110 #define PROFILE_FILE "/tmp/pcscd_profile"
112 #include <sys/time.h>
116 struct timeval profile_time_start;
120 #define PROFILE_START profile_start(__FUNCTION__);
121 #define PROFILE_END profile_end(__FUNCTION__, __LINE__);
123 static void profile_start(
const char *f)
125 static char initialized = FALSE;
130 fd = fopen(PROFILE_FILE,
"a+");
133 fprintf(stderr,
"\33[01;31mCan't open %s: %s\33[0m\n",
134 PROFILE_FILE, strerror(errno));
137 fprintf(fd,
"\nStart a new profile\n");
140 if (isatty(fileno(stderr)))
146 gettimeofday(&profile_time_start, NULL);
150 static void profile_end(
const char *f,
int line)
152 struct timeval profile_time_end;
155 gettimeofday(&profile_time_end, NULL);
156 d =
time_sub(&profile_time_end, &profile_time_start);
159 fprintf(stderr,
"\33[01;31mRESULT %s \33[35m%ld\33[0m (%d)\n", f, d,
161 fprintf(fd,
"%s %ld\n", f, d);
166 #define PROFILE_START
171 #define SCARD_PROTOCOL_ANY_OLD 0x1000
174 LPCVOID pvReserved2, LPSCARDCONTEXT phContext)
191 *phContext = SYS_RandomInt(0, -1);
193 Log2(PCSC_LOG_DEBUG,
"Establishing Context: 0x%lX", *phContext);
204 Log2(PCSC_LOG_DEBUG,
"Releasing Context: 0x%lX", hContext);
210 DWORD dwShareMode, DWORD dwPreferredProtocols, LPSCARDHANDLE phCard,
211 LPDWORD pdwActiveProtocol)
215 uint32_t readerState;
234 Log3(PCSC_LOG_DEBUG,
"Attempting Connect to %s using protocol: %ld",
235 szReader, dwPreferredProtocols);
237 rv = RFReaderInfo((LPSTR) szReader, &rContext);
240 Log2(PCSC_LOG_ERROR,
"Reader %s Not Found", szReader);
247 rv = RFCheckReaderStatus(rContext);
262 Log1(PCSC_LOG_ERROR,
"Error Reader Exclusive");
272 Log1(PCSC_LOG_INFO,
"Waiting for release of lock");
275 Log1(PCSC_LOG_INFO,
"Lock released");
290 Log1(PCSC_LOG_DEBUG,
"Card Not Inserted");
310 Log1(PCSC_LOG_DEBUG,
"power up complete.");
311 LogXxd(PCSC_LOG_DEBUG,
"Card ATR: ",
316 Log3(PCSC_LOG_ERROR,
"Error powering up card: %ld 0x%04lX",
322 Log1(PCSC_LOG_ERROR,
"Card Not Powered");
330 Log1(PCSC_LOG_DEBUG,
"powerState: POWER_STATE_INUSE");
348 (void)pthread_mutex_lock(rContext->
mMutex);
353 int availableProtocols, defaultProtocol;
361 if (dwPreferredProtocols & SCARD_PROTOCOL_ANY_OLD)
365 availableProtocols, defaultProtocol);
368 if (SET_PROTOCOL_PPS_FAILED == ret)
370 (void)pthread_mutex_unlock(rContext->
mMutex);
375 if (SET_PROTOCOL_WRONG_ARGUMENT == ret)
377 (void)pthread_mutex_unlock(rContext->
mMutex);
385 (void)pthread_mutex_unlock(rContext->
mMutex);
389 (void)pthread_mutex_unlock(rContext->
mMutex);
404 switch (*pdwActiveProtocol)
407 case SCARD_PROTOCOL_T1:
408 Log2(PCSC_LOG_DEBUG,
"Active Protocol: T=%d",
412 case SCARD_PROTOCOL_RAW:
413 Log1(PCSC_LOG_DEBUG,
"Active Protocol: RAW");
417 Log2(PCSC_LOG_ERROR,
"Active Protocol: unknown %ld",
422 Log1(PCSC_LOG_DEBUG,
"Direct access: no protocol selected");
427 *phCard = RFCreateReaderHandle(rContext);
429 Log2(PCSC_LOG_DEBUG,
"hCard Identity: %lx", *phCard);
443 (void)RFLockSharing(*phCard, rContext);
447 (void)RFDestroyReaderHandle(*phCard);
464 rv = RFAddReaderHandle(rContext, *phCard);
471 (void)RFDestroyReaderHandle(*phCard);
490 UNREF_READER(rContext)
498 DWORD dwPreferredProtocols, DWORD dwInitialization,
499 LPDWORD pdwActiveProtocol)
504 Log1(PCSC_LOG_DEBUG,
"Attempting reconnect to token.");
530 rv = RFReaderInfoById(hCard, &rContext);
537 rv = RFCheckReaderStatus(rContext);
544 rv = RFCheckSharing(hCard, rContext);
556 (void)RFSetReaderEventState(rContext,
SCARD_RESET);
585 Log1(PCSC_LOG_DEBUG,
"Reset complete.");
586 LogXxd(PCSC_LOG_DEBUG,
"Card ATR: ",
593 Log1(PCSC_LOG_ERROR,
"Error resetting card.");
635 if (dwPreferredProtocols & SCARD_PROTOCOL_RAW)
643 (void)pthread_mutex_lock(rContext->
mMutex);
648 int availableProtocols, defaultProtocol;
656 if (dwPreferredProtocols & SCARD_PROTOCOL_ANY_OLD)
660 availableProtocols, defaultProtocol);
663 if (SET_PROTOCOL_PPS_FAILED == ret)
665 (void)pthread_mutex_unlock(rContext->
mMutex);
670 if (SET_PROTOCOL_WRONG_ARGUMENT == ret)
672 (void)pthread_mutex_unlock(rContext->
mMutex);
680 (void)pthread_mutex_unlock(rContext->
mMutex);
684 (void)pthread_mutex_unlock(rContext->
mMutex);
699 switch (*pdwActiveProtocol)
701 case SCARD_PROTOCOL_T0:
702 case SCARD_PROTOCOL_T1:
703 Log2(PCSC_LOG_DEBUG,
"Active Protocol: T=%d",
704 (*pdwActiveProtocol == SCARD_PROTOCOL_T0) ? 0 : 1);
707 case SCARD_PROTOCOL_RAW:
708 Log1(PCSC_LOG_DEBUG,
"Active Protocol: RAW");
712 Log2(PCSC_LOG_ERROR,
"Active Protocol: unknown %ld",
717 Log1(PCSC_LOG_DEBUG,
"Direct access: no protocol selected");
732 (void)RFLockSharing(hCard, rContext);
754 (void)RFUnlockSharing(hCard, rContext);
771 (void)RFUnlockSharing(hCard, rContext);
784 (void)RFClearReaderEventState(rContext, hCard);
794 UNREF_READER(rContext)
814 rv = RFReaderInfoById(hCard, &rContext);
822 && (rContext->
hLockId != hCard))
824 Log1(PCSC_LOG_INFO,
"Waiting for release of lock");
827 Log1(PCSC_LOG_INFO,
"Lock released");
837 rv = RFUnlockAllSharing(hCard, rContext);
851 Log2(PCSC_LOG_DEBUG,
"Active Contexts: %d", rContext->
contexts);
852 Log2(PCSC_LOG_DEBUG,
"dwDisposition: %ld", dwDisposition);
862 (void)RFSetReaderEventState(rContext,
SCARD_RESET);
876 #ifdef DISABLE_AUTO_POWER_ON
878 Log1(PCSC_LOG_DEBUG,
"powerState: POWER_STATE_UNPOWERED");
888 #ifdef DISABLE_AUTO_POWER_ON
896 Log3(PCSC_LOG_ERROR,
"Error powering down card: %d 0x%04X",
904 Log1(PCSC_LOG_INFO,
"Skip card power on");
918 Log1(PCSC_LOG_DEBUG,
"Reset complete.");
919 LogXxd(PCSC_LOG_DEBUG,
"Card ATR: ",
926 Log1(PCSC_LOG_ERROR,
"Error resetting card.");
938 UCHAR controlBuffer[5];
945 controlBuffer[0] = 0x20;
946 controlBuffer[1] = 0x15;
947 controlBuffer[2] = (rContext->
slot & 0x0000FFFF) + 1;
948 controlBuffer[3] = 0x00;
949 controlBuffer[4] = 0x00;
951 rv = IFDControl_v2(rContext, controlBuffer, 5, receiveBuffer,
956 if (receiveLength == 2 && receiveBuffer[0] == 0x90)
958 Log1(PCSC_LOG_DEBUG,
"Card ejected successfully.");
964 Log1(PCSC_LOG_ERROR,
"Error ejecting card.");
967 Log1(PCSC_LOG_ERROR,
"Error ejecting card.");
980 (void)RFRemoveReaderHandle(rContext, hCard);
981 (void)RFDestroyReaderHandle(hCard);
1001 RESPONSECODE (*fct)(DWORD) = NULL;
1007 if (POWER_STATE_POWERED <= rContext->powerState)
1009 #ifdef DISABLE_AUTO_POWER_ON
1013 Log1(PCSC_LOG_DEBUG,
"powerState: POWER_STATE_GRACE_PERIOD");
1017 Log1(PCSC_LOG_DEBUG,
"powerState: POWER_STATE_GRACE_PERIOD");
1025 dwGetSize =
sizeof(fct);
1027 &dwGetSize, (PUCHAR)&fct);
1029 if ((
IFD_SUCCESS == rv) && (dwGetSize ==
sizeof(fct)))
1031 Log1(PCSC_LOG_INFO,
"Stopping polling thread");
1032 fct(rContext->
slot);
1044 UNREF_READER(rContext)
1058 rv = RFReaderInfoById(hCard, &rContext);
1065 rv = RFCheckReaderStatus(rContext);
1072 rv = RFCheckReaderEventState(rContext, hCard);
1076 rv = RFLockSharing(hCard, rContext);
1083 Log2(PCSC_LOG_DEBUG,
"Status: 0x%08lX", rv);
1086 UNREF_READER(rContext)
1109 rv = RFReaderInfoById(hCard, &rContext);
1116 rv = RFCheckReaderEventState(rContext, hCard);
1145 (void)RFSetReaderEventState(rContext,
SCARD_RESET);
1156 Log1(PCSC_LOG_DEBUG,
"Reset complete.");
1157 LogXxd(PCSC_LOG_DEBUG,
"Card ATR: ",
1164 Log1(PCSC_LOG_ERROR,
"Error resetting card.");
1175 UCHAR controlBuffer[5];
1177 DWORD receiveLength;
1182 controlBuffer[0] = 0x20;
1183 controlBuffer[1] = 0x15;
1184 controlBuffer[2] = (rContext->
slot & 0x0000FFFF) + 1;
1185 controlBuffer[3] = 0x00;
1186 controlBuffer[4] = 0x00;
1188 rv = IFDControl_v2(rContext, controlBuffer, 5, receiveBuffer,
1193 if (receiveLength == 2 && receiveBuffer[0] == 0x90)
1195 Log1(PCSC_LOG_DEBUG,
"Card ejected successfully.");
1201 Log1(PCSC_LOG_ERROR,
"Error ejecting card.");
1204 Log1(PCSC_LOG_ERROR,
"Error ejecting card.");
1217 (void)RFUnlockSharing(hCard, rContext);
1219 Log2(PCSC_LOG_DEBUG,
"Status: 0x%08lX", rv);
1222 UNREF_READER(rContext)
1228 LPDWORD pcchReaderLen, LPDWORD pdwState,
1229 LPDWORD pdwProtocol, LPBYTE pbAtr, LPDWORD pcbAtrLen)
1236 (void)mszReaderNames;
1237 (void)pcchReaderLen;
1247 rv = RFReaderInfoById(hCard, &rContext);
1254 rv = RFCheckSharing(hCard, rContext);
1273 rv = RFCheckReaderEventState(rContext, hCard);
1280 rv = RFCheckReaderStatus(rContext);
1285 UNREF_READER(rContext)
1291 LPCVOID pbSendBuffer, DWORD cbSendLength,
1292 LPVOID pbRecvBuffer, DWORD cbRecvLength, LPDWORD lpBytesReturned)
1298 *lpBytesReturned = 0;
1304 rv = RFReaderInfoById(hCard, &rContext);
1311 rv = RFCheckSharing(hCard, rContext);
1315 if (IFD_HVERSION_2_0 == rContext->
version)
1316 if (NULL == pbSendBuffer || 0 == cbSendLength)
1325 rv = RFCheckReaderStatus(rContext);
1329 if (IFD_HVERSION_2_0 == rContext->
version)
1332 *lpBytesReturned = cbRecvLength;
1333 rv = IFDControl_v2(rContext, (PUCHAR)pbSendBuffer,
1334 cbSendLength, pbRecvBuffer, lpBytesReturned);
1337 if (IFD_HVERSION_3_0 == rContext->
version)
1338 rv =
IFDControl(rContext, dwControlCode, pbSendBuffer,
1339 cbSendLength, pbRecvBuffer, cbRecvLength, lpBytesReturned);
1344 UNREF_READER(rContext)
1350 LPBYTE pbAttr, LPDWORD pcbAttrLen)
1359 rv = RFReaderInfoById(hCard, &rContext);
1366 rv = RFCheckSharing(hCard, rContext);
1373 rv = RFCheckReaderStatus(rContext);
1380 rv = RFCheckReaderEventState(rContext, hCard);
1399 if (len > *pcbAttrLen)
1403 (void)strlcpy((
char *)pbAttr,
1420 UNREF_READER(rContext)
1426 LPCBYTE pbAttr, DWORD cbAttrLen)
1435 rv = RFReaderInfoById(hCard, &rContext);
1442 rv = RFCheckSharing(hCard, rContext);
1449 rv = RFCheckReaderStatus(rContext);
1456 rv = RFCheckReaderEventState(rContext, hCard);
1470 UNREF_READER(rContext)
1476 LPCBYTE pbSendBuffer, DWORD cbSendLength,
1478 LPDWORD pcbRecvLength)
1483 DWORD dwRxLength, tempRxLength;
1485 dwRxLength = *pcbRecvLength;
1498 rv = RFReaderInfoById(hCard, &rContext);
1505 rv = RFCheckSharing(hCard, rContext);
1512 rv = RFCheckReaderStatus(rContext);
1519 rv = RFCheckReaderEventState(rContext, hCard);
1552 sSendPci.Protocol = 0;
1556 sSendPci.Protocol = 1;
1569 for (i = 0 ; prot != 1 ; i++)
1572 sSendPci.Protocol = i;
1581 Log2(PCSC_LOG_DEBUG,
"Send Protocol: T=%ld", sSendPci.Protocol);
1583 tempRxLength = dwRxLength;
1586 && (rContext->
version == IFD_HVERSION_2_0))
1588 rv = IFDControl_v2(rContext, (PUCHAR) pbSendBuffer, cbSendLength,
1589 pbRecvBuffer, &dwRxLength);
1592 rv =
IFDTransmit(rContext, sSendPci, (PUCHAR) pbSendBuffer,
1593 cbSendLength, pbRecvBuffer, &dwRxLength, &sRecvPci);
1606 Log2(PCSC_LOG_ERROR,
"Card not transacted: 0x%08lX", rv);
1613 if (tempRxLength < dwRxLength)
1623 *pcbRecvLength = dwRxLength;
1626 UNREF_READER(rContext)
struct pubReaderStatesList * readerState
link to the reader state
uint32_t cardAtrLength
ATR length.
#define SCARD_ATTR_DEVICE_FRIENDLY_NAME
Reader's display name.
int32_t contexts
Number of open contexts.
#define IFD_ERROR_TAG
tag unknown
#define SCARD_E_PROTO_MISMATCH
The requested protocols are incompatible with the protocol currently in use with the smart card...
volatile SCARDHANDLE hLockId
Lock Id.
#define SCARD_SCOPE_USER
Scope in user space.
#define TAG_IFD_STOP_POLLING_THREAD
method used to stop the polling thread (instead of just pthread_kill())
#define PCSCLITE_SHARING_NO_CONTEXT
No application is using the reader.
#define MAX_BUFFER_SIZE
Maximum Tx/Rx Buffer for short APDU.
LONG IFDGetCapabilities(READER_CONTEXT *rContext, DWORD dwTag, PDWORD pdwLength, PUCHAR pucValue)
Get's capabilities in the reader.
This keeps a list of defines shared between the driver and the application.
char readerName[MAX_READERNAME]
reader name
PCSC_API LONG SCardEstablishContext(DWORD dwScope, LPCVOID pvReserved1, LPCVOID pvReserved2, LPSCARDCONTEXT phContext)
Creates an Application Context to the PC/SC Resource Manager.
unsigned long cbPciLength
Protocol Control Inf Length.
int32_t readerSharing
PCSCLITE_SHARING_* sharing status.
#define SCARD_E_INVALID_PARAMETER
One or more of the supplied parameters could not be properly interpreted.
#define SCARD_E_NOT_TRANSACTED
An attempt was made to end a non-existent transaction.
#define SCARD_LEAVE_CARD
Do nothing on close.
This handles protocol defaults, PTS, etc.
This handles abstract system level calls.
int slot
Current Reader Slot.
This wraps the dynamic ifdhandler functions.
#define SCARD_PROTOCOL_T1
T=1 active protocol.
#define SCARD_E_INVALID_HANDLE
The supplied handle was invalid.
#define SCARD_SCOPE_TERMINAL
Scope in terminal.
#define SCARD_W_UNRESPONSIVE_CARD
The smart card is not responding to a reset.
PCSC_API LONG SCardGetAttrib(SCARDHANDLE hCard, DWORD dwAttrId, LPBYTE pbAttr, LPDWORD pcbAttrLen)
Get an attribute from the IFD Handler (reader driver).
#define SCARD_PROTOCOL_ANY_OLD
used for backward compatibility
#define SCARD_PRESENT
Card is present.
PCSC_API LONG SCardDisconnect(SCARDHANDLE hCard, DWORD dwDisposition)
Terminates a connection made through SCardConnect().
int SYS_USleep(int)
Makes the current process sleep for some microseconds.
#define SCARD_NEGOTIABLE
Ready for PTS.
#define PCSCLITE_SHARING_EXCLUSIVE_CONTEXT
Reader used in exclusive mode.
#define PCSCLITE_LOCK_POLL_RATE
Lock polling rate.
LONG SCARDCONTEXT
hContext returned by SCardEstablishContext()
This keeps track of smart card protocols, timing issues and Answer to Reset ATR handling.
#define SCARD_E_INVALID_VALUE
One or more of the supplied parameters values could not be properly interpreted.
#define SCARD_RESET
Card was reset.
#define SCARD_SHARE_SHARED
Shared mode only.
LONG IFDTransmit(READER_CONTEXT *rContext, SCARD_IO_HEADER pioTxPci, PUCHAR pucTxBuffer, DWORD dwTxLength, PUCHAR pucRxBuffer, PDWORD pdwRxLength, PSCARD_IO_HEADER pioRxPci)
Transmit an APDU to the ICC.
unsigned long dwProtocol
Protocol identifier.
prototypes of strlcpy()/strlcat() imported from OpenBSD
#define IFD_POWER_DOWN
power down the card
int version
IFD Handler version number.
#define SCARD_PROTOCOL_T0
T=0 active protocol.
pthread_mutex_t * mMutex
Mutex for this connection.
PCSC_API LONG SCardReconnect(SCARDHANDLE hCard, DWORD dwShareMode, DWORD dwPreferredProtocols, DWORD dwInitialization, LPDWORD pdwActiveProtocol)
Reestablishes a connection to a reader that was previously connected to using SCardConnect().
long int time_sub(struct timeval *a, struct timeval *b)
return the difference (as long int) in µs between 2 struct timeval r = a - b
short ATRDecodeAtr(int *availableProtocols, int *currentProtocol, PUCHAR pucAtr, DWORD dwLength)
parse an ATR
This handles card insertion/removal events, updates ATR, protocol, and status information.
#define SCARD_UNPOWER_CARD
Power down on close.
LONG IFDSetCapabilities(READER_CONTEXT *rContext, DWORD dwTag, DWORD dwLength, PUCHAR pucValue)
Set capabilities in the reader.
#define SCARD_W_REMOVED_CARD
The smart card has been removed, so further communication is not possible.
PCSC_API LONG SCardConnect(SCARDCONTEXT hContext, LPCSTR szReader, DWORD dwShareMode, DWORD dwPreferredProtocols, LPSCARDHANDLE phCard, LPDWORD pdwActiveProtocol)
Establishes a connection to the reader specified in * szReader.
PCSC_API LONG SCardStatus(SCARDHANDLE hCard, LPSTR mszReaderName, LPDWORD pcchReaderLen, LPDWORD pdwState, LPDWORD pdwProtocol, LPBYTE pbAtr, LPDWORD pcbAtrLen)
Returns the current status of the reader connected to by hCard.
PCSC_API LONG SCardSetAttrib(SCARDHANDLE hCard, DWORD dwAttrId, LPCBYTE pbAttr, DWORD cbAttrLen)
Set an attribute of the IFD Handler.
#define SCARD_SWALLOWED
Card not powered.
#define SCARD_E_UNSUPPORTED_FEATURE
This smart card does not support the requested feature.
int powerState
auto power off state
#define SCARD_PROTOCOL_UNDEFINED
protocol not set
#define SCARD_RESET_CARD
Reset on close.
UCHAR cardAtr[MAX_ATR_SIZE]
ATR.
LONG SCARDHANDLE
hCard returned by SCardConnect()
LONG IFDPowerICC(READER_CONTEXT *rContext, DWORD dwAction, PUCHAR pucAtr, PDWORD pdwAtrLen)
Power up/down or reset's an ICC located in the IFD.
#define SCARD_SHARE_EXCLUSIVE
Exclusive mode only.
#define SCARD_POWERED
Card is powered.
DWORD PHSetProtocol(struct ReaderContext *rContext, DWORD dwPreferred, UCHAR ucAvailable, UCHAR ucDefault)
Determine which protocol to use.
PCSC_API LONG SCardBeginTransaction(SCARDHANDLE hCard)
Establishes a temporary exclusive access mode for doing a serie of commands in a transaction.
This keeps a list of defines for pcsc-lite.
#define SCARD_PROTOCOL_RAW
Raw active protocol.
#define SCARD_EJECT_CARD
Eject on close.
Protocol Control Information (PCI)
PCSC_API LONG SCardControl(SCARDHANDLE hCard, DWORD dwControlCode, LPCVOID pbSendBuffer, DWORD cbSendLength, LPVOID pbRecvBuffer, DWORD cbRecvLength, LPDWORD lpBytesReturned)
Sends a command directly to the IFD Handler (reader driver) to be processed by the reader...
#define SCARD_E_SHARING_VIOLATION
The smart card cannot be accessed because of other connections outstanding.
#define SCARD_SCOPE_GLOBAL
Scope is global.
#define SCARD_W_UNPOWERED_CARD
Power has been removed from the smart card, so that further communication is not possible.
#define SCARD_ABSENT
Card is absent.
uint32_t cardProtocol
SCARD_PROTOCOL_* value.
#define SCARD_E_NO_SMARTCARD
The operation requires a Smart Card, but no Smart Card is currently in the device.
This keeps track of a list of currently available reader structures.
#define MAX_ATR_SIZE
Maximum ATR size.
#define IFD_ERROR_INSUFFICIENT_BUFFER
buffer is too small
uint32_t readerState
SCARD_* bit field.
#define SCARD_E_INSUFFICIENT_BUFFER
The data buffer to receive returned data is too small for the returned data.
#define SCARD_SHARE_DIRECT
Raw mode only.
#define PCSCLITE_SHARING_LAST_CONTEXT
One application is using the reader.
pthread_mutex_t powerState_lock
powerState mutex
PCSC_API LONG SCardEndTransaction(SCARDHANDLE hCard, DWORD dwDisposition)
Ends a previously begun transaction.
PCSC_API LONG SCardTransmit(SCARDHANDLE hCard, const SCARD_IO_REQUEST *pioSendPci, LPCBYTE pbSendBuffer, DWORD cbSendLength, SCARD_IO_REQUEST *pioRecvPci, LPBYTE pbRecvBuffer, LPDWORD pcbRecvLength)
Sends an APDU to the smart card contained in the reader connected to by SCardConnect().
#define IFD_RESET
warm reset
#define SCARD_S_SUCCESS
error codes from http://msdn.microsoft.com/en-us/library/aa924526.aspx
#define SCARD_SCOPE_SYSTEM
Scope in system.
This handles smart card reader communications.
PCSC_API LONG SCardReleaseContext(SCARDCONTEXT hContext)
Destroys a communication context to the PC/SC Resource Manager.
#define IFD_POWER_UP
power up the card
#define IFD_SUCCESS
no error
LONG IFDControl(READER_CONTEXT *rContext, DWORD ControlCode, LPCVOID TxBuffer, DWORD TxLength, LPVOID RxBuffer, DWORD RxLength, LPDWORD BytesReturned)
Provide a means for toggling a specific action on the reader such as swallow, eject, biometric.
#define SCARD_F_INTERNAL_ERROR
An internal consistency check failed.