5#include "PCSC/pcsclite.h"
13int pcsc_assert_wire_constants(
void);
14int pcsc_assert_wire_constants(
void)
24 LASSERTF(MAX_READERNAME == 128,
" found %lld\n",
25 (
long long)MAX_READERNAME);
75 LASSERTF((
int)
sizeof(
struct version_struct) == 12,
" found %lld\n",
77 LASSERTF((
int)offsetof(
struct version_struct, major) == 0,
" found %lld\n",
79 LASSERTF((
int)
sizeof(((
struct version_struct *)0)->major) == 4,
" found %lld\n",
81 LASSERTF((
int)offsetof(
struct version_struct, minor) == 4,
" found %lld\n",
83 LASSERTF((
int)
sizeof(((
struct version_struct *)0)->minor) == 4,
" found %lld\n",
85 LASSERTF((
int)offsetof(
struct version_struct, rv) == 8,
" found %lld\n",
87 LASSERTF((
int)
sizeof(((
struct version_struct *)0)->rv) == 4,
" found %lld\n",
91 LASSERTF((
int)
sizeof(
struct client_struct) == 4,
" found %lld\n",
93 LASSERTF((
int)offsetof(
struct client_struct, hContext) == 0,
" found %lld\n",
95 LASSERTF((
int)
sizeof(((
struct client_struct *)0)->hContext) == 4,
" found %lld\n",
96 (
long long)(
int)
sizeof(((
struct client_struct *)0)->hContext));
101 LASSERTF((
int)offsetof(
struct establish_struct, dwScope) == 0,
" found %lld\n",
103 LASSERTF((
int)
sizeof(((
struct establish_struct *)0)->dwScope) == 4,
" found %lld\n",
105 LASSERTF((
int)offsetof(
struct establish_struct, hContext) == 4,
" found %lld\n",
107 LASSERTF((
int)
sizeof(((
struct establish_struct *)0)->hContext) == 4,
" found %lld\n",
111 LASSERTF((
int)
sizeof(((
struct establish_struct *)0)->rv) == 4,
" found %lld\n",
115 LASSERTF((
int)
sizeof(
struct release_struct) == 8,
" found %lld\n",
117 LASSERTF((
int)offsetof(
struct release_struct, hContext) == 0,
" found %lld\n",
119 LASSERTF((
int)
sizeof(((
struct release_struct *)0)->hContext) == 4,
" found %lld\n",
121 LASSERTF((
int)offsetof(
struct release_struct, rv) == 4,
" found %lld\n",
123 LASSERTF((
int)
sizeof(((
struct release_struct *)0)->rv) == 4,
" found %lld\n",
127 LASSERTF((
int)
sizeof(
struct connect_struct) == 152,
" found %lld\n",
129 LASSERTF((
int)offsetof(
struct connect_struct, hContext) == 0,
" found %lld\n",
131 LASSERTF((
int)
sizeof(((
struct connect_struct *)0)->hContext) == 4,
" found %lld\n",
133 LASSERTF((
int)offsetof(
struct connect_struct, szReader) == 4,
" found %lld\n",
135 LASSERTF((
int)
sizeof(((
struct connect_struct *)0)->szReader) == 128,
" found %lld\n",
137 LASSERTF((
int)offsetof(
struct connect_struct, dwShareMode) == 132,
" found %lld\n",
139 LASSERTF((
int)
sizeof(((
struct connect_struct *)0)->dwShareMode) == 4,
" found %lld\n",
140 (
long long)(
int)
sizeof(((
struct connect_struct *)0)->dwShareMode));
141 LASSERTF((
int)offsetof(
struct connect_struct, dwPreferredProtocols) == 136,
" found %lld\n",
142 (
long long)(
int)offsetof(
struct connect_struct, dwPreferredProtocols));
143 LASSERTF((
int)
sizeof(((
struct connect_struct *)0)->dwPreferredProtocols) == 4,
" found %lld\n",
144 (
long long)(
int)
sizeof(((
struct connect_struct *)0)->dwPreferredProtocols));
145 LASSERTF((
int)offsetof(
struct connect_struct, hCard) == 140,
" found %lld\n",
147 LASSERTF((
int)
sizeof(((
struct connect_struct *)0)->hCard) == 4,
" found %lld\n",
149 LASSERTF((
int)offsetof(
struct connect_struct, dwActiveProtocol) == 144,
" found %lld\n",
150 (
long long)(
int)offsetof(
struct connect_struct, dwActiveProtocol));
151 LASSERTF((
int)
sizeof(((
struct connect_struct *)0)->dwActiveProtocol) == 4,
" found %lld\n",
152 (
long long)(
int)
sizeof(((
struct connect_struct *)0)->dwActiveProtocol));
153 LASSERTF((
int)offsetof(
struct connect_struct, rv) == 148,
" found %lld\n",
155 LASSERTF((
int)
sizeof(((
struct connect_struct *)0)->rv) == 4,
" found %lld\n",
161 LASSERTF((
int)offsetof(
struct reconnect_struct, hCard) == 0,
" found %lld\n",
163 LASSERTF((
int)
sizeof(((
struct reconnect_struct *)0)->hCard) == 4,
" found %lld\n",
165 LASSERTF((
int)offsetof(
struct reconnect_struct, dwShareMode) == 4,
" found %lld\n",
167 LASSERTF((
int)
sizeof(((
struct reconnect_struct *)0)->dwShareMode) == 4,
" found %lld\n",
169 LASSERTF((
int)offsetof(
struct reconnect_struct, dwPreferredProtocols) == 8,
" found %lld\n",
171 LASSERTF((
int)
sizeof(((
struct reconnect_struct *)0)->dwPreferredProtocols) == 4,
" found %lld\n",
172 (
long long)(
int)
sizeof(((
struct reconnect_struct *)0)->dwPreferredProtocols));
173 LASSERTF((
int)offsetof(
struct reconnect_struct, dwInitialization) == 12,
" found %lld\n",
175 LASSERTF((
int)
sizeof(((
struct reconnect_struct *)0)->dwInitialization) == 4,
" found %lld\n",
177 LASSERTF((
int)offsetof(
struct reconnect_struct, dwActiveProtocol) == 16,
" found %lld\n",
179 LASSERTF((
int)
sizeof(((
struct reconnect_struct *)0)->dwActiveProtocol) == 4,
" found %lld\n",
183 LASSERTF((
int)
sizeof(((
struct reconnect_struct *)0)->rv) == 4,
" found %lld\n",
191 LASSERTF((
int)
sizeof(((
struct disconnect_struct *)0)->hCard) == 4,
" found %lld\n",
193 LASSERTF((
int)offsetof(
struct disconnect_struct, dwDisposition) == 4,
" found %lld\n",
195 LASSERTF((
int)
sizeof(((
struct disconnect_struct *)0)->dwDisposition) == 4,
" found %lld\n",
203 LASSERTF((
int)
sizeof(
struct begin_struct) == 8,
" found %lld\n",
205 LASSERTF((
int)offsetof(
struct begin_struct, hCard) == 0,
" found %lld\n",
207 LASSERTF((
int)
sizeof(((
struct begin_struct *)0)->hCard) == 4,
" found %lld\n",
208 (
long long)(
int)
sizeof(((
struct begin_struct *)0)->hCard));
209 LASSERTF((
int)offsetof(
struct begin_struct, rv) == 4,
" found %lld\n",
211 LASSERTF((
int)
sizeof(((
struct begin_struct *)0)->rv) == 4,
" found %lld\n",
212 (
long long)(
int)
sizeof(((
struct begin_struct *)0)->rv));
215 LASSERTF((
int)
sizeof(
struct end_struct) == 12,
" found %lld\n",
217 LASSERTF((
int)offsetof(
struct end_struct, hCard) == 0,
" found %lld\n",
218 (
long long)(
int)offsetof(
struct end_struct, hCard));
219 LASSERTF((
int)
sizeof(((
struct end_struct *)0)->hCard) == 4,
" found %lld\n",
220 (
long long)(
int)
sizeof(((
struct end_struct *)0)->hCard));
221 LASSERTF((
int)offsetof(
struct end_struct, dwDisposition) == 4,
" found %lld\n",
222 (
long long)(
int)offsetof(
struct end_struct, dwDisposition));
223 LASSERTF((
int)
sizeof(((
struct end_struct *)0)->dwDisposition) == 4,
" found %lld\n",
224 (
long long)(
int)
sizeof(((
struct end_struct *)0)->dwDisposition));
225 LASSERTF((
int)offsetof(
struct end_struct, rv) == 8,
" found %lld\n",
226 (
long long)(
int)offsetof(
struct end_struct, rv));
227 LASSERTF((
int)
sizeof(((
struct end_struct *)0)->rv) == 4,
" found %lld\n",
228 (
long long)(
int)
sizeof(((
struct end_struct *)0)->rv));
231 LASSERTF((
int)
sizeof(
struct cancel_struct) == 8,
" found %lld\n",
233 LASSERTF((
int)offsetof(
struct cancel_struct, hContext) == 0,
" found %lld\n",
235 LASSERTF((
int)
sizeof(((
struct cancel_struct *)0)->hContext) == 4,
" found %lld\n",
236 (
long long)(
int)
sizeof(((
struct cancel_struct *)0)->hContext));
237 LASSERTF((
int)offsetof(
struct cancel_struct, rv) == 4,
" found %lld\n",
239 LASSERTF((
int)
sizeof(((
struct cancel_struct *)0)->rv) == 4,
" found %lld\n",
243 LASSERTF((
int)
sizeof(
struct status_struct) == 8,
" found %lld\n",
245 LASSERTF((
int)offsetof(
struct status_struct, hCard) == 0,
" found %lld\n",
247 LASSERTF((
int)
sizeof(((
struct status_struct *)0)->hCard) == 4,
" found %lld\n",
249 LASSERTF((
int)offsetof(
struct status_struct, rv) == 4,
" found %lld\n",
251 LASSERTF((
int)
sizeof(((
struct status_struct *)0)->rv) == 4,
" found %lld\n",
257 LASSERTF((
int)offsetof(
struct transmit_struct, hCard) == 0,
" found %lld\n",
259 LASSERTF((
int)
sizeof(((
struct transmit_struct *)0)->hCard) == 4,
" found %lld\n",
261 LASSERTF((
int)offsetof(
struct transmit_struct, ioSendPciProtocol) == 4,
" found %lld\n",
263 LASSERTF((
int)
sizeof(((
struct transmit_struct *)0)->ioSendPciProtocol) == 4,
" found %lld\n",
264 (
long long)(
int)
sizeof(((
struct transmit_struct *)0)->ioSendPciProtocol));
265 LASSERTF((
int)offsetof(
struct transmit_struct, ioSendPciLength) == 8,
" found %lld\n",
267 LASSERTF((
int)
sizeof(((
struct transmit_struct *)0)->ioSendPciLength) == 4,
" found %lld\n",
268 (
long long)(
int)
sizeof(((
struct transmit_struct *)0)->ioSendPciLength));
269 LASSERTF((
int)offsetof(
struct transmit_struct, cbSendLength) == 12,
" found %lld\n",
271 LASSERTF((
int)
sizeof(((
struct transmit_struct *)0)->cbSendLength) == 4,
" found %lld\n",
273 LASSERTF((
int)offsetof(
struct transmit_struct, ioRecvPciProtocol) == 16,
" found %lld\n",
275 LASSERTF((
int)
sizeof(((
struct transmit_struct *)0)->ioRecvPciProtocol) == 4,
" found %lld\n",
276 (
long long)(
int)
sizeof(((
struct transmit_struct *)0)->ioRecvPciProtocol));
277 LASSERTF((
int)offsetof(
struct transmit_struct, ioRecvPciLength) == 20,
" found %lld\n",
279 LASSERTF((
int)
sizeof(((
struct transmit_struct *)0)->ioRecvPciLength) == 4,
" found %lld\n",
280 (
long long)(
int)
sizeof(((
struct transmit_struct *)0)->ioRecvPciLength));
281 LASSERTF((
int)offsetof(
struct transmit_struct, pcbRecvLength) == 24,
" found %lld\n",
283 LASSERTF((
int)
sizeof(((
struct transmit_struct *)0)->pcbRecvLength) == 4,
" found %lld\n",
285 LASSERTF((
int)offsetof(
struct transmit_struct, rv) == 28,
" found %lld\n",
287 LASSERTF((
int)
sizeof(((
struct transmit_struct *)0)->rv) == 4,
" found %lld\n",
291 LASSERTF((
int)
sizeof(
struct control_struct) == 24,
" found %lld\n",
293 LASSERTF((
int)offsetof(
struct control_struct, hCard) == 0,
" found %lld\n",
295 LASSERTF((
int)
sizeof(((
struct control_struct *)0)->hCard) == 4,
" found %lld\n",
297 LASSERTF((
int)offsetof(
struct control_struct, dwControlCode) == 4,
" found %lld\n",
299 LASSERTF((
int)
sizeof(((
struct control_struct *)0)->dwControlCode) == 4,
" found %lld\n",
300 (
long long)(
int)
sizeof(((
struct control_struct *)0)->dwControlCode));
301 LASSERTF((
int)offsetof(
struct control_struct, cbSendLength) == 8,
" found %lld\n",
303 LASSERTF((
int)
sizeof(((
struct control_struct *)0)->cbSendLength) == 4,
" found %lld\n",
304 (
long long)(
int)
sizeof(((
struct control_struct *)0)->cbSendLength));
305 LASSERTF((
int)offsetof(
struct control_struct, cbRecvLength) == 12,
" found %lld\n",
307 LASSERTF((
int)
sizeof(((
struct control_struct *)0)->cbRecvLength) == 4,
" found %lld\n",
308 (
long long)(
int)
sizeof(((
struct control_struct *)0)->cbRecvLength));
309 LASSERTF((
int)offsetof(
struct control_struct, dwBytesReturned) == 16,
" found %lld\n",
310 (
long long)(
int)offsetof(
struct control_struct, dwBytesReturned));
311 LASSERTF((
int)
sizeof(((
struct control_struct *)0)->dwBytesReturned) == 4,
" found %lld\n",
312 (
long long)(
int)
sizeof(((
struct control_struct *)0)->dwBytesReturned));
313 LASSERTF((
int)offsetof(
struct control_struct, rv) == 20,
" found %lld\n",
315 LASSERTF((
int)
sizeof(((
struct control_struct *)0)->rv) == 4,
" found %lld\n",
319 LASSERTF((
int)
sizeof(
struct getset_struct) == 280,
" found %lld\n",
321 LASSERTF((
int)offsetof(
struct getset_struct, hCard) == 0,
" found %lld\n",
323 LASSERTF((
int)
sizeof(((
struct getset_struct *)0)->hCard) == 4,
" found %lld\n",
325 LASSERTF((
int)offsetof(
struct getset_struct, dwAttrId) == 4,
" found %lld\n",
327 LASSERTF((
int)
sizeof(((
struct getset_struct *)0)->dwAttrId) == 4,
" found %lld\n",
328 (
long long)(
int)
sizeof(((
struct getset_struct *)0)->dwAttrId));
329 LASSERTF((
int)offsetof(
struct getset_struct, cbAttrLen) == 272,
" found %lld\n",
331 LASSERTF((
int)
sizeof(((
struct getset_struct *)0)->cbAttrLen) == 4,
" found %lld\n",
332 (
long long)(
int)
sizeof(((
struct getset_struct *)0)->cbAttrLen));
333 LASSERTF((
int)offsetof(
struct getset_struct, rv) == 276,
" found %lld\n",
335 LASSERTF((
int)
sizeof(((
struct getset_struct *)0)->rv) == 4,
" found %lld\n",
343 LASSERTF((
int)
sizeof(((
struct pubReaderStatesList *)0)->readerName) == 128,
" found %lld\n",
347 LASSERTF((
int)
sizeof(((
struct pubReaderStatesList *)0)->readerState) == 4,
" found %lld\n",
351 LASSERTF((
int)
sizeof(((
struct pubReaderStatesList *)0)->readerSharing) == 4,
" found %lld\n",
359 LASSERTF((
int)
sizeof(((
struct pubReaderStatesList *)0)->cardAtrLength) == 4,
" found %lld\n",
363 LASSERTF((
int)
sizeof(((
struct pubReaderStatesList *)0)->cardProtocol) == 4,
" found %lld\n",
This handles card insertion/removal events, updates ATR, protocol, and status information.
#define MAX_ATR_SIZE
Maximum ATR size.
#define MAX_BUFFER_SIZE
Maximum Tx/Rx Buffer for short APDU.
This keeps track of a list of currently available reader structures.
contained in SCARD_BEGIN_TRANSACTION Messages.
contained in SCARD_CANCEL Messages.
contained in SCARD_CONNECT Messages.
contained in SCARD_CONTROL Messages.
contained in SCARD_DISCONNECT Messages.
contained in SCARD_END_TRANSACTION Messages.
Information contained in SCARD_ESTABLISH_CONTEXT Messages.
contained in SCARD_GET_ATTRIB and Messages.
Define an exported public reader state structure so each application gets instant notification of cha...
contained in SCARD_RECONNECT Messages.
Information contained in SCARD_RELEASE_CONTEXT Messages.
contained in SCARD_STATUS Messages.
contained in SCARD_TRANSMIT Messages.
Information transmitted in CMD_VERSION Messages.
This defines some structures and #defines to be used over the transport layer.
#define PROTOCOL_VERSION_MAJOR
Major version of the current message protocol.
#define PROTOCOL_VERSION_MINOR
Minor version of the current message protocol.
@ SCARD_DISCONNECT
used by SCardDisconnect()
@ SCARD_SET_ATTRIB
used by SCardSetAttrib()
@ SCARD_RELEASE_CONTEXT
used by SCardReleaseContext()
@ CMD_STOP_WAITING_READER_STATE_CHANGE
stop waiting for a reader state change
@ CMD_GET_READERS_STATE
get the readers state
@ SCARD_GET_STATUS_CHANGE
not used
@ SCARD_CONTROL
used by SCardControl()
@ CMD_VERSION
get the client/server protocol version
@ CMD_WAIT_READER_STATE_CHANGE
wait for a reader state change
@ SCARD_RECONNECT
used by SCardReconnect()
@ SCARD_STATUS
used by SCardStatus()
@ SCARD_GET_ATTRIB
used by SCardGetAttrib()
@ SCARD_BEGIN_TRANSACTION
used by SCardBeginTransaction()
@ SCARD_TRANSMIT
used by SCardTransmit()
@ SCARD_LIST_READERS
used by SCardListReaders()
@ SCARD_END_TRANSACTION
used by SCardEndTransaction()
@ SCARD_CANCEL
used by SCardCancel()
@ SCARD_CANCEL_TRANSACTION
not used
@ SCARD_CONNECT
used by SCardConnect()
@ SCARD_ESTABLISH_CONTEXT
used by SCardEstablishContext()