I\'m trying to get the version number of a driver programmatically. The seems to be done by using SetupDiEnumDriverInfo
to get a SP_DRVINFO_DATA
st
As your code is written, all the possible drivers will be output. Try doing the following to filter on only the installed driver:
SP_DEVINSTALL_PARAMS InstallParams;
if ( !SetupDiGetDeviceInstallParams( devInfoSet, &devInfo, &InstallParams ) )
{
//Error
}
else
{
InstallParams.FlagsEx |= DI_FLAGSEX_INSTALLEDDRIVER;
if ( !SetupDiSetDeviceInstallParams( devInfoSet, &devInfo, &InstallParams) )
{
//Errror
}
}
I found this at http://doxygen.reactos.org/df/db2/dll_2win32_2devmgr_2misc_8c_a1cd0b33c1785392a37689433dc99e482.html