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

LONG SCardListReaderGroups ( SCARDCONTEXT  hContext,
LPTSTR  mszGroups,
LPDWORD  pcchGroups 
)

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

The group names is a multi-string and separated by a nul character ('\0') and ended by a double nul character. "SCard$DefaultReaders\\0Group 2\\0\\0".

Parameters:
[in] hContext Connection context to the PC/SC Resource Manager.
[out] mszGroups List of groups to list readers.
pcchGroups [inout] Size of multi-string buffer including NULL's.
Returns:
Error code.
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 mszGroups;
 DWORD dwGroups;
 LONG rv;
 ...
 rv = SCardEstablishContext(SCARD_SCOPE_SYSTEM, NULL, NULL, &hContext);
 rv = SCardListReaderGroups(hContext, NULL, &dwGroups);
 mszGroups = (LPTSTR)malloc(sizeof(char)*dwGroups);
 rv = SCardListReaderGroups(hContext, mszGroups, &dwGroups);

Definition at line 1156 of file winscard_scf.c.

References SCardLockThread(), and SCardUnlockThread().

{
      long rv;

      SCardLockThread();
      rv = SCardListReaderGroupsTH(hContext, mszGroups, pcchGroups);
      SCardUnlockThread();

      return rv;
}


Generated by  Doxygen 1.6.0   Back to index