Hans Leidekker : user32: By default, return all zeroes in the first half of the keyboard layout name.

Alexandre Julliard julliard at winehq.org
Tue Apr 14 16:00:02 CDT 2009


Module: wine
Branch: master
Commit: ed70c76adde1a41a71c3eb3129a05fc39ccf1918
URL:    http://source.winehq.org/git/wine.git/?a=commit;h=ed70c76adde1a41a71c3eb3129a05fc39ccf1918

Author: Hans Leidekker <hans at codeweavers.com>
Date:   Tue Apr 14 12:34:37 2009 +0200

user32: By default, return all zeroes in the first half of the keyboard layout name.

---

 dlls/user32/tests/input.c   |   14 ++++++++++++++
 dlls/winex11.drv/keyboard.c |    2 --
 2 files changed, 14 insertions(+), 2 deletions(-)

diff --git a/dlls/user32/tests/input.c b/dlls/user32/tests/input.c
index e4ad1de..4f3bd56 100644
--- a/dlls/user32/tests/input.c
+++ b/dlls/user32/tests/input.c
@@ -1284,6 +1284,19 @@ static void test_get_async_key_state(void)
     ok(0 == GetAsyncKeyState(-1000000), "GetAsyncKeyState did not return 0\n");
 }
 
+static void test_keyboard_layout_name(void)
+{
+    BOOL ret;
+    char klid[KL_NAMELENGTH];
+
+    if (GetKeyboardLayout(0) != (HKL)(ULONG_PTR)0x04090409) return;
+
+    klid[0] = 0;
+    ret = GetKeyboardLayoutNameA(klid);
+    ok(ret, "GetKeyboardLayoutNameA failed %u\n", GetLastError());
+    ok(!strcmp(klid, "00000409"), "expected 00000409, got %s\n", klid);
+}
+
 START_TEST(input)
 {
     init_function_pointers();
@@ -1300,6 +1313,7 @@ START_TEST(input)
     test_key_map();
     test_ToUnicode();
     test_get_async_key_state();
+    test_keyboard_layout_name();
 
     if(pGetMouseMovePointsEx)
         test_GetMouseMovePointsEx();
diff --git a/dlls/winex11.drv/keyboard.c b/dlls/winex11.drv/keyboard.c
index 542e5a8..f7dad12 100644
--- a/dlls/winex11.drv/keyboard.c
+++ b/dlls/winex11.drv/keyboard.c
@@ -1914,8 +1914,6 @@ BOOL CDECL X11DRV_GetKeyboardLayoutName(LPWSTR name)
     langid = PRIMARYLANGID(LANGIDFROMLCID(layout));
     if (langid == LANG_CHINESE || langid == LANG_JAPANESE || langid == LANG_KOREAN)
         layout |= 0xe001 << 16; /* FIXME */
-    else
-        layout |= layout << 16;
 
     sprintfW(name, formatW, layout);
     TRACE("returning %s\n", debugstr_w(name));




More information about the wine-cvs mailing list