VirtualBox

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

Last change on this file since 104429 was 98103, checked in by vboxsync, 22 months ago

Copyright year updates by scm.

  • Property svn:eol-style set to native
  • Property svn:keywords set to Author Date Id Revision
File size: 39.7 KB
RevLine 
[80453]1/* $Id: DragAndDropSvc.h 98103 2023-01-17 14:15:46Z vboxsync $ */
[42264]2/** @file
3 * Drag and Drop service - Common header for host service and guest clients.
4 */
5
6/*
[98103]7 * Copyright (C) 2011-2023 Oracle and/or its affiliates.
[42264]8 *
[96407]9 * This file is part of VirtualBox base platform packages, as
10 * available from https://www.virtualbox.org.
[42264]11 *
[96407]12 * This program is free software; you can redistribute it and/or
13 * modify it under the terms of the GNU General Public License
14 * as published by the Free Software Foundation, in version 3 of the
15 * License.
16 *
17 * This program is distributed in the hope that it will be useful, but
18 * WITHOUT ANY WARRANTY; without even the implied warranty of
19 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
20 * General Public License for more details.
21 *
22 * You should have received a copy of the GNU General Public License
23 * along with this program; if not, see <https://www.gnu.org/licenses>.
24 *
[42264]25 * The contents of this file may alternatively be used under the terms
26 * of the Common Development and Distribution License Version 1.0
[96407]27 * (CDDL), a copy of it is provided in the "COPYING.CDDL" file included
28 * in the VirtualBox distribution, in which case the provisions of the
[42264]29 * CDDL are applicable instead of those of the GPL.
30 *
31 * You may elect to license modified versions of this file under the
32 * terms and conditions of either the GPL or the CDDL or both.
[96407]33 *
34 * SPDX-License-Identifier: GPL-3.0-only OR CDDL-1.0
[42264]35 */
36
[58212]37/**
38 * Protocol handling and notes:
39 * All client/server components should be backwards compatible.
40 *
41 ******************************************************************************
42 *
43 * Protocol changelog:
44 *
[58329]45 * Protocol v1 (VBox < 5.0, deprecated):
46 * | Initial implementation which only implemented host to guest transfers.
47 * | For file transfers all file information such as the file name and file size were
[58212]48 * transferred with every file data chunk being sent.
49 *
[58329]50 * Protocol v2 (VBox 5.0 - VBox 5.0.8, deprecated):
51 * + Added support for guest to host transfers.
52 * + Added protocol version support through VBOXDNDCONNECTMSG. The host takes the installed
[58212]53 * Guest Additions version as indicator which protocol to use for communicating with the guest.
54 * The guest itself uses VBOXDNDCONNECTMSG to report its supported protocol version to the DnD service.
55 *
[85712]56 * Protocol v3 (VBox 5.0.10 and up, deprecated):
[58329]57 * + Added VBOXDNDDISCONNECTMSG for being able to track client disconnects on host side (Main).
58 * + Added context IDs for every HGCM message. Not used yet and must be 0.
59 * + Added VBOXDNDSNDDATAHDR and VBOXDNDCBSNDDATAHDRDATA to support (simple) accounting of objects
[58212]60 * being transferred, along with supplying separate meta data size (which is part of the total size being sent).
[85745]61 * + Added new HOST_DND_FN_HG_SND_DATA_HDR + GUEST_DND_FN_GH_SND_DATA_HDR commands which now allow specifying an optional
[58212]62 * compression type and defining a checksum for the overall data transfer.
[58329]63 * + Enhannced VBOXDNDGHSENDDATAMSG to support (rolling) checksums for the supplied data block.
64 * + VBOXDNDHGSENDDATAMSG and VBOXDNDGHSENDDATAMSG can now contain an optional checksum for the current data block.
65 * | VBOXDNDHGSENDFILEDATAMSG and VBOXDNDGHSENDFILEDATAMSG are now sharing the same HGCM mesasge.
[85745]66 * - Removed unused HOST_DND_FN_GH_RECV_DIR, HOST_DND_FN_GH_RECV_FILE_DATA and HOST_DND_FN_GH_RECV_FILE_HDR commands.
[74234]67 *
[85712]68 * VBox 6.1.x and up, current:
[85745]69 * + Added GUEST_DND_FN_QUERY_FEATURES + GUEST_DND_FN_REPORT_FEATURES.
[85712]70 * - Protocol versioning support in VBOXDNDCONNECTMSG is now marked as being deprecated.
[74234]71 *
[85712]72 ** @todo:
73 * - Split up messages which use VBOXDNDHGACTIONMSG into own functions and remove parameters which
[85745]74 * are not actually needed / used by a function. Why does HOST_DND_FN_HG_EVT_MOVE need all the format stuff, for example?
[58212]75 */
76
[76558]77#ifndef VBOX_INCLUDED_HostServices_DragAndDropSvc_h
78#define VBOX_INCLUDED_HostServices_DragAndDropSvc_h
[76507]79#ifndef RT_WITHOUT_PRAGMA_ONCE
80# pragma once
81#endif
[42264]82
[55422]83#include <VBox/hgcmsvc.h>
[68660]84#include <VBox/VMMDevCoreTypes.h>
[68656]85#include <VBox/VBoxGuestCoreTypes.h>
[42264]86
[74442]87#include <VBox/GuestHost/DragAndDropDefs.h>
88
[42264]89namespace DragAndDropSvc {
90
91/******************************************************************************
92* Typedefs, constants and inlines *
93******************************************************************************/
94
95/**
96 * The service functions which are callable by host.
[50265]97 * Note: When adding new functions to this table, make sure that the actual ID
98 * does *not* overlap with the eGuestFn enumeration below!
[42264]99 */
100enum eHostFn
101{
[74335]102 /** The host sets a new DnD mode. */
[85745]103 HOST_DND_FN_SET_MODE = 100,
[76891]104 /** The host requests to cancel the current DnD operation on
105 * the guest side. This can happen on user request on the host's
106 * UI side or due to some host error which has happened.
107 *
108 * Note: This is a fire-and-forget message, as the host should
109 * not rely on an answer from the guest side in order to
110 * properly cancel the operation. */
[85745]111 HOST_DND_FN_CANCEL = 204,
[42264]112
[50305]113 /*
114 * Host -> Guest messages
115 */
116
[74335]117 /** The host enters the VM window for starting an actual
[55422]118 * DnD operation. */
[85745]119 HOST_DND_FN_HG_EVT_ENTER = 200,
[74335]120 /** The host's DnD cursor moves within the VM window. */
[85745]121 HOST_DND_FN_HG_EVT_MOVE = 201,
[74335]122 /** The host leaves the guest VM window. */
[85745]123 HOST_DND_FN_HG_EVT_LEAVE = 202,
[74335]124 /** The host issues a "drop" event, meaning that the host is
[55422]125 * ready to transfer data over to the guest. */
[85745]126 HOST_DND_FN_HG_EVT_DROPPED = 203,
[74335]127 /** The host sends the data header at the beginning of a (new)
[58212]128 * data transfer. */
[85745]129 HOST_DND_FN_HG_SND_DATA_HDR = 210,
[58212]130 /**
[74335]131 * The host sends the actual meta data, based on
[85745]132 * the format(s) specified by HOST_DND_FN_HG_EVT_ENTER.
[58212]133 *
134 * Protocol v1/v2: If the guest supplied buffer too small to send
[85745]135 * the actual data, the host will send a HOST_DND_FN_HG_SND_MORE_DATA
[58212]136 * message as follow-up.
137 * Protocol v3+: The incoming meta data size is specified upfront in the
[85745]138 * HOST_DND_FN_HG_SND_DATA_HDR message and must be handled accordingly.
[58212]139 */
[85745]140 HOST_DND_FN_HG_SND_DATA = 205,
[74335]141 /** The host sends more data in case the data did not entirely fit in
[85745]142 * the HOST_DND_FN_HG_SND_DATA message. */
[58212]143 /** @todo Deprecated function; do not use anymore. */
[85745]144 HOST_DND_FN_HG_SND_MORE_DATA = 206,
[74335]145 /** The host sends a directory entry to the guest. */
[85745]146 HOST_DND_FN_HG_SND_DIR = 207,
[74335]147 /** The host sends a file data chunk to the guest. */
[85745]148 HOST_DND_FN_HG_SND_FILE_DATA = 208,
[74335]149 /** The host sends a file header to the guest.
[55422]150 * Note: Only for protocol version 2 and up (>= VBox 5.0). */
[85745]151 HOST_DND_FN_HG_SND_FILE_HDR = 209,
[42264]152
[50305]153 /*
154 * Guest -> Host messages
155 */
156
[50265]157 /** The host asks the guest whether a DnD operation
158 * is in progress when the mouse leaves the guest window. */
[85745]159 HOST_DND_FN_GH_REQ_PENDING = 600,
[50265]160 /** The host informs the guest that a DnD drop operation
161 * has been started and that the host wants the data in
[50460]162 * a specific MIME type. */
[85745]163 HOST_DND_FN_GH_EVT_DROPPED = 601,
[55422]164 /** Blow the type up to 32-bit. */
[85745]165 HOST_DND_FN_32BIT_HACK = 0x7fffffff
[42264]166};
167
168/**
169 * The service functions which are called by guest.
[50265]170 * Note: When adding new functions to this table, make sure that the actual ID
[55422]171 * does *not* overlap with the eHostFn enumeration above!
[42264]172 */
173enum eGuestFn
174{
[74335]175 /**
176 * The guest sends a connection request to the HGCM service,
[58329]177 * along with some additional information like supported
178 * protocol version and flags.
[55422]179 * Note: New since protocol version 2. */
[85745]180 GUEST_DND_FN_CONNECT = 10,
[55422]181
[74335]182 /** The guest client disconnects from the HGCM service. */
[85745]183 GUEST_DND_FN_DISCONNECT = 11,
[58329]184
[85712]185 /** Report guest side feature flags and retrieve the host ones.
186 *
187 * Two 64-bit parameters are passed in from the guest with the guest features
188 * (VBOX_DND_GF_XXX), the host replies by replacing the parameter values with
189 * the host ones (VBOX_DND_HF_XXX).
190 *
191 * @retval VINF_SUCCESS on success.
192 * @retval VERR_INVALID_CLIENT_ID
193 * @retval VERR_WRONG_PARAMETER_COUNT
194 * @retval VERR_WRONG_PARAMETER_TYPE
195 * @since 6.1.x
196 */
[85745]197 GUEST_DND_FN_REPORT_FEATURES = 12,
[85712]198
199 /** Query the host ones feature masks.
200 *
201 * That way the guest (client) can get hold of the features from the host.
202 * Again, it is prudent to set the 127 bit and observe it being cleared on
203 * success, as older hosts might return success without doing anything.
204 *
205 * @retval VINF_SUCCESS on success.
206 * @retval VERR_INVALID_CLIENT_ID
207 * @retval VERR_WRONG_PARAMETER_COUNT
208 * @retval VERR_WRONG_PARAMETER_TYPE
209 * @since 6.1.x
210 */
[85745]211 GUEST_DND_FN_QUERY_FEATURES = 13,
[85712]212
[42264]213 /**
[74335]214 * The guest waits for a new message the host wants to process
[50265]215 * on the guest side. This can be a blocking call.
[42264]216 */
[85745]217 GUEST_DND_FN_GET_NEXT_HOST_MSG = 300,
[42264]218
[97748]219 /** Reports back an error to the host.
220 *
221 * Note: Don't change the ID to also support older hosts
222 * (was GUEST_DND_FN_GH_EVT_ERROR before < 7.0, only for G->H transfers).
223 *
224 * This was changed to GUEST_DND_FN_EVT_ERROR to be a generic event
225 * that also can be used for H->G transfers.
226 *
227 * @retval VINF_SUCCESS on success.
228 * @retval VERR_INVALID_CLIENT_ID
229 * @retval VERR_WRONG_PARAMETER_COUNT
230 * @retval VERR_WRONG_PARAMETER_TYPE
231 * @since 7.0.x
232 */
233 GUEST_DND_FN_EVT_ERROR = 502,
234
[55422]235 /*
236 * Host -> Guest operation messages.
237 */
238
[74335]239 /** The guest acknowledges that a pending DnD operation from the host
240 * can be dropped on the currently selected area on the guest. */
[85745]241 GUEST_DND_FN_HG_ACK_OP = 400,
[74335]242 /** The guest requests the actual DnD data to be sent from the host. */
[85745]243 GUEST_DND_FN_HG_REQ_DATA = 401,
[74335]244 /** The guest reports back its progress back to the host. */
[85745]245 GUEST_DND_FN_HG_EVT_PROGRESS = 402,
[42264]246
[55422]247 /*
248 * Guest -> Host operation messages.
249 */
250
[50265]251 /**
252 * The guests acknowledges that it currently has a drag'n drop
253 * operation in progress on the guest, which eventually could be
254 * dragged over to the host.
255 */
[85745]256 GUEST_DND_FN_GH_ACK_PENDING = 500,
[74335]257 /** The guest sends the data header at the beginning of a (new)
[58212]258 * data transfer. */
[85745]259 GUEST_DND_FN_GH_SND_DATA_HDR = 503,
[50460]260 /**
[74335]261 * The guest sends data of the requested format to the host. There can
[50460]262 * be more than one message if the actual data does not fit
263 * into one.
264 */
[85745]265 GUEST_DND_FN_GH_SND_DATA = 501,
[74335]266 /** The guest sends a directory entry to the host. */
[85745]267 GUEST_DND_FN_GH_SND_DIR = 700,
[74335]268 /** The guest sends file data to the host.
269 * Note: On protocol version 1 this also contains the file name
[55422]270 * and other attributes. */
[85745]271 GUEST_DND_FN_GH_SND_FILE_DATA = 701,
[74335]272 /** The guest sends a file header to the host, marking the
[55422]273 * beginning of a (new) file transfer.
274 * Note: Available since protocol version 2 (VBox 5.0). */
[85745]275 GUEST_DND_FN_GH_SND_FILE_HDR = 702,
[55422]276 /** Blow the type up to 32-bit. */
[85745]277 GUEST_DND_FN_32BIT_HACK = 0x7fffffff
[42264]278};
279
[85712]280/** @name VBOX_DND_GF_XXX - Guest features.
[85745]281 * @sa GUEST_DND_FN_REPORT_FEATURES
[85712]282 * @{ */
283/** No flags set. */
284#define VBOX_DND_GF_NONE 0
285/** Bit that must be set in the 2nd parameter, will be cleared if the host reponds
286 * correctly (old hosts might not). */
287#define VBOX_DND_GF_1_MUST_BE_ONE RT_BIT_64(63)
288/** @} */
289
290/** @name VBOX_DND_HF_XXX - Host features.
291 * @sa DND_GUEST_REPORT_FEATURES
292 * @{ */
293/** No flags set. */
294#define VBOX_DND_HF_NONE 0
295/** @} */
296
[42264]297/**
[55422]298 * DnD operation progress states.
[42264]299 */
[55422]300typedef enum DNDPROGRESS
[42264]301{
[55422]302 DND_PROGRESS_UNKNOWN = 0,
303 DND_PROGRESS_RUNNING = 1,
[42264]304 DND_PROGRESS_COMPLETE,
305 DND_PROGRESS_CANCELLED,
[55422]306 DND_PROGRESS_ERROR,
307 /** Blow the type up to 32-bit. */
308 DND_PROGRESS_32BIT_HACK = 0x7fffffff
309} DNDPROGRESS, *PDNDPROGRESS;
[42264]310
311#pragma pack (1)
312
313/*
314 * Host events
315 */
316
[58212]317/**
318 * Action message for telling the guest about the currently ongoing
319 * drag and drop action when entering the guest's area, moving around in it
320 * and dropping content into it from the host.
321 *
322 * Used by:
[85745]323 * HOST_DND_FN_HG_EVT_ENTER
324 * HOST_DND_FN_HG_EVT_MOVE
325 * HOST_DND_FN_HG_EVT_DROPPED
[58212]326 */
[84984]327typedef struct HGCMMsgHGAction
[42264]328{
[68550]329 VBGLIOCHGCMCALL hdr;
[42264]330
[58257]331 union
332 {
333 struct
334 {
335 HGCMFunctionParameter uScreenId; /* OUT uint32_t */
336 HGCMFunctionParameter uX; /* OUT uint32_t */
337 HGCMFunctionParameter uY; /* OUT uint32_t */
338 HGCMFunctionParameter uDefAction; /* OUT uint32_t */
339 HGCMFunctionParameter uAllActions; /* OUT uint32_t */
340 HGCMFunctionParameter pvFormats; /* OUT ptr */
[58329]341 HGCMFunctionParameter cbFormats; /* OUT uint32_t */
[58257]342 } v1;
343 struct
344 {
345 /** Context ID. */
346 HGCMFunctionParameter uContext;
347 HGCMFunctionParameter uScreenId; /* OUT uint32_t */
348 HGCMFunctionParameter uX; /* OUT uint32_t */
349 HGCMFunctionParameter uY; /* OUT uint32_t */
350 HGCMFunctionParameter uDefAction; /* OUT uint32_t */
351 HGCMFunctionParameter uAllActions; /* OUT uint32_t */
352 HGCMFunctionParameter pvFormats; /* OUT ptr */
[58329]353 HGCMFunctionParameter cbFormats; /* OUT uint32_t */
[58257]354 } v3;
355 } u;
[84984]356} HGCMMsgHGAction;
[42264]357
[58212]358/**
359 * Tells the guest that the host has left its drag and drop area on the guest.
360 *
361 * Used by:
[85745]362 * HOST_DND_FN_HG_EVT_LEAVE
[58212]363 */
[84984]364typedef struct HGCMMsgHGLeave
[42264]365{
[68550]366 VBGLIOCHGCMCALL hdr;
[58257]367 union
368 {
369 struct
370 {
371 /** Context ID. */
372 HGCMFunctionParameter uContext;
373 } v3;
374 } u;
[84984]375} HGCMMsgHGLeave;
[42264]376
[58212]377/**
378 * Tells the guest that the host wants to cancel the current drag and drop operation.
379 *
380 * Used by:
[85745]381 * HOST_DND_FN_HG_EVT_CANCEL
[58212]382 */
[84984]383typedef struct HGCMMsgHGCancel
[42264]384{
[68550]385 VBGLIOCHGCMCALL hdr;
[58257]386 union
387 {
388 struct
389 {
390 /** Context ID. */
391 HGCMFunctionParameter uContext;
392 } v3;
393 } u;
[84984]394} HGCMMsgHGCancel;
[42264]395
[58212]396/**
397 * Sends the header of an incoming (meta) data block.
398 *
399 * Used by:
[85745]400 * HOST_DND_FN_HG_SND_DATA_HDR
401 * GUEST_DND_FN_GH_SND_DATA_HDR
[58212]402 *
403 * New since protocol v3.
404 */
[84984]405typedef struct HGCMMsgHGSendDataHdr
[58212]406{
[68550]407 VBGLIOCHGCMCALL hdr;
[58212]408
409 /** Context ID. Unused at the moment. */
410 HGCMFunctionParameter uContext; /* OUT uint32_t */
411 /** Data transfer flags. Not yet used and must be 0. */
412 HGCMFunctionParameter uFlags; /* OUT uint32_t */
413 /** Screen ID where the data originates from. */
414 HGCMFunctionParameter uScreenId; /* OUT uint32_t */
415 /** Total size (in bytes) to transfer. */
416 HGCMFunctionParameter cbTotal; /* OUT uint64_t */
[42264]417 /**
[58212]418 * Total meta data size (in bytes) to transfer.
419 * This size also is part of cbTotal already, so:
[42264]420 *
[58212]421 * cbTotal = cbMeta + additional size for files etc.
[42264]422 */
[58212]423 HGCMFunctionParameter cbMeta; /* OUT uint64_t */
424 /** Meta data format. */
425 HGCMFunctionParameter pvMetaFmt; /* OUT ptr */
426 /** Size (in bytes) of meta data format. */
427 HGCMFunctionParameter cbMetaFmt; /* OUT uint32_t */
428 /* Number of objects (files/directories) to transfer. */
429 HGCMFunctionParameter cObjects; /* OUT uint64_t */
430 /** Compression type. */
431 HGCMFunctionParameter enmCompression; /* OUT uint32_t */
432 /** Checksum type. */
433 HGCMFunctionParameter enmChecksumType; /* OUT uint32_t */
434 /** Checksum buffer for the entire data to be transferred. */
435 HGCMFunctionParameter pvChecksum; /* OUT ptr */
436 /** Size (in bytes) of checksum. */
437 HGCMFunctionParameter cbChecksum; /* OUT uint32_t */
[84984]438} HGCMMsgHGSendDataHdr;
[42264]439
[58212]440/**
441 * Sends a (meta) data block to the guest.
442 *
443 * Used by:
[85745]444 * HOST_DND_FN_HG_SND_DATA
[58212]445 */
[84984]446typedef struct HGCMMsgHGSendData
[42264]447{
[68550]448 VBGLIOCHGCMCALL hdr;
[42264]449
[58212]450 union
451 {
452 struct
453 {
454 HGCMFunctionParameter uScreenId; /* OUT uint32_t */
455 HGCMFunctionParameter pvFormat; /* OUT ptr */
456 HGCMFunctionParameter cbFormat; /* OUT uint32_t */
457 HGCMFunctionParameter pvData; /* OUT ptr */
458 HGCMFunctionParameter cbData; /* OUT uint32_t */
459 } v1;
460 /* No changes in v2. */
461 struct
462 {
463 /** Context ID. Unused at the moment. */
464 HGCMFunctionParameter uContext; /* OUT uint32_t */
465 /** Data block to send. */
466 HGCMFunctionParameter pvData; /* OUT ptr */
467 /** Size (in bytes) of data block to send. */
468 HGCMFunctionParameter cbData; /* OUT uint32_t */
469 /** Checksum of data block, based on the checksum
470 * type in the data header. Optional. */
471 HGCMFunctionParameter pvChecksum; /* OUT ptr */
472 /** Size (in bytes) of checksum to send. */
473 HGCMFunctionParameter cbChecksum; /* OUT uint32_t */
474 } v3;
475 } u;
[84984]476} HGCMMsgHGSendData;
[42264]477
[58212]478/**
479 * Sends more (meta) data in case the data didn't fit
480 * into the current XXX_DND_HG_SND_DATA message.
481 *
482 ** @todo Deprecated since protocol v3. Don't use! Will be removed.
483 *
484 * Used by:
[85745]485 * HOST_DND_FN_HG_SND_MORE_DATA
[58212]486 */
[84984]487typedef struct HGCMMsgHGSendMoreData
[42264]488{
[68550]489 VBGLIOCHGCMCALL hdr;
[42264]490
491 HGCMFunctionParameter pvData; /* OUT ptr */
[50508]492 HGCMFunctionParameter cbData; /* OUT uint32_t */
[84984]493} HGCMMsgHGSendMoreData;
[42264]494
[58212]495/**
496 * Directory entry event.
497 *
498 * Used by:
[85745]499 * HOST_DND_FN_HG_SND_DIR
500 * GUEST_DND_FN_GH_SND_DIR
[58212]501 */
[84984]502typedef struct HGCMMsgHGSendDir
[42264]503{
[68550]504 VBGLIOCHGCMCALL hdr;
[42264]505
[58257]506 union
507 {
508 struct
509 {
510 /** Directory name. */
511 HGCMFunctionParameter pvName; /* OUT ptr */
512 /** Size (in bytes) of directory name. */
513 HGCMFunctionParameter cbName; /* OUT uint32_t */
514 /** Directory mode. */
515 HGCMFunctionParameter fMode; /* OUT uint32_t */
516 } v1;
517 struct
518 {
519 /** Context ID. Unused at the moment. */
520 HGCMFunctionParameter uContext; /* OUT uint32_t */
521 /** Directory name. */
522 HGCMFunctionParameter pvName; /* OUT ptr */
523 /** Size (in bytes) of directory name. */
524 HGCMFunctionParameter cbName; /* OUT uint32_t */
525 /** Directory mode. */
526 HGCMFunctionParameter fMode; /* OUT uint32_t */
527 } v3;
528 } u;
[84984]529} HGCMMsgHGSendDir;
[42264]530
[55422]531/**
[58212]532 * File header message, marking the start of transferring a new file.
[55422]533 * Note: Only for protocol version 2 and up.
534 *
535 * Used by:
[85745]536 * HOST_DND_FN_HG_SND_FILE_HDR
537 * GUEST_DND_FN_GH_SND_FILE_HDR
[55422]538 */
[84984]539typedef struct HGCMMsgHGSendFileHdr
[42264]540{
[68550]541 VBGLIOCHGCMCALL hdr;
[42264]542
[55422]543 /** Context ID. Unused at the moment. */
544 HGCMFunctionParameter uContext; /* OUT uint32_t */
545 /** File path. */
[42264]546 HGCMFunctionParameter pvName; /* OUT ptr */
[55422]547 /** Size (in bytes) of file path. */
[50508]548 HGCMFunctionParameter cbName; /* OUT uint32_t */
[55422]549 /** Optional flags; unused at the moment. */
550 HGCMFunctionParameter uFlags; /* OUT uint32_t */
551 /** File creation mode. */
[42264]552 HGCMFunctionParameter fMode; /* OUT uint32_t */
[55422]553 /** Total size (in bytes). */
554 HGCMFunctionParameter cbTotal; /* OUT uint64_t */
[84984]555} HGCMMsgHGSendFileHdr;
[55422]556
557/**
558 * HG: File data (chunk) event.
559 *
560 * Used by:
[85745]561 * HOST_DND_FN_HG_SND_FILE
[55422]562 */
[84984]563typedef struct HGCMMsgHGSendFileData
[55422]564{
[68550]565 VBGLIOCHGCMCALL hdr;
[55422]566
567 union
568 {
[55549]569 /* Note: Protocol v1 sends the file name + file mode
570 * every time a file data chunk is being sent. */
[55422]571 struct
572 {
[58212]573 /** File name. */
[55422]574 HGCMFunctionParameter pvName; /* OUT ptr */
[58212]575 /** Size (in bytes) of file name. */
[55422]576 HGCMFunctionParameter cbName; /* OUT uint32_t */
[58212]577 /** Current data chunk. */
[55422]578 HGCMFunctionParameter pvData; /* OUT ptr */
[58212]579 /** Size (in bytes) of current data chunk. */
[55422]580 HGCMFunctionParameter cbData; /* OUT uint32_t */
[58212]581 /** File mode. */
[55422]582 HGCMFunctionParameter fMode; /* OUT uint32_t */
583 } v1;
584 struct
585 {
586 /** Note: pvName is now part of the VBOXDNDHGSENDFILEHDRMSG message. */
587 /** Note: cbName is now part of the VBOXDNDHGSENDFILEHDRMSG message. */
[55549]588 /** Context ID. Unused at the moment. */
[55422]589 HGCMFunctionParameter uContext; /* OUT uint32_t */
[58212]590 /** Current data chunk. */
[55422]591 HGCMFunctionParameter pvData; /* OUT ptr */
[58212]592 /** Size (in bytes) of current data chunk. */
[55422]593 HGCMFunctionParameter cbData; /* OUT uint32_t */
594 /** Note: fMode is now part of the VBOXDNDHGSENDFILEHDRMSG message. */
595 } v2;
[58212]596 struct
597 {
598 /** Context ID. Unused at the moment. */
599 HGCMFunctionParameter uContext; /* OUT uint32_t */
600 /** Current data chunk. */
601 HGCMFunctionParameter pvData; /* OUT ptr */
602 /** Size (in bytes) of current data chunk. */
603 HGCMFunctionParameter cbData; /* OUT uint32_t */
604 /** Checksum of data block, based on the checksum
605 * type in the data header. Optional. */
606 HGCMFunctionParameter pvChecksum; /* OUT ptr */
607 /** Size (in bytes) of curren data chunk checksum. */
608 HGCMFunctionParameter cbChecksum; /* OUT uint32_t */
609 } v3;
[55422]610 } u;
[84984]611} HGCMMsgHGSendFileData;
[55422]612
[58212]613/**
614 * Asks the guest if a guest->host DnD operation is in progress.
615 *
616 * Used by:
[85745]617 * HOST_DND_FN_GH_REQ_PENDING
[58212]618 */
[84984]619typedef struct HGCMMsgGHReqPending
[42264]620{
[68550]621 VBGLIOCHGCMCALL hdr;
[42264]622
[58257]623 union
624 {
625 struct
626 {
627 /** Screen ID. */
628 HGCMFunctionParameter uScreenId; /* OUT uint32_t */
629 } v1;
630 struct
631 {
632 /** Context ID. Unused at the moment. */
633 HGCMFunctionParameter uContext; /* OUT uint32_t */
634 /** Screen ID. */
635 HGCMFunctionParameter uScreenId; /* OUT uint32_t */
636 } v3;
637 } u;
[84984]638} HGCMMsgGHReqPending;
[42264]639
[58212]640/**
641 * Tells the guest that the host has dropped the ongoing guest->host
642 * DnD operation on a valid target on the host.
643 *
644 * Used by:
[85745]645 * HOST_DND_FN_GH_EVT_DROPPED
[58212]646 */
[84984]647typedef struct HGCMMsgGHDropped
[42264]648{
[68550]649 VBGLIOCHGCMCALL hdr;
[42264]650
[58257]651 union
652 {
653 struct
654 {
655 /** Requested format for sending the data. */
656 HGCMFunctionParameter pvFormat; /* OUT ptr */
657 /** Size (in bytes) of requested format. */
658 HGCMFunctionParameter cbFormat; /* OUT uint32_t */
659 /** Drop action peformed on the host. */
660 HGCMFunctionParameter uAction; /* OUT uint32_t */
661 } v1;
662 struct
663 {
664 /** Context ID. Unused at the moment. */
665 HGCMFunctionParameter uContext; /* OUT uint32_t */
666 /** Requested format for sending the data. */
667 HGCMFunctionParameter pvFormat; /* OUT ptr */
668 /** Size (in bytes) of requested format. */
669 HGCMFunctionParameter cbFormat; /* OUT uint32_t */
670 /** Drop action peformed on the host. */
671 HGCMFunctionParameter uAction; /* OUT uint32_t */
672 } v3;
673 } u;
[84984]674} HGCMMsgGHDropped;
[42264]675
676/*
677 * Guest events
678 */
679
[55422]680/**
[58257]681 * Asks the host for the next command to process, along
682 * with the needed amount of parameters and an optional blocking
683 * flag.
[55422]684 *
685 * Used by:
[85745]686 * GUEST_DND_FN_GET_NEXT_HOST_MSG
[55422]687 */
[84984]688typedef struct HGCMMsgGetNext
[42264]689{
[68550]690 VBGLIOCHGCMCALL hdr;
[42264]691
[58212]692 /** Message ID. */
693 HGCMFunctionParameter uMsg; /* OUT uint32_t */
[42264]694 /** Number of parameters the message needs. */
[58212]695 HGCMFunctionParameter cParms; /* OUT uint32_t */
[50508]696 /** Whether or not to block (wait) for a
697 * new message to arrive. */
[58212]698 HGCMFunctionParameter fBlock; /* OUT uint32_t */
[84984]699} HGCMMsgGetNext;
[42264]700
[55422]701/**
[58212]702 * Guest connection request. Used to tell the DnD protocol
[55422]703 * version to the (host) service.
704 *
705 * Used by:
[85745]706 * GUEST_DND_FN_CONNECT
[55422]707 */
[84984]708typedef struct HGCMMsgConnect
[55422]709{
[68550]710 VBGLIOCHGCMCALL hdr;
[55422]711
[58257]712 union
713 {
714 struct
715 {
[85712]716 /** Protocol version to use.
717 * Deprecated since VBox 6.1.x. Do not use / rely on it anymore. */
[58257]718 HGCMFunctionParameter uProtocol; /* OUT uint32_t */
719 /** Connection flags. Optional. */
720 HGCMFunctionParameter uFlags; /* OUT uint32_t */
721 } v2;
722 struct
723 {
724 /** Context ID. Unused at the moment. */
725 HGCMFunctionParameter uContext; /* OUT uint32_t */
[85712]726 /** Protocol version to use.
727 * Deprecated since VBox 6.1.x. Do not use / rely on it anymore. */
[58257]728 HGCMFunctionParameter uProtocol; /* OUT uint32_t */
729 /** Connection flags. Optional. */
730 HGCMFunctionParameter uFlags; /* OUT uint32_t */
731 } v3;
732 } u;
[84984]733} HGCMMsgConnect;
[55422]734
735/**
[58329]736 * Acknowledges a host operation along with the allowed
737 * action(s) on the guest.
[55422]738 *
739 * Used by:
[85745]740 * GUEST_DND_FN_HG_ACK_OP
[55422]741 */
[84984]742typedef struct HGCMMsgHGAck
[42264]743{
[68550]744 VBGLIOCHGCMCALL hdr;
[42264]745
[58257]746 union
747 {
748 struct
749 {
750 HGCMFunctionParameter uAction; /* OUT uint32_t */
751 } v1;
752 struct
753 {
754 /** Context ID. Unused at the moment. */
755 HGCMFunctionParameter uContext; /* OUT uint32_t */
756 HGCMFunctionParameter uAction; /* OUT uint32_t */
757 } v3;
758 } u;
[84984]759} HGCMMsgHGAck;
[42264]760
[55422]761/**
[84984]762 * Requests data to be sent to the guest.
[55422]763 *
764 * Used by:
[85745]765 * GUEST_DND_FN_HG_REQ_DATA
[55422]766 */
[84984]767typedef struct HGCMMsgHGReqData
[42264]768{
[68550]769 VBGLIOCHGCMCALL hdr;
[42264]770
[58257]771 union
772 {
773 struct
774 {
775 HGCMFunctionParameter pvFormat; /* OUT ptr */
776 } v1;
777 struct
778 {
779 /** Context ID. Unused at the moment. */
780 HGCMFunctionParameter uContext; /* OUT uint32_t */
781 HGCMFunctionParameter pvFormat; /* OUT ptr */
782 HGCMFunctionParameter cbFormat; /* OUT uint32_t */
783 } v3;
784 } u;
[84984]785} HGCMMsgHGReqData;
[42264]786
[84984]787typedef struct HGCMMsgHGProgress
[55422]788{
[68550]789 VBGLIOCHGCMCALL hdr;
[55422]790
[58257]791 union
792 {
793 struct
794 {
795 HGCMFunctionParameter uStatus; /* OUT uint32_t */
796 HGCMFunctionParameter uPercent; /* OUT uint32_t */
797 HGCMFunctionParameter rc; /* OUT uint32_t */
798 } v1;
799 struct
800 {
801 /** Context ID. Unused at the moment. */
802 HGCMFunctionParameter uContext; /* OUT uint32_t */
803 HGCMFunctionParameter uStatus; /* OUT uint32_t */
804 HGCMFunctionParameter uPercent; /* OUT uint32_t */
805 HGCMFunctionParameter rc; /* OUT uint32_t */
806 } v3;
807 } u;
[84984]808} HGCMMsgHGProgress;
[55422]809
810/**
[84984]811 * Acknowledges a pending guest drag and drop event to the host.
[55422]812 *
813 * Used by:
[85745]814 * GUEST_DND_FN_GH_ACK_PENDING
[55422]815 */
[84984]816typedef struct HGCMMsgGHAckPending
[42264]817{
[68550]818 VBGLIOCHGCMCALL hdr;
[42264]819
[58257]820 union
821 {
822 struct
823 {
824 HGCMFunctionParameter uDefAction; /* OUT uint32_t */
825 HGCMFunctionParameter uAllActions; /* OUT uint32_t */
826 HGCMFunctionParameter pvFormats; /* OUT ptr */
827 } v1;
828 struct
829 {
830 /** Context ID. Unused at the moment. */
831 HGCMFunctionParameter uContext; /* OUT uint32_t */
832 HGCMFunctionParameter uDefAction; /* OUT uint32_t */
833 HGCMFunctionParameter uAllActions; /* OUT uint32_t */
834 HGCMFunctionParameter pvFormats; /* OUT ptr */
835 HGCMFunctionParameter cbFormats; /* OUT uint32_t */
836 } v3;
837 } u;
[84984]838} HGCMMsgGHAckPending;
[42264]839
[55422]840/**
[58212]841 * Sends the header of an incoming data block
842 * to the host.
[55422]843 *
844 * Used by:
[85745]845 * GUEST_DND_FN_GH_SND_DATA_HDR
[58212]846 *
847 * New since protocol v3.
848 */
[84984]849typedef struct HGCMMsgHGSendDataHdr HGCMMsgGHSendDataHdr;
[58212]850
851/**
852 * Sends a (meta) data block to the host.
853 *
854 * Used by:
[85745]855 * GUEST_DND_FN_GH_SND_DATA
[55422]856 */
[84984]857typedef struct HGCMMsgGHSendData
[42264]858{
[68550]859 VBGLIOCHGCMCALL hdr;
[42264]860
[58212]861 union
862 {
863 struct
864 {
865 HGCMFunctionParameter pvData; /* OUT ptr */
866 /** Total bytes to send. This can be more than
867 * the data block specified in pvData above, e.g.
868 * when sending over file objects afterwards. */
869 HGCMFunctionParameter cbTotalBytes; /* OUT uint32_t */
870 } v1;
871 struct
872 {
873 /** Context ID. Unused at the moment. */
874 HGCMFunctionParameter uContext; /* OUT uint32_t */
875 /** Data block to send. */
876 HGCMFunctionParameter pvData; /* OUT ptr */
877 /** Size (in bytes) of data block to send. */
878 HGCMFunctionParameter cbData; /* OUT uint32_t */
879 /** (Rolling) Checksum, based on checksum type in data header. */
880 HGCMFunctionParameter pvChecksum; /* OUT ptr */
881 /** Size (in bytes) of checksum. */
882 HGCMFunctionParameter cbChecksum; /* OUT uint32_t */
883 } v3;
884 } u;
[84984]885} HGCMMsgGHSendData;
[42264]886
[55422]887/**
[58212]888 * Sends a directory entry to the host.
[55422]889 *
890 * Used by:
[85745]891 * GUEST_DND_FN_GH_SND_DIR
[55422]892 */
[84984]893typedef struct HGCMMsgHGSendDir HGCMMsgGHSendDir;
[50508]894
[55422]895/**
[58212]896 * Sends a file header to the host.
[55422]897 *
898 * Used by:
[85745]899 * GUEST_DND_FN_GH_SND_FILE_HDR
[58212]900 *
901 * New since protocol v2.
[55422]902 */
[84984]903typedef struct HGCMMsgHGSendFileHdr HGCMMsgGHSendFileHdr;
[55422]904
905/**
[58212]906 * Sends file data to the host.
[55422]907 *
908 * Used by:
[85745]909 * GUEST_DND_FN_GH_SND_FILE_DATA
[55422]910 */
[84984]911typedef struct HGCMMsgHGSendFileData HGCMMsgGHSendFileData;
[50508]912
[55422]913/**
[58212]914 * Sends a guest error event to the host.
[55422]915 *
916 * Used by:
[85745]917 * GUEST_DND_FN_GH_EVT_ERROR
[55422]918 */
[84984]919typedef struct HGCMMsgGHError
[42264]920{
[68550]921 VBGLIOCHGCMCALL hdr;
[42264]922
[58257]923 union
924 {
925 struct
926 {
927 HGCMFunctionParameter rc; /* OUT uint32_t */
928 } v1;
929 struct
930 {
931 /** Context ID. Unused at the moment. */
932 HGCMFunctionParameter uContext; /* OUT uint32_t */
933 HGCMFunctionParameter rc; /* OUT uint32_t */
934 } v3;
935 } u;
[84984]936} HGCMMsgGHError;
[42264]937
938#pragma pack()
939
[58231]940/** Builds a callback magic out of the function ID and the version
941 * of the callback data. */
942#define VBOX_DND_CB_MAGIC_MAKE(uFn, uVer) \
943 RT_MAKE_U32(uVer, uFn)
944
[42264]945/*
[58231]946 * Callback magics.
[42264]947 */
[58231]948enum eDnDCallbackMagics
[42264]949{
[85745]950 CB_MAGIC_DND_CONNECT = VBOX_DND_CB_MAGIC_MAKE(GUEST_DND_FN_CONNECT, 0),
951 CB_MAGIC_DND_REPORT_FEATURES = VBOX_DND_CB_MAGIC_MAKE(GUEST_DND_FN_REPORT_FEATURES, 0),
[97748]952 CB_MAGIC_DND_EVT_ERROR = VBOX_DND_CB_MAGIC_MAKE(GUEST_DND_FN_EVT_ERROR, 0),
[85745]953 CB_MAGIC_DND_HG_GET_NEXT_HOST_MSG = VBOX_DND_CB_MAGIC_MAKE(GUEST_DND_FN_GET_NEXT_HOST_MSG, 0),
954 CB_MAGIC_DND_HG_ACK_OP = VBOX_DND_CB_MAGIC_MAKE(GUEST_DND_FN_HG_ACK_OP, 0),
955 CB_MAGIC_DND_HG_REQ_DATA = VBOX_DND_CB_MAGIC_MAKE(GUEST_DND_FN_HG_REQ_DATA, 0),
956 CB_MAGIC_DND_HG_EVT_PROGRESS = VBOX_DND_CB_MAGIC_MAKE(GUEST_DND_FN_HG_EVT_PROGRESS, 0),
957 CB_MAGIC_DND_GH_ACK_PENDING = VBOX_DND_CB_MAGIC_MAKE(GUEST_DND_FN_GH_ACK_PENDING, 0),
958 CB_MAGIC_DND_GH_SND_DATA = VBOX_DND_CB_MAGIC_MAKE(GUEST_DND_FN_GH_SND_DATA, 0),
959 CB_MAGIC_DND_GH_SND_DATA_HDR = VBOX_DND_CB_MAGIC_MAKE(GUEST_DND_FN_GH_SND_DATA_HDR, 0),
960 CB_MAGIC_DND_GH_SND_DIR = VBOX_DND_CB_MAGIC_MAKE(GUEST_DND_FN_GH_SND_DIR, 0),
961 CB_MAGIC_DND_GH_SND_FILE_HDR = VBOX_DND_CB_MAGIC_MAKE(GUEST_DND_FN_GH_SND_FILE_HDR, 0),
[97748]962 CB_MAGIC_DND_GH_SND_FILE_DATA = VBOX_DND_CB_MAGIC_MAKE(GUEST_DND_FN_GH_SND_FILE_DATA, 0)
[42264]963};
964
965typedef struct VBOXDNDCBHEADERDATA
966{
967 /** Magic number to identify the structure. */
[58257]968 uint32_t uMagic;
[42264]969 /** Context ID to identify callback data. */
[58257]970 uint32_t uContextID;
[55422]971} VBOXDNDCBHEADERDATA, *PVBOXDNDCBHEADERDATA;
[42264]972
[85722]973typedef struct VBOXDNDCBCONNECTDATA
[58230]974{
975 /** Callback data header. */
976 VBOXDNDCBHEADERDATA hdr;
[85712]977 /** Protocol version to use.
978 * Deprecated since VBox 6.1.x. Do not use / rely on it anymore. */
[85722]979 uint32_t uProtocolVersion;
980 /** Connection flags; currently unused. */
981 uint32_t fFlags;
982} VBOXDNDCBCONNECTDATA, *PVBOXDNDCBCONNECTDATA;
[58230]983
[85722]984typedef struct VBOXDNDCBREPORTFEATURESDATA
985{
986 /** Callback data header. */
987 VBOXDNDCBHEADERDATA hdr;
988 uint32_t fGuestFeatures0;
989} VBOXDNDCBREPORTFEATURESDATA, *PVBOXDNDCBREPORTFEATURESDATA;
990
[58329]991typedef struct VBOXDNDCBDISCONNECTMSGDATA
992{
993 /** Callback data header. */
994 VBOXDNDCBHEADERDATA hdr;
995} VBOXDNDCBDISCONNECTMSGDATA, *PVBOXDNDCBDISCONNECTMSGDATA;
996
[55422]997typedef struct VBOXDNDCBHGGETNEXTHOSTMSG
998{
999 /** Callback data header. */
[55539]1000 VBOXDNDCBHEADERDATA hdr;
1001 uint32_t uMsg;
1002 uint32_t cParms;
[55422]1003} VBOXDNDCBHGGETNEXTHOSTMSG, *PVBOXDNDCBHGGETNEXTHOSTMSG;
1004
1005typedef struct VBOXDNDCBHGGETNEXTHOSTMSGDATA
1006{
1007 /** Callback data header. */
[55539]1008 VBOXDNDCBHEADERDATA hdr;
1009 uint32_t uMsg;
1010 uint32_t cParms;
1011 PVBOXHGCMSVCPARM paParms;
[55422]1012} VBOXDNDCBHGGETNEXTHOSTMSGDATA, *PVBOXDNDCBHGGETNEXTHOSTMSGDATA;
1013
[42264]1014typedef struct VBOXDNDCBHGACKOPDATA
1015{
1016 /** Callback data header. */
[55539]1017 VBOXDNDCBHEADERDATA hdr;
1018 uint32_t uAction;
[55422]1019} VBOXDNDCBHGACKOPDATA, *PVBOXDNDCBHGACKOPDATA;
[42264]1020
1021typedef struct VBOXDNDCBHGREQDATADATA
1022{
1023 /** Callback data header. */
[55539]1024 VBOXDNDCBHEADERDATA hdr;
1025 char *pszFormat;
1026 uint32_t cbFormat;
[55422]1027} VBOXDNDCBHGREQDATADATA, *PVBOXDNDCBHGREQDATADATA;
[42264]1028
1029typedef struct VBOXDNDCBHGEVTPROGRESSDATA
1030{
1031 /** Callback data header. */
[55539]1032 VBOXDNDCBHEADERDATA hdr;
1033 uint32_t uPercentage;
1034 uint32_t uStatus;
1035 uint32_t rc;
[55422]1036} VBOXDNDCBHGEVTPROGRESSDATA, *PVBOXDNDCBHGEVTPROGRESSDATA;
[42264]1037
1038typedef struct VBOXDNDCBGHACKPENDINGDATA
1039{
1040 /** Callback data header. */
[55539]1041 VBOXDNDCBHEADERDATA hdr;
1042 uint32_t uDefAction;
1043 uint32_t uAllActions;
1044 char *pszFormat;
1045 uint32_t cbFormat;
[55422]1046} VBOXDNDCBGHACKPENDINGDATA, *PVBOXDNDCBGHACKPENDINGDATA;
[42264]1047
[58212]1048/**
1049 * Data header.
1050 * New since protocol v3.
1051 */
1052typedef struct VBOXDNDDATAHDR
1053{
1054 /** Data transfer flags. Not yet used and must be 0. */
1055 uint32_t uFlags;
1056 /** Screen ID where the data originates from. */
1057 uint32_t uScreenId;
1058 /** Total size (in bytes) to transfer. */
1059 uint64_t cbTotal;
1060 /** Meta data size (in bytes) to transfer.
1061 * This size also is part of cbTotal already. */
1062 uint32_t cbMeta;
1063 /** Meta format buffer. */
1064 void *pvMetaFmt;
1065 /** Size (in bytes) of meta format buffer. */
1066 uint32_t cbMetaFmt;
1067 /** Number of objects (files/directories) to transfer. */
1068 uint64_t cObjects;
1069 /** Compression type. Currently unused, so specify 0.
1070 **@todo Add IPRT compression type enumeration as soon as it's available. */
1071 uint32_t enmCompression;
1072 /** Checksum type. Currently unused, so specify RTDIGESTTYPE_INVALID. */
1073 RTDIGESTTYPE enmChecksumType;
1074 /** The actual checksum buffer for the entire data to be transferred,
1075 * based on enmChksumType. If RTDIGESTTYPE_INVALID is specified,
1076 * no checksum is being used and pvChecksum will be NULL. */
1077 void *pvChecksum;
1078 /** Size (in bytes) of checksum. */
1079 uint32_t cbChecksum;
1080} VBOXDNDDATAHDR, *PVBOXDNDSNDDATAHDR;
1081
1082/* New since protocol v3. */
1083typedef struct VBOXDNDCBSNDDATAHDRDATA
1084{
1085 /** Callback data header. */
1086 VBOXDNDCBHEADERDATA hdr;
1087 /** Actual header data. */
1088 VBOXDNDDATAHDR data;
1089} VBOXDNDCBSNDDATAHDRDATA, *PVBOXDNDCBSNDDATAHDRDATA;
1090
1091typedef struct VBOXDNDSNDDATA
1092{
1093 union
1094 {
1095 struct
1096 {
1097 /** Data block buffer. */
1098 void *pvData;
1099 /** Size (in bytes) of data block. */
1100 uint32_t cbData;
1101 /** Total metadata size (in bytes). This is transmitted
1102 * with every message because the size can change. */
1103 uint32_t cbTotalSize;
1104 } v1;
1105 /* Protocol v2: No changes. */
1106 struct
1107 {
1108 /** Data block buffer. */
1109 void *pvData;
1110 /** Size (in bytes) of data block. */
1111 uint32_t cbData;
1112 /** (Rolling) Checksum. Not yet implemented. */
1113 void *pvChecksum;
1114 /** Size (in bytes) of checksum. Not yet implemented. */
1115 uint32_t cbChecksum;
1116 } v3;
1117 } u;
1118} VBOXDNDSNDDATA, *PVBOXDNDSNDDATA;
1119
[42264]1120typedef struct VBOXDNDCBSNDDATADATA
1121{
1122 /** Callback data header. */
[55539]1123 VBOXDNDCBHEADERDATA hdr;
[58212]1124 /** Actual data. */
1125 VBOXDNDSNDDATA data;
[55422]1126} VBOXDNDCBSNDDATADATA, *PVBOXDNDCBSNDDATADATA;
[42264]1127
[50508]1128typedef struct VBOXDNDCBSNDDIRDATA
1129{
1130 /** Callback data header. */
[55539]1131 VBOXDNDCBHEADERDATA hdr;
[58212]1132 /** Directory path. */
[55539]1133 char *pszPath;
[58212]1134 /** Size (in bytes) of path. */
[55539]1135 uint32_t cbPath;
[58212]1136 /** Directory creation mode. */
[55539]1137 uint32_t fMode;
[55422]1138} VBOXDNDCBSNDDIRDATA, *PVBOXDNDCBSNDDIRDATA;
[50508]1139
[58212]1140/* Note: Only for protocol version 2 and up (>= VBox 5.0). */
[55422]1141typedef struct VBOXDNDCBSNDFILEHDRDATA
[50508]1142{
1143 /** Callback data header. */
[55539]1144 VBOXDNDCBHEADERDATA hdr;
[55422]1145 /** File path (name). */
[55539]1146 char *pszFilePath;
[55422]1147 /** Size (in bytes) of file path. */
[55539]1148 uint32_t cbFilePath;
[55422]1149 /** Total size (in bytes) of this file. */
[55539]1150 uint64_t cbSize;
[55422]1151 /** File (creation) mode. */
[55539]1152 uint32_t fMode;
[55422]1153 /** Additional flags. Not used at the moment. */
[55539]1154 uint32_t fFlags;
[55422]1155} VBOXDNDCBSNDFILEHDRDATA, *PVBOXDNDCBSNDFILEHDRDATA;
[50508]1156
[55422]1157typedef struct VBOXDNDCBSNDFILEDATADATA
1158{
1159 /** Callback data header. */
[55539]1160 VBOXDNDCBHEADERDATA hdr;
[55422]1161 /** Current file data chunk. */
[55539]1162 void *pvData;
[55422]1163 /** Size (in bytes) of current data chunk. */
[55539]1164 uint32_t cbData;
[55422]1165 union
1166 {
1167 struct
1168 {
1169 /** File path (name). */
[55539]1170 char *pszFilePath;
[55422]1171 /** Size (in bytes) of file path. */
[55539]1172 uint32_t cbFilePath;
[55422]1173 /** File (creation) mode. */
[55539]1174 uint32_t fMode;
[55422]1175 } v1;
[58212]1176 /* Protocol v2 + v3: Have the file attributes (name, size, mode, ...)
1177 in the VBOXDNDCBSNDFILEHDRDATA structure. */
1178 struct
1179 {
1180 /** Checksum for current file data chunk. */
1181 void *pvChecksum;
1182 /** Size (in bytes) of current data chunk. */
1183 uint32_t cbChecksum;
1184 } v3;
[55422]1185 } u;
1186} VBOXDNDCBSNDFILEDATADATA, *PVBOXDNDCBSNDFILEDATADATA;
1187
[42264]1188typedef struct VBOXDNDCBEVTERRORDATA
1189{
1190 /** Callback data header. */
[55539]1191 VBOXDNDCBHEADERDATA hdr;
1192 int32_t rc;
[55422]1193} VBOXDNDCBEVTERRORDATA, *PVBOXDNDCBEVTERRORDATA;
[42264]1194
1195} /* namespace DragAndDropSvc */
1196
[76585]1197#endif /* !VBOX_INCLUDED_HostServices_DragAndDropSvc_h */
[42264]1198
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