Logo Search packages:      
Sourcecode: pcsc-lite version File versions  Download package

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

This function returns a list of currently available readers on the system. mszReaders is a pointer to a character string that is allocated by the application. If the application sends mszGroups and mszReaders as NULL then this function will return the size of the buffer needed to allocate in pcchReaders.

Parameters:
[in] hContext Connection context to the PC/SC Resource Manager.
[in] mszGroups List of groups to list readers (not used).
[out] mszReaders Multi-string with list of readers.
pcchReaders [inout] Size of multi-string buffer including NULL's.
Returns:
Connection status.
Return values:
SCARD_S_SUCCESS Successful.
SCARD_E_INVALID_HANDLE Invalid Scope Handle.
SCARD_E_INSUFFICIENT_BUFFER Reader buffer not large enough.
Test:
 SCARDCONTEXT hContext;
 LPTSTR mszReaders;
 DWORD dwReaders;
 LONG rv;
 ...
 rv = SCardEstablishContext(SCARD_SCOPE_SYSTEM, NULL, NULL, &hContext);
 rv = SCardListReaders(hContext, NULL, NULL, &dwReaders);
 mszReaders = (LPTSTR)malloc(sizeof(char)*dwReaders);
 rv = SCardListReaders(hContext, NULL, mszReaders, &dwReaders); 

Definition at line 273 of file winscard_scf.c.

References SCardLockThread(), and SCardUnlockThread().

{
      long rv;

      SCardLockThread();
      rv = SCardListReadersTH(hContext, mszGroups, mszReaders, pcchReaders);
      SCardUnlockThread();

      return rv;
}


Generated by  Doxygen 1.6.0   Back to index