how to install filter driver using inf file?

Hi,

How to install filter driver using inf file?
Is there any sample?

how to specify which device class we are filtering in the inf file?

can we filter different device class in the same inf file?

Thank You!

cheers,
vincent


Get 10mb of inbox space with MSN Hotmail Extra Storage
http://join.msn.com/?pgmarket=en-sg

Take a look at toster sample in Win2000/WinXP DDK.

Cyril

----- Original Message -----
From: “vincent gambit”
To: “Windows System Software Devs Interest List”
Sent: Thursday, November 06, 2003 10:01 AM
Subject: [ntdev] how to install filter driver using inf file?

> Hi,
>
> How to install filter driver using inf file?
> Is there any sample?
>
> how to specify which device class we are filtering in the inf file?
>
> can we filter different device class in the same inf file?
>
> Thank You!
>
> cheers,
> vincent
>
> _________________________________________________________________
> Get 10mb of inbox space with MSN Hotmail Extra Storage
> http://join.msn.com/?pgmarket=en-sg
>
>
> —
> Questions? First check the Kernel Driver FAQ at
http://www.osronline.com/article.cfm?id=256
>
> You are currently subscribed to ntdev as: xxxxx@wipro.com
> To unsubscribe send a blank email to xxxxx@lists.osr.com

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?

thank you

From: “Cyril”
>Reply-To: “Windows System Software Devs Interest List”
>
>To: “Windows System Software Devs Interest List”
>Subject: [ntdev] Re: how to install filter driver using inf file?
>Date: Thu, 6 Nov 2003 10:26:31 +0530
>
>Take a look at toster sample in Win2000/WinXP DDK.
>
>Cyril
>
>----- Original Message -----
>From: “vincent gambit”
>To: “Windows System Software Devs Interest List”
>Sent: Thursday, November 06, 2003 10:01 AM
>Subject: [ntdev] how to install filter driver using inf file?
>
>
> > Hi,
> >
> > How to install filter driver using inf file?
> > Is there any sample?
> >
> > how to specify which device class we are filtering in the inf file?
> >
> > can we filter different device class in the same inf file?
> >
> > Thank You!
> >
> > cheers,
> > vincent
> >
> >
> > Get 10mb of inbox space with MSN Hotmail Extra Storage
> > http://join.msn.com/?pgmarket=en-sg
> >
> >
> > —
> > Questions? First check the Kernel Driver FAQ at
>http://www.osronline.com/article.cfm?id=256
> >
> > You are currently subscribed to ntdev as: xxxxx@wipro.com
> > To unsubscribe send a blank email to xxxxx@lists.osr.com
>
>
>—
>Questions? First check the Kernel Driver FAQ at
>http://www.osronline.com/article.cfm?id=256
>
>You are currently subscribed to ntdev as: xxxxx@hotmail.com
>To unsubscribe send a blank email to xxxxx@lists.osr.com


Find it on the web with MSN Search. http://search.msn.com.sg/

The following, which works for floppies, is based on my WDM driver sample
(see http://home.mindspring.com/~antognini):

  1. 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

  1. A command to instate the filter driver, using the above:

%systemroot%\System32\rundll32.exe setupapi,InstallHinfSection DefaultInstall
132 C:\temp\JAf2Driver\floppyFilter.inf

  1. A command to actually start things (depends on devcon.exe, which is part
    of the DDK):

devcon restart =floppydisk

If one wants to uninstall:

  1. This command:

devcon classfilter floppydisk upper !JAf2driver

  1. 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

Hi,

Thanks for your reply.

By specifiing the class to be FloppyDisk, does that mean that the wdm driver
will filter floppy disk only?
so if i wan to filter floppydisk, cdrom and hard disk, how can i create the
inf file?.
is it possible?

thank you!

cheers,
vincent

From: James Antognini
>Reply-To: “Windows System Software Devs Interest List”
>
>To: “Windows System Software Devs Interest List”
>Subject: [ntdev] Re: how to install filter driver using inf file?
>Date: Thu, 06 Nov 2003 15:50:07 -0500
>
>The following, which works for floppies, is based on my WDM driver sample
>(see http://home.mindspring.com/~antognini):
>
>1) 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
>
>2) A command to instate the filter driver, using the above:
>
>%systemroot%\System32\rundll32.exe setupapi,InstallHinfSection
>DefaultInstall
>132 C:\temp\JAf2Driver\floppyFilter.inf
>
>3) A command to actually start things (depends on devcon.exe, which is part
>of the DDK):
>
>devcon restart =floppydisk
>
>If one wants to uninstall:
>
>1) This command:
>
>devcon classfilter floppydisk upper !JAf2driver
>
>2) 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
>
>
>
>—
>Questions? First check the Kernel Driver FAQ at
>http://www.osronline.com/article.cfm?id=256
>
>You are currently subscribed to ntdev as: xxxxx@hotmail.com
>To unsubscribe send a blank email to xxxxx@lists.osr.com

