;
; WUDFUsbccidDriver.inf - Install the USBCCID user-mode driver
;

[Version]
Signature="$Windows NT$"
Class=SmartCardReader
ClassGuid={50DD5230-BA8A-11D1-BF5D-0000F805F530}
Provider=%MSFT%
DriverVer=06/14/2009,6.1.7601.17514

[Manufacturer]
%MSFT%=Microsoft,NTx86,NTamd64

[Microsoft.NTx86]
%UsbccidDeviceName% = ICCD_Install, USB\Class_0B&SubClass_00&Prot_01
%UsbccidDeviceName% = ICCD_Install, USB\Class_0B&SubClass_00&Prot_02
%USB\VID_9999&PID_0055&MI_00% = ICCD_Install, USB\VID_9999&PID_0055&MI_00
%USB\VID_9999&PID_0058&MI_00% = ICCD_Install, USB\VID_9999&PID_0058&MI_00
%USB\VID_9999&PID_0059&MI_00% = ICCD_Install, USB\VID_9999&PID_0059&MI_00
%USB\VID_9999&PID_005A&MI_00% = ICCD_Install, USB\VID_9999&PID_005A&MI_00

[Microsoft.NTamd64]
%UsbccidDeviceName% = ICCD_Install.NTamd64, USB\Class_0B&SubClass_00&Prot_01
%UsbccidDeviceName% = ICCD_Install.NTamd64, USB\Class_0B&SubClass_00&Prot_02
%USB\VID_9999&PID_0055&MI_00% = ICCD_Install.NTamd64, USB\VID_9999&PID_0055&MI_00
%USB\VID_9999&PID_0058&MI_00% = ICCD_Install.NTamd64, USB\VID_9999&PID_0058&MI_00
%USB\VID_9999&PID_0059&MI_00% = ICCD_Install.NTamd64, USB\VID_9999&PID_0059&MI_00
%USB\VID_9999&PID_005A&MI_00% = ICCD_Install.NTamd64, USB\VID_9999&PID_005A&MI_00

[ClassInstall32]
AddReg=SmartcardClass_RegistryAdd

[SmartcardClass_RegistryAdd]
HKR,,,,%ClassName%
HKR,,Icon,,"-10"

[SourceDisksFiles]
WUDFUsbccidDriver.dll=1,i386
WudfUpdate_01009.dll=1,i386
WdfCoInstaller01009.dll=1,i386
WinUsbCoinstaller2.dll=1,i386

[SourceDisksFiles.NTamd64]
WUDFUsbccidDriver.dll=1,amd64
WudfUpdate_01009.dll=1,amd64
WdfCoInstaller01009.dll=1,amd64
WinUsbCoinstaller2.dll=1,amd64

[SourceDisksNames]
1=%MediaDescription%

; ============ Add reg for all readers ===============

