FreeRDP
server/cliprdr_main.c File Reference
#include <freerdp/config.h>
#include <winpr/crt.h>
#include <winpr/assert.h>
#include <winpr/print.h>
#include <winpr/stream.h>
#include <freerdp/freerdp.h>
#include <freerdp/channels/log.h>
#include "cliprdr_main.h"
#include "../cliprdr_common.h"

Functions

static UINT cliprdr_server_packet_send (CliprdrServerPrivate *cliprdr, wStream *s)
 
static UINT cliprdr_server_capabilities (CliprdrServerContext *context, const CLIPRDR_CAPABILITIES *capabilities)
 
static UINT cliprdr_server_monitor_ready (CliprdrServerContext *context, const CLIPRDR_MONITOR_READY *monitorReady)
 
static UINT cliprdr_server_format_list (CliprdrServerContext *context, const CLIPRDR_FORMAT_LIST *formatList)
 
static UINT cliprdr_server_format_list_response (CliprdrServerContext *context, const CLIPRDR_FORMAT_LIST_RESPONSE *formatListResponse)
 
static UINT cliprdr_server_lock_clipboard_data (CliprdrServerContext *context, const CLIPRDR_LOCK_CLIPBOARD_DATA *lockClipboardData)
 
static UINT cliprdr_server_unlock_clipboard_data (CliprdrServerContext *context, const CLIPRDR_UNLOCK_CLIPBOARD_DATA *unlockClipboardData)
 
static UINT cliprdr_server_format_data_request (CliprdrServerContext *context, const CLIPRDR_FORMAT_DATA_REQUEST *formatDataRequest)
 
static UINT cliprdr_server_format_data_response (CliprdrServerContext *context, const CLIPRDR_FORMAT_DATA_RESPONSE *formatDataResponse)
 
static UINT cliprdr_server_file_contents_request (CliprdrServerContext *context, const CLIPRDR_FILE_CONTENTS_REQUEST *fileContentsRequest)
 
static UINT cliprdr_server_file_contents_response (CliprdrServerContext *context, const CLIPRDR_FILE_CONTENTS_RESPONSE *fileContentsResponse)
 
static UINT cliprdr_server_receive_general_capability (CliprdrServerContext *context, wStream *s, CLIPRDR_GENERAL_CAPABILITY_SET *cap_set)
 
static UINT cliprdr_server_receive_capabilities (CliprdrServerContext *context, wStream *s, const CLIPRDR_HEADER *header)
 
static UINT cliprdr_server_receive_temporary_directory (CliprdrServerContext *context, wStream *s, const CLIPRDR_HEADER *header)
 
static UINT cliprdr_server_receive_format_list (CliprdrServerContext *context, wStream *s, const CLIPRDR_HEADER *header)
 
static UINT cliprdr_server_receive_format_list_response (CliprdrServerContext *context, wStream *s, const CLIPRDR_HEADER *header)
 
static UINT cliprdr_server_receive_lock_clipdata (CliprdrServerContext *context, wStream *s, const CLIPRDR_HEADER *header)
 
static UINT cliprdr_server_receive_unlock_clipdata (CliprdrServerContext *context, wStream *s, const CLIPRDR_HEADER *header)
 
static UINT cliprdr_server_receive_format_data_request (CliprdrServerContext *context, wStream *s, const CLIPRDR_HEADER *header)
 
static UINT cliprdr_server_receive_format_data_response (CliprdrServerContext *context, wStream *s, const CLIPRDR_HEADER *header)
 
static UINT cliprdr_server_receive_filecontents_request (CliprdrServerContext *context, wStream *s, const CLIPRDR_HEADER *header)
 
static UINT cliprdr_server_receive_filecontents_response (CliprdrServerContext *context, wStream *s, const CLIPRDR_HEADER *header)
 
static UINT cliprdr_server_receive_pdu (CliprdrServerContext *context, wStream *s, const CLIPRDR_HEADER *header)
 
static UINT cliprdr_server_init (CliprdrServerContext *context)
 
static UINT cliprdr_server_read (CliprdrServerContext *context)
 
static DWORD WINAPI cliprdr_server_thread (LPVOID arg)
 
static UINT cliprdr_server_open (CliprdrServerContext *context)
 
