It's been a long time I haven't developed drivers on Windows, that dates back to Windows XP.
At the time, I had done one based on DiskPerf.
Fast forward to today, and I'd like to develop a driver for Windows 10/11. Diskperf again seems like a nice place to start, I had to download it from the WDK 8.0.
I started updating the project, and I'm now stuck on this: "diskperf.inf(33-33): error 1321: Registry root (HKLM\System\CurrentControlSet\Control\Class{4d36e967-e325-11ce-bfc1-08002be10318}) of value 'UpperFilters' is not isolated to HKR."
Corresponding lines of the inf file are:
[diskperf.AddReg]
HKLM, System\CurrentControlSet\Control\Class\{4d36e967-e325-11ce-bfc1-08002be10318}, UpperFilters, 0x00010008, diskperf.
I've been reading, and I can't understand how to change it. I downloaded the sources of an open source project, VeraCrypt, which has a filter driver. The inf reads very similarly:
[veracrypt.AddReg]
HKLM, System\CurrentControlSet\Control\Class\{4d36e967-e325-11ce-bfc1-08002be10318}, UpperFilters, 0x00010008, veracrypt
I don't know how to fix that issue (or how to rewrite things so that it gets loaded as a filter driver on disk drives).
Here's the complete inf:
; diskperf.inf
;
; Installation inf for the Disk Performance Monitor Filter driver [ DDK Sample ]
;
; Copyright (c) Microsoft Corporation
;
[Version]
Signature = "$Windows NT$"
Class = DiskDrive
ClassGUID = {4d36e967-e325-11ce-bfc1-08002be10318}
Provider = %lpc%
DriverVer = 03/22/2002,5.1.2600.0
CatalogFile=diskperf.cat
PnpLockdown=1
;
; General installation section
;
[DefaultInstall.NTx86]
CopyFiles = @diskperf.sys
Addreg = diskperf.AddReg
[DefaultInstall.ntamd64]
CopyFiles = @diskperf.sys
Addreg = diskperf.AddReg
[DestinationDirs]
DefaultDestDir = 13
[diskperf.AddReg]
;https://learn.microsoft.com/en-us/windows-hardware/drivers/install/inf-addreg-directive
;https://learn.microsoft.com/en-us/windows-hardware/drivers/install/registry-trees-and-keys
;https://learn.microsoft.com/en-us/windows-hardware/drivers/develop/run-from-driver-store
HKLM, System\CurrentControlSet\Control\Class\{4d36e967-e325-11ce-bfc1-08002be10318}, UpperFilters, 0x00010008, diskperf.
;HKR,{4d36e967-e325-11ce-bfc1-08002be10318},UpperFilters,0x10000,diskperf
;
; Service installation section
;
[DefaultInstall.NTx86.Services]
AddService = diskperf, , diskperf.Service.Install
[DefaultInstall.NTamd64.Services]
AddService = diskperf, , diskperf.Service.Install
[diskperf.Service.Install]
DisplayName = %service_desc%
ServiceType = 1
StartType = 0
ErrorControl = 1
ServiceBinary = %13%\diskperf.sys
LoadOrderGroup = "PnP Filter"
[SourceDisksFiles]
diskperf.sys=1
[SourceDisksNames]
1 = %diskid1%,,,
;
; Localizable Strings
;
[Strings]
service_desc = "Disk Performance Monitor Filter Driver"
diskid1 = "Microsoft Corp. Installation Disk #1 (DiskPerf)"
lpc = "company"