Dear Doron Holan…
Sorry i don’t have windbg, but the root obj “Composite USB device” , “Hid
input device”
had been installed as shown within device manager. And last interface keeps
in “can’t load
the driver of this device”.
Configuration descriptor is differcence between device ceclare and driver
retrive!?
wTotalLength 0x19 ===>should be 0x32 ?
bNumInterfaces 0x01===>should be 0x02?
relative data as below.
Device ==retrive by CATC)=============================================
Device descriptor
12 01 10 01 00 00 00 08
6A 0E 37 2F 00 01 00 00
00 01
Configuration descriptor
09 02 32 00 02 01 00 A0
32 09 04 00 00 01 03 01
02 00 09 21 00 01 00 01
22 34 00 07 05 81 03 04
00 0A 09 04 01 00 01 FF
FF FF 00 07 05 03 03 08
00 A0
Drvier===============================================================
Device Descriptor
bLength 18
bDescriptorType 0x01
bcdUSB 0X110
bDeviceClass 0x00
bDeviceSubClass 0x00
bDeviceProtocal 0x00
bMaxPacketSize 0x08
idVendor 0x0e6a
idProduct 0x2f37
bcdDevice 0x100
iManufacturer 0x00
iproduct 0x00
iSerialNumber 0x00
bNumConfigurations 0x01
Configuration Descriptor
bLength 9
bdescriptorType 0x02
wTotalLength 0x19
bNumInterfaces 0x01
iConfiguration 0x0
bmAttributes 0xa0
MaxPower 32
Code ===(from Bulkusb)======================================================
NTSTATUS
BulkUsb_ConfigureDevice(
IN PDEVICE_OBJECT DeviceObject
)
{
PDEVICE_EXTENSION deviceExtension;
NTSTATUS ntStatus;
PURB urb;
ULONG siz;
BULKUSB_KdPrint( DBGLVL_HIGH,(“enter BulkUsb_ConfigureDevice\n”));
deviceExtension = DeviceObject->DeviceExtension;
BULKUSB_ASSERT( deviceExtension->UsbConfigurationDescriptor == NULL );
urb = BULKUSB_ExAllocatePool(NonPagedPool,
sizeof(struct _URB_CONTROL_DESCRIPTOR_REQUEST));
if ( !urb )
return STATUS_INSUFFICIENT_RESOURCES;
siz = sizeof(USB_CONFIGURATION_DESCRIPTOR) + 512;
while( 1 ) {
deviceExtension->UsbConfigurationDescriptor =
BULKUSB_ExAllocatePool(NonPagedPool, siz);
if ( !deviceExtension->UsbConfigurationDescriptor ) {
BULKUSB_ExFreePool(urb);
return STATUS_INSUFFICIENT_RESOURCES;
}
UsbBuildGetDescriptorRequest(urb,
(USHORT) sizeof (struct _URB_CONTROL_DESCRIPTOR_REQUEST),
USB_CONFIGURATION_DESCRIPTOR_TYPE,
0,
0,
deviceExtension->UsbConfigurationDescriptor,
NULL,
siz,
NULL);
ntStatus = BulkUsb_CallUSBD(DeviceObject, urb);
BULKUSB_KdPrint( DBGLVL_HIGH,(“BulkUsb_CallUSBD() Configuration
Descriptor = %x, len %x\n”,
deviceExtension->UsbConfigurationDescriptor,
urb->UrbControlDescriptorRequest.TransferBufferLength));
BULKUSB_KdPrint( DBGLVL_HIGH,(“bLength
%x\n”,deviceExtension->UsbConfigurationDescriptor->bLength));
BULKUSB_KdPrint( DBGLVL_HIGH,(“bDescriptorType
%x\n”,deviceExtension->UsbConfigurationDescriptor->bDescriptorType));
BULKUSB_KdPrint( DBGLVL_HIGH,(“wTotalLength
%x\n”,deviceExtension->UsbConfigurationDescriptor->wTotalLength ));
BULKUSB_KdPrint( DBGLVL_HIGH,(“bNumInterfaces
%x\n”,deviceExtension->UsbConfigurationDescriptor->bNumInterfaces));
BULKUSB_KdPrint( DBGLVL_HIGH,(“iConfiguration
%x\n”,deviceExtension->UsbConfigurationDescriptor->iConfiguration ));
BULKUSB_KdPrint( DBGLVL_HIGH,(“bmAttributes
%x\n”,deviceExtension->UsbConfigurationDescriptor->bmAttributes ));
BULKUSB_KdPrint( DBGLVL_HIGH,(“MaxPower
%x\n”,deviceExtension->UsbConfigurationDescriptor->MaxPower ));
if (urb->UrbControlDescriptorRequest.TransferBufferLength>0 &&
deviceExtension->UsbConfigurationDescriptor->wTotalLength > siz) {
siz = deviceExtension->UsbConfigurationDescriptor->wTotalLength;
BULKUSB_ExFreePool(deviceExtension->UsbConfigurationDescriptor);
deviceExtension->UsbConfigurationDescriptor = NULL;
} else {
break; // we got it on the first try
}
} // end, while (retry loop )
BULKUSB_ExFreePool(urb);
BULKUSB_ASSERT( deviceExtension->UsbConfigurationDescriptor );
ntStatus = BulkUsb_SelectInterface(DeviceObject,
deviceExtension->UsbConfigurationDescriptor);
BULKUSB_KdPrint( DBGLVL_HIGH,(“exit BulkUsb_ConfigureDevice (%x)\n”,
ntStatus));
return ntStatus;
}
NTSTATUS
BulkUsb_SelectInterface(
IN PDEVICE_OBJECT DeviceObject,
IN PUSB_CONFIGURATION_DESCRIPTOR ConfigurationDescriptor
)
{
PDEVICE_EXTENSION deviceExtension;
NTSTATUS ntStatus=STATUS_SUCCESS;
PURB urb = NULL;
ULONG i;
PUSB_INTERFACE_DESCRIPTOR interfaceDescriptor = NULL;
PUSBD_INTERFACE_INFORMATION Interface = NULL;
USHORT siz;
PUCHAR pInf;
BULKUSB_KdPrint( DBGLVL_MEDIUM,(“enter BulkUsb_SelectInterface\n”));
deviceExtension = DeviceObject->DeviceExtension;
BULKUSB_KdPrint( DBGLVL_HIGH,(“BulkUsb_SelectInterface() called with
NULL Interface\n”));
//**************************
// Here !!! urb ==NULL
//**************************
urb = USBD_CreateConfigurationRequest(ConfigurationDescriptor, &siz);
if (urb) {
}else{
}
… other code…