FreeRDP
smartcard_operations.c File Reference
#include <assert.h>
#include <winpr/crt.h>
#include <winpr/print.h>
#include <winpr/stream.h>
#include <winpr/smartcard.h>
#include <freerdp/freerdp.h>
#include <freerdp/channels/rdpdr.h>
#include "smartcard_main.h"

Functions

const char * smartcard_get_ioctl_string (UINT32 ioControlCode, BOOL funcName)
 
static LONG smartcard_EstablishContext_Decode (SMARTCARD_DEVICE *smartcard, SMARTCARD_OPERATION *operation)
 
static LONG smartcard_EstablishContext_Call (SMARTCARD_DEVICE *smartcard, SMARTCARD_OPERATION *operation)
 
static LONG smartcard_ReleaseContext_Decode (SMARTCARD_DEVICE *smartcard, SMARTCARD_OPERATION *operation)
 
static LONG smartcard_ReleaseContext_Call (SMARTCARD_DEVICE *smartcard, SMARTCARD_OPERATION *operation)
 
static LONG smartcard_IsValidContext_Decode (SMARTCARD_DEVICE *smartcard, SMARTCARD_OPERATION *operation)
 
static LONG smartcard_IsValidContext_Call (SMARTCARD_DEVICE *smartcard, SMARTCARD_OPERATION *operation)
 
static LONG smartcard_ListReaderGroupsA_Decode (SMARTCARD_DEVICE *smartcard, SMARTCARD_OPERATION *operation)
 
static LONG smartcard_ListReaderGroupsA_Call (SMARTCARD_DEVICE *smartcard, SMARTCARD_OPERATION *operation)
 
static LONG smartcard_ListReaderGroupsW_Decode (SMARTCARD_DEVICE *smartcard, SMARTCARD_OPERATION *operation)
 
static LONG smartcard_ListReaderGroupsW_Call (SMARTCARD_DEVICE *smartcard, SMARTCARD_OPERATION *operation)
 
static BOOL filter_match (wLinkedList *list, LPCSTR reader, size_t readerLen)
 
static DWORD filter_device_by_name_a (wLinkedList *list, LPSTR *mszReaders, DWORD cchReaders)
 
static DWORD filter_device_by_name_w (wLinkedList *list, LPWSTR *mszReaders, DWORD cchReaders)
 
static LONG smartcard_ListReadersA_Decode (SMARTCARD_DEVICE *smartcard, SMARTCARD_OPERATION *operation)
 
static LONG smartcard_ListReadersA_Call (SMARTCARD_DEVICE *smartcard, SMARTCARD_OPERATION *operation)
 
static LONG smartcard_ListReadersW_Decode (SMARTCARD_DEVICE *smartcard, SMARTCARD_OPERATION *operation)
 
static LONG smartcard_ListReadersW_Call (SMARTCARD_DEVICE *smartcard, SMARTCARD_OPERATION *operation)
 
static LONG smartcard_GetStatusChangeA_Decode (SMARTCARD_DEVICE *smartcard, SMARTCARD_OPERATION *operation)
 
static LONG smartcard_GetStatusChangeA_Call (SMARTCARD_DEVICE *smartcard, SMARTCARD_OPERATION *operation)
 
static LONG smartcard_GetStatusChangeW_Decode (SMARTCARD_DEVICE *smartcard, SMARTCARD_OPERATION *operation)
 
static LONG smartcard_GetStatusChangeW_Call (SMARTCARD_DEVICE *smartcard, SMARTCARD_OPERATION *operation)
 
static LONG smartcard_Cancel_Decode (SMARTCARD_DEVICE *smartcard, SMARTCARD_OPERATION *operation)
 
static LONG smartcard_Cancel_Call (SMARTCARD_DEVICE *smartcard, SMARTCARD_OPERATION *operation)
 
static LONG smartcard_ConnectA_Decode (SMARTCARD_DEVICE *smartcard, SMARTCARD_OPERATION *operation)
 
static LONG smartcard_ConnectA_Call (SMARTCARD_DEVICE *smartcard, SMARTCARD_OPERATION *operation)
 
static LONG smartcard_ConnectW_Decode (SMARTCARD_DEVICE *smartcard, SMARTCARD_OPERATION *operation)
 
