;
; HIDOMNIKEYCCIDDriver.inf
;

[Version]
Signature="$Windows NT$"
Class       = SmartCardReader
ClassGuid   = {50dd5230-ba8a-11d1-bf5d-0000f805f530}
Provider=%ManufacturerName%
CatalogFile=HIDOMNIKEYCCIDDriver.cat
DriverVer = 04/08/2021,2.3.4.121

[Manufacturer]
%ManufacturerName%=Standard,NTx86

[Standard.NTx86]
%OK3x21DeviceName%=Device_Install, USB\VID_076B&PID_3031
%OK6121DeviceName%=Device_Install, USB\VID_076B&PID_6632
%CherrySmartTerminalxx88DeviceName%=Device_Install, USB\VID_046A&PID_00A7
%GenericUSBSmartCardReaderDeviceName%=Device_Install, USB\VID_076B&PID_3A21
%SmartcardReaderD323DeviceName%=Device_Install, USB\VID_0BF8&PID_1024
%OK5022DeviceName%=Device_Install, USB\VID_076B&PID_5022
%OK5023DeviceName%=Device_Install, USB\VID_076B&PID_5023
%OK5x25DeviceName%=Device_Install, USB\VID_076B&PID_502A
%OK5427CKDeviceName%=Device_Install, USB\VID_076B&PID_5427&MI_00
%OK5127MiniDeviceName%=Device_Install, USB\VID_076B&PID_5127&MI_00
%OMNIKEY5122FirstInterface%=Device_Install, USB\VID_076B&PID_5412&MI_00
%OMNIKEY5122SecondInterface%=Device_Install, USB\VID_076B&PID_5412&MI_01
%OMNIKEY5122DualFirstInterface%=Device_Install, USB\VID_076B&PID_5432&MI_00
%OMNIKEY5122DualSecondInterface%=Device_Install, USB\VID_076B&PID_5432&MI_01
%OMNIKEY5422FirstInterface%=Device_Install, USB\VID_076B&PID_5422&MI_00
%OMNIKEY5422SecondInterface%=Device_Install, USB\VID_076B&PID_5422&MI_01
%OK5027SecondInterface%=Device_Install, USB\VID_076B&PID_5A27&MI_01
%OK5427CKSingleInterfaceDeviceName%=Device_Install, USB\VID_076B&PID_5429
%OK5127MiniSingleInterfaceDeviceName%=Device_Install, USB\VID_076B&PID_5129

[SourceDisksFiles]
HIDOMNIKEYCCIDDriver.dll=1
WudfUpdate_01011.dll=1
WdfCoInstaller01011.dll=1
WinUsbCoinstaller2.dll=1

[SourceDisksNames]
1 = %DiskName%

; =================== UMDF Device ==================================
[Reader.Install.AddReg]
HKLM, Software\Microsoft\Cryptography\Calais\Readers,,,
HKLM, System\CurrentControlSet\Services\SCardSvr,Start,0x00010001,2
HKLM, System\CurrentControlSet\Services\CertPropSvc,Start,0x00010001,2

[Reader.Install.AddReg2]
HKLM, System\CurrentControlSet\Control\OMNIKEY\Instances ; create key to track instances in order to enumerate readers

[Reader.Install.AddReg2.Security]
"O:SYG:SYD:PAI(A;CIIO;KA;;;CO)(A;CI;KA;;;SY)(A;CI;KA;;;LS)(A;CI;KA;;;BA)(A;CI;KR;;;BU)(A;CI;KR;;;PU)" ; set permissions for instances registry key

[Device_Install.NT]
CopyFiles=UMDriverCopy
Include=WINUSB.INF                      ; Import sections from WINUSB.INF
Needs=WINUSB.NT                         ; Run the CopyFiles & AddReg directives for WinUsb.INF
AddReg=Reader.Install.AddReg, Reader.Install.AddReg2

[Device_Install.NT.hw]
AddReg=HIDOMNIKEYCCIDDriver_AddReg

[Device_Install.NT.Services]
AddService=WUDFRd,0x000001fa,WUDFRD_ServiceInstall  ; flag 0x2 sets this as the service for the device
AddService=WinUsb,0x000001f8,WinUsb_ServiceInstall  ; this service is installed because its a filter.

[Device_Install.NT.CoInstallers]
CopyFiles=CoInstallers_CopyFiles
AddReg=CoInstallers_AddReg

[Device_Install.NT.Wdf]
KmdfService = WINUSB, WinUsb_Install
UmdfKernelModeClientPolicy=AllowKernelModeClients
UmdfDispatcher=WinUsb
UmdfService=HIDOMNIKEYCCIDDriver,HIDOMNIKEYCCIDDriver_Install
UmdfServiceOrder=HIDOMNIKEYCCIDDriver
UmdfHostProcessSharing=ProcessSharingDisabled

