Author: greatlrd
Date: Sun Feb 4 18:54:14 2007
New Revision: 25710
URL:
http://svn.reactos.org/svn/reactos?rev=25710&view=rev
Log:
implement NtUserGetKeyboardLayoutName tested in 0.3.1 and works fine
Modified:
trunk/reactos/subsystems/win32/win32k/ntuser/keyboard.c
Modified: trunk/reactos/subsystems/win32/win32k/ntuser/keyboard.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/subsystems/win32/win32k/nt…
==============================================================================
--- trunk/reactos/subsystems/win32/win32k/ntuser/keyboard.c (original)
+++ trunk/reactos/subsystems/win32/win32k/ntuser/keyboard.c Sun Feb 4 18:54:14 2007
@@ -1263,10 +1263,38 @@
NtUserGetKeyboardLayoutName(
LPWSTR lpszName)
{
- UNIMPLEMENTED
-
- return 0;
-}
+ BOOL ret = FALSE;
+ LCID LocaleId;
+ WCHAR LocaleBuffer[16];
+ NTSTATUS Status;
+
+
+ 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(