jdk/src/solaris/native/sun/security/smartcardio/pcsc_md.h
changeset 2 90ce3da70b43
child 5506 202f599c92aa
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/jdk/src/solaris/native/sun/security/smartcardio/pcsc_md.h	Sat Dec 01 00:00:00 2007 +0000
@@ -0,0 +1,112 @@
+/*
+ * Copyright 2005 Sun Microsystems, Inc.  All Rights Reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.  Sun designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Sun in the LICENSE file that accompanied this code.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
+ * CA 95054 USA or visit www.sun.com if you need additional information or
+ * have any questions.
+ */
+
+typedef LONG (*FPTR_SCardEstablishContext)(ULONG dwScope,
+                const void *pvReserved1,
+                const void *pvReserved2,
+                LONG *phContext);
+
+typedef LONG (*FPTR_SCardConnect)(LONG hContext,
+                const char *szReader,
+                ULONG dwShareMode,
+                ULONG dwPreferredProtocols,
+                LONG *phCard, ULONG *pdwActiveProtocol);
+
+typedef LONG (*FPTR_SCardDisconnect)(LONG hCard, ULONG dwDisposition);
+
+typedef LONG (*FPTR_SCardStatus)(LONG hCard,
+                char *mszReaderNames,
+                ULONG *pcchReaderLen,
+                ULONG *pdwState,
+                ULONG *pdwProtocol,
+                unsigned char *pbAtr, ULONG *pcbAtrLen);
+
+typedef LONG (*FPTR_SCardGetStatusChange)(LONG hContext,
+                ULONG dwTimeout,
+                LPSCARD_READERSTATE_A rgReaderStates, ULONG cReaders);
+
+typedef LONG (*FPTR_SCardTransmit)(LONG hCard,
+                LPCSCARD_IO_REQUEST pioSendPci,
+                const unsigned char *pbSendBuffer,
+                ULONG cbSendLength,
+                LPSCARD_IO_REQUEST pioRecvPci,
+                unsigned char *pbRecvBuffer, ULONG *pcbRecvLength);
+
+typedef LONG (*FPTR_SCardListReaders)(LONG hContext,
+                const char *mszGroups,
+                char *mszReaders, ULONG *pcchReaders);
+
+typedef LONG (*FPTR_SCardBeginTransaction)(LONG hCard);
+
+typedef LONG (*FPTR_SCardEndTransaction)(LONG hCard, ULONG dwDisposition);
+
+typedef LONG (*FPTR_SCardControl)(LONG hCard, ULONG dwControlCode,
+    const void* pbSendBuffer, ULONG cbSendLength, const void* pbRecvBuffer,
+    ULONG pcbRecvLength, ULONG *lpBytesReturned);
+
+#define CALL_SCardEstablishContext(dwScope, pvReserved1, pvReserved2, phContext) \
+    ((scardEstablishContext)(dwScope, pvReserved1, pvReserved2, phContext))
+
+#define CALL_SCardConnect(hContext, szReader, dwSharedMode, dwPreferredProtocols, phCard, pdwActiveProtocols) \
+    ((scardConnect)(hContext, szReader, dwSharedMode, dwPreferredProtocols, phCard, pdwActiveProtocols))
+
+#define CALL_SCardDisconnect(hCard, dwDisposition) \
+    ((scardDisconnect)(hCard, dwDisposition))
+
+#define CALL_SCardStatus(hCard, mszReaderNames, pcchReaderLen, pdwState, pdwProtocol, pbAtr, pcbAtrLen) \
+    ((scardStatus)(hCard, mszReaderNames, pcchReaderLen, pdwState, pdwProtocol, pbAtr, pcbAtrLen))
+
+#define CALL_SCardGetStatusChange(hContext, dwTimeout, rgReaderStates, cReaders) \
+    ((scardGetStatusChange)(hContext, dwTimeout, rgReaderStates, cReaders))
+
+#define CALL_SCardTransmit(hCard, pioSendPci, pbSendBuffer, cbSendLength, \
+                            pioRecvPci, pbRecvBuffer, pcbRecvLength) \
+    ((scardTransmit)(hCard, pioSendPci, pbSendBuffer, cbSendLength, \
+                            pioRecvPci, pbRecvBuffer, pcbRecvLength))
+
+#define CALL_SCardListReaders(hContext, mszGroups, mszReaders, pcchReaders) \
+    ((scardListReaders)(hContext, mszGroups, mszReaders, pcchReaders))
+
+#define CALL_SCardBeginTransaction(hCard) \
+    ((scardBeginTransaction)(hCard))
+
+#define CALL_SCardEndTransaction(hCard, dwDisposition) \
+    ((scardEndTransaction)(hCard, dwDisposition))
+
+#define CALL_SCardControl(hCard, dwControlCode, pbSendBuffer, cbSendLength, \
+            pbRecvBuffer, pcbRecvLength, lpBytesReturned) \
+    ((scardControl)(hCard, dwControlCode, pbSendBuffer, cbSendLength, \
+            pbRecvBuffer, pcbRecvLength, lpBytesReturned))
+
+extern FPTR_SCardEstablishContext scardEstablishContext;
+extern FPTR_SCardConnect scardConnect;
+extern FPTR_SCardDisconnect scardDisconnect;
+extern FPTR_SCardStatus scardStatus;
+extern FPTR_SCardGetStatusChange scardGetStatusChange;
+extern FPTR_SCardTransmit scardTransmit;
+extern FPTR_SCardListReaders scardListReaders;
+extern FPTR_SCardBeginTransaction scardBeginTransaction;
+extern FPTR_SCardEndTransaction scardEndTransaction;
+extern FPTR_SCardControl scardControl;