The Context
This question is related to the RAMDisk Storage Driver Sample, but also applies to the Toaster Sample Driver, and may even apply to any driver that make use of .INX files and CoInstallers.
My original question was "Why am I missing the WdfCoInstallerXXXXX.dll file when my build was successful?" After reviewing the ramdisk.inf file, I realized that all the coinstaller sections are empty (replaced with a semicolon). This lead me to the question below.
The Question
The coinstaller section of the ramdisk.inx file make use of the $KMDFCOINSTALLERVERSION$ variable. This should be a valid variable according to this page. However, upon successful build, all lines that reference the $KMDFCOINSTALLERVERSION$ variable evaluate to a semicolon in the generated ramdisk.inf file. Why?
Additional Information
All other variables in the ramdisk.inx files, such as $KMDFVERSION$ and $ARCH$, gets evaluated properly.
The Cause
It turns out that the cause of this was the fact that I don't have the specified KMDF library version install, even though I recently installed the latest WDK 10. According to this page, "if you omit the KMDF Version Minor, the most recent minor version is used."
In other words, I was trying to use KMDF version 1.15, when I only support 1.7, 1.9, and 1.11. You can check the redistributable directory to see which version you support. Mine is located at C:\Program Files (x86)\Windows Kits\10\Redist\wdf\x64
.
The Fix
Go to Project->Properties->Driver Settings->Driver Model
, and select the appropriate KMDF version. After that, rebuild, and your .INF file will be properly populated, and your driver package will contain the appropriate WdfCoInstallerXXXXX.dll.