Author: tkreuzer
Date: Sat Nov 10 07:53:02 2007
New Revision: 30318
URL:
http://svn.reactos.org/svn/reactos?rev=30318&view=rev
Log:
fix bug in NtUserToUnicodeEx. It still ignores the hkl parameter.
NtUserVkScanKeyEx: use HKL instead of ULONG_PTR.
See issue #2557 for more details.
Modified:
trunk/reactos/include/reactos/win32k/ntuser.h
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 Sat Nov 10 07:53:02 2007
@@ -2357,7 +2357,7 @@
NTAPI
NtUserVkKeyScanEx(
WCHAR wChar,
- ULONG_PTR KeyboardLayout,
+ HKL KeyboardLayout,
DWORD Unknown2);
DWORD
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 Sat Nov 10 07:53:02 2007
@@ -196,7 +196,15 @@
KS_DOWN_BIT)
ModBits |= GetShiftBit( pkKT, VK_SHIFT );
+ if (KeysSet( pkKT, KeyState, VK_SHIFT, 0 ) &
+ KS_DOWN_BIT)
+ ModBits |= GetShiftBit( pkKT, VK_SHIFT );
+
if (KeysSet( pkKT, KeyState, VK_LCONTROL, VK_RCONTROL ) &
+ KS_DOWN_BIT )
+ ModBits |= GetShiftBit( pkKT, VK_CONTROL );
+
+ if (KeysSet( pkKT, KeyState, VK_CONTROL, 0 ) &
KS_DOWN_BIT )
ModBits |= GetShiftBit( pkKT, VK_CONTROL );
@@ -406,36 +414,6 @@
END_CLEANUP;
}
-
-
-int STDCALL ToUnicodeEx( UINT wVirtKey,
- UINT wScanCode,
- PBYTE lpKeyState,
- LPWSTR pwszBuff,
- int cchBuff,
- UINT wFlags,
- HKL dwhkl )
-{
- int ToUnicodeResult = 0;
-
- if (0 == (lpKeyState[wVirtKey] & KS_DOWN_BIT))
- {
- ToUnicodeResult = 0;
- }
- else
- {
- ToUnicodeResult = ToUnicodeInner( wVirtKey,
- wScanCode,
- lpKeyState,
- pwszBuff,
- cchBuff,
- wFlags,
- PsGetCurrentThreadWin32Thread() ?
-
PsGetCurrentThreadWin32Thread()->KeyboardLayout->KBTables : 0 );
- }
-
- return ToUnicodeResult;
-}
BOOL FASTCALL
@@ -741,13 +719,14 @@
}
RtlZeroMemory( OutPwszBuff, sizeof( WCHAR ) * cchBuff );
- ret = ToUnicodeEx( wVirtKey,
- wScanCode,
- KeyStateBuf,
- OutPwszBuff,
- cchBuff,
- wFlags,
- dwhkl );
+ ret = ToUnicodeInner( wVirtKey,
+ wScanCode,
+ KeyStateBuf,
+ OutPwszBuff,
+ cchBuff,
+ wFlags,
+ PsGetCurrentThreadWin32Thread() ?
+
PsGetCurrentThreadWin32Thread()->KeyboardLayout->KBTables : 0 );
MmCopyToCaller(pwszBuff,OutPwszBuff,sizeof(WCHAR)*cchBuff);
ExFreePool(OutPwszBuff);
@@ -1008,7 +987,7 @@
STDCALL
NtUserVkKeyScanEx(
WCHAR wChar,
- ULONG_PTR KeyboardLayout,
+ HKL KeyboardLayout,
DWORD Unknown2)
{
/* FIXME: currently, this routine doesnt seem to need any locking */
@@ -1023,7 +1002,7 @@
if(!KeyboardLayout)
return -1;
- KeyLayout = UserHklToKbl((HKL)KeyboardLayout)->KBTables;
+ KeyLayout = UserHklToKbl(KeyboardLayout)->KBTables;
for (nMod = 0; KeyLayout->pVkToWcharTable[nMod].nModifications; nMod++)
{