Hi, is there any way to install an upper filter for USBHUB.SYS? I want to control all the USB devices. So I have to find a way to install a filter on USBHUB.SYS? Could this work be done by simply modifying the registry? I tried to install my filter as an upper filter over USB controller by adding “UpperFilters” value on {36fc9e60-c465-11cf-8056-444553540000} class. But this didn’t work.
So how to install an upper filter for USBHUB.SYS? Do I have to create an INF file for my filter and use the SetupDi APIs to install? Actually I generated an INF file and tried to use DevCon.exe to install it. But DevCon failed when it called UpdateDriverForPlugAndPlayDevices(). The returned error is 0xE0000219. I used “USB\ROOT_HUB” as the hardware ID for my filter. I used the following DevCon command.
devcon install myfilter.inf USB\ROOT_HUB
And here is my INF file.
[Version]
Signature = “$Windows NT$”
Class=USB
ClassGUID={36fc9e60-c465-11cf-8056-444553540000}
Provider=%TF%
DriverVer= 07/27/2007
[DestinationDirs]
SDUSBWPD.Files = 12 ; %windir%\system32\drivers
[Manufacturer]
%TF%=TF
[TF]
%SDUSBWPDDesc%=SDUSBWPD_Inst,USB\ROOT_HUB
[SDUSBWPD_Inst.NT]
Include=usb.inf
[SDUSBWPD_Inst.NT.HW]
CopyFiles = SDUSBWPD.Files
AddReg = SDUSBWPD.AddReg.NT.HW
[SDUSBWPD_Inst.NT.Services]
AddService = SDUSBWPD,SDUSBWPD_Service_Inst
[SDUSBWPD_Service_Inst]
DisplayName = “SecureDoc USB Port Control Driver”
ServiceType = %SERVICE_KERNEL_DRIVER%
StartType = %SERVICE_DEMAND_START%
ErrorControl = %SERVICE_ERROR_NORMAL%
ServiceBinary = %12%\SDUSBWPD.sys
LoadOrderGroup = “pnp filter”
[SDUSBWPD.AddReg.NT.HW]
HKR,UpperFilters,0x00010008,SDUSBWPD
[SDUSBWPD.Files]
SDUSBWPD.sys
[Strings]
; *******Localizable Strings*******
TF= “Test Filter”
SDUSBWPDDesc= “USB Port Controller”
; *******Non Localizable Strings*******
SERVICE_BOOT_START = 0x0
SERVICE_SYSTEM_START = 0x1
SERVICE_AUTO_START = 0x2
SERVICE_DEMAND_START = 0x3
SERVICE_DISABLED = 0x4
SERVICE_KERNEL_DRIVER = 0x1
SERVICE_ERROR_IGNORE = 0x0
SERVICE_ERROR_NORMAL = 0x1
SERVICE_ERROR_SEVERE = 0x2
SERVICE_ERROR_CRITICAL = 0x3
REG_EXPAND_SZ = 0x00020000
REG_DWORD = 0x00010001
Is there anything wrong with my INF file?
Thanks.