1 /*
2 * Copyright (c) 2005, Oracle and/or its affiliates. All rights reserved.
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4 *
5 * This code is free software; you can redistribute it and/or modify it
6 * under the terms of the GNU General Public License version 2 only, as
7 * published by the Free Software Foundation. Oracle designates this
8 * particular file as subject to the "Classpath" exception as provided
9 * by Oracle in the LICENSE file that accompanied this code.
10 *
11 * This code is distributed in the hope that it will be useful, but WITHOUT
12 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
13 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
14 * version 2 for more details (a copy is included in the LICENSE file that
15 * accompanied this code).
16 *
17 * You should have received a copy of the GNU General Public License version
18 * 2 along with this work; if not, write to the Free Software Foundation,
19 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
20 *
21 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
22 * or visit www.oracle.com if you need additional information or have any
23 * questions.
24 */
25
26 typedef LONG (*FPTR_SCardEstablishContext)(ULONG dwScope,
27 const void *pvReserved1,
28 const void *pvReserved2,
29 LONG *phContext);
30
31 typedef LONG (*FPTR_SCardConnect)(LONG hContext,
32 const char *szReader,
33 ULONG dwShareMode,
34 ULONG dwPreferredProtocols,
35 LONG *phCard, ULONG *pdwActiveProtocol);
36
37 typedef LONG (*FPTR_SCardDisconnect)(LONG hCard, ULONG dwDisposition);
38
39 typedef LONG (*FPTR_SCardStatus)(LONG hCard,
40 char *mszReaderNames,
41 ULONG *pcchReaderLen,
42 ULONG *pdwState,
43 ULONG *pdwProtocol,
44 unsigned char *pbAtr, ULONG *pcbAtrLen);
45
46 typedef LONG (*FPTR_SCardGetStatusChange)(LONG hContext,
47 ULONG dwTimeout,
48 LPSCARD_READERSTATE_A rgReaderStates, ULONG cReaders);
49
50 typedef LONG (*FPTR_SCardTransmit)(LONG hCard,
51 LPCSCARD_IO_REQUEST pioSendPci,
52 const unsigned char *pbSendBuffer,
53 ULONG cbSendLength,
54 LPSCARD_IO_REQUEST pioRecvPci,
55 unsigned char *pbRecvBuffer, ULONG *pcbRecvLength);
56
57 typedef LONG (*FPTR_SCardListReaders)(LONG hContext,
58 const char *mszGroups,
59 char *mszReaders, ULONG *pcchReaders);
60
61 typedef LONG (*FPTR_SCardBeginTransaction)(LONG hCard);
62
63 typedef LONG (*FPTR_SCardEndTransaction)(LONG hCard, ULONG dwDisposition);
64
65 typedef LONG (*FPTR_SCardControl)(LONG hCard, ULONG dwControlCode,
66 const void* pbSendBuffer, ULONG cbSendLength, const void* pbRecvBuffer,
67 ULONG pcbRecvLength, ULONG *lpBytesReturned);
68
69 #define CALL_SCardEstablishContext(dwScope, pvReserved1, pvReserved2, phContext) \
70 ((scardEstablishContext)(dwScope, pvReserved1, pvReserved2, phContext))
71
72 #define CALL_SCardConnect(hContext, szReader, dwSharedMode, dwPreferredProtocols, phCard, pdwActiveProtocols) \
73 ((scardConnect)(hContext, szReader, dwSharedMode, dwPreferredProtocols, phCard, pdwActiveProtocols))
74
75 #define CALL_SCardDisconnect(hCard, dwDisposition) \
76 ((scardDisconnect)(hCard, dwDisposition))
77
78 #define CALL_SCardStatus(hCard, mszReaderNames, pcchReaderLen, pdwState, pdwProtocol, pbAtr, pcbAtrLen) \
79 ((scardStatus)(hCard, mszReaderNames, pcchReaderLen, pdwState, pdwProtocol, pbAtr, pcbAtrLen))
80
81 #define CALL_SCardGetStatusChange(hContext, dwTimeout, rgReaderStates, cReaders) \
82 ((scardGetStatusChange)(hContext, dwTimeout, rgReaderStates, cReaders))
83
84 #define CALL_SCardTransmit(hCard, pioSendPci, pbSendBuffer, cbSendLength, \
85 pioRecvPci, pbRecvBuffer, pcbRecvLength) \
86 ((scardTransmit)(hCard, pioSendPci, pbSendBuffer, cbSendLength, \
87 pioRecvPci, pbRecvBuffer, pcbRecvLength))
|
1 /*
2 * Copyright (c) 2005, 2019, Oracle and/or its affiliates. All rights reserved.
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4 *
5 * This code is free software; you can redistribute it and/or modify it
6 * under the terms of the GNU General Public License version 2 only, as
7 * published by the Free Software Foundation. Oracle designates this
8 * particular file as subject to the "Classpath" exception as provided
9 * by Oracle in the LICENSE file that accompanied this code.
10 *
11 * This code is distributed in the hope that it will be useful, but WITHOUT
12 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
13 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
14 * version 2 for more details (a copy is included in the LICENSE file that
15 * accompanied this code).
16 *
17 * You should have received a copy of the GNU General Public License version
18 * 2 along with this work; if not, write to the Free Software Foundation,
19 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
20 *
21 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
22 * or visit www.oracle.com if you need additional information or have any
23 * questions.
24 */
25
26 typedef LONG (*FPTR_SCardEstablishContext)(DWORD dwScope,
27 LPCVOID pvReserved1,
28 LPCVOID pvReserved2,
29 LPSCARDCONTEXT phContext);
30
31 typedef LONG (*FPTR_SCardConnect)(SCARDCONTEXT hContext,
32 LPCSTR szReader,
33 DWORD dwShareMode,
34 DWORD dwPreferredProtocols,
35 LPSCARDHANDLE phCard, LPDWORD pdwActiveProtocol);
36
37 typedef LONG (*FPTR_SCardDisconnect)(SCARDHANDLE hCard, DWORD dwDisposition);
38
39 typedef LONG (*FPTR_SCardStatus)(SCARDHANDLE hCard,
40 LPSTR mszReaderNames,
41 LPDWORD pcchReaderLen,
42 LPDWORD pdwState,
43 LPDWORD pdwProtocol,
44 LPBYTE pbAtr, LPDWORD pcbAtrLen);
45
46 typedef LONG (*FPTR_SCardGetStatusChange)(SCARDCONTEXT hContext,
47 DWORD dwTimeout,
48 SCARD_READERSTATE *rgReaderStates, DWORD cReaders);
49
50 typedef LONG (*FPTR_SCardTransmit)(SCARDHANDLE hCard,
51 const SCARD_IO_REQUEST *pioSendPci,
52 LPCBYTE pbSendBuffer,
53 DWORD cbSendLength,
54 SCARD_IO_REQUEST *pioRecvPci,
55 LPBYTE pbRecvBuffer, LPDWORD pcbRecvLength);
56
57 typedef LONG (*FPTR_SCardListReaders)(SCARDCONTEXT hContext,
58 LPCSTR mszGroups,
59 LPSTR mszReaders, LPDWORD pcchReaders);
60
61 typedef LONG (*FPTR_SCardBeginTransaction)(SCARDHANDLE hCard);
62
63 typedef LONG (*FPTR_SCardEndTransaction)(SCARDHANDLE hCard,
64 DWORD dwDisposition);
65
66 typedef LONG (*FPTR_SCardControl)(SCARDHANDLE hCard, DWORD dwControlCode,
67 LPCVOID pbSendBuffer, DWORD cbSendLength, LPVOID pbRecvBuffer,
68 DWORD pcbRecvLength, LPDWORD lpBytesReturned);
69
70 #define CALL_SCardEstablishContext(dwScope, pvReserved1, pvReserved2, phContext) \
71 ((scardEstablishContext)(dwScope, pvReserved1, pvReserved2, phContext))
72
73 #define CALL_SCardConnect(hContext, szReader, dwSharedMode, dwPreferredProtocols, phCard, pdwActiveProtocols) \
74 ((scardConnect)(hContext, szReader, dwSharedMode, dwPreferredProtocols, phCard, pdwActiveProtocols))
75
76 #define CALL_SCardDisconnect(hCard, dwDisposition) \
77 ((scardDisconnect)(hCard, dwDisposition))
78
79 #define CALL_SCardStatus(hCard, mszReaderNames, pcchReaderLen, pdwState, pdwProtocol, pbAtr, pcbAtrLen) \
80 ((scardStatus)(hCard, mszReaderNames, pcchReaderLen, pdwState, pdwProtocol, pbAtr, pcbAtrLen))
81
82 #define CALL_SCardGetStatusChange(hContext, dwTimeout, rgReaderStates, cReaders) \
83 ((scardGetStatusChange)(hContext, dwTimeout, rgReaderStates, cReaders))
84
85 #define CALL_SCardTransmit(hCard, pioSendPci, pbSendBuffer, cbSendLength, \
86 pioRecvPci, pbRecvBuffer, pcbRecvLength) \
87 ((scardTransmit)(hCard, pioSendPci, pbSendBuffer, cbSendLength, \
88 pioRecvPci, pbRecvBuffer, pcbRecvLength))
|