views:

316

answers:

3

On Windows, how can my user-mode program get the driver version number(s) for the video card(s) installed?

Programs like ATI's "Catalyst Control Center" can display this information to the user or include it automatically into bug reports. How do they get it?

I've been looking thru the PSDK documentation, and I can't find anything relevant.

Can a user program walk thru the database that Device Manager displays?
Is there an IOCTL call like getting disk drive geometry?
Is it in a (reliable) registry key?

A: 

I've had to solve this problem before. I believe you actually have to get the File Version information of the associated driver file.

BobbyShaftoe
But how do you identify the driver file?
Die in Sente
+4  A: 

In PowerShell:

Get-WmiObject Win32_VideoController | format-table Name, Description,VideoProcessor,DriverVersion

The WMI objects are also available from any language that speaks COM or .Net.

ETA: You may wish to exclude records without a value for VideoProcessor, like the Live Mesh drivers. I did that by including |where {$_.VideoProcessor -ne $null } in the pipeline before the format command.

JasonTrue
Thanks for the starting point. I'll look there.
Die in Sente
Thanks, JasonTrue. Given that starting point, I've figured out how to do this in C++.
Die in Sente
+1  A: 

I used "dxdiag /x output.xml", then get the video driver version by parsing "output.xml". dxdiag is slow, but it tells the one correct driver version..

I used python to do this job. Inspired by Jason's answer, I get the following code:

>>> import wmi
>>> c = wmi.WMI()
>>> for device in c.Win32_VideoController():
    if device.VideoProcessor:
        print device.DriverVersion
Wang Dingwei