pcsc-lite  1.8.7
winscard_msg.h
Go to the documentation of this file.
1 /*
2  * MUSCLE SmartCard Development ( http://www.linuxnet.com )
3  *
4  * Copyright (C) 2001-2004
5  * David Corcoran <corcoran@linuxnet.com>
6  * Copyright (C) 2003-2004
7  * Damien Sauveron <damien.sauveron@labri.fr>
8  * Copyright (C) 2002-2010
9  * Ludovic Rousseau <ludovic.rousseau@free.fr>
10  *
11  * $Id: winscard_msg.h 5929 2011-09-03 21:43:21Z rousseau $
12  */
13 
20 #ifndef __winscard_msg_h__
21 #define __winscard_msg_h__
22 
23 #include <stdint.h>
24 
26 #define PROTOCOL_VERSION_MAJOR 4
27 
28 #define PROTOCOL_VERSION_MINOR 2
29 
34  {
35  int32_t major;
36  int32_t minor;
37  uint32_t rv;
38  };
39 
43  struct rxHeader
44  {
45  uint32_t size;
46  uint32_t command;
47  };
48 
53  {
54  CMD_ENUM_FIRST,
58  SCARD_CONNECT = 0x04,
59  SCARD_RECONNECT = 0x05,
63  SCARD_TRANSMIT = 0x09,
64  SCARD_CONTROL = 0x0A,
65  SCARD_STATUS = 0x0B,
67  SCARD_CANCEL = 0x0D,
71  CMD_VERSION = 0x11,
75  CMD_ENUM_LAST
76  };
77 
79  {
80  uint32_t hContext;
81  };
82 
87  {
88  uint32_t timeOut;
89  uint32_t rv;
90  };
91 
98  {
99  uint32_t dwScope;
100  uint32_t hContext;
101  uint32_t rv;
102  };
103 
110  {
111  uint32_t hContext;
112  uint32_t rv;
113  };
114 
121  {
122  uint32_t hContext;
123  char szReader[MAX_READERNAME];
124  uint32_t dwShareMode;
125  uint32_t dwPreferredProtocols;
126  int32_t hCard;
127  uint32_t dwActiveProtocol;
128  uint32_t rv;
129  };
130 
137  {
138  int32_t hCard;
139  uint32_t dwShareMode;
140  uint32_t dwPreferredProtocols;
141  uint32_t dwInitialization;
142  uint32_t dwActiveProtocol;
143  uint32_t rv;
144  };
145 
152  {
153  int32_t hCard;
154  uint32_t dwDisposition;
155  uint32_t rv;
156  };
157 
164  {
165  int32_t hCard;
166  uint32_t rv;
167  };
168 
174  struct end_struct
175  {
176  int32_t hCard;
177  uint32_t dwDisposition;
178  uint32_t rv;
179  };
180 
187  {
188  int32_t hContext;
189  uint32_t rv;
190  };
191 
198  {
199  int32_t hCard;
200  uint32_t rv;
201  };
202 
209  {
210  int32_t hCard;
211  uint32_t ioSendPciProtocol;
212  uint32_t ioSendPciLength;
213  uint32_t cbSendLength;
214  uint32_t ioRecvPciProtocol;
215  uint32_t ioRecvPciLength;
216  uint32_t pcbRecvLength;
217  uint32_t rv;
218  };
219 
226  {
227  int32_t hCard;
228  uint32_t dwControlCode;
229  uint32_t cbSendLength;
230  uint32_t cbRecvLength;
231  uint32_t dwBytesReturned;
232  uint32_t rv;
233  };
234 
241  {
242  int32_t hCard;
243  uint32_t dwAttrId;
244  uint8_t pbAttr[MAX_BUFFER_SIZE];
245  uint32_t cbAttrLen;
246  uint32_t rv;
247  };
248 
249  /*
250  * Now some function definitions
251  */
252 
253 #ifdef PCSCD
254  int32_t InitializeSocket(void);
255  int32_t ListenExistingSocket(int fd);
256  int32_t ProcessEventsServer(/*@out@*/ uint32_t *);
257 #else
258  char *getSocketName(void);
259  int32_t ClientSetupSession(uint32_t *);
260  int32_t ClientCloseSession(uint32_t);
261  LONG MessageReceiveTimeout(uint32_t command, /*@out@*/ void *buffer,
262  uint64_t buffer_size, int32_t filedes, long timeOut);
263  LONG MessageSendWithHeader(uint32_t command, uint32_t dwClientID,
264  uint64_t size, void *data);
265 #endif
266  LONG MessageSend(void *buffer, uint64_t buffer_size, int32_t filedes);
267  LONG MessageReceive(/*@out@*/ void *buffer, uint64_t buffer_size,
268  int32_t filedes);
269 
270 #endif