问题
I need to find out if parent of USB device is a hub or host. Current plan is to use CM_Get_Parent() to get the DEVINST and use SetupDiGetDeviceInfoListDetail() to get the SP_DEVINFO_LIST_DETAIL_DATA structure, but from there I am looking for information to parse against to will tell me if the parent is a hub.
Any pointers/hints/advice would be greatly appreciated.
Thanks in advance,
EB
回答1:
Parent is always a hub. Might be a root hub or a peripheral hub, I guess that's what you want to know. Check the grandparent's enumerator property (whether it's on a USB or PCI bus).
来源:https://stackoverflow.com/questions/3834951/how-to-find-if-parent-of-usb-device-is-a-hub