;
; INF file for installing Realtek Input Device Driver
; Copyright (c) Realtek Semiconductor Corp.
;

[Version]
Signature   = "$WINDOWS NT$"
Class       = HIDClass
ClassGuid   = {745a17a0-74d3-11d0-b6fe-00a0c90f57da}
Provider    = %VENDOR%
LayoutFile  = layout.inf
CatalogFile = RtkAuHid.cat
DriverVer=08/21/2015,6.3.9600.17336

;
;   Layout.inf (etc.) list all files shipped with the operating system so the 
;   source description sections are only needed if other files are needed.
;   
;   In order to use IHV drivers, the SourceDisksNames section must list the 
;   disk(s) containing the drivers and the SourceDisksFiles section must list 
;   which disk number each file to be copied is found on.
;   Disk number 99 is used to avoid a conflict with the disk numbers defined 
;   in layout.inf
;
;   Files used in a driver installation need to be digitally signed otherwise 
;   installation may fail.  See documentation elsewhere in the DDK regarding 
;   driver signing.

[SourceDisksFiles]
RtkAuHid.sys   = 99
RtkAudHM.sys   = 99
WdfCoInstaller01011.dll=99 ; make sure the number matches with SourceDisksNames


[SourceDisksNames]
99 = %DISK_NAME%,,,""

[DestinationDirs]
CopyFunctionDriver  = 12
CopyFilterDriver    = 12
RtkAuHid.Inst_CoInstaller_CopyFiles = 11

[Manufacturer]
%VENDOR%=Vendor, NTamd64, NTamd64.6.1

; For XP and later
[Vendor.NTamd64]
%RtkAuHid%          = RtkAuHid.Inst, RTKAUDIO\FUNC_01&VEN_10EC&DEV_1000
;%customCollection%  = customCollection.Inst, HID_DEVICE_UP:FF00_U:0001

; For Win7 and later so that we can use inbox HID-KMDF mapper
[Vendor.NTamd64.6.1]
%RtkAuHid%          = RtkAuHid.Inst.Win7, RTKAUDIO\FUNC_01&VEN_10EC&DEV_1000
;%customCollection%  = customCollection.Inst, HID_DEVICE_UP:FF00_U:0001

;===============================================================
;   Install section for XP thru Vista
;===============================================================
[RtkAuHid.Inst.NT]
CopyFiles = CopyFunctionDriver, CopyFilterDriver

[RtkAuHid.Inst.NT.HW]
AddReg = RtkAuHid_Parameters.AddReg 

;
; RtkAudHM is the function driver and RtkAuHid is the lower filter
;
[RtkAuHid.Inst.NT.Services]
AddService = RtkAudHM,0x00000002,RtkAudHM_Service_Inst,
AddService = RtkAuHid,, RtkAuHid_Service_Inst

[CopyFunctionDriver]
RtkAudHM.sys

[RtkAuHid_Parameters.AddReg]
HKR,,"LowerFilters",0x00010000,"RtkAuHid"

[RtkAudHM_Service_Inst]
DisplayName    = %RtkAudHM.SVCDESC%
ServiceType    = 1               ; SERVICE_KERNEL_DRIVER
StartType      = 3               ; SERVICE_DEMAND_START 
ErrorControl   = 1               ; SERVICE_ERROR_NORMAL
ServiceBinary  = %12%\RtkAudHM.sys
LoadOrderGroup = PNP Filter


;===============================================================
;   Install section for Win7 and later
;   Use the inbox mshidkmdf.sys as the shim
;===============================================================
[RtkAuHid.Inst.Win7.NT]
; Just copy the driver. No neeed to copy other system binaries.
CopyFiles = CopyFilterDriver

[RtkAuHid.Inst.Win7.NT.HW]
AddReg = RtkAuHid_Win7_Parameters.AddReg 

;
; mshidkmdf is the function driver and RtkAuHid is the lower filter
;
[RtkAuHid.Inst.Win7.NT.Services]
AddService = RtkAuHid,, RtkAuHid_Service_Inst
AddService = mshidkmdf, 0x000001fa, mshidkmdf.AddService ;flag 0x2 sets this as the service for the device

