1 | /** @file
|
---|
2 | * Drag and Drop service - Common header for host service and guest clients.
|
---|
3 | */
|
---|
4 |
|
---|
5 | /*
|
---|
6 | * Copyright (C) 2011-2015 Oracle Corporation
|
---|
7 | *
|
---|
8 | * This file is part of VirtualBox Open Source Edition (OSE), as
|
---|
9 | * available from http://www.virtualbox.org. This file is free software;
|
---|
10 | * you can redistribute it and/or modify it under the terms of the GNU
|
---|
11 | * General Public License (GPL) as published by the Free Software
|
---|
12 | * Foundation, in version 2 as it comes in the "COPYING" file of the
|
---|
13 | * VirtualBox OSE distribution. VirtualBox OSE is distributed in the
|
---|
14 | * hope that it will be useful, but WITHOUT ANY WARRANTY of any kind.
|
---|
15 | *
|
---|
16 | * The contents of this file may alternatively be used under the terms
|
---|
17 | * of the Common Development and Distribution License Version 1.0
|
---|
18 | * (CDDL) only, as it comes in the "COPYING.CDDL" file of the
|
---|
19 | * VirtualBox OSE distribution, in which case the provisions of the
|
---|
20 | * CDDL are applicable instead of those of the GPL.
|
---|
21 | *
|
---|
22 | * You may elect to license modified versions of this file under the
|
---|
23 | * terms and conditions of either the GPL or the CDDL or both.
|
---|
24 | */
|
---|
25 |
|
---|
26 | #ifndef ___VBox_HostService_DragAndDropSvc_h
|
---|
27 | #define ___VBox_HostService_DragAndDropSvc_h
|
---|
28 |
|
---|
29 | #include <VBox/hgcmsvc.h>
|
---|
30 | #include <VBox/VMMDev.h>
|
---|
31 | #include <VBox/VBoxGuest2.h>
|
---|
32 |
|
---|
33 | /*
|
---|
34 | * The mode of operations.
|
---|
35 | */
|
---|
36 | #define VBOX_DRAG_AND_DROP_MODE_OFF 0
|
---|
37 | #define VBOX_DRAG_AND_DROP_MODE_HOST_TO_GUEST 1
|
---|
38 | #define VBOX_DRAG_AND_DROP_MODE_GUEST_TO_HOST 2
|
---|
39 | #define VBOX_DRAG_AND_DROP_MODE_BIDIRECTIONAL 3
|
---|
40 |
|
---|
41 | #define DND_IGNORE_ACTION UINT32_C(0)
|
---|
42 | #define DND_COPY_ACTION RT_BIT_32(0)
|
---|
43 | #define DND_MOVE_ACTION RT_BIT_32(1)
|
---|
44 | #define DND_LINK_ACTION RT_BIT_32(2)
|
---|
45 |
|
---|
46 | #define hasDnDCopyAction(a) ((a) & DND_COPY_ACTION)
|
---|
47 | #define hasDnDMoveAction(a) ((a) & DND_MOVE_ACTION)
|
---|
48 | #define hasDnDLinkAction(a) ((a) & DND_LINK_ACTION)
|
---|
49 |
|
---|
50 | #define isDnDIgnoreAction(a) ((a) == DND_IGNORE_ACTION)
|
---|
51 | #define isDnDCopyAction(a) ((a) == DND_COPY_ACTION)
|
---|
52 | #define isDnDMoveAction(a) ((a) == DND_MOVE_ACTION)
|
---|
53 | #define isDnDLinkAction(a) ((a) == DND_LINK_ACTION)
|
---|
54 |
|
---|
55 | /** @def VBOX_DND_FORMATS_DEFAULT
|
---|
56 | * Default drag'n drop formats.
|
---|
57 | * Note: If you add new entries here, make sure you test those
|
---|
58 | * with all supported guest OSes!
|
---|
59 | */
|
---|
60 | #define VBOX_DND_FORMATS_DEFAULT \
|
---|
61 | "text/uri-list", \
|
---|
62 | /* Text. */ \
|
---|
63 | "text/html", \
|
---|
64 | "text/plain;charset=utf-8", \
|
---|
65 | "text/plain;charset=utf-16", \
|
---|
66 | "text/plain", \
|
---|
67 | "text/richtext", \
|
---|
68 | "UTF8_STRING", \
|
---|
69 | "TEXT", \
|
---|
70 | "STRING", \
|
---|
71 | /* OpenOffice formats. */ \
|
---|
72 | /* See: https://wiki.openoffice.org/wiki/Documentation/DevGuide/OfficeDev/Common_Application_Features#OpenOffice.org_Clipboard_Data_Formats */ \
|
---|
73 | "application/x-openoffice-embed-source-xml;windows_formatname=\"Star Embed Source (XML)\"", \
|
---|
74 | "application/x-openoffice;windows_formatname=\"Bitmap\""
|
---|
75 |
|
---|
76 | namespace DragAndDropSvc {
|
---|
77 |
|
---|
78 | /******************************************************************************
|
---|
79 | * Typedefs, constants and inlines *
|
---|
80 | ******************************************************************************/
|
---|
81 |
|
---|
82 | /**
|
---|
83 | * The service functions which are callable by host.
|
---|
84 | * Note: When adding new functions to this table, make sure that the actual ID
|
---|
85 | * does *not* overlap with the eGuestFn enumeration below!
|
---|
86 | */
|
---|
87 | enum eHostFn
|
---|
88 | {
|
---|
89 | /** The host just has set a new DnD mode. */
|
---|
90 | HOST_DND_SET_MODE = 100,
|
---|
91 |
|
---|
92 | /*
|
---|
93 | * Host -> Guest messages
|
---|
94 | */
|
---|
95 |
|
---|
96 | /** The host entered the VM window for starting an actual
|
---|
97 | * DnD operation. */
|
---|
98 | HOST_DND_HG_EVT_ENTER = 200,
|
---|
99 | /** The host's DnD cursor moved within the VM window. */
|
---|
100 | HOST_DND_HG_EVT_MOVE = 201,
|
---|
101 | /** The host left the guest VM window. */
|
---|
102 | HOST_DND_HG_EVT_LEAVE = 202,
|
---|
103 | /** The host issued a "drop" event, meaning that the host is
|
---|
104 | * ready to transfer data over to the guest. */
|
---|
105 | HOST_DND_HG_EVT_DROPPED = 203,
|
---|
106 | /** The host requested to cancel the current DnD operation. */
|
---|
107 | HOST_DND_HG_EVT_CANCEL = 204,
|
---|
108 | /** Gets the actual MIME data, based on
|
---|
109 | * the format(s) specified by HOST_DND_HG_EVT_ENTER. If the guest
|
---|
110 | * supplied buffer too small to send the actual data, the host
|
---|
111 | * will send a HOST_DND_HG_SND_MORE_DATA message as follow-up. */
|
---|
112 | HOST_DND_HG_SND_DATA = 205,
|
---|
113 | /** Sent when the actual buffer for HOST_DND_HG_SND_DATA
|
---|
114 | * was too small, issued by the DnD host service. */
|
---|
115 | HOST_DND_HG_SND_MORE_DATA = 206,
|
---|
116 | /** Directory entry to be sent to the guest. */
|
---|
117 | HOST_DND_HG_SND_DIR = 207,
|
---|
118 | /** File data chunk to send to the guest. */
|
---|
119 | HOST_DND_HG_SND_FILE_DATA = 208,
|
---|
120 | /** File header to send to the guest.
|
---|
121 | * Note: Only for protocol version 2 and up (>= VBox 5.0). */
|
---|
122 | HOST_DND_HG_SND_FILE_HDR = 209,
|
---|
123 |
|
---|
124 | /*
|
---|
125 | * Guest -> Host messages
|
---|
126 | */
|
---|
127 |
|
---|
128 | /** The host asks the guest whether a DnD operation
|
---|
129 | * is in progress when the mouse leaves the guest window. */
|
---|
130 | HOST_DND_GH_REQ_PENDING = 600,
|
---|
131 | /** The host informs the guest that a DnD drop operation
|
---|
132 | * has been started and that the host wants the data in
|
---|
133 | * a specific MIME type. */
|
---|
134 | HOST_DND_GH_EVT_DROPPED = 601,
|
---|
135 | /** Creates a directory on the guest. */
|
---|
136 | HOST_DND_GH_RECV_DIR = 650,
|
---|
137 | /** Retrieves file data from the guest. */
|
---|
138 | HOST_DND_GH_RECV_FILE_DATA = 670,
|
---|
139 | /** Retrieves a file header from the guest.
|
---|
140 | * Note: Only for protocol version 2 and up (>= VBox 5.0). */
|
---|
141 | HOST_DND_GH_RECV_FILE_HDR = 671,
|
---|
142 | /** Blow the type up to 32-bit. */
|
---|
143 | HOST_DND_32BIT_HACK = 0x7fffffff
|
---|
144 | };
|
---|
145 |
|
---|
146 | /**
|
---|
147 | * The service functions which are called by guest.
|
---|
148 | * Note: When adding new functions to this table, make sure that the actual ID
|
---|
149 | * does *not* overlap with the eHostFn enumeration above!
|
---|
150 | */
|
---|
151 | enum eGuestFn
|
---|
152 | {
|
---|
153 | /* Guest sends a connection request to the HGCM service.
|
---|
154 | * Note: New since protocol version 2. */
|
---|
155 | GUEST_DND_CONNECT = 10,
|
---|
156 |
|
---|
157 | /**
|
---|
158 | * Guest waits for a new message the host wants to process
|
---|
159 | * on the guest side. This can be a blocking call.
|
---|
160 | */
|
---|
161 | GUEST_DND_GET_NEXT_HOST_MSG = 300,
|
---|
162 |
|
---|
163 | /*
|
---|
164 | * Host -> Guest operation messages.
|
---|
165 | */
|
---|
166 |
|
---|
167 | /** The guest acknowledges that the pending DnD data from
|
---|
168 | * the host can be dropped on the currently selected source
|
---|
169 | * on the guest. */
|
---|
170 | GUEST_DND_HG_ACK_OP = 400,
|
---|
171 | /** The guest requests the actual DnD data to be sent
|
---|
172 | * from the host. */
|
---|
173 | GUEST_DND_HG_REQ_DATA = 401,
|
---|
174 | /** Reports back the guest's progress on a host -> guest operation. */
|
---|
175 | GUEST_DND_HG_EVT_PROGRESS = 402,
|
---|
176 |
|
---|
177 | /*
|
---|
178 | * Guest -> Host operation messages.
|
---|
179 | */
|
---|
180 |
|
---|
181 | /**
|
---|
182 | * The guests acknowledges that it currently has a drag'n drop
|
---|
183 | * operation in progress on the guest, which eventually could be
|
---|
184 | * dragged over to the host.
|
---|
185 | */
|
---|
186 | GUEST_DND_GH_ACK_PENDING = 500,
|
---|
187 | /**
|
---|
188 | * Sends data of the requested format to the host. There can
|
---|
189 | * be more than one message if the actual data does not fit
|
---|
190 | * into one.
|
---|
191 | */
|
---|
192 | GUEST_DND_GH_SND_DATA = 501,
|
---|
193 | /** Reports an error back to the host. */
|
---|
194 | GUEST_DND_GH_EVT_ERROR = 502,
|
---|
195 | /** Guest sends a directory entry to the host. */
|
---|
196 | GUEST_DND_GH_SND_DIR = 700,
|
---|
197 | /** Guest sends file data to the host. */
|
---|
198 | /* Note: On protocol version 1 this also contains the file name
|
---|
199 | * and other attributes. */
|
---|
200 | GUEST_DND_GH_SND_FILE_DATA = 701,
|
---|
201 | /** Guest sends a file header to the host, marking the
|
---|
202 | * beginning of a (new) file transfer.
|
---|
203 | * Note: Available since protocol version 2 (VBox 5.0). */
|
---|
204 | GUEST_DND_GH_SND_FILE_HDR = 702,
|
---|
205 | /** Blow the type up to 32-bit. */
|
---|
206 | GUEST_DND_32BIT_HACK = 0x7fffffff
|
---|
207 | };
|
---|
208 |
|
---|
209 | /**
|
---|
210 | * DnD operation progress states.
|
---|
211 | */
|
---|
212 | typedef enum DNDPROGRESS
|
---|
213 | {
|
---|
214 | DND_PROGRESS_UNKNOWN = 0,
|
---|
215 | DND_PROGRESS_RUNNING = 1,
|
---|
216 | DND_PROGRESS_COMPLETE,
|
---|
217 | DND_PROGRESS_CANCELLED,
|
---|
218 | DND_PROGRESS_ERROR,
|
---|
219 | /** Blow the type up to 32-bit. */
|
---|
220 | DND_PROGRESS_32BIT_HACK = 0x7fffffff
|
---|
221 | } DNDPROGRESS, *PDNDPROGRESS;
|
---|
222 |
|
---|
223 | #pragma pack (1)
|
---|
224 |
|
---|
225 | /*
|
---|
226 | * Host events
|
---|
227 | */
|
---|
228 |
|
---|
229 | typedef struct VBOXDNDHGACTIONMSG
|
---|
230 | {
|
---|
231 | VBoxGuestHGCMCallInfo hdr;
|
---|
232 |
|
---|
233 | /**
|
---|
234 | * HG Action event.
|
---|
235 | *
|
---|
236 | * Used by:
|
---|
237 | * HOST_DND_HG_EVT_ENTER
|
---|
238 | * HOST_DND_HG_EVT_MOVE
|
---|
239 | * HOST_DND_HG_EVT_DROPPED
|
---|
240 | */
|
---|
241 | HGCMFunctionParameter uScreenId; /* OUT uint32_t */
|
---|
242 | HGCMFunctionParameter uX; /* OUT uint32_t */
|
---|
243 | HGCMFunctionParameter uY; /* OUT uint32_t */
|
---|
244 | HGCMFunctionParameter uDefAction; /* OUT uint32_t */
|
---|
245 | HGCMFunctionParameter uAllActions; /* OUT uint32_t */
|
---|
246 | HGCMFunctionParameter pvFormats; /* OUT ptr */
|
---|
247 | HGCMFunctionParameter cFormats; /* OUT uint32_t */
|
---|
248 | } VBOXDNDHGACTIONMSG;
|
---|
249 |
|
---|
250 | typedef struct VBOXDNDHGLEAVEMSG
|
---|
251 | {
|
---|
252 | VBoxGuestHGCMCallInfo hdr;
|
---|
253 | /**
|
---|
254 | * HG Leave event.
|
---|
255 | *
|
---|
256 | * Used by:
|
---|
257 | * HOST_DND_HG_EVT_LEAVE
|
---|
258 | */
|
---|
259 | } VBOXDNDHGLEAVEMSG;
|
---|
260 |
|
---|
261 | typedef struct VBOXDNDHGCANCELMSG
|
---|
262 | {
|
---|
263 | VBoxGuestHGCMCallInfo hdr;
|
---|
264 |
|
---|
265 | /**
|
---|
266 | * HG Cancel return event.
|
---|
267 | *
|
---|
268 | * Used by:
|
---|
269 | * HOST_DND_HG_EVT_CANCEL
|
---|
270 | */
|
---|
271 | } VBOXDNDHGCANCELMSG;
|
---|
272 |
|
---|
273 | typedef struct VBOXDNDHGSENDDATAMSG
|
---|
274 | {
|
---|
275 | VBoxGuestHGCMCallInfo hdr;
|
---|
276 |
|
---|
277 | /**
|
---|
278 | * HG Send Data event.
|
---|
279 | *
|
---|
280 | * Used by:
|
---|
281 | * HOST_DND_HG_SND_DATA
|
---|
282 | */
|
---|
283 | HGCMFunctionParameter uScreenId; /* OUT uint32_t */
|
---|
284 | HGCMFunctionParameter pvFormat; /* OUT ptr */
|
---|
285 | HGCMFunctionParameter cFormat; /* OUT uint32_t */
|
---|
286 | HGCMFunctionParameter pvData; /* OUT ptr */
|
---|
287 | HGCMFunctionParameter cbData; /* OUT uint32_t */
|
---|
288 | } VBOXDNDHGSENDDATAMSG;
|
---|
289 |
|
---|
290 | typedef struct VBOXDNDHGSENDMOREDATAMSG
|
---|
291 | {
|
---|
292 | VBoxGuestHGCMCallInfo hdr;
|
---|
293 |
|
---|
294 | /**
|
---|
295 | * HG Send More Data event.
|
---|
296 | *
|
---|
297 | * Used by:
|
---|
298 | * HOST_DND_HG_SND_MORE_DATA
|
---|
299 | */
|
---|
300 | HGCMFunctionParameter pvData; /* OUT ptr */
|
---|
301 | HGCMFunctionParameter cbData; /* OUT uint32_t */
|
---|
302 | } VBOXDNDHGSENDMOREDATAMSG;
|
---|
303 |
|
---|
304 | typedef struct VBOXDNDHGSENDDIRMSG
|
---|
305 | {
|
---|
306 | VBoxGuestHGCMCallInfo hdr;
|
---|
307 |
|
---|
308 | /**
|
---|
309 | * HG Directory event.
|
---|
310 | *
|
---|
311 | * Used by:
|
---|
312 | * HOST_DND_HG_SND_DIR
|
---|
313 | */
|
---|
314 | HGCMFunctionParameter pvName; /* OUT ptr */
|
---|
315 | HGCMFunctionParameter cbName; /* OUT uint32_t */
|
---|
316 | HGCMFunctionParameter fMode; /* OUT uint32_t */
|
---|
317 | } VBOXDNDHGSENDDIRMSG;
|
---|
318 |
|
---|
319 | /**
|
---|
320 | * File header event.
|
---|
321 | * Note: Only for protocol version 2 and up.
|
---|
322 | *
|
---|
323 | * Used by:
|
---|
324 | * HOST_DND_HG_SND_FILE_HDR
|
---|
325 | * HOST_DND_GH_SND_FILE_HDR
|
---|
326 | */
|
---|
327 | typedef struct VBOXDNDHGSENDFILEHDRMSG
|
---|
328 | {
|
---|
329 | VBoxGuestHGCMCallInfo hdr;
|
---|
330 |
|
---|
331 | /** Context ID. Unused at the moment. */
|
---|
332 | HGCMFunctionParameter uContext; /* OUT uint32_t */
|
---|
333 | /** File path. */
|
---|
334 | HGCMFunctionParameter pvName; /* OUT ptr */
|
---|
335 | /** Size (in bytes) of file path. */
|
---|
336 | HGCMFunctionParameter cbName; /* OUT uint32_t */
|
---|
337 | /** Optional flags; unused at the moment. */
|
---|
338 | HGCMFunctionParameter uFlags; /* OUT uint32_t */
|
---|
339 | /** File creation mode. */
|
---|
340 | HGCMFunctionParameter fMode; /* OUT uint32_t */
|
---|
341 | /** Total size (in bytes). */
|
---|
342 | HGCMFunctionParameter cbTotal; /* OUT uint64_t */
|
---|
343 |
|
---|
344 | } VBOXDNDHGSENDFILEHDRMSG;
|
---|
345 |
|
---|
346 | /**
|
---|
347 | * HG: File data (chunk) event.
|
---|
348 | *
|
---|
349 | * Used by:
|
---|
350 | * HOST_DND_HG_SND_FILE
|
---|
351 | */
|
---|
352 | typedef struct VBOXDNDHGSENDFILEDATAMSG
|
---|
353 | {
|
---|
354 | VBoxGuestHGCMCallInfo hdr;
|
---|
355 |
|
---|
356 | union
|
---|
357 | {
|
---|
358 | struct
|
---|
359 | {
|
---|
360 | HGCMFunctionParameter pvName; /* OUT ptr */
|
---|
361 | HGCMFunctionParameter cbName; /* OUT uint32_t */
|
---|
362 | HGCMFunctionParameter pvData; /* OUT ptr */
|
---|
363 | HGCMFunctionParameter cbData; /* OUT uint32_t */
|
---|
364 | HGCMFunctionParameter fMode; /* OUT uint32_t */
|
---|
365 | } v1;
|
---|
366 | struct
|
---|
367 | {
|
---|
368 | /** Note: pvName is now part of the VBOXDNDHGSENDFILEHDRMSG message. */
|
---|
369 | /** Note: cbName is now part of the VBOXDNDHGSENDFILEHDRMSG message. */
|
---|
370 | HGCMFunctionParameter uContext; /* OUT uint32_t */
|
---|
371 | HGCMFunctionParameter pvData; /* OUT ptr */
|
---|
372 | HGCMFunctionParameter cbData; /* OUT uint32_t */
|
---|
373 | /** Note: fMode is now part of the VBOXDNDHGSENDFILEHDRMSG message. */
|
---|
374 | } v2;
|
---|
375 | } u;
|
---|
376 |
|
---|
377 | } VBOXDNDHGSENDFILEDATAMSG;
|
---|
378 |
|
---|
379 | typedef struct VBOXDNDGHREQPENDINGMSG
|
---|
380 | {
|
---|
381 | VBoxGuestHGCMCallInfo hdr;
|
---|
382 |
|
---|
383 | /**
|
---|
384 | * GH Request Pending event.
|
---|
385 | *
|
---|
386 | * Used by:
|
---|
387 | * HOST_DND_GH_REQ_PENDING
|
---|
388 | */
|
---|
389 | HGCMFunctionParameter uScreenId; /* OUT uint32_t */
|
---|
390 | } VBOXDNDGHREQPENDINGMSG;
|
---|
391 |
|
---|
392 | typedef struct VBOXDNDGHDROPPEDMSG
|
---|
393 | {
|
---|
394 | VBoxGuestHGCMCallInfo hdr;
|
---|
395 |
|
---|
396 | /**
|
---|
397 | * GH Dropped event.
|
---|
398 | *
|
---|
399 | * Used by:
|
---|
400 | * HOST_DND_GH_EVT_DROPPED
|
---|
401 | */
|
---|
402 | HGCMFunctionParameter pvFormat; /* OUT ptr */
|
---|
403 | HGCMFunctionParameter cFormat; /* OUT uint32_t */
|
---|
404 | HGCMFunctionParameter uAction; /* OUT uint32_t */
|
---|
405 | } VBOXDNDGHDROPPEDMSG;
|
---|
406 |
|
---|
407 | /*
|
---|
408 | * Guest events
|
---|
409 | */
|
---|
410 |
|
---|
411 | /**
|
---|
412 | * The returned command the host wants to
|
---|
413 | * run on the guest.
|
---|
414 | *
|
---|
415 | * Used by:
|
---|
416 | * GUEST_DND_GET_NEXT_HOST_MSG
|
---|
417 | */
|
---|
418 | typedef struct VBOXDNDNEXTMSGMSG
|
---|
419 | {
|
---|
420 | VBoxGuestHGCMCallInfo hdr;
|
---|
421 |
|
---|
422 | HGCMFunctionParameter msg; /* OUT uint32_t */
|
---|
423 | /** Number of parameters the message needs. */
|
---|
424 | HGCMFunctionParameter num_parms; /* OUT uint32_t */
|
---|
425 | /** Whether or not to block (wait) for a
|
---|
426 | * new message to arrive. */
|
---|
427 | HGCMFunctionParameter block; /* OUT uint32_t */
|
---|
428 |
|
---|
429 | } VBOXDNDNEXTMSGMSG;
|
---|
430 |
|
---|
431 | /**
|
---|
432 | * Connection request. Used to tell the DnD protocol
|
---|
433 | * version to the (host) service.
|
---|
434 | *
|
---|
435 | * Used by:
|
---|
436 | * GUEST_DND_CONNECT
|
---|
437 | */
|
---|
438 | typedef struct VBOXDNDCONNECTPMSG
|
---|
439 | {
|
---|
440 | VBoxGuestHGCMCallInfo hdr;
|
---|
441 |
|
---|
442 | /** Protocol version to use. */
|
---|
443 | HGCMFunctionParameter uProtocol; /* OUT uint32_t */
|
---|
444 | /** Connection flags. Optional. */
|
---|
445 | HGCMFunctionParameter uFlags; /* OUT uint32_t */
|
---|
446 |
|
---|
447 | } VBOXDNDCONNECTPMSG;
|
---|
448 |
|
---|
449 | /**
|
---|
450 | * HG Acknowledge Operation event.
|
---|
451 | *
|
---|
452 | * Used by:
|
---|
453 | * GUEST_DND_HG_ACK_OP
|
---|
454 | */
|
---|
455 | typedef struct VBOXDNDHGACKOPMSG
|
---|
456 | {
|
---|
457 | VBoxGuestHGCMCallInfo hdr;
|
---|
458 |
|
---|
459 | HGCMFunctionParameter uAction; /* OUT uint32_t */
|
---|
460 | } VBOXDNDHGACKOPMSG;
|
---|
461 |
|
---|
462 | /**
|
---|
463 | * HG request for data event.
|
---|
464 | *
|
---|
465 | * Used by:
|
---|
466 | * GUEST_DND_HG_REQ_DATA
|
---|
467 | */
|
---|
468 | typedef struct VBOXDNDHGREQDATAMSG
|
---|
469 | {
|
---|
470 | VBoxGuestHGCMCallInfo hdr;
|
---|
471 |
|
---|
472 | HGCMFunctionParameter pFormat; /* OUT ptr */
|
---|
473 | } VBOXDNDHGREQDATAMSG;
|
---|
474 |
|
---|
475 | typedef struct VBOXDNDHGEVTPROGRESSMSG
|
---|
476 | {
|
---|
477 | VBoxGuestHGCMCallInfo hdr;
|
---|
478 |
|
---|
479 | HGCMFunctionParameter uStatus;
|
---|
480 | HGCMFunctionParameter uPercent;
|
---|
481 | HGCMFunctionParameter rc;
|
---|
482 | } VBOXDNDHGEVTPROGRESSMSG;
|
---|
483 |
|
---|
484 | /**
|
---|
485 | * GH Acknowledge Pending event.
|
---|
486 | *
|
---|
487 | * Used by:
|
---|
488 | * GUEST_DND_GH_ACK_PENDING
|
---|
489 | */
|
---|
490 | typedef struct VBOXDNDGHACKPENDINGMSG
|
---|
491 | {
|
---|
492 | VBoxGuestHGCMCallInfo hdr;
|
---|
493 |
|
---|
494 | HGCMFunctionParameter uDefAction; /* OUT uint32_t */
|
---|
495 | HGCMFunctionParameter uAllActions; /* OUT uint32_t */
|
---|
496 | HGCMFunctionParameter pFormat; /* OUT ptr */
|
---|
497 | } VBOXDNDGHACKPENDINGMSG;
|
---|
498 |
|
---|
499 | /**
|
---|
500 | * GH Send Data event.
|
---|
501 | *
|
---|
502 | * Used by:
|
---|
503 | * GUEST_DND_GH_SND_DATA
|
---|
504 | */
|
---|
505 | typedef struct VBOXDNDGHSENDDATAMSG
|
---|
506 | {
|
---|
507 | VBoxGuestHGCMCallInfo hdr;
|
---|
508 |
|
---|
509 | HGCMFunctionParameter pvData; /* OUT ptr */
|
---|
510 | /** Total bytes to send. This can be more than
|
---|
511 | * the data block specified in pvData above, e.g.
|
---|
512 | * when sending over file objects afterwards. */
|
---|
513 | HGCMFunctionParameter cbTotalBytes; /* OUT uint32_t */
|
---|
514 | } VBOXDNDGHSENDDATAMSG;
|
---|
515 |
|
---|
516 | /**
|
---|
517 | * GH Directory event.
|
---|
518 | *
|
---|
519 | * Used by:
|
---|
520 | * GUEST_DND_GH_SND_DIR
|
---|
521 | */
|
---|
522 | typedef struct VBOXDNDGHSENDDIRMSG
|
---|
523 | {
|
---|
524 | VBoxGuestHGCMCallInfo hdr;
|
---|
525 |
|
---|
526 | HGCMFunctionParameter pvName; /* OUT ptr */
|
---|
527 | HGCMFunctionParameter cbName; /* OUT uint32_t */
|
---|
528 | HGCMFunctionParameter fMode; /* OUT uint32_t */
|
---|
529 | } VBOXDNDGHSENDDIRMSG;
|
---|
530 |
|
---|
531 | /**
|
---|
532 | * GH File header event.
|
---|
533 | * Note: Only for protocol version 2 and up.
|
---|
534 | *
|
---|
535 | * Used by:
|
---|
536 | * HOST_DND_GH_SND_FILE_HDR
|
---|
537 | */
|
---|
538 | typedef struct VBOXDNDHGSENDFILEHDRMSG VBOXDNDGHSENDFILEHDRMSG;
|
---|
539 |
|
---|
540 | /**
|
---|
541 | * GH File data event.
|
---|
542 | *
|
---|
543 | * Used by:
|
---|
544 | * GUEST_DND_HG_SND_FILE_DATA
|
---|
545 | */
|
---|
546 | typedef struct VBOXDNDGHSENDFILEDATAMSG
|
---|
547 | {
|
---|
548 | VBoxGuestHGCMCallInfo hdr;
|
---|
549 |
|
---|
550 | union
|
---|
551 | {
|
---|
552 | /* Note: Protocol v1 sends the file name + file mode
|
---|
553 | * every time a file data chunk is being sent. */
|
---|
554 | struct
|
---|
555 | {
|
---|
556 | HGCMFunctionParameter pvName; /* OUT ptr */
|
---|
557 | HGCMFunctionParameter cbName; /* OUT uint32_t */
|
---|
558 | HGCMFunctionParameter fMode; /* OUT uint32_t */
|
---|
559 | HGCMFunctionParameter pvData; /* OUT ptr */
|
---|
560 | HGCMFunctionParameter cbData; /* OUT uint32_t */
|
---|
561 | } v1;
|
---|
562 | struct
|
---|
563 | {
|
---|
564 | /** Context ID. Unused at the moment. */
|
---|
565 | HGCMFunctionParameter uContext; /* OUT uint32_t */
|
---|
566 | HGCMFunctionParameter pvData; /* OUT ptr */
|
---|
567 | HGCMFunctionParameter cbData; /* OUT uint32_t */
|
---|
568 | } v2;
|
---|
569 | } u;
|
---|
570 |
|
---|
571 | } VBOXDNDGHSENDFILEDATAMSG;
|
---|
572 |
|
---|
573 | /**
|
---|
574 | * GH Error event.
|
---|
575 | *
|
---|
576 | * Used by:
|
---|
577 | * GUEST_DND_GH_EVT_ERROR
|
---|
578 | */
|
---|
579 | typedef struct VBOXDNDGHEVTERRORMSG
|
---|
580 | {
|
---|
581 | VBoxGuestHGCMCallInfo hdr;
|
---|
582 |
|
---|
583 | HGCMFunctionParameter rc; /* OUT uint32_t */
|
---|
584 | } VBOXDNDGHEVTERRORMSG;
|
---|
585 |
|
---|
586 | #pragma pack()
|
---|
587 |
|
---|
588 | /*
|
---|
589 | * Callback data magics.
|
---|
590 | */
|
---|
591 | enum
|
---|
592 | {
|
---|
593 | CB_MAGIC_DND_HG_GET_NEXT_HOST_MSG = 0x19820126,
|
---|
594 | CB_MAGIC_DND_HG_GET_NEXT_HOST_MSG_DATA = 0x19850630,
|
---|
595 | CB_MAGIC_DND_HG_ACK_OP = 0xe2100b93,
|
---|
596 | CB_MAGIC_DND_HG_REQ_DATA = 0x5cb3faf9,
|
---|
597 | CB_MAGIC_DND_HG_EVT_PROGRESS = 0x8c8a6956,
|
---|
598 | CB_MAGIC_DND_GH_ACK_PENDING = 0xbe975a14,
|
---|
599 | CB_MAGIC_DND_GH_SND_DATA = 0x4eb61bff,
|
---|
600 | CB_MAGIC_DND_GH_SND_DIR = 0x411ca754,
|
---|
601 | CB_MAGIC_DND_GH_SND_FILE_HDR = 0x65e35eaf,
|
---|
602 | CB_MAGIC_DND_GH_SND_FILE_DATA = 0x19840804,
|
---|
603 | CB_MAGIC_DND_GH_EVT_ERROR = 0x117a87c4
|
---|
604 | };
|
---|
605 |
|
---|
606 | typedef struct VBOXDNDCBHEADERDATA
|
---|
607 | {
|
---|
608 | /** Magic number to identify the structure. */
|
---|
609 | uint32_t u32Magic;
|
---|
610 | /** Context ID to identify callback data. */
|
---|
611 | uint32_t u32ContextID;
|
---|
612 | } VBOXDNDCBHEADERDATA, *PVBOXDNDCBHEADERDATA;
|
---|
613 |
|
---|
614 | typedef struct VBOXDNDCBHGGETNEXTHOSTMSG
|
---|
615 | {
|
---|
616 | /** Callback data header. */
|
---|
617 | VBOXDNDCBHEADERDATA hdr;
|
---|
618 | uint32_t uMsg;
|
---|
619 | uint32_t cParms;
|
---|
620 | } VBOXDNDCBHGGETNEXTHOSTMSG, *PVBOXDNDCBHGGETNEXTHOSTMSG;
|
---|
621 |
|
---|
622 | typedef struct VBOXDNDCBHGGETNEXTHOSTMSGDATA
|
---|
623 | {
|
---|
624 | /** Callback data header. */
|
---|
625 | VBOXDNDCBHEADERDATA hdr;
|
---|
626 | uint32_t uMsg;
|
---|
627 | uint32_t cParms;
|
---|
628 | PVBOXHGCMSVCPARM paParms;
|
---|
629 | } VBOXDNDCBHGGETNEXTHOSTMSGDATA, *PVBOXDNDCBHGGETNEXTHOSTMSGDATA;
|
---|
630 |
|
---|
631 | typedef struct VBOXDNDCBHGACKOPDATA
|
---|
632 | {
|
---|
633 | /** Callback data header. */
|
---|
634 | VBOXDNDCBHEADERDATA hdr;
|
---|
635 | uint32_t uAction;
|
---|
636 | } VBOXDNDCBHGACKOPDATA, *PVBOXDNDCBHGACKOPDATA;
|
---|
637 |
|
---|
638 | typedef struct VBOXDNDCBHGREQDATADATA
|
---|
639 | {
|
---|
640 | /** Callback data header. */
|
---|
641 | VBOXDNDCBHEADERDATA hdr;
|
---|
642 | char *pszFormat;
|
---|
643 | uint32_t cbFormat;
|
---|
644 | } VBOXDNDCBHGREQDATADATA, *PVBOXDNDCBHGREQDATADATA;
|
---|
645 |
|
---|
646 | typedef struct VBOXDNDCBHGEVTPROGRESSDATA
|
---|
647 | {
|
---|
648 | /** Callback data header. */
|
---|
649 | VBOXDNDCBHEADERDATA hdr;
|
---|
650 | uint32_t uPercentage;
|
---|
651 | uint32_t uStatus;
|
---|
652 | uint32_t rc;
|
---|
653 | } VBOXDNDCBHGEVTPROGRESSDATA, *PVBOXDNDCBHGEVTPROGRESSDATA;
|
---|
654 |
|
---|
655 | typedef struct VBOXDNDCBGHACKPENDINGDATA
|
---|
656 | {
|
---|
657 | /** Callback data header. */
|
---|
658 | VBOXDNDCBHEADERDATA hdr;
|
---|
659 | uint32_t uDefAction;
|
---|
660 | uint32_t uAllActions;
|
---|
661 | char *pszFormat;
|
---|
662 | uint32_t cbFormat;
|
---|
663 | } VBOXDNDCBGHACKPENDINGDATA, *PVBOXDNDCBGHACKPENDINGDATA;
|
---|
664 |
|
---|
665 | typedef struct VBOXDNDCBSNDDATADATA
|
---|
666 | {
|
---|
667 | /** Callback data header. */
|
---|
668 | VBOXDNDCBHEADERDATA hdr;
|
---|
669 | void *pvData;
|
---|
670 | uint32_t cbData;
|
---|
671 | /** Total metadata size (in bytes). This is transmitted
|
---|
672 | * with every message because the size can change. */
|
---|
673 | uint32_t cbTotalSize;
|
---|
674 | } VBOXDNDCBSNDDATADATA, *PVBOXDNDCBSNDDATADATA;
|
---|
675 |
|
---|
676 | typedef struct VBOXDNDCBSNDDIRDATA
|
---|
677 | {
|
---|
678 | /** Callback data header. */
|
---|
679 | VBOXDNDCBHEADERDATA hdr;
|
---|
680 | char *pszPath;
|
---|
681 | uint32_t cbPath;
|
---|
682 | uint32_t fMode;
|
---|
683 | } VBOXDNDCBSNDDIRDATA, *PVBOXDNDCBSNDDIRDATA;
|
---|
684 |
|
---|
685 | /* Note: Only for protocol version 2 and up (>= VBox 5.0). */
|
---|
686 | typedef struct VBOXDNDCBSNDFILEHDRDATA
|
---|
687 | {
|
---|
688 | /** Callback data header. */
|
---|
689 | VBOXDNDCBHEADERDATA hdr;
|
---|
690 | /** File path (name). */
|
---|
691 | char *pszFilePath;
|
---|
692 | /** Size (in bytes) of file path. */
|
---|
693 | uint32_t cbFilePath;
|
---|
694 | /** Total size (in bytes) of this file. */
|
---|
695 | uint64_t cbSize;
|
---|
696 | /** File (creation) mode. */
|
---|
697 | uint32_t fMode;
|
---|
698 | /** Additional flags. Not used at the moment. */
|
---|
699 | uint32_t fFlags;
|
---|
700 | } VBOXDNDCBSNDFILEHDRDATA, *PVBOXDNDCBSNDFILEHDRDATA;
|
---|
701 |
|
---|
702 | typedef struct VBOXDNDCBSNDFILEDATADATA
|
---|
703 | {
|
---|
704 | /** Callback data header. */
|
---|
705 | VBOXDNDCBHEADERDATA hdr;
|
---|
706 | /** Current file data chunk. */
|
---|
707 | void *pvData;
|
---|
708 | /** Size (in bytes) of current data chunk. */
|
---|
709 | uint32_t cbData;
|
---|
710 | union
|
---|
711 | {
|
---|
712 | struct
|
---|
713 | {
|
---|
714 | /** File path (name). */
|
---|
715 | char *pszFilePath;
|
---|
716 | /** Size (in bytes) of file path. */
|
---|
717 | uint32_t cbFilePath;
|
---|
718 | /** File (creation) mode. */
|
---|
719 | uint32_t fMode;
|
---|
720 | } v1;
|
---|
721 | /* Note: Protocol version 2 has the file attributes (name, size,
|
---|
722 | mode, ...) in the VBOXDNDCBSNDFILEHDRDATA structure. */
|
---|
723 | } u;
|
---|
724 | } VBOXDNDCBSNDFILEDATADATA, *PVBOXDNDCBSNDFILEDATADATA;
|
---|
725 |
|
---|
726 | typedef struct VBOXDNDCBEVTERRORDATA
|
---|
727 | {
|
---|
728 | /** Callback data header. */
|
---|
729 | VBOXDNDCBHEADERDATA hdr;
|
---|
730 | int32_t rc;
|
---|
731 | } VBOXDNDCBEVTERRORDATA, *PVBOXDNDCBEVTERRORDATA;
|
---|
732 |
|
---|
733 | } /* namespace DragAndDropSvc */
|
---|
734 |
|
---|
735 | #endif /* !___VBox_HostService_DragAndDropSvc_h */
|
---|
736 |
|
---|