VirtualBox

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

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

VbglR3PidFile,VbglR3PidFileClose: Made it build everywhere.

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