user32: Read "Layout Id" from registry in GetKeyboardLayoutList.

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-04-30 10:43:59 +02:00 committed by Alexandre Julliard
parent 66c3181444
commit 80985b7eec
1 changed files with 6 additions and 2 deletions

View File

@ -1336,8 +1336,8 @@ BOOL WINAPI BlockInput(BOOL fBlockIt)
*/
UINT WINAPI GetKeyboardLayoutList( INT size, HKL *layouts )
{
WCHAR klid[KL_NAMELENGTH];
UINT count, tmp, i = 0;
WCHAR klid[KL_NAMELENGTH], value[5];
DWORD value_size, count, tmp, i = 0;
HKEY hkey;
HKL layout;
@ -1360,6 +1360,10 @@ UINT WINAPI GetKeyboardLayoutList( INT size, HKL *layouts )
while (!RegEnumKeyW( hkey, i++, klid, ARRAY_SIZE(klid) ))
{
tmp = wcstoul( klid, NULL, 16 );
value_size = sizeof(value);
if (!RegGetValueW( hkey, klid, L"Layout Id", RRF_RT_REG_SZ, NULL, (void *)&value, &value_size ))
tmp = MAKELONG( LOWORD( tmp ), 0xf000 | (wcstoul( value, NULL, 16 ) & 0xfff) );
if (layout == UlongToHandle( tmp )) continue;
count++;