PC/SC Guide
Prox–DU & Prox–SU
www.gemalto.com
DOC119811A Public Use Page 25/129
DWORD cch = SCARD_AUTOALLOCATE;
// Retrieve the list the reader groups.
// hSC was set by a previous call to SCardEstablishContext.
lReturn = SCardListReaderGroups(hSC,
(LPTSTR)&pmszReaderGroups,
&cch );
if ( SCARD_S_SUCCESS != lReturn )
printf("Failed SCardListReaderGroups\n");
else
{
// Do something with the multi string of reader groups.
// Output the values.
// A double-null terminates the list of values.
pReaderGroup = pmszReaderGroups;
while ( '\0' != *pReaderGroup )
{
// Display the value.
printf("%S\n", pReaderGroup );
// Advance to the next value.
pReaderGroup = pReaderGroup + wcslen((wchar_t *) pReaderGroup) + 1;
}
// Remember to free pmszReaderGroups by a call to SCardFreeMemory.
// ...
}