VirtualBox

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

Last change on this file since 104429 was 103480, checked in by vboxsync, 9 months ago

Shared Clipboard: Added a ShClTransferTransformPath() function to make the paths more uniform. bugref:9437

  • Property svn:eol-style set to native
  • Property svn:keywords set to Id Revision
File size: 41.9 KB
RevLine 
[4172]1/** @file
[45718]2 * Shared Clipboard - Common header for host service and guest clients.
[82494]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.
[4172]17 */
18
19/*
[98103]20 * Copyright (C) 2006-2023 Oracle and/or its affiliates.
[4071]21 *
[96407]22 * This file is part of VirtualBox base platform packages, as
23 * available from https://www.virtualbox.org.
[5999]24 *
[96407]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 *
[5999]38 * The contents of this file may alternatively be used under the terms
39 * of the Common Development and Distribution License Version 1.0
[96407]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
[5999]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.
[96407]46 *
47 * SPDX-License-Identifier: GPL-3.0-only OR CDDL-1.0
[4172]48 */
49
[76558]50#ifndef VBOX_INCLUDED_HostServices_VBoxClipboardSvc_h
51#define VBOX_INCLUDED_HostServices_VBoxClipboardSvc_h
[76507]52#ifndef RT_WITHOUT_PRAGMA_ONCE
53# pragma once
54#endif
[4172]55
[68660]56#include <VBox/VMMDevCoreTypes.h>
[68656]57#include <VBox/VBoxGuestCoreTypes.h>
[4172]58#include <VBox/hgcmsvc.h>
59
[79497]60
[82484]61/** @name VBOX_SHCL_MODE_XXX - The Shared Clipboard modes of operation.
62 * @{
[4172]63 */
[80970]64/** Shared Clipboard is disabled completely. */
[80847]65#define VBOX_SHCL_MODE_OFF 0
[80970]66/** Only transfers from host to the guest are possible. */
[80847]67#define VBOX_SHCL_MODE_HOST_TO_GUEST 1
[80970]68/** Only transfers from guest to the host are possible. */
[80847]69#define VBOX_SHCL_MODE_GUEST_TO_HOST 2
[80970]70/** Bidirectional transfers between guest and host are possible. */
[80847]71#define VBOX_SHCL_MODE_BIDIRECTIONAL 3
[82484]72/** @} */
[4172]73
[99968]74/** @name VBOX_SHCL_TRANSFER_MODE_XXX - The Shared Clipboard file transfer mode flags.
[82484]75 * @{
[81286]76 */
77/** Shared Clipboard file transfers are disabled. */
[99968]78#define VBOX_SHCL_TRANSFER_MODE_F_NONE UINT32_C(0)
[81286]79/** Shared Clipboard file transfers are enabled. */
[99968]80#define VBOX_SHCL_TRANSFER_MODE_F_ENABLED RT_BIT(0)
[81286]81/** Shared Clipboard file transfer mode valid mask. */
[99968]82#define VBOX_SHCL_TRANSFER_MODE_F_VALID_MASK UINT32_C(0x1)
[82484]83/** @} */
[81286]84
[82526]85
[82484]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 * @{
[4172]90 */
[79497]91/** Sets the current Shared Clipboard operation mode. */
[80847]92#define VBOX_SHCL_HOST_FN_SET_MODE 1
[81286]93/** Sets the current Shared Clipboard (file) transfers mode.
[82484]94 * Operates on the VBOX_SHCL_TRANSFERS_XXX defines.
95 * @since 6.1 */
[81286]96#define VBOX_SHCL_HOST_FN_SET_TRANSFER_MODE 2
[37434]97/** Run headless on the host, i.e. do not touch the host clipboard. */
[81286]98#define VBOX_SHCL_HOST_FN_SET_HEADLESS 3
[82526]99
[81559]100/** Reports cancellation of the current operation to the guest.
[82484]101 * @since 6.1 - still a todo */
[81286]102#define VBOX_SHCL_HOST_FN_CANCEL 4
[81559]103/** Reports an error to the guest.
[82484]104 * @since 6.1 - still a todo */
[81286]105#define VBOX_SHCL_HOST_FN_ERROR 5
[82484]106/** @} */
[4172]107
[82526]108
[82484]109/** @name VBOX_SHCL_HOST_MSG_XXX - The host messages for the guest.
110 * @{
[79630]111 */
[82526]112/** Returned only when the HGCM client session is closed (by different thread).
113 *
[82527]114 * This can require no futher host interaction since the session has been
115 * closed.
116 *
117 * @since 1.3.2
[82526]118 */
119#define VBOX_SHCL_HOST_MSG_QUIT 1
120/** Request data for a specific format from the guest.
121 *
[83621]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
[82527]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
[82526]129 */
130#define VBOX_SHCL_HOST_MSG_READ_DATA 2
[82527]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 */
[82526]139#define VBOX_SHCL_HOST_MSG_FORMATS_REPORT 3
140/** Message PEEK or GET operation was canceled, try again.
[82527]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 *
[82526]147 * @since 6.1.0
148 */
149#define VBOX_SHCL_HOST_MSG_CANCELED 4
[79630]150
[82527]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.
[83621]161 * @since 6.1.2
[82527]162 */
163#define VBOX_SHCL_HOST_MSG_READ_DATA_CID 5
164
[81559]165/** Sends a transfer status to the guest side.
[100016]166 * @since 7.1
[81559]167 */
[80907]168#define VBOX_SHCL_HOST_MSG_TRANSFER_STATUS 50
[81559]169/** Reads the root list header from the guest.
[100016]170 * @since 7.1
[81559]171 */
[80858]172#define VBOX_SHCL_HOST_MSG_TRANSFER_ROOT_LIST_HDR_READ 51
[81559]173/** Writes the root list header to the guest.
[100016]174 * @since 7.1
[81559]175 */
[80858]176#define VBOX_SHCL_HOST_MSG_TRANSFER_ROOT_LIST_HDR_WRITE 52
[81559]177/** Reads a root list entry from the guest.
[100016]178 * @since 7.1
[81559]179 */
[80858]180#define VBOX_SHCL_HOST_MSG_TRANSFER_ROOT_LIST_ENTRY_READ 53
[81559]181/** Writes a root list entry to the guest.
[100016]182 * @since 7.1
[81559]183 */
[80858]184#define VBOX_SHCL_HOST_MSG_TRANSFER_ROOT_LIST_ENTRY_WRITE 54
[81559]185/** Open a transfer list on the guest side.
[100016]186 * @since 7.1
[81559]187 */
[80858]188#define VBOX_SHCL_HOST_MSG_TRANSFER_LIST_OPEN 55
[81559]189/** Closes a formerly opened transfer list on the guest side.
[100016]190 * @since 7.1
[81559]191 */
[80858]192#define VBOX_SHCL_HOST_MSG_TRANSFER_LIST_CLOSE 56
[81559]193/** Reads a list header from the guest.
[100016]194 * @since 7.1
[81559]195 */
[80858]196#define VBOX_SHCL_HOST_MSG_TRANSFER_LIST_HDR_READ 57
[81559]197/** Writes a list header to the guest.
[100016]198 * @since 7.1
[81559]199 */
[80858]200#define VBOX_SHCL_HOST_MSG_TRANSFER_LIST_HDR_WRITE 58
[81559]201/** Reads a list entry from the guest.
[100016]202 * @since 7.1
[81559]203 */
[80858]204#define VBOX_SHCL_HOST_MSG_TRANSFER_LIST_ENTRY_READ 59
[81559]205/** Writes a list entry to the guest.
[100016]206 * @since 7.1
[81559]207 */
[80858]208#define VBOX_SHCL_HOST_MSG_TRANSFER_LIST_ENTRY_WRITE 60
[81559]209/** Open a transfer object on the guest side.
[100016]210 * @since 7.1
[81559]211 */
[80858]212#define VBOX_SHCL_HOST_MSG_TRANSFER_OBJ_OPEN 61
[81559]213/** Closes a formerly opened transfer object on the guest side.
[100016]214 * @since 7.1
[81559]215 */
[80858]216#define VBOX_SHCL_HOST_MSG_TRANSFER_OBJ_CLOSE 62
[81559]217/** Reads from an object on the guest side.
[100016]218 * @since 7.1
[81559]219 */
[80858]220#define VBOX_SHCL_HOST_MSG_TRANSFER_OBJ_READ 63
[81559]221/** Writes to an object on the guest side.
[100016]222 * @since 7.1
[81559]223 */
[80858]224#define VBOX_SHCL_HOST_MSG_TRANSFER_OBJ_WRITE 64
[81559]225/** Indicates that the host has canceled a transfer.
[100016]226 * @since 7.1
[81559]227 */
[80858]228#define VBOX_SHCL_HOST_MSG_TRANSFER_CANCEL 65
[81559]229/** Indicates that the an unrecoverable error on the host occurred.
[100016]230 * @since 7.1
[81559]231 */
[80858]232#define VBOX_SHCL_HOST_MSG_TRANSFER_ERROR 66
[82484]233/** @} */
[79630]234
[82526]235
[82484]236/** @name VBOX_SHCL_GUEST_FN_XXX - The service functions which are called by guest.
237 * @{
[4172]238 */
[82486]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,
[82526]242 * VBOX_SHCL_GUEST_FN_MSG_GET, VBOX_SHCL_GUEST_FN_MSG_CANCEL.
243 * @since 1.3.2
[82486]244 */
[82526]245#define VBOX_SHCL_GUEST_FN_MSG_OLD_GET_WAIT 1
[80444]246/** Sends a list of available formats to the host.
[82513]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.
[82526]264 * @since 1.3.2
[82513]265 */
[82526]266#define VBOX_SHCL_GUEST_FN_REPORT_FORMATS 2
[81768]267/** Reads data in specified format from the host.
268 *
[82506]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).
[82500]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 *
[81768]278 * @retval VINF_SUCCESS on success.
[82486]279 * @retval VINF_BUFFER_OVERLFLOW (VBox >= 6.1 only) if not enough buffer space
[82500]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.
[81768]283 * @retval VERR_INVALID_CLIENT_ID
284 * @retval VERR_WRONG_PARAMETER_COUNT
285 * @retval VERR_WRONG_PARAMETER_TYPE
[82526]286 * @since 1.3.2
[81768]287 */
[82526]288#define VBOX_SHCL_GUEST_FN_DATA_READ 3
[82506]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.
[82526]307 * @since 1.3.2
[82506]308 */
[82526]309#define VBOX_SHCL_GUEST_FN_DATA_WRITE 4
[79497]310
[82525]311/** This is a left-over from the 6.1 dev cycle and will always fail.
[80470]312 *
[82525]313 * It used to take three 32-bit parameters, only one of which was actually used.
[82488]314 *
[82525]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
[81559]319 * @since 6.1
320 */
[82526]321#define VBOX_SHCL_GUEST_FN_CONNECT 5
[81352]322/** Report guest side feature flags and retrieve the host ones.
323 *
[82486]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).
[81352]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
[100367]332 * @since 7.1.0
[81352]333 */
[82526]334#define VBOX_SHCL_GUEST_FN_REPORT_FEATURES 6
[81352]335/** Query the host ones feature masks.
336 *
[82488]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.
[81352]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
[100367]345 * @since 7.1.0
[81352]346 */
[82526]347#define VBOX_SHCL_GUEST_FN_QUERY_FEATURES 7
[79630]348/** Peeks at the next message, returning immediately.
[81559]349 *
[82526]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.
[81559]364 * @retval VERR_INVALID_CLIENT_ID
365 * @retval VERR_WRONG_PARAMETER_COUNT
366 * @retval VERR_WRONG_PARAMETER_TYPE
[100367]367 * @since 7.1.0
[81559]368 */
[82526]369#define VBOX_SHCL_GUEST_FN_MSG_PEEK_NOWAIT 8
[79630]370/** Peeks at the next message, waiting for one to arrive.
[81559]371 *
[82526]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.
[81559]391 * @retval VERR_INVALID_CLIENT_ID
392 * @retval VERR_WRONG_PARAMETER_COUNT
393 * @retval VERR_WRONG_PARAMETER_TYPE
[82526]394 * @note This replaces VBOX_SHCL_GUEST_FN_MSG_OLD_GET_WAIT.
[100367]395 * @since 7.1.0
[81559]396 */
[82526]397#define VBOX_SHCL_GUEST_FN_MSG_PEEK_WAIT 9
[79630]398/** Gets the next message, returning immediately.
[81559]399 *
[82526]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.
[81559]412 * @retval VERR_INVALID_CLIENT_ID
413 * @retval VERR_WRONG_PARAMETER_COUNT
414 * @retval VERR_WRONG_PARAMETER_TYPE
[82526]415 * @note This replaces VBOX_SHCL_GUEST_FN_MSG_OLD_GET_WAIT.
416 * @since 6.1.0
[81559]417 */
[82526]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
[79630]434/** Replies to a function from the host.
[81559]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
[82526]440 * @since 6.1.x
[81559]441 */
[100367]442#define VBOX_SHCL_GUEST_FN_REPLY 11
443/** Gets the transfer root list header from the host.
[81559]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
[100367]449 * @since 7.1.x
[81559]450 */
[100367]451#define VBOX_SHCL_GUEST_FN_ROOT_LIST_HDR_READ 12
452/** Sends the transfer root list header to the host.
[81559]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
[100021]458 * @since 7.1.x
[81559]459 */
[100367]460#define VBOX_SHCL_GUEST_FN_ROOT_LIST_HDR_WRITE 13
461/** Gets a transfer root list root entry from the host.
[81559]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
[100021]467 * @since 7.1.x
[81559]468 */
[100367]469#define VBOX_SHCL_GUEST_FN_ROOT_LIST_ENTRY_READ 14
470/** Sends a transfer root list root entry to the host.
[81559]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
[100021]476 * @since 7.1.x
[81559]477 */
[100367]478#define VBOX_SHCL_GUEST_FN_ROOT_LIST_ENTRY_WRITE 15
479/** Opens / gets a transfer list handle from the host.
[81559]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
[100021]485 * @since 7.1.x
[81559]486 */
[100367]487#define VBOX_SHCL_GUEST_FN_LIST_OPEN 16
488/** Closes a transfer list handle from the host.
[81559]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
[100021]494 * @since 7.1.x
[81559]495 */
[100367]496#define VBOX_SHCL_GUEST_FN_LIST_CLOSE 17
497/** Reads a transfer list header from the host.
[81559]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
[100021]503 * @since 7.1.x
[81559]504 */
[100367]505#define VBOX_SHCL_GUEST_FN_LIST_HDR_READ 18
506/** Writes a transfer list header to the host.
[81559]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
[100021]512 * @since 7.1.x
[81559]513 */
[100367]514#define VBOX_SHCL_GUEST_FN_LIST_HDR_WRITE 19
515/** Reads a transfer list entry from the host.
[81559]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
[100021]521 * @since 7.1.x
[81559]522 */
[100367]523#define VBOX_SHCL_GUEST_FN_LIST_ENTRY_READ 20
524/** Sends a transfer list entry to the host.
[81559]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
[100021]530 * @since 7.1.x
[81559]531 */
[100367]532#define VBOX_SHCL_GUEST_FN_LIST_ENTRY_WRITE 21
533/** Opens a transfer object on the host.
[81559]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
[100021]539 * @since 7.1.x
[81559]540 */
[100367]541#define VBOX_SHCL_GUEST_FN_OBJ_OPEN 22
542/** Closes a transfer object on the host.
[81559]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
[100021]548 * @since 7.1.x
[81559]549 */
[100367]550#define VBOX_SHCL_GUEST_FN_OBJ_CLOSE 23
551/** Reads from a transfer object on the host.
[81559]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
[100021]557 * @since 7.1.x
[81559]558 */
[100367]559#define VBOX_SHCL_GUEST_FN_OBJ_READ 24
560/** Writes to a transfer object on the host.
[81559]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
[100021]566 * @since 7.1.x
[81559]567 */
[100367]568#define VBOX_SHCL_GUEST_FN_OBJ_WRITE 25
569/** Reports a transfer error to the host.
[81559]570 *
[82526]571 * @todo r=bird: Smells like GUEST_MSG_SKIP
572 *
[81559]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 */
[100367]579#define VBOX_SHCL_GUEST_FN_ERROR 27
[82488]580
[82525]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
[100367]595 * @since 7.1
[82525]596 */
597#define VBOX_SHCL_GUEST_FN_NEGOTIATE_CHUNK_SIZE 28
598
[82488]599/** The last function number (used for validation/sanity). */
[82852]600#define VBOX_SHCL_GUEST_FN_LAST VBOX_SHCL_GUEST_FN_NEGOTIATE_CHUNK_SIZE
[82484]601/** @} */
[4172]602
[79630]603
[82852]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);
[82484]608
[82493]609
[81352]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
[82525]615/** The guest can handle context IDs where applicable. */
[81559]616#define VBOX_SHCL_GF_0_CONTEXT_ID RT_BIT_64(0)
[82526]617/** The guest can copy & paste files and directories.
[86911]618 * @since 6.x */
[82526]619#define VBOX_SHCL_GF_0_TRANSFERS RT_BIT_64(1)
[86911]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)
[81352]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
[82525]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)
[82526]638/** The host can copy & paste files and directories.
[82852]639 * This includes messages like
[100016]640 * @since 7.1 */
[82526]641#define VBOX_SHCL_HF_0_TRANSFERS RT_BIT_64(1)
[81352]642/** @} */
643
[82493]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
[4172]672/*
673 * HGCM parameter structures.
674 */
[82493]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. */
[68675]678#pragma pack(1)
[80444]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 */
[80847]684typedef struct _VBoxShClGetHostMsgOld
[4172]685{
[68550]686 VBGLIOCHGCMCALL hdr;
[4172]687
[80444]688 /** uint32_t, out: Host message type. */
689 HGCMFunctionParameter msg;
[80847]690 /** uint32_t, out: VBOX_SHCL_FMT_*, depends on the 'msg'.
[80444]691 * r=andy This actual can have *different* meanings, depending on the host message type. */
[4172]692 HGCMFunctionParameter formats; /* OUT uint32_t */
[80847]693} VBoxShClGetHostMsgOld;
[4172]694
[80847]695#define VBOX_SHCL_CPARMS_GET_HOST_MSG_OLD 2
[9435]696
[82513]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/** @} */
[80444]709
[82500]710/** @name VBOX_SHCL_GUEST_FN_DATA_READ
711 * @{ */
712/** VBOX_SHCL_GUEST_FN_DATA_READ parameters. */
713typedef struct VBoxShClParmDataRead
[4172]714{
[82506]715 /** uint32_t, in: Requested format (VBOX_SHCL_FMT_XXX). */
[82500]716 HGCMFunctionParameter f32Format;
[82506]717 /** ptr, out: The data buffer to put the data in on success. */
[82500]718 HGCMFunctionParameter pData;
[82506]719 /** uint32_t, out: Size of returned data, if larger than the buffer, then no
[82500]720 * data was actually transferred and the guest must repeat the call. */
721 HGCMFunctionParameter cb32Needed;
722} VBoxShClParmDataRead;
[82506]723
[82500]724#define VBOX_SHCL_CPARMS_DATA_READ 3 /**< The parameter count for VBOX_SHCL_GUEST_FN_DATA_READ. */
[82513]725#define VBOX_SHCL_CPARMS_DATA_READ_61B 5 /**< The 6.1 dev cycle variant, see VBOX_SHCL_GUEST_FN_DATA_READ. */
[82500]726/** @} */
[4172]727
[82506]728/** @name
729 * @{ */
730
731/** VBOX_SHCL_GUEST_FN_DATA_WRITE parameters. */
732typedef struct VBoxShClParmDataWrite
[4172]733{
[82506]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;
[4172]741
[82506]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;
[9435]750
[82506]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/** @} */
[9435]755
[80845]756/**
757 * Reports a transfer status.
758 */
[80847]759typedef struct _VBoxShClTransferStatusMsg
[79497]760{
761 VBGLIOCHGCMCALL hdr;
762
[81346]763 /** uint64_t, out: Context ID. */
[79497]764 HGCMFunctionParameter uContext;
[80858]765 /** uint32_t, out: Direction of transfer; of type SHCLTRANSFERDIR_. */
[80845]766 HGCMFunctionParameter enmDir;
[80858]767 /** uint32_t, out: Status to report; of type SHCLTRANSFERSTATUS_. */
[80845]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;
[80847]773} VBoxShClTransferStatusMsg;
[79497]774
[80847]775#define VBOX_SHCL_CPARMS_TRANSFER_STATUS 5
[79497]776
[78307]777/**
[79497]778 * Asks the host for the next command to process, along
779 * with the needed amount of parameters and an optional blocking
780 * flag.
[78307]781 *
[80847]782 * Used by: VBOX_SHCL_GUEST_FN_GET_HOST_MSG
[79497]783 *
784 */
[80847]785typedef struct _VBoxShClGetHostMsg
[79497]786{
787 VBGLIOCHGCMCALL hdr;
788
[79630]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;
[80847]795} VBoxShClPeekMsg;
[79497]796
[80847]797#define VBOX_SHCL_CPARMS_GET_HOST_MSG 3
[79497]798
[80990]799/** No listing flags specified. */
[100204]800#define VBOX_SHCL_LIST_F_NONE 0
[80990]801/** Only returns one entry per read. */
[100204]802#define VBOX_SHCL_LIST_F_RETURN_ONE RT_BIT(0)
[80990]803/** Restarts reading a list from the beginning. */
[100204]804#define VBOX_SHCL_LIST_F_RESTART RT_BIT(1)
805/** Listing flags valid mask. */
806#define VBOX_SHCL_LIST_F_VALID_MASK 0x3
[79497]807
[100204]808/** No list header flags specified. */
809#define VBOX_SHCL_LISTHDR_F_NONE 0
810/** List header flags valid mask. */
811#define VBOX_SHCL_LISTHDR_F_VALID_MASK 0x0
[79630]812
[79672]813/** No additional information provided. */
[100204]814#define VBOX_SHCL_INFO_F_NONE 0
[80662]815/** Get object information of type SHCLFSOBJINFO. */
[100204]816#define VBOX_SHCL_INFO_F_FSOBJINFO RT_BIT(0)
817/** Info flags valid mask. */
818#define VBOX_SHCL_INFO_F_VALID_MASK 0x1
[79497]819
820/**
[84996]821 * Status message for lists and objects.
[79630]822 */
[80847]823typedef struct _VBoxShClStatusMsg
[79630]824{
825 VBGLIOCHGCMCALL hdr;
826
[81346]827 /** uint64_t, in: Context ID. */
[79630]828 HGCMFunctionParameter uContext;
[80858]829 /** uint32_t, in: Transfer status of type SHCLTRANSFERSTATUS. */
[79630]830 HGCMFunctionParameter uStatus;
831 /** pointer, in: Optional payload of this status, based on the status type. */
832 HGCMFunctionParameter pvPayload;
[80847]833} VBoxShClStatusMsg;
[79630]834
[84996]835#define VBOX_SHCL_CPARMS_STATUS 3
[79630]836
[80845]837/** Invalid message type, do not use. */
[100367]838#define VBOX_SHCL_TX_REPLYMSGTYPE_INVALID 0
[80845]839/** Replies a transfer status. */
[100367]840#define VBOX_SHCL_TX_REPLYMSGTYPE_TRANSFER_STATUS 1
[80845]841/** Replies a list open status. */
[100367]842#define VBOX_SHCL_TX_REPLYMSGTYPE_LIST_OPEN 2
[80845]843/** Replies a list close status. */
[100367]844#define VBOX_SHCL_TX_REPLYMSGTYPE_LIST_CLOSE 3
[80845]845/** Replies an object open status. */
[100367]846#define VBOX_SHCL_TX_REPLYMSGTYPE_OBJ_OPEN 4
[80845]847/** Replies an object close status. */
[100367]848#define VBOX_SHCL_TX_REPLYMSGTYPE_OBJ_CLOSE 5
[79630]849
850/**
851 * Generic reply message.
852 */
[80847]853typedef struct _VBoxShClReplyMsg
[79630]854{
855 VBGLIOCHGCMCALL hdr;
856
[81346]857 /** uint64_t, out: Context ID. */
[79630]858 HGCMFunctionParameter uContext;
[100367]859 /** uint32_t, out: Message type of type VBOX_SHCL_TX_REPLYMSGTYPE_XXX. */
[79630]860 HGCMFunctionParameter enmType;
[79672]861 /** uint32_t, out: IPRT result of overall operation. */
[79630]862 HGCMFunctionParameter rc;
[79672]863 /** pointer, out: Optional payload of this reply, based on the message type. */
[79630]864 HGCMFunctionParameter pvPayload;
865 union
866 {
867 struct
868 {
[80845]869 HGCMFunctionParameter enmStatus;
870 } TransferStatus;
871 struct
872 {
[79630]873 HGCMFunctionParameter uHandle;
874 } ListOpen;
875 struct
876 {
877 HGCMFunctionParameter uHandle;
878 } ObjOpen;
[80283]879 struct
880 {
881 HGCMFunctionParameter uHandle;
882 } ObjClose;
[79630]883 } u;
[80847]884} VBoxShClReplyMsg;
[79630]885
[80845]886/** Minimum parameters (HGCM function parameters minus the union) a reply message must have. */
[84996]887#define VBOX_SHCL_CPARMS_REPLY_MIN 4
[79630]888
[80990]889/**
890 * Structure for keeping root list message parameters.
891 */
[80847]892typedef struct _VBoxShClRootListParms
[80283]893{
[81346]894 /** uint64_t, in: Context ID. */
[80283]895 HGCMFunctionParameter uContext;
896 /** uint32_t, in: Roots listing flags; unused at the moment. */
897 HGCMFunctionParameter fRoots;
[80847]898} VBoxShClRootListParms;
[80283]899
[84996]900#define VBOX_SHCL_CPARMS_ROOT_LIST 2
901
[79630]902/**
[81025]903 * Requests to read the root list header.
[79672]904 */
[80847]905typedef struct _VBoxShClRootListReadReqMsg
[79672]906{
907 VBGLIOCHGCMCALL hdr;
908
[80847]909 VBoxShClRootListParms ReqParms;
910} VBoxShClRootListReadReqMsg;
[80283]911
[84996]912#define VBOX_SHCL_CPARMS_ROOT_LIST_HDR_READ_REQ VBOX_SHCL_CPARMS_ROOT_LIST
[80283]913
914/**
915 * Reads / Writes a root list header.
916 */
[80847]917typedef struct _VBoxShClRootListHdrMsg
[80283]918{
919 VBGLIOCHGCMCALL hdr;
920
[80847]921 VBoxShClRootListParms ReqParms;
[80283]922 /** uint64_t, in/out: Number of total root list entries. */
[80886]923 HGCMFunctionParameter cRoots;
[80847]924} VBoxShClRootListHdrMsg;
[80283]925
[84996]926#define VBOX_SHCL_CPARMS_ROOT_LIST_HDR_READ VBOX_SHCL_CPARMS_ROOT_LIST + 1
927#define VBOX_SHCL_CPARMS_ROOT_LIST_HDR_WRITE VBOX_SHCL_CPARMS_ROOT_LIST + 1
[80283]928
[80990]929/**
930 * Structure for keeping list entry message parameters.
931 */
[80847]932typedef struct _VBoxShClRootListEntryParms
[80283]933{
[81346]934 /** uint64_t, in: Context ID. */
[79672]935 HGCMFunctionParameter uContext;
[100234]936 /** uint32_t, in: VBOX_SHCL_INFO_F_XXX. */
[80283]937 HGCMFunctionParameter fInfo;
[100204]938 /** uint64_t, in: Index of root list entry to get (zero-based). */
[80283]939 HGCMFunctionParameter uIndex;
[80847]940} VBoxShClRootListEntryParms;
[79672]941
[84996]942#define VBOX_SHCL_CPARMS_ROOT_LIST_ENTRY 3
943
[80283]944/**
945 * Request to read a list root entry.
946 */
[80847]947typedef struct _VBoxShClRootListEntryReadReqMsg
[80283]948{
949 VBGLIOCHGCMCALL hdr;
[79672]950
[80283]951 /** in: Request parameters. */
[80847]952 VBoxShClRootListEntryParms Parms;
953} VBoxShClRootListEntryReadReqMsg;
[80283]954
[84996]955#define VBOX_SHCL_CPARMS_ROOT_LIST_ENTRY_READ_REQ VBOX_SHCL_CPARMS_ROOT_LIST_ENTRY
[80283]956
[79672]957/**
[80283]958 * Reads / Writes a root list entry.
959 */
[80847]960typedef struct _VBoxShClRootListEntryMsg
[80283]961{
962 VBGLIOCHGCMCALL hdr;
963
964 /** in/out: Request parameters. */
[80847]965 VBoxShClRootListEntryParms Parms;
[100204]966 /** pointer, in/out: Entry name.
967 * Up to SHCLLISTENTRY_MAX_NAME. */
[80990]968 HGCMFunctionParameter szName;
[80283]969 /** uint32_t, out: Bytes to be used for information/How many bytes were used. */
[80990]970 HGCMFunctionParameter cbInfo;
[80662]971 /** pointer, in/out: Information to be set/get (SHCLFSOBJINFO only currently).
972 * Do not forget to set the SHCLFSOBJINFO::Attr::enmAdditional for Get operation as well. */
[80990]973 HGCMFunctionParameter pvInfo;
[80847]974} VBoxShClRootListEntryMsg;
[80283]975
[84996]976#define VBOX_SHCL_CPARMS_ROOT_LIST_ENTRY_READ VBOX_SHCL_CPARMS_ROOT_LIST_ENTRY + 3
977#define VBOX_SHCL_CPARMS_ROOT_LIST_ENTRY_WRITE VBOX_SHCL_CPARMS_ROOT_LIST_ENTRY + 3
[80283]978
979/**
[79497]980 * Opens a list.
[78307]981 */
[80847]982typedef struct _VBoxShClListOpenMsg
[78307]983{
984 VBGLIOCHGCMCALL hdr;
985
[81346]986 /** uint64_t, in: Context ID. */
[79497]987 HGCMFunctionParameter uContext;
[80662]988 /** uint32_t, in: Listing flags (see VBOX_SHCL_LIST_FLAG_XXX). */
[79497]989 HGCMFunctionParameter fList;
990 /** pointer, in: Filter string. */
991 HGCMFunctionParameter pvFilter;
[103480]992 /** pointer, in: Listing path. If empty or NULL the listing's root path will be opened.
993 * We always use UNIX-style paths. */
[79630]994 HGCMFunctionParameter pvPath;
995 /** uint64_t, out: List handle. */
996 HGCMFunctionParameter uHandle;
[80847]997} VBoxShClListOpenMsg;
[78307]998
[84996]999#define VBOX_SHCL_CPARMS_LIST_OPEN 5
[78307]1000
1001/**
[79497]1002 * Closes a list.
[78307]1003 */
[80847]1004typedef struct _VBoxShClListCloseMsg
[78307]1005{
1006 VBGLIOCHGCMCALL hdr;
1007
[81346]1008 /** uint64_t, in/out: Context ID. */
[79497]1009 HGCMFunctionParameter uContext;
1010 /** uint64_t, in: List handle. */
1011 HGCMFunctionParameter uHandle;
[80847]1012} VBoxShClListCloseMsg;
[78307]1013
[80847]1014#define VBOX_SHCL_CPARMS_LIST_CLOSE 2
[78648]1015
[80847]1016typedef struct _VBoxShClListHdrReqParms
[79630]1017{
[81346]1018 /** uint64_t, in: Context ID. */
[79630]1019 HGCMFunctionParameter uContext;
1020 /** uint64_t, in: List handle. */
1021 HGCMFunctionParameter uHandle;
[80662]1022 /** uint32_t, in: Flags of type VBOX_SHCL_LISTHDR_FLAG_XXX. */
[79630]1023 HGCMFunctionParameter fFlags;
[80847]1024} VBoxShClListHdrReqParms;
[79630]1025
[84996]1026#define VBOX_SHCL_CPARMS_LIST_HDR_REQ 3
1027
[78307]1028/**
[79630]1029 * Request to read a list header.
[78307]1030 */
[80847]1031typedef struct _VBoxShClListHdrReadReqMsg
[79630]1032{
1033 VBGLIOCHGCMCALL hdr;
1034
[80847]1035 VBoxShClListHdrReqParms ReqParms;
1036} VBoxShClListHdrReadReqMsg;
[79630]1037
[84996]1038#define VBOX_SHCL_CPARMS_LIST_HDR_READ_REQ VBOX_SHCL_CPARMS_LIST_HDR_REQ
[79630]1039
1040/**
1041 * Reads / Writes a list header.
1042 */
[80847]1043typedef struct _VBoxShClListHdrMsg
[78307]1044{
1045 VBGLIOCHGCMCALL hdr;
1046
[80847]1047 VBoxShClListHdrReqParms ReqParms;
[80662]1048 /** uint32_t, in/out: Feature flags (see VBOX_SHCL_FEATURE_FLAG_XXX). */
[80990]1049 HGCMFunctionParameter fFeatures;
[84996]1050 /** uint64_t, in/out: Number of total objects to transfer. */
[80990]1051 HGCMFunctionParameter cTotalObjects;
[84996]1052 /** uint64_t, in/out: Number of total bytes to transfer. */
[80990]1053 HGCMFunctionParameter cbTotalSize;
[80847]1054} VBoxShClListHdrMsg;
[79630]1055
[84996]1056#define VBOX_SHCL_CPARMS_LIST_HDR VBOX_SHCL_CPARMS_LIST_HDR_REQ + 3
[79630]1057
[80847]1058typedef struct _VBoxShClListEntryReqParms
[79630]1059{
[81346]1060 /** uint64_t, in: Context ID. */
[79497]1061 HGCMFunctionParameter uContext;
1062 /** uint64_t, in: List handle. */
1063 HGCMFunctionParameter uHandle;
[100234]1064 /** uint32_t, in: VBOX_SHCL_INFO_F_XXX. */
[79630]1065 HGCMFunctionParameter fInfo;
[80847]1066} VBoxShClListEntryReqParms;
[78307]1067
[84996]1068#define VBOX_SHCL_CPARMS_LIST_ENTRY_REQ 3
1069
[79630]1070/**
1071 * Request to read a list entry.
1072 */
[80847]1073typedef struct _VBoxShClListEntryReadReqMsg
[79630]1074{
1075 VBGLIOCHGCMCALL hdr;
[78648]1076
[80847]1077 VBoxShClListEntryReqParms ReqParms;
1078} VBoxShClListEntryReadReqMsg;
[79630]1079
[84996]1080#define VBOX_SHCL_CPARMS_LIST_ENTRY_READ VBOX_SHCL_CPARMS_LIST_ENTRY_REQ
[79630]1081
[78307]1082/**
[79630]1083 * Reads / Writes a list entry.
[78307]1084 */
[80847]1085typedef struct _VBoxShClListEntryMsg
[78307]1086{
1087 VBGLIOCHGCMCALL hdr;
1088
[79672]1089 /** in/out: Request parameters. */
[80847]1090 VBoxShClListEntryReqParms ReqParms;
[79672]1091 /** pointer, in/out: Entry name. */
[84996]1092 HGCMFunctionParameter szName;
[79630]1093 /** uint32_t, out: Bytes to be used for information/How many bytes were used. */
[84996]1094 HGCMFunctionParameter cbInfo;
[80662]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. */
[84996]1097 HGCMFunctionParameter pvInfo;
[80847]1098} VBoxShClListEntryMsg;
[78307]1099
[84996]1100#define VBOX_SHCL_CPARMS_LIST_ENTRY VBOX_SHCL_CPARMS_LIST_ENTRY_REQ + 3
[78648]1101
[80990]1102/**
1103 * Opens a Shared Clipboard object.
1104 */
[80847]1105typedef struct _VBoxShClObjOpenMsg
[79497]1106{
[80283]1107 VBGLIOCHGCMCALL hdr;
[79497]1108
[81346]1109 /** uint64_t, in/out: Context ID. */
[80283]1110 HGCMFunctionParameter uContext;
[84996]1111 /** uint64_t, out: Object handle. */
[80283]1112 HGCMFunctionParameter uHandle;
[103480]1113 /** pointer, in: Absoulte path of object to open/create.
1114 * We always use UNIX-style paths. */
[79497]1115 HGCMFunctionParameter szPath;
[84996]1116 /** uint32_t in: Open / Create flags of type SHCL_OBJ_CF_. */
[80283]1117 HGCMFunctionParameter fCreate;
[80847]1118} VBoxShClObjOpenMsg;
[79497]1119
[84996]1120#define VBOX_SHCL_CPARMS_OBJ_OPEN 4
[79497]1121
[80990]1122/**
1123 * Closes a Shared Clipboard object.
1124 */
[80847]1125typedef struct _VBoxShClObjCloseMsg
[79497]1126{
[80283]1127 VBGLIOCHGCMCALL hdr;
[79497]1128
[81346]1129 /** uint64_t, in/out: Context ID. */
[80283]1130 HGCMFunctionParameter uContext;
[80662]1131 /** uint64_t, in: SHCLOBJHANDLE of object to close. */
[79497]1132 HGCMFunctionParameter uHandle;
[80847]1133} VBoxShClObjCloseMsg;
[79497]1134
[80847]1135#define VBOX_SHCL_CPARMS_OBJ_CLOSE 2
[79497]1136
[80990]1137/**
1138 * Structure for keeping read parameters of a Shared Clipboard object.
1139 */
[80847]1140typedef struct _VBoxShClObjReadReqParms
[80283]1141{
[81346]1142 /** uint64_t, in: Context ID. */
[80283]1143 HGCMFunctionParameter uContext;
[80662]1144 /** uint64_t, in: SHCLOBJHANDLE of object to write to. */
[80283]1145 HGCMFunctionParameter uHandle;
1146 /** uint32_t, in: How many bytes to read. */
1147 HGCMFunctionParameter cbToRead;
[80359]1148 /** uint32_t, in: Read flags. Currently unused and must be 0. */
[80283]1149 HGCMFunctionParameter fRead;
[80847]1150} VBoxShClObjReadReqParms;
[80283]1151
[80990]1152/**
1153 * Reads from a Shared Clipboard object.
1154 */
[80847]1155typedef struct _VBoxShClObjReadReqMsg
[80283]1156{
1157 VBGLIOCHGCMCALL hdr;
1158
[80847]1159 VBoxShClObjReadReqParms ReqParms;
1160} VBoxShClObjReadReqMsg;
[80283]1161
[80847]1162#define VBOX_SHCL_CPARMS_OBJ_READ_REQ 4
[80283]1163
[78307]1164/**
[79497]1165 * Reads / writes data of / to an object.
[78307]1166 *
1167 * Used by:
[80847]1168 * VBOX_SHCL_FN_OBJ_READ
1169 * VBOX_SHCL_FN_OBJ_WRITE
[78307]1170 */
[80847]1171typedef struct _VBoxShClObjReadWriteMsg
[78307]1172{
1173 VBGLIOCHGCMCALL hdr;
1174
[81346]1175 /** uint64_t, in/out: Context ID. */
[80283]1176 HGCMFunctionParameter uContext;
[80662]1177 /** uint64_t, in/out: SHCLOBJHANDLE of object to write to. */
[79497]1178 HGCMFunctionParameter uHandle;
[84996]1179 /** uint32_t, out: Size (in bytes) read/written. */
[80283]1180 HGCMFunctionParameter cbData;
1181 /** pointer, in/out: Current data chunk. */
1182 HGCMFunctionParameter pvData;
1183 /** uint32_t, in/out: Size (in bytes) of current data chunk checksum. */
1184 HGCMFunctionParameter cbChecksum;
1185 /** pointer, in/out: Checksum of data block, based on the checksum
[78307]1186 * type in the data header. Optional. */
[80283]1187 HGCMFunctionParameter pvChecksum;
[80847]1188} VBoxShClObjReadWriteMsg;
[78307]1189
[80847]1190#define VBOX_SHCL_CPARMS_OBJ_READ 6
1191#define VBOX_SHCL_CPARMS_OBJ_WRITE 6
[78648]1192
[78307]1193/**
1194 * Sends an error event.
1195 *
1196 * Used by:
[80847]1197 * VBOX_SHCL_FN_WRITE_ERROR
[78307]1198 */
[80847]1199typedef struct _VBoxShClErrorMsg
[78307]1200{
1201 VBGLIOCHGCMCALL hdr;
1202
[81346]1203 /** uint64_t, in: Context ID. */
[79497]1204 HGCMFunctionParameter uContext;
1205 /** uint32_t, in: The error code (IPRT-style). */
1206 HGCMFunctionParameter rc;
[80847]1207} VBoxShClWriteErrorMsg;
[78307]1208
[80847]1209#define VBOX_SHCL_CPARMS_ERROR 2
[79497]1210
[82852]1211/** @name VBOX_SHCL_GUEST_FN_NEGOTIATE_CHUNK_SIZE
1212 * @{ */
1213/** VBOX_SHCL_GUEST_FN_NEGOTIATE_CHUNK_SIZE parameters. */
1214typedef struct _VBoxShClParmNegotiateChunkSize
[78618]1215{
[82852]1216 VBGLIOCHGCMCALL hdr;
[78618]1217
[82852]1218 /** uint32_t, in: Maximum chunk size. */
1219 HGCMFunctionParameter cb32MaxChunkSize;
1220 /** uint32_t, in: Default chunk size. */
1221 HGCMFunctionParameter cb32ChunkSize;
1222} VBoxShClParmNegotiateChunkSize;
[78618]1223
[82852]1224#define VBOX_SHCL_CPARMS_NEGOTIATE_CHUNK_SIZE 2
1225/** @} */
1226
1227#pragma pack()
1228
[79107]1229#endif /* !VBOX_INCLUDED_HostServices_VBoxClipboardSvc_h */
[79702]1230
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