How to create an INF file for a minfilter that works for different versions of Windows?

I’m trying to create a minifilter and now I want to create an INF to install it. For that I base mine on the Minispy’s one. But when I run InfVerif on it, it fail to pass (note that I replace instances of $ARCH$ with arm64):

> `C:\Program Files (x86)\Windows Kits\10\Tools\10.0.26100.0\x64\infverif.exe` /w minispy.inf
ERROR(1323) in c:\dev\minispy.inf, line 77, target OS NTarm64: Service registry key 'Flags' must be under the Parameters subkey.
ERROR(1323) in c:\dev\minispy.inf, line 77, target OS NTarm64: Service registry key 'DefaultInstance' must be under the Parameters subkey.
ERROR(1323) in c:\dev\minispy.inf, line 77, target OS NTarm64: Service registry key 'SupportedFeatures' must be under the Parameters subkey.
ERROR(1323) in c:\dev\minispy.inf, line 77, target OS NTarm64: Service registry key 'Altitude' must be under the Parameters subkey.
ERROR(1322) in c:\dev\minispy.inf, line 115, target OS NTarm64: Destination file path 'C:\Windows\System32\drivers' for file 'minispy.sys' is not isolated to DIRID 13.

As I understand after the docs, since Windows 11 version 24H2 the registry values must be under the Parameters subkey. But the INF file uses the old way for version prior 24H2 which makes InfVerif to emit errors.

So my question is how can I make InfVerif to validate my INF?

See the updated minispy sample INF:

Windows-driver-samples/filesys/miniFilter/minispy/minispy.inf at main · microsoft/Windows-driver-samples

[DefaultInstall.NT$ARCH$.10.0...25952]
OptionDesc          = %ServiceDescription%
CopyFiles           = Minispy.Files,

[DefaultInstall.NT$ARCH$.10.0...25952.Services]
AddService          = %ServiceName%,,Minispy.Service

....

;;
;; Downlevel default install sections
;;

[DefaultInstall.NT$ARCH$]
OptionDesc          = %ServiceDescription%
CopyFiles           = MinispyDownlevel.CopyDriverFiles

[DefaultInstall.NT$ARCH$.Services]
AddService          = %ServiceName%,,MinispyDownlevel.Service

1 Like

This is the file I used.

It seems InfVerif isn’t able to understand the version filter. My current workaround is to pass /wbuild 10.0.25952 to InfVerif, but I don't know if this is the way to go.

That’s a pre-release 24H2 build number. If you make it 26100 does everything pass?

No it doesn't pass until I put /wbuild 10.0.26100