Author Topic: enumerate VID/PID/WinUSB DeviceInterfaceGUID on Windows - robust code?  (Read 5458 times)

rdebaene

  • Member
  • ***
  • Posts: 1
Both the book "USB Complete" and the demo project winusb_cs_31 use VID/PID for detecting device insertion/removal (via WMI) and the DeviceInterface GUID for accessing WinUSB devices.

I couldn't find example code to link VID/PID to DeviceInterface GUID and vice versa, so I tried to write my own code. See attachment (.NET Framework, C#, VS2019).
  • Is this the right method to link both, or are there simpler methods?
  • Can others test if it works on their system, especially in foreign languages? The code assumes ASCII or UTF16 encoding in some places, not sure if this is always correct.

Kind regards,

Renaat