Author: janderwald
Date: Sun Feb 12 22:17:50 2012
New Revision: 55571

URL: http://svn.reactos.org/svn/reactos?rev=55571&view=rev
Log:
[HIDUSB]
- Check if boot procol is supported
- Don't assert on boot protocol active
See issue #6886 for more details.

Modified:
    trunk/reactos/drivers/hid/hidusb/hidusb.c

Modified: trunk/reactos/drivers/hid/hidusb/hidusb.c
URL: 
http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/hid/hidusb/hidusb.c?rev=55571&r1=55570&r2=55571&view=diff
==============================================================================
--- trunk/reactos/drivers/hid/hidusb/hidusb.c [iso-8859-1] (original)
+++ trunk/reactos/drivers/hid/hidusb/hidusb.c [iso-8859-1] Sun Feb 12 22:17:50 
2012
@@ -1296,7 +1296,7 @@
 }
 
 
-NTSTATUS
+VOID
 Hid_GetProtocol(
     IN PDEVICE_OBJECT DeviceObject)
 {
@@ -1312,6 +1312,15 @@
     DeviceExtension = (PHID_DEVICE_EXTENSION)DeviceObject->DeviceExtension;
     HidDeviceExtension = 
(PHID_USB_DEVICE_EXTENSION)DeviceExtension->MiniDeviceExtension;
 
+    if (HidDeviceExtension->InterfaceInfo->SubClass != 0x1)
+    {
+        //
+        // device does not support the boot protocol
+        //
+        return;
+    }
+
+
     //
     // allocate urb
     //
@@ -1321,7 +1330,7 @@
         //
         // no memory
         //
-        return STATUS_INSUFFICIENT_RESOURCES;
+        return;
     }
 
     //
@@ -1356,15 +1365,19 @@
     ExFreePool(Urb);
 
     //
-    // print status
-    //
-    DPRINT("Status %x Protocol %x\n", Status, Protocol[0] & 0xFF);
-
-    //
-    // assert when boot protocol is still active
-    //
-    ASSERT(Protocol[0] == 0x1); 
-    return Status;
+    // boot protocol active 0x00 disabled 0x1
+    //
+    if (Protocol[0] != 0x1)
+    {
+        if (Protocol[0] == 0x00)
+        {
+            DPRINT1("[HIDUSB] Need to disable boot protocol!\n");
+        }
+        else
+        {
+            DPRINT1("[HIDUSB] Unexpected protocol value %x\n", Protocol[0] & 
0xFF);
+        }
+    }
 }
 
 NTSTATUS
@@ -1474,7 +1487,10 @@
     //
     Hid_SetIdle(DeviceObject);
 
-   Hid_GetProtocol(DeviceObject);
+    //
+    // get protocol
+    //
+    Hid_GetProtocol(DeviceObject);
 
     //
     // move to next descriptor


Reply via email to