43 #include <sys/types.h>
53 static char strError[] =
"0x12345678";
55 snprintf(strError,
sizeof(strError),
"0x%08lX", pcscError);
79 static char strError[75];
80 const char *msg = NULL;
85 msg =
"Command successful.";
88 msg =
"Internal error.";
91 msg =
"Command cancelled.";
94 msg =
"Invalid handle.";
97 msg =
"Invalid parameter given.";
100 msg =
"Invalid target given.";
103 msg =
"Not enough memory.";
106 msg =
"Waited too long.";
109 msg =
"Insufficient buffer.";
112 msg =
"Unknown reader specified.";
115 msg =
"Command timeout.";
118 msg =
"Sharing violation.";
121 msg =
"No smart card inserted.";
124 msg =
"Unknown card.";
127 msg =
"Cannot dispose handle.";
130 msg =
"Card protocol mismatch.";
133 msg =
"Subsystem not ready.";
136 msg =
"Invalid value given.";
139 msg =
"System cancelled.";
142 msg =
"RPC transport error.";
145 msg =
"Unknown error.";
148 msg =
"Invalid ATR.";
151 msg =
"Transaction failed.";
154 msg =
"Reader is unavailable.";
158 msg =
"PCI struct too small.";
161 msg =
"Reader is unsupported.";
164 msg =
"Reader already exists.";
167 msg =
"Card is unsupported.";
170 msg =
"Service not available.";
173 msg =
"Service was stopped.";
189 msg =
"Cannot find a smart card reader.";
195 msg =
"Card is not supported.";
198 msg =
"Card is unresponsive.";
201 msg =
"Card is unpowered.";
204 msg =
"Card was reset.";
207 msg =
"Card was removed.";
217 msg =
"Feature not supported.";
220 (void)snprintf(strError,
sizeof(strError)-1,
"Unknown error: 0x%08lX",
225 (void)strncpy(strError, msg,
sizeof(strError));
227 (
void)snprintf(strError,
sizeof(strError)-1,
"Unknown error: 0x%08lX",
231 strError[
sizeof(strError)-1] =
'\0';
#define SCARD_E_INVALID_VALUE
One or more of the supplied parameters values could not be properly interpreted.
#define SCARD_S_SUCCESS
No error was encountered.
#define SCARD_E_SYSTEM_CANCELLED
The action was cancelled by the system, presumably to log off or shut down.
#define SCARD_E_CARD_UNSUPPORTED
The smart card does not meet minimal requirements for support.
#define SCARD_E_TIMEOUT
The user-specified timeout value has expired.
#define SCARD_E_NO_SERVICE
The Smart card resource manager is not running.
#define SCARD_E_INVALID_TARGET
Registry startup information is missing or invalid.
#define SCARD_E_INVALID_PARAMETER
One or more of the supplied parameters could not be properly interpreted.
PCSC_API char * pcsc_stringify_error(const LONG pcscError)
Returns a human readable text for the given PC/SC error code.
#define SCARD_E_NO_READERS_AVAILABLE
Cannot find a smart card reader.
#define SCARD_E_INVALID_ATR
An ATR obtained from the registry is not a valid ATR string.
#define SCARD_E_NO_SMARTCARD
The operation requires a Smart Card, but no Smart Card is currently in the device.
#define SCARD_W_UNRESPONSIVE_CARD
The smart card is not responding to a reset.
#define SCARD_E_READER_UNSUPPORTED
The reader driver does not meet minimal requirements for support.
#define SCARD_E_NOT_TRANSACTED
An attempt was made to end a non-existent transaction.
#define SCARD_E_NOT_READY
The reader or smart card is not ready to accept commands.
#define SCARD_E_PROTO_MISMATCH
The requested protocols are incompatible with the protocol currently in use with the smart card...
#define SCARD_F_UNKNOWN_ERROR
An internal error has been detected, but the source is unknown.
#define SCARD_W_UNSUPPORTED_CARD
The reader cannot communicate with the card, due to ATR string configuration conflicts.
#define SCARD_E_NO_MEMORY
Not enough memory available to complete this command.
#define SCARD_E_READER_UNAVAILABLE
The specified reader is not currently available for use.
#define SCARD_E_PCI_TOO_SMALL
The PCI Receive buffer was too small.
#define SCARD_E_UNKNOWN_CARD
The specified smart card name is not recognized.
#define SCARD_W_RESET_CARD
The smart card has been reset, so any shared state information is invalid.
This keeps a list of defines for pcsc-lite.
#define SCARD_F_COMM_ERROR
An internal communications error has been detected.
#define SCARD_W_REMOVED_CARD
The smart card has been removed, so further communication is not possible.
#define SCARD_E_INSUFFICIENT_BUFFER
The data buffer to receive returned data is too small for the returned data.
#define SCARD_E_CANCELLED
The action was cancelled by an SCardCancel request.
#define SCARD_E_DUPLICATE_READER
The reader driver did not produce a unique reader name.
#define SCARD_E_CANT_DISPOSE
The system could not dispose of the media in the requested manner.
#define SCARD_E_SHARING_VIOLATION
The smart card cannot be accessed because of other connections outstanding.
#define SCARD_E_UNKNOWN_READER
The specified reader name is not recognized.
#define SCARD_F_INTERNAL_ERROR
An internal consistency check failed.
#define SCARD_E_UNSUPPORTED_FEATURE
This smart card does not support the requested feature.
#define SCARD_E_SERVICE_STOPPED
The Smart card resource manager has shut down.
#define SCARD_E_INVALID_HANDLE
The supplied handle was invalid.
#define SCARD_F_WAITED_TOO_LONG
An internal consistency timer has expired.
#define SCARD_W_UNPOWERED_CARD
Power has been removed from the smart card, so that further communication is not possible.