Compartilhar via


SCardLocateCardsByATR

A version of this page is also available for

Windows Embedded CE 6.0 R3

4/8/2010

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
Windows Embedded CE Windows CE .NET 4.1 and later
Windows Mobile Windows Mobile Version 5.0 and later