1 | /** @file
|
---|
2 | * VBoxGuestLib - VirtualBox Guest Additions Library.
|
---|
3 | */
|
---|
4 |
|
---|
5 | /*
|
---|
6 | * Copyright (C) 2006-2018 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_VBoxGuestLib_h
|
---|
31 | #define ___VBox_VBoxGuestLib_h
|
---|
32 |
|
---|
33 | #include <VBox/types.h>
|
---|
34 | #include <VBox/VMMDev.h>
|
---|
35 | #include <VBox/VBoxGuestCoreTypes.h>
|
---|
36 |
|
---|
37 | /** @defgroup grp_vboxguest_lib VirtualBox Guest Additions Library
|
---|
38 | * @ingroup grp_vboxguest
|
---|
39 | * @{
|
---|
40 | */
|
---|
41 |
|
---|
42 | /** @page pg_guest_lib VirtualBox Guest Library
|
---|
43 | *
|
---|
44 | * This is a library for abstracting the additions driver interface. There are
|
---|
45 | * multiple versions of the library depending on the context. The main
|
---|
46 | * distinction is between kernel and user mode where the interfaces are very
|
---|
47 | * different.
|
---|
48 | *
|
---|
49 | *
|
---|
50 | * @section sec_guest_lib_ring0 Ring-0
|
---|
51 | *
|
---|
52 | * In ring-0 there are two version:
|
---|
53 | * - VBOX_LIB_VBGL_R0_BASE / VBoxGuestR0LibBase for the VBoxGuest main driver,
|
---|
54 | * who is responsible for managing the VMMDev virtual hardware.
|
---|
55 | * - VBOX_LIB_VBGL_R0 / VBoxGuestR0Lib for other (client) guest drivers.
|
---|
56 | *
|
---|
57 | *
|
---|
58 | * The library source code and the header have a define VBGL_VBOXGUEST, which is
|
---|
59 | * defined for VBoxGuest and undefined for other drivers. Drivers must choose
|
---|
60 | * right library in their makefiles and set VBGL_VBOXGUEST accordingly.
|
---|
61 | *
|
---|
62 | * The libraries consists of:
|
---|
63 | * - common code to be used by both VBoxGuest and other drivers;
|
---|
64 | * - VBoxGuest specific code;
|
---|
65 | * - code for other drivers which communicate with VBoxGuest via an IOCTL.
|
---|
66 | *
|
---|
67 | *
|
---|
68 | * @section sec_guest_lib_ring3 Ring-3
|
---|
69 | *
|
---|
70 | * There are more variants of the library here:
|
---|
71 | * - VBOX_LIB_VBGL_R3 / VBoxGuestR3Lib for programs.
|
---|
72 | * - VBOX_LIB_VBGL_R3_XFREE86 / VBoxGuestR3LibXFree86 for old style XFree
|
---|
73 | * drivers which uses special loader and or symbol resolving strategy.
|
---|
74 | * - VBOX_LIB_VBGL_R3_SHARED / VBoxGuestR3LibShared for shared objects / DLLs /
|
---|
75 | * Dylibs.
|
---|
76 | *
|
---|
77 | */
|
---|
78 |
|
---|
79 | RT_C_DECLS_BEGIN
|
---|
80 |
|
---|
81 | /** HGCM client ID.
|
---|
82 | * @todo Promote to VBox/types.h */
|
---|
83 | typedef uint32_t HGCMCLIENTID;
|
---|
84 |
|
---|
85 |
|
---|
86 | /** @defgroup grp_vboxguest_lib_r0 Ring-0 interface.
|
---|
87 | * @{
|
---|
88 | */
|
---|
89 | #ifdef IN_RING0
|
---|
90 | /** @def DECLR0VBGL
|
---|
91 | * Declare a VBGL ring-0 API with the right calling convention and visibilitiy.
|
---|
92 | * @param type Return type. */
|
---|
93 | # ifdef RT_OS_DARWIN /** @todo probably apply to all, but don't want a forest fire on our hands right now. */
|
---|
94 | # define DECLR0VBGL(type) DECLHIDDEN(type) VBOXCALL
|
---|
95 | # else
|
---|
96 | # define DECLR0VBGL(type) type VBOXCALL
|
---|
97 | # endif
|
---|
98 | # define DECLVBGL(type) DECLR0VBGL(type)
|
---|
99 |
|
---|
100 |
|
---|
101 | /**
|
---|
102 | * The library initialization function to be used by the main VBoxGuest driver.
|
---|
103 | *
|
---|
104 | * @return VBox status code.
|
---|
105 | */
|
---|
106 | DECLR0VBGL(int) VbglR0InitPrimary(RTIOPORT portVMMDev, struct VMMDevMemory *pVMMDevMemory);
|
---|
107 |
|
---|
108 | /**
|
---|
109 | * The library termination function to be used by the main VBoxGuest driver.
|
---|
110 | *
|
---|
111 | * @author bird (2017-08-23)
|
---|
112 | */
|
---|
113 | DECLR0VBGL(void) VbglR0TerminatePrimary(void);
|
---|
114 |
|
---|
115 | /**
|
---|
116 | * The library initialization function to be used by all drivers
|
---|
117 | * other than the main VBoxGuest system driver.
|
---|
118 | *
|
---|
119 | * @return VBox status code.
|
---|
120 | */
|
---|
121 | DECLR0VBGL(int) VbglR0InitClient(void);
|
---|
122 |
|
---|
123 | /**
|
---|
124 | * The library termination function.
|
---|
125 | */
|
---|
126 | DECLR0VBGL(void) VbglR0TerminateClient(void);
|
---|
127 |
|
---|
128 |
|
---|
129 | /** @name The IDC Client Interface
|
---|
130 | * @{
|
---|
131 | */
|
---|
132 |
|
---|
133 | /**
|
---|
134 | * Inter-Driver Communication Handle.
|
---|
135 | */
|
---|
136 | typedef union VBGLIDCHANDLE
|
---|
137 | {
|
---|
138 | /** Padding for opaque usage.
|
---|
139 | * Must be greater or equal in size than the private struct. */
|
---|
140 | void *apvPadding[4];
|
---|
141 | #ifdef VBGLIDCHANDLEPRIVATE_DECLARED
|
---|
142 | /** The private view. */
|
---|
143 | struct VBGLIDCHANDLEPRIVATE s;
|
---|
144 | #endif
|
---|
145 | } VBGLIDCHANDLE;
|
---|
146 | /** Pointer to a handle. */
|
---|
147 | typedef VBGLIDCHANDLE *PVBGLIDCHANDLE;
|
---|
148 |
|
---|
149 | DECLR0VBGL(int) VbglR0IdcOpen(PVBGLIDCHANDLE pHandle, uint32_t uReqVersion, uint32_t uMinVersion,
|
---|
150 | uint32_t *puSessionVersion, uint32_t *puDriverVersion, uint32_t *puDriverRevision);
|
---|
151 | struct VBGLREQHDR;
|
---|
152 | DECLR0VBGL(int) VbglR0IdcCallRaw(PVBGLIDCHANDLE pHandle, uintptr_t uReq, struct VBGLREQHDR *pReqHdr, uint32_t cbReq);
|
---|
153 | DECLR0VBGL(int) VbglR0IdcCall(PVBGLIDCHANDLE pHandle, uintptr_t uReq, struct VBGLREQHDR *pReqHdr, uint32_t cbReq);
|
---|
154 | DECLR0VBGL(int) VbglR0IdcClose(PVBGLIDCHANDLE pHandle);
|
---|
155 |
|
---|
156 | /** @} */
|
---|
157 |
|
---|
158 |
|
---|
159 | /** @name Generic request functions.
|
---|
160 | * @{
|
---|
161 | */
|
---|
162 |
|
---|
163 | /**
|
---|
164 | * Allocate memory for generic request and initialize the request header.
|
---|
165 | *
|
---|
166 | * @returns VBox status code.
|
---|
167 | * @param ppReq Where to return the pointer to the allocated memory.
|
---|
168 | * @param cbReq Size of memory block required for the request.
|
---|
169 | * @param enmReqType the generic request type.
|
---|
170 | */
|
---|
171 | # if defined(___VBox_VMMDev_h) || defined(DOXYGEN_RUNNING)
|
---|
172 | DECLR0VBGL(int) VbglR0GRAlloc(struct VMMDevRequestHeader **ppReq, size_t cbReq, VMMDevRequestType enmReqType);
|
---|
173 | # else
|
---|
174 | DECLR0VBGL(int) VbglR0GRAlloc(struct VMMDevRequestHeader **ppReq, size_t cbReq, int32_t enmReqType);
|
---|
175 | # endif
|
---|
176 |
|
---|
177 | /**
|
---|
178 | * Perform the generic request.
|
---|
179 | *
|
---|
180 | * @param pReq pointer the request structure.
|
---|
181 | *
|
---|
182 | * @return VBox status code.
|
---|
183 | */
|
---|
184 | DECLR0VBGL(int) VbglR0GRPerform(struct VMMDevRequestHeader *pReq);
|
---|
185 |
|
---|
186 | /**
|
---|
187 | * Free the generic request memory.
|
---|
188 | *
|
---|
189 | * @param pReq pointer the request structure.
|
---|
190 | *
|
---|
191 | * @return VBox status code.
|
---|
192 | */
|
---|
193 | DECLR0VBGL(void) VbglR0GRFree(struct VMMDevRequestHeader *pReq);
|
---|
194 |
|
---|
195 | /**
|
---|
196 | * Verify the generic request header.
|
---|
197 | *
|
---|
198 | * @param pReq pointer the request header structure.
|
---|
199 | * @param cbReq size of the request memory block. It should be equal to the request size
|
---|
200 | * for fixed size requests. It can be greater than the request size for
|
---|
201 | * variable size requests.
|
---|
202 | *
|
---|
203 | * @return VBox status code.
|
---|
204 | */
|
---|
205 | DECLR0VBGL(int) VbglGR0Verify(const struct VMMDevRequestHeader *pReq, size_t cbReq);
|
---|
206 |
|
---|
207 | /** @} */
|
---|
208 |
|
---|
209 | # ifdef VBOX_WITH_HGCM
|
---|
210 | struct VBGLIOCHGCMCALL;
|
---|
211 |
|
---|
212 | # ifdef VBGL_VBOXGUEST
|
---|
213 |
|
---|
214 | /**
|
---|
215 | * Callback function called from HGCM helpers when a wait for request
|
---|
216 | * completion IRQ is required.
|
---|
217 | *
|
---|
218 | * @returns VINF_SUCCESS, VERR_INTERRUPT or VERR_TIMEOUT.
|
---|
219 | * @param pvData VBoxGuest pointer to be passed to callback.
|
---|
220 | * @param u32Data VBoxGuest 32 bit value to be passed to callback.
|
---|
221 | */
|
---|
222 | typedef DECLCALLBACK(int) FNVBGLHGCMCALLBACK(VMMDevHGCMRequestHeader *pHeader, void *pvData, uint32_t u32Data);
|
---|
223 | /** Pointer to a FNVBGLHGCMCALLBACK. */
|
---|
224 | typedef FNVBGLHGCMCALLBACK *PFNVBGLHGCMCALLBACK;
|
---|
225 |
|
---|
226 | /**
|
---|
227 | * Perform a connect request.
|
---|
228 | *
|
---|
229 | * That is locate required service and obtain a client identifier for future
|
---|
230 | * access.
|
---|
231 | *
|
---|
232 | * @note This function can NOT handle cancelled requests!
|
---|
233 | *
|
---|
234 | * @param pLoc The service to connect to.
|
---|
235 | * @param fRequestor VMMDEV_REQUESTOR_XXX.
|
---|
236 | * @param pidClient Where to return the client ID on success.
|
---|
237 | * @param pfnAsyncCallback Required pointer to function that is calledwhen
|
---|
238 | * host returns VINF_HGCM_ASYNC_EXECUTE. VBoxGuest
|
---|
239 | * implements waiting for an IRQ in this function.
|
---|
240 | * @param pvAsyncData An arbitrary VBoxGuest pointer to be passed to callback.
|
---|
241 | * @param u32AsyncData An arbitrary VBoxGuest 32 bit value to be passed to callback.
|
---|
242 | *
|
---|
243 | * @return VBox status code.
|
---|
244 | */
|
---|
245 | DECLR0VBGL(int) VbglR0HGCMInternalConnect(HGCMServiceLocation const *pLoc, uint32_t fRequestor, HGCMCLIENTID *pidClient,
|
---|
246 | PFNVBGLHGCMCALLBACK pfnAsyncCallback, void *pvAsyncData, uint32_t u32AsyncData);
|
---|
247 |
|
---|
248 |
|
---|
249 | /**
|
---|
250 | * Perform a disconnect request.
|
---|
251 | *
|
---|
252 | * That is tell the host that the client will not call the service anymore.
|
---|
253 | *
|
---|
254 | * @note This function can NOT handle cancelled requests!
|
---|
255 | *
|
---|
256 | * @param idClient The client ID to disconnect.
|
---|
257 | * @param fRequestor VMMDEV_REQUESTOR_XXX.
|
---|
258 | * @param pfnAsyncCallback Required pointer to function that is called when
|
---|
259 | * host returns VINF_HGCM_ASYNC_EXECUTE. VBoxGuest
|
---|
260 | * implements waiting for an IRQ in this function.
|
---|
261 | * @param pvAsyncData An arbitrary VBoxGuest pointer to be passed to callback.
|
---|
262 | * @param u32AsyncData An arbitrary VBoxGuest 32 bit value to be passed to
|
---|
263 | * callback.
|
---|
264 | *
|
---|
265 | * @return VBox status code.
|
---|
266 | */
|
---|
267 |
|
---|
268 | DECLR0VBGL(int) VbglR0HGCMInternalDisconnect(HGCMCLIENTID idClient, uint32_t fRequestor,
|
---|
269 | PFNVBGLHGCMCALLBACK pfnAsyncCallback, void *pvAsyncData, uint32_t u32AsyncData);
|
---|
270 |
|
---|
271 | /** Call a HGCM service.
|
---|
272 | *
|
---|
273 | * @note This function can deal with cancelled requests.
|
---|
274 | *
|
---|
275 | * @param pCallInfo The request data.
|
---|
276 | * @param fFlags Flags, see VBGLR0_HGCMCALL_F_XXX.
|
---|
277 | * @param fRequestor VMMDEV_REQUESTOR_XXX.
|
---|
278 | * @param pfnAsyncCallback Required pointer to function that is called when
|
---|
279 | * host returns VINF_HGCM_ASYNC_EXECUTE. VBoxGuest
|
---|
280 | * implements waiting for an IRQ in this function.
|
---|
281 | * @param pvAsyncData An arbitrary VBoxGuest pointer to be passed to callback.
|
---|
282 | * @param u32AsyncData An arbitrary VBoxGuest 32 bit value to be passed to callback.
|
---|
283 | *
|
---|
284 | * @return VBox status code.
|
---|
285 | */
|
---|
286 | DECLR0VBGL(int) VbglR0HGCMInternalCall(struct VBGLIOCHGCMCALL *pCallInfo, uint32_t cbCallInfo, uint32_t fFlags, uint32_t fRequestor,
|
---|
287 | PFNVBGLHGCMCALLBACK pfnAsyncCallback, void *pvAsyncData, uint32_t u32AsyncData);
|
---|
288 |
|
---|
289 | /** Call a HGCM service. (32 bits packet structure in a 64 bits guest)
|
---|
290 | *
|
---|
291 | * @note This function can deal with cancelled requests.
|
---|
292 | *
|
---|
293 | * @param pCallInfo The request data.
|
---|
294 | * @param fFlags Flags, see VBGLR0_HGCMCALL_F_XXX.
|
---|
295 | * @param fRequestor VMMDEV_REQUESTOR_XXX.
|
---|
296 | * @param pfnAsyncCallback Required pointer to function that is called when
|
---|
297 | * host returns VINF_HGCM_ASYNC_EXECUTE. VBoxGuest
|
---|
298 | * implements waiting for an IRQ in this function.
|
---|
299 | * @param pvAsyncData An arbitrary VBoxGuest pointer to be passed to callback.
|
---|
300 | * @param u32AsyncData An arbitrary VBoxGuest 32 bit value to be passed to callback.
|
---|
301 | *
|
---|
302 | * @return VBox status code.
|
---|
303 | */
|
---|
304 | DECLR0VBGL(int) VbglR0HGCMInternalCall32(struct VBGLIOCHGCMCALL *pCallInfo, uint32_t cbCallInfo, uint32_t fFlags, uint32_t fRequestor,
|
---|
305 | PFNVBGLHGCMCALLBACK pfnAsyncCallback, void *pvAsyncData, uint32_t u32AsyncData);
|
---|
306 |
|
---|
307 | /** @name VbglR0HGCMInternalCall flags
|
---|
308 | * @{ */
|
---|
309 | /** User mode request.
|
---|
310 | * Indicates that only user mode addresses are permitted as parameters. */
|
---|
311 | #define VBGLR0_HGCMCALL_F_USER UINT32_C(0)
|
---|
312 | /** Kernel mode request.
|
---|
313 | * Indicates that kernel mode addresses are permitted as parameters. Whether or
|
---|
314 | * not user mode addresses are permitted is, unfortunately, OS specific. The
|
---|
315 | * following OSes allows user mode addresses: Windows, TODO.
|
---|
316 | */
|
---|
317 | #define VBGLR0_HGCMCALL_F_KERNEL UINT32_C(1)
|
---|
318 | /** Mode mask. */
|
---|
319 | #define VBGLR0_HGCMCALL_F_MODE_MASK UINT32_C(1)
|
---|
320 | /** @} */
|
---|
321 |
|
---|
322 | # else /* !VBGL_VBOXGUEST */
|
---|
323 |
|
---|
324 | struct VBGLHGCMHANDLEDATA;
|
---|
325 | typedef struct VBGLHGCMHANDLEDATA *VBGLHGCMHANDLE;
|
---|
326 |
|
---|
327 | /** @name HGCM functions
|
---|
328 | * @{
|
---|
329 | */
|
---|
330 |
|
---|
331 | /**
|
---|
332 | * Initializes HGCM in the R0 guest library. Must be called before any HGCM
|
---|
333 | * connections are made. Is called by VbglInitClient().
|
---|
334 | *
|
---|
335 | * @return VBox status code.
|
---|
336 | */
|
---|
337 | DECLR0VBGL(int) VbglR0HGCMInit(void);
|
---|
338 |
|
---|
339 | /**
|
---|
340 | * Terminates HGCM in the R0 guest library. Is called by VbglTerminate().
|
---|
341 | *
|
---|
342 | * @return VBox status code.
|
---|
343 | */
|
---|
344 | DECLR0VBGL(int) VbglR0HGCMTerminate(void);
|
---|
345 |
|
---|
346 | /**
|
---|
347 | * Connect to a service.
|
---|
348 | *
|
---|
349 | * @param pHandle Pointer to variable that will hold a handle to be used
|
---|
350 | * further in VbglHGCMCall and VbglHGCMClose.
|
---|
351 | * @param pszServiceName The service to connect to.
|
---|
352 | * @param pidClient Where to return the client ID for the connection.
|
---|
353 | *
|
---|
354 | * @return VBox status code.
|
---|
355 | *
|
---|
356 | * @todo consider baking the client Id into the handle.
|
---|
357 | */
|
---|
358 | DECLR0VBGL(int) VbglR0HGCMConnect(VBGLHGCMHANDLE *pHandle, const char *pszServiceName, HGCMCLIENTID *pidClient);
|
---|
359 |
|
---|
360 | /**
|
---|
361 | * Connect to a service.
|
---|
362 | *
|
---|
363 | * @param handle Handle of the connection.
|
---|
364 | * @param idClient The ID of the client connection.
|
---|
365 | *
|
---|
366 | * @return VBox status code.
|
---|
367 | *
|
---|
368 | * @todo consider baking the client Id into the handle.
|
---|
369 | */
|
---|
370 | DECLR0VBGL(int) VbglR0HGCMDisconnect(VBGLHGCMHANDLE handle, HGCMCLIENTID idClient);
|
---|
371 |
|
---|
372 | /**
|
---|
373 | * Call to a service, returning only the I/O control status code.
|
---|
374 | *
|
---|
375 | * @param handle Handle of the connection.
|
---|
376 | * @param pData Call request information structure, including function parameters.
|
---|
377 | * @param cbData Length in bytes of data.
|
---|
378 | *
|
---|
379 | * @return VBox status code.
|
---|
380 | */
|
---|
381 | DECLR0VBGL(int) VbglR0HGCMCallRaw(VBGLHGCMHANDLE handle, struct VBGLIOCHGCMCALL*pData, uint32_t cbData);
|
---|
382 |
|
---|
383 | /**
|
---|
384 | * Call to a service, returning the HGCM status code.
|
---|
385 | *
|
---|
386 | * @param handle Handle of the connection.
|
---|
387 | * @param pData Call request information structure, including function parameters.
|
---|
388 | * @param cbData Length in bytes of data.
|
---|
389 | *
|
---|
390 | * @return VBox status code. Either the I/O control status code if that failed,
|
---|
391 | * or the HGCM status code (pData->Hdr.rc).
|
---|
392 | */
|
---|
393 | DECLR0VBGL(int) VbglR0HGCMCall(VBGLHGCMHANDLE handle, struct VBGLIOCHGCMCALL*pData, uint32_t cbData);
|
---|
394 |
|
---|
395 | /**
|
---|
396 | * Call to a service with user-mode data received by the calling driver from the User-Mode process.
|
---|
397 | * The call must be done in the context of a calling process.
|
---|
398 | *
|
---|
399 | * @param handle Handle of the connection.
|
---|
400 | * @param pData Call request information structure, including function parameters.
|
---|
401 | * @param cbData Length in bytes of data.
|
---|
402 | *
|
---|
403 | * @return VBox status code.
|
---|
404 | */
|
---|
405 | DECLR0VBGL(int) VbglR0HGCMCallUserDataRaw(VBGLHGCMHANDLE handle, struct VBGLIOCHGCMCALL*pData, uint32_t cbData);
|
---|
406 |
|
---|
407 | /** @} */
|
---|
408 |
|
---|
409 | /** @name Undocumented helpers for talking to the Chromium OpenGL Host Service
|
---|
410 | * @{ */
|
---|
411 | typedef VBGLHGCMHANDLE VBGLCRCTLHANDLE;
|
---|
412 | DECLR0VBGL(int) VbglR0CrCtlCreate(VBGLCRCTLHANDLE *phCtl);
|
---|
413 | DECLR0VBGL(int) VbglR0CrCtlDestroy(VBGLCRCTLHANDLE hCtl);
|
---|
414 | DECLR0VBGL(int) VbglR0CrCtlConConnect(VBGLCRCTLHANDLE hCtl, HGCMCLIENTID *pidClient);
|
---|
415 | DECLR0VBGL(int) VbglR0CrCtlConDisconnect(VBGLCRCTLHANDLE hCtl, HGCMCLIENTID idClient);
|
---|
416 | struct VBGLIOCHGCMCALL;
|
---|
417 | DECLR0VBGL(int) VbglR0CrCtlConCallRaw(VBGLCRCTLHANDLE hCtl, struct VBGLIOCHGCMCALL *pCallInfo, int cbCallInfo);
|
---|
418 | DECLR0VBGL(int) VbglR0CrCtlConCall(VBGLCRCTLHANDLE hCtl, struct VBGLIOCHGCMCALL *pCallInfo, int cbCallInfo);
|
---|
419 | DECLR0VBGL(int) VbglR0CrCtlConCallUserDataRaw(VBGLCRCTLHANDLE hCtl, struct VBGLIOCHGCMCALL *pCallInfo, int cbCallInfo);
|
---|
420 | /** @} */
|
---|
421 |
|
---|
422 | # endif /* !VBGL_VBOXGUEST */
|
---|
423 |
|
---|
424 | # endif /* VBOX_WITH_HGCM */
|
---|
425 |
|
---|
426 |
|
---|
427 | /**
|
---|
428 | * Initialize the heap.
|
---|
429 | *
|
---|
430 | * @returns VBox status code.
|
---|
431 | */
|
---|
432 | DECLR0VBGL(int) VbglR0PhysHeapInit(void);
|
---|
433 |
|
---|
434 | /**
|
---|
435 | * Shutdown the heap.
|
---|
436 | */
|
---|
437 | DECLR0VBGL(void) VbglR0PhysHeapTerminate(void);
|
---|
438 |
|
---|
439 | /**
|
---|
440 | * Allocate a memory block.
|
---|
441 | *
|
---|
442 | * @returns Virtual address of the allocated memory block.
|
---|
443 | * @param cbSize Size of block to be allocated.
|
---|
444 | */
|
---|
445 | DECLR0VBGL(void *) VbglR0PhysHeapAlloc(uint32_t cbSize);
|
---|
446 |
|
---|
447 | /**
|
---|
448 | * Get physical address of memory block pointed by the virtual address.
|
---|
449 | *
|
---|
450 | * @note WARNING!
|
---|
451 | * The function does not acquire the Heap mutex!
|
---|
452 | * When calling the function make sure that the pointer is a valid one and
|
---|
453 | * is not being deallocated. This function can NOT be used for verifying
|
---|
454 | * if the given pointer is a valid one allocated from the heap.
|
---|
455 | *
|
---|
456 | * @param pv Virtual address of memory block.
|
---|
457 | * @returns Physical address of the memory block.
|
---|
458 | */
|
---|
459 | DECLR0VBGL(uint32_t) VbglR0PhysHeapGetPhysAddr(void *pv);
|
---|
460 |
|
---|
461 | /**
|
---|
462 | * Free a memory block.
|
---|
463 | *
|
---|
464 | * @param pv Virtual address of memory block.
|
---|
465 | */
|
---|
466 | DECLR0VBGL(void) VbglR0PhysHeapFree(void *pv);
|
---|
467 |
|
---|
468 | DECLR0VBGL(int) VbglR0QueryVMMDevMemory(struct VMMDevMemory **ppVMMDevMemory);
|
---|
469 | DECLR0VBGL(bool) VbglR0CanUsePhysPageList(void);
|
---|
470 |
|
---|
471 | # ifndef VBOX_GUEST
|
---|
472 | /** @name Mouse
|
---|
473 | * @{ */
|
---|
474 | DECLR0VBGL(int) VbglR0SetMouseNotifyCallback(PFNVBOXGUESTMOUSENOTIFY pfnNotify, void *pvUser);
|
---|
475 | DECLR0VBGL(int) VbglR0GetMouseStatus(uint32_t *pfFeatures, uint32_t *px, uint32_t *py);
|
---|
476 | DECLR0VBGL(int) VbglR0SetMouseStatus(uint32_t fFeatures);
|
---|
477 | /** @} */
|
---|
478 | # endif /* VBOX_GUEST */
|
---|
479 |
|
---|
480 | #endif /* IN_RING0 */
|
---|
481 |
|
---|
482 | /** @} */
|
---|
483 |
|
---|
484 |
|
---|
485 | /** @defgroup grp_vboxguest_lib_r3 Ring-3 interface.
|
---|
486 | * @{
|
---|
487 | */
|
---|
488 | #ifdef IN_RING3
|
---|
489 |
|
---|
490 | /** @def VBGLR3DECL
|
---|
491 | * Ring 3 VBGL declaration.
|
---|
492 | * @param type The return type of the function declaration.
|
---|
493 | */
|
---|
494 | # define VBGLR3DECL(type) DECLHIDDEN(type) VBOXCALL
|
---|
495 |
|
---|
496 | /** @name General-purpose functions
|
---|
497 | * @{ */
|
---|
498 | VBGLR3DECL(int) VbglR3Init(void);
|
---|
499 | VBGLR3DECL(int) VbglR3InitUser(void);
|
---|
500 | VBGLR3DECL(void) VbglR3Term(void);
|
---|
501 | # ifdef ___iprt_time_h
|
---|
502 | VBGLR3DECL(int) VbglR3GetHostTime(PRTTIMESPEC pTime);
|
---|
503 | # endif
|
---|
504 | VBGLR3DECL(int) VbglR3InterruptEventWaits(void);
|
---|
505 | VBGLR3DECL(int) VbglR3WriteLog(const char *pch, size_t cch);
|
---|
506 | VBGLR3DECL(int) VbglR3CtlFilterMask(uint32_t fOr, uint32_t fNot);
|
---|
507 | VBGLR3DECL(int) VbglR3Daemonize(bool fNoChDir, bool fNoClose, bool fRespawn, unsigned *pcRespawn);
|
---|
508 | VBGLR3DECL(int) VbglR3PidFile(const char *pszPath, PRTFILE phFile);
|
---|
509 | VBGLR3DECL(void) VbglR3ClosePidFile(const char *pszPath, RTFILE hFile);
|
---|
510 | VBGLR3DECL(int) VbglR3SetGuestCaps(uint32_t fOr, uint32_t fNot);
|
---|
511 | VBGLR3DECL(int) VbglR3AcquireGuestCaps(uint32_t fOr, uint32_t fNot, bool fConfig);
|
---|
512 | VBGLR3DECL(int) VbglR3WaitEvent(uint32_t fMask, uint32_t cMillies, uint32_t *pfEvents);
|
---|
513 |
|
---|
514 | VBGLR3DECL(int) VbglR3ReportAdditionsStatus(VBoxGuestFacilityType Facility, VBoxGuestFacilityStatus StatusCurrent,
|
---|
515 | uint32_t fFlags);
|
---|
516 | VBGLR3DECL(int) VbglR3GetAdditionsVersion(char **ppszVer, char **ppszVerEx, char **ppszRev);
|
---|
517 | VBGLR3DECL(int) VbglR3GetAdditionsInstallationPath(char **ppszPath);
|
---|
518 | VBGLR3DECL(int) VbglR3GetSessionId(uint64_t *pu64IdSession);
|
---|
519 |
|
---|
520 | /** @} */
|
---|
521 |
|
---|
522 | /** @name Shared clipboard
|
---|
523 | * @{ */
|
---|
524 | VBGLR3DECL(int) VbglR3ClipboardConnect(HGCMCLIENTID *pidClient);
|
---|
525 | VBGLR3DECL(int) VbglR3ClipboardDisconnect(HGCMCLIENTID idClient);
|
---|
526 | VBGLR3DECL(int) VbglR3ClipboardGetHostMsg(HGCMCLIENTID idClient, uint32_t *pMsg, uint32_t *pfFormats);
|
---|
527 | VBGLR3DECL(int) VbglR3ClipboardReadData(HGCMCLIENTID idClient, uint32_t fFormat, void *pv, uint32_t cb, uint32_t *pcb);
|
---|
528 | VBGLR3DECL(int) VbglR3ClipboardReportFormats(HGCMCLIENTID idClient, uint32_t fFormats);
|
---|
529 | VBGLR3DECL(int) VbglR3ClipboardWriteData(HGCMCLIENTID idClient, uint32_t fFormat, void *pv, uint32_t cb);
|
---|
530 | /** @} */
|
---|
531 |
|
---|
532 | /** @name Seamless mode
|
---|
533 | * @{ */
|
---|
534 | VBGLR3DECL(int) VbglR3SeamlessSetCap(bool fState);
|
---|
535 | VBGLR3DECL(int) VbglR3SeamlessWaitEvent(VMMDevSeamlessMode *pMode);
|
---|
536 | VBGLR3DECL(int) VbglR3SeamlessSendRects(uint32_t cRects, PRTRECT pRects);
|
---|
537 | VBGLR3DECL(int) VbglR3SeamlessGetLastEvent(VMMDevSeamlessMode *pMode);
|
---|
538 |
|
---|
539 | /** @} */
|
---|
540 |
|
---|
541 | /** @name Mouse
|
---|
542 | * @{ */
|
---|
543 | VBGLR3DECL(int) VbglR3GetMouseStatus(uint32_t *pfFeatures, uint32_t *px, uint32_t *py);
|
---|
544 | VBGLR3DECL(int) VbglR3SetMouseStatus(uint32_t fFeatures);
|
---|
545 | /** @} */
|
---|
546 |
|
---|
547 | /** @name Video
|
---|
548 | * @{ */
|
---|
549 | VBGLR3DECL(int) VbglR3VideoAccelEnable(bool fEnable);
|
---|
550 | VBGLR3DECL(int) VbglR3VideoAccelFlush(void);
|
---|
551 | VBGLR3DECL(int) VbglR3SetPointerShape(uint32_t fFlags, uint32_t xHot, uint32_t yHot, uint32_t cx, uint32_t cy,
|
---|
552 | const void *pvImg, size_t cbImg);
|
---|
553 | VBGLR3DECL(int) VbglR3SetPointerShapeReq(struct VMMDevReqMousePointer *pReq);
|
---|
554 | /** @} */
|
---|
555 |
|
---|
556 | /** @name Display
|
---|
557 | * @{ */
|
---|
558 | /** The folder for the video mode hint unix domain socket on Unix-like guests.
|
---|
559 | * @note This can be safely changed as all users are rebuilt in lock-step. */
|
---|
560 | #define VBGLR3HOSTDISPSOCKETPATH "/tmp/.VBoxService"
|
---|
561 | /** The path to the video mode hint unix domain socket on Unix-like guests. */
|
---|
562 | #define VBGLR3HOSTDISPSOCKET VBGLR3VIDEOMODEHINTSOCKETPATH "/VideoModeHint"
|
---|
563 |
|
---|
564 | /** The folder for saving video mode hints to between sessions. */
|
---|
565 | #define VBGLR3HOSTDISPSAVEDMODEPATH "/var/lib/VBoxGuestAdditions"
|
---|
566 | /** The path to the file for saving video mode hints to between sessions. */
|
---|
567 | #define VBGLR3HOSTDISPSAVEDMODE VBGLR3HOSTDISPSAVEDMODEPATH "/SavedVideoModes"
|
---|
568 |
|
---|
569 | VBGLR3DECL(int) VbglR3GetDisplayChangeRequest(uint32_t *pcx, uint32_t *pcy, uint32_t *pcBits, uint32_t *piDisplay,
|
---|
570 | uint32_t *pdx, uint32_t *pdy, bool *pfEnabled, bool *pfChangeOrigin, bool fAck);
|
---|
571 | VBGLR3DECL(int) VbglR3GetDisplayChangeRequestMulti(uint32_t cDisplaysIn, uint32_t *pcDisplaysOut,
|
---|
572 | VMMDevDisplayDef *paDisplays, bool fAck);
|
---|
573 | VBGLR3DECL(bool) VbglR3HostLikesVideoMode(uint32_t cx, uint32_t cy, uint32_t cBits);
|
---|
574 | VBGLR3DECL(int) VbglR3VideoModeGetHighestSavedScreen(unsigned *pcScreen);
|
---|
575 | VBGLR3DECL(int) VbglR3SaveVideoMode(unsigned cScreen, unsigned cx, unsigned cy, unsigned cBits,
|
---|
576 | unsigned x, unsigned y, bool fEnabled);
|
---|
577 | VBGLR3DECL(int) VbglR3RetrieveVideoMode(unsigned cScreen, unsigned *pcx, unsigned *pcy, unsigned *pcBits,
|
---|
578 | unsigned *px, unsigned *py, bool *pfEnabled);
|
---|
579 | /** @} */
|
---|
580 |
|
---|
581 | /** @name VRDP
|
---|
582 | * @{ */
|
---|
583 | VBGLR3DECL(int) VbglR3VrdpGetChangeRequest(bool *pfActive, uint32_t *puExperienceLevel);
|
---|
584 | /** @} */
|
---|
585 |
|
---|
586 | /** @name VM Statistics
|
---|
587 | * @{ */
|
---|
588 | VBGLR3DECL(int) VbglR3StatQueryInterval(uint32_t *pu32Interval);
|
---|
589 | # if defined(___VBox_VMMDev_h) || defined(DOXYGEN_RUNNING)
|
---|
590 | VBGLR3DECL(int) VbglR3StatReport(VMMDevReportGuestStats *pReq);
|
---|
591 | # endif
|
---|
592 | /** @} */
|
---|
593 |
|
---|
594 | /** @name Memory ballooning
|
---|
595 | * @{ */
|
---|
596 | VBGLR3DECL(int) VbglR3MemBalloonRefresh(uint32_t *pcChunks, bool *pfHandleInR3);
|
---|
597 | VBGLR3DECL(int) VbglR3MemBalloonChange(void *pv, bool fInflate);
|
---|
598 | /** @} */
|
---|
599 |
|
---|
600 | /** @name Core Dump
|
---|
601 | * @{ */
|
---|
602 | VBGLR3DECL(int) VbglR3WriteCoreDump(void);
|
---|
603 |
|
---|
604 | /** @} */
|
---|
605 |
|
---|
606 | # ifdef VBOX_WITH_GUEST_PROPS
|
---|
607 | /** @name Guest properties
|
---|
608 | * @{ */
|
---|
609 | /** @todo Docs. */
|
---|
610 | typedef struct VBGLR3GUESTPROPENUM VBGLR3GUESTPROPENUM;
|
---|
611 | /** @todo Docs. */
|
---|
612 | typedef VBGLR3GUESTPROPENUM *PVBGLR3GUESTPROPENUM;
|
---|
613 | VBGLR3DECL(int) VbglR3GuestPropConnect(uint32_t *pidClient);
|
---|
614 | VBGLR3DECL(int) VbglR3GuestPropDisconnect(HGCMCLIENTID idClient);
|
---|
615 | VBGLR3DECL(int) VbglR3GuestPropWrite(HGCMCLIENTID idClient, const char *pszName, const char *pszValue, const char *pszFlags);
|
---|
616 | VBGLR3DECL(int) VbglR3GuestPropWriteValue(HGCMCLIENTID idClient, const char *pszName, const char *pszValue);
|
---|
617 | VBGLR3DECL(int) VbglR3GuestPropWriteValueV(HGCMCLIENTID idClient, const char *pszName,
|
---|
618 | const char *pszValueFormat, va_list va) RT_IPRT_FORMAT_ATTR(3, 0);
|
---|
619 | VBGLR3DECL(int) VbglR3GuestPropWriteValueF(HGCMCLIENTID idClient, const char *pszName,
|
---|
620 | const char *pszValueFormat, ...) RT_IPRT_FORMAT_ATTR(3, 4);
|
---|
621 | VBGLR3DECL(int) VbglR3GuestPropRead(HGCMCLIENTID idClient, const char *pszName, void *pvBuf, uint32_t cbBuf, char **ppszValue,
|
---|
622 | uint64_t *pu64Timestamp, char **ppszFlags, uint32_t *pcbBufActual);
|
---|
623 | VBGLR3DECL(int) VbglR3GuestPropReadValue(uint32_t ClientId, const char *pszName, char *pszValue, uint32_t cchValue,
|
---|
624 | uint32_t *pcchValueActual);
|
---|
625 | VBGLR3DECL(int) VbglR3GuestPropReadValueAlloc(HGCMCLIENTID idClient, const char *pszName, char **ppszValue);
|
---|
626 | VBGLR3DECL(void) VbglR3GuestPropReadValueFree(char *pszValue);
|
---|
627 | VBGLR3DECL(int) VbglR3GuestPropEnumRaw(HGCMCLIENTID idClient, const char *paszPatterns, char *pcBuf, uint32_t cbBuf,
|
---|
628 | uint32_t *pcbBufActual);
|
---|
629 | VBGLR3DECL(int) VbglR3GuestPropEnum(HGCMCLIENTID idClient, char const * const *ppaszPatterns, uint32_t cPatterns,
|
---|
630 | PVBGLR3GUESTPROPENUM *ppHandle, char const **ppszName, char const **ppszValue,
|
---|
631 | uint64_t *pu64Timestamp, char const **ppszFlags);
|
---|
632 | VBGLR3DECL(int) VbglR3GuestPropEnumNext(PVBGLR3GUESTPROPENUM pHandle, char const **ppszName, char const **ppszValue,
|
---|
633 | uint64_t *pu64Timestamp, char const **ppszFlags);
|
---|
634 | VBGLR3DECL(void) VbglR3GuestPropEnumFree(PVBGLR3GUESTPROPENUM pHandle);
|
---|
635 | VBGLR3DECL(int) VbglR3GuestPropDelete(HGCMCLIENTID idClient, const char *pszName);
|
---|
636 | VBGLR3DECL(int) VbglR3GuestPropDelSet(HGCMCLIENTID idClient, char const * const *papszPatterns, uint32_t cPatterns);
|
---|
637 | VBGLR3DECL(int) VbglR3GuestPropWait(HGCMCLIENTID idClient, const char *pszPatterns, void *pvBuf, uint32_t cbBuf,
|
---|
638 | uint64_t u64Timestamp, uint32_t cMillies, char ** ppszName, char **ppszValue,
|
---|
639 | uint64_t *pu64Timestamp, char **ppszFlags, uint32_t *pcbBufActual);
|
---|
640 | /** @} */
|
---|
641 |
|
---|
642 | /** @name Guest user handling / reporting.
|
---|
643 | * @{ */
|
---|
644 | VBGLR3DECL(int) VbglR3GuestUserReportState(const char *pszUser, const char *pszDomain, VBoxGuestUserState enmState,
|
---|
645 | uint8_t *pbDetails, uint32_t cbDetails);
|
---|
646 | /** @} */
|
---|
647 |
|
---|
648 | /** @name Host version handling
|
---|
649 | * @{ */
|
---|
650 | VBGLR3DECL(int) VbglR3HostVersionCheckForUpdate(HGCMCLIENTID idClient, bool *pfUpdate, char **ppszHostVersion,
|
---|
651 | char **ppszGuestVersion);
|
---|
652 | VBGLR3DECL(int) VbglR3HostVersionLastCheckedLoad(HGCMCLIENTID idClient, char **ppszVer);
|
---|
653 | VBGLR3DECL(int) VbglR3HostVersionLastCheckedStore(HGCMCLIENTID idClient, const char *pszVer);
|
---|
654 | /** @} */
|
---|
655 | # endif /* VBOX_WITH_GUEST_PROPS defined */
|
---|
656 |
|
---|
657 | # ifdef VBOX_WITH_SHARED_FOLDERS
|
---|
658 | /** @name Shared folders
|
---|
659 | * @{ */
|
---|
660 | /**
|
---|
661 | * Structure containing mapping information for a shared folder.
|
---|
662 | */
|
---|
663 | typedef struct VBGLR3SHAREDFOLDERMAPPING
|
---|
664 | {
|
---|
665 | /** Mapping status. */
|
---|
666 | uint32_t u32Status;
|
---|
667 | /** Root handle. */
|
---|
668 | uint32_t u32Root;
|
---|
669 | } VBGLR3SHAREDFOLDERMAPPING;
|
---|
670 | /** Pointer to a shared folder mapping information structure. */
|
---|
671 | typedef VBGLR3SHAREDFOLDERMAPPING *PVBGLR3SHAREDFOLDERMAPPING;
|
---|
672 | /** Pointer to a const shared folder mapping information structure. */
|
---|
673 | typedef VBGLR3SHAREDFOLDERMAPPING const *PCVBGLR3SHAREDFOLDERMAPPING;
|
---|
674 |
|
---|
675 | VBGLR3DECL(int) VbglR3SharedFolderConnect(uint32_t *pidClient);
|
---|
676 | VBGLR3DECL(int) VbglR3SharedFolderDisconnect(HGCMCLIENTID idClient);
|
---|
677 | VBGLR3DECL(bool) VbglR3SharedFolderExists(HGCMCLIENTID idClient, const char *pszShareName);
|
---|
678 | VBGLR3DECL(int) VbglR3SharedFolderGetMappings(HGCMCLIENTID idClient, bool fAutoMountOnly,
|
---|
679 | PVBGLR3SHAREDFOLDERMAPPING *ppaMappings, uint32_t *pcMappings);
|
---|
680 | VBGLR3DECL(void) VbglR3SharedFolderFreeMappings(PVBGLR3SHAREDFOLDERMAPPING paMappings);
|
---|
681 | VBGLR3DECL(int) VbglR3SharedFolderGetName(HGCMCLIENTID idClient,uint32_t u32Root, char **ppszName);
|
---|
682 | VBGLR3DECL(int) VbglR3SharedFolderGetMountPrefix(char **ppszPrefix);
|
---|
683 | VBGLR3DECL(int) VbglR3SharedFolderGetMountDir(char **ppszDir);
|
---|
684 | /** @} */
|
---|
685 | # endif /* VBOX_WITH_SHARED_FOLDERS defined */
|
---|
686 |
|
---|
687 | # ifdef VBOX_WITH_GUEST_CONTROL
|
---|
688 | /** @name Guest control
|
---|
689 | * @{ */
|
---|
690 |
|
---|
691 | /**
|
---|
692 | * Structure containing the context required for
|
---|
693 | * either retrieving or sending a HGCM guest control
|
---|
694 | * commands from or to the host.
|
---|
695 | *
|
---|
696 | * Note: Do not change parameter order without also
|
---|
697 | * adapting all structure initializers.
|
---|
698 | */
|
---|
699 | typedef struct VBGLR3GUESTCTRLCMDCTX
|
---|
700 | {
|
---|
701 | /** @todo This struct could be handy if we want to implement
|
---|
702 | * a second communication channel, e.g. via TCP/IP.
|
---|
703 | * Use a union for the HGCM stuff then. */
|
---|
704 |
|
---|
705 | /** IN: HGCM client ID to use for
|
---|
706 | * communication. */
|
---|
707 | uint32_t uClientID;
|
---|
708 | /** IN/OUT: Context ID to retrieve
|
---|
709 | * or to use. */
|
---|
710 | uint32_t uContextID;
|
---|
711 | /** IN: Protocol version to use. */
|
---|
712 | uint32_t uProtocol;
|
---|
713 | /** OUT: Number of parameters retrieved. */
|
---|
714 | uint32_t uNumParms;
|
---|
715 | } VBGLR3GUESTCTRLCMDCTX, *PVBGLR3GUESTCTRLCMDCTX;
|
---|
716 |
|
---|
717 | /* General message handling on the guest. */
|
---|
718 | VBGLR3DECL(int) VbglR3GuestCtrlConnect(uint32_t *pidClient);
|
---|
719 | VBGLR3DECL(int) VbglR3GuestCtrlDisconnect(uint32_t idClient);
|
---|
720 | VBGLR3DECL(int) VbglR3GuestCtrlMsgFilterSet(uint32_t uClientId, uint32_t uValue, uint32_t uMaskAdd, uint32_t uMaskRemove);
|
---|
721 | VBGLR3DECL(int) VbglR3GuestCtrlMsgFilterUnset(uint32_t uClientId);
|
---|
722 | VBGLR3DECL(int) VbglR3GuestCtrlMsgReply(PVBGLR3GUESTCTRLCMDCTX pCtx, int rc);
|
---|
723 | VBGLR3DECL(int) VbglR3GuestCtrlMsgReplyEx(PVBGLR3GUESTCTRLCMDCTX pCtx, int rc, uint32_t uType,
|
---|
724 | void *pvPayload, uint32_t cbPayload);
|
---|
725 | VBGLR3DECL(int) VbglR3GuestCtrlMsgSkip(uint32_t uClientId);
|
---|
726 | VBGLR3DECL(int) VbglR3GuestCtrlMsgWaitFor(uint32_t uClientId, uint32_t *puMsg, uint32_t *puNumParms);
|
---|
727 | VBGLR3DECL(int) VbglR3GuestCtrlCancelPendingWaits(HGCMCLIENTID idClient);
|
---|
728 | /* Guest session handling. */
|
---|
729 | VBGLR3DECL(int) VbglR3GuestCtrlSessionClose(PVBGLR3GUESTCTRLCMDCTX pCtx, uint32_t fFlags);
|
---|
730 | VBGLR3DECL(int) VbglR3GuestCtrlSessionNotify(PVBGLR3GUESTCTRLCMDCTX pCtx, uint32_t uType, uint32_t uResult);
|
---|
731 | VBGLR3DECL(int) VbglR3GuestCtrlSessionGetOpen(PVBGLR3GUESTCTRLCMDCTX pCtx, uint32_t *puProtocol, char *pszUser, uint32_t cbUser,
|
---|
732 | char *pszPassword, uint32_t cbPassword, char *pszDomain, uint32_t cbDomain,
|
---|
733 | uint32_t *pfFlags, uint32_t *pidSession);
|
---|
734 | VBGLR3DECL(int) VbglR3GuestCtrlSessionGetClose(PVBGLR3GUESTCTRLCMDCTX pCtx, uint32_t *pfFlags, uint32_t *pidSession);
|
---|
735 | /* Guest path handling. */
|
---|
736 | VBGLR3DECL(int) VbglR3GuestCtrlPathGetRename(PVBGLR3GUESTCTRLCMDCTX pCtx, char *pszSource, uint32_t cbSource, char *pszDest,
|
---|
737 | uint32_t cbDest, uint32_t *pfFlags);
|
---|
738 | VBGLR3DECL(int) VbglR3GuestCtrlPathGetUserDocuments(PVBGLR3GUESTCTRLCMDCTX pCtx);
|
---|
739 | VBGLR3DECL(int) VbglR3GuestCtrlPathGetUserHome(PVBGLR3GUESTCTRLCMDCTX pCtx);
|
---|
740 | /* Guest process execution. */
|
---|
741 | VBGLR3DECL(int) VbglR3GuestCtrlProcGetStart(PVBGLR3GUESTCTRLCMDCTX pCtx, char *pszCmd, uint32_t cbCmd, uint32_t *pfFlags,
|
---|
742 | char *pszArgs, uint32_t cbArgs, uint32_t *puNumArgs, char *pszEnv, uint32_t *pcbEnv,
|
---|
743 | uint32_t *puNumEnvVars, char *pszUser, uint32_t cbUser, char *pszPassword,
|
---|
744 | uint32_t cbPassword, uint32_t *puTimeoutMS, uint32_t *puPriority,
|
---|
745 | uint64_t *puAffinity, uint32_t cbAffinity, uint32_t *pcAffinity);
|
---|
746 | VBGLR3DECL(int) VbglR3GuestCtrlProcGetTerminate(PVBGLR3GUESTCTRLCMDCTX pCtx, uint32_t *puPID);
|
---|
747 | VBGLR3DECL(int) VbglR3GuestCtrlProcGetInput(PVBGLR3GUESTCTRLCMDCTX pCtx, uint32_t *puPID, uint32_t *pfFlags, void *pvData,
|
---|
748 | uint32_t cbData, uint32_t *pcbSize);
|
---|
749 | VBGLR3DECL(int) VbglR3GuestCtrlProcGetOutput(PVBGLR3GUESTCTRLCMDCTX pCtx, uint32_t *puPID, uint32_t *puHandle, uint32_t *pfFlags);
|
---|
750 | VBGLR3DECL(int) VbglR3GuestCtrlProcGetWaitFor(PVBGLR3GUESTCTRLCMDCTX pCtx, uint32_t *puPID, uint32_t *puWaitFlags,
|
---|
751 | uint32_t *puTimeoutMS);
|
---|
752 | /* Guest native directory handling. */
|
---|
753 | VBGLR3DECL(int) VbglR3GuestCtrlDirGetRemove(PVBGLR3GUESTCTRLCMDCTX pCtx, char *pszPath, uint32_t cbPath, uint32_t *pfFlags);
|
---|
754 | /* Guest native file handling. */
|
---|
755 | VBGLR3DECL(int) VbglR3GuestCtrlFileGetOpen(PVBGLR3GUESTCTRLCMDCTX pCtx, char *pszFileName, uint32_t cbFileName, char *pszOpenMode,
|
---|
756 | uint32_t cbOpenMode, char *pszDisposition, uint32_t cbDisposition, char *pszSharing,
|
---|
757 | uint32_t cbSharing, uint32_t *puCreationMode, uint64_t *puOffset);
|
---|
758 | VBGLR3DECL(int) VbglR3GuestCtrlFileGetClose(PVBGLR3GUESTCTRLCMDCTX pCtx, uint32_t *puHandle);
|
---|
759 | VBGLR3DECL(int) VbglR3GuestCtrlFileGetRead(PVBGLR3GUESTCTRLCMDCTX pCtx, uint32_t *puHandle, uint32_t *puToRead);
|
---|
760 | VBGLR3DECL(int) VbglR3GuestCtrlFileGetReadAt(PVBGLR3GUESTCTRLCMDCTX pCtx, uint32_t *puHandle,
|
---|
761 | uint32_t *puToRead, uint64_t *poffRead);
|
---|
762 | VBGLR3DECL(int) VbglR3GuestCtrlFileGetWrite(PVBGLR3GUESTCTRLCMDCTX pCtx, uint32_t *puHandle,
|
---|
763 | void *pvData, uint32_t cbData, uint32_t *pcbActual);
|
---|
764 | VBGLR3DECL(int) VbglR3GuestCtrlFileGetWriteAt(PVBGLR3GUESTCTRLCMDCTX pCtx, uint32_t *puHandle, void *pvData, uint32_t cbData,
|
---|
765 | uint32_t *pcbActual, uint64_t *poffWrite);
|
---|
766 | VBGLR3DECL(int) VbglR3GuestCtrlFileGetSeek(PVBGLR3GUESTCTRLCMDCTX pCtx, uint32_t *puHandle,
|
---|
767 | uint32_t *puSeekMethod, uint64_t *poffSeek);
|
---|
768 | VBGLR3DECL(int) VbglR3GuestCtrlFileGetTell(PVBGLR3GUESTCTRLCMDCTX pCtx, uint32_t *puHandle);
|
---|
769 | /* Guest -> Host. */
|
---|
770 | VBGLR3DECL(int) VbglR3GuestCtrlFileCbOpen(PVBGLR3GUESTCTRLCMDCTX pCtx, uint32_t uRc, uint32_t uFileHandle);
|
---|
771 | VBGLR3DECL(int) VbglR3GuestCtrlFileCbClose(PVBGLR3GUESTCTRLCMDCTX pCtx, uint32_t uRc);
|
---|
772 | VBGLR3DECL(int) VbglR3GuestCtrlFileCbError(PVBGLR3GUESTCTRLCMDCTX pCtx, uint32_t uRc);
|
---|
773 | VBGLR3DECL(int) VbglR3GuestCtrlFileCbRead(PVBGLR3GUESTCTRLCMDCTX pCtx, uint32_t uRc, void *pvData, uint32_t cbData);
|
---|
774 | VBGLR3DECL(int) VbglR3GuestCtrlFileCbWrite(PVBGLR3GUESTCTRLCMDCTX pCtx, uint32_t uRc, uint32_t uWritten);
|
---|
775 | VBGLR3DECL(int) VbglR3GuestCtrlFileCbSeek(PVBGLR3GUESTCTRLCMDCTX pCtx, uint32_t uRc, uint64_t uOffActual);
|
---|
776 | VBGLR3DECL(int) VbglR3GuestCtrlFileCbTell(PVBGLR3GUESTCTRLCMDCTX pCtx, uint32_t uRc, uint64_t uOffActual);
|
---|
777 | VBGLR3DECL(int) VbglR3GuestCtrlProcCbStatus(PVBGLR3GUESTCTRLCMDCTX pCtx, uint32_t uPID, uint32_t uStatus, uint32_t fFlags,
|
---|
778 | void *pvData, uint32_t cbData);
|
---|
779 | VBGLR3DECL(int) VbglR3GuestCtrlProcCbOutput(PVBGLR3GUESTCTRLCMDCTX pCtx, uint32_t uPID, uint32_t uHandle, uint32_t fFlags,
|
---|
780 | void *pvData, uint32_t cbData);
|
---|
781 | VBGLR3DECL(int) VbglR3GuestCtrlProcCbStatusInput(PVBGLR3GUESTCTRLCMDCTX pCtx, uint32_t u32PID, uint32_t uStatus,
|
---|
782 | uint32_t fFlags, uint32_t cbWritten);
|
---|
783 |
|
---|
784 | /** @} */
|
---|
785 | # endif /* VBOX_WITH_GUEST_CONTROL defined */
|
---|
786 |
|
---|
787 | /** @name Auto-logon handling
|
---|
788 | * @{ */
|
---|
789 | VBGLR3DECL(int) VbglR3AutoLogonReportStatus(VBoxGuestFacilityStatus enmStatus);
|
---|
790 | VBGLR3DECL(bool) VbglR3AutoLogonIsRemoteSession(void);
|
---|
791 | /** @} */
|
---|
792 |
|
---|
793 | /** @name User credentials handling
|
---|
794 | * @{ */
|
---|
795 | VBGLR3DECL(int) VbglR3CredentialsQueryAvailability(void);
|
---|
796 | VBGLR3DECL(int) VbglR3CredentialsRetrieve(char **ppszUser, char **ppszPassword, char **ppszDomain);
|
---|
797 | VBGLR3DECL(int) VbglR3CredentialsRetrieveUtf16(PRTUTF16 *ppwszUser, PRTUTF16 *ppwszPassword, PRTUTF16 *ppwszDomain);
|
---|
798 | VBGLR3DECL(void) VbglR3CredentialsDestroy(char *pszUser, char *pszPassword, char *pszDomain, uint32_t cPasses);
|
---|
799 | VBGLR3DECL(void) VbglR3CredentialsDestroyUtf16(PRTUTF16 pwszUser, PRTUTF16 pwszPassword, PRTUTF16 pwszDomain,
|
---|
800 | uint32_t cPasses);
|
---|
801 | /** @} */
|
---|
802 |
|
---|
803 | /** @name CPU hotplug monitor
|
---|
804 | * @{ */
|
---|
805 | VBGLR3DECL(int) VbglR3CpuHotPlugInit(void);
|
---|
806 | VBGLR3DECL(int) VbglR3CpuHotPlugTerm(void);
|
---|
807 | VBGLR3DECL(int) VbglR3CpuHotPlugWaitForEvent(VMMDevCpuEventType *penmEventType, uint32_t *pidCpuCore, uint32_t *pidCpuPackage);
|
---|
808 | /** @} */
|
---|
809 |
|
---|
810 | /** @name Page sharing
|
---|
811 | * @{ */
|
---|
812 | struct VMMDEVSHAREDREGIONDESC;
|
---|
813 | VBGLR3DECL(int) VbglR3RegisterSharedModule(char *pszModuleName, char *pszVersion, RTGCPTR64 GCBaseAddr, uint32_t cbModule,
|
---|
814 | unsigned cRegions, struct VMMDEVSHAREDREGIONDESC *pRegions);
|
---|
815 | VBGLR3DECL(int) VbglR3UnregisterSharedModule(char *pszModuleName, char *pszVersion, RTGCPTR64 GCBaseAddr, uint32_t cbModule);
|
---|
816 | VBGLR3DECL(int) VbglR3CheckSharedModules(void);
|
---|
817 | VBGLR3DECL(bool) VbglR3PageSharingIsEnabled(void);
|
---|
818 | VBGLR3DECL(int) VbglR3PageIsShared(RTGCPTR pPage, bool *pfShared, uint64_t *puPageFlags);
|
---|
819 | /** @} */
|
---|
820 |
|
---|
821 | # ifdef VBOX_WITH_DRAG_AND_DROP
|
---|
822 | /** @name Drag and Drop
|
---|
823 | * @{ */
|
---|
824 | /**
|
---|
825 | * Structure containing the context required for
|
---|
826 | * either retrieving or sending a HGCM guest drag'n drop
|
---|
827 | * commands from or to the host.
|
---|
828 | *
|
---|
829 | * Note: Do not change parameter order without also
|
---|
830 | * adapting all structure initializers.
|
---|
831 | */
|
---|
832 | typedef struct VBGLR3GUESTDNDCMDCTX
|
---|
833 | {
|
---|
834 | /** @todo This struct could be handy if we want to implement
|
---|
835 | * a second communication channel, e.g. via TCP/IP.
|
---|
836 | * Use a union for the HGCM stuff then. */
|
---|
837 |
|
---|
838 | /** HGCM client ID to use for communication. */
|
---|
839 | uint32_t uClientID;
|
---|
840 | /** The VM's current session ID. */
|
---|
841 | uint64_t uSessionID;
|
---|
842 | /** Protocol version to use. */
|
---|
843 | uint32_t uProtocol;
|
---|
844 | /** Number of parameters retrieved for the current command. */
|
---|
845 | uint32_t uNumParms;
|
---|
846 | /** Max chunk size (in bytes) for data transfers. */
|
---|
847 | uint32_t cbMaxChunkSize;
|
---|
848 | } VBGLR3GUESTDNDCMDCTX, *PVBGLR3GUESTDNDCMDCTX;
|
---|
849 |
|
---|
850 | typedef struct VBGLR3DNDHGCMEVENT
|
---|
851 | {
|
---|
852 | uint32_t uType; /** The event type this struct contains. */
|
---|
853 | uint32_t uScreenId; /** Screen ID this request belongs to. */
|
---|
854 | char *pszFormats; /** Format list (\r\n separated). */
|
---|
855 | uint32_t cbFormats; /** Size (in bytes) of pszFormats (\0 included). */
|
---|
856 | union
|
---|
857 | {
|
---|
858 | struct
|
---|
859 | {
|
---|
860 | uint32_t uXpos; /** X position of guest screen. */
|
---|
861 | uint32_t uYpos; /** Y position of guest screen. */
|
---|
862 | uint32_t uDefAction; /** Proposed DnD action. */
|
---|
863 | uint32_t uAllActions; /** Allowed DnD actions. */
|
---|
864 | } a; /** Values used in init, move and drop event type. */
|
---|
865 | struct
|
---|
866 | {
|
---|
867 | void *pvData; /** Data request. */
|
---|
868 | uint32_t cbData; /** Size (in bytes) of pvData. */
|
---|
869 | } b; /** Values used in drop data event type. */
|
---|
870 | } u;
|
---|
871 | } VBGLR3DNDHGCMEVENT;
|
---|
872 | typedef VBGLR3DNDHGCMEVENT *PVBGLR3DNDHGCMEVENT;
|
---|
873 | typedef const PVBGLR3DNDHGCMEVENT CPVBGLR3DNDHGCMEVENT;
|
---|
874 | VBGLR3DECL(int) VbglR3DnDConnect(PVBGLR3GUESTDNDCMDCTX pCtx);
|
---|
875 | VBGLR3DECL(int) VbglR3DnDDisconnect(PVBGLR3GUESTDNDCMDCTX pCtx);
|
---|
876 |
|
---|
877 | VBGLR3DECL(int) VbglR3DnDRecvNextMsg(PVBGLR3GUESTDNDCMDCTX pCtx, CPVBGLR3DNDHGCMEVENT pEvent);
|
---|
878 |
|
---|
879 | VBGLR3DECL(int) VbglR3DnDHGSendAckOp(PVBGLR3GUESTDNDCMDCTX pCtx, uint32_t uAction);
|
---|
880 | VBGLR3DECL(int) VbglR3DnDHGSendReqData(PVBGLR3GUESTDNDCMDCTX pCtx, const char *pcszFormat);
|
---|
881 | VBGLR3DECL(int) VbglR3DnDHGSendProgress(PVBGLR3GUESTDNDCMDCTX pCtx, uint32_t uStatus, uint8_t uPercent, int rcErr);
|
---|
882 | # ifdef VBOX_WITH_DRAG_AND_DROP_GH
|
---|
883 | VBGLR3DECL(int) VbglR3DnDGHSendAckPending(PVBGLR3GUESTDNDCMDCTX pCtx, uint32_t uDefAction, uint32_t uAllActions, const char* pcszFormats, uint32_t cbFormats);
|
---|
884 | VBGLR3DECL(int) VbglR3DnDGHSendData(PVBGLR3GUESTDNDCMDCTX pCtx, const char *pszFormat, void *pvData, uint32_t cbData);
|
---|
885 | VBGLR3DECL(int) VbglR3DnDGHSendError(PVBGLR3GUESTDNDCMDCTX pCtx, int rcOp);
|
---|
886 | # endif /* VBOX_WITH_DRAG_AND_DROP_GH */
|
---|
887 | /** @} */
|
---|
888 | # endif /* VBOX_WITH_DRAG_AND_DROP */
|
---|
889 |
|
---|
890 | /* Generic Host Channel Service. */
|
---|
891 | VBGLR3DECL(int) VbglR3HostChannelInit(uint32_t *pidClient);
|
---|
892 | VBGLR3DECL(void) VbglR3HostChannelTerm(uint32_t idClient);
|
---|
893 | VBGLR3DECL(int) VbglR3HostChannelAttach(uint32_t *pu32ChannelHandle, uint32_t u32HGCMClientId,
|
---|
894 | const char *pszName, uint32_t u32Flags);
|
---|
895 | VBGLR3DECL(void) VbglR3HostChannelDetach(uint32_t u32ChannelHandle, uint32_t u32HGCMClientId);
|
---|
896 | VBGLR3DECL(int) VbglR3HostChannelSend(uint32_t u32ChannelHandle, uint32_t u32HGCMClientId,
|
---|
897 | void *pvData, uint32_t cbData);
|
---|
898 | VBGLR3DECL(int) VbglR3HostChannelRecv(uint32_t u32ChannelHandle, uint32_t u32HGCMClientId,
|
---|
899 | void *pvData, uint32_t cbData,
|
---|
900 | uint32_t *pu32SizeReceived, uint32_t *pu32SizeRemaining);
|
---|
901 | VBGLR3DECL(int) VbglR3HostChannelControl(uint32_t u32ChannelHandle, uint32_t u32HGCMClientId,
|
---|
902 | uint32_t u32Code, void *pvParm, uint32_t cbParm,
|
---|
903 | void *pvData, uint32_t cbData, uint32_t *pu32SizeDataReturned);
|
---|
904 | VBGLR3DECL(int) VbglR3HostChannelEventWait(uint32_t *pu32ChannelHandle, uint32_t u32HGCMClientId,
|
---|
905 | uint32_t *pu32EventId, void *pvParm, uint32_t cbParm,
|
---|
906 | uint32_t *pu32SizeReturned);
|
---|
907 | VBGLR3DECL(int) VbglR3HostChannelEventCancel(uint32_t u32ChannelHandle, uint32_t u32HGCMClientId);
|
---|
908 | VBGLR3DECL(int) VbglR3HostChannelQuery(const char *pszName, uint32_t u32HGCMClientId, uint32_t u32Code,
|
---|
909 | void *pvParm, uint32_t cbParm, void *pvData, uint32_t cbData,
|
---|
910 | uint32_t *pu32SizeDataReturned);
|
---|
911 |
|
---|
912 | /** @name Mode hint storage
|
---|
913 | * @{ */
|
---|
914 | VBGLR3DECL(int) VbglR3ReadVideoMode(unsigned cDisplay, unsigned *cx,
|
---|
915 | unsigned *cy, unsigned *cBPP, unsigned *x,
|
---|
916 | unsigned *y, unsigned *fEnabled);
|
---|
917 | VBGLR3DECL(int) VbglR3WriteVideoMode(unsigned cDisplay, unsigned cx,
|
---|
918 | unsigned cy, unsigned cBPP, unsigned x,
|
---|
919 | unsigned y, unsigned fEnabled);
|
---|
920 | /** @} */
|
---|
921 |
|
---|
922 | /** @name Generic HGCM
|
---|
923 | * @{ */
|
---|
924 | VBGLR3DECL(int) VbglR3HGCMConnect(const char *pszServiceName, HGCMCLIENTID *pidClient);
|
---|
925 | VBGLR3DECL(int) VbglR3HGCMDisconnect(HGCMCLIENTID idClient);
|
---|
926 | struct VBGLIOCHGCMCALL;
|
---|
927 | VBGLR3DECL(int) VbglR3HGCMCall(struct VBGLIOCHGCMCALL *pInfo, size_t cbInfo);
|
---|
928 | /** @} */
|
---|
929 |
|
---|
930 | #endif /* IN_RING3 */
|
---|
931 | /** @} */
|
---|
932 |
|
---|
933 | RT_C_DECLS_END
|
---|
934 |
|
---|
935 | /** @} */
|
---|
936 |
|
---|
937 | #endif
|
---|
938 |
|
---|