53 static char strError[] =
"0x12345678";
55 snprintf(strError,
sizeof(strError),
"0x%08lX", pcscError);
86 static __thread
char strError[75];
87 const char *msg = NULL;
92 msg =
"Command successful.";
95 msg =
"Internal error.";
98 msg =
"Command cancelled.";
101 msg =
"Invalid handle.";
104 msg =
"Invalid parameter given.";
107 msg =
"Invalid target given.";
110 msg =
"Not enough memory.";
113 msg =
"Waited too long.";
116 msg =
"Insufficient buffer.";
119 msg =
"Unknown reader specified.";
122 msg =
"Command timeout.";
125 msg =
"Sharing violation.";
128 msg =
"No smart card inserted.";
131 msg =
"Unknown card.";
134 msg =
"Cannot dispose handle.";
137 msg =
"Card protocol mismatch.";
140 msg =
"Subsystem not ready.";
143 msg =
"Invalid value given.";
146 msg =
"System cancelled.";
149 msg =
"RPC transport error.";
152 msg =
"Unknown error.";
155 msg =
"Invalid ATR.";
158 msg =
"Transaction failed.";
161 msg =
"Reader is unavailable.";
165 msg =
"PCI struct too small.";
168 msg =
"Reader is unsupported.";
171 msg =
"Reader already exists.";
174 msg =
"Card is unsupported.";
177 msg =
"Service not available.";
180 msg =
"Service was stopped.";
196 msg =
"Cannot find a smart card reader.";
202 msg =
"Card is not supported.";
205 msg =
"Card is unresponsive.";
208 msg =
"Card is unpowered.";
211 msg =
"Card was reset.";
214 msg =
"Card was removed.";
217 msg =
"Access denied.";
226 msg =
"Feature not supported.";
229 (void)snprintf(strError,
sizeof(strError)-1,
"Unknown error: 0x%08lX",
234 (void)strncpy(strError, msg,
sizeof(strError));
236 (
void)snprintf(strError,
sizeof(strError)-1,
"Unknown error: 0x%08lX",
240 strError[
sizeof(strError)-1] =
'\0';
PCSC_API const char * pcsc_stringify_error(const LONG pcscError)
Returns a human readable text for the given PC/SC error code.
#define SCARD_E_INVALID_HANDLE
The supplied handle was invalid.
#define SCARD_F_INTERNAL_ERROR
An internal consistency check failed.
#define SCARD_E_READER_UNSUPPORTED
The reader driver does not meet minimal requirements for support.
#define SCARD_W_SECURITY_VIOLATION
Access was denied because of a security violation.
#define SCARD_E_CARD_UNSUPPORTED
The smart card does not meet minimal requirements for support.
#define SCARD_E_UNKNOWN_READER
The specified reader name is not recognized.
#define SCARD_W_RESET_CARD
The smart card has been reset, so any shared state information is invalid.
#define SCARD_E_SERVICE_STOPPED
The Smart card resource manager has shut down.
#define SCARD_F_UNKNOWN_ERROR
An internal error has been detected, but the source is unknown.
#define SCARD_W_UNRESPONSIVE_CARD
The smart card is not responding to a reset.
#define SCARD_E_PROTO_MISMATCH
The requested protocols are incompatible with the protocol currently in use with the smart card.
#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_PARAMETER
One or more of the supplied parameters could not be properly interpreted.
#define SCARD_E_CANCELLED
The action was cancelled by an SCardCancel request.
#define SCARD_S_SUCCESS
No error was encountered.
#define SCARD_E_CANT_DISPOSE
The system could not dispose of the media in the requested manner.
#define SCARD_E_NO_MEMORY
Not enough memory available to complete this command.
#define SCARD_E_NO_READERS_AVAILABLE
Cannot find a smart card reader.
#define SCARD_E_SHARING_VIOLATION
The smart card cannot be accessed because of other connections outstanding.
#define SCARD_E_DUPLICATE_READER
The reader driver did not produce a unique reader name.
#define SCARD_F_COMM_ERROR
An internal communications error has been detected.
#define SCARD_E_INVALID_VALUE
One or more of the supplied parameters values could not be properly interpreted.
#define SCARD_E_TIMEOUT
The user-specified timeout value has expired.
#define SCARD_F_WAITED_TOO_LONG
An internal consistency timer has expired.
#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_NOT_READY
The reader or smart card is not ready to accept commands.
#define SCARD_E_NO_SMARTCARD
The operation requires a Smart Card, but no Smart Card is currently in the device.
#define SCARD_E_NOT_TRANSACTED
An attempt was made to end a non-existent transaction.
#define SCARD_E_INVALID_ATR
An ATR obtained from the registry is not a valid ATR string.
#define SCARD_E_NO_SERVICE
The Smart card resource manager is not running.
#define SCARD_E_READER_UNAVAILABLE
The specified reader is not currently available for use.
#define SCARD_W_UNPOWERED_CARD
Power has been removed from the smart card, so that further communication is not possible.
#define SCARD_W_UNSUPPORTED_CARD
The reader cannot communicate with the card, due to ATR string configuration conflicts.
#define SCARD_E_UNKNOWN_CARD
The specified smart card name is not recognized.
#define SCARD_E_UNSUPPORTED_FEATURE
This smart card does not support the requested feature.
#define SCARD_E_SYSTEM_CANCELLED
The action was cancelled by the system, presumably to log off or shut down.
This keeps a list of defines for pcsc-lite.