[gnome-remote-desktop] clipboard-rdp: Add public async FileContents request functions
- From: Jonas Ådahl <jadahl src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-remote-desktop] clipboard-rdp: Add public async FileContents request functions
- Date: Thu, 18 Feb 2021 16:50:57 +0000 (UTC)
commit 6857f53612ad764d7415071112cedf930b6068de
Author: Pascal Nowack <Pascal Nowack gmx de>
Date: Thu Nov 12 16:07:30 2020 +0100
clipboard-rdp: Add public async FileContents request functions
In order to be able to manage the files, that were copied to the
clipboard, via FUSE, add public functions to request the file size of a
file and to request data of a file.
These functions don't handle the FileContentsResponse, which allows
the FUSE implementation for the clipboard to request the data in an
asynchronous way.
src/grd-clipboard-rdp.c | 41 +++++++++++++++++++++++++++++++++++++++++
src/grd-clipboard-rdp.h | 10 ++++++++++
2 files changed, 51 insertions(+)
---
diff --git a/src/grd-clipboard-rdp.c b/src/grd-clipboard-rdp.c
index 17c0768..8b4396f 100644
--- a/src/grd-clipboard-rdp.c
+++ b/src/grd-clipboard-rdp.c
@@ -464,6 +464,24 @@ request_remote_file_size (GrdClipboardRdp *clipboard_rdp,
return FALSE;
}
+void
+grd_clipboard_rdp_request_remote_file_size_async (GrdClipboardRdp *clipboard_rdp,
+ uint32_t stream_id,
+ uint32_t list_index)
+{
+ CliprdrServerContext *cliprdr_context = clipboard_rdp->cliprdr_context;
+ CLIPRDR_FILE_CONTENTS_REQUEST file_contents_request = {0};
+
+ file_contents_request.msgType = CB_FILECONTENTS_REQUEST;
+ file_contents_request.streamId = stream_id;
+ file_contents_request.listIndex = list_index;
+ file_contents_request.dwFlags = FILECONTENTS_SIZE;
+ file_contents_request.cbRequested = 0x8;
+
+ cliprdr_context->ServerFileContentsRequest (cliprdr_context,
+ &file_contents_request);
+}
+
static uint8_t *
request_remote_file_data (GrdClipboardRdp *clipboard_rdp,
uint32_t stream_id,
@@ -510,6 +528,29 @@ request_remote_file_data (GrdClipboardRdp *clipboard_rdp,
return requested_data;
}
+void
+grd_clipboard_rdp_request_remote_file_range_async (GrdClipboardRdp *clipboard_rdp,
+ uint32_t stream_id,
+ uint32_t list_index,
+ uint64_t offset,
+ uint32_t requested_size)
+{
+ CliprdrServerContext *cliprdr_context = clipboard_rdp->cliprdr_context;
+ CLIPRDR_FILE_CONTENTS_REQUEST file_contents_request = {0};
+
+ file_contents_request.msgType = CB_FILECONTENTS_REQUEST;
+ file_contents_request.streamId = stream_id;
+ file_contents_request.listIndex = list_index;
+ file_contents_request.dwFlags = FILECONTENTS_RANGE;
+ file_contents_request.nPositionLow = offset & 0xFFFFFFFF;
+ file_contents_request.nPositionHigh = offset >> 32 & 0xFFFFFFFF;
+ file_contents_request.cbRequested = requested_size;
+ file_contents_request.haveClipDataId = FALSE;
+
+ cliprdr_context->ServerFileContentsRequest (cliprdr_context,
+ &file_contents_request);
+}
+
static uint8_t *
get_uri_list_from_packet_file_list (GrdClipboardRdp *clipboard_rdp,
uint8_t *src_data,
diff --git a/src/grd-clipboard-rdp.h b/src/grd-clipboard-rdp.h
index bb37379..a832c56 100644
--- a/src/grd-clipboard-rdp.h
+++ b/src/grd-clipboard-rdp.h
@@ -34,4 +34,14 @@ GrdClipboardRdp *grd_clipboard_rdp_new (GrdSessionRdp *session_rdp,
HANDLE vcm,
HANDLE stop_event);
+void grd_clipboard_rdp_request_remote_file_size_async (GrdClipboardRdp *clipboard_rdp,
+ uint32_t stream_id,
+ uint32_t list_index);
+
+void grd_clipboard_rdp_request_remote_file_range_async (GrdClipboardRdp *clipboard_rdp,
+ uint32_t stream_id,
+ uint32_t list_index,
+ uint64_t offset,
+ uint32_t requested_size);
+
#endif /* GRD_CLIPBOARD_RDP_H */
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]