Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Get device interface from SetupDiGetClassDevs

is it possible to somehow get interface string for using with CreateFile from SetupDiGetClassDevs function or related functions? I have to scan for my devices connected to computer.

like image 759
Marin Avatar asked Oct 15 '25 06:10

Marin


1 Answers

For each device returned from SetupDiGetClassDevs, you need to enumerate device interfaces using SetupDiEnumDeviceInterfaces, and then retrieve detail data using SetupDiGetDeviceInterfaceDetail. The SP_DEVICE_INTERFACE_DETAIL_DATA structure filled in by SetupDiGetDeviceInterfaceDetail contains the correct CreateFile path.

like image 97
Erik Avatar answered Oct 16 '25 18:10

Erik



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!