From 295123e7d577fcfb2a95b8e7765a431d540d38d3 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Marc-Andr=C3=A9=20Moreau?= Date: Fri, 24 Oct 2014 10:16:55 -0400 Subject: [PATCH] wfreerdp: fix cliprdr with callback interface --- client/Windows/wf_cliprdr.c | 24 ++++++++++++++++++++++-- 1 file changed, 22 insertions(+), 2 deletions(-) diff --git a/client/Windows/wf_cliprdr.c b/client/Windows/wf_cliprdr.c index 59f4355..9dbb1c3 100644 --- a/client/Windows/wf_cliprdr.c +++ b/client/Windows/wf_cliprdr.c @@ -1028,7 +1028,7 @@ static int cliprdr_send_format_list(wfClipboard* clipboard) CloseClipboard(); - formatList.msgFlags = CB_RESPONSE_OK; + formatList.msgFlags = 0; formatList.numFormats = numFormats; formatList.formats = formats; @@ -2208,11 +2208,31 @@ void wf_process_cliprdr_event(wfContext* wfc, wMessage* event) } } +int wf_cliprdr_send_client_capabilities(wfClipboard* clipboard) +{ + CLIPRDR_CAPABILITIES capabilities; + CLIPRDR_GENERAL_CAPABILITY_SET generalCapabilitySet; + + capabilities.cCapabilitiesSets = 1; + capabilities.capabilitySets = (CLIPRDR_CAPABILITY_SET*) &(generalCapabilitySet); + + generalCapabilitySet.capabilitySetType = CB_CAPSTYPE_GENERAL; + generalCapabilitySet.capabilitySetLength = 12; + + generalCapabilitySet.version = CB_CAPS_VERSION_2; + generalCapabilitySet.generalFlags = CB_USE_LONG_FORMAT_NAMES; + + clipboard->context->ClientCapabilities(clipboard->context, &capabilities); + + return 1; +} + static int wf_cliprdr_monitor_ready(CliprdrClientContext* context, CLIPRDR_MONITOR_READY* monitorReady) { wfClipboard* clipboard = (wfClipboard*) context->custom; clipboard->sync = TRUE; + wf_cliprdr_send_client_capabilities(clipboard); cliprdr_send_format_list(clipboard); return 1; @@ -2723,7 +2743,7 @@ void wf_cliprdr_init(wfContext* wfc, CliprdrClientContext* cliprdr) clipboard->wfc = wfc; clipboard->context = cliprdr; - if (0) + if (1) { cliprdr->custom = (void*) wfc->clipboard; clipboard->context = cliprdr; -- 2.7.4