FreeRDP
client/rdpdr_main.c File Reference
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <winpr/crt.h>
#include <winpr/assert.h>
#include <winpr/stream.h>
#include <freerdp/types.h>
#include <freerdp/constants.h>
#include <freerdp/channels/log.h>
#include <freerdp/channels/rdpdr.h>
#include <sys/types.h>
#include <sys/stat.h>
#include <fcntl.h>
#include "rdpdr_capabilities.h"
#include "devman.h"
#include "irp.h"
#include "rdpdr_main.h"

Macros

#define MAX_USB_DEVICES   100
 
#define VirtualChannelEntryEx   rdpdr_VirtualChannelEntryEx
 

Functions

static UINT rdpdr_send_device_list_announce_request (rdpdrPlugin *rdpdr, BOOL userLoggedOn)
 
static UINT rdpdr_send_device_list_remove_request (rdpdrPlugin *rdpdr, UINT32 count, UINT32 ids[])
 
static BOOL isAutomountLocation (const char *path)
 
static void handle_mountpoint (hotplug_dev *dev_array, size_t *size, const char *mountpoint)
 
static UINT handle_platform_mounts (hotplug_dev *dev_array, size_t *size)
 
static BOOL device_already_plugged (rdpdrPlugin *rdpdr, const hotplug_dev *device)
 
static UINT handle_hotplug (rdpdrPlugin *rdpdr)
 
static void first_hotplug (rdpdrPlugin *rdpdr)
 
static DWORD WINAPI drive_hotplug_thread_func (LPVOID arg)
 
static UINT drive_hotplug_thread_terminate (rdpdrPlugin *rdpdr)
 
static UINT rdpdr_process_connect (rdpdrPlugin *rdpdr)
 
static UINT rdpdr_process_server_announce_request (rdpdrPlugin *rdpdr, wStream *s)
 
static UINT rdpdr_send_client_announce_reply (rdpdrPlugin *rdpdr)
 
static UINT rdpdr_send_client_name_request (rdpdrPlugin *rdpdr)
 
static UINT rdpdr_process_server_clientid_confirm (rdpdrPlugin *rdpdr, wStream *s)
 
static UINT dummy_irp_response (rdpdrPlugin *rdpdr, wStream *s)
 
static UINT rdpdr_process_irp (rdpdrPlugin *rdpdr, wStream *s)
 
static UINT rdpdr_process_component (rdpdrPlugin *rdpdr, UINT16 component, UINT16 packetId, wStream *s)
 
static UINT rdpdr_process_init (rdpdrPlugin *rdpdr)
 
static UINT rdpdr_process_receive (rdpdrPlugin *rdpdr, wStream *s)
 
UINT rdpdr_send (rdpdrPlugin *rdpdr, wStream *s)
 
static UINT rdpdr_virtual_channel_event_data_received (rdpdrPlugin *rdpdr, void *pData, UINT32 dataLength, UINT32 totalLength, UINT32 dataFlags)
 
static VOID VCAPITYPE rdpdr_virtual_channel_open_event_ex (LPVOID lpUserParam, DWORD openHandle, UINT event, LPVOID pData, UINT32 dataLength, UINT32 totalLength, UINT32 dataFlags)
 
static DWORD WINAPI rdpdr_virtual_channel_client_thread (LPVOID arg)
 
static void queue_free (void *obj)
 
static UINT rdpdr_virtual_channel_event_connected (rdpdrPlugin *rdpdr, LPVOID pData, UINT32 dataLength)
 
static UINT rdpdr_virtual_channel_event_disconnected (rdpdrPlugin *rdpdr)
 
static void rdpdr_virtual_channel_event_terminated (rdpdrPlugin *rdpdr)
 
static VOID VCAPITYPE rdpdr_virtual_channel_init_event_ex (LPVOID lpUserParam, LPVOID pInitHandle, UINT event, LPVOID pData, UINT dataLength)
 
BOOL VCAPITYPE VirtualChannelEntryEx (PCHANNEL_ENTRY_POINTS pEntryPoints, PVOID pInitHandle)
 

Variables

static const char * automountLocations []
 

Macro Definition Documentation

◆ MAX_USB_DEVICES

#define MAX_USB_DEVICES   100

◆ VirtualChannelEntryEx

#define VirtualChannelEntryEx   rdpdr_VirtualChannelEntryEx

Function Documentation

◆ device_already_plugged()

static BOOL device_already_plugged ( rdpdrPlugin *  rdpdr,
const hotplug_dev *  device 
)
static
Here is the call graph for this function:
Here is the caller graph for this function:

◆ drive_hotplug_thread_func()

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

◆ drive_hotplug_thread_terminate()

static UINT drive_hotplug_thread_terminate ( rdpdrPlugin *  rdpdr)
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:

◆ dummy_irp_response()

static UINT dummy_irp_response ( rdpdrPlugin *  rdpdr,
wStream *  s 
)
static
Here is the call graph for this function:
Here is the caller graph for this function:

◆ first_hotplug()

static void first_hotplug ( rdpdrPlugin *  rdpdr)
static
Here is the call graph for this function:
Here is the caller graph for this function:

◆ handle_hotplug()

static UINT handle_hotplug ( rdpdrPlugin *  rdpdr)
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:

◆ handle_mountpoint()

static void handle_mountpoint ( hotplug_dev *  dev_array,
size_t *  size,
const char *  mountpoint 
)
static
Here is the call graph for this function:

◆ handle_platform_mounts()

static UINT handle_platform_mounts ( hotplug_dev *  dev_array,
size_t *  size 
)
static
Here is the caller graph for this function:

◆ isAutomountLocation()

static BOOL isAutomountLocation ( const char *  path)
static
Here is the caller graph for this function:

◆ queue_free()

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

◆ rdpdr_process_component()

static UINT rdpdr_process_component ( rdpdrPlugin *  rdpdr,
UINT16  component,
UINT16  packetId,
wStream *  s 
)
static
Here is the call graph for this function:
Here is the caller graph for this function:

◆ rdpdr_process_connect()

static UINT rdpdr_process_connect ( rdpdrPlugin *  rdpdr)
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:

◆ rdpdr_process_init()

static UINT rdpdr_process_init ( rdpdrPlugin *  rdpdr)
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:

◆ rdpdr_process_irp()

static UINT rdpdr_process_irp ( rdpdrPlugin *  rdpdr,
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:

◆ rdpdr_process_receive()

static UINT rdpdr_process_receive ( rdpdrPlugin *  rdpdr,
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:

◆ rdpdr_process_server_announce_request()

static UINT rdpdr_process_server_announce_request ( rdpdrPlugin *  rdpdr,
wStream *  s 
)
static
Here is the call graph for this function:
Here is the caller graph for this function:

◆ rdpdr_process_server_clientid_confirm()

static UINT rdpdr_process_server_clientid_confirm ( rdpdrPlugin *  rdpdr,
wStream *  s 
)
static
Here is the call graph for this function:
Here is the caller graph for this function:

◆ rdpdr_send()

UINT rdpdr_send ( rdpdrPlugin *  rdpdr,
wStream *  s 
)

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:

◆ rdpdr_send_client_announce_reply()

static UINT rdpdr_send_client_announce_reply ( rdpdrPlugin *  rdpdr)
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:

◆ rdpdr_send_client_name_request()

static UINT rdpdr_send_client_name_request ( rdpdrPlugin *  rdpdr)
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:

◆ rdpdr_send_device_list_announce_request()

static UINT rdpdr_send_device_list_announce_request ( rdpdrPlugin *  rdpdr,
BOOL  userLoggedOn 
)
static

Function description

Returns
0 on success, otherwise a Win32 error code
  1. versionMinor 0x0005 doesn't send PAKID_CORE_USER_LOGGEDON so all devices should be sent regardless of user_loggedon
  2. smartcard devices should be always sent
  3. other devices are sent only after user_loggedon
Here is the call graph for this function:
Here is the caller graph for this function:

◆ rdpdr_send_device_list_remove_request()

static UINT rdpdr_send_device_list_remove_request ( rdpdrPlugin *  rdpdr,
UINT32  count,
UINT32  ids[] 
)
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:

◆ rdpdr_virtual_channel_client_thread()

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

◆ rdpdr_virtual_channel_event_connected()

static UINT rdpdr_virtual_channel_event_connected ( rdpdrPlugin *  rdpdr,
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:

◆ rdpdr_virtual_channel_event_data_received()

static UINT rdpdr_virtual_channel_event_data_received ( rdpdrPlugin *  rdpdr,
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:

◆ rdpdr_virtual_channel_event_disconnected()

static UINT rdpdr_virtual_channel_event_disconnected ( rdpdrPlugin *  rdpdr)
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:

◆ rdpdr_virtual_channel_event_terminated()

static void rdpdr_virtual_channel_event_terminated ( rdpdrPlugin *  rdpdr)
static
Here is the caller graph for this function:

◆ rdpdr_virtual_channel_init_event_ex()

static VOID VCAPITYPE rdpdr_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:

◆ rdpdr_virtual_channel_open_event_ex()

static VOID VCAPITYPE rdpdr_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:

◆ VirtualChannelEntryEx()

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

Variable Documentation

◆ automountLocations

const char* automountLocations[]
static
Initial value:
= { "/run/user/%lu/gvfs", "/run/media/%s", "/media/%s",
"/media", "/mnt" }