jdk/src/java.smartcardio/unix/native/libj2pcsc/pcsc_md.h
author vlivanov
Wed, 04 May 2016 21:00:41 +0000
changeset 38189 942dde137b5d
parent 25859 3317bb8137f4
permissions -rw-r--r--
Merge
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
     1
/*
5506
202f599c92aa 6943119: Rebrand source copyright notices
ohair
parents: 2
diff changeset
     2
 * Copyright (c) 2005, Oracle and/or its affiliates. All rights reserved.
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
     3
 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
90ce3da70b43 Initial load
duke
parents:
diff changeset
     4
 *
90ce3da70b43 Initial load
duke
parents:
diff changeset
     5
 * This code is free software; you can redistribute it and/or modify it
90ce3da70b43 Initial load
duke
parents:
diff changeset
     6
 * under the terms of the GNU General Public License version 2 only, as
5506
202f599c92aa 6943119: Rebrand source copyright notices
ohair
parents: 2
diff changeset
     7
 * published by the Free Software Foundation.  Oracle designates this
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
     8
 * particular file as subject to the "Classpath" exception as provided
5506
202f599c92aa 6943119: Rebrand source copyright notices
ohair
parents: 2
diff changeset
     9
 * by Oracle in the LICENSE file that accompanied this code.
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
    10
 *
90ce3da70b43 Initial load
duke
parents:
diff changeset
    11
 * This code is distributed in the hope that it will be useful, but WITHOUT
90ce3da70b43 Initial load
duke
parents:
diff changeset
    12
 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
90ce3da70b43 Initial load
duke
parents:
diff changeset
    13
 * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
90ce3da70b43 Initial load
duke
parents:
diff changeset
    14
 * version 2 for more details (a copy is included in the LICENSE file that
90ce3da70b43 Initial load
duke
parents:
diff changeset
    15
 * accompanied this code).
90ce3da70b43 Initial load
duke
parents:
diff changeset
    16
 *
90ce3da70b43 Initial load
duke
parents:
diff changeset
    17
 * You should have received a copy of the GNU General Public License version
90ce3da70b43 Initial load
duke
parents:
diff changeset
    18
 * 2 along with this work; if not, write to the Free Software Foundation,
90ce3da70b43 Initial load
duke
parents:
diff changeset
    19
 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
90ce3da70b43 Initial load
duke
parents:
diff changeset
    20
 *
5506
202f599c92aa 6943119: Rebrand source copyright notices
ohair
parents: 2
diff changeset
    21
 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
202f599c92aa 6943119: Rebrand source copyright notices
ohair
parents: 2
diff changeset
    22
 * or visit www.oracle.com if you need additional information or have any
202f599c92aa 6943119: Rebrand source copyright notices
ohair
parents: 2
diff changeset
    23
 * questions.
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
    24
 */
90ce3da70b43 Initial load
duke
parents:
diff changeset
    25
90ce3da70b43 Initial load
duke
parents:
diff changeset
    26
typedef LONG (*FPTR_SCardEstablishContext)(ULONG dwScope,
90ce3da70b43 Initial load
duke
parents:
diff changeset
    27
                const void *pvReserved1,
90ce3da70b43 Initial load
duke
parents:
diff changeset
    28
                const void *pvReserved2,
90ce3da70b43 Initial load
duke
parents:
diff changeset
    29
                LONG *phContext);
90ce3da70b43 Initial load
duke
parents:
diff changeset
    30
90ce3da70b43 Initial load
duke
parents:
diff changeset
    31
typedef LONG (*FPTR_SCardConnect)(LONG hContext,
90ce3da70b43 Initial load
duke
parents:
diff changeset
    32
                const char *szReader,
90ce3da70b43 Initial load
duke
parents:
diff changeset
    33
                ULONG dwShareMode,
90ce3da70b43 Initial load
duke
parents:
diff changeset
    34
                ULONG dwPreferredProtocols,
90ce3da70b43 Initial load
duke
parents:
diff changeset
    35
                LONG *phCard, ULONG *pdwActiveProtocol);
90ce3da70b43 Initial load
duke
parents:
diff changeset
    36
90ce3da70b43 Initial load
duke
parents:
diff changeset
    37
typedef LONG (*FPTR_SCardDisconnect)(LONG hCard, ULONG dwDisposition);
90ce3da70b43 Initial load
duke
parents:
diff changeset
    38
90ce3da70b43 Initial load
duke
parents:
diff changeset
    39
