USB Multi-Interface problem during PnP

This is a WDF USB driver for a two interface device. I’ve got it configured as a pairs device, and that part seems to be just fine.

This is a multiple interface USB device that I’m bringing up and I’ve read (http://www.osronline.com/article.cfm?article=534) very carefully to get where I am now. My device has two interfaces, and one endpoint per interface. I’m preprocessing (mostly for debugging purposes) the IRPs, and have the URBCompletion routine correctly hooked so I get all the callbacks. AddDevice, PrepareHardware and SelectInterfaces all return success and their state variables (handles and the like) are all valid when inspected or used in WDF calls (as far as I can tell).

For the calls leading up to this point, I see that the device and configuration descriptors are propagating upstack properly and they’re correctly formatted.

During PnP init, I get:

URB_FUNCTION_GET_DESCRIPTOR_FROM_DEVICE,
and my device descriptor is returned successfully

URB_FUNCTION_GET_DESCRIPTOR_FROM_DEVICE,
and my config descriptor header is returned successfully

URB_FUNCTION_GET_DESCRIPTOR_FROM_DEVICE,
and my config descriptor (in its entirety) is returned successfully

URB_FUNCTION_SELECT_CONFIGURATION
and now here’s the problem I hit in URBCompletion() …

The problem I have is that during the plug and play initialization I get the URB_FUNCTION_SELECT_CONFIGURATION callback for completion and Params.IoStatus.Status is 0xC0000001 (STATUS_UNSUCCESSFUL), and the status in the URB header is 0xC0000F00, which I have not been able to track down the meaning of. The data in the Configuration descriptor embedded in the URB is correct, but the other contents of the UrbSelectConfiguration struct appear to all be invalid. I don’t know whether pUrb.UrbSelectConfiguration.Hdr.Length is supposed to be the same size as my config descriptor or not, but the size contained in that location is exactly one larger than the correct size for my descriptor (not sure whether this is important or not, but it feels fishy).

I’m not exactly sure how to proceed from this point. Any ideas?

Bob Lacey

Turns out that I found the 0xC0000F00 status: USBD_STATUS_INVALID_CONFIGURATION_DESCRIPTOR. Time to do some more digging…