We have developed a WDDM driver based on the Microsoft KMDOD example (https://github.com/Microsoft/Windows-driver-samples/tree/master/video/KMDOD) and it works fine, including installation via dpinst.exe. We currently provide an installer for this driver, providing a copy to customers who wish to use it. However, we are investigating switching to a different distribution model, using Microsoft?s Window Update to distribute the driver. That is, the current installer for our product would remove the installation of our WDDM driver and delegate it to Windows Update, which would (somehow, see below) detect the installation of our product and trigger the installation of our WDDM driver.
Now, our WDDM driver should be enabled only when the rest of our product is installed, and remain disabled otherwise. Currently, our .INF file specifies the driver as being a Display type driver, with a FeatureScore of 0xF6, which ensures that when we explicitly run dpinst.exe or pnputil.exe to install the driver, that our WDDM driver is the one used. The existing devicenode (typically the Microsoft Basic Display Only Driver) gets replaced with our KMDOD-based WDDM devicenode. My understanding is that because of our FeatureScore, and that in our INF models section we specify CC_0300 (VGA), the PnPManager determines that our WDDM driver is the best driver (i.e. better than the MS DOD driver one) and replaces it.
This works well because our product?s installer is explicitly invoking dpinst on our INF file, triggering the driver?s installation. That is, our driver is installed only when our product is also being installed. That?s not the case when distributing the driver via Windows Update. In that case, our WDDM driver is likely to be installed on all WDDM-supporting machines, regardless of whether our product is installed or not. That is, any machine whose display drivers have a FeatureScore higher than the WDDM one of 0xF6 (the MS DoD ones have a FeatureScore of 0xFF) get replaced.
Our INF file has a rather broad target in the Models section, where it looks like:
[COMPANY.NTamd64]
%OUR_WDDM_DRIVER% = KDOD_Install, CC_0300
Obviously we don?t want it installed unless our product is also being installed. How can we control the installation of our WDDM driver? We were hoping to do this by creating a devicenode that uniquely matched our driver, and trigger the driver?s loading via a call to DiInstallDevice. That is, when the installer for our product was running, it would create a devicenode tailored for our WDDM driver, the causing PnPManager to replace the existing Display devicenode with ours. And if/when our product was uninstalled, we would delete this devicenode and the previous display driver would be restored.
I?ve experimented with changing our models section to specify something more specific e.g.
[COMPANY.NTamd64]
%OUR_WDDM_DRIVER% = KDOD_Install, PCI\VEN_1234&DEV_0001&CC_0300
However this simply created a sibling devicenode, so there were now two Display devicenodes, one being ours, and the other one belonging to MS DoD (there was also a problem with our device node not being recognized though). As an experiment I tried manually deleting the MS DoD device node, leaving just our WDDM device node, but if I triggered a ?Scan for hardware changes? then the MS DoD driver devicenode gets reintroduced.
I think either my strategy (and possibly execution) for solving this problem is invalid.
Is it indeed possible to distribute a miniport KMDOD driver via Windows Update and control exactly when it gets installed? If so, how does one do this?
Many thanks in advance for any help you may be able to provide.