|
|
Hi guys i am trying to build a tool similar to device manager. Till now i am able to enumerate all the devices in the system(the properties i need for each device) using setupapi functions. what i can't accomplish is get list the installed driver files for each device like when pressing "driver details" button in device manager. The close i could get is an inf file, and a section name in that inf file related to the driver.
I tried the other way around: get the list of installed drivers using the 3 psapi functions(but GetDeviceDriverFileNameW returns the file name in different ways:"\windows\system32\drivers....", "system32\drivers....", "\SystemRoot\system32\drivers...", "\??\c:\windows\system32\drivers\..." and so on. for some files it just returns the file name with no leading path.
The latter approach needs a lot of extra file name processing in order to get the physical path for the driver file, and it is useless since even if i had the complete list of driver files in form of:"c:\windows....." i don't know how to link them to the devices list, so this approach seems useless.
The only way that i see now is parse the inf files and build the driver files list(based on "CopyFiles, Include, Needs...." directives), but this also seems a difficult job(although setupapi offers an superior layer for processing inf files, i think it is based on GetPrivateProfileString API series) and i was wondering isn't there some APIs which could retrieve the list of needed files based on the inf file and the section name?
PS: When playing with device manager i was monitoring file system and registry, and seems that devmgr.dll which is used by mmc when displaying devices, is reading from the registry the inf file name for the device, the section name and is accessing the inf file.
Regards, Cristi Fati.
|
|
|