Searching for a driver each time a smart card is connected
This behavior occurs when Windows detect a smart card which has no driver. This could happened if your manufacturer didn’t package the CSP or the minidriver using an inf file.
Solution :
- you can disable the smart card plug and play
- or, you can install a fake driver manually.
Alternative A) disable the smart card plug and play
Create a reg file using the following text and apply it.
Windows Registry Editor Version 5.00 [HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\ScPnP] "EnableScPnP"=dword:00000000 [HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Policies\Microsoft\Windows\ScPnP] "EnableScPnP"=dword:00000000
Alternative B) create a fake driver
find the historical bytes
Open the device manager, look for the smart card in error. Go to property then attributes. Search for Hardware ID which begins with “SCFILTER\”
In this case, the historical bytes are : 41 73 74 72 69 64. They are also part of the ATR which can be found using the command “certutil -scinfo”. In this case, we can see the bytes translated in ASCII to “Astrid” which is the code name of the card.
create an inf file
Create a file with the “inf extension” and copy paste the following content. Replace the “SCFILTER\” with the SCFILTER you have.
; ;FabrikamVendor Smartcard Minidriver for an x86 and x64 based package. ; [Version] Signature="$Windows NT$" Class=SmartCard ClassGuid={990A2BD7-E738-46c7-B26F-1CF8FB9F1391} Provider=%ProviderName% DriverVer=04/03/2013,1.0.0.0 [Manufacturer] %ProviderName%=Minidriver,NTamd64,NTamd64.6.1,NTx86,NTx86.6.1 [Minidriver.NTamd64] %CardDeviceName%=Minidriver64_Install,SCFILTER\CID_51FF0800 [Minidriver.NTx86] %CardDeviceName%=Minidriver32_Install,SCFILTER\CID_51FF0800 [Minidriver.NTamd64.6.1] %CardDeviceName%=Minidriver64_61_Install,SCFILTER\CID_51FF0800 [Minidriver.NTx86.6.1] %CardDeviceName%=Minidriver32_61_Install,SCFILTER\CID_51FF0800 [Minidriver64_61_Install.NT] Include=umpass.inf Needs=UmPass [Minidriver32_61_Install.NT] AddReg=AddRegDefault Include=umpass.inf Needs=UmPass [Minidriver64_61_Install.NT.Services] Include=umpass.inf Needs=UmPass.Services [Minidriver32_61_Install.NT.Services] Include=umpass.inf Needs=UmPass.Services [Minidriver64_61_Install.NT.HW] Include=umpass.inf Needs=UmPass.HW [Minidriver64_61_Install.NT.CoInstallers] Include=umpass.inf Needs=UmPass.CoInstallers [Minidriver64_61_Install.NT.Interfaces] Include=umpass.inf Needs=UmPass.Interfaces [Minidriver32_61_Install.NT.HW] Include=umpass.inf Needs=UmPass.HW [Minidriver32_61_Install.NT.CoInstallers] Include=umpass.inf Needs=UmPass.CoInstallers [Minidriver32_61_Install.NT.Interfaces] Include=umpass.inf Needs=UmPass.Interfaces ; =================== Generic ================================== [Strings] ProviderName ="FabrikamVendor" CardDeviceName="FabrikamVendor Minidriver for Smart Card"
Install the inf
In the device manager, choose the smart card then in the properties, choose “update driver”. Choose the options “search a pilote on my computer” then select the folder where the inf file is located. If there is no compatible driver found, the SCFILTER string is wrong.
Debugging
If the install failed, there are maybe a typo in the inf file. You can use the tool chkInf in the Windows SDK to debug the inf file.