Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Install moufiltr on HID class driver

480 views
Skip to first unread message

Liang Fu

unread,
Mar 21, 2005, 11:23:30 AM3/21/05
to
Hi everyone,
I installed moufiltr on the PS/2 port by simply replacing *PNP0FAKE with
*PNP0F13 in moufiltr.inf (thanks for the support from this site) and I could
monitor and modify PS/2 mouse data packets in MouFilter_ServiceCallback
routine . Now I would like to do the same for the USB mouse, i.e., I would
like to modify moufiltr.inf so that I can install moufiltr on top of HID
class. What parts in moufiltr.inf do I have to change?

Thanks in advance.
Liang Fu


Ray Trent

unread,
Mar 22, 2005, 1:10:01 PM3/22/05
to
If you want to filter all mice, make it a MOUCLASS lower filter.

If you want to filter USB mice particularly, just set your PnP ID to the
PnP ID of the USB mouse you're trying to filter. If you don't know what
that will be, you can use HID_DEVICE_SYSTEM_MOUSE, though that will
install you as an upper filter on MOUHID, rather than HIDCLASS. One
might wonder, though, why being on top of HIDCLASS would be desirable.
It's not a spot you'd usually want to install on.

On the other hand, I've said this several times before, so I think I'll
shut up after this...

--
../ray\..

Liang Fu

unread,
Mar 24, 2005, 3:05:38 PM3/24/05
to
Ray,
Thank you very much for your help. Unfortunately, when I changed *PNP0F13
(which you taught me and worked perfect for PS/2 mouse) to
HID_DEVICE_SYSTEM_MOUSE in moufiltr.inf, I got error message from FastInst:
Error E0000219 in UpdateDriverForPlugAndPlayDevices:
ERROR_NO_ASSOCIATED_SERVICE

I copied my moufiltr.inf down below. I know that my mistakes are probably
laughable, but please help me to correct them.

Thanks in advance.

Liang Fu

; moufiltr.inf
;
; Installation inf for the Device that needs flitering adapter.
;
; (c) Copyright 1999 Microsoft
;

[Version]
Signature="$Windows NT$"
Provider=%DDK_Ex%
ClassGUID={4D36E96F-E325-11CE-BFC1-08002BE10318}
Class=Mouse
CatalogFile=moufiltr.cat
DriverVer=07/20/1999

[DestinationDirs]
DefaultDestDir = 12

;
; Driver information
;

[Manufacturer]
%DDK_Ex% = DDK_Ex.Mfg

[DDK_Ex.Mfg]
%DDK_Ex% = moufiltr, *PNP0FAKE


;
; General installation section
;

[moufiltr]
; perform port related actions from msmouse.inf
Include=msmouse.inf
Needs=PS2_Inst

; Copy the driver over
CopyFiles=moufiltr.CopyFiles


;
; File sections
;

[moufiltr.CopyFiles]
moufiltr.sys


;
; Service Installation
;

[moufiltr.Services]
AddService = moufiltr, , moufiltr_Service_Inst
; Install the port driver and mouclass from msmouse.inf
Include=msmouse.inf
Needs=PS2_Inst.Services

[moufiltr_Service_Inst]
DisplayName = %moufiltr.SvcDesc%
ServiceType = 1 ; SERVICE_KERNEL_DRIVER
StartType = 3 ; SERVICE_DEMAND_START
ErrorControl = 0 ; SERVICE_ERROR_IGNORE
LoadOrderGroup = Pointer Port
ServiceBinary = %12%\moufiltr.sys

[moufiltr.HW]
; Add the device upper filter
AddReg = moufiltr.HW.AddReg

; run the directives need by the port driver
Include=msmouse.inf
Needs=PS2_Inst.HW

[moufiltr.HW.AddReg]
HKR,,"UpperFilters",0x00010000,"moufiltr"


;
; Source file information
;

; use [SourceDisksNames.x86] for x86 only installs
; use [SourceDisksNames.alpha] for alpha only installs

[SourceDisksNames]
1 = %DiskId1%,,,

[SourceDisksFiles]
moufiltr.sys = 1,,


