[PATCH v5 0/3] MR5361: user32: Add LoadKeyboardLayoutEx stub.
Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=28170 -- v5: Apply 1 suggestion(s) to 1 file(s) https://gitlab.winehq.org/wine/wine/-/merge_requests/5361
From: Vijay Kiran Kamuju <infyquest(a)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) -- GitLab https://gitlab.winehq.org/wine/wine/-/merge_requests/5361
From: Rémi Bernon <rbernon(a)codeweavers.com> --- dlls/user32/tests/input.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dlls/user32/tests/input.c b/dlls/user32/tests/input.c index 5157d251bd6..58ed8e40ee4 100644 --- a/dlls/user32/tests/input.c +++ b/dlls/user32/tests/input.c @@ -5584,7 +5584,7 @@ static void test_keyboard_layout(void) } } -static void test_keyboard_layoutex(void) +static void test_LoadKeyboardLayoutEx(void) { HKL oldhkl, newhkl; WCHAR oldlayoutname[64], layoutname[64]; -- GitLab https://gitlab.winehq.org/wine/wine/-/merge_requests/5361
From: Rémi Bernon <rbernon(a)codeweavers.com> --- dlls/user32/input.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/dlls/user32/input.c b/dlls/user32/input.c index 2d2340b25e1..00337aa72b7 100644 --- a/dlls/user32/input.c +++ b/dlls/user32/input.c @@ -483,10 +483,8 @@ 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); + if (!layout) return NULL; + return LoadKeyboardLayoutW( name, flags ); } /*********************************************************************** -- GitLab https://gitlab.winehq.org/wine/wine/-/merge_requests/5361
Hi, It looks like your patch introduced the new failures shown below. Please investigate and fix them before resubmitting your patch. If they are not new, fixing them anyway would help a lot. Otherwise please ask for the known failures list to be updated. The full results can be found at: https://testbot.winehq.org/JobDetails.pl?Key=144316 Your paranoid android. === build (build log) === /home/winetest/tools/testbot/var/wine-exe32/../wine/dlls/user32/tests/input.c:5640: undefined reference to `test_keyboard_layoutex' collect2: error: ld returned 1 exit status Task: The exe32 Wine build failed === debian11 (build log) === /home/winetest/tools/testbot/var/wine-win32/../wine/dlls/user32/tests/input.c:5640: undefined reference to `test_keyboard_layoutex' /home/winetest/tools/testbot/var/wine-win32/../wine/dlls/user32/tests/input.c:5640: undefined reference to `test_keyboard_layoutex' collect2: error: ld returned 1 exit status collect2: error: ld returned 1 exit status Task: The win32 Wine build failed === debian11b (build log) === /home/winetest/tools/testbot/var/wine-wow64/../wine/dlls/user32/tests/input.c:5640: undefined reference to `test_keyboard_layoutex' /home/winetest/tools/testbot/var/wine-wow64/../wine/dlls/user32/tests/input.c:5640: undefined reference to `test_keyboard_layoutex' collect2: error: ld returned 1 exit status collect2: error: ld returned 1 exit status Task: The wow64 Wine build failed
participants (4)
-
Marvin -
Rémi Bernon -
Vijay Kiran Kamuju -
Vijay Kiran Kamuju (@infyquest)