static LONG smartcard_ConnectW_Call (SMARTCARD_DEVICE *smartcard, SMARTCARD_OPERATION *operation)
 
static LONG smartcard_Reconnect_Decode (SMARTCARD_DEVICE *smartcard, SMARTCARD_OPERATION *operation)
 
static LONG smartcard_Reconnect_Call (SMARTCARD_DEVICE *smartcard, SMARTCARD_OPERATION *operation)
 
static LONG smartcard_Disconnect_Decode (SMARTCARD_DEVICE *smartcard, SMARTCARD_OPERATION *operation)
 
static LONG smartcard_Disconnect_Call (SMARTCARD_DEVICE *smartcard, SMARTCARD_OPERATION *operation)
 
static LONG smartcard_BeginTransaction_Decode (SMARTCARD_DEVICE *smartcard, SMARTCARD_OPERATION *operation)
 
static LONG smartcard_BeginTransaction_Call (SMARTCARD_DEVICE *smartcard, SMARTCARD_OPERATION *operation)
 
static LONG smartcard_EndTransaction_Decode (SMARTCARD_DEVICE *smartcard, SMARTCARD_OPERATION *operation)
 
static LONG smartcard_EndTransaction_Call (SMARTCARD_DEVICE *smartcard, SMARTCARD_OPERATION *operation)
 
static LONG smartcard_State_Decode (SMARTCARD_DEVICE *smartcard, SMARTCARD_OPERATION *operation)
 
static LONG smartcard_State_Call (SMARTCARD_DEVICE *smartcard, SMARTCARD_OPERATION *operation)
 
static LONG smartcard_StatusA_Decode (SMARTCARD_DEVICE *smartcard, SMARTCARD_OPERATION *operation)
 
static LONG smartcard_StatusA_Call (SMARTCARD_DEVICE *smartcard, SMARTCARD_OPERATION *operation)
 
static LONG smartcard_StatusW_Decode (SMARTCARD_DEVICE *smartcard, SMARTCARD_OPERATION *operation)
 
static LONG smartcard_StatusW_Call (SMARTCARD_DEVICE *smartcard, SMARTCARD_OPERATION *operation)
 
static LONG smartcard_Transmit_Decode (SMARTCARD_DEVICE *smartcard, SMARTCARD_OPERATION *operation)
 
static LONG smartcard_Transmit_Call (SMARTCARD_DEVICE *smartcard, SMARTCARD_OPERATION *operation)
 
static LONG smartcard_Control_Decode (SMARTCARD_DEVICE *smartcard, SMARTCARD_OPERATION *operation)
 
static LONG smartcard_Control_Call (SMARTCARD_DEVICE *smartcard, SMARTCARD_OPERATION *operation)
 
static LONG smartcard_GetAttrib_Decode (SMARTCARD_DEVICE *smartcard, SMARTCARD_OPERATION *operation)
 
static LONG smartcard_GetAttrib_Call (SMARTCARD_DEVICE *smartcard, SMARTCARD_OPERATION *operation)
 
static LONG smartcard_AccessStartedEvent_Decode (SMARTCARD_DEVICE *smartcard, SMARTCARD_OPERATION *operation)
 
static LONG smartcard_AccessStartedEvent_Call (SMARTCARD_DEVICE *smartcard, SMARTCARD_OPERATION *operation)
 
static LONG smartcard_LocateCardsByATRA_Decode (SMARTCARD_DEVICE *smartcard, SMARTCARD_OPERATION *operation)
 
static LONG smartcard_LocateCardsByATRA_Call (SMARTCARD_DEVICE *smartcard, SMARTCARD_OPERATION *operation)
 
LONG smartcard_irp_device_control_decode (SMARTCARD_DEVICE *smartcard, SMARTCARD_OPERATION *operation)
 
LONG smartcard_irp_device_control_call (SMARTCARD_DEVICE *smartcard, SMARTCARD_OPERATION *operation)
 

Function Documentation

static DWORD filter_device_by_name_a ( wLinkedList *  list,
LPSTR *  mszReaders,
DWORD  cchReaders 
)
static

Here is the call graph for this function:

Here is the caller graph for this function:

static DWORD filter_device_by_name_w ( wLinkedList *  list,
LPWSTR *  mszReaders,
DWORD  cchReaders 
)
static

Here is the call graph for this function:

Here is the caller graph for this function:

