Content-Type: text/plain; charset=ISO-8859-15; format=flowed
Content-Transfer-Encoding: 7bit
Hello,
I am writing a KMDF driver for a USB device for Windows Vista, but I’m
having problems selecting the only endpoint descriptor available
(WdfUsbTargetDeviceSelectConfig always returns
STATUS_INVALID_PARAMETER). The same driver works fine on Windows XP.
This is the code I’m using (taken from a WDK sample):
…
status = WdfUsbTargetDeviceCreate(Device, WDF_NO_OBJECT_ATTRIBUTES,
&pDeviceContext->UsbDevice);
WDF_USB_DEVICE_SELECT_CONFIG_PARAMS_INIT_SINGLE_INTERFACE(&configParams);
status = WdfUsbTargetDeviceSelectConfig(pDeviceContext->UsbDevice,
WDF_NO_OBJECT_ATTRIBUTES, &configParams);
Since I read somewhere that Vista is much more strict regarding devices
following USB standards, I decided to “dump” all the descriptors and see
if everything was correct.
Here is the result:
*********** DEVICE_DESCRIPTOR ***********
bLength: 18 OK
bDescriptorType: 1 OK
bcdUSB: 100 OK
bDeviceClass: 0 OK
bDeviceSubClass: 0 OK
bDeviceProtocol: 0 OK
bMaxPacketSize0: 8 OK
idVendor: 4512 OK
idProduct: 1000 OK
bcdDevice: 100 OK
iManufacturer: 1 OK (?)
iSerialNumber: 0 OK
bNumConfigurations: 1 OK
*********** CONFIGURATION_DESCRIPTOR ***********
bLength: 9 OK
bDescriptorType: 2 OK
wTotalLength: 19 OK
bNumInterfaces: 1 OK
bConfigurationValue: 1 OK
iConfiguration: 4 OK (?)
bmAttributes: A0 OK
MaxPower: 10 OK
*********** INTERFACE_DESCRIPTOR ***********
bLength: 9 OK
bDescriptorType: 4 OK
bInterfaceNumber: 0 OK
bAlternateSetting: 0 OK
bNumEndpoints: 1 OK
bInterfaceClass: 0 INVALID
bInterfaceSubClass: 0 INVALID
bInterfaceProtocol: 0 INVALID
iInterface: 5 OK (?)
*********** ENDPOINT_DESCRIPTOR ***********
bLength: 7 OK
bDescriptorType: 5 OK
bEndpointAddress: 81 OK
bmAttributes: 3 OK
wMaxPacketSize: 15 OK (?)
bInterval: 2 OK (?)
- The values marked as “OK” follow the USB specification
- The values marked as “OK (?)” should follow the USB specification, but
I don’t know if Vista is happy with them - The values marked as “INVALID” do NOT follow the USB specification
Do you have any idea why selecting the descriptor doesn’t work on Vista,
while it works flawless on XP? Are those values really ok, or is there
something wrong? Is my code fine, or is the device the problem?
Thanks,
- AS