typedef LONG (*FPTR_SCardStatus)(LONG hCard,
90ce3da70b43 Initial load
duke
parents:
diff changeset
    40
                char *mszReaderNames,
90ce3da70b43 Initial load
duke
parents:
diff changeset
    41
                ULONG *pcchReaderLen,
90ce3da70b43 Initial load
duke
parents:
diff changeset
    42
                ULONG *pdwState,
90ce3da70b43 Initial load
duke
parents:
diff changeset
    43
                ULONG *pdwProtocol,
90ce3da70b43 Initial load
duke
parents:
diff changeset
    44
                unsigned char *pbAtr, ULONG *pcbAtrLen);
90ce3da70b43 Initial load
duke
parents:
diff changeset
    45
90ce3da70b43 Initial load
duke
parents:
diff changeset
    46
typedef LONG (*FPTR_SCardGetStatusChange)(LONG hContext,
90ce3da70b43 Initial load
duke
parents:
diff changeset
    47
                ULONG dwTimeout,
90ce3da70b43 Initial load
duke
parents:
diff changeset
    48
                LPSCARD_READERSTATE_A rgReaderStates, ULONG cReaders);
90ce3da70b43 Initial load
duke
parents:
diff changeset
    49
90ce3da70b43 Initial load
duke
parents:
diff changeset
    50
typedef LONG (*FPTR_SCardTransmit)(LONG hCard,
90ce3da70b43 Initial load
duke
parents:
diff changeset
    51
                LPCSCARD_IO_REQUEST pioSendPci,
90ce3da70b43 Initial load
duke
parents:
diff changeset
    52
                const unsigned char *pbSendBuffer,
90ce3da70b43 Initial load
duke
parents:
diff changeset
    53
                ULONG cbSendLength,
90ce3da70b43 Initial load
duke
parents:
diff changeset
    54
                LPSCARD_IO_REQUEST pioRecvPci,
90ce3da70b43 Initial load
duke
parents:
diff changeset
    55
                unsigned char *pbRecvBuffer, ULONG *pcbRecvLength);
90ce3da70b43 Initial load
duke
parents:
diff changeset
    56
90ce3da70b43 Initial load
duke
parents:
diff changeset
    57
typedef LONG (*FPTR_SCardListReaders)(LONG hContext,
90ce3da70b43 Initial load
duke
parents:
diff changeset
    58
                const char *mszGroups,
90ce3da70b43 Initial load
duke
parents:
diff changeset
    59
                char *mszReaders, ULONG *pcchReaders);
90ce3da70b43 Initial load
duke
parents:
diff changeset
    60
90ce3da70b43 Initial load
duke
parents:
diff changeset
    61
typedef LONG (*FPTR_SCardBeginTransaction)(LONG hCard);
90ce3da70b43 Initial load
duke
parents:
diff changeset
    62
90ce3da70b43 Initial load
duke
parents:
diff changeset
    63
typedef LONG (*FPTR_SCardEndTransaction)(LONG hCard, ULONG dwDisposition);
90ce3da70b43 Initial load
duke
parents:
diff changeset
    64
90ce3da70b43 Initial load
duke
parents:
diff changeset
    65
typedef LONG (*FPTR_SCardControl)(LONG hCard, ULONG dwControlCode,
90ce3da70b43 Initial load
duke
parents:
diff changeset
    66
    const void* pbSendBuffer, ULONG cbSendLength, const void* pbRecvBuffer,
90ce3da70b43 Initial load
duke
parents:
diff changeset
    67
    ULONG pcbRecvLength, ULONG *lpBytesReturned);
90ce3da70b43 Initial load
duke
parents:
diff changeset
    68
90ce3da70b43 Initial load
duke
parents:
diff changeset
    69
#define CALL_SCardEstablishContext(dwScope, pvReserved1, pvReserved2, phContext) \
90ce3da70b43 Initial load
duke
parents:
diff changeset
    70
    ((scardEstablishContext)(dwScope, pvReserved1, pvReserved2, phContext))
90ce3da70b43 Initial load
duke
parents:
diff changeset
    71
90ce3da70b43 Initial load
duke
parents:
diff changeset
    72
#define CALL_SCardConnect(hContext, szReader, dwSharedMode, dwPreferredProtocols, phCard, pdwActiveProtocols) \
90ce3da70b43 Initial load
duke
parents:
diff changeset
    73
    ((scardConnect)(hContext, szReader, dwSharedMode, dwPreferredProtocols, phCard, pdwActiveProtocols))
90ce3da70b43 Initial load
duke
parents:
diff changeset
    74
90ce3da70b43 Initial load
duke
parents:
diff changeset
    75
