59#define MAX_ATR_SIZE 33
95#define SCARD_PCI_T0 (&g_rgSCardT0Pci)
96#define SCARD_PCI_T1 (&g_rgSCardT1Pci)
97#define SCARD_PCI_RAW (&g_rgSCardRawPci)
107#define SCARD_S_SUCCESS ((LONG)0x00000000)
109#define SCARD_F_INTERNAL_ERROR ((LONG)0x80100001)
111#define SCARD_E_CANCELLED ((LONG)0x80100002)
113#define SCARD_E_INVALID_HANDLE ((LONG)0x80100003)
115#define SCARD_E_INVALID_PARAMETER ((LONG)0x80100004)
117#define SCARD_E_INVALID_TARGET ((LONG)0x80100005)
119#define SCARD_E_NO_MEMORY ((LONG)0x80100006)
121#define SCARD_F_WAITED_TOO_LONG ((LONG)0x80100007)
123#define SCARD_E_INSUFFICIENT_BUFFER ((LONG)0x80100008)
125#define SCARD_E_UNKNOWN_READER ((LONG)0x80100009)
127#define SCARD_E_TIMEOUT ((LONG)0x8010000A)
129#define SCARD_E_SHARING_VIOLATION ((LONG)0x8010000B)
131#define SCARD_E_NO_SMARTCARD ((LONG)0x8010000C)
133#define SCARD_E_UNKNOWN_CARD ((LONG)0x8010000D)
135#define SCARD_E_CANT_DISPOSE ((LONG)0x8010000E)
137#define SCARD_E_PROTO_MISMATCH ((LONG)0x8010000F)
139#define SCARD_E_NOT_READY ((LONG)0x80100010)
141#define SCARD_E_INVALID_VALUE ((LONG)0x80100011)
143#define SCARD_E_SYSTEM_CANCELLED ((LONG)0x80100012)
145#define SCARD_F_COMM_ERROR ((LONG)0x80100013)
147#define SCARD_F_UNKNOWN_ERROR ((LONG)0x80100014)
149#define SCARD_E_INVALID_ATR ((LONG)0x80100015)
151#define SCARD_E_NOT_TRANSACTED ((LONG)0x80100016)
153#define SCARD_E_READER_UNAVAILABLE ((LONG)0x80100017)
155#define SCARD_P_SHUTDOWN ((LONG)0x80100018)
157#define SCARD_E_PCI_TOO_SMALL ((LONG)0x80100019)
159#define SCARD_E_READER_UNSUPPORTED ((LONG)0x8010001A)
161#define SCARD_E_DUPLICATE_READER ((LONG)0x8010001B)
163#define SCARD_E_CARD_UNSUPPORTED ((LONG)0x8010001C)
165#define SCARD_E_NO_SERVICE ((LONG)0x8010001D)
167#define SCARD_E_SERVICE_STOPPED ((LONG)0x8010001E)
169#define SCARD_E_UNEXPECTED ((LONG)0x8010001F)
171#define SCARD_E_UNSUPPORTED_FEATURE ((LONG)0x8010001F)
173#define SCARD_E_ICC_INSTALLATION ((LONG)0x80100020)
175#define SCARD_E_ICC_CREATEORDER ((LONG)0x80100021)
179#define SCARD_E_DIR_NOT_FOUND ((LONG)0x80100023)
181#define SCARD_E_FILE_NOT_FOUND ((LONG)0x80100024)
183#define SCARD_E_NO_DIR ((LONG)0x80100025)
185#define SCARD_E_NO_FILE ((LONG)0x80100026)
187#define SCARD_E_NO_ACCESS ((LONG)0x80100027)
189#define SCARD_E_WRITE_TOO_MANY ((LONG)0x80100028)
191#define SCARD_E_BAD_SEEK ((LONG)0x80100029)
193#define SCARD_E_INVALID_CHV ((LONG)0x8010002A)
195#define SCARD_E_UNKNOWN_RES_MSG ((LONG)0x8010002B)
196#define SCARD_E_UNKNOWN_RES_MNG SCARD_E_UNKNOWN_RES_MSG
198#define SCARD_E_NO_SUCH_CERTIFICATE ((LONG)0x8010002C)
200#define SCARD_E_CERTIFICATE_UNAVAILABLE ((LONG)0x8010002D)
202#define SCARD_E_NO_READERS_AVAILABLE ((LONG)0x8010002E)
204#define SCARD_E_COMM_DATA_LOST ((LONG)0x8010002F)
206#define SCARD_E_NO_KEY_CONTAINER ((LONG)0x80100030)
208#define SCARD_E_SERVER_TOO_BUSY ((LONG)0x80100031)
211#define SCARD_W_UNSUPPORTED_CARD ((LONG)0x80100065)
213#define SCARD_W_UNRESPONSIVE_CARD ((LONG)0x80100066)
215#define SCARD_W_UNPOWERED_CARD ((LONG)0x80100067)
217#define SCARD_W_RESET_CARD ((LONG)0x80100068)
219#define SCARD_W_REMOVED_CARD ((LONG)0x80100069)
222#define SCARD_W_SECURITY_VIOLATION ((LONG)0x8010006A)
224#define SCARD_W_WRONG_CHV ((LONG)0x8010006B)
226#define SCARD_W_CHV_BLOCKED ((LONG)0x8010006C)
228#define SCARD_W_EOF ((LONG)0x8010006D)
230#define SCARD_W_CANCELLED_BY_USER ((LONG)0x8010006E)
232#define SCARD_W_CARD_NOT_AUTHENTICATED ((LONG)0x8010006F)
234#define SCARD_AUTOALLOCATE (DWORD)(-1)
235#define SCARD_SCOPE_USER 0x0000
236#define SCARD_SCOPE_TERMINAL 0x0001
237#define SCARD_SCOPE_SYSTEM 0x0002
238#define SCARD_SCOPE_GLOBAL 0x0003
240#define SCARD_PROTOCOL_UNDEFINED 0x0000
241#define SCARD_PROTOCOL_UNSET SCARD_PROTOCOL_UNDEFINED
242#define SCARD_PROTOCOL_T0 0x0001
243#define SCARD_PROTOCOL_T1 0x0002
244#define SCARD_PROTOCOL_RAW 0x0004
245#define SCARD_PROTOCOL_T15 0x0008
247#define SCARD_PROTOCOL_ANY (SCARD_PROTOCOL_T0|SCARD_PROTOCOL_T1)
249#define SCARD_SHARE_EXCLUSIVE 0x0001
250#define SCARD_SHARE_SHARED 0x0002
251#define SCARD_SHARE_DIRECT 0x0003
253#define SCARD_LEAVE_CARD 0x0000
254#define SCARD_RESET_CARD 0x0001
255#define SCARD_UNPOWER_CARD 0x0002
256#define SCARD_EJECT_CARD 0x0003
258#define SCARD_UNKNOWN 0x0001
259#define SCARD_ABSENT 0x0002
260#define SCARD_PRESENT 0x0004
261#define SCARD_SWALLOWED 0x0008
262#define SCARD_POWERED 0x0010
263#define SCARD_NEGOTIABLE 0x0020
264#define SCARD_SPECIFIC 0x0040
266#define SCARD_STATE_UNAWARE 0x0000
267#define SCARD_STATE_IGNORE 0x0001
268#define SCARD_STATE_CHANGED 0x0002
269#define SCARD_STATE_UNKNOWN 0x0004
270#define SCARD_STATE_UNAVAILABLE 0x0008
271#define SCARD_STATE_EMPTY 0x0010
272#define SCARD_STATE_PRESENT 0x0020
273#define SCARD_STATE_ATRMATCH 0x0040
274#define SCARD_STATE_EXCLUSIVE 0x0080
275#define SCARD_STATE_INUSE 0x0100
276#define SCARD_STATE_MUTE 0x0200
277#define SCARD_STATE_UNPOWERED 0x0400
280#define INFINITE 0xFFFFFFFF
283#define PCSCLITE_VERSION_NUMBER "2.3.0"
285#define PCSCLITE_MAX_READERS_CONTEXTS 16
287#define MAX_READERNAME 128
289#ifndef SCARD_ATR_LENGTH
290#define SCARD_ATR_LENGTH MAX_ATR_SIZE
298#define MAX_BUFFER_SIZE 264
299#define MAX_BUFFER_SIZE_EXTENDED (4 + 3 + (1<<16) + 3 + 2)
const char * pcsc_stringify_error(const LONG)
Returns a human readable text for the given PC/SC error code.
PCSC_API const SCARD_IO_REQUEST g_rgSCardRawPci
Protocol Control Information for raw access.
PCSC_API const SCARD_IO_REQUEST g_rgSCardT1Pci
Protocol Control Information for T=1.
LONG SCARDCONTEXT
hContext returned by SCardEstablishContext()
#define MAX_ATR_SIZE
Maximum ATR size.
LONG SCARDHANDLE
hCard returned by SCardConnect()
const SCARD_IO_REQUEST g_rgSCardT0Pci
Protocol Control Information for T=0.
Protocol Control Information (PCI)
unsigned long dwProtocol
Protocol identifier.
unsigned long cbPciLength
Protocol Control Inf Length.
This keeps a list of Windows(R) types.