FreeRDP
libfreerdp/core/client.c File Reference
#include <freerdp/config.h>
#include "settings.h"
#include <winpr/assert.h>
#include <freerdp/log.h>
#include <freerdp/channels/drdynvc.h>
#include "rdp.h"
#include "client.h"

Macros

#define TAG   FREERDP_TAG("core.client")
 

Functions

static BOOL freerdp_channels_process_message_free (wMessage *message, DWORD type)
 
static CHANNEL_OPEN_DATAfreerdp_channels_find_channel_open_data_by_name (rdpChannels *channels, const char *name)
 
static rdpMcsChannel * freerdp_channels_find_channel_by_name (rdpRdp *rdp, const char *name)
 
static rdpMcsChannel * freerdp_channels_find_channel_by_id (rdpRdp *rdp, UINT16 channel_id)
 
static void channel_queue_message_free (wMessage *msg)
 
static void channel_queue_free (void *obj)
 
static BOOL CALLBACK init_channel_handles_table (PINIT_ONCE once, PVOID param, PVOID *context)
 
rdpChannels * freerdp_channels_new (freerdp *instance)
 
void freerdp_channels_free (rdpChannels *channels)
 
static UINT freerdp_drdynvc_on_channel_connected (DrdynvcClientContext *context, const char *name, void *pInterface)
 
static UINT freerdp_drdynvc_on_channel_disconnected (DrdynvcClientContext *context, const char *name, void *pInterface)
 
static UINT freerdp_drdynvc_on_channel_attached (DrdynvcClientContext *context, const char *name, void *pInterface)
 
static UINT freerdp_drdynvc_on_channel_detached (DrdynvcClientContext *context, const char *name, void *pInterface)
 
void freerdp_channels_register_instance (rdpChannels *channels, freerdp *instance)
 
UINT freerdp_channels_pre_connect (rdpChannels *channels, freerdp *instance)
 
UINT freerdp_channels_attach (freerdp *instance)
 
UINT freerdp_channels_detach (freerdp *instance)
 
UINT freerdp_channels_post_connect (rdpChannels *channels, freerdp *instance)
 
BOOL freerdp_channels_data (freerdp *instance, UINT16 channelId, const BYTE *cdata, size_t dataSize, UINT32 flags, size_t totalSize)
 
UINT16 freerdp_channels_get_id_by_name (freerdp *instance, const char *channel_name)
 
const char * freerdp_channels_get_name_by_id (freerdp *instance, UINT16 channelId)
 
static BOOL freerdp_channels_process_message (freerdp *instance, wMessage *message)
 
static BOOL freerdp_channels_process_sync (rdpChannels *channels, freerdp *instance)
 
void * freerdp_channels_get_static_channel_interface (rdpChannels *channels, const char *name)
 
HANDLE freerdp_channels_get_event_handle (freerdp *instance)
 
int freerdp_channels_process_pending_messages (freerdp *instance)
 
BOOL freerdp_channels_check_fds (rdpChannels *channels, freerdp *instance)
 
UINT freerdp_channels_disconnect (rdpChannels *channels, freerdp *instance)
 
void freerdp_channels_close (rdpChannels *channels, freerdp *instance)
 
static UINT VCAPITYPE FreeRDP_VirtualChannelInitEx (LPVOID lpUserParam, LPVOID clientContext, LPVOID pInitHandle, PCHANNEL_DEF pChannel, INT channelCount, ULONG versionRequested, PCHANNEL_INIT_EVENT_EX_FN pChannelInitEventProcEx)
 
static UINT VCAPITYPE FreeRDP_VirtualChannelInit (LPVOID *ppInitHandle, PCHANNEL_DEF pChannel, INT channelCount, ULONG versionRequested, PCHANNEL_INIT_EVENT_FN pChannelInitEventProc)
 
static UINT VCAPITYPE FreeRDP_VirtualChannelOpenEx (LPVOID pInitHandle, LPDWORD pOpenHandle, PCHAR pChannelName, PCHANNEL_OPEN_EVENT_EX_FN pChannelOpenEventProcEx)
 
static UINT VCAPITYPE FreeRDP_VirtualChannelOpen (LPVOID pInitHandle, LPDWORD pOpenHandle, PCHAR pChannelName, PCHANNEL_OPEN_EVENT_FN pChannelOpenEventProc)
 
