2 * Virtual Device for Guest <-> VMM/Host communication (ADD,DEV).
6 * Copyright (C) 2006-2016 Oracle Corporation
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.
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.
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.
26 #ifndef ___VBox_VMMDev_h
27 #define ___VBox_VMMDev_h
29 #include <VBox/cdefs.h>
30 #include <VBox/param.h> /* for the PCI IDs. */
31 #include <VBox/types.h>
33 #include <VBox/ostypes.h>
34 #include <VBox/VMMDev2.h>
35 #include <iprt/assert.h>
38 #pragma pack(4) /* force structure dword packing here. */
42 /** @defgroup grp_vmmdev VMM Device
44 * @note This interface cannot be changed, it can only be extended!
50 /** Size of VMMDev RAM region accessible by guest.
51 * Must be big enough to contain VMMDevMemory structure (see further down).
52 * For now: 4 megabyte.
54 #define VMMDEV_RAM_SIZE (4 * 256 * PAGE_SIZE)
56 /** Size of VMMDev heap region accessible by guest.
57 * (Must be a power of two (pci range).)
59 #define VMMDEV_HEAP_SIZE (4 * PAGE_SIZE)
61 /** Port for generic request interface (relative offset). */
62 #define VMMDEV_PORT_OFF_REQUEST 0
65 /** @name VMMDev events.
67 * Used mainly by VMMDevReq_AcknowledgeEvents/VMMDevEvents and version 1.3 of
72 /** Host mouse capabilities has been changed. */
73 #define VMMDEV_EVENT_MOUSE_CAPABILITIES_CHANGED RT_BIT(0)
75 #define VMMDEV_EVENT_HGCM RT_BIT(1)
76 /** A display change request has been issued. */
77 #define VMMDEV_EVENT_DISPLAY_CHANGE_REQUEST RT_BIT(2)
78 /** Credentials are available for judgement. */
79 #define VMMDEV_EVENT_JUDGE_CREDENTIALS RT_BIT(3)
80 /** The guest has been restored. */
81 #define VMMDEV_EVENT_RESTORED RT_BIT(4)
82 /** Seamless mode state changed. */
83 #define VMMDEV_EVENT_SEAMLESS_MODE_CHANGE_REQUEST RT_BIT(5)
84 /** Memory balloon size changed. */
85 #define VMMDEV_EVENT_BALLOON_CHANGE_REQUEST RT_BIT(6)
86 /** Statistics interval changed. */
87 #define VMMDEV_EVENT_STATISTICS_INTERVAL_CHANGE_REQUEST RT_BIT(7)
88 /** VRDP status changed. */
89 #define VMMDEV_EVENT_VRDP RT_BIT(8)
90 /** New mouse position data available. */
91 #define VMMDEV_EVENT_MOUSE_POSITION_CHANGED RT_BIT(9)
92 /** CPU hotplug event occurred. */
93 #define VMMDEV_EVENT_CPU_HOTPLUG RT_BIT(10)
94 /** The mask of valid events, for sanity checking. */
95 #define VMMDEV_EVENT_VALID_EVENT_MASK UINT32_C(0x000007ff)
99 /** @defgroup grp_vmmdev_req VMMDev Generic Request Interface
103 /** @name Current version of the VMMDev interface.
105 * Additions are allowed to work only if
106 * additions_major == vmmdev_current && additions_minor <= vmmdev_current.
107 * Additions version is reported to host (VMMDev) by VMMDevReq_ReportGuestInfo.
109 * @remarks These defines also live in the 16-bit and assembly versions of this
112 #define VMMDEV_VERSION 0x00010004
113 #define VMMDEV_VERSION_MAJOR (VMMDEV_VERSION >> 16)
114 #define VMMDEV_VERSION_MINOR (VMMDEV_VERSION & 0xffff)
117 /** Maximum request packet size. */
118 #define VMMDEV_MAX_VMMDEVREQ_SIZE _1M
119 /** Maximum number of HGCM parameters. */
120 #define VMMDEV_MAX_HGCM_PARMS 1024
121 /** Maximum total size of hgcm buffers in one call. */
122 #define VMMDEV_MAX_HGCM_DATA_SIZE UINT32_C(0x7FFFFFFF)
125 * VMMDev request types.
126 * @note when updating this, adjust vmmdevGetRequestSize() as well
130 VMMDevReq_InvalidRequest
= 0,
131 VMMDevReq_GetMouseStatus
= 1,
132 VMMDevReq_SetMouseStatus
= 2,
133 VMMDevReq_SetPointerShape
= 3,
134 VMMDevReq_GetHostVersion
= 4,
136 VMMDevReq_GetHostTime
= 10,
137 VMMDevReq_GetHypervisorInfo
= 20,
138 VMMDevReq_SetHypervisorInfo
= 21,
139 VMMDevReq_RegisterPatchMemory
= 22, /* since version 3.0.6 */
140 VMMDevReq_DeregisterPatchMemory
= 23, /* since version 3.0.6 */
141 VMMDevReq_SetPowerStatus
= 30,
142 VMMDevReq_AcknowledgeEvents
= 41,
143 VMMDevReq_CtlGuestFilterMask
= 42,
144 VMMDevReq_ReportGuestInfo
= 50,
145 VMMDevReq_ReportGuestInfo2
= 58, /* since version 3.2.0 */
146 VMMDevReq_ReportGuestStatus
= 59, /* since version 3.2.8 */
147 VMMDevReq_ReportGuestUserState
= 74, /* since version 4.3 */
149 * Retrieve a display resize request sent by the host using
150 * @a IDisplay:setVideoModeHint. Deprecated.
152 * Similar to @a VMMDevReq_GetDisplayChangeRequest2, except that it only
153 * considers host requests sent for the first virtual display. This guest
154 * request should not be used in new guest code, and the results are
155 * undefined if a guest mixes calls to this and
156 * @a VMMDevReq_GetDisplayChangeRequest2.
158 VMMDevReq_GetDisplayChangeRequest
= 51,
159 VMMDevReq_VideoModeSupported
= 52,
160 VMMDevReq_GetHeightReduction
= 53,
162 * Retrieve a display resize request sent by the host using
163 * @a IDisplay:setVideoModeHint.
165 * Queries a display resize request sent from the host. If the
166 * @a eventAck member is sent to true and there is an unqueried
167 * request available for one of the virtual display then that request will
168 * be returned. If several displays have unqueried requests the lowest
169 * numbered display will be chosen first. Only the most recent unseen
170 * request for each display is remembered.
171 * If @a eventAck is set to false, the last host request queried with
172 * @a eventAck set is resent, or failing that the most recent received from
173 * the host. If no host request was ever received then all zeros are
176 VMMDevReq_GetDisplayChangeRequest2
= 54,
177 VMMDevReq_ReportGuestCapabilities
= 55,
178 VMMDevReq_SetGuestCapabilities
= 56,
179 VMMDevReq_VideoModeSupported2
= 57, /* since version 3.2.0 */
180 VMMDevReq_GetDisplayChangeRequestEx
= 80, /* since version 4.2.4 */
181 #ifdef VBOX_WITH_HGCM
182 VMMDevReq_HGCMConnect
= 60,
183 VMMDevReq_HGCMDisconnect
= 61,
184 #ifdef VBOX_WITH_64_BITS_GUESTS
185 VMMDevReq_HGCMCall32
= 62,
186 VMMDevReq_HGCMCall64
= 63,
188 VMMDevReq_HGCMCall
= 62,
189 #endif /* VBOX_WITH_64_BITS_GUESTS */
190 VMMDevReq_HGCMCancel
= 64,
191 VMMDevReq_HGCMCancel2
= 65,
193 VMMDevReq_VideoAccelEnable
= 70,
194 VMMDevReq_VideoAccelFlush
= 71,
195 VMMDevReq_VideoSetVisibleRegion
= 72,
196 VMMDevReq_GetSeamlessChangeRequest
= 73,
197 VMMDevReq_QueryCredentials
= 100,
198 VMMDevReq_ReportCredentialsJudgement
= 101,
199 VMMDevReq_ReportGuestStats
= 110,
200 VMMDevReq_GetMemBalloonChangeRequest
= 111,
201 VMMDevReq_GetStatisticsChangeRequest
= 112,
202 VMMDevReq_ChangeMemBalloon
= 113,
203 VMMDevReq_GetVRDPChangeRequest
= 150,
204 VMMDevReq_LogString
= 200,
205 VMMDevReq_GetCpuHotPlugRequest
= 210,
206 VMMDevReq_SetCpuHotPlugStatus
= 211,
207 VMMDevReq_RegisterSharedModule
= 212,
208 VMMDevReq_UnregisterSharedModule
= 213,
209 VMMDevReq_CheckSharedModules
= 214,
210 VMMDevReq_GetPageSharingStatus
= 215,
211 VMMDevReq_DebugIsPageShared
= 216,
212 VMMDevReq_GetSessionId
= 217, /* since version 3.2.8 */
213 VMMDevReq_WriteCoreDump
= 218,
214 VMMDevReq_GuestHeartbeat
= 219,
215 VMMDevReq_HeartbeatConfigure
= 220,
216 VMMDevReq_SizeHack
= 0x7fffffff
219 #ifdef VBOX_WITH_64_BITS_GUESTS
221 * Constants and structures are redefined for the guest.
223 * Host code MUST always use either *32 or *64 variant explicitely.
224 * Host source code will use VBOX_HGCM_HOST_CODE define to catch undefined
225 * data types and constants.
227 * This redefinition means that the new additions builds will use
228 * the *64 or *32 variants depending on the current architecture bit count (ARCH_BITS).
230 # ifndef VBOX_HGCM_HOST_CODE
232 # define VMMDevReq_HGCMCall VMMDevReq_HGCMCall64
233 # elif ARCH_BITS == 32
234 # define VMMDevReq_HGCMCall VMMDevReq_HGCMCall32
236 # error "Unsupported ARCH_BITS"
238 # endif /* !VBOX_HGCM_HOST_CODE */
239 #endif /* VBOX_WITH_64_BITS_GUESTS */
241 /** Version of VMMDevRequestHeader structure. */
242 #define VMMDEV_REQUEST_HEADER_VERSION (0x10001)
246 * Generic VMMDev request header.
250 /** IN: Size of the structure in bytes (including body). */
252 /** IN: Version of the structure. */
254 /** IN: Type of the request. */
255 VMMDevRequestType requestType
;
256 /** OUT: Return code. */
258 /** Reserved field no.1. MBZ. */
260 /** Reserved field no.2. MBZ. */
262 } VMMDevRequestHeader
;
263 AssertCompileSize(VMMDevRequestHeader
, 24);
267 * Mouse status request structure.
269 * Used by VMMDevReq_GetMouseStatus and VMMDevReq_SetMouseStatus.
274 VMMDevRequestHeader header
;
275 /** Mouse feature mask. See VMMDEV_MOUSE_*. */
276 uint32_t mouseFeatures
;
277 /** Mouse x position. */
279 /** Mouse y position. */
281 } VMMDevReqMouseStatus
;
282 AssertCompileSize(VMMDevReqMouseStatus
, 24+12);
284 /** @name Mouse capability bits (VMMDevReqMouseStatus::mouseFeatures).
286 /** The guest can (== wants to) handle absolute coordinates. */
287 #define VMMDEV_MOUSE_GUEST_CAN_ABSOLUTE RT_BIT(0)
288 /** The host can (== wants to) send absolute coordinates.
289 * (Input not captured.) */
290 #define VMMDEV_MOUSE_HOST_WANTS_ABSOLUTE RT_BIT(1)
291 /** The guest can *NOT* switch to software cursor and therefore depends on the
294 * When guest additions are installed and the host has promised to display the
295 * cursor itself, the guest installs a hardware mouse driver. Don't ask the
296 * guest to switch to a software cursor then. */
297 #define VMMDEV_MOUSE_GUEST_NEEDS_HOST_CURSOR RT_BIT(2)
298 /** The host does NOT provide support for drawing the cursor itself. */
299 #define VMMDEV_MOUSE_HOST_CANNOT_HWPOINTER RT_BIT(3)
300 /** The guest can read VMMDev events to find out about pointer movement */
301 #define VMMDEV_MOUSE_NEW_PROTOCOL RT_BIT(4)
302 /** If the guest changes the status of the
303 * VMMDEV_MOUSE_GUEST_NEEDS_HOST_CURSOR bit, the host will honour this */
304 #define VMMDEV_MOUSE_HOST_RECHECKS_NEEDS_HOST_CURSOR RT_BIT(5)
305 /** The host supplies an absolute pointing device. The Guest Additions may
306 * wish to use this to decide whether to install their own driver */
307 #define VMMDEV_MOUSE_HOST_HAS_ABS_DEV RT_BIT(6)
308 /** The mask of all VMMDEV_MOUSE_* flags */
309 #define VMMDEV_MOUSE_MASK UINT32_C(0x0000007f)
310 /** The mask of guest capability changes for which notification events should
312 #define VMMDEV_MOUSE_NOTIFY_HOST_MASK \
313 (VMMDEV_MOUSE_GUEST_CAN_ABSOLUTE | VMMDEV_MOUSE_GUEST_NEEDS_HOST_CURSOR)
314 /** The mask of all capabilities which the guest can legitimately change */
315 #define VMMDEV_MOUSE_GUEST_MASK \
316 (VMMDEV_MOUSE_NOTIFY_HOST_MASK | VMMDEV_MOUSE_NEW_PROTOCOL)
317 /** The mask of host capability changes for which notification events should
319 #define VMMDEV_MOUSE_NOTIFY_GUEST_MASK \
320 VMMDEV_MOUSE_HOST_WANTS_ABSOLUTE
321 /** The mask of all capabilities which the host can legitimately change */
322 #define VMMDEV_MOUSE_HOST_MASK \
323 ( VMMDEV_MOUSE_NOTIFY_GUEST_MASK \
324 | VMMDEV_MOUSE_HOST_CANNOT_HWPOINTER \
325 | VMMDEV_MOUSE_HOST_RECHECKS_NEEDS_HOST_CURSOR \
326 | VMMDEV_MOUSE_HOST_HAS_ABS_DEV)
329 /** @name Absolute mouse reporting range
331 /** @todo Should these be here? They are needed by both host and guest. */
332 /** The minumum value our pointing device can return. */
333 #define VMMDEV_MOUSE_RANGE_MIN 0
334 /** The maximum value our pointing device can return. */
335 #define VMMDEV_MOUSE_RANGE_MAX 0xFFFF
336 /** The full range our pointing device can return. */
337 #define VMMDEV_MOUSE_RANGE (VMMDEV_MOUSE_RANGE_MAX - VMMDEV_MOUSE_RANGE_MIN)
342 * Mouse pointer shape/visibility change request.
344 * Used by VMMDevReq_SetPointerShape. The size is variable.
346 typedef struct VMMDevReqMousePointer
349 VMMDevRequestHeader header
;
350 /** VBOX_MOUSE_POINTER_* bit flags. */
352 /** x coordinate of hot spot. */
354 /** y coordinate of hot spot. */
356 /** Width of the pointer in pixels. */
358 /** Height of the pointer in scanlines. */
363 * The data consists of 1 bpp AND mask followed by 32 bpp XOR (color) mask.
365 * For pointers without alpha channel the XOR mask pixels are 32 bit values: (lsb)BGR0(msb).
366 * For pointers with alpha channel the XOR mask consists of (lsb)BGRA(msb) 32 bit values.
368 * Guest driver must create the AND mask for pointers with alpha channel, so if host does not
369 * support alpha, the pointer could be displayed as a normal color pointer. The AND mask can
370 * be constructed from alpha values. For example alpha value >= 0xf0 means bit 0 in the AND mask.
372 * The AND mask is 1 bpp bitmap with byte aligned scanlines. Size of AND mask,
373 * therefore, is cbAnd = (width + 7) / 8 * height. The padding bits at the
374 * end of any scanline are undefined.
376 * The XOR mask follows the AND mask on the next 4 bytes aligned offset:
377 * uint8_t *pXor = pAnd + (cbAnd + 3) & ~3
378 * Bytes in the gap between the AND and the XOR mask are undefined.
379 * XOR mask scanlines have no gap between them and size of XOR mask is:
380 * cXor = width * 4 * height.
383 * Preallocate 4 bytes for accessing actual data as p->pointerData.
386 } VMMDevReqMousePointer
;
387 AssertCompileSize(VMMDevReqMousePointer
, 24+24);
390 * Get the size that a VMMDevReqMousePointer request should have for a given
391 * size of cursor, including the trailing cursor image and mask data.
392 * @note an "empty" request still has the four preallocated bytes of data
395 * @param width the cursor width
396 * @param height the cursor height
398 DECLINLINE(size_t) vmmdevGetMousePointerReqSize(uint32_t width
, uint32_t height
)
400 size_t cbBase
= RT_OFFSETOF(VMMDevReqMousePointer
, pointerData
);
401 size_t cbMask
= (width
+ 7) / 8 * height
;
402 size_t cbArgb
= width
* height
* 4;
403 return RT_MAX(cbBase
+ ((cbMask
+ 3) & ~3) + cbArgb
,
404 sizeof(VMMDevReqMousePointer
));
407 /** @name VMMDevReqMousePointer::fFlags
408 * @note The VBOX_MOUSE_POINTER_* flags are used in the guest video driver,
409 * values must be <= 0x8000 and must not be changed. (try make more sense
413 /** pointer is visible */
414 #define VBOX_MOUSE_POINTER_VISIBLE (0x0001)
415 /** pointer has alpha channel */
416 #define VBOX_MOUSE_POINTER_ALPHA (0x0002)
417 /** pointerData contains new pointer shape */
418 #define VBOX_MOUSE_POINTER_SHAPE (0x0004)
423 * String log request structure.
425 * Used by VMMDevReq_LogString.
426 * @deprecated Use the IPRT logger or VbglR3WriteLog instead.
431 VMMDevRequestHeader header
;
432 /** variable length string data */
434 } VMMDevReqLogString
;
435 AssertCompileSize(VMMDevReqLogString
, 24+4);
439 * VirtualBox host version request structure.
441 * Used by VMMDevReq_GetHostVersion.
443 * @remarks VBGL uses this to detect the precense of new features in the
449 VMMDevRequestHeader header
;
450 /** Major version. */
452 /** Minor version. */
460 } VMMDevReqHostVersion
;
461 AssertCompileSize(VMMDevReqHostVersion
, 24+16);
463 /** @name VMMDevReqHostVersion::features
465 /** Physical page lists are supported by HGCM. */
466 #define VMMDEV_HVF_HGCM_PHYS_PAGE_LIST RT_BIT(0)
471 * Guest capabilities structure.
473 * Used by VMMDevReq_ReportGuestCapabilities.
478 VMMDevRequestHeader header
;
479 /** Capabilities (VMMDEV_GUEST_*). */
481 } VMMDevReqGuestCapabilities
;
482 AssertCompileSize(VMMDevReqGuestCapabilities
, 24+4);
485 * Guest capabilities structure, version 2.
487 * Used by VMMDevReq_SetGuestCapabilities.
492 VMMDevRequestHeader header
;
493 /** Mask of capabilities to be added. */
495 /** Mask of capabilities to be removed. */
497 } VMMDevReqGuestCapabilities2
;
498 AssertCompileSize(VMMDevReqGuestCapabilities2
, 24+8);
500 /** @name Guest capability bits.
501 * Used by VMMDevReq_ReportGuestCapabilities and VMMDevReq_SetGuestCapabilities.
503 /** The guest supports seamless display rendering. */
504 #define VMMDEV_GUEST_SUPPORTS_SEAMLESS RT_BIT_32(0)
505 /** The guest supports mapping guest to host windows. */
506 #define VMMDEV_GUEST_SUPPORTS_GUEST_HOST_WINDOW_MAPPING RT_BIT_32(1)
507 /** The guest graphical additions are active.
508 * Used for fast activation and deactivation of certain graphical operations
509 * (e.g. resizing & seamless). The legacy VMMDevReq_ReportGuestCapabilities
510 * request sets this automatically, but VMMDevReq_SetGuestCapabilities does
512 #define VMMDEV_GUEST_SUPPORTS_GRAPHICS RT_BIT_32(2)
513 /** The mask of valid events, for sanity checking. */
514 #define VMMDEV_GUEST_CAPABILITIES_MASK UINT32_C(0x00000007)
519 * Idle request structure.
521 * Used by VMMDevReq_Idle.
526 VMMDevRequestHeader header
;
528 AssertCompileSize(VMMDevReqIdle
, 24);
532 * Host time request structure.
534 * Used by VMMDevReq_GetHostTime.
539 VMMDevRequestHeader header
;
540 /** OUT: Time in milliseconds since unix epoch. */
543 AssertCompileSize(VMMDevReqHostTime
, 24+8);
547 * Hypervisor info structure.
549 * Used by VMMDevReq_GetHypervisorInfo and VMMDevReq_SetHypervisorInfo.
554 VMMDevRequestHeader header
;
555 /** Guest virtual address of proposed hypervisor start.
556 * Not used by VMMDevReq_GetHypervisorInfo.
557 * @todo Make this 64-bit compatible? */
558 RTGCPTR32 hypervisorStart
;
559 /** Hypervisor size in bytes. */
560 uint32_t hypervisorSize
;
561 } VMMDevReqHypervisorInfo
;
562 AssertCompileSize(VMMDevReqHypervisorInfo
, 24+8);
564 /** @name Default patch memory size .
565 * Used by VMMDevReq_RegisterPatchMemory and VMMDevReq_DeregisterPatchMemory.
567 #define VMMDEV_GUEST_DEFAULT_PATCHMEM_SIZE 8192
571 * Patching memory structure. (locked executable & read-only page from the guest's perspective)
573 * Used by VMMDevReq_RegisterPatchMemory and VMMDevReq_DeregisterPatchMemory
578 VMMDevRequestHeader header
;
579 /** Guest virtual address of the patching page(s). */
581 /** Patch page size in bytes. */
583 } VMMDevReqPatchMemory
;
584 AssertCompileSize(VMMDevReqPatchMemory
, 24+12);
588 * Guest power requests.
590 * See VMMDevReq_SetPowerStatus and VMMDevPowerStateRequest.
594 VMMDevPowerState_Invalid
= 0,
595 VMMDevPowerState_Pause
= 1,
596 VMMDevPowerState_PowerOff
= 2,
597 VMMDevPowerState_SaveState
= 3,
598 VMMDevPowerState_SizeHack
= 0x7fffffff
600 AssertCompileSize(VMMDevPowerState
, 4);
603 * VM power status structure.
605 * Used by VMMDevReq_SetPowerStatus.
610 VMMDevRequestHeader header
;
611 /** Power state request. */
612 VMMDevPowerState powerState
;
613 } VMMDevPowerStateRequest
;
614 AssertCompileSize(VMMDevPowerStateRequest
, 24+4);
618 * Pending events structure.
620 * Used by VMMDevReq_AcknowledgeEvents.
625 VMMDevRequestHeader header
;
626 /** OUT: Pending event mask. */
629 AssertCompileSize(VMMDevEvents
, 24+4);
633 * Guest event filter mask control.
635 * Used by VMMDevReq_CtlGuestFilterMask.
640 VMMDevRequestHeader header
;
641 /** Mask of events to be added to the filter. */
643 /** Mask of events to be removed from the filter. */
645 } VMMDevCtlGuestFilterMask
;
646 AssertCompileSize(VMMDevCtlGuestFilterMask
, 24+8);
650 * Guest information structure.
652 * Used by VMMDevReportGuestInfo and PDMIVMMDEVCONNECTOR::pfnUpdateGuestVersion.
654 typedef struct VBoxGuestInfo
656 /** The VMMDev interface version expected by additions.
657 * *Deprecated*, do not use anymore! Will be removed. */
658 uint32_t interfaceVersion
;
659 /** Guest OS type. */
662 AssertCompileSize(VBoxGuestInfo
, 8);
665 * Guest information report.
667 * Used by VMMDevReq_ReportGuestInfo.
672 VMMDevRequestHeader header
;
673 /** Guest information. */
674 VBoxGuestInfo guestInfo
;
675 } VMMDevReportGuestInfo
;
676 AssertCompileSize(VMMDevReportGuestInfo
, 24+8);
680 * Guest information structure, version 2.
682 * Used by VMMDevReportGuestInfo2 and PDMIVMMDEVCONNECTOR::pfnUpdateGuestVersion2.
684 typedef struct VBoxGuestInfo2
686 /** Major version. */
687 uint16_t additionsMajor
;
688 /** Minor version. */
689 uint16_t additionsMinor
;
691 uint32_t additionsBuild
;
693 uint32_t additionsRevision
;
694 /** Feature mask, currently unused. */
695 uint32_t additionsFeatures
;
696 /** The intentional meaning of this field was:
697 * Some additional information, for example 'Beta 1' or something like that.
699 * The way it was implemented was implemented: VBOX_VERSION_STRING.
701 * This means the first three members are duplicated in this field (if the guest
702 * build config is sane). So, the user must check this and chop it off before
703 * usage. There is, because of the Main code's blind trust in the field's
704 * content, no way back. */
707 AssertCompileSize(VBoxGuestInfo2
, 144);
710 * Guest information report, version 2.
712 * Used by VMMDevReq_ReportGuestInfo2.
717 VMMDevRequestHeader header
;
718 /** Guest information. */
719 VBoxGuestInfo2 guestInfo
;
720 } VMMDevReportGuestInfo2
;
721 AssertCompileSize(VMMDevReportGuestInfo2
, 24+144);
725 * The guest facility.
726 * This needs to be kept in sync with AdditionsFacilityType of the Main API!
730 VBoxGuestFacilityType_Unknown
= 0,
731 VBoxGuestFacilityType_VBoxGuestDriver
= 20,
732 VBoxGuestFacilityType_AutoLogon
= 90, /* VBoxGINA / VBoxCredProv / pam_vbox. */
733 VBoxGuestFacilityType_VBoxService
= 100,
734 VBoxGuestFacilityType_VBoxTrayClient
= 101, /* VBoxTray (Windows), VBoxClient (Linux, Unix). */
735 VBoxGuestFacilityType_Seamless
= 1000,
736 VBoxGuestFacilityType_Graphics
= 1100,
737 VBoxGuestFacilityType_All
= 0x7ffffffe,
738 VBoxGuestFacilityType_SizeHack
= 0x7fffffff
739 } VBoxGuestFacilityType
;
740 AssertCompileSize(VBoxGuestFacilityType
, 4);
744 * The current guest status of a facility.
745 * This needs to be kept in sync with AdditionsFacilityStatus of the Main API!
747 * @remarks r=bird: Pretty please, for future types like this, simply do a
748 * linear allocation without any gaps. This stuff is impossible work
749 * efficiently with, let alone validate. Applies to the other facility
754 VBoxGuestFacilityStatus_Inactive
= 0,
755 VBoxGuestFacilityStatus_Paused
= 1,
756 VBoxGuestFacilityStatus_PreInit
= 20,
757 VBoxGuestFacilityStatus_Init
= 30,
758 VBoxGuestFacilityStatus_Active
= 50,
759 VBoxGuestFacilityStatus_Terminating
= 100,
760 VBoxGuestFacilityStatus_Terminated
= 101,
761 VBoxGuestFacilityStatus_Failed
= 800,
762 VBoxGuestFacilityStatus_Unknown
= 999,
763 VBoxGuestFacilityStatus_SizeHack
= 0x7fffffff
764 } VBoxGuestFacilityStatus
;
765 AssertCompileSize(VBoxGuestFacilityStatus
, 4);
769 * The facility class.
770 * This needs to be kept in sync with AdditionsFacilityClass of the Main API!
774 VBoxGuestFacilityClass_None
= 0,
775 VBoxGuestFacilityClass_Driver
= 10,
776 VBoxGuestFacilityClass_Service
= 30,
777 VBoxGuestFacilityClass_Program
= 50,
778 VBoxGuestFacilityClass_Feature
= 100,
779 VBoxGuestFacilityClass_ThirdParty
= 999,
780 VBoxGuestFacilityClass_All
= 0x7ffffffe,
781 VBoxGuestFacilityClass_SizeHack
= 0x7fffffff
782 } VBoxGuestFacilityClass
;
783 AssertCompileSize(VBoxGuestFacilityClass
, 4);
787 * Guest status structure.
789 * Used by VMMDevReqGuestStatus.
791 typedef struct VBoxGuestStatus
793 /** Facility the status is indicated for. */
794 VBoxGuestFacilityType facility
;
795 /** Current guest status. */
796 VBoxGuestFacilityStatus status
;
797 /** Flags, not used at the moment. */
800 AssertCompileSize(VBoxGuestStatus
, 12);
803 * Guest Additions status structure.
805 * Used by VMMDevReq_ReportGuestStatus.
810 VMMDevRequestHeader header
;
811 /** Guest information. */
812 VBoxGuestStatus guestStatus
;
813 } VMMDevReportGuestStatus
;
814 AssertCompileSize(VMMDevReportGuestStatus
, 24+12);
818 * The current status of specific guest user.
819 * This needs to be kept in sync with GuestUserState of the Main API!
821 typedef enum VBoxGuestUserState
823 VBoxGuestUserState_Unknown
= 0,
824 VBoxGuestUserState_LoggedIn
= 1,
825 VBoxGuestUserState_LoggedOut
= 2,
826 VBoxGuestUserState_Locked
= 3,
827 VBoxGuestUserState_Unlocked
= 4,
828 VBoxGuestUserState_Disabled
= 5,
829 VBoxGuestUserState_Idle
= 6,
830 VBoxGuestUserState_InUse
= 7,
831 VBoxGuestUserState_Created
= 8,
832 VBoxGuestUserState_Deleted
= 9,
833 VBoxGuestUserState_SessionChanged
= 10,
834 VBoxGuestUserState_CredentialsChanged
= 11,
835 VBoxGuestUserState_RoleChanged
= 12,
836 VBoxGuestUserState_GroupAdded
= 13,
837 VBoxGuestUserState_GroupRemoved
= 14,
838 VBoxGuestUserState_Elevated
= 15,
839 VBoxGuestUserState_SizeHack
= 0x7fffffff
840 } VBoxGuestUserState
;
841 AssertCompileSize(VBoxGuestUserState
, 4);
845 * Guest user status updates.
847 typedef struct VBoxGuestUserStatus
849 /** The guest user state to send. */
850 VBoxGuestUserState state
;
851 /** Size (in bytes) of szUser. */
853 /** Size (in bytes) of szDomain. */
855 /** Size (in bytes) of aDetails. */
857 /** Note: Here begins the dynamically
858 * allocated region. */
859 /** Guest user to report state for. */
861 /** Domain the guest user is bound to. */
863 /** Optional details of the state. */
865 } VBoxGuestUserStatus
;
866 AssertCompileSize(VBoxGuestUserStatus
, 20);
870 * Guest user status structure.
872 * Used by VMMDevReq_ReportGuestUserStatus.
877 VMMDevRequestHeader header
;
878 /** Guest user status. */
879 VBoxGuestUserStatus status
;
880 } VMMDevReportGuestUserState
;
881 AssertCompileSize(VMMDevReportGuestUserState
, 24+20);
885 * Guest statistics structure.
887 * Used by VMMDevReportGuestStats and PDMIVMMDEVCONNECTOR::pfnReportStatistics.
889 typedef struct VBoxGuestStatistics
891 /** Virtual CPU ID. */
893 /** Reported statistics. */
894 uint32_t u32StatCaps
;
895 /** Idle CPU load (0-100) for last interval. */
896 uint32_t u32CpuLoad_Idle
;
897 /** Kernel CPU load (0-100) for last interval. */
898 uint32_t u32CpuLoad_Kernel
;
899 /** User CPU load (0-100) for last interval. */
900 uint32_t u32CpuLoad_User
;
901 /** Nr of threads. */
903 /** Nr of processes. */
904 uint32_t u32Processes
;
905 /** Nr of handles. */
907 /** Memory load (0-100). */
908 uint32_t u32MemoryLoad
;
909 /** Page size of guest system. */
910 uint32_t u32PageSize
;
911 /** Total physical memory (in 4KB pages). */
912 uint32_t u32PhysMemTotal
;
913 /** Available physical memory (in 4KB pages). */
914 uint32_t u32PhysMemAvail
;
915 /** Ballooned physical memory (in 4KB pages). */
916 uint32_t u32PhysMemBalloon
;
917 /** Total number of committed memory (which is not necessarily in-use) (in 4KB pages). */
918 uint32_t u32MemCommitTotal
;
919 /** Total amount of memory used by the kernel (in 4KB pages). */
920 uint32_t u32MemKernelTotal
;
921 /** Total amount of paged memory used by the kernel (in 4KB pages). */
922 uint32_t u32MemKernelPaged
;
923 /** Total amount of nonpaged memory used by the kernel (in 4KB pages). */
924 uint32_t u32MemKernelNonPaged
;
925 /** Total amount of memory used for the system cache (in 4KB pages). */
926 uint32_t u32MemSystemCache
;
927 /** Pagefile size (in 4KB pages). */
928 uint32_t u32PageFileSize
;
929 } VBoxGuestStatistics
;
930 AssertCompileSize(VBoxGuestStatistics
, 19*4);
932 /** @name Guest statistics values (VBoxGuestStatistics::u32StatCaps).
934 #define VBOX_GUEST_STAT_CPU_LOAD_IDLE RT_BIT(0)
935 #define VBOX_GUEST_STAT_CPU_LOAD_KERNEL RT_BIT(1)
936 #define VBOX_GUEST_STAT_CPU_LOAD_USER RT_BIT(2)
937 #define VBOX_GUEST_STAT_THREADS RT_BIT(3)
938 #define VBOX_GUEST_STAT_PROCESSES RT_BIT(4)
939 #define VBOX_GUEST_STAT_HANDLES RT_BIT(5)
940 #define VBOX_GUEST_STAT_MEMORY_LOAD RT_BIT(6)
941 #define VBOX_GUEST_STAT_PHYS_MEM_TOTAL RT_BIT(7)
942 #define VBOX_GUEST_STAT_PHYS_MEM_AVAIL RT_BIT(8)
943 #define VBOX_GUEST_STAT_PHYS_MEM_BALLOON RT_BIT(9)
944 #define VBOX_GUEST_STAT_MEM_COMMIT_TOTAL RT_BIT(10)
945 #define VBOX_GUEST_STAT_MEM_KERNEL_TOTAL RT_BIT(11)
946 #define VBOX_GUEST_STAT_MEM_KERNEL_PAGED RT_BIT(12)
947 #define VBOX_GUEST_STAT_MEM_KERNEL_NONPAGED RT_BIT(13)
948 #define VBOX_GUEST_STAT_MEM_SYSTEM_CACHE RT_BIT(14)
949 #define VBOX_GUEST_STAT_PAGE_FILE_SIZE RT_BIT(15)
953 * Guest statistics command structure.
955 * Used by VMMDevReq_ReportGuestStats.
960 VMMDevRequestHeader header
;
961 /** Guest information. */
962 VBoxGuestStatistics guestStats
;
963 } VMMDevReportGuestStats
;
964 AssertCompileSize(VMMDevReportGuestStats
, 24+19*4);
967 /** Memory balloon change request structure. */
968 #define VMMDEV_MAX_MEMORY_BALLOON(PhysMemTotal) ( (9 * (PhysMemTotal)) / 10 )
971 * Poll for ballooning change request.
973 * Used by VMMDevReq_GetMemBalloonChangeRequest.
978 VMMDevRequestHeader header
;
979 /** Balloon size in megabytes. */
980 uint32_t cBalloonChunks
;
981 /** Guest ram size in megabytes. */
982 uint32_t cPhysMemChunks
;
983 /** Setting this to VMMDEV_EVENT_BALLOON_CHANGE_REQUEST indicates that the
984 * request is a response to that event.
985 * (Don't confuse this with VMMDevReq_AcknowledgeEvents.) */
987 } VMMDevGetMemBalloonChangeRequest
;
988 AssertCompileSize(VMMDevGetMemBalloonChangeRequest
, 24+12);
992 * Change the size of the balloon.
994 * Used by VMMDevReq_ChangeMemBalloon.
999 VMMDevRequestHeader header
;
1000 /** The number of pages in the array. */
1002 /** true = inflate, false = deflate. */
1004 /** Physical address (RTGCPHYS) of each page, variable size. */
1005 RTGCPHYS aPhysPage
[1];
1006 } VMMDevChangeMemBalloon
;
1007 AssertCompileSize(VMMDevChangeMemBalloon
, 24+16);
1009 /** @name The ballooning chunk size which VMMDev works at.
1011 #define VMMDEV_MEMORY_BALLOON_CHUNK_PAGES (_1M/4096)
1012 #define VMMDEV_MEMORY_BALLOON_CHUNK_SIZE (VMMDEV_MEMORY_BALLOON_CHUNK_PAGES*4096)
1017 * Guest statistics interval change request structure.
1019 * Used by VMMDevReq_GetStatisticsChangeRequest.
1024 VMMDevRequestHeader header
;
1025 /** The interval in seconds. */
1026 uint32_t u32StatInterval
;
1027 /** Setting this to VMMDEV_EVENT_STATISTICS_INTERVAL_CHANGE_REQUEST indicates
1028 * that the request is a response to that event.
1029 * (Don't confuse this with VMMDevReq_AcknowledgeEvents.) */
1031 } VMMDevGetStatisticsChangeRequest
;
1032 AssertCompileSize(VMMDevGetStatisticsChangeRequest
, 24+8);
1035 /** The size of a string field in the credentials request (including '\\0').
1036 * @see VMMDevCredentials */
1037 #define VMMDEV_CREDENTIALS_SZ_SIZE 128
1040 * Credentials request structure.
1042 * Used by VMMDevReq_QueryCredentials.
1047 VMMDevRequestHeader header
;
1048 /** IN/OUT: Request flags. */
1050 /** OUT: User name (UTF-8). */
1051 char szUserName
[VMMDEV_CREDENTIALS_SZ_SIZE
];
1052 /** OUT: Password (UTF-8). */
1053 char szPassword
[VMMDEV_CREDENTIALS_SZ_SIZE
];
1054 /** OUT: Domain name (UTF-8). */
1055 char szDomain
[VMMDEV_CREDENTIALS_SZ_SIZE
];
1056 } VMMDevCredentials
;
1057 AssertCompileSize(VMMDevCredentials
, 24+4+3*128);
1059 /** @name Credentials request flag (VMMDevCredentials::u32Flags)
1061 /** query from host whether credentials are present */
1062 #define VMMDEV_CREDENTIALS_QUERYPRESENCE RT_BIT(1)
1063 /** read credentials from host (can be combined with clear) */
1064 #define VMMDEV_CREDENTIALS_READ RT_BIT(2)
1065 /** clear credentials on host (can be combined with read) */
1066 #define VMMDEV_CREDENTIALS_CLEAR RT_BIT(3)
1067 /** read credentials for judgement in the guest */
1068 #define VMMDEV_CREDENTIALS_READJUDGE RT_BIT(8)
1069 /** clear credentials for judegement on the host */
1070 #define VMMDEV_CREDENTIALS_CLEARJUDGE RT_BIT(9)
1071 /** report credentials acceptance by guest */
1072 #define VMMDEV_CREDENTIALS_JUDGE_OK RT_BIT(10)
1073 /** report credentials denial by guest */
1074 #define VMMDEV_CREDENTIALS_JUDGE_DENY RT_BIT(11)
1075 /** report that no judgement could be made by guest */
1076 #define VMMDEV_CREDENTIALS_JUDGE_NOJUDGEMENT RT_BIT(12)
1078 /** flag telling the guest that credentials are present */
1079 #define VMMDEV_CREDENTIALS_PRESENT RT_BIT(16)
1080 /** flag telling guest that local logons should be prohibited */
1081 #define VMMDEV_CREDENTIALS_NOLOCALLOGON RT_BIT(17)
1086 * Seamless mode change request structure.
1088 * Used by VMMDevReq_GetSeamlessChangeRequest.
1093 VMMDevRequestHeader header
;
1095 /** New seamless mode. */
1096 VMMDevSeamlessMode mode
;
1097 /** Setting this to VMMDEV_EVENT_SEAMLESS_MODE_CHANGE_REQUEST indicates
1098 * that the request is a response to that event.
1099 * (Don't confuse this with VMMDevReq_AcknowledgeEvents.) */
1101 } VMMDevSeamlessChangeRequest
;
1102 AssertCompileSize(VMMDevSeamlessChangeRequest
, 24+8);
1103 AssertCompileMemberOffset(VMMDevSeamlessChangeRequest
, eventAck
, 24+4);
1107 * Display change request structure.
1109 * Used by VMMDevReq_GetDisplayChangeRequest.
1114 VMMDevRequestHeader header
;
1115 /** Horizontal pixel resolution (0 = do not change). */
1117 /** Vertical pixel resolution (0 = do not change). */
1119 /** Bits per pixel (0 = do not change). */
1121 /** Setting this to VMMDEV_EVENT_DISPLAY_CHANGE_REQUEST indicates
1122 * that the request is a response to that event.
1123 * (Don't confuse this with VMMDevReq_AcknowledgeEvents.) */
1125 } VMMDevDisplayChangeRequest
;
1126 AssertCompileSize(VMMDevDisplayChangeRequest
, 24+16);
1130 * Display change request structure, version 2.
1132 * Used by VMMDevReq_GetDisplayChangeRequest2.
1137 VMMDevRequestHeader header
;
1138 /** Horizontal pixel resolution (0 = do not change). */
1140 /** Vertical pixel resolution (0 = do not change). */
1142 /** Bits per pixel (0 = do not change). */
1144 /** Setting this to VMMDEV_EVENT_DISPLAY_CHANGE_REQUEST indicates
1145 * that the request is a response to that event.
1146 * (Don't confuse this with VMMDevReq_AcknowledgeEvents.) */
1148 /** 0 for primary display, 1 for the first secondary, etc. */
1150 } VMMDevDisplayChangeRequest2
;
1151 AssertCompileSize(VMMDevDisplayChangeRequest2
, 24+20);
1155 * Display change request structure, version Extended.
1157 * Used by VMMDevReq_GetDisplayChangeRequestEx.
1162 VMMDevRequestHeader header
;
1163 /** Horizontal pixel resolution (0 = do not change). */
1165 /** Vertical pixel resolution (0 = do not change). */
1167 /** Bits per pixel (0 = do not change). */
1169 /** Setting this to VMMDEV_EVENT_DISPLAY_CHANGE_REQUEST indicates
1170 * that the request is a response to that event.
1171 * (Don't confuse this with VMMDevReq_AcknowledgeEvents.) */
1173 /** 0 for primary display, 1 for the first secondary, etc. */
1175 /** New OriginX of secondary virtual screen */
1177 /** New OriginY of secondary virtual screen */
1179 /** Change in origin of the secondary virtaul scree is
1182 /** secondary virtual screen enabled or disabled */
1184 } VMMDevDisplayChangeRequestEx
;
1185 AssertCompileSize(VMMDevDisplayChangeRequestEx
, 24+32);
1189 * Video mode supported request structure.
1191 * Used by VMMDevReq_VideoModeSupported.
1196 VMMDevRequestHeader header
;
1197 /** IN: Horizontal pixel resolution. */
1199 /** IN: Vertical pixel resolution. */
1201 /** IN: Bits per pixel. */
1203 /** OUT: Support indicator. */
1205 } VMMDevVideoModeSupportedRequest
;
1206 AssertCompileSize(VMMDevVideoModeSupportedRequest
, 24+16);
1209 * Video mode supported request structure for a specific display.
1211 * Used by VMMDevReq_VideoModeSupported2.
1216 VMMDevRequestHeader header
;
1217 /** IN: The guest display number. */
1219 /** IN: Horizontal pixel resolution. */
1221 /** IN: Vertical pixel resolution. */
1223 /** IN: Bits per pixel. */
1225 /** OUT: Support indicator. */
1227 } VMMDevVideoModeSupportedRequest2
;
1228 AssertCompileSize(VMMDevVideoModeSupportedRequest2
, 24+20);
1231 * Video modes height reduction request structure.
1233 * Used by VMMDevReq_GetHeightReduction.
1238 VMMDevRequestHeader header
;
1239 /** OUT: Height reduction in pixels. */
1240 uint32_t heightReduction
;
1241 } VMMDevGetHeightReductionRequest
;
1242 AssertCompileSize(VMMDevGetHeightReductionRequest
, 24+4);
1246 * VRDP change request structure.
1248 * Used by VMMDevReq_GetVRDPChangeRequest.
1253 VMMDevRequestHeader header
;
1254 /** Whether VRDP is active or not. */
1255 uint8_t u8VRDPActive
;
1256 /** The configured experience level for active VRDP. */
1257 uint32_t u32VRDPExperienceLevel
;
1258 } VMMDevVRDPChangeRequest
;
1259 AssertCompileSize(VMMDevVRDPChangeRequest
, 24+8);
1260 AssertCompileMemberOffset(VMMDevVRDPChangeRequest
, u8VRDPActive
, 24);
1261 AssertCompileMemberOffset(VMMDevVRDPChangeRequest
, u32VRDPExperienceLevel
, 24+4);
1263 /** @name VRDP Experience level (VMMDevVRDPChangeRequest::u32VRDPExperienceLevel)
1265 #define VRDP_EXPERIENCE_LEVEL_ZERO 0 /**< Theming disabled. */
1266 #define VRDP_EXPERIENCE_LEVEL_LOW 1 /**< Full window dragging and desktop wallpaper disabled. */
1267 #define VRDP_EXPERIENCE_LEVEL_MEDIUM 2 /**< Font smoothing, gradients. */
1268 #define VRDP_EXPERIENCE_LEVEL_HIGH 3 /**< Animation effects disabled. */
1269 #define VRDP_EXPERIENCE_LEVEL_FULL 4 /**< Everything enabled. */
1274 * VBVA enable request structure.
1276 * Used by VMMDevReq_VideoAccelEnable.
1281 VMMDevRequestHeader header
;
1282 /** 0 - disable, !0 - enable. */
1284 /** The size of VBVAMEMORY::au8RingBuffer expected by driver.
1285 * The host will refuse to enable VBVA if the size is not equal to
1286 * VBVA_RING_BUFFER_SIZE.
1288 uint32_t cbRingBuffer
;
1289 /** Guest initializes the status to 0. Host sets appropriate VBVA_F_STATUS_ flags. */
1290 uint32_t fu32Status
;
1291 } VMMDevVideoAccelEnable
;
1292 AssertCompileSize(VMMDevVideoAccelEnable
, 24+12);
1294 /** @name VMMDevVideoAccelEnable::fu32Status.
1296 #define VBVA_F_STATUS_ACCEPTED (0x01)
1297 #define VBVA_F_STATUS_ENABLED (0x02)
1302 * VBVA flush request structure.
1304 * Used by VMMDevReq_VideoAccelFlush.
1309 VMMDevRequestHeader header
;
1310 } VMMDevVideoAccelFlush
;
1311 AssertCompileSize(VMMDevVideoAccelFlush
, 24);
1315 * VBVA set visible region request structure.
1317 * Used by VMMDevReq_VideoSetVisibleRegion.
1322 VMMDevRequestHeader header
;
1323 /** Number of rectangles */
1325 /** Rectangle array.
1326 * @todo array is spelled aRects[1]. */
1328 } VMMDevVideoSetVisibleRegion
;
1329 AssertCompileSize(RTRECT
, 16);
1330 AssertCompileSize(VMMDevVideoSetVisibleRegion
, 24+4+16);
1337 VMMDevCpuStatusType_Invalid
= 0,
1338 VMMDevCpuStatusType_Disable
= 1,
1339 VMMDevCpuStatusType_Enable
= 2,
1340 VMMDevCpuStatusType_SizeHack
= 0x7fffffff
1341 } VMMDevCpuStatusType
;
1344 * CPU hotplug event status request.
1349 VMMDevRequestHeader header
;
1351 VMMDevCpuStatusType enmStatusType
;
1352 } VMMDevCpuHotPlugStatusRequest
;
1353 AssertCompileSize(VMMDevCpuHotPlugStatusRequest
, 24+4);
1356 * Get the ID of the changed CPU and event type.
1361 VMMDevRequestHeader header
;
1363 VMMDevCpuEventType enmEventType
;
1364 /** core id of the CPU changed */
1366 /** package id of the CPU changed */
1367 uint32_t idCpuPackage
;
1368 } VMMDevGetCpuHotPlugRequest
;
1369 AssertCompileSize(VMMDevGetCpuHotPlugRequest
, 24+4+4+4);
1373 * Shared region description
1375 typedef struct VMMDEVSHAREDREGIONDESC
1377 RTGCPTR64 GCRegionAddr
;
1379 uint32_t u32Alignment
;
1380 } VMMDEVSHAREDREGIONDESC
;
1381 AssertCompileSize(VMMDEVSHAREDREGIONDESC
, 16);
1383 #define VMMDEVSHAREDREGIONDESC_MAX 32
1386 * Shared module registration
1391 VMMDevRequestHeader header
;
1392 /** Shared module size. */
1394 /** Number of included region descriptors */
1396 /** Base address of the shared module. */
1397 RTGCPTR64 GCBaseAddr
;
1398 /** Guest OS type. */
1399 VBOXOSFAMILY enmGuestOS
;
1404 /** Module version */
1406 /** Shared region descriptor(s). */
1407 VMMDEVSHAREDREGIONDESC aRegions
[1];
1408 } VMMDevSharedModuleRegistrationRequest
;
1409 AssertCompileSize(VMMDevSharedModuleRegistrationRequest
, 24+4+4+8+4+4+128+16+16);
1413 * Shared module unregistration
1418 VMMDevRequestHeader header
;
1419 /** Shared module size. */
1421 /** Align at 8 byte boundary. */
1422 uint32_t u32Alignment
;
1423 /** Base address of the shared module. */
1424 RTGCPTR64 GCBaseAddr
;
1427 /** Module version */
1429 } VMMDevSharedModuleUnregistrationRequest
;
1430 AssertCompileSize(VMMDevSharedModuleUnregistrationRequest
, 24+4+4+8+128+16);
1434 * Shared module periodic check
1439 VMMDevRequestHeader header
;
1440 } VMMDevSharedModuleCheckRequest
;
1441 AssertCompileSize(VMMDevSharedModuleCheckRequest
, 24);
1444 * Paging sharing enabled query
1449 VMMDevRequestHeader header
;
1450 /** Enabled flag (out) */
1454 } VMMDevPageSharingStatusRequest
;
1455 AssertCompileSize(VMMDevPageSharingStatusRequest
, 24+4);
1459 * Page sharing status query (debug build only)
1464 VMMDevRequestHeader header
;
1465 /** Page address. */
1468 uint64_t uPageFlags
;
1469 /** Shared flag (out) */
1473 } VMMDevPageIsSharedRequest
;
1476 * Session id request structure.
1478 * Used by VMMDevReq_GetSessionId.
1483 VMMDevRequestHeader header
;
1484 /** OUT: unique session id; the id will be different after each start, reset or restore of the VM */
1486 } VMMDevReqSessionId
;
1487 AssertCompileSize(VMMDevReqSessionId
, 24+8);
1491 * Write Core Dump request.
1493 * Used by VMMDevReq_WriteCoreDump.
1498 VMMDevRequestHeader header
;
1499 /** Flags (reserved, MBZ). */
1501 } VMMDevReqWriteCoreDump
;
1502 AssertCompileSize(VMMDevReqWriteCoreDump
, 24+4);
1504 /** Heart beat check state structure.
1505 * Used by VMMDevReq_HeartbeatConfigure. */
1509 VMMDevRequestHeader header
;
1510 /** OUT: Guest heartbeat interval in nanosec. */
1511 uint64_t cNsInterval
;
1512 /** Heartbeat check flag. */
1514 } VMMDevReqHeartbeat
;
1515 AssertCompileSize(VMMDevReqHeartbeat
, 24+12);
1519 #ifdef VBOX_WITH_HGCM
1521 /** @name HGCM flags.
1524 # define VBOX_HGCM_REQ_DONE RT_BIT_32(VBOX_HGCM_REQ_DONE_BIT)
1525 # define VBOX_HGCM_REQ_DONE_BIT 0
1526 # define VBOX_HGCM_REQ_CANCELLED (0x2)
1530 * HGCM request header.
1532 typedef struct VMMDevHGCMRequestHeader
1534 /** Request header. */
1535 VMMDevRequestHeader header
;
1542 } VMMDevHGCMRequestHeader
;
1543 AssertCompileSize(VMMDevHGCMRequestHeader
, 24+8);
1546 * HGCM connect request structure.
1548 * Used by VMMDevReq_HGCMConnect.
1552 /** HGCM request header. */
1553 VMMDevHGCMRequestHeader header
;
1555 /** IN: Description of service to connect to. */
1556 HGCMServiceLocation loc
;
1558 /** OUT: Client identifier assigned by local instance of HGCM. */
1559 uint32_t u32ClientID
;
1560 } VMMDevHGCMConnect
;
1561 AssertCompileSize(VMMDevHGCMConnect
, 32+132+4);
1565 * HGCM disconnect request structure.
1567 * Used by VMMDevReq_HGCMDisconnect.
1571 /** HGCM request header. */
1572 VMMDevHGCMRequestHeader header
;
1574 /** IN: Client identifier. */
1575 uint32_t u32ClientID
;
1576 } VMMDevHGCMDisconnect
;
1577 AssertCompileSize(VMMDevHGCMDisconnect
, 32+4);
1580 * HGCM parameter type.
1584 VMMDevHGCMParmType_Invalid
= 0,
1585 VMMDevHGCMParmType_32bit
= 1,
1586 VMMDevHGCMParmType_64bit
= 2,
1587 VMMDevHGCMParmType_PhysAddr
= 3, /**< @deprecated Doesn't work, use PageList. */
1588 VMMDevHGCMParmType_LinAddr
= 4, /**< In and Out */
1589 VMMDevHGCMParmType_LinAddr_In
= 5, /**< In (read; host<-guest) */
1590 VMMDevHGCMParmType_LinAddr_Out
= 6, /**< Out (write; host->guest) */
1591 VMMDevHGCMParmType_LinAddr_Locked
= 7, /**< Locked In and Out */
1592 VMMDevHGCMParmType_LinAddr_Locked_In
= 8, /**< Locked In (read; host<-guest) */
1593 VMMDevHGCMParmType_LinAddr_Locked_Out
= 9, /**< Locked Out (write; host->guest) */
1594 VMMDevHGCMParmType_PageList
= 10, /**< Physical addresses of locked pages for a buffer. */
1595 VMMDevHGCMParmType_SizeHack
= 0x7fffffff
1596 } HGCMFunctionParameterType
;
1597 AssertCompileSize(HGCMFunctionParameterType
, 4);
1599 # ifdef VBOX_WITH_64_BITS_GUESTS
1601 * HGCM function parameter, 32-bit client.
1605 HGCMFunctionParameterType type
;
1616 RTGCPHYS32 physAddr
;
1617 RTGCPTR32 linearAddr
;
1622 uint32_t size
; /**< Size of the buffer described by the page list. */
1623 uint32_t offset
; /**< Relative to the request header, valid if size != 0. */
1627 void SetUInt32(uint32_t u32
)
1629 type
= VMMDevHGCMParmType_32bit
;
1630 u
.value64
= 0; /* init unused bits to 0 */
1634 int GetUInt32(uint32_t *pu32
)
1636 if (type
== VMMDevHGCMParmType_32bit
)
1639 return VINF_SUCCESS
;
1641 return VERR_INVALID_PARAMETER
;
1644 void SetUInt64(uint64_t u64
)
1646 type
= VMMDevHGCMParmType_64bit
;
1650 int GetUInt64(uint64_t *pu64
)
1652 if (type
== VMMDevHGCMParmType_64bit
)
1655 return VINF_SUCCESS
;
1657 return VERR_INVALID_PARAMETER
;
1660 void SetPtr(void *pv
, uint32_t cb
)
1662 type
= VMMDevHGCMParmType_LinAddr
;
1663 u
.Pointer
.size
= cb
;
1664 u
.Pointer
.u
.linearAddr
= (RTGCPTR32
)(uintptr_t)pv
;
1666 # endif /* __cplusplus */
1667 } HGCMFunctionParameter32
;
1668 AssertCompileSize(HGCMFunctionParameter32
, 4+8);
1671 * HGCM function parameter, 64-bit client.
1675 HGCMFunctionParameterType type
;
1686 RTGCPHYS64 physAddr
;
1687 RTGCPTR64 linearAddr
;
1692 uint32_t size
; /**< Size of the buffer described by the page list. */
1693 uint32_t offset
; /**< Relative to the request header, valid if size != 0. */
1697 void SetUInt32(uint32_t u32
)
1699 type
= VMMDevHGCMParmType_32bit
;
1700 u
.value64
= 0; /* init unused bits to 0 */
1704 int GetUInt32(uint32_t *pu32
)
1706 if (type
== VMMDevHGCMParmType_32bit
)
1709 return VINF_SUCCESS
;
1711 return VERR_INVALID_PARAMETER
;
1714 void SetUInt64(uint64_t u64
)
1716 type
= VMMDevHGCMParmType_64bit
;
1720 int GetUInt64(uint64_t *pu64
)
1722 if (type
== VMMDevHGCMParmType_64bit
)
1725 return VINF_SUCCESS
;
1727 return VERR_INVALID_PARAMETER
;
1730 void SetPtr(void *pv
, uint32_t cb
)
1732 type
= VMMDevHGCMParmType_LinAddr
;
1733 u
.Pointer
.size
= cb
;
1734 u
.Pointer
.u
.linearAddr
= (uintptr_t)pv
;
1736 # endif /** __cplusplus */
1737 } HGCMFunctionParameter64
;
1738 AssertCompileSize(HGCMFunctionParameter64
, 4+12);
1740 /* Redefine the structure type for the guest code. */
1741 # ifndef VBOX_HGCM_HOST_CODE
1742 # if ARCH_BITS == 64
1743 # define HGCMFunctionParameter HGCMFunctionParameter64
1744 # elif ARCH_BITS == 32
1745 # define HGCMFunctionParameter HGCMFunctionParameter32
1747 # error "Unsupported sizeof (void *)"
1749 # endif /* !VBOX_HGCM_HOST_CODE */
1751 # else /* !VBOX_WITH_64_BITS_GUESTS */
1754 * HGCM function parameter, 32-bit client.
1756 * @todo If this is the same as HGCMFunctionParameter32, why the duplication?
1760 HGCMFunctionParameterType type
;
1771 RTGCPHYS32 physAddr
;
1772 RTGCPTR32 linearAddr
;
1777 uint32_t size
; /**< Size of the buffer described by the page list. */
1778 uint32_t offset
; /**< Relative to the request header, valid if size != 0. */
1782 void SetUInt32(uint32_t u32
)
1784 type
= VMMDevHGCMParmType_32bit
;
1785 u
.value64
= 0; /* init unused bits to 0 */
1789 int GetUInt32(uint32_t *pu32
)
1791 if (type
== VMMDevHGCMParmType_32bit
)
1794 return VINF_SUCCESS
;
1796 return VERR_INVALID_PARAMETER
;
1799 void SetUInt64(uint64_t u64
)
1801 type
= VMMDevHGCMParmType_64bit
;
1805 int GetUInt64(uint64_t *pu64
)
1807 if (type
== VMMDevHGCMParmType_64bit
)
1810 return VINF_SUCCESS
;
1812 return VERR_INVALID_PARAMETER
;
1815 void SetPtr(void *pv
, uint32_t cb
)
1817 type
= VMMDevHGCMParmType_LinAddr
;
1818 u
.Pointer
.size
= cb
;
1819 u
.Pointer
.u
.linearAddr
= (uintptr_t)pv
;
1821 # endif /* __cplusplus */
1822 } HGCMFunctionParameter
;
1823 AssertCompileSize(HGCMFunctionParameter
, 4+8);
1824 # endif /* !VBOX_WITH_64_BITS_GUESTS */
1827 * HGCM call request structure.
1829 * Used by VMMDevReq_HGCMCall, VMMDevReq_HGCMCall32 and VMMDevReq_HGCMCall64.
1833 /* request header */
1834 VMMDevHGCMRequestHeader header
;
1836 /** IN: Client identifier. */
1837 uint32_t u32ClientID
;
1838 /** IN: Service function number. */
1839 uint32_t u32Function
;
1840 /** IN: Number of parameters. */
1842 /** Parameters follow in form: HGCMFunctionParameter aParms[X]; */
1844 AssertCompileSize(VMMDevHGCMCall
, 32+12);
1846 /** @name Direction of data transfer (HGCMPageListInfo::flags). Bit flags.
1848 #define VBOX_HGCM_F_PARM_DIRECTION_NONE UINT32_C(0x00000000)
1849 #define VBOX_HGCM_F_PARM_DIRECTION_TO_HOST UINT32_C(0x00000001)
1850 #define VBOX_HGCM_F_PARM_DIRECTION_FROM_HOST UINT32_C(0x00000002)
1851 #define VBOX_HGCM_F_PARM_DIRECTION_BOTH UINT32_C(0x00000003)
1852 /** Macro for validating that the specified flags are valid. */
1853 #define VBOX_HGCM_F_PARM_ARE_VALID(fFlags) \
1854 ( (fFlags) > VBOX_HGCM_F_PARM_DIRECTION_NONE \
1855 && (fFlags) < VBOX_HGCM_F_PARM_DIRECTION_BOTH )
1859 * VMMDevHGCMParmType_PageList points to this structure to actually describe the
1864 uint32_t flags
; /**< VBOX_HGCM_F_PARM_*. */
1865 uint16_t offFirstPage
; /**< Offset in the first page where data begins. */
1866 uint16_t cPages
; /**< Number of pages. */
1867 RTGCPHYS64 aPages
[1]; /**< Page addresses. */
1869 AssertCompileSize(HGCMPageListInfo
, 4+2+2+8);
1872 /** Get the pointer to the first parmater of a HGCM call request. */
1873 # define VMMDEV_HGCM_CALL_PARMS(a) ((HGCMFunctionParameter *)((uint8_t *)(a) + sizeof (VMMDevHGCMCall)))
1874 /** Get the pointer to the first parmater of a 32-bit HGCM call request. */
1875 # define VMMDEV_HGCM_CALL_PARMS32(a) ((HGCMFunctionParameter32 *)((uint8_t *)(a) + sizeof (VMMDevHGCMCall)))
1877 # ifdef VBOX_WITH_64_BITS_GUESTS
1878 /* Explicit defines for the host code. */
1879 # ifdef VBOX_HGCM_HOST_CODE
1880 # define VMMDEV_HGCM_CALL_PARMS32(a) ((HGCMFunctionParameter32 *)((uint8_t *)(a) + sizeof (VMMDevHGCMCall)))
1881 # define VMMDEV_HGCM_CALL_PARMS64(a) ((HGCMFunctionParameter64 *)((uint8_t *)(a) + sizeof (VMMDevHGCMCall)))
1882 # endif /* VBOX_HGCM_HOST_CODE */
1883 # endif /* VBOX_WITH_64_BITS_GUESTS */
1885 # define VBOX_HGCM_MAX_PARMS 32
1888 * HGCM cancel request structure.
1890 * The Cancel request is issued using the same physical memory address as was
1891 * used for the corresponding initial HGCMCall.
1893 * Used by VMMDevReq_HGCMCancel.
1898 VMMDevHGCMRequestHeader header
;
1900 AssertCompileSize(VMMDevHGCMCancel
, 32);
1903 * HGCM cancel request structure, version 2.
1905 * Used by VMMDevReq_HGCMCancel2.
1907 * VINF_SUCCESS when cancelled.
1908 * VERR_NOT_FOUND if the specified request cannot be found.
1909 * VERR_INVALID_PARAMETER if the address is invalid valid.
1914 VMMDevRequestHeader header
;
1915 /** The physical address of the request to cancel. */
1916 RTGCPHYS32 physReqToCancel
;
1917 } VMMDevHGCMCancel2
;
1918 AssertCompileSize(VMMDevHGCMCancel2
, 24+4);
1920 #endif /* VBOX_WITH_HGCM */
1924 * Inline helper to determine the request size for the given operation.
1925 * Returns 0 if the given operation is not handled and/or supported.
1928 * @param requestType The VMMDev request type.
1930 DECLINLINE(size_t) vmmdevGetRequestSize(VMMDevRequestType requestType
)
1932 switch (requestType
)
1934 case VMMDevReq_GetMouseStatus
:
1935 case VMMDevReq_SetMouseStatus
:
1936 return sizeof(VMMDevReqMouseStatus
);
1937 case VMMDevReq_SetPointerShape
:
1938 return sizeof(VMMDevReqMousePointer
);
1939 case VMMDevReq_GetHostVersion
:
1940 return sizeof(VMMDevReqHostVersion
);
1941 case VMMDevReq_Idle
:
1942 return sizeof(VMMDevReqIdle
);
1943 case VMMDevReq_GetHostTime
:
1944 return sizeof(VMMDevReqHostTime
);
1945 case VMMDevReq_GetHypervisorInfo
:
1946 case VMMDevReq_SetHypervisorInfo
:
1947 return sizeof(VMMDevReqHypervisorInfo
);
1948 case VMMDevReq_RegisterPatchMemory
:
1949 case VMMDevReq_DeregisterPatchMemory
:
1950 return sizeof(VMMDevReqPatchMemory
);
1951 case VMMDevReq_SetPowerStatus
:
1952 return sizeof(VMMDevPowerStateRequest
);
1953 case VMMDevReq_AcknowledgeEvents
:
1954 return sizeof(VMMDevEvents
);
1955 case VMMDevReq_ReportGuestInfo
:
1956 return sizeof(VMMDevReportGuestInfo
);
1957 case VMMDevReq_ReportGuestInfo2
:
1958 return sizeof(VMMDevReportGuestInfo2
);
1959 case VMMDevReq_ReportGuestStatus
:
1960 return sizeof(VMMDevReportGuestStatus
);
1961 case VMMDevReq_ReportGuestUserState
:
1962 return sizeof(VMMDevReportGuestUserState
);
1963 case VMMDevReq_GetDisplayChangeRequest
:
1964 return sizeof(VMMDevDisplayChangeRequest
);
1965 case VMMDevReq_GetDisplayChangeRequest2
:
1966 return sizeof(VMMDevDisplayChangeRequest2
);
1967 case VMMDevReq_GetDisplayChangeRequestEx
:
1968 return sizeof(VMMDevDisplayChangeRequestEx
);
1969 case VMMDevReq_VideoModeSupported
:
1970 return sizeof(VMMDevVideoModeSupportedRequest
);
1971 case VMMDevReq_GetHeightReduction
:
1972 return sizeof(VMMDevGetHeightReductionRequest
);
1973 case VMMDevReq_ReportGuestCapabilities
:
1974 return sizeof(VMMDevReqGuestCapabilities
);
1975 case VMMDevReq_SetGuestCapabilities
:
1976 return sizeof(VMMDevReqGuestCapabilities2
);
1977 #ifdef VBOX_WITH_HGCM
1978 case VMMDevReq_HGCMConnect
:
1979 return sizeof(VMMDevHGCMConnect
);
1980 case VMMDevReq_HGCMDisconnect
:
1981 return sizeof(VMMDevHGCMDisconnect
);
1982 #ifdef VBOX_WITH_64_BITS_GUESTS
1983 case VMMDevReq_HGCMCall32
:
1984 return sizeof(VMMDevHGCMCall
);
1985 case VMMDevReq_HGCMCall64
:
1986 return sizeof(VMMDevHGCMCall
);
1988 case VMMDevReq_HGCMCall
:
1989 return sizeof(VMMDevHGCMCall
);
1990 #endif /* VBOX_WITH_64_BITS_GUESTS */
1991 case VMMDevReq_HGCMCancel
:
1992 return sizeof(VMMDevHGCMCancel
);
1993 #endif /* VBOX_WITH_HGCM */
1994 case VMMDevReq_VideoAccelEnable
:
1995 return sizeof(VMMDevVideoAccelEnable
);
1996 case VMMDevReq_VideoAccelFlush
:
1997 return sizeof(VMMDevVideoAccelFlush
);
1998 case VMMDevReq_VideoSetVisibleRegion
:
1999 /* The original protocol didn't consider a guest with NO visible
2001 return sizeof(VMMDevVideoSetVisibleRegion
) - sizeof(RTRECT
);
2002 case VMMDevReq_GetSeamlessChangeRequest
:
2003 return sizeof(VMMDevSeamlessChangeRequest
);
2004 case VMMDevReq_QueryCredentials
:
2005 return sizeof(VMMDevCredentials
);
2006 case VMMDevReq_ReportGuestStats
:
2007 return sizeof(VMMDevReportGuestStats
);
2008 case VMMDevReq_GetMemBalloonChangeRequest
:
2009 return sizeof(VMMDevGetMemBalloonChangeRequest
);
2010 case VMMDevReq_GetStatisticsChangeRequest
:
2011 return sizeof(VMMDevGetStatisticsChangeRequest
);
2012 case VMMDevReq_ChangeMemBalloon
:
2013 return sizeof(VMMDevChangeMemBalloon
);
2014 case VMMDevReq_GetVRDPChangeRequest
:
2015 return sizeof(VMMDevVRDPChangeRequest
);
2016 case VMMDevReq_LogString
:
2017 return sizeof(VMMDevReqLogString
);
2018 case VMMDevReq_CtlGuestFilterMask
:
2019 return sizeof(VMMDevCtlGuestFilterMask
);
2020 case VMMDevReq_GetCpuHotPlugRequest
:
2021 return sizeof(VMMDevGetCpuHotPlugRequest
);
2022 case VMMDevReq_SetCpuHotPlugStatus
:
2023 return sizeof(VMMDevCpuHotPlugStatusRequest
);
2024 case VMMDevReq_RegisterSharedModule
:
2025 return sizeof(VMMDevSharedModuleRegistrationRequest
);
2026 case VMMDevReq_UnregisterSharedModule
:
2027 return sizeof(VMMDevSharedModuleUnregistrationRequest
);
2028 case VMMDevReq_CheckSharedModules
:
2029 return sizeof(VMMDevSharedModuleCheckRequest
);
2030 case VMMDevReq_GetPageSharingStatus
:
2031 return sizeof(VMMDevPageSharingStatusRequest
);
2032 case VMMDevReq_DebugIsPageShared
:
2033 return sizeof(VMMDevPageIsSharedRequest
);
2034 case VMMDevReq_GetSessionId
:
2035 return sizeof(VMMDevReqSessionId
);
2036 case VMMDevReq_HeartbeatConfigure
:
2037 return sizeof(VMMDevReqHeartbeat
);
2038 case VMMDevReq_GuestHeartbeat
:
2039 return sizeof(VMMDevRequestHeader
);
2049 * Initializes a request structure.
2051 * @returns VBox status code.
2052 * @param req The request structure to initialize.
2053 * @param type The request type.
2055 DECLINLINE(int) vmmdevInitRequest(VMMDevRequestHeader
*req
, VMMDevRequestType type
)
2057 uint32_t requestSize
;
2059 return VERR_INVALID_PARAMETER
;
2060 requestSize
= (uint32_t)vmmdevGetRequestSize(type
);
2062 return VERR_INVALID_PARAMETER
;
2063 req
->size
= requestSize
;
2064 req
->version
= VMMDEV_REQUEST_HEADER_VERSION
;
2065 req
->requestType
= type
;
2066 req
->rc
= VERR_GENERAL_FAILURE
;
2069 return VINF_SUCCESS
;
2076 * VBVA command header.
2078 * @todo Where does this fit in?
2080 typedef struct VBVACMDHDR
2082 /** Coordinates of affected rectangle. */
2088 AssertCompileSize(VBVACMDHDR
, 8);
2090 /** @name VBVA ring defines.
2092 * The VBVA ring buffer is suitable for transferring large (< 2GB) amount of
2093 * data. For example big bitmaps which do not fit to the buffer.
2095 * Guest starts writing to the buffer by initializing a record entry in the
2096 * aRecords queue. VBVA_F_RECORD_PARTIAL indicates that the record is being
2097 * written. As data is written to the ring buffer, the guest increases off32End
2100 * The host reads the aRecords on flushes and processes all completed records.
2101 * When host encounters situation when only a partial record presents and
2102 * cbRecord & ~VBVA_F_RECORD_PARTIAL >= VBVA_RING_BUFFER_SIZE -
2103 * VBVA_RING_BUFFER_THRESHOLD, the host fetched all record data and updates
2104 * off32Head. After that on each flush the host continues fetching the data
2105 * until the record is completed.
2108 #define VBVA_RING_BUFFER_SIZE (_4M - _1K)
2109 #define VBVA_RING_BUFFER_THRESHOLD (4 * _1K)
2111 #define VBVA_MAX_RECORDS (64)
2113 #define VBVA_F_MODE_ENABLED UINT32_C(0x00000001)
2114 #define VBVA_F_MODE_VRDP UINT32_C(0x00000002)
2115 #define VBVA_F_MODE_VRDP_RESET UINT32_C(0x00000004)
2116 #define VBVA_F_MODE_VRDP_ORDER_MASK UINT32_C(0x00000008)
2118 #define VBVA_F_STATE_PROCESSING UINT32_C(0x00010000)
2120 #define VBVA_F_RECORD_PARTIAL UINT32_C(0x80000000)
2126 typedef struct VBVARECORD
2128 /** The length of the record. Changed by guest. */
2131 AssertCompileSize(VBVARECORD
, 4);
2135 * VBVA memory layout.
2137 * This is a subsection of the VMMDevMemory structure.
2139 typedef struct VBVAMEMORY
2141 /** VBVA_F_MODE_*. */
2142 uint32_t fu32ModeFlags
;
2144 /** The offset where the data start in the buffer. */
2146 /** The offset where next data must be placed in the buffer. */
2149 /** The ring buffer for data. */
2150 uint8_t au8RingBuffer
[VBVA_RING_BUFFER_SIZE
];
2152 /** The queue of record descriptions. */
2153 VBVARECORD aRecords
[VBVA_MAX_RECORDS
];
2154 uint32_t indexRecordFirst
;
2155 uint32_t indexRecordFree
;
2157 /** RDP orders supported by the client. The guest reports only them
2158 * and falls back to DIRTY rects for not supported ones.
2160 * (1 << VBVA_VRDP_*)
2162 uint32_t fu32SupportedOrders
;
2165 AssertCompileSize(VBVAMEMORY
, 12 + (_4M
-_1K
) + 4*64 + 12);
2169 * The layout of VMMDEV RAM region that contains information for guest.
2171 typedef struct VMMDevMemory
2173 /** The size of this structure. */
2175 /** The structure version. (VMMDEV_MEMORY_VERSION) */
2176 uint32_t u32Version
;
2182 /** Flag telling that VMMDev set the IRQ and acknowlegment is required */
2188 /** Pending events flags, set by host. */
2189 uint32_t u32HostEvents
;
2190 /** Mask of events the guest wants to see, set by guest. */
2191 uint32_t u32GuestEventMask
;
2195 VBVAMEMORY vbvaMemory
;
2198 AssertCompileSize(VMMDevMemory
, 8+8 + (12 + (_4M
-_1K
) + 4*64 + 12) );
2199 AssertCompileMemberOffset(VMMDevMemory
, vbvaMemory
, 16);
2201 /** Version of VMMDevMemory structure (VMMDevMemory::u32Version). */
2202 #define VMMDEV_MEMORY_VERSION (1)