Done! Thank you so much Tim_Roberts! AddDevice function was called! (But IRP_MJ_PNP not accepted, after my driver was loaded, it is automatically unloaded after AddDevice function is finished. May be i should change my AddDevice function and create device for IRP can be accepted?)… P.S: I am installed my driver through Device Manager → Update Driver
My final inf file looks like that
[Version]
Signature=“$Windows NT$”
Class=Mouse
ClassGUID={4D36E96F-E325-11CE-BFC1-08002BE10318}
Provider=%Provider%
DriverVer=03/17/2001,1.0.0.1
CatalogFile=MouseDriver.cat
CatalogFile.NTAMD64 = MouseDriver.cat
PnpLockdown=1
[DestinationDirs]
DefaultDestDir = 13
[SourceDisksNames]
1 = %DiskName%
[SourceDisksFiles]
MouseDriver.sys = 1
[ControlFlags]
; We don’t want our device to be installable via the non-PnP hardware dialogs
ExcludeFromSelect = *
; Manufacturer Section
; ---------------------------------------------------------
[Manufacturer]
%ShinyThings%=ShinyThingsMfg,NT,NTAMD64
; Devices Section
; ---------------------------------------------------------
[ShinyThingsMfg.NTAMD64]
%HID\Vid_045E&Pid_001E.DeviceDesc%=MouseDriver_Inst, HID\Vid_045E&Pid_001E
%HID\Vid_045E&Pid_0029.DeviceDesc%=MouseDriver_Inst, HID\Vid_045E&Pid_0029
%HID\Vid_045E&Pid_0039.DeviceDesc%=MouseDriver_Inst, HID\Vid_045E&Pid_0039
%HID\Vid_045E&Pid_0040.DeviceDesc%=MouseDriver_Inst, HID\Vid_045E&Pid_0040
%HID\Vid_045E&Pid_0047.DeviceDesc%=MouseDriver_Inst, HID\Vid_045E&Pid_0047
%HID\Vid_10C4&PID_8108.DeviceDesc%=MouseDriver_Inst, HID\Vid_10C4&PID_8108
; Install Section
; ---------------------------------------------------------
[MouseDriver_Inst.NTAMD64]
Include = MSMOUSE.INF
Needs = HID_Mouse_Inst.NT
CopyFiles = MouseDriver_Inst_CopyFiles.NT
[MouseDriver_Inst.NTAMD64.HW]
Include = MSMOUSE.INF
Needs = HID_Mouse_Inst.NT.Hw
AddReg = MouseDriver_Inst_HWAddReg.NT
[MouseDriver_Inst_HWAddReg.NTAMD64]
HKR,“UpperFilters”,0x00010000,“MouseDriver”
[MouseDriver_Inst_CopyFiles.NTAMD64]
MouseDriver.sys
[MouseDriver_Inst.NTAMD64.Services]
Include = MSMOUSE.INF
Needs = HID_Mouse_Inst.NT.Services
AddService = MouseDriver, 2, MouseDriver_Service_Inst
[MouseDriver_Service_Inst]
DisplayName = %MouseDriver.SvcDesc%
ServiceType = 1 ; SERVICE_KERNEL_DRIVER
StartType = 3 ; SERVICE_DEMAND_START
ErrorControl = 1 ; SERVICE_ERROR_NORMAL
ServiceBinary = %13%\MouseDriver.sys
;[MouseDriver_Inst.NT.Wdf]
;KmdfService = MouseDriver, MouseDriver_wdfsect
;[MouseDriver_wdfsect]
;KmdfLibraryVersion = $KMDFVERSION$
; Strings Section
; ---------------------------------------------------------
[Strings]
; Provider names
Provider = “TODO-Set-Provider”
; Mfg names
ShinyThings = “Shiny Things”
; Service names
MouseDriver.SvcDesc = “MouseDriver Service”
; Media names
DiskName = “MouseDriver Driver Disk”
; HID device IDs
HID\VID_045E&PID_001E.DeviceDesc = “Shiny Things MouseDriver Mouse”
HID\VID_045E&PID_0029.DeviceDesc = “Shiny Things MouseDriver Mouse”
HID\VID_045E&PID_0039.DeviceDesc = “Shiny Things MouseDriver Mouse”
HID\VID_045E&PID_0040.DeviceDesc = “Shiny Things MouseDriver Mouse”
HID\VID_045E&PID_0047.DeviceDesc = “Shiny Things MouseDriver Mouse”
HID\VID_10C4&PID_8108.DeviceDesc = “Shiny Things MouseDriver 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