PC/SC Guide
Prox–DU & Prox–SU
www.gemalto.com
DOC119811A Public Use Page 60/129
of pdwState is SCARD_SPECIFICMODE:
SCARD_PROTOCOL_RAW: The Raw Transfer protocol is in use.
SCARD_PROTOCOL_T0: The ISO 7816/3 T=0 protocol is in use.
SCARD_PROTOCOL_T1: The ISO 7816/3 T=1 protocol is in use.
pbAtr [out]
Pointer to a 32-byte buffer that receives the ATR string from the currently inserted
card, if available.
pcbAtrLen [in, out, optional]
On input, supplies the length of the pbAtr buffer.
On output, receives the number of bytes in the ATR string (32 bytes maximum). If
this buffer length is specified as SCARD_AUTOALLOCATE, then pbAtr is converted
to a pointer to a byte pointer, and it receives the address of a block of memory that
contains the multiple-string structure.
Return Value:
If the function successfully provides the current status of a smart card in a reader, the return
value is SCARD_S_SUCCESS.
If the function fails, it returns an error code. For more information, see Smart Card Return
Values.
Remarks:
The szReaderName function is a smart card and reader access function. For information
about other access functions, see Smart Card and Reader Access Functions.
Examples:
The following example shows how to determine the state of the smart card.
WCHAR szReader[200];
DWORD cch = 200;
BYTE bAttr[32];
DWORD cByte = 32;
DWORD dwState, dwProtocol;
LONG lReturn;
// Determine the status.
// hCardHandle was set by an earlier call to SCardConnect.
lReturn = SCardStatus(hCardHandle,
szReader,
&cch,
&dwState,
&dwProtocol,
(LPBYTE)&bAttr,
&cByte);
if ( SCARD_S_SUCCESS != lReturn )
{
printf("Failed SCardStatus\n");