[CopyFilterDriver]
RtkAuHid.sys

[mshidkmdf.AddService]
ServiceType    = 1                  ; SERVICE_KERNEL_DRIVER
StartType      = 3                  ; SERVICE_DEMAND_START
ErrorControl   = 1                  ; SERVICE_ERROR_NORMAL
ServiceBinary  = %10%\System32\Drivers\mshidkmdf.sys

[RtkAuHid_Win7_Parameters.AddReg]
HKR,,"LowerFilters",0x00010000,"RtkAuHid"
HKR,,"AllowIdleIrpInD3",0x00010001,0x1

;===============================================================
;   Service section (common to all OS versions)
;===============================================================

[RtkAuHid_Service_Inst]
DisplayName    = %RtkAuHid%
ServiceType    = %SERVICE_KERNEL_DRIVER% 
StartType      = %SERVICE_DEMAND_START% 
ErrorControl   = %SERVICE_ERROR_IGNORE% 
ServiceBinary  = %12%\RtkAuHid.sys 


;===============================================================
;   Custom Collection install section
; - Only a Null service is installed.
;===============================================================
;[customCollection.Inst.NT]
;; NULL section

;[customCollection.Inst.NT.HW]
;AddReg = customCollection.Inst.AddReg.NT.HW

;[customCollection.Inst.AddReg.NT.HW]
;; NULL section
;; HKR,,"SelectiveSuspendEnabled",0x00000001,0x1

;[customCollection.Inst.NT.Services]
;AddService = ,0x00000002,   ; NULL Service

;================================================================
; WDF Coinstaller installation
;===============================================================

[RtkAuHid.Inst.NT.CoInstallers]
AddReg=RtkAuHid.Inst_CoInstaller_AddReg
CopyFiles=RtkAuHid.Inst_CoInstaller_CopyFiles

[RtkAuHid.Inst.Win7.NT.CoInstallers]
AddReg=RtkAuHid.Inst_CoInstaller_AddReg
CopyFiles=RtkAuHid.Inst_CoInstaller_CopyFiles

[RtkAuHid.Inst_CoInstaller_AddReg]
HKR,,CoInstallers32,0x00010000, "WdfCoInstaller01011.dll,WdfCoInstaller"

[RtkAuHid.Inst_CoInstaller_CopyFiles]
WdfCoInstaller01011.dll,,,0x00000010    ;COPYFLG_NO_OVERWRITE (for win2k)

[RtkAuHid.Inst.NT.Wdf]
KmdfService = RtkAuHid, RtkAuHid_wdfsect

[RtkAuHid.Inst.Win7.NT.Wdf]
KmdfService = RtkAuHid, RtkAuHid_wdfsect

[RtkAuHid_wdfsect]
KmdfLibraryVersion = 1.11

;================================================================
; Strings section
;===============================================================

[Strings] 
;Localizable
VENDOR              = "Realtek Semiconductor Corp."
RtkAuHid            = "Realtek Input Device"
;customCollection    = "Realtek HID Vendor-defined Collection for audio device"
DISK_NAME           = "Realtek HID Driver Install Disk"
RtkAudHM.SVCDESC    = "Realtek Filter Driver Service for HID-KMDF Interface layer"

;Non-Localizable
SERVICE_BOOT_START     = 0x0 
SERVICE_SYSTEM_START   = 0x1 
SERVICE_AUTO_START     = 0x2 
SERVICE_DEMAND_START   = 0x3 
SERVICE_DISABLED       = 0x4 

SERVICE_KERNEL_DRIVER  = 0x1 
SERVICE_ERROR_IGNORE   = 0x0 
SERVICE_ERROR_NORMAL   = 0x1 
SERVICE_ERROR_SEVERE   = 0x2 
SERVICE_ERROR_CRITICAL = 0x3 

REG_EXPAND_SZ          = 0x00020000 
REG_DWORD              = 0x00010001 
REG_MULTI_SZ           = 0x00010000
REG_BINARY             = 0x00000001
REG_SZ                 = 0x00000000
