Hi,
Devcon from DDK has “driverfiles” command, which shows the driver files for a device. On Windoes XP it works by calling SetupDiBuildDriverInfoList with DI_FLAGSEX_INSTALLEDDRIVER | DI_FLAGSEX_ALLOWEXCLUDEDDRVS flags and then SetupDiEnumDriverInfo to get the installed driver details. Most of the time it works but sometimes for some devices seems that SetupDiBuildDriverInfoList does nothing since SetupDiEnumDriverInfo fails with error ERROR_NO_MORE_ITEMS (0x103). I’ve tested this on different configurations on different computers, it fails on random computers and devices, couldn’t find anything common. Device Manager correctly shows the driver information for the same devices.
Basically I just need some API to get the list of driver files installed for every device, I could do that by parsing registry but this is not the best way.
thanks!
(1) You tried devcon driverfiles *
Which will give you all devices.
(2) There is another sample code project for enumerating devices. It called
devmgr.exe and is with the CodeProject.
-Mike Jones
wrote in message news:xxxxx@ntdev…
> Hi,
>
> Devcon from DDK has “driverfiles” command, which shows the driver files
> for a device. On Windoes XP it works by calling SetupDiBuildDriverInfoList
> with DI_FLAGSEX_INSTALLEDDRIVER | DI_FLAGSEX_ALLOWEXCLUDEDDRVS flags and
> then SetupDiEnumDriverInfo to get the installed driver details. Most of
> the time it works but sometimes for some devices seems that
> SetupDiBuildDriverInfoList does nothing since SetupDiEnumDriverInfo fails
> with error ERROR_NO_MORE_ITEMS (0x103). I’ve tested this on different
> configurations on different computers, it fails on random computers and
> devices, couldn’t find anything common. Device Manager correctly shows the
> driver information for the same devices.
>
> Basically I just need some API to get the list of driver files installed
> for every device, I could do that by parsing registry but this is not the
> best way.
>
> thanks!
>
devmgr.exe directly reads ‘ImagePath’ from the registry, that gives only single file not all the files that needed for driver installation (filters, DLLs, installers, etc.). I need all of them.
I’ve found workaround, when DI_FLAGSEX_INSTALLEDDRIVER does not work I build a list of all the compatible drivers and select the best one. This works so far in all the cases where DI_FLAGSEX_INSTALLEDDRIVER does not.