static BOOL filter_match ( wLinkedList *  list,
LPCSTR  reader,
size_t  readerLen 
)
static

Here is the call graph for this function:

Here is the caller graph for this function:

static LONG smartcard_AccessStartedEvent_Call ( SMARTCARD_DEVICE *  smartcard,
SMARTCARD_OPERATION *  operation 
)
static

Here is the call graph for this function:

Here is the caller graph for this function:

static LONG smartcard_AccessStartedEvent_Decode ( SMARTCARD_DEVICE *  smartcard,
SMARTCARD_OPERATION *  operation 
)
static

Here is the call graph for this function:

Here is the caller graph for this function:

static LONG smartcard_BeginTransaction_Call ( SMARTCARD_DEVICE *  smartcard,
SMARTCARD_OPERATION *  operation 
)
static

Here is the call graph for this function:

Here is the caller graph for this function:

static LONG smartcard_BeginTransaction_Decode ( SMARTCARD_DEVICE *  smartcard,
SMARTCARD_OPERATION *  operation 
)
static

Here is the call graph for this function:

Here is the caller graph for this function:

static LONG smartcard_Cancel_Call ( SMARTCARD_DEVICE *  smartcard,
SMARTCARD_OPERATION *  operation 
)
static

Here is the call graph for this function:

Here is the caller graph for this function:

static LONG smartcard_Cancel_Decode ( SMARTCARD_DEVICE *  smartcard,
SMARTCARD_OPERATION *  operation 
)
static

Here is the call graph for this function:

Here is the caller graph for this function:

static LONG smartcard_ConnectA_Call ( SMARTCARD_DEVICE *  smartcard,
SMARTCARD_OPERATION *  operation 
)
static

Here is the call graph for this function:

Here is the caller graph for this function:

static LONG smartcard_ConnectA_Decode ( SMARTCARD_DEVICE *  smartcard,
SMARTCARD_OPERATION *  operation 
)
static

Here is the call graph for this function:

Here is the caller graph for this function:

static LONG smartcard_ConnectW_Call ( SMARTCARD_DEVICE *  smartcard,
SMARTCARD_OPERATION *  operation 
)
static

Here is the call graph for this function:

Here is the caller graph for this function:

static LONG smartcard_ConnectW_Decode ( SMARTCARD_DEVICE *  smartcard,
SMARTCARD_OPERATION *  operation 
)
static

Here is the call graph for this function:

Here is the caller graph for this function:

static LONG smartcard_Control_Call ( SMARTCARD_DEVICE *  smartcard,
SMARTCARD_OPERATION *  operation 
)
static

Here is the call graph for this function:

Here is the caller graph for this function:

static LONG smartcard_Control_Decode ( SMARTCARD_DEVICE *  smartcard,
SMARTCARD_OPERATION *  operation 
)
static

Here is the call graph for this function:

Here is the caller graph for this function:

static LONG smartcard_Disconnect_Call ( SMARTCARD_DEVICE *  smartcard,
SMARTCARD_OPERATION *  operation 
)
static

Here is the call graph for this function:

Here is the caller graph for this function:

static LONG smartcard_Disconnect_Decode ( SMARTCARD_DEVICE *  smartcard,
SMARTCARD_OPERATION *  operation 
)
static

Here is the call graph for this function:

Here is the caller graph for this function:

static LONG smartcard_EndTransaction_Call ( SMARTCARD_DEVICE *  smartcard,
SMARTCARD_OPERATION *  operation 
)
static

Here is the call graph for this function:

Here is the caller graph for this function:

static LONG smartcard_EndTransaction_Decode ( SMARTCARD_DEVICE *  smartcard,
SMARTCARD_OPERATION *  operation 
)
static

Here is the call graph for this function:

Here is the caller graph for this function:

static LONG smartcard_EstablishContext_Call ( SMARTCARD_DEVICE *  smartcard,
SMARTCARD_OPERATION *  operation 
)
static

Here is the call graph for this function:

Here is the caller graph for this function:

static LONG smartcard_EstablishContext_Decode ( SMARTCARD_DEVICE *  smartcard,
SMARTCARD_OPERATION *  operation 
)
static

Here is the call graph for this function:

Here is the caller graph for this function:

const char* smartcard_get_ioctl_string ( UINT32  ioControlCode,
BOOL  funcName 
)

