INF filter driver

Hello:
I developed a lower filter driver that I am attaching to usbser.sys using a class lower filter inf file but I just need to attach it to a particular device instead of a class setup. Hence I changed the inf file that install usbser.sys and added the filter driver sections. Nevertheless, when I install the inf file using the device manager, I can see in driver details both sys files (usbser.sys and lower.sys) but when I run “devcon stack=ports” I cannot see the lower filter driver and even worst the DebugView does not display anything. Can you point me why I am wrong? This is my inf file:
[Version]
Signature=“$Windows NT$”
Class=Ports
ClassGuid={4D36E978-E325-11CE-BFC1-08002BE10318}
Provider=%MANUFACTURER%
LayoutFile=layout.inf
;CatalogFile=%FILENAME%.cat

DriverVer= 4/24/2009,1.6.2600.1

[DestinationDirs]
DefaultDestDir=12

[Manufacturer]
“FSL Software”

[SourceDiskFiles]
usbser.sys=1
low_usb.sys=1

[SimpleFilterDriverInstall]
CopyFiles=SimpleFilterDriverCopyFiles
AddReg=SimpleFilterDriverAddReg

[SimpleFilterDriverCopyFiles]
usbser.sys
low_usb.sys

[SimpleFilterDriverAddReg]
HKR,DevLoader,*ntkern
HKR,NTMPDriver,usbser.sys
HKR,EnumPropPages32,“MsPorts.dll,SerialPortPropPageProvider”

[SimpleFilterDriverInstall.hw]
AddReg=FilterAddreg

[FilterAddreg]
HKR,LowerFilters,0x00010000,low_usb.sys

[SimpleFilterDriverInstall.nt]
CopyFiles=SimpleCopyFiles

[SimpleFilterDriverInstall.nt.Services]
AddService=usbser,2,SimpleService
AddService=low_usb,FilterService

[SimpleService]
ServiceType=1 ; SERVICE_KERNEL_DRIVER
StartType=3 ; SERVICE_DEMAND_START
ErrorControl=1 ; SERVICE_ERROR_NORMAL
ServiceBinary=%12%\usbser.sys

[FilterService]
ServiceType=1
StartType=3
ErrorControl=1
ServiceBinary=%12%\low_usb.sys

[SimpleFilterDriverInstall.NT.hw]
AddReg=FilterAddreg.nt

[FilterAddreg.nt]
HKR,LowerFilters,0x00010000,low_usb.sys

xxxxx@pounceconsulting.com wrote:

Hello:
I developed a lower filter driver that I am attaching to usbser.sys using a class lower filter inf file but I just need to attach it to a particular device instead of a class setup. Hence I changed the inf file that install usbser.sys and added the filter driver sections. Nevertheless, when I install the inf file using the device manager, I can see in driver details both sys files (usbser.sys and lower.sys) but when I run “devcon stack=ports” I cannot see the lower filter driver and even worst the DebugView does not display anything. Can you point me why I am wrong?

How did you install this?

This is my inf file:
[Version]

[DestinationDirs]
DefaultDestDir=12

[Manufacturer]
“FSL Software”

This can’t be your real INF file. The lines in the manufacturer section
have to point to the individual device sections, which match up your INF
with specific devices. Example:

[Manufacturer]
“FSL Software”=SimpleFilter

[SimpleFilter]
“Our Device”=SimpleFilterDriverInstall, USB\VID_xxxx&PID_yyyy

[SimpleFilterDriverAddReg]
HKR,DevLoader,*ntkern
HKR,NTMPDriver,usbser.sys
HKR,EnumPropPages32,“MsPorts.dll,SerialPortPropPageProvider”

Unless you plan to run on Windows 98, the “DevLoader” and “NTMPDriver”
lines serve no purpose whatsoever. I really wonder how long it’s going
to take before we stop seeing these in INF files.

You don’t have an AddReg section for the .nt section. Was that an
oversight? Really, unless you plan to support Windows 98 or 2000, you
don’t really need separate sections for [SimpleFilterDriverInstall] and
[SimpleFilterDriverInstall.nt]

[FilterAddreg]
HKR,LowerFilters,0x00010000,low_usb.sys

That’s dangerous, because it REPLACES the LowerFilters key with your
value, thereby deleting whatever filter(s) might have been there
already. You should use 0x00010008.


Tim Roberts, xxxxx@probo.com
Providenza & Boekelheide, Inc.

Tim:
Yes it’s true. I used a old template for the inf file, sorry. Now this was the inf file that the device used to install usbser.sys so I modified it to include the lower filter. I installed through Device Manager (update driver) and no error came up but still devcon stack=ports does not see the lower filter.
;------------------------------------------------------------------------------
; Freescale Semiconductor INC.
; Communication Device Class(CDC) INF File
;------------------------------------------------------------------------------

