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

Matteo Bruni matteo.mystral at gmail.com
Wed Aug 10 17:58:41 CDT 2016


2016-08-06 1:09 GMT+02:00 Nils Kuhnhenn <kuhnhenn.nils at gmail.com>:
> 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.
> ---
>  dlls/winex11.drv/keyboard.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/dlls/winex11.drv/keyboard.c b/dlls/winex11.drv/keyboard.c
> index 47a9872..6f6eda8 100644
> --- a/dlls/winex11.drv/keyboard.c
> +++ b/dlls/winex11.drv/keyboard.c
> @@ -1947,9 +1947,9 @@ HKL CDECL X11DRV_GetKeyboardLayout(DWORD dwThreadid)
>   */
>  HKL CDECL X11DRV_LoadKeyboardLayout(LPCWSTR name, UINT flags)
>  {
> -    FIXME("%s, %04x: stub!\n", debugstr_w(name), flags);
> +    FIXME("%s, %04x: stub! Returning default language.\n", debugstr_w(name), flags);
>      SetLastError(ERROR_CALL_NOT_IMPLEMENTED);
> -    return 0;
> +    return get_locale_kbd_layout();
>  }

I'm not exactly an expert in the area but I think your patch makes
sense. It's missing your sign-off though, please resend the patch with
it.
BTW, you can follow the status of your patch on
http://source.winehq.org/patches/.



More information about the wine-devel mailing list