VirtualBox

source: vbox/trunk/include/VBox/HostServices/VBoxClipboardSvc.h@ 80318

Last change on this file since 80318 was 80318, checked in by vboxsync, 6 years ago

Shared Clipboard/URI: More work on context IDs and entry list handling.

  • Property svn:eol-style set to native
  • Property svn:keywords set to Id Revision
File size: 24.4 KB
Line 
1/** @file
2 * Shared Clipboard - Common header for host service and guest clients.
3 */
4
5/*
6 * Copyright (C) 2006-2019 Oracle Corporation
7 *
8 * This file is part of VirtualBox Open Source Edition (OSE), as
9 * available from http://www.virtualbox.org. This file is free software;
10 * you can redistribute it and/or modify it under the terms of the GNU
11 * General Public License (GPL) as published by the Free Software
12 * Foundation, in version 2 as it comes in the "COPYING" file of the
13 * VirtualBox OSE distribution. VirtualBox OSE is distributed in the
14 * hope that it will be useful, but WITHOUT ANY WARRANTY of any kind.
15 *
16 * The contents of this file may alternatively be used under the terms
17 * of the Common Development and Distribution License Version 1.0
18 * (CDDL) only, as it comes in the "COPYING.CDDL" file of the
19 * VirtualBox OSE distribution, in which case the provisions of the
20 * CDDL are applicable instead of those of the GPL.
21 *
22 * You may elect to license modified versions of this file under the
23 * terms and conditions of either the GPL or the CDDL or both.
24 */
25
26#ifndef VBOX_INCLUDED_HostServices_VBoxClipboardSvc_h
27#define VBOX_INCLUDED_HostServices_VBoxClipboardSvc_h
28#ifndef RT_WITHOUT_PRAGMA_ONCE
29# pragma once
30#endif
31
32#include <VBox/VMMDevCoreTypes.h>
33#include <VBox/VBoxGuestCoreTypes.h>
34#include <VBox/hgcmsvc.h>
35
36#ifdef VBOX_WITH_SHARED_CLIPBOARD_URI_LIST
37#include <VBox/GuestHost/SharedClipboard-uri.h>
38#endif
39
40/*
41 * The mode of operations.
42 */
43#define VBOX_SHARED_CLIPBOARD_MODE_OFF 0
44#define VBOX_SHARED_CLIPBOARD_MODE_HOST_TO_GUEST 1
45#define VBOX_SHARED_CLIPBOARD_MODE_GUEST_TO_HOST 2
46#define VBOX_SHARED_CLIPBOARD_MODE_BIDIRECTIONAL 3
47
48/*
49 * The service functions which are callable by host.
50 */
51/** Sets the current Shared Clipboard operation mode. */
52#define VBOX_SHARED_CLIPBOARD_HOST_FN_SET_MODE 1
53/** Run headless on the host, i.e. do not touch the host clipboard. */
54#define VBOX_SHARED_CLIPBOARD_HOST_FN_SET_HEADLESS 2
55/** Reports cancellation of the current operation to the guest. */
56#define VBOX_SHARED_CLIPBOARD_HOST_FN_CANCEL 3
57/** Reports an error to the guest. */
58#define VBOX_SHARED_CLIPBOARD_HOST_FN_ERROR 4
59/** Reports that a new clipboard area has been registered. */
60#define VBOX_SHARED_CLIPBOARD_HOST_FN_AREA_REGISTER 5
61/** Reports that a clipboard area has been unregistered. */
62#define VBOX_SHARED_CLIPBOARD_HOST_FN_AREA_UNREGISTER 6
63/** Reports that a client (host / guest) has attached to a clipboard area. */
64#define VBOX_SHARED_CLIPBOARD_HOST_FN_AREA_ATTACH 7
65/** Reports that a client (host / guest) has detached from a clipboard area. */
66#define VBOX_SHARED_CLIPBOARD_HOST_FN_AREA_DETACH 8
67
68/**
69 * The host messages for the guest.
70 */
71#define VBOX_SHARED_CLIPBOARD_HOST_MSG_QUIT 1
72#define VBOX_SHARED_CLIPBOARD_HOST_MSG_READ_DATA 2
73#define VBOX_SHARED_CLIPBOARD_HOST_MSG_REPORT_FORMATS 3
74
75/** Initiates a new transfer (read / write) on the guest side. */
76#define VBOX_SHARED_CLIPBOARD_HOST_MSG_URI_TRANSFER_START 50
77/** Reads the root list header from the guest. */
78#define VBOX_SHARED_CLIPBOARD_HOST_MSG_URI_ROOT_LIST_HDR_READ 51
79/** Writes the root list header to the guest. */
80#define VBOX_SHARED_CLIPBOARD_HOST_MSG_URI_ROOT_LIST_HDR_WRITE 52
81/** Reads a root list entry from the guest. */
82#define VBOX_SHARED_CLIPBOARD_HOST_MSG_URI_ROOT_LIST_ENTRY_READ 53
83/** Writes a root list entry to the guest. */
84#define VBOX_SHARED_CLIPBOARD_HOST_MSG_URI_ROOT_LIST_ENTRY_WRITE 54
85/** Open an URI list on the guest side. */
86#define VBOX_SHARED_CLIPBOARD_HOST_MSG_URI_LIST_OPEN 55
87/** Closes a formerly opened URI list on the guest side. */
88#define VBOX_SHARED_CLIPBOARD_HOST_MSG_URI_LIST_CLOSE 56
89/** Reads a list header from the guest. */
90#define VBOX_SHARED_CLIPBOARD_HOST_MSG_URI_LIST_HDR_READ 57
91/** Writes a list header to the guest. */
92#define VBOX_SHARED_CLIPBOARD_HOST_MSG_URI_LIST_HDR_WRITE 58
93/** Reads a list entry from the guest. */
94#define VBOX_SHARED_CLIPBOARD_HOST_MSG_URI_LIST_ENTRY_READ 59
95/** Writes a list entry to the guest. */
96#define VBOX_SHARED_CLIPBOARD_HOST_MSG_URI_LIST_ENTRY_WRITE 60
97/** Open an URI object on the guest side. */
98#define VBOX_SHARED_CLIPBOARD_HOST_MSG_URI_OBJ_OPEN 61
99/** Closes a formerly opened URI object on the guest side. */
100#define VBOX_SHARED_CLIPBOARD_HOST_MSG_URI_OBJ_CLOSE 62
101/** Reads from an object on the guest side. */
102#define VBOX_SHARED_CLIPBOARD_HOST_MSG_URI_OBJ_READ 63
103/** Writes to an object on the guest side. */
104#define VBOX_SHARED_CLIPBOARD_HOST_MSG_URI_OBJ_WRITE 64
105/** Indicates that the host has canceled a transfer. */
106#define VBOX_SHARED_CLIPBOARD_HOST_MSG_URI_CANCEL 65
107/** Indicates that the an unrecoverable error on the host occurred . */
108#define VBOX_SHARED_CLIPBOARD_HOST_MSG_URI_ERROR 66
109
110/*
111 * The service functions which are called by guest.
112 */
113/** Calls the host and waits (blocking) for an host event VBOX_SHARED_CLIPBOARD_HOST_MSG_*.
114 * Note: This is the old message which still is being used for the non-URI Shared Clipboard transfers,
115 * to not break compatibility with older Guest Additions / VBox versions. */
116#define VBOX_SHARED_CLIPBOARD_GUEST_FN_GET_HOST_MSG_OLD 1
117/** Sends a list of available formats to the host. */
118#define VBOX_SHARED_CLIPBOARD_GUEST_FN_REPORT_FORMATS 2
119/** Reads data in specified format from the host. */
120#define VBOX_SHARED_CLIPBOARD_GUEST_FN_READ_DATA 3
121/** Writes data in requested format to the host. */
122#define VBOX_SHARED_CLIPBOARD_GUEST_FN_WRITE_DATA 4
123
124/** Peeks at the next message, returning immediately.
125 * New since URI handling was implemented. */
126#define VBOX_SHARED_CLIPBOARD_GUEST_FN_MSG_PEEK_NOWAIT 5
127/** Peeks at the next message, waiting for one to arrive.
128 * New since URI handling was implemented. */
129#define VBOX_SHARED_CLIPBOARD_GUEST_FN_MSG_PEEK_WAIT 6
130/** Gets the next message, returning immediately.
131 * New since URI handling was implemented. */
132#define VBOX_SHARED_CLIPBOARD_GUEST_FN_MSG_GET 7
133/** Sends a transfer status to the host.
134 * New since URI handling was implemented. */
135#define VBOX_SHARED_CLIPBOARD_GUEST_FN_STATUS 8
136/** Replies to a function from the host.
137 * New since URI handling was implemented. */
138#define VBOX_SHARED_CLIPBOARD_GUEST_FN_REPLY 9
139/** Reports the available root entries of a transfer.
140 * New since URI handling was implemented. */
141#define VBOX_SHARED_CLIPBOARD_GUEST_FN_ROOT_LIST_HDR_READ 10
142/** Reports the available root entries of a transfer.
143 * New since URI handling was implemented. */
144#define VBOX_SHARED_CLIPBOARD_GUEST_FN_ROOT_LIST_HDR_WRITE 11
145/** Reports the available root entries of a transfer.
146 * New since URI handling was implemented. */
147#define VBOX_SHARED_CLIPBOARD_GUEST_FN_ROOT_LIST_ENTRY_READ 12
148/** Reports the available root entries of a transfer.
149 * New since URI handling was implemented. */
150#define VBOX_SHARED_CLIPBOARD_GUEST_FN_ROOT_LIST_ENTRY_WRITE 13
151/** Opens / gets a list handle from the host.
152 * New since URI handling was implemented. */
153#define VBOX_SHARED_CLIPBOARD_GUEST_FN_LIST_OPEN 14
154/** Closes a list handle from the host.
155 * New since URI handling was implemented. */
156#define VBOX_SHARED_CLIPBOARD_GUEST_FN_LIST_CLOSE 15
157/** Reads a list header from the host.
158 * New since URI handling was implemented. */
159#define VBOX_SHARED_CLIPBOARD_GUEST_FN_LIST_HDR_READ 16
160/** Writes a list header to the host.
161 * New since URI handling was implemented. */
162#define VBOX_SHARED_CLIPBOARD_GUEST_FN_LIST_HDR_WRITE 17
163/** New since URI handling was implemented. */
164#define VBOX_SHARED_CLIPBOARD_GUEST_FN_LIST_ENTRY_READ 18
165/** New since URI handling was implemented. */
166#define VBOX_SHARED_CLIPBOARD_GUEST_FN_LIST_ENTRY_WRITE 19
167/** New since URI handling was implemented. */
168#define VBOX_SHARED_CLIPBOARD_GUEST_FN_OBJ_OPEN 20
169/** New since URI handling was implemented. */
170#define VBOX_SHARED_CLIPBOARD_GUEST_FN_OBJ_CLOSE 21
171/** New since URI handling was implemented. */
172#define VBOX_SHARED_CLIPBOARD_GUEST_FN_OBJ_READ 22
173/** New since URI handling was implemented. */
174#define VBOX_SHARED_CLIPBOARD_GUEST_FN_OBJ_WRITE 23
175/** Reports cancellation of the current operation to the host.
176 * New since URI handling was implemented. */
177#define VBOX_SHARED_CLIPBOARD_GUEST_FN_CANCEL 24
178/** Reports an error to the host.
179 * New since URI handling was implemented. */
180#define VBOX_SHARED_CLIPBOARD_GUEST_FN_ERROR 25
181
182/** The maximum default chunk size for a single data transfer. */
183#define VBOX_SHARED_CLIPBOARD_MAX_CHUNK_SIZE _64K
184
185/** Maximum number of concurrent Shared Clipboard transfers a VM can have. */
186#define VBOX_SHARED_CLIPBOARD_MAX_TRANSFERS UINT16_MAX
187/** Maximum number of concurrent events a transfer can have. */
188#define VBOX_SHARED_CLIPBOARD_MAX_EVENTS UINT16_MAX
189
190/** Creates a context ID out of a transfer ID. */
191#define VBOX_SHARED_CLIPBOARD_CONTEXTID_MAKE(uTransfer, uEvent) \
192 RT_MAKE_U32(uEvent, uTransfer)
193/** Gets the transfer ID out of a context ID. */
194#define VBOX_SHARED_CLIPBOARD_CONTEXTID_GET_TRANSFER(uContextID) \
195 RT_HI_U16(uContextID)
196/** Gets the event ID out of a context ID. */
197#define VBOX_SHARED_CLIPBOARD_CONTEXTID_GET_EVENT(uContextID) \
198 RT_LO_U16(uContextID)
199
200/**
201 * Structure for keeping a Shared Clipboard HGCM message context.
202 */
203typedef struct _VBOXSHCLMSGCTX
204{
205 /** Context ID. */
206 uint32_t uContextID;
207} VBOXSHCLMSGCTX, *PVBOXSHCLMSGCTX;
208
209/*
210 * HGCM parameter structures.
211 */
212#pragma pack(1)
213typedef struct _VBoxClipboardGetHostMsgOld
214{
215 VBGLIOCHGCMCALL hdr;
216
217 /* VBOX_SHARED_CLIPBOARD_HOST_MSG_* */
218 HGCMFunctionParameter msg; /* OUT uint32_t */
219
220 /* VBOX_SHARED_CLIPBOARD_FMT_*, depends on the 'msg'. */
221 HGCMFunctionParameter formats; /* OUT uint32_t */
222} VBoxClipboardGetHostMsgOld;
223
224#define VBOX_SHARED_CLIPBOARD_CPARMS_GET_HOST_MSG_OLD 2
225
226typedef struct _VBoxClipboardReportFormatsMsg
227{
228 VBGLIOCHGCMCALL hdr;
229
230 /* VBOX_SHARED_CLIPBOARD_FMT_* */
231 HGCMFunctionParameter formats; /* OUT uint32_t */
232} VBoxClipboardReportFormatsMsg;
233
234#define VBOX_SHARED_CLIPBOARD_CPARMS_REPORT_FORMATS 1
235
236typedef struct _VBoxClipboardReadDataMsg
237{
238 VBGLIOCHGCMCALL hdr;
239
240 /* Requested format. */
241 HGCMFunctionParameter format; /* IN uint32_t */
242
243 /* The data buffer. */
244 HGCMFunctionParameter ptr; /* IN linear pointer. */
245
246 /* Size of returned data, if > ptr->cb, then no data was
247 * actually transferred and the guest must repeat the call.
248 */
249 HGCMFunctionParameter size; /* OUT uint32_t */
250
251} VBoxClipboardReadDataMsg;
252
253#define VBOX_SHARED_CLIPBOARD_CPARMS_READ_DATA 3
254
255typedef struct _VBoxClipboardWriteDataMsg
256{
257 VBGLIOCHGCMCALL hdr;
258
259 /* Returned format as requested in the VBOX_SHARED_CLIPBOARD_HOST_MSG_READ_DATA message. */
260 HGCMFunctionParameter format; /* IN uint32_t */
261
262 /* Data. */
263 HGCMFunctionParameter ptr; /* IN linear pointer. */
264} VBoxClipboardWriteDataMsg;
265
266#define VBOX_SHARED_CLIPBOARD_CPARMS_WRITE_DATA 2
267
268typedef struct _VBoxClipboardTransferReport
269{
270 VBGLIOCHGCMCALL hdr;
271
272 /** uint32_t, out: Context ID. */
273 HGCMFunctionParameter uContext;
274 /** uint32_t, out: Status to report. */
275 HGCMFunctionParameter uStatus;
276} VBoxClipboardTransferReport;
277
278#define VBOX_SHARED_CLIPBOARD_CPARMS_TRANSFER_REPORT 2
279
280/**
281 * Asks the host for the next command to process, along
282 * with the needed amount of parameters and an optional blocking
283 * flag.
284 *
285 * Used by: VBOX_SHARED_CLIPBOARD_GUEST_FN_GET_HOST_MSG
286 *
287 */
288typedef struct _VBoxClipboardGetHostMsg
289{
290 VBGLIOCHGCMCALL hdr;
291
292 /** uint32_t, out: Message ID. */
293 HGCMFunctionParameter uMsg;
294 /** uint32_t, out: Number of parameters the message needs. */
295 HGCMFunctionParameter cParms;
296 /** uint32_t, in: Whether or not to block (wait) for a new message to arrive. */
297 HGCMFunctionParameter fBlock;
298} VBoxClipboardPeekMsg;
299
300#define VBOX_SHARED_CLIPBOARD_CPARMS_GET_HOST_MSG 3
301
302/** @todo might be necessary for future. */
303#define VBOX_SHAREDCLIPBOARD_LIST_FLAG_NONE 0
304#define VBOX_SHAREDCLIPBOARD_LIST_FLAG_RETURN_ONE RT_BIT(0)
305#define VBOX_SHAREDCLIPBOARD_LIST_FLAG_RESTART RT_BIT(1)
306
307#define VBOX_SHAREDCLIPBOARD_LISTHDR_FLAG_NONE 0
308
309/** No additional information provided. */
310#define VBOX_SHAREDCLIPBOARD_INFO_FLAG_NONE 0
311/** Get object information of type SHAREDCLIPBOARDFSOBJINFO. */
312#define VBOX_SHAREDCLIPBOARD_INFO_FLAG_FSOBJINFO RT_BIT(0)
313
314/**
315 * Transfert status message.
316 */
317typedef struct _VBoxClipboardStatusMsg
318{
319 VBGLIOCHGCMCALL hdr;
320
321 /** uint32_t, in: Context ID. */
322 HGCMFunctionParameter uContext;
323 /** uint32_t, in: Transfer status of type SHAREDCLIPBOARDURITRANSFERSTATUS. */
324 HGCMFunctionParameter uStatus;
325 /** uint32_t, in: Size of payload of this status, based on the status type. */
326 HGCMFunctionParameter cbPayload;
327 /** pointer, in: Optional payload of this status, based on the status type. */
328 HGCMFunctionParameter pvPayload;
329} VBoxClipboardStatusMsg;
330
331#define VBOX_SHARED_CLIPBOARD_CPARMS_STATUS 4
332
333#define VBOX_SHAREDCLIPBOARD_REPLYMSGTYPE_INVALID 0
334#define VBOX_SHAREDCLIPBOARD_REPLYMSGTYPE_LIST_OPEN 1
335#define VBOX_SHAREDCLIPBOARD_REPLYMSGTYPE_LIST_CLOSE 2
336#define VBOX_SHAREDCLIPBOARD_REPLYMSGTYPE_OBJ_OPEN 3
337#define VBOX_SHAREDCLIPBOARD_REPLYMSGTYPE_OBJ_CLOSE 4
338
339/**
340 * Generic reply message.
341 */
342typedef struct _VBoxClipboardReplyMsg
343{
344 VBGLIOCHGCMCALL hdr;
345
346 /** uint32_t, out: Context ID. */
347 HGCMFunctionParameter uContext;
348 /** uint32_t, out: Message type of type VBOX_SHAREDCLIPBOARD_REPLYMSGTYPE_XXX. */
349 HGCMFunctionParameter enmType;
350 /** uint32_t, out: IPRT result of overall operation. */
351 HGCMFunctionParameter rc;
352 /** uint32_t, out: Size of optional payload of this reply, based on the message type. */
353 HGCMFunctionParameter cbPayload;
354 /** pointer, out: Optional payload of this reply, based on the message type. */
355 HGCMFunctionParameter pvPayload;
356 union
357 {
358 struct
359 {
360 HGCMFunctionParameter uHandle;
361 } ListOpen;
362 struct
363 {
364 HGCMFunctionParameter uHandle;
365 } ObjOpen;
366 struct
367 {
368 HGCMFunctionParameter uHandle;
369 } ObjClose;
370 } u;
371} VBoxClipboardReplyMsg;
372
373#define VBOX_SHARED_CLIPBOARD_CPARMS_REPLY_MIN 5
374
375typedef struct _VBoxClipboardRootListParms
376{
377 /** uint32_t, in: Context ID. s*/
378 HGCMFunctionParameter uContext;
379 /** uint32_t, in: Roots listing flags; unused at the moment. */
380 HGCMFunctionParameter fRoots;
381} VBoxClipboardRootListParms;
382
383/**
384 * Requests to read the root list.
385 */
386typedef struct _VBoxClipboardRootListReadReqMsg
387{
388 VBGLIOCHGCMCALL hdr;
389
390 VBoxClipboardRootListParms ReqParms;
391} VBoxClipboardRootListReadReqMsg;
392
393#define VBOX_SHARED_CLIPBOARD_CPARMS_ROOT_LIST_HDR_READ 2
394
395/**
396 * Reads / Writes a root list header.
397 */
398typedef struct _VBoxClipboardRootListHdrMsg
399{
400 VBGLIOCHGCMCALL hdr;
401
402 VBoxClipboardRootListParms ReqParms;
403 /** uint64_t, in/out: Number of total root list entries. */
404 HGCMFunctionParameter cRoots;
405 /** uint32_t, in/out: Compression type. */
406 HGCMFunctionParameter enmCompression;
407 /** uint32_t, in/out: Checksum type used for data transfer. */
408 HGCMFunctionParameter enmChecksumType;
409} VBoxClipboardRootListHdrMsg;
410
411#define VBOX_SHARED_CLIPBOARD_CPARMS_ROOT_LIST_HDR 5
412
413typedef struct _VBoxClipboardRootListEntryParms
414{
415 /** uint32_t, in: Context ID. */
416 HGCMFunctionParameter uContext;
417 /** uint32_t, in: VBOX_SHAREDCLIPBOARD_INFO_FLAG_XXX. */
418 HGCMFunctionParameter fInfo;
419 /** uint32_t, in: Index of root list entry to get (zero-based). */
420 HGCMFunctionParameter uIndex;
421} VBoxClipboardRootListEntryParms;
422
423/**
424 * Request to read a list root entry.
425 */
426typedef struct _VBoxClipboardRootListEntryReadReqMsg
427{
428 VBGLIOCHGCMCALL hdr;
429
430 /** in: Request parameters. */
431 VBoxClipboardRootListEntryParms Parms;
432} VBoxClipboardRootListEntryReadReqMsg;
433
434#define VBOX_SHARED_CLIPBOARD_CPARMS_ROOT_LIST_ENTRY_READ_REQ 3
435
436/**
437 * Reads / Writes a root list entry.
438 */
439typedef struct _VBoxClipboardRootListEntryMsg
440{
441 VBGLIOCHGCMCALL hdr;
442
443 /** in/out: Request parameters. */
444 VBoxClipboardRootListEntryParms Parms;
445 /** pointer, in/out: Entry name. */
446 HGCMFunctionParameter szName;
447 /** uint32_t, out: Bytes to be used for information/How many bytes were used. */
448 HGCMFunctionParameter cbInfo;
449 /** pointer, in/out: Information to be set/get (SHAREDCLIPBOARDFSOBJINFO only currently).
450 * Do not forget to set the SHAREDCLIPBOARDFSOBJINFO::Attr::enmAdditional for Get operation as well. */
451 HGCMFunctionParameter pvInfo;
452} VBoxClipboardRootListEntryMsg;
453
454#define VBOX_SHARED_CLIPBOARD_CPARMS_ROOT_LIST_ENTRY 6
455
456/**
457 * Opens a list.
458 */
459typedef struct _VBoxClipboardListOpenMsg
460{
461 VBGLIOCHGCMCALL hdr;
462
463 /** uint32_t, in: Context ID. */
464 HGCMFunctionParameter uContext;
465 /** uint32_t, in: Listing flags (see VBOX_SHAREDCLIPBOARD_LIST_FLAG_XXX). */
466 HGCMFunctionParameter fList;
467 /** uint32_t, in: Size (in bytes) of the filter string. */
468 HGCMFunctionParameter cbFilter;
469 /** pointer, in: Filter string. */
470 HGCMFunctionParameter pvFilter;
471 /** uint32_t, in: Size (in bytes) of the listing path. */
472 HGCMFunctionParameter cbPath;
473 /** pointer, in: Listing poth. If empty or NULL the listing's root path will be opened. */
474 HGCMFunctionParameter pvPath;
475 /** uint64_t, out: List handle. */
476 HGCMFunctionParameter uHandle;
477} VBoxClipboardListOpenMsg;
478
479#define VBOX_SHARED_CLIPBOARD_CPARMS_LIST_OPEN 7
480
481/**
482 * Closes a list.
483 */
484typedef struct _VBoxClipboardListCloseMsg
485{
486 VBGLIOCHGCMCALL hdr;
487
488 /** uint32_t, in/out: Context ID. */
489 HGCMFunctionParameter uContext;
490 /** uint64_t, in: List handle. */
491 HGCMFunctionParameter uHandle;
492} VBoxClipboardListCloseMsg;
493
494#define VBOX_SHARED_CLIPBOARD_CPARMS_LIST_CLOSE 2
495
496typedef struct _VBoxClipboardListHdrReqParms
497{
498 /** uint32_t, in: Context ID. */
499 HGCMFunctionParameter uContext;
500 /** uint64_t, in: List handle. */
501 HGCMFunctionParameter uHandle;
502 /** uint32_t, in: Flags of type VBOX_SHAREDCLIPBOARD_LISTHDR_FLAG_XXX. */
503 HGCMFunctionParameter fFlags;
504} VBoxClipboardListHdrReqParms;
505
506/**
507 * Request to read a list header.
508 */
509typedef struct _VBoxClipboardListHdrReadReqMsg
510{
511 VBGLIOCHGCMCALL hdr;
512
513 VBoxClipboardListHdrReqParms ReqParms;
514} VBoxClipboardListHdrReadReqMsg;
515
516#define VBOX_SHARED_CLIPBOARD_CPARMS_LIST_HDR_READ_REQ 3
517
518/**
519 * Reads / Writes a list header.
520 */
521typedef struct _VBoxClipboardListHdrMsg
522{
523 VBGLIOCHGCMCALL hdr;
524
525 VBoxClipboardListHdrReqParms ReqParms;
526 /** uint32_t, in/out: Feature flags (see VBOX_SHAREDCLIPBOARD_FEATURE_FLAG_XXX). */
527 HGCMFunctionParameter fFeatures;
528 /** uint64_t, in/out: Number of total objects to transfer. */
529 HGCMFunctionParameter cTotalObjects;
530 /** uint64_t, in/out: Number of total bytes to transfer. */
531 HGCMFunctionParameter cbTotalSize;
532 /** uint32_t, in/out: Compression type. */
533 HGCMFunctionParameter enmCompression;
534 /** uint32_t, in/out: Checksum type used for data transfer. */
535 HGCMFunctionParameter enmChecksumType;
536} VBoxClipboardListHdrMsg;
537
538#define VBOX_SHARED_CLIPBOARD_CPARMS_LIST_HDR 8
539
540typedef struct _VBoxClipboardListEntryReqParms
541{
542 /** uint32_t, in: Context ID. */
543 HGCMFunctionParameter uContext;
544 /** uint64_t, in: List handle. */
545 HGCMFunctionParameter uHandle;
546 /** uint32_t, in: VBOX_SHAREDCLIPBOARD_INFO_FLAG_XXX. */
547 HGCMFunctionParameter fInfo;
548} VBoxClipboardListEntryReqParms;
549
550/**
551 * Request to read a list entry.
552 */
553typedef struct _VBoxClipboardListEntryReadReqMsg
554{
555 VBGLIOCHGCMCALL hdr;
556
557 VBoxClipboardListEntryReqParms ReqParms;
558} VBoxClipboardListEntryReadReqMsg;
559
560#define VBOX_SHARED_CLIPBOARD_CPARMS_LIST_ENTRY_READ 3
561
562/**
563 * Reads / Writes a list entry.
564 */
565typedef struct _VBoxClipboardListEntryMsg
566{
567 VBGLIOCHGCMCALL hdr;
568
569 /** in/out: Request parameters. */
570 VBoxClipboardListEntryReqParms ReqParms;
571 /** pointer, in/out: Entry name. */
572 HGCMFunctionParameter szName;
573 /** uint32_t, out: Bytes to be used for information/How many bytes were used. */
574 HGCMFunctionParameter cbInfo;
575 /** pointer, in/out: Information to be set/get (SHAREDCLIPBOARDFSOBJINFO only currently).
576 * Do not forget to set the SHAREDCLIPBOARDFSOBJINFO::Attr::enmAdditional for Get operation as well. */
577 HGCMFunctionParameter pvInfo;
578} VBoxClipboardListEntryMsg;
579
580#define VBOX_SHARED_CLIPBOARD_CPARMS_LIST_ENTRY 6
581
582typedef struct _VBoxClipboardObjOpenMsg
583{
584 VBGLIOCHGCMCALL hdr;
585
586 /** uint32_t, in/out: Context ID. */
587 HGCMFunctionParameter uContext;
588 /** uint64_t, in/out: Object handle. */
589 HGCMFunctionParameter uHandle;
590 /** uint32_t, in/out: Size (in bytes) of absoulte path of object to open/create. */
591 HGCMFunctionParameter cbPath;
592 /** pointer, in/out: Absoulte path of object to open/create. */
593 HGCMFunctionParameter szPath;
594 /** uint32_t in/out: Open / Create flags of type SHAREDCLIPBOARD_OBJ_CF_. */
595 HGCMFunctionParameter fCreate;
596 /** pointer, in/out: SHAREDCLIPBOARDFSOBJINFO. */
597 HGCMFunctionParameter objInfo;
598} VBoxClipboardObjOpenMsg;
599
600#define VBOX_SHARED_CLIPBOARD_CPARMS_OBJ_OPEN 4
601
602typedef struct _VBoxClipboardObjCloseMsg
603{
604 VBGLIOCHGCMCALL hdr;
605
606 /** uint32_t, in/out: Context ID. */
607 HGCMFunctionParameter uContext;
608 /** uint64_t, in: SHAREDCLIPBOARDOBJHANDLE of object to close. */
609 HGCMFunctionParameter uHandle;
610} VBoxClipboardObjCloseMsg;
611
612#define VBOX_SHARED_CLIPBOARD_CPARMS_OBJ_CLOSE 2
613
614typedef struct _VBoxClipboardObjReadReqParms
615{
616 /** uint32_t, in: Context ID. */
617 HGCMFunctionParameter uContext;
618 /** uint64_t, in: SHAREDCLIPBOARDOBJHANDLE of object to write to. */
619 HGCMFunctionParameter uHandle;
620 /** uint32_t, in: How many bytes to read. */
621 HGCMFunctionParameter cbToRead;
622 /** uint32_t, in: Read flags. Currently unused. */
623 HGCMFunctionParameter fRead;
624} VBoxClipboardObjReadReqParms;
625
626typedef struct _VBoxClipboardObjReadReqMsg
627{
628 VBGLIOCHGCMCALL hdr;
629
630 VBoxClipboardObjReadReqParms ReqParms;
631} VBoxClipboardObjReadReqMsg;
632
633#define VBOX_SHARED_CLIPBOARD_CPARMS_OBJ_READ_REQ 3
634
635/**
636 * Reads / writes data of / to an object.
637 *
638 * Used by:
639 * VBOX_SHARED_CLIPBOARD_FN_OBJ_READ
640 * VBOX_SHARED_CLIPBOARD_FN_OBJ_WRITE
641 */
642typedef struct _VBoxClipboardObjReadWriteMsg
643{
644 VBGLIOCHGCMCALL hdr;
645
646 /** uint32_t, in/out: Context ID. */
647 HGCMFunctionParameter uContext;
648 /** uint64_t, in/out: SHAREDCLIPBOARDOBJHANDLE of object to write to. */
649 HGCMFunctionParameter uHandle;
650 /** uint32_t, in/out: Size (in bytes) of current data chunk. */
651 HGCMFunctionParameter cbData;
652 /** pointer, in/out: Current data chunk. */
653 HGCMFunctionParameter pvData;
654 /** uint32_t, in/out: Size (in bytes) of current data chunk checksum. */
655 HGCMFunctionParameter cbChecksum;
656 /** pointer, in/out: Checksum of data block, based on the checksum
657 * type in the data header. Optional. */
658 HGCMFunctionParameter pvChecksum;
659} VBoxClipboardObjReadWriteMsg;
660
661#define VBOX_SHARED_CLIPBOARD_CPARMS_OBJ_READ 6
662#define VBOX_SHARED_CLIPBOARD_CPARMS_OBJ_WRITE 6
663
664/**
665 * Sends an error event.
666 *
667 * Used by:
668 * VBOX_SHARED_CLIPBOARD_FN_WRITE_ERROR
669 */
670typedef struct _VBoxClipboardErrorMsg
671{
672 VBGLIOCHGCMCALL hdr;
673
674 /** uint32_t, in: Context ID. */
675 HGCMFunctionParameter uContext;
676 /** uint32_t, in: The error code (IPRT-style). */
677 HGCMFunctionParameter rc;
678} VBoxClipboardWriteErrorMsg;
679
680#define VBOX_SHARED_CLIPBOARD_CPARMS_ERROR 2
681
682#pragma pack()
683
684typedef struct _VBOXCLIPBOARDFILEDATA
685{
686 /** Current file data chunk. */
687 void *pvData;
688 /** Size (in bytes) of current data chunk. */
689 uint32_t cbData;
690 /** Checksum for current file data chunk. */
691 void *pvChecksum;
692 /** Size (in bytes) of current data chunk. */
693 uint32_t cbChecksum;
694} VBOXCLIPBOARDFILEDATA, *PVBOXCLIPBOARDFILEDATA;
695
696typedef struct _VBOXCLIPBOARDERRORDATA
697{
698 int32_t rc;
699} VBOXCLIPBOARDERRORDATA, *PVBOXCLIPBOARDERRORDATA;
700
701bool VBoxSvcClipboardGetHeadless(void);
702bool VBoxSvcClipboardLock(void);
703void VBoxSvcClipboardUnlock(void);
704
705#endif /* !VBOX_INCLUDED_HostServices_VBoxClipboardSvc_h */
706
Note: See TracBrowser for help on using the repository browser.

© 2025 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette