This topic is not current. For the most current information about the Smart Card API, see Smart Card Minidriver Specification.
The CardAcquireContext function, defined by a smart card module, initializes communication between the smart card module and either the Microsoft Base Smart Card Cryptographic Service Provider (CSP) or smart card key storage provider (KSP).
DWORD WINAPI CardAcquireContext( _In_ PCARD_DATA pCardData, _In_ DWORD dwFlags );
A pointer to a CARD_DATA structure. The dwVersion member of the CARD_DATA structure must be initialized to the requested version of the structure to be returned by the smart card module.
On output, the structure contains a table of card module functions and information about the state of the smart card module. On successful output, the dwVersion member of the CARD_DATA structure must be set to the actual version of the structure returned by the smart card module.
Reserved. This parameter must be set to zero.
If the function succeeds, it returns zero.
If the function fails, it returns a nonzero error value or one of the following possible error values.
||The pbAtr member of the CARD_DATA structure passed as the pCardData parameter does not refer to a valid smart card, or the smart card module does not recognize the specified smart card.
||The pbAtr, cbAtr, or pwszCardName member of the CARD_DATA structure passed as the pCardData parameter contains a NULL or a value that is not valid, or the pCardData parameter contains a NULL value.
This function must be able to return multiple CARD_DATA structures upon multiple calls.
|Minimum supported client
||Windows XP [desktop apps only]
|Minimum supported server
||Windows Server 2003 [desktop apps only]