The FindCard method searches for the smart card and opens a valid connection to it.
HRESULT FindCard(
SCARD_SHARE_MODES ShareMode,
SCARD_PROTOCOLS Protocols,
LONG lFlags,
LPSCARDINFO *ppCardInfo
);
Values | Description |
---|---|
EXCLUSIVE | No one else use this connection to the smart card. |
SHARED | Other applications can use this connection. |
Values | |
---|---|
T0 | |
T1 | |
Raw | |
T0|T1 |
Flag | Meaning |
---|---|
SC_DLG_MINIMAL_UI | Displays the dialog only if the card being searched for by the calling application is not located and available for use in a reader. This allows the card to be found, connected (either through internal dialog mechanism or the user callback functions), and returned to the calling application. |
SC_DLG_NO_UI | Causes no UI display, regardless of the search outcome. |
SC_DLG_FORCE_UI | Causes UI display regardless of the search outcome. |
The possible return values are the following:
Value | Meaning |
---|---|
S_OK | Public key retrieved successfully. |
E_INVALIDARG | Invalid parameter. |
E_POINTER | A bad pointer was passed in ppCardInfo. |
E_OUTOFMEMORY | Out of memory. |
To set the search criteria of the search, call ConfigureCardNameSearch to specify a smart card's card names or call ConfigureCardGuidSearch to specify a smart card's interfaces.
For a list of all the methods provided by the ISCardLocate interface, see ISCardLocate.
In addition to the COM error codes listed above, this interface may return a smart card error code if a smart card function was called to complete the request. For information on smart card error codes, see Smart Card Error Codes.
Windows NT: Use version 4.0 SP3 and later.
Windows: Use Windows 95 OSR2.1.
Windows CE: Unsupported.
Header: Declared in scardmgr.h.
Import Library: scardmgr.tlb.
ConfigureCardNameSearch, ISCardLocate