VirtualBox

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

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

SharedClipboardSvc,Vbgl: Reviewed and adjusted the handling of the VBOX_SHCL_GUEST_FN_DATA_WRITE message, paddling back two thirds of the parameter changes from the 6.1 dev cycle and fixing a couple of bugs introduced (buggy code commented out and marked with @todos). Fixing the broadcast approach of VBOX_SHCL_GUEST_FN_FORMATS_REPORT as the host doesn't want to know about clipboard stuff when VRDE clients are using the clipboard. Also documented the message. bugref:9437

  • Property svn:eol-style set to native
  • Property svn:keywords set to Id Revision
File size: 39.4 KB
Line 
1/** @file
2 * Shared Clipboard - Common header for host service and guest clients.
3 *
4 * Protocol history notes (incomplete):
5 *
6 * - VirtualBox 6.1.0 betas: Started work on adding support for copying &
7 * pasting files and directories, refactoring the protocol in the process.
8 * - Adds guest/host feature flags.
9 * - Adds context IDs (via guest feature flags).
10 * - Borrowed the message handling from guest controls.
11 * - Adds a multitude of functions and messages for dealing with file & dir
12 * copying, most inte
13 *
14 * - VirtualBox x.x.x: Missing a lot of gradual improvements here.
15 *
16 * - VirtualBox 1.3.2 (r17182): Initial implementation, supporting text.
17 */
18
19/*
20 * Copyright (C) 2006-2019 Oracle Corporation
21 *
22 * This file is part of VirtualBox Open Source Edition (OSE), as
23 * available from http://www.virtualbox.org. This file is free software;
24 * you can redistribute it and/or modify it under the terms of the GNU
25 * General Public License (GPL) as published by the Free Software
26 * Foundation, in version 2 as it comes in the "COPYING" file of the
27 * VirtualBox OSE distribution. VirtualBox OSE is distributed in the
28 * hope that it will be useful, but WITHOUT ANY WARRANTY of any kind.
29 *
30 * The contents of this file may alternatively be used under the terms
31 * of the Common Development and Distribution License Version 1.0
32 * (CDDL) only, as it comes in the "COPYING.CDDL" file of the
33 * VirtualBox OSE distribution, in which case the provisions of the
34 * CDDL are applicable instead of those of the GPL.
35 *
36 * You may elect to license modified versions of this file under the
37 * terms and conditions of either the GPL or the CDDL or both.
38 */
39
40#ifndef VBOX_INCLUDED_HostServices_VBoxClipboardSvc_h
41#define VBOX_INCLUDED_HostServices_VBoxClipboardSvc_h
42#ifndef RT_WITHOUT_PRAGMA_ONCE
43# pragma once
44#endif
45
46#include <VBox/VMMDevCoreTypes.h>
47#include <VBox/VBoxGuestCoreTypes.h>
48#include <VBox/hgcmsvc.h>
49
50
51/** @name VBOX_SHCL_MODE_XXX - The Shared Clipboard modes of operation.
52 * @{
53 */
54/** Shared Clipboard is disabled completely. */
55#define VBOX_SHCL_MODE_OFF 0
56/** Only transfers from host to the guest are possible. */
57#define VBOX_SHCL_MODE_HOST_TO_GUEST 1
58/** Only transfers from guest to the host are possible. */
59#define VBOX_SHCL_MODE_GUEST_TO_HOST 2
60/** Bidirectional transfers between guest and host are possible. */
61#define VBOX_SHCL_MODE_BIDIRECTIONAL 3
62/** @} */
63
64/** @name VBOX_SHCL_TRANSFER_MODE_XXX - The Shared Clipboard file transfer mode (bit field).
65 * @{
66 */
67/** Shared Clipboard file transfers are disabled. */
68#define VBOX_SHCL_TRANSFER_MODE_DISABLED UINT32_C(0)
69/** Shared Clipboard file transfers are enabled. */
70#define VBOX_SHCL_TRANSFER_MODE_ENABLED RT_BIT(0)
71/** Shared Clipboard file transfer mode valid mask. */
72#define VBOX_SHCL_TRANSFER_MODE_VALID_MASK UINT32_C(0x1)
73/** @} */
74
75/** @name VBOX_SHCL_HOST_FN_XXX - The service functions which are callable by host.
76 * @note These are not sacred and can be modified at will as long as all host
77 * clients are updated accordingly (probably just Main).
78 * @{
79 */
80/** Sets the current Shared Clipboard operation mode. */
81#define VBOX_SHCL_HOST_FN_SET_MODE 1
82/** Sets the current Shared Clipboard (file) transfers mode.
83 * Operates on the VBOX_SHCL_TRANSFERS_XXX defines.
84 * @since 6.1 */
85#define VBOX_SHCL_HOST_FN_SET_TRANSFER_MODE 2
86/** Run headless on the host, i.e. do not touch the host clipboard. */
87#define VBOX_SHCL_HOST_FN_SET_HEADLESS 3
88/** Reports cancellation of the current operation to the guest.
89 * @since 6.1 - still a todo */
90#define VBOX_SHCL_HOST_FN_CANCEL 4
91/** Reports an error to the guest.
92 * @since 6.1 - still a todo */
93#define VBOX_SHCL_HOST_FN_ERROR 5
94/** Reports that a new clipboard area has been registered.
95 * @since 6.1 - not implemented */
96#define VBOX_SHCL_HOST_FN_AREA_REGISTER 6
97/** Reports that a clipboard area has been unregistered.
98 * @since 6.1 - not implemented */
99#define VBOX_SHCL_HOST_FN_AREA_UNREGISTER 7
100/** Reports that a client (host / guest) has attached to a clipboard area.
101 * @since 6.1 - not implemented */
102#define VBOX_SHCL_HOST_FN_AREA_ATTACH 8
103/** Reports that a client (host / guest) has detached from a clipboard area.
104 * @since 6.1 - not implemented */
105#define VBOX_SHCL_HOST_FN_AREA_DETACH 9
106/** @} */
107
108/** @name VBOX_SHCL_HOST_MSG_XXX - The host messages for the guest.
109 * @{
110 */
111/** Asks the client to quit / terminate. */
112#define VBOX_SHCL_HOST_MSG_QUIT 1
113/** Reads (simple) data from the guest. */
114#define VBOX_SHCL_HOST_MSG_READ_DATA 2
115/** Reports available clipboard format from host to the guest.
116 * Formerly known as VBOX_SHCL_HOST_MSG_REPORT_FORMATS. */
117#define VBOX_SHCL_HOST_MSG_FORMATS_REPORT 3
118
119/** Sends a transfer status to the guest side.
120 *
121 * @retval VINF_SUCCESS on success.
122 * @retval VERR_INVALID_CLIENT_ID
123 * @retval VERR_WRONG_PARAMETER_COUNT
124 * @retval VERR_WRONG_PARAMETER_TYPE
125 * @since 6.1
126 */
127#define VBOX_SHCL_HOST_MSG_TRANSFER_STATUS 50
128/** Reads the root list header from the guest.
129 *
130 * @retval VINF_SUCCESS on success.
131 * @retval VERR_INVALID_CLIENT_ID
132 * @retval VERR_WRONG_PARAMETER_COUNT
133 * @retval VERR_WRONG_PARAMETER_TYPE
134 * @since 6.1
135 */
136#define VBOX_SHCL_HOST_MSG_TRANSFER_ROOT_LIST_HDR_READ 51
137/** Writes the root list header to the guest.
138 *
139 * @retval VINF_SUCCESS on success.
140 * @retval VERR_INVALID_CLIENT_ID
141 * @retval VERR_WRONG_PARAMETER_COUNT
142 * @retval VERR_WRONG_PARAMETER_TYPE
143 * @since 6.1
144 */
145#define VBOX_SHCL_HOST_MSG_TRANSFER_ROOT_LIST_HDR_WRITE 52
146/** Reads a root list entry from the guest.
147 *
148 * @retval VINF_SUCCESS on success.
149 * @retval VERR_INVALID_CLIENT_ID
150 * @retval VERR_WRONG_PARAMETER_COUNT
151 * @retval VERR_WRONG_PARAMETER_TYPE
152 * @since 6.1
153 */
154#define VBOX_SHCL_HOST_MSG_TRANSFER_ROOT_LIST_ENTRY_READ 53
155/** Writes a root list entry to the guest.
156 *
157 * @retval VINF_SUCCESS on success.
158 * @retval VERR_INVALID_CLIENT_ID
159 * @retval VERR_WRONG_PARAMETER_COUNT
160 * @retval VERR_WRONG_PARAMETER_TYPE
161 * @since 6.1
162 */
163#define VBOX_SHCL_HOST_MSG_TRANSFER_ROOT_LIST_ENTRY_WRITE 54
164/** Open a transfer list on the guest side.
165 *
166 * @retval VINF_SUCCESS on success.
167 * @retval VERR_INVALID_CLIENT_ID
168 * @retval VERR_WRONG_PARAMETER_COUNT
169 * @retval VERR_WRONG_PARAMETER_TYPE
170 * @since 6.1
171 */
172#define VBOX_SHCL_HOST_MSG_TRANSFER_LIST_OPEN 55
173/** Closes a formerly opened transfer list on the guest side.
174 *
175 * @retval VINF_SUCCESS on success.
176 * @retval VERR_INVALID_CLIENT_ID
177 * @retval VERR_WRONG_PARAMETER_COUNT
178 * @retval VERR_WRONG_PARAMETER_TYPE
179 * @since 6.1
180 */
181#define VBOX_SHCL_HOST_MSG_TRANSFER_LIST_CLOSE 56
182/** Reads a list header from the guest.
183 *
184 * @retval VINF_SUCCESS on success.
185 * @retval VERR_INVALID_CLIENT_ID
186 * @retval VERR_WRONG_PARAMETER_COUNT
187 * @retval VERR_WRONG_PARAMETER_TYPE
188 * @since 6.1
189 */
190#define VBOX_SHCL_HOST_MSG_TRANSFER_LIST_HDR_READ 57
191/** Writes a list header to the guest.
192 *
193 * @retval VINF_SUCCESS on success.
194 * @retval VERR_INVALID_CLIENT_ID
195 * @retval VERR_WRONG_PARAMETER_COUNT
196 * @retval VERR_WRONG_PARAMETER_TYPE
197 * @since 6.1
198 */
199#define VBOX_SHCL_HOST_MSG_TRANSFER_LIST_HDR_WRITE 58
200/** Reads a list entry from the guest.
201 *
202 * @retval VINF_SUCCESS on success.
203 * @retval VERR_INVALID_CLIENT_ID
204 * @retval VERR_WRONG_PARAMETER_COUNT
205 * @retval VERR_WRONG_PARAMETER_TYPE
206 * @since 6.1
207 */
208#define VBOX_SHCL_HOST_MSG_TRANSFER_LIST_ENTRY_READ 59
209/** Writes a list entry to the guest.
210 *
211 * @retval VINF_SUCCESS on success.
212 * @retval VERR_INVALID_CLIENT_ID
213 * @retval VERR_WRONG_PARAMETER_COUNT
214 * @retval VERR_WRONG_PARAMETER_TYPE
215 * @since 6.1
216 */
217#define VBOX_SHCL_HOST_MSG_TRANSFER_LIST_ENTRY_WRITE 60
218/** Open a transfer object on the guest side.
219 *
220 * @retval VINF_SUCCESS on success.
221 * @retval VERR_INVALID_CLIENT_ID
222 * @retval VERR_WRONG_PARAMETER_COUNT
223 * @retval VERR_WRONG_PARAMETER_TYPE
224 * @since 6.1
225 */
226#define VBOX_SHCL_HOST_MSG_TRANSFER_OBJ_OPEN 61
227/** Closes a formerly opened transfer object on the guest side.
228 *
229 * @retval VINF_SUCCESS on success.
230 * @retval VERR_INVALID_CLIENT_ID
231 * @retval VERR_WRONG_PARAMETER_COUNT
232 * @retval VERR_WRONG_PARAMETER_TYPE
233 * @since 6.1
234 */
235#define VBOX_SHCL_HOST_MSG_TRANSFER_OBJ_CLOSE 62
236/** Reads from an object on the guest side.
237 *
238 * @retval VINF_SUCCESS on success.
239 * @retval VERR_INVALID_CLIENT_ID
240 * @retval VERR_WRONG_PARAMETER_COUNT
241 * @retval VERR_WRONG_PARAMETER_TYPE
242 * @since 6.1
243 */
244#define VBOX_SHCL_HOST_MSG_TRANSFER_OBJ_READ 63
245/** Writes to an object on the guest side.
246 *
247 * @retval VINF_SUCCESS on success.
248 * @retval VERR_INVALID_CLIENT_ID
249 * @retval VERR_WRONG_PARAMETER_COUNT
250 * @retval VERR_WRONG_PARAMETER_TYPE
251 * @since 6.1
252 */
253#define VBOX_SHCL_HOST_MSG_TRANSFER_OBJ_WRITE 64
254/** Indicates that the host has canceled a transfer.
255 *
256 * @retval VINF_SUCCESS on success.
257 * @retval VERR_INVALID_CLIENT_ID
258 * @retval VERR_WRONG_PARAMETER_COUNT
259 * @retval VERR_WRONG_PARAMETER_TYPE
260 * @since 6.1
261 */
262#define VBOX_SHCL_HOST_MSG_TRANSFER_CANCEL 65
263/** Indicates that the an unrecoverable error on the host occurred.
264 *
265 * @retval VINF_SUCCESS on success.
266 * @retval VERR_INVALID_CLIENT_ID
267 * @retval VERR_WRONG_PARAMETER_COUNT
268 * @retval VERR_WRONG_PARAMETER_TYPE
269 * @since 6.1
270 */
271#define VBOX_SHCL_HOST_MSG_TRANSFER_ERROR 66
272/** @} */
273
274/** @name VBOX_SHCL_GUEST_FN_XXX - The service functions which are called by guest.
275 * @{
276 */
277/** Calls the host and waits (blocking) for an host event VBOX_SHCL_HOST_MSG_XXX.
278 *
279 * @deprecated Replaced by VBOX_SHCL_GUEST_FN_MSG_PEEK_WAIT,
280 * VBOX_SHCL_GUEST_FN_MSG_GET, VBOX_SHCL_GUEST_FN_CANCEL.
281 */
282#define VBOX_SHCL_GUEST_FN_GET_HOST_MSG_OLD 1
283/** Sends a list of available formats to the host.
284 * Formely known as VBOX_SHCL_GUEST_FN_REPORT_FORMATS. */
285#define VBOX_SHCL_GUEST_FN_FORMATS_REPORT 2
286/** Reads data in specified format from the host.
287 *
288 * This function takes three parameters, a 32-bit format bit
289 * (VBOX_SHCL_FMT_XXX), a buffer and 32-bit number of bytes read (output).
290 *
291 * There was a period during 6.1 development where it would take five parameters
292 * when VBOX_SHCL_GF_0_CONTEXT_ID was reported by the guest. A 64-bit context
293 * ID (ignored as purpose undefined), a 32-bit unused flag (MBZ), then the
294 * 32-bit format bits, number of bytes read (output), and the buffer. This
295 * format is still accepted.
296 *
297 * @retval VINF_SUCCESS on success.
298 * @retval VINF_BUFFER_OVERLFLOW (VBox >= 6.1 only) if not enough buffer space
299 * has been given to retrieve the actual data, no data actually copied.
300 * The call then must be repeated with a buffer size returned from the
301 * host in cbData.
302 * @retval VERR_INVALID_CLIENT_ID
303 * @retval VERR_WRONG_PARAMETER_COUNT
304 * @retval VERR_WRONG_PARAMETER_TYPE
305 */
306#define VBOX_SHCL_GUEST_FN_DATA_READ 3
307/** Writes requested data to the host.
308 *
309 * This function takes either 2 or 3 parameters. The last two parameters are a
310 * 32-bit format bit (VBOX_SHCL_FMT_XXX) and a data buffer holding the related
311 * data. The three parameter variant have a context ID first, which shall be a
312 * copy of the ID in the data request message.
313 *
314 * There was a period during 6.1 development where there would be a 5 parameter
315 * version of this, inserting an unused flags parameter between the context ID
316 * and the format bit, as well as a 32-bit data buffer size repate between the
317 * format bit and the data buffer. This format is still accepted, though
318 * deprecated.
319 *
320 * @retval VINF_SUCCESS on success.
321 * @retval VERR_INVALID_CLIENT_ID
322 * @retval VERR_WRONG_PARAMETER_COUNT
323 * @retval VERR_WRONG_PARAMETER_TYPE
324 * @retval VERR_INVALID_CONTEXT if the context ID didn't match up.
325 */
326#define VBOX_SHCL_GUEST_FN_DATA_WRITE 4
327
328/** Does the actual protocol handshake.
329 *
330 * If this message is not being sent by the guest, the host handles that
331 * particular client with the legacy protocol (v0).
332 *
333 * @retval VINF_SUCCESS on success.
334 * @retval VERR_INVALID_CLIENT_ID
335 * @retval VERR_WRONG_PARAMETER_COUNT
336 * @retval VERR_WRONG_PARAMETER_TYPE
337 * @since 6.1
338 */
339#define VBOX_SHCL_GUEST_FN_CONNECT 5
340/** Report guest side feature flags and retrieve the host ones.
341 *
342 * Two 64-bit parameters are passed in from the guest with the guest features
343 * (VBOX_SHCL_GF_XXX), the host replies by replacing the parameter values with
344 * the host ones (VBOX_SHCL_HF_XXX).
345 *
346 * @retval VINF_SUCCESS on success.
347 * @retval VERR_INVALID_CLIENT_ID
348 * @retval VERR_WRONG_PARAMETER_COUNT
349 * @retval VERR_WRONG_PARAMETER_TYPE
350 * @since 6.1
351 */
352#define VBOX_SHCL_GUEST_FN_REPORT_FEATURES 6
353/** Query the host ones feature masks.
354 *
355 * That way the guest (client) can get hold of the features from the host.
356 * Again, it is prudent to set the 127 bit and observe it being cleared on
357 * success, as older hosts might return success without doing anything.
358 *
359 * @retval VINF_SUCCESS on success.
360 * @retval VERR_INVALID_CLIENT_ID
361 * @retval VERR_WRONG_PARAMETER_COUNT
362 * @retval VERR_WRONG_PARAMETER_TYPE
363 * @since 6.1
364 */
365#define VBOX_SHCL_GUEST_FN_QUERY_FEATURES 7
366/** Peeks at the next message, returning immediately.
367 *
368 * @retval VINF_SUCCESS on success.
369 * @retval VERR_INVALID_CLIENT_ID
370 * @retval VERR_WRONG_PARAMETER_COUNT
371 * @retval VERR_WRONG_PARAMETER_TYPE
372 * @since 6.1
373 * @todo r=bird: Either s/_FN_(MSG_)/_MSG_/ or s/_FN_(MSG_)/_FN_/, the place
374 * you copied these from used _MSG_ instead of _FN_ in the general prefix.
375 */
376#define VBOX_SHCL_GUEST_FN_MSG_PEEK_NOWAIT 8
377/** Peeks at the next message, waiting for one to arrive.
378 *
379 * @retval VINF_SUCCESS on success.
380 * @retval VERR_INVALID_CLIENT_ID
381 * @retval VERR_WRONG_PARAMETER_COUNT
382 * @retval VERR_WRONG_PARAMETER_TYPE
383 * @since 6.1
384 */
385#define VBOX_SHCL_GUEST_FN_MSG_PEEK_WAIT 9
386/** Gets the next message, returning immediately.
387 *
388 * @retval VINF_SUCCESS on success.
389 * @retval VERR_INVALID_CLIENT_ID
390 * @retval VERR_WRONG_PARAMETER_COUNT
391 * @retval VERR_WRONG_PARAMETER_TYPE
392 * @since 6.1
393 */
394#define VBOX_SHCL_GUEST_FN_MSG_GET 10
395/** Replies to a function from the host.
396 *
397 * @retval VINF_SUCCESS on success.
398 * @retval VERR_INVALID_CLIENT_ID
399 * @retval VERR_WRONG_PARAMETER_COUNT
400 * @retval VERR_WRONG_PARAMETER_TYPE
401 * @since 6.1
402 */
403#define VBOX_SHCL_GUEST_FN_REPLY 11
404/** Gets the root list header from the host.
405 *
406 * @retval VINF_SUCCESS on success.
407 * @retval VERR_INVALID_CLIENT_ID
408 * @retval VERR_WRONG_PARAMETER_COUNT
409 * @retval VERR_WRONG_PARAMETER_TYPE
410 * @since 6.1
411 */
412#define VBOX_SHCL_GUEST_FN_ROOT_LIST_HDR_READ 12
413/** Sends the root list header to the host.
414 *
415 * @retval VINF_SUCCESS on success.
416 * @retval VERR_INVALID_CLIENT_ID
417 * @retval VERR_WRONG_PARAMETER_COUNT
418 * @retval VERR_WRONG_PARAMETER_TYPE
419 * @since 6.1
420 */
421#define VBOX_SHCL_GUEST_FN_ROOT_LIST_HDR_WRITE 13
422/** Gets a root list root entry from the host.
423 *
424 * @retval VINF_SUCCESS on success.
425 * @retval VERR_INVALID_CLIENT_ID
426 * @retval VERR_WRONG_PARAMETER_COUNT
427 * @retval VERR_WRONG_PARAMETER_TYPE
428 * @since 6.1
429 */
430#define VBOX_SHCL_GUEST_FN_ROOT_LIST_ENTRY_READ 14
431/** Sends a root list root entry to the host.
432 *
433 * @retval VINF_SUCCESS on success.
434 * @retval VERR_INVALID_CLIENT_ID
435 * @retval VERR_WRONG_PARAMETER_COUNT
436 * @retval VERR_WRONG_PARAMETER_TYPE
437 * @since 6.1
438 */
439#define VBOX_SHCL_GUEST_FN_ROOT_LIST_ENTRY_WRITE 15
440/** Opens / gets a list handle from the host.
441 *
442 * @retval VINF_SUCCESS on success.
443 * @retval VERR_INVALID_CLIENT_ID
444 * @retval VERR_WRONG_PARAMETER_COUNT
445 * @retval VERR_WRONG_PARAMETER_TYPE
446 * @since 6.1
447 */
448#define VBOX_SHCL_GUEST_FN_LIST_OPEN 16
449/** Closes a list handle from the host.
450 *
451 * @retval VINF_SUCCESS on success.
452 * @retval VERR_INVALID_CLIENT_ID
453 * @retval VERR_WRONG_PARAMETER_COUNT
454 * @retval VERR_WRONG_PARAMETER_TYPE
455 * @since 6.1
456 */
457#define VBOX_SHCL_GUEST_FN_LIST_CLOSE 17
458/** Reads a list header from the host.
459 *
460 * @retval VINF_SUCCESS on success.
461 * @retval VERR_INVALID_CLIENT_ID
462 * @retval VERR_WRONG_PARAMETER_COUNT
463 * @retval VERR_WRONG_PARAMETER_TYPE
464 * @since 6.1
465 */
466#define VBOX_SHCL_GUEST_FN_LIST_HDR_READ 18
467/** Writes a list header to the host.
468 *
469 * @retval VINF_SUCCESS on success.
470 * @retval VERR_INVALID_CLIENT_ID
471 * @retval VERR_WRONG_PARAMETER_COUNT
472 * @retval VERR_WRONG_PARAMETER_TYPE
473 * @since 6.1
474 */
475#define VBOX_SHCL_GUEST_FN_LIST_HDR_WRITE 19
476/** Reads a list entry from the host.
477 *
478 * @retval VINF_SUCCESS on success.
479 * @retval VERR_INVALID_CLIENT_ID
480 * @retval VERR_WRONG_PARAMETER_COUNT
481 * @retval VERR_WRONG_PARAMETER_TYPE
482 * @since 6.1
483 */
484#define VBOX_SHCL_GUEST_FN_LIST_ENTRY_READ 20
485/** Sends a list entry to the host.
486 *
487 * @retval VINF_SUCCESS on success.
488 * @retval VERR_INVALID_CLIENT_ID
489 * @retval VERR_WRONG_PARAMETER_COUNT
490 * @retval VERR_WRONG_PARAMETER_TYPE
491 * @since 6.1
492 */
493#define VBOX_SHCL_GUEST_FN_LIST_ENTRY_WRITE 21
494/** Opens an object on the host.
495 *
496 * @retval VINF_SUCCESS on success.
497 * @retval VERR_INVALID_CLIENT_ID
498 * @retval VERR_WRONG_PARAMETER_COUNT
499 * @retval VERR_WRONG_PARAMETER_TYPE
500 * @since 6.1
501 */
502#define VBOX_SHCL_GUEST_FN_OBJ_OPEN 22
503/** Closes an object on the host.
504 *
505 * @retval VINF_SUCCESS on success.
506 * @retval VERR_INVALID_CLIENT_ID
507 * @retval VERR_WRONG_PARAMETER_COUNT
508 * @retval VERR_WRONG_PARAMETER_TYPE
509 * @since 6.1
510 */
511#define VBOX_SHCL_GUEST_FN_OBJ_CLOSE 23
512/** Reads from an object on the host.
513 *
514 * @retval VINF_SUCCESS on success.
515 * @retval VERR_INVALID_CLIENT_ID
516 * @retval VERR_WRONG_PARAMETER_COUNT
517 * @retval VERR_WRONG_PARAMETER_TYPE
518 * @since 6.1
519 */
520#define VBOX_SHCL_GUEST_FN_OBJ_READ 24
521/** Writes to an object on the host.
522 *
523 * @retval VINF_SUCCESS on success.
524 * @retval VERR_INVALID_CLIENT_ID
525 * @retval VERR_WRONG_PARAMETER_COUNT
526 * @retval VERR_WRONG_PARAMETER_TYPE
527 * @since 6.1
528 */
529#define VBOX_SHCL_GUEST_FN_OBJ_WRITE 25
530/** Reports cancellation of the current operation to the host.
531 *
532 * @retval VINF_SUCCESS on success.
533 * @retval VERR_INVALID_CLIENT_ID
534 * @retval VERR_WRONG_PARAMETER_COUNT
535 * @retval VERR_WRONG_PARAMETER_TYPE
536 * @since 6.1
537 */
538#define VBOX_SHCL_GUEST_FN_CANCEL 26
539/** Reports an error to the host.
540 *
541 * @retval VINF_SUCCESS on success.
542 * @retval VERR_INVALID_CLIENT_ID
543 * @retval VERR_WRONG_PARAMETER_COUNT
544 * @retval VERR_WRONG_PARAMETER_TYPE
545 * @since 6.1
546 */
547#define VBOX_SHCL_GUEST_FN_ERROR 27
548
549/** The last function number (used for validation/sanity). */
550#define VBOX_SHCL_GUEST_FN_LAST VBOX_SHCL_GUEST_FN_ERROR
551/** @} */
552
553
554/** The maximum default chunk size for a single data transfer.
555 * @note r=bird: Nobody actually uses this. */
556#define VBOX_SHCL_DEFAULT_MAX_CHUNK_SIZE _64K
557
558
559/** @name VBOX_SHCL_GF_XXX - Guest features.
560 * @sa VBOX_SHCL_GUEST_FN_REPORT_FEATURES
561 * @{ */
562/** No flags set. */
563#define VBOX_SHCL_GF_NONE 0
564/** Guest can handle context IDs (uint64_t, in paParam[0]).
565 * This is true for Guest Additions < 6.1. */
566#define VBOX_SHCL_GF_0_CONTEXT_ID RT_BIT_64(0)
567/** Bit that must be set in the 2nd parameter, will be cleared if the host reponds
568 * correctly (old hosts might not). */
569#define VBOX_SHCL_GF_1_MUST_BE_ONE RT_BIT_64(63)
570/** @} */
571
572/** @name VBOX_GUESTCTRL_HF_XXX - Host features.
573 * @sa VBOX_SHCL_GUEST_FN_REPORT_FEATURES
574 * @{ */
575/** No flags set. */
576#define VBOX_SHCL_HF_NONE 0
577/** @} */
578
579
580/** @name VBOX_SHCL_FMT_XXX - Data formats (flags) for Shared Clipboard.
581 * @{
582 */
583/** No format set. */
584#define VBOX_SHCL_FMT_NONE 0
585/** Shared Clipboard format is an Unicode text. */
586#define VBOX_SHCL_FMT_UNICODETEXT RT_BIT(0)
587/** Shared Clipboard format is bitmap (BMP / DIB). */
588#define VBOX_SHCL_FMT_BITMAP RT_BIT(1)
589/** Shared Clipboard format is HTML. */
590#define VBOX_SHCL_FMT_HTML RT_BIT(2)
591#ifdef VBOX_WITH_SHARED_CLIPBOARD_TRANSFERS
592/** Shared Clipboard format is a transfer list. */
593# define VBOX_SHCL_FMT_URI_LIST RT_BIT(3)
594#endif
595/** @} */
596
597
598/** @name Context ID related macros and limits
599 * @{ */
600/**
601 * Creates a context ID out of a client ID, a transfer ID and an event ID (count).
602 */
603#define VBOX_SHCL_CONTEXTID_MAKE(a_idSession, a_idTransfer, a_idEvent) \
604 ( ((uint64_t)((a_idSession) & 0xffff) << 48) \
605 | ((uint64_t)((a_idTransfer) & 0xffff) << 32) \
606 | ((uint32_t) (a_idEvent)) \
607 )
608/** Creates a context ID out of a session ID. */
609#define VBOX_SHCL_CONTEXTID_MAKE_SESSION(a_idSession) VBOX_SHCL_CONTEXTID_MAKE(a_idSession, 0, 0)
610/** Gets the session ID out of a context ID. */
611#define VBOX_SHCL_CONTEXTID_GET_SESSION(a_idContext) ( (uint16_t)(((a_idContext) >> 48) & UINT16_MAX) )
612/** Gets the transfer ID out of a context ID. */
613#define VBOX_SHCL_CONTEXTID_GET_TRANSFER(a_idContext) ( (uint16_t)(((a_idContext) >> 32) & UINT16_MAX) )
614/** Gets the transfer event out of a context ID. */
615#define VBOX_SHCL_CONTEXTID_GET_EVENT(a_idContext) ( (uint32_t)( (a_idContext) & UINT32_MAX) )
616
617/** Maximum number of concurrent Shared Clipboard client sessions a VM can have. */
618#define VBOX_SHCL_MAX_SESSIONS (UINT16_MAX - 1)
619/** Maximum number of concurrent Shared Clipboard transfers a single client can have. */
620#define VBOX_SHCL_MAX_TRANSFERS (UINT16_MAX - 1)
621/** Maximum number of events a single Shared Clipboard transfer can have. */
622#define VBOX_SHCL_MAX_EVENTS (UINT32_MAX - 1)
623/** @} */
624
625
626/*
627 * HGCM parameter structures.
628 */
629/** @todo r=bird: These structures are mostly pointless, as they're only
630 * ever used by the VbglR3 part. The host service does not use these
631 * structures for decoding guest requests, instead it's all hardcoded. */
632#pragma pack(1)
633/**
634 * Waits (blocking) for a new host message to arrive.
635 * Deprecated; do not use anymore.
636 * Kept for maintaining compatibility with older Guest Additions.
637 */
638typedef struct _VBoxShClGetHostMsgOld
639{
640 VBGLIOCHGCMCALL hdr;
641
642 /** uint32_t, out: Host message type. */
643 HGCMFunctionParameter msg;
644 /** uint32_t, out: VBOX_SHCL_FMT_*, depends on the 'msg'.
645 * r=andy This actual can have *different* meanings, depending on the host message type. */
646 HGCMFunctionParameter formats; /* OUT uint32_t */
647} VBoxShClGetHostMsgOld;
648
649#define VBOX_SHCL_CPARMS_GET_HOST_MSG_OLD 2
650
651/**
652 * Message for doing the protocol negotiation between the host
653 * and the guest. Not available on older (VBox <= 6.0) hosts.
654 *
655 * This message acts as a beacon between the old protocol (VBox <= 6.0) and
656 * the new protocol (>= VBox 6.1). Newer features are getting introduced soley via
657 * the guest / host feature flags then.
658 */
659typedef struct _VBoxShClConnect
660{
661 VBGLIOCHGCMCALL hdr;
662
663 /** uint32_t, out: Maximum chunk size for data transfers. */
664 HGCMFunctionParameter cbChunkSize;
665 /** uint32_t, in/out: Compression type. Currently unused. */
666 HGCMFunctionParameter enmCompression;
667 /** uint32_t, in/out: Checksum type used for data transfer. Currently unused. */
668 HGCMFunctionParameter enmChecksumType;
669} VBoxShClConnect;
670
671#define VBOX_SHCL_CPARMS_CONNECT 3
672
673/**
674 * Reports available formats.
675 */
676typedef struct _VBoxShClFormatsMsg
677{
678 VBGLIOCHGCMCALL hdr;
679
680 union
681 {
682 struct
683 {
684 /** uint32_t, out: VBOX_SHCL_FMT_*. */
685 HGCMFunctionParameter uFormats;
686 } v0;
687
688 struct
689 {
690 /** uint64_t, out: Context ID. */
691 HGCMFunctionParameter uContext;
692 /** uint32_t, out: VBOX_SHCL_FMT_*. */
693 HGCMFunctionParameter uFormats;
694 /** uint32_t, out: Format flags. */
695 HGCMFunctionParameter fFlags;
696 } v1;
697 } u;
698} VBoxShClFormatsMsg;
699
700/**
701 * Requests to read clipboard data.
702 */
703typedef struct _VBoxShClReadDataReqMsg
704{
705 VBGLIOCHGCMCALL hdr;
706
707 /** uint64_t, out: Context ID. */
708 HGCMFunctionParameter uContext;
709 /** uint32_t, out: Request flags; currently unused and must be set to 0. */
710 HGCMFunctionParameter fFlags;
711 /** uint32_t, out: Requested format to read data in. */
712 HGCMFunctionParameter uFormat;
713 /** uint32_t, out: Maximum size (in bytes) to read. */
714 HGCMFunctionParameter cbSize;
715} VBoxShClReadDataReqMsg;
716
717#define VBOX_SHCL_CPARMS_READ_DATA_REQ 4
718
719/** @name VBOX_SHCL_GUEST_FN_DATA_READ
720 * @{ */
721/** VBOX_SHCL_GUEST_FN_DATA_READ parameters. */
722typedef struct VBoxShClParmDataRead
723{
724 /** uint32_t, in: Requested format (VBOX_SHCL_FMT_XXX). */
725 HGCMFunctionParameter f32Format;
726 /** ptr, out: The data buffer to put the data in on success. */
727 HGCMFunctionParameter pData;
728 /** uint32_t, out: Size of returned data, if larger than the buffer, then no
729 * data was actually transferred and the guest must repeat the call. */
730 HGCMFunctionParameter cb32Needed;
731} VBoxShClParmDataRead;
732
733#define VBOX_SHCL_CPARMS_DATA_READ 3 /**< The parameter count for VBOX_SHCL_GUEST_FN_DATA_READ. */
734#define VBOX_SHCL_CPARMS_DATA_READ_61B 5 /**< The 6.1 dev cycle variant, see VBOX_SHCL_GUEST_FN_DATA_READ. */
735/** @} */
736
737/** @name
738 * @{ */
739
740/** VBOX_SHCL_GUEST_FN_DATA_WRITE parameters. */
741typedef struct VBoxShClParmDataWrite
742{
743 /** uint64_t, in: Context ID from VBOX_SHCL_HOST_MSG_READ_DATA. */
744 HGCMFunctionParameter id64Context;
745 /** uint32_t, in: The data format (VBOX_SHCL_FMT_XXX). */
746 HGCMFunctionParameter f32Format;
747 /** ptr, in: The data. */
748 HGCMFunctionParameter pData;
749} VBoxShClParmDataWrite;
750
751/** Old VBOX_SHCL_GUEST_FN_DATA_WRITE parameters. */
752typedef struct VBoxShClParmDataWriteOld
753{
754 /** uint32_t, in: The data format (VBOX_SHCL_FMT_XXX). */
755 HGCMFunctionParameter f32Format;
756 /** ptr, in: The data. */
757 HGCMFunctionParameter pData;
758} VBoxShClParmDataWriteOld;
759
760#define VBOX_SHCL_CPARMS_DATA_WRITE 3 /**< The variant used when VBOX_SHCL_GF_0_CONTEXT_ID is reported. */
761#define VBOX_SHCL_CPARMS_DATA_WRITE_OLD 2 /**< The variant used when VBOX_SHCL_GF_0_CONTEXT_ID isn't reported. */
762#define VBOX_SHCL_CPARMS_DATA_WRITE_61B 5 /**< The 6.1 dev cycle variant, see VBOX_SHCL_GUEST_FN_DATA_WRITE. */
763/** @} */
764
765/**
766 * Reports a transfer status.
767 */
768typedef struct _VBoxShClTransferStatusMsg
769{
770 VBGLIOCHGCMCALL hdr;
771
772 /** uint64_t, out: Context ID. */
773 HGCMFunctionParameter uContext;
774 /** uint32_t, out: Direction of transfer; of type SHCLTRANSFERDIR_. */
775 HGCMFunctionParameter enmDir;
776 /** uint32_t, out: Status to report; of type SHCLTRANSFERSTATUS_. */
777 HGCMFunctionParameter enmStatus;
778 /** uint32_t, out: Result code to report. Optional. */
779 HGCMFunctionParameter rc;
780 /** uint32_t, out: Reporting flags. Currently unused and must be 0. */
781 HGCMFunctionParameter fFlags;
782} VBoxShClTransferStatusMsg;
783
784#define VBOX_SHCL_CPARMS_TRANSFER_STATUS 5
785
786/**
787 * Asks the host for the next command to process, along
788 * with the needed amount of parameters and an optional blocking
789 * flag.
790 *
791 * Used by: VBOX_SHCL_GUEST_FN_GET_HOST_MSG
792 *
793 */
794typedef struct _VBoxShClGetHostMsg
795{
796 VBGLIOCHGCMCALL hdr;
797
798 /** uint32_t, out: Message ID. */
799 HGCMFunctionParameter uMsg;
800 /** uint32_t, out: Number of parameters the message needs. */
801 HGCMFunctionParameter cParms;
802 /** uint32_t, in: Whether or not to block (wait) for a new message to arrive. */
803 HGCMFunctionParameter fBlock;
804} VBoxShClPeekMsg;
805
806#define VBOX_SHCL_CPARMS_GET_HOST_MSG 3
807
808/** No listing flags specified. */
809#define VBOX_SHCL_LIST_FLAG_NONE 0
810/** Only returns one entry per read. */
811#define VBOX_SHCL_LIST_FLAG_RETURN_ONE RT_BIT(0)
812/** Restarts reading a list from the beginning. */
813#define VBOX_SHCL_LIST_FLAG_RESTART RT_BIT(1)
814
815#define VBOX_SHCL_LISTHDR_FLAG_NONE 0
816
817/** No additional information provided. */
818#define VBOX_SHCL_INFO_FLAG_NONE 0
819/** Get object information of type SHCLFSOBJINFO. */
820#define VBOX_SHCL_INFO_FLAG_FSOBJINFO RT_BIT(0)
821
822/**
823 * Status messag for lists and objects.
824 */
825typedef struct _VBoxShClStatusMsg
826{
827 VBGLIOCHGCMCALL hdr;
828
829 /** uint64_t, in: Context ID. */
830 HGCMFunctionParameter uContext;
831 /** uint32_t, in: Transfer status of type SHCLTRANSFERSTATUS. */
832 HGCMFunctionParameter uStatus;
833 /** uint32_t, in: Size of payload of this status, based on the status type. */
834 HGCMFunctionParameter cbPayload;
835 /** pointer, in: Optional payload of this status, based on the status type. */
836 HGCMFunctionParameter pvPayload;
837} VBoxShClStatusMsg;
838
839#define VBOX_SHCL_CPARMS_STATUS 4
840
841/** Invalid message type, do not use. */
842#define VBOX_SHCL_REPLYMSGTYPE_INVALID 0
843/** Replies a transfer status. */
844#define VBOX_SHCL_REPLYMSGTYPE_TRANSFER_STATUS 1
845/** Replies a list open status. */
846#define VBOX_SHCL_REPLYMSGTYPE_LIST_OPEN 2
847/** Replies a list close status. */
848#define VBOX_SHCL_REPLYMSGTYPE_LIST_CLOSE 3
849/** Replies an object open status. */
850#define VBOX_SHCL_REPLYMSGTYPE_OBJ_OPEN 4
851/** Replies an object close status. */
852#define VBOX_SHCL_REPLYMSGTYPE_OBJ_CLOSE 5
853
854/**
855 * Generic reply message.
856 */
857typedef struct _VBoxShClReplyMsg
858{
859 VBGLIOCHGCMCALL hdr;
860
861 /** uint64_t, out: Context ID. */
862 HGCMFunctionParameter uContext;
863 /** uint32_t, out: Message type of type VBOX_SHCL_REPLYMSGTYPE_XXX. */
864 HGCMFunctionParameter enmType;
865 /** uint32_t, out: IPRT result of overall operation. */
866 HGCMFunctionParameter rc;
867 /** uint32_t, out: Size of optional payload of this reply, based on the message type. */
868 HGCMFunctionParameter cbPayload;
869 /** pointer, out: Optional payload of this reply, based on the message type. */
870 HGCMFunctionParameter pvPayload;
871 union
872 {
873 struct
874 {
875 HGCMFunctionParameter enmStatus;
876 } TransferStatus;
877 struct
878 {
879 HGCMFunctionParameter uHandle;
880 } ListOpen;
881 struct
882 {
883 HGCMFunctionParameter uHandle;
884 } ObjOpen;
885 struct
886 {
887 HGCMFunctionParameter uHandle;
888 } ObjClose;
889 } u;
890} VBoxShClReplyMsg;
891
892/** Minimum parameters (HGCM function parameters minus the union) a reply message must have. */
893#define VBOX_SHCL_CPARMS_REPLY_MIN 5
894
895/**
896 * Structure for keeping root list message parameters.
897 */
898typedef struct _VBoxShClRootListParms
899{
900 /** uint64_t, in: Context ID. */
901 HGCMFunctionParameter uContext;
902 /** uint32_t, in: Roots listing flags; unused at the moment. */
903 HGCMFunctionParameter fRoots;
904} VBoxShClRootListParms;
905
906/**
907 * Requests to read the root list header.
908 */
909typedef struct _VBoxShClRootListReadReqMsg
910{
911 VBGLIOCHGCMCALL hdr;
912
913 VBoxShClRootListParms ReqParms;
914} VBoxShClRootListReadReqMsg;
915
916#define VBOX_SHCL_CPARMS_ROOT_LIST_HDR_READ_REQ 2
917
918/**
919 * Reads / Writes a root list header.
920 */
921typedef struct _VBoxShClRootListHdrMsg
922{
923 VBGLIOCHGCMCALL hdr;
924
925 VBoxShClRootListParms ReqParms;
926 /** uint64_t, in/out: Number of total root list entries. */
927 HGCMFunctionParameter cRoots;
928} VBoxShClRootListHdrMsg;
929
930#define VBOX_SHCL_CPARMS_ROOT_LIST_HDR_READ 3
931#define VBOX_SHCL_CPARMS_ROOT_LIST_HDR_WRITE 3
932
933/**
934 * Structure for keeping list entry message parameters.
935 */
936typedef struct _VBoxShClRootListEntryParms
937{
938 /** uint64_t, in: Context ID. */
939 HGCMFunctionParameter uContext;
940 /** uint32_t, in: VBOX_SHCL_INFO_FLAG_XXX. */
941 HGCMFunctionParameter fInfo;
942 /** uint32_t, in: Index of root list entry to get (zero-based). */
943 HGCMFunctionParameter uIndex;
944} VBoxShClRootListEntryParms;
945
946/**
947 * Request to read a list root entry.
948 */
949typedef struct _VBoxShClRootListEntryReadReqMsg
950{
951 VBGLIOCHGCMCALL hdr;
952
953 /** in: Request parameters. */
954 VBoxShClRootListEntryParms Parms;
955} VBoxShClRootListEntryReadReqMsg;
956
957#define VBOX_SHCL_CPARMS_ROOT_LIST_ENTRY_READ_REQ 3
958
959/**
960 * Reads / Writes a root list entry.
961 */
962typedef struct _VBoxShClRootListEntryMsg
963{
964 VBGLIOCHGCMCALL hdr;
965
966 /** in/out: Request parameters. */
967 VBoxShClRootListEntryParms Parms;
968 /** pointer, in/out: Entry name. */
969 HGCMFunctionParameter szName;
970 /** uint32_t, out: Bytes to be used for information/How many bytes were used. */
971 HGCMFunctionParameter cbInfo;
972 /** pointer, in/out: Information to be set/get (SHCLFSOBJINFO only currently).
973 * Do not forget to set the SHCLFSOBJINFO::Attr::enmAdditional for Get operation as well. */
974 HGCMFunctionParameter pvInfo;
975} VBoxShClRootListEntryMsg;
976
977#define VBOX_SHCL_CPARMS_ROOT_LIST_ENTRY_READ 6
978#define VBOX_SHCL_CPARMS_ROOT_LIST_ENTRY_WRITE 6
979
980/**
981 * Opens a list.
982 */
983typedef struct _VBoxShClListOpenMsg
984{
985 VBGLIOCHGCMCALL hdr;
986
987 /** uint64_t, in: Context ID. */
988 HGCMFunctionParameter uContext;
989 /** uint32_t, in: Listing flags (see VBOX_SHCL_LIST_FLAG_XXX). */
990 HGCMFunctionParameter fList;
991 /** uint32_t, in: Size (in bytes) of the filter string. */
992 HGCMFunctionParameter cbFilter;
993 /** pointer, in: Filter string. */
994 HGCMFunctionParameter pvFilter;
995 /** uint32_t, in: Size (in bytes) of the listing path. */
996 HGCMFunctionParameter cbPath;
997 /** pointer, in: Listing poth. If empty or NULL the listing's root path will be opened. */
998 HGCMFunctionParameter pvPath;
999 /** uint64_t, out: List handle. */
1000 HGCMFunctionParameter uHandle;
1001} VBoxShClListOpenMsg;
1002
1003#define VBOX_SHCL_CPARMS_LIST_OPEN 7
1004
1005/**
1006 * Closes a list.
1007 */
1008typedef struct _VBoxShClListCloseMsg
1009{
1010 VBGLIOCHGCMCALL hdr;
1011
1012 /** uint64_t, in/out: Context ID. */
1013 HGCMFunctionParameter uContext;
1014 /** uint64_t, in: List handle. */
1015 HGCMFunctionParameter uHandle;
1016} VBoxShClListCloseMsg;
1017
1018#define VBOX_SHCL_CPARMS_LIST_CLOSE 2
1019
1020typedef struct _VBoxShClListHdrReqParms
1021{
1022 /** uint64_t, in: Context ID. */
1023 HGCMFunctionParameter uContext;
1024 /** uint64_t, in: List handle. */
1025 HGCMFunctionParameter uHandle;
1026 /** uint32_t, in: Flags of type VBOX_SHCL_LISTHDR_FLAG_XXX. */
1027 HGCMFunctionParameter fFlags;
1028} VBoxShClListHdrReqParms;
1029
1030/**
1031 * Request to read a list header.
1032 */
1033typedef struct _VBoxShClListHdrReadReqMsg
1034{
1035 VBGLIOCHGCMCALL hdr;
1036
1037 VBoxShClListHdrReqParms ReqParms;
1038} VBoxShClListHdrReadReqMsg;
1039
1040#define VBOX_SHCL_CPARMS_LIST_HDR_READ_REQ 3
1041
1042/**
1043 * Reads / Writes a list header.
1044 */
1045typedef struct _VBoxShClListHdrMsg
1046{
1047 VBGLIOCHGCMCALL hdr;
1048
1049 VBoxShClListHdrReqParms ReqParms;
1050 /** uint32_t, in/out: Feature flags (see VBOX_SHCL_FEATURE_FLAG_XXX). */
1051 HGCMFunctionParameter fFeatures;
1052 /** uint64_t, in/out: Number of total objects to transfer. */
1053 HGCMFunctionParameter cTotalObjects;
1054 /** uint64_t, in/out: Number of total bytes to transfer. */
1055 HGCMFunctionParameter cbTotalSize;
1056} VBoxShClListHdrMsg;
1057
1058#define VBOX_SHCL_CPARMS_LIST_HDR 6
1059
1060typedef struct _VBoxShClListEntryReqParms
1061{
1062 /** uint64_t, in: Context ID. */
1063 HGCMFunctionParameter uContext;
1064 /** uint64_t, in: List handle. */
1065 HGCMFunctionParameter uHandle;
1066 /** uint32_t, in: VBOX_SHCL_INFO_FLAG_XXX. */
1067 HGCMFunctionParameter fInfo;
1068} VBoxShClListEntryReqParms;
1069
1070/**
1071 * Request to read a list entry.
1072 */
1073typedef struct _VBoxShClListEntryReadReqMsg
1074{
1075 VBGLIOCHGCMCALL hdr;
1076
1077 VBoxShClListEntryReqParms ReqParms;
1078} VBoxShClListEntryReadReqMsg;
1079
1080#define VBOX_SHCL_CPARMS_LIST_ENTRY_READ 3
1081
1082/**
1083 * Reads / Writes a list entry.
1084 */
1085typedef struct _VBoxShClListEntryMsg
1086{
1087 VBGLIOCHGCMCALL hdr;
1088
1089 /** in/out: Request parameters. */
1090 VBoxShClListEntryReqParms ReqParms;
1091 /** pointer, in/out: Entry name. */
1092 HGCMFunctionParameter szName;
1093 /** uint32_t, out: Bytes to be used for information/How many bytes were used. */
1094 HGCMFunctionParameter cbInfo;
1095 /** pointer, in/out: Information to be set/get (SHCLFSOBJINFO only currently).
1096 * Do not forget to set the SHCLFSOBJINFO::Attr::enmAdditional for Get operation as well. */
1097 HGCMFunctionParameter pvInfo;
1098} VBoxShClListEntryMsg;
1099
1100#define VBOX_SHCL_CPARMS_LIST_ENTRY 6
1101
1102/**
1103 * Opens a Shared Clipboard object.
1104 */
1105typedef struct _VBoxShClObjOpenMsg
1106{
1107 VBGLIOCHGCMCALL hdr;
1108
1109 /** uint64_t, in/out: Context ID. */
1110 HGCMFunctionParameter uContext;
1111 /** uint64_t, in/out: Object handle. */
1112 HGCMFunctionParameter uHandle;
1113 /** uint32_t, in/out: Size (in bytes) of absoulte path of object to open/create. */
1114 HGCMFunctionParameter cbPath;
1115 /** pointer, in/out: Absoulte path of object to open/create. */
1116 HGCMFunctionParameter szPath;
1117 /** uint32_t in/out: Open / Create flags of type SHCL_OBJ_CF_. */
1118 HGCMFunctionParameter fCreate;
1119} VBoxShClObjOpenMsg;
1120
1121#define VBOX_SHCL_CPARMS_OBJ_OPEN 5
1122
1123/**
1124 * Closes a Shared Clipboard object.
1125 */
1126typedef struct _VBoxShClObjCloseMsg
1127{
1128 VBGLIOCHGCMCALL hdr;
1129
1130 /** uint64_t, in/out: Context ID. */
1131 HGCMFunctionParameter uContext;
1132 /** uint64_t, in: SHCLOBJHANDLE of object to close. */
1133 HGCMFunctionParameter uHandle;
1134} VBoxShClObjCloseMsg;
1135
1136#define VBOX_SHCL_CPARMS_OBJ_CLOSE 2
1137
1138/**
1139 * Structure for keeping read parameters of a Shared Clipboard object.
1140 */
1141typedef struct _VBoxShClObjReadReqParms
1142{
1143 /** uint64_t, in: Context ID. */
1144 HGCMFunctionParameter uContext;
1145 /** uint64_t, in: SHCLOBJHANDLE of object to write to. */
1146 HGCMFunctionParameter uHandle;
1147 /** uint32_t, in: How many bytes to read. */
1148 HGCMFunctionParameter cbToRead;
1149 /** uint32_t, in: Read flags. Currently unused and must be 0. */
1150 HGCMFunctionParameter fRead;
1151} VBoxShClObjReadReqParms;
1152
1153/**
1154 * Reads from a Shared Clipboard object.
1155 */
1156typedef struct _VBoxShClObjReadReqMsg
1157{
1158 VBGLIOCHGCMCALL hdr;
1159
1160 VBoxShClObjReadReqParms ReqParms;
1161} VBoxShClObjReadReqMsg;
1162
1163#define VBOX_SHCL_CPARMS_OBJ_READ_REQ 4
1164
1165/**
1166 * Reads / writes data of / to an object.
1167 *
1168 * Used by:
1169 * VBOX_SHCL_FN_OBJ_READ
1170 * VBOX_SHCL_FN_OBJ_WRITE
1171 */
1172typedef struct _VBoxShClObjReadWriteMsg
1173{
1174 VBGLIOCHGCMCALL hdr;
1175
1176 /** uint64_t, in/out: Context ID. */
1177 HGCMFunctionParameter uContext;
1178 /** uint64_t, in/out: SHCLOBJHANDLE of object to write to. */
1179 HGCMFunctionParameter uHandle;
1180 /** uint32_t, in/out: Size (in bytes) of current data chunk. */
1181 HGCMFunctionParameter cbData;
1182 /** pointer, in/out: Current data chunk. */
1183 HGCMFunctionParameter pvData;
1184 /** uint32_t, in/out: Size (in bytes) of current data chunk checksum. */
1185 HGCMFunctionParameter cbChecksum;
1186 /** pointer, in/out: Checksum of data block, based on the checksum
1187 * type in the data header. Optional. */
1188 HGCMFunctionParameter pvChecksum;
1189} VBoxShClObjReadWriteMsg;
1190
1191#define VBOX_SHCL_CPARMS_OBJ_READ 6
1192#define VBOX_SHCL_CPARMS_OBJ_WRITE 6
1193
1194/**
1195 * Sends an error event.
1196 *
1197 * Used by:
1198 * VBOX_SHCL_FN_WRITE_ERROR
1199 */
1200typedef struct _VBoxShClErrorMsg
1201{
1202 VBGLIOCHGCMCALL hdr;
1203
1204 /** uint64_t, in: Context ID. */
1205 HGCMFunctionParameter uContext;
1206 /** uint32_t, in: The error code (IPRT-style). */
1207 HGCMFunctionParameter rc;
1208} VBoxShClWriteErrorMsg;
1209
1210#define VBOX_SHCL_CPARMS_ERROR 2
1211
1212#pragma pack()
1213
1214#if 0 /** @todo r=bird: Wrong file + unused. Remove or put where they belong! */
1215/**
1216 * Structure for keeping a Shared Clipboard file data chunk.
1217 *
1218 * @returns VBox status code.
1219 */
1220typedef struct _SHCLFILEDATA
1221{
1222 /** Current file data chunk. */
1223 void *pvData;
1224 /** Size (in bytes) of current data chunk. */
1225 uint32_t cbData;
1226 /** Checksum for current file data chunk. */
1227 void *pvChecksum;
1228 /** Size (in bytes) of current data chunk. */
1229 uint32_t cbChecksum;
1230} SHCLFILEDATA, *PSHCLFILEDATA;
1231
1232/**
1233 * Structure for keeping Shared Clipboard error data.
1234 */
1235typedef struct _SHCLERRORDATA
1236{
1237 int32_t rc;
1238} SHCLERRORDATA, *PSHCLERRORDATA;
1239#endif
1240
1241#endif /* !VBOX_INCLUDED_HostServices_VBoxClipboardSvc_h */
1242
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