Dear Sirs,
Today, I’m trying to add a new upper class filter to the top of the original upper class filter. Its architecture is like:
new class filter(toaster upper class filter)
^
|
|
original class filter(a upper class filter given by other company)
^
|
|
function driver(camera driver, for example: UVC driver)
In fact, the original upper class driver and the function driver are given by other company and both work well.
Now, I want to develop a new upper class filter in order to do something myself. The sample of upper class filter I would like to use is toaster upper class filter in the WDK.(Is it suitable? Is there other beter samples?)
But I failed to add the toaster upper class filter on the top of the original class filter. My inf is like:
//////////////////////////////////////////////////////////////
[Version]
Signature=“$WINDOWS NT$”
Class=Image
ClassGuid={6bdd1fc6-810f-11d0-bec7-08002be2092f}
Provider=%MSFT%
DriverVer=09/21/2006,6.0.5736.1
CatalogFile=toaster.cat
[DestinationDirs]
DefaultDestDir = 12
ToasterClassInstallerCopyFiles = 11
; ================= Class section =====================
[ClassInstall32]
Addreg=ToasterClassReg
CopyFiles=ToasterClassInstallerCopyFiles
[ToasterClassReg]
HKR,0,%ClassName%
HKR,Icon,100
HKR,“UpperFilters”,0x00010000,“clsupper”
HKR,Installer32,“tostrcls.dll,ToasterClassInstaller”
HKR,DeviceCharacteristics,0x10001,0x100 ; Use same security checks on relative opens
HKR,Security,“D:P(A;;GA;;;SY)(A;;GA;;;BA)” ;Allow generic all access to system and built-in Admin.
;This one overrides the security set by the driver
[ToasterClassInstallerCopyFiles]
tostrcls.dll
;*****************************************
; Toaster Device Install Section
;*****************************************
[Manufacturer]
%StdMfg%=Standard
[Standard]
; DisplayName Section DeviceId
; ----------- ------- --------
%ToasterDevice.DeviceDesc%=Toaster_Device, USB\VID_0C45&PID_62C0
[Toaster_Device.NT]
CopyFiles=Toaster_Device.NT.Copy
[Toaster_Device.NT.HW]
AddReg=Toaster_Device.NT.HW.AddReg
[Toaster_Device.NT.Copy]
clsupper.sys
[Toaster_Device.NT.HW.AddReg]
;-------------- Service installation
[Toaster_Device.NT.Services]
AddService = clsupper, classupper_Service_Inst
; -------------- class upper Driver install section
[classupper_Service_Inst]
DisplayName = %classupper.SVCDESC%
ServiceType = 1 ; SERVICE_KERNEL_DRIVER
StartType = 3 ; SERVICE_DEMAND_START
ErrorControl = 1 ; SERVICE_ERROR_NORMAL
ServiceBinary = %12%\clsupper.sys
LoadOrderGroup = PNP Filter
[MySection]
MySpecialFlag
[SourceDisksNames]
1 = %DiskId1%,“”
[SourceDisksFiles]
clsupper.sys = 1,
tostrcls.dll = 1,
[Strings]
SPSVCINST_ASSOCSERVICE= 0x00000002
MSFT = “Microsoft”
StdMfg = “(Standard system devices)”
ClassName = “Toaster”
DiskId1 = “Toaster Device Installation Disk #1”
ToasterDevice.DeviceDesc = “MY Toaster with class filters”
toaster.SVCDESC = “Microsoft Toaster Device Driver”
devupper.SVCDESC = “Toaster Device Upper Filter”
devlower.SVCDESC = “Toaster Device Lower Filter”
classupper.SVCDESC = “Toaster Class Upper Filter”
classlower.SVCDESC = “Toaster Class Lower Filter”
//////////////////////////////////////////////////////////////
Why? What should I do to add the new upper class filter?(this is my focused question.)
In fact, Device Manager show I have installed the toaster filter to the device stack. But I think it doesn’t work. Because the original filter can get IRPs, even if I modify the toaster filter driver so that the new toaster filter driver does not send IRPs to the original filter driver. Why?
Another question is that I don’t know whether the new filter above the original one or below. How to tell the difference? How to determine class filter A is above class filter B?
My last question is that when I install the new toaster upper class filter, device manager show that many things disappear, such as ks.sys, ksproxy.ax and so on. Why? How to avoid this situation?
Thank you for your reading and answering.