[Version]
Signature=“$Windows NT$”
Class=Ports
ClassGuid={4D36E978-E325-11CE-BFC1-08002BE10318}
Provider=%MANUFACTURER%
LayoutFile=layout.inf
;CatalogFile=%FILENAME%.cat

DriverVer= 4/24/2009,1.1.2600.1

[Manufacturer]
%MANUFACTURER%=DeviceList,NTamd64

[DestinationDirs]
DefaultDestDir=12

;------------------------------------------------------------------------------
; Windows 2000/XP
;------------------------------------------------------------------------------
[DriverInstall.nt]
include=mdmcpq.inf
CopyFiles=DriverCopyFiles.nt
AddReg=DriverInstall.nt.AddReg

[DriverCopyFiles.nt]
usbser.sys,0x20
low_usb.sys

[DriverInstall.nt.AddReg]
HKR,DevLoader,*ntkern
HKR,NTMPDriver,%DRIVERFILENAME%.sys
HKR,EnumPropPages32,“MsPorts.dll,SerialPortPropPageProvider”
HKR,“LowerFilters”,0x00010008,“low_usb”

[DriverInstall.nt.Services]
AddService=usbser, 0x00000002, DriverService.nt
AddService = low_usb, , lowfilt_Service_Inst

[DriverService.nt]
DisplayName=%SERVICE%
ServiceType=1
StartType=3
ErrorControl=1
ServiceBinary=%12%%DRIVERFILENAME%.sys

[lowfilt_Service_Inst]
DisplayName = “Lower Class Filter Driver for FSL”
ServiceType = 1
StartType = 3
ErrorControl = 1
ServiceBinary = %12%\low_usb.sys

;------------------------------------------------------------------------------
; VID/PID Settings
;------------------------------------------------------------------------------
[SourceDisksFiles]
[SourceDisksNames]
[DeviceList]
%DESCRIPTION%=DriverInstall, USB\VID_15A2&PID_A50E
%DESCRIPTION%=DriverInstall, USB\VID_15A2&PID_A50F

[DeviceList.NTamd64]
%DESCRIPTION%=DriverInstall, USB\VID_15A2&PID_A50E
%DESCRIPTION%=DriverInstall, USB\VID_15A2&PID_A50F

;------------------------------------------------------------------------------
; String Definitions
;------------------------------------------------------------------------------
[Strings]

FILENAME=“FSL_cdc”
DRIVERFILENAME =“usbser”
MANUFACTURER=“Freescale Semiconductor”
INSTDISK=“USB2UART”
DESCRIPTION=“Freescale CDC Device”
SERVICE=“Virtual Com Driver”

xxxxx@pounceconsulting.com wrote:

Yes it’s true. I used a old template for the inf file, sorry. Now this was the inf file that the device used to install usbser.sys so I modified it to include the lower filter. I installed through Device Manager (update driver) and no error came up but still devcon stack=ports does not see the lower filter.

Don’t you go through the registry after an installation and double-check
to make sure your INF did what you think? In this case, you’d find that
the LowerFilters value is in the wrong key.

;------------------------------------------------------------------------------
; Windows 2000/XP
;------------------------------------------------------------------------------
[DriverInstall.nt]
include=mdmcpq.inf
CopyFiles=DriverCopyFiles.nt
AddReg=DriverInstall.nt.AddReg

[DriverCopyFiles.nt]
usbser.sys,0x20
low_usb.sys

[DriverInstall.nt.AddReg]
HKR,DevLoader,*ntkern
HKR,NTMPDriver,%DRIVERFILENAME%.sys
HKR,EnumPropPages32,“MsPorts.dll,SerialPortPropPageProvider”
HKR,“LowerFilters”,0x00010008,“low_usb”

You to move the AddReg line into an HW section:
[DriverInstall.nt.HW]
AddReg=DriverInstall.nt.AddReg

Also, unless you plan to test on the 16-bit systems (Win 98 and Win ME),
you need to remove the DevLoader and NTMPDriver lines. They are useless
in NT.

;------------------------------------------------------------------------------
; String Definitions
;------------------------------------------------------------------------------
[Strings]

FILENAME=“FSL_cdc”
DRIVERFILENAME =“usbser”
MANUFACTURER=“Freescale Semiconductor”
INSTDISK=“USB2UART”
DESCRIPTION=“Freescale CDC Device”
SERVICE=“Virtual Com Driver”

This is not really a “virtual” driver at all. This is a com driver for
a real piece of hardware. You’re translating, you’re not inventing
hardware from thin air.


Tim Roberts, xxxxx@probo.com
Providenza & Boekelheide, Inc.

Tim:
With this line
[DriverInstall.nt.HW]
AddReg=DriverInstall.nt.AddReg

It worked! Even I was able to install also my upper filter driver at the same time.
Thank you!!!