From 5db5136bde61b827926d7fced44a4a5eb30f39ac Mon Sep 17 00:00:00 2001 From: akallabeth Date: Thu, 27 Mar 2025 15:46:50 +0100 Subject: [PATCH] [client,windows] ignore clipboard failures --- client/Windows/wf_cliprdr.c | 21 +++++++++++++++++---- 1 file changed, 17 insertions(+), 4 deletions(-) diff --git a/client/Windows/wf_cliprdr.c b/client/Windows/wf_cliprdr.c index e489739fa..085d4d5d7 100644 --- a/client/Windows/wf_cliprdr.c +++ b/client/Windows/wf_cliprdr.c @@ -2163,13 +2163,26 @@ wf_cliprdr_server_format_data_request(CliprdrClientContext* context, UINT rc = ERROR_INTERNAL_ERROR; if (res >= 0) { - CLIPRDR_FORMAT_DATA_RESPONSE response = { .common = { .msgType = CB_FORMAT_DATA_RESPONSE, - .msgFlags = CB_RESPONSE_OK, - .dataLen = (uint32_t)res }, - .requestedFormatData = requestedFormatData }; + const CLIPRDR_FORMAT_DATA_RESPONSE response = { + .common = { .msgType = CB_FORMAT_DATA_RESPONSE, + .msgFlags = CB_RESPONSE_OK, + .dataLen = (uint32_t)res }, + .requestedFormatData = requestedFormatData + }; rc = clipboard->context->ClientFormatDataResponse(clipboard->context, &response); } + else + { + const CLIPRDR_FORMAT_DATA_RESPONSE response = { .common = { .msgType = + CB_FORMAT_DATA_RESPONSE, + .msgFlags = CB_RESPONSE_FAIL, + .dataLen = 0 }, + .requestedFormatData = NULL }; + + rc = clipboard->context->ClientFormatDataResponse(clipboard->context, &response); + } + free(requestedFormatData); return rc; }