Author: janderwald
Date: Wed Dec 5 08:26:39 2012
New Revision: 57805
URL:
http://svn.reactos.org/svn/reactos?rev=57805&view=rev
Log:
[HIDUSB]
- Add check if interface descriptor was parsed
- Correct error message
- Set device idle after a configuration has been selected
- CORE-6574
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.…
==============================================================================
--- trunk/reactos/drivers/hid/hidusb/hidusb.c [iso-8859-1] (original)
+++ trunk/reactos/drivers/hid/hidusb/hidusb.c [iso-8859-1] Wed Dec 5 08:26:39 2012
@@ -1168,6 +1168,13 @@
USB_DEVICE_CLASS_HUMAN_INTERFACE,
-1,
-1);
+ if (!InterfaceDescriptor)
+ {
+ //
+ // bogus configuration descriptor
+ //
+ return STATUS_INVALID_PARAMETER;
+ }
//
// sanity check
@@ -1472,7 +1479,7 @@
//
// no interface class
//
- DPRINT1("[HIDUSB] HID Class found\n");
+ DPRINT1("[HIDUSB] HID Interface descriptor not found\n");
return STATUS_UNSUCCESSFUL;
}
@@ -1484,11 +1491,6 @@
ASSERT(InterfaceDescriptor->bLength == sizeof(USB_INTERFACE_DESCRIPTOR));
//
- // now set the device idle
- //
- Hid_SetIdle(DeviceObject);
-
- //
// move to next descriptor
//
HidDescriptor = (PHID_DESCRIPTOR)((ULONG_PTR)InterfaceDescriptor +
InterfaceDescriptor->bLength);
@@ -1512,10 +1514,15 @@
//
// done
//
- DPRINT("[HIDUSB] SelectConfiguration %x\n", Status);
+ DPRINT1("[HIDUSB] SelectConfiguration %x\n", Status);
if (NT_SUCCESS(Status))
{
+ //
+ // now set the device idle
+ //
+ Hid_SetIdle(DeviceObject);
+
//
// get protocol
//
@@ -1523,18 +1530,18 @@
return Status;
}
}
-
- //
- // FIXME parse hid descriptor
- //
- UNIMPLEMENTED
- ASSERT(FALSE);
-
- //
- // get protocol
- //
- Hid_GetProtocol(DeviceObject);
- return STATUS_SUCCESS;
+ else
+ {
+ //
+ // FIXME parse hid descriptor
+ // select configuration
+ // set idle
+ // and get protocol
+ //
+ UNIMPLEMENTED
+ ASSERT(FALSE);
+ }
+ return Status;
}