SCardListCards

This function searches the smart card database and provides a list of named cards previously introduced to the system by a user.

The caller specifies an Automatic Terminal Recognition (ATR) string, a set of globally unique identifiers (GUIDs), or both. If both an ATR string and an identifier array are supplied, the cards returned will match the ATR string supplied and support the interfaces specified.

LONG SCardListCards(
  SCARDCONTEXT hContext, 
  LPCBYTE pbAtr, 
  LPCGUID rgguidInterfaces, 
  DWORD cguidInterfaceCount, 
  LPTSTR mszCards, 
  LPDWORD pcchCards 
);

Parameters

  • hContext
    [in] Handle to the resource manager context for the query. The resource manager context can be set by a previous call to SCardEstablishContext or set to NULL if the query is not directed toward a specific context.
  • pbAtr
    [in] Pointer to the address of an ATR string to compare to known cards or NULL if no ATR matching is to be performed.
  • rgguidInterfaces
    [in] Supplies an array of GUIDs or NULL if no interface matching is to be performed. When an array is supplied, a card name is returned only if all the specified identifiers are supported by the card.
  • cguidInterfaceCount
    [in] Count of entries in the rgguidInterfaces array. If rgguidInterfaces is NULL, then this value is ignored.
  • mszCards
    [out] Receives a multi-string that lists the smart cards found. If this value is NULL, SCardListCards ignores the buffer length supplied in pcchCards, returning the length of the buffer that would have been returned if this parameter had not been NULL to pcchCards and a success code.
  • pcchCards
    [in, out] Pointer to the length of the mszCards buffer in characters; receives the actual length of the multi-string structure, including all trailing Null characters.

Return Values

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

To return all smart cards introduced to the subsystem, set pbAtr and rgguidInterfaces to NULL.

SCardListCards is a database query function.

Requirements

OS Versions: Windows CE 3.0 and later.
Header: Winscard.h.
Link Library: Winscard.lib.

See Also

SCardEstablishContext | SCardGetProviderId | SCardListInterfaces | SCardListReaders

 Last updated on Saturday, April 10, 2004

© 1992-2003 Microsoft Corporation. All rights reserved.