VirtualBox

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

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

VbglPhysHeapGetPhysAddr returns a 32-bit value, RTCCPHYS causes warnings due to implicit downcasting to smaller type.

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