static UINT VCAPITYPE FreeRDP_VirtualChannelCloseEx (LPVOID pInitHandle, DWORD openHandle)
 
static UINT VCAPITYPE FreeRDP_VirtualChannelClose (DWORD openHandle)
 
static UINT VCAPITYPE FreeRDP_VirtualChannelWriteEx (LPVOID pInitHandle, DWORD openHandle, LPVOID pData, ULONG dataLength, LPVOID pUserData)
 
static UINT VCAPITYPE FreeRDP_VirtualChannelWrite (DWORD openHandle, LPVOID pData, ULONG dataLength, LPVOID pUserData)
 
static BOOL freerdp_channels_is_loaded (rdpChannels *channels, PVIRTUALCHANNELENTRY entry)
 
static BOOL freerdp_channels_is_loaded_ex (rdpChannels *channels, PVIRTUALCHANNELENTRYEX entryEx)
 
int freerdp_channels_client_load (rdpChannels *channels, rdpSettings *settings, PVIRTUALCHANNELENTRY entry, void *data)
 
int freerdp_channels_client_load_ex (rdpChannels *channels, rdpSettings *settings, PVIRTUALCHANNELENTRYEX entryEx, void *data)
 
int freerdp_channels_load_plugin (rdpChannels *channels, rdpSettings *settings, const char *name, void *data)
 

Variables

static WINPR_TLS freerdp * g_Instance = NULL
 
static volatile LONG g_OpenHandleSeq = 1
 
static INIT_ONCE g_ChannelHandlesOnce = INIT_ONCE_STATIC_INIT
 
static wHashTable * g_ChannelHandles = NULL
 

Macro Definition Documentation

◆ TAG

#define TAG   FREERDP_TAG("core.client")

FreeRDP: A Remote Desktop Protocol Implementation Client Channels

Copyright 2014 Marc-Andre Moreau marca.nosp@m.ndre.nosp@m..more.nosp@m.au@g.nosp@m.mail..nosp@m.com 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

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.

Function Documentation

◆ channel_queue_free()

static void channel_queue_free ( void *  obj)
static
Here is the call graph for this function:
Here is the caller graph for this function:

◆ channel_queue_message_free()

static void channel_queue_message_free ( wMessage *  msg)
static
Here is the caller graph for this function:

◆ freerdp_channels_attach()

UINT freerdp_channels_attach ( freerdp *  instance)
Here is the call graph for this function:

◆ freerdp_channels_check_fds()

BOOL freerdp_channels_check_fds ( rdpChannels *  channels,
freerdp *  instance 
)

called only from main thread

Here is the call graph for this function:
Here is the caller graph for this function:

◆ freerdp_channels_client_load()

int freerdp_channels_client_load ( rdpChannels *  channels,
rdpSettings *  settings,
PVIRTUALCHANNELENTRY  entry,
void *  data 
)

FreeRDP: A Remote Desktop Protocol Implementation Virtual Channel Manager

Copyright 2009-2011 Jay Sorg Copyright 2010-2011 Vic Lee

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 call graph for this function:
Here is the caller graph for this function:

◆ freerdp_channels_client_load_ex()

int freerdp_channels_client_load_ex ( rdpChannels *  channels,
rdpSettings *  settings,
PVIRTUALCHANNELENTRYEX  entryEx,
void *  data 
)
Here is the call graph for this function:
Here is the caller graph for this function:

◆ freerdp_channels_close()

void freerdp_channels_close ( rdpChannels *  channels,
freerdp *  instance 
)
Here is the call graph for this function:
Here is the caller graph for this function:

◆ freerdp_channels_data()

BOOL freerdp_channels_data ( freerdp *  instance,
UINT16  channelId,
const BYTE cdata,
size_t  dataSize,
UINT32  flags,
size_t  totalSize 
)
Here is the call graph for this function:
Here is the caller graph for this function:

◆ freerdp_channels_detach()

UINT freerdp_channels_detach ( freerdp *  instance)
Here is the call graph for this function:

◆ freerdp_channels_disconnect()

UINT freerdp_channels_disconnect ( rdpChannels *  channels,
freerdp *  instance 
)
Here is the call graph for this function:
Here is the caller graph for this function:

◆ freerdp_channels_find_channel_by_id()

static rdpMcsChannel* freerdp_channels_find_channel_by_id ( rdpRdp *  rdp,
UINT16  channel_id 
)
static
Here is the caller graph for this function:

