EDIT: This is all left for context, but I figured it out. See end of post.
Forgive my ignorance, but it’s pretty difficult to find good examples (or I’m just failing miserably to find them) on how to set up INF files correctly. I’m trying to combine them into a single one as suggested, but I’m not sure how to indicate which of the two services belongs to the filter and which one belongs to the base driver.
If I try to specify two different names that point to the same hardware ID path (so I can configure one with the base driver and the second with the filter driver), I get a validation error:
[Manufacturer]
%ManufacturerName%=Standard,NT$ARCH$
[Standard.NT$ARCH$]
%FuryGPU.DeviceDesc%=FuryGPU_Device, PCI\VEN_DBDB&DEV_DB01
%FuryGPU.FilterDesc%=FuryGPU_Filter, PCI\VEN_DBDB&DEV_DB01 ; This causes a validation error
I’m trying to use the FuryGPU_Filter name to specify AddFilter to add it as a filter for the base driver, and to add its specific service:
[FuryGPU_Filter.NT.Filters]
AddFilter = FuryGPU_WDF_Filter, FuryGPU_Filter_Inst
[FuryGPU_Filter_Inst]
FilterPosition = Upper
[FuryGPU_Filter.NT.Services]
AddService = FuryGPU_Flt,, FuryGPU_WDF_Service_Inst, FuryGPU_WDF_EventLog_Inst
If I can’t do it this way, how do I indicate which of the driver binaries is the base and which is the filter?
EDIT: I did not understand the connection between the name specified in the AddFilter command and the name of the service. Also, it seems that the INF validation VS 2019 is doing is a bit too eager, and fails if you have a [DDInstall.NT.Filters]
section, though I did not dig any further in to figure out why.
I figured out how to configure the INF properly, and now it is loading both driver binaries using a single INF! Here’s everything that’s in the INF file:
;
; FuryGPU.inf
;
[Version]
Signature = "$WINDOWS NT$"
Class = %ClassName%
ClassGuid = {4d36e968-e325-11ce-bfc1-08002be10318}
Provider = %ManufacturerName%
CatalogFile = FuryGPU.cat
;DriverVer= ; Is set via stampinf property page
PnpLockdown = 1
; ================= Class section =====================
[SourceDisksNames]
1 = %DiskName%,,,""
[SourceDisksFiles]
FuryGPU_KMD.sys = 1
FuryGPU_WDF.sys = 1
[DestinationDirs]
FuryGPU.MiniportFiles = 12 ; drivers
;*****************************************
; Install Section
;*****************************************
[ControlFlags]
ExcludeFromSelect=*
[Manufacturer]
%ManufacturerName%=Standard,NT$ARCH$
[Standard.NT$ARCH$]
%FuryGPU.DeviceDesc%=FuryGPU_Device, PCI\VEN_DBDB&DEV_DB01
;-------------- WDDM Device
[FuryGPU_Device.NT]
FeatureScore = FB
CopyFiles = FuryGPU.MiniportFiles;, FuryGPU.UserModeFiles
;AddReg = FuryGPU_AddReg
[FuryGPU.MiniportFiles]
FuryGPU_KMD.sys,,,0x100
FuryGPU_WDF.sys,,,0x100
[FuryGPU_Device.NT.HW]
AddReg = FuryGPU_MSI_HardwareDeviceSettings
AddReg = FuryGPU_Security_Settings
AddReg = FuryGPU_FilterReg
[FuryGPU_MSI_HardwareDeviceSettings]
HKR,Interrupt Management,,0x00000010
HKR,Interrupt Management\MessageSignaledInterruptProperties,,0x00000010
HKR,Interrupt Management\MessageSignaledInterruptProperties,MSISupported,0x00010001,1
[FuryGPU_Security_Settings]
HKR,,Security,,"D:P(A;;GA;;;SY)(A;;GRGWGX;;;BA)(A;;GRGWGX;;;WD)(A;;GRGWGX;;;RC)"
; NOTE: Had to use this method instead of the new AddFilter method. My version of VS might be too old to support it properly.
[FuryGPU_FilterReg]
HKR,,"UpperFilters", 0x00010008, "FuryGPU_Filter"
;-------------- Service installation
[FuryGPU_Device.NT.Services]
AddService = FuryGPU,%SPSVCINST_ASSOCSERVICE%, FuryGPU_Service_Inst, FuryGPU_EventLog_Inst
AddService = FuryGPU_Filter,, FuryGPU_Filter_Service_Inst, FuryGPU_Filter_EventLog_Inst
[FuryGPU_EventLog_Inst]
AddReg = FuryGPU_EventLog_AddReg
[FuryGPU_Filter_EventLog_Inst]
AddReg = FuryGPU_EventLog_AddReg
[FuryGPU_EventLog_AddReg]
HKR,,EventMessageFile,%REG_EXPAND_SZ%,"%%SystemRoot%%\System32\IoLogMsg.dll"
HKR,,TypesSupported,%REG_DWORD%,7
[FuryGPU_Service_Inst]
DisplayName = %FuryGPU.SVCDESC%
ServiceType = 1 ; SERVICE_KERNEL_DRIVER
StartType = 3 ; SERVICE_DEMAND_START
ErrorControl = 1 ; SERVICE_ERROR_NORMAL
ServiceBinary = %12%\FuryGPU_KMD.sys
[FuryGPU_Filter_Service_Inst]
DisplayName = %FuryGPU.SVCDESC%
ServiceType = 1 ; SERVICE_KERNEL_DRIVER
StartType = 3 ; SERVICE_DEMAND_START
ErrorControl = 1 ; SERVICE_ERROR_NORMAL
ServiceBinary = %12%\FuryGPU_WDF.sys
[Strings]
REG_MULTI_SZ = 0x00010000
REG_EXPAND_SZ = 0x00020000
REG_DWORD = 0x00010001
SPSVCINST_ASSOCSERVICE = 0x00000002
ManufacturerName = "Dylan Barrie"
ClassName = "Display"
DiskName = "FuryGPU Installation Disk"
FuryGPU.DeviceDesc = "FuryGPU Device"
FuryGPU.SVCDESC = "FuryGPU Service"
Thanks for the pointers, everyone!