VirtualBox

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

Last change on this file since 80353 was 80320, checked in by vboxsync, 5 years ago

Shared Clipboard/URI: Build fix.

  • Property svn:eol-style set to native
  • Property svn:keywords set to Id Revision
File size: 24.2 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 * HGCM parameter structures.
202 */
203#pragma pack(1)
204typedef struct _VBoxClipboardGetHostMsgOld
205{
206 VBGLIOCHGCMCALL hdr;
207
208 /* VBOX_SHARED_CLIPBOARD_HOST_MSG_* */
209 HGCMFunctionParameter msg; /* OUT uint32_t */
210
211 /* VBOX_SHARED_CLIPBOARD_FMT_*, depends on the 'msg'. */
212 HGCMFunctionParameter formats; /* OUT uint32_t */
213} VBoxClipboardGetHostMsgOld;
214
215#define VBOX_SHARED_CLIPBOARD_CPARMS_GET_HOST_MSG_OLD 2
216
217typedef struct _VBoxClipboardReportFormatsMsg
218{
219 VBGLIOCHGCMCALL hdr;
220
221 /* VBOX_SHARED_CLIPBOARD_FMT_* */
222 HGCMFunctionParameter formats; /* OUT uint32_t */
223} VBoxClipboardReportFormatsMsg;
224
225#define VBOX_SHARED_CLIPBOARD_CPARMS_REPORT_FORMATS 1
226
227typedef struct _VBoxClipboardReadDataMsg
228{
229 VBGLIOCHGCMCALL hdr;
230
231 /* Requested format. */
232 HGCMFunctionParameter format; /* IN uint32_t */
233
234 /* The data buffer. */
235 HGCMFunctionParameter ptr; /* IN linear pointer. */
236
237 /* Size of returned data, if > ptr->cb, then no data was
238 * actually transferred and the guest must repeat the call.
239 */
240 HGCMFunctionParameter size; /* OUT uint32_t */
241
242} VBoxClipboardReadDataMsg;
243
244#define VBOX_SHARED_CLIPBOARD_CPARMS_READ_DATA 3
245
246typedef struct _VBoxClipboardWriteDataMsg
247{
248 VBGLIOCHGCMCALL hdr;
249
250 /* Returned format as requested in the VBOX_SHARED_CLIPBOARD_HOST_MSG_READ_DATA message. */
251 HGCMFunctionParameter format; /* IN uint32_t */
252
253 /* Data. */
254 HGCMFunctionParameter ptr; /* IN linear pointer. */
255} VBoxClipboardWriteDataMsg;
256
257#define VBOX_SHARED_CLIPBOARD_CPARMS_WRITE_DATA 2
258
259typedef struct _VBoxClipboardTransferReport
260{
261 VBGLIOCHGCMCALL hdr;
262
263 /** uint32_t, out: Context ID. */
264 HGCMFunctionParameter uContext;
265 /** uint32_t, out: Status to report. */
266 HGCMFunctionParameter uStatus;
267} VBoxClipboardTransferReport;
268
269#define VBOX_SHARED_CLIPBOARD_CPARMS_TRANSFER_REPORT 2
270
271/**
272 * Asks the host for the next command to process, along
273 * with the needed amount of parameters and an optional blocking
274 * flag.
275 *
276 * Used by: VBOX_SHARED_CLIPBOARD_GUEST_FN_GET_HOST_MSG
277 *
278 */
279typedef struct _VBoxClipboardGetHostMsg
280{
281 VBGLIOCHGCMCALL hdr;
282
283 /** uint32_t, out: Message ID. */
284 HGCMFunctionParameter uMsg;
285 /** uint32_t, out: Number of parameters the message needs. */
286 HGCMFunctionParameter cParms;
287 /** uint32_t, in: Whether or not to block (wait) for a new message to arrive. */
288 HGCMFunctionParameter fBlock;
289} VBoxClipboardPeekMsg;
290
291#define VBOX_SHARED_CLIPBOARD_CPARMS_GET_HOST_MSG 3
292
293/** @todo might be necessary for future. */
294#define VBOX_SHAREDCLIPBOARD_LIST_FLAG_NONE 0
295#define VBOX_SHAREDCLIPBOARD_LIST_FLAG_RETURN_ONE RT_BIT(0)
296#define VBOX_SHAREDCLIPBOARD_LIST_FLAG_RESTART RT_BIT(1)
297
298#define VBOX_SHAREDCLIPBOARD_LISTHDR_FLAG_NONE 0
299
300/** No additional information provided. */
301#define VBOX_SHAREDCLIPBOARD_INFO_FLAG_NONE 0
302/** Get object information of type SHAREDCLIPBOARDFSOBJINFO. */
303#define VBOX_SHAREDCLIPBOARD_INFO_FLAG_FSOBJINFO RT_BIT(0)
304
305/**
306 * Transfert status message.
307 */
308typedef struct _VBoxClipboardStatusMsg
309{
310 VBGLIOCHGCMCALL hdr;
311
312 /** uint32_t, in: Context ID. */
313 HGCMFunctionParameter uContext;
314 /** uint32_t, in: Transfer status of type SHAREDCLIPBOARDURITRANSFERSTATUS. */
315 HGCMFunctionParameter uStatus;
316 /** uint32_t, in: Size of payload of this status, based on the status type. */
317 HGCMFunctionParameter cbPayload;
318 /** pointer, in: Optional payload of this status, based on the status type. */
319 HGCMFunctionParameter pvPayload;
320} VBoxClipboardStatusMsg;
321
322#define VBOX_SHARED_CLIPBOARD_CPARMS_STATUS 4
323
324#define VBOX_SHAREDCLIPBOARD_REPLYMSGTYPE_INVALID 0
325#define VBOX_SHAREDCLIPBOARD_REPLYMSGTYPE_LIST_OPEN 1
326#define VBOX_SHAREDCLIPBOARD_REPLYMSGTYPE_LIST_CLOSE 2
327#define VBOX_SHAREDCLIPBOARD_REPLYMSGTYPE_OBJ_OPEN 3
328#define VBOX_SHAREDCLIPBOARD_REPLYMSGTYPE_OBJ_CLOSE 4
329
330/**
331 * Generic reply message.
332 */
333typedef struct _VBoxClipboardReplyMsg
334{
335 VBGLIOCHGCMCALL hdr;
336
337 /** uint32_t, out: Context ID. */
338 HGCMFunctionParameter uContext;
339 /** uint32_t, out: Message type of type VBOX_SHAREDCLIPBOARD_REPLYMSGTYPE_XXX. */
340 HGCMFunctionParameter enmType;
341 /** uint32_t, out: IPRT result of overall operation. */
342 HGCMFunctionParameter rc;
343 /** uint32_t, out: Size of optional payload of this reply, based on the message type. */
344 HGCMFunctionParameter cbPayload;
345 /** pointer, out: Optional payload of this reply, based on the message type. */
346 HGCMFunctionParameter pvPayload;
347 union
348 {
349 struct
350 {
351 HGCMFunctionParameter uHandle;
352 } ListOpen;
353 struct
354 {
355 HGCMFunctionParameter uHandle;
356 } ObjOpen;
357 struct
358 {
359 HGCMFunctionParameter uHandle;
360 } ObjClose;
361 } u;
362} VBoxClipboardReplyMsg;
363
364#define VBOX_SHARED_CLIPBOARD_CPARMS_REPLY_MIN 5
365
366typedef struct _VBoxClipboardRootListParms
367{
368 /** uint32_t, in: Context ID. s*/
369 HGCMFunctionParameter uContext;
370 /** uint32_t, in: Roots listing flags; unused at the moment. */
371 HGCMFunctionParameter fRoots;
372} VBoxClipboardRootListParms;
373
374/**
375 * Requests to read the root list.
376 */
377typedef struct _VBoxClipboardRootListReadReqMsg
378{
379 VBGLIOCHGCMCALL hdr;
380
381 VBoxClipboardRootListParms ReqParms;
382} VBoxClipboardRootListReadReqMsg;
383
384#define VBOX_SHARED_CLIPBOARD_CPARMS_ROOT_LIST_HDR_READ 2
385
386/**
387 * Reads / Writes a root list header.
388 */
389typedef struct _VBoxClipboardRootListHdrMsg
390{
391 VBGLIOCHGCMCALL hdr;
392
393 VBoxClipboardRootListParms ReqParms;
394 /** uint64_t, in/out: Number of total root list entries. */
395 HGCMFunctionParameter cRoots;
396 /** uint32_t, in/out: Compression type. */
397 HGCMFunctionParameter enmCompression;
398 /** uint32_t, in/out: Checksum type used for data transfer. */
399 HGCMFunctionParameter enmChecksumType;
400} VBoxClipboardRootListHdrMsg;
401
402#define VBOX_SHARED_CLIPBOARD_CPARMS_ROOT_LIST_HDR 5
403
404typedef struct _VBoxClipboardRootListEntryParms
405{
406 /** uint32_t, in: Context ID. */
407 HGCMFunctionParameter uContext;
408 /** uint32_t, in: VBOX_SHAREDCLIPBOARD_INFO_FLAG_XXX. */
409 HGCMFunctionParameter fInfo;
410 /** uint32_t, in: Index of root list entry to get (zero-based). */
411 HGCMFunctionParameter uIndex;
412} VBoxClipboardRootListEntryParms;
413
414/**
415 * Request to read a list root entry.
416 */
417typedef struct _VBoxClipboardRootListEntryReadReqMsg
418{
419 VBGLIOCHGCMCALL hdr;
420
421 /** in: Request parameters. */
422 VBoxClipboardRootListEntryParms Parms;
423} VBoxClipboardRootListEntryReadReqMsg;
424
425#define VBOX_SHARED_CLIPBOARD_CPARMS_ROOT_LIST_ENTRY_READ_REQ 3
426
427/**
428 * Reads / Writes a root list entry.
429 */
430typedef struct _VBoxClipboardRootListEntryMsg
431{
432 VBGLIOCHGCMCALL hdr;
433
434 /** in/out: Request parameters. */
435 VBoxClipboardRootListEntryParms Parms;
436 /** pointer, in/out: Entry name. */
437 HGCMFunctionParameter szName;
438 /** uint32_t, out: Bytes to be used for information/How many bytes were used. */
439 HGCMFunctionParameter cbInfo;
440 /** pointer, in/out: Information to be set/get (SHAREDCLIPBOARDFSOBJINFO only currently).
441 * Do not forget to set the SHAREDCLIPBOARDFSOBJINFO::Attr::enmAdditional for Get operation as well. */
442 HGCMFunctionParameter pvInfo;
443} VBoxClipboardRootListEntryMsg;
444
445#define VBOX_SHARED_CLIPBOARD_CPARMS_ROOT_LIST_ENTRY 6
446
447/**
448 * Opens a list.
449 */
450typedef struct _VBoxClipboardListOpenMsg
451{
452 VBGLIOCHGCMCALL hdr;
453
454 /** uint32_t, in: Context ID. */
455 HGCMFunctionParameter uContext;
456 /** uint32_t, in: Listing flags (see VBOX_SHAREDCLIPBOARD_LIST_FLAG_XXX). */
457 HGCMFunctionParameter fList;
458 /** uint32_t, in: Size (in bytes) of the filter string. */
459 HGCMFunctionParameter cbFilter;
460 /** pointer, in: Filter string. */
461 HGCMFunctionParameter pvFilter;
462 /** uint32_t, in: Size (in bytes) of the listing path. */
463 HGCMFunctionParameter cbPath;
464 /** pointer, in: Listing poth. If empty or NULL the listing's root path will be opened. */
465 HGCMFunctionParameter pvPath;
466 /** uint64_t, out: List handle. */
467 HGCMFunctionParameter uHandle;
468} VBoxClipboardListOpenMsg;
469
470#define VBOX_SHARED_CLIPBOARD_CPARMS_LIST_OPEN 7
471
472/**
473 * Closes a list.
474 */
475typedef struct _VBoxClipboardListCloseMsg
476{
477 VBGLIOCHGCMCALL hdr;
478
479 /** uint32_t, in/out: Context ID. */
480 HGCMFunctionParameter uContext;
481 /** uint64_t, in: List handle. */
482 HGCMFunctionParameter uHandle;
483} VBoxClipboardListCloseMsg;
484
485#define VBOX_SHARED_CLIPBOARD_CPARMS_LIST_CLOSE 2
486
487typedef struct _VBoxClipboardListHdrReqParms
488{
489 /** uint32_t, in: Context ID. */
490 HGCMFunctionParameter uContext;
491 /** uint64_t, in: List handle. */
492 HGCMFunctionParameter uHandle;
493 /** uint32_t, in: Flags of type VBOX_SHAREDCLIPBOARD_LISTHDR_FLAG_XXX. */
494 HGCMFunctionParameter fFlags;
495} VBoxClipboardListHdrReqParms;
496
497/**
498 * Request to read a list header.
499 */
500typedef struct _VBoxClipboardListHdrReadReqMsg
501{
502 VBGLIOCHGCMCALL hdr;
503
504 VBoxClipboardListHdrReqParms ReqParms;
505} VBoxClipboardListHdrReadReqMsg;
506
507#define VBOX_SHARED_CLIPBOARD_CPARMS_LIST_HDR_READ_REQ 3
508
509/**
510 * Reads / Writes a list header.
511 */
512typedef struct _VBoxClipboardListHdrMsg
513{
514 VBGLIOCHGCMCALL hdr;
515
516 VBoxClipboardListHdrReqParms ReqParms;
517 /** uint32_t, in/out: Feature flags (see VBOX_SHAREDCLIPBOARD_FEATURE_FLAG_XXX). */
518 HGCMFunctionParameter fFeatures;
519 /** uint64_t, in/out: Number of total objects to transfer. */
520 HGCMFunctionParameter cTotalObjects;
521 /** uint64_t, in/out: Number of total bytes to transfer. */
522 HGCMFunctionParameter cbTotalSize;
523 /** uint32_t, in/out: Compression type. */
524 HGCMFunctionParameter enmCompression;
525 /** uint32_t, in/out: Checksum type used for data transfer. */
526 HGCMFunctionParameter enmChecksumType;
527} VBoxClipboardListHdrMsg;
528
529#define VBOX_SHARED_CLIPBOARD_CPARMS_LIST_HDR 8
530
531typedef struct _VBoxClipboardListEntryReqParms
532{
533 /** uint32_t, in: Context ID. */
534 HGCMFunctionParameter uContext;
535 /** uint64_t, in: List handle. */
536 HGCMFunctionParameter uHandle;
537 /** uint32_t, in: VBOX_SHAREDCLIPBOARD_INFO_FLAG_XXX. */
538 HGCMFunctionParameter fInfo;
539} VBoxClipboardListEntryReqParms;
540
541/**
542 * Request to read a list entry.
543 */
544typedef struct _VBoxClipboardListEntryReadReqMsg
545{
546 VBGLIOCHGCMCALL hdr;
547
548 VBoxClipboardListEntryReqParms ReqParms;
549} VBoxClipboardListEntryReadReqMsg;
550
551#define VBOX_SHARED_CLIPBOARD_CPARMS_LIST_ENTRY_READ 3
552
553/**
554 * Reads / Writes a list entry.
555 */
556typedef struct _VBoxClipboardListEntryMsg
557{
558 VBGLIOCHGCMCALL hdr;
559
560 /** in/out: Request parameters. */
561 VBoxClipboardListEntryReqParms ReqParms;
562 /** pointer, in/out: Entry name. */
563 HGCMFunctionParameter szName;
564 /** uint32_t, out: Bytes to be used for information/How many bytes were used. */
565 HGCMFunctionParameter cbInfo;
566 /** pointer, in/out: Information to be set/get (SHAREDCLIPBOARDFSOBJINFO only currently).
567 * Do not forget to set the SHAREDCLIPBOARDFSOBJINFO::Attr::enmAdditional for Get operation as well. */
568 HGCMFunctionParameter pvInfo;
569} VBoxClipboardListEntryMsg;
570
571#define VBOX_SHARED_CLIPBOARD_CPARMS_LIST_ENTRY 6
572
573typedef struct _VBoxClipboardObjOpenMsg
574{
575 VBGLIOCHGCMCALL hdr;
576
577 /** uint32_t, in/out: Context ID. */
578 HGCMFunctionParameter uContext;
579 /** uint64_t, in/out: Object handle. */
580 HGCMFunctionParameter uHandle;
581 /** uint32_t, in/out: Size (in bytes) of absoulte path of object to open/create. */
582 HGCMFunctionParameter cbPath;
583 /** pointer, in/out: Absoulte path of object to open/create. */
584 HGCMFunctionParameter szPath;
585 /** uint32_t in/out: Open / Create flags of type SHAREDCLIPBOARD_OBJ_CF_. */
586 HGCMFunctionParameter fCreate;
587 /** pointer, in/out: SHAREDCLIPBOARDFSOBJINFO. */
588 HGCMFunctionParameter objInfo;
589} VBoxClipboardObjOpenMsg;
590
591#define VBOX_SHARED_CLIPBOARD_CPARMS_OBJ_OPEN 4
592
593typedef struct _VBoxClipboardObjCloseMsg
594{
595 VBGLIOCHGCMCALL hdr;
596
597 /** uint32_t, in/out: Context ID. */
598 HGCMFunctionParameter uContext;
599 /** uint64_t, in: SHAREDCLIPBOARDOBJHANDLE of object to close. */
600 HGCMFunctionParameter uHandle;
601} VBoxClipboardObjCloseMsg;
602
603#define VBOX_SHARED_CLIPBOARD_CPARMS_OBJ_CLOSE 2
604
605typedef struct _VBoxClipboardObjReadReqParms
606{
607 /** uint32_t, in: Context ID. */
608 HGCMFunctionParameter uContext;
609 /** uint64_t, in: SHAREDCLIPBOARDOBJHANDLE of object to write to. */
610 HGCMFunctionParameter uHandle;
611 /** uint32_t, in: How many bytes to read. */
612 HGCMFunctionParameter cbToRead;
613 /** uint32_t, in: Read flags. Currently unused. */
614 HGCMFunctionParameter fRead;
615} VBoxClipboardObjReadReqParms;
616
617typedef struct _VBoxClipboardObjReadReqMsg
618{
619 VBGLIOCHGCMCALL hdr;
620
621 VBoxClipboardObjReadReqParms ReqParms;
622} VBoxClipboardObjReadReqMsg;
623
624#define VBOX_SHARED_CLIPBOARD_CPARMS_OBJ_READ_REQ 3
625
626/**
627 * Reads / writes data of / to an object.
628 *
629 * Used by:
630 * VBOX_SHARED_CLIPBOARD_FN_OBJ_READ
631 * VBOX_SHARED_CLIPBOARD_FN_OBJ_WRITE
632 */
633typedef struct _VBoxClipboardObjReadWriteMsg
634{
635 VBGLIOCHGCMCALL hdr;
636
637 /** uint32_t, in/out: Context ID. */
638 HGCMFunctionParameter uContext;
639 /** uint64_t, in/out: SHAREDCLIPBOARDOBJHANDLE of object to write to. */
640 HGCMFunctionParameter uHandle;
641 /** uint32_t, in/out: Size (in bytes) of current data chunk. */
642 HGCMFunctionParameter cbData;
643 /** pointer, in/out: Current data chunk. */
644 HGCMFunctionParameter pvData;
645 /** uint32_t, in/out: Size (in bytes) of current data chunk checksum. */
646 HGCMFunctionParameter cbChecksum;
647 /** pointer, in/out: Checksum of data block, based on the checksum
648 * type in the data header. Optional. */
649 HGCMFunctionParameter pvChecksum;
650} VBoxClipboardObjReadWriteMsg;
651
652#define VBOX_SHARED_CLIPBOARD_CPARMS_OBJ_READ 6
653#define VBOX_SHARED_CLIPBOARD_CPARMS_OBJ_WRITE 6
654
655/**
656 * Sends an error event.
657 *
658 * Used by:
659 * VBOX_SHARED_CLIPBOARD_FN_WRITE_ERROR
660 */
661typedef struct _VBoxClipboardErrorMsg
662{
663 VBGLIOCHGCMCALL hdr;
664
665 /** uint32_t, in: Context ID. */
666 HGCMFunctionParameter uContext;
667 /** uint32_t, in: The error code (IPRT-style). */
668 HGCMFunctionParameter rc;
669} VBoxClipboardWriteErrorMsg;
670
671#define VBOX_SHARED_CLIPBOARD_CPARMS_ERROR 2
672
673#pragma pack()
674
675typedef struct _VBOXCLIPBOARDFILEDATA
676{
677 /** Current file data chunk. */
678 void *pvData;
679 /** Size (in bytes) of current data chunk. */
680 uint32_t cbData;
681 /** Checksum for current file data chunk. */
682 void *pvChecksum;
683 /** Size (in bytes) of current data chunk. */
684 uint32_t cbChecksum;
685} VBOXCLIPBOARDFILEDATA, *PVBOXCLIPBOARDFILEDATA;
686
687typedef struct _VBOXCLIPBOARDERRORDATA
688{
689 int32_t rc;
690} VBOXCLIPBOARDERRORDATA, *PVBOXCLIPBOARDERRORDATA;
691
692bool VBoxSvcClipboardGetHeadless(void);
693bool VBoxSvcClipboardLock(void);
694void VBoxSvcClipboardUnlock(void);
695
696#endif /* !VBOX_INCLUDED_HostServices_VBoxClipboardSvc_h */
697
Note: See TracBrowser for help on using the repository browser.

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