FreeRDP: A Remote Desktop Protocol Implementation Smartcard Device Service Virtual Channel

Copyright (C) Alexi Volkov alexi.nosp@m.@myr.nosp@m.ealbo.nosp@m.x.co.nosp@m.m 2006 Copyright 2011 O.S. Systems Software Ltda. Copyright 2011 Anthony Tong atong.nosp@m.@tru.nosp@m.stedc.nosp@m.s.co.nosp@m.m Copyright 2015 Thincast Technologies GmbH Copyright 2015 DI (FH) Martin Haimberger marti.nosp@m.n.ha.nosp@m.imber.nosp@m.ger@.nosp@m.thinc.nosp@m.ast..nosp@m.com Copyright 2017 Armin Novak armin.nosp@m..nov.nosp@m.ak@th.nosp@m.inca.nosp@m.st.co.nosp@m.m Copyright 2017 Thincast Technologies GmbH

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.

Here is the caller graph for this function:

static LONG smartcard_GetAttrib_Call ( SMARTCARD_DEVICE *  smartcard,
SMARTCARD_OPERATION *  operation 
)
static

Here is the call graph for this function:

Here is the caller graph for this function:

static LONG smartcard_GetAttrib_Decode ( SMARTCARD_DEVICE *  smartcard,
SMARTCARD_OPERATION *  operation 
)
static

Here is the call graph for this function:

Here is the caller graph for this function:

static LONG smartcard_GetStatusChangeA_Call ( SMARTCARD_DEVICE *  smartcard,
SMARTCARD_OPERATION *  operation 
)
static

Here is the call graph for this function:

Here is the caller graph for this function:

static LONG smartcard_GetStatusChangeA_Decode ( SMARTCARD_DEVICE *  smartcard,
SMARTCARD_OPERATION *  operation 
)
static

Here is the call graph for this function:

Here is the caller graph for this function:

static LONG smartcard_GetStatusChangeW_Call ( SMARTCARD_DEVICE *  smartcard,
SMARTCARD_OPERATION *  operation 
)
static

Here is the call graph for this function:

Here is the caller graph for this function:

static LONG smartcard_GetStatusChangeW_Decode ( SMARTCARD_DEVICE *  smartcard,
SMARTCARD_OPERATION *  operation 
)
static

Here is the call graph for this function:

Here is the caller graph for this function:

LONG smartcard_irp_device_control_call ( SMARTCARD_DEVICE *  smartcard,
SMARTCARD_OPERATION *  operation 
)

[MS-RDPESC] 3.2.5.1: Sending Outgoing Messages: the output buffer length SHOULD be set to 2048

Since it's a SHOULD and not a MUST, we don't care about it, but we still reserve at least 2048 bytes.

[MS-RPCE] 2.2.6.3 Primitive Type Serialization The type MUST be aligned on an 8-byte boundary. If the size of the primitive type is not a multiple of 8 bytes, the data MUST be padded.

Here is the call graph for this function:

Here is the caller graph for this function:

LONG smartcard_irp_device_control_decode ( SMARTCARD_DEVICE *  smartcard,
SMARTCARD_OPERATION *  operation 
)

Here is the call graph for this function:

Here is the caller graph for this function:

static LONG smartcard_IsValidContext_Call ( SMARTCARD_DEVICE *  smartcard,
SMARTCARD_OPERATION *  operation 
)
static

Here is the call graph for this function:

Here is the caller graph for this function:

static LONG smartcard_IsValidContext_Decode ( SMARTCARD_DEVICE *  smartcard,
SMARTCARD_OPERATION *  operation 
)
static

Here is the call graph for this function:

Here is the caller graph for this function:

static LONG smartcard_ListReaderGroupsA_Call ( SMARTCARD_DEVICE *  smartcard,
SMARTCARD_OPERATION *  operation 
)
static

Here is the call graph for this function:

Here is the caller graph for this function:

static LONG smartcard_ListReaderGroupsA_Decode ( SMARTCARD_DEVICE *  smartcard,
SMARTCARD_OPERATION *  operation 
)
static

Here is the call graph for this function:

Here is the caller graph for this function:

static LONG smartcard_ListReaderGroupsW_Call ( SMARTCARD_DEVICE *  smartcard,
SMARTCARD_OPERATION *  operation 
)
static

