22 #include <sys/types.h>
32 static char strError[] =
"0x12345678";
34 snprintf(strError,
sizeof(strError),
"0x%08lX", pcscError);
58 static char strError[75];
63 (void)strlcpy(strError,
"Command successful.",
sizeof(strError));
66 (void)strlcpy(strError,
"Internal error.",
sizeof(strError));
69 (void)strlcpy(strError,
"Command cancelled.",
sizeof(strError));
72 (void)strlcpy(strError,
"Invalid handle.",
sizeof(strError));
75 (void)strlcpy(strError,
"Invalid parameter given.",
sizeof(strError));
78 (void)strlcpy(strError,
"Invalid target given.",
sizeof(strError));
81 (void)strlcpy(strError,
"Not enough memory.",
sizeof(strError));
84 (void)strlcpy(strError,
"Waited too long.",
sizeof(strError));
87 (void)strlcpy(strError,
"Insufficient buffer.",
sizeof(strError));
90 (void)strlcpy(strError,
"Unknown reader specified.",
sizeof(strError));
93 (void)strlcpy(strError,
"Command timeout.",
sizeof(strError));
96 (void)strlcpy(strError,
"Sharing violation.",
sizeof(strError));
99 (void)strlcpy(strError,
"No smart card inserted.",
sizeof(strError));
102 (void)strlcpy(strError,
"Unknown card.",
sizeof(strError));
105 (void)strlcpy(strError,
"Cannot dispose handle.",
sizeof(strError));
108 (void)strlcpy(strError,
"Card protocol mismatch.",
sizeof(strError));
111 (void)strlcpy(strError,
"Subsystem not ready.",
sizeof(strError));
114 (void)strlcpy(strError,
"Invalid value given.",
sizeof(strError));
117 (void)strlcpy(strError,
"System cancelled.",
sizeof(strError));
120 (void)strlcpy(strError,
"RPC transport error.",
sizeof(strError));
123 (void)strlcpy(strError,
"Unknown error.",
sizeof(strError));
126 (void)strlcpy(strError,
"Invalid ATR.",
sizeof(strError));
129 (void)strlcpy(strError,
"Transaction failed.",
sizeof(strError));
132 (void)strlcpy(strError,
"Reader is unavailable.",
sizeof(strError));
136 (void)strlcpy(strError,
"PCI struct too small.",
sizeof(strError));
139 (void)strlcpy(strError,
"Reader is unsupported.",
sizeof(strError));
142 (void)strlcpy(strError,
"Reader already exists.",
sizeof(strError));
145 (void)strlcpy(strError,
"Card is unsupported.",
sizeof(strError));
148 (void)strlcpy(strError,
"Service not available.",
sizeof(strError));
151 (void)strlcpy(strError,
"Service was stopped.",
sizeof(strError));
167 (void)strlcpy(strError,
"Cannot find a smart card reader.",
sizeof(strError));
173 (void)strlcpy(strError,
"Card is not supported.",
sizeof(strError));
176 (void)strlcpy(strError,
"Card is unresponsive.",
sizeof(strError));
179 (void)strlcpy(strError,
"Card is unpowered.",
sizeof(strError));
182 (void)strlcpy(strError,
"Card was reset.",
sizeof(strError));
185 (void)strlcpy(strError,
"Card was removed.",
sizeof(strError));
195 (void)strlcpy(strError,
"Feature not supported.",
sizeof(strError));
198 (void)snprintf(strError,
sizeof(strError)-1,
"Unknown error: 0x%08lX",
203 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.
prototypes of strlcpy()/strlcat() imported from OpenBSD
#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.