static UINT cliprdr_server_close (CliprdrServerContext *context)
 
static UINT cliprdr_server_start (CliprdrServerContext *context)
 
static UINT cliprdr_server_stop (CliprdrServerContext *context)
 
static HANDLE cliprdr_server_get_event_handle (CliprdrServerContext *context)
 
static UINT cliprdr_server_check_event_handle (CliprdrServerContext *context)
 
CliprdrServerContext * cliprdr_server_context_new (HANDLE vcm)
 
void cliprdr_server_context_free (CliprdrServerContext *context)
 

Function Documentation

◆ cliprdr_server_capabilities()

static UINT cliprdr_server_capabilities ( CliprdrServerContext *  context,
const CLIPRDR_CAPABILITIES capabilities 
)
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:

◆ cliprdr_server_check_event_handle()

static UINT cliprdr_server_check_event_handle ( CliprdrServerContext *  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:

◆ cliprdr_server_close()

static UINT cliprdr_server_close ( CliprdrServerContext *  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:

◆ cliprdr_server_context_free()

void cliprdr_server_context_free ( CliprdrServerContext *  context)
Here is the call graph for this function:
Here is the caller graph for this function:

◆ cliprdr_server_context_new()

CliprdrServerContext* cliprdr_server_context_new ( HANDLE  vcm)
Here is the call graph for this function:
Here is the caller graph for this function:

◆ cliprdr_server_file_contents_request()

static UINT cliprdr_server_file_contents_request ( CliprdrServerContext *  context,
const CLIPRDR_FILE_CONTENTS_REQUEST fileContentsRequest 
)
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:

◆ cliprdr_server_file_contents_response()

static UINT cliprdr_server_file_contents_response ( CliprdrServerContext *  context,
const CLIPRDR_FILE_CONTENTS_RESPONSE fileContentsResponse 
)
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:

◆ cliprdr_server_format_data_request()

static UINT cliprdr_server_format_data_request ( CliprdrServerContext *  context,
const CLIPRDR_FORMAT_DATA_REQUEST formatDataRequest 
)
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:

◆ cliprdr_server_format_data_response()

static UINT cliprdr_server_format_data_response ( CliprdrServerContext *  context,
const CLIPRDR_FORMAT_DATA_RESPONSE formatDataResponse 
)
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:

◆ cliprdr_server_format_list()

static UINT cliprdr_server_format_list ( CliprdrServerContext *  context,
const CLIPRDR_FORMAT_LIST formatList 
)
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:

◆ cliprdr_server_format_list_response()

static UINT cliprdr_server_format_list_response ( CliprdrServerContext *  context,
const CLIPRDR_FORMAT_LIST_RESPONSE formatListResponse 
)
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:

◆ cliprdr_server_get_event_handle()

static HANDLE cliprdr_server_get_event_handle ( CliprdrServerContext *  context)
static
Here is the caller graph for this function:

◆ cliprdr_server_init()

static UINT cliprdr_server_init ( CliprdrServerContext *  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:

◆ cliprdr_server_lock_clipboard_data()

static UINT cliprdr_server_lock_clipboard_data ( CliprdrServerContext *  context,
const CLIPRDR_LOCK_CLIPBOARD_DATA lockClipboardData 
)
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:

◆ cliprdr_server_monitor_ready()

static UINT cliprdr_server_monitor_ready ( CliprdrServerContext *  context,
const CLIPRDR_MONITOR_READY monitorReady 
)
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:

◆ cliprdr_server_open()

static UINT cliprdr_server_open ( CliprdrServerContext *  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:

◆ cliprdr_server_packet_send()

static UINT cliprdr_server_packet_send ( CliprdrServerPrivate cliprdr,
wStream s 
)
static

FreeRDP: A Remote Desktop Protocol Implementation Clipboard Virtual Channel Extension

Copyright 2013 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.

                           Initialization Sequence\n

Client Server
| |
|<-------------------—Server Clipboard Capabilities PDU--------------—|
|<--------------------------—Monitor Ready PDU-----------------------—|
|--------------------—Client Clipboard Capabilities PDU-------------—>|
|------------------------—Temporary Directory PDU-------------------—>|
|----------------------------—Format List PDU-----------------------—>|
|<-----------------------—Format List Response PDU-------------------—|

                               Data Transfer Sequences\n
Shared                                                                     Local\n

Clipboard Owner Clipboard Owner
| |
|----------------------------------------------------------------------—|
_ |----------------------------—Format List PDU-----------------------—>|
| |<-----------------------—Format List Response PDU-------------------—|
_| Copy Sequence |<------------------—Lock Clipboard Data PDU (Optional)--------------—|
|----------------------------------------------------------------------—|
|----------------------------------------------------------------------—|
_ |<-----------------------—Format Data Request PDU--------------------—|
| Paste Sequence Palette, |------------------------—Format Data Response PDU------------------—>|
_| Metafile, File List Data |----------------------------------------------------------------------—|
|----------------------------------------------------------------------—|
_ |<---------------------—Format Contents Request PDU------------------—|
| Paste Sequence |----------------------—Format Contents Response PDU----------------—>|
_| File Stream Data |<------------------—Lock Clipboard Data PDU (Optional)--------------—|
|----------------------------------------------------------------------—|
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:

◆ cliprdr_server_read()

static UINT cliprdr_server_read ( CliprdrServerContext *  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:

◆ cliprdr_server_receive_capabilities()

static UINT cliprdr_server_receive_capabilities ( CliprdrServerContext *  context,
wStream s,
const CLIPRDR_HEADER header 
)
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:

◆ cliprdr_server_receive_filecontents_request()

static UINT cliprdr_server_receive_filecontents_request ( CliprdrServerContext *  context,
wStream s,
const CLIPRDR_HEADER header 
)
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:

◆ cliprdr_server_receive_filecontents_response()

static UINT cliprdr_server_receive_filecontents_response ( CliprdrServerContext *  context,
wStream s,
const CLIPRDR_HEADER header 
)
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:

◆ cliprdr_server_receive_format_data_request()

static UINT cliprdr_server_receive_format_data_request ( CliprdrServerContext *  context,
wStream s,
const CLIPRDR_HEADER header 
)
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:

◆ cliprdr_server_receive_format_data_response()

static UINT cliprdr_server_receive_format_data_response ( CliprdrServerContext *  context,
wStream s,
const CLIPRDR_HEADER header 
)
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:

◆ cliprdr_server_receive_format_list()

static UINT cliprdr_server_receive_format_list ( CliprdrServerContext *  context,
wStream s,
const CLIPRDR_HEADER header 
)
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:

◆ cliprdr_server_receive_format_list_response()

static UINT cliprdr_server_receive_format_list_response ( CliprdrServerContext *  context,
wStream s,
const CLIPRDR_HEADER header 
)
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:

◆ cliprdr_server_receive_general_capability()

static UINT cliprdr_server_receive_general_capability ( CliprdrServerContext *  context,
wStream s,
CLIPRDR_GENERAL_CAPABILITY_SET cap_set 
)
static

Function description

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

◆ cliprdr_server_receive_lock_clipdata()

static UINT cliprdr_server_receive_lock_clipdata ( CliprdrServerContext *  context,
wStream s,
const CLIPRDR_HEADER header 
)
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:

◆ cliprdr_server_receive_pdu()

static UINT cliprdr_server_receive_pdu ( CliprdrServerContext *  context,
wStream s,
const CLIPRDR_HEADER header 
)
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:

◆ cliprdr_server_receive_temporary_directory()

static UINT cliprdr_server_receive_temporary_directory ( CliprdrServerContext *  context,
wStream s,
const CLIPRDR_HEADER header 
)
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:

◆ cliprdr_server_receive_unlock_clipdata()

static UINT cliprdr_server_receive_unlock_clipdata ( CliprdrServerContext *  context,
wStream s,
const CLIPRDR_HEADER header 
)
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:

◆ cliprdr_server_start()

static UINT cliprdr_server_start ( CliprdrServerContext *  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:

◆ cliprdr_server_stop()

static UINT cliprdr_server_stop ( CliprdrServerContext *  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:

◆ cliprdr_server_thread()

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

◆ cliprdr_server_unlock_clipboard_data()

static UINT cliprdr_server_unlock_clipboard_data ( CliprdrServerContext *  context,
const CLIPRDR_UNLOCK_CLIPBOARD_DATA unlockClipboardData 
)
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: