45 #include <sys/types.h>
55 static char strError[] =
"0x12345678";
57 snprintf(strError,
sizeof(strError),
"0x%08lX", pcscError);
81 static char strError[75];
82 const char *msg = NULL;
87 msg =
"Command successful.";
90 msg =
"Internal error.";
93 msg =
"Command cancelled.";
96 msg =
"Invalid handle.";
99 msg =
"Invalid parameter given.";
102 msg =
"Invalid target given.";
105 msg =
"Not enough memory.";
108 msg =
"Waited too long.";
111 msg =
"Insufficient buffer.";
114 msg =
"Unknown reader specified.";
117 msg =
"Command timeout.";
120 msg =
"Sharing violation.";
123 msg =
"No smart card inserted.";
126 msg =
"Unknown card.";
129 msg =
"Cannot dispose handle.";
132 msg =
"Card protocol mismatch.";
135 msg =
"Subsystem not ready.";
138 msg =
"Invalid value given.";
141 msg =
"System cancelled.";
144 msg =
"RPC transport error.";
147 msg =
"Unknown error.";
150 msg =
"Invalid ATR.";
153 msg =
"Transaction failed.";
156 msg =
"Reader is unavailable.";
160 msg =
"PCI struct too small.";
163 msg =
"Reader is unsupported.";
166 msg =
"Reader already exists.";
169 msg =
"Card is unsupported.";
172 msg =
"Service not available.";
175 msg =
"Service was stopped.";
191 msg =
"Cannot find a smart card reader.";
197 msg =
"Card is not supported.";
200 msg =
"Card is unresponsive.";
203 msg =
"Card is unpowered.";
206 msg =
"Card was reset.";
209 msg =
"Card was removed.";
219 msg =
"Feature not supported.";
222 (void)snprintf(strError,
sizeof(strError)-1,
"Unknown error: 0x%08lX",
227 (void)strncpy(strError, msg,
sizeof(strError));
229 (
void)snprintf(strError,
sizeof(strError)-1,
"Unknown error: 0x%08lX",
233 strError[
sizeof(strError)-1] =
'\0';
#define SCARD_E_CARD_UNSUPPORTED
The smart card does not meet minimal requirements for support.
#define SCARD_E_CANCELLED
The action was cancelled by an SCardCancel request.
#define SCARD_E_READER_UNSUPPORTED
The reader driver does not meet minimal requirements for support.
#define SCARD_E_PROTO_MISMATCH
The requested protocols are incompatible with the protocol currently in use with the smart card...
#define SCARD_E_READER_UNAVAILABLE
The specified reader is not currently available for use.
#define SCARD_E_CANT_DISPOSE
The system could not dispose of the media in the requested manner.
#define SCARD_E_DUPLICATE_READER
The reader driver did not produce a unique reader name.
PCSC_API char * pcsc_stringify_error(const LONG pcscError)
Returns a human readable text for the given PC/SC error code.
#define SCARD_F_COMM_ERROR
An internal communications error has been detected.
#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_E_NO_SERVICE
The Smart card resource manager is not running.
#define SCARD_E_SERVICE_STOPPED
The Smart card resource manager has shut down.
#define SCARD_E_NO_READERS_AVAILABLE
Cannot find a smart card reader.
#define SCARD_E_UNKNOWN_CARD
The specified smart card name is not recognized.
#define SCARD_F_WAITED_TOO_LONG
An internal consistency timer has expired.
#define SCARD_F_UNKNOWN_ERROR
An internal error has been detected, but the source is unknown.
#define SCARD_E_INVALID_HANDLE
The supplied handle was invalid.
#define SCARD_W_UNRESPONSIVE_CARD
The smart card is not responding to a reset.
#define SCARD_E_INVALID_VALUE
One or more of the supplied parameters values could not be properly interpreted.
#define SCARD_W_UNSUPPORTED_CARD
The reader cannot communicate with the card, due to ATR string configuration conflicts.
This keeps a list of defines for pcsc-lite.
#define SCARD_W_REMOVED_CARD
The smart card has been removed, so further communication is not possible.
#define SCARD_E_UNSUPPORTED_FEATURE
This smart card does not support the requested feature.
#define SCARD_W_RESET_CARD
The smart card has been reset, so any shared state information is invalid.
#define SCARD_E_SHARING_VIOLATION
The smart card cannot be accessed because of other connections outstanding.
#define SCARD_W_UNPOWERED_CARD
Power has been removed from the smart card, so that further communication is not possible.
#define SCARD_E_SYSTEM_CANCELLED
The action was cancelled by the system, presumably to log off or shut down.
#define SCARD_E_NO_SMARTCARD
The operation requires a Smart Card, but no Smart Card is currently in the device.
#define SCARD_E_NO_MEMORY
Not enough memory available to complete this command.
#define SCARD_E_INSUFFICIENT_BUFFER
The data buffer to receive returned data is too small for the returned data.
#define SCARD_E_INVALID_TARGET
Registry startup information is missing or invalid.
#define SCARD_E_PCI_TOO_SMALL
The PCI Receive buffer was too small.
#define SCARD_E_INVALID_ATR
An ATR obtained from the registry is not a valid ATR string.
#define SCARD_E_UNKNOWN_READER
The specified reader name is not recognized.
#define SCARD_E_NOT_READY
The reader or smart card is not ready to accept commands.
#define SCARD_S_SUCCESS
error codes from http://msdn.microsoft.com/en-us/library/aa924526.aspx
#define SCARD_E_TIMEOUT
The user-specified timeout value has expired.
#define SCARD_F_INTERNAL_ERROR
An internal consistency check failed.