◆ freerdp_channels_find_channel_by_name()

static rdpMcsChannel* freerdp_channels_find_channel_by_name ( rdpRdp *  rdp,
const char *  name 
)
static
Here is the caller graph for this function:

◆ freerdp_channels_find_channel_open_data_by_name()

static CHANNEL_OPEN_DATA* freerdp_channels_find_channel_open_data_by_name ( rdpChannels *  channels,
const char *  name 
)
static
Here is the caller graph for this function:

◆ freerdp_channels_free()

void freerdp_channels_free ( rdpChannels *  channels)
Here is the call graph for this function:
Here is the caller graph for this function:

◆ freerdp_channels_get_event_handle()

HANDLE freerdp_channels_get_event_handle ( freerdp *  instance)
Here is the call graph for this function:
Here is the caller graph for this function:

◆ freerdp_channels_get_id_by_name()

UINT16 freerdp_channels_get_id_by_name ( freerdp *  instance,
const char *  channel_name 
)
Here is the call graph for this function:
Here is the caller graph for this function:

◆ freerdp_channels_get_name_by_id()

const char* freerdp_channels_get_name_by_id ( freerdp *  instance,
UINT16  channelId 
)
Here is the call graph for this function:

◆ freerdp_channels_get_static_channel_interface()

void* freerdp_channels_get_static_channel_interface ( rdpChannels *  channels,
const char *  name 
)

called only from main thread

Here is the call graph for this function:
Here is the caller graph for this function:

◆ freerdp_channels_is_loaded()

static BOOL freerdp_channels_is_loaded ( rdpChannels *  channels,
PVIRTUALCHANNELENTRY  entry 
)
static
Here is the caller graph for this function:

◆ freerdp_channels_is_loaded_ex()

static BOOL freerdp_channels_is_loaded_ex ( rdpChannels *  channels,
PVIRTUALCHANNELENTRYEX  entryEx 
)
static
Here is the caller graph for this function:

◆ freerdp_channels_load_plugin()

int freerdp_channels_load_plugin ( rdpChannels *  channels,
rdpSettings *  settings,
const char *  name,
void *  data 
)

this is called when processing the command line parameters called only from main thread

Here is the call graph for this function:

◆ freerdp_channels_new()

rdpChannels* freerdp_channels_new ( freerdp *  instance)
Here is the call graph for this function:
Here is the caller graph for this function:

◆ freerdp_channels_post_connect()

UINT freerdp_channels_post_connect ( rdpChannels *  channels,
freerdp *  instance 
)

go through and inform all the libraries that we are connected this will tell the libraries that its ok to call MyVirtualChannelOpen called only from main thread

Here is the call graph for this function:
Here is the caller graph for this function:

◆ freerdp_channels_pre_connect()

UINT freerdp_channels_pre_connect ( rdpChannels *  channels,
freerdp *  instance 
)

go through and inform all the libraries that we are initialized called only from main thread

Here is the call graph for this function:
Here is the caller graph for this function:

◆ freerdp_channels_process_message()

static BOOL freerdp_channels_process_message ( freerdp *  instance,
wMessage *  message 
)
static
Here is the call graph for this function:
Here is the caller graph for this function:

◆ freerdp_channels_process_message_free()

BOOL freerdp_channels_process_message_free ( wMessage *  message,
DWORD  type 
)
static
Here is the call graph for this function:
Here is the caller graph for this function:

◆ freerdp_channels_process_pending_messages()

int freerdp_channels_process_pending_messages ( freerdp *  instance)
Here is the call graph for this function:

◆ freerdp_channels_process_sync()

static BOOL freerdp_channels_process_sync ( rdpChannels *  channels,
freerdp *  instance 
)
static

called only from main thread

Here is the call graph for this function:
Here is the caller graph for this function:

◆ freerdp_channels_register_instance()

void freerdp_channels_register_instance ( rdpChannels *  channels,
freerdp *  instance 
)
Here is the caller graph for this function:

◆ freerdp_drdynvc_on_channel_attached()

static UINT freerdp_drdynvc_on_channel_attached ( DrdynvcClientContext *  context,
const char *  name,
void *  pInterface 
)
static
Here is the call graph for this function:
Here is the caller graph for this function:

◆ freerdp_drdynvc_on_channel_connected()

static UINT freerdp_drdynvc_on_channel_connected ( DrdynvcClientContext *  context,
const char *  name,
void *  pInterface 
)
static

