pcsc-lite
2.3.0
src
libfake.c
Go to the documentation of this file.
1
/*
2
* MUSCLE SmartCard Development ( https://pcsclite.apdu.fr/ )
3
*
4
* Copyright (C) 2024
5
* Ludovic Rousseau <ludovic.rousseau@free.fr>
6
*
7
Redistribution and use in source and binary forms, with or without
8
modification, are permitted provided that the following conditions
9
are met:
10
11
1. Redistributions of source code must retain the above copyright
12
notice, this list of conditions and the following disclaimer.
13
2. Redistributions in binary form must reproduce the above copyright
14
notice, this list of conditions and the following disclaimer in the
15
documentation and/or other materials provided with the distribution.
16
3. The name of the author may not be used to endorse or promote products
17
derived from this software without specific prior written permission.
18
19
THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
20
IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
21
OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
22
IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
23
INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
24
NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
25
DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
26
THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
27
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
28
THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
29
*/
30
36
/* define PCSC_API used in winscard.h */
37
#include "misc.h"
38
#include "
winscard.h
"
39
40
LONG SCardEstablishContext(DWORD dwScope,
41
LPCVOID pvReserved1, LPCVOID pvReserved2,
42
LPSCARDCONTEXT phContext)
43
{
44
(void)dwScope;
45
(void)pvReserved1;
46
(void)pvReserved2;
47
(void)phContext;
48
49
return
SCARD_F_INTERNAL_ERROR
;
50
}
51
52
LONG SCardReleaseContext(
SCARDCONTEXT
hContext)
53
{
54
(void)hContext;
55
56
return
SCARD_F_INTERNAL_ERROR
;
57
}
58
59
LONG SCardIsValidContext(
SCARDCONTEXT
hContext)
60
{
61
(void)hContext;
62
63
return
SCARD_F_INTERNAL_ERROR
;
64
}
65
66
LONG SCardConnect(
SCARDCONTEXT
hContext,
67
LPCSTR szReader,
68
DWORD dwShareMode,
69
DWORD dwPreferredProtocols,
70
LPSCARDHANDLE phCard, LPDWORD pdwActiveProtocol)
71
{
72
(void)hContext;
73
(void)szReader;
74
(void)dwShareMode;
75
(void)dwPreferredProtocols;
76
(void)phCard;
77
(void)pdwActiveProtocol;
78
79
return
SCARD_F_INTERNAL_ERROR
;
80
}
81
82
LONG SCardReconnect(
SCARDHANDLE
hCard,
83
DWORD dwShareMode,
84
DWORD dwPreferredProtocols,
85
DWORD dwInitialization, LPDWORD pdwActiveProtocol)
86
{
87
(void)hCard;
88
(void)dwShareMode;
89
(void)dwPreferredProtocols;
90
(void)dwInitialization;
91
(void)pdwActiveProtocol;
92
93
return
SCARD_F_INTERNAL_ERROR
;
94
}
95
96
LONG SCardDisconnect(
SCARDHANDLE
hCard, DWORD dwDisposition)
97
{
98
(void)hCard;
99
(void)dwDisposition;
100
101
return
SCARD_F_INTERNAL_ERROR
;
102
}
103
104
LONG SCardBeginTransaction(
SCARDHANDLE
hCard)
105
{
106
(void)hCard;
107
108
return
SCARD_F_INTERNAL_ERROR
;
109
}
110
111
LONG SCardEndTransaction(
SCARDHANDLE
hCard, DWORD dwDisposition)
112
{
113
(void)hCard;
114
(void)dwDisposition;
115
116
return
SCARD_F_INTERNAL_ERROR
;
117
}
118
119
LONG SCardStatus(
SCARDHANDLE
hCard,
120
LPSTR mszReaderName,
121
LPDWORD pcchReaderLen,
122
LPDWORD pdwState,
123
LPDWORD pdwProtocol,
124
LPBYTE pbAtr,
125
LPDWORD pcbAtrLen)
126
{
127
(void)hCard;
128
(void)mszReaderName;
129
(void)pcchReaderLen;
130
(void)pdwState;
131
(void)pdwProtocol;
132
(void)pbAtr;
133
(void)pcbAtrLen;
134
135
return
SCARD_F_INTERNAL_ERROR
;
136
}
137
138
LONG SCardGetStatusChange(
SCARDCONTEXT
hContext,
139
DWORD dwTimeout,
140
SCARD_READERSTATE
*rgReaderStates, DWORD cReaders)
141
{
142
(void)hContext;
143
(void)dwTimeout;
144
(void)rgReaderStates;
145
(void)cReaders;
146
147
return
SCARD_F_INTERNAL_ERROR
;
148
}
149
150
LONG SCardControl(
SCARDHANDLE
hCard, DWORD dwControlCode,
151
LPCVOID pbSendBuffer, DWORD cbSendLength,
152
LPVOID pbRecvBuffer, DWORD cbRecvLength,
153
LPDWORD lpBytesReturned)
154
{
155
(void)hCard;
156
(void)dwControlCode;
157
(void)pbSendBuffer;
158
(void)cbSendLength;
159
(void)pbRecvBuffer;
160
(void)cbRecvLength;
161
(void)lpBytesReturned;
162
163
return
SCARD_F_INTERNAL_ERROR
;
164
}
165
166
LONG SCardTransmit(
SCARDHANDLE
hCard,
167
const
SCARD_IO_REQUEST
*pioSendPci,
168
LPCBYTE pbSendBuffer, DWORD cbSendLength,
169
SCARD_IO_REQUEST
*pioRecvPci,
170
LPBYTE pbRecvBuffer, LPDWORD pcbRecvLength)
171
{
172
(void)hCard;
173
(void)pioSendPci;
174
(void)pbSendBuffer;
175
(void)cbSendLength;
176
(void)pioRecvPci;
177
(void)pbRecvBuffer;
178
(void)pcbRecvLength;
179
180
return
SCARD_F_INTERNAL_ERROR
;
181
}
182
183
LONG SCardListReaderGroups(
SCARDCONTEXT
hContext,
184
LPSTR mszGroups, LPDWORD pcchGroups)
185
{
186
(void)hContext;
187
(void)mszGroups;
188
(void)pcchGroups;
189
190
return
SCARD_F_INTERNAL_ERROR
;
191
}
192
193
LONG SCardListReaders(
SCARDCONTEXT
hContext,
194
LPCSTR mszGroups,
195
LPSTR mszReaders,
196
LPDWORD pcchReaders)
197
{
198
(void)hContext;
199
(void)mszGroups;
200
(void)mszReaders;
201
(void)pcchReaders;
202
203
return
SCARD_F_INTERNAL_ERROR
;
204
}
205
206
LONG SCardFreeMemory(
SCARDCONTEXT
hContext, LPCVOID pvMem)
207
{
208
(void)hContext;
209
(void)pvMem;
210
211
return
SCARD_F_INTERNAL_ERROR
;
212
}
213
214
LONG SCardCancel(
SCARDCONTEXT
hContext)
215
{
216
(void)hContext;
217
218
return
SCARD_F_INTERNAL_ERROR
;
219
}
220
221
LONG SCardGetAttrib(
SCARDHANDLE
hCard, DWORD dwAttrId,
222
LPBYTE pbAttr, LPDWORD pcbAttrLen)
223
{
224
(void)hCard;
225
(void)dwAttrId;
226
(void)pbAttr;
227
(void)pcbAttrLen;
228
229
return
SCARD_F_INTERNAL_ERROR
;
230
}
231
232
LONG SCardSetAttrib(
SCARDHANDLE
hCard, DWORD dwAttrId,
233
LPCBYTE pbAttr, DWORD cbAttrLen)
234
{
235
(void)hCard;
236
(void)dwAttrId;
237
(void)pbAttr;
238
(void)cbAttrLen;
239
240
return
SCARD_F_INTERNAL_ERROR
;
241
}
SCARD_F_INTERNAL_ERROR
#define SCARD_F_INTERNAL_ERROR
An internal consistency check failed.
Definition
pcsclite.h:109
SCARDCONTEXT
LONG SCARDCONTEXT
hContext returned by SCardEstablishContext()
Definition
pcsclite.h:52
SCARDHANDLE
LONG SCARDHANDLE
hCard returned by SCardConnect()
Definition
pcsclite.h:55
SCARD_IO_REQUEST
Protocol Control Information (PCI)
Definition
pcsclite.h:80
SCARD_READERSTATE
Definition
pcsclite.h:68
winscard.h
This handles smart card reader communications.
Generated on Sun Aug 4 2024 13:41:53 for pcsc-lite by
1.11.0