Hello all:
I want to find the Hub/Port that a USB device is attached to.
The USB FAQ describes a way to match devices enumerated through the interface through the driverkey (with SetupDiGetClassDevs - flag DIGCF_DEVICEINTERFACE/SetupDiEnumDeviceInterfaces/SetupDiGetDeviceInterfaceDetail) and then SetupDiGetDeviceRegistryPropertyA with option SPDRP_DEVICEDESC) and match this to the driverkey from DeviceIOCtl (IOCTL_USB_GET_NODE_CONNECTION_DRIVERKEY_NAME) for each hub port. Unfortunately the driverkeys do not match because the Hub returns the driverkey (for the same device) enumerated in the USB category (HKLM\System\CurentControlSet\Enum\USB\) while the DeviceInterface enumeration returns the driverkey that is enumerated under HID (HKLM\System\CurentControlSet\Enum\HID).
Purpose of this task: I need to find a USB device that first starts in a custom HID mode which allows me to read configuration data. I will then switch it over to DFU mode, find the same device and install new device firmware (Windows XP) Unfortunately in DFU mode, with the small bootload programm, there is no device serial number stored in the USB descriptor.
Any help - or a different approach to the problem - is appreciated.
Thanks,
H.