Hi,
I am trying to write a Pci Bus filter driver that attaches itself below PCI Express Root Port(pci.sys) and above
PCI Express Upstream Switch Port(pci.sys).When we install my Upper filter driver on PEUSP, it seem to affect(restart) other
PCI Express Root Ports(that attached pci devices).Then system hang for a few seconds before it complete.Maybe soon or thirty seconds based on platforms.
Is the behavior of restarting other PCI Express Root Ports correctily?or i just need to modify my INF file correctilly?
Any help regarding the cause of this behavior or any steps that I have missed that would cause this would be greatly appreciated.
-
I create a sample filter driver according to
https://github.com/microsoft/Windows-driver-samples/tree/main/general/toaster/toastDrv/kmdf/filter -
I create and test two INF files, see below
[Version]
Signature=“$WINDOWS NT$”
Class=System
ClassGuid={4D36E97D-E325-11CE-BFC1-08002BE10318}
Provider=%TEST%
CatalogFile=filter64.cat
DriverVer = 06/15/2023,10.16.46.97
PnpLockdown=1
;*************************
; Source file information
;*************************
[SourceDisksNames]
1 = %DiskName%,“”
[SourceDisksFiles]
asmfilter64.sys = 1,
[DestinationDirs]
DefaultDestDir = 12 ;system32/drivers
[ControlFlags]
ExcludeFromSelect=*
;*****************************************
; filter Install Section
;*****************************************
[Manufacturer]
%TEST%=Standard,NTamd64
[Standard.NTamd64]
%filter.DeviceDesc%=FilterInstall, PCI\VEN_XXXX&DEV_XXXX
[FilterInstall]
Include=machine.inf
Needs=PCI_DRV
CopyFiles=FilterInstall.Copy
[FilterInstall.Copy]
filter64.sys
[FilterInstall.HW]
Include=machine.inf
Needs=PCI_DRV.HW
AddReg=FilterInstall.HW.AddReg
[FilterInstall.HW.AddReg]
HKR,“UpperFilters”,0x00010008,“filter64”
[FilterInstall.Services]
;Do not specify SPSVCINST_ASSOCSERVICE on filter drivers.
Include=machine.inf
Needs=PCI_DRV.Services
AddService=filter64,ufilter_Service_Inst
[ufilter_Service_Inst]
DisplayName = %ufilter.SvcName%
Description = %ufilter.SvcDesc%
ServiceType = 1 ; SERVICE_KERNEL_DRIVER
StartType = 3 ; SERVICE_DEMAND_START
ErrorControl = 1 ; SERVICE_ERROR_NORMAL
ServiceBinary = %12%\filter64.sys
LoadOrderGroup = “PnP Filter”
[Strings]
TEST=“Technology Inc.”
DiskName = “Filter Installation Disk”
filter.DeviceDesc = “PCI Upstream Port”
ufilter.SvcName = “PCI Upper Filter”
ufilter.SvcDesc = “PCI Upper Filter Service”
or
[Version]
Signature=“$WINDOWS NT$”
Class=System
ClassGuid={4D36E97D-E325-11CE-BFC1-08002BE10318}
Provider=%TEST%
CatalogFile=filter64.cat
DriverVer = 06/15/2023,13.39.37.918
;*************************
; Source file information
;*************************
[SourceDisksNames]
1 = %DiskName%,“”
[SourceDisksFiles]
filter64.sys = 1,
[DestinationDirs]
DefaultDestDir = 12 ;system32/drivers
[ControlFlags]
ExcludeFromSelect=*
;*****************************************
; filter Install Section
;*****************************************
[Manufacturer]
%TEST%=Standard,NTamd64
[Standard.NTamd64]
%filter.DeviceDesc%=FilterInstall, PCI\VEN_XXXX&DEV_XXXX
[FilterInstall]
Include=machine.inf
Needs=PCI_DRV_ROOT
CopyFiles=FilterInstall.Copy
[FilterInstall.Copy]
filter64.sys
[FilterInstall.HW]
Include=machine.inf
Needs=PCI_DRV_ROOT.HW
AddReg=FilterInstall.HW.AddReg
[FilterInstall.HW.AddReg]
HKR,“UpperFilters”,0x00010008,“filter64”
[FilterInstall.Services]
;Do not specify SPSVCINST_ASSOCSERVICE on filter drivers.
Include=machine.inf
Needs=PCI_DRV_ROOT.Services
AddService=filter64,ufilter_Service_Inst
[ufilter_Service_Inst]
DisplayName = %ufilter.SvcName%
Description = %ufilter.SvcDesc%
ServiceType = 1 ; SERVICE_KERNEL_DRIVER
StartType = 0 ; SERVICE_BOOT_START
ErrorControl = 1 ; SERVICE_ERROR_NORMAL
ServiceBinary = %12%\filter64.sys
LoadOrderGroup = “Boot Bus Extender”
[Strings]
TEST=“ASMedia Technology Inc.”
DiskName = “Filter Installation Disk”
filter.DeviceDesc = “PCI Upstream Port”
ufilter.SvcName = “PCI Upper Filter”
ufilter.SvcDesc = “PCI Upper Filter Service”