For each device returned from SetupDiGetClassDevs, you need to list the device interfaces with SetupDiEnumDeviceInterfaces, and then get the details with SetupDiGetDeviceInterfaceDetail. The structure SP_DEVICE_INTERFACE_DETAIL_DATAfilled SetupDiGetDeviceInterfaceDetailin contains the correct path CreateFile.
source
share