setupapi

How do I obtain USB_DEVICE_DESCRIPTOR given a device path

拟墨画扇 提交于 2019-12-05 01:13:20
问题 I have been able to enumerate USB devices using the SetupAPI, and I've looked at the usbview application from the WDK, but I still can't figure out how to get the USB_DEVICE_DESCRIPTOR. I would rather avoid using WMI. DeviceIoControl is what the sample app usbview uses, but that really only works if you're enumerating devices on a Hub. I suppose if I can get to the parent hub (and port) given a device path (or Id), this method may work but I haven't been able to determine how to do this

How do I obtain USB_DEVICE_DESCRIPTOR given a device path

こ雲淡風輕ζ 提交于 2019-12-03 16:14:07
I have been able to enumerate USB devices using the SetupAPI, and I've looked at the usbview application from the WDK, but I still can't figure out how to get the USB_DEVICE_DESCRIPTOR . I would rather avoid using WMI. DeviceIoControl is what the sample app usbview uses, but that really only works if you're enumerating devices on a Hub. I suppose if I can get to the parent hub (and port) given a device path (or Id), this method may work but I haven't been able to determine how to do this either. I have a mix of devices for which I'd like to get the descriptor. Some of these are HIDs, and it's