提交 acac8601 编写于 作者: S sgehwolf

8218780: Update MUSCLE PCSC-Lite header files

Summary: Update the PCSC-lite header files to 1.8.24 release
Reviewed-by: andrew
上级 20c5374b
/*
* Copyright (c) 2005, 2014, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2005, 2019, Oracle and/or its affiliates. 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
......@@ -179,7 +179,7 @@ JNIEXPORT jobjectArray JNICALL Java_sun_security_smartcardio_PCSC_SCardListReade
{
SCARDCONTEXT context = (SCARDCONTEXT)jContext;
LONG rv;
LPTSTR mszReaders = NULL;
LPSTR mszReaders = NULL;
DWORD size = 0;
jobjectArray result;
......@@ -216,7 +216,7 @@ JNIEXPORT jlong JNICALL Java_sun_security_smartcardio_PCSC_SCardConnect
{
SCARDCONTEXT context = (SCARDCONTEXT)jContext;
LONG rv;
LPCTSTR readerName;
LPCSTR readerName;
SCARDHANDLE card = 0;
DWORD proto = 0;
......
/*
* This handles smartcard reader communications.
*
* MUSCLE SmartCard Development ( http://www.linuxnet.com )
* MUSCLE SmartCard Development ( https://pcsclite.apdu.fr/ )
*
* Copyright (C) 1999-2003
* David Corcoran <corcoran@linuxnet.com>
* David Corcoran <corcoran@musclecard.com>
* Copyright (C) 2002-2009
* Ludovic Rousseau <ludovic.rousseau@free.fr>
*
* $Id: winscard.h,v 1.13 2004/08/06 12:12:19 rousseau Exp $
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions
are met:
1. Redistributions of source code must retain the above copyright
notice, this list of conditions and the following disclaimer.
2. Redistributions in binary form must reproduce the above copyright
notice, this list of conditions and the following disclaimer in the
documentation and/or other materials provided with the distribution.
3. The name of the author may not be used to endorse or promote products
derived from this software without specific prior written permission.
THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
/**
* @file
* @brief This handles smart card reader communications.
*/
#ifndef __winscard_h__
......@@ -20,71 +45,79 @@ extern "C"
{
#endif
LONG SCardEstablishContext(DWORD dwScope,
LPCVOID pvReserved1, LPCVOID pvReserved2, LPSCARDCONTEXT phContext);
#ifndef PCSC_API
#define PCSC_API
#endif
LONG SCardReleaseContext(SCARDCONTEXT hContext);
PCSC_API LONG SCardEstablishContext(DWORD dwScope,
/*@null@*/ LPCVOID pvReserved1, /*@null@*/ LPCVOID pvReserved2,
/*@out@*/ LPSCARDCONTEXT phContext);
LONG SCardSetTimeout(SCARDCONTEXT hContext, DWORD dwTimeout);
PCSC_API LONG SCardReleaseContext(SCARDCONTEXT hContext);
LONG SCardConnect(SCARDCONTEXT hContext,
LPCTSTR szReader,
DWORD dwShareMode,
DWORD dwPreferredProtocols,
LPSCARDHANDLE phCard, LPDWORD pdwActiveProtocol);
PCSC_API LONG SCardIsValidContext(SCARDCONTEXT hContext);
LONG SCardReconnect(SCARDHANDLE hCard,
DWORD dwShareMode,
DWORD dwPreferredProtocols,
DWORD dwInitialization, LPDWORD pdwActiveProtocol);
PCSC_API LONG SCardConnect(SCARDCONTEXT hContext,
LPCSTR szReader,
DWORD dwShareMode,
DWORD dwPreferredProtocols,
/*@out@*/ LPSCARDHANDLE phCard, /*@out@*/ LPDWORD pdwActiveProtocol);
LONG SCardDisconnect(SCARDHANDLE hCard, DWORD dwDisposition);
PCSC_API LONG SCardReconnect(SCARDHANDLE hCard,
DWORD dwShareMode,
DWORD dwPreferredProtocols,
DWORD dwInitialization, /*@out@*/ LPDWORD pdwActiveProtocol);
LONG SCardBeginTransaction(SCARDHANDLE hCard);
PCSC_API LONG SCardDisconnect(SCARDHANDLE hCard, DWORD dwDisposition);
LONG SCardEndTransaction(SCARDHANDLE hCard, DWORD dwDisposition);
PCSC_API LONG SCardBeginTransaction(SCARDHANDLE hCard);
LONG SCardCancelTransaction(SCARDHANDLE hCard);
PCSC_API LONG SCardEndTransaction(SCARDHANDLE hCard, DWORD dwDisposition);
LONG SCardStatus(SCARDHANDLE hCard,
LPTSTR mszReaderNames, LPDWORD pcchReaderLen,
LPDWORD pdwState,
LPDWORD pdwProtocol,
LPBYTE pbAtr, LPDWORD pcbAtrLen);
PCSC_API LONG SCardStatus(SCARDHANDLE hCard,
/*@null@*/ /*@out@*/ LPSTR mszReaderName,
/*@null@*/ /*@out@*/ LPDWORD pcchReaderLen,
/*@null@*/ /*@out@*/ LPDWORD pdwState,
/*@null@*/ /*@out@*/ LPDWORD pdwProtocol,
/*@null@*/ /*@out@*/ LPBYTE pbAtr,
/*@null@*/ /*@out@*/ LPDWORD pcbAtrLen);
LONG SCardGetStatusChange(SCARDCONTEXT hContext,
DWORD dwTimeout,
LPSCARD_READERSTATE_A rgReaderStates, DWORD cReaders);
PCSC_API LONG SCardGetStatusChange(SCARDCONTEXT hContext,
DWORD dwTimeout,
SCARD_READERSTATE *rgReaderStates, DWORD cReaders);
LONG SCardControl(SCARDHANDLE hCard, DWORD dwControlCode,
LPCVOID pbSendBuffer, DWORD cbSendLength,
LPVOID pbRecvBuffer, DWORD cbRecvLength, LPDWORD lpBytesReturned);
PCSC_API LONG SCardControl(SCARDHANDLE hCard, DWORD dwControlCode,
LPCVOID pbSendBuffer, DWORD cbSendLength,
/*@out@*/ LPVOID pbRecvBuffer, DWORD cbRecvLength,
LPDWORD lpBytesReturned);
LONG SCardTransmit(SCARDHANDLE hCard,
LPCSCARD_IO_REQUEST pioSendPci,
LPCBYTE pbSendBuffer, DWORD cbSendLength,
LPSCARD_IO_REQUEST pioRecvPci,
LPBYTE pbRecvBuffer, LPDWORD pcbRecvLength);
PCSC_API LONG SCardTransmit(SCARDHANDLE hCard,
const SCARD_IO_REQUEST *pioSendPci,
LPCBYTE pbSendBuffer, DWORD cbSendLength,
/*@out@*/ SCARD_IO_REQUEST *pioRecvPci,
/*@out@*/ LPBYTE pbRecvBuffer, LPDWORD pcbRecvLength);
LONG SCardListReaderGroups(SCARDCONTEXT hContext,
LPTSTR mszGroups, LPDWORD pcchGroups);
PCSC_API LONG SCardListReaderGroups(SCARDCONTEXT hContext,
/*@out@*/ LPSTR mszGroups, LPDWORD pcchGroups);
LONG SCardListReaders(SCARDCONTEXT hContext,
LPCTSTR mszGroups,
LPTSTR mszReaders, LPDWORD pcchReaders);
PCSC_API LONG SCardListReaders(SCARDCONTEXT hContext,
/*@null@*/ /*@out@*/ LPCSTR mszGroups,
/*@null@*/ /*@out@*/ LPSTR mszReaders,
/*@out@*/ LPDWORD pcchReaders);
LONG SCardCancel(SCARDCONTEXT hContext);
PCSC_API LONG SCardFreeMemory(SCARDCONTEXT hContext, LPCVOID pvMem);
LONG SCardGetAttrib(SCARDHANDLE hCard, DWORD dwAttrId, LPBYTE pbAttr,
LPDWORD pcbAttrLen);
PCSC_API LONG SCardCancel(SCARDCONTEXT hContext);
LONG SCardSetAttrib(SCARDHANDLE hCard, DWORD dwAttrId, LPCBYTE pbAttr,
DWORD cbAttrLen);
PCSC_API LONG SCardGetAttrib(SCARDHANDLE hCard, DWORD dwAttrId,
/*@out@*/ LPBYTE pbAttr, LPDWORD pcbAttrLen);
void SCardUnload(void);
PCSC_API LONG SCardSetAttrib(SCARDHANDLE hCard, DWORD dwAttrId,
LPCBYTE pbAttr, DWORD cbAttrLen);
#ifdef __cplusplus
}
#endif
#endif
Copyright (c) 1999-2003 David Corcoran <corcoran@linuxnet.com>
All rights reserved.
/*
* MUSCLE SmartCard Development ( https://pcsclite.apdu.fr/ )
*
* Copyright (C) 1999
* David Corcoran <corcoran@musclecard.com>
* Copyright (C) 2002-2011
* Ludovic Rousseau <ludovic.rousseau@free.fr>
*
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions
are met:
......@@ -13,9 +18,6 @@ are met:
3. The name of the author may not be used to endorse or promote products
derived from this software without specific prior written permission.
Changes to this license can be made only by the copyright author with
explicit written consent.
THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
......@@ -26,3 +28,88 @@ DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
/**
* @file
* @brief This keeps a list of Windows(R) types.
*/
#ifndef __wintypes_h__
#define __wintypes_h__
#ifdef __cplusplus
extern "C"
{
#endif
#ifdef __APPLE__
#include <stdint.h>
#ifndef BYTE
typedef uint8_t BYTE;
#endif
typedef uint8_t UCHAR;
typedef UCHAR *PUCHAR;
typedef uint16_t USHORT;
#ifndef __COREFOUNDATION_CFPLUGINCOM__
typedef uint32_t ULONG;
typedef void *LPVOID;
typedef int16_t BOOL;
#endif
typedef ULONG *PULONG;
typedef const void *LPCVOID;
typedef uint32_t DWORD;
typedef DWORD *PDWORD;
typedef uint16_t WORD;
typedef int32_t LONG;
typedef const char *LPCSTR;
typedef const BYTE *LPCBYTE;
typedef BYTE *LPBYTE;
typedef DWORD *LPDWORD;
typedef char *LPSTR;
#else
#ifndef BYTE
typedef unsigned char BYTE;
#endif
typedef unsigned char UCHAR;
typedef UCHAR *PUCHAR;
typedef unsigned short USHORT;
#ifndef __COREFOUNDATION_CFPLUGINCOM__
typedef unsigned long ULONG;
typedef void *LPVOID;
#endif
typedef const void *LPCVOID;
typedef unsigned long DWORD;
typedef DWORD *PDWORD;
typedef long LONG;
typedef const char *LPCSTR;
typedef const BYTE *LPCBYTE;
typedef BYTE *LPBYTE;
typedef DWORD *LPDWORD;
typedef char *LPSTR;
/* these types were deprecated but still used by old drivers and
* applications. So just declare and use them. */
typedef LPSTR LPTSTR;
typedef LPCSTR LPCTSTR;
/* types unused by pcsc-lite */
typedef short BOOL;
typedef unsigned short WORD;
typedef ULONG *PULONG;
#endif
#ifdef __cplusplus
}
#endif
#endif
/*
* Copyright (c) 2005, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2005, 2019, Oracle and/or its affiliates. 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
......@@ -23,48 +23,49 @@
* 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);
typedef LONG (*FPTR_SCardEstablishContext)(DWORD dwScope,
LPCVOID pvReserved1,
LPCVOID pvReserved2,
LPSCARDCONTEXT phContext);
typedef LONG (*FPTR_SCardConnect)(SCARDCONTEXT hContext,
LPCSTR szReader,
DWORD dwShareMode,
DWORD dwPreferredProtocols,
LPSCARDHANDLE phCard, LPDWORD pdwActiveProtocol);
typedef LONG (*FPTR_SCardDisconnect)(SCARDHANDLE hCard, DWORD dwDisposition);
typedef LONG (*FPTR_SCardStatus)(SCARDHANDLE hCard,
LPSTR mszReaderNames,
LPDWORD pcchReaderLen,
LPDWORD pdwState,
LPDWORD pdwProtocol,
LPBYTE pbAtr, LPDWORD pcbAtrLen);
typedef LONG (*FPTR_SCardGetStatusChange)(SCARDCONTEXT hContext,
DWORD dwTimeout,
SCARD_READERSTATE *rgReaderStates, DWORD cReaders);
typedef LONG (*FPTR_SCardTransmit)(SCARDHANDLE hCard,
const SCARD_IO_REQUEST *pioSendPci,
LPCBYTE pbSendBuffer,
DWORD cbSendLength,
SCARD_IO_REQUEST *pioRecvPci,
LPBYTE pbRecvBuffer, LPDWORD pcbRecvLength);
typedef LONG (*FPTR_SCardListReaders)(SCARDCONTEXT hContext,
LPCSTR mszGroups,
LPSTR mszReaders, LPDWORD pcchReaders);
typedef LONG (*FPTR_SCardBeginTransaction)(SCARDHANDLE hCard);
typedef LONG (*FPTR_SCardEndTransaction)(SCARDHANDLE hCard,
DWORD dwDisposition);
typedef LONG (*FPTR_SCardControl)(SCARDHANDLE hCard, DWORD dwControlCode,
LPCVOID pbSendBuffer, DWORD cbSendLength, LPVOID pbRecvBuffer,
DWORD pcbRecvLength, LPDWORD lpBytesReturned);
#define CALL_SCardEstablishContext(dwScope, pvReserved1, pvReserved2, phContext) \
((scardEstablishContext)(dwScope, pvReserved1, pvReserved2, phContext))
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册