Author: dgorbachev
Date: Wed May 30 13:35:41 2007
New Revision: 26940
URL:
http://svn.reactos.org/svn/reactos?rev=26940&view=rev
Log:
- Do not look outside VkToWcharTable[].
- Check for WCH_NONE.
Modified:
trunk/reactos/subsystems/win32/win32k/ntuser/keyboard.c
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 Wed May 30 13:35:41 2007
@@ -248,6 +248,7 @@
{
return FALSE;
}
+
for (nMod = 0; keyLayout->pVkToWcharTable[nMod].nModifications; nMod++)
{
vtwTbl = &keyLayout->pVkToWcharTable[nMod];
@@ -263,13 +264,12 @@
if( CapsMod >= keyLayout->pVkToWcharTable[nMod].nModifications )
{
- DWORD MaxBit = 1;
- while( MaxBit <
- keyLayout->pVkToWcharTable[nMod].nModifications )
- MaxBit <<= 1;
-
- CapsMod &= MaxBit - 1; /* Guarantee that CapsMod lies
- in bounds. */
+ return FALSE;
+ }
+
+ if( vkPtr->wch[CapsMod] == WCH_NONE )
+ {
+ return FALSE;
}
*pbDead = vkPtr->wch[CapsMod] == WCH_DEAD;