VirtualBox

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

Last change on this file since 99841 was 98103, checked in by vboxsync, 2 years ago

Copyright year updates by scm.

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