[PATCH] winex11.drv: LoadKeyboardLayout - return default locale in stub instead of 0

Nils Kuhnhenn kuhnhenn.nils at gmail.com
Thu Aug 11 10:28:17 CDT 2016


This matches the behavior of the original more closely, which returns
the default locale in case of any error.

See the section "Return value" here:
https://msdn.microsoft.com/en-us/library/windows/desktop/ms646305(v=vs.85).aspx

Guild Wars 2 will repeat the call to "LoadKeyboardLayout" every frame
if 0 is returned, followed by a call to "MapVirtualKeyEx" with the returned
(unsupported) layout.

Signed-off-by: Nils Kuhnhenn <kuhnhenn.nils at gmail.com>
---
 dlls/winex11.drv/keyboard.c | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)

diff --git a/dlls/winex11.drv/keyboard.c b/dlls/winex11.drv/keyboard.c
index 47a9872..adb028a 100644
--- a/dlls/winex11.drv/keyboard.c
+++ b/dlls/winex11.drv/keyboard.c
@@ -1947,9 +1947,8 @@ HKL CDECL X11DRV_GetKeyboardLayout(DWORD dwThreadid)
  */
 HKL CDECL X11DRV_LoadKeyboardLayout(LPCWSTR name, UINT flags)
 {
-    FIXME("%s, %04x: stub!\n", debugstr_w(name), flags);
-    SetLastError(ERROR_CALL_NOT_IMPLEMENTED);
-    return 0;
+    FIXME("%s, %04x: semi-stub! Returning default layout.\n", debugstr_w(name), flags);
+    return get_locale_kbd_layout();
 }
 
 
-- 
2.9.2




More information about the wine-patches mailing list