SCardLocateCardsByATR function
The SCardLocateCardsByATR function searches the readers listed in the rgReaderStates parameter for a card with a name that matches one of the card names contained in one of the SCARD_ATRMASK structures specified by the rgAtrMasks parameter.
Syntax
LONG WINAPI SCardLocateCardsByATR( _In_ SCARDCONTEXT hContext, _In_ LPSCARD_ATRMASK rgAtrMasks, _In_ DWORD cAtrs, _Inout_ LPSCARD_READERSTATE rgReaderStates, _In_ DWORD cReaders );
Parameters
- hContext [in]
-
Handle that identifies the resource manager context. The resource manager context is set by a previous call to SCardEstablishContext.
- rgAtrMasks [in]
-
Array of SCARD_ATRMASK structures that contain the names of the cards for which to search.
- cAtrs [in]
-
Number of elements in the rgAtrMasks array.
- rgReaderStates [in, out]
-
Array of SCARD_READERSTATE structures that specify the readers to search, and receive the result.
- cReaders [in]
-
Number of elements in the rgReaderStates array.
Return value
This function returns different values depending on whether it succeeds or fails.
| Return code | Description |
|---|---|
|
SCARD_S_SUCCESS. |
|
Error code. For more information, see Smart Card Return Values. |
Remarks
This service is especially useful when used in conjunction with SCardGetStatusChange. If no matching cards are found by means of SCardLocateCards, the calling application may use SCardGetStatusChange to wait for card availability changes.
The SCardLocateCardsByATR function is a smart card tracking function. For information about other tracking functions, see Smart Card Tracking Functions.
Requirements
|
Minimum supported client |
Windows XP [desktop apps only] |
|---|---|
|
Minimum supported server |
Windows Server 2003 [desktop apps only] |
|
Header |
|
|
Library |
|
|
DLL |
|
|
Unicode and ANSI names |
SCardLocateCardsByATRW (Unicode) and SCardLocateCardsByATRA (ANSI) |