I am on a Windows 7 x64 box.
I am enumerating USB HostControllers, Hubs And Devices.
My Machine Has 6 Universal Host Controllers and 2 Enhanced Host Controllers.
One of the Enhanced Host Controllers (Intel(R) ICH10 Family USB Enhanced Host Controller)
has a Root Hub With 6 Ports and attached To Port 3 Is An External Hub With 4 Ports.
None of the other Host Controllers have External Hubs
When It comes to the Port that the External Hub is on:
(I am positive my USB_DESCRIPTOR_REQUEST (DescriptorRequest) is set up properly before calling):
About one out of every 10 times I make this call (A complete re-enumuration) for the Port with the External Hub attached
it fails with GetLastError()==31 (ERROR_GEN_FAILURE)
I am in a loop as follows:
When DeviceIoControl() fails it will fail all 20 times.
If I am in the debugger and have a break point set on Attempts++
1.) When I hit the break point and 'F5' the DeviceIoControl() still fails.
2.) When I Hit The break point and step over the break point and the Sleep(1000)
the DeviceIoControl() will then succeed!
This same code is called for all Root Hub Ports.
The only time it fails is on the Port with the External Hub.
My code that fails on my Windows 7 box does not fail on my Windows 8.1 box.
I do not know if this will help but (Maybe it relates to the manufacturer?):
The External hub that I am having an issue with on my Windows 7 box is USB\VID_1058\PID_0500
This external hub is on an Intel(R) ICH10 Family USB Enhanced Host Controller.
On my Windows 8.1 box there are a total of 2 external hubs that I do not have an issue with are USB\VID_8087\PID_0024
They are on 2 separate Inter(R) 7 Series/C216 Chipset Family Host Controllers. Vid: 8086, Pid: 1E2D, SubSysId:05451028, Revision: 04
I suppose it could be hardware related but the Usb controller and hub on my Windows 7 box is really common. I have plinked at this and when the exception occurs I re-enumerate from the Host controller level (the one that the external hub is on). I attempt this twice. This seems to work about 1/2 of the times the exception occurs, so I still have an issue about once out of every 20 times. I am assuming if a attempt this 4 times when the exception occurs I will only get the issue once out of every 40 times!