;/*++
;win10安装建议使用"DPInst64.exe", win7安装必须使用devcon, 而签名后可以统一使用"DPInst64.exe"
;系统不存在硬件id时: devcon install vhidflt.inf "USB\VID_2516&PID_016D&MI_00"
;系统已经存在设备时: devcon update vhidflt.inf "USB\VID_2516&PID_016D&MI_00"
;                   devcon update vhidflt.inf "USB\VID_1A2C&PID_9ff6&MI_00"
;vhidev虚拟设备不会默认安装, 需要手动安装: devcon install vhidflt.inf root\vhidev
;注意: 若已存在设备, 任然使用install, 则会出现2个设备
;--*/
[Version]
Signature="$WINDOWS NT$"
;若修改为hidclass, 则需要将[ClassInstall32]及[SampleClassReg]屏蔽
Class=HIDClass
ClassGuid={745a17a0-74d3-11d0-b6fe-00a0c90f57da}
;Class=Sample
;ClassGuid={78A1C341-4539-11d3-B88D-00C04FAD5171}
Provider=%ProviderString%
DriverVer = 11/03/2021,18.13.46.429
CatalogFile=wudf.cat

; ================= Class section =====================

;[ClassInstall32]
;Addreg=SampleClassReg

;[SampleClassReg]
;HKR,,,0,%ClassName%
;HKR,,Icon,,-5

; ================= Device section =====================

[Manufacturer]
%ManufacturerString%=Microsoft,NTamd64.6.1

; Works on Win7 and later because we use inbox HID-KMDF mapper
[Microsoft.NTamd64.6.1]
%DeviceDesc%=vhidev, root\vhidev
%hidflt.DeviceDesc% = hidflt_Inst, USB\VID_2516&PID_1011&MI_01 ;指定地址的usb设备
%hidflt.DeviceDesc% = hidflt_Inst, USB\VID_2516&PID_016D&MI_00 ;指定地址的usb设备
%hidflt.DeviceDesc% = hidflt_Inst, USB\VID_2516&PID_016D&MI_02 ;指定地址的usb设备
%hidflt.DeviceDesc% = hidflt_Inst, USB\VID_1A2C&PID_4C48&MI_00 ;指定地址的usb设备
%hidflt.DeviceDesc% = hidflt_Inst, USB\VID_1A2C&PID_4C48&MI_01 ;指定地址的usb设备
%hidflt.DeviceDesc% = hidflt_Inst, USB\VID_1A2C&PID_424D&MI_00 ;指定地址的usb设备
%hidflt.DeviceDesc% = hidflt_Inst, USB\VID_1A2C&PID_424D&MI_01 ;指定地址的usb设备
%hidflt.DeviceDesc% = hidflt_Inst, USB\VID_1A2C&PID_7FFF&MI_00 ;指定地址的usb设备
%hidflt.DeviceDesc% = hidflt_Inst, USB\VID_1A2C&PID_7FFF&MI_01 ;指定地址的usb设备


[vhidev.NT]
CopyFiles=KMDriverCopy

[vhidev.NT.hw]
AddReg=vhidev_AddReg

[vhidev.NT.Services]
AddService=vhidflt, ,vhidflt_Service_Inst,
AddService=mshidkmdf,0x00000002,mshidkmdf_Service_Inst ;flag 0x2 sets this as the service for the device

[vhidev_AddReg]
HKR,,"LowerFilters",0x00010008,"vhidflt" ; FLG_ADDREG_TYPE_MULTI_SZ | FLG_ADDREG_APPEND

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

[vhidev.NT.Wdf]
KmdfService=vhidflt, vhidflt_wdfsect

[vhidflt_wdfsect]
KmdfLibraryVersion=1.9

;===================ii==============================

[hidflt_Inst.NT]
Include = input.inf
Needs = HID_Inst.NT
CopyFiles = hidflt_CopyFiles.NT

[hidflt_Inst.NT.HW]
Include = input.inf
Needs = HID_Inst.NT.Hw
AddReg = hidflt_HWAddReg.NT

[hidflt_Inst.NT.Services]
Include = input.inf
Needs = HID_Inst.NT.Services
AddService=vhidflt, ,vhidflt_Service_Inst,

[hidflt_HWAddReg.NT]
;HKR,,"LowerFilters",0x00010008,"hidusb" ; FLG_ADDREG_TYPE_MULTI_SZ | FLG_ADDREG_APPEND
;HKR,,"LowerFilters",0x00010000,"hidusb"
HKR,,"LowerFilters",0x00010000,"vhidflt"

[hidflt_CopyFiles.NT]
vhidflt.sys

[vhidflt_Service_Inst]
DisplayName    = %hidusbFilter.SvcDesc%
ServiceType    = 1                  ; SERVICE_KERNEL_DRIVER
StartType      = 3                  ; SERVICE_DEMAND_START
ErrorControl   = 1                  ; SERVICE_ERROR_NORMAL
ServiceBinary  = %12%\vhidflt.sys


; ================= copy files =====================

[KMDriverCopy]
vhidflt.sys

[SourceDisksNames]
1=%DiskDesc%,,,

[SourceDisksFiles]
vhidflt.sys=1

[DestinationDirs]
KMDriverCopy=12
DefaultDestDir = 12 ; DIRID_DRIVERS
;---------------------------------------------------------------;

[Strings]
ProviderString     = "Virtual HID Provider"
ManufacturerString = "Virtual HID Manufacturer"
ClassName          = "Sample Device"
DeviceDesc         = "Virtual HID Device"
ServiceDesc        = "Virtual HID Service"
DiskDesc           = "Virtual HID Installation Disk"

hidflt.DeviceDesc = "HID-compliant device"
hidusbFilter.SvcDesc = "HID-filter device"