[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
; Registering event log provider.
HKLM, Software\Microsoft\Windows\CurrentVersion\WINEVT\Publishers\{22c370a7-a3db-4390-ade5-3a1accf4b5d5},,0x00000000,"WudfUsbccidDriver"
HKLM, Software\Microsoft\Windows\CurrentVersion\WINEVT\Publishers\{22c370a7-a3db-4390-ade5-3a1accf4b5d5},Enabled,0x00010001,1
HKLM, Software\Microsoft\Windows\CurrentVersion\WINEVT\Publishers\{22c370a7-a3db-4390-ade5-3a1accf4b5d5},MessageFileName,0x00020000,"%SystemRoot%\System32\Drivers\UMDF\WudfUsbccidDriver.dll"
HKLM, Software\Microsoft\Windows\CurrentVersion\WINEVT\Publishers\{22c370a7-a3db-4390-ade5-3a1accf4b5d5},ResourceFileName,0x00020000,"%SystemRoot%\System32\Drivers\UMDF\WudfUsbccidDriver.dll"
HKLM, Software\Microsoft\Windows\CurrentVersion\WINEVT\Publishers\{22c370a7-a3db-4390-ade5-3a1accf4b5d5}\ChannelReferences,Count,0x00010001,1
HKLM, Software\Microsoft\Windows\CurrentVersion\WINEVT\Publishers\{22c370a7-a3db-4390-ade5-3a1accf4b5d5}\ChannelReferences\0,,0x00000000,"System"
HKLM, Software\Microsoft\Windows\CurrentVersion\WINEVT\Publishers\{22c370a7-a3db-4390-ade5-3a1accf4b5d5}\ChannelReferences\0,Id,0x00010001,0x00000008
HKLM, Software\Microsoft\Windows\CurrentVersion\WINEVT\Publishers\{22c370a7-a3db-4390-ade5-3a1accf4b5d5}\ChannelReferences\0,Flags,0x00010001,0x00000001
HKLM, System\CurrentControlSet\Control\WMI\Autologger\EventLog-System\{22c370a7-a3db-4390-ade5-3a1accf4b5d5},Enabled,0x00010001,1
HKLM, System\CurrentControlSet\Control\WMI\Autologger\EventLog-System\{22c370a7-a3db-4390-ade5-3a1accf4b5d5},EnableLevel,0x00010001,0
HKLM, System\CurrentControlSet\Control\WMI\Autologger\EventLog-System\{22c370a7-a3db-4390-ade5-3a1accf4b5d5},EnableProperty,0x00010001,0x00000001
HKLM, System\CurrentControlSet\Control\WMI\Autologger\EventLog-System\{22c370a7-a3db-4390-ade5-3a1accf4b5d5},LoggerName,0x00000000,"EventLog-System"
; Note: The 0x000B0001 flag in the two entries below indicates the value is a REG_QWORD. This is not documented in MSDN!
HKLM, System\CurrentControlSet\Control\WMI\Autologger\EventLog-System\{22c370a7-a3db-4390-ade5-3a1accf4b5d5},MatchAnyKeyword,0x000B0001,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x80
HKLM, System\CurrentControlSet\Control\WMI\Autologger\EventLog-System\{22c370a7-a3db-4390-ade5-3a1accf4b5d5},MatchAllKeyword,0x000B0001,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00


; =================== UMDF CCID Device ==================================
; Work around of a WinUsb issue.

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

[ICCD_Install.NT.hw]
AddReg=ICCD_Device_AddReg

[ICCD_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.

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

[ICCD_Install.NT.Wdf]
KmdfService = WINUSB, WinUsb_Install
UmdfService=WUDFUsbccidDriver, WUDFUsbccidDriver_Install
UmdfServiceOrder=WUDFUsbccidDriver
UmdfDispatcher=WinUsb
UmdfKernelModeClientPolicy=AllowKernelModeClients

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

[ICCD_Install.NTamd64.hw]
AddReg=ICCD_Device_AddReg

[ICCD_Install.NTamd64.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.

[ICCD_Install.NTamd64.CoInstallers]
AddReg=CoInstallers_AddReg
CopyFiles=CoInstallers_CopyFiles

[ICCD_Install.NTamd64.Wdf]
KmdfService = WINUSB, WinUsb_Install
UmdfService=WUDFUsbccidDriver, WUDFUsbccidDriver_Install
UmdfServiceOrder=WUDFUsbccidDriver
UmdfDispatcher=WinUsb
UmdfKernelModeClientPolicy=AllowKernelModeClients

; =====================================================

[WinUsb_Install]
KmdfLibraryVersion = 1.9

[WUDFUsbccidDriver_Install]
UmdfLibraryVersion=1.9.0
DriverCLSID="{5EB949F2-78C6-443b-9964-07588EB151C6}"
ServiceBinary="%12%\UMDF\WUDFUsbccidDriver.dll"

[ICCD_Device_AddReg]
HKR,,"LowerFilters",0x00010008,"WinUsb" ; FLG_ADDREG_TYPE_MULTI_SZ | FLG_ADDREG_APPEND
HKR,"WUDF","Exclusive",0x10001,1
HKR,"WUDF","UpperDriverOK",0x10001,1
HKR,,"SystemWakeEnabled",0x00010001,0
HKR,,"DeviceIdleEnabled",0x00010001,1
HKR,,"UserSetDeviceIdleEnabled",0x00010001,0
HKR,,"DefaultIdleState",0x00010001,1
HKR,,"DefaultIdleTimeout",0x00010001,5000
HKR,"WDF","WdfDefaultWakeFromSleepState",0x00010001,0
HKR,"WDF","WdfDefaultIdleInWorkingState",0x00010001,1

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

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

[CoInstallers_AddReg]
HKR,,CoInstallers32,0x00010000,"WudfUpdate_01009.dll","WinUsbCoinstaller2.dll","WdfCoInstaller01009.dll,WdfCoInstaller"

[CoInstallers_CopyFiles]
WudfUpdate_01009.dll
WdfCoInstaller01009.dll
WinUsbCoinstaller2.dll

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

[UMDriverCopy]
WUDFUsbccidDriver.dll

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

[Strings]
MSFT="Microsoft"
MediaDescription="Microsoft HRP Installation Media"
ClassName="WUDF Smartcard"
USB\VID_9999&PID_0055&MI_00="HTI Smartcard Reader"
USB\VID_9999&PID_0058&MI_00="HTI Smartcard Reader (WUDF)"
USB\VID_9999&PID_0059&MI_00="HTI PLUS Smartcard Reader (WUDF)"
USB\VID_9999&PID_005A&MI_00="HTI Highspeed Smartcard Reader (WUDF)"
UsbccidDeviceName="Microsoft Usbccid Smartcard Reader (WUDF)"
WinUsb_Service_DisplayName="WinUSB Driver"
WinUsb_SvcDesc="WinUSB Driver"
