From c1dfea16131e1c3533f5b64a1f99254fe81d7a1f Mon Sep 17 00:00:00 2001 From: Jay Sorg Date: Fri, 5 Oct 2012 10:13:53 -0700 Subject: [PATCH] chansrv: work on clipboard --- sesman/chansrv/chansrv.c | 6 +++--- sesman/chansrv/chansrv.h | 7 +++---- sesman/chansrv/clipboard.c | 10 +++++++--- sesman/chansrv/clipboard.h | 5 +++++ 4 files changed, 18 insertions(+), 10 deletions(-) diff --git a/sesman/chansrv/chansrv.c b/sesman/chansrv/chansrv.c index c2729a4f..81d14130 100644 --- a/sesman/chansrv/chansrv.c +++ b/sesman/chansrv/chansrv.c @@ -68,7 +68,7 @@ int g_exec_pid = 0; /* each time we create a DVC we need a unique DVC channel id */ /* this variable gets bumped up once per DVC we create */ -uint32_t g_dvc_chan_id = 100; +tui32 g_dvc_chan_id = 100; /*****************************************************************************/ /* add data to chan_item, on its way to the client */ @@ -1282,7 +1282,7 @@ find_empty_slot_in_dvc_channels() * @return xrdp_api_data struct containing dvc_chan_id or NULL on failure ******************************************************************************/ struct xrdp_api_data *APP_CC -struct_from_dvc_chan_id(uint32_t dvc_chan_id) +struct_from_dvc_chan_id(tui32 dvc_chan_id) { int i; @@ -1298,7 +1298,7 @@ struct_from_dvc_chan_id(uint32_t dvc_chan_id) } int -remove_struct_with_chan_id(uint32_t dvc_chan_id) +remove_struct_with_chan_id(tui32 dvc_chan_id) { int i; diff --git a/sesman/chansrv/chansrv.h b/sesman/chansrv/chansrv.h index 78efe29a..b8f47742 100644 --- a/sesman/chansrv/chansrv.h +++ b/sesman/chansrv/chansrv.h @@ -20,7 +20,6 @@ #if !defined(CHANSRV_H) #define CHANSRV_H -#include #include "arch.h" #include "parse.h" #include "log.h" @@ -51,15 +50,15 @@ struct xrdp_api_data /* for dynamic virtual channels */ struct trans *transp; - uint32_t dvc_chan_id; + tui32 dvc_chan_id; int is_connected; }; int APP_CC send_channel_data(int chan_id, char *data, int size); int APP_CC main_cleanup(void); int APP_CC find_empty_slot_in_dvc_channels(); -struct xrdp_api_data *APP_CC struct_from_dvc_chan_id(uint32_t dvc_chan_id); -int remove_struct_with_chan_id(uint32_t dvc_chan_id); +struct xrdp_api_data *APP_CC struct_from_dvc_chan_id(tui32 dvc_chan_id); +int remove_struct_with_chan_id(tui32 dvc_chan_id); #define LOG_LEVEL 5 diff --git a/sesman/chansrv/clipboard.c b/sesman/chansrv/clipboard.c index 70dff45b..183703f4 100644 --- a/sesman/chansrv/clipboard.c +++ b/sesman/chansrv/clipboard.c @@ -495,6 +495,7 @@ clipboard_send_format_announce(tui32 format_id, char *format_name) { if (format_id == CB_FORMAT_FILE) { + /* canned response for "file" */ out_uint32_le(s, 0x0000c0bc); clipboard_out_unicode(s, "FileGroupDescriptorW", 21); out_uint32_le(s, 0x0000c0ba); @@ -504,6 +505,7 @@ clipboard_send_format_announce(tui32 format_id, char *format_name) } else if (format_id == CB_FORMAT_DIB) { + /* canned response for "bitmap" */ out_uint32_le(s, 0x0000c004); clipboard_out_unicode(s, "Native", 7); out_uint32_le(s, 0x00000003); @@ -873,7 +875,8 @@ clipboard_process_data_response(struct stream *s, int clip_msg_status, if (g_want_image_data) { g_want_image_data = 0; - clipboard_process_data_response_for_image(s, clip_msg_status, clip_msg_len); + clipboard_process_data_response_for_image(s, clip_msg_status, + clip_msg_len); return 0; } @@ -942,8 +945,9 @@ clipboard_process_data_response(struct stream *s, int clip_msg_status, lxev = &(g_selection_request_event[index]); clipboard_provide_selection(lxev, lxev->target, 8, g_data_in, data_in_len); - LOGM((LOG_LEVEL_DEBUG, "clipboard_process_data_response: requestor %d " - "data_in_len %d", lxev->requestor, data_in_len)); + LOGM((LOG_LEVEL_DEBUG, "clipboard_process_data_response: " + "requestor %d data_in_len %d", + lxev->requestor, data_in_len)); } } diff --git a/sesman/chansrv/clipboard.h b/sesman/chansrv/clipboard.h index 9345ed32..deb70b6b 100644 --- a/sesman/chansrv/clipboard.h +++ b/sesman/chansrv/clipboard.h @@ -52,6 +52,11 @@ #define CB_FORMAT_GIF 0xD013 #define CB_FORMAT_FILE 0xC0BC +/* these are the supported general types */ +#define XRDP_CB_TEXT 1 +#define XRDP_CB_BITMAP 2 +#define XRDP_CB_FILE 3 + int APP_CC clipboard_init(void); int APP_CC