Function description

Returns
0 on success, otherwise a Win32 error code
Here is the call graph for this function:
Here is the caller graph for this function:

◆ freerdp_drdynvc_on_channel_detached()

static UINT freerdp_drdynvc_on_channel_detached ( DrdynvcClientContext *  context,
const char *  name,
void *  pInterface 
)
static
Here is the call graph for this function:
Here is the caller graph for this function:

◆ freerdp_drdynvc_on_channel_disconnected()

static UINT freerdp_drdynvc_on_channel_disconnected ( DrdynvcClientContext *  context,
const char *  name,
void *  pInterface 
)
static

Function description

Returns
0 on success, otherwise a Win32 error code
Here is the call graph for this function:
Here is the caller graph for this function:

◆ FreeRDP_VirtualChannelClose()

static UINT VCAPITYPE FreeRDP_VirtualChannelClose ( DWORD  openHandle)
static
Here is the call graph for this function:
Here is the caller graph for this function:

◆ FreeRDP_VirtualChannelCloseEx()

static UINT VCAPITYPE FreeRDP_VirtualChannelCloseEx ( LPVOID  pInitHandle,
DWORD  openHandle 
)
static
Here is the call graph for this function:
Here is the caller graph for this function:

◆ FreeRDP_VirtualChannelInit()

static UINT VCAPITYPE FreeRDP_VirtualChannelInit ( LPVOID *  ppInitHandle,
PCHANNEL_DEF  pChannel,
INT  channelCount,
ULONG  versionRequested,
PCHANNEL_INIT_EVENT_FN  pChannelInitEventProc 
)
static
Here is the call graph for this function:
Here is the caller graph for this function:

◆ FreeRDP_VirtualChannelInitEx()

static UINT VCAPITYPE FreeRDP_VirtualChannelInitEx ( LPVOID  lpUserParam,
LPVOID  clientContext,
LPVOID  pInitHandle,
PCHANNEL_DEF  pChannel,
INT  channelCount,
ULONG  versionRequested,
PCHANNEL_INIT_EVENT_EX_FN  pChannelInitEventProcEx 
)
static
Here is the call graph for this function:
Here is the caller graph for this function:

◆ FreeRDP_VirtualChannelOpen()

static UINT VCAPITYPE FreeRDP_VirtualChannelOpen ( LPVOID  pInitHandle,
LPDWORD  pOpenHandle,
PCHAR  pChannelName,
PCHANNEL_OPEN_EVENT_FN  pChannelOpenEventProc 
)
static
Here is the call graph for this function:
Here is the caller graph for this function:

◆ FreeRDP_VirtualChannelOpenEx()

static UINT VCAPITYPE FreeRDP_VirtualChannelOpenEx ( LPVOID  pInitHandle,
LPDWORD  pOpenHandle,
PCHAR  pChannelName,
PCHANNEL_OPEN_EVENT_EX_FN  pChannelOpenEventProcEx 
)
static
Here is the call graph for this function:
Here is the caller graph for this function:

◆ FreeRDP_VirtualChannelWrite()

static UINT VCAPITYPE FreeRDP_VirtualChannelWrite ( DWORD  openHandle,
LPVOID  pData,
ULONG  dataLength,
LPVOID  pUserData 
)
static
Here is the call graph for this function:
Here is the caller graph for this function:

◆ FreeRDP_VirtualChannelWriteEx()

static UINT VCAPITYPE FreeRDP_VirtualChannelWriteEx ( LPVOID  pInitHandle,
DWORD  openHandle,
LPVOID  pData,
ULONG  dataLength,
LPVOID  pUserData 
)
static
Here is the call graph for this function:
Here is the caller graph for this function:

◆ init_channel_handles_table()

static BOOL CALLBACK init_channel_handles_table ( PINIT_ONCE  once,
PVOID  param,
PVOID *  context 
)
static
Here is the call graph for this function:
Here is the caller graph for this function:

Variable Documentation

◆ g_ChannelHandles

wHashTable* g_ChannelHandles = NULL
static

◆ g_ChannelHandlesOnce

INIT_ONCE g_ChannelHandlesOnce = INIT_ONCE_STATIC_INIT
static

◆ g_Instance

WINPR_TLS freerdp* g_Instance = NULL
static

◆ g_OpenHandleSeq

volatile LONG g_OpenHandleSeq = 1
static