FreeRDP
client/drdynvc_main.c File Reference
#include <freerdp/config.h>
#include <winpr/crt.h>
#include <winpr/stream.h>
#include <winpr/interlocked.h>
#include <freerdp/freerdp.h>
#include <freerdp/channels/drdynvc.h>
#include <freerdp/utils/drdynvc.h>
#include "drdynvc_main.h"

Macros

#define TAG   CHANNELS_TAG("drdynvc.client")
 
#define VirtualChannelEntryEx   drdynvc_VirtualChannelEntryEx
 

Functions

static void dvcman_channel_free (DVCMAN_CHANNEL *channel)
 
static UINT dvcman_channel_close (DVCMAN_CHANNEL *channel, BOOL perRequest, BOOL fromHashTableFn)
 
static void dvcman_free (drdynvcPlugin *drdynvc, IWTSVirtualChannelManager *pChannelMgr)
 
static UINT drdynvc_write_data (drdynvcPlugin *drdynvc, UINT32 ChannelId, const BYTE *data, UINT32 dataSize, BOOL *close)
 
static UINT drdynvc_send (drdynvcPlugin *drdynvc, wStream *s)
 
static void dvcman_wtslistener_free (DVCMAN_LISTENER *listener)
 
static UINT dvcman_get_configuration (IWTSListener *pListener, void **ppPropertyBag)
 
static UINT dvcman_create_listener (IWTSVirtualChannelManager *pChannelMgr, const char *pszChannelName, ULONG ulFlags, IWTSListenerCallback *pListenerCallback, IWTSListener **ppListener)
 
static UINT dvcman_destroy_listener (IWTSVirtualChannelManager *pChannelMgr, IWTSListener *pListener)
 
static UINT dvcman_register_plugin (IDRDYNVC_ENTRY_POINTS *pEntryPoints, const char *name, IWTSPlugin *pPlugin)
 
static IWTSPlugin * dvcman_get_plugin (IDRDYNVC_ENTRY_POINTS *pEntryPoints, const char *name)
 
static const ADDIN_ARGVdvcman_get_plugin_data (IDRDYNVC_ENTRY_POINTS *pEntryPoints)
 
static rdpContext * dvcman_get_rdp_context (IDRDYNVC_ENTRY_POINTS *pEntryPoints)
 
static rdpSettings * dvcman_get_rdp_settings (IDRDYNVC_ENTRY_POINTS *pEntryPoints)
 
static UINT32 dvcman_get_channel_id (IWTSVirtualChannel *channel)
 
static const char * dvcman_get_channel_name (IWTSVirtualChannel *channel)
 
static DVCMAN_CHANNELdvcman_get_channel_by_id (IWTSVirtualChannelManager *pChannelMgr, UINT32 ChannelId, BOOL doRef)
 
static IWTSVirtualChannel * dvcman_find_channel_by_id (IWTSVirtualChannelManager *pChannelMgr, UINT32 ChannelId)
 
static void dvcman_plugin_terminate (void *plugin)
 
static void wts_listener_free (void *arg)
 
static BOOL channelIdMatch (const void *k1, const void *k2)
 
static UINT32 channelIdHash (const void *id)
 
static void channelByIdCleanerFn (void *value)
 
static IWTSVirtualChannelManager * dvcman_new (drdynvcPlugin *plugin)
 
static UINT dvcman_load_addin (drdynvcPlugin *drdynvc, IWTSVirtualChannelManager *pChannelMgr, const ADDIN_ARGV *args, rdpContext *context)
 
static void dvcman_channel_unref (DVCMAN_CHANNEL *channel)
 
static UINT dvcchannel_send_close (DVCMAN_CHANNEL *channel)
 
static void check_open_close_receive (DVCMAN_CHANNEL *channel)
 
static UINT dvcman_call_on_receive (DVCMAN_CHANNEL *channel, wStream *data)
 
static DVCMAN_CHANNELdvcman_channel_new (drdynvcPlugin *drdynvc, IWTSVirtualChannelManager *pChannelMgr, UINT32 ChannelId, const char *ChannelName)
 
static void dvcman_clear (drdynvcPlugin *drdynvc, IWTSVirtualChannelManager *pChannelMgr)
 
static UINT dvcman_init (drdynvcPlugin *drdynvc, IWTSVirtualChannelManager *pChannelMgr)
 
static UINT dvcman_write_channel (IWTSVirtualChannel *pChannel, ULONG cbSize, const BYTE *pBuffer, void *pReserved)
 