[WinUsb_Install]
KmdfLibraryVersion = 1.0

[HIDOMNIKEYCCIDDriver_Install]
UmdfLibraryVersion=1.11.0 
ServiceBinary=%12%\UMDF\HIDOMNIKEYCCIDDriver.dll
DriverCLSID={9412acd5-25f7-4eac-8c40-9ac766657a54}

[HIDOMNIKEYCCIDDriver_AddReg]
HKR,,"LowerFilters",0x00010008,"WinUsb" ; FLG_ADDREG_TYPE_MULTI_SZ | FLG_ADDREG_APPEND
HKR,,"WinUsbPowerPolicyOwnershipDisabled",0x00010001,0 ; do NOT disable winusb policy ownership

HKR,,"DeviceIdleEnabled",0x00010001,1 ; notify WinUSB about selective suspend support
HKR,,"SystemWakeEnabled",0x00010001,1 ; notify WinUSB about wake up support

HKR,,"UserSetDeviceIdleEnabled",0x00010001,1 ; provide user control of USB selective suspend (in device manager)
HKR,,"DefaultIdleState",0x00010001,1 ; allow computer to supsend device by default
HKR,,"DefaultIdleTimeout",0x00010001,5000 ; set idle time-out value

[WUDFRD_ServiceInstall]
DisplayName = %WudfRdDisplayName%
ServiceType = 1
StartType = 3
ErrorControl = 1
ServiceBinary = %12%\WUDFRd.sys
LoadOrderGroup = Base

[WinUsb_ServiceInstall]
DisplayName = %WinUsb_SvcDesc%
ServiceType = 1
StartType = 3
ErrorControl = 1
ServiceBinary = %12%\WinUSB.sys

[CoInstallers_CopyFiles]
WudfUpdate_01011.dll
WdfCoInstaller01011.dll
WinUsbCoinstaller2.dll

[CoInstallers_AddReg]
HKR,,CoInstallers32,0x00010000,"WudfUpdate_01011.dll", "WdfCoInstaller01011.dll, WdfCoInstaller", "WinUsbCoinstaller2.dll"

[DestinationDirs]
UMDriverCopy=12,UMDF ; copy to drivers\umdf
CoInstallers_CopyFiles=11

[UMDriverCopy]
HIDOMNIKEYCCIDDriver.dll

; =================== Generic ==================================

[Strings]
ManufacturerName="HID Global"
DiskName = "HID OMNIKEY CCID Driver Installation Disk"
WudfRdDisplayName="Windows Driver Foundation - User-mode Driver Framework Reflector"
WinUsb_SvcDesc="WinUSB Driver"
DeviceName="HID OMNIKEY CCID Device"
OK3x21DeviceName="OMNIKEY 3x21"
OK6121DeviceName="OMNIKEY 6121"
CherrySmartTerminalxx88DeviceName="CHERRY Smart Terminal XX44"
GenericUSBSmartCardReaderDeviceName="Generic USB Smart Card Reader"
SmartcardReaderD323DeviceName="Fujitsu Smartcard Reader D323"
OK5022DeviceName="HID OMNIKEY 5022"
OK5023DeviceName="HID OMNIKEY 5023"
OK5x25DeviceName="OMNIKEY 5x25"
CherryKC1000SCDeviceName="CHERRY KC 1000 SC"
Cherry1000SCZDeviceName="CHERRY KC 1000 SC Z"
FujitsuKB100SCRDeviceName="Fujitsu Keyboard KB100 SCR"
FujitsuKB100SCReSIGDeviceName="Fujitsu Keyboard KB100 SCR eSIG"
OK5427CKDeviceName="HID OMNIKEY 5427CK"
OK5127MiniDeviceName="HID OMNIKEY 5127CK"
OMNIKEY5122FirstInterface="HID OMNIKEY 5122CL"
OMNIKEY5122SecondInterface="HID OMNIKEY 5122"
OMNIKEY5122DualFirstInterface="HID OMNIKEY 5122CL Dual"
OMNIKEY5122DualSecondInterface="HID OMNIKEY 5122 Dual"
OMNIKEY5422FirstInterface="HID OMNIKEY 5422CL"
OMNIKEY5422SecondInterface="HID OMNIKEY 5422"
OK5027SecondInterface="HID OMNIKEY 5027"
OK5427CKSingleInterfaceDeviceName="HID OMNIKEY 5427CK"
OK5127MiniSingleInterfaceDeviceName="HID OMNIKEY 5127CK"

REG_MULTI_SZ = 0x00010000

