提交 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. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
* *
* This code is free software; you can redistribute it and/or modify it * 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 ...@@ -179,7 +179,7 @@ JNIEXPORT jobjectArray JNICALL Java_sun_security_smartcardio_PCSC_SCardListReade
{ {
SCARDCONTEXT context = (SCARDCONTEXT)jContext; SCARDCONTEXT context = (SCARDCONTEXT)jContext;
LONG rv; LONG rv;
LPTSTR mszReaders = NULL; LPSTR mszReaders = NULL;
DWORD size = 0; DWORD size = 0;
jobjectArray result; jobjectArray result;
...@@ -216,7 +216,7 @@ JNIEXPORT jlong JNICALL Java_sun_security_smartcardio_PCSC_SCardConnect ...@@ -216,7 +216,7 @@ JNIEXPORT jlong JNICALL Java_sun_security_smartcardio_PCSC_SCardConnect
{ {
SCARDCONTEXT context = (SCARDCONTEXT)jContext; SCARDCONTEXT context = (SCARDCONTEXT)jContext;
LONG rv; LONG rv;
LPCTSTR readerName; LPCSTR readerName;
SCARDHANDLE card = 0; SCARDHANDLE card = 0;
DWORD proto = 0; DWORD proto = 0;
......
/* /*
* This handles smartcard reader communications. * MUSCLE SmartCard Development ( https://pcsclite.apdu.fr/ )
*
* MUSCLE SmartCard Development ( http://www.linuxnet.com )
* *
* Copyright (C) 1999-2003 * Copyright (C) 1999-2003
* David Corcoran <corcoran@linuxnet.com> * David Corcoran <corcoran@musclecard.com>
* Copyright (C) 2002-2009
* Ludovic Rousseau <ludovic.rousseau@free.fr> * 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__ #ifndef __winscard_h__
...@@ -20,71 +45,79 @@ extern "C" ...@@ -20,71 +45,79 @@ extern "C"
{ {
#endif #endif
LONG SCardEstablishContext(DWORD dwScope, #ifndef PCSC_API
LPCVOID pvReserved1, LPCVOID pvReserved2, LPSCARDCONTEXT phContext); #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, PCSC_API LONG SCardIsValidContext(SCARDCONTEXT hContext);
LPCTSTR szReader,
DWORD dwShareMode,
DWORD dwPreferredProtocols,
LPSCARDHANDLE phCard, LPDWORD pdwActiveProtocol);
LONG SCardReconnect(SCARDHANDLE hCard, PCSC_API LONG SCardConnect(SCARDCONTEXT hContext,
DWORD dwShareMode, LPCSTR szReader,
DWORD dwPreferredProtocols, DWORD dwShareMode,
DWORD dwInitialization, LPDWORD pdwActiveProtocol); 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, PCSC_API LONG SCardStatus(SCARDHANDLE hCard,
LPTSTR mszReaderNames, LPDWORD pcchReaderLen, /*@null@*/ /*@out@*/ LPSTR mszReaderName,
LPDWORD pdwState, /*@null@*/ /*@out@*/ LPDWORD pcchReaderLen,
LPDWORD pdwProtocol, /*@null@*/ /*@out@*/ LPDWORD pdwState,
LPBYTE pbAtr, LPDWORD pcbAtrLen); /*@null@*/ /*@out@*/ LPDWORD pdwProtocol,
/*@null@*/ /*@out@*/ LPBYTE pbAtr,
/*@null@*/ /*@out@*/ LPDWORD pcbAtrLen);
LONG SCardGetStatusChange(SCARDCONTEXT hContext, PCSC_API LONG SCardGetStatusChange(SCARDCONTEXT hContext,
DWORD dwTimeout, DWORD dwTimeout,
LPSCARD_READERSTATE_A rgReaderStates, DWORD cReaders); SCARD_READERSTATE *rgReaderStates, DWORD cReaders);
LONG SCardControl(SCARDHANDLE hCard, DWORD dwControlCode, PCSC_API LONG SCardControl(SCARDHANDLE hCard, DWORD dwControlCode,
LPCVOID pbSendBuffer, DWORD cbSendLength, LPCVOID pbSendBuffer, DWORD cbSendLength,
LPVOID pbRecvBuffer, DWORD cbRecvLength, LPDWORD lpBytesReturned); /*@out@*/ LPVOID pbRecvBuffer, DWORD cbRecvLength,
LPDWORD lpBytesReturned);
LONG SCardTransmit(SCARDHANDLE hCard, PCSC_API LONG SCardTransmit(SCARDHANDLE hCard,
LPCSCARD_IO_REQUEST pioSendPci, const SCARD_IO_REQUEST *pioSendPci,
LPCBYTE pbSendBuffer, DWORD cbSendLength, LPCBYTE pbSendBuffer, DWORD cbSendLength,
LPSCARD_IO_REQUEST pioRecvPci, /*@out@*/ SCARD_IO_REQUEST *pioRecvPci,
LPBYTE pbRecvBuffer, LPDWORD pcbRecvLength); /*@out@*/ LPBYTE pbRecvBuffer, LPDWORD pcbRecvLength);
LONG SCardListReaderGroups(SCARDCONTEXT hContext, PCSC_API LONG SCardListReaderGroups(SCARDCONTEXT hContext,
LPTSTR mszGroups, LPDWORD pcchGroups); /*@out@*/ LPSTR mszGroups, LPDWORD pcchGroups);
LONG SCardListReaders(SCARDCONTEXT hContext, PCSC_API LONG SCardListReaders(SCARDCONTEXT hContext,
LPCTSTR mszGroups, /*@null@*/ /*@out@*/ LPCSTR mszGroups,
LPTSTR mszReaders, LPDWORD pcchReaders); /*@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, PCSC_API LONG SCardCancel(SCARDCONTEXT hContext);
LPDWORD pcbAttrLen);
LONG SCardSetAttrib(SCARDHANDLE hCard, DWORD dwAttrId, LPCBYTE pbAttr, PCSC_API LONG SCardGetAttrib(SCARDHANDLE hCard, DWORD dwAttrId,
DWORD cbAttrLen); /*@out@*/ LPBYTE pbAttr, LPDWORD pcbAttrLen);
void SCardUnload(void); PCSC_API LONG SCardSetAttrib(SCARDHANDLE hCard, DWORD dwAttrId,
LPCBYTE pbAttr, DWORD cbAttrLen);
#ifdef __cplusplus #ifdef __cplusplus
} }
#endif #endif
#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 Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions modification, are permitted provided that the following conditions
are met: are met:
...@@ -13,9 +18,6 @@ are met: ...@@ -13,9 +18,6 @@ are met:
3. The name of the author may not be used to endorse or promote products 3. The name of the author may not be used to endorse or promote products
derived from this software without specific prior written permission. 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 THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. 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 ...@@ -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 THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 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. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
* *
* This code is free software; you can redistribute it and/or modify it * This code is free software; you can redistribute it and/or modify it
...@@ -23,48 +23,49 @@ ...@@ -23,48 +23,49 @@
* questions. * questions.
*/ */
typedef LONG (*FPTR_SCardEstablishContext)(ULONG dwScope, typedef LONG (*FPTR_SCardEstablishContext)(DWORD dwScope,
const void *pvReserved1, LPCVOID pvReserved1,
const void *pvReserved2, LPCVOID pvReserved2,
LONG *phContext); LPSCARDCONTEXT phContext);
typedef LONG (*FPTR_SCardConnect)(LONG hContext, typedef LONG (*FPTR_SCardConnect)(SCARDCONTEXT hContext,
const char *szReader, LPCSTR szReader,
ULONG dwShareMode, DWORD dwShareMode,
ULONG dwPreferredProtocols, DWORD dwPreferredProtocols,
LONG *phCard, ULONG *pdwActiveProtocol); LPSCARDHANDLE phCard, LPDWORD pdwActiveProtocol);
typedef LONG (*FPTR_SCardDisconnect)(LONG hCard, ULONG dwDisposition); typedef LONG (*FPTR_SCardDisconnect)(SCARDHANDLE hCard, DWORD dwDisposition);
typedef LONG (*FPTR_SCardStatus)(LONG hCard, typedef LONG (*FPTR_SCardStatus)(SCARDHANDLE hCard,
char *mszReaderNames, LPSTR mszReaderNames,
ULONG *pcchReaderLen, LPDWORD pcchReaderLen,
ULONG *pdwState, LPDWORD pdwState,
ULONG *pdwProtocol, LPDWORD pdwProtocol,
unsigned char *pbAtr, ULONG *pcbAtrLen); LPBYTE pbAtr, LPDWORD pcbAtrLen);
typedef LONG (*FPTR_SCardGetStatusChange)(LONG hContext, typedef LONG (*FPTR_SCardGetStatusChange)(SCARDCONTEXT hContext,
ULONG dwTimeout, DWORD dwTimeout,
LPSCARD_READERSTATE_A rgReaderStates, ULONG cReaders); SCARD_READERSTATE *rgReaderStates, DWORD cReaders);
typedef LONG (*FPTR_SCardTransmit)(LONG hCard, typedef LONG (*FPTR_SCardTransmit)(SCARDHANDLE hCard,
LPCSCARD_IO_REQUEST pioSendPci, const SCARD_IO_REQUEST *pioSendPci,
const unsigned char *pbSendBuffer, LPCBYTE pbSendBuffer,
ULONG cbSendLength, DWORD cbSendLength,
LPSCARD_IO_REQUEST pioRecvPci, SCARD_IO_REQUEST *pioRecvPci,
unsigned char *pbRecvBuffer, ULONG *pcbRecvLength); LPBYTE pbRecvBuffer, LPDWORD pcbRecvLength);
typedef LONG (*FPTR_SCardListReaders)(LONG hContext, typedef LONG (*FPTR_SCardListReaders)(SCARDCONTEXT hContext,
const char *mszGroups, LPCSTR mszGroups,
char *mszReaders, ULONG *pcchReaders); LPSTR mszReaders, LPDWORD pcchReaders);
typedef LONG (*FPTR_SCardBeginTransaction)(LONG hCard); typedef LONG (*FPTR_SCardBeginTransaction)(SCARDHANDLE hCard);
typedef LONG (*FPTR_SCardEndTransaction)(LONG hCard, ULONG dwDisposition); typedef LONG (*FPTR_SCardEndTransaction)(SCARDHANDLE hCard,
DWORD dwDisposition);
typedef LONG (*FPTR_SCardControl)(LONG hCard, ULONG dwControlCode,
const void* pbSendBuffer, ULONG cbSendLength, const void* pbRecvBuffer, typedef LONG (*FPTR_SCardControl)(SCARDHANDLE hCard, DWORD dwControlCode,
ULONG pcbRecvLength, ULONG *lpBytesReturned); LPCVOID pbSendBuffer, DWORD cbSendLength, LPVOID pbRecvBuffer,
DWORD pcbRecvLength, LPDWORD lpBytesReturned);
#define CALL_SCardEstablishContext(dwScope, pvReserved1, pvReserved2, phContext) \ #define CALL_SCardEstablishContext(dwScope, pvReserved1, pvReserved2, phContext) \
((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.
先完成此消息的编辑!
想要评论请 注册