1 | /** @file
|
---|
2 | * Shared Clipboard - Common header for host service and guest clients.
|
---|
3 | */
|
---|
4 |
|
---|
5 | /*
|
---|
6 | * Copyright (C) 2006-2019 Oracle Corporation
|
---|
7 | *
|
---|
8 | * This file is part of VirtualBox Open Source Edition (OSE), as
|
---|
9 | * available from http://www.alldomusa.eu.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 | /**
|
---|
27 | * Protocol handling and notes:
|
---|
28 | * All client/server components should be backwards compatible.
|
---|
29 | *
|
---|
30 | ******************************************************************************
|
---|
31 | *
|
---|
32 | * Protocol changelog:
|
---|
33 | *
|
---|
34 | * VBox < 6.1, deprecated:
|
---|
35 | * | First, initial implementation since feature was developed.
|
---|
36 | * Has no protocol handshake or support for feature exchange,
|
---|
37 | * the client's waiting message also acted as retrieving the
|
---|
38 | * parameters from the host (always and only *exactly* two
|
---|
39 | * parameters). Does not have the ability to control / handle parallel
|
---|
40 | * transfers.
|
---|
41 | *
|
---|
42 | * VBox >= 6.1:
|
---|
43 | * + Adds host/guest feature flags and context IDs for parallel,
|
---|
44 | * asynchronous transfers.
|
---|
45 | * | Keeps backwards-compatbility with by translating messages to
|
---|
46 | * the older protocol (< 6.1), to not break compatibility with older
|
---|
47 | * Guest Additions.
|
---|
48 | */
|
---|
49 |
|
---|
50 | #ifndef VBOX_INCLUDED_HostServices_VBoxClipboardSvc_h
|
---|
51 | #define VBOX_INCLUDED_HostServices_VBoxClipboardSvc_h
|
---|
52 | #ifndef RT_WITHOUT_PRAGMA_ONCE
|
---|
53 | # pragma once
|
---|
54 | #endif
|
---|
55 |
|
---|
56 | #include <VBox/VMMDevCoreTypes.h>
|
---|
57 | #include <VBox/VBoxGuestCoreTypes.h>
|
---|
58 | #include <VBox/hgcmsvc.h>
|
---|
59 |
|
---|
60 | #include <VBox/GuestHost/SharedClipboard.h>
|
---|
61 | #ifdef VBOX_WITH_SHARED_CLIPBOARD_TRANSFERS
|
---|
62 | #include <VBox/GuestHost/SharedClipboard-transfers.h>
|
---|
63 | #endif
|
---|
64 |
|
---|
65 | /*
|
---|
66 | * The Shared Clipboard modes of operation.
|
---|
67 | */
|
---|
68 | /** Shared Clipboard is disabled completely. */
|
---|
69 | #define VBOX_SHCL_MODE_OFF 0
|
---|
70 | /** Only transfers from host to the guest are possible. */
|
---|
71 | #define VBOX_SHCL_MODE_HOST_TO_GUEST 1
|
---|
72 | /** Only transfers from guest to the host are possible. */
|
---|
73 | #define VBOX_SHCL_MODE_GUEST_TO_HOST 2
|
---|
74 | /** Bidirectional transfers between guest and host are possible. */
|
---|
75 | #define VBOX_SHCL_MODE_BIDIRECTIONAL 3
|
---|
76 |
|
---|
77 | /*
|
---|
78 | * The Shared Clipboard file transfer mode (bit field).
|
---|
79 | */
|
---|
80 | /** Shared Clipboard file transfers are disabled. */
|
---|
81 | #define VBOX_SHCL_TRANSFER_MODE_DISABLED UINT32_C(0)
|
---|
82 | /** Shared Clipboard file transfers are enabled. */
|
---|
83 | #define VBOX_SHCL_TRANSFER_MODE_ENABLED RT_BIT(0)
|
---|
84 | /** Shared Clipboard file transfer mode valid mask. */
|
---|
85 | #define VBOX_SHCL_TRANSFER_MODE_VALID_MASK UINT32_C(0x1)
|
---|
86 |
|
---|
87 | /*
|
---|
88 | * The service functions which are callable by host.
|
---|
89 | */
|
---|
90 | /** Sets the current Shared Clipboard operation mode. */
|
---|
91 | #define VBOX_SHCL_HOST_FN_SET_MODE 1
|
---|
92 | /** Sets the current Shared Clipboard (file) transfers mode.
|
---|
93 | * Operates on the VBOX_SHCL_TRANSFERS_ defines.
|
---|
94 | *
|
---|
95 | * @since 6.1
|
---|
96 | */
|
---|
97 | #define VBOX_SHCL_HOST_FN_SET_TRANSFER_MODE 2
|
---|
98 | /** Run headless on the host, i.e. do not touch the host clipboard. */
|
---|
99 | #define VBOX_SHCL_HOST_FN_SET_HEADLESS 3
|
---|
100 | /** Reports cancellation of the current operation to the guest.
|
---|
101 | * @since 6.1
|
---|
102 | */
|
---|
103 | #define VBOX_SHCL_HOST_FN_CANCEL 4
|
---|
104 | /** Reports an error to the guest.
|
---|
105 | * @since 6.1
|
---|
106 | */
|
---|
107 | #define VBOX_SHCL_HOST_FN_ERROR 5
|
---|
108 | /** Reports that a new clipboard area has been registered.
|
---|
109 | * @since 6.1
|
---|
110 | */
|
---|
111 | #define VBOX_SHCL_HOST_FN_AREA_REGISTER 6
|
---|
112 | /** Reports that a clipboard area has been unregistered.
|
---|
113 | * @since 6.1
|
---|
114 | */
|
---|
115 | #define VBOX_SHCL_HOST_FN_AREA_UNREGISTER 7
|
---|
116 | /** Reports that a client (host / guest) has attached to a clipboard area.
|
---|
117 | * @since 6.1
|
---|
118 | */
|
---|
119 | #define VBOX_SHCL_HOST_FN_AREA_ATTACH 8
|
---|
120 | /** Reports that a client (host / guest) has detached from a clipboard area.
|
---|
121 | * @since 6.1
|
---|
122 | */
|
---|
123 | #define VBOX_SHCL_HOST_FN_AREA_DETACH 9
|
---|
124 |
|
---|
125 | /**
|
---|
126 | * The host messages for the guest.
|
---|
127 | */
|
---|
128 | /** Asks the client to quit / terminate. */
|
---|
129 | #define VBOX_SHCL_HOST_MSG_QUIT 1
|
---|
130 | /** Reads (simple) data from the guest. */
|
---|
131 | #define VBOX_SHCL_HOST_MSG_READ_DATA 2
|
---|
132 | /** Reports available clipboard format from host to the guest.
|
---|
133 | * Formerly known as VBOX_SHCL_HOST_MSG_REPORT_FORMATS. */
|
---|
134 | #define VBOX_SHCL_HOST_MSG_FORMATS_REPORT 3
|
---|
135 |
|
---|
136 | /** Sends a transfer status to the guest side.
|
---|
137 | *
|
---|
138 | * @retval VINF_SUCCESS on success.
|
---|
139 | * @retval VERR_INVALID_CLIENT_ID
|
---|
140 | * @retval VERR_WRONG_PARAMETER_COUNT
|
---|
141 | * @retval VERR_WRONG_PARAMETER_TYPE
|
---|
142 | * @since 6.1
|
---|
143 | */
|
---|
144 | #define VBOX_SHCL_HOST_MSG_TRANSFER_STATUS 50
|
---|
145 | /** Reads the root list header from the guest.
|
---|
146 | *
|
---|
147 | * @retval VINF_SUCCESS on success.
|
---|
148 | * @retval VERR_INVALID_CLIENT_ID
|
---|
149 | * @retval VERR_WRONG_PARAMETER_COUNT
|
---|
150 | * @retval VERR_WRONG_PARAMETER_TYPE
|
---|
151 | * @since 6.1
|
---|
152 | */
|
---|
153 | #define VBOX_SHCL_HOST_MSG_TRANSFER_ROOT_LIST_HDR_READ 51
|
---|
154 | /** Writes the root list header to the guest.
|
---|
155 | *
|
---|
156 | * @retval VINF_SUCCESS on success.
|
---|
157 | * @retval VERR_INVALID_CLIENT_ID
|
---|
158 | * @retval VERR_WRONG_PARAMETER_COUNT
|
---|
159 | * @retval VERR_WRONG_PARAMETER_TYPE
|
---|
160 | * @since 6.1
|
---|
161 | */
|
---|
162 | #define VBOX_SHCL_HOST_MSG_TRANSFER_ROOT_LIST_HDR_WRITE 52
|
---|
163 | /** Reads a root list entry from the guest.
|
---|
164 | *
|
---|
165 | * @retval VINF_SUCCESS on success.
|
---|
166 | * @retval VERR_INVALID_CLIENT_ID
|
---|
167 | * @retval VERR_WRONG_PARAMETER_COUNT
|
---|
168 | * @retval VERR_WRONG_PARAMETER_TYPE
|
---|
169 | * @since 6.1
|
---|
170 | */
|
---|
171 | #define VBOX_SHCL_HOST_MSG_TRANSFER_ROOT_LIST_ENTRY_READ 53
|
---|
172 | /** Writes a root list entry to the guest.
|
---|
173 | *
|
---|
174 | * @retval VINF_SUCCESS on success.
|
---|
175 | * @retval VERR_INVALID_CLIENT_ID
|
---|
176 | * @retval VERR_WRONG_PARAMETER_COUNT
|
---|
177 | * @retval VERR_WRONG_PARAMETER_TYPE
|
---|
178 | * @since 6.1
|
---|
179 | */
|
---|
180 | #define VBOX_SHCL_HOST_MSG_TRANSFER_ROOT_LIST_ENTRY_WRITE 54
|
---|
181 | /** Open a transfer list on the guest side.
|
---|
182 | *
|
---|
183 | * @retval VINF_SUCCESS on success.
|
---|
184 | * @retval VERR_INVALID_CLIENT_ID
|
---|
185 | * @retval VERR_WRONG_PARAMETER_COUNT
|
---|
186 | * @retval VERR_WRONG_PARAMETER_TYPE
|
---|
187 | * @since 6.1
|
---|
188 | */
|
---|
189 | #define VBOX_SHCL_HOST_MSG_TRANSFER_LIST_OPEN 55
|
---|
190 | /** Closes a formerly opened transfer list on the guest side.
|
---|
191 | *
|
---|
192 | * @retval VINF_SUCCESS on success.
|
---|
193 | * @retval VERR_INVALID_CLIENT_ID
|
---|
194 | * @retval VERR_WRONG_PARAMETER_COUNT
|
---|
195 | * @retval VERR_WRONG_PARAMETER_TYPE
|
---|
196 | * @since 6.1
|
---|
197 | */
|
---|
198 | #define VBOX_SHCL_HOST_MSG_TRANSFER_LIST_CLOSE 56
|
---|
199 | /** Reads a list header from the guest.
|
---|
200 | *
|
---|
201 | * @retval VINF_SUCCESS on success.
|
---|
202 | * @retval VERR_INVALID_CLIENT_ID
|
---|
203 | * @retval VERR_WRONG_PARAMETER_COUNT
|
---|
204 | * @retval VERR_WRONG_PARAMETER_TYPE
|
---|
205 | * @since 6.1
|
---|
206 | */
|
---|
207 | #define VBOX_SHCL_HOST_MSG_TRANSFER_LIST_HDR_READ 57
|
---|
208 | /** Writes a list header to the guest.
|
---|
209 | *
|
---|
210 | * @retval VINF_SUCCESS on success.
|
---|
211 | * @retval VERR_INVALID_CLIENT_ID
|
---|
212 | * @retval VERR_WRONG_PARAMETER_COUNT
|
---|
213 | * @retval VERR_WRONG_PARAMETER_TYPE
|
---|
214 | * @since 6.1
|
---|
215 | */
|
---|
216 | #define VBOX_SHCL_HOST_MSG_TRANSFER_LIST_HDR_WRITE 58
|
---|
217 | /** Reads a list entry from the guest.
|
---|
218 | *
|
---|
219 | * @retval VINF_SUCCESS on success.
|
---|
220 | * @retval VERR_INVALID_CLIENT_ID
|
---|
221 | * @retval VERR_WRONG_PARAMETER_COUNT
|
---|
222 | * @retval VERR_WRONG_PARAMETER_TYPE
|
---|
223 | * @since 6.1
|
---|
224 | */
|
---|
225 | #define VBOX_SHCL_HOST_MSG_TRANSFER_LIST_ENTRY_READ 59
|
---|
226 | /** Writes a list entry to the guest.
|
---|
227 | *
|
---|
228 | * @retval VINF_SUCCESS on success.
|
---|
229 | * @retval VERR_INVALID_CLIENT_ID
|
---|
230 | * @retval VERR_WRONG_PARAMETER_COUNT
|
---|
231 | * @retval VERR_WRONG_PARAMETER_TYPE
|
---|
232 | * @since 6.1
|
---|
233 | */
|
---|
234 | #define VBOX_SHCL_HOST_MSG_TRANSFER_LIST_ENTRY_WRITE 60
|
---|
235 | /** Open a transfer object on the guest side.
|
---|
236 | *
|
---|
237 | * @retval VINF_SUCCESS on success.
|
---|
238 | * @retval VERR_INVALID_CLIENT_ID
|
---|
239 | * @retval VERR_WRONG_PARAMETER_COUNT
|
---|
240 | * @retval VERR_WRONG_PARAMETER_TYPE
|
---|
241 | * @since 6.1
|
---|
242 | */
|
---|
243 | #define VBOX_SHCL_HOST_MSG_TRANSFER_OBJ_OPEN 61
|
---|
244 | /** Closes a formerly opened transfer object on the guest side.
|
---|
245 | *
|
---|
246 | * @retval VINF_SUCCESS on success.
|
---|
247 | * @retval VERR_INVALID_CLIENT_ID
|
---|
248 | * @retval VERR_WRONG_PARAMETER_COUNT
|
---|
249 | * @retval VERR_WRONG_PARAMETER_TYPE
|
---|
250 | * @since 6.1
|
---|
251 | */
|
---|
252 | #define VBOX_SHCL_HOST_MSG_TRANSFER_OBJ_CLOSE 62
|
---|
253 | /** Reads from an object on the guest side.
|
---|
254 | *
|
---|
255 | * @retval VINF_SUCCESS on success.
|
---|
256 | * @retval VERR_INVALID_CLIENT_ID
|
---|
257 | * @retval VERR_WRONG_PARAMETER_COUNT
|
---|
258 | * @retval VERR_WRONG_PARAMETER_TYPE
|
---|
259 | * @since 6.1
|
---|
260 | */
|
---|
261 | #define VBOX_SHCL_HOST_MSG_TRANSFER_OBJ_READ 63
|
---|
262 | /** Writes to an object on the guest side.
|
---|
263 | *
|
---|
264 | * @retval VINF_SUCCESS on success.
|
---|
265 | * @retval VERR_INVALID_CLIENT_ID
|
---|
266 | * @retval VERR_WRONG_PARAMETER_COUNT
|
---|
267 | * @retval VERR_WRONG_PARAMETER_TYPE
|
---|
268 | * @since 6.1
|
---|
269 | */
|
---|
270 | #define VBOX_SHCL_HOST_MSG_TRANSFER_OBJ_WRITE 64
|
---|
271 | /** Indicates that the host has canceled a transfer.
|
---|
272 | *
|
---|
273 | * @retval VINF_SUCCESS on success.
|
---|
274 | * @retval VERR_INVALID_CLIENT_ID
|
---|
275 | * @retval VERR_WRONG_PARAMETER_COUNT
|
---|
276 | * @retval VERR_WRONG_PARAMETER_TYPE
|
---|
277 | * @since 6.1
|
---|
278 | */
|
---|
279 | #define VBOX_SHCL_HOST_MSG_TRANSFER_CANCEL 65
|
---|
280 | /** Indicates that the an unrecoverable error on the host occurred.
|
---|
281 | *
|
---|
282 | * @retval VINF_SUCCESS on success.
|
---|
283 | * @retval VERR_INVALID_CLIENT_ID
|
---|
284 | * @retval VERR_WRONG_PARAMETER_COUNT
|
---|
285 | * @retval VERR_WRONG_PARAMETER_TYPE
|
---|
286 | * @since 6.1
|
---|
287 | */
|
---|
288 | #define VBOX_SHCL_HOST_MSG_TRANSFER_ERROR 66
|
---|
289 |
|
---|
290 | /*
|
---|
291 | * The service functions which are called by guest.
|
---|
292 | */
|
---|
293 | /** Calls the host and waits (blocking) for an host event VBOX_SHCL_HOST_MSG_*.
|
---|
294 | * Deprecated, do not use anymore. Kept to not break compatibility with older
|
---|
295 | * Guest Additions / VBox versions. */
|
---|
296 | #define VBOX_SHCL_GUEST_FN_GET_HOST_MSG_OLD 1
|
---|
297 | /** Sends a list of available formats to the host.
|
---|
298 | * Formely known as VBOX_SHCL_GUEST_FN_REPORT_FORMATS. */
|
---|
299 | #define VBOX_SHCL_GUEST_FN_FORMATS_REPORT 2
|
---|
300 | /** Reads data in specified format from the host.
|
---|
301 | *
|
---|
302 | * @retval VINF_SUCCESS on success.
|
---|
303 | * @retval For VBox >= 6.1: VINF_BUFFER_OVERLFLOW if not enough buffer space has been given to retrieve the actual data.
|
---|
304 | * The call then must be repeated with a buffer size returned from the host in cbData.
|
---|
305 | * @retval VERR_INVALID_CLIENT_ID
|
---|
306 | * @retval VERR_WRONG_PARAMETER_COUNT
|
---|
307 | * @retval VERR_WRONG_PARAMETER_TYPE
|
---|
308 | */
|
---|
309 | #define VBOX_SHCL_GUEST_FN_DATA_READ 3
|
---|
310 | /** Writes data in requested format to the host. */
|
---|
311 | #define VBOX_SHCL_GUEST_FN_DATA_WRITE 4
|
---|
312 |
|
---|
313 | /** Does the actual protocol handshake. If this message is not
|
---|
314 | * being sent by the guest, the host handles that particular client
|
---|
315 | * with the legacy protocol (v0).
|
---|
316 | *
|
---|
317 | * @retval VINF_SUCCESS on success.
|
---|
318 | * @retval VERR_INVALID_CLIENT_ID
|
---|
319 | * @retval VERR_WRONG_PARAMETER_COUNT
|
---|
320 | * @retval VERR_WRONG_PARAMETER_TYPE
|
---|
321 | * @since 6.1
|
---|
322 | */
|
---|
323 | #define VBOX_SHCL_GUEST_FN_CONNECT 5
|
---|
324 | /** Report guest side feature flags and retrieve the host ones.
|
---|
325 | *
|
---|
326 | * The guest replies to the host what features it support in addition.
|
---|
327 | * In return the host will return features the host supports.
|
---|
328 | *
|
---|
329 | * Two 64-bit parameters are passed in from the
|
---|
330 | * guest with the guest features (VBOX_SHCL_GF_XXX), the host replies by
|
---|
331 | * replacing the parameter values with the host ones (VBOX_SHCL_HF_XXX).
|
---|
332 | *
|
---|
333 | * @retval VINF_SUCCESS on success.
|
---|
334 | * @retval VERR_INVALID_CLIENT_ID
|
---|
335 | * @retval VERR_WRONG_PARAMETER_COUNT
|
---|
336 | * @retval VERR_WRONG_PARAMETER_TYPE
|
---|
337 | * @since 6.1
|
---|
338 | */
|
---|
339 | #define VBOX_SHCL_GUEST_FN_REPORT_FEATURES 6
|
---|
340 | /** Query the host ones feature masks.
|
---|
341 | *
|
---|
342 | * That way the guest (client) can get hold of the features
|
---|
343 | * from the host. Again, it is prudent to set the 127 bit and observe it being
|
---|
344 | * cleared on success, as older hosts might return success without doing
|
---|
345 | * anything.
|
---|
346 | *
|
---|
347 | * @retval VINF_SUCCESS on success.
|
---|
348 | * @retval VERR_INVALID_CLIENT_ID
|
---|
349 | * @retval VERR_WRONG_PARAMETER_COUNT
|
---|
350 | * @retval VERR_WRONG_PARAMETER_TYPE
|
---|
351 | * @since 6.1
|
---|
352 | */
|
---|
353 | #define VBOX_SHCL_GUEST_FN_QUERY_FEATURES 7
|
---|
354 | /** Peeks at the next message, returning immediately.
|
---|
355 | *
|
---|
356 | * @retval VINF_SUCCESS on success.
|
---|
357 | * @retval VERR_INVALID_CLIENT_ID
|
---|
358 | * @retval VERR_WRONG_PARAMETER_COUNT
|
---|
359 | * @retval VERR_WRONG_PARAMETER_TYPE
|
---|
360 | * @since 6.1
|
---|
361 | */
|
---|
362 | #define VBOX_SHCL_GUEST_FN_MSG_PEEK_NOWAIT 8
|
---|
363 | /** Peeks at the next message, waiting for one to arrive.
|
---|
364 | *
|
---|
365 | * @retval VINF_SUCCESS on success.
|
---|
366 | * @retval VERR_INVALID_CLIENT_ID
|
---|
367 | * @retval VERR_WRONG_PARAMETER_COUNT
|
---|
368 | * @retval VERR_WRONG_PARAMETER_TYPE
|
---|
369 | * @since 6.1
|
---|
370 | */
|
---|
371 | #define VBOX_SHCL_GUEST_FN_MSG_PEEK_WAIT 9
|
---|
372 | /** Gets the next message, returning immediately.
|
---|
373 | *
|
---|
374 | * @retval VINF_SUCCESS on success.
|
---|
375 | * @retval VERR_INVALID_CLIENT_ID
|
---|
376 | * @retval VERR_WRONG_PARAMETER_COUNT
|
---|
377 | * @retval VERR_WRONG_PARAMETER_TYPE
|
---|
378 | * @since 6.1
|
---|
379 | */
|
---|
380 | #define VBOX_SHCL_GUEST_FN_MSG_GET 10
|
---|
381 | /** Replies to a function from the host.
|
---|
382 | *
|
---|
383 | * @retval VINF_SUCCESS on success.
|
---|
384 | * @retval VERR_INVALID_CLIENT_ID
|
---|
385 | * @retval VERR_WRONG_PARAMETER_COUNT
|
---|
386 | * @retval VERR_WRONG_PARAMETER_TYPE
|
---|
387 | * @since 6.1
|
---|
388 | */
|
---|
389 | #define VBOX_SHCL_GUEST_FN_REPLY 11
|
---|
390 | /** Gets the root list header from the host.
|
---|
391 | *
|
---|
392 | * @retval VINF_SUCCESS on success.
|
---|
393 | * @retval VERR_INVALID_CLIENT_ID
|
---|
394 | * @retval VERR_WRONG_PARAMETER_COUNT
|
---|
395 | * @retval VERR_WRONG_PARAMETER_TYPE
|
---|
396 | * @since 6.1
|
---|
397 | */
|
---|
398 | #define VBOX_SHCL_GUEST_FN_ROOT_LIST_HDR_READ 12
|
---|
399 | /** Sends the root list header to the host.
|
---|
400 | *
|
---|
401 | * @retval VINF_SUCCESS on success.
|
---|
402 | * @retval VERR_INVALID_CLIENT_ID
|
---|
403 | * @retval VERR_WRONG_PARAMETER_COUNT
|
---|
404 | * @retval VERR_WRONG_PARAMETER_TYPE
|
---|
405 | * @since 6.1
|
---|
406 | */
|
---|
407 | #define VBOX_SHCL_GUEST_FN_ROOT_LIST_HDR_WRITE 13
|
---|
408 | /** Gets a root list root entry from the host.
|
---|
409 | *
|
---|
410 | * @retval VINF_SUCCESS on success.
|
---|
411 | * @retval VERR_INVALID_CLIENT_ID
|
---|
412 | * @retval VERR_WRONG_PARAMETER_COUNT
|
---|
413 | * @retval VERR_WRONG_PARAMETER_TYPE
|
---|
414 | * @since 6.1
|
---|
415 | */
|
---|
416 | #define VBOX_SHCL_GUEST_FN_ROOT_LIST_ENTRY_READ 14
|
---|
417 | /** Sends a root list root entry to the host.
|
---|
418 | *
|
---|
419 | * @retval VINF_SUCCESS on success.
|
---|
420 | * @retval VERR_INVALID_CLIENT_ID
|
---|
421 | * @retval VERR_WRONG_PARAMETER_COUNT
|
---|
422 | * @retval VERR_WRONG_PARAMETER_TYPE
|
---|
423 | * @since 6.1
|
---|
424 | */
|
---|
425 | #define VBOX_SHCL_GUEST_FN_ROOT_LIST_ENTRY_WRITE 15
|
---|
426 | /** Opens / gets a list handle from the host.
|
---|
427 | *
|
---|
428 | * @retval VINF_SUCCESS on success.
|
---|
429 | * @retval VERR_INVALID_CLIENT_ID
|
---|
430 | * @retval VERR_WRONG_PARAMETER_COUNT
|
---|
431 | * @retval VERR_WRONG_PARAMETER_TYPE
|
---|
432 | * @since 6.1
|
---|
433 | */
|
---|
434 | #define VBOX_SHCL_GUEST_FN_LIST_OPEN 16
|
---|
435 | /** Closes a list handle from the host.
|
---|
436 | *
|
---|
437 | * @retval VINF_SUCCESS on success.
|
---|
438 | * @retval VERR_INVALID_CLIENT_ID
|
---|
439 | * @retval VERR_WRONG_PARAMETER_COUNT
|
---|
440 | * @retval VERR_WRONG_PARAMETER_TYPE
|
---|
441 | * @since 6.1
|
---|
442 | */
|
---|
443 | #define VBOX_SHCL_GUEST_FN_LIST_CLOSE 17
|
---|
444 | /** Reads a list header from the host.
|
---|
445 | *
|
---|
446 | * @retval VINF_SUCCESS on success.
|
---|
447 | * @retval VERR_INVALID_CLIENT_ID
|
---|
448 | * @retval VERR_WRONG_PARAMETER_COUNT
|
---|
449 | * @retval VERR_WRONG_PARAMETER_TYPE
|
---|
450 | * @since 6.1
|
---|
451 | */
|
---|
452 | #define VBOX_SHCL_GUEST_FN_LIST_HDR_READ 18
|
---|
453 | /** Writes a list header to the host.
|
---|
454 | *
|
---|
455 | * @retval VINF_SUCCESS on success.
|
---|
456 | * @retval VERR_INVALID_CLIENT_ID
|
---|
457 | * @retval VERR_WRONG_PARAMETER_COUNT
|
---|
458 | * @retval VERR_WRONG_PARAMETER_TYPE
|
---|
459 | * @since 6.1
|
---|
460 | */
|
---|
461 | #define VBOX_SHCL_GUEST_FN_LIST_HDR_WRITE 19
|
---|
462 | /** Reads a list entry from the host.
|
---|
463 | *
|
---|
464 | * @retval VINF_SUCCESS on success.
|
---|
465 | * @retval VERR_INVALID_CLIENT_ID
|
---|
466 | * @retval VERR_WRONG_PARAMETER_COUNT
|
---|
467 | * @retval VERR_WRONG_PARAMETER_TYPE
|
---|
468 | * @since 6.1
|
---|
469 | */
|
---|
470 | #define VBOX_SHCL_GUEST_FN_LIST_ENTRY_READ 20
|
---|
471 | /** Sends a list entry to the host.
|
---|
472 | *
|
---|
473 | * @retval VINF_SUCCESS on success.
|
---|
474 | * @retval VERR_INVALID_CLIENT_ID
|
---|
475 | * @retval VERR_WRONG_PARAMETER_COUNT
|
---|
476 | * @retval VERR_WRONG_PARAMETER_TYPE
|
---|
477 | * @since 6.1
|
---|
478 | */
|
---|
479 | #define VBOX_SHCL_GUEST_FN_LIST_ENTRY_WRITE 21
|
---|
480 | /** Opens an object on the host.
|
---|
481 | *
|
---|
482 | * @retval VINF_SUCCESS on success.
|
---|
483 | * @retval VERR_INVALID_CLIENT_ID
|
---|
484 | * @retval VERR_WRONG_PARAMETER_COUNT
|
---|
485 | * @retval VERR_WRONG_PARAMETER_TYPE
|
---|
486 | * @since 6.1
|
---|
487 | */
|
---|
488 | #define VBOX_SHCL_GUEST_FN_OBJ_OPEN 22
|
---|
489 | /** Closes an object on the host.
|
---|
490 | *
|
---|
491 | * @retval VINF_SUCCESS on success.
|
---|
492 | * @retval VERR_INVALID_CLIENT_ID
|
---|
493 | * @retval VERR_WRONG_PARAMETER_COUNT
|
---|
494 | * @retval VERR_WRONG_PARAMETER_TYPE
|
---|
495 | * @since 6.1
|
---|
496 | */
|
---|
497 | #define VBOX_SHCL_GUEST_FN_OBJ_CLOSE 23
|
---|
498 | /** Reads from an object on the host.
|
---|
499 | *
|
---|
500 | * @retval VINF_SUCCESS on success.
|
---|
501 | * @retval VERR_INVALID_CLIENT_ID
|
---|
502 | * @retval VERR_WRONG_PARAMETER_COUNT
|
---|
503 | * @retval VERR_WRONG_PARAMETER_TYPE
|
---|
504 | * @since 6.1
|
---|
505 | */
|
---|
506 | #define VBOX_SHCL_GUEST_FN_OBJ_READ 24
|
---|
507 | /** Writes to an object on the host.
|
---|
508 | *
|
---|
509 | * @retval VINF_SUCCESS on success.
|
---|
510 | * @retval VERR_INVALID_CLIENT_ID
|
---|
511 | * @retval VERR_WRONG_PARAMETER_COUNT
|
---|
512 | * @retval VERR_WRONG_PARAMETER_TYPE
|
---|
513 | * @since 6.1
|
---|
514 | */
|
---|
515 | #define VBOX_SHCL_GUEST_FN_OBJ_WRITE 25
|
---|
516 | /** Reports cancellation of the current operation to the host.
|
---|
517 | *
|
---|
518 | * @retval VINF_SUCCESS on success.
|
---|
519 | * @retval VERR_INVALID_CLIENT_ID
|
---|
520 | * @retval VERR_WRONG_PARAMETER_COUNT
|
---|
521 | * @retval VERR_WRONG_PARAMETER_TYPE
|
---|
522 | * @since 6.1
|
---|
523 | */
|
---|
524 | #define VBOX_SHCL_GUEST_FN_CANCEL 26
|
---|
525 | /** Reports an error to the host.
|
---|
526 | *
|
---|
527 | * @retval VINF_SUCCESS on success.
|
---|
528 | * @retval VERR_INVALID_CLIENT_ID
|
---|
529 | * @retval VERR_WRONG_PARAMETER_COUNT
|
---|
530 | * @retval VERR_WRONG_PARAMETER_TYPE
|
---|
531 | * @since 6.1
|
---|
532 | */
|
---|
533 | #define VBOX_SHCL_GUEST_FN_ERROR 27
|
---|
534 |
|
---|
535 | /** The maximum default chunk size for a single data transfer. */
|
---|
536 | #define VBOX_SHCL_MAX_CHUNK_SIZE _64K
|
---|
537 |
|
---|
538 | /** @name VBOX_SHCL_GF_XXX - Guest features.
|
---|
539 | * @sa VBOX_SHCL_GUEST_FN_REPORT_FEATURES
|
---|
540 | * @{ */
|
---|
541 | /** No flags set. */
|
---|
542 | #define VBOX_SHCL_GF_NONE 0
|
---|
543 | /** Guest can handle context IDs (uint64_t, in paParam[0]).
|
---|
544 | * This is true for Guest Additions < 6.1. */
|
---|
545 | #define VBOX_SHCL_GF_0_CONTEXT_ID RT_BIT_64(0)
|
---|
546 | /** Bit that must be set in the 2nd parameter, will be cleared if the host reponds
|
---|
547 | * correctly (old hosts might not). */
|
---|
548 | #define VBOX_SHCL_GF_1_MUST_BE_ONE RT_BIT_64(63)
|
---|
549 | /** @} */
|
---|
550 |
|
---|
551 | /** @name VBOX_GUESTCTRL_HF_XXX - Host features.
|
---|
552 | * @sa VBOX_SHCL_GUEST_FN_REPORT_FEATURES
|
---|
553 | * @{ */
|
---|
554 | /** No flags set. */
|
---|
555 | #define VBOX_SHCL_HF_NONE 0
|
---|
556 | /** @} */
|
---|
557 |
|
---|
558 | /*
|
---|
559 | * HGCM parameter structures.
|
---|
560 | */
|
---|
561 | #pragma pack(1)
|
---|
562 | /**
|
---|
563 | * Waits (blocking) for a new host message to arrive.
|
---|
564 | * Deprecated; do not use anymore.
|
---|
565 | * Kept for maintaining compatibility with older Guest Additions.
|
---|
566 | */
|
---|
567 | typedef struct _VBoxShClGetHostMsgOld
|
---|
568 | {
|
---|
569 | VBGLIOCHGCMCALL hdr;
|
---|
570 |
|
---|
571 | /** uint32_t, out: Host message type. */
|
---|
572 | HGCMFunctionParameter msg;
|
---|
573 | /** uint32_t, out: VBOX_SHCL_FMT_*, depends on the 'msg'.
|
---|
574 | * r=andy This actual can have *different* meanings, depending on the host message type. */
|
---|
575 | HGCMFunctionParameter formats; /* OUT uint32_t */
|
---|
576 | } VBoxShClGetHostMsgOld;
|
---|
577 |
|
---|
578 | #define VBOX_SHCL_CPARMS_GET_HOST_MSG_OLD 2
|
---|
579 |
|
---|
580 | /**
|
---|
581 | * Message for doing the protocol negotiation between the host
|
---|
582 | * and the guest. Not available on older (VBox <= 6.0) hosts.
|
---|
583 | *
|
---|
584 | * This message acts as a beacon between the old protocol (VBox <= 6.0) and
|
---|
585 | * the new protocol (>= VBox 6.1). Newer features are getting introduced soley via
|
---|
586 | * the guest / host feature flags then.
|
---|
587 | */
|
---|
588 | typedef struct _VBoxShClConnect
|
---|
589 | {
|
---|
590 | VBGLIOCHGCMCALL hdr;
|
---|
591 |
|
---|
592 | /** uint32_t, out: Maximum chunk size for data transfers. */
|
---|
593 | HGCMFunctionParameter cbChunkSize;
|
---|
594 | /** uint32_t, in/out: Compression type. Currently unused. */
|
---|
595 | HGCMFunctionParameter enmCompression;
|
---|
596 | /** uint32_t, in/out: Checksum type used for data transfer. Currently unused. */
|
---|
597 | HGCMFunctionParameter enmChecksumType;
|
---|
598 | } VBoxShClConnect;
|
---|
599 |
|
---|
600 | #define VBOX_SHCL_CPARMS_CONNECT 3
|
---|
601 |
|
---|
602 | /**
|
---|
603 | * Reports available formats.
|
---|
604 | */
|
---|
605 | typedef struct _VBoxShClFormatsMsg
|
---|
606 | {
|
---|
607 | VBGLIOCHGCMCALL hdr;
|
---|
608 |
|
---|
609 | union
|
---|
610 | {
|
---|
611 | struct
|
---|
612 | {
|
---|
613 | /** uint32_t, out: VBOX_SHCL_FMT_*. */
|
---|
614 | HGCMFunctionParameter uFormats;
|
---|
615 | } v0;
|
---|
616 |
|
---|
617 | struct
|
---|
618 | {
|
---|
619 | /** uint64_t, out: Context ID. */
|
---|
620 | HGCMFunctionParameter uContext;
|
---|
621 | /** uint32_t, out: VBOX_SHCL_FMT_*. */
|
---|
622 | HGCMFunctionParameter uFormats;
|
---|
623 | /** uint32_t, out: Format flags. */
|
---|
624 | HGCMFunctionParameter fFlags;
|
---|
625 | } v1;
|
---|
626 | } u;
|
---|
627 | } VBoxShClFormatsMsg;
|
---|
628 |
|
---|
629 | /**
|
---|
630 | * Requests to read clipboard data.
|
---|
631 | */
|
---|
632 | typedef struct _VBoxShClReadDataReqMsg
|
---|
633 | {
|
---|
634 | VBGLIOCHGCMCALL hdr;
|
---|
635 |
|
---|
636 | /** uint64_t, out: Context ID. */
|
---|
637 | HGCMFunctionParameter uContext;
|
---|
638 | /** uint32_t, out: Request flags; currently unused and must be set to 0. */
|
---|
639 | HGCMFunctionParameter fFlags;
|
---|
640 | /** uint32_t, out: Requested format to read data in. */
|
---|
641 | HGCMFunctionParameter uFormat;
|
---|
642 | /** uint32_t, out: Maximum size (in bytes) to read. */
|
---|
643 | HGCMFunctionParameter cbSize;
|
---|
644 | } VBoxShClReadDataReqMsg;
|
---|
645 |
|
---|
646 | #define VBOX_SHCL_CPARMS_READ_DATA_REQ 4
|
---|
647 |
|
---|
648 | /**
|
---|
649 | * Reads clipboard data.
|
---|
650 | */
|
---|
651 | typedef struct _VBoxShClReadDataMsg
|
---|
652 | {
|
---|
653 | VBGLIOCHGCMCALL hdr;
|
---|
654 |
|
---|
655 | union
|
---|
656 | {
|
---|
657 | struct
|
---|
658 | {
|
---|
659 | /** uint32_t, out: Requested format. */
|
---|
660 | HGCMFunctionParameter format; /* IN uint32_t */
|
---|
661 | /** ptr, out: The data buffer. */
|
---|
662 | HGCMFunctionParameter ptr; /* IN linear pointer. */
|
---|
663 | /** uint32_t, out: Size of returned data, if > ptr->cb, then no data was
|
---|
664 | * actually transferred and the guest must repeat the call.
|
---|
665 | */
|
---|
666 | HGCMFunctionParameter size; /* OUT uint32_t */
|
---|
667 | } v0;
|
---|
668 | struct
|
---|
669 | {
|
---|
670 | /** uint64_t, out: Context ID. */
|
---|
671 | HGCMFunctionParameter uContext;
|
---|
672 | /** uint32_t, out: Read flags; currently unused and must be set to 0. */
|
---|
673 | HGCMFunctionParameter fFlags;
|
---|
674 | /** uint32_t, out: Requested format. */
|
---|
675 | HGCMFunctionParameter uFormat;
|
---|
676 | /** uint32_t, in/out:
|
---|
677 | * On input: How much data to read max.
|
---|
678 | * On output: Size of returned data, if > ptr->cb, then no data was
|
---|
679 | * actually transferred and the guest must repeat the call.
|
---|
680 | */
|
---|
681 | HGCMFunctionParameter cbData;
|
---|
682 | /** ptr, out: The data buffer. */
|
---|
683 | HGCMFunctionParameter pvData;
|
---|
684 | } v1;
|
---|
685 | } u;
|
---|
686 | } VBoxShClReadDataMsg;
|
---|
687 |
|
---|
688 | #define VBOX_SHCL_CPARMS_READ_DATA 5
|
---|
689 |
|
---|
690 | /**
|
---|
691 | * Writes clipboard data.
|
---|
692 | */
|
---|
693 | typedef struct _VBoxShClWriteDataMsg
|
---|
694 | {
|
---|
695 | VBGLIOCHGCMCALL hdr;
|
---|
696 |
|
---|
697 | union
|
---|
698 | {
|
---|
699 | struct
|
---|
700 | {
|
---|
701 | /** Returned format as requested in the VBOX_SHCL_HOST_MSG_READ_DATA message. */
|
---|
702 | HGCMFunctionParameter format; /* IN uint32_t */
|
---|
703 | /** Data. */
|
---|
704 | HGCMFunctionParameter ptr; /* IN linear pointer. */
|
---|
705 | } v0;
|
---|
706 | struct
|
---|
707 | {
|
---|
708 | /** uint64_t, out: Context ID. */
|
---|
709 | HGCMFunctionParameter uContext;
|
---|
710 | /** uint32_t, out: Write flags; currently unused and must be set to 0. */
|
---|
711 | HGCMFunctionParameter fFlags;
|
---|
712 | /** uint32_t, out: Requested format to read data in. */
|
---|
713 | HGCMFunctionParameter uFormat;
|
---|
714 | /** uint32_t, out: Size of data (in bytes). */
|
---|
715 | HGCMFunctionParameter cbData;
|
---|
716 | /** ptr, out: Actual data. */
|
---|
717 | HGCMFunctionParameter pvData;
|
---|
718 | } v1;
|
---|
719 | } u;
|
---|
720 | } VBoxShClWriteDataMsg;
|
---|
721 |
|
---|
722 | #define VBOX_SHCL_CPARMS_WRITE_DATA 5
|
---|
723 |
|
---|
724 | /**
|
---|
725 | * Reports a transfer status.
|
---|
726 | */
|
---|
727 | typedef struct _VBoxShClTransferStatusMsg
|
---|
728 | {
|
---|
729 | VBGLIOCHGCMCALL hdr;
|
---|
730 |
|
---|
731 | /** uint64_t, out: Context ID. */
|
---|
732 | HGCMFunctionParameter uContext;
|
---|
733 | /** uint32_t, out: Direction of transfer; of type SHCLTRANSFERDIR_. */
|
---|
734 | HGCMFunctionParameter enmDir;
|
---|
735 | /** uint32_t, out: Status to report; of type SHCLTRANSFERSTATUS_. */
|
---|
736 | HGCMFunctionParameter enmStatus;
|
---|
737 | /** uint32_t, out: Result code to report. Optional. */
|
---|
738 | HGCMFunctionParameter rc;
|
---|
739 | /** uint32_t, out: Reporting flags. Currently unused and must be 0. */
|
---|
740 | HGCMFunctionParameter fFlags;
|
---|
741 | } VBoxShClTransferStatusMsg;
|
---|
742 |
|
---|
743 | #define VBOX_SHCL_CPARMS_TRANSFER_STATUS 5
|
---|
744 |
|
---|
745 | /**
|
---|
746 | * Asks the host for the next command to process, along
|
---|
747 | * with the needed amount of parameters and an optional blocking
|
---|
748 | * flag.
|
---|
749 | *
|
---|
750 | * Used by: VBOX_SHCL_GUEST_FN_GET_HOST_MSG
|
---|
751 | *
|
---|
752 | */
|
---|
753 | typedef struct _VBoxShClGetHostMsg
|
---|
754 | {
|
---|
755 | VBGLIOCHGCMCALL hdr;
|
---|
756 |
|
---|
757 | /** uint32_t, out: Message ID. */
|
---|
758 | HGCMFunctionParameter uMsg;
|
---|
759 | /** uint32_t, out: Number of parameters the message needs. */
|
---|
760 | HGCMFunctionParameter cParms;
|
---|
761 | /** uint32_t, in: Whether or not to block (wait) for a new message to arrive. */
|
---|
762 | HGCMFunctionParameter fBlock;
|
---|
763 | } VBoxShClPeekMsg;
|
---|
764 |
|
---|
765 | #define VBOX_SHCL_CPARMS_GET_HOST_MSG 3
|
---|
766 |
|
---|
767 | /** No listing flags specified. */
|
---|
768 | #define VBOX_SHCL_LIST_FLAG_NONE 0
|
---|
769 | /** Only returns one entry per read. */
|
---|
770 | #define VBOX_SHCL_LIST_FLAG_RETURN_ONE RT_BIT(0)
|
---|
771 | /** Restarts reading a list from the beginning. */
|
---|
772 | #define VBOX_SHCL_LIST_FLAG_RESTART RT_BIT(1)
|
---|
773 |
|
---|
774 | #define VBOX_SHCL_LISTHDR_FLAG_NONE 0
|
---|
775 |
|
---|
776 | /** No additional information provided. */
|
---|
777 | #define VBOX_SHCL_INFO_FLAG_NONE 0
|
---|
778 | /** Get object information of type SHCLFSOBJINFO. */
|
---|
779 | #define VBOX_SHCL_INFO_FLAG_FSOBJINFO RT_BIT(0)
|
---|
780 |
|
---|
781 | /**
|
---|
782 | * Status messag for lists and objects.
|
---|
783 | */
|
---|
784 | typedef struct _VBoxShClStatusMsg
|
---|
785 | {
|
---|
786 | VBGLIOCHGCMCALL hdr;
|
---|
787 |
|
---|
788 | /** uint64_t, in: Context ID. */
|
---|
789 | HGCMFunctionParameter uContext;
|
---|
790 | /** uint32_t, in: Transfer status of type SHCLTRANSFERSTATUS. */
|
---|
791 | HGCMFunctionParameter uStatus;
|
---|
792 | /** uint32_t, in: Size of payload of this status, based on the status type. */
|
---|
793 | HGCMFunctionParameter cbPayload;
|
---|
794 | /** pointer, in: Optional payload of this status, based on the status type. */
|
---|
795 | HGCMFunctionParameter pvPayload;
|
---|
796 | } VBoxShClStatusMsg;
|
---|
797 |
|
---|
798 | #define VBOX_SHCL_CPARMS_STATUS 4
|
---|
799 |
|
---|
800 | /** Invalid message type, do not use. */
|
---|
801 | #define VBOX_SHCL_REPLYMSGTYPE_INVALID 0
|
---|
802 | /** Replies a transfer status. */
|
---|
803 | #define VBOX_SHCL_REPLYMSGTYPE_TRANSFER_STATUS 1
|
---|
804 | /** Replies a list open status. */
|
---|
805 | #define VBOX_SHCL_REPLYMSGTYPE_LIST_OPEN 2
|
---|
806 | /** Replies a list close status. */
|
---|
807 | #define VBOX_SHCL_REPLYMSGTYPE_LIST_CLOSE 3
|
---|
808 | /** Replies an object open status. */
|
---|
809 | #define VBOX_SHCL_REPLYMSGTYPE_OBJ_OPEN 4
|
---|
810 | /** Replies an object close status. */
|
---|
811 | #define VBOX_SHCL_REPLYMSGTYPE_OBJ_CLOSE 5
|
---|
812 |
|
---|
813 | /**
|
---|
814 | * Generic reply message.
|
---|
815 | */
|
---|
816 | typedef struct _VBoxShClReplyMsg
|
---|
817 | {
|
---|
818 | VBGLIOCHGCMCALL hdr;
|
---|
819 |
|
---|
820 | /** uint64_t, out: Context ID. */
|
---|
821 | HGCMFunctionParameter uContext;
|
---|
822 | /** uint32_t, out: Message type of type VBOX_SHCL_REPLYMSGTYPE_XXX. */
|
---|
823 | HGCMFunctionParameter enmType;
|
---|
824 | /** uint32_t, out: IPRT result of overall operation. */
|
---|
825 | HGCMFunctionParameter rc;
|
---|
826 | /** uint32_t, out: Size of optional payload of this reply, based on the message type. */
|
---|
827 | HGCMFunctionParameter cbPayload;
|
---|
828 | /** pointer, out: Optional payload of this reply, based on the message type. */
|
---|
829 | HGCMFunctionParameter pvPayload;
|
---|
830 | union
|
---|
831 | {
|
---|
832 | struct
|
---|
833 | {
|
---|
834 | HGCMFunctionParameter enmStatus;
|
---|
835 | } TransferStatus;
|
---|
836 | struct
|
---|
837 | {
|
---|
838 | HGCMFunctionParameter uHandle;
|
---|
839 | } ListOpen;
|
---|
840 | struct
|
---|
841 | {
|
---|
842 | HGCMFunctionParameter uHandle;
|
---|
843 | } ObjOpen;
|
---|
844 | struct
|
---|
845 | {
|
---|
846 | HGCMFunctionParameter uHandle;
|
---|
847 | } ObjClose;
|
---|
848 | } u;
|
---|
849 | } VBoxShClReplyMsg;
|
---|
850 |
|
---|
851 | /** Minimum parameters (HGCM function parameters minus the union) a reply message must have. */
|
---|
852 | #define VBOX_SHCL_CPARMS_REPLY_MIN 5
|
---|
853 |
|
---|
854 | /**
|
---|
855 | * Structure for keeping root list message parameters.
|
---|
856 | */
|
---|
857 | typedef struct _VBoxShClRootListParms
|
---|
858 | {
|
---|
859 | /** uint64_t, in: Context ID. */
|
---|
860 | HGCMFunctionParameter uContext;
|
---|
861 | /** uint32_t, in: Roots listing flags; unused at the moment. */
|
---|
862 | HGCMFunctionParameter fRoots;
|
---|
863 | } VBoxShClRootListParms;
|
---|
864 |
|
---|
865 | /**
|
---|
866 | * Requests to read the root list header.
|
---|
867 | */
|
---|
868 | typedef struct _VBoxShClRootListReadReqMsg
|
---|
869 | {
|
---|
870 | VBGLIOCHGCMCALL hdr;
|
---|
871 |
|
---|
872 | VBoxShClRootListParms ReqParms;
|
---|
873 | } VBoxShClRootListReadReqMsg;
|
---|
874 |
|
---|
875 | #define VBOX_SHCL_CPARMS_ROOT_LIST_HDR_READ_REQ 2
|
---|
876 |
|
---|
877 | /**
|
---|
878 | * Reads / Writes a root list header.
|
---|
879 | */
|
---|
880 | typedef struct _VBoxShClRootListHdrMsg
|
---|
881 | {
|
---|
882 | VBGLIOCHGCMCALL hdr;
|
---|
883 |
|
---|
884 | VBoxShClRootListParms ReqParms;
|
---|
885 | /** uint64_t, in/out: Number of total root list entries. */
|
---|
886 | HGCMFunctionParameter cRoots;
|
---|
887 | } VBoxShClRootListHdrMsg;
|
---|
888 |
|
---|
889 | #define VBOX_SHCL_CPARMS_ROOT_LIST_HDR_READ 3
|
---|
890 | #define VBOX_SHCL_CPARMS_ROOT_LIST_HDR_WRITE 3
|
---|
891 |
|
---|
892 | /**
|
---|
893 | * Structure for keeping list entry message parameters.
|
---|
894 | */
|
---|
895 | typedef struct _VBoxShClRootListEntryParms
|
---|
896 | {
|
---|
897 | /** uint64_t, in: Context ID. */
|
---|
898 | HGCMFunctionParameter uContext;
|
---|
899 | /** uint32_t, in: VBOX_SHCL_INFO_FLAG_XXX. */
|
---|
900 | HGCMFunctionParameter fInfo;
|
---|
901 | /** uint32_t, in: Index of root list entry to get (zero-based). */
|
---|
902 | HGCMFunctionParameter uIndex;
|
---|
903 | } VBoxShClRootListEntryParms;
|
---|
904 |
|
---|
905 | /**
|
---|
906 | * Request to read a list root entry.
|
---|
907 | */
|
---|
908 | typedef struct _VBoxShClRootListEntryReadReqMsg
|
---|
909 | {
|
---|
910 | VBGLIOCHGCMCALL hdr;
|
---|
911 |
|
---|
912 | /** in: Request parameters. */
|
---|
913 | VBoxShClRootListEntryParms Parms;
|
---|
914 | } VBoxShClRootListEntryReadReqMsg;
|
---|
915 |
|
---|
916 | #define VBOX_SHCL_CPARMS_ROOT_LIST_ENTRY_READ_REQ 3
|
---|
917 |
|
---|
918 | /**
|
---|
919 | * Reads / Writes a root list entry.
|
---|
920 | */
|
---|
921 | typedef struct _VBoxShClRootListEntryMsg
|
---|
922 | {
|
---|
923 | VBGLIOCHGCMCALL hdr;
|
---|
924 |
|
---|
925 | /** in/out: Request parameters. */
|
---|
926 | VBoxShClRootListEntryParms Parms;
|
---|
927 | /** pointer, in/out: Entry name. */
|
---|
928 | HGCMFunctionParameter szName;
|
---|
929 | /** uint32_t, out: Bytes to be used for information/How many bytes were used. */
|
---|
930 | HGCMFunctionParameter cbInfo;
|
---|
931 | /** pointer, in/out: Information to be set/get (SHCLFSOBJINFO only currently).
|
---|
932 | * Do not forget to set the SHCLFSOBJINFO::Attr::enmAdditional for Get operation as well. */
|
---|
933 | HGCMFunctionParameter pvInfo;
|
---|
934 | } VBoxShClRootListEntryMsg;
|
---|
935 |
|
---|
936 | #define VBOX_SHCL_CPARMS_ROOT_LIST_ENTRY_READ 6
|
---|
937 | #define VBOX_SHCL_CPARMS_ROOT_LIST_ENTRY_WRITE 6
|
---|
938 |
|
---|
939 | /**
|
---|
940 | * Opens a list.
|
---|
941 | */
|
---|
942 | typedef struct _VBoxShClListOpenMsg
|
---|
943 | {
|
---|
944 | VBGLIOCHGCMCALL hdr;
|
---|
945 |
|
---|
946 | /** uint64_t, in: Context ID. */
|
---|
947 | HGCMFunctionParameter uContext;
|
---|
948 | /** uint32_t, in: Listing flags (see VBOX_SHCL_LIST_FLAG_XXX). */
|
---|
949 | HGCMFunctionParameter fList;
|
---|
950 | /** uint32_t, in: Size (in bytes) of the filter string. */
|
---|
951 | HGCMFunctionParameter cbFilter;
|
---|
952 | /** pointer, in: Filter string. */
|
---|
953 | HGCMFunctionParameter pvFilter;
|
---|
954 | /** uint32_t, in: Size (in bytes) of the listing path. */
|
---|
955 | HGCMFunctionParameter cbPath;
|
---|
956 | /** pointer, in: Listing poth. If empty or NULL the listing's root path will be opened. */
|
---|
957 | HGCMFunctionParameter pvPath;
|
---|
958 | /** uint64_t, out: List handle. */
|
---|
959 | HGCMFunctionParameter uHandle;
|
---|
960 | } VBoxShClListOpenMsg;
|
---|
961 |
|
---|
962 | #define VBOX_SHCL_CPARMS_LIST_OPEN 7
|
---|
963 |
|
---|
964 | /**
|
---|
965 | * Closes a list.
|
---|
966 | */
|
---|
967 | typedef struct _VBoxShClListCloseMsg
|
---|
968 | {
|
---|
969 | VBGLIOCHGCMCALL hdr;
|
---|
970 |
|
---|
971 | /** uint64_t, in/out: Context ID. */
|
---|
972 | HGCMFunctionParameter uContext;
|
---|
973 | /** uint64_t, in: List handle. */
|
---|
974 | HGCMFunctionParameter uHandle;
|
---|
975 | } VBoxShClListCloseMsg;
|
---|
976 |
|
---|
977 | #define VBOX_SHCL_CPARMS_LIST_CLOSE 2
|
---|
978 |
|
---|
979 | typedef struct _VBoxShClListHdrReqParms
|
---|
980 | {
|
---|
981 | /** uint64_t, in: Context ID. */
|
---|
982 | HGCMFunctionParameter uContext;
|
---|
983 | /** uint64_t, in: List handle. */
|
---|
984 | HGCMFunctionParameter uHandle;
|
---|
985 | /** uint32_t, in: Flags of type VBOX_SHCL_LISTHDR_FLAG_XXX. */
|
---|
986 | HGCMFunctionParameter fFlags;
|
---|
987 | } VBoxShClListHdrReqParms;
|
---|
988 |
|
---|
989 | /**
|
---|
990 | * Request to read a list header.
|
---|
991 | */
|
---|
992 | typedef struct _VBoxShClListHdrReadReqMsg
|
---|
993 | {
|
---|
994 | VBGLIOCHGCMCALL hdr;
|
---|
995 |
|
---|
996 | VBoxShClListHdrReqParms ReqParms;
|
---|
997 | } VBoxShClListHdrReadReqMsg;
|
---|
998 |
|
---|
999 | #define VBOX_SHCL_CPARMS_LIST_HDR_READ_REQ 3
|
---|
1000 |
|
---|
1001 | /**
|
---|
1002 | * Reads / Writes a list header.
|
---|
1003 | */
|
---|
1004 | typedef struct _VBoxShClListHdrMsg
|
---|
1005 | {
|
---|
1006 | VBGLIOCHGCMCALL hdr;
|
---|
1007 |
|
---|
1008 | VBoxShClListHdrReqParms ReqParms;
|
---|
1009 | /** uint32_t, in/out: Feature flags (see VBOX_SHCL_FEATURE_FLAG_XXX). */
|
---|
1010 | HGCMFunctionParameter fFeatures;
|
---|
1011 | /** uint64_t, in/out: Number of total objects to transfer. */
|
---|
1012 | HGCMFunctionParameter cTotalObjects;
|
---|
1013 | /** uint64_t, in/out: Number of total bytes to transfer. */
|
---|
1014 | HGCMFunctionParameter cbTotalSize;
|
---|
1015 | } VBoxShClListHdrMsg;
|
---|
1016 |
|
---|
1017 | #define VBOX_SHCL_CPARMS_LIST_HDR 6
|
---|
1018 |
|
---|
1019 | typedef struct _VBoxShClListEntryReqParms
|
---|
1020 | {
|
---|
1021 | /** uint64_t, in: Context ID. */
|
---|
1022 | HGCMFunctionParameter uContext;
|
---|
1023 | /** uint64_t, in: List handle. */
|
---|
1024 | HGCMFunctionParameter uHandle;
|
---|
1025 | /** uint32_t, in: VBOX_SHCL_INFO_FLAG_XXX. */
|
---|
1026 | HGCMFunctionParameter fInfo;
|
---|
1027 | } VBoxShClListEntryReqParms;
|
---|
1028 |
|
---|
1029 | /**
|
---|
1030 | * Request to read a list entry.
|
---|
1031 | */
|
---|
1032 | typedef struct _VBoxShClListEntryReadReqMsg
|
---|
1033 | {
|
---|
1034 | VBGLIOCHGCMCALL hdr;
|
---|
1035 |
|
---|
1036 | VBoxShClListEntryReqParms ReqParms;
|
---|
1037 | } VBoxShClListEntryReadReqMsg;
|
---|
1038 |
|
---|
1039 | #define VBOX_SHCL_CPARMS_LIST_ENTRY_READ 3
|
---|
1040 |
|
---|
1041 | /**
|
---|
1042 | * Reads / Writes a list entry.
|
---|
1043 | */
|
---|
1044 | typedef struct _VBoxShClListEntryMsg
|
---|
1045 | {
|
---|
1046 | VBGLIOCHGCMCALL hdr;
|
---|
1047 |
|
---|
1048 | /** in/out: Request parameters. */
|
---|
1049 | VBoxShClListEntryReqParms ReqParms;
|
---|
1050 | /** pointer, in/out: Entry name. */
|
---|
1051 | HGCMFunctionParameter szName;
|
---|
1052 | /** uint32_t, out: Bytes to be used for information/How many bytes were used. */
|
---|
1053 | HGCMFunctionParameter cbInfo;
|
---|
1054 | /** pointer, in/out: Information to be set/get (SHCLFSOBJINFO only currently).
|
---|
1055 | * Do not forget to set the SHCLFSOBJINFO::Attr::enmAdditional for Get operation as well. */
|
---|
1056 | HGCMFunctionParameter pvInfo;
|
---|
1057 | } VBoxShClListEntryMsg;
|
---|
1058 |
|
---|
1059 | #define VBOX_SHCL_CPARMS_LIST_ENTRY 6
|
---|
1060 |
|
---|
1061 | /**
|
---|
1062 | * Opens a Shared Clipboard object.
|
---|
1063 | */
|
---|
1064 | typedef struct _VBoxShClObjOpenMsg
|
---|
1065 | {
|
---|
1066 | VBGLIOCHGCMCALL hdr;
|
---|
1067 |
|
---|
1068 | /** uint64_t, in/out: Context ID. */
|
---|
1069 | HGCMFunctionParameter uContext;
|
---|
1070 | /** uint64_t, in/out: Object handle. */
|
---|
1071 | HGCMFunctionParameter uHandle;
|
---|
1072 | /** uint32_t, in/out: Size (in bytes) of absoulte path of object to open/create. */
|
---|
1073 | HGCMFunctionParameter cbPath;
|
---|
1074 | /** pointer, in/out: Absoulte path of object to open/create. */
|
---|
1075 | HGCMFunctionParameter szPath;
|
---|
1076 | /** uint32_t in/out: Open / Create flags of type SHCL_OBJ_CF_. */
|
---|
1077 | HGCMFunctionParameter fCreate;
|
---|
1078 | } VBoxShClObjOpenMsg;
|
---|
1079 |
|
---|
1080 | #define VBOX_SHCL_CPARMS_OBJ_OPEN 5
|
---|
1081 |
|
---|
1082 | /**
|
---|
1083 | * Closes a Shared Clipboard object.
|
---|
1084 | */
|
---|
1085 | typedef struct _VBoxShClObjCloseMsg
|
---|
1086 | {
|
---|
1087 | VBGLIOCHGCMCALL hdr;
|
---|
1088 |
|
---|
1089 | /** uint64_t, in/out: Context ID. */
|
---|
1090 | HGCMFunctionParameter uContext;
|
---|
1091 | /** uint64_t, in: SHCLOBJHANDLE of object to close. */
|
---|
1092 | HGCMFunctionParameter uHandle;
|
---|
1093 | } VBoxShClObjCloseMsg;
|
---|
1094 |
|
---|
1095 | #define VBOX_SHCL_CPARMS_OBJ_CLOSE 2
|
---|
1096 |
|
---|
1097 | /**
|
---|
1098 | * Structure for keeping read parameters of a Shared Clipboard object.
|
---|
1099 | */
|
---|
1100 | typedef struct _VBoxShClObjReadReqParms
|
---|
1101 | {
|
---|
1102 | /** uint64_t, in: Context ID. */
|
---|
1103 | HGCMFunctionParameter uContext;
|
---|
1104 | /** uint64_t, in: SHCLOBJHANDLE of object to write to. */
|
---|
1105 | HGCMFunctionParameter uHandle;
|
---|
1106 | /** uint32_t, in: How many bytes to read. */
|
---|
1107 | HGCMFunctionParameter cbToRead;
|
---|
1108 | /** uint32_t, in: Read flags. Currently unused and must be 0. */
|
---|
1109 | HGCMFunctionParameter fRead;
|
---|
1110 | } VBoxShClObjReadReqParms;
|
---|
1111 |
|
---|
1112 | /**
|
---|
1113 | * Reads from a Shared Clipboard object.
|
---|
1114 | */
|
---|
1115 | typedef struct _VBoxShClObjReadReqMsg
|
---|
1116 | {
|
---|
1117 | VBGLIOCHGCMCALL hdr;
|
---|
1118 |
|
---|
1119 | VBoxShClObjReadReqParms ReqParms;
|
---|
1120 | } VBoxShClObjReadReqMsg;
|
---|
1121 |
|
---|
1122 | #define VBOX_SHCL_CPARMS_OBJ_READ_REQ 4
|
---|
1123 |
|
---|
1124 | /**
|
---|
1125 | * Reads / writes data of / to an object.
|
---|
1126 | *
|
---|
1127 | * Used by:
|
---|
1128 | * VBOX_SHCL_FN_OBJ_READ
|
---|
1129 | * VBOX_SHCL_FN_OBJ_WRITE
|
---|
1130 | */
|
---|
1131 | typedef struct _VBoxShClObjReadWriteMsg
|
---|
1132 | {
|
---|
1133 | VBGLIOCHGCMCALL hdr;
|
---|
1134 |
|
---|
1135 | /** uint64_t, in/out: Context ID. */
|
---|
1136 | HGCMFunctionParameter uContext;
|
---|
1137 | /** uint64_t, in/out: SHCLOBJHANDLE of object to write to. */
|
---|
1138 | HGCMFunctionParameter uHandle;
|
---|
1139 | /** uint32_t, in/out: Size (in bytes) of current data chunk. */
|
---|
1140 | HGCMFunctionParameter cbData;
|
---|
1141 | /** pointer, in/out: Current data chunk. */
|
---|
1142 | HGCMFunctionParameter pvData;
|
---|
1143 | /** uint32_t, in/out: Size (in bytes) of current data chunk checksum. */
|
---|
1144 | HGCMFunctionParameter cbChecksum;
|
---|
1145 | /** pointer, in/out: Checksum of data block, based on the checksum
|
---|
1146 | * type in the data header. Optional. */
|
---|
1147 | HGCMFunctionParameter pvChecksum;
|
---|
1148 | } VBoxShClObjReadWriteMsg;
|
---|
1149 |
|
---|
1150 | #define VBOX_SHCL_CPARMS_OBJ_READ 6
|
---|
1151 | #define VBOX_SHCL_CPARMS_OBJ_WRITE 6
|
---|
1152 |
|
---|
1153 | /**
|
---|
1154 | * Sends an error event.
|
---|
1155 | *
|
---|
1156 | * Used by:
|
---|
1157 | * VBOX_SHCL_FN_WRITE_ERROR
|
---|
1158 | */
|
---|
1159 | typedef struct _VBoxShClErrorMsg
|
---|
1160 | {
|
---|
1161 | VBGLIOCHGCMCALL hdr;
|
---|
1162 |
|
---|
1163 | /** uint64_t, in: Context ID. */
|
---|
1164 | HGCMFunctionParameter uContext;
|
---|
1165 | /** uint32_t, in: The error code (IPRT-style). */
|
---|
1166 | HGCMFunctionParameter rc;
|
---|
1167 | } VBoxShClWriteErrorMsg;
|
---|
1168 |
|
---|
1169 | #define VBOX_SHCL_CPARMS_ERROR 2
|
---|
1170 |
|
---|
1171 | #pragma pack()
|
---|
1172 |
|
---|
1173 | /**
|
---|
1174 | * Structure for keeping a Shared Clipboard file data chunk.
|
---|
1175 | *
|
---|
1176 | * @returns VBox status code.
|
---|
1177 | */
|
---|
1178 | typedef struct _SHCLFILEDATA
|
---|
1179 | {
|
---|
1180 | /** Current file data chunk. */
|
---|
1181 | void *pvData;
|
---|
1182 | /** Size (in bytes) of current data chunk. */
|
---|
1183 | uint32_t cbData;
|
---|
1184 | /** Checksum for current file data chunk. */
|
---|
1185 | void *pvChecksum;
|
---|
1186 | /** Size (in bytes) of current data chunk. */
|
---|
1187 | uint32_t cbChecksum;
|
---|
1188 | } SHCLFILEDATA, *PSHCLFILEDATA;
|
---|
1189 |
|
---|
1190 | /**
|
---|
1191 | * Structure for keeping Shared Clipboard error data.
|
---|
1192 | */
|
---|
1193 | typedef struct _SHCLERRORDATA
|
---|
1194 | {
|
---|
1195 | int32_t rc;
|
---|
1196 | } SHCLERRORDATA, *PSHCLERRORDATA;
|
---|
1197 |
|
---|
1198 | /** Opaque client structure for API access. */
|
---|
1199 | struct _SHCLCLIENT;
|
---|
1200 | typedef struct _SHCLCLIENT SHCLCLIENT, *PSHCLCLIENT;
|
---|
1201 |
|
---|
1202 | /** Opaque client structure for API access. */
|
---|
1203 | struct _SHCLCLIENTCMDCTX;
|
---|
1204 | typedef struct _SHCLCLIENTCMDCTX SHCLCLIENTCMDCTX, *PSHCLCLIENTCMDCTX;
|
---|
1205 |
|
---|
1206 | /** @name Public service functions, accessible by the backends.
|
---|
1207 | * Locking is between the (host) service thread and the platform-dependent (window) thread.
|
---|
1208 | * @{
|
---|
1209 | */
|
---|
1210 | int ShClSvcDataReadRequest(PSHCLCLIENT pClient, PSHCLDATAREQ pDataReq, PSHCLEVENTID puEvent);
|
---|
1211 | int ShClSvcDataReadSignal(PSHCLCLIENT pClient, PSHCLCLIENTCMDCTX pCmdCtx, PSHCLDATABLOCK pData);
|
---|
1212 | int ShClSvcFormatsReport(PSHCLCLIENT pClient, PSHCLFORMATDATA pFormats);
|
---|
1213 | /** @} */
|
---|
1214 |
|
---|
1215 | uint32_t ShClSvcGetMode(void);
|
---|
1216 | bool ShClSvcGetHeadless(void);
|
---|
1217 | bool ShClSvcLock(void);
|
---|
1218 | void ShClSvcUnlock(void);
|
---|
1219 |
|
---|
1220 | #endif /* !VBOX_INCLUDED_HostServices_VBoxClipboardSvc_h */
|
---|
1221 |
|
---|