I'll try to keep this simple.
I have a hub connected to my PC. This hub has several USB interfaces. I'm listening to WM_DEVICECHANGE
event and I get the USB interface path. How can I know what port it was connected to? Looking for a non-WMI solution in c++ or c# for a windows environment.
I tried using IOCTL_USB_GET_NODE_CONNECTION_NAME
with USB_NODE_CONNECTION_NAME
(where USB_NODE_CONNECTION_NAME.NodeName
will hold the path to the device) but this only works if the device connected to the port is a hub as well.
Any help will be much appreciated.