- Add more checks for detecting composite device

svn path=/branches/usb-bringup-trunk/; revision=55135
This commit is contained in:
Johannes Anderwald 2012-01-23 23:41:40 +00:00
parent e62233a8e7
commit 3b70f619c8

View file

@ -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",