2014-04-04 02:47:18 +04:00
|
|
|
/**
|
|
|
|
* FreeRDP: A Remote Desktop Protocol Implementation
|
|
|
|
* Smart Card Structure Packing
|
|
|
|
*
|
|
|
|
* Copyright 2014 Marc-Andre Moreau <marcandre.moreau@gmail.com>
|
2015-07-03 14:09:03 +03:00
|
|
|
* Copyright 2015 Thincast Technologies GmbH
|
|
|
|
* Copyright 2015 DI (FH) Martin Haimberger <martin.haimberger@thincast.com>
|
2014-04-04 02:47:18 +04:00
|
|
|
*
|
|
|
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
|
|
* you may not use this file except in compliance with the License.
|
|
|
|
* You may obtain a copy of the License at
|
|
|
|
*
|
|
|
|
* http://www.apache.org/licenses/LICENSE-2.0
|
|
|
|
*
|
|
|
|
* Unless required by applicable law or agreed to in writing, software
|
|
|
|
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
|
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
|
|
* See the License for the specific language governing permissions and
|
|
|
|
* limitations under the License.
|
|
|
|
*/
|
|
|
|
|
|
|
|
#ifndef FREERDP_CHANNEL_SMARTCARD_CLIENT_PACK_H
|
|
|
|
#define FREERDP_CHANNEL_SMARTCARD_CLIENT_PACK_H
|
|
|
|
|
|
|
|
#include <winpr/crt.h>
|
2014-04-04 21:57:28 +04:00
|
|
|
#include <winpr/stream.h>
|
2014-04-04 02:47:18 +04:00
|
|
|
#include <winpr/smartcard.h>
|
|
|
|
|
|
|
|
/* interface type_scard_pack */
|
|
|
|
/* [unique][version][uuid] */
|
|
|
|
|
|
|
|
typedef struct _REDIR_SCARDCONTEXT
|
|
|
|
{
|
2014-04-05 19:22:48 +04:00
|
|
|
/* [range] */ DWORD cbContext;
|
2014-04-12 00:27:01 +04:00
|
|
|
/* [size_is][unique] */ BYTE pbContext[8];
|
2014-04-04 02:47:18 +04:00
|
|
|
} REDIR_SCARDCONTEXT;
|
|
|
|
|
|
|
|
typedef struct _REDIR_SCARDHANDLE
|
|
|
|
{
|
2014-04-05 19:22:48 +04:00
|
|
|
/* [range] */ DWORD cbHandle;
|
2014-04-12 00:27:01 +04:00
|
|
|
/* [size_is] */ BYTE pbHandle[8];
|
2014-04-04 02:47:18 +04:00
|
|
|
} REDIR_SCARDHANDLE;
|
|
|
|
|
2014-05-12 23:04:31 +04:00
|
|
|
typedef struct _Long_Call
|
|
|
|
{
|
|
|
|
LONG LongValue;
|
|
|
|
} Long_Call;
|
|
|
|
|
2014-04-07 18:59:13 +04:00
|
|
|
typedef struct _Long_Return
|
2014-04-04 02:47:18 +04:00
|
|
|
{
|
2014-04-07 18:59:13 +04:00
|
|
|
LONG ReturnCode;
|
2014-05-12 23:04:31 +04:00
|
|
|
} Long_Return;
|
2014-04-04 02:47:18 +04:00
|
|
|
|
|
|
|
typedef struct _longAndMultiString_Return
|
|
|
|
{
|
2014-04-07 18:59:13 +04:00
|
|
|
LONG ReturnCode;
|
2014-04-05 19:22:48 +04:00
|
|
|
/* [range] */ DWORD cBytes;
|
2015-06-30 18:42:01 +03:00
|
|
|
/* [size_is][unique] */ BYTE* msz;
|
2014-04-04 02:47:18 +04:00
|
|
|
} ListReaderGroups_Return;
|
|
|
|
|
|
|
|
typedef struct _longAndMultiString_Return ListReaders_Return;
|
|
|
|
|
|
|
|
typedef struct _Context_Call
|
|
|
|
{
|
2014-04-12 01:44:27 +04:00
|
|
|
REDIR_SCARDCONTEXT hContext;
|
2014-04-04 02:47:18 +04:00
|
|
|
} Context_Call;
|
|
|
|
|
|
|
|
typedef struct _ContextAndStringA_Call
|
|
|
|
{
|
2014-04-12 01:44:27 +04:00
|
|
|
REDIR_SCARDCONTEXT hContext;
|
2015-06-30 18:42:01 +03:00
|
|
|
/* [string] */ unsigned char* sz;
|
2014-04-04 02:47:18 +04:00
|
|
|
} ContextAndStringA_Call;
|
|
|
|
|
|
|
|
typedef struct _ContextAndStringW_Call
|
|
|
|
{
|
2014-04-12 01:44:27 +04:00
|
|
|
REDIR_SCARDCONTEXT hContext;
|
2015-06-30 18:42:01 +03:00
|
|
|
/* [string] */ WCHAR* sz;
|
2014-04-04 02:47:18 +04:00
|
|
|
} ContextAndStringW_Call;
|
|
|
|
|
|
|
|
typedef struct _ContextAndTwoStringA_Call
|
|
|
|
{
|
2014-04-12 01:44:27 +04:00
|
|
|
REDIR_SCARDCONTEXT hContext;
|
2015-06-30 18:42:01 +03:00
|
|
|
/* [string] */ unsigned char* sz1;
|
|
|
|
/* [string] */ unsigned char* sz2;
|
2014-04-04 02:47:18 +04:00
|
|
|
} ContextAndTwoStringA_Call;
|
|
|
|
|
|
|
|
typedef struct _ContextAndTwoStringW_Call
|
|
|
|
{
|
2014-04-12 01:44:27 +04:00
|
|
|
REDIR_SCARDCONTEXT hContext;
|
2015-06-30 18:42:01 +03:00
|
|
|
/* [string] */ WCHAR* sz1;
|
|
|
|
/* [string] */ WCHAR* sz2;
|
2014-04-04 02:47:18 +04:00
|
|
|
} ContextAndTwoStringW_Call;
|
|
|
|
|
|
|
|
typedef struct _EstablishContext_Call
|
|
|
|
{
|
2014-04-05 19:22:48 +04:00
|
|
|
DWORD dwScope;
|
2014-04-04 02:47:18 +04:00
|
|
|
} EstablishContext_Call;
|
|
|
|
|
|
|
|
typedef struct _EstablishContext_Return
|
|
|
|
{
|
2014-04-07 18:59:13 +04:00
|
|
|
LONG ReturnCode;
|
2014-04-12 01:44:27 +04:00
|
|
|
REDIR_SCARDCONTEXT hContext;
|
2014-04-04 02:47:18 +04:00
|
|
|
} EstablishContext_Return;
|
|
|
|
|
|
|
|
typedef struct _ListReaderGroups_Call
|
|
|
|
{
|
2014-04-12 01:44:27 +04:00
|
|
|
REDIR_SCARDCONTEXT hContext;
|
2014-04-07 18:59:13 +04:00
|
|
|
LONG fmszGroupsIsNULL;
|
2014-04-05 19:22:48 +04:00
|
|
|
DWORD cchGroups;
|
2014-04-04 02:47:18 +04:00
|
|
|
} ListReaderGroups_Call;
|
|
|
|
|
|
|
|
typedef struct _ListReaders_Call
|
|
|
|
{
|
2014-04-12 01:44:27 +04:00
|
|
|
REDIR_SCARDCONTEXT hContext;
|
2014-04-05 19:22:48 +04:00
|
|
|
/* [range] */ DWORD cBytes;
|
2015-06-30 18:42:01 +03:00
|
|
|
/* [size_is][unique] */ BYTE* mszGroups;
|
2014-04-07 18:59:13 +04:00
|
|
|
LONG fmszReadersIsNULL;
|
2014-04-05 19:22:48 +04:00
|
|
|
DWORD cchReaders;
|
2014-04-04 02:47:18 +04:00
|
|
|
} ListReaders_Call;
|
|
|
|
|
|
|
|
typedef struct _ReaderState_Common_Call
|
|
|
|
{
|
2014-04-05 19:22:48 +04:00
|
|
|
DWORD dwCurrentState;
|
|
|
|
DWORD dwEventState;
|
|
|
|
/* [range] */ DWORD cbAtr;
|
2014-04-08 19:32:48 +04:00
|
|
|
BYTE rgbAtr[36];
|
2014-04-04 02:47:18 +04:00
|
|
|
} ReaderState_Common_Call;
|
|
|
|
|
|
|
|
typedef struct _ReaderStateA
|
|
|
|
{
|
2015-06-30 18:42:01 +03:00
|
|
|
/* [string] */ unsigned char* szReader;
|
2014-04-04 02:47:18 +04:00
|
|
|
ReaderState_Common_Call Common;
|
|
|
|
} ReaderStateA;
|
|
|
|
|
|
|
|
typedef struct _ReaderStateW
|
|
|
|
{
|
2015-06-30 18:42:01 +03:00
|
|
|
/* [string] */ WCHAR* szReader;
|
2014-04-04 02:47:18 +04:00
|
|
|
ReaderState_Common_Call Common;
|
|
|
|
} ReaderStateW;
|
|
|
|
|
|
|
|
typedef struct _ReaderState_Return
|
|
|
|
{
|
2014-04-05 19:22:48 +04:00
|
|
|
DWORD dwCurrentState;
|
|
|
|
DWORD dwEventState;
|
|
|
|
/* [range] */ DWORD cbAtr;
|
2014-04-07 18:59:13 +04:00
|
|
|
BYTE rgbAtr[36];
|
2014-04-04 02:47:18 +04:00
|
|
|
} ReaderState_Return;
|
|
|
|
|
|
|
|
typedef struct _GetStatusChangeA_Call
|
|
|
|
{
|
2014-04-12 01:44:27 +04:00
|
|
|
REDIR_SCARDCONTEXT hContext;
|
2014-04-05 19:22:48 +04:00
|
|
|
DWORD dwTimeOut;
|
|
|
|
/* [range] */ DWORD cReaders;
|
2014-04-11 07:55:11 +04:00
|
|
|
/* [size_is] */ LPSCARD_READERSTATEA rgReaderStates;
|
2014-04-04 02:47:18 +04:00
|
|
|
} GetStatusChangeA_Call;
|
|
|
|
|
|
|
|
typedef struct _LocateCardsA_Call
|
|
|
|
{
|
2014-04-12 01:44:27 +04:00
|
|
|
REDIR_SCARDCONTEXT hContext;
|
2014-04-05 19:22:48 +04:00
|
|
|
/* [range] */ DWORD cBytes;
|
2015-06-30 18:42:01 +03:00
|
|
|
/* [size_is] */ BYTE* mszCards;
|
2014-04-05 19:22:48 +04:00
|
|
|
/* [range] */ DWORD cReaders;
|
2015-06-30 18:42:01 +03:00
|
|
|
/* [size_is] */ ReaderStateA* rgReaderStates;
|
2014-04-04 02:47:18 +04:00
|
|
|
} LocateCardsA_Call;
|
|
|
|
|
|
|
|
typedef struct _LocateCardsW_Call
|
|
|
|
{
|
2014-04-12 01:44:27 +04:00
|
|
|
REDIR_SCARDCONTEXT hContext;
|
2014-04-05 19:22:48 +04:00
|
|
|
/* [range] */ DWORD cBytes;
|
2015-06-30 18:42:01 +03:00
|
|
|
/* [size_is] */ BYTE* mszCards;
|
2014-04-05 19:22:48 +04:00
|
|
|
/* [range] */ DWORD cReaders;
|
2015-06-30 18:42:01 +03:00
|
|
|
/* [size_is] */ ReaderStateW* rgReaderStates;
|
2014-04-04 02:47:18 +04:00
|
|
|
} LocateCardsW_Call;
|
|
|
|
|
|
|
|
typedef struct _LocateCards_ATRMask
|
|
|
|
{
|
2014-04-05 19:22:48 +04:00
|
|
|
/* [range] */ DWORD cbAtr;
|
2014-04-04 02:47:18 +04:00
|
|
|
BYTE rgbAtr[ 36 ];
|
|
|
|
BYTE rgbMask[ 36 ];
|
|
|
|
} LocateCards_ATRMask;
|
|
|
|
|
|
|
|
typedef struct _LocateCardsByATRA_Call
|
|
|
|
{
|
2014-04-12 01:44:27 +04:00
|
|
|
REDIR_SCARDCONTEXT hContext;
|
2014-04-05 19:22:48 +04:00
|
|
|
/* [range] */ DWORD cAtrs;
|
2015-06-30 18:42:01 +03:00
|
|
|
/* [size_is] */ LocateCards_ATRMask* rgAtrMasks;
|
2014-04-05 19:22:48 +04:00
|
|
|
/* [range] */ DWORD cReaders;
|
2015-06-30 18:42:01 +03:00
|
|
|
/* [size_is] */ ReaderStateA* rgReaderStates;
|
2014-04-04 02:47:18 +04:00
|
|
|
} LocateCardsByATRA_Call;
|
|
|
|
|
|
|
|
typedef struct _LocateCardsByATRW_Call
|
|
|
|
{
|
2014-04-12 01:44:27 +04:00
|
|
|
REDIR_SCARDCONTEXT hContext;
|
2014-04-05 19:22:48 +04:00
|
|
|
/* [range] */ DWORD cAtrs;
|
2015-06-30 18:42:01 +03:00
|
|
|
/* [size_is] */ LocateCards_ATRMask* rgAtrMasks;
|
2014-04-05 19:22:48 +04:00
|
|
|
/* [range] */ DWORD cReaders;
|
2015-06-30 18:42:01 +03:00
|
|
|
/* [size_is] */ ReaderStateW* rgReaderStates;
|
2014-04-04 02:47:18 +04:00
|
|
|
} LocateCardsByATRW_Call;
|
|
|
|
|
|
|
|
typedef struct _GetStatusChange_Return
|
|
|
|
{
|
2014-04-07 18:59:13 +04:00
|
|
|
LONG ReturnCode;
|
2014-04-05 19:22:48 +04:00
|
|
|
/* [range] */ DWORD cReaders;
|
2015-06-30 18:42:01 +03:00
|
|
|
/* [size_is] */ ReaderState_Return* rgReaderStates;
|
2014-04-04 02:47:18 +04:00
|
|
|
} LocateCards_Return;
|
|
|
|
|
|
|
|
typedef struct _GetStatusChange_Return GetStatusChange_Return;
|
|
|
|
|
|
|
|
typedef struct _GetStatusChangeW_Call
|
|
|
|
{
|
2014-04-12 01:44:27 +04:00
|
|
|
REDIR_SCARDCONTEXT hContext;
|
2014-04-05 19:22:48 +04:00
|
|
|
DWORD dwTimeOut;
|
|
|
|
/* [range] */ DWORD cReaders;
|
2014-04-11 07:55:11 +04:00
|
|
|
/* [size_is] */ LPSCARD_READERSTATEW rgReaderStates;
|
2014-04-04 02:47:18 +04:00
|
|
|
} GetStatusChangeW_Call;
|
|
|
|
|
|
|
|
typedef struct _Connect_Common
|
|
|
|
{
|
2014-04-12 01:44:27 +04:00
|
|
|
REDIR_SCARDCONTEXT hContext;
|
2014-04-05 19:22:48 +04:00
|
|
|
DWORD dwShareMode;
|
|
|
|
DWORD dwPreferredProtocols;
|
2014-04-04 02:47:18 +04:00
|
|
|
} Connect_Common;
|
|
|
|
|
|
|
|
typedef struct _ConnectA_Call
|
|
|
|
{
|
2015-06-30 18:42:01 +03:00
|
|
|
/* [string] */ unsigned char* szReader;
|
2014-04-04 02:47:18 +04:00
|
|
|
Connect_Common Common;
|
|
|
|
} ConnectA_Call;
|
|
|
|
|
|
|
|
typedef struct _ConnectW_Call
|
|
|
|
{
|
2015-06-30 18:42:01 +03:00
|
|
|
/* [string] */ WCHAR* szReader;
|
2014-04-04 02:47:18 +04:00
|
|
|
Connect_Common Common;
|
|
|
|
} ConnectW_Call;
|
|
|
|
|
|
|
|
typedef struct _Connect_Return
|
|
|
|
{
|
2014-04-07 18:59:13 +04:00
|
|
|
LONG ReturnCode;
|
2014-04-12 00:27:01 +04:00
|
|
|
REDIR_SCARDCONTEXT hContext;
|
2014-04-04 02:47:18 +04:00
|
|
|
REDIR_SCARDHANDLE hCard;
|
2014-04-05 19:22:48 +04:00
|
|
|
DWORD dwActiveProtocol;
|
2014-04-04 02:47:18 +04:00
|
|
|
} Connect_Return;
|
|
|
|
|
|
|
|
typedef struct _Reconnect_Call
|
|
|
|
{
|
2014-04-12 00:27:01 +04:00
|
|
|
REDIR_SCARDCONTEXT hContext;
|
2014-04-04 02:47:18 +04:00
|
|
|
REDIR_SCARDHANDLE hCard;
|
2014-04-05 19:22:48 +04:00
|
|
|
DWORD dwShareMode;
|
|
|
|
DWORD dwPreferredProtocols;
|
|
|
|
DWORD dwInitialization;
|
2014-04-04 02:47:18 +04:00
|
|
|
} Reconnect_Call;
|
|
|
|
|
|
|
|
typedef struct Reconnect_Return
|
|
|
|
{
|
2014-04-07 18:59:13 +04:00
|
|
|
LONG ReturnCode;
|
2014-04-05 19:22:48 +04:00
|
|
|
DWORD dwActiveProtocol;
|
2014-04-04 02:47:18 +04:00
|
|
|
} Reconnect_Return;
|
|
|
|
|
|
|
|
typedef struct _HCardAndDisposition_Call
|
|
|
|
{
|
2014-04-12 00:27:01 +04:00
|
|
|
REDIR_SCARDCONTEXT hContext;
|
2014-04-04 02:47:18 +04:00
|
|
|
REDIR_SCARDHANDLE hCard;
|
2014-04-05 19:22:48 +04:00
|
|
|
DWORD dwDisposition;
|
2014-04-04 02:47:18 +04:00
|
|
|
} HCardAndDisposition_Call;
|
|
|
|
|
|
|
|
typedef struct _State_Call
|
|
|
|
{
|
2014-04-12 00:27:01 +04:00
|
|
|
REDIR_SCARDCONTEXT hContext;
|
2014-04-04 02:47:18 +04:00
|
|
|
REDIR_SCARDHANDLE hCard;
|
2014-04-07 18:59:13 +04:00
|
|
|
LONG fpbAtrIsNULL;
|
2014-04-05 19:22:48 +04:00
|
|
|
DWORD cbAtrLen;
|
2014-04-04 02:47:18 +04:00
|
|
|
} State_Call;
|
|
|
|
|
|
|
|
typedef struct _State_Return
|
|
|
|
{
|
2014-04-07 18:59:13 +04:00
|
|
|
LONG ReturnCode;
|
2014-04-05 19:22:48 +04:00
|
|
|
DWORD dwState;
|
|
|
|
DWORD dwProtocol;
|
|
|
|
/* [range] */ DWORD cbAtrLen;
|
2014-04-07 09:19:58 +04:00
|
|
|
/* [size_is][unique] */ BYTE rgAtr[36];
|
2014-04-04 02:47:18 +04:00
|
|
|
} State_Return;
|
|
|
|
|
|
|
|
typedef struct _Status_Call
|
|
|
|
{
|
2014-04-12 00:27:01 +04:00
|
|
|
REDIR_SCARDCONTEXT hContext;
|
2014-04-04 02:47:18 +04:00
|
|
|
REDIR_SCARDHANDLE hCard;
|
2014-04-07 18:59:13 +04:00
|
|
|
LONG fmszReaderNamesIsNULL;
|
2014-04-05 19:22:48 +04:00
|
|
|
DWORD cchReaderLen;
|
|
|
|
DWORD cbAtrLen;
|
2014-04-04 02:47:18 +04:00
|
|
|
} Status_Call;
|
|
|
|
|
|
|
|
typedef struct _Status_Return
|
|
|
|
{
|
2014-04-07 18:59:13 +04:00
|
|
|
LONG ReturnCode;
|
2014-04-05 19:22:48 +04:00
|
|
|
/* [range] */ DWORD cBytes;
|
2015-06-30 18:42:01 +03:00
|
|
|
/* [size_is][unique] */ BYTE* mszReaderNames;
|
2014-04-05 19:22:48 +04:00
|
|
|
DWORD dwState;
|
|
|
|
DWORD dwProtocol;
|
2014-04-07 08:58:34 +04:00
|
|
|
BYTE pbAtr[32];
|
2014-04-05 19:22:48 +04:00
|
|
|
/* [range] */ DWORD cbAtrLen;
|
2014-04-04 02:47:18 +04:00
|
|
|
} Status_Return;
|
|
|
|
|
|
|
|
typedef struct _SCardIO_Request
|
|
|
|
{
|
2014-04-05 19:22:48 +04:00
|
|
|
DWORD dwProtocol;
|
|
|
|
/* [range] */ DWORD cbExtraBytes;
|
2015-06-30 18:42:01 +03:00
|
|
|
/* [size_is][unique] */ BYTE* pbExtraBytes;
|
2014-04-04 02:47:18 +04:00
|
|
|
} SCardIO_Request;
|
|
|
|
|
|
|
|
typedef struct _Transmit_Call
|
|
|
|
{
|
2014-04-12 00:27:01 +04:00
|
|
|
REDIR_SCARDCONTEXT hContext;
|
2014-04-04 02:47:18 +04:00
|
|
|
REDIR_SCARDHANDLE hCard;
|
2014-04-07 05:09:49 +04:00
|
|
|
LPSCARD_IO_REQUEST pioSendPci;
|
2014-04-05 19:22:48 +04:00
|
|
|
/* [range] */ DWORD cbSendLength;
|
2015-06-30 18:42:01 +03:00
|
|
|
/* [size_is] */ BYTE* pbSendBuffer;
|
2014-04-07 05:09:49 +04:00
|
|
|
/* [unique] */ LPSCARD_IO_REQUEST pioRecvPci;
|
2014-04-07 18:59:13 +04:00
|
|
|
LONG fpbRecvBufferIsNULL;
|
2014-04-05 19:22:48 +04:00
|
|
|
DWORD cbRecvLength;
|
2014-04-04 02:47:18 +04:00
|
|
|
} Transmit_Call;
|
|
|
|
|
|
|
|
typedef struct _Transmit_Return
|
|
|
|
{
|
2014-04-07 18:59:13 +04:00
|
|
|
LONG ReturnCode;
|
2014-04-07 07:08:40 +04:00
|
|
|
/* [unique] */ LPSCARD_IO_REQUEST pioRecvPci;
|
2014-04-05 19:22:48 +04:00
|
|
|
/* [range] */ DWORD cbRecvLength;
|
2015-06-30 18:42:01 +03:00
|
|
|
/* [size_is][unique] */ BYTE* pbRecvBuffer;
|
2014-04-04 02:47:18 +04:00
|
|
|
} Transmit_Return;
|
|
|
|
|
|
|
|
typedef struct _GetTransmitCount_Call
|
|
|
|
{
|
2014-04-12 00:27:01 +04:00
|
|
|
REDIR_SCARDCONTEXT hContext;
|
2014-04-04 02:47:18 +04:00
|
|
|
REDIR_SCARDHANDLE hCard;
|
|
|
|
} GetTransmitCount_Call;
|
|
|
|
|
|
|
|
typedef struct _GetTransmitCount_Return
|
|
|
|
{
|
2014-04-07 18:59:13 +04:00
|
|
|
LONG ReturnCode;
|
2014-04-05 19:22:48 +04:00
|
|
|
DWORD cTransmitCount;
|
2014-04-04 02:47:18 +04:00
|
|
|
} GetTransmitCount_Return;
|
|
|
|
|
|
|
|
typedef struct _Control_Call
|
|
|
|
{
|
2014-04-12 00:27:01 +04:00
|
|
|
REDIR_SCARDCONTEXT hContext;
|
2014-04-04 02:47:18 +04:00
|
|
|
REDIR_SCARDHANDLE hCard;
|
2014-04-05 19:22:48 +04:00
|
|
|
DWORD dwControlCode;
|
|
|
|
/* [range] */ DWORD cbInBufferSize;
|
2015-06-30 18:42:01 +03:00
|
|
|
/* [size_is][unique] */ BYTE* pvInBuffer;
|
2014-04-07 18:59:13 +04:00
|
|
|
LONG fpvOutBufferIsNULL;
|
2014-04-05 19:22:48 +04:00
|
|
|
DWORD cbOutBufferSize;
|
2014-04-04 02:47:18 +04:00
|
|
|
} Control_Call;
|
|
|
|
|
|
|
|
typedef struct _Control_Return
|
|
|
|
{
|
2014-04-07 18:59:13 +04:00
|
|
|
LONG ReturnCode;
|
2014-04-05 19:22:48 +04:00
|
|
|
/* [range] */ DWORD cbOutBufferSize;
|
2015-06-30 18:42:01 +03:00
|
|
|
/* [size_is][unique] */ BYTE* pvOutBuffer;
|
2014-04-04 02:47:18 +04:00
|
|
|
} Control_Return;
|
|
|
|
|
|
|
|
typedef struct _GetAttrib_Call
|
|
|
|
{
|
2014-04-12 00:27:01 +04:00
|
|
|
REDIR_SCARDCONTEXT hContext;
|
2014-04-04 02:47:18 +04:00
|
|
|
REDIR_SCARDHANDLE hCard;
|
2014-04-05 19:22:48 +04:00
|
|
|
DWORD dwAttrId;
|
2014-04-07 18:59:13 +04:00
|
|
|
LONG fpbAttrIsNULL;
|
2014-04-05 19:22:48 +04:00
|
|
|
DWORD cbAttrLen;
|
2014-04-04 02:47:18 +04:00
|
|
|
} GetAttrib_Call;
|
|
|
|
|
|
|
|
typedef struct _GetAttrib_Return
|
|
|
|
{
|
2014-04-07 18:59:13 +04:00
|
|
|
LONG ReturnCode;
|
2014-04-05 19:22:48 +04:00
|
|
|
/* [range] */ DWORD cbAttrLen;
|
2015-06-30 18:42:01 +03:00
|
|
|
/* [size_is][unique] */ BYTE* pbAttr;
|
2014-04-04 02:47:18 +04:00
|
|
|
} GetAttrib_Return;
|
|
|
|
|
|
|
|
typedef struct _SetAttrib_Call
|
|
|
|
{
|
2014-04-12 00:27:01 +04:00
|
|
|
REDIR_SCARDCONTEXT hContext;
|
2014-04-04 02:47:18 +04:00
|
|
|
REDIR_SCARDHANDLE hCard;
|
2014-04-05 19:22:48 +04:00
|
|
|
DWORD dwAttrId;
|
|
|
|
/* [range] */ DWORD cbAttrLen;
|
2015-06-30 18:42:01 +03:00
|
|
|
/* [size_is] */ BYTE* pbAttr;
|
2014-04-04 02:47:18 +04:00
|
|
|
} SetAttrib_Call;
|
|
|
|
|
|
|
|
typedef struct _ReadCache_Common
|
|
|
|
{
|
2014-04-12 01:44:27 +04:00
|
|
|
REDIR_SCARDCONTEXT hContext;
|
2015-06-30 18:42:01 +03:00
|
|
|
UUID* CardIdentifier;
|
2014-04-05 19:22:48 +04:00
|
|
|
DWORD FreshnessCounter;
|
2014-04-07 18:59:13 +04:00
|
|
|
LONG fPbDataIsNULL;
|
2014-04-05 19:22:48 +04:00
|
|
|
DWORD cbDataLen;
|
2014-04-04 02:47:18 +04:00
|
|
|
} ReadCache_Common;
|
|
|
|
|
|
|
|
typedef struct _ReadCacheA_Call
|
|
|
|
{
|
2015-06-30 18:42:01 +03:00
|
|
|
/* [string] */ unsigned char* szLookupName;
|
2014-04-04 02:47:18 +04:00
|
|
|
ReadCache_Common Common;
|
|
|
|
} ReadCacheA_Call;
|
|
|
|
|
|
|
|
typedef struct _ReadCacheW_Call
|
|
|
|
{
|
2015-06-30 18:42:01 +03:00
|
|
|
/* [string] */ WCHAR* szLookupName;
|
2014-04-04 02:47:18 +04:00
|
|
|
ReadCache_Common Common;
|
|
|
|
} ReadCacheW_Call;
|
|
|
|
|
|
|
|
typedef struct _ReadCache_Return
|
|
|
|
{
|
2014-04-07 18:59:13 +04:00
|
|
|
LONG ReturnCode;
|
2014-04-05 19:22:48 +04:00
|
|
|
/* [range] */ DWORD cbDataLen;
|
2015-06-30 18:42:01 +03:00
|
|
|
/* [size_is][unique] */ BYTE* pbData;
|
2014-04-04 02:47:18 +04:00
|
|
|
} ReadCache_Return;
|
|
|
|
|
|
|
|
typedef struct _WriteCache_Common
|
|
|
|
{
|
2014-04-12 01:44:27 +04:00
|
|
|
REDIR_SCARDCONTEXT hContext;
|
2015-06-30 18:42:01 +03:00
|
|
|
UUID* CardIdentifier;
|
2014-04-05 19:22:48 +04:00
|
|
|
DWORD FreshnessCounter;
|
|
|
|
/* [range] */ DWORD cbDataLen;
|
2015-06-30 18:42:01 +03:00
|
|
|
/* [size_is][unique] */ BYTE* pbData;
|
2014-04-04 02:47:18 +04:00
|
|
|
} WriteCache_Common;
|
|
|
|
|
|
|
|
typedef struct _WriteCacheA_Call
|
|
|
|
{
|
2015-06-30 18:42:01 +03:00
|
|
|
/* [string] */ unsigned char* szLookupName;
|
2014-04-04 02:47:18 +04:00
|
|
|
WriteCache_Common Common;
|
|
|
|
} WriteCacheA_Call;
|
|
|
|
|
|
|
|
typedef struct _WriteCacheW_Call
|
|
|
|
{
|
2015-06-30 18:42:01 +03:00
|
|
|
/* [string] */ WCHAR* szLookupName;
|
2014-04-04 02:47:18 +04:00
|
|
|
WriteCache_Common Common;
|
|
|
|
} WriteCacheW_Call;
|
|
|
|
|
2014-04-06 00:06:46 +04:00
|
|
|
#define SMARTCARD_COMMON_TYPE_HEADER_LENGTH 8
|
|
|
|
#define SMARTCARD_PRIVATE_TYPE_HEADER_LENGTH 8
|
|
|
|
|
2014-05-12 22:13:57 +04:00
|
|
|
#include "smartcard_main.h"
|
|
|
|
|
2015-06-30 18:42:01 +03:00
|
|
|
LONG smartcard_pack_write_size_align(SMARTCARD_DEVICE* smartcard, wStream* s, UINT32 size,
|
|
|
|
UINT32 alignment);
|
|
|
|
LONG smartcard_unpack_read_size_align(SMARTCARD_DEVICE* smartcard, wStream* s, UINT32 size,
|
|
|
|
UINT32 alignment);
|
2014-04-08 19:32:48 +04:00
|
|
|
|
2015-06-30 18:42:01 +03:00
|
|
|
SCARDCONTEXT smartcard_scard_context_native_from_redir(SMARTCARD_DEVICE* smartcard,
|
|
|
|
REDIR_SCARDCONTEXT* context);
|
|
|
|
void smartcard_scard_context_native_to_redir(SMARTCARD_DEVICE* smartcard,
|
|
|
|
REDIR_SCARDCONTEXT* context, SCARDCONTEXT hContext);
|
2014-04-11 22:01:42 +04:00
|
|
|
|
2015-06-30 18:42:01 +03:00
|
|
|
SCARDHANDLE smartcard_scard_handle_native_from_redir(SMARTCARD_DEVICE* smartcard,
|
|
|
|
REDIR_SCARDHANDLE* handle);
|
|
|
|
void smartcard_scard_handle_native_to_redir(SMARTCARD_DEVICE* smartcard, REDIR_SCARDHANDLE* handle,
|
|
|
|
SCARDHANDLE hCard);
|
2014-04-11 22:01:42 +04:00
|
|
|
|
2015-07-03 14:09:03 +03:00
|
|
|
LONG smartcard_unpack_common_type_header(SMARTCARD_DEVICE* smartcard, wStream* s);
|
2017-12-14 18:21:19 +03:00
|
|
|
void smartcard_pack_common_type_header(SMARTCARD_DEVICE* smartcard, wStream* s);
|
2014-04-06 00:06:46 +04:00
|
|
|
|
2015-07-03 14:09:03 +03:00
|
|
|
LONG smartcard_unpack_private_type_header(SMARTCARD_DEVICE* smartcard, wStream* s);
|
2017-12-14 18:21:19 +03:00
|
|
|
void smartcard_pack_private_type_header(SMARTCARD_DEVICE* smartcard, wStream* s,
|
2015-06-30 18:42:01 +03:00
|
|
|
UINT32 objectBufferLength);
|
|
|
|
|
|
|
|
LONG smartcard_unpack_redir_scard_context(SMARTCARD_DEVICE* smartcard, wStream* s,
|
|
|
|
REDIR_SCARDCONTEXT* context);
|
|
|
|
LONG smartcard_pack_redir_scard_context(SMARTCARD_DEVICE* smartcard, wStream* s,
|
|
|
|
REDIR_SCARDCONTEXT* context);
|
|
|
|
|
|
|
|
LONG smartcard_unpack_redir_scard_context_ref(SMARTCARD_DEVICE* smartcard, wStream* s,
|
|
|
|
REDIR_SCARDCONTEXT* context);
|
|
|
|
LONG smartcard_pack_redir_scard_context_ref(SMARTCARD_DEVICE* smartcard, wStream* s,
|
|
|
|
REDIR_SCARDCONTEXT* context);
|
|
|
|
|
|
|
|
LONG smartcard_unpack_redir_scard_handle(SMARTCARD_DEVICE* smartcard, wStream* s,
|
|
|
|
REDIR_SCARDHANDLE* handle);
|
|
|
|
LONG smartcard_pack_redir_scard_handle(SMARTCARD_DEVICE* smartcard, wStream* s,
|
|
|
|
REDIR_SCARDHANDLE* handle);
|
|
|
|
|
|
|
|
LONG smartcard_unpack_redir_scard_handle_ref(SMARTCARD_DEVICE* smartcard, wStream* s,
|
|
|
|
REDIR_SCARDHANDLE* handle);
|
|
|
|
LONG smartcard_pack_redir_scard_handle_ref(SMARTCARD_DEVICE* smartcard, wStream* s,
|
|
|
|
REDIR_SCARDHANDLE* handle);
|
|
|
|
|
|
|
|
LONG smartcard_unpack_establish_context_call(SMARTCARD_DEVICE* smartcard, wStream* s,
|
|
|
|
EstablishContext_Call* call);
|
|
|
|
void smartcard_trace_establish_context_call(SMARTCARD_DEVICE* smartcard,
|
|
|
|
EstablishContext_Call* call);
|
|
|
|
|
|
|
|
LONG smartcard_pack_establish_context_return(SMARTCARD_DEVICE* smartcard, wStream* s,
|
|
|
|
EstablishContext_Return* ret);
|
|
|
|
void smartcard_trace_establish_context_return(SMARTCARD_DEVICE* smartcard,
|
|
|
|
EstablishContext_Return* ret);
|
2014-04-06 00:06:46 +04:00
|
|
|
|
2015-07-03 14:09:03 +03:00
|
|
|
LONG smartcard_unpack_context_call(SMARTCARD_DEVICE* smartcard, wStream* s, Context_Call* call);
|
2015-06-30 18:42:01 +03:00
|
|
|
void smartcard_trace_context_call(SMARTCARD_DEVICE* smartcard, Context_Call* call,
|
|
|
|
const char* name);
|
2014-04-07 05:09:49 +04:00
|
|
|
|
2014-05-06 21:00:44 +04:00
|
|
|
void smartcard_trace_long_return(SMARTCARD_DEVICE* smartcard, Long_Return* ret, const char* name);
|
|
|
|
|
2015-06-30 18:42:01 +03:00
|
|
|
LONG smartcard_unpack_list_reader_groups_call(SMARTCARD_DEVICE* smartcard, wStream* s,
|
|
|
|
ListReaderGroups_Call* call);
|
|
|
|
void smartcard_trace_list_reader_groups_call(SMARTCARD_DEVICE* smartcard,
|
|
|
|
ListReaderGroups_Call* call, BOOL unicode);
|
|
|
|
|
|
|
|
LONG smartcard_pack_list_reader_groups_return(SMARTCARD_DEVICE* smartcard, wStream* s,
|
|
|
|
ListReaderGroups_Return* ret);
|
|
|
|
void smartcard_trace_list_reader_groups_return(SMARTCARD_DEVICE* smartcard,
|
|
|
|
ListReaderGroups_Return* ret, BOOL unicode);
|
|
|
|
|
|
|
|
LONG smartcard_unpack_list_readers_call(SMARTCARD_DEVICE* smartcard, wStream* s,
|
|
|
|
ListReaders_Call* call);
|
|
|
|
void smartcard_trace_list_readers_call(SMARTCARD_DEVICE* smartcard, ListReaders_Call* call,
|
|
|
|
BOOL unicode);
|
2014-04-11 10:17:36 +04:00
|
|
|
|
2015-06-30 18:42:01 +03:00
|
|
|
LONG smartcard_pack_list_readers_return(SMARTCARD_DEVICE* smartcard, wStream* s,
|
|
|
|
ListReaders_Return* ret);
|
|
|
|
void smartcard_trace_list_readers_return(SMARTCARD_DEVICE* smartcard, ListReaders_Return* ret,
|
|
|
|
BOOL unicode);
|
2014-04-04 21:57:28 +04:00
|
|
|
|
2015-07-03 14:09:03 +03:00
|
|
|
LONG smartcard_unpack_connect_a_call(SMARTCARD_DEVICE* smartcard, wStream* s, ConnectA_Call* call);
|
2014-04-11 10:17:36 +04:00
|
|
|
void smartcard_trace_connect_a_call(SMARTCARD_DEVICE* smartcard, ConnectA_Call* call);
|
|
|
|
|
2015-07-03 14:09:03 +03:00
|
|
|
LONG smartcard_unpack_connect_w_call(SMARTCARD_DEVICE* smartcard, wStream* s, ConnectW_Call* call);
|
2014-04-11 10:17:36 +04:00
|
|
|
void smartcard_trace_connect_w_call(SMARTCARD_DEVICE* smartcard, ConnectW_Call* call);
|
2014-04-06 00:06:46 +04:00
|
|
|
|
2015-07-03 14:09:03 +03:00
|
|
|
LONG smartcard_pack_connect_return(SMARTCARD_DEVICE* smartcard, wStream* s, Connect_Return* ret);
|
2014-04-11 10:17:36 +04:00
|
|
|
void smartcard_trace_connect_return(SMARTCARD_DEVICE* smartcard, Connect_Return* ret);
|
2014-04-07 07:08:40 +04:00
|
|
|
|
2015-07-03 14:09:03 +03:00
|
|
|
LONG smartcard_unpack_reconnect_call(SMARTCARD_DEVICE* smartcard, wStream* s, Reconnect_Call* call);
|
2014-04-14 00:48:32 +04:00
|
|
|
void smartcard_trace_reconnect_call(SMARTCARD_DEVICE* smartcard, Reconnect_Call* call);
|
|
|
|
|
2015-06-30 18:42:01 +03:00
|
|
|
LONG smartcard_pack_reconnect_return(SMARTCARD_DEVICE* smartcard, wStream* s,
|
|
|
|
Reconnect_Return* ret);
|
2014-04-14 00:48:32 +04:00
|
|
|
void smartcard_trace_reconnect_return(SMARTCARD_DEVICE* smartcard, Reconnect_Return* ret);
|
2014-04-07 00:29:11 +04:00
|
|
|
|
2015-06-30 18:42:01 +03:00
|
|
|
LONG smartcard_unpack_hcard_and_disposition_call(SMARTCARD_DEVICE* smartcard, wStream* s,
|
|
|
|
HCardAndDisposition_Call* call);
|
|
|
|
void smartcard_trace_hcard_and_disposition_call(SMARTCARD_DEVICE* smartcard,
|
|
|
|
HCardAndDisposition_Call* call, const char* name);
|
2014-04-07 00:29:11 +04:00
|
|
|
|
2015-06-30 18:42:01 +03:00
|
|
|
LONG smartcard_unpack_get_status_change_a_call(SMARTCARD_DEVICE* smartcard, wStream* s,
|
|
|
|
GetStatusChangeA_Call* call);
|
|
|
|
void smartcard_trace_get_status_change_a_call(SMARTCARD_DEVICE* smartcard,
|
|
|
|
GetStatusChangeA_Call* call);
|
2014-04-11 10:17:36 +04:00
|
|
|
|
2015-06-30 18:42:01 +03:00
|
|
|
LONG smartcard_unpack_get_status_change_w_call(SMARTCARD_DEVICE* smartcard, wStream* s,
|
|
|
|
GetStatusChangeW_Call* call);
|
|
|
|
void smartcard_trace_get_status_change_w_call(SMARTCARD_DEVICE* smartcard,
|
|
|
|
GetStatusChangeW_Call* call);
|
2014-04-11 10:17:36 +04:00
|
|
|
|
2015-06-30 18:42:01 +03:00
|
|
|
LONG smartcard_pack_get_status_change_return(SMARTCARD_DEVICE* smartcard, wStream* s,
|
|
|
|
GetStatusChange_Return* ret);
|
|
|
|
void smartcard_trace_get_status_change_return(SMARTCARD_DEVICE* smartcard,
|
|
|
|
GetStatusChange_Return* ret, BOOL unicode);
|
2014-04-07 00:29:11 +04:00
|
|
|
|
2015-07-03 14:09:03 +03:00
|
|
|
LONG smartcard_unpack_state_call(SMARTCARD_DEVICE* smartcard, wStream* s, State_Call* call);
|
|
|
|
LONG smartcard_pack_state_return(SMARTCARD_DEVICE* smartcard, wStream* s, State_Return* ret);
|
2014-04-07 05:09:49 +04:00
|
|
|
|
2015-07-03 14:09:03 +03:00
|
|
|
LONG smartcard_unpack_status_call(SMARTCARD_DEVICE* smartcard, wStream* s, Status_Call* call);
|
2014-04-11 22:01:42 +04:00
|
|
|
void smartcard_trace_status_call(SMARTCARD_DEVICE* smartcard, Status_Call* call, BOOL unicode);
|
|
|
|
|
2015-07-03 14:09:03 +03:00
|
|
|
LONG smartcard_pack_status_return(SMARTCARD_DEVICE* smartcard, wStream* s, Status_Return* ret);
|
2014-04-11 22:01:42 +04:00
|
|
|
void smartcard_trace_status_return(SMARTCARD_DEVICE* smartcard, Status_Return* ret, BOOL unicode);
|
2014-04-07 05:09:49 +04:00
|
|
|
|
2015-06-30 18:42:01 +03:00
|
|
|
LONG smartcard_unpack_get_attrib_call(SMARTCARD_DEVICE* smartcard, wStream* s,
|
|
|
|
GetAttrib_Call* call);
|
2014-04-11 22:01:42 +04:00
|
|
|
void smartcard_trace_get_attrib_call(SMARTCARD_DEVICE* smartcard, GetAttrib_Call* call);
|
|
|
|
|
2015-06-30 18:42:01 +03:00
|
|
|
LONG smartcard_pack_get_attrib_return(SMARTCARD_DEVICE* smartcard, wStream* s,
|
|
|
|
GetAttrib_Return* ret);
|
|
|
|
void smartcard_trace_get_attrib_return(SMARTCARD_DEVICE* smartcard, GetAttrib_Return* ret,
|
|
|
|
DWORD dwAttrId);
|
2014-04-07 05:09:49 +04:00
|
|
|
|
2015-07-03 14:09:03 +03:00
|
|
|
LONG smartcard_unpack_control_call(SMARTCARD_DEVICE* smartcard, wStream* s, Control_Call* call);
|
2014-04-14 00:48:32 +04:00
|
|
|
void smartcard_trace_control_call(SMARTCARD_DEVICE* smartcard, Control_Call* call);
|
|
|
|
|
2015-07-03 14:09:03 +03:00
|
|
|
LONG smartcard_pack_control_return(SMARTCARD_DEVICE* smartcard, wStream* s, Control_Return* ret);
|
2014-04-14 00:48:32 +04:00
|
|
|
void smartcard_trace_control_return(SMARTCARD_DEVICE* smartcard, Control_Return* ret);
|
2014-04-07 05:09:49 +04:00
|
|
|
|
2015-07-03 14:09:03 +03:00
|
|
|
LONG smartcard_unpack_transmit_call(SMARTCARD_DEVICE* smartcard, wStream* s, Transmit_Call* call);
|
2014-04-13 23:50:51 +04:00
|
|
|
void smartcard_trace_transmit_call(SMARTCARD_DEVICE* smartcard, Transmit_Call* call);
|
|
|
|
|
2015-07-03 14:09:03 +03:00
|
|
|
LONG smartcard_pack_transmit_return(SMARTCARD_DEVICE* smartcard, wStream* s, Transmit_Return* ret);
|
2014-04-13 23:50:51 +04:00
|
|
|
void smartcard_trace_transmit_return(SMARTCARD_DEVICE* smartcard, Transmit_Return* ret);
|
2014-04-07 05:09:49 +04:00
|
|
|
|
2015-06-30 18:42:01 +03:00
|
|
|
LONG smartcard_unpack_locate_cards_by_atr_a_call(SMARTCARD_DEVICE* smartcard, wStream* s,
|
|
|
|
LocateCardsByATRA_Call* call);
|
|
|
|
void smartcard_trace_locate_cards_by_atr_a_call(SMARTCARD_DEVICE* smartcard,
|
|
|
|
LocateCardsByATRA_Call* call);
|
2014-11-10 00:42:35 +03:00
|
|
|
|
|
|
|
|
2014-04-04 02:47:18 +04:00
|
|
|
#endif /* FREERDP_CHANNEL_SMARTCARD_CLIENT_PACK_H */
|