I've only seen this issue on ASMedia XHCI's (tested with latest fw/driver) but 
the call that uses SPDRP_ADDRESS to query the port number a device is on yields 
incorrect information. That information is later used by the 
IOCTL_USB_GET_NODE_CONNECTION_INFORMATION_EX iotcl to get information about the 
device. however since the port_nr is wrong, the hub driver correctly reports 
back 'no device connected' causing the device to be unavailable from libusb. 

```
CHAR DevLocation[256];
.
.
.
// The SPDRP_ADDRESS for USB devices is the device port number on the hub
                        port_nr = 0;
                        if ((pass >= HUB_PASS) && (pass <= GEN_PASS)) {
                                if ( 
(!pSetupDiGetDeviceRegistryPropertyA(dev_info, &dev_info_data, SPDRP_ADDRESS,
                                        &reg_type, (BYTE*)&port_nr, 4, &size))
                                  || (size != 4) ) {
                                        usbi_warn(ctx, "could not retrieve port 
number for device '%s', skipping: %s",
                                                dev_id_path, 
windows_error_str(0));
                                        continue;
                                }
                        }
                        if (pSetupDiGetDeviceRegistryPropertyA(dev_info, 
&dev_info_data, SPDRP_LOCATION_INFORMATION  , &reg_type, (BYTE*)&DevLocation, 
sizeof(DevLocation), &size)) {
                          if ( (size>=6) && 
(strncmp(DevLocation,"Port_#",6)==0) )
                          {
                                        port_nr = strtol(DevLocation+6,NULL,10);
                                }
                        }
```

This works around the issue by querying SPDRP_LOCATION_INFORMATION see if it's 
in Port_#xxxx_Hub_#yyyy format and parses the correct port from there. 








---
Reply to this email directly or view it on GitHub:
https://github.com/libusbx/libusbx/issues/147
------------------------------------------------------------------------------
LIMITED TIME SALE - Full Year of Microsoft Training For Just $49.99!
1,500+ hours of tutorials including VisualStudio 2012, Windows 8, SharePoint
2013, SQL 2012, MVC 4, more. BEST VALUE: New Multi-Library Power Pack includes
Mobile, Cloud, Java, and UX Design. Lowest price ever! Ends 9/20/13. 
http://pubads.g.doubleclick.net/gampad/clk?id=58041151&iu=/4140/ostg.clktrk
_______________________________________________
libusbx-devel mailing list
libusbx-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/libusbx-devel

Reply via email to