From: Vijay Kiran Kamuju infyquest@gmail.com
Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=28170 --- dlls/user32/input.c | 13 +++++++++++++ dlls/user32/tests/input.c | 24 ++++++++++++++++++++++++ dlls/user32/user32.spec | 2 +- 3 files changed, 38 insertions(+), 1 deletion(-)
diff --git a/dlls/user32/input.c b/dlls/user32/input.c index 1fff29c7f87..2d2340b25e1 100644 --- a/dlls/user32/input.c +++ b/dlls/user32/input.c @@ -476,6 +476,19 @@ HKL WINAPI LoadKeyboardLayoutA(LPCSTR pwszKLID, UINT Flags) }
+/*********************************************************************** + * LoadKeyboardLayoutEx (USER32.@) + */ +HKL WINAPI LoadKeyboardLayoutEx( HKL layout, const WCHAR *name, UINT flags ) +{ + FIXME_(keyboard)( "layout %p, name %s, flags %x, semi-stub!\n", layout, debugstr_w( name ), flags ); + + if (!layout) + return NULL; + + return LoadKeyboardLayoutW(name, flags); +} + /*********************************************************************** * UnloadKeyboardLayout (USER32.@) */ diff --git a/dlls/user32/tests/input.c b/dlls/user32/tests/input.c index a78ea3b7c43..5157d251bd6 100644 --- a/dlls/user32/tests/input.c +++ b/dlls/user32/tests/input.c @@ -376,6 +376,7 @@ static UINT (WINAPI *pGetRawInputDeviceList) (PRAWINPUTDEVICELIST, PUINT, UINT); static UINT (WINAPI *pGetRawInputDeviceInfoW) (HANDLE, UINT, void *, UINT *); static UINT (WINAPI *pGetRawInputDeviceInfoA) (HANDLE, UINT, void *, UINT *); static BOOL (WINAPI *pIsWow64Process)(HANDLE, PBOOL); +static HKL (WINAPI *pLoadKeyboardLayoutEx)(HKL, const WCHAR *, UINT);
/**********************adapted from input.c **********************************/
@@ -401,6 +402,7 @@ static void init_function_pointers(void) GET_PROC(GetRawInputDeviceList); GET_PROC(GetRawInputDeviceInfoW); GET_PROC(GetRawInputDeviceInfoA); + GET_PROC(LoadKeyboardLayoutEx);
hdll = GetModuleHandleA("kernel32"); GET_PROC(IsWow64Process); @@ -5582,6 +5584,27 @@ static void test_keyboard_layout(void) } }
+static void test_keyboard_layoutex(void) +{ + HKL oldhkl, newhkl; + WCHAR oldlayoutname[64], layoutname[64]; + const WCHAR *newlayoutname = L"00000429"; + + oldhkl = GetKeyboardLayout(0); + GetKeyboardLayoutNameW(oldlayoutname); + + newhkl = pLoadKeyboardLayoutEx(NULL, newlayoutname, 0); + ok(!newhkl, "Got unexpected hkl.\n"); + + newhkl = pLoadKeyboardLayoutEx(oldhkl, newlayoutname, 0); + GetKeyboardLayoutNameW(layoutname); + ok(!wcscmp(newlayoutname, layoutname), "Expected : %s, Got : %s.\n", debugstr_w(newlayoutname), debugstr_w(layoutname)); + + oldhkl = pLoadKeyboardLayoutEx(newhkl, oldlayoutname, 0); + GetKeyboardLayoutNameW(layoutname); + ok(!wcscmp(oldlayoutname, layoutname), "Expected : %s, Got : %s.\n", debugstr_w(oldlayoutname), debugstr_w(layoutname)); +} + START_TEST(input) { char **argv; @@ -5614,6 +5637,7 @@ START_TEST(input) test_ToAscii(); test_get_async_key_state(); test_keyboard_layout(); + test_keyboard_layoutex(); test_keyboard_layout_name(); test_ActivateKeyboardLayout( argv ); test_key_names(); diff --git a/dlls/user32/user32.spec b/dlls/user32/user32.spec index 14246b3e3e0..21fa904082c 100644 --- a/dlls/user32/user32.spec +++ b/dlls/user32/user32.spec @@ -507,7 +507,7 @@ @ stdcall LoadImageA(long str long long long long) @ stdcall LoadImageW(long wstr long long long long) @ stdcall LoadKeyboardLayoutA(str long) -# @ stub LoadKeyboardLayoutEx +@ stdcall LoadKeyboardLayoutEx(long wstr long) @ stdcall LoadKeyboardLayoutW(wstr long) @ stdcall LoadLocalFonts() @ stdcall LoadMenuA(long str)