-
-
未解决 [讨论][求助]PCIE过滤驱动如何开发 10雪币
-
发表于: 2025-12-1 16:48 523
-
PS E:\> .\devcon.exe stack "PCI\VEN_****&DEV_0010"
PCI\VEN_****&DEV_0010&SUBSYS_00000000&REV_10\4&39FF1125&0&0009
Name: PCI Configuration Filter Driver for VEN_****&DEV_0010
Setup Class: {4d36e97d-e325-11ce-bfc1-08002be10318} System
Controlling service:
PciConfig
Lower filters:
PciConfig
ROOT\SYSTEM\0002
Name: PCI Configuration Filter Driver for VEN_****&DEV_0010
Setup Class: {4d36e97d-e325-11ce-bfc1-08002be10318} System
Controlling service:
PciConfig
Lower filters:
PciConfig
2 matching device(s) found.
我电脑插入了一块pcie switch板卡,默认驱动是pci.sys我想在pci.sys驱动上安装一个过滤驱动,即上面的PciConfig,这个过滤驱动的功能主要是去读写pci配置和bar空间的操作。但是感觉安装后显示如上图所示。原来的pci.sys不见了。devcon.exe driverfiles又可以看到pci.sys,如下
PS E:\> .\devcon.exe driverfiles "PCI\VEN_****&DEV_0010*"
PCI\VEN_****&DEV_0010&SUBSYS_00000000&REV_10\4&39FF1125&0&0009
Name: PCI Configuration Filter Driver for VEN_****&DEV_0010
Driver installed from C:\WINDOWS\INF\oem31.inf [PciConfig_Device]. 2 file(s) used by driver:
C:\WINDOWS\system32\DRIVERS\PciConfig.sys
C:\WINDOWS\system32\DRIVERS\pci.sys
ROOT\SYSTEM\0002
Name: PCI Configuration Filter Driver for VEN_****&DEV_0010
Driver installed from C:\WINDOWS\INF\oem31.inf [PciConfig_Device]. 2 file(s) used by driver:
C:\WINDOWS\system32\DRIVERS\PciConfig.sys
C:\WINDOWS\system32\DRIVERS\pci.sys
2 matching device(s) found.
;
; PciConfig.inf
;
[Version]
Signature = "$WINDOWS NT$"
Class = System
ClassGuid = {4d36e97d-e325-11ce-bfc1-08002be10318}
Provider = %ManufacturerName%
CatalogFile = PciConfig.cat
DriverVer = 11/13/2025,1.0.0.0
PnpLockdown = 1
[DestinationDirs]
DefaultDestDir = 12
[SourceDisksNames]
1 = %DiskName%,,,""
[SourceDisksFiles]
PciConfig.sys = 1,,
;*****************************************
; Install Section
;*****************************************
[Manufacturer]
%ManufacturerName% = Standard,NT$ARCH$.10.0...16299
[Standard.NT$ARCH$.10.0...16299]
%PciConfig.DeviceDesc% = PciConfig_Device, PCI\VEN_****&DEV_0010&SUBSYS_00000000&REV_10
%PciConfig.DeviceDesc% = PciConfig_Device, PCI\VEN_****&DEV_0010&SUBSYS_00000000
%PciConfig.DeviceDesc% = PciConfig_Device, PCI\VEN_****&DEV_0010
[PciConfig_Device.NT]
; MODIFIED: 使用正确的节名 PCI_BRIDGE
Include=pci.inf
Needs=PCI_BRIDGE
CopyFiles = File_Copy
[PciConfig_Device.NT.HW]
AddReg = PciFilter_AddReg
[PciFilter_AddReg]
HKR,,"LowerFilters",0x00010008,"PciConfig"
[File_Copy]
PciConfig.sys
;-------------- Service installation
[PciConfig_Device.NT.Services]
; MODIFIED: 使用正确的服务节名 PCI_BRIDGE.Services
Include=pci.inf
Needs=PCI_BRIDGE.Services
AddService = PciConfig,%SPSVCINST_ASSOCSERVICE%, PciConfig_Service_Inst
; -------------- PciConfig driver install sections
[PciConfig_Service_Inst]
DisplayName = %PciConfig.SVCDESC%
ServiceType = 1 ; SERVICE_KERNEL_DRIVER
StartType = 3 ; SERVICE_DEMAND_START
ErrorControl = 1 ; SERVICE_ERROR_NORMAL
ServiceBinary = %12%\PciConfig.sys
LoadOrderGroup = "Filter"
[PciConfig_Device.NT.Wdf]
KmdfService = PciConfig, PciConfig_wdfsect
[PciConfig_wdfsect]
KmdfLibraryVersion = $KMDFVERSION$
[Strings]
SPSVCINST_ASSOCSERVICE = 0x00000002
ManufacturerName = "<**** Company>"
DiskName = "PciConfig Installation Disk"
PciConfig.DeviceDesc = "PCI Configuration Filter Driver for VEN_****&DEV_0010"
PciConfig.SVCDESC = "PCI Configuration Filter Service"
希望大佬给予指导,谢谢