Copying most of the description of 4/10 here for visibility:
For some unfathomable reason, Windows driver files are not installed to their "proper" place until the device is actually plugged in and used. Once that happens, the INF file in C:/windows/inf/ is used as an installation script.
However, Microsoft also wanted to make it possible for drivers to be installed before a device is plugged in and used, without putting the onus on the driver distributor to keep the source files somewhere that the INF will know where to find them.
Thus the Driver Store was introduced. When an INF is "preinstalled", a "package" containing the INF, catalog, and any file referenced by the INF is copied to a location in C:/windows/system32/DriverStore/. The INF itself is then copied again to C:/windows/inf/ so that it can be probed when a new device is enumerated, and a PNF is created referencing the driver store location.
The Driver Store attempts to avoid duplication, but also treats any difference in any file as creating a different driver package.
The Driver Store APIs introduced here are actually completely undocumented. The Driver Store is normally accessed through one of several apparently higher-level components, apparently introduced at different points in time, and all with apparently the same function:
* DriverPackageInstall() et al. from difxapi.dll
* DiInstallDriver() et al. from newdev.dll
* SetupCopyOEMInf() [this not only installs the INF but also implicitly also installs to the driver store]
* The DIFx MSI-based framework, including the DIFxApp.dll redistributable and dpinst.exe
The first three are Windows components, but the last is a redistributable. More pressingly, DIFxApp.dll is a custom action DLL, which means that MSI will invariably rename it, so we cannot even in practice substitute a builtin version.
We cannot easily substitute a builtin dpinst.exe, either, since our current load order logic always uses a native EXE if specified by path (which in practice is the case). It's not clear that changing this logic is worthwhile.