merge down 25710 change from trunk : implement NtUserGetKeyboardLayoutName tested...
authorMagnus Olsen <magnus@greatlord.com>
Sun, 4 Feb 2007 16:01:25 +0000 (16:01 +0000)
committerMagnus Olsen <magnus@greatlord.com>
Sun, 4 Feb 2007 16:01:25 +0000 (16:01 +0000)
svn path=/branches/ros-branch-0_3_1/; revision=25711

reactos/subsystems/win32/win32k/ntuser/keyboard.c

index e8ea268..dcc915f 100644 (file)
@@ -1263,11 +1263,39 @@ STDCALL
 NtUserGetKeyboardLayoutName(
    LPWSTR lpszName)
 {
 NtUserGetKeyboardLayoutName(
    LPWSTR lpszName)
 {
-   UNIMPLEMENTED
+  BOOL ret = FALSE;
+  LCID LocaleId;
+  WCHAR LocaleBuffer[16];
+  NTSTATUS Status;
 
 
-   return 0;
+
+  UserEnterExclusive();
+
+   DPRINT("Enter NtUserGetKeyboardLayoutName\n");
+
+   Status = ZwQueryDefaultLocale(FALSE, &LocaleId);
+   if (NT_SUCCESS(Status))
+   {
+        swprintf(LocaleBuffer, L"%08lx", LocaleId);
+        DPRINT("LocaleId : %08lx\n",LocaleId);
+        _SEH_TRY
+        {
+           ProbeForWrite(lpszName, 16, 1);
+           RtlCopyMemory(lpszName,LocaleBuffer,16);
+            ret = TRUE;
+        }
+        _SEH_HANDLE
+        {
+            SetLastNtError(_SEH_GetExceptionCode());
+            ret = FALSE;
+        }
+        _SEH_END;
+   }
+   UserLeave();
+   return ret;
 }
 
 }
 
+
 HKL FASTCALL
 UserGetKeyboardLayout(
    DWORD dwThreadId)
 HKL FASTCALL
 UserGetKeyboardLayout(
    DWORD dwThreadId)