Rémi Bernon : user32: Read "Layout Id" from registry in GetKeyboardLayoutList.

Alexandre Julliard julliard at winehq.org
Fri Apr 30 16:03:27 CDT 2021


Module: wine
Branch: master
Commit: 80985b7eec645ee4ae2494909ad2503d2775d20d
URL:    https://source.winehq.org/git/wine.git/?a=commit;h=80985b7eec645ee4ae2494909ad2503d2775d20d

Author: Rémi Bernon <rbernon at codeweavers.com>
Date:   Fri Apr 30 10:43:59 2021 +0200

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

Signed-off-by: Rémi Bernon <rbernon at codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard at winehq.org>

---

 dlls/user32/input.c | 8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)

diff --git a/dlls/user32/input.c b/dlls/user32/input.c
index 4895a007500..97be83369d9 100644
--- a/dlls/user32/input.c
+++ b/dlls/user32/input.c
@@ -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++;




More information about the wine-cvs mailing list