windows - How to enumerate all connected USB devices' device path?

后端 未结 1 1026
野的像风
野的像风 2020-12-01 05:44

I\'m trying to use the SetupDi functions to enumerate all connected USB devices\' device path. The device path is the path used in CreateFile() so I can communicate with the

相关标签:
1条回答
  • 2020-12-01 06:31

    MSDN says that there's a generic USB device interface class named GUID_DEVINTERFACE_USB_DEVICE with the GUID {A5DCBF10-6530-11D2-901F-00C04FB951ED}:

    The system-supplied USB hub driver registers instances of GUID_DEVINTERFACE_USB_DEVICE to notify the system and applications of the presence of USB devices that are attached to a USB hub.

    Here's a code example that seems to do what you want to do, using the DEVINTERFACE_USB_DEVICE GUID.

    0 讨论(0)
提交回复
热议问题