VirtualBox

source: vbox/trunk/include/VBox/VBoxGuest.h@ 15743

Last change on this file since 15743 was 15706, checked in by vboxsync, 16 years ago

more reverts for 41266

  • Property svn:eol-style set to native
  • Property svn:keywords set to Author Date Id Revision
File size: 57.3 KB
Line 
1/** @file
2 * VBoxGuest - VirtualBox Guest Additions interface
3 */
4
5/*
6 * Copyright (C) 2006-2007 Sun Microsystems, Inc.
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 * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa
26 * Clara, CA 95054 USA or visit http://www.sun.com if you need
27 * additional information or have any questions.
28 */
29
30#ifndef ___VBox_VBoxGuest_h
31#define ___VBox_VBoxGuest_h
32
33#include <iprt/cdefs.h>
34#include <iprt/types.h>
35#ifdef IN_RING3
36# include <iprt/stdarg.h>
37#endif
38#include <VBox/err.h>
39#include <VBox/ostypes.h>
40
41/*******************************************************************************
42* Defined Constants And Macros *
43*******************************************************************************/
44
45/** @todo The following is a temporary fix for the problem of accessing
46 hypervisor pointers from within guest additions */
47
48/** Hypervisor linear pointer size type */
49typedef RTGCPTR32 VMMDEVHYPPTR32;
50typedef RTGCPTR64 VMMDEVHYPPTR64;
51/** Hypervisor physical pointer size type */
52typedef RTGCPHYS32 VMMDEVHYPPHYS32;
53typedef RTGCPHYS64 VMMDEVHYPPHYS64;
54
55#if defined(VBOX_WITH_64_BITS_GUESTS) && ARCH_BITS == 64
56# define VMMDEVHYPPTR VMMDEVHYPPTR64
57# define VMMDEVHYPPHYS VMMDEVHYPPHYS64
58# else
59# define VMMDEVHYPPTR VMMDEVHYPPTR32
60# define VMMDEVHYPPHYS VMMDEVHYPPHYS32
61#endif
62
63#if defined(RT_OS_LINUX)
64/** The support device name. */
65# define VBOXGUEST_DEVICE_NAME "/dev/vboxadd"
66
67#elif defined(RT_OS_OS2)
68/** The support device name. */
69# define VBOXGUEST_DEVICE_NAME "\\Dev\\VBoxGst$"
70
71#elif defined(RT_OS_SOLARIS)
72/** The support device name. */
73# define VBOXGUEST_DEVICE_NAME "/dev/vboxguest"
74
75#elif defined(RT_OS_WINDOWS)
76/** The support service name. */
77# define VBOXGUEST_SERVICE_NAME "VBoxGuest"
78/** Win32 Device name. */
79# define VBOXGUEST_DEVICE_NAME "\\\\.\\VBoxGuest"
80/** Global name for Win2k+ */
81# define VBOXGUEST_DEVICE_NAME_GLOBAL "\\\\.\\Global\\VBoxGuest"
82/** Win32 driver name */
83# define VBOXGUEST_DEVICE_NAME_NT L"\\Device\\VBoxGuest"
84/** device name */
85# define VBOXGUEST_DEVICE_NAME_DOS L"\\DosDevices\\VBoxGuest"
86
87#elif defined(RT_OS_FREEBSD)
88/** The support device name. */
89# define VBOXGUEST_DEVICE_NAME "/dev/vboxguest"
90
91#else
92/* PORTME */
93#endif
94
95/** VirtualBox vendor ID */
96#define VBOX_PCI_VENDORID (0x80ee)
97
98/** VMMDev PCI card identifiers */
99#define VMMDEV_VENDORID VBOX_PCI_VENDORID
100#define VMMDEV_DEVICEID (0xcafe)
101
102/** VirtualBox graphics card identifiers */
103#define VBOX_VENDORID VBOX_PCI_VENDORID
104#define VBOX_VESA_VENDORID VBOX_PCI_VENDORID
105#define VBOX_DEVICEID (0xbeef)
106#define VBOX_VESA_DEVICEID (0xbeef)
107
108/**
109 * VBoxGuest port definitions
110 * @{
111 */
112
113/** guest can (== wants to) handle absolute coordinates */
114#define VBOXGUEST_MOUSE_GUEST_CAN_ABSOLUTE RT_BIT(0)
115/** host can (== wants to) send absolute coordinates */
116#define VBOXGUEST_MOUSE_HOST_CAN_ABSOLUTE RT_BIT(1)
117/** guest can *NOT* switch to software cursor and therefore depends on the host cursor */
118#define VBOXGUEST_MOUSE_GUEST_NEEDS_HOST_CURSOR RT_BIT(2)
119/** host does NOT provide support for drawing the cursor itself (e.g. L4 console) */
120#define VBOXGUEST_MOUSE_HOST_CANNOT_HWPOINTER RT_BIT(3)
121
122/** fictive start address of the hypervisor physical memory for MmMapIoSpace */
123#define HYPERVISOR_PHYSICAL_START 0xf8000000
124
125/*
126 * VMMDev Generic Request Interface
127 */
128
129/** port for generic request interface */
130#define PORT_VMMDEV_REQUEST_OFFSET 0
131
132/** Current version of the VMMDev interface.
133 *
134 * Additions are allowed to work only if
135 * additions_major == vmmdev_current && additions_minor <= vmmdev_current.
136 * Additions version is reported to host (VMMDev) by VMMDevReq_ReportGuestInfo.
137 *
138 * @remark These defines also live in the 16-bit and assembly versions of this header.
139 */
140#define VMMDEV_VERSION 0x00010004
141#define VMMDEV_VERSION_MAJOR (VMMDEV_VERSION >> 16)
142#define VMMDEV_VERSION_MINOR (VMMDEV_VERSION & 0xffff)
143
144/* Maximum request packet size */
145#define VMMDEV_MAX_VMMDEVREQ_SIZE _1M
146
147/**
148 * VMMDev request types.
149 * @note when updating this, adjust vmmdevGetRequestSize() as well
150 */
151typedef enum
152{
153 VMMDevReq_InvalidRequest = 0,
154 VMMDevReq_GetMouseStatus = 1,
155 VMMDevReq_SetMouseStatus = 2,
156 VMMDevReq_SetPointerShape = 3,
157 /** @todo implement on host side */
158 VMMDevReq_GetHostVersion = 4,
159 VMMDevReq_Idle = 5,
160 VMMDevReq_GetHostTime = 10,
161 VMMDevReq_GetHypervisorInfo = 20,
162 VMMDevReq_SetHypervisorInfo = 21,
163 VMMDevReq_SetPowerStatus = 30,
164 VMMDevReq_AcknowledgeEvents = 41,
165 VMMDevReq_CtlGuestFilterMask = 42,
166 VMMDevReq_ReportGuestInfo = 50,
167 VMMDevReq_GetDisplayChangeRequest = 51,
168 VMMDevReq_VideoModeSupported = 52,
169 VMMDevReq_GetHeightReduction = 53,
170 VMMDevReq_GetDisplayChangeRequest2 = 54,
171 VMMDevReq_ReportGuestCapabilities = 55,
172 VMMDevReq_SetGuestCapabilities = 56,
173#ifdef VBOX_WITH_HGCM
174 VMMDevReq_HGCMConnect = 60,
175 VMMDevReq_HGCMDisconnect = 61,
176#ifdef VBOX_WITH_64_BITS_GUESTS
177 VMMDevReq_HGCMCall32 = 62,
178 VMMDevReq_HGCMCall64 = 63,
179#else
180 VMMDevReq_HGCMCall = 62,
181#endif /* VBOX_WITH_64_BITS_GUESTS */
182 VMMDevReq_HGCMCancel = 64,
183#endif
184 VMMDevReq_VideoAccelEnable = 70,
185 VMMDevReq_VideoAccelFlush = 71,
186 VMMDevReq_VideoSetVisibleRegion = 72,
187 VMMDevReq_GetSeamlessChangeRequest = 73,
188 VMMDevReq_QueryCredentials = 100,
189 VMMDevReq_ReportCredentialsJudgement = 101,
190 VMMDevReq_ReportGuestStats = 110,
191 VMMDevReq_GetMemBalloonChangeRequest = 111,
192 VMMDevReq_GetStatisticsChangeRequest = 112,
193 VMMDevReq_ChangeMemBalloon = 113,
194 VMMDevReq_GetVRDPChangeRequest = 150,
195 VMMDevReq_LogString = 200,
196 VMMDevReq_SizeHack = 0x7fffffff
197} VMMDevRequestType;
198
199#ifdef VBOX_WITH_64_BITS_GUESTS
200/*
201 * Constants and structures are redefined for the guest.
202 *
203 * Host code MUST always use either *32 or *64 variant explicitely.
204 * Host source code will use VBOX_HGCM_HOST_CODE define to catch undefined
205 * data types and constants.
206 *
207 * This redefinition means that the new additions builds will use
208 * the *64 or *32 variants depending on the current architecture bit count (ARCH_BITS).
209 */
210# ifndef VBOX_HGCM_HOST_CODE
211# if ARCH_BITS == 64
212# define VMMDevReq_HGCMCall VMMDevReq_HGCMCall64
213# elif ARCH_BITS == 32
214# define VMMDevReq_HGCMCall VMMDevReq_HGCMCall32
215# else
216# error "Unsupported ARCH_BITS"
217# endif
218# endif /* !VBOX_HGCM_HOST_CODE */
219#endif /* VBOX_WITH_64_BITS_GUESTS */
220
221/** Version of VMMDevRequestHeader structure. */
222#define VMMDEV_REQUEST_HEADER_VERSION (0x10001)
223
224#pragma pack(4)
225/** generic VMMDev request header */
226typedef struct
227{
228 /** size of the structure in bytes (including body). Filled by caller */
229 uint32_t size;
230 /** version of the structure. Filled by caller */
231 uint32_t version;
232 /** type of the request */
233 VMMDevRequestType requestType;
234 /** return code. Filled by VMMDev */
235 int32_t rc;
236 /** reserved fields */
237 uint32_t reserved1;
238 uint32_t reserved2;
239} VMMDevRequestHeader;
240
241/** mouse status request structure */
242typedef struct
243{
244 /** header */
245 VMMDevRequestHeader header;
246 /** mouse feature mask */
247 uint32_t mouseFeatures;
248 /** mouse x position */
249 uint32_t pointerXPos;
250 /** mouse y position */
251 uint32_t pointerYPos;
252} VMMDevReqMouseStatus;
253
254/** Note VBOX_MOUSE_POINTER_* flags are used in guest video driver,
255 * values must be <= 0x8000 and must not be changed.
256 */
257
258/** pointer is visible */
259#define VBOX_MOUSE_POINTER_VISIBLE (0x0001)
260/** pointer has alpha channel */
261#define VBOX_MOUSE_POINTER_ALPHA (0x0002)
262/** pointerData contains new pointer shape */
263#define VBOX_MOUSE_POINTER_SHAPE (0x0004)
264
265/** mouse pointer shape/visibility change request */
266typedef struct
267{
268 /** header */
269 VMMDevRequestHeader header;
270 /** VBOX_MOUSE_POINTER_* bit flags */
271 uint32_t fFlags;
272 /** x coordinate of hot spot */
273 uint32_t xHot;
274 /** y coordinate of hot spot */
275 uint32_t yHot;
276 /** width of the pointer in pixels */
277 uint32_t width;
278 /** height of the pointer in scanlines */
279 uint32_t height;
280 /** Pointer data.
281 *
282 ****
283 * The data consists of 1 bpp AND mask followed by 32 bpp XOR (color) mask.
284 *
285 * For pointers without alpha channel the XOR mask pixels are 32 bit values: (lsb)BGR0(msb).
286 * For pointers with alpha channel the XOR mask consists of (lsb)BGRA(msb) 32 bit values.
287 *
288 * Guest driver must create the AND mask for pointers with alpha channel, so if host does not
289 * support alpha, the pointer could be displayed as a normal color pointer. The AND mask can
290 * be constructed from alpha values. For example alpha value >= 0xf0 means bit 0 in the AND mask.
291 *
292 * The AND mask is 1 bpp bitmap with byte aligned scanlines. Size of AND mask,
293 * therefore, is cbAnd = (width + 7) / 8 * height. The padding bits at the
294 * end of any scanline are undefined.
295 *
296 * The XOR mask follows the AND mask on the next 4 bytes aligned offset:
297 * uint8_t *pXor = pAnd + (cbAnd + 3) & ~3
298 * Bytes in the gap between the AND and the XOR mask are undefined.
299 * XOR mask scanlines have no gap between them and size of XOR mask is:
300 * cXor = width * 4 * height.
301 ****
302 *
303 * Preallocate 4 bytes for accessing actual data as p->pointerData
304 */
305 char pointerData[4];
306} VMMDevReqMousePointer;
307
308/** string log request structure */
309typedef struct
310{
311 /** header */
312 VMMDevRequestHeader header;
313 /** variable length string data */
314 char szString[1];
315} VMMDevReqLogString;
316
317/** host version request structure */
318typedef struct
319{
320 /** header */
321 VMMDevRequestHeader header;
322 /** major version */
323 uint32_t major;
324 /** minor version */
325 uint32_t minor;
326 /** build number */
327 uint32_t build;
328} VMMDevReqHostVersion;
329
330/** guest capabilites structure */
331typedef struct
332{
333 /** header */
334 VMMDevRequestHeader header;
335 /** capabilities (VMMDEV_GUEST_*) */
336 uint32_t caps;
337} VMMDevReqGuestCapabilities;
338
339/** guest capabilites structure */
340typedef struct
341{
342 /** header */
343 VMMDevRequestHeader header;
344 /** mask of capabilities to be added */
345 uint32_t u32OrMask;
346 /** mask of capabilities to be removed */
347 uint32_t u32NotMask;
348} VMMDevReqGuestCapabilities2;
349
350/** idle request structure */
351typedef struct
352{
353 /** header */
354 VMMDevRequestHeader header;
355} VMMDevReqIdle;
356
357/** host time request structure */
358typedef struct
359{
360 /** header */
361 VMMDevRequestHeader header;
362 /** time in milliseconds since unix epoch. Filled by VMMDev. */
363 uint64_t time;
364} VMMDevReqHostTime;
365
366/** hypervisor info structure */
367typedef struct
368{
369 /** header */
370 VMMDevRequestHeader header;
371 /** guest virtual address of proposed hypervisor start */
372 /** TODO: Make this 64-bit compatible */
373 VMMDEVHYPPTR32 hypervisorStart;
374 /** hypervisor size in bytes */
375 uint32_t hypervisorSize;
376} VMMDevReqHypervisorInfo;
377
378/** system power requests */
379typedef enum
380{
381 VMMDevPowerState_Invalid = 0,
382 VMMDevPowerState_Pause = 1,
383 VMMDevPowerState_PowerOff = 2,
384 VMMDevPowerState_SaveState = 3,
385 VMMDevPowerState_SizeHack = 0x7fffffff
386} VMMDevPowerState;
387
388/** system power status structure */
389typedef struct
390{
391 /** header */
392 VMMDevRequestHeader header;
393 /** power state request */
394 VMMDevPowerState powerState;
395} VMMDevPowerStateRequest;
396
397/** pending events structure */
398typedef struct
399{
400 /** header */
401 VMMDevRequestHeader header;
402 /** pending event bitmap */
403 uint32_t events;
404} VMMDevEvents;
405
406/** guest filter mask control */
407typedef struct
408{
409 /** header */
410 VMMDevRequestHeader header;
411 /** mask of events to be added to filter */
412 uint32_t u32OrMask;
413 /** mask of events to be removed from filter */
414 uint32_t u32NotMask;
415} VMMDevCtlGuestFilterMask;
416
417/** guest information structure */
418typedef struct VBoxGuestInfo
419{
420 /** The VMMDev interface version expected by additions. */
421 uint32_t additionsVersion;
422 /** guest OS type */
423 VBOXOSTYPE osType;
424 /** @todo */
425} VBoxGuestInfo;
426
427/** guest information structure */
428typedef struct
429{
430 /** header */
431 VMMDevRequestHeader header;
432 /** Guest information. */
433 VBoxGuestInfo guestInfo;
434} VMMDevReportGuestInfo;
435
436/** guest statistics values */
437#define VBOX_GUEST_STAT_CPU_LOAD_IDLE RT_BIT(0)
438#define VBOX_GUEST_STAT_CPU_LOAD_KERNEL RT_BIT(1)
439#define VBOX_GUEST_STAT_CPU_LOAD_USER RT_BIT(2)
440#define VBOX_GUEST_STAT_THREADS RT_BIT(3)
441#define VBOX_GUEST_STAT_PROCESSES RT_BIT(4)
442#define VBOX_GUEST_STAT_HANDLES RT_BIT(5)
443#define VBOX_GUEST_STAT_MEMORY_LOAD RT_BIT(6)
444#define VBOX_GUEST_STAT_PHYS_MEM_TOTAL RT_BIT(7)
445#define VBOX_GUEST_STAT_PHYS_MEM_AVAIL RT_BIT(8)
446#define VBOX_GUEST_STAT_PHYS_MEM_BALLOON RT_BIT(9)
447#define VBOX_GUEST_STAT_MEM_COMMIT_TOTAL RT_BIT(10)
448#define VBOX_GUEST_STAT_MEM_KERNEL_TOTAL RT_BIT(11)
449#define VBOX_GUEST_STAT_MEM_KERNEL_PAGED RT_BIT(12)
450#define VBOX_GUEST_STAT_MEM_KERNEL_NONPAGED RT_BIT(13)
451#define VBOX_GUEST_STAT_MEM_SYSTEM_CACHE RT_BIT(14)
452#define VBOX_GUEST_STAT_PAGE_FILE_SIZE RT_BIT(15)
453
454
455/** guest statistics structure */
456typedef struct VBoxGuestStatistics
457{
458 /** Virtual CPU id */
459 uint32_t u32CpuId;
460 /** Reported statistics */
461 uint32_t u32StatCaps;
462 /** Idle CPU load (0-100) for last interval */
463 uint32_t u32CpuLoad_Idle;
464 /** Kernel CPU load (0-100) for last interval */
465 uint32_t u32CpuLoad_Kernel;
466 /** User CPU load (0-100) for last interval */
467 uint32_t u32CpuLoad_User;
468 /** Nr of threads */
469 uint32_t u32Threads;
470 /** Nr of processes */
471 uint32_t u32Processes;
472 /** Nr of handles */
473 uint32_t u32Handles;
474 /** Memory load (0-100) */
475 uint32_t u32MemoryLoad;
476 /** Page size of guest system */
477 uint32_t u32PageSize;
478 /** Total physical memory (in 4kb pages) */
479 uint32_t u32PhysMemTotal;
480 /** Available physical memory (in 4kb pages) */
481 uint32_t u32PhysMemAvail;
482 /** Ballooned physical memory (in 4kb pages) */
483 uint32_t u32PhysMemBalloon;
484 /** Total number of committed memory (which is not necessarily in-use) (in 4kb pages) */
485 uint32_t u32MemCommitTotal;
486 /** Total amount of memory used by the kernel (in 4kb pages) */
487 uint32_t u32MemKernelTotal;
488 /** Total amount of paged memory used by the kernel (in 4kb pages) */
489 uint32_t u32MemKernelPaged;
490 /** Total amount of nonpaged memory used by the kernel (in 4kb pages) */
491 uint32_t u32MemKernelNonPaged;
492 /** Total amount of memory used for the system cache (in 4kb pages) */
493 uint32_t u32MemSystemCache;
494 /** Pagefile size (in 4kb pages) */
495 uint32_t u32PageFileSize;
496} VBoxGuestStatistics;
497
498/** guest statistics command structure */
499typedef struct
500{
501 /** header */
502 VMMDevRequestHeader header;
503 /** Guest information. */
504 VBoxGuestStatistics guestStats;
505} VMMDevReportGuestStats;
506
507/** memory balloon change request structure */
508#define VMMDEV_MAX_MEMORY_BALLOON(PhysMemTotal) ((90*PhysMemTotal)/100)
509
510typedef struct
511{
512 /** header */
513 VMMDevRequestHeader header;
514 uint32_t u32BalloonSize; /* balloon size in megabytes */
515 uint32_t u32PhysMemSize; /* guest ram size in megabytes */
516 uint32_t eventAck;
517} VMMDevGetMemBalloonChangeRequest;
518
519/** inflate/deflate memory balloon structure */
520#define VMMDEV_MEMORY_BALLOON_CHUNK_PAGES (_1M/4096)
521#define VMMDEV_MEMORY_BALLOON_CHUNK_SIZE (VMMDEV_MEMORY_BALLOON_CHUNK_PAGES*4096)
522
523typedef struct
524{
525 /** header */
526 VMMDevRequestHeader header;
527 uint32_t cPages;
528 uint32_t fInflate; /* true = inflate, false = defalte */
529 /** Physical address (RTGCPHYS) of each page, variable size. */
530 RTGCPHYS aPhysPage[1];
531} VMMDevChangeMemBalloon;
532
533/** guest statistics interval change request structure */
534typedef struct
535{
536 /** header */
537 VMMDevRequestHeader header;
538 uint32_t u32StatInterval; /* interval in seconds */
539 uint32_t eventAck;
540} VMMDevGetStatisticsChangeRequest;
541
542/** display change request structure */
543typedef struct
544{
545 /** header */
546 VMMDevRequestHeader header;
547 /** horizontal pixel resolution (0 = do not change) */
548 uint32_t xres;
549 /** vertical pixel resolution (0 = do not change) */
550 uint32_t yres;
551 /** bits per pixel (0 = do not change) */
552 uint32_t bpp;
553 /** Flag that the request is an acknowlegement for the VMMDEV_EVENT_DISPLAY_CHANGE_REQUEST.
554 * Values: 0 - just querying, VMMDEV_EVENT_DISPLAY_CHANGE_REQUEST - event acknowledged.
555 */
556 uint32_t eventAck;
557} VMMDevDisplayChangeRequest;
558
559typedef struct
560{
561 /** header */
562 VMMDevRequestHeader header;
563 /** horizontal pixel resolution (0 = do not change) */
564 uint32_t xres;
565 /** vertical pixel resolution (0 = do not change) */
566 uint32_t yres;
567 /** bits per pixel (0 = do not change) */
568 uint32_t bpp;
569 /** Flag that the request is an acknowlegement for the VMMDEV_EVENT_DISPLAY_CHANGE_REQUEST.
570 * Values: 0 - just querying, VMMDEV_EVENT_DISPLAY_CHANGE_REQUEST - event acknowledged.
571 */
572 uint32_t eventAck;
573 /** 0 for primary display, 1 for the first secondary, etc. */
574 uint32_t display;
575} VMMDevDisplayChangeRequest2;
576
577/** video mode supported request structure */
578typedef struct
579{
580 /** header */
581 VMMDevRequestHeader header;
582 /** horizontal pixel resolution (input) */
583 uint32_t width;
584 /** vertical pixel resolution (input) */
585 uint32_t height;
586 /** bits per pixel (input) */
587 uint32_t bpp;
588 /** supported flag (output) */
589 bool fSupported;
590} VMMDevVideoModeSupportedRequest;
591
592/** video modes height reduction request structure */
593typedef struct
594{
595 /** header */
596 VMMDevRequestHeader header;
597 /** height reduction in pixels (output) */
598 uint32_t heightReduction;
599} VMMDevGetHeightReductionRequest;
600
601#define VRDP_EXPERIENCE_LEVEL_ZERO 0 /* Theming disabled. */
602#define VRDP_EXPERIENCE_LEVEL_LOW 1 /* Full window dragging and desktop wallpaper disabled. */
603#define VRDP_EXPERIENCE_LEVEL_MEDIUM 2 /* Font smoothing, gradients. */
604#define VRDP_EXPERIENCE_LEVEL_HIGH 3 /* Animation effects disabled. */
605#define VRDP_EXPERIENCE_LEVEL_FULL 4 /* Everything enabled. */
606
607typedef struct
608{
609 /** header */
610 VMMDevRequestHeader header;
611 /** Whether VRDP is active or not */
612 uint8_t u8VRDPActive;
613 /** The configured experience level for active VRDP. */
614 uint32_t u32VRDPExperienceLevel;
615} VMMDevVRDPChangeRequest;
616
617
618
619#pragma pack()
620
621#ifdef VBOX_WITH_HGCM
622
623/** HGCM flags.
624 * @{
625 */
626#define VBOX_HGCM_REQ_DONE (0x1)
627#define VBOX_HGCM_REQ_CANCELLED (0x2)
628/** @} */
629
630#pragma pack(4)
631typedef struct _VMMDevHGCMRequestHeader
632{
633 /** Request header. */
634 VMMDevRequestHeader header;
635
636 /** HGCM flags. */
637 uint32_t fu32Flags;
638
639 /** Result code. */
640 int32_t result;
641} VMMDevHGCMRequestHeader;
642
643/** HGCM service location types. */
644typedef enum
645{
646 VMMDevHGCMLoc_Invalid = 0,
647 VMMDevHGCMLoc_LocalHost = 1,
648 VMMDevHGCMLoc_LocalHost_Existing = 2,
649 VMMDevHGCMLoc_SizeHack = 0x7fffffff
650} HGCMServiceLocationType;
651
652typedef struct
653{
654 char achName[128]; /**< This is really szName. */
655} HGCMServiceLocationHost;
656
657typedef struct HGCMSERVICELOCATION
658{
659 /** Type of the location. */
660 HGCMServiceLocationType type;
661
662 union
663 {
664 HGCMServiceLocationHost host;
665 } u;
666} HGCMServiceLocation;
667
668typedef struct
669{
670 /* request header */
671 VMMDevHGCMRequestHeader header;
672
673 /** IN: Description of service to connect to. */
674 HGCMServiceLocation loc;
675
676 /** OUT: Client identifier assigned by local instance of HGCM. */
677 uint32_t u32ClientID;
678} VMMDevHGCMConnect;
679
680typedef struct
681{
682 /* request header */
683 VMMDevHGCMRequestHeader header;
684
685 /** IN: Client identifier. */
686 uint32_t u32ClientID;
687} VMMDevHGCMDisconnect;
688
689typedef enum
690{
691 VMMDevHGCMParmType_Invalid = 0,
692 VMMDevHGCMParmType_32bit = 1,
693 VMMDevHGCMParmType_64bit = 2,
694 VMMDevHGCMParmType_PhysAddr = 3,
695 VMMDevHGCMParmType_LinAddr = 4, /**< In and Out */
696 VMMDevHGCMParmType_LinAddr_In = 5, /**< In (read; host<-guest) */
697 VMMDevHGCMParmType_LinAddr_Out = 6, /**< Out (write; host->guest) */
698 VMMDevHGCMParmType_LinAddr_Locked = 7, /**< Locked In and Out */
699 VMMDevHGCMParmType_LinAddr_Locked_In = 8, /**< Locked In (read; host<-guest) */
700 VMMDevHGCMParmType_LinAddr_Locked_Out = 9, /**< Locked Out (write; host->guest) */
701 VMMDevHGCMParmType_SizeHack = 0x7fffffff
702} HGCMFunctionParameterType;
703
704#ifdef VBOX_WITH_64_BITS_GUESTS
705typedef struct _HGCMFUNCTIONPARAMETER32
706{
707 HGCMFunctionParameterType type;
708 union
709 {
710 uint32_t value32;
711 uint64_t value64;
712 struct
713 {
714 uint32_t size;
715
716 union
717 {
718 VMMDEVHYPPHYS32 physAddr;
719 VMMDEVHYPPTR32 linearAddr;
720 } u;
721 } Pointer;
722 } u;
723#ifdef __cplusplus
724 void SetUInt32(uint32_t u32)
725 {
726 type = VMMDevHGCMParmType_32bit;
727 u.value64 = 0; /* init unused bits to 0 */
728 u.value32 = u32;
729 }
730
731 int GetUInt32(uint32_t *pu32)
732 {
733 if (type == VMMDevHGCMParmType_32bit)
734 {
735 *pu32 = u.value32;
736 return VINF_SUCCESS;
737 }
738 return VERR_INVALID_PARAMETER;
739 }
740
741 void SetUInt64(uint64_t u64)
742 {
743 type = VMMDevHGCMParmType_64bit;
744 u.value64 = u64;
745 }
746
747 int GetUInt64(uint64_t *pu64)
748 {
749 if (type == VMMDevHGCMParmType_64bit)
750 {
751 *pu64 = u.value64;
752 return VINF_SUCCESS;
753 }
754 return VERR_INVALID_PARAMETER;
755 }
756
757 void SetPtr(void *pv, uint32_t cb)
758 {
759 type = VMMDevHGCMParmType_LinAddr;
760 u.Pointer.size = cb;
761 u.Pointer.u.linearAddr = (VMMDEVHYPPTR32)(uintptr_t)pv;
762 }
763#endif
764} HGCMFunctionParameter32;
765
766typedef struct _HGCMFUNCTIONPARAMETER64
767{
768 HGCMFunctionParameterType type;
769 union
770 {
771 uint32_t value32;
772 uint64_t value64;
773 struct
774 {
775 uint32_t size;
776
777 union
778 {
779 VMMDEVHYPPHYS64 physAddr;
780 VMMDEVHYPPTR64 linearAddr;
781 } u;
782 } Pointer;
783 } u;
784#ifdef __cplusplus
785 void SetUInt32(uint32_t u32)
786 {
787 type = VMMDevHGCMParmType_32bit;
788 u.value64 = 0; /* init unused bits to 0 */
789 u.value32 = u32;
790 }
791
792 int GetUInt32(uint32_t *pu32)
793 {
794 if (type == VMMDevHGCMParmType_32bit)
795 {
796 *pu32 = u.value32;
797 return VINF_SUCCESS;
798 }
799 return VERR_INVALID_PARAMETER;
800 }
801
802 void SetUInt64(uint64_t u64)
803 {
804 type = VMMDevHGCMParmType_64bit;
805 u.value64 = u64;
806 }
807
808 int GetUInt64(uint64_t *pu64)
809 {
810 if (type == VMMDevHGCMParmType_64bit)
811 {
812 *pu64 = u.value64;
813 return VINF_SUCCESS;
814 }
815 return VERR_INVALID_PARAMETER;
816 }
817
818 void SetPtr(void *pv, uint32_t cb)
819 {
820 type = VMMDevHGCMParmType_LinAddr;
821 u.Pointer.size = cb;
822 u.Pointer.u.linearAddr = (uintptr_t)pv;
823 }
824#endif
825} HGCMFunctionParameter64;
826#else /* !VBOX_WITH_64_BITS_GUESTS */
827typedef struct _HGCMFUNCTIONPARAMETER
828{
829 HGCMFunctionParameterType type;
830 union
831 {
832 uint32_t value32;
833 uint64_t value64;
834 struct
835 {
836 uint32_t size;
837
838 union
839 {
840 VMMDEVHYPPHYS32 physAddr;
841 VMMDEVHYPPTR32 linearAddr;
842 } u;
843 } Pointer;
844 } u;
845#ifdef __cplusplus
846 void SetUInt32(uint32_t u32)
847 {
848 type = VMMDevHGCMParmType_32bit;
849 u.value64 = 0; /* init unused bits to 0 */
850 u.value32 = u32;
851 }
852
853 int GetUInt32(uint32_t *pu32)
854 {
855 if (type == VMMDevHGCMParmType_32bit)
856 {
857 *pu32 = u.value32;
858 return VINF_SUCCESS;
859 }
860 return VERR_INVALID_PARAMETER;
861 }
862
863 void SetUInt64(uint64_t u64)
864 {
865 type = VMMDevHGCMParmType_64bit;
866 u.value64 = u64;
867 }
868
869 int GetUInt64(uint64_t *pu64)
870 {
871 if (type == VMMDevHGCMParmType_64bit)
872 {
873 *pu64 = u.value64;
874 return VINF_SUCCESS;
875 }
876 return VERR_INVALID_PARAMETER;
877 }
878
879 void SetPtr(void *pv, uint32_t cb)
880 {
881 type = VMMDevHGCMParmType_LinAddr;
882 u.Pointer.size = cb;
883 u.Pointer.u.linearAddr = (uintptr_t)pv;
884 }
885#endif
886} HGCMFunctionParameter;
887#endif /* !VBOX_WITH_64_BITS_GUESTS */
888
889
890#ifdef VBOX_WITH_64_BITS_GUESTS
891/* Redefine the structure type for the guest code. */
892# ifndef VBOX_HGCM_HOST_CODE
893# if ARCH_BITS == 64
894# define HGCMFunctionParameter HGCMFunctionParameter64
895# elif ARCH_BITS == 32
896# define HGCMFunctionParameter HGCMFunctionParameter32
897# else
898# error "Unsupported sizeof (void *)"
899# endif
900# endif /* !VBOX_HGCM_HOST_CODE */
901#endif /* VBOX_WITH_64_BITS_GUESTS */
902
903typedef struct
904{
905 /* request header */
906 VMMDevHGCMRequestHeader header;
907
908 /** IN: Client identifier. */
909 uint32_t u32ClientID;
910 /** IN: Service function number. */
911 uint32_t u32Function;
912 /** IN: Number of parameters. */
913 uint32_t cParms;
914 /** Parameters follow in form: HGCMFunctionParameter aParms[X]; */
915} VMMDevHGCMCall;
916#pragma pack()
917
918#define VMMDEV_HGCM_CALL_PARMS(a) ((HGCMFunctionParameter *)((uint8_t *)a + sizeof (VMMDevHGCMCall)))
919#define VMMDEV_HGCM_CALL_PARMS32(a) ((HGCMFunctionParameter32 *)((uint8_t *)a + sizeof (VMMDevHGCMCall)))
920
921#ifdef VBOX_WITH_64_BITS_GUESTS
922/* Explicit defines for the host code. */
923# ifdef VBOX_HGCM_HOST_CODE
924# define VMMDEV_HGCM_CALL_PARMS32(a) ((HGCMFunctionParameter32 *)((uint8_t *)a + sizeof (VMMDevHGCMCall)))
925# define VMMDEV_HGCM_CALL_PARMS64(a) ((HGCMFunctionParameter64 *)((uint8_t *)a + sizeof (VMMDevHGCMCall)))
926# endif /* VBOX_HGCM_HOST_CODE */
927#endif /* VBOX_WITH_64_BITS_GUESTS */
928
929#define VBOX_HGCM_MAX_PARMS 32
930
931/* The Cancel request is issued using the same physical memory address
932 * as was used for the corresponding initial HGCMCall.
933 */
934typedef struct
935{
936 /* request header */
937 VMMDevHGCMRequestHeader header;
938} VMMDevHGCMCancel;
939
940#endif /* VBOX_WITH_HGCM */
941
942
943#define VBVA_F_STATUS_ACCEPTED (0x01)
944#define VBVA_F_STATUS_ENABLED (0x02)
945
946#pragma pack(4)
947
948typedef struct _VMMDevVideoAccelEnable
949{
950 /* request header */
951 VMMDevRequestHeader header;
952
953 /** 0 - disable, !0 - enable. */
954 uint32_t u32Enable;
955
956 /** The size of VBVAMEMORY::au8RingBuffer expected by driver.
957 * The host will refuse to enable VBVA if the size is not equal to
958 * VBVA_RING_BUFFER_SIZE.
959 */
960 uint32_t cbRingBuffer;
961
962 /** Guest initializes the status to 0. Host sets appropriate VBVA_F_STATUS_ flags. */
963 uint32_t fu32Status;
964
965} VMMDevVideoAccelEnable;
966
967typedef struct _VMMDevVideoAccelFlush
968{
969 /* request header */
970 VMMDevRequestHeader header;
971
972} VMMDevVideoAccelFlush;
973
974
975typedef struct _VMMDevVideoSetVisibleRegion
976{
977 /* request header */
978 VMMDevRequestHeader header;
979
980 /** Number of rectangles */
981 uint32_t cRect;
982
983 /** Rectangle array */
984 RTRECT Rect;
985} VMMDevVideoSetVisibleRegion;
986
987
988/** Seamless mode */
989typedef enum
990{
991 VMMDev_Seamless_Disabled = 0, /* normal mode; entire guest desktop displayed */
992 VMMDev_Seamless_Visible_Region = 1, /* visible region mode; only top-level guest windows displayed */
993 VMMDev_Seamless_Host_Window = 2 /* windowed mode; each top-level guest window is represented in a host window */
994} VMMDevSeamlessMode;
995
996typedef struct
997{
998 /** header */
999 VMMDevRequestHeader header;
1000
1001 /** New seamless mode */
1002 VMMDevSeamlessMode mode;
1003 /** Flag that the request is an acknowlegement for the VMMDEV_EVENT_SEAMLESS_MODE_CHANGE_REQUEST.
1004 * Values: 0 - just querying, VMMDEV_EVENT_SEAMLESS_MODE_CHANGE_REQUEST - event acknowledged.
1005 */
1006 uint32_t eventAck;
1007} VMMDevSeamlessChangeRequest;
1008
1009#pragma pack()
1010
1011#pragma pack(1)
1012/** VBVA command header. */
1013typedef struct _VBVACMDHDR
1014{
1015 /** Coordinates of affected rectangle. */
1016 int16_t x;
1017 int16_t y;
1018 uint16_t w;
1019 uint16_t h;
1020} VBVACMDHDR;
1021#pragma pack()
1022
1023/* The VBVA ring buffer is suitable for transferring large (< 2gb) amount of data.
1024 * For example big bitmaps which do not fit to the buffer.
1025 *
1026 * Guest starts writing to the buffer by initializing a record entry in the
1027 * aRecords queue. VBVA_F_RECORD_PARTIAL indicates that the record is being
1028 * written. As data is written to the ring buffer, the guest increases off32End
1029 * for the record.
1030 *
1031 * The host reads the aRecords on flushes and processes all completed records.
1032 * When host encounters situation when only a partial record presents and
1033 * cbRecord & ~VBVA_F_RECORD_PARTIAL >= VBVA_RING_BUFFER_SIZE - VBVA_RING_BUFFER_THRESHOLD,
1034 * the host fetched all record data and updates off32Head. After that on each flush
1035 * the host continues fetching the data until the record is completed.
1036 *
1037 */
1038
1039#define VBVA_RING_BUFFER_SIZE (_4M - _1K)
1040#define VBVA_RING_BUFFER_THRESHOLD (4 * _1K)
1041
1042#define VBVA_MAX_RECORDS (64)
1043
1044#define VBVA_F_MODE_ENABLED (0x00000001)
1045#define VBVA_F_MODE_VRDP (0x00000002)
1046#define VBVA_F_MODE_VRDP_RESET (0x00000004)
1047#define VBVA_F_MODE_VRDP_ORDER_MASK (0x00000008)
1048
1049#define VBVA_F_RECORD_PARTIAL (0x80000000)
1050
1051#pragma pack(1)
1052typedef struct _VBVARECORD
1053{
1054 /** The length of the record. Changed by guest. */
1055 uint32_t cbRecord;
1056} VBVARECORD;
1057
1058typedef struct _VBVAMEMORY
1059{
1060 /** VBVA_F_MODE_* */
1061 uint32_t fu32ModeFlags;
1062
1063 /** The offset where the data start in the buffer. */
1064 uint32_t off32Data;
1065 /** The offset where next data must be placed in the buffer. */
1066 uint32_t off32Free;
1067
1068 /** The ring buffer for data. */
1069 uint8_t au8RingBuffer[VBVA_RING_BUFFER_SIZE];
1070
1071 /** The queue of record descriptions. */
1072 VBVARECORD aRecords[VBVA_MAX_RECORDS];
1073 uint32_t indexRecordFirst;
1074 uint32_t indexRecordFree;
1075
1076 /* RDP orders supported by the client. The guest reports only them
1077 * and falls back to DIRTY rects for not supported ones.
1078 *
1079 * (1 << VBVA_VRDP_*)
1080 */
1081 uint32_t fu32SupportedOrders;
1082
1083} VBVAMEMORY;
1084#pragma pack()
1085
1086/** @} */
1087
1088
1089/**
1090 * VMMDev RAM
1091 * @{
1092 */
1093
1094#pragma pack(1)
1095/** Layout of VMMDEV RAM region that contains information for guest */
1096typedef struct
1097{
1098 /** size */
1099 uint32_t u32Size;
1100 /** version */
1101 uint32_t u32Version;
1102
1103 union {
1104 /** Flag telling that VMMDev set the IRQ and acknowlegment is required */
1105 struct {
1106 bool fHaveEvents;
1107 } V1_04;
1108
1109 struct {
1110 /** Pending events flags, set by host. */
1111 uint32_t u32HostEvents;
1112 /** Mask of events the guest wants to see, set by guest. */
1113 uint32_t u32GuestEventMask;
1114 } V1_03;
1115 } V;
1116
1117 VBVAMEMORY vbvaMemory;
1118
1119} VMMDevMemory;
1120#pragma pack()
1121
1122/** Version of VMMDevMemory structure. */
1123#define VMMDEV_MEMORY_VERSION (1)
1124
1125/** @} */
1126
1127
1128/**
1129 * VMMDev events.
1130 * @{
1131 */
1132
1133/** Host mouse capabilities has been changed. */
1134#define VMMDEV_EVENT_MOUSE_CAPABILITIES_CHANGED RT_BIT(0)
1135/** HGCM event. */
1136#define VMMDEV_EVENT_HGCM RT_BIT(1)
1137/** A display change request has been issued. */
1138#define VMMDEV_EVENT_DISPLAY_CHANGE_REQUEST RT_BIT(2)
1139/** Credentials are available for judgement. */
1140#define VMMDEV_EVENT_JUDGE_CREDENTIALS RT_BIT(3)
1141/** The guest has been restored. */
1142#define VMMDEV_EVENT_RESTORED RT_BIT(4)
1143/** Seamless mode state changed */
1144#define VMMDEV_EVENT_SEAMLESS_MODE_CHANGE_REQUEST RT_BIT(5)
1145/** Memory balloon size changed */
1146#define VMMDEV_EVENT_BALLOON_CHANGE_REQUEST RT_BIT(6)
1147/** Statistics interval changed */
1148#define VMMDEV_EVENT_STATISTICS_INTERVAL_CHANGE_REQUEST RT_BIT(7)
1149/** VRDP status changed. */
1150#define VMMDEV_EVENT_VRDP RT_BIT(8)
1151/** New mouse position data available */
1152#define VMMDEV_EVENT_MOUSE_POSITION_CHANGED RT_BIT(9)
1153
1154/** @} */
1155
1156
1157#if !defined(IN_RC) && !defined(IN_RING0_AGNOSTIC) && !defined(IPRT_NO_CRT)
1158/** @name VBoxGuest IOCTL codes and structures.
1159 *
1160 * The range 0..15 is for basic driver communication.
1161 * The range 16..31 is for HGCM communcation.
1162 * The range 32..47 is reserved for future use.
1163 * The range 48..63 is for OS specific communcation.
1164 * The 7th bit is reserved for future hacks.
1165 * The 8th bit is reserved for distinguishing between 32-bit and 64-bit
1166 * processes in future 64-bit guest additions.
1167 *
1168 * While windows IOCTL function number has to start at 2048 and stop at 4096 there
1169 * never was any need to do this for everyone. A simple ((Function) | 0x800) would
1170 * have sufficed. On Linux we're now intruding upon the type field. Fortunately
1171 * this hasn't caused any trouble because the FILE_DEVICE_UNKNOWN value was set
1172 * to 0x22 (if it were 0x2C it would not have worked soo smoothly). The situation
1173 * would've been the same for *BSD and Darwin since they seems to share common
1174 * _IOC() heritage.
1175 *
1176 * However, on good old OS/2 we only have 8-bit handy for the function number. The
1177 * result from using the old IOCTL function numbers her would've been overlapping
1178 * between the two ranges.
1179 *
1180 * To fix this problem and get rid of all the unnecessary windowsy crap that I
1181 * bet was copied from my SUPDRVIOC.h once upon a time (although the concept of
1182 * prefixing macros with the purpose of avoid clashes with system stuff and
1183 * to indicate exactly how owns them seems to have been lost somewhere along
1184 * the way), I've introduced a VBOXGUEST_IOCTL_CODE for defining generic IN/OUT
1185 * IOCtls on new ports of the additions.
1186 *
1187 * @remarks When creating new IOCtl interfaces keep in mind that not all OSes supports
1188 * reporting back the output size. (This got messed up a little bit in VBoxDrv.)
1189 *
1190 * The request size is also a little bit tricky as it's passed as part of the
1191 * request code on unix. The size field is 14 bits on Linux, 12 bits on *BSD,
1192 * 13 bits Darwin, and 8-bits on Solaris. All the BSDs and Darwin kernels
1193 * will make use of the size field, while Linux and Solaris will not. We're of
1194 * course using the size to validate and/or map/lock the request, so it has
1195 * to be valid.
1196 *
1197 * For Solaris we will have to do something special though, 255 isn't
1198 * sufficent for all we need. A 4KB restriction (BSD) is probably not
1199 * too problematic (yet) as a general one.
1200 *
1201 * More info can be found in SUPDRVIOC.h and related sources.
1202 *
1203 * @remarks If adding interfaces that only has input or only has output, some new macros
1204 * needs to be created so the most efficient IOCtl data buffering method can be
1205 * used.
1206 * @{
1207 */
1208#ifdef RT_ARCH_AMD64
1209# define VBOXGUEST_IOCTL_FLAG 128
1210#elif defined(RT_ARCH_X86)
1211# define VBOXGUEST_IOCTL_FLAG 0
1212#else
1213# error "dunno which arch this is!"
1214#endif
1215
1216/** Ring-3 request wrapper for big requests.
1217 *
1218 * This is necessary because the ioctl number scheme on many Unixy OSes (esp. Solaris)
1219 * only allows a relatively small size to be encoded into the request. So, for big
1220 * request this generic form is used instead. */
1221typedef struct VBGLBIGREQ
1222{
1223 /** Magic value (VBGLBIGREQ_MAGIC). */
1224 uint32_t u32Magic;
1225 /** The size of the data buffer. */
1226 uint32_t cbData;
1227 /** The user address of the data buffer. */
1228 RTR3PTR pvDataR3;
1229} VBGLBIGREQ;
1230/** Pointer to a request wrapper for solaris guests. */
1231typedef VBGLBIGREQ *PVBGLBIGREQ;
1232/** Pointer to a const request wrapper for solaris guests. */
1233typedef const VBGLBIGREQ *PCVBGLBIGREQ;
1234
1235/** The VBGLBIGREQ::u32Magic value (Ryuu Murakami). */
1236#define VBGLBIGREQ_MAGIC 0x19520219
1237
1238
1239#if defined(RT_OS_WINDOWS)
1240/* @todo Remove IOCTL_CODE later! Integrate it in VBOXGUEST_IOCTL_CODE below. */
1241/** @todo r=bird: IOCTL_CODE is supposedly defined in some header included by Windows.h or ntddk.h, which is why it wasn't in the #if 0 earlier. See HostDrivers/Support/SUPDrvIOC.h... */
1242# define IOCTL_CODE(DeviceType, Function, Method, Access, DataSize_ignored) \
1243 ( ((DeviceType) << 16) | ((Access) << 14) | ((Function) << 2) | (Method))
1244# define VBOXGUEST_IOCTL_CODE(Function, Size) IOCTL_CODE(FILE_DEVICE_UNKNOWN, 2048 + (Function), METHOD_BUFFERED, FILE_WRITE_ACCESS, 0)
1245# define VBOXGUEST_IOCTL_STRIP_SIZE(Code) (Code)
1246
1247#elif defined(RT_OS_OS2)
1248 /* No automatic buffering, size not encoded. */
1249# define VBOXGUEST_IOCTL_CATEGORY 0xc2
1250# define VBOXGUEST_IOCTL_CODE(Function, Size) ((unsigned char)(Function))
1251# define VBOXGUEST_IOCTL_CATEGORY_FAST 0xc3 /**< Also defined in VBoxGuestA-os2.asm. */
1252# define VBOXGUEST_IOCTL_CODE_FAST(Function) ((unsigned char)(Function))
1253# define VBOXGUEST_IOCTL_STRIP_SIZE(Code) (Code)
1254
1255#elif defined(RT_OS_SOLARIS)
1256 /* No automatic buffering, size limited to 255 bytes => use VBGLBIGREQ for everything. */
1257# include <sys/ioccom.h>
1258# define VBOXGUEST_IOCTL_CODE(Function, Size) _IOWRN('V', (Function) | VBOXGUEST_IOCTL_FLAG, sizeof(VBGLBIGREQ))
1259# define VBOXGUEST_IOCTL_CODE_FAST(Function) _IO( 'V', (Function) | VBOXGUEST_IOCTL_FLAG)
1260# define VBOXGUEST_IOCTL_STRIP_SIZE(Code) (Code)
1261
1262#elif defined(RT_OS_LINUX)
1263 /* No automatic buffering, size limited to 16KB. */
1264# include <linux/ioctl.h>
1265# define VBOXGUEST_IOCTL_CODE(Function, Size) _IOC(_IOC_READ|_IOC_WRITE, 'V', (Function) | VBOXGUEST_IOCTL_FLAG, (Size))
1266# define VBOXGUEST_IOCTL_CODE_FAST(Function) _IO( 'V', (Function) | VBOXGUEST_IOCTL_FLAG)
1267# define VBOXGUEST_IOCTL_STRIP_SIZE(Code) VBOXGUEST_IOCTL_CODE(_IOC_NR((Code)), 0)
1268
1269#elif defined(RT_OS_FREEBSD) /** @todo r=bird: Please do it like SUPDRVIOC to keep it as similar as possible. */
1270# include <sys/ioccom.h>
1271
1272# define VBOXGUEST_IOCTL_CODE(Function, Size) _IOWR('V', (Function) | VBOXGUEST_IOCTL_FLAG, VBGLBIGREQ)
1273# define VBOXGUEST_IOCTL_CODE_FAST(Function) _IO( 'V', (Function) | VBOXGUEST_IOCTL_FLAG)
1274# define VBOXGUEST_IOCTL_STRIP_SIZE(Code) IOCBASECMD(Code)
1275
1276#else
1277/* PORTME */
1278#endif
1279
1280/** IOCTL to VBoxGuest to query the VMMDev IO port region start. */
1281#define VBOXGUEST_IOCTL_GETVMMDEVPORT VBOXGUEST_IOCTL_CODE(1, sizeof(VBoxGuestPortInfo))
1282
1283#pragma pack(4)
1284typedef struct _VBoxGuestPortInfo
1285{
1286 uint32_t portAddress;
1287 VMMDevMemory *pVMMDevMemory;
1288} VBoxGuestPortInfo;
1289
1290/** IOCTL to VBoxGuest to wait for a VMMDev host notification */
1291#define VBOXGUEST_IOCTL_WAITEVENT VBOXGUEST_IOCTL_CODE(2, sizeof(VBoxGuestWaitEventInfo))
1292
1293/** IOCTL to VBoxGuest to interrupt (cancel) any pending WAITEVENTs and return.
1294 * Handled inside the guest additions and not seen by the host at all.
1295 * @see VBOXGUEST_IOCTL_WAITEVENT */
1296#define VBOXGUEST_IOCTL_CANCEL_ALL_WAITEVENTS VBOXGUEST_IOCTL_CODE(5, 0)
1297
1298/** @name Result codes for VBoxGuestWaitEventInfo::u32Result
1299 * @{
1300 */
1301/** Successful completion, an event occured. */
1302#define VBOXGUEST_WAITEVENT_OK (0)
1303/** Successful completion, timed out. */
1304#define VBOXGUEST_WAITEVENT_TIMEOUT (1)
1305/** Wait was interrupted. */
1306#define VBOXGUEST_WAITEVENT_INTERRUPTED (2)
1307/** An error occured while processing the request. */
1308#define VBOXGUEST_WAITEVENT_ERROR (3)
1309/** @} */
1310
1311/** Input and output buffers layout of the IOCTL_VBOXGUEST_WAITEVENT */
1312typedef struct _VBoxGuestWaitEventInfo
1313{
1314 /** timeout in milliseconds */
1315 uint32_t u32TimeoutIn;
1316 /** events to wait for */
1317 uint32_t u32EventMaskIn;
1318 /** result code */
1319 uint32_t u32Result;
1320 /** events occured */
1321 uint32_t u32EventFlagsOut;
1322} VBoxGuestWaitEventInfo;
1323
1324/** IOCTL to VBoxGuest to perform a VMM request
1325 * @remark The data buffer for this IOCtl has an variable size, keep this in mind
1326 * on systems where this matters. */
1327#define VBOXGUEST_IOCTL_VMMREQUEST(Size) VBOXGUEST_IOCTL_CODE(3, (Size))
1328
1329/** Input and output buffer layout of the IOCTL_VBOXGUEST_CTL_FILTER_MASK. */
1330typedef struct _VBoxGuestFilterMaskInfo
1331{
1332 uint32_t u32OrMask;
1333 uint32_t u32NotMask;
1334} VBoxGuestFilterMaskInfo;
1335#pragma pack()
1336
1337/** IOCTL to VBoxGuest to control event filter mask. */
1338#define VBOXGUEST_IOCTL_CTL_FILTER_MASK VBOXGUEST_IOCTL_CODE(4, sizeof(VBoxGuestFilterMaskInfo))
1339
1340/** IOCTL to VBoxGuest to check memory ballooning. */
1341#define VBOXGUEST_IOCTL_CTL_CHECK_BALLOON_MASK VBOXGUEST_IOCTL_CODE(7, 100)
1342
1343/** IOCTL to VBoxGuest to perform backdoor logging. */
1344#define VBOXGUEST_IOCTL_LOG(Size) VBOXGUEST_IOCTL_CODE(6, (Size))
1345
1346
1347#ifdef VBOX_WITH_HGCM
1348/* These structures are shared between the driver and other binaries,
1349 * therefore packing must be defined explicitely.
1350 */
1351# pragma pack(1)
1352typedef struct _VBoxGuestHGCMConnectInfo
1353{
1354 uint32_t result; /**< OUT */
1355 HGCMServiceLocation Loc; /**< IN */
1356 uint32_t u32ClientID; /**< OUT */
1357} VBoxGuestHGCMConnectInfo;
1358
1359typedef struct _VBoxGuestHGCMDisconnectInfo
1360{
1361 uint32_t result; /**< OUT */
1362 uint32_t u32ClientID; /**< IN */
1363} VBoxGuestHGCMDisconnectInfo;
1364
1365typedef struct _VBoxGuestHGCMCallInfo
1366{
1367 uint32_t result; /**< OUT Host HGCM return code.*/
1368 uint32_t u32ClientID; /**< IN The id of the caller. */
1369 uint32_t u32Function; /**< IN Function number. */
1370 uint32_t cParms; /**< IN How many parms. */
1371 /* Parameters follow in form HGCMFunctionParameter aParms[cParms] */
1372} VBoxGuestHGCMCallInfo;
1373
1374typedef struct _VBoxGuestHGCMCallInfoTimed
1375{
1376 uint32_t u32Timeout; /**< IN How long to wait for completion before cancelling the call */
1377 uint32_t fInterruptible; /**< IN Is this request interruptible? */
1378 VBoxGuestHGCMCallInfo info; /**< IN/OUT The rest of the call information. Placed after the timeout
1379 * so that the parameters follow as they would for a normal call. */
1380 /* Parameters follow in form HGCMFunctionParameter aParms[cParms] */
1381} VBoxGuestHGCMCallInfoTimed;
1382# pragma pack()
1383
1384# define VBOXGUEST_IOCTL_HGCM_CONNECT VBOXGUEST_IOCTL_CODE(16, sizeof(VBoxGuestHGCMConnectInfo))
1385# define VBOXGUEST_IOCTL_HGCM_DISCONNECT VBOXGUEST_IOCTL_CODE(17, sizeof(VBoxGuestHGCMDisconnectInfo))
1386# define VBOXGUEST_IOCTL_HGCM_CALL(Size) VBOXGUEST_IOCTL_CODE(18, (Size))
1387# define VBOXGUEST_IOCTL_HGCM_CALL_TIMED(Size) VBOXGUEST_IOCTL_CODE(20, (Size))
1388# define VBOXGUEST_IOCTL_CLIPBOARD_CONNECT VBOXGUEST_IOCTL_CODE(19, sizeof(uint32_t))
1389
1390# ifdef VBOX_WITH_64_BITS_GUESTS
1391# ifndef VBOX_HGCM_HOST_CODE
1392# define VBOXGUEST_IOCTL_HGCM_CALL_32(Size) VBOXGUEST_IOCTL_CODE(18, (Size))
1393# endif /* !VBOX_HGCM_HOST_CODE */
1394# endif /* VBOX_WITH_64_BITS_GUESTS */
1395
1396# define VBOXGUEST_HGCM_CALL_PARMS(a) ((HGCMFunctionParameter *)((uint8_t *)(a) + sizeof (VBoxGuestHGCMCallInfo)))
1397# define VBOXGUEST_HGCM_CALL_PARMS32(a) ((HGCMFunctionParameter32 *)((uint8_t *)(a) + sizeof (VBoxGuestHGCMCallInfo)))
1398
1399#endif /* VBOX_WITH_HGCM */
1400
1401/*
1402 * Credentials request flags and structure
1403 */
1404
1405#define VMMDEV_CREDENTIALS_STRLEN 128
1406
1407/** query from host whether credentials are present */
1408#define VMMDEV_CREDENTIALS_QUERYPRESENCE RT_BIT(1)
1409/** read credentials from host (can be combined with clear) */
1410#define VMMDEV_CREDENTIALS_READ RT_BIT(2)
1411/** clear credentials on host (can be combined with read) */
1412#define VMMDEV_CREDENTIALS_CLEAR RT_BIT(3)
1413/** read credentials for judgement in the guest */
1414#define VMMDEV_CREDENTIALS_READJUDGE RT_BIT(8)
1415/** clear credentials for judegement on the host */
1416#define VMMDEV_CREDENTIALS_CLEARJUDGE RT_BIT(9)
1417/** report credentials acceptance by guest */
1418#define VMMDEV_CREDENTIALS_JUDGE_OK RT_BIT(10)
1419/** report credentials denial by guest */
1420#define VMMDEV_CREDENTIALS_JUDGE_DENY RT_BIT(11)
1421/** report that no judgement could be made by guest */
1422#define VMMDEV_CREDENTIALS_JUDGE_NOJUDGEMENT RT_BIT(12)
1423
1424/** flag telling the guest that credentials are present */
1425#define VMMDEV_CREDENTIALS_PRESENT RT_BIT(16)
1426/** flag telling guest that local logons should be prohibited */
1427#define VMMDEV_CREDENTIALS_NOLOCALLOGON RT_BIT(17)
1428
1429/** credentials request structure */
1430#pragma pack(4)
1431typedef struct _VMMDevCredentials
1432{
1433 /* request header */
1434 VMMDevRequestHeader header;
1435 /* request flags (in/out) */
1436 uint32_t u32Flags;
1437 /* user name (UTF-8) (out) */
1438 char szUserName[VMMDEV_CREDENTIALS_STRLEN];
1439 /* password (UTF-8) (out) */
1440 char szPassword[VMMDEV_CREDENTIALS_STRLEN];
1441 /* domain name (UTF-8) (out) */
1442 char szDomain[VMMDEV_CREDENTIALS_STRLEN];
1443} VMMDevCredentials;
1444#pragma pack()
1445
1446/** inline helper to determine the request size for the given operation */
1447DECLINLINE(size_t) vmmdevGetRequestSize(VMMDevRequestType requestType)
1448{
1449 switch (requestType)
1450 {
1451 case VMMDevReq_GetMouseStatus:
1452 case VMMDevReq_SetMouseStatus:
1453 return sizeof(VMMDevReqMouseStatus);
1454 case VMMDevReq_SetPointerShape:
1455 return sizeof(VMMDevReqMousePointer);
1456 case VMMDevReq_GetHostVersion:
1457 return sizeof(VMMDevReqHostVersion);
1458 case VMMDevReq_Idle:
1459 return sizeof(VMMDevReqIdle);
1460 case VMMDevReq_GetHostTime:
1461 return sizeof(VMMDevReqHostTime);
1462 case VMMDevReq_GetHypervisorInfo:
1463 case VMMDevReq_SetHypervisorInfo:
1464 return sizeof(VMMDevReqHypervisorInfo);
1465 case VMMDevReq_SetPowerStatus:
1466 return sizeof(VMMDevPowerStateRequest);
1467 case VMMDevReq_AcknowledgeEvents:
1468 return sizeof(VMMDevEvents);
1469 case VMMDevReq_ReportGuestInfo:
1470 return sizeof(VMMDevReportGuestInfo);
1471 case VMMDevReq_GetDisplayChangeRequest:
1472 return sizeof(VMMDevDisplayChangeRequest);
1473 case VMMDevReq_GetDisplayChangeRequest2:
1474 return sizeof(VMMDevDisplayChangeRequest2);
1475 case VMMDevReq_VideoModeSupported:
1476 return sizeof(VMMDevVideoModeSupportedRequest);
1477 case VMMDevReq_GetHeightReduction:
1478 return sizeof(VMMDevGetHeightReductionRequest);
1479 case VMMDevReq_ReportGuestCapabilities:
1480 return sizeof(VMMDevReqGuestCapabilities);
1481 case VMMDevReq_SetGuestCapabilities:
1482 return sizeof(VMMDevReqGuestCapabilities2);
1483#ifdef VBOX_WITH_HGCM
1484 case VMMDevReq_HGCMConnect:
1485 return sizeof(VMMDevHGCMConnect);
1486 case VMMDevReq_HGCMDisconnect:
1487 return sizeof(VMMDevHGCMDisconnect);
1488#ifdef VBOX_WITH_64_BITS_GUESTS
1489 case VMMDevReq_HGCMCall32:
1490 return sizeof(VMMDevHGCMCall);
1491 case VMMDevReq_HGCMCall64:
1492 return sizeof(VMMDevHGCMCall);
1493#else
1494 case VMMDevReq_HGCMCall:
1495 return sizeof(VMMDevHGCMCall);
1496#endif /* VBOX_WITH_64_BITS_GUESTS */
1497 case VMMDevReq_HGCMCancel:
1498 return sizeof(VMMDevHGCMCancel);
1499#endif /* VBOX_WITH_HGCM */
1500 case VMMDevReq_VideoAccelEnable:
1501 return sizeof(VMMDevVideoAccelEnable);
1502 case VMMDevReq_VideoAccelFlush:
1503 return sizeof(VMMDevVideoAccelFlush);
1504 case VMMDevReq_VideoSetVisibleRegion:
1505 return sizeof(VMMDevVideoSetVisibleRegion);
1506 case VMMDevReq_GetSeamlessChangeRequest:
1507 return sizeof(VMMDevSeamlessChangeRequest);
1508 case VMMDevReq_QueryCredentials:
1509 return sizeof(VMMDevCredentials);
1510 case VMMDevReq_ReportGuestStats:
1511 return sizeof(VMMDevReportGuestStats);
1512 case VMMDevReq_GetMemBalloonChangeRequest:
1513 return sizeof(VMMDevGetMemBalloonChangeRequest);
1514 case VMMDevReq_GetStatisticsChangeRequest:
1515 return sizeof(VMMDevGetStatisticsChangeRequest);
1516 case VMMDevReq_ChangeMemBalloon:
1517 return sizeof(VMMDevChangeMemBalloon);
1518 case VMMDevReq_GetVRDPChangeRequest:
1519 return sizeof(VMMDevVRDPChangeRequest);
1520 case VMMDevReq_LogString:
1521 return sizeof(VMMDevReqLogString);
1522 default:
1523 return 0;
1524 }
1525}
1526
1527/**
1528 * Initializes a request structure.
1529 *
1530 */
1531DECLINLINE(int) vmmdevInitRequest(VMMDevRequestHeader *req, VMMDevRequestType type)
1532{
1533 uint32_t requestSize;
1534 if (!req)
1535 return VERR_INVALID_PARAMETER;
1536 requestSize = (uint32_t)vmmdevGetRequestSize(type);
1537 if (!requestSize)
1538 return VERR_INVALID_PARAMETER;
1539 req->size = requestSize;
1540 req->version = VMMDEV_REQUEST_HEADER_VERSION;
1541 req->requestType = type;
1542 req->rc = VERR_GENERAL_FAILURE;
1543 req->reserved1 = 0;
1544 req->reserved2 = 0;
1545 return VINF_SUCCESS;
1546}
1547
1548
1549#ifdef RT_OS_OS2
1550
1551/**
1552 * The data buffer layout for the IDC entry point (AttachDD).
1553 *
1554 * @remark This is defined in multiple 16-bit headers / sources.
1555 * Some places it's called VBGOS2IDC to short things a bit.
1556 */
1557typedef struct VBOXGUESTOS2IDCCONNECT
1558{
1559 /** VMMDEV_VERSION. */
1560 uint32_t u32Version;
1561 /** Opaque session handle. */
1562 uint32_t u32Session;
1563
1564 /**
1565 * The 32-bit service entry point.
1566 *
1567 * @returns VBox status code.
1568 * @param u32Session The above session handle.
1569 * @param iFunction The requested function.
1570 * @param pvData The input/output data buffer. The caller ensures that this
1571 * cannot be swapped out, or that it's acceptable to take a
1572 * page in fault in the current context. If the request doesn't
1573 * take input or produces output, apssing NULL is okay.
1574 * @param cbData The size of the data buffer.
1575 * @param pcbDataReturned Where to store the amount of data that's returned.
1576 * This can be NULL if pvData is NULL.
1577 */
1578 DECLCALLBACKMEMBER(int, pfnServiceEP)(uint32_t u32Session, unsigned iFunction, void *pvData, size_t cbData, size_t *pcbDataReturned);
1579
1580 /** The 16-bit service entry point for C code (cdecl).
1581 *
1582 * It's the same as the 32-bit entry point, but the types has
1583 * changed to 16-bit equivalents.
1584 *
1585 * @code
1586 * int far cdecl
1587 * VBoxGuestOs2IDCService16(uint32_t u32Session, uint16_t iFunction,
1588 * void far *fpvData, uint16_t cbData, uint16_t far *pcbDataReturned);
1589 * @endcode
1590 */
1591 RTFAR16 fpfnServiceEP;
1592
1593 /** The 16-bit service entry point for Assembly code (register).
1594 *
1595 * This is just a wrapper around fpfnServiceEP to simplify calls
1596 * from 16-bit assembly code.
1597 *
1598 * @returns (e)ax: VBox status code; cx: The amount of data returned.
1599 *
1600 * @param u32Session eax - The above session handle.
1601 * @param iFunction dl - The requested function.
1602 * @param pvData es:bx - The input/output data buffer.
1603 * @param cbData cx - The size of the data buffer.
1604 */
1605 RTFAR16 fpfnServiceAsmEP;
1606} VBOXGUESTOS2IDCCONNECT;
1607/** Pointer to VBOXGUESTOS2IDCCONNECT buffer. */
1608typedef VBOXGUESTOS2IDCCONNECT *PVBOXGUESTOS2IDCCONNECT;
1609
1610/** OS/2 specific: IDC client disconnect request.
1611 *
1612 * This takes no input and it doesn't return anything. Obviously this
1613 * is only recognized if it arrives thru the IDC service EP.
1614 */
1615#define VBOXGUEST_IOCTL_OS2_IDC_DISCONNECT VBOXGUEST_IOCTL_CODE(48, sizeof(uint32_t))
1616
1617#endif /* RT_OS_OS2 */
1618
1619/** @} */
1620#endif /* !defined(IN_RC) && !defined(IN_RING0_AGNOSTIC) && !defined(IPRT_NO_CRT) */
1621
1622
1623#ifdef IN_RING3
1624
1625/** @def VBGLR3DECL
1626 * Ring 3 VBGL declaration.
1627 * @param type The return type of the function declaration.
1628 */
1629#define VBGLR3DECL(type) type VBOXCALL
1630
1631/* General-purpose functions */
1632
1633__BEGIN_DECLS
1634VBGLR3DECL(int) VbglR3Init(void);
1635VBGLR3DECL(void) VbglR3Term(void);
1636# ifdef ___iprt_time_h
1637VBGLR3DECL(int) VbglR3GetHostTime(PRTTIMESPEC pTime);
1638# endif
1639VBGLR3DECL(int) VbglR3InterruptEventWaits(void);
1640VBGLR3DECL(int) VbglR3WriteLog(const char *pch, size_t cb);
1641VBGLR3DECL(int) VbglR3CtlFilterMask(uint32_t fOr, uint32_t fNot);
1642VBGLR3DECL(int) VbglR3Daemonize(bool fNoChDir, bool fNoClose, char const *pszPidfile);
1643VBGLR3DECL(int) VbglR3SetGuestCaps(uint32_t fOr, uint32_t fNot);
1644
1645/** @name Shared clipboard
1646 * @{ */
1647VBGLR3DECL(int) VbglR3ClipboardConnect(uint32_t *pu32ClientId);
1648VBGLR3DECL(int) VbglR3ClipboardDisconnect(uint32_t u32ClientId);
1649VBGLR3DECL(int) VbglR3ClipboardGetHostMsg(uint32_t u32ClientId, uint32_t *pMsg, uint32_t *pfFormats);
1650VBGLR3DECL(int) VbglR3ClipboardReadData(uint32_t u32ClientId, uint32_t fFormat, void *pv, uint32_t cb, uint32_t *pcb);
1651VBGLR3DECL(int) VbglR3ClipboardReportFormats(uint32_t u32ClientId, uint32_t fFormats);
1652VBGLR3DECL(int) VbglR3ClipboardWriteData(uint32_t u32ClientId, uint32_t fFormat, void *pv, uint32_t cb);
1653/** @} */
1654
1655/** @name Seamless mode
1656 * @{ */
1657VBGLR3DECL(int) VbglR3SeamlessSetCap(bool fState);
1658VBGLR3DECL(int) VbglR3SeamlessWaitEvent(VMMDevSeamlessMode *pMode);
1659VBGLR3DECL(int) VbglR3SeamlessSendRects(uint32_t cRects, PRTRECT pRects);
1660/** @} */
1661
1662/** @name Mouse
1663 * @{ */
1664VBGLR3DECL(int) VbglR3GetMouseStatus(uint32_t *pfFeatures, uint32_t *px, uint32_t *py);
1665VBGLR3DECL(int) VbglR3SetMouseStatus(uint32_t fFeatures);
1666/** @} */
1667
1668/** @name Video
1669 * @{ */
1670VBGLR3DECL(int) VbglR3VideoAccelEnable(bool fEnable);
1671VBGLR3DECL(int) VbglR3VideoAccelFlush(void);
1672VBGLR3DECL(int) VbglR3SetPointerShape(uint32_t fFlags, uint32_t xHot, uint32_t yHot, uint32_t cx, uint32_t cy, const void *pvImg, size_t cbImg);
1673VBGLR3DECL(int) VbglR3SetPointerShapeReq(VMMDevReqMousePointer *pReq);
1674/** @} */
1675
1676/** @name Display
1677 * @{ */
1678VBGLR3DECL(int) VbglR3GetLastDisplayChangeRequest(uint32_t *pcx, uint32_t *pcy, uint32_t *pcBits, uint32_t *piDisplay);
1679VBGLR3DECL(int) VbglR3DisplayChangeWaitEvent(uint32_t *pcx, uint32_t *pcy, uint32_t *pcBits, uint32_t *piDisplay);
1680VBGLR3DECL(bool) VbglR3HostLikesVideoMode(uint32_t cx, uint32_t cy, uint32_t cBits);
1681VBGLR3DECL(int) VbglR3SaveVideoMode(const char *pszName, uint32_t cx, uint32_t cy, uint32_t cBits);
1682VBGLR3DECL(int) VbglR3RetrieveVideoMode(const char *pszName, uint32_t *pcx, uint32_t *pcy, uint32_t *pcBits);
1683/** @} */
1684
1685#ifdef VBOX_WITH_GUEST_PROPS
1686/** @name Guest properties
1687 * @{ */
1688typedef struct VBGLR3GUESTPROPENUM VBGLR3GUESTPROPENUM, *PVBGLR3GUESTPROPENUM;
1689VBGLR3DECL(int) VbglR3GuestPropConnect(uint32_t *pu32ClientId);
1690VBGLR3DECL(int) VbglR3GuestPropDisconnect(uint32_t u32ClientId);
1691VBGLR3DECL(int) VbglR3GuestPropWrite(uint32_t u32ClientId, const char *pszName, const char *pszValue, const char *pszFlags);
1692VBGLR3DECL(int) VbglR3GuestPropWriteValue(uint32_t u32ClientId, const char *pszName, const char *pszValue);
1693VBGLR3DECL(int) VbglR3GuestPropWriteValueV(uint32_t u32ClientId, const char *pszName, const char *pszValueFormat, va_list va);
1694VBGLR3DECL(int) VbglR3GuestPropWriteValueF(uint32_t u32ClientId, const char *pszName, const char *pszValueFormat, ...);
1695VBGLR3DECL(int) VbglR3GuestPropRead(uint32_t u32ClientId, const char *pszName, void *pvBuf, uint32_t cbBuf, char **ppszValue, uint64_t *pu64Timestamp, char **ppszFlags, uint32_t *pcbBufActual);
1696VBGLR3DECL(int) VbglR3GuestPropReadValue(uint32_t ClientId, const char *pszName, char *pszValue, uint32_t cchValue, uint32_t *pcchValueActual);
1697VBGLR3DECL(int) VbglR3GuestPropReadValueAlloc(uint32_t u32ClientId, const char *pszName, char **ppszValue);
1698VBGLR3DECL(void) VbglR3GuestPropReadValueFree(char *pszValue);
1699VBGLR3DECL(int) VbglR3GuestPropEnumRaw(uint32_t u32ClientId, const char *paszPatterns, char *pcBuf, uint32_t cbBuf, uint32_t *pcbBufActual);
1700VBGLR3DECL(int) VbglR3GuestPropEnum(uint32_t u32ClientId, char const * const *ppaszPatterns, uint32_t cPatterns, PVBGLR3GUESTPROPENUM *ppHandle,
1701 char const **ppszName, char const **ppszValue, uint64_t *pu64Timestamp, char const **ppszFlags);
1702VBGLR3DECL(int) VbglR3GuestPropEnumNext(PVBGLR3GUESTPROPENUM pHandle, char const **ppszName, char const **ppszValue, uint64_t *pu64Timestamp,
1703 char const **ppszFlags);
1704VBGLR3DECL(void) VbglR3GuestPropEnumFree(PVBGLR3GUESTPROPENUM pHandle);
1705VBGLR3DECL(int) VbglR3GuestPropDelSet(uint32_t u32ClientId, char const * const *papszPatterns, uint32_t cPatterns);
1706VBGLR3DECL(int) VbglR3GuestPropWait(uint32_t u32ClientId, const char *pszPatterns, void *pvBuf, uint32_t cbBuf, uint64_t u64Timestamp, uint32_t u32Timeout, char ** ppszName, char **ppszValue, uint64_t *pu64Timestamp, char **ppszFlags, uint32_t *pcbBufActual);
1707/** @} */
1708#endif /* VBOX_WITH_GUEST_PROPS defined */
1709
1710
1711__END_DECLS
1712
1713#endif /* IN_RING3 */
1714
1715#endif
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