1 | /** @file
|
---|
2 | * VBoxGuestLib - VirtualBox Guest Additions Library.
|
---|
3 | */
|
---|
4 |
|
---|
5 | /*
|
---|
6 | * Copyright (C) 2006-2019 Oracle Corporation
|
---|
7 | *
|
---|
8 | * Permission is hereby granted, free of charge, to any person
|
---|
9 | * obtaining a copy of this software and associated documentation
|
---|
10 | * files (the "Software"), to deal in the Software without
|
---|
11 | * restriction, including without limitation the rights to use,
|
---|
12 | * copy, modify, merge, publish, distribute, sublicense, and/or sell
|
---|
13 | * copies of the Software, and to permit persons to whom the
|
---|
14 | * Software is furnished to do so, subject to the following
|
---|
15 | * conditions:
|
---|
16 | *
|
---|
17 | * The above copyright notice and this permission notice shall be
|
---|
18 | * included in all copies or substantial portions of the Software.
|
---|
19 | *
|
---|
20 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
---|
21 | * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
|
---|
22 | * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
---|
23 | * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
|
---|
24 | * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
|
---|
25 | * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
|
---|
26 | * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
|
---|
27 | * OTHER DEALINGS IN THE SOFTWARE.
|
---|
28 | */
|
---|
29 |
|
---|
30 | #ifndef VBOX_INCLUDED_VBoxGuestLib_h
|
---|
31 | #define VBOX_INCLUDED_VBoxGuestLib_h
|
---|
32 | #ifndef RT_WITHOUT_PRAGMA_ONCE
|
---|
33 | # pragma once
|
---|
34 | #endif
|
---|
35 |
|
---|
36 | #include <VBox/types.h>
|
---|
37 | #include <VBox/VMMDev.h>
|
---|
38 | #include <VBox/VBoxGuestCoreTypes.h>
|
---|
39 | # ifdef VBOX_WITH_DRAG_AND_DROP
|
---|
40 | # include <VBox/GuestHost/DragAndDropDefs.h>
|
---|
41 | # endif
|
---|
42 | # ifdef VBOX_WITH_SHARED_CLIPBOARD
|
---|
43 | # include <VBox/GuestHost/SharedClipboard.h>
|
---|
44 | # ifdef VBOX_WITH_SHARED_CLIPBOARD_URI_LIST
|
---|
45 | # include <VBox/GuestHost/SharedClipboard-uri.h>
|
---|
46 | # endif
|
---|
47 | # endif /* VBOX_WITH_SHARED_CLIPBOARD */
|
---|
48 |
|
---|
49 | /** @defgroup grp_vboxguest_lib VirtualBox Guest Additions Library
|
---|
50 | * @ingroup grp_vboxguest
|
---|
51 | * @{
|
---|
52 | */
|
---|
53 |
|
---|
54 | /** @page pg_guest_lib VirtualBox Guest Library
|
---|
55 | *
|
---|
56 | * This is a library for abstracting the additions driver interface. There are
|
---|
57 | * multiple versions of the library depending on the context. The main
|
---|
58 | * distinction is between kernel and user mode where the interfaces are very
|
---|
59 | * different.
|
---|
60 | *
|
---|
61 | *
|
---|
62 | * @section sec_guest_lib_ring0 Ring-0
|
---|
63 | *
|
---|
64 | * In ring-0 there are two version:
|
---|
65 | * - VBOX_LIB_VBGL_R0_BASE / VBoxGuestR0LibBase for the VBoxGuest main driver,
|
---|
66 | * who is responsible for managing the VMMDev virtual hardware.
|
---|
67 | * - VBOX_LIB_VBGL_R0 / VBoxGuestR0Lib for other (client) guest drivers.
|
---|
68 | *
|
---|
69 | *
|
---|
70 | * The library source code and the header have a define VBGL_VBOXGUEST, which is
|
---|
71 | * defined for VBoxGuest and undefined for other drivers. Drivers must choose
|
---|
72 | * right library in their makefiles and set VBGL_VBOXGUEST accordingly.
|
---|
73 | *
|
---|
74 | * The libraries consists of:
|
---|
75 | * - common code to be used by both VBoxGuest and other drivers;
|
---|
76 | * - VBoxGuest specific code;
|
---|
77 | * - code for other drivers which communicate with VBoxGuest via an IOCTL.
|
---|
78 | *
|
---|
79 | *
|
---|
80 | * @section sec_guest_lib_ring3 Ring-3
|
---|
81 | *
|
---|
82 | * There are more variants of the library here:
|
---|
83 | * - VBOX_LIB_VBGL_R3 / VBoxGuestR3Lib for programs.
|
---|
84 | * - VBOX_LIB_VBGL_R3_XFREE86 / VBoxGuestR3LibXFree86 for old style XFree
|
---|
85 | * drivers which uses special loader and or symbol resolving strategy.
|
---|
86 | * - VBOX_LIB_VBGL_R3_SHARED / VBoxGuestR3LibShared for shared objects / DLLs /
|
---|
87 | * Dylibs.
|
---|
88 | *
|
---|
89 | */
|
---|
90 |
|
---|
91 | RT_C_DECLS_BEGIN
|
---|
92 |
|
---|
93 | /** HGCM client ID.
|
---|
94 | * @todo Promote to VBox/types.h */
|
---|
95 | typedef uint32_t HGCMCLIENTID;
|
---|
96 |
|
---|
97 |
|
---|
98 | /** @defgroup grp_vboxguest_lib_r0 Ring-0 interface.
|
---|
99 | * @{
|
---|
100 | */
|
---|
101 | #ifdef IN_RING0
|
---|
102 | /** @def DECLR0VBGL
|
---|
103 | * Declare a VBGL ring-0 API with the right calling convention and visibilitiy.
|
---|
104 | * @param type Return type. */
|
---|
105 | # ifdef RT_OS_DARWIN /** @todo probably apply to all, but don't want a forest fire on our hands right now. */
|
---|
106 | # define DECLR0VBGL(type) DECLHIDDEN(type) VBOXCALL
|
---|
107 | # else
|
---|
108 | # define DECLR0VBGL(type) type VBOXCALL
|
---|
109 | # endif
|
---|
110 | # define DECLVBGL(type) DECLR0VBGL(type)
|
---|
111 |
|
---|
112 |
|
---|
113 | /**
|
---|
114 | * The library initialization function to be used by the main VBoxGuest driver.
|
---|
115 | *
|
---|
116 | * @return VBox status code.
|
---|
117 | */
|
---|
118 | DECLR0VBGL(int) VbglR0InitPrimary(RTIOPORT portVMMDev, VMMDevMemory *pVMMDevMemory, uint32_t *pfFeatures);
|
---|
119 |
|
---|
120 | /**
|
---|
121 | * The library termination function to be used by the main VBoxGuest driver.
|
---|
122 | *
|
---|
123 | * @author bird (2017-08-23)
|
---|
124 | */
|
---|
125 | DECLR0VBGL(void) VbglR0TerminatePrimary(void);
|
---|
126 |
|
---|
127 | /**
|
---|
128 | * The library initialization function to be used by all drivers
|
---|
129 | * other than the main VBoxGuest system driver.
|
---|
130 | *
|
---|
131 | * @return VBox status code.
|
---|
132 | */
|
---|
133 | DECLR0VBGL(int) VbglR0InitClient(void);
|
---|
134 |
|
---|
135 | /**
|
---|
136 | * The library termination function.
|
---|
137 | */
|
---|
138 | DECLR0VBGL(void) VbglR0TerminateClient(void);
|
---|
139 |
|
---|
140 | /**
|
---|
141 | * Query the host feature mask.
|
---|
142 | *
|
---|
143 | * @returns VBox status code.
|
---|
144 | * @param pfHostFeatures Where to return the host feature mask,
|
---|
145 | * VMMDEV_HVF_XXX.
|
---|
146 | * @note Client only. May fail we're unable to connect VBoxGuest.
|
---|
147 | */
|
---|
148 | DECLR0VBGL(int) VbglR0QueryHostFeatures(uint32_t *pfHostFeatures);
|
---|
149 |
|
---|
150 |
|
---|
151 | /** @name The IDC Client Interface
|
---|
152 | * @{
|
---|
153 | */
|
---|
154 |
|
---|
155 | /**
|
---|
156 | * Inter-Driver Communication Handle.
|
---|
157 | */
|
---|
158 | typedef union VBGLIDCHANDLE
|
---|
159 | {
|
---|
160 | /** Padding for opaque usage.
|
---|
161 | * Must be greater or equal in size than the private struct. */
|
---|
162 | void *apvPadding[4];
|
---|
163 | #ifdef VBGLIDCHANDLEPRIVATE_DECLARED
|
---|
164 | /** The private view. */
|
---|
165 | struct VBGLIDCHANDLEPRIVATE s;
|
---|
166 | #endif
|
---|
167 | } VBGLIDCHANDLE;
|
---|
168 | /** Pointer to a handle. */
|
---|
169 | typedef VBGLIDCHANDLE *PVBGLIDCHANDLE;
|
---|
170 |
|
---|
171 | DECLR0VBGL(int) VbglR0IdcOpen(PVBGLIDCHANDLE pHandle, uint32_t uReqVersion, uint32_t uMinVersion,
|
---|
172 | uint32_t *puSessionVersion, uint32_t *puDriverVersion, uint32_t *puDriverRevision);
|
---|
173 | struct VBGLREQHDR;
|
---|
174 | DECLR0VBGL(int) VbglR0IdcCallRaw(PVBGLIDCHANDLE pHandle, uintptr_t uReq, struct VBGLREQHDR *pReqHdr, uint32_t cbReq);
|
---|
175 | DECLR0VBGL(int) VbglR0IdcCall(PVBGLIDCHANDLE pHandle, uintptr_t uReq, struct VBGLREQHDR *pReqHdr, uint32_t cbReq);
|
---|
176 | DECLR0VBGL(int) VbglR0IdcClose(PVBGLIDCHANDLE pHandle);
|
---|
177 |
|
---|
178 | /** @} */
|
---|
179 |
|
---|
180 |
|
---|
181 | /** @name Generic request functions.
|
---|
182 | * @{
|
---|
183 | */
|
---|
184 |
|
---|
185 | /**
|
---|
186 | * Allocate memory for generic request and initialize the request header.
|
---|
187 | *
|
---|
188 | * @returns VBox status code.
|
---|
189 | * @param ppReq Where to return the pointer to the allocated memory.
|
---|
190 | * @param cbReq Size of memory block required for the request.
|
---|
191 | * @param enmReqType the generic request type.
|
---|
192 | */
|
---|
193 | # if defined(VBOX_INCLUDED_VMMDev_h) || defined(DOXYGEN_RUNNING)
|
---|
194 | DECLR0VBGL(int) VbglR0GRAlloc(struct VMMDevRequestHeader **ppReq, size_t cbReq, VMMDevRequestType enmReqType);
|
---|
195 | # else
|
---|
196 | DECLR0VBGL(int) VbglR0GRAlloc(struct VMMDevRequestHeader **ppReq, size_t cbReq, int32_t enmReqType);
|
---|
197 | # endif
|
---|
198 |
|
---|
199 | /**
|
---|
200 | * Perform the generic request.
|
---|
201 | *
|
---|
202 | * @param pReq pointer the request structure.
|
---|
203 | *
|
---|
204 | * @return VBox status code.
|
---|
205 | */
|
---|
206 | DECLR0VBGL(int) VbglR0GRPerform(struct VMMDevRequestHeader *pReq);
|
---|
207 |
|
---|
208 | /**
|
---|
209 | * Free the generic request memory.
|
---|
210 | *
|
---|
211 | * @param pReq pointer the request structure.
|
---|
212 | *
|
---|
213 | * @return VBox status code.
|
---|
214 | */
|
---|
215 | DECLR0VBGL(void) VbglR0GRFree(struct VMMDevRequestHeader *pReq);
|
---|
216 |
|
---|
217 | /**
|
---|
218 | * Verify the generic request header.
|
---|
219 | *
|
---|
220 | * @param pReq pointer the request header structure.
|
---|
221 | * @param cbReq size of the request memory block. It should be equal to the request size
|
---|
222 | * for fixed size requests. It can be greater than the request size for
|
---|
223 | * variable size requests.
|
---|
224 | *
|
---|
225 | * @return VBox status code.
|
---|
226 | */
|
---|
227 | DECLR0VBGL(int) VbglGR0Verify(const struct VMMDevRequestHeader *pReq, size_t cbReq);
|
---|
228 |
|
---|
229 | /** @} */
|
---|
230 |
|
---|
231 | # ifdef VBOX_WITH_HGCM
|
---|
232 | struct VBGLIOCHGCMCALL;
|
---|
233 | struct VBGLIOCIDCHGCMFASTCALL;
|
---|
234 |
|
---|
235 | # ifdef VBGL_VBOXGUEST
|
---|
236 |
|
---|
237 | /**
|
---|
238 | * Callback function called from HGCM helpers when a wait for request
|
---|
239 | * completion IRQ is required.
|
---|
240 | *
|
---|
241 | * @returns VINF_SUCCESS, VERR_INTERRUPT or VERR_TIMEOUT.
|
---|
242 | * @param pvData VBoxGuest pointer to be passed to callback.
|
---|
243 | * @param u32Data VBoxGuest 32 bit value to be passed to callback.
|
---|
244 | */
|
---|
245 | typedef DECLCALLBACK(int) FNVBGLHGCMCALLBACK(VMMDevHGCMRequestHeader *pHeader, void *pvData, uint32_t u32Data);
|
---|
246 | /** Pointer to a FNVBGLHGCMCALLBACK. */
|
---|
247 | typedef FNVBGLHGCMCALLBACK *PFNVBGLHGCMCALLBACK;
|
---|
248 |
|
---|
249 | /**
|
---|
250 | * Perform a connect request.
|
---|
251 | *
|
---|
252 | * That is locate required service and obtain a client identifier for future
|
---|
253 | * access.
|
---|
254 | *
|
---|
255 | * @note This function can NOT handle cancelled requests!
|
---|
256 | *
|
---|
257 | * @param pLoc The service to connect to.
|
---|
258 | * @param fRequestor VMMDEV_REQUESTOR_XXX.
|
---|
259 | * @param pidClient Where to return the client ID on success.
|
---|
260 | * @param pfnAsyncCallback Required pointer to function that is calledwhen
|
---|
261 | * host returns VINF_HGCM_ASYNC_EXECUTE. VBoxGuest
|
---|
262 | * implements waiting for an IRQ in this function.
|
---|
263 | * @param pvAsyncData An arbitrary VBoxGuest pointer to be passed to callback.
|
---|
264 | * @param u32AsyncData An arbitrary VBoxGuest 32 bit value to be passed to callback.
|
---|
265 | *
|
---|
266 | * @return VBox status code.
|
---|
267 | */
|
---|
268 | DECLR0VBGL(int) VbglR0HGCMInternalConnect(HGCMServiceLocation const *pLoc, uint32_t fRequestor, HGCMCLIENTID *pidClient,
|
---|
269 | PFNVBGLHGCMCALLBACK pfnAsyncCallback, void *pvAsyncData, uint32_t u32AsyncData);
|
---|
270 |
|
---|
271 |
|
---|
272 | /**
|
---|
273 | * Perform a disconnect request.
|
---|
274 | *
|
---|
275 | * That is tell the host that the client will not call the service anymore.
|
---|
276 | *
|
---|
277 | * @note This function can NOT handle cancelled requests!
|
---|
278 | *
|
---|
279 | * @param idClient The client ID to disconnect.
|
---|
280 | * @param fRequestor VMMDEV_REQUESTOR_XXX.
|
---|
281 | * @param pfnAsyncCallback Required pointer to function that is called when
|
---|
282 | * host returns VINF_HGCM_ASYNC_EXECUTE. VBoxGuest
|
---|
283 | * implements waiting for an IRQ in this function.
|
---|
284 | * @param pvAsyncData An arbitrary VBoxGuest pointer to be passed to callback.
|
---|
285 | * @param u32AsyncData An arbitrary VBoxGuest 32 bit value to be passed to
|
---|
286 | * callback.
|
---|
287 | *
|
---|
288 | * @return VBox status code.
|
---|
289 | */
|
---|
290 |
|
---|
291 | DECLR0VBGL(int) VbglR0HGCMInternalDisconnect(HGCMCLIENTID idClient, uint32_t fRequestor,
|
---|
292 | PFNVBGLHGCMCALLBACK pfnAsyncCallback, void *pvAsyncData, uint32_t u32AsyncData);
|
---|
293 |
|
---|
294 | /** Call a HGCM service.
|
---|
295 | *
|
---|
296 | * @note This function can deal with cancelled requests.
|
---|
297 | *
|
---|
298 | * @param pCallInfo The request data.
|
---|
299 | * @param fFlags Flags, see VBGLR0_HGCMCALL_F_XXX.
|
---|
300 | * @param fRequestor VMMDEV_REQUESTOR_XXX.
|
---|
301 | * @param pfnAsyncCallback Required pointer to function that is called when
|
---|
302 | * host returns VINF_HGCM_ASYNC_EXECUTE. VBoxGuest
|
---|
303 | * implements waiting for an IRQ in this function.
|
---|
304 | * @param pvAsyncData An arbitrary VBoxGuest pointer to be passed to callback.
|
---|
305 | * @param u32AsyncData An arbitrary VBoxGuest 32 bit value to be passed to callback.
|
---|
306 | *
|
---|
307 | * @return VBox status code.
|
---|
308 | */
|
---|
309 | DECLR0VBGL(int) VbglR0HGCMInternalCall(struct VBGLIOCHGCMCALL *pCallInfo, uint32_t cbCallInfo, uint32_t fFlags, uint32_t fRequestor,
|
---|
310 | PFNVBGLHGCMCALLBACK pfnAsyncCallback, void *pvAsyncData, uint32_t u32AsyncData);
|
---|
311 |
|
---|
312 | /** Call a HGCM service. (32 bits packet structure in a 64 bits guest)
|
---|
313 | *
|
---|
314 | * @note This function can deal with cancelled requests.
|
---|
315 | *
|
---|
316 | * @param pCallInfo The request data.
|
---|
317 | * @param fFlags Flags, see VBGLR0_HGCMCALL_F_XXX.
|
---|
318 | * @param fRequestor VMMDEV_REQUESTOR_XXX.
|
---|
319 | * @param pfnAsyncCallback Required pointer to function that is called when
|
---|
320 | * host returns VINF_HGCM_ASYNC_EXECUTE. VBoxGuest
|
---|
321 | * implements waiting for an IRQ in this function.
|
---|
322 | * @param pvAsyncData An arbitrary VBoxGuest pointer to be passed to callback.
|
---|
323 | * @param u32AsyncData An arbitrary VBoxGuest 32 bit value to be passed to callback.
|
---|
324 | *
|
---|
325 | * @return VBox status code.
|
---|
326 | */
|
---|
327 | DECLR0VBGL(int) VbglR0HGCMInternalCall32(struct VBGLIOCHGCMCALL *pCallInfo, uint32_t cbCallInfo, uint32_t fFlags, uint32_t fRequestor,
|
---|
328 | PFNVBGLHGCMCALLBACK pfnAsyncCallback, void *pvAsyncData, uint32_t u32AsyncData);
|
---|
329 |
|
---|
330 | /** @name VbglR0HGCMInternalCall flags
|
---|
331 | * @{ */
|
---|
332 | /** User mode request.
|
---|
333 | * Indicates that only user mode addresses are permitted as parameters. */
|
---|
334 | #define VBGLR0_HGCMCALL_F_USER UINT32_C(0)
|
---|
335 | /** Kernel mode request.
|
---|
336 | * Indicates that kernel mode addresses are permitted as parameters. Whether or
|
---|
337 | * not user mode addresses are permitted is, unfortunately, OS specific. The
|
---|
338 | * following OSes allows user mode addresses: Windows, TODO.
|
---|
339 | */
|
---|
340 | #define VBGLR0_HGCMCALL_F_KERNEL UINT32_C(1)
|
---|
341 | /** Mode mask. */
|
---|
342 | #define VBGLR0_HGCMCALL_F_MODE_MASK UINT32_C(1)
|
---|
343 | /** @} */
|
---|
344 |
|
---|
345 | # else /* !VBGL_VBOXGUEST */
|
---|
346 |
|
---|
347 | #ifndef VBGL_VBOXGUEST
|
---|
348 | /** @internal */
|
---|
349 | typedef struct VBGLHGCMHANDLEDATA
|
---|
350 | {
|
---|
351 | uint32_t fAllocated;
|
---|
352 | VBGLIDCHANDLE IdcHandle;
|
---|
353 | } VBGLHGCMHANDLEDATA;
|
---|
354 | #else
|
---|
355 | struct VBGLHGCMHANDLEDATA;
|
---|
356 | #endif
|
---|
357 |
|
---|
358 | typedef struct VBGLHGCMHANDLEDATA *VBGLHGCMHANDLE;
|
---|
359 |
|
---|
360 | /** @name HGCM functions
|
---|
361 | * @{
|
---|
362 | */
|
---|
363 |
|
---|
364 | /**
|
---|
365 | * Initializes HGCM in the R0 guest library. Must be called before any HGCM
|
---|
366 | * connections are made. Is called by VbglInitClient().
|
---|
367 | *
|
---|
368 | * @return VBox status code.
|
---|
369 | */
|
---|
370 | DECLR0VBGL(int) VbglR0HGCMInit(void);
|
---|
371 |
|
---|
372 | /**
|
---|
373 | * Terminates HGCM in the R0 guest library. Is called by VbglTerminate().
|
---|
374 | *
|
---|
375 | * @return VBox status code.
|
---|
376 | */
|
---|
377 | DECLR0VBGL(int) VbglR0HGCMTerminate(void);
|
---|
378 |
|
---|
379 | /**
|
---|
380 | * Connect to a service.
|
---|
381 | *
|
---|
382 | * @param pHandle Pointer to variable that will hold a handle to be used
|
---|
383 | * further in VbglHGCMCall and VbglHGCMClose.
|
---|
384 | * @param pszServiceName The service to connect to.
|
---|
385 | * @param pidClient Where to return the client ID for the connection.
|
---|
386 | *
|
---|
387 | * @return VBox status code.
|
---|
388 | *
|
---|
389 | * @todo consider baking the client Id into the handle.
|
---|
390 | */
|
---|
391 | DECLR0VBGL(int) VbglR0HGCMConnect(VBGLHGCMHANDLE *pHandle, const char *pszServiceName, HGCMCLIENTID *pidClient);
|
---|
392 |
|
---|
393 | /**
|
---|
394 | * Connect to a service.
|
---|
395 | *
|
---|
396 | * @param handle Handle of the connection.
|
---|
397 | * @param idClient The ID of the client connection.
|
---|
398 | *
|
---|
399 | * @return VBox status code.
|
---|
400 | *
|
---|
401 | * @todo consider baking the client Id into the handle.
|
---|
402 | */
|
---|
403 | DECLR0VBGL(int) VbglR0HGCMDisconnect(VBGLHGCMHANDLE handle, HGCMCLIENTID idClient);
|
---|
404 |
|
---|
405 | /**
|
---|
406 | * Call to a service, returning only the I/O control status code.
|
---|
407 | *
|
---|
408 | * @param handle Handle of the connection.
|
---|
409 | * @param pData Call request information structure, including function parameters.
|
---|
410 | * @param cbData Length in bytes of data.
|
---|
411 | *
|
---|
412 | * @return VBox status code.
|
---|
413 | */
|
---|
414 | DECLR0VBGL(int) VbglR0HGCMCallRaw(VBGLHGCMHANDLE handle, struct VBGLIOCHGCMCALL *pData, uint32_t cbData);
|
---|
415 |
|
---|
416 | /**
|
---|
417 | * Call to a service, returning the HGCM status code.
|
---|
418 | *
|
---|
419 | * @param handle Handle of the connection.
|
---|
420 | * @param pData Call request information structure, including function parameters.
|
---|
421 | * @param cbData Length in bytes of data.
|
---|
422 | *
|
---|
423 | * @return VBox status code. Either the I/O control status code if that failed,
|
---|
424 | * or the HGCM status code (pData->Hdr.rc).
|
---|
425 | */
|
---|
426 | DECLR0VBGL(int) VbglR0HGCMCall(VBGLHGCMHANDLE handle, struct VBGLIOCHGCMCALL *pData, uint32_t cbData);
|
---|
427 |
|
---|
428 | /**
|
---|
429 | * Call to a service with user-mode data received by the calling driver from the User-Mode process.
|
---|
430 | * The call must be done in the context of a calling process.
|
---|
431 | *
|
---|
432 | * @param handle Handle of the connection.
|
---|
433 | * @param pData Call request information structure, including function parameters.
|
---|
434 | * @param cbData Length in bytes of data.
|
---|
435 | *
|
---|
436 | * @return VBox status code.
|
---|
437 | */
|
---|
438 | DECLR0VBGL(int) VbglR0HGCMCallUserDataRaw(VBGLHGCMHANDLE handle, struct VBGLIOCHGCMCALL *pData, uint32_t cbData);
|
---|
439 |
|
---|
440 | /**
|
---|
441 | * Call to a service, w/o any repacking and buffer locking in VBoxGuest,
|
---|
442 | * returning the only request related status code (not HGCM).
|
---|
443 | *
|
---|
444 | * The driver only submits the request and waits for completion, nothing else.
|
---|
445 | *
|
---|
446 | * @param hHandle The connection handle.
|
---|
447 | * @param pCallReq The call request. Will be passed directly to the host.
|
---|
448 | * @param cbCallReq The size of the whole call request.
|
---|
449 | *
|
---|
450 | * @return VBox status code.
|
---|
451 | *
|
---|
452 | * @remarks The result of the HGCM call is found in
|
---|
453 | * @a pCallReq->HgcmCallReq.header.result on a successful return. The
|
---|
454 | * @a pCallReq->Hdr.rc and @a pCallReq->HgcmCallReq.header.header.rc
|
---|
455 | * fields are the same as the return value and can safely be ignored.
|
---|
456 | */
|
---|
457 | DECLR0VBGL(int) VbglR0HGCMFastCall(VBGLHGCMHANDLE hHandle, struct VBGLIOCIDCHGCMFASTCALL *pCallReq, uint32_t cbCallReq);
|
---|
458 |
|
---|
459 | /** @} */
|
---|
460 |
|
---|
461 | /** @name Undocumented helpers for talking to the Chromium OpenGL Host Service
|
---|
462 | * @{ */
|
---|
463 | typedef VBGLHGCMHANDLE VBGLCRCTLHANDLE;
|
---|
464 | DECLR0VBGL(int) VbglR0CrCtlCreate(VBGLCRCTLHANDLE *phCtl);
|
---|
465 | DECLR0VBGL(int) VbglR0CrCtlDestroy(VBGLCRCTLHANDLE hCtl);
|
---|
466 | DECLR0VBGL(int) VbglR0CrCtlConConnect(VBGLCRCTLHANDLE hCtl, HGCMCLIENTID *pidClient);
|
---|
467 | DECLR0VBGL(int) VbglR0CrCtlConDisconnect(VBGLCRCTLHANDLE hCtl, HGCMCLIENTID idClient);
|
---|
468 | struct VBGLIOCHGCMCALL;
|
---|
469 | DECLR0VBGL(int) VbglR0CrCtlConCallRaw(VBGLCRCTLHANDLE hCtl, struct VBGLIOCHGCMCALL *pCallInfo, int cbCallInfo);
|
---|
470 | DECLR0VBGL(int) VbglR0CrCtlConCall(VBGLCRCTLHANDLE hCtl, struct VBGLIOCHGCMCALL *pCallInfo, int cbCallInfo);
|
---|
471 | DECLR0VBGL(int) VbglR0CrCtlConCallUserDataRaw(VBGLCRCTLHANDLE hCtl, struct VBGLIOCHGCMCALL *pCallInfo, int cbCallInfo);
|
---|
472 | /** @} */
|
---|
473 |
|
---|
474 | # endif /* !VBGL_VBOXGUEST */
|
---|
475 |
|
---|
476 | # endif /* VBOX_WITH_HGCM */
|
---|
477 |
|
---|
478 |
|
---|
479 | /**
|
---|
480 | * Initialize the heap.
|
---|
481 | *
|
---|
482 | * @returns VBox status code.
|
---|
483 | */
|
---|
484 | DECLR0VBGL(int) VbglR0PhysHeapInit(void);
|
---|
485 |
|
---|
486 | /**
|
---|
487 | * Shutdown the heap.
|
---|
488 | */
|
---|
489 | DECLR0VBGL(void) VbglR0PhysHeapTerminate(void);
|
---|
490 |
|
---|
491 | /**
|
---|
492 | * Allocate a memory block.
|
---|
493 | *
|
---|
494 | * @returns Virtual address of the allocated memory block.
|
---|
495 | * @param cbSize Size of block to be allocated.
|
---|
496 | */
|
---|
497 | DECLR0VBGL(void *) VbglR0PhysHeapAlloc(uint32_t cbSize);
|
---|
498 |
|
---|
499 | /**
|
---|
500 | * Get physical address of memory block pointed by the virtual address.
|
---|
501 | *
|
---|
502 | * @note WARNING!
|
---|
503 | * The function does not acquire the Heap mutex!
|
---|
504 | * When calling the function make sure that the pointer is a valid one and
|
---|
505 | * is not being deallocated. This function can NOT be used for verifying
|
---|
506 | * if the given pointer is a valid one allocated from the heap.
|
---|
507 | *
|
---|
508 | * @param pv Virtual address of memory block.
|
---|
509 | * @returns Physical address of the memory block.
|
---|
510 | */
|
---|
511 | DECLR0VBGL(uint32_t) VbglR0PhysHeapGetPhysAddr(void *pv);
|
---|
512 |
|
---|
513 | /**
|
---|
514 | * Free a memory block.
|
---|
515 | *
|
---|
516 | * @param pv Virtual address of memory block.
|
---|
517 | */
|
---|
518 | DECLR0VBGL(void) VbglR0PhysHeapFree(void *pv);
|
---|
519 |
|
---|
520 | DECLR0VBGL(int) VbglR0QueryVMMDevMemory(struct VMMDevMemory **ppVMMDevMemory);
|
---|
521 | DECLR0VBGL(bool) VbglR0CanUsePhysPageList(void);
|
---|
522 |
|
---|
523 | # ifndef VBOX_GUEST
|
---|
524 | /** @name Mouse
|
---|
525 | * @{ */
|
---|
526 | DECLR0VBGL(int) VbglR0SetMouseNotifyCallback(PFNVBOXGUESTMOUSENOTIFY pfnNotify, void *pvUser);
|
---|
527 | DECLR0VBGL(int) VbglR0GetMouseStatus(uint32_t *pfFeatures, uint32_t *px, uint32_t *py);
|
---|
528 | DECLR0VBGL(int) VbglR0SetMouseStatus(uint32_t fFeatures);
|
---|
529 | /** @} */
|
---|
530 | # endif /* VBOX_GUEST */
|
---|
531 |
|
---|
532 | #endif /* IN_RING0 */
|
---|
533 |
|
---|
534 | /** @} */
|
---|
535 |
|
---|
536 |
|
---|
537 | /** @defgroup grp_vboxguest_lib_r3 Ring-3 interface.
|
---|
538 | * @{
|
---|
539 | */
|
---|
540 | #ifdef IN_RING3
|
---|
541 |
|
---|
542 | /** @def VBGLR3DECL
|
---|
543 | * Ring 3 VBGL declaration.
|
---|
544 | * @param type The return type of the function declaration.
|
---|
545 | */
|
---|
546 | # define VBGLR3DECL(type) DECLHIDDEN(type) VBOXCALL
|
---|
547 |
|
---|
548 | /** @name General-purpose functions
|
---|
549 | * @{ */
|
---|
550 | VBGLR3DECL(int) VbglR3Init(void);
|
---|
551 | VBGLR3DECL(int) VbglR3InitUser(void);
|
---|
552 | VBGLR3DECL(void) VbglR3Term(void);
|
---|
553 | # ifdef IPRT_INCLUDED_time_h
|
---|
554 | VBGLR3DECL(int) VbglR3GetHostTime(PRTTIMESPEC pTime);
|
---|
555 | # endif
|
---|
556 | VBGLR3DECL(int) VbglR3InterruptEventWaits(void);
|
---|
557 | VBGLR3DECL(int) VbglR3WriteLog(const char *pch, size_t cch);
|
---|
558 | VBGLR3DECL(int) VbglR3CtlFilterMask(uint32_t fOr, uint32_t fNot);
|
---|
559 | VBGLR3DECL(int) VbglR3Daemonize(bool fNoChDir, bool fNoClose, bool fRespawn, unsigned *pcRespawn);
|
---|
560 | VBGLR3DECL(int) VbglR3PidFile(const char *pszPath, PRTFILE phFile);
|
---|
561 | VBGLR3DECL(void) VbglR3ClosePidFile(const char *pszPath, RTFILE hFile);
|
---|
562 | VBGLR3DECL(int) VbglR3SetGuestCaps(uint32_t fOr, uint32_t fNot);
|
---|
563 | VBGLR3DECL(int) VbglR3AcquireGuestCaps(uint32_t fOr, uint32_t fNot, bool fConfig);
|
---|
564 | VBGLR3DECL(int) VbglR3WaitEvent(uint32_t fMask, uint32_t cMillies, uint32_t *pfEvents);
|
---|
565 |
|
---|
566 | VBGLR3DECL(int) VbglR3ReportAdditionsStatus(VBoxGuestFacilityType Facility, VBoxGuestFacilityStatus StatusCurrent,
|
---|
567 | uint32_t fFlags);
|
---|
568 | VBGLR3DECL(int) VbglR3GetAdditionsVersion(char **ppszVer, char **ppszVerEx, char **ppszRev);
|
---|
569 | VBGLR3DECL(int) VbglR3GetAdditionsInstallationPath(char **ppszPath);
|
---|
570 | VBGLR3DECL(int) VbglR3GetSessionId(uint64_t *pu64IdSession);
|
---|
571 |
|
---|
572 | /** @} */
|
---|
573 |
|
---|
574 | # ifdef VBOX_WITH_SHARED_CLIPBOARD
|
---|
575 | /** @name Shared Clipboard
|
---|
576 | * @{ */
|
---|
577 |
|
---|
578 | /**
|
---|
579 | * Structure containing the context required for
|
---|
580 | * either retrieving or sending a HGCM shared clipboard
|
---|
581 | * commands from or to the host.
|
---|
582 | *
|
---|
583 | * Note: Do not change parameter order without also
|
---|
584 | * adapting all structure initializers.
|
---|
585 | */
|
---|
586 | typedef struct VBGLR3SHCLCMDCTX
|
---|
587 | {
|
---|
588 | /** @todo This struct could be handy if we want to implement
|
---|
589 | * a second communication channel, e.g. via TCP/IP.
|
---|
590 | * Use a union for the HGCM stuff then. */
|
---|
591 |
|
---|
592 | /** IN: HGCM client ID to use for communication. */
|
---|
593 | uint32_t uClientID;
|
---|
594 | /** IN/OUT: Context ID to retrieve or to use. */
|
---|
595 | uint32_t uContextID;
|
---|
596 | /** IN: Protocol version to use. */
|
---|
597 | uint32_t uProtocol;
|
---|
598 | /** IN: Maximum chunk size (in bytes). */
|
---|
599 | uint32_t cbChunkSize;
|
---|
600 | /** OUT: Number of parameters retrieved. */
|
---|
601 | uint32_t uNumParms;
|
---|
602 | } VBGLR3SHCLCMDCTX, *PVBGLR3SHCLCMDCTX;
|
---|
603 |
|
---|
604 | # ifdef VBOX_WITH_SHARED_CLIPBOARD_URI_LIST
|
---|
605 | /**
|
---|
606 | * Enumeration specifying a Shared Clipboard event type.
|
---|
607 | */
|
---|
608 | typedef enum _VBGLR3CLIPBOARDEVENTTYPE
|
---|
609 | {
|
---|
610 | VBGLR3CLIPBOARDEVENTTYPE_INVALID = 0,
|
---|
611 | VBGLR3CLIPBOARDEVENTTYPE_URI_LIST_HDR_READ,
|
---|
612 | VBGLR3CLIPBOARDEVENTTYPE_URI_LIST_HDR_WRITE,
|
---|
613 | VBGLR3CLIPBOARDEVENTTYPE_URI_LIST_ENTRY_READ,
|
---|
614 | VBGLR3CLIPBOARDEVENTTYPE_URI_LIST_ENTRY_WRITE,
|
---|
615 | VBGLR3CLIPBOARDEVENTTYPE_URI_OBJ_OPEN,
|
---|
616 | VBGLR3CLIPBOARDEVENTTYPE_URI_OBJ_CLOSE,
|
---|
617 | VBGLR3CLIPBOARDEVENTTYPE_URI_OBJ_READ,
|
---|
618 | VBGLR3CLIPBOARDEVENTTYPE_URI_OBJ_WRITE,
|
---|
619 | VBGLR3CLIPBOARDEVENTTYPE_URI_CANCEL,
|
---|
620 | VBGLR3CLIPBOARDEVENTTYPE_URI_ERROR,
|
---|
621 | /** Blow the type up to 32-bit. */
|
---|
622 | VBGLR3CLIPBOARDEVENTTYPE_32BIT_HACK = 0x7fffffff
|
---|
623 | } VBGLR3CLIPBOARDEVENTTYPE;
|
---|
624 |
|
---|
625 | typedef struct _VBGLR3CLIPBOARDEVENT
|
---|
626 | {
|
---|
627 | /** The event type the union contains. */
|
---|
628 | VBGLR3CLIPBOARDEVENTTYPE enmType;
|
---|
629 | union
|
---|
630 | {
|
---|
631 | struct
|
---|
632 | {
|
---|
633 | PVBOXCLIPBOARDLISTHDR pHdr;
|
---|
634 | } ListHdrRead, ListHdrWrite;
|
---|
635 | } u;
|
---|
636 | } VBGLR3CLIPBOARDEVENT, *PVBGLR3CLIPBOARDEVENT;
|
---|
637 | typedef const PVBGLR3CLIPBOARDEVENT CPVBGLR3CLIPBOARDEVENT;
|
---|
638 | # endif /* VBOX_WITH_SHARED_CLIPBOARD_URI_LIST */
|
---|
639 |
|
---|
640 | VBGLR3DECL(int) VbglR3ClipboardConnect(HGCMCLIENTID *pidClient);
|
---|
641 | VBGLR3DECL(int) VbglR3ClipboardDisconnect(HGCMCLIENTID idClient);
|
---|
642 | VBGLR3DECL(int) VbglR3ClipboardGetHostMsgOld(HGCMCLIENTID idClient, uint32_t *pMsg, uint32_t *pfFormats);
|
---|
643 | VBGLR3DECL(int) VbglR3ClipboardReadData(HGCMCLIENTID idClient, uint32_t fFormat, void *pv, uint32_t cb, uint32_t *pcb);
|
---|
644 | VBGLR3DECL(int) VbglR3ClipboardReportFormats(HGCMCLIENTID idClient, uint32_t fFormats);
|
---|
645 | VBGLR3DECL(int) VbglR3ClipboardWriteData(HGCMCLIENTID idClient, uint32_t fFormat, void *pv, uint32_t cb);
|
---|
646 |
|
---|
647 | # ifdef VBOX_WITH_SHARED_CLIPBOARD_URI_LIST
|
---|
648 | VBGLR3DECL(int) VbglR3ClipboardConnectEx(PVBGLR3SHCLCMDCTX pCtx);
|
---|
649 | VBGLR3DECL(int) VbglR3ClipboardDisconnectEx(PVBGLR3SHCLCMDCTX pCtx);
|
---|
650 | VBGLR3DECL(int) VbglR3ClipboardEventGetNext(PVBGLR3SHCLCMDCTX pCtx, PSHAREDCLIPBOARDURITRANSFER pTransfer,
|
---|
651 | PVBGLR3CLIPBOARDEVENT *ppEvent);
|
---|
652 | VBGLR3DECL(void) VbglR3ClipboardEventFree(PVBGLR3CLIPBOARDEVENT pEvent);
|
---|
653 |
|
---|
654 | VBGLR3DECL(int) VbglR3ClipboardTransferSendStatus(PVBGLR3SHCLCMDCTX pCtx, SHAREDCLIPBOARDURITRANSFERSTATUS uStatus);
|
---|
655 |
|
---|
656 | VBGLR3DECL(int) VbglR3ClipboardRootListRead(PVBGLR3SHCLCMDCTX pCtx, PVBOXCLIPBOARDROOTLIST *ppRootList);
|
---|
657 |
|
---|
658 | VBGLR3DECL(int) VbglR3ClipboardRootListHdrReadReq(PVBGLR3SHCLCMDCTX pCtx, uint32_t *pfRoots);
|
---|
659 | VBGLR3DECL(int) VbglR3ClipboardRootListHdrReadReply(PVBGLR3SHCLCMDCTX pCtx, PVBOXCLIPBOARDROOTLIST pRootList);
|
---|
660 | VBGLR3DECL(int) VbglR3ClipboardRootsWrite(PVBGLR3SHCLCMDCTX pCtx, PVBOXCLIPBOARDROOTLISTHDR pRoots);
|
---|
661 |
|
---|
662 | VBGLR3DECL(int) VbglR3ClipboardListOpenSend(PVBGLR3SHCLCMDCTX pCtx, PVBOXCLIPBOARDLISTOPENPARMS pOpenParms, PSHAREDCLIPBOARDLISTHANDLE phList);
|
---|
663 | VBGLR3DECL(int) VbglR3ClipboardListOpenRecv(PVBGLR3SHCLCMDCTX pCtx, PVBOXCLIPBOARDLISTOPENPARMS pOpenParms);
|
---|
664 | VBGLR3DECL(int) VbglR3ClipboardListOpenReply(PVBGLR3SHCLCMDCTX pCtx, int rcReply, SHAREDCLIPBOARDLISTHANDLE hList);
|
---|
665 |
|
---|
666 | VBGLR3DECL(int) VbglR3ClipboardListCloseSend(PVBGLR3SHCLCMDCTX pCtx, SHAREDCLIPBOARDLISTHANDLE hList);
|
---|
667 | VBGLR3DECL(int) VbglR3ClipboardListCloseRecv(PVBGLR3SHCLCMDCTX pCtx, PSHAREDCLIPBOARDLISTHANDLE phList);
|
---|
668 |
|
---|
669 | VBGLR3DECL(int) VbglR3ClipboardListHdrWrite(PVBGLR3SHCLCMDCTX pCtx, SHAREDCLIPBOARDLISTHANDLE hList, PVBOXCLIPBOARDLISTHDR pListHdr);
|
---|
670 | VBGLR3DECL(int) VbglR3ClipboardListEntryWrite(PVBGLR3SHCLCMDCTX pCtx, SHAREDCLIPBOARDLISTHANDLE hList, PVBOXCLIPBOARDLISTENTRY pListEntry);
|
---|
671 |
|
---|
672 | VBGLR3DECL(int) VbglR3ClipboardObjOpenRecv(PVBGLR3SHCLCMDCTX pCtx, PVBOXCLIPBOARDOBJOPENCREATEPARMS pCreateParms);
|
---|
673 | VBGLR3DECL(int) VbglR3ClipboardObjOpenReply(PVBGLR3SHCLCMDCTX pCtx, int rcReply, SHAREDCLIPBOARDOBJHANDLE hObj);
|
---|
674 | VBGLR3DECL(int) VbglR3ClipboardObjOpenSend(PVBGLR3SHCLCMDCTX pCtx, PVBOXCLIPBOARDOBJOPENCREATEPARMS pCreateParms,
|
---|
675 | PSHAREDCLIPBOARDOBJHANDLE phObj);
|
---|
676 |
|
---|
677 | VBGLR3DECL(int) VbglR3ClipboardObjCloseRecv(PVBGLR3SHCLCMDCTX pCtx, PSHAREDCLIPBOARDOBJHANDLE phObj);
|
---|
678 | VBGLR3DECL(int) VbglR3ClipboardObjCloseReply(PVBGLR3SHCLCMDCTX pCtx, int rcReply, SHAREDCLIPBOARDOBJHANDLE hObj);
|
---|
679 | VBGLR3DECL(int) VbglR3ClipboardObjCloseSend(PVBGLR3SHCLCMDCTX pCtx, SHAREDCLIPBOARDOBJHANDLE hObj);
|
---|
680 |
|
---|
681 | VBGLR3DECL(int) VbglR3ClipboardObjReadRecv(PVBGLR3SHCLCMDCTX pCtx, PSHAREDCLIPBOARDOBJHANDLE phObj, uint32_t pcbToRead,
|
---|
682 | uint32_t *pfFlags);
|
---|
683 | VBGLR3DECL(int) VbglR3ClipboardObjRead(PVBGLR3SHCLCMDCTX pCtx, SHAREDCLIPBOARDOBJHANDLE hObj, void *pvBuf, uint32_t cbBuf,
|
---|
684 | uint32_t *pcbRead);
|
---|
685 | VBGLR3DECL(int) VbglR3ClipboardObjWrite(PVBGLR3SHCLCMDCTX pCtx, SHAREDCLIPBOARDOBJHANDLE hObj, void *pvBuf, uint32_t cbBuf,
|
---|
686 | uint32_t *pcbWritten);
|
---|
687 |
|
---|
688 | VBGLR3DECL(int) VbglR3ClipboardWriteError(HGCMCLIENTID idClient, int rcErr);
|
---|
689 | # endif /* VBOX_WITH_SHARED_CLIPBOARD_URI_LIST */
|
---|
690 | /** @} */
|
---|
691 | # endif /* VBOX_WITH_SHARED_CLIPBOARD */
|
---|
692 |
|
---|
693 | /** @name Seamless mode
|
---|
694 | * @{ */
|
---|
695 | VBGLR3DECL(int) VbglR3SeamlessSetCap(bool fState);
|
---|
696 | VBGLR3DECL(int) VbglR3SeamlessWaitEvent(VMMDevSeamlessMode *pMode);
|
---|
697 | VBGLR3DECL(int) VbglR3SeamlessSendRects(uint32_t cRects, PRTRECT pRects);
|
---|
698 | VBGLR3DECL(int) VbglR3SeamlessGetLastEvent(VMMDevSeamlessMode *pMode);
|
---|
699 |
|
---|
700 | /** @} */
|
---|
701 |
|
---|
702 | /** @name Mouse
|
---|
703 | * @{ */
|
---|
704 | VBGLR3DECL(int) VbglR3GetMouseStatus(uint32_t *pfFeatures, uint32_t *px, uint32_t *py);
|
---|
705 | VBGLR3DECL(int) VbglR3SetMouseStatus(uint32_t fFeatures);
|
---|
706 | /** @} */
|
---|
707 |
|
---|
708 | /** @name Video
|
---|
709 | * @{ */
|
---|
710 | VBGLR3DECL(int) VbglR3VideoAccelEnable(bool fEnable);
|
---|
711 | VBGLR3DECL(int) VbglR3VideoAccelFlush(void);
|
---|
712 | VBGLR3DECL(int) VbglR3SetPointerShape(uint32_t fFlags, uint32_t xHot, uint32_t yHot, uint32_t cx, uint32_t cy,
|
---|
713 | const void *pvImg, size_t cbImg);
|
---|
714 | VBGLR3DECL(int) VbglR3SetPointerShapeReq(struct VMMDevReqMousePointer *pReq);
|
---|
715 | /** @} */
|
---|
716 |
|
---|
717 | /** @name Display
|
---|
718 | * @{ */
|
---|
719 | /** The folder for the video mode hint unix domain socket on Unix-like guests.
|
---|
720 | * @note This can be safely changed as all users are rebuilt in lock-step. */
|
---|
721 | #define VBGLR3HOSTDISPSOCKETPATH "/tmp/.VBoxService"
|
---|
722 | /** The path to the video mode hint unix domain socket on Unix-like guests. */
|
---|
723 | #define VBGLR3HOSTDISPSOCKET VBGLR3VIDEOMODEHINTSOCKETPATH "/VideoModeHint"
|
---|
724 |
|
---|
725 | /** The folder for saving video mode hints to between sessions. */
|
---|
726 | #define VBGLR3HOSTDISPSAVEDMODEPATH "/var/lib/VBoxGuestAdditions"
|
---|
727 | /** The path to the file for saving video mode hints to between sessions. */
|
---|
728 | #define VBGLR3HOSTDISPSAVEDMODE VBGLR3HOSTDISPSAVEDMODEPATH "/SavedVideoModes"
|
---|
729 |
|
---|
730 | VBGLR3DECL(int) VbglR3GetDisplayChangeRequest(uint32_t *pcx, uint32_t *pcy, uint32_t *pcBits, uint32_t *piDisplay,
|
---|
731 | uint32_t *pdx, uint32_t *pdy, bool *pfEnabled, bool *pfChangeOrigin, bool fAck);
|
---|
732 | VBGLR3DECL(int) VbglR3GetDisplayChangeRequestMulti(uint32_t cDisplaysIn, uint32_t *pcDisplaysOut,
|
---|
733 | VMMDevDisplayDef *paDisplays, bool fAck);
|
---|
734 | VBGLR3DECL(bool) VbglR3HostLikesVideoMode(uint32_t cx, uint32_t cy, uint32_t cBits);
|
---|
735 | VBGLR3DECL(int) VbglR3VideoModeGetHighestSavedScreen(unsigned *pcScreen);
|
---|
736 | VBGLR3DECL(int) VbglR3SaveVideoMode(unsigned cScreen, unsigned cx, unsigned cy, unsigned cBits,
|
---|
737 | unsigned x, unsigned y, bool fEnabled);
|
---|
738 | VBGLR3DECL(int) VbglR3RetrieveVideoMode(unsigned cScreen, unsigned *pcx, unsigned *pcy, unsigned *pcBits,
|
---|
739 | unsigned *px, unsigned *py, bool *pfEnabled);
|
---|
740 | /** @} */
|
---|
741 |
|
---|
742 | /** @name VRDP
|
---|
743 | * @{ */
|
---|
744 | VBGLR3DECL(int) VbglR3VrdpGetChangeRequest(bool *pfActive, uint32_t *puExperienceLevel);
|
---|
745 | /** @} */
|
---|
746 |
|
---|
747 | /** @name VM Statistics
|
---|
748 | * @{ */
|
---|
749 | VBGLR3DECL(int) VbglR3StatQueryInterval(uint32_t *pu32Interval);
|
---|
750 | # if defined(VBOX_INCLUDED_VMMDev_h) || defined(DOXYGEN_RUNNING)
|
---|
751 | VBGLR3DECL(int) VbglR3StatReport(VMMDevReportGuestStats *pReq);
|
---|
752 | # endif
|
---|
753 | /** @} */
|
---|
754 |
|
---|
755 | /** @name Memory ballooning
|
---|
756 | * @{ */
|
---|
757 | VBGLR3DECL(int) VbglR3MemBalloonRefresh(uint32_t *pcChunks, bool *pfHandleInR3);
|
---|
758 | VBGLR3DECL(int) VbglR3MemBalloonChange(void *pv, bool fInflate);
|
---|
759 | /** @} */
|
---|
760 |
|
---|
761 | /** @name Core Dump
|
---|
762 | * @{ */
|
---|
763 | VBGLR3DECL(int) VbglR3WriteCoreDump(void);
|
---|
764 |
|
---|
765 | /** @} */
|
---|
766 |
|
---|
767 | # ifdef VBOX_WITH_GUEST_PROPS
|
---|
768 | /** @name Guest properties
|
---|
769 | * @{ */
|
---|
770 | /** @todo Docs. */
|
---|
771 | typedef struct VBGLR3GUESTPROPENUM VBGLR3GUESTPROPENUM;
|
---|
772 | /** @todo Docs. */
|
---|
773 | typedef VBGLR3GUESTPROPENUM *PVBGLR3GUESTPROPENUM;
|
---|
774 | VBGLR3DECL(int) VbglR3GuestPropConnect(uint32_t *pidClient);
|
---|
775 | VBGLR3DECL(int) VbglR3GuestPropDisconnect(HGCMCLIENTID idClient);
|
---|
776 | VBGLR3DECL(int) VbglR3GuestPropWrite(HGCMCLIENTID idClient, const char *pszName, const char *pszValue, const char *pszFlags);
|
---|
777 | VBGLR3DECL(int) VbglR3GuestPropWriteValue(HGCMCLIENTID idClient, const char *pszName, const char *pszValue);
|
---|
778 | VBGLR3DECL(int) VbglR3GuestPropWriteValueV(HGCMCLIENTID idClient, const char *pszName,
|
---|
779 | const char *pszValueFormat, va_list va) RT_IPRT_FORMAT_ATTR(3, 0);
|
---|
780 | VBGLR3DECL(int) VbglR3GuestPropWriteValueF(HGCMCLIENTID idClient, const char *pszName,
|
---|
781 | const char *pszValueFormat, ...) RT_IPRT_FORMAT_ATTR(3, 4);
|
---|
782 | VBGLR3DECL(int) VbglR3GuestPropRead(HGCMCLIENTID idClient, const char *pszName, void *pvBuf, uint32_t cbBuf, char **ppszValue,
|
---|
783 | uint64_t *pu64Timestamp, char **ppszFlags, uint32_t *pcbBufActual);
|
---|
784 | VBGLR3DECL(int) VbglR3GuestPropReadValue(uint32_t ClientId, const char *pszName, char *pszValue, uint32_t cchValue,
|
---|
785 | uint32_t *pcchValueActual);
|
---|
786 | VBGLR3DECL(int) VbglR3GuestPropReadValueAlloc(HGCMCLIENTID idClient, const char *pszName, char **ppszValue);
|
---|
787 | VBGLR3DECL(void) VbglR3GuestPropReadValueFree(char *pszValue);
|
---|
788 | VBGLR3DECL(int) VbglR3GuestPropEnumRaw(HGCMCLIENTID idClient, const char *paszPatterns, char *pcBuf, uint32_t cbBuf,
|
---|
789 | uint32_t *pcbBufActual);
|
---|
790 | VBGLR3DECL(int) VbglR3GuestPropEnum(HGCMCLIENTID idClient, char const * const *ppaszPatterns, uint32_t cPatterns,
|
---|
791 | PVBGLR3GUESTPROPENUM *ppHandle, char const **ppszName, char const **ppszValue,
|
---|
792 | uint64_t *pu64Timestamp, char const **ppszFlags);
|
---|
793 | VBGLR3DECL(int) VbglR3GuestPropEnumNext(PVBGLR3GUESTPROPENUM pHandle, char const **ppszName, char const **ppszValue,
|
---|
794 | uint64_t *pu64Timestamp, char const **ppszFlags);
|
---|
795 | VBGLR3DECL(void) VbglR3GuestPropEnumFree(PVBGLR3GUESTPROPENUM pHandle);
|
---|
796 | VBGLR3DECL(int) VbglR3GuestPropDelete(HGCMCLIENTID idClient, const char *pszName);
|
---|
797 | VBGLR3DECL(int) VbglR3GuestPropDelSet(HGCMCLIENTID idClient, char const * const *papszPatterns, uint32_t cPatterns);
|
---|
798 | VBGLR3DECL(int) VbglR3GuestPropWait(HGCMCLIENTID idClient, const char *pszPatterns, void *pvBuf, uint32_t cbBuf,
|
---|
799 | uint64_t u64Timestamp, uint32_t cMillies, char ** ppszName, char **ppszValue,
|
---|
800 | uint64_t *pu64Timestamp, char **ppszFlags, uint32_t *pcbBufActual);
|
---|
801 | /** @} */
|
---|
802 |
|
---|
803 | /** @name Guest user handling / reporting.
|
---|
804 | * @{ */
|
---|
805 | VBGLR3DECL(int) VbglR3GuestUserReportState(const char *pszUser, const char *pszDomain, VBoxGuestUserState enmState,
|
---|
806 | uint8_t *pbDetails, uint32_t cbDetails);
|
---|
807 | /** @} */
|
---|
808 |
|
---|
809 | /** @name Host version handling
|
---|
810 | * @{ */
|
---|
811 | VBGLR3DECL(int) VbglR3HostVersionCheckForUpdate(HGCMCLIENTID idClient, bool *pfUpdate, char **ppszHostVersion,
|
---|
812 | char **ppszGuestVersion);
|
---|
813 | VBGLR3DECL(int) VbglR3HostVersionLastCheckedLoad(HGCMCLIENTID idClient, char **ppszVer);
|
---|
814 | VBGLR3DECL(int) VbglR3HostVersionLastCheckedStore(HGCMCLIENTID idClient, const char *pszVer);
|
---|
815 | /** @} */
|
---|
816 | # endif /* VBOX_WITH_GUEST_PROPS defined */
|
---|
817 |
|
---|
818 | # ifdef VBOX_WITH_SHARED_FOLDERS
|
---|
819 | /** @name Shared folders
|
---|
820 | * @{ */
|
---|
821 | /**
|
---|
822 | * Structure containing mapping information for a shared folder.
|
---|
823 | */
|
---|
824 | typedef struct VBGLR3SHAREDFOLDERMAPPING
|
---|
825 | {
|
---|
826 | /** Mapping status. */
|
---|
827 | uint32_t u32Status;
|
---|
828 | /** Root handle. */
|
---|
829 | uint32_t u32Root;
|
---|
830 | } VBGLR3SHAREDFOLDERMAPPING;
|
---|
831 | /** Pointer to a shared folder mapping information structure. */
|
---|
832 | typedef VBGLR3SHAREDFOLDERMAPPING *PVBGLR3SHAREDFOLDERMAPPING;
|
---|
833 | /** Pointer to a const shared folder mapping information structure. */
|
---|
834 | typedef VBGLR3SHAREDFOLDERMAPPING const *PCVBGLR3SHAREDFOLDERMAPPING;
|
---|
835 |
|
---|
836 | VBGLR3DECL(int) VbglR3SharedFolderConnect(uint32_t *pidClient);
|
---|
837 | VBGLR3DECL(int) VbglR3SharedFolderDisconnect(HGCMCLIENTID idClient);
|
---|
838 | VBGLR3DECL(bool) VbglR3SharedFolderExists(HGCMCLIENTID idClient, const char *pszShareName);
|
---|
839 | VBGLR3DECL(int) VbglR3SharedFolderGetMappings(HGCMCLIENTID idClient, bool fAutoMountOnly,
|
---|
840 | PVBGLR3SHAREDFOLDERMAPPING *ppaMappings, uint32_t *pcMappings);
|
---|
841 | VBGLR3DECL(void) VbglR3SharedFolderFreeMappings(PVBGLR3SHAREDFOLDERMAPPING paMappings);
|
---|
842 | VBGLR3DECL(int) VbglR3SharedFolderGetName(HGCMCLIENTID idClient,uint32_t u32Root, char **ppszName); /**< @todo r=bird: GET functions return the value, not a status code!*/
|
---|
843 | VBGLR3DECL(int) VbglR3SharedFolderQueryFolderInfo(HGCMCLIENTID idClient, uint32_t idRoot, uint64_t fQueryFlags,
|
---|
844 | char **ppszName, char **ppszMountPoint,
|
---|
845 | uint64_t *pfFlags, uint32_t *puRootIdVersion);
|
---|
846 | VBGLR3DECL(int) VbglR3SharedFolderWaitForMappingsChanges(HGCMCLIENTID idClient, uint32_t uPrevVersion, uint32_t *puCurVersion);
|
---|
847 | VBGLR3DECL(int) VbglR3SharedFolderCancelMappingsChangesWaits(HGCMCLIENTID idClient);
|
---|
848 |
|
---|
849 | VBGLR3DECL(int) VbglR3SharedFolderGetMountPrefix(char **ppszPrefix); /**< @todo r=bird: GET functions return the value, not a status code! */
|
---|
850 | VBGLR3DECL(int) VbglR3SharedFolderGetMountDir(char **ppszDir); /**< @todo r=bird: GET functions return the value, not a status code! */
|
---|
851 | /** @} */
|
---|
852 | # endif /* VBOX_WITH_SHARED_FOLDERS defined */
|
---|
853 |
|
---|
854 | # ifdef VBOX_WITH_GUEST_CONTROL
|
---|
855 | /** @name Guest control
|
---|
856 | * @{ */
|
---|
857 |
|
---|
858 | /**
|
---|
859 | * Structure containing the context required for
|
---|
860 | * either retrieving or sending a HGCM guest control
|
---|
861 | * commands from or to the host.
|
---|
862 | *
|
---|
863 | * Note: Do not change parameter order without also
|
---|
864 | * adapting all structure initializers.
|
---|
865 | */
|
---|
866 | typedef struct VBGLR3GUESTCTRLCMDCTX
|
---|
867 | {
|
---|
868 | /** @todo This struct could be handy if we want to implement
|
---|
869 | * a second communication channel, e.g. via TCP/IP.
|
---|
870 | * Use a union for the HGCM stuff then. */
|
---|
871 |
|
---|
872 | /** IN: HGCM client ID to use for communication. */
|
---|
873 | uint32_t uClientID;
|
---|
874 | /** IN/OUT: Context ID to retrieve or to use. */
|
---|
875 | uint32_t uContextID;
|
---|
876 | /** IN: Protocol version to use. */
|
---|
877 | uint32_t uProtocol;
|
---|
878 | /** OUT: Number of parameters retrieved. */
|
---|
879 | uint32_t uNumParms;
|
---|
880 | } VBGLR3GUESTCTRLCMDCTX, *PVBGLR3GUESTCTRLCMDCTX;
|
---|
881 |
|
---|
882 | /* General message handling on the guest. */
|
---|
883 | VBGLR3DECL(int) VbglR3GuestCtrlConnect(uint32_t *pidClient);
|
---|
884 | VBGLR3DECL(int) VbglR3GuestCtrlDisconnect(uint32_t idClient);
|
---|
885 | VBGLR3DECL(bool) VbglR3GuestCtrlSupportsOptimizations(uint32_t idClient);
|
---|
886 | VBGLR3DECL(int) VbglR3GuestCtrlMakeMeMaster(uint32_t idClient);
|
---|
887 | VBGLR3DECL(int) VbglR3GuestCtrlReportFeatures(uint32_t idClient, uint64_t fGuestFeatures, uint64_t *pfHostFeatures);
|
---|
888 | VBGLR3DECL(int) VbglR3GuestCtrlQueryFeatures(uint32_t idClient, uint64_t *pfHostFeatures);
|
---|
889 | VBGLR3DECL(int) VbglR3GuestCtrlMsgFilterSet(uint32_t uClientId, uint32_t uValue, uint32_t uMaskAdd, uint32_t uMaskRemove);
|
---|
890 | VBGLR3DECL(int) VbglR3GuestCtrlMsgReply(PVBGLR3GUESTCTRLCMDCTX pCtx, int rc);
|
---|
891 | VBGLR3DECL(int) VbglR3GuestCtrlMsgReplyEx(PVBGLR3GUESTCTRLCMDCTX pCtx, int rc, uint32_t uType,
|
---|
892 | void *pvPayload, uint32_t cbPayload);
|
---|
893 | VBGLR3DECL(int) VbglR3GuestCtrlMsgSkip(uint32_t idClient, int rcSkip, uint32_t idMsg);
|
---|
894 | VBGLR3DECL(int) VbglR3GuestCtrlMsgSkipOld(uint32_t uClientId);
|
---|
895 | VBGLR3DECL(int) VbglR3GuestCtrlMsgPeekWait(uint32_t idClient, uint32_t *pidMsg, uint32_t *pcParameters, uint64_t *pidRestoreCheck);
|
---|
896 | VBGLR3DECL(int) VbglR3GuestCtrlCancelPendingWaits(HGCMCLIENTID idClient);
|
---|
897 | /* Guest session handling. */
|
---|
898 | VBGLR3DECL(int) VbglR3GuestCtrlSessionPrepare(uint32_t idClient, uint32_t idSession, void const *pvKey, uint32_t cbKey);
|
---|
899 | VBGLR3DECL(int) VbglR3GuestCtrlSessionAccept(uint32_t idClient, uint32_t idSession, void const *pvKey, uint32_t cbKey);
|
---|
900 | VBGLR3DECL(int) VbglR3GuestCtrlSessionCancelPrepared(uint32_t idClient, uint32_t idSession);
|
---|
901 | VBGLR3DECL(int) VbglR3GuestCtrlSessionClose(PVBGLR3GUESTCTRLCMDCTX pCtx, uint32_t fFlags);
|
---|
902 | VBGLR3DECL(int) VbglR3GuestCtrlSessionNotify(PVBGLR3GUESTCTRLCMDCTX pCtx, uint32_t uType, int32_t iResult);
|
---|
903 | VBGLR3DECL(int) VbglR3GuestCtrlSessionGetOpen(PVBGLR3GUESTCTRLCMDCTX pCtx, uint32_t *puProtocol, char *pszUser, uint32_t cbUser,
|
---|
904 | char *pszPassword, uint32_t cbPassword, char *pszDomain, uint32_t cbDomain,
|
---|
905 | uint32_t *pfFlags, uint32_t *pidSession);
|
---|
906 | VBGLR3DECL(int) VbglR3GuestCtrlSessionGetClose(PVBGLR3GUESTCTRLCMDCTX pCtx, uint32_t *pfFlags, uint32_t *pidSession);
|
---|
907 | /* Guest path handling. */
|
---|
908 | VBGLR3DECL(int) VbglR3GuestCtrlPathGetRename(PVBGLR3GUESTCTRLCMDCTX pCtx, char *pszSource, uint32_t cbSource, char *pszDest,
|
---|
909 | uint32_t cbDest, uint32_t *pfFlags);
|
---|
910 | VBGLR3DECL(int) VbglR3GuestCtrlPathGetUserDocuments(PVBGLR3GUESTCTRLCMDCTX pCtx);
|
---|
911 | VBGLR3DECL(int) VbglR3GuestCtrlPathGetUserHome(PVBGLR3GUESTCTRLCMDCTX pCtx);
|
---|
912 | /* Guest process execution. */
|
---|
913 | VBGLR3DECL(int) VbglR3GuestCtrlProcGetStart(PVBGLR3GUESTCTRLCMDCTX pCtx, char *pszCmd, uint32_t cbCmd, uint32_t *pfFlags,
|
---|
914 | char *pszArgs, uint32_t cbArgs, uint32_t *puNumArgs, char *pszEnv, uint32_t *pcbEnv,
|
---|
915 | uint32_t *puNumEnvVars, char *pszUser, uint32_t cbUser, char *pszPassword,
|
---|
916 | uint32_t cbPassword, uint32_t *puTimeoutMS, uint32_t *puPriority,
|
---|
917 | uint64_t *puAffinity, uint32_t cbAffinity, uint32_t *pcAffinity);
|
---|
918 | VBGLR3DECL(int) VbglR3GuestCtrlProcGetTerminate(PVBGLR3GUESTCTRLCMDCTX pCtx, uint32_t *puPID);
|
---|
919 | VBGLR3DECL(int) VbglR3GuestCtrlProcGetInput(PVBGLR3GUESTCTRLCMDCTX pCtx, uint32_t *puPID, uint32_t *pfFlags, void *pvData,
|
---|
920 | uint32_t cbData, uint32_t *pcbSize);
|
---|
921 | VBGLR3DECL(int) VbglR3GuestCtrlProcGetOutput(PVBGLR3GUESTCTRLCMDCTX pCtx, uint32_t *puPID, uint32_t *puHandle, uint32_t *pfFlags);
|
---|
922 | VBGLR3DECL(int) VbglR3GuestCtrlProcGetWaitFor(PVBGLR3GUESTCTRLCMDCTX pCtx, uint32_t *puPID, uint32_t *puWaitFlags,
|
---|
923 | uint32_t *puTimeoutMS);
|
---|
924 | /* Guest native directory handling. */
|
---|
925 | VBGLR3DECL(int) VbglR3GuestCtrlDirGetRemove(PVBGLR3GUESTCTRLCMDCTX pCtx, char *pszPath, uint32_t cbPath, uint32_t *pfFlags);
|
---|
926 | /* Guest native file handling. */
|
---|
927 | VBGLR3DECL(int) VbglR3GuestCtrlFileGetOpen(PVBGLR3GUESTCTRLCMDCTX pCtx, char *pszFileName, uint32_t cbFileName, char *pszOpenMode,
|
---|
928 | uint32_t cbOpenMode, char *pszDisposition, uint32_t cbDisposition, char *pszSharing,
|
---|
929 | uint32_t cbSharing, uint32_t *puCreationMode, uint64_t *puOffset);
|
---|
930 | VBGLR3DECL(int) VbglR3GuestCtrlFileGetClose(PVBGLR3GUESTCTRLCMDCTX pCtx, uint32_t *puHandle);
|
---|
931 | VBGLR3DECL(int) VbglR3GuestCtrlFileGetRead(PVBGLR3GUESTCTRLCMDCTX pCtx, uint32_t *puHandle, uint32_t *puToRead);
|
---|
932 | VBGLR3DECL(int) VbglR3GuestCtrlFileGetReadAt(PVBGLR3GUESTCTRLCMDCTX pCtx, uint32_t *puHandle,
|
---|
933 | uint32_t *puToRead, uint64_t *poffRead);
|
---|
934 | VBGLR3DECL(int) VbglR3GuestCtrlFileGetWrite(PVBGLR3GUESTCTRLCMDCTX pCtx, uint32_t *puHandle,
|
---|
935 | void *pvData, uint32_t cbData, uint32_t *pcbActual);
|
---|
936 | VBGLR3DECL(int) VbglR3GuestCtrlFileGetWriteAt(PVBGLR3GUESTCTRLCMDCTX pCtx, uint32_t *puHandle, void *pvData, uint32_t cbData,
|
---|
937 | uint32_t *pcbActual, uint64_t *poffWrite);
|
---|
938 | VBGLR3DECL(int) VbglR3GuestCtrlFileGetSeek(PVBGLR3GUESTCTRLCMDCTX pCtx, uint32_t *puHandle,
|
---|
939 | uint32_t *puSeekMethod, uint64_t *poffSeek);
|
---|
940 | VBGLR3DECL(int) VbglR3GuestCtrlFileGetTell(PVBGLR3GUESTCTRLCMDCTX pCtx, uint32_t *puHandle);
|
---|
941 | VBGLR3DECL(int) VbglR3GuestCtrlFileGetSetSize(PVBGLR3GUESTCTRLCMDCTX pCtx, uint32_t *puHandle, uint64_t *pcbNew);
|
---|
942 |
|
---|
943 | /* Guest -> Host. */
|
---|
944 | VBGLR3DECL(int) VbglR3GuestCtrlFileCbOpen(PVBGLR3GUESTCTRLCMDCTX pCtx, uint32_t uRc, uint32_t uFileHandle);
|
---|
945 | VBGLR3DECL(int) VbglR3GuestCtrlFileCbClose(PVBGLR3GUESTCTRLCMDCTX pCtx, uint32_t uRc);
|
---|
946 | VBGLR3DECL(int) VbglR3GuestCtrlFileCbError(PVBGLR3GUESTCTRLCMDCTX pCtx, uint32_t uRc);
|
---|
947 | VBGLR3DECL(int) VbglR3GuestCtrlFileCbRead(PVBGLR3GUESTCTRLCMDCTX pCtx, uint32_t uRc, void *pvData, uint32_t cbData);
|
---|
948 | VBGLR3DECL(int) VbglR3GuestCtrlFileCbReadOffset(PVBGLR3GUESTCTRLCMDCTX pCtx, uint32_t uRc,
|
---|
949 | void *pvData, uint32_t cbData, int64_t offNew);
|
---|
950 | VBGLR3DECL(int) VbglR3GuestCtrlFileCbWrite(PVBGLR3GUESTCTRLCMDCTX pCtx, uint32_t uRc, uint32_t cbWritten);
|
---|
951 | VBGLR3DECL(int) VbglR3GuestCtrlFileCbWriteOffset(PVBGLR3GUESTCTRLCMDCTX pCtx, uint32_t uRc, uint32_t cbWritten, int64_t offNew);
|
---|
952 |
|
---|
953 | VBGLR3DECL(int) VbglR3GuestCtrlFileCbSeek(PVBGLR3GUESTCTRLCMDCTX pCtx, uint32_t uRc, uint64_t offCurrent);
|
---|
954 | VBGLR3DECL(int) VbglR3GuestCtrlFileCbTell(PVBGLR3GUESTCTRLCMDCTX pCtx, uint32_t uRc, uint64_t offCurrent);
|
---|
955 | VBGLR3DECL(int) VbglR3GuestCtrlFileCbSetSize(PVBGLR3GUESTCTRLCMDCTX pCtx, uint32_t uRc, uint64_t cbNew);
|
---|
956 | VBGLR3DECL(int) VbglR3GuestCtrlProcCbStatus(PVBGLR3GUESTCTRLCMDCTX pCtx, uint32_t uPID, uint32_t uStatus, uint32_t fFlags,
|
---|
957 | void *pvData, uint32_t cbData);
|
---|
958 | VBGLR3DECL(int) VbglR3GuestCtrlProcCbOutput(PVBGLR3GUESTCTRLCMDCTX pCtx, uint32_t uPID, uint32_t uHandle, uint32_t fFlags,
|
---|
959 | void *pvData, uint32_t cbData);
|
---|
960 | VBGLR3DECL(int) VbglR3GuestCtrlProcCbStatusInput(PVBGLR3GUESTCTRLCMDCTX pCtx, uint32_t u32PID, uint32_t uStatus,
|
---|
961 | uint32_t fFlags, uint32_t cbWritten);
|
---|
962 |
|
---|
963 | /** @} */
|
---|
964 | # endif /* VBOX_WITH_GUEST_CONTROL defined */
|
---|
965 |
|
---|
966 | /** @name Auto-logon handling
|
---|
967 | * @{ */
|
---|
968 | VBGLR3DECL(int) VbglR3AutoLogonReportStatus(VBoxGuestFacilityStatus enmStatus);
|
---|
969 | VBGLR3DECL(bool) VbglR3AutoLogonIsRemoteSession(void);
|
---|
970 | /** @} */
|
---|
971 |
|
---|
972 | /** @name User credentials handling
|
---|
973 | * @{ */
|
---|
974 | VBGLR3DECL(int) VbglR3CredentialsQueryAvailability(void);
|
---|
975 | VBGLR3DECL(int) VbglR3CredentialsRetrieve(char **ppszUser, char **ppszPassword, char **ppszDomain);
|
---|
976 | VBGLR3DECL(int) VbglR3CredentialsRetrieveUtf16(PRTUTF16 *ppwszUser, PRTUTF16 *ppwszPassword, PRTUTF16 *ppwszDomain);
|
---|
977 | VBGLR3DECL(void) VbglR3CredentialsDestroy(char *pszUser, char *pszPassword, char *pszDomain, uint32_t cPasses);
|
---|
978 | VBGLR3DECL(void) VbglR3CredentialsDestroyUtf16(PRTUTF16 pwszUser, PRTUTF16 pwszPassword, PRTUTF16 pwszDomain,
|
---|
979 | uint32_t cPasses);
|
---|
980 | /** @} */
|
---|
981 |
|
---|
982 | /** @name CPU hotplug monitor
|
---|
983 | * @{ */
|
---|
984 | VBGLR3DECL(int) VbglR3CpuHotPlugInit(void);
|
---|
985 | VBGLR3DECL(int) VbglR3CpuHotPlugTerm(void);
|
---|
986 | VBGLR3DECL(int) VbglR3CpuHotPlugWaitForEvent(VMMDevCpuEventType *penmEventType, uint32_t *pidCpuCore, uint32_t *pidCpuPackage);
|
---|
987 | /** @} */
|
---|
988 |
|
---|
989 | /** @name Page sharing
|
---|
990 | * @{ */
|
---|
991 | struct VMMDEVSHAREDREGIONDESC;
|
---|
992 | VBGLR3DECL(int) VbglR3RegisterSharedModule(char *pszModuleName, char *pszVersion, RTGCPTR64 GCBaseAddr, uint32_t cbModule,
|
---|
993 | unsigned cRegions, struct VMMDEVSHAREDREGIONDESC *pRegions);
|
---|
994 | VBGLR3DECL(int) VbglR3UnregisterSharedModule(char *pszModuleName, char *pszVersion, RTGCPTR64 GCBaseAddr, uint32_t cbModule);
|
---|
995 | VBGLR3DECL(int) VbglR3CheckSharedModules(void);
|
---|
996 | VBGLR3DECL(bool) VbglR3PageSharingIsEnabled(void);
|
---|
997 | VBGLR3DECL(int) VbglR3PageIsShared(RTGCPTR pPage, bool *pfShared, uint64_t *puPageFlags);
|
---|
998 | /** @} */
|
---|
999 |
|
---|
1000 | # ifdef VBOX_WITH_DRAG_AND_DROP
|
---|
1001 | /** @name Drag and Drop
|
---|
1002 | * @{ */
|
---|
1003 | /**
|
---|
1004 | * Structure containing the context required for
|
---|
1005 | * either retrieving or sending a HGCM guest drag'n drop
|
---|
1006 | * commands from or to the host.
|
---|
1007 | *
|
---|
1008 | * Note: Do not change parameter order without also
|
---|
1009 | * adapting all structure initializers.
|
---|
1010 | */
|
---|
1011 | typedef struct VBGLR3GUESTDNDCMDCTX
|
---|
1012 | {
|
---|
1013 | /** @todo This struct could be handy if we want to implement
|
---|
1014 | * a second communication channel, e.g. via TCP/IP.
|
---|
1015 | * Use a union for the HGCM stuff then. */
|
---|
1016 |
|
---|
1017 | /** HGCM client ID to use for communication. */
|
---|
1018 | uint32_t uClientID;
|
---|
1019 | /** The VM's current session ID. */
|
---|
1020 | uint64_t uSessionID;
|
---|
1021 | /** Protocol version to use. */
|
---|
1022 | uint32_t uProtocol;
|
---|
1023 | /** Number of parameters retrieved for the current command. */
|
---|
1024 | uint32_t uNumParms;
|
---|
1025 | /** Max chunk size (in bytes) for data transfers. */
|
---|
1026 | uint32_t cbMaxChunkSize;
|
---|
1027 | } VBGLR3GUESTDNDCMDCTX, *PVBGLR3GUESTDNDCMDCTX;
|
---|
1028 |
|
---|
1029 | /**
|
---|
1030 | * Enumeration for specifying the DnD meta data type.
|
---|
1031 | */
|
---|
1032 | typedef enum VBGLR3GUESTDNDMETADATATYPE
|
---|
1033 | {
|
---|
1034 | /** Unknown meta data type; don't use. */
|
---|
1035 | VBGLR3GUESTDNDMETADATATYPE_UNKNOWN = 0,
|
---|
1036 | /** Raw meta data; can be everything. */
|
---|
1037 | VBGLR3GUESTDNDMETADATATYPE_RAW,
|
---|
1038 | /** Meta data is an URI list, specifying objects. */
|
---|
1039 | VBGLR3GUESTDNDMETADATATYPE_URI_LIST,
|
---|
1040 | /** Blow the type up to 32-bit. */
|
---|
1041 | VBGLR3GUESTDNDMETADATATYPE_32BIT_HACK = 0x7fffffff
|
---|
1042 | } VBGLR3GUESTDNDMETADATATYPE;
|
---|
1043 |
|
---|
1044 | /**
|
---|
1045 | * Structure for keeping + handling DnD meta data.
|
---|
1046 | *
|
---|
1047 | * Note: Don't treat this struct as POD object, as the union has classes in it.
|
---|
1048 | */
|
---|
1049 | typedef struct VBGLR3GUESTDNDMETADATA
|
---|
1050 | {
|
---|
1051 | /** The meta data type the union contains. */
|
---|
1052 | VBGLR3GUESTDNDMETADATATYPE enmType;
|
---|
1053 | /** Pointer to actual meta data. */
|
---|
1054 | void *pvMeta;
|
---|
1055 | /** Size (in bytes) of meta data. */
|
---|
1056 | uint32_t cbMeta;
|
---|
1057 | } VBGLR3GUESTDNDMETADATA;
|
---|
1058 |
|
---|
1059 | /** Pointer to VBGLR3GUESTDNDMETADATA. */
|
---|
1060 | typedef VBGLR3GUESTDNDMETADATA *PVBGLR3GUESTDNDMETADATA;
|
---|
1061 |
|
---|
1062 | /** Const pointer to VBGLR3GUESTDNDMETADATA. */
|
---|
1063 | typedef const PVBGLR3GUESTDNDMETADATA CPVBGLR3GUESTDNDMETADATA;
|
---|
1064 |
|
---|
1065 | /**
|
---|
1066 | * Enumeration specifying a DnD event type.
|
---|
1067 | */
|
---|
1068 | typedef enum VBGLR3DNDEVENTTYPE
|
---|
1069 | {
|
---|
1070 | VBGLR3DNDEVENTTYPE_INVALID = 0,
|
---|
1071 | VBGLR3DNDEVENTTYPE_HG_ERROR = 1,
|
---|
1072 | VBGLR3DNDEVENTTYPE_HG_ENTER = 2,
|
---|
1073 | VBGLR3DNDEVENTTYPE_HG_MOVE = 3,
|
---|
1074 | VBGLR3DNDEVENTTYPE_HG_LEAVE = 4,
|
---|
1075 | VBGLR3DNDEVENTTYPE_HG_DROP = 5,
|
---|
1076 | VBGLR3DNDEVENTTYPE_HG_RECEIVE = 6,
|
---|
1077 | VBGLR3DNDEVENTTYPE_HG_CANCEL = 7,
|
---|
1078 | # ifdef VBOX_WITH_DRAG_AND_DROP_GH
|
---|
1079 | VBGLR3DNDEVENTTYPE_GH_ERROR = 100,
|
---|
1080 | VBGLR3DNDEVENTTYPE_GH_REQ_PENDING = 101,
|
---|
1081 | VBGLR3DNDEVENTTYPE_GH_DROP = 102,
|
---|
1082 | # endif
|
---|
1083 | /** Blow the type up to 32-bit. */
|
---|
1084 | VBGLR3DNDEVENTTYPE_32BIT_HACK = 0x7fffffff
|
---|
1085 | } VBGLR3DNDEVENTTYPE;
|
---|
1086 |
|
---|
1087 | typedef struct VBGLR3DNDEVENT
|
---|
1088 | {
|
---|
1089 | /** The event type the union contains. */
|
---|
1090 | VBGLR3DNDEVENTTYPE enmType;
|
---|
1091 | union
|
---|
1092 | {
|
---|
1093 | struct
|
---|
1094 | {
|
---|
1095 | /** Screen ID this request belongs to. */
|
---|
1096 | uint32_t uScreenID;
|
---|
1097 | /** Format list (UTF-8, \r\n separated). */
|
---|
1098 | char *pszFormats;
|
---|
1099 | /** Size (in bytes) of pszFormats (\0 included). */
|
---|
1100 | uint32_t cbFormats;
|
---|
1101 | /** List of allowed DnD actions. */
|
---|
1102 | VBOXDNDACTIONLIST dndLstActionsAllowed;
|
---|
1103 | } HG_Enter;
|
---|
1104 | struct
|
---|
1105 | {
|
---|
1106 | /** Absolute X position of guest screen. */
|
---|
1107 | uint32_t uXpos;
|
---|
1108 | /** Absolute Y position of guest screen. */
|
---|
1109 | uint32_t uYpos;
|
---|
1110 | /** Default DnD action. */
|
---|
1111 | VBOXDNDACTION dndActionDefault;
|
---|
1112 | } HG_Move;
|
---|
1113 | struct
|
---|
1114 | {
|
---|
1115 | /** Absolute X position of guest screen. */
|
---|
1116 | uint32_t uXpos;
|
---|
1117 | /** Absolute Y position of guest screen. */
|
---|
1118 | uint32_t uYpos;
|
---|
1119 | /** Default DnD action. */
|
---|
1120 | VBOXDNDACTION dndActionDefault;
|
---|
1121 | } HG_Drop;
|
---|
1122 | struct
|
---|
1123 | {
|
---|
1124 | /** Meta data for the operation. */
|
---|
1125 | VBGLR3GUESTDNDMETADATA Meta;
|
---|
1126 | } HG_Received;
|
---|
1127 | struct
|
---|
1128 | {
|
---|
1129 | /** IPRT-style error code. */
|
---|
1130 | int rc;
|
---|
1131 | } HG_Error;
|
---|
1132 | # ifdef VBOX_WITH_DRAG_AND_DROP_GH
|
---|
1133 | struct
|
---|
1134 | {
|
---|
1135 | /** Screen ID this request belongs to. */
|
---|
1136 | uint32_t uScreenID;
|
---|
1137 | } GH_IsPending;
|
---|
1138 | struct
|
---|
1139 | {
|
---|
1140 | /** Requested format by the host. */
|
---|
1141 | char *pszFormat;
|
---|
1142 | /** Size (in bytes) of pszFormat (\0 included). */
|
---|
1143 | uint32_t cbFormat;
|
---|
1144 | /** Requested DnD action. */
|
---|
1145 | VBOXDNDACTION dndActionRequested;
|
---|
1146 | } GH_Drop;
|
---|
1147 | # endif
|
---|
1148 | } u;
|
---|
1149 | } VBGLR3DNDEVENT;
|
---|
1150 | typedef VBGLR3DNDEVENT *PVBGLR3DNDEVENT;
|
---|
1151 | typedef const PVBGLR3DNDEVENT CPVBGLR3DNDEVENT;
|
---|
1152 |
|
---|
1153 | VBGLR3DECL(int) VbglR3DnDConnect(PVBGLR3GUESTDNDCMDCTX pCtx);
|
---|
1154 | VBGLR3DECL(int) VbglR3DnDDisconnect(PVBGLR3GUESTDNDCMDCTX pCtx);
|
---|
1155 |
|
---|
1156 | VBGLR3DECL(int) VbglR3DnDEventGetNext(PVBGLR3GUESTDNDCMDCTX pCtx, PVBGLR3DNDEVENT *ppEvent);
|
---|
1157 | VBGLR3DECL(void) VbglR3DnDEventFree(PVBGLR3DNDEVENT pEvent);
|
---|
1158 |
|
---|
1159 | VBGLR3DECL(int) VbglR3DnDHGSendAckOp(PVBGLR3GUESTDNDCMDCTX pCtx, VBOXDNDACTION dndAction);
|
---|
1160 | VBGLR3DECL(int) VbglR3DnDHGSendReqData(PVBGLR3GUESTDNDCMDCTX pCtx, const char *pcszFormat);
|
---|
1161 | VBGLR3DECL(int) VbglR3DnDHGSendProgress(PVBGLR3GUESTDNDCMDCTX pCtx, uint32_t uStatus, uint8_t uPercent, int rcErr);
|
---|
1162 | # ifdef VBOX_WITH_DRAG_AND_DROP_GH
|
---|
1163 | VBGLR3DECL(int) VbglR3DnDGHSendAckPending(PVBGLR3GUESTDNDCMDCTX pCtx, VBOXDNDACTION dndActionDefault, VBOXDNDACTIONLIST dndLstActionsAllowed, const char* pcszFormats, uint32_t cbFormats);
|
---|
1164 | VBGLR3DECL(int) VbglR3DnDGHSendData(PVBGLR3GUESTDNDCMDCTX pCtx, const char *pszFormat, void *pvData, uint32_t cbData);
|
---|
1165 | VBGLR3DECL(int) VbglR3DnDGHSendError(PVBGLR3GUESTDNDCMDCTX pCtx, int rcOp);
|
---|
1166 | # endif /* VBOX_WITH_DRAG_AND_DROP_GH */
|
---|
1167 | /** @} */
|
---|
1168 | # endif /* VBOX_WITH_DRAG_AND_DROP */
|
---|
1169 |
|
---|
1170 | /* Generic Host Channel Service. */
|
---|
1171 | VBGLR3DECL(int) VbglR3HostChannelInit(uint32_t *pidClient);
|
---|
1172 | VBGLR3DECL(void) VbglR3HostChannelTerm(uint32_t idClient);
|
---|
1173 | VBGLR3DECL(int) VbglR3HostChannelAttach(uint32_t *pu32ChannelHandle, uint32_t u32HGCMClientId,
|
---|
1174 | const char *pszName, uint32_t u32Flags);
|
---|
1175 | VBGLR3DECL(void) VbglR3HostChannelDetach(uint32_t u32ChannelHandle, uint32_t u32HGCMClientId);
|
---|
1176 | VBGLR3DECL(int) VbglR3HostChannelSend(uint32_t u32ChannelHandle, uint32_t u32HGCMClientId,
|
---|
1177 | void *pvData, uint32_t cbData);
|
---|
1178 | VBGLR3DECL(int) VbglR3HostChannelRecv(uint32_t u32ChannelHandle, uint32_t u32HGCMClientId,
|
---|
1179 | void *pvData, uint32_t cbData,
|
---|
1180 | uint32_t *pu32SizeReceived, uint32_t *pu32SizeRemaining);
|
---|
1181 | VBGLR3DECL(int) VbglR3HostChannelControl(uint32_t u32ChannelHandle, uint32_t u32HGCMClientId,
|
---|
1182 | uint32_t u32Code, void *pvParm, uint32_t cbParm,
|
---|
1183 | void *pvData, uint32_t cbData, uint32_t *pu32SizeDataReturned);
|
---|
1184 | VBGLR3DECL(int) VbglR3HostChannelEventWait(uint32_t *pu32ChannelHandle, uint32_t u32HGCMClientId,
|
---|
1185 | uint32_t *pu32EventId, void *pvParm, uint32_t cbParm,
|
---|
1186 | uint32_t *pu32SizeReturned);
|
---|
1187 | VBGLR3DECL(int) VbglR3HostChannelEventCancel(uint32_t u32ChannelHandle, uint32_t u32HGCMClientId);
|
---|
1188 | VBGLR3DECL(int) VbglR3HostChannelQuery(const char *pszName, uint32_t u32HGCMClientId, uint32_t u32Code,
|
---|
1189 | void *pvParm, uint32_t cbParm, void *pvData, uint32_t cbData,
|
---|
1190 | uint32_t *pu32SizeDataReturned);
|
---|
1191 |
|
---|
1192 | /** @name Mode hint storage
|
---|
1193 | * @{ */
|
---|
1194 | VBGLR3DECL(int) VbglR3ReadVideoMode(unsigned cDisplay, unsigned *cx,
|
---|
1195 | unsigned *cy, unsigned *cBPP, unsigned *x,
|
---|
1196 | unsigned *y, unsigned *fEnabled);
|
---|
1197 | VBGLR3DECL(int) VbglR3WriteVideoMode(unsigned cDisplay, unsigned cx,
|
---|
1198 | unsigned cy, unsigned cBPP, unsigned x,
|
---|
1199 | unsigned y, unsigned fEnabled);
|
---|
1200 | /** @} */
|
---|
1201 |
|
---|
1202 | /** @name Generic HGCM
|
---|
1203 | * @{ */
|
---|
1204 | VBGLR3DECL(int) VbglR3HGCMConnect(const char *pszServiceName, HGCMCLIENTID *pidClient);
|
---|
1205 | VBGLR3DECL(int) VbglR3HGCMDisconnect(HGCMCLIENTID idClient);
|
---|
1206 | struct VBGLIOCHGCMCALL;
|
---|
1207 | VBGLR3DECL(int) VbglR3HGCMCall(struct VBGLIOCHGCMCALL *pInfo, size_t cbInfo);
|
---|
1208 | /** @} */
|
---|
1209 |
|
---|
1210 | #endif /* IN_RING3 */
|
---|
1211 | /** @} */
|
---|
1212 |
|
---|
1213 | RT_C_DECLS_END
|
---|
1214 |
|
---|
1215 | /** @} */
|
---|
1216 |
|
---|
1217 | #endif /* !VBOX_INCLUDED_VBoxGuestLib_h */
|
---|
1218 |
|
---|