The smart card minidriver implements and exports a DllMain funtion to handle load/unload and attach/detach notifications. This allows the minidriver DLL to manage its state and allocated resources. For implementation details, see the DllMain reference topic.
DllRegisterServer and DllUnregisterServer
DllRegisterServer and DllUnregisterServer are no longer called stating with v5 of the Smart Card Minidriver Specification. The registration of the card minidriver is performed through an INF-based update to the system registry.
An INF-based approach should be used for the registration of a smart card minidriver. The INF file allows for the creation of the necessary registry entries as well as the copy of files from the driver package to the appropriate directories
For an example of a smart card INF file, see Smart Card Plug and Play.
INF File Requirements
The smart card INF file should contain directives that create the following registry entries for each card.
[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Cryptography\Calais\SmartCards\VENDORCARDNAME] "80000001"="VENDOR.dll" "ATR"=hex:01,23,45,67,89,01,23,45,67,89,01,23,45,67,89,01,23,45 "ATRMask"=hex:ff,ff,ff,ff,ff,ff,ff,ff,ff,ff,ff,ff,ff,ff,ff,ff,ff,ff
If the minidriver supports loading under CAPI, the following line should be included in the registry file:
"Crypto Provider"="Microsoft Base Smart Card Crypto Provider"
If the minidriver supports loading under CNG, the following line should be included in the registry file:
"Smart Card Key Storage Provider"="Microsoft Smart Card Key Storage Provider"