static UINT dvcman_close_channel_iface (IWTSVirtualChannel *pChannel)
 
static DVCMAN_CHANNELdvcman_create_channel (drdynvcPlugin *drdynvc, IWTSVirtualChannelManager *pChannelMgr, UINT32 ChannelId, const char *ChannelName, UINT *res)
 
static UINT dvcman_open_channel (drdynvcPlugin *drdynvc, DVCMAN_CHANNEL *channel)
 
static UINT dvcman_receive_channel_data_first (DVCMAN_CHANNEL *channel, UINT32 length)
 
static UINT dvcman_receive_channel_data (DVCMAN_CHANNEL *channel, wStream *data, UINT32 ThreadingFlags)
 
static UINT8 drdynvc_write_variable_uint (wStream *s, UINT32 val)
 
static UINT drdynvc_send_capability_response (drdynvcPlugin *drdynvc)
 
static UINT drdynvc_process_capability_request (drdynvcPlugin *drdynvc, int Sp, int cbChId, wStream *s)
 
static UINT32 drdynvc_cblen_to_bytes (int cbLen)
 
static UINT32 drdynvc_read_variable_uint (wStream *s, int cbLen)
 
static UINT drdynvc_process_create_request (drdynvcPlugin *drdynvc, int Sp, int cbChId, wStream *s)
 
static UINT drdynvc_process_data_first (drdynvcPlugin *drdynvc, int Sp, int cbChId, wStream *s, UINT32 ThreadingFlags)
 
static UINT drdynvc_process_data (drdynvcPlugin *drdynvc, int Sp, int cbChId, wStream *s, UINT32 ThreadingFlags)
 
static UINT drdynvc_process_close_request (drdynvcPlugin *drdynvc, int Sp, int cbChId, wStream *s)
 
static UINT drdynvc_order_recv (drdynvcPlugin *drdynvc, wStream *s, UINT32 ThreadingFlags)
 
static UINT drdynvc_virtual_channel_event_data_received (drdynvcPlugin *drdynvc, void *pData, UINT32 dataLength, UINT32 totalLength, UINT32 dataFlags)
 
static void VCAPITYPE drdynvc_virtual_channel_open_event_ex (LPVOID lpUserParam, DWORD openHandle, UINT event, LPVOID pData, UINT32 dataLength, UINT32 totalLength, UINT32 dataFlags)
 
static DWORD WINAPI drdynvc_virtual_channel_client_thread (LPVOID arg)
 
static void drdynvc_queue_object_free (void *obj)
 
static UINT drdynvc_virtual_channel_event_initialized (drdynvcPlugin *drdynvc, LPVOID pData, UINT32 dataLength)
 
static UINT drdynvc_virtual_channel_event_connected (drdynvcPlugin *drdynvc, LPVOID pData, UINT32 dataLength)
 
static UINT drdynvc_virtual_channel_event_disconnected (drdynvcPlugin *drdynvc)
 
static UINT drdynvc_virtual_channel_event_terminated (drdynvcPlugin *drdynvc)
 
static UINT drdynvc_virtual_channel_event_attached (drdynvcPlugin *drdynvc)
 
static UINT drdynvc_virtual_channel_event_detached (drdynvcPlugin *drdynvc)
 
static VOID VCAPITYPE drdynvc_virtual_channel_init_event_ex (LPVOID lpUserParam, LPVOID pInitHandle, UINT event, LPVOID pData, UINT dataLength)
 
static int drdynvc_get_version (DrdynvcClientContext *context)
 
 FREERDP_ENTRY_POINT (BOOL VCAPITYPE VirtualChannelEntryEx(PCHANNEL_ENTRY_POINTS_EX pEntryPoints, PVOID pInitHandle))
 

Macro Definition Documentation

◆ TAG

#define TAG   CHANNELS_TAG("drdynvc.client")

FreeRDP: A Remote Desktop Protocol Implementation Dynamic Virtual Channel

Copyright 2010-2011 Vic Lee 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.

◆ VirtualChannelEntryEx

#define VirtualChannelEntryEx   drdynvc_VirtualChannelEntryEx

Function Documentation

◆ channelByIdCleanerFn()

static void channelByIdCleanerFn ( void *  value)
static
Here is the call graph for this function:
Here is the caller graph for this function:

◆ channelIdHash()

static UINT32 channelIdHash ( const void *  id)
static
Here is the caller graph for this function:

◆ channelIdMatch()

static BOOL channelIdMatch ( const void *  k1,
const void *  k2 
)
static
Here is the caller graph for this function:

◆ check_open_close_receive()

static void check_open_close_receive ( DVCMAN_CHANNEL channel)
static
Here is the caller graph for this function:

◆ drdynvc_cblen_to_bytes()

static UINT32 drdynvc_cblen_to_bytes ( int  cbLen)
static
Here is the caller graph for this function:

◆ drdynvc_get_version()

static int drdynvc_get_version ( DrdynvcClientContext *  context)
static

Channel Client Interface

Here is the caller graph for this function:

◆ drdynvc_order_recv()

static UINT drdynvc_order_recv ( drdynvcPlugin *  drdynvc,
wStream s,
UINT32  ThreadingFlags 
)
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:

◆ drdynvc_process_capability_request()

static UINT drdynvc_process_capability_request ( drdynvcPlugin *  drdynvc,
int  Sp,
int  cbChId,
wStream s 
)
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:

◆ drdynvc_process_close_request()

static UINT drdynvc_process_close_request ( drdynvcPlugin *  drdynvc,
int  Sp,
int  cbChId,
wStream s 
)
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:

◆ drdynvc_process_create_request()

static UINT drdynvc_process_create_request ( drdynvcPlugin *  drdynvc,
int  Sp,
int  cbChId,
wStream s 
)
static

Function description

Returns
0 on success, otherwise a Win32 error code

For some reason the server does not always send the capabilities pdu as it should. When this happens, send a capabilities response.

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

◆ drdynvc_process_data()

static UINT drdynvc_process_data ( drdynvcPlugin *  drdynvc,
int  Sp,
int  cbChId,
wStream s,
UINT32  ThreadingFlags 
)
static

Function description

Returns
0 on success, otherwise a Win32 error code

Windows Server 2012 R2 can send some messages over Microsoft::Windows::RDS::Geometry::v08.01 even if the dynamic virtual channel wasn't registered on our side. Ignoring it works.

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

◆ drdynvc_process_data_first()

static UINT drdynvc_process_data_first ( drdynvcPlugin *  drdynvc,
int  Sp,
int  cbChId,
wStream s,
UINT32  ThreadingFlags 
)
static

Function description

Returns
0 on success, otherwise a Win32 error code

Windows Server 2012 R2 can send some messages over Microsoft::Windows::RDS::Geometry::v08.01 even if the dynamic virtual channel wasn't registered on our side. Ignoring it works.

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

◆ drdynvc_queue_object_free()

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

◆ drdynvc_read_variable_uint()

static UINT32 drdynvc_read_variable_uint ( wStream s,
int  cbLen 
)
static
Here is the caller graph for this function:

◆ drdynvc_send()

static UINT drdynvc_send ( drdynvcPlugin *  drdynvc,
wStream s 
)
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:

◆ drdynvc_send_capability_response()

static UINT drdynvc_send_capability_response ( drdynvcPlugin *  drdynvc)
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:

◆ drdynvc_virtual_channel_client_thread()

static DWORD WINAPI drdynvc_virtual_channel_client_thread ( LPVOID  arg)
static
Here is the call graph for this function:
Here is the caller graph for this function:

◆ drdynvc_virtual_channel_event_attached()

static UINT drdynvc_virtual_channel_event_attached ( drdynvcPlugin *  drdynvc)
static
Here is the call graph for this function:
Here is the caller graph for this function:

◆ drdynvc_virtual_channel_event_connected()

static UINT drdynvc_virtual_channel_event_connected ( drdynvcPlugin *  drdynvc,
LPVOID  pData,
UINT32  dataLength 
)
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:

◆ drdynvc_virtual_channel_event_data_received()

static UINT drdynvc_virtual_channel_event_data_received ( drdynvcPlugin *  drdynvc,
void *  pData,
UINT32  dataLength,
UINT32  totalLength,
UINT32  dataFlags 
)
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:

◆ drdynvc_virtual_channel_event_detached()

static UINT drdynvc_virtual_channel_event_detached ( drdynvcPlugin *  drdynvc)
static
Here is the call graph for this function:
Here is the caller graph for this function:

◆ drdynvc_virtual_channel_event_disconnected()

static UINT drdynvc_virtual_channel_event_disconnected ( drdynvcPlugin *  drdynvc)
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:

◆ drdynvc_virtual_channel_event_initialized()

static UINT drdynvc_virtual_channel_event_initialized ( drdynvcPlugin *  drdynvc,
LPVOID  pData,
UINT32  dataLength 
)
static
Here is the call graph for this function:
Here is the caller graph for this function:

◆ drdynvc_virtual_channel_event_terminated()

static UINT drdynvc_virtual_channel_event_terminated ( drdynvcPlugin *  drdynvc)
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:

◆ drdynvc_virtual_channel_init_event_ex()

static VOID VCAPITYPE drdynvc_virtual_channel_init_event_ex ( LPVOID  lpUserParam,
LPVOID  pInitHandle,
UINT  event,
LPVOID  pData,
UINT  dataLength 
)
static
Here is the call graph for this function:
Here is the caller graph for this function:

◆ drdynvc_virtual_channel_open_event_ex()

static void VCAPITYPE drdynvc_virtual_channel_open_event_ex ( LPVOID  lpUserParam,
DWORD  openHandle,
UINT  event,
LPVOID  pData,
UINT32  dataLength,
UINT32  totalLength,
UINT32  dataFlags 
)
static
Here is the call graph for this function:
Here is the caller graph for this function:

◆ drdynvc_write_data()

static UINT drdynvc_write_data ( drdynvcPlugin *  drdynvc,
UINT32  ChannelId,
const BYTE data,
UINT32  dataSize,
BOOL *  close 
)
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:

◆ drdynvc_write_variable_uint()

static UINT8 drdynvc_write_variable_uint ( wStream s,
UINT32  val 
)
static
Here is the call graph for this function:
Here is the caller graph for this function:

◆ dvcchannel_send_close()

static UINT dvcchannel_send_close ( DVCMAN_CHANNEL channel)
static
Here is the call graph for this function:
Here is the caller graph for this function:

◆ dvcman_call_on_receive()

static UINT dvcman_call_on_receive ( DVCMAN_CHANNEL channel,
wStream data 
)
static
Here is the call graph for this function:
Here is the caller graph for this function:

◆ dvcman_channel_close()

static UINT dvcman_channel_close ( DVCMAN_CHANNEL channel,
BOOL  perRequest,
BOOL  fromHashTableFn 
)
static
Here is the call graph for this function:
Here is the caller graph for this function:

◆ dvcman_channel_free()

static void dvcman_channel_free ( DVCMAN_CHANNEL channel)
static
Here is the call graph for this function:
Here is the caller graph for this function:

◆ dvcman_channel_new()

static DVCMAN_CHANNEL* dvcman_channel_new ( drdynvcPlugin *  drdynvc,
IWTSVirtualChannelManager *  pChannelMgr,
UINT32  ChannelId,
const char *  ChannelName 
)
static
Here is the call graph for this function:
Here is the caller graph for this function:

◆ dvcman_channel_unref()

static void dvcman_channel_unref ( DVCMAN_CHANNEL channel)
static
Here is the call graph for this function:
Here is the caller graph for this function:

◆ dvcman_clear()

static void dvcman_clear ( drdynvcPlugin *  drdynvc,
IWTSVirtualChannelManager *  pChannelMgr 
)
static
Here is the call graph for this function:
Here is the caller graph for this function:

◆ dvcman_close_channel_iface()

static UINT dvcman_close_channel_iface ( IWTSVirtualChannel *  pChannel)
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:

◆ dvcman_create_channel()

static DVCMAN_CHANNEL* dvcman_create_channel ( drdynvcPlugin *  drdynvc,
IWTSVirtualChannelManager *  pChannelMgr,
UINT32  ChannelId,
const char *  ChannelName,
UINT *  res 
)
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:

◆ dvcman_create_listener()

static UINT dvcman_create_listener ( IWTSVirtualChannelManager *  pChannelMgr,
const char *  pszChannelName,
ULONG  ulFlags,
IWTSListenerCallback *  pListenerCallback,
IWTSListener **  ppListener 
)
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:

◆ dvcman_destroy_listener()

static UINT dvcman_destroy_listener ( IWTSVirtualChannelManager *  pChannelMgr,
IWTSListener *  pListener 
)
static
Here is the call graph for this function:
Here is the caller graph for this function:

◆ dvcman_find_channel_by_id()

static IWTSVirtualChannel* dvcman_find_channel_by_id ( IWTSVirtualChannelManager *  pChannelMgr,
UINT32  ChannelId 
)
static
Here is the call graph for this function:
Here is the caller graph for this function:

◆ dvcman_free()

static void dvcman_free ( drdynvcPlugin *  drdynvc,
IWTSVirtualChannelManager *  pChannelMgr 
)
static
Here is the call graph for this function:
Here is the caller graph for this function:

◆ dvcman_get_channel_by_id()

static DVCMAN_CHANNEL* dvcman_get_channel_by_id ( IWTSVirtualChannelManager *  pChannelMgr,
UINT32  ChannelId,
BOOL  doRef 
)
static
Here is the call graph for this function:
Here is the caller graph for this function:

◆ dvcman_get_channel_id()

static UINT32 dvcman_get_channel_id ( IWTSVirtualChannel *  channel)
static
Here is the caller graph for this function:

◆ dvcman_get_channel_name()

static const char* dvcman_get_channel_name ( IWTSVirtualChannel *  channel)
static
Here is the caller graph for this function:

◆ dvcman_get_configuration()

static UINT dvcman_get_configuration ( IWTSListener *  pListener,
void **  ppPropertyBag 
)
static

Function description

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

◆ dvcman_get_plugin()

static IWTSPlugin* dvcman_get_plugin ( IDRDYNVC_ENTRY_POINTS *  pEntryPoints,
const char *  name 
)
static
Here is the call graph for this function:
Here is the caller graph for this function:

◆ dvcman_get_plugin_data()

static const ADDIN_ARGV* dvcman_get_plugin_data ( IDRDYNVC_ENTRY_POINTS *  pEntryPoints)
static
Here is the caller graph for this function:

◆ dvcman_get_rdp_context()

static rdpContext* dvcman_get_rdp_context ( IDRDYNVC_ENTRY_POINTS *  pEntryPoints)
static
Here is the caller graph for this function:

◆ dvcman_get_rdp_settings()

static rdpSettings* dvcman_get_rdp_settings ( IDRDYNVC_ENTRY_POINTS *  pEntryPoints)
static
Here is the call graph for this function:
Here is the caller graph for this function:

◆ dvcman_init()

static UINT dvcman_init ( drdynvcPlugin *  drdynvc,
IWTSVirtualChannelManager *  pChannelMgr 
)
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:

◆ dvcman_load_addin()

static UINT dvcman_load_addin ( drdynvcPlugin *  drdynvc,
IWTSVirtualChannelManager *  pChannelMgr,
const ADDIN_ARGV args,
rdpContext *  context 
)
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:

◆ dvcman_new()

static IWTSVirtualChannelManager* dvcman_new ( drdynvcPlugin *  plugin)
static
Here is the call graph for this function:
Here is the caller graph for this function:

◆ dvcman_open_channel()

static UINT dvcman_open_channel ( drdynvcPlugin *  drdynvc,
DVCMAN_CHANNEL channel 
)
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:

◆ dvcman_plugin_terminate()

static void dvcman_plugin_terminate ( void *  plugin)
static
Here is the caller graph for this function:

◆ dvcman_receive_channel_data()

static UINT dvcman_receive_channel_data ( DVCMAN_CHANNEL channel,
wStream data,
UINT32  ThreadingFlags 
)
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:

◆ dvcman_receive_channel_data_first()

static UINT dvcman_receive_channel_data_first ( DVCMAN_CHANNEL channel,
UINT32  length 
)
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:

◆ dvcman_register_plugin()

static UINT dvcman_register_plugin ( IDRDYNVC_ENTRY_POINTS *  pEntryPoints,
const char *  name,
IWTSPlugin *  pPlugin 
)
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:

◆ dvcman_write_channel()

static UINT dvcman_write_channel ( IWTSVirtualChannel *  pChannel,
ULONG  cbSize,
const BYTE pBuffer,
void *  pReserved 
)
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:

◆ dvcman_wtslistener_free()

static void dvcman_wtslistener_free ( DVCMAN_LISTENER listener)
static
Here is the call graph for this function:
Here is the caller graph for this function:

◆ FREERDP_ENTRY_POINT()

FREERDP_ENTRY_POINT ( BOOL VCAPITYPE   VirtualChannelEntryExPCHANNEL_ENTRY_POINTS_EX pEntryPoints, PVOID pInitHandle)
Here is the call graph for this function:

◆ wts_listener_free()

static void wts_listener_free ( void *  arg)
static
Here is the call graph for this function:
Here is the caller graph for this function: