I try to find out the version of the currently active graphics driver on Windows using C++ and SetupAPI. The solution roughly looks like
- Call
SetupDiGetClassDevsforGUID_DEVCLASS_DISPLAY. - Call
SetupDiBuildDriverInfoListfor the result set. - Call
SetupDiEnumDriverInfofor the device set withSPDIT_COMPATDRIVER, which gives me all known drivers compatible with the GPU.
The result includes the fallback driver from Microsoft, which I can easily exclute, but it also includes all driver versions (from NVIDIA) that have been installed on the system.
The question is: How do I find out which of the drivers is actually running?
I know from the SP_DEVINFO_DATA returned in step 1 how the driver service is called and I also get some kind of registry key, but I do not see how I could relate this to the SP_DRVINFO_DATA. I also know that NVAPI provides driver management capabilities, but I would prefer a solution that works with GPUs of all kinds of vendors.