简体   繁体   中英

Get the currently “Active” driver for a device in C++

I have used SetupAPI to enumerate all the drivers, build a list of its properties etc etc. But what i want is to enumerate only the " Active " drivers for any device.

Eg. For a Intel HD 5500, There are a couple of drivers installed in the System with different versions like

20.19.15.4531
20.19.15.4454

But the version shown in DeviceManager is 20.19.15.4531. I need to get only this version.

When I use SetupAPI, I Get both the drivers. I've tried the solution listed at This Post but I can confirm that the solution does not work for me.

SetupDiGetSelectedDriver() also does not work . ie It works only when we are installing a driver to the store using SetupAPI functions.

Any Help will be really appreciated.

Note : There is no problem in finding and Enumerating the drivers. I use SetupDiBuildDriverInfoList() and SetupDiEnumDrvInfo() , and they work as expected.

I Finally ended up building a list of current drivers using WMI in c++. Couldn't find a way out!

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM