FreeRDP
client/rdpdr_main.c File Reference
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <winpr/crt.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 char * next_line (FILE *fd, size_t *len)
 
static char * get_word (char *str, unsigned int *offset)
 
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 rdpdr_process_irp (rdpdrPlugin *rdpdr, 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 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

#define MAX_USB_DEVICES   100
#define VirtualChannelEntryEx   rdpdr_VirtualChannelEntryEx

Function Documentation

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:

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:

static void first_hotplug ( rdpdrPlugin *  rdpdr)
static

Here is the call graph for this function:

Here is the caller graph for this function:

static char* get_word ( char *  str,
unsigned int *  offset 
)
static

Here is the caller graph for this function:

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:

static BOOL isAutomountLocation ( const char *  path)
static

Here is the caller graph for this function:

static char* next_line ( FILE *  fd,
size_t *  len 
)
static

Here is the caller graph for this function:

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:

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:

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:

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:

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:

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:

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:

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:

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:

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:

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:

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:

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:

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:

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:

static void rdpdr_virtual_channel_event_terminated ( rdpdrPlugin *  rdpdr)
static

Here is the caller graph for this function:

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:

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:

BOOL VCAPITYPE VirtualChannelEntryEx ( PCHANNEL_ENTRY_POINTS  pEntryPoints,
PVOID  pInitHandle 
)

Here is the call graph for this function:

Variable Documentation

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