win32u: Keep the current user locale when enumerating layouts.

The low word of the enumerated HKL is the desired user locale, the high
word is either the keyboard layout LANGID, or the keyboard "Layout Id"
for additional layouts with the same LANGID.
This commit is contained in:
Rémi Bernon 2023-03-03 17:06:24 +01:00 committed by Alexandre Julliard
parent ab80ee17fa
commit d12dda395f

View file

@ -1273,10 +1273,10 @@ UINT WINAPI NtUserGetKeyboardLayoutList( INT size, HKL *layouts )
tmp = wcstoul( key_info->Name, NULL, 16 );
if (query_reg_ascii_value( subkey, "Layout Id", value_info, sizeof(buffer) ) &&
value_info->Type == REG_SZ)
tmp = MAKELONG( LOWORD( tmp ),
0xf000 | (wcstoul( (const WCHAR *)value_info->Data, NULL, 16 ) & 0xfff) );
tmp = 0xf000 | (wcstoul( (const WCHAR *)value_info->Data, NULL, 16 ) & 0xfff);
NtClose( subkey );
tmp = MAKELONG( LOWORD( layout ), LOWORD( tmp ) );
if (layout == UlongToHandle( tmp )) continue;
count++;