- 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:
James Tabor 2008-08-05 04:05:28 +00:00
parent 0fd48bec89
commit 1dbbf02a7e

View file

@ -711,6 +711,10 @@ NtUserToUnicodeEx(
DPRINT1( "Couldn't copy key state from caller.\n" );
RETURN(0);
}
/* Virtual code is correct and key is pressed currently? */
if (wVirtKey < 0x100 && KeyStateBuf[wVirtKey] & KS_DOWN_BIT)
{
OutPwszBuff = ExAllocatePoolWithTag(NonPagedPool,sizeof(WCHAR) * cchBuff, TAG_STRING);
if( !OutPwszBuff )
{
@ -730,6 +734,9 @@ NtUserToUnicodeEx(
MmCopyToCaller(pwszBuff,OutPwszBuff,sizeof(WCHAR)*cchBuff);
ExFreePool(OutPwszBuff);
}
else
ret = 0;
RETURN(ret);