[Strings]

;
; Non-Localizable Strings
;

REG_SZ = 0x00000000
REG_MULTI_SZ = 0x00010000
REG_EXPAND_SZ = 0x00020000
REG_BINARY = 0x00000001
REG_DWORD = 0x00010001
SERVICEROOT = "System\CurrentControlSet\Services"

;
; Localizable Strings
;

DiskId1 = "DDK Example Installation Disk #1 (Mouse)"
DDK_Ex = "DDK Example Device that needs flitering"
moufiltr.SvcDesc="Mouse Filter Example"


"Ray Trent" <rat...@nospam.nospam> wrote in message
news:ezF5NpwL...@TK2MSFTNGP10.phx.gbl...

Ray Trent

unread,
Mar 24, 2005, 4:51:42 PM3/24/05
to
The only thing I see that's obvious is that in the INF file you
included, the PNP ID was still "*PNP0FAKE", rather than
HID_DEVICE_SYSTEM_MOUSE.

--
../ray\..

Liang Fu

unread,
Mar 24, 2005, 5:02:44 PM3/24/05
to
Sorry, I copied the original moufiltr.inf in my first email. But I did
change it to HID_DEVICE_SYSTEM_MOUSE and also *HID_DEVICE_SYSTEM_MOUSE in
my modified moufiltr.inf. Both cases I got the same error message quoted in
my first email.

Liang Fu

"Ray Trent" <rat...@nospam.nospam> wrote in message

news:e%23IybuLM...@tk2msftngp13.phx.gbl...

Ray Trent

unread,
Mar 24, 2005, 5:21:53 PM3/24/05
to
Oh, right... In your needs/includes section, you need to change the
"PS2_Inst" to "HID_Mouse_Inst" (actually, you probably only need to
include "HID_Mouse_Inst.NT.Services", but I'm not sure about that in
this situation).

--
../ray\..

Liang Fu

unread,
Mar 25, 2005, 8:47:20 AM3/25/05
to
Thanks for your help.
I experimented with various modifications of moufiltr.inf, following your
suggestion. But I always get the same error message: Error E0000219 in
UpdateDriverForPlugAndPlayDevices:
ERROR_NO_ASSOCIATED_SERVICE
The following is a typical modified moufiltr.inf that I used (I tried with
or without * in front of PNP_DEVICE_SYSTEM_MPUSE, different PNP IDs, such as
HID\VID_046D&PID_C00x (x=0,1,2,3), etc.).
============================================================================
=====

; moufiltr.inf
;
; Installation inf for the Device that needs flitering adapter.
;
; (c) Copyright 1999 Microsoft
;

[Version]
Signature="$Windows NT$"
Provider=%DDK_Ex%
ClassGUID={4D36E96F-E325-11CE-BFC1-08002BE10318}
Class=Mouse
CatalogFile=moufiltr.cat
DriverVer=07/20/1999

[DestinationDirs]
DefaultDestDir = 12

;
; Driver information
;

[Manufacturer]
%DDK_Ex% = DDK_Ex.Mfg

[DDK_Ex.Mfg]
%DDK_Ex% = moufiltr, HID_DEVICE_SYSTEM_MOUSE


;
; General installation section
;

[moufiltr]
; perform port related actions from msmouse.inf
Include=msmouse.inf

Needs=HID_Mouse_Inst

; Copy the driver over
CopyFiles=moufiltr.CopyFiles


;
; File sections
;

[moufiltr.CopyFiles]
moufiltr.sys


;
; Service Installation
;

[moufiltr.Services]
AddService = moufiltr, , moufiltr_Service_Inst
; Install the port driver and mouclass from msmouse.inf
Include=msmouse.inf

Needs=HID_Mouse_Inst.Services

[moufiltr_Service_Inst]
DisplayName = %moufiltr.SvcDesc%
ServiceType = 1 ; SERVICE_KERNEL_DRIVER
StartType = 3 ; SERVICE_DEMAND_START
ErrorControl = 0 ; SERVICE_ERROR_IGNORE
LoadOrderGroup = Pointer Port
ServiceBinary = %12%\moufiltr.sys

