Important:
This is retired content. This content is outdated and is no longer being maintained. It is provided as a courtesy for individuals who are still using these technologies. This content may contain URLs that were valid when originally published, but now link to sites or pages that no longer exist.
A version of this page is also available for
4/8/2010

This function provides the list of readers within a set of named reader groups, eliminating duplicates.

The caller supplies a list of reader groups, and receives the list of readers within the named groups. Unrecognized group names are ignored.

Syntax

LONG SCardListReaders(
  SCARDCONTEXT 
hContext, 
  LPCTSTR 
mszGroups, 
  LPTSTR 
mszReaders, 
  LPDWORD 
pcchReaders 
);

Parameters

hContext

[in] Handle to the resource manager context for the query. The resource manager context can be set by a previous call to SCardEstablishContextor set to NULL if the query is not directed toward a specific context.

mszGroups

[in] Supplies the names of the reader groups defined to the system as a multi-string. For Windows Embedded CE, set to NULL to list all readers in the system (that is, the SCard$AllReaders group).

mszReaders

[out] Receives a multi-string that lists the card readers within the supplied reader groups. If this value is NULL, SCardListReadersignores the buffer length supplied in pcchReaders, writes the length of the buffer that would have been returned if this parameter had not been NULL to pcchReaders, and returns a success code.

pcchReaders

[in, out] Pointer to the length, in characters, of the mszReadersbuffer. This parameter receives the actual length of the multi-string structure, including all trailing null characters. If the buffer length is specified as SCARD_AUTOALLOCATE, mszReadersis converted to a byte pointer, and receives the address of a block of memory containing the multi-string structure. This block of memory must be deallocated with SCardFreeMemory.

Return Value

The following table shows the possible return values.

Value Description

SCARD_S_SUCCESS

Succeeds

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

Fails

Remarks

SCardListReadersis a database query function.

Requirements

Header winscard.h
Library winscard.lib
Windows Embedded CE Windows CE 3.0 and later
Windows Mobile Windows Mobile Version 5.0 and later

See Also