Here is the call graph for this function:

Here is the caller graph for this function:

static LONG smartcard_ListReaderGroupsW_Decode ( SMARTCARD_DEVICE *  smartcard,
SMARTCARD_OPERATION *  operation 
)
static

Here is the call graph for this function:

Here is the caller graph for this function:

static LONG smartcard_ListReadersA_Call ( SMARTCARD_DEVICE *  smartcard,
SMARTCARD_OPERATION *  operation 
)
static

Here is the call graph for this function:

Here is the caller graph for this function:

static LONG smartcard_ListReadersA_Decode ( SMARTCARD_DEVICE *  smartcard,
SMARTCARD_OPERATION *  operation 
)
static

Here is the call graph for this function:

Here is the caller graph for this function:

static LONG smartcard_ListReadersW_Call ( SMARTCARD_DEVICE *  smartcard,
SMARTCARD_OPERATION *  operation 
)
static

Here is the call graph for this function:

Here is the caller graph for this function:

static LONG smartcard_ListReadersW_Decode ( SMARTCARD_DEVICE *  smartcard,
SMARTCARD_OPERATION *  operation 
)
static

Here is the call graph for this function:

Here is the caller graph for this function:

static LONG smartcard_LocateCardsByATRA_Call ( SMARTCARD_DEVICE *  smartcard,
SMARTCARD_OPERATION *  operation 
)
static

Here is the call graph for this function:

Here is the caller graph for this function:

static LONG smartcard_LocateCardsByATRA_Decode ( SMARTCARD_DEVICE *  smartcard,
SMARTCARD_OPERATION *  operation 
)
static

Here is the call graph for this function:

Here is the caller graph for this function:

static LONG smartcard_Reconnect_Call ( SMARTCARD_DEVICE *  smartcard,
SMARTCARD_OPERATION *  operation 
)
static

Here is the call graph for this function:

Here is the caller graph for this function:

static LONG smartcard_Reconnect_Decode ( SMARTCARD_DEVICE *  smartcard,
SMARTCARD_OPERATION *  operation 
)
static

Here is the call graph for this function:

Here is the caller graph for this function:

static LONG smartcard_ReleaseContext_Call ( SMARTCARD_DEVICE *  smartcard,
SMARTCARD_OPERATION *  operation 
)
static

Here is the call graph for this function:

Here is the caller graph for this function:

static LONG smartcard_ReleaseContext_Decode ( SMARTCARD_DEVICE *  smartcard,
SMARTCARD_OPERATION *  operation 
)
static

Here is the call graph for this function:

Here is the caller graph for this function:

static LONG smartcard_State_Call ( SMARTCARD_DEVICE *  smartcard,
SMARTCARD_OPERATION *  operation 
)
static

Here is the call graph for this function:

Here is the caller graph for this function:

static LONG smartcard_State_Decode ( SMARTCARD_DEVICE *  smartcard,
SMARTCARD_OPERATION *  operation 
)
static

Here is the call graph for this function:

Here is the caller graph for this function:

static LONG smartcard_StatusA_Call ( SMARTCARD_DEVICE *  smartcard,
SMARTCARD_OPERATION *  operation 
)
static

Here is the call graph for this function:

Here is the caller graph for this function:

static LONG smartcard_StatusA_Decode ( SMARTCARD_DEVICE *  smartcard,
SMARTCARD_OPERATION *  operation 
)
static

Here is the call graph for this function:

Here is the caller graph for this function:

static LONG smartcard_StatusW_Call ( SMARTCARD_DEVICE *  smartcard,
SMARTCARD_OPERATION *  operation 
)
static

Here is the call graph for this function:

Here is the caller graph for this function:

static LONG smartcard_StatusW_Decode ( SMARTCARD_DEVICE *  smartcard,
SMARTCARD_OPERATION *  operation 
)
static

Here is the call graph for this function:

Here is the caller graph for this function:

static LONG smartcard_Transmit_Call ( SMARTCARD_DEVICE *  smartcard,
SMARTCARD_OPERATION *  operation 
)
static

Here is the call graph for this function:

Here is the caller graph for this function:

static LONG smartcard_Transmit_Decode ( SMARTCARD_DEVICE *  smartcard,
SMARTCARD_OPERATION *  operation 
)
static

Here is the call graph for this function:

Here is the caller graph for this function: