VirtualBox

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

Last change on this file since 70917 was 70873, checked in by vboxsync, 7 years ago

VMMDev,VBoxGuest: Classify who is calling the host (part 1). bugref:9105

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