Get device interface from SetupDiGetClassDevs

Is there any way to get the interface string to use with the CreateFilefrom function SetupDiGetClassDevsor related functions? I need to scan my devices connected to a computer.

+3
source share
1 answer

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.

+5
source

Source: https://habr.com/ru/post/1792197/


All Articles