SCardLocateCardsByATR (Compact 7)

3/12/2014

This function searches the readers listed in the rgReaderStates parameter for a card with an ATR string that matches one of the ATRs specified in rgAtrMasks, returning immediately with the result.

Syntax

LONG SCardLocateCards(
  SCARDCONTEXT hContext,
  LPSCARD_ATRMASK rgAtrMasks,
  DWORD  cAtrs,
  LPSCARD_READERSTATE rgReaderStates,
  DWORD cReaders
);

Parameters

  • hContext
    [in] Supplies the handle that identifies the resource manager context. A previous call to SCardEstablishContext sets the resource manager context.
  • rgAtrMasks
    [in] Array of SCARD_ATRMASK structures that contain the ATRs and ATR masks for the cards to search for.
  • cAtrs
    [in] Number of elements in the rgAtrMasks array.
  • rgReaderStates
    [in, out] Supplies an array of SCARD_READERSTATE structures that specify the readers to search, and receives the result.
  • cReaders
    [in] Supplies the number of elements in the rgReaderStates array.

Return Value

The following table shows the possible return values.

Value Description

SCARD_S_SUCCESS

Succeeds

An error value (see Smart Card Error Values for a list of all error values).

Fails

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.

Requirements

Header

winscard.h

Library

winscard.lib

See Also

Reference

Smart Card Functions