FreeRDP
urbdrc_main.c File Reference
#include <winpr/assert.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <errno.h>
#include <winpr/pool.h>
#include <winpr/print.h>
#include <winpr/crt.h>
#include <winpr/synch.h>
#include <winpr/cmdline.h>
#include <freerdp/dvc.h>
#include <freerdp/addin.h>
#include <freerdp/channels/log.h>
#include <freerdp/channels/urbdrc.h>
#include "urbdrc_types.h"
#include "urbdrc_main.h"
#include "data_transfer.h"
#include <urbdrc_helpers.h>

Macros

#define DVCPluginEntry   FREERDP_API DVCPluginEntry
 

Functions

static BOOL Stream_Write_UTF16_String_From_Utf8 (wStream *s, const char *utf8, size_t len)
 
static IWTSVirtualChannel * get_channel (IUDEVMAN *idevman)
 
static int func_container_id_generate (IUDEVICE *pdev, char *strContainerId)
 
static int func_instance_id_generate (IUDEVICE *pdev, char *strInstanceId, size_t len)
 
static UINT urbdrc_process_capability_request (URBDRC_CHANNEL_CALLBACK *callback, wStream *s, UINT32 MessageId)
 
static UINT urbdrc_process_channel_create (URBDRC_CHANNEL_CALLBACK *callback, wStream *s, UINT32 MessageId)
 
static UINT urdbrc_send_virtual_channel_add (IWTSPlugin *plugin, IWTSVirtualChannel *channel, UINT32 MessageId)
 
static UINT urdbrc_send_usb_device_add (URBDRC_CHANNEL_CALLBACK *callback, IUDEVICE *pdev)
 
static UINT urbdrc_exchange_capabilities (URBDRC_CHANNEL_CALLBACK *callback, wStream *data)
 
static BOOL urbdrc_announce_devices (IUDEVMAN *udevman)
 
static UINT urbdrc_device_control_channel (URBDRC_CHANNEL_CALLBACK *callback, wStream *s)
 
static UINT urbdrc_process_channel_notification (URBDRC_CHANNEL_CALLBACK *callback, wStream *data)
 
static UINT urbdrc_on_data_received (IWTSVirtualChannelCallback *pChannelCallback, wStream *data)
 
static UINT urbdrc_on_close (IWTSVirtualChannelCallback *pChannelCallback)
 
static UINT urbdrc_on_new_channel_connection (IWTSListenerCallback *pListenerCallback, IWTSVirtualChannel *pChannel, BYTE *pData, BOOL *pbAccept, IWTSVirtualChannelCallback **ppCallback)
 
static UINT urbdrc_plugin_initialize (IWTSPlugin *pPlugin, IWTSVirtualChannelManager *pChannelMgr)
 
static UINT urbdrc_plugin_terminated (IWTSPlugin *pPlugin)
 
static BOOL urbdrc_register_udevman_addin (IWTSPlugin *pPlugin, IUDEVMAN *udevman)
 
static UINT urbdrc_load_udevman_addin (IWTSPlugin *pPlugin, LPCSTR name, const ADDIN_ARGV *args)
 
static BOOL urbdrc_set_subsystem (URBDRC_PLUGIN *urbdrc, const char *subsystem)
 
static UINT urbdrc_process_addin_args (URBDRC_PLUGIN *urbdrc, const ADDIN_ARGV *args)
 
BOOL add_device (IUDEVMAN *idevman, UINT32 flags, BYTE busnum, BYTE devnum, UINT16 idVendor, UINT16 idProduct)
 
BOOL del_device (IUDEVMAN *idevman, UINT32 flags, BYTE busnum, BYTE devnum, UINT16 idVendor, UINT16 idProduct)
 
UINT DVCPluginEntry (IDRDYNVC_ENTRY_POINTS *pEntryPoints)
 
UINT stream_write_and_free (IWTSPlugin *plugin, IWTSVirtualChannel *channel, wStream *out)
 

Macro Definition Documentation

◆ DVCPluginEntry

#define DVCPluginEntry   FREERDP_API DVCPluginEntry

Function Documentation

◆ add_device()

BOOL add_device ( IUDEVMAN *  idevman,
UINT32  flags,
BYTE  busnum,
BYTE  devnum,
UINT16  idVendor,
UINT16  idProduct 
)
Here is the call graph for this function:
Here is the caller graph for this function:

◆ del_device()

BOOL del_device ( IUDEVMAN *  idevman,
UINT32  flags,
BYTE  busnum,
BYTE  devnum,
UINT16  idVendor,
UINT16  idProduct 
)
Here is the call graph for this function:
Here is the caller graph for this function:

◆ DVCPluginEntry()

UINT DVCPluginEntry ( IDRDYNVC_ENTRY_POINTS *  pEntryPoints)

Function description

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

◆ func_container_id_generate()

