Author: khornicek
Date: Wed Oct 22 20:05:32 2014
New Revision: 64908

URL: http://svn.reactos.org/svn/reactos?rev=64908&view=rev
Log:
[I8042PRT]
- check the right buffer's length
[WIN32K]
- simplify IntKeyboardUpdateLeds a bit and mind previous mode
- fixes keyboard indicators
CORE-8547

Modified:
    trunk/reactos/drivers/input/i8042prt/keyboard.c
    trunk/reactos/win32ss/user/ntuser/keyboard.c

Modified: trunk/reactos/drivers/input/i8042prt/keyboard.c
URL: 
http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/input/i8042prt/keyboard.c?rev=64908&r1=64907&r2=64908&view=diff
==============================================================================
--- trunk/reactos/drivers/input/i8042prt/keyboard.c     [iso-8859-1] (original)
+++ trunk/reactos/drivers/input/i8042prt/keyboard.c     [iso-8859-1] Wed Oct 22 
20:05:32 2014
@@ -694,7 +694,7 @@
                {
                        TRACE_(I8042PRT, "IRP_MJ_INTERNAL_DEVICE_CONTROL / 
IOCTL_KEYBOARD_QUERY_INDICATORS\n");
 
-                       if (Stack->Parameters.DeviceIoControl.InputBufferLength 
< sizeof(KEYBOARD_INDICATOR_PARAMETERS))
+                       if 
(Stack->Parameters.DeviceIoControl.OutputBufferLength < 
sizeof(KEYBOARD_INDICATOR_PARAMETERS))
                        {
                                Status = STATUS_BUFFER_TOO_SMALL;
                        }

Modified: trunk/reactos/win32ss/user/ntuser/keyboard.c
URL: 
http://svn.reactos.org/svn/reactos/trunk/reactos/win32ss/user/ntuser/keyboard.c?rev=64908&r1=64907&r2=64908&view=diff
==============================================================================
--- trunk/reactos/win32ss/user/ntuser/keyboard.c        [iso-8859-1] (original)
+++ trunk/reactos/win32ss/user/ntuser/keyboard.c        [iso-8859-1] Wed Oct 22 
20:05:32 2014
@@ -61,7 +61,7 @@
 
     while (pRet)
     {
-        Status = NtDeviceIoControlFile(hKeyboardDevice,
+        Status = ZwDeviceIoControlFile(hKeyboardDevice,
                                        NULL,
                                        NULL,
                                        NULL,
@@ -104,8 +104,7 @@
 NTSTATUS APIENTRY
 IntKeyboardUpdateLeds(HANDLE hKeyboardDevice,
                       WORD wVk,
-                      WORD wScanCode,
-                      BOOL bEnabled)
+                      WORD wScanCode)
 {
     NTSTATUS Status;
     UINT i;
@@ -133,13 +132,10 @@
 
     if (LedFlag)
     {
-        if (bEnabled)
-            gIndicators.LedFlags |= LedFlag;
-        else
-            gIndicators.LedFlags = ~LedFlag;
+        gIndicators.LedFlags ^= LedFlag;
 
         /* Update the lights on the hardware */
-        Status = NtDeviceIoControlFile(hKeyboardDevice,
+        Status = ZwDeviceIoControlFile(hKeyboardDevice,
                                        NULL,
                                        NULL,
                                        NULL,
@@ -164,10 +160,10 @@
 {
     NTSTATUS Status;
     IO_STATUS_BLOCK Block;
-/*
+
     IntKeyboardGetIndicatorTrans(hKeyboardDevice, &gpKeyboardIndicatorTrans);
 
-    Status = NtDeviceIoControlFile(hKeyboardDevice,
+    Status = ZwDeviceIoControlFile(hKeyboardDevice,
                                    NULL,
                                    NULL,
                                    NULL,
@@ -186,9 +182,9 @@
                    gIndicators.LedFlags & KEYBOARD_NUM_LOCK_ON);
     SET_KEY_LOCKED(gafAsyncKeyState, VK_SCROLL,
                    gIndicators.LedFlags & KEYBOARD_SCROLL_LOCK_ON);
-*/
+
     // FIXME: Need device driver to work! HID support more than one!!!!
-    Status = NtDeviceIoControlFile(hKeyboardDevice,
+    Status = ZwDeviceIoControlFile(hKeyboardDevice,
                                    NULL,
                                    NULL,
                                    NULL,
@@ -808,8 +804,7 @@
         /* Update keyboard LEDs */
         IntKeyboardUpdateLeds(ghKeyboardDevice,
                               wSimpleVk,
-                              wScanCode,
-                              IS_KEY_LOCKED(gafAsyncKeyState, wSimpleVk));
+                              wScanCode);
     }
 
     /* Call WH_KEYBOARD_LL hook */


Reply via email to