VirtualBox

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

Last change on this file since 68561 was 68561, checked in by vboxsync, 8 years ago

merging vbglioc r117713: Linux code updates and build fixes.

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

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