VirtualBox

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

Last change on this file since 90237 was 86960, checked in by vboxsync, 4 years ago

Shared Clipboard/Transfers: Removed clipboard area handling code. bugref:9437

  • Property svn:eol-style set to native
  • Property svn:keywords set to Id Revision
File size: 41.1 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-2020 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
76/** @name VBOX_SHCL_HOST_FN_XXX - The service functions which are callable by host.
77 * @note These are not sacred and can be modified at will as long as all host
78 * clients are updated accordingly (probably just Main).
79 * @{
80 */
81/** Sets the current Shared Clipboard operation mode. */
82#define VBOX_SHCL_HOST_FN_SET_MODE 1
83/** Sets the current Shared Clipboard (file) transfers mode.
84 * Operates on the VBOX_SHCL_TRANSFERS_XXX defines.
85 * @since 6.1 */
86#define VBOX_SHCL_HOST_FN_SET_TRANSFER_MODE 2
87/** Run headless on the host, i.e. do not touch the host clipboard. */
88#define VBOX_SHCL_HOST_FN_SET_HEADLESS 3
89
90/** Reports cancellation of the current operation to the guest.
91 * @since 6.1 - still a todo */
92#define VBOX_SHCL_HOST_FN_CANCEL 4
93/** Reports an error to the guest.
94 * @since 6.1 - still a todo */
95#define VBOX_SHCL_HOST_FN_ERROR 5
96/** @} */
97
98
99/** @name VBOX_SHCL_HOST_MSG_XXX - The host messages for the guest.
100 * @{
101 */
102/** Returned only when the HGCM client session is closed (by different thread).
103 *
104 * This can require no futher host interaction since the session has been
105 * closed.
106 *
107 * @since 1.3.2
108 */
109#define VBOX_SHCL_HOST_MSG_QUIT 1
110/** Request data for a specific format from the guest.
111 *
112 * Two parameters, first the 32-bit message ID followed by a 32-bit format bit
113 * (VBOX_SHCL_FMT_XXX). The guest will respond by issuing a
114 * VBOX_SHCL_GUEST_FN_DATA_WRITE.
115 *
116 * @note The host may sometimes incorrectly set more than one format bit, in
117 * which case it's up to the guest to pick which to write back.
118 * @since 1.3.2
119 */
120#define VBOX_SHCL_HOST_MSG_READ_DATA 2
121/** Reports available clipboard format on the host to the guest.
122 *
123 * Two parameters, first the 32-bit message ID followed by a 32-bit format mask
124 * containing zero or more VBOX_SHCL_FMT_XXX flags. The guest is not require to
125 * respond to the host when receiving this message.
126 *
127 * @since 1.3.2
128 */
129#define VBOX_SHCL_HOST_MSG_FORMATS_REPORT 3
130/** Message PEEK or GET operation was canceled, try again.
131 *
132 * This is returned by VBOX_SHCL_GUEST_FN_MSG_PEEK_WAIT and
133 * VBOX_SHCL_GUEST_FN_MSG_OLD_GET_WAIT in response to the guest calling
134 * VBOX_SHCL_GUEST_FN_MSG_CANCEL. The 2nd parameter is set to zero (be it
135 * thought of as a parameter count or a format mask).
136 *
137 * @since 6.1.0
138 */
139#define VBOX_SHCL_HOST_MSG_CANCELED 4
140
141/** Request data for a specific format from the guest with context ID.
142 *
143 * This is send instead of the VBOX_SHCL_HOST_MSG_READ_DATA message to guest
144 * that advertises VBOX_SHCL_GF_0_CONTEXT_ID. The first parameter is a 64-bit
145 * context ID which is to be used when issuing VBOX_SHCL_GUEST_F_DATA_WRITE, and
146 * the second parameter is a 32-bit format bit (VBOX_SHCL_FMT_XXX). The guest
147 * will respond by issuing a VBOX_SHCL_GUEST_F_DATA_WRITE.
148 *
149 * @note The host may sometimes incorrectly set more than one format bit, in
150 * which case it's up to the guest to pick which to write back.
151 * @since 6.1.2
152 */
153#define VBOX_SHCL_HOST_MSG_READ_DATA_CID 5
154
155/** Sends a transfer status to the guest side.
156 * @since 6.1.?
157 */
158#define VBOX_SHCL_HOST_MSG_TRANSFER_STATUS 50
159/** Reads the root list header from the guest.
160 * @since 6.1.?
161 */
162#define VBOX_SHCL_HOST_MSG_TRANSFER_ROOT_LIST_HDR_READ 51
163/** Writes the root list header to the guest.
164 * @since 6.1.?
165 */
166#define VBOX_SHCL_HOST_MSG_TRANSFER_ROOT_LIST_HDR_WRITE 52
167/** Reads a root list entry from the guest.
168 * @since 6.1.?
169 */
170#define VBOX_SHCL_HOST_MSG_TRANSFER_ROOT_LIST_ENTRY_READ 53
171/** Writes a root list entry to the guest.
172 * @since 6.1.?
173 */
174#define VBOX_SHCL_HOST_MSG_TRANSFER_ROOT_LIST_ENTRY_WRITE 54
175/** Open a transfer list on the guest side.
176 * @since 6.1.?
177 */
178#define VBOX_SHCL_HOST_MSG_TRANSFER_LIST_OPEN 55
179/** Closes a formerly opened transfer list on the guest side.
180 * @since 6.1.?
181 */
182#define VBOX_SHCL_HOST_MSG_TRANSFER_LIST_CLOSE 56
183/** Reads a list header from the guest.
184 * @since 6.1.?
185 */
186#define VBOX_SHCL_HOST_MSG_TRANSFER_LIST_HDR_READ 57
187/** Writes a list header to the guest.
188 * @since 6.1.?
189 */
190#define VBOX_SHCL_HOST_MSG_TRANSFER_LIST_HDR_WRITE 58
191/** Reads a list entry from the guest.
192 * @since 6.1.?
193 */
194#define VBOX_SHCL_HOST_MSG_TRANSFER_LIST_ENTRY_READ 59
195/** Writes a list entry to the guest.
196 * @since 6.1.?
197 */
198#define VBOX_SHCL_HOST_MSG_TRANSFER_LIST_ENTRY_WRITE 60
199/** Open a transfer object on the guest side.
200 * @since 6.1.?
201 */
202#define VBOX_SHCL_HOST_MSG_TRANSFER_OBJ_OPEN 61
203/** Closes a formerly opened transfer object on the guest side.
204 * @since 6.1.?
205 */
206#define VBOX_SHCL_HOST_MSG_TRANSFER_OBJ_CLOSE 62
207/** Reads from an object on the guest side.
208 * @since 6.1.?
209 */
210#define VBOX_SHCL_HOST_MSG_TRANSFER_OBJ_READ 63
211/** Writes to an object on the guest side.
212 * @since 6.1.?
213 */
214#define VBOX_SHCL_HOST_MSG_TRANSFER_OBJ_WRITE 64
215/** Indicates that the host has canceled a transfer.
216 * @since 6.1.?
217 */
218#define VBOX_SHCL_HOST_MSG_TRANSFER_CANCEL 65
219/** Indicates that the an unrecoverable error on the host occurred.
220 * @since 6.1.?
221 */
222#define VBOX_SHCL_HOST_MSG_TRANSFER_ERROR 66
223/** @} */
224
225
226/** @name VBOX_SHCL_GUEST_FN_XXX - The service functions which are called by guest.
227 * @{
228 */
229/** Calls the host and waits (blocking) for an host event VBOX_SHCL_HOST_MSG_XXX.
230 *
231 * @deprecated Replaced by VBOX_SHCL_GUEST_FN_MSG_PEEK_WAIT,
232 * VBOX_SHCL_GUEST_FN_MSG_GET, VBOX_SHCL_GUEST_FN_MSG_CANCEL.
233 * @since 1.3.2
234 */
235#define VBOX_SHCL_GUEST_FN_MSG_OLD_GET_WAIT 1
236/** Sends a list of available formats to the host.
237 *
238 * This function takes a single parameter, a 32-bit set of formats
239 * (VBOX_SHCL_FMT_XXX), this can be zero if the clipboard is empty or previously
240 * reported formats are no longer avaible (logout, shutdown, whatever).
241 *
242 * There was a period during 6.1 development where it would take three
243 * parameters, a 64-bit context ID preceeded the formats and a 32-bit MBZ flags
244 * parameter was appended. This is still accepted, though deprecated.
245 *
246 * @returns May return informational statuses indicating partial success, just
247 * ignore it.
248 * @retval VINF_SUCCESS on success.
249 * @retval VERR_INVALID_CLIENT_ID
250 * @retval VERR_WRONG_PARAMETER_COUNT
251 * @retval VERR_WRONG_PARAMETER_TYPE
252 * @retval VERR_NOT_SUPPORTED if all the formats are unsupported, host
253 * clipboard will be empty.
254 * @since 1.3.2
255 */
256#define VBOX_SHCL_GUEST_FN_REPORT_FORMATS 2
257/** Reads data in specified format from the host.
258 *
259 * This function takes three parameters, a 32-bit format bit
260 * (VBOX_SHCL_FMT_XXX), a buffer and 32-bit number of bytes read (output).
261 *
262 * There was a period during 6.1 development where it would take five parameters
263 * when VBOX_SHCL_GF_0_CONTEXT_ID was reported by the guest. A 64-bit context
264 * ID (ignored as purpose undefined), a 32-bit unused flag (MBZ), then the
265 * 32-bit format bits, number of bytes read (output), and the buffer. This
266 * format is still accepted.
267 *
268 * @retval VINF_SUCCESS on success.
269 * @retval VINF_BUFFER_OVERLFLOW (VBox >= 6.1 only) if not enough buffer space
270 * has been given to retrieve the actual data, no data actually copied.
271 * The call then must be repeated with a buffer size returned from the
272 * host in cbData.
273 * @retval VERR_INVALID_CLIENT_ID
274 * @retval VERR_WRONG_PARAMETER_COUNT
275 * @retval VERR_WRONG_PARAMETER_TYPE
276 * @since 1.3.2
277 */
278#define VBOX_SHCL_GUEST_FN_DATA_READ 3
279/** Writes requested data to the host.
280 *
281 * This function takes either 2 or 3 parameters. The last two parameters are a
282 * 32-bit format bit (VBOX_SHCL_FMT_XXX) and a data buffer holding the related
283 * data. The three parameter variant have a context ID first, which shall be a
284 * copy of the ID in the data request message.
285 *
286 * There was a period during 6.1 development where there would be a 5 parameter
287 * version of this, inserting an unused flags parameter between the context ID
288 * and the format bit, as well as a 32-bit data buffer size repate between the
289 * format bit and the data buffer. This format is still accepted, though
290 * deprecated.
291 *
292 * @retval VINF_SUCCESS on success.
293 * @retval VERR_INVALID_CLIENT_ID
294 * @retval VERR_WRONG_PARAMETER_COUNT
295 * @retval VERR_WRONG_PARAMETER_TYPE
296 * @retval VERR_INVALID_CONTEXT if the context ID didn't match up.
297 * @since 1.3.2
298 */
299#define VBOX_SHCL_GUEST_FN_DATA_WRITE 4
300
301/** This is a left-over from the 6.1 dev cycle and will always fail.
302 *
303 * It used to take three 32-bit parameters, only one of which was actually used.
304 *
305 * It was replaced by VBOX_SHCL_GUEST_FN_REPORT_FEATURES and
306 * VBOX_SHCL_GUEST_FN_NEGOTIATE_CHUNK_SIZE.
307 *
308 * @retval VERR_NOT_IMPLEMENTED
309 * @since 6.1
310 */
311#define VBOX_SHCL_GUEST_FN_CONNECT 5
312/** Report guest side feature flags and retrieve the host ones.
313 *
314 * Two 64-bit parameters are passed in from the guest with the guest features
315 * (VBOX_SHCL_GF_XXX), the host replies by replacing the parameter values with
316 * the host ones (VBOX_SHCL_HF_XXX).
317 *
318 * @retval VINF_SUCCESS on success.
319 * @retval VERR_INVALID_CLIENT_ID
320 * @retval VERR_WRONG_PARAMETER_COUNT
321 * @retval VERR_WRONG_PARAMETER_TYPE
322 * @since 6.1.0
323 */
324#define VBOX_SHCL_GUEST_FN_REPORT_FEATURES 6
325/** Query the host ones feature masks.
326 *
327 * That way the guest (client) can get hold of the features from the host.
328 * Again, it is prudent to set the 127 bit and observe it being cleared on
329 * success, as older hosts might return success without doing anything.
330 *
331 * @retval VINF_SUCCESS on success.
332 * @retval VERR_INVALID_CLIENT_ID
333 * @retval VERR_WRONG_PARAMETER_COUNT
334 * @retval VERR_WRONG_PARAMETER_TYPE
335 * @since 6.1.0
336 */
337#define VBOX_SHCL_GUEST_FN_QUERY_FEATURES 7
338/** Peeks at the next message, returning immediately.
339 *
340 * Returns two 32-bit parameters, first is the message ID and the second the
341 * parameter count. May optionally return additional 32-bit parameters with the
342 * sizes of respective message parameters. To distinguish buffer sizes from
343 * integer parameters, the latter gets their sizes inverted (uint32_t is ~4U,
344 * uint64_t is ~8U).
345 *
346 * Does also support the VM restore checking as in VBOX_SHCL_GUEST_FN_MSG_PEEK_WAIT
347 * (64-bit param \# 0), see documentation there.
348 *
349 * @retval VINF_SUCCESS if a message was pending and is being returned.
350 * @retval VERR_TRY_AGAIN if no message pending.
351 * @retval VERR_VM_RESTORED if first parameter is a non-zero 64-bit value that
352 * does not match VbglR3GetSessionId() any more. The new value is
353 * returned.
354 * @retval VERR_INVALID_CLIENT_ID
355 * @retval VERR_WRONG_PARAMETER_COUNT
356 * @retval VERR_WRONG_PARAMETER_TYPE
357 * @since 6.1.0
358 */
359#define VBOX_SHCL_GUEST_FN_MSG_PEEK_NOWAIT 8
360/** Peeks at the next message, waiting for one to arrive.
361 *
362 * Returns two 32-bit parameters, first is the message ID and the second the
363 * parameter count. May optionally return additional 32-bit parameters with the
364 * sizes of respective message parameters. To distinguish buffer sizes from
365 * integer parameters, the latter gets their sizes inverted (uint32_t is ~4U,
366 * uint64_t is ~8U).
367 *
368 * To facilitate VM restore checking, the first parameter can be a 64-bit
369 * integer holding the VbglR3GetSessionId() value the guest knowns. The
370 * function will then check this before going to sleep and return
371 * VERR_VM_RESTORED if it doesn't match, same thing happens when the VM is
372 * restored.
373 *
374 * @retval VINF_SUCCESS if info about an pending message is being returned.
375 * @retval VINF_TRY_AGAIN and message set to VBOX_SHCL_HOST_MSG_CANCELED if
376 * cancelled by VBOX_SHCL_GUEST_FN_MSG_CANCEL.
377 * @retval VERR_RESOURCE_BUSY if another thread already made a waiting call.
378 * @retval VERR_VM_RESTORED if first parameter is a non-zero 64-bit value that
379 * does not match VbglR3GetSessionId() any more. The new value is
380 * returned.
381 * @retval VERR_INVALID_CLIENT_ID
382 * @retval VERR_WRONG_PARAMETER_COUNT
383 * @retval VERR_WRONG_PARAMETER_TYPE
384 * @note This replaces VBOX_SHCL_GUEST_FN_MSG_OLD_GET_WAIT.
385 * @since 6.1.0
386 */
387#define VBOX_SHCL_GUEST_FN_MSG_PEEK_WAIT 9
388/** Gets the next message, returning immediately.
389 *
390 * All parameters are specific to the message being retrieved, however if the
391 * first one is an integer value it shall be an input parameter holding the
392 * ID of the message being retrieved. While it would be nice to add a separate
393 * parameter for this purpose, this is done so because the code was liften from
394 * Guest Controls which had backwards compatibilities to consider and we just
395 * kept it like that.
396 *
397 * @retval VINF_SUCCESS if message retrieved and removed from the pending queue.
398 * @retval VERR_TRY_AGAIN if no message pending.
399 * @retval VERR_MISMATCH if the incoming message ID does not match the pending.
400 * @retval VERR_BUFFER_OVERFLOW if a parmeter buffer is too small. The buffer
401 * size was updated to reflect the required size.
402 * @retval VERR_INVALID_CLIENT_ID
403 * @retval VERR_WRONG_PARAMETER_COUNT
404 * @retval VERR_WRONG_PARAMETER_TYPE
405 * @note This replaces VBOX_SHCL_GUEST_FN_MSG_OLD_GET_WAIT.
406 * @since 6.1.0
407 */
408#define VBOX_SHCL_GUEST_FN_MSG_GET 10
409/** Cancels pending calls for this client session.
410 *
411 * This should be used if a VBOX_SHCL_GUEST_FN__MSG_PEEK_WAIT or
412 * VBOX_SHCL_GUEST_FN_MSG_OLD_GET_WAIT call gets interrupted on the client end,
413 * so as to prevent being rebuffed with VERR_RESOURCE_BUSY when restarting the
414 * call.
415 *
416 * @retval VINF_SUCCESS if cancelled any calls.
417 * @retval VWRN_NOT_FOUND if no callers.
418 * @retval VERR_INVALID_CLIENT_ID
419 * @retval VERR_WRONG_PARAMETER_COUNT
420 * @since 6.1.0
421 */
422#define VBOX_SHCL_GUEST_FN_MSG_CANCEL 26
423
424/** Replies to a function from the host.
425 *
426 * @retval VINF_SUCCESS on success.
427 * @retval VERR_INVALID_CLIENT_ID
428 * @retval VERR_WRONG_PARAMETER_COUNT
429 * @retval VERR_WRONG_PARAMETER_TYPE
430 * @since 6.1.x
431 */
432#define VBOX_SHCL_GUEST_FN_REPLY 11
433/** Gets the root list header from the host.
434 *
435 * @retval VINF_SUCCESS on success.
436 * @retval VERR_INVALID_CLIENT_ID
437 * @retval VERR_WRONG_PARAMETER_COUNT
438 * @retval VERR_WRONG_PARAMETER_TYPE
439 * @since 6.1.x
440 */
441#define VBOX_SHCL_GUEST_FN_ROOT_LIST_HDR_READ 12
442/** Sends the root list header to the host.
443 *
444 * @retval VINF_SUCCESS on success.
445 * @retval VERR_INVALID_CLIENT_ID
446 * @retval VERR_WRONG_PARAMETER_COUNT
447 * @retval VERR_WRONG_PARAMETER_TYPE
448 * @since 6.1.x
449 */
450#define VBOX_SHCL_GUEST_FN_ROOT_LIST_HDR_WRITE 13
451/** Gets a root list root entry from the host.
452 *
453 * @retval VINF_SUCCESS on success.
454 * @retval VERR_INVALID_CLIENT_ID
455 * @retval VERR_WRONG_PARAMETER_COUNT
456 * @retval VERR_WRONG_PARAMETER_TYPE
457 * @since 6.1.x
458 */
459#define VBOX_SHCL_GUEST_FN_ROOT_LIST_ENTRY_READ 14
460/** Sends a root list root entry to the host.
461 *
462 * @retval VINF_SUCCESS on success.
463 * @retval VERR_INVALID_CLIENT_ID
464 * @retval VERR_WRONG_PARAMETER_COUNT
465 * @retval VERR_WRONG_PARAMETER_TYPE
466 * @since 6.1.x
467 */
468#define VBOX_SHCL_GUEST_FN_ROOT_LIST_ENTRY_WRITE 15
469/** Opens / gets a list handle from the host.
470 *
471 * @retval VINF_SUCCESS on success.
472 * @retval VERR_INVALID_CLIENT_ID
473 * @retval VERR_WRONG_PARAMETER_COUNT
474 * @retval VERR_WRONG_PARAMETER_TYPE
475 * @since 6.1.x
476 */
477#define VBOX_SHCL_GUEST_FN_LIST_OPEN 16
478/** Closes a list handle from the host.
479 *
480 * @retval VINF_SUCCESS on success.
481 * @retval VERR_INVALID_CLIENT_ID
482 * @retval VERR_WRONG_PARAMETER_COUNT
483 * @retval VERR_WRONG_PARAMETER_TYPE
484 * @since 6.1.x
485 */
486#define VBOX_SHCL_GUEST_FN_LIST_CLOSE 17
487/** Reads a list header from the host.
488 *
489 * @retval VINF_SUCCESS on success.
490 * @retval VERR_INVALID_CLIENT_ID
491 * @retval VERR_WRONG_PARAMETER_COUNT
492 * @retval VERR_WRONG_PARAMETER_TYPE
493 * @since 6.1.x
494 */
495#define VBOX_SHCL_GUEST_FN_LIST_HDR_READ 18
496/** Writes a list header to the host.
497 *
498 * @retval VINF_SUCCESS on success.
499 * @retval VERR_INVALID_CLIENT_ID
500 * @retval VERR_WRONG_PARAMETER_COUNT
501 * @retval VERR_WRONG_PARAMETER_TYPE
502 * @since 6.1.x
503 */
504#define VBOX_SHCL_GUEST_FN_LIST_HDR_WRITE 19
505/** Reads a list entry from the host.
506 *
507 * @retval VINF_SUCCESS on success.
508 * @retval VERR_INVALID_CLIENT_ID
509 * @retval VERR_WRONG_PARAMETER_COUNT
510 * @retval VERR_WRONG_PARAMETER_TYPE
511 * @since 6.1.x
512 */
513#define VBOX_SHCL_GUEST_FN_LIST_ENTRY_READ 20
514/** Sends a list entry to the host.
515 *
516 * @retval VINF_SUCCESS on success.
517 * @retval VERR_INVALID_CLIENT_ID
518 * @retval VERR_WRONG_PARAMETER_COUNT
519 * @retval VERR_WRONG_PARAMETER_TYPE
520 * @since 6.1.x
521 */
522#define VBOX_SHCL_GUEST_FN_LIST_ENTRY_WRITE 21
523/** Opens an object on the host.
524 *
525 * @retval VINF_SUCCESS on success.
526 * @retval VERR_INVALID_CLIENT_ID
527 * @retval VERR_WRONG_PARAMETER_COUNT
528 * @retval VERR_WRONG_PARAMETER_TYPE
529 * @since 6.1.x
530 */
531#define VBOX_SHCL_GUEST_FN_OBJ_OPEN 22
532/** Closes an object on the host.
533 *
534 * @retval VINF_SUCCESS on success.
535 * @retval VERR_INVALID_CLIENT_ID
536 * @retval VERR_WRONG_PARAMETER_COUNT
537 * @retval VERR_WRONG_PARAMETER_TYPE
538 * @since 6.1.x
539 */
540#define VBOX_SHCL_GUEST_FN_OBJ_CLOSE 23
541/** Reads from an object on the host.
542 *
543 * @retval VINF_SUCCESS on success.
544 * @retval VERR_INVALID_CLIENT_ID
545 * @retval VERR_WRONG_PARAMETER_COUNT
546 * @retval VERR_WRONG_PARAMETER_TYPE
547 * @since 6.1.x
548 */
549#define VBOX_SHCL_GUEST_FN_OBJ_READ 24
550/** Writes to an object on the host.
551 *
552 * @retval VINF_SUCCESS on success.
553 * @retval VERR_INVALID_CLIENT_ID
554 * @retval VERR_WRONG_PARAMETER_COUNT
555 * @retval VERR_WRONG_PARAMETER_TYPE
556 * @since 6.1.x
557 */
558#define VBOX_SHCL_GUEST_FN_OBJ_WRITE 25
559/** Reports an error to the host.
560 *
561 * @todo r=bird: Smells like GUEST_MSG_SKIP
562 *
563 * @retval VINF_SUCCESS on success.
564 * @retval VERR_INVALID_CLIENT_ID
565 * @retval VERR_WRONG_PARAMETER_COUNT
566 * @retval VERR_WRONG_PARAMETER_TYPE
567 * @since 6.1
568 */
569#define VBOX_SHCL_GUEST_FN_ERROR 27
570
571/** For negotiating a chunk size between the guest and host.
572 *
573 * Takes two 32-bit parameters both being byte counts, the first one gives the
574 * maximum chunk size the guest can handle and the second the preferred choice
575 * of the guest. Upon return, the host will have updated both of them to
576 * reflect the maximum and default chunk sizes this client connect. The guest
577 * may set the 2nd value to zero and let the host choose.
578 *
579 * @retval VINF_SUCCESS on success.
580 * @retval VERR_INVALID_CLIENT_ID
581 * @retval VERR_WRONG_PARAMETER_COUNT
582 * @retval VERR_WRONG_PARAMETER_TYPE
583 * @retval VERR_INVALID_PARAMETER if the 2nd parameter is larger than the
584 * first one
585 * @since 6.1
586 */
587#define VBOX_SHCL_GUEST_FN_NEGOTIATE_CHUNK_SIZE 28
588
589/** The last function number (used for validation/sanity). */
590#define VBOX_SHCL_GUEST_FN_LAST VBOX_SHCL_GUEST_FN_NEGOTIATE_CHUNK_SIZE
591/** @} */
592
593
594/** Maximum chunk size for a single data transfer. */
595#define VBOX_SHCL_MAX_CHUNK_SIZE VMMDEV_MAX_HGCM_DATA_SIZE - _4K
596/** Default chunk size for a single data transfer. */
597#define VBOX_SHCL_DEFAULT_CHUNK_SIZE RT_MIN(_64K, VBOX_SHCL_MAX_CHUNK_SIZE);
598
599
600/** @name VBOX_SHCL_GF_XXX - Guest features.
601 * @sa VBOX_SHCL_GUEST_FN_REPORT_FEATURES
602 * @{ */
603/** No flags set. */
604#define VBOX_SHCL_GF_NONE 0
605/** The guest can handle context IDs where applicable. */
606#define VBOX_SHCL_GF_0_CONTEXT_ID RT_BIT_64(0)
607/** The guest can copy & paste files and directories.
608 * @since 6.x */
609#define VBOX_SHCL_GF_0_TRANSFERS RT_BIT_64(1)
610/** The guest supports a (guest OS-)native frontend for showing and handling file transfers.
611 * If not set, the host will show a modal progress dialog instead and transferring file to
612 * a guest-specific temporary location first.
613 * Currently only supported for Windows guests (integrated into Windows Explorer via IDataObject). */
614#define VBOX_SHCL_GF_0_TRANSFERS_FRONTEND RT_BIT_64(2)
615/** Bit that must be set in the 2nd parameter, will be cleared if the host reponds
616 * correctly (old hosts might not). */
617#define VBOX_SHCL_GF_1_MUST_BE_ONE RT_BIT_64(63)
618/** @} */
619
620/** @name VBOX_GUESTCTRL_HF_XXX - Host features.
621 * @sa VBOX_SHCL_GUEST_FN_REPORT_FEATURES
622 * @{ */
623/** No flags set. */
624#define VBOX_SHCL_HF_NONE 0
625/** The host can handle context IDs where applicable as well as the new
626 * message handling functions. */
627#define VBOX_SHCL_HF_0_CONTEXT_ID RT_BIT_64(0)
628/** The host can copy & paste files and directories.
629 * This includes messages like
630 * @since 6.1.? */
631#define VBOX_SHCL_HF_0_TRANSFERS RT_BIT_64(1)
632/** @} */
633
634/** @name Context ID related macros and limits
635 * @{ */
636/**
637 * Creates a context ID out of a client ID, a transfer ID and an event ID (count).
638 */
639#define VBOX_SHCL_CONTEXTID_MAKE(a_idSession, a_idTransfer, a_idEvent) \
640 ( ((uint64_t)((a_idSession) & 0xffff) << 48) \
641 | ((uint64_t)((a_idTransfer) & 0xffff) << 32) \
642 | ((uint32_t) (a_idEvent)) \
643 )
644/** Creates a context ID out of a session ID. */
645#define VBOX_SHCL_CONTEXTID_MAKE_SESSION(a_idSession) VBOX_SHCL_CONTEXTID_MAKE(a_idSession, 0, 0)
646/** Gets the session ID out of a context ID. */
647#define VBOX_SHCL_CONTEXTID_GET_SESSION(a_idContext) ( (uint16_t)(((a_idContext) >> 48) & UINT16_MAX) )
648/** Gets the transfer ID out of a context ID. */
649#define VBOX_SHCL_CONTEXTID_GET_TRANSFER(a_idContext) ( (uint16_t)(((a_idContext) >> 32) & UINT16_MAX) )
650/** Gets the transfer event out of a context ID. */
651#define VBOX_SHCL_CONTEXTID_GET_EVENT(a_idContext) ( (uint32_t)( (a_idContext) & UINT32_MAX) )
652
653/** Maximum number of concurrent Shared Clipboard client sessions a VM can have. */
654#define VBOX_SHCL_MAX_SESSIONS (UINT16_MAX - 1)
655/** Maximum number of concurrent Shared Clipboard transfers a single client can have. */
656#define VBOX_SHCL_MAX_TRANSFERS (UINT16_MAX - 1)
657/** Maximum number of events a single Shared Clipboard transfer can have. */
658#define VBOX_SHCL_MAX_EVENTS (UINT32_MAX - 1)
659/** @} */
660
661
662/*
663 * HGCM parameter structures.
664 */
665/** @todo r=bird: These structures are mostly pointless, as they're only
666 * ever used by the VbglR3 part. The host service does not use these
667 * structures for decoding guest requests, instead it's all hardcoded. */
668#pragma pack(1)
669/**
670 * Waits (blocking) for a new host message to arrive.
671 * Deprecated; do not use anymore.
672 * Kept for maintaining compatibility with older Guest Additions.
673 */
674typedef struct _VBoxShClGetHostMsgOld
675{
676 VBGLIOCHGCMCALL hdr;
677
678 /** uint32_t, out: Host message type. */
679 HGCMFunctionParameter msg;
680 /** uint32_t, out: VBOX_SHCL_FMT_*, depends on the 'msg'.
681 * r=andy This actual can have *different* meanings, depending on the host message type. */
682 HGCMFunctionParameter formats; /* OUT uint32_t */
683} VBoxShClGetHostMsgOld;
684
685#define VBOX_SHCL_CPARMS_GET_HOST_MSG_OLD 2
686
687/** @name VBOX_SHCL_GUEST_FN_REPORT_FORMATS
688 * @{ */
689/** VBOX_SHCL_GUEST_FN_REPORT_FORMATS parameters. */
690typedef struct VBoxShClParmReportFormats
691{
692 /** uint32_t, int: Zero or more VBOX_SHCL_FMT_XXX bits. */
693 HGCMFunctionParameter f32Formats;
694} VBoxShClParmReportFormats;
695
696#define VBOX_SHCL_CPARMS_REPORT_FORMATS 1 /**< The parameter count for VBOX_SHCL_GUEST_FN_REPORT_FORMATS. */
697#define VBOX_SHCL_CPARMS_REPORT_FORMATS_61B 3 /**< The 6.1 dev cycle variant, see VBOX_SHCL_GUEST_FN_REPORT_FORMATS. */
698/** @} */
699
700/** @name VBOX_SHCL_GUEST_FN_DATA_READ
701 * @{ */
702/** VBOX_SHCL_GUEST_FN_DATA_READ parameters. */
703typedef struct VBoxShClParmDataRead
704{
705 /** uint32_t, in: Requested format (VBOX_SHCL_FMT_XXX). */
706 HGCMFunctionParameter f32Format;
707 /** ptr, out: The data buffer to put the data in on success. */
708 HGCMFunctionParameter pData;
709 /** uint32_t, out: Size of returned data, if larger than the buffer, then no
710 * data was actually transferred and the guest must repeat the call. */
711 HGCMFunctionParameter cb32Needed;
712} VBoxShClParmDataRead;
713
714#define VBOX_SHCL_CPARMS_DATA_READ 3 /**< The parameter count for VBOX_SHCL_GUEST_FN_DATA_READ. */
715#define VBOX_SHCL_CPARMS_DATA_READ_61B 5 /**< The 6.1 dev cycle variant, see VBOX_SHCL_GUEST_FN_DATA_READ. */
716/** @} */
717
718/** @name
719 * @{ */
720
721/** VBOX_SHCL_GUEST_FN_DATA_WRITE parameters. */
722typedef struct VBoxShClParmDataWrite
723{
724 /** uint64_t, in: Context ID from VBOX_SHCL_HOST_MSG_READ_DATA. */
725 HGCMFunctionParameter id64Context;
726 /** uint32_t, in: The data format (VBOX_SHCL_FMT_XXX). */
727 HGCMFunctionParameter f32Format;
728 /** ptr, in: The data. */
729 HGCMFunctionParameter pData;
730} VBoxShClParmDataWrite;
731
732/** Old VBOX_SHCL_GUEST_FN_DATA_WRITE parameters. */
733typedef struct VBoxShClParmDataWriteOld
734{
735 /** uint32_t, in: The data format (VBOX_SHCL_FMT_XXX). */
736 HGCMFunctionParameter f32Format;
737 /** ptr, in: The data. */
738 HGCMFunctionParameter pData;
739} VBoxShClParmDataWriteOld;
740
741#define VBOX_SHCL_CPARMS_DATA_WRITE 3 /**< The variant used when VBOX_SHCL_GF_0_CONTEXT_ID is reported. */
742#define VBOX_SHCL_CPARMS_DATA_WRITE_OLD 2 /**< The variant used when VBOX_SHCL_GF_0_CONTEXT_ID isn't reported. */
743#define VBOX_SHCL_CPARMS_DATA_WRITE_61B 5 /**< The 6.1 dev cycle variant, see VBOX_SHCL_GUEST_FN_DATA_WRITE. */
744/** @} */
745
746/**
747 * Reports a transfer status.
748 */
749typedef struct _VBoxShClTransferStatusMsg
750{
751 VBGLIOCHGCMCALL hdr;
752
753 /** uint64_t, out: Context ID. */
754 HGCMFunctionParameter uContext;
755 /** uint32_t, out: Direction of transfer; of type SHCLTRANSFERDIR_. */
756 HGCMFunctionParameter enmDir;
757 /** uint32_t, out: Status to report; of type SHCLTRANSFERSTATUS_. */
758 HGCMFunctionParameter enmStatus;
759 /** uint32_t, out: Result code to report. Optional. */
760 HGCMFunctionParameter rc;
761 /** uint32_t, out: Reporting flags. Currently unused and must be 0. */
762 HGCMFunctionParameter fFlags;
763} VBoxShClTransferStatusMsg;
764
765#define VBOX_SHCL_CPARMS_TRANSFER_STATUS 5
766
767/**
768 * Asks the host for the next command to process, along
769 * with the needed amount of parameters and an optional blocking
770 * flag.
771 *
772 * Used by: VBOX_SHCL_GUEST_FN_GET_HOST_MSG
773 *
774 */
775typedef struct _VBoxShClGetHostMsg
776{
777 VBGLIOCHGCMCALL hdr;
778
779 /** uint32_t, out: Message ID. */
780 HGCMFunctionParameter uMsg;
781 /** uint32_t, out: Number of parameters the message needs. */
782 HGCMFunctionParameter cParms;
783 /** uint32_t, in: Whether or not to block (wait) for a new message to arrive. */
784 HGCMFunctionParameter fBlock;
785} VBoxShClPeekMsg;
786
787#define VBOX_SHCL_CPARMS_GET_HOST_MSG 3
788
789/** No listing flags specified. */
790#define VBOX_SHCL_LIST_FLAG_NONE 0
791/** Only returns one entry per read. */
792#define VBOX_SHCL_LIST_FLAG_RETURN_ONE RT_BIT(0)
793/** Restarts reading a list from the beginning. */
794#define VBOX_SHCL_LIST_FLAG_RESTART RT_BIT(1)
795
796#define VBOX_SHCL_LISTHDR_FLAG_NONE 0
797
798/** No additional information provided. */
799#define VBOX_SHCL_INFO_FLAG_NONE 0
800/** Get object information of type SHCLFSOBJINFO. */
801#define VBOX_SHCL_INFO_FLAG_FSOBJINFO RT_BIT(0)
802
803/**
804 * Status message for lists and objects.
805 */
806typedef struct _VBoxShClStatusMsg
807{
808 VBGLIOCHGCMCALL hdr;
809
810 /** uint64_t, in: Context ID. */
811 HGCMFunctionParameter uContext;
812 /** uint32_t, in: Transfer status of type SHCLTRANSFERSTATUS. */
813 HGCMFunctionParameter uStatus;
814 /** pointer, in: Optional payload of this status, based on the status type. */
815 HGCMFunctionParameter pvPayload;
816} VBoxShClStatusMsg;
817
818#define VBOX_SHCL_CPARMS_STATUS 3
819
820/** Invalid message type, do not use. */
821#define VBOX_SHCL_REPLYMSGTYPE_INVALID 0
822/** Replies a transfer status. */
823#define VBOX_SHCL_REPLYMSGTYPE_TRANSFER_STATUS 1
824/** Replies a list open status. */
825#define VBOX_SHCL_REPLYMSGTYPE_LIST_OPEN 2
826/** Replies a list close status. */
827#define VBOX_SHCL_REPLYMSGTYPE_LIST_CLOSE 3
828/** Replies an object open status. */
829#define VBOX_SHCL_REPLYMSGTYPE_OBJ_OPEN 4
830/** Replies an object close status. */
831#define VBOX_SHCL_REPLYMSGTYPE_OBJ_CLOSE 5
832
833/**
834 * Generic reply message.
835 */
836typedef struct _VBoxShClReplyMsg
837{
838 VBGLIOCHGCMCALL hdr;
839
840 /** uint64_t, out: Context ID. */
841 HGCMFunctionParameter uContext;
842 /** uint32_t, out: Message type of type VBOX_SHCL_REPLYMSGTYPE_XXX. */
843 HGCMFunctionParameter enmType;
844 /** uint32_t, out: IPRT result of overall operation. */
845 HGCMFunctionParameter rc;
846 /** pointer, out: Optional payload of this reply, based on the message type. */
847 HGCMFunctionParameter pvPayload;
848 union
849 {
850 struct
851 {
852 HGCMFunctionParameter enmStatus;
853 } TransferStatus;
854 struct
855 {
856 HGCMFunctionParameter uHandle;
857 } ListOpen;
858 struct
859 {
860 HGCMFunctionParameter uHandle;
861 } ObjOpen;
862 struct
863 {
864 HGCMFunctionParameter uHandle;
865 } ObjClose;
866 } u;
867} VBoxShClReplyMsg;
868
869/** Minimum parameters (HGCM function parameters minus the union) a reply message must have. */
870#define VBOX_SHCL_CPARMS_REPLY_MIN 4
871
872/**
873 * Structure for keeping root list message parameters.
874 */
875typedef struct _VBoxShClRootListParms
876{
877 /** uint64_t, in: Context ID. */
878 HGCMFunctionParameter uContext;
879 /** uint32_t, in: Roots listing flags; unused at the moment. */
880 HGCMFunctionParameter fRoots;
881} VBoxShClRootListParms;
882
883#define VBOX_SHCL_CPARMS_ROOT_LIST 2
884
885/**
886 * Requests to read the root list header.
887 */
888typedef struct _VBoxShClRootListReadReqMsg
889{
890 VBGLIOCHGCMCALL hdr;
891
892 VBoxShClRootListParms ReqParms;
893} VBoxShClRootListReadReqMsg;
894
895#define VBOX_SHCL_CPARMS_ROOT_LIST_HDR_READ_REQ VBOX_SHCL_CPARMS_ROOT_LIST
896
897/**
898 * Reads / Writes a root list header.
899 */
900typedef struct _VBoxShClRootListHdrMsg
901{
902 VBGLIOCHGCMCALL hdr;
903
904 VBoxShClRootListParms ReqParms;
905 /** uint64_t, in/out: Number of total root list entries. */
906 HGCMFunctionParameter cRoots;
907} VBoxShClRootListHdrMsg;
908
909#define VBOX_SHCL_CPARMS_ROOT_LIST_HDR_READ VBOX_SHCL_CPARMS_ROOT_LIST + 1
910#define VBOX_SHCL_CPARMS_ROOT_LIST_HDR_WRITE VBOX_SHCL_CPARMS_ROOT_LIST + 1
911
912/**
913 * Structure for keeping list entry message parameters.
914 */
915typedef struct _VBoxShClRootListEntryParms
916{
917 /** uint64_t, in: Context ID. */
918 HGCMFunctionParameter uContext;
919 /** uint32_t, in: VBOX_SHCL_INFO_FLAG_XXX. */
920 HGCMFunctionParameter fInfo;
921 /** uint32_t, in: Index of root list entry to get (zero-based). */
922 HGCMFunctionParameter uIndex;
923} VBoxShClRootListEntryParms;
924
925#define VBOX_SHCL_CPARMS_ROOT_LIST_ENTRY 3
926
927/**
928 * Request to read a list root entry.
929 */
930typedef struct _VBoxShClRootListEntryReadReqMsg
931{
932 VBGLIOCHGCMCALL hdr;
933
934 /** in: Request parameters. */
935 VBoxShClRootListEntryParms Parms;
936} VBoxShClRootListEntryReadReqMsg;
937
938#define VBOX_SHCL_CPARMS_ROOT_LIST_ENTRY_READ_REQ VBOX_SHCL_CPARMS_ROOT_LIST_ENTRY
939
940/**
941 * Reads / Writes a root list entry.
942 */
943typedef struct _VBoxShClRootListEntryMsg
944{
945 VBGLIOCHGCMCALL hdr;
946
947 /** in/out: Request parameters. */
948 VBoxShClRootListEntryParms Parms;
949 /** pointer, in/out: Entry name. */
950 HGCMFunctionParameter szName;
951 /** uint32_t, out: Bytes to be used for information/How many bytes were used. */
952 HGCMFunctionParameter cbInfo;
953 /** pointer, in/out: Information to be set/get (SHCLFSOBJINFO only currently).
954 * Do not forget to set the SHCLFSOBJINFO::Attr::enmAdditional for Get operation as well. */
955 HGCMFunctionParameter pvInfo;
956} VBoxShClRootListEntryMsg;
957
958#define VBOX_SHCL_CPARMS_ROOT_LIST_ENTRY_READ VBOX_SHCL_CPARMS_ROOT_LIST_ENTRY + 3
959#define VBOX_SHCL_CPARMS_ROOT_LIST_ENTRY_WRITE VBOX_SHCL_CPARMS_ROOT_LIST_ENTRY + 3
960
961/**
962 * Opens a list.
963 */
964typedef struct _VBoxShClListOpenMsg
965{
966 VBGLIOCHGCMCALL hdr;
967
968 /** uint64_t, in: Context ID. */
969 HGCMFunctionParameter uContext;
970 /** uint32_t, in: Listing flags (see VBOX_SHCL_LIST_FLAG_XXX). */
971 HGCMFunctionParameter fList;
972 /** pointer, in: Filter string. */
973 HGCMFunctionParameter pvFilter;
974 /** pointer, in: Listing poth. If empty or NULL the listing's root path will be opened. */
975 HGCMFunctionParameter pvPath;
976 /** uint64_t, out: List handle. */
977 HGCMFunctionParameter uHandle;
978} VBoxShClListOpenMsg;
979
980#define VBOX_SHCL_CPARMS_LIST_OPEN 5
981
982/**
983 * Closes a list.
984 */
985typedef struct _VBoxShClListCloseMsg
986{
987 VBGLIOCHGCMCALL hdr;
988
989 /** uint64_t, in/out: Context ID. */
990 HGCMFunctionParameter uContext;
991 /** uint64_t, in: List handle. */
992 HGCMFunctionParameter uHandle;
993} VBoxShClListCloseMsg;
994
995#define VBOX_SHCL_CPARMS_LIST_CLOSE 2
996
997typedef struct _VBoxShClListHdrReqParms
998{
999 /** uint64_t, in: Context ID. */
1000 HGCMFunctionParameter uContext;
1001 /** uint64_t, in: List handle. */
1002 HGCMFunctionParameter uHandle;
1003 /** uint32_t, in: Flags of type VBOX_SHCL_LISTHDR_FLAG_XXX. */
1004 HGCMFunctionParameter fFlags;
1005} VBoxShClListHdrReqParms;
1006
1007#define VBOX_SHCL_CPARMS_LIST_HDR_REQ 3
1008
1009/**
1010 * Request to read a list header.
1011 */
1012typedef struct _VBoxShClListHdrReadReqMsg
1013{
1014 VBGLIOCHGCMCALL hdr;
1015
1016 VBoxShClListHdrReqParms ReqParms;
1017} VBoxShClListHdrReadReqMsg;
1018
1019#define VBOX_SHCL_CPARMS_LIST_HDR_READ_REQ VBOX_SHCL_CPARMS_LIST_HDR_REQ
1020
1021/**
1022 * Reads / Writes a list header.
1023 */
1024typedef struct _VBoxShClListHdrMsg
1025{
1026 VBGLIOCHGCMCALL hdr;
1027
1028 VBoxShClListHdrReqParms ReqParms;
1029 /** uint32_t, in/out: Feature flags (see VBOX_SHCL_FEATURE_FLAG_XXX). */
1030 HGCMFunctionParameter fFeatures;
1031 /** uint64_t, in/out: Number of total objects to transfer. */
1032 HGCMFunctionParameter cTotalObjects;
1033 /** uint64_t, in/out: Number of total bytes to transfer. */
1034 HGCMFunctionParameter cbTotalSize;
1035} VBoxShClListHdrMsg;
1036
1037#define VBOX_SHCL_CPARMS_LIST_HDR VBOX_SHCL_CPARMS_LIST_HDR_REQ + 3
1038
1039typedef struct _VBoxShClListEntryReqParms
1040{
1041 /** uint64_t, in: Context ID. */
1042 HGCMFunctionParameter uContext;
1043 /** uint64_t, in: List handle. */
1044 HGCMFunctionParameter uHandle;
1045 /** uint32_t, in: VBOX_SHCL_INFO_FLAG_XXX. */
1046 HGCMFunctionParameter fInfo;
1047} VBoxShClListEntryReqParms;
1048
1049#define VBOX_SHCL_CPARMS_LIST_ENTRY_REQ 3
1050
1051/**
1052 * Request to read a list entry.
1053 */
1054typedef struct _VBoxShClListEntryReadReqMsg
1055{
1056 VBGLIOCHGCMCALL hdr;
1057
1058 VBoxShClListEntryReqParms ReqParms;
1059} VBoxShClListEntryReadReqMsg;
1060
1061#define VBOX_SHCL_CPARMS_LIST_ENTRY_READ VBOX_SHCL_CPARMS_LIST_ENTRY_REQ
1062
1063/**
1064 * Reads / Writes a list entry.
1065 */
1066typedef struct _VBoxShClListEntryMsg
1067{
1068 VBGLIOCHGCMCALL hdr;
1069
1070 /** in/out: Request parameters. */
1071 VBoxShClListEntryReqParms ReqParms;
1072 /** pointer, in/out: Entry name. */
1073 HGCMFunctionParameter szName;
1074 /** uint32_t, out: Bytes to be used for information/How many bytes were used. */
1075 HGCMFunctionParameter cbInfo;
1076 /** pointer, in/out: Information to be set/get (SHCLFSOBJINFO only currently).
1077 * Do not forget to set the SHCLFSOBJINFO::Attr::enmAdditional for Get operation as well. */
1078 HGCMFunctionParameter pvInfo;
1079} VBoxShClListEntryMsg;
1080
1081#define VBOX_SHCL_CPARMS_LIST_ENTRY VBOX_SHCL_CPARMS_LIST_ENTRY_REQ + 3
1082
1083/**
1084 * Opens a Shared Clipboard object.
1085 */
1086typedef struct _VBoxShClObjOpenMsg
1087{
1088 VBGLIOCHGCMCALL hdr;
1089
1090 /** uint64_t, in/out: Context ID. */
1091 HGCMFunctionParameter uContext;
1092 /** uint64_t, out: Object handle. */
1093 HGCMFunctionParameter uHandle;
1094 /** pointer, in: Absoulte path of object to open/create. */
1095 HGCMFunctionParameter szPath;
1096 /** uint32_t in: Open / Create flags of type SHCL_OBJ_CF_. */
1097 HGCMFunctionParameter fCreate;
1098} VBoxShClObjOpenMsg;
1099
1100#define VBOX_SHCL_CPARMS_OBJ_OPEN 4
1101
1102/**
1103 * Closes a Shared Clipboard object.
1104 */
1105typedef struct _VBoxShClObjCloseMsg
1106{
1107 VBGLIOCHGCMCALL hdr;
1108
1109 /** uint64_t, in/out: Context ID. */
1110 HGCMFunctionParameter uContext;
1111 /** uint64_t, in: SHCLOBJHANDLE of object to close. */
1112 HGCMFunctionParameter uHandle;
1113} VBoxShClObjCloseMsg;
1114
1115#define VBOX_SHCL_CPARMS_OBJ_CLOSE 2
1116
1117/**
1118 * Structure for keeping read parameters of a Shared Clipboard object.
1119 */
1120typedef struct _VBoxShClObjReadReqParms
1121{
1122 /** uint64_t, in: Context ID. */
1123 HGCMFunctionParameter uContext;
1124 /** uint64_t, in: SHCLOBJHANDLE of object to write to. */
1125 HGCMFunctionParameter uHandle;
1126 /** uint32_t, in: How many bytes to read. */
1127 HGCMFunctionParameter cbToRead;
1128 /** uint32_t, in: Read flags. Currently unused and must be 0. */
1129 HGCMFunctionParameter fRead;
1130} VBoxShClObjReadReqParms;
1131
1132/**
1133 * Reads from a Shared Clipboard object.
1134 */
1135typedef struct _VBoxShClObjReadReqMsg
1136{
1137 VBGLIOCHGCMCALL hdr;
1138
1139 VBoxShClObjReadReqParms ReqParms;
1140} VBoxShClObjReadReqMsg;
1141
1142#define VBOX_SHCL_CPARMS_OBJ_READ_REQ 4
1143
1144/**
1145 * Reads / writes data of / to an object.
1146 *
1147 * Used by:
1148 * VBOX_SHCL_FN_OBJ_READ
1149 * VBOX_SHCL_FN_OBJ_WRITE
1150 */
1151typedef struct _VBoxShClObjReadWriteMsg
1152{
1153 VBGLIOCHGCMCALL hdr;
1154
1155 /** uint64_t, in/out: Context ID. */
1156 HGCMFunctionParameter uContext;
1157 /** uint64_t, in/out: SHCLOBJHANDLE of object to write to. */
1158 HGCMFunctionParameter uHandle;
1159 /** uint32_t, out: Size (in bytes) read/written. */
1160 HGCMFunctionParameter cbData;
1161 /** pointer, in/out: Current data chunk. */
1162 HGCMFunctionParameter pvData;
1163 /** uint32_t, in/out: Size (in bytes) of current data chunk checksum. */
1164 HGCMFunctionParameter cbChecksum;
1165 /** pointer, in/out: Checksum of data block, based on the checksum
1166 * type in the data header. Optional. */
1167 HGCMFunctionParameter pvChecksum;
1168} VBoxShClObjReadWriteMsg;
1169
1170#define VBOX_SHCL_CPARMS_OBJ_READ 6
1171#define VBOX_SHCL_CPARMS_OBJ_WRITE 6
1172
1173/**
1174 * Sends an error event.
1175 *
1176 * Used by:
1177 * VBOX_SHCL_FN_WRITE_ERROR
1178 */
1179typedef struct _VBoxShClErrorMsg
1180{
1181 VBGLIOCHGCMCALL hdr;
1182
1183 /** uint64_t, in: Context ID. */
1184 HGCMFunctionParameter uContext;
1185 /** uint32_t, in: The error code (IPRT-style). */
1186 HGCMFunctionParameter rc;
1187} VBoxShClWriteErrorMsg;
1188
1189#define VBOX_SHCL_CPARMS_ERROR 2
1190
1191/** @name VBOX_SHCL_GUEST_FN_NEGOTIATE_CHUNK_SIZE
1192 * @{ */
1193/** VBOX_SHCL_GUEST_FN_NEGOTIATE_CHUNK_SIZE parameters. */
1194typedef struct _VBoxShClParmNegotiateChunkSize
1195{
1196 VBGLIOCHGCMCALL hdr;
1197
1198 /** uint32_t, in: Maximum chunk size. */
1199 HGCMFunctionParameter cb32MaxChunkSize;
1200 /** uint32_t, in: Default chunk size. */
1201 HGCMFunctionParameter cb32ChunkSize;
1202} VBoxShClParmNegotiateChunkSize;
1203
1204#define VBOX_SHCL_CPARMS_NEGOTIATE_CHUNK_SIZE 2
1205/** @} */
1206
1207#pragma pack()
1208
1209#endif /* !VBOX_INCLUDED_HostServices_VBoxClipboardSvc_h */
1210
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