From 32157dc19279b209ab467e669c0cbf68112f4069 Mon Sep 17 00:00:00 2001 From: Johannes Anderwald Date: Sun, 12 Feb 2012 22:17:50 +0000 Subject: [PATCH] [HIDUSB] - Check if boot procol is supported - Don't assert on boot protocol active See issue #6886 for more details. svn path=/trunk/; revision=55571 --- reactos/drivers/hid/hidusb/hidusb.c | 38 ++++++++++++++++++++--------- 1 file changed, 27 insertions(+), 11 deletions(-) diff --git a/reactos/drivers/hid/hidusb/hidusb.c b/reactos/drivers/hid/hidusb/hidusb.c index a862045525b..4fc26fd5cd7 100644 --- a/reactos/drivers/hid/hidusb/hidusb.c +++ b/reactos/drivers/hid/hidusb/hidusb.c @@ -1296,7 +1296,7 @@ Hid_SetIdle( } -NTSTATUS +VOID Hid_GetProtocol( IN PDEVICE_OBJECT DeviceObject) { @@ -1312,6 +1312,15 @@ Hid_GetProtocol( 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 @@ Hid_GetProtocol( // // no memory // - return STATUS_INSUFFICIENT_RESOURCES; + return; } // @@ -1356,15 +1365,19 @@ Hid_GetProtocol( ExFreePool(Urb); // - // print status + // boot protocol active 0x00 disabled 0x1 // - DPRINT("Status %x Protocol %x\n", Status, Protocol[0] & 0xFF); - - // - // assert when boot protocol is still active - // - ASSERT(Protocol[0] == 0x1); - return Status; + 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_PnpStart( // Hid_SetIdle(DeviceObject); - Hid_GetProtocol(DeviceObject); + // + // get protocol + // + Hid_GetProtocol(DeviceObject); // // move to next descriptor