The following, which works for floppies, is based on my WDM driver sample
(see http://home.mindspring.com/~antognini):
- The .inf file.
; (c) Copyright 2003 James Antognini
[Version]
Signature = “$Windows NT$”
Class=FloppyDisk
ClassGUID={4d36e980-e325-11ce-bfc1-08002be10318}
Provider=%JA%
DriverVer= 10/07/2003,2.00
CatalogFile=whatever.cat
[DestinationDirs]
DefaultDestDir = 12
[SourceDisksFiles]
JAf2Driver.sys=0,
[SourceDisksNames]
0=“Stuff”,whatever.cat
[DefaultInstall]
CopyFiles = HitherToThither
Addreg = JAf2Driver.AddReg
[HitherToThither]
JAf2Driver.sys,2
[DefaultInstall.Services]
AddService = JAf2Driver, ,JAf2DriverServiceInstall
[JAf2Driver.AddReg]
HKLM,
System\CurrentControlSet\Control\Class{4d36e980-e325-11ce-bfc1-08002be10318},
UpperFilters, 0x00010008, JAf2Driver
; 0x00010008 ==> FLG_ADDREG_TYPE_MULTI_SZ | FLG_ADDREG_APPEND
[JAf2DriverServiceInstall]
ServiceType = %SERVICE_KERNEL_DRIVER%
StartType = %SERVICE_BOOT_START%
ErrorControl = %SERVICE_ERROR_IGNORE%
ServiceBinary = %12%\JAf2Driver.sys
[Strings]
; *******Localizable Strings*******
JA= “Antognini”
; *******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
- A command to instate the filter driver, using the above:
%systemroot%\System32\rundll32.exe setupapi,InstallHinfSection DefaultInstall
132 C:\temp\JAf2Driver\floppyFilter.inf
- A command to actually start things (depends on devcon.exe, which is part
of the DDK):
devcon restart =floppydisk
If one wants to uninstall:
- This command:
devcon classfilter floppydisk upper !JAf2driver
- This command:
devcon restart =floppydisk
I’ve got similar solutions for the CD/DVD stack and the harddisk stack. The
latter, however, requires a reboot since the driver stack for the disk with
OS files cannot be changed on the fly.
One of these days this stuff will appear in an update to the Web site.
vincent gambit wrote:
the toaster sample is filtering the toaster.sys
but how do i do it if i want to filter those device thats already been
installed, like disk, ports, etc?
–
If replying by e-mail, please remove “nospam.” from the address.
James Antognini
Windows DDK MVP