WDF filter driver as top filter driver (e.g. MouFiltr sample driver to be loaded on top of stack)

CpAmolVaidya 20 Reputation points
2023-05-15T09:34:49.3233333+00:00

Hello

How to make Moufiltr as top driver in below list (& above Mouclass), what should be INF or code changes expected. Kindly share any links or tutorials if they are already there.

[Image

](https://filestore.community.support.microsoft.com/api/images/38c00bf0-304d-47b0-83eb-d519fccdd6b5?upload=true&fud_access=wJJIheezUklbAN2ppeDns8cDNpYs3nCYjgitr%2bfFBh2dqlqMuW7np3F6Utp%2fKMltnRRYFtVjOMO5tpbpW9UyRAwvLeec5emAPixgq9ta07Dgnp2aq5eJbnfd%2fU3qhn54kIhTDuBO%2bj4%2bGFVFVGdRiIbrAe6w6ygVVPDwK8B6gG5M2plSBjPDjV4muqdLPTwjkAk44Z0qVwWGTl%2bJdCy6wUlpjUWPcSnK2%2fOUN3HgmqZYF%2f7C4qAWHaCyyPOVVZN8Z8Y%2fUOhToc6uExP%2fzC7qIO1Xgi9o3Xe9t8%2feu7lt3MqSGC%2fw81eJhRrHPKl0R4m1XlxU3i76ehCk9DcvPDwrZuVJ2%2bYimM2LtZqbPjnJSiXIQLVfK3e0I2r3jC5zMIrkY31EC%2fuucCbbSGt3wM5NGU8ReNGCdsJd2S6ScDnb5RY%3d)

My INF file is as follows,

;/*++

;

; Copyright (c) Microsoft Corporation.  All rights reserved.

;

; Module Name:

;    moufiltr.inf

;

; Abstract:

;    Installation inf for the Device that needs filtering adapter.

;

; Important:

;    This INF depends on features for the Driver Store DIRIDs which are available starting Windows 10 1809

;

;--*/

[Version]

Signature="$Windows NT$"

Provider=%ProviderName%

ClassGUID={4D36E96F-E325-11CE-BFC1-08002BE10318}

Class=Mouse

DriverVer=02/05/2008, 1.0.0.0

CatalogFile=KmdfSamples.cat

PnpLockdown=1

[DestinationDirs]

DefaultDestDir = 13

[SourceDisksNames]

1 = %DiskId1%,,,

[SourceDisksFiles]

moufiltr.sys = 1

;

; Driver information

;

[Manufacturer]

%MfgName% = Standard,NT$ARCH$

[Standard.NT$ARCH$]

%HID\VID_17EF&PID_608D.DeviceDesc% = moufiltr, HID\VID_17EF&PID_608D

%HID\VID_17EF&UP:0001_U:0002.DeviceDesc% = moufiltr, HID\VID_17EF&UP:0001_U:0002

;

; General installation section

;

[moufiltr.NT]

; perform port related actions from mouse.inf

Include=msmouse.inf

Needs=HID_Mouse_Inst.NT

; Copy the driver over

CopyFiles=moufiltr.CopyFiles

;

; File sections

;

[moufiltr.CopyFiles]

moufiltr.sys

;

; Service Installation

;

[moufiltr.NT.Services]

AddService = moufiltr,  , moufiltr_Service_Inst

; Install the port driver and mouclass from msmouse.inf

Include=msmouse.inf

Needs=HID_Mouse_Inst.NT.Services

[moufiltr_Service_Inst]

DisplayName    = %moufiltr.SvcDesc%

ServiceType    = 1                  ; SERVICE_KERNEL_DRIVER

StartType      = 3                  ; SERVICE_DEMAND_START

ErrorControl   = 0                  ; SERVICE_ERROR_IGNORE

ServiceBinary  = %13%\moufiltr.sys

[moufiltr.NT.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.NT.Hw

[moufiltr.HW.AddReg]

HKR,,"UpperFilters",0x00010000,"moufiltr"

[moufiltr.NT.Wdf]

KmdfService = moufiltr, moufiltr_wdfsect

[moufiltr_wdfsect]

KmdfLibraryVersion = $KMDFVERSION$

[Strings]

;

; Non-Localizable Strings

;

REG_SZ         = 0x00000000

REG_MULTI_SZ   = 0x00010000

REG_EXPAND_SZ  = 0x00020000

REG_BINARY     = 0x00000001

REG_DWORD      = 0x00010001

;

; Localizable Strings

;

ProviderName = "TODO-Set-Provider"

MfgName      = "TODO-Set-Manufacturer"

moufiltr.DeviceDesc = "Mouse Filter Sample Device"

; Make sure the service description is unique to avoid collision with another INF.

moufiltr.SvcDesc = "Mouse Filter Sample Driver"

DiskId1 = "Mouse Filter Install Disk"

HID\VID_17EF&PID_608D.DeviceDesc = "Mouse Filter Sample Driver"

HID\VID_17EF&UP:0001_U:0002.DeviceDesc = "Mouse Filter Sample Driver"

Windows 10
Windows 10
A Microsoft operating system that runs on personal computers and tablets.
11,642 questions
C++
C++
A high-level, general-purpose programming language, created as an extension of the C programming language, that has object-oriented, generic, and functional features in addition to facilities for low-level memory manipulation.
3,742 questions
Windows Hardware Performance
Windows Hardware Performance
Windows: A family of Microsoft operating systems that run across personal computers, tablets, laptops, phones, internet of things devices, self-contained mixed reality headsets, large collaboration screens, and other devices.Hardware Performance: Delivering / providing hardware or hardware systems or adjusting / adapting hardware or hardware systems.
1,618 questions
0 comments No comments
{count} votes

Accepted answer
  1. Limitless Technology 44,346 Reputation points
    2023-05-18T13:53:41.05+00:00

    Hello CpAmolVaidya,

    Thank you for your question and for reaching out with your question today.

    It is possible to change the loading order for drivers but it relies on creating a parent/child relationship. The following link explains how to complete the task:

    https://learn.microsoft.com/windows-hardware/drivers/install/specifying-driver-load-order

    If the reply was helpful, please don’t forget to upvote or accept as answer.

    1 person found this answer helpful.

0 additional answers

Sort by: Most helpful

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.