[ros-diffs] [dgorbachev] 26940: - Do not look outside VkToWcharTable[]. - Check for WCH_NONE.

dgorbachev at svn.reactos.org dgorbachev at svn.reactos.org
Fri Jun 8 17:29:04 CEST 2007


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/ntuser/keyboard.c?rev=26940&r1=26939&r2=26940&view=diff
==============================================================================
--- 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;




More information about the Ros-diffs mailing list