VirtualBox

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

Last change on this file since 41279 was 40483, checked in by vboxsync, 13 years ago

crOpenGL/wddm: don't use VBoxGuest device to comply woth Metro apps security

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