What happens when a hardware device matches two or more inf files when Windows is loading the drivers for that devices?
For example, the disk drive in my PC has two drivers loaded for it, cdrom.sys and iaStorF.sys. cdrom.sys was loaded from the cdrom.inf file and iaStorF.sys was loaded from the oem2.inf file that I installed from Intel.
Does Windows search all inf files and load anything that matches?
If so which is the 'primary INF file', what I mean by this in Device Manager when I click on the disk drive and go to the 'Details' tab, and then look at inf name, it shows cdrom.inf file, even though it also matched oem2.inf.
If I then look at my monitor, which also has two drivers for it loaded from two inf files, oem22.inf and monitor.inf. Under 'Details' and inf name, it shows oem22.inf.
Why did it choose oem22.inf over monitor.inf?
Best Answer
Its actually one main driver. The other one you see is a filter driver -- iaStorF.sys, where F means filter.
A filter driver is a Microsoft Windows driver that extends or modifies the function of peripheral devices or supports a specialized device in the personal computer. It is a driver or program or module that is inserted into the existing driver stack to perform some specific function.(wikipedia)
Here is a screenshot of my system, for disk drives, its in
HKLM\System\CurrentControlSet\Control\Class\{4D36E967-E325-11CE-BFC1-08002BE10318}
The main driver is disk.sys, the other 3 are all filter drivers, EhStoreClass.sys and partmgr.sys are default MS drivers in Windows 8, edevmon.sys is from eset.
For monitors, the additional inf is optional, used for extending the capacity, like color profile(.icm) or EDID information, these inf are not required for monitor to operate, only monitor.sys is necessary. (MSDN)
Some more info about filter driver, I'll just reproduce it here for future reference.(MSDN)