VirtualBox

source: vbox/trunk/include/VBox/VBoxGuestLib.h@ 75853

Last change on this file since 75853 was 75853, checked in by vboxsync, 6 years ago

GuestControl,HGCM,VBoxService: Save/restore related optimizations and changes. bugref:9313

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

© 2024 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette