I modify my INF file so that I can install the filter on a specific mouse device. I was able to install this filter by updating the mouse driver (have disk option). My filter was successful been installed ans started and I was able to handle control event of the HID Device. But now I a not sure if an upper filter is able the modify the HID data and pass the modified data to the OS. (considering the “keyboard and mouse HID client drivers” document: https://msdn.microsoft.com/en-us/library/windows/hardware/jj128406(v=vs.85).aspx )
I wan to intercept the mouse events generated by a Pen and generate touch events to the OS.
Here is my INF:
[Version]
Signature=“$Windows NT$”
Class=Mouse
ClassGUID={4D36E96F-E325-11CE-BFC1-08002BE10318}
Provider=%Provider%
DriverVer=02/25/2015,15.0.48.465
CatalogFile=KmdfSamples.cat
[DestinationDirs]
DefaultDestDir = 12 ; DIRID_DRIVERS
[ControlFlags]
; We don’t want our device to be installable via the non-PnP hardware dialogs
ExcludeFromSelect = *
; Manufacturer Section
; ---------------------------------------------------------
[Manufacturer]
%ShinyThings%=ShinyThingsMfg,NTamd64
; Devices Section for Win2K
; ---------------------------------------------------------
[ShinyThingsMfg]
%HID\Vid_0458&Pid_00CA.DeviceDesc%=Firefly_Inst, HID\Vid_0458&Pid_00CA
; Devices Section for XP and above
; ---------------------------------------------------------
[ShinyThingsMfg.NTamd64]
%HID\Vid_0458&Pid_00CA.DeviceDesc%=Firefly_Inst, HID\Vid_0458&Pid_00CA
; Install Section for Windows 2000 & Windows XP
; ---------------------------------------------------------
[Firefly_Inst.NT]
Include = MSMOUSE.INF
Needs = HID_Mouse_Inst.NT
CopyFiles = Firefly_Inst_CopyFiles.NT
[Firefly_Inst.NT.HW]
Include = MSMOUSE.INF
Needs = HID_Mouse_Inst.NT
AddReg = Firefly_Inst_HWAddReg.NT
[Firefly_Inst_HWAddReg.NT]
HKR,“UpperFilters”,0x00010000,“Firefly”
[Firefly_Inst_CopyFiles.NT]
Firefly.sys
[Firefly_Inst.NT.Services]
Needs = HID_Mouse_Inst.NT.Services
AddService = Firefly, , Firefly_Service_Inst
[Firefly_Service_Inst]
DisplayName = %Firefly.SvcDesc%
ServiceType = 1 ; SERVICE_KERNEL_DRIVER
StartType = 3 ; SERVICE_DEMAND_START
ErrorControl = 1 ; SERVICE_ERROR_NORMAL
ServiceBinary = %12%\Firefly.sys
LoadOrderGroup = PNP Filter
; Source Media Section
; ---------------------------------------------------------
[SourceDisksNames]
1 = %DiskName%
[SourceDisksFiles]
Firefly.sys = 1
;
;— Firefly_Inst WDF Coinstaller installation ------
;
[DestinationDirs]
Firefly_Inst_CoInstaller_CopyFiles = 11
[Firefly_Inst.NT.CoInstallers]
AddReg=Firefly_Inst_CoInstaller_AddReg
CopyFiles=Firefly_Inst_CoInstaller_CopyFiles
[Firefly_Inst_CoInstaller_AddReg]
HKR,CoInstallers32,0x00010000, “WdfCoInstaller01011.dll,WdfCoInstaller”
[Firefly_Inst_CoInstaller_CopyFiles]
WdfCoInstaller01011.dll
[SourceDisksFiles]
WdfCoInstaller01011.dll=1 ; make sure the number matches with SourceDisksNames
[Firefly_Inst.NT.Wdf]
KmdfService = Firefly, Firefly_wdfsect
[Firefly_wdfsect]
KmdfLibraryVersion = 1.11
; Strings Section
; ---------------------------------------------------------
[Strings]
; Provider names
Provider = “IsiQiri”
; Mfg names
ShinyThings = “QPen”
; Service names
Firefly.SvcDesc = “QPen Service”
; Media names
DiskName = “QPen Driver Disk”
; HID device IDs
HID\VID_0458&PID_00CA.DeviceDesc = “QPen Mouse”
; Standard defs
SPSVCINST_TAGTOFRONT = 0x00000001
SPSVCINST_ASSOCSERVICE= 0x00000002
SERVICE_KERNEL_DRIVER = 1
SERVICE_BOOT_START = 0
SERVICE_SYSTEM_START = 1
SERVICE_AUTO_START = 2
SERVICE_ERROR_NORMAL = 1
SERVICE_ERROR_IGNORE = 0
REG_EXPAND_SZ = 0x00020000
REG_DWORD = 0x00010001
REG_SZ = 0x00000000