VirtualBox

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

Last change on this file since 42466 was 42466, checked in by vboxsync, 12 years ago

Additions/common/VBoxGuestLib: we do not need VbglIsReady() after all.

  • Property svn:eol-style set to native
  • Property svn:keywords set to Author Date Id Revision
File size: 28.1 KB
Line 
1/** @file
2 * VBoxGuestLib - VirtualBox Guest Additions Library.
3 */
4
5/*
6 * Copyright (C) 2006-2012 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# include <VBox/VBoxGuest2.h>
35#endif
36
37
38/** @defgroup grp_guest_lib VirtualBox Guest Additions Library
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
82/** @defgroup grp_guest_lib_r0 Ring-0 interface.
83 * @{
84 */
85#if defined(IN_RING0) && !defined(IN_RING0_AGNOSTIC)
86/** @def DECLR0VBGL
87 * Declare a VBGL ring-0 API with the right calling convention and visibilitiy.
88 * @param type Return type. */
89# define DECLR0VBGL(type) type VBOXCALL
90# define DECLVBGL(type) DECLR0VBGL(type)
91
92typedef uint32_t VBGLIOPORT; /**< @todo r=bird: We have RTIOPORT (uint16_t) for this. */
93
94
95# ifdef VBGL_VBOXGUEST
96
97/**
98 * The library initialization function to be used by the main
99 * VBoxGuest system driver.
100 *
101 * @return VBox status code.
102 */
103DECLVBGL(int) VbglInit (VBGLIOPORT portVMMDev, struct VMMDevMemory *pVMMDevMemory);
104
105# else
106
107/**
108 * The library initialization function to be used by all drivers
109 * other than the main VBoxGuest system driver.
110 *
111 * @return VBox status code.
112 */
113DECLVBGL(int) VbglInit (void);
114
115# endif
116
117/**
118 * The library termination function.
119 */
120DECLVBGL(void) VbglTerminate (void);
121
122
123/** @name Generic request functions.
124 * @{
125 */
126
127/**
128 * Allocate memory for generic request and initialize the request header.
129 *
130 * @param ppReq pointer to resulting memory address.
131 * @param cbSize size of memory block required for the request.
132 * @param reqType the generic request type.
133 *
134 * @return VBox status code.
135 */
136DECLVBGL(int) VbglGRAlloc (VMMDevRequestHeader **ppReq, uint32_t cbSize, VMMDevRequestType reqType);
137
138/**
139 * Perform the generic request.
140 *
141 * @param pReq pointer the request structure.
142 *
143 * @return VBox status code.
144 */
145DECLVBGL(int) VbglGRPerform (VMMDevRequestHeader *pReq);
146
147/**
148 * Free the generic request memory.
149 *
150 * @param pReq pointer the request structure.
151 *
152 * @return VBox status code.
153 */
154DECLVBGL(void) VbglGRFree (VMMDevRequestHeader *pReq);
155
156/**
157 * Verify the generic request header.
158 *
159 * @param pReq pointer the request header structure.
160 * @param cbReq size of the request memory block. It should be equal to the request size
161 * for fixed size requests. It can be greater than the request size for
162 * variable size requests.
163 *
164 * @return VBox status code.
165 */
166DECLVBGL(int) VbglGRVerify (const VMMDevRequestHeader *pReq, size_t cbReq);
167/** @} */
168
169# ifdef VBOX_WITH_HGCM
170
171# ifdef VBGL_VBOXGUEST
172
173/**
174 * Callback function called from HGCM helpers when a wait for request
175 * completion IRQ is required.
176 *
177 * @returns VINF_SUCCESS, VERR_INTERRUPT or VERR_TIMEOUT.
178 * @param pvData VBoxGuest pointer to be passed to callback.
179 * @param u32Data VBoxGuest 32 bit value to be passed to callback.
180 */
181typedef DECLVBGL(int) FNVBGLHGCMCALLBACK(VMMDevHGCMRequestHeader *pHeader, void *pvData, uint32_t u32Data);
182/** Pointer to a FNVBGLHGCMCALLBACK. */
183typedef FNVBGLHGCMCALLBACK *PFNVBGLHGCMCALLBACK;
184
185/**
186 * Perform a connect request. That is locate required service and
187 * obtain a client identifier for future access.
188 *
189 * @note This function can NOT handle cancelled requests!
190 *
191 * @param pConnectInfo The request data.
192 * @param pfnAsyncCallback Required pointer to function that is calledwhen
193 * host returns VINF_HGCM_ASYNC_EXECUTE. VBoxGuest
194 * implements waiting for an IRQ in this function.
195 * @param pvAsyncData An arbitrary VBoxGuest pointer to be passed to callback.
196 * @param u32AsyncData An arbitrary VBoxGuest 32 bit value to be passed to callback.
197 *
198 * @return VBox status code.
199 */
200
201DECLR0VBGL(int) VbglR0HGCMInternalConnect (VBoxGuestHGCMConnectInfo *pConnectInfo,
202 PFNVBGLHGCMCALLBACK pfnAsyncCallback, void *pvAsyncData, uint32_t u32AsyncData);
203
204
205/**
206 * Perform a disconnect request. That is tell the host that
207 * the client will not call the service anymore.
208 *
209 * @note This function can NOT handle cancelled requests!
210 *
211 * @param pDisconnectInfo The request data.
212 * @param pfnAsyncCallback Required pointer to function that is called when
213 * host returns VINF_HGCM_ASYNC_EXECUTE. VBoxGuest
214 * implements waiting for an IRQ in this function.
215 * @param pvAsyncData An arbitrary VBoxGuest pointer to be passed to callback.
216 * @param u32AsyncData An arbitrary VBoxGuest 32 bit value to be passed to
217 * callback.
218 *
219 * @return VBox status code.
220 */
221
222DECLR0VBGL(int) VbglR0HGCMInternalDisconnect (VBoxGuestHGCMDisconnectInfo *pDisconnectInfo,
223 PFNVBGLHGCMCALLBACK pfnAsyncCallback, void *pvAsyncData, uint32_t u32AsyncData);
224
225/** Call a HGCM service.
226 *
227 * @note This function can deal with cancelled requests.
228 *
229 * @param pCallInfo The request data.
230 * @param fFlags Flags, see VBGLR0_HGCMCALL_F_XXX.
231 * @param pfnAsyncCallback Required pointer to function that is called when
232 * host returns VINF_HGCM_ASYNC_EXECUTE. VBoxGuest
233 * implements waiting for an IRQ in this function.
234 * @param pvAsyncData An arbitrary VBoxGuest pointer to be passed to callback.
235 * @param u32AsyncData An arbitrary VBoxGuest 32 bit value to be passed to callback.
236 *
237 * @return VBox status code.
238 */
239DECLR0VBGL(int) VbglR0HGCMInternalCall (VBoxGuestHGCMCallInfo *pCallInfo, uint32_t cbCallInfo, uint32_t fFlags,
240 PFNVBGLHGCMCALLBACK pfnAsyncCallback, void *pvAsyncData, uint32_t u32AsyncData);
241
242/** Call a HGCM service. (32 bits packet structure in a 64 bits guest)
243 *
244 * @note This function can deal with cancelled requests.
245 *
246 * @param pCallInfo The request data.
247 * @param fFlags Flags, see VBGLR0_HGCMCALL_F_XXX.
248 * @param pfnAsyncCallback Required pointer to function that is called when
249 * host returns VINF_HGCM_ASYNC_EXECUTE. VBoxGuest
250 * implements waiting for an IRQ in this function.
251 * @param pvAsyncData An arbitrary VBoxGuest pointer to be passed to callback.
252 * @param u32AsyncData An arbitrary VBoxGuest 32 bit value to be passed to callback.
253 *
254 * @return VBox status code.
255 */
256DECLR0VBGL(int) VbglR0HGCMInternalCall32 (VBoxGuestHGCMCallInfo *pCallInfo, uint32_t cbCallInfo, uint32_t fFlags,
257 PFNVBGLHGCMCALLBACK pfnAsyncCallback, void *pvAsyncData, uint32_t u32AsyncData);
258
259/** @name VbglR0HGCMInternalCall flags
260 * @{ */
261/** User mode request.
262 * Indicates that only user mode addresses are permitted as parameters. */
263#define VBGLR0_HGCMCALL_F_USER UINT32_C(0)
264/** Kernel mode request.
265 * Indicates that kernel mode addresses are permitted as parameters. Whether or
266 * not user mode addresses are permitted is, unfortunately, OS specific. The
267 * following OSes allows user mode addresses: Windows, TODO.
268 */
269#define VBGLR0_HGCMCALL_F_KERNEL UINT32_C(1)
270/** Mode mask. */
271#define VBGLR0_HGCMCALL_F_MODE_MASK UINT32_C(1)
272/** @} */
273
274# else /* !VBGL_VBOXGUEST */
275
276struct VBGLHGCMHANDLEDATA;
277typedef struct VBGLHGCMHANDLEDATA *VBGLHGCMHANDLE;
278
279/** @name HGCM functions
280 * @{
281 */
282
283/**
284 * Connect to a service.
285 *
286 * @param pHandle Pointer to variable that will hold a handle to be used
287 * further in VbglHGCMCall and VbglHGCMClose.
288 * @param pData Connection information structure.
289 *
290 * @return VBox status code.
291 */
292DECLVBGL(int) VbglHGCMConnect (VBGLHGCMHANDLE *pHandle, VBoxGuestHGCMConnectInfo *pData);
293
294/**
295 * Connect to a service.
296 *
297 * @param handle Handle of the connection.
298 * @param pData Disconnect request information structure.
299 *
300 * @return VBox status code.
301 */
302DECLVBGL(int) VbglHGCMDisconnect (VBGLHGCMHANDLE handle, VBoxGuestHGCMDisconnectInfo *pData);
303
304/**
305 * Call to a service.
306 *
307 * @param handle Handle of the connection.
308 * @param pData Call request information structure, including function parameters.
309 * @param cbData Length in bytes of data.
310 *
311 * @return VBox status code.
312 */
313DECLVBGL(int) VbglHGCMCall (VBGLHGCMHANDLE handle, VBoxGuestHGCMCallInfo *pData, uint32_t cbData);
314
315/**
316 * Call to a service with user-mode data received by the calling driver from the User-Mode process.
317 * The call must be done in the context of a calling process.
318 *
319 * @param handle Handle of the connection.
320 * @param pData Call request information structure, including function parameters.
321 * @param cbData Length in bytes of data.
322 *
323 * @return VBox status code.
324 */
325DECLVBGL(int) VbglHGCMCallUserData (VBGLHGCMHANDLE handle, VBoxGuestHGCMCallInfo *pData, uint32_t cbData);
326
327/**
328 * Call to a service with timeout.
329 *
330 * @param handle Handle of the connection.
331 * @param pData Call request information structure, including function parameters.
332 * @param cbData Length in bytes of data.
333 * @param cMillies Timeout in milliseconds. Use RT_INDEFINITE_WAIT to wait forever.
334 *
335 * @return VBox status code.
336 */
337DECLVBGL(int) VbglHGCMCallTimed (VBGLHGCMHANDLE handle,
338 VBoxGuestHGCMCallInfoTimed *pData, uint32_t cbData);
339/** @} */
340
341# endif /* !VBGL_VBOXGUEST */
342
343# endif /* VBOX_WITH_HGCM */
344
345
346/**
347 * Initialize the heap.
348 *
349 * @return VBox error code.
350 */
351DECLVBGL(int) VbglPhysHeapInit (void);
352
353/**
354 * Shutdown the heap.
355 */
356DECLVBGL(void) VbglPhysHeapTerminate (void);
357
358
359/**
360 * Allocate a memory block.
361 *
362 * @param cbSize Size of block to be allocated.
363 * @return Virtual address of allocated memory block.
364 */
365DECLVBGL(void *) VbglPhysHeapAlloc (uint32_t cbSize);
366
367/**
368 * Get physical address of memory block pointed by
369 * the virtual address.
370 *
371 * @note WARNING!
372 * The function does not acquire the Heap mutex!
373 * When calling the function make sure that
374 * the pointer is a valid one and is not being
375 * deallocated.
376 * This function can NOT be used for verifying
377 * if the given pointer is a valid one allocated
378 * from the heap.
379 *
380 *
381 * @param p Virtual address of memory block.
382 * @return Physical memory block.
383 */
384DECLVBGL(RTCCPHYS) VbglPhysHeapGetPhysAddr (void *p);
385
386/**
387 * Free a memory block.
388 *
389 * @param p Virtual address of memory block.
390 */
391DECLVBGL(void) VbglPhysHeapFree (void *p);
392
393DECLVBGL(int) VbglQueryVMMDevMemory (VMMDevMemory **ppVMMDevMemory);
394DECLR0VBGL(bool) VbglR0CanUsePhysPageList(void);
395
396# ifndef VBOX_GUEST
397/** @name Mouse
398 * @{ */
399DECLVBGL(int) VbglSetMouseNotifyCallback(PFNVBOXGUESTMOUSENOTIFY pfnNotify, void *pvUser);
400DECLVBGL(int) VbglGetMouseStatus(uint32_t *pfFeatures, uint32_t *px, uint32_t *py);
401DECLVBGL(int) VbglSetMouseStatus(uint32_t fFeatures);
402/** @} */
403# endif /* VBOX_GUEST */
404
405#endif /* IN_RING0 && !IN_RING0_AGNOSTIC */
406/** @} */
407
408
409/** @defgroup grp_guest_lib_r3 Ring-3 interface.
410 * @{
411 */
412#ifdef IN_RING3
413
414/** @def VBGLR3DECL
415 * Ring 3 VBGL declaration.
416 * @param type The return type of the function declaration.
417 */
418# define VBGLR3DECL(type) type VBOXCALL
419
420/** @name General-purpose functions
421 * @{ */
422VBGLR3DECL(int) VbglR3Init(void);
423VBGLR3DECL(int) VbglR3InitUser(void);
424VBGLR3DECL(void) VbglR3Term(void);
425# ifdef ___iprt_time_h
426VBGLR3DECL(int) VbglR3GetHostTime(PRTTIMESPEC pTime);
427# endif
428VBGLR3DECL(int) VbglR3InterruptEventWaits(void);
429VBGLR3DECL(int) VbglR3WriteLog(const char *pch, size_t cch);
430VBGLR3DECL(int) VbglR3CtlFilterMask(uint32_t fOr, uint32_t fNot);
431VBGLR3DECL(int) VbglR3Daemonize(bool fNoChDir, bool fNoClose);
432VBGLR3DECL(int) VbglR3PidFile(const char *pszPath, PRTFILE phFile);
433VBGLR3DECL(void) VbglR3ClosePidFile(const char *pszPath, RTFILE hFile);
434VBGLR3DECL(int) VbglR3SetGuestCaps(uint32_t fOr, uint32_t fNot);
435VBGLR3DECL(int) VbglR3WaitEvent(uint32_t fMask, uint32_t cMillies, uint32_t *pfEvents);
436
437VBGLR3DECL(int) VbglR3ReportAdditionsStatus(VBoxGuestFacilityType Facility, VBoxGuestFacilityStatus StatusCurrent, uint32_t uFlags);
438VBGLR3DECL(int) VbglR3GetAdditionsVersion(char **ppszVer, char **ppszVerEx, char **ppszRev);
439VBGLR3DECL(int) VbglR3GetAdditionsInstallationPath(char **ppszPath);
440VBGLR3DECL(int) VbglR3GetSessionId(uint64_t *pu64IdSession);
441
442/** @} */
443
444/** @name Shared clipboard
445 * @{ */
446VBGLR3DECL(int) VbglR3ClipboardConnect(uint32_t *pu32ClientId);
447VBGLR3DECL(int) VbglR3ClipboardDisconnect(uint32_t u32ClientId);
448VBGLR3DECL(int) VbglR3ClipboardGetHostMsg(uint32_t u32ClientId, uint32_t *pMsg, uint32_t *pfFormats);
449VBGLR3DECL(int) VbglR3ClipboardReadData(uint32_t u32ClientId, uint32_t fFormat, void *pv, uint32_t cb, uint32_t *pcb);
450VBGLR3DECL(int) VbglR3ClipboardReportFormats(uint32_t u32ClientId, uint32_t fFormats);
451VBGLR3DECL(int) VbglR3ClipboardWriteData(uint32_t u32ClientId, uint32_t fFormat, void *pv, uint32_t cb);
452/** @} */
453
454/** @name Seamless mode
455 * @{ */
456VBGLR3DECL(int) VbglR3SeamlessSetCap(bool fState);
457VBGLR3DECL(int) VbglR3SeamlessWaitEvent(VMMDevSeamlessMode *pMode);
458VBGLR3DECL(int) VbglR3SeamlessSendRects(uint32_t cRects, PRTRECT pRects);
459VBGLR3DECL(int) VbglR3SeamlessGetLastEvent(VMMDevSeamlessMode *pMode);
460
461/** @} */
462
463/** @name Mouse
464 * @{ */
465VBGLR3DECL(int) VbglR3GetMouseStatus(uint32_t *pfFeatures, uint32_t *px, uint32_t *py);
466VBGLR3DECL(int) VbglR3SetMouseStatus(uint32_t fFeatures);
467/** @} */
468
469/** @name Video
470 * @{ */
471VBGLR3DECL(int) VbglR3VideoAccelEnable(bool fEnable);
472VBGLR3DECL(int) VbglR3VideoAccelFlush(void);
473VBGLR3DECL(int) VbglR3SetPointerShape(uint32_t fFlags, uint32_t xHot, uint32_t yHot, uint32_t cx, uint32_t cy, const void *pvImg, size_t cbImg);
474VBGLR3DECL(int) VbglR3SetPointerShapeReq(struct VMMDevReqMousePointer *pReq);
475/** @} */
476
477/** @name Display
478 * @{ */
479VBGLR3DECL(int) VbglR3GetDisplayChangeRequest(uint32_t *pcx, uint32_t *pcy, uint32_t *pcBits, uint32_t *piDisplay, bool fAck);
480VBGLR3DECL(bool) VbglR3HostLikesVideoMode(uint32_t cx, uint32_t cy, uint32_t cBits);
481VBGLR3DECL(int) VbglR3SaveVideoMode(const char *pszName, uint32_t cx, uint32_t cy, uint32_t cBits);
482VBGLR3DECL(int) VbglR3RetrieveVideoMode(const char *pszName, uint32_t *pcx, uint32_t *pcy, uint32_t *pcBits);
483/** @} */
484
485/** @name VM Statistics
486 * @{ */
487VBGLR3DECL(int) VbglR3StatQueryInterval(uint32_t *pu32Interval);
488VBGLR3DECL(int) VbglR3StatReport(VMMDevReportGuestStats *pReq);
489/** @} */
490
491/** @name Memory ballooning
492 * @{ */
493VBGLR3DECL(int) VbglR3MemBalloonRefresh(uint32_t *pcChunks, bool *pfHandleInR3);
494VBGLR3DECL(int) VbglR3MemBalloonChange(void *pv, bool fInflate);
495/** @} */
496
497/** @name Core Dump
498 * @{ */
499VBGLR3DECL(int) VbglR3WriteCoreDump(void);
500
501/** @} */
502
503# ifdef VBOX_WITH_GUEST_PROPS
504/** @name Guest properties
505 * @{ */
506/** @todo Docs. */
507typedef struct VBGLR3GUESTPROPENUM VBGLR3GUESTPROPENUM;
508/** @todo Docs. */
509typedef VBGLR3GUESTPROPENUM *PVBGLR3GUESTPROPENUM;
510VBGLR3DECL(int) VbglR3GuestPropConnect(uint32_t *pu32ClientId);
511VBGLR3DECL(int) VbglR3GuestPropDisconnect(uint32_t u32ClientId);
512VBGLR3DECL(int) VbglR3GuestPropWrite(uint32_t u32ClientId, const char *pszName, const char *pszValue, const char *pszFlags);
513VBGLR3DECL(int) VbglR3GuestPropWriteValue(uint32_t u32ClientId, const char *pszName, const char *pszValue);
514VBGLR3DECL(int) VbglR3GuestPropWriteValueV(uint32_t u32ClientId, const char *pszName, const char *pszValueFormat, va_list va);
515VBGLR3DECL(int) VbglR3GuestPropWriteValueF(uint32_t u32ClientId, const char *pszName, const char *pszValueFormat, ...);
516VBGLR3DECL(int) VbglR3GuestPropRead(uint32_t u32ClientId, const char *pszName, void *pvBuf, uint32_t cbBuf, char **ppszValue, uint64_t *pu64Timestamp, char **ppszFlags, uint32_t *pcbBufActual);
517VBGLR3DECL(int) VbglR3GuestPropReadValue(uint32_t ClientId, const char *pszName, char *pszValue, uint32_t cchValue, uint32_t *pcchValueActual);
518VBGLR3DECL(int) VbglR3GuestPropReadValueAlloc(uint32_t u32ClientId, const char *pszName, char **ppszValue);
519VBGLR3DECL(void) VbglR3GuestPropReadValueFree(char *pszValue);
520VBGLR3DECL(int) VbglR3GuestPropEnumRaw(uint32_t u32ClientId, const char *paszPatterns, char *pcBuf, uint32_t cbBuf, uint32_t *pcbBufActual);
521VBGLR3DECL(int) VbglR3GuestPropEnum(uint32_t u32ClientId, char const * const *ppaszPatterns, uint32_t cPatterns, PVBGLR3GUESTPROPENUM *ppHandle,
522 char const **ppszName, char const **ppszValue, uint64_t *pu64Timestamp, char const **ppszFlags);
523VBGLR3DECL(int) VbglR3GuestPropEnumNext(PVBGLR3GUESTPROPENUM pHandle, char const **ppszName, char const **ppszValue, uint64_t *pu64Timestamp,
524 char const **ppszFlags);
525VBGLR3DECL(void) VbglR3GuestPropEnumFree(PVBGLR3GUESTPROPENUM pHandle);
526VBGLR3DECL(int) VbglR3GuestPropDelSet(uint32_t u32ClientId, char const * const *papszPatterns, uint32_t cPatterns);
527VBGLR3DECL(int) VbglR3GuestPropWait(uint32_t u32ClientId, const char *pszPatterns, void *pvBuf, uint32_t cbBuf, uint64_t u64Timestamp, uint32_t cMillies, char ** ppszName, char **ppszValue, uint64_t *pu64Timestamp, char **ppszFlags, uint32_t *pcbBufActual);
528/** @} */
529
530/** @name Host version handling
531 * @{ */
532VBGLR3DECL(int) VbglR3HostVersionCheckForUpdate(uint32_t u32ClientId, bool *pfUpdate, char **ppszHostVersion, char **ppszGuestVersion);
533VBGLR3DECL(int) VbglR3HostVersionLastCheckedLoad(uint32_t u32ClientId, char **ppszVer);
534VBGLR3DECL(int) VbglR3HostVersionLastCheckedStore(uint32_t u32ClientId, const char *pszVer);
535/** @} */
536# endif /* VBOX_WITH_GUEST_PROPS defined */
537
538# ifdef VBOX_WITH_SHARED_FOLDERS
539/** @name Shared folders
540 * @{ */
541/**
542 * Structure containing mapping information for a shared folder.
543 */
544typedef struct VBGLR3SHAREDFOLDERMAPPING
545{
546 /** Mapping status. */
547 uint32_t u32Status;
548 /** Root handle. */
549 uint32_t u32Root;
550} VBGLR3SHAREDFOLDERMAPPING;
551/** Pointer to a shared folder mapping information struct. */
552typedef VBGLR3SHAREDFOLDERMAPPING *PVBGLR3SHAREDFOLDERMAPPING;
553
554VBGLR3DECL(int) VbglR3SharedFolderConnect(uint32_t *pu32ClientId);
555VBGLR3DECL(int) VbglR3SharedFolderDisconnect(uint32_t u32ClientId);
556VBGLR3DECL(bool) VbglR3SharedFolderExists(uint32_t u32ClientId, const char *pszShareName);
557VBGLR3DECL(int) VbglR3SharedFolderGetMappings(uint32_t u32ClientId, bool fAutoMountOnly,
558 PVBGLR3SHAREDFOLDERMAPPING *ppaMappings, uint32_t *pcMappings);
559VBGLR3DECL(void) VbglR3SharedFolderFreeMappings(PVBGLR3SHAREDFOLDERMAPPING paMappings);
560VBGLR3DECL(int) VbglR3SharedFolderGetName(uint32_t u32ClientId,uint32_t u32Root, char **ppszName);
561VBGLR3DECL(int) VbglR3SharedFolderGetMountPrefix(char **ppszPrefix);
562VBGLR3DECL(int) VbglR3SharedFolderGetMountDir(char **ppszDir);
563/** @} */
564# endif /* VBOX_WITH_SHARED_FOLDERS defined */
565
566# ifdef VBOX_WITH_GUEST_CONTROL
567/** @name Guest control
568 * @{ */
569VBGLR3DECL(int) VbglR3GuestCtrlConnect(uint32_t *pu32ClientId);
570VBGLR3DECL(int) VbglR3GuestCtrlDisconnect(uint32_t u32ClientId);
571VBGLR3DECL(int) VbglR3GuestCtrlWaitForHostMsg(uint32_t u32ClientId, uint32_t *puMsg, uint32_t *puNumParms);
572VBGLR3DECL(int) VbglR3GuestCtrlCancelPendingWaits(uint32_t u32ClientId);
573VBGLR3DECL(int) VbglR3GuestCtrlExecGetHostCmdExec(uint32_t u32ClientId, uint32_t cParms,
574 uint32_t *puContext,
575 char *pszCmd, uint32_t cbCmd,
576 uint32_t *puFlags,
577 char *pszArgs, uint32_t cbArgs, uint32_t *puNumArgs,
578 char *pszEnv, uint32_t *pcbEnv, uint32_t *puNumEnvVars,
579 char *pszUser, uint32_t cbUser,
580 char *pszPassword, uint32_t cbPassword,
581 uint32_t *puTimeLimit);
582VBGLR3DECL(int) VbglR3GuestCtrlExecGetHostCmdInput(uint32_t u32ClientId, uint32_t uNumParms,
583 uint32_t *puContext, uint32_t *puPID,
584 uint32_t *puFlags, void *pvData,
585 uint32_t cbData, uint32_t *pcbSize);
586VBGLR3DECL(int) VbglR3GuestCtrlExecGetHostCmdOutput(uint32_t u32ClientId, uint32_t uNumParms,
587 uint32_t *puContext, uint32_t *puPID,
588 uint32_t *puHandle, uint32_t *puFlags);
589VBGLR3DECL(int) VbglR3GuestCtrlExecReportStatus(uint32_t u32ClientId,
590 uint32_t u32Context,
591 uint32_t u32PID,
592 uint32_t u32Status,
593 uint32_t u32Flags,
594 void *pvData,
595 uint32_t cbData);
596VBGLR3DECL(int) VbglR3GuestCtrlExecSendOut(uint32_t u32ClientId,
597 uint32_t u32Context,
598 uint32_t u32PID,
599 uint32_t u32Handle,
600 uint32_t u32Flags,
601 void *pvData,
602 uint32_t cbData);
603VBGLR3DECL(int) VbglR3GuestCtrlExecReportStatusIn(uint32_t u32ClientId,
604 uint32_t u32Context,
605 uint32_t u32PID,
606 uint32_t u32Status,
607 uint32_t u32Flags,
608 uint32_t cbWritten);
609/** @} */
610# endif /* VBOX_WITH_GUEST_CONTROL defined */
611
612/** @name Auto-logon handling
613 * @{ */
614VBGLR3DECL(int) VbglR3AutoLogonReportStatus(VBoxGuestFacilityStatus enmStatus);
615VBGLR3DECL(bool) VbglR3AutoLogonIsRemoteSession(void);
616/** @} */
617
618/** @name User credentials handling
619 * @{ */
620VBGLR3DECL(int) VbglR3CredentialsQueryAvailability(void);
621VBGLR3DECL(int) VbglR3CredentialsRetrieve(char **ppszUser, char **ppszPassword, char **ppszDomain);
622VBGLR3DECL(int) VbglR3CredentialsRetrieveUtf16(PRTUTF16 *ppwszUser, PRTUTF16 *ppwszPassword, PRTUTF16 *ppwszDomain);
623VBGLR3DECL(void) VbglR3CredentialsDestroy(char *pszUser, char *pszPassword, char *pszDomain, uint32_t cPasses);
624VBGLR3DECL(void) VbglR3CredentialsDestroyUtf16(PRTUTF16 pwszUser, PRTUTF16 pwszPassword, PRTUTF16 pwszDomain,
625 uint32_t cPasses);
626/** @} */
627
628/** @name CPU hotplug monitor
629 * @{ */
630VBGLR3DECL(int) VbglR3CpuHotPlugInit(void);
631VBGLR3DECL(int) VbglR3CpuHotPlugTerm(void);
632VBGLR3DECL(int) VbglR3CpuHotPlugWaitForEvent(VMMDevCpuEventType *penmEventType, uint32_t *pidCpuCore, uint32_t *pidCpuPackage);
633/** @} */
634
635/** @name Page sharing
636 * @{ */
637VBGLR3DECL(int) VbglR3RegisterSharedModule(char *pszModuleName, char *pszVersion, RTGCPTR64 GCBaseAddr, uint32_t cbModule, unsigned cRegions, VMMDEVSHAREDREGIONDESC *pRegions);
638VBGLR3DECL(int) VbglR3UnregisterSharedModule(char *pszModuleName, char *pszVersion, RTGCPTR64 GCBaseAddr, uint32_t cbModule);
639VBGLR3DECL(int) VbglR3CheckSharedModules(void);
640VBGLR3DECL(bool) VbglR3PageSharingIsEnabled(void);
641VBGLR3DECL(int) VbglR3PageIsShared(RTGCPTR pPage, bool *pfShared, uint64_t *puPageFlags);
642/** @} */
643
644# ifdef VBOX_WITH_DRAG_AND_DROP
645/** @name Drag and Drop
646 * @{ */
647typedef struct VBGLR3DNDHGCMEVENT
648{
649 uint32_t uType; /** The event type this struct contains */
650 uint32_t uScreenId; /** Screen id this request belongs to */
651 char *pszFormats; /** Format list (\r\n separated) */
652 uint32_t cbFormats; /** Size of pszFormats (\0 included) */
653 union
654 {
655 struct
656 {
657 uint32_t uXpos; /** X position of guest screen */
658 uint32_t uYpos; /** Y position of guest screen */
659 uint32_t uDefAction; /** Proposed DnD action */
660 uint32_t uAllActions; /** Allowed DnD actions */
661 }a; /** Values used in init, move and drop event type */
662 struct
663 {
664 void *pvData; /** Data request */
665 size_t cbData; /** Size of pvData */
666 }b; /** Values used in drop data event type */
667 }u;
668} VBGLR3DNDHGCMEVENT;
669typedef VBGLR3DNDHGCMEVENT *PVBGLR3DNDHGCMEVENT;
670typedef const PVBGLR3DNDHGCMEVENT CPVBGLR3DNDHGCMEVENT;
671VBGLR3DECL(int) VbglR3DnDInit(void);
672VBGLR3DECL(int) VbglR3DnDTerm(void);
673
674VBGLR3DECL(int) VbglR3DnDConnect(uint32_t *pu32ClientId);
675VBGLR3DECL(int) VbglR3DnDDisconnect(uint32_t u32ClientId);
676
677VBGLR3DECL(int) VbglR3DnDProcessNextMessage(CPVBGLR3DNDHGCMEVENT pEvent);
678
679VBGLR3DECL(int) VbglR3DnDHGAcknowledgeOperation(uint32_t uAction);
680VBGLR3DECL(int) VbglR3DnDHGRequestData(const char* pcszFormat);
681# ifdef VBOX_WITH_DRAG_AND_DROP_GH
682VBGLR3DECL(int) VbglR3DnDGHAcknowledgePending(uint32_t uDefAction, uint32_t uAllActions, const char* pcszFormat);
683VBGLR3DECL(int) VbglR3DnDGHSendData(void *pvData, uint32_t cbData);
684VBGLR3DECL(int) VbglR3DnDGHErrorEvent(int rcOp);
685# endif /* VBOX_WITH_DRAG_AND_DROP_GH */
686/** @} */
687# endif /* VBOX_WITH_DRAG_AND_DROP */
688
689#endif /* IN_RING3 */
690/** @} */
691
692RT_C_DECLS_END
693
694/** @} */
695
696#endif
697
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