Thank you for the information, you have given me some new clues and the
issue is now resolved.
I’m using the KMDF sample from WDK 6001.18002. I modify the generated
INF file manually, as the sample will use StampInf to stamp the
co-installer version instead on the driver version.
This was the big hint, StampInf! I noticed that when I use an INX
template and let the WDK generate the INF from the template, the
DriverVer field is clobbered and replaced with the WDK version. I
should have noticed this sooner!
makefile.inc:
_LNG=$(LANGUAGE)
_INX=.
STAMP=stampinf -f $@ -a $(_BUILDARCH) -k
$(KMDF_VERSION_MAJOR).$(KMDF_VERSION_MINOR)
$(OBJ_PATH)$(O)$(INF_NAME).inf: $(_INX)$(INF_NAME).inx
copy $(_INX)$(@B).inx $@
$(STAMP)
I’m removed $(STAMP) from the end of the file, but it has broken the
installation process and the co-installers are not being located
properly (same folder is INF and SYS). Specifically, the
$KMDFCOINSTALLERVERSION$ variable seems to be left unprocessed, which
leads me to believe that StampInf processes this variable.
Unfortunately, StampInf also clobbers version info. I would love to know
how Microsoft handle this issue. Do Microsoft really write scripts to
go back and repair that info? I would hope not.
Original INF WDF sections:
; ================= WDF Coninstaller =====================
[CoInstaller_CopyFiles]
WdfCoInstaller$KMDFCOINSTALLERVERSION$.dll
[SourceDisksFiles]
WdfCoInstaller$KMDFCOINSTALLERVERSION$.dll = 1
[CoInstaller_AddReg]
HKR,CoInstallers32,0x00010000,
“WdfCoInstaller$KMDFCOINSTALLERVERSION$.dll,WdfCoInstaller”
[DspPci_wdfsect]
KmdfLibraryVersion = $KMDFVERSION$
Updated INF WDF sections:
; ================= WDF Coninstaller =====================
[CoInstaller_CopyFiles]
WdfCoInstaller01007.dll
[SourceDisksFiles]
WdfCoInstaller01007.dll = 1
[CoInstaller_AddReg]
HKR,CoInstallers32,0x00010000, “WdfCoInstaller01007.dll,WdfCoInstaller”
[DspPci_wdfsect]
KmdfLibraryVersion = 1.7
So if anyone else runes into this issue, disable StampInf and manually
manage the KMDF version information yourself. There is probably a
better way, but for now this works as a fix for my driver.
Thanks to everyone for the ideas and help, I really appreciate it.