[moufiltr.HW]
; Add the device upper filter
AddReg = moufiltr.HW.AddReg

; run the directives need by the port driver
Include=msmouse.inf

Needs=HID_Mouse_Inst.HW

[moufiltr.HW.AddReg]
HKR,,"UpperFilters",0x00010000,"moufiltr"


;
; Source file information
;

; use [SourceDisksNames.x86] for x86 only installs
; use [SourceDisksNames.alpha] for alpha only installs

[SourceDisksNames]
1 = %DiskId1%,,,

[SourceDisksFiles]
moufiltr.sys = 1,,


[Strings]

;
; Non-Localizable Strings
;

REG_SZ = 0x00000000
REG_MULTI_SZ = 0x00010000
REG_EXPAND_SZ = 0x00020000
REG_BINARY = 0x00000001
REG_DWORD = 0x00010001
SERVICEROOT = "System\CurrentControlSet\Services"

;
; Localizable Strings
;

DiskId1 = "DDK Example Installation Disk #1 (Mouse)"
DDK_Ex = "DDK Example Device that needs flitering"
moufiltr.SvcDesc="Mouse Filter Example"

"Ray Trent" <rat...@nospam.nospam> wrote in message

news:%23mkTT$LMFHA...@TK2MSFTNGP09.phx.gbl...

Ray Trent

unread,
Mar 25, 2005, 1:03:55 PM3/25/05
to
Hmmm. The only thing I see that's different from how we do this is that
now that I've looked, we actually needs/includes "HID_Mouse_Inst.NT" and
"HID_Mouse_Inst.NT.Services"... try that.

Other than that, I'm at a loss. Have you tried running chkinf to make
sure you don't have any typos or other hard to see errors?

--
../ray\..

Liang Fu

unread,
Mar 25, 2005, 3:02:29 PM3/25/05
to
Ray,
Thank you so much for your kind help. I just tried including
HID_Mouse_Inst.NT and HID_Mouse_Inst.NT.Services. I still get the same
error. The only parts that I have changed are these includes and the PNP ID,
which I checked carefully for typo. I tried to run chkinf, it complains
"Can't open MSMOUSE.INF for input". I don't have msmouse.inf in my system
(it does not come with DDK). What confuses me is that my PS/2 version of
moufiltr.inf (simply replaced *PNP0FAKE to *PNP0F13 in the original
moufiltr.inf) does not pass chkinf for the same reason, but it works fine.

Liang Fu
"Ray Trent" <rat...@nospam.nospam> wrote in message

news:eVOA0TWM...@TK2MSFTNGP14.phx.gbl...

Doron Holan [MS]

unread,
Mar 26, 2005, 3:31:16 AM3/26/05
to
msmouse.inf lives in %windir%\inf\msmouse.inf

d

--
Please do not send e-mail directly to this alias. this alias is for
newsgroup purposes only.
This posting is provided "AS IS" with no warranties, and confers no rights.


"Liang Fu" <liang...@hotmail.com> wrote in message
news:umAmXXX...@TK2MSFTNGP15.phx.gbl...

Liang Fu

unread,
Mar 28, 2005, 11:43:58 AM3/28/05
to
Hi Doron,
Thanks for your help.
I have Windows 2000 professional OS, there is no %windir%\inf directory and
I have searched the entire system for msmouse.inf and the Search for files
or directory could not find it. But my main concern is not msmouse.inf since
I was able to install moufiltr on PS/2 port and it worked fine (although I
am still wondering how FastInst went about the missing msmouse.inf, which
was called in moufiltr.inf).
What I desperately want to know is how to modify the DDK's moufiltr.inf
so that I can install moufiltr to filter my USB mouse. For a novice in this
field like me, the detailed corrections to my (modified) moufiltr.inf (see
below) would be extremely helpful and greatly appreciated.

Thanks in advance,
Liang Fu

"Doron Holan [MS]" <dor...@nospam.microsoft.com> wrote in message
news:uf34u4dM...@tk2msftngp13.phx.gbl...

0 new messages