SCardLocateCards

The SCardLocateCards function searches the readers listed in the lpReaderStates parameter for a card with an ATR string that matches one of the card names specified in mszCards, returning immediately with the result.

LONG SCardLocateCards(
  IN SCARDCONTEXT hContext,
  IN LPCTSTR mszCards,
  IN OUT LPSCARD_READERSTATE rgReaderStates,
  IN DWORD cReaders
);
 

Parameters

hContext
Supplies the handle that identifies the resource manager context. The resource manager context is set by a previous call to SCardEstablishContext.
mszCards
Supplies a multi-string that contains the names of the cards to search for.
rgReaderStates
Supplies an array of SCARD_READERSTATE structures that specify the readers to search, and receives the result.
cReaders
Supplies the number of elements in the rgReaderStates array.

Return Values

If the function… The return value is…
Succeeds SCARD_S_SUCCESS.
Fails An error code (see Error Codes for a list of all error codes).

Remarks

If no matching cards are found, the calling application may use SCardGetStatusChange to wait for card availability changes.

SCardLocateCards is a smart card tracking function. For a description of other tracking functions, see Smart Card Tracking Functions.

QuickInfo

  Windows NT: Use version 4.0 SP3 and later.
  Windows: Use Windows 95 OSR2.1.
  Windows CE: Unsupported.
  Header: Declared in winscard.h.
  Import Library: Link with winscard.lib.

See Also

SCardCancel, SCardEstablishContext, SCardGetStatusChange, SCARD_READERSTATE