static int func_container_id_generate ( IUDEVICE *  pdev,
char *  strContainerId 
)
static
Here is the caller graph for this function:

◆ func_instance_id_generate()

static int func_instance_id_generate ( IUDEVICE *  pdev,
char *  strInstanceId,
size_t  len 
)
static
Here is the caller graph for this function:

◆ get_channel()

static IWTSVirtualChannel* get_channel ( IUDEVMAN *  idevman)
static
Here is the call graph for this function:
Here is the caller graph for this function:

◆ stream_write_and_free()

UINT stream_write_and_free ( IWTSPlugin *  plugin,
IWTSVirtualChannel *  channel,
wStream *  out 
)
Here is the call graph for this function:
Here is the caller graph for this function:

◆ Stream_Write_UTF16_String_From_Utf8()

static BOOL Stream_Write_UTF16_String_From_Utf8 ( wStream *  s,
const char *  utf8,
size_t  len 
)
static

FreeRDP: A Remote Desktop Protocol Implementation RemoteFX USB Redirection

Copyright 2012 Atrust corp. Copyright 2012 Alfred Liu alfre.nosp@m.d.li.nosp@m.u@atr.nosp@m.usco.nosp@m.rp.co.nosp@m.m

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:

◆ urbdrc_announce_devices()

static BOOL urbdrc_announce_devices ( IUDEVMAN *  udevman)
static
Here is the call graph for this function:
Here is the caller graph for this function:

◆ urbdrc_device_control_channel()

static UINT urbdrc_device_control_channel ( URBDRC_CHANNEL_CALLBACK *  callback,
wStream *  s 
)
static
Here is the call graph for this function:
Here is the caller graph for this function:

◆ urbdrc_exchange_capabilities()

static UINT urbdrc_exchange_capabilities ( URBDRC_CHANNEL_CALLBACK *  callback,
wStream *  data 
)
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:

◆ urbdrc_load_udevman_addin()

static UINT urbdrc_load_udevman_addin ( IWTSPlugin *  pPlugin,
LPCSTR  name,
const ADDIN_ARGV *  args 
)
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:

◆ urbdrc_on_close()

static UINT urbdrc_on_close ( IWTSVirtualChannelCallback *  pChannelCallback)
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:

◆ urbdrc_on_data_received()

static UINT urbdrc_on_data_received ( IWTSVirtualChannelCallback *  pChannelCallback,
wStream *  data 
)
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:

◆ urbdrc_on_new_channel_connection()

static UINT urbdrc_on_new_channel_connection ( IWTSListenerCallback *  pListenerCallback,
IWTSVirtualChannel *  pChannel,
BYTE pData,
BOOL *  pbAccept,
IWTSVirtualChannelCallback **  ppCallback 
)
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:

◆ urbdrc_plugin_initialize()

static UINT urbdrc_plugin_initialize ( IWTSPlugin *  pPlugin,
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:

◆ urbdrc_plugin_terminated()

static UINT urbdrc_plugin_terminated ( IWTSPlugin *  pPlugin)
static

Function description

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

◆ urbdrc_process_addin_args()

static UINT urbdrc_process_addin_args ( URBDRC_PLUGIN *  urbdrc,
const ADDIN_ARGV *  args 
)
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:

◆ urbdrc_process_capability_request()

static UINT urbdrc_process_capability_request ( URBDRC_CHANNEL_CALLBACK *  callback,
wStream *  s,
UINT32  MessageId 
)
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:

◆ urbdrc_process_channel_create()

static UINT urbdrc_process_channel_create ( URBDRC_CHANNEL_CALLBACK *  callback,
wStream *  s,
UINT32  MessageId 
)
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:

◆ urbdrc_process_channel_notification()

static UINT urbdrc_process_channel_notification ( URBDRC_CHANNEL_CALLBACK *  callback,
wStream *  data 
)
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:

◆ urbdrc_register_udevman_addin()

static BOOL urbdrc_register_udevman_addin ( IWTSPlugin *  pPlugin,
IUDEVMAN *  udevman 
)
static
Here is the caller graph for this function:

◆ urbdrc_set_subsystem()

static BOOL urbdrc_set_subsystem ( URBDRC_PLUGIN *  urbdrc,
const char *  subsystem 
)
static
Here is the call graph for this function:
Here is the caller graph for this function:

◆ urdbrc_send_usb_device_add()

static UINT urdbrc_send_usb_device_add ( URBDRC_CHANNEL_CALLBACK *  callback,
IUDEVICE *  pdev 
)
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:

◆ urdbrc_send_virtual_channel_add()

static UINT urdbrc_send_virtual_channel_add ( IWTSPlugin *  plugin,
IWTSVirtualChannel *  channel,
UINT32  MessageId 
)
static
Here is the call graph for this function:
Here is the caller graph for this function: