Author: fireball
Date: Thu Nov 1 20:06:49 2007
New Revision: 30046
URL:
http://svn.reactos.org/svn/reactos?rev=30046&view=rev
Log:
- Fix a bug with incorrect handling of the keyboard layout pointer (which is HKL in fact
in our current implementation).
- Change the prototype to better match actual parameters usage.
See issue #2787 for more details.
Modified:
trunk/reactos/include/reactos/win32k/ntuser.h
trunk/reactos/subsystems/win32/win32k/include/input.h
trunk/reactos/subsystems/win32/win32k/ntuser/kbdlayout.c
trunk/reactos/subsystems/win32/win32k/ntuser/keyboard.c
Modified: trunk/reactos/include/reactos/win32k/ntuser.h
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/include/reactos/win32k/ntu…
==============================================================================
--- trunk/reactos/include/reactos/win32k/ntuser.h (original)
+++ trunk/reactos/include/reactos/win32k/ntuser.h Thu Nov 1 20:06:49 2007
@@ -2356,8 +2356,8 @@
DWORD
NTAPI
NtUserVkKeyScanEx(
- DWORD Unknown0,
- DWORD Unknown1,
+ WCHAR wChar,
+ ULONG_PTR KeyboardLayout,
DWORD Unknown2);
DWORD
Modified: trunk/reactos/subsystems/win32/win32k/include/input.h
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/subsystems/win32/win32k/in…
==============================================================================
--- trunk/reactos/subsystems/win32/win32k/include/input.h (original)
+++ trunk/reactos/subsystems/win32/win32k/include/input.h Thu Nov 1 20:06:49 2007
@@ -32,6 +32,7 @@
BOOL FASTCALL IntKeyboardInput(KEYBDINPUT *ki);
BOOL UserInitDefaultKeyboardLayout();
+PKBL UserHklToKbl(HKL hKl);
#define ThreadHasInputAccess(W32Thread) \
(TRUE)
Modified: trunk/reactos/subsystems/win32/win32k/ntuser/kbdlayout.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/subsystems/win32/win32k/nt…
==============================================================================
--- trunk/reactos/subsystems/win32/win32k/ntuser/kbdlayout.c (original)
+++ trunk/reactos/subsystems/win32/win32k/ntuser/kbdlayout.c Thu Nov 1 20:06:49 2007
@@ -308,7 +308,7 @@
return pKbl;
}
-static PKBL UserHklToKbl(HKL hKl)
+PKBL UserHklToKbl(HKL hKl)
{
PKBL pKbl = KBLList;
do
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 Thu Nov 1 20:06:49 2007
@@ -1007,12 +1007,11 @@
DWORD
STDCALL
NtUserVkKeyScanEx(
- DWORD wChar,
- DWORD KeyboardLayout,
+ WCHAR wChar,
+ ULONG_PTR KeyboardLayout,
DWORD Unknown2)
{
-/* FAXME: currently, this routine doesnt seem to need any locking */
-
+/* FIXME: currently, this routine doesnt seem to need any locking */
PKBDTABLES KeyLayout;
PVK_TO_WCHAR_TABLE vtwTbl;
PVK_TO_WCHARS10 vkPtr;
@@ -1020,9 +1019,11 @@
int nMod;
DWORD CapsMod = 0, CapsState = 0;
+ DPRINT("NtUserVkKeyScanEx() wChar %d, KbdLayout 0x%p\n", wChar,
KeyboardLayout);
+
if(!KeyboardLayout)
return -1;
- KeyLayout = (PKBDTABLES) KeyboardLayout;
+ KeyLayout = UserHklToKbl((HKL)KeyboardLayout)->KBTables;
for (nMod = 0; KeyLayout->pVkToWcharTable[nMod].nModifications; nMod++)
{