pcsc-lite 2.3.0
pcsc-wirecheck-dist.c
1#include <sys/types.h>
2#include <time.h>
3#include <stddef.h>
4
5#include "PCSC/pcsclite.h"
6#include "pcscd.h"
7#include "readerfactory.h"
8#include "eventhandler.h"
9#include "winscard_msg.h"
10
11#include "lassert.h"
12
13int pcsc_assert_wire_constants(void);
14int pcsc_assert_wire_constants(void)
15{
16
17 /* Constants... */
18
19 LASSERTF(PROTOCOL_VERSION_MAJOR == 4," found %lld\n",
20 (long long)PROTOCOL_VERSION_MAJOR);
21 LASSERTF(PROTOCOL_VERSION_MINOR == 4," found %lld\n",
22 (long long)PROTOCOL_VERSION_MINOR);
23
24 LASSERTF(MAX_READERNAME == 128," found %lld\n",
25 (long long)MAX_READERNAME);
26 LASSERTF(MAX_ATR_SIZE == 33," found %lld\n",
27 (long long)MAX_ATR_SIZE);
28 LASSERTF(MAX_BUFFER_SIZE == 264," found %lld\n",
29 (long long)MAX_BUFFER_SIZE);
30
31 /* enum pcsc_msg_commands */
32 LASSERTF(SCARD_ESTABLISH_CONTEXT == 1, " found %lld\n",
33 (long long)SCARD_ESTABLISH_CONTEXT);
34 LASSERTF(SCARD_RELEASE_CONTEXT == 2, " found %lld\n",
35 (long long)SCARD_RELEASE_CONTEXT);
36 LASSERTF(SCARD_LIST_READERS == 3, " found %lld\n",
37 (long long)SCARD_LIST_READERS);
38 LASSERTF(SCARD_CONNECT == 4, " found %lld\n",
39 (long long)SCARD_CONNECT);
40 LASSERTF(SCARD_RECONNECT == 5, " found %lld\n",
41 (long long)SCARD_RECONNECT);
42 LASSERTF(SCARD_DISCONNECT == 6, " found %lld\n",
43 (long long)SCARD_DISCONNECT);
44 LASSERTF(SCARD_BEGIN_TRANSACTION == 7, " found %lld\n",
45 (long long)SCARD_BEGIN_TRANSACTION);
46 LASSERTF(SCARD_END_TRANSACTION == 8, " found %lld\n",
47 (long long)SCARD_END_TRANSACTION);
48 LASSERTF(SCARD_TRANSMIT == 9, " found %lld\n",
49 (long long)SCARD_TRANSMIT);
50 LASSERTF(SCARD_CONTROL == 10, " found %lld\n",
51 (long long)SCARD_CONTROL);
52 LASSERTF(SCARD_STATUS == 11, " found %lld\n",
53 (long long)SCARD_STATUS);
54 LASSERTF(SCARD_GET_STATUS_CHANGE == 12, " found %lld\n",
55 (long long)SCARD_GET_STATUS_CHANGE);
56 LASSERTF(SCARD_CANCEL == 13, " found %lld\n",
57 (long long)SCARD_CANCEL);
58 LASSERTF(SCARD_CANCEL_TRANSACTION == 14, " found %lld\n",
59 (long long)SCARD_CANCEL_TRANSACTION);
60 LASSERTF(SCARD_GET_ATTRIB == 15, " found %lld\n",
61 (long long)SCARD_GET_ATTRIB);
62 LASSERTF(SCARD_SET_ATTRIB == 16, " found %lld\n",
63 (long long)SCARD_SET_ATTRIB);
64 LASSERTF(CMD_VERSION == 17, " found %lld\n",
65 (long long)CMD_VERSION);
66 LASSERTF(CMD_GET_READERS_STATE == 18, " found %lld\n",
67 (long long)CMD_GET_READERS_STATE);
68 LASSERTF(CMD_WAIT_READER_STATE_CHANGE == 19, " found %lld\n",
70 LASSERTF(CMD_STOP_WAITING_READER_STATE_CHANGE == 20, " found %lld\n",
72 /* Types... */
73
74 /* Checks for struct version_struct */
75 LASSERTF((int)sizeof(struct version_struct) == 12, " found %lld\n",
76 (long long)(int)sizeof(struct version_struct));
77 LASSERTF((int)offsetof(struct version_struct, major) == 0, " found %lld\n",
78 (long long)(int)offsetof(struct version_struct, major));
79 LASSERTF((int)sizeof(((struct version_struct *)0)->major) == 4, " found %lld\n",
80 (long long)(int)sizeof(((struct version_struct *)0)->major));
81 LASSERTF((int)offsetof(struct version_struct, minor) == 4, " found %lld\n",
82 (long long)(int)offsetof(struct version_struct, minor));
83 LASSERTF((int)sizeof(((struct version_struct *)0)->minor) == 4, " found %lld\n",
84 (long long)(int)sizeof(((struct version_struct *)0)->minor));
85 LASSERTF((int)offsetof(struct version_struct, rv) == 8, " found %lld\n",
86 (long long)(int)offsetof(struct version_struct, rv));
87 LASSERTF((int)sizeof(((struct version_struct *)0)->rv) == 4, " found %lld\n",
88 (long long)(int)sizeof(((struct version_struct *)0)->rv));
89
90 /* Checks for struct client_struct */
91 LASSERTF((int)sizeof(struct client_struct) == 4, " found %lld\n",
92 (long long)(int)sizeof(struct client_struct));
93 LASSERTF((int)offsetof(struct client_struct, hContext) == 0, " found %lld\n",
94 (long long)(int)offsetof(struct client_struct, hContext));
95 LASSERTF((int)sizeof(((struct client_struct *)0)->hContext) == 4, " found %lld\n",
96 (long long)(int)sizeof(((struct client_struct *)0)->hContext));
97
98 /* Checks for struct establish_struct */
99 LASSERTF((int)sizeof(struct establish_struct) == 12, " found %lld\n",
100 (long long)(int)sizeof(struct establish_struct));
101 LASSERTF((int)offsetof(struct establish_struct, dwScope) == 0, " found %lld\n",
102 (long long)(int)offsetof(struct establish_struct, dwScope));
103 LASSERTF((int)sizeof(((struct establish_struct *)0)->dwScope) == 4, " found %lld\n",
104 (long long)(int)sizeof(((struct establish_struct *)0)->dwScope));
105 LASSERTF((int)offsetof(struct establish_struct, hContext) == 4, " found %lld\n",
106 (long long)(int)offsetof(struct establish_struct, hContext));
107 LASSERTF((int)sizeof(((struct establish_struct *)0)->hContext) == 4, " found %lld\n",
108 (long long)(int)sizeof(((struct establish_struct *)0)->hContext));
109 LASSERTF((int)offsetof(struct establish_struct, rv) == 8, " found %lld\n",
110 (long long)(int)offsetof(struct establish_struct, rv));
111 LASSERTF((int)sizeof(((struct establish_struct *)0)->rv) == 4, " found %lld\n",
112 (long long)(int)sizeof(((struct establish_struct *)0)->rv));
113
114 /* Checks for struct release_struct */
115 LASSERTF((int)sizeof(struct release_struct) == 8, " found %lld\n",
116 (long long)(int)sizeof(struct release_struct));
117 LASSERTF((int)offsetof(struct release_struct, hContext) == 0, " found %lld\n",
118 (long long)(int)offsetof(struct release_struct, hContext));
119 LASSERTF((int)sizeof(((struct release_struct *)0)->hContext) == 4, " found %lld\n",
120 (long long)(int)sizeof(((struct release_struct *)0)->hContext));
121 LASSERTF((int)offsetof(struct release_struct, rv) == 4, " found %lld\n",
122 (long long)(int)offsetof(struct release_struct, rv));
123 LASSERTF((int)sizeof(((struct release_struct *)0)->rv) == 4, " found %lld\n",
124 (long long)(int)sizeof(((struct release_struct *)0)->rv));
125
126 /* Checks for struct connect_struct */
127 LASSERTF((int)sizeof(struct connect_struct) == 152, " found %lld\n",
128 (long long)(int)sizeof(struct connect_struct));
129 LASSERTF((int)offsetof(struct connect_struct, hContext) == 0, " found %lld\n",
130 (long long)(int)offsetof(struct connect_struct, hContext));
131 LASSERTF((int)sizeof(((struct connect_struct *)0)->hContext) == 4, " found %lld\n",
132 (long long)(int)sizeof(((struct connect_struct *)0)->hContext));
133 LASSERTF((int)offsetof(struct connect_struct, szReader) == 4, " found %lld\n",
134 (long long)(int)offsetof(struct connect_struct, szReader));
135 LASSERTF((int)sizeof(((struct connect_struct *)0)->szReader) == 128, " found %lld\n",
136 (long long)(int)sizeof(((struct connect_struct *)0)->szReader));
137 LASSERTF((int)offsetof(struct connect_struct, dwShareMode) == 132, " found %lld\n",
138 (long long)(int)offsetof(struct connect_struct, dwShareMode));
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",
146 (long long)(int)offsetof(struct connect_struct, hCard));
147 LASSERTF((int)sizeof(((struct connect_struct *)0)->hCard) == 4, " found %lld\n",
148 (long long)(int)sizeof(((struct connect_struct *)0)->hCard));
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",
154 (long long)(int)offsetof(struct connect_struct, rv));
155 LASSERTF((int)sizeof(((struct connect_struct *)0)->rv) == 4, " found %lld\n",
156 (long long)(int)sizeof(((struct connect_struct *)0)->rv));
157
158 /* Checks for struct reconnect_struct */
159 LASSERTF((int)sizeof(struct reconnect_struct) == 24, " found %lld\n",
160 (long long)(int)sizeof(struct reconnect_struct));
161 LASSERTF((int)offsetof(struct reconnect_struct, hCard) == 0, " found %lld\n",
162 (long long)(int)offsetof(struct reconnect_struct, hCard));
163 LASSERTF((int)sizeof(((struct reconnect_struct *)0)->hCard) == 4, " found %lld\n",
164 (long long)(int)sizeof(((struct reconnect_struct *)0)->hCard));
165 LASSERTF((int)offsetof(struct reconnect_struct, dwShareMode) == 4, " found %lld\n",
166 (long long)(int)offsetof(struct reconnect_struct, dwShareMode));
167 LASSERTF((int)sizeof(((struct reconnect_struct *)0)->dwShareMode) == 4, " found %lld\n",
168 (long long)(int)sizeof(((struct reconnect_struct *)0)->dwShareMode));
169 LASSERTF((int)offsetof(struct reconnect_struct, dwPreferredProtocols) == 8, " found %lld\n",
170 (long long)(int)offsetof(struct reconnect_struct, dwPreferredProtocols));
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",
174 (long long)(int)offsetof(struct reconnect_struct, dwInitialization));
175 LASSERTF((int)sizeof(((struct reconnect_struct *)0)->dwInitialization) == 4, " found %lld\n",
176 (long long)(int)sizeof(((struct reconnect_struct *)0)->dwInitialization));
177 LASSERTF((int)offsetof(struct reconnect_struct, dwActiveProtocol) == 16, " found %lld\n",
178 (long long)(int)offsetof(struct reconnect_struct, dwActiveProtocol));
179 LASSERTF((int)sizeof(((struct reconnect_struct *)0)->dwActiveProtocol) == 4, " found %lld\n",
180 (long long)(int)sizeof(((struct reconnect_struct *)0)->dwActiveProtocol));
181 LASSERTF((int)offsetof(struct reconnect_struct, rv) == 20, " found %lld\n",
182 (long long)(int)offsetof(struct reconnect_struct, rv));
183 LASSERTF((int)sizeof(((struct reconnect_struct *)0)->rv) == 4, " found %lld\n",
184 (long long)(int)sizeof(((struct reconnect_struct *)0)->rv));
185
186 /* Checks for struct disconnect_struct */
187 LASSERTF((int)sizeof(struct disconnect_struct) == 12, " found %lld\n",
188 (long long)(int)sizeof(struct disconnect_struct));
189 LASSERTF((int)offsetof(struct disconnect_struct, hCard) == 0, " found %lld\n",
190 (long long)(int)offsetof(struct disconnect_struct, hCard));
191 LASSERTF((int)sizeof(((struct disconnect_struct *)0)->hCard) == 4, " found %lld\n",
192 (long long)(int)sizeof(((struct disconnect_struct *)0)->hCard));
193 LASSERTF((int)offsetof(struct disconnect_struct, dwDisposition) == 4, " found %lld\n",
194 (long long)(int)offsetof(struct disconnect_struct, dwDisposition));
195 LASSERTF((int)sizeof(((struct disconnect_struct *)0)->dwDisposition) == 4, " found %lld\n",
196 (long long)(int)sizeof(((struct disconnect_struct *)0)->dwDisposition));
197 LASSERTF((int)offsetof(struct disconnect_struct, rv) == 8, " found %lld\n",
198 (long long)(int)offsetof(struct disconnect_struct, rv));
199 LASSERTF((int)sizeof(((struct disconnect_struct *)0)->rv) == 4, " found %lld\n",
200 (long long)(int)sizeof(((struct disconnect_struct *)0)->rv));
201
202 /* Checks for struct begin_struct */
203 LASSERTF((int)sizeof(struct begin_struct) == 8, " found %lld\n",
204 (long long)(int)sizeof(struct begin_struct));
205 LASSERTF((int)offsetof(struct begin_struct, hCard) == 0, " found %lld\n",
206 (long long)(int)offsetof(struct begin_struct, hCard));
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",
210 (long long)(int)offsetof(struct begin_struct, rv));
211 LASSERTF((int)sizeof(((struct begin_struct *)0)->rv) == 4, " found %lld\n",
212 (long long)(int)sizeof(((struct begin_struct *)0)->rv));
213
214 /* Checks for struct end_struct */
215 LASSERTF((int)sizeof(struct end_struct) == 12, " found %lld\n",
216 (long long)(int)sizeof(struct end_struct));
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));
229
230 /* Checks for struct cancel_struct */
231 LASSERTF((int)sizeof(struct cancel_struct) == 8, " found %lld\n",
232 (long long)(int)sizeof(struct cancel_struct));
233 LASSERTF((int)offsetof(struct cancel_struct, hContext) == 0, " found %lld\n",
234 (long long)(int)offsetof(struct cancel_struct, hContext));
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",
238 (long long)(int)offsetof(struct cancel_struct, rv));
239 LASSERTF((int)sizeof(((struct cancel_struct *)0)->rv) == 4, " found %lld\n",
240 (long long)(int)sizeof(((struct cancel_struct *)0)->rv));
241
242 /* Checks for struct status_struct */
243 LASSERTF((int)sizeof(struct status_struct) == 8, " found %lld\n",
244 (long long)(int)sizeof(struct status_struct));
245 LASSERTF((int)offsetof(struct status_struct, hCard) == 0, " found %lld\n",
246 (long long)(int)offsetof(struct status_struct, hCard));
247 LASSERTF((int)sizeof(((struct status_struct *)0)->hCard) == 4, " found %lld\n",
248 (long long)(int)sizeof(((struct status_struct *)0)->hCard));
249 LASSERTF((int)offsetof(struct status_struct, rv) == 4, " found %lld\n",
250 (long long)(int)offsetof(struct status_struct, rv));
251 LASSERTF((int)sizeof(((struct status_struct *)0)->rv) == 4, " found %lld\n",
252 (long long)(int)sizeof(((struct status_struct *)0)->rv));
253
254 /* Checks for struct transmit_struct */
255 LASSERTF((int)sizeof(struct transmit_struct) == 32, " found %lld\n",
256 (long long)(int)sizeof(struct transmit_struct));
257 LASSERTF((int)offsetof(struct transmit_struct, hCard) == 0, " found %lld\n",
258 (long long)(int)offsetof(struct transmit_struct, hCard));
259 LASSERTF((int)sizeof(((struct transmit_struct *)0)->hCard) == 4, " found %lld\n",
260 (long long)(int)sizeof(((struct transmit_struct *)0)->hCard));
261 LASSERTF((int)offsetof(struct transmit_struct, ioSendPciProtocol) == 4, " found %lld\n",
262 (long long)(int)offsetof(struct transmit_struct, ioSendPciProtocol));
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",
266 (long long)(int)offsetof(struct transmit_struct, ioSendPciLength));
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",
270 (long long)(int)offsetof(struct transmit_struct, cbSendLength));
271 LASSERTF((int)sizeof(((struct transmit_struct *)0)->cbSendLength) == 4, " found %lld\n",
272 (long long)(int)sizeof(((struct transmit_struct *)0)->cbSendLength));
273 LASSERTF((int)offsetof(struct transmit_struct, ioRecvPciProtocol) == 16, " found %lld\n",
274 (long long)(int)offsetof(struct transmit_struct, ioRecvPciProtocol));
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",
278 (long long)(int)offsetof(struct transmit_struct, ioRecvPciLength));
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",
282 (long long)(int)offsetof(struct transmit_struct, pcbRecvLength));
283 LASSERTF((int)sizeof(((struct transmit_struct *)0)->pcbRecvLength) == 4, " found %lld\n",
284 (long long)(int)sizeof(((struct transmit_struct *)0)->pcbRecvLength));
285 LASSERTF((int)offsetof(struct transmit_struct, rv) == 28, " found %lld\n",
286 (long long)(int)offsetof(struct transmit_struct, rv));
287 LASSERTF((int)sizeof(((struct transmit_struct *)0)->rv) == 4, " found %lld\n",
288 (long long)(int)sizeof(((struct transmit_struct *)0)->rv));
289
290 /* Checks for struct control_struct */
291 LASSERTF((int)sizeof(struct control_struct) == 24, " found %lld\n",
292 (long long)(int)sizeof(struct control_struct));
293 LASSERTF((int)offsetof(struct control_struct, hCard) == 0, " found %lld\n",
294 (long long)(int)offsetof(struct control_struct, hCard));
295 LASSERTF((int)sizeof(((struct control_struct *)0)->hCard) == 4, " found %lld\n",
296 (long long)(int)sizeof(((struct control_struct *)0)->hCard));
297 LASSERTF((int)offsetof(struct control_struct, dwControlCode) == 4, " found %lld\n",
298 (long long)(int)offsetof(struct control_struct, dwControlCode));
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",
302 (long long)(int)offsetof(struct control_struct, cbSendLength));
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",
306 (long long)(int)offsetof(struct control_struct, cbRecvLength));
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",
314 (long long)(int)offsetof(struct control_struct, rv));
315 LASSERTF((int)sizeof(((struct control_struct *)0)->rv) == 4, " found %lld\n",
316 (long long)(int)sizeof(((struct control_struct *)0)->rv));
317
318 /* Checks for struct getset_struct */
319 LASSERTF((int)sizeof(struct getset_struct) == 280, " found %lld\n",
320 (long long)(int)sizeof(struct getset_struct));
321 LASSERTF((int)offsetof(struct getset_struct, hCard) == 0, " found %lld\n",
322 (long long)(int)offsetof(struct getset_struct, hCard));
323 LASSERTF((int)sizeof(((struct getset_struct *)0)->hCard) == 4, " found %lld\n",
324 (long long)(int)sizeof(((struct getset_struct *)0)->hCard));
325 LASSERTF((int)offsetof(struct getset_struct, dwAttrId) == 4, " found %lld\n",
326 (long long)(int)offsetof(struct getset_struct, dwAttrId));
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",
330 (long long)(int)offsetof(struct getset_struct, cbAttrLen));
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",
334 (long long)(int)offsetof(struct getset_struct, rv));
335 LASSERTF((int)sizeof(((struct getset_struct *)0)->rv) == 4, " found %lld\n",
336 (long long)(int)sizeof(((struct getset_struct *)0)->rv));
337
338 /* Checks for struct pubReaderStatesList */
339 LASSERTF((int)sizeof(struct pubReaderStatesList) == 184, " found %lld\n",
340 (long long)(int)sizeof(struct pubReaderStatesList));
341 LASSERTF((int)offsetof(struct pubReaderStatesList, readerName) == 0, " found %lld\n",
342 (long long)(int)offsetof(struct pubReaderStatesList, readerName));
343 LASSERTF((int)sizeof(((struct pubReaderStatesList *)0)->readerName) == 128, " found %lld\n",
344 (long long)(int)sizeof(((struct pubReaderStatesList *)0)->readerName));
345 LASSERTF((int)offsetof(struct pubReaderStatesList, readerState) == 132, " found %lld\n",
346 (long long)(int)offsetof(struct pubReaderStatesList, readerState));
347 LASSERTF((int)sizeof(((struct pubReaderStatesList *)0)->readerState) == 4, " found %lld\n",
348 (long long)(int)sizeof(((struct pubReaderStatesList *)0)->readerState));
349 LASSERTF((int)offsetof(struct pubReaderStatesList, readerSharing) == 136, " found %lld\n",
350 (long long)(int)offsetof(struct pubReaderStatesList, readerSharing));
351 LASSERTF((int)sizeof(((struct pubReaderStatesList *)0)->readerSharing) == 4, " found %lld\n",
352 (long long)(int)sizeof(((struct pubReaderStatesList *)0)->readerSharing));
353 LASSERTF((int)offsetof(struct pubReaderStatesList, cardAtr) == 140, " found %lld\n",
354 (long long)(int)offsetof(struct pubReaderStatesList, cardAtr));
355 LASSERTF((int)sizeof(((struct pubReaderStatesList *)0)->cardAtr) == 33, " found %lld\n",
356 (long long)(int)sizeof(((struct pubReaderStatesList *)0)->cardAtr));
357 LASSERTF((int)offsetof(struct pubReaderStatesList, cardAtrLength) == 176, " found %lld\n",
358 (long long)(int)offsetof(struct pubReaderStatesList, cardAtrLength));
359 LASSERTF((int)sizeof(((struct pubReaderStatesList *)0)->cardAtrLength) == 4, " found %lld\n",
360 (long long)(int)sizeof(((struct pubReaderStatesList *)0)->cardAtrLength));
361 LASSERTF((int)offsetof(struct pubReaderStatesList, cardProtocol) == 180, " found %lld\n",
362 (long long)(int)offsetof(struct pubReaderStatesList, cardProtocol));
363 LASSERTF((int)sizeof(((struct pubReaderStatesList *)0)->cardProtocol) == 4, " found %lld\n",
364 (long long)(int)sizeof(((struct pubReaderStatesList *)0)->cardProtocol));
365
366return 0;
367}
This handles card insertion/removal events, updates ATR, protocol, and status information.
#define MAX_ATR_SIZE
Maximum ATR size.
Definition pcsclite.h:59
#define MAX_BUFFER_SIZE
Maximum Tx/Rx Buffer for short APDU.
Definition pcsclite.h:298
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()