SCardListReaders

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

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

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

Parameters

hContext
Supplies the handle that identifies 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 towards a specific context.
mszGroups
Supplies the names of the reader groups defined to the system, as a multi-string. Use a NULL value to list all readers in the system (that is, the SCard$AllReaders group).
mszReaders
Receives a multi-string that list the card readers within the supplied reader groups. If this value is NULL, SCardListReaders ignores 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
Supplies the length of the mszReaders buffer in characters, and receives the actual length of the multi-string structure, including all trailing Null characters. If the buffer length is specified as SCARD_AUTOALLOCATE, then mszReaders is converted to a pointer to a string 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 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

SCardListReaders is a database query function. For a description of other database query functions, see Smart Card Database Query 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

SCardEstablishContext, SCardFreeMemory, SCardGetProviderId, SCardListCards, SCardListInterfaces, SCardListReaderGroups