user32: Duplicate klid to HKL high word in LoadKeyboardLayoutW.

When high word is 0, and unless it has an explicit layout id.

Signed-off-by: Rémi Bernon <rbernon@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
Rémi Bernon 2021-05-14 13:40:07 +02:00 committed by Alexandre Julliard
parent 702b52fe13
commit 50ca64fcdf
1 changed files with 2 additions and 1 deletions

View File

@ -1548,7 +1548,8 @@ HKL WINAPI LoadKeyboardLayoutW( const WCHAR *name, UINT flags )
FIXME_(keyboard)( "name %s, flags %x, semi-stub!\n", debugstr_w( name ), flags );
tmp = wcstoul( name, NULL, 16 );
layout = UlongToHandle( tmp );
if (HIWORD( tmp )) layout = UlongToHandle( tmp );
else layout = UlongToHandle( MAKELONG( LOWORD( tmp ), LOWORD( tmp ) ) );
wcscpy( layout_path, L"System\\CurrentControlSet\\Control\\Keyboard Layouts\\" );
wcscat( layout_path, name );