I have a virtual ACPI device in BIOS with hardware id ACPI\VEN_TEST&DEV_1234
I create a function driver for it called SecondTouch from KMDF driver template in Visual Studio, its INF:
[Version]
Signature = "$WINDOWS NT$"
Class = System ; TODO: specify appropriate Class
ClassGuid = {4d36e97d-e325-11ce-bfc1-08002be10318} ; TODO: specify appropriate ClassGuid
Provider = %ManufacturerName%
CatalogFile = SecondTouch.cat
DriverVer = ; TODO: set DriverVer in stampinf property pages
PnpLockdown = 1
[DestinationDirs]
DefaultDestDir = 13
[SourceDisksNames]
1 = %DiskName%,,,""
[SourceDisksFiles]
SecondTouch.sys = 1,,
;*****************************************
; Install Section
;*****************************************
[Manufacturer]
%ManufacturerName% = Standard,NT$ARCH$.10.0...16299 ; %13% support introduced in build 16299
[Standard.NT$ARCH$.10.0...16299]
%SecondTouch.DeviceDesc% = SecondTouch_Device, ACPI\VEN_TEST&DEV_1234 ; TODO: edit hw-id
[SecondTouch_Device.NT]
CopyFiles = File_Copy
[File_Copy]
SecondTouch.sys
;-------------- Service installation
[SecondTouch_Device.NT.Services]
AddService = SecondTouch,%SPSVCINST_ASSOCSERVICE%, SecondTouch_Service_Inst
; -------------- SecondTouch driver install sections
[SecondTouch_Service_Inst]
DisplayName = %SecondTouch.SVCDESC%
ServiceType = 1 ; SERVICE_KERNEL_DRIVER
StartType = 3 ; SERVICE_DEMAND_START
ErrorControl = 1 ; SERVICE_ERROR_NORMAL
ServiceBinary = %13%\SecondTouch.sys
[SecondTouch_Device.NT.Wdf]
KmdfService = SecondTouch, SecondTouch_wdfsect
[SecondTouch_wdfsect]
KmdfLibraryVersion = $KMDFVERSION$
[Strings]
SPSVCINST_ASSOCSERVICE = 0x00000002
ManufacturerName = "Co., Ltd." ;TODO: Replace with your manufacturer name
DiskName = "SecondTouch Installation Disk"
SecondTouch.DeviceDesc = "SecondTouch Device"
SecondTouch.SVCDESC = "SecondTouch Service"
A filter driver called ThirdTouch to modify the IOCTLs sent to the device.
I call the WdfFdoInitSetFilter(DeviceInit) in DeviceAdd routine to configure the driver as a filter driver.
Then modify the INF:
- Add UpperFilters registry
- Remove the
SPSVCINST_ASSOCSERVICE=0x00000002and addAddService = ,2as guided by Microsoft * here
[Version]
Signature = "$WINDOWS NT$"
Class = System ; TODO: specify appropriate Class
ClassGuid = {4d36e97d-e325-11ce-bfc1-08002be10318} ; TODO: specify appropriate ClassGuid
Provider = %ManufacturerName%
CatalogFile = ThirdTouch.cat
DriverVer = ; TODO: set DriverVer in stampinf property pages
PnpLockdown = 1
[DestinationDirs]
DefaultDestDir = 13
[SourceDisksNames]
1 = %DiskName%,,,""
[SourceDisksFiles]
ThirdTouch.sys = 1,,
;*****************************************
; Install Section
;*****************************************
[Manufacturer]
%ManufacturerName% = Standard,NT$ARCH$.10.0...16299 ; %13% support introduced in build 16299
[Standard.NT$ARCH$.10.0...16299]
%ThirdTouch.DeviceDesc% = ThirdTouch_Device, ACPI\VEN_TEST&DEV_1234 ; TODO: edit hw-id
[ThirdTouch_Device.NT]
CopyFiles = File_Copy
[File_Copy]
ThirdTouch.sys
[ThirdTouch_Device.NT.HW]
AddReg = ThirdTouch_Device.HW.AddReg
[ThirdTouch_Device.HW.AddReg]
HKR,,"UpperFilters",0x00010008,"ThirdTouch"
;-------------- Service installation
[ThirdTouch_Device.NT.Services]
AddService = ThirdTouch,, ThirdTouch_Service_Inst
AddService = ,2
; -------------- ThirdTouch driver install sections
[ThirdTouch_Service_Inst]
DisplayName = %ThirdTouch.SVCDESC%
ServiceType = 1 ; SERVICE_KERNEL_DRIVER
StartType = 3 ; SERVICE_DEMAND_START
ErrorControl = 1 ; SERVICE_ERROR_NORMAL
ServiceBinary = %13%\ThirdTouch.sys
[ThirdTouch_Device.NT.Wdf]
KmdfService = ThirdTouch, ThirdTouch_wdfsect
[ThirdTouch_wdfsect]
KmdfLibraryVersion = $KMDFVERSION$
[Strings]
ManufacturerName = "Co., Ltd." ;TODO: Replace with your manufacturer name
DiskName = "ThirdTouch Installation Disk"
ThirdTouch.DeviceDesc = "ThirdTouch Device"
ThirdTouch.SVCDESC = "ThirdTouch Service"
My installation order is SecondTouch (function driver) → ThirdTouch (filter driver).
I notice that the filter driver replaced completely the function driver.
It seems my configuration for filter driver is wrong and Windows still sees it as a function driver then replace my old function driver in the end.
How can I fix this issue?