mirror of
https://github.com/reactos/reactos.git
synced 2024-10-01 06:57:08 +00:00
[WIN32K]
- Check the supplied scancode instead of the state buffer whether a key is up - Fixes the calculator keyboard input regression introduced with r35117 - Ref: http://www.osronline.com/ddkx/w98ddk/keycnt_4ilz.htm and wine implementation See issue #3727 for more details. svn path=/trunk/; revision=47138
This commit is contained in:
parent
1bd675f802
commit
428dff1a79
|
@ -43,6 +43,8 @@
|
|||
#define KS_DOWN_MASK 0xc0
|
||||
#define KS_DOWN_BIT 0x80
|
||||
#define KS_LOCK_BIT 0x01
|
||||
/* Scan Codes */
|
||||
#define SC_KEY_UP 0x8000
|
||||
/* lParam bits */
|
||||
#define LP_EXT_BIT (1<<24)
|
||||
/* From kbdxx.c -- Key changes with numlock */
|
||||
|
@ -720,6 +722,11 @@ NtUserToUnicodeEx(
|
|||
DPRINT("Enter NtUserSetKeyboardState\n");
|
||||
UserEnterShared();//fixme: this syscall doesnt seem to need any locking...
|
||||
|
||||
/* Key up? */
|
||||
if (wScanCode & SC_KEY_UP)
|
||||
{
|
||||
RETURN(0);
|
||||
}
|
||||
|
||||
if( !NT_SUCCESS(MmCopyFromCaller(KeyStateBuf,
|
||||
lpKeyState,
|
||||
|
@ -729,8 +736,8 @@ NtUserToUnicodeEx(
|
|||
RETURN(0);
|
||||
}
|
||||
|
||||
/* Virtual code is correct and key is pressed currently? */
|
||||
if (wVirtKey < 0x100 && KeyStateBuf[wVirtKey] & KS_DOWN_BIT)
|
||||
/* Virtual code is correct? */
|
||||
if (wVirtKey < 0x100)
|
||||
{
|
||||
OutPwszBuff = ExAllocatePoolWithTag(NonPagedPool,sizeof(WCHAR) * cchBuff, TAG_STRING);
|
||||
if( !OutPwszBuff )
|
||||
|
@ -752,8 +759,6 @@ NtUserToUnicodeEx(
|
|||
MmCopyToCaller(pwszBuff,OutPwszBuff,sizeof(WCHAR)*cchBuff);
|
||||
ExFreePoolWithTag(OutPwszBuff, TAG_STRING);
|
||||
}
|
||||
else
|
||||
ret = 0;
|
||||
|
||||
RETURN(ret);
|
||||
|
||||
|
|
Loading…
Reference in a new issue