_________________________________________________________________
Get 10mb of inbox space with MSN Hotmail Extra Storage
http://join.msn.com/?pgmarket=en-sg

Floppies only. Use Help on devcon to learn the names for CDs/DVDs and harddisks. I
wrote separate .inf files for CD/DVD and for harddisk.

For CD/DVD:

Class=CDROM
ClassGuid={4D36E965-E325-11CE-BFC1-08002BE10318}

HKLM,
System\CurrentControlSet\Control\Class{4D36E965-E325-11CE-BFC1-08002BE10318},
UpperFilters, 0x00010008, JAf2Driver

For harddisk:

Class=DiskDrive
ClassGuid={4D36E967-E325-11CE-BFC1-08002BE10318}

HKLM,
System\CurrentControlSet\Control\Class{4D36E967-E325-11CE-BFC1-08002BE10318},
UpperFilters, 0x00010008, JAf2Driver

vincent gambit wrote:

By specifiing the class to be FloppyDisk, does that mean that the wdm driver
will filter floppy disk only?
so if i wan to filter floppydisk, cdrom and hard disk, how can i create the
inf file?.


If replying by e-mail, please remove “nospam.” from the address.

James Antognini
Windows DDK MVP

hi,

thanks for your reply.

Is this the same as editing the registry manually at the floppy. cd and
harddisk class,
eg:
HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Class{4D36E967-E325-11CE-BFC1-08002BE10318}
for hard disk and add UpperFilters?

Thank you!

cheers,
vincent

From: James Antognini
>Reply-To: “Windows System Software Devs Interest List”
>
>To: “Windows System Software Devs Interest List”
>Subject: [ntdev] Re: how to install filter driver using inf file?
>Date: Fri, 07 Nov 2003 09:35:11 -0500
>
>Floppies only. Use Help on devcon to learn the names for CDs/DVDs and
>harddisks. I
>wrote separate .inf files for CD/DVD and for harddisk.
>
>For CD/DVD:
>
>Class=CDROM
>ClassGuid={4D36E965-E325-11CE-BFC1-08002BE10318}
>…
>HKLM,
>System\CurrentControlSet\Control\Class{4D36E965-E325-11CE-BFC1-08002BE10318},
>UpperFilters, 0x00010008, JAf2Driver
>
>For harddisk:
>
>Class=DiskDrive
>ClassGuid={4D36E967-E325-11CE-BFC1-08002BE10318}
>…
>HKLM,
>System\CurrentControlSet\Control\Class{4D36E967-E325-11CE-BFC1-08002BE10318},
>UpperFilters, 0x00010008, JAf2Driver
>
>
>vincent gambit wrote:
>
> > By specifiing the class to be FloppyDisk, does that mean that the wdm
>driver
> > will filter floppy disk only?
> > so if i wan to filter floppydisk, cdrom and hard disk, how can i create
>the
> > inf file?.
>
>–
>If replying by e-mail, please remove “nospam.” from the address.
>
>James Antognini
>Windows DDK MVP
>
>
>
>—
>Questions? First check the Kernel Driver FAQ at
>http://www.osronline.com/article.cfm?id=256
>
>You are currently subscribed to ntdev as: xxxxx@hotmail.com
>To unsubscribe send a blank email to xxxxx@lists.osr.com

_________________________________________________________________
Get 10mb of inbox space with MSN Hotmail Extra Storage
http://join.msn.com/?pgmarket=en-sg

Pretty much the same.

vincent gambit wrote:

Is this the same as editing the registry manually at the floppy. cd and
harddisk class,
eg:
HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Class{4D36E967-E325-11CE-BFC1-08002BE10318}
for hard disk and add UpperFilters?


If replying by e-mail, please remove “nospam.” from the address.

James Antognini
Windows DDK MVP