#define CALL_SCardDisconnect(hCard, dwDisposition) \
90ce3da70b43 Initial load
duke
parents:
diff changeset
    76
    ((scardDisconnect)(hCard, dwDisposition))
90ce3da70b43 Initial load
duke
parents:
diff changeset
    77
90ce3da70b43 Initial load
duke
parents:
diff changeset
    78
#define CALL_SCardStatus(hCard, mszReaderNames, pcchReaderLen, pdwState, pdwProtocol, pbAtr, pcbAtrLen) \
90ce3da70b43 Initial load
duke
parents:
diff changeset
    79
    ((scardStatus)(hCard, mszReaderNames, pcchReaderLen, pdwState, pdwProtocol, pbAtr, pcbAtrLen))
90ce3da70b43 Initial load
duke
parents:
diff changeset
    80
90ce3da70b43 Initial load
duke
parents:
diff changeset
    81
#define CALL_SCardGetStatusChange(hContext, dwTimeout, rgReaderStates, cReaders) \
90ce3da70b43 Initial load
duke
parents:
diff changeset
    82
    ((scardGetStatusChange)(hContext, dwTimeout, rgReaderStates, cReaders))
90ce3da70b43 Initial load
duke
parents:
diff changeset
    83
90ce3da70b43 Initial load
duke
parents:
diff changeset
    84
#define CALL_SCardTransmit(hCard, pioSendPci, pbSendBuffer, cbSendLength, \
90ce3da70b43 Initial load
duke
parents:
diff changeset
    85
                            pioRecvPci, pbRecvBuffer, pcbRecvLength) \
90ce3da70b43 Initial load
duke
parents:
diff changeset
    86
    ((scardTransmit)(hCard, pioSendPci, pbSendBuffer, cbSendLength, \
90ce3da70b43 Initial load
duke
parents:
diff changeset
    87
                            pioRecvPci, pbRecvBuffer, pcbRecvLength))
90ce3da70b43 Initial load
duke
parents:
diff changeset
    88
90ce3da70b43 Initial load
duke
parents:
diff changeset
    89
#define CALL_SCardListReaders(hContext, mszGroups, mszReaders, pcchReaders) \
90ce3da70b43 Initial load
duke
parents:
diff changeset
    90
    ((scardListReaders)(hContext, mszGroups, mszReaders, pcchReaders))
90ce3da70b43 Initial load
duke
parents:
diff changeset
    91
90ce3da70b43 Initial load
duke
parents:
diff changeset
    92
#define CALL_SCardBeginTransaction(hCard) \
90ce3da70b43 Initial load
duke
parents:
diff changeset
    93
    ((scardBeginTransaction)(hCard))
90ce3da70b43 Initial load
duke
parents:
diff changeset
    94
90ce3da70b43 Initial load
duke
parents:
diff changeset
    95
#define CALL_SCardEndTransaction(hCard, dwDisposition) \
90ce3da70b43 Initial load
duke
parents:
diff changeset
    96
    ((scardEndTransaction)(hCard, dwDisposition))
90ce3da70b43 Initial load
duke
parents:
diff changeset
    97
90ce3da70b43 Initial load
duke
parents:
diff changeset
    98
#define CALL_SCardControl(hCard, dwControlCode, pbSendBuffer, cbSendLength, \
90ce3da70b43 Initial load
duke
parents:
diff changeset
    99
            pbRecvBuffer, pcbRecvLength, lpBytesReturned) \
90ce3da70b43 Initial load
duke
parents:
diff changeset
   100
    ((scardControl)(hCard, dwControlCode, pbSendBuffer, cbSendLength, \
90ce3da70b43 Initial load
duke
parents:
diff changeset
   101
            pbRecvBuffer, pcbRecvLength, lpBytesReturned))
90ce3da70b43 Initial load
duke
parents:
diff changeset
   102
90ce3da70b43 Initial load
duke
parents:
diff changeset
   103
extern FPTR_SCardEstablishContext scardEstablishContext;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   104
extern FPTR_SCardConnect scardConnect;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   105
extern FPTR_SCardDisconnect scardDisconnect;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   106
extern FPTR_SCardStatus scardStatus;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   107
extern FPTR_SCardGetStatusChange scardGetStatusChange;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   108
extern FPTR_SCardTransmit scardTransmit;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   109
extern FPTR_SCardListReaders scardListReaders;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   110
extern FPTR_SCardBeginTransaction scardBeginTransaction;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   111
extern FPTR_SCardEndTransaction scardEndTransaction;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   112
extern FPTR_SCardControl scardControl;