From 3b70f619c8b0881d94c071c0984d36d43a2b80ca Mon Sep 17 00:00:00 2001 From: Johannes Anderwald Date: Mon, 23 Jan 2012 23:41:40 +0000 Subject: [PATCH] [USBHUB] - Add more checks for detecting composite device svn path=/branches/usb-bringup-trunk/; revision=55135 --- drivers/usb/usbhub_new/fdo.c | 21 +++++++++++++++++++-- 1 file changed, 19 insertions(+), 2 deletions(-) diff --git a/drivers/usb/usbhub_new/fdo.c b/drivers/usb/usbhub_new/fdo.c index af80149a68b..44287248441 100644 --- a/drivers/usb/usbhub_new/fdo.c +++ b/drivers/usb/usbhub_new/fdo.c @@ -806,8 +806,25 @@ GetUsbStringDescriptor( ULONG IsCompositeDevice( - PUSB_DEVICE_DESCRIPTOR DeviceDescriptor) + IN PUSB_DEVICE_DESCRIPTOR DeviceDescriptor, + IN PUSB_CONFIGURATION_DESCRIPTOR ConfigurationDescriptor) { + if (DeviceDescriptor->bNumConfigurations != 1) + { + // + // composite device must have only one configuration + // + return FALSE; + } + + if (ConfigurationDescriptor->bNumInterfaces < 2) + { + // + // composite device must have multiple interfaces + // + return FALSE; + } + if (DeviceDescriptor->bDeviceClass == 0) { // @@ -877,7 +894,7 @@ CreateDeviceIds( // // Construct the CompatibleIds // - if (IsCompositeDevice(DeviceDescriptor)) + if (IsCompositeDevice(DeviceDescriptor, UsbChildExtension->FullConfigDesc)) { Index += swprintf(&BufferPtr[Index], L"USB\\DevClass_%02x&SubClass_%02x&Prot_%02x", -- 2.17.1