mirror of
https://github.com/reactos/reactos.git
synced 2024-07-31 00:28:56 +00:00
- Patch by Yuriy Sidorov <jura at cp-lab.com> , NtUserToUnicodeEx should return zero if key in lpKeyState array is not pressed.
svn path=/trunk/; revision=35117
This commit is contained in:
parent
0fd48bec89
commit
1dbbf02a7e
|
@ -711,25 +711,32 @@ NtUserToUnicodeEx(
|
|||
DPRINT1( "Couldn't copy key state from caller.\n" );
|
||||
RETURN(0);
|
||||
}
|
||||
OutPwszBuff = ExAllocatePoolWithTag(NonPagedPool,sizeof(WCHAR) * cchBuff, TAG_STRING);
|
||||
if( !OutPwszBuff )
|
||||
|
||||
/* Virtual code is correct and key is pressed currently? */
|
||||
if (wVirtKey < 0x100 && KeyStateBuf[wVirtKey] & KS_DOWN_BIT)
|
||||
{
|
||||
DPRINT1( "ExAllocatePool(%d) failed\n", sizeof(WCHAR) * cchBuff);
|
||||
RETURN(0);
|
||||
OutPwszBuff = ExAllocatePoolWithTag(NonPagedPool,sizeof(WCHAR) * cchBuff, TAG_STRING);
|
||||
if( !OutPwszBuff )
|
||||
{
|
||||
DPRINT1( "ExAllocatePool(%d) failed\n", sizeof(WCHAR) * cchBuff);
|
||||
RETURN(0);
|
||||
}
|
||||
RtlZeroMemory( OutPwszBuff, sizeof( WCHAR ) * cchBuff );
|
||||
|
||||
ret = ToUnicodeInner( wVirtKey,
|
||||
wScanCode,
|
||||
KeyStateBuf,
|
||||
OutPwszBuff,
|
||||
cchBuff,
|
||||
wFlags,
|
||||
PsGetCurrentThreadWin32Thread() ?
|
||||
PsGetCurrentThreadWin32Thread()->KeyboardLayout->KBTables : 0 );
|
||||
|
||||
MmCopyToCaller(pwszBuff,OutPwszBuff,sizeof(WCHAR)*cchBuff);
|
||||
ExFreePool(OutPwszBuff);
|
||||
}
|
||||
RtlZeroMemory( OutPwszBuff, sizeof( WCHAR ) * cchBuff );
|
||||
|
||||
ret = ToUnicodeInner( wVirtKey,
|
||||
wScanCode,
|
||||
KeyStateBuf,
|
||||
OutPwszBuff,
|
||||
cchBuff,
|
||||
wFlags,
|
||||
PsGetCurrentThreadWin32Thread() ?
|
||||
PsGetCurrentThreadWin32Thread()->KeyboardLayout->KBTables : 0 );
|
||||
|
||||
MmCopyToCaller(pwszBuff,OutPwszBuff,sizeof(WCHAR)*cchBuff);
|
||||
ExFreePool(OutPwszBuff);
|
||||
else
|
||||
ret = 0;
|
||||
|
||||
RETURN(ret);
|
||||
|
||||
|
|
Loading…
Reference in a new issue