[1] | 1 | /** @file
|
---|
[21217] | 2 | * Virtual Device for Guest <-> VMM/Host communication (ADD,DEV).
|
---|
[1] | 3 | */
|
---|
| 4 |
|
---|
| 5 | /*
|
---|
[98103] | 6 | * Copyright (C) 2006-2023 Oracle and/or its affiliates.
|
---|
[1] | 7 | *
|
---|
[72627] | 8 | * Permission is hereby granted, free of charge, to any person
|
---|
| 9 | * obtaining a copy of this software and associated documentation
|
---|
| 10 | * files (the "Software"), to deal in the Software without
|
---|
| 11 | * restriction, including without limitation the rights to use,
|
---|
| 12 | * copy, modify, merge, publish, distribute, sublicense, and/or sell
|
---|
| 13 | * copies of the Software, and to permit persons to whom the
|
---|
| 14 | * Software is furnished to do so, subject to the following
|
---|
| 15 | * conditions:
|
---|
[5999] | 16 | *
|
---|
[72627] | 17 | * The above copyright notice and this permission notice shall be
|
---|
| 18 | * included in all copies or substantial portions of the Software.
|
---|
[5999] | 19 | *
|
---|
[72627] | 20 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
---|
| 21 | * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
|
---|
| 22 | * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
---|
| 23 | * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
|
---|
| 24 | * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
|
---|
| 25 | * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
|
---|
| 26 | * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
|
---|
| 27 | * OTHER DEALINGS IN THE SOFTWARE.
|
---|
[1] | 28 | */
|
---|
| 29 |
|
---|
[76558] | 30 | #ifndef VBOX_INCLUDED_VMMDev_h
|
---|
| 31 | #define VBOX_INCLUDED_VMMDev_h
|
---|
[76507] | 32 | #ifndef RT_WITHOUT_PRAGMA_ONCE
|
---|
| 33 | # pragma once
|
---|
| 34 | #endif
|
---|
[1] | 35 |
|
---|
| 36 | #include <VBox/cdefs.h>
|
---|
[21223] | 37 | #include <VBox/param.h> /* for the PCI IDs. */
|
---|
| 38 | #include <VBox/types.h>
|
---|
| 39 | #include <VBox/ostypes.h>
|
---|
[68628] | 40 | #include <VBox/VMMDevCoreTypes.h>
|
---|
[68688] | 41 | #include <iprt/assertcompile.h>
|
---|
[76419] | 42 | #include <iprt/errcore.h>
|
---|
[1] | 43 |
|
---|
[48934] | 44 |
|
---|
[46691] | 45 | #pragma pack(4) /* force structure dword packing here. */
|
---|
[20374] | 46 | RT_C_DECLS_BEGIN
|
---|
[1] | 47 |
|
---|
[46691] | 48 |
|
---|
[21219] | 49 | /** @defgroup grp_vmmdev VMM Device
|
---|
| 50 | *
|
---|
[58111] | 51 | * @note This interface cannot be changed, it can only be extended!
|
---|
[21219] | 52 | *
|
---|
| 53 | * @{
|
---|
| 54 | */
|
---|
| 55 |
|
---|
[100185] | 56 | /** The VMMDev assumed page size (not the real guest page size which might be different
|
---|
| 57 | * between guest and host, on ARM for example), 4KiB is the minimum supported by both
|
---|
| 58 | * ARM and x86 and was the one used back when the device supported x86 only. */
|
---|
| 59 | #define VMMDEV_PAGE_SIZE _4K
|
---|
| 60 | /** The VMMDev assumed page shift. */
|
---|
| 61 | #define VMMDEV_PAGE_SHIFT 12
|
---|
| 62 | /** The VMMDev assumed page offset mask. */
|
---|
| 63 | #define VMMDEV_PAGE_OFFSET_MASK 0xfff
|
---|
[1] | 64 |
|
---|
[100185] | 65 |
|
---|
[1] | 66 | /** Size of VMMDev RAM region accessible by guest.
|
---|
[21227] | 67 | * Must be big enough to contain VMMDevMemory structure (see further down).
|
---|
| 68 | * For now: 4 megabyte.
|
---|
[1] | 69 | */
|
---|
[100185] | 70 | #define VMMDEV_RAM_SIZE (4 * 256 * VMMDEV_PAGE_SIZE)
|
---|
[1] | 71 |
|
---|
[12687] | 72 | /** Size of VMMDev heap region accessible by guest.
|
---|
[21219] | 73 | * (Must be a power of two (pci range).)
|
---|
[12687] | 74 | */
|
---|
[100185] | 75 | #define VMMDEV_HEAP_SIZE (4 * VMMDEV_PAGE_SIZE)
|
---|
[12687] | 76 |
|
---|
[21226] | 77 | /** Port for generic request interface (relative offset). */
|
---|
| 78 | #define VMMDEV_PORT_OFF_REQUEST 0
|
---|
[75585] | 79 | /** Port for requests that can be handled w/o going to ring-3 (relative offset).
|
---|
| 80 | * This works like VMMDevReq_AcknowledgeEvents when read. */
|
---|
| 81 | #define VMMDEV_PORT_OFF_REQUEST_FAST 8
|
---|
[21223] | 82 |
|
---|
[21226] | 83 |
|
---|
[100185] | 84 | /** The MMIO region size if MMIO is used instead of PIO. */
|
---|
| 85 | #define VMMDEV_MMIO_SIZE _4K
|
---|
| 86 | /** Port for generic request interface (relative offset). */
|
---|
| 87 | #define VMMDEV_MMIO_OFF_REQUEST 0
|
---|
| 88 | /** Port for requests that can be handled w/o going to ring-3 (relative offset).
|
---|
| 89 | * This works like VMMDevReq_AcknowledgeEvents when read. */
|
---|
| 90 | #define VMMDEV_MMIO_OFF_REQUEST_FAST 8
|
---|
| 91 |
|
---|
| 92 |
|
---|
[21226] | 93 | /** @defgroup grp_vmmdev_req VMMDev Generic Request Interface
|
---|
| 94 | * @{
|
---|
[21223] | 95 | */
|
---|
| 96 |
|
---|
[21226] | 97 | /** @name Current version of the VMMDev interface.
|
---|
[21223] | 98 | *
|
---|
| 99 | * Additions are allowed to work only if
|
---|
| 100 | * additions_major == vmmdev_current && additions_minor <= vmmdev_current.
|
---|
| 101 | * Additions version is reported to host (VMMDev) by VMMDevReq_ReportGuestInfo.
|
---|
| 102 | *
|
---|
[21456] | 103 | * @remarks These defines also live in the 16-bit and assembly versions of this
|
---|
| 104 | * header.
|
---|
[81369] | 105 | * @{
|
---|
[21223] | 106 | */
|
---|
[21226] | 107 | #define VMMDEV_VERSION 0x00010004
|
---|
| 108 | #define VMMDEV_VERSION_MAJOR (VMMDEV_VERSION >> 16)
|
---|
| 109 | #define VMMDEV_VERSION_MINOR (VMMDEV_VERSION & 0xffff)
|
---|
| 110 | /** @} */
|
---|
[21223] | 111 |
|
---|
[21226] | 112 | /** Maximum request packet size. */
|
---|
[21223] | 113 | #define VMMDEV_MAX_VMMDEVREQ_SIZE _1M
|
---|
[68550] | 114 | /** Maximum number of HGCM parameters.
|
---|
[75533] | 115 | * @note This used to be 1024, which is kind of insane. Was changed to 32,
|
---|
| 116 | * given that (guest) user land can only pass 61 anyway.
|
---|
[68550] | 117 | * See comments on VBGLIOCHGCMCALL::cParms. */
|
---|
[75533] | 118 | #define VMMDEV_MAX_HGCM_PARMS 32
|
---|
| 119 | /** Maximum total size of hgcm buffers in one call.
|
---|
| 120 | * @note Used to be 2G, since reduced to 128MB. */
|
---|
| 121 | #define VMMDEV_MAX_HGCM_DATA_SIZE _128M
|
---|
[21223] | 122 |
|
---|
| 123 | /**
|
---|
| 124 | * VMMDev request types.
|
---|
| 125 | * @note when updating this, adjust vmmdevGetRequestSize() as well
|
---|
| 126 | */
|
---|
[68630] | 127 | typedef enum VMMDevRequestType
|
---|
[21223] | 128 | {
|
---|
| 129 | VMMDevReq_InvalidRequest = 0,
|
---|
| 130 | VMMDevReq_GetMouseStatus = 1,
|
---|
| 131 | VMMDevReq_SetMouseStatus = 2,
|
---|
| 132 | VMMDevReq_SetPointerShape = 3,
|
---|
| 133 | VMMDevReq_GetHostVersion = 4,
|
---|
| 134 | VMMDevReq_Idle = 5,
|
---|
| 135 | VMMDevReq_GetHostTime = 10,
|
---|
| 136 | VMMDevReq_GetHypervisorInfo = 20,
|
---|
| 137 | VMMDevReq_SetHypervisorInfo = 21,
|
---|
[68550] | 138 | VMMDevReq_RegisterPatchMemory = 22, /**< @since version 3.0.6 */
|
---|
| 139 | VMMDevReq_DeregisterPatchMemory = 23, /**< @since version 3.0.6 */
|
---|
[21223] | 140 | VMMDevReq_SetPowerStatus = 30,
|
---|
| 141 | VMMDevReq_AcknowledgeEvents = 41,
|
---|
| 142 | VMMDevReq_CtlGuestFilterMask = 42,
|
---|
| 143 | VMMDevReq_ReportGuestInfo = 50,
|
---|
[68550] | 144 | VMMDevReq_ReportGuestInfo2 = 58, /**< @since version 3.2.0 */
|
---|
| 145 | VMMDevReq_ReportGuestStatus = 59, /**< @since version 3.2.8 */
|
---|
| 146 | VMMDevReq_ReportGuestUserState = 74, /**< @since version 4.3 */
|
---|
[38663] | 147 | /**
|
---|
| 148 | * Retrieve a display resize request sent by the host using
|
---|
| 149 | * @a IDisplay:setVideoModeHint. Deprecated.
|
---|
| 150 | *
|
---|
| 151 | * Similar to @a VMMDevReq_GetDisplayChangeRequest2, except that it only
|
---|
| 152 | * considers host requests sent for the first virtual display. This guest
|
---|
| 153 | * request should not be used in new guest code, and the results are
|
---|
| 154 | * undefined if a guest mixes calls to this and
|
---|
| 155 | * @a VMMDevReq_GetDisplayChangeRequest2.
|
---|
| 156 | */
|
---|
[21223] | 157 | VMMDevReq_GetDisplayChangeRequest = 51,
|
---|
| 158 | VMMDevReq_VideoModeSupported = 52,
|
---|
| 159 | VMMDevReq_GetHeightReduction = 53,
|
---|
[38663] | 160 | /**
|
---|
| 161 | * Retrieve a display resize request sent by the host using
|
---|
| 162 | * @a IDisplay:setVideoModeHint.
|
---|
| 163 | *
|
---|
| 164 | * Queries a display resize request sent from the host. If the
|
---|
| 165 | * @a eventAck member is sent to true and there is an unqueried
|
---|
| 166 | * request available for one of the virtual display then that request will
|
---|
| 167 | * be returned. If several displays have unqueried requests the lowest
|
---|
| 168 | * numbered display will be chosen first. Only the most recent unseen
|
---|
| 169 | * request for each display is remembered.
|
---|
| 170 | * If @a eventAck is set to false, the last host request queried with
|
---|
| 171 | * @a eventAck set is resent, or failing that the most recent received from
|
---|
| 172 | * the host. If no host request was ever received then all zeros are
|
---|
| 173 | * returned.
|
---|
| 174 | */
|
---|
[21223] | 175 | VMMDevReq_GetDisplayChangeRequest2 = 54,
|
---|
| 176 | VMMDevReq_ReportGuestCapabilities = 55,
|
---|
| 177 | VMMDevReq_SetGuestCapabilities = 56,
|
---|
[68550] | 178 | VMMDevReq_VideoModeSupported2 = 57, /**< @since version 3.2.0 */
|
---|
| 179 | VMMDevReq_GetDisplayChangeRequestEx = 80, /**< @since version 4.2.4 */
|
---|
[72352] | 180 | VMMDevReq_GetDisplayChangeRequestMulti = 81,
|
---|
[21223] | 181 | #ifdef VBOX_WITH_HGCM
|
---|
| 182 | VMMDevReq_HGCMConnect = 60,
|
---|
| 183 | VMMDevReq_HGCMDisconnect = 61,
|
---|
| 184 | VMMDevReq_HGCMCall32 = 62,
|
---|
| 185 | VMMDevReq_HGCMCall64 = 63,
|
---|
[77056] | 186 | # ifdef IN_GUEST
|
---|
| 187 | # if ARCH_BITS == 64
|
---|
| 188 | VMMDevReq_HGCMCall = VMMDevReq_HGCMCall64,
|
---|
| 189 | # elif ARCH_BITS == 32 || ARCH_BITS == 16
|
---|
| 190 | VMMDevReq_HGCMCall = VMMDevReq_HGCMCall32,
|
---|
| 191 | # else
|
---|
| 192 | # error "Unsupported ARCH_BITS"
|
---|
| 193 | # endif
|
---|
| 194 | # endif
|
---|
[21223] | 195 | VMMDevReq_HGCMCancel = 64,
|
---|
[21506] | 196 | VMMDevReq_HGCMCancel2 = 65,
|
---|
[21223] | 197 | #endif
|
---|
| 198 | VMMDevReq_VideoAccelEnable = 70,
|
---|
| 199 | VMMDevReq_VideoAccelFlush = 71,
|
---|
| 200 | VMMDevReq_VideoSetVisibleRegion = 72,
|
---|
| 201 | VMMDevReq_GetSeamlessChangeRequest = 73,
|
---|
| 202 | VMMDevReq_QueryCredentials = 100,
|
---|
| 203 | VMMDevReq_ReportCredentialsJudgement = 101,
|
---|
| 204 | VMMDevReq_ReportGuestStats = 110,
|
---|
| 205 | VMMDevReq_GetMemBalloonChangeRequest = 111,
|
---|
| 206 | VMMDevReq_GetStatisticsChangeRequest = 112,
|
---|
| 207 | VMMDevReq_ChangeMemBalloon = 113,
|
---|
| 208 | VMMDevReq_GetVRDPChangeRequest = 150,
|
---|
| 209 | VMMDevReq_LogString = 200,
|
---|
[25848] | 210 | VMMDevReq_GetCpuHotPlugRequest = 210,
|
---|
| 211 | VMMDevReq_SetCpuHotPlugStatus = 211,
|
---|
[28404] | 212 | VMMDevReq_RegisterSharedModule = 212,
|
---|
| 213 | VMMDevReq_UnregisterSharedModule = 213,
|
---|
| 214 | VMMDevReq_CheckSharedModules = 214,
|
---|
[29307] | 215 | VMMDevReq_GetPageSharingStatus = 215,
|
---|
[30040] | 216 | VMMDevReq_DebugIsPageShared = 216,
|
---|
[68550] | 217 | VMMDevReq_GetSessionId = 217, /**< @since version 3.2.8 */
|
---|
[32313] | 218 | VMMDevReq_WriteCoreDump = 218,
|
---|
[52789] | 219 | VMMDevReq_GuestHeartbeat = 219,
|
---|
| 220 | VMMDevReq_HeartbeatConfigure = 220,
|
---|
[73351] | 221 | VMMDevReq_NtBugCheck = 221,
|
---|
[83142] | 222 | VMMDevReq_VideoUpdateMonitorPositions= 222,
|
---|
[97790] | 223 | VMMDevReq_GetMouseStatusEx = 223,
|
---|
[21223] | 224 | VMMDevReq_SizeHack = 0x7fffffff
|
---|
| 225 | } VMMDevRequestType;
|
---|
| 226 |
|
---|
| 227 | /** Version of VMMDevRequestHeader structure. */
|
---|
| 228 | #define VMMDEV_REQUEST_HEADER_VERSION (0x10001)
|
---|
| 229 |
|
---|
[21226] | 230 |
|
---|
| 231 | /**
|
---|
| 232 | * Generic VMMDev request header.
|
---|
[68550] | 233 | *
|
---|
| 234 | * This structure is copied/mirrored by VBGLREQHDR in the VBoxGuest I/O control
|
---|
| 235 | * interface. Changes there needs to be mirrored in it.
|
---|
| 236 | *
|
---|
| 237 | * @sa VBGLREQHDR
|
---|
[21226] | 238 | */
|
---|
[68630] | 239 | typedef struct VMMDevRequestHeader
|
---|
[21223] | 240 | {
|
---|
[68550] | 241 | /** IN: Size of the structure in bytes (including body).
|
---|
| 242 | * (VBGLREQHDR uses this for input size and output if reserved1 is zero). */
|
---|
[21223] | 243 | uint32_t size;
|
---|
[21227] | 244 | /** IN: Version of the structure. */
|
---|
[21223] | 245 | uint32_t version;
|
---|
[68550] | 246 | /** IN: Type of the request.
|
---|
| 247 | * @note VBGLREQHDR uses this for optional output size. */
|
---|
[21223] | 248 | VMMDevRequestType requestType;
|
---|
[68550] | 249 | /** OUT: VBox status code. */
|
---|
[21223] | 250 | int32_t rc;
|
---|
[68550] | 251 | /** Reserved field no.1. MBZ.
|
---|
| 252 | * @note VBGLREQHDR uses this for optional output size, however never for a
|
---|
| 253 | * real VMMDev request, only in the I/O control interface. */
|
---|
[21223] | 254 | uint32_t reserved1;
|
---|
[70873] | 255 | /** IN: Requestor information (VMMDEV_REQUESTOR_XXX) when
|
---|
| 256 | * VBOXGSTINFO2_F_REQUESTOR_INFO is set, otherwise ignored by the host. */
|
---|
| 257 | uint32_t fRequestor;
|
---|
[21223] | 258 | } VMMDevRequestHeader;
|
---|
| 259 | AssertCompileSize(VMMDevRequestHeader, 24);
|
---|
| 260 |
|
---|
[70873] | 261 | /** @name VMMDEV_REQUESTOR_XXX - Requestor information.
|
---|
| 262 | *
|
---|
| 263 | * This is information provided to the host by the VBoxGuest device driver, so
|
---|
| 264 | * the host can implemented fine grained access to functionality if it likes.
|
---|
| 265 | * @bugref{9105}
|
---|
| 266 | *
|
---|
| 267 | * @{ */
|
---|
| 268 | /** Requestor user not given. */
|
---|
| 269 | #define VMMDEV_REQUESTOR_USR_NOT_GIVEN UINT32_C(0x00000000)
|
---|
| 270 | /** The kernel driver (VBoxGuest) is the requestor. */
|
---|
| 271 | #define VMMDEV_REQUESTOR_USR_DRV UINT32_C(0x00000001)
|
---|
| 272 | /** Some other kernel driver is the requestor. */
|
---|
| 273 | #define VMMDEV_REQUESTOR_USR_DRV_OTHER UINT32_C(0x00000002)
|
---|
| 274 | /** The root or a admin user is the requestor. */
|
---|
| 275 | #define VMMDEV_REQUESTOR_USR_ROOT UINT32_C(0x00000003)
|
---|
| 276 | /** Requestor is the windows system user (SID S-1-5-18). */
|
---|
| 277 | #define VMMDEV_REQUESTOR_USR_SYSTEM UINT32_C(0x00000004)
|
---|
| 278 | /** Reserved requestor user \#1, treat like VMMDEV_REQUESTOR_USR_USER. */
|
---|
| 279 | #define VMMDEV_REQUESTOR_USR_RESERVED1 UINT32_C(0x00000005)
|
---|
| 280 | /** Regular joe user is making the request. */
|
---|
| 281 | #define VMMDEV_REQUESTOR_USR_USER UINT32_C(0x00000006)
|
---|
| 282 | /** Requestor is a guest user (or in a guest user group). */
|
---|
| 283 | #define VMMDEV_REQUESTOR_USR_GUEST UINT32_C(0x00000007)
|
---|
| 284 | /** User classification mask. */
|
---|
| 285 | #define VMMDEV_REQUESTOR_USR_MASK UINT32_C(0x00000007)
|
---|
| 286 |
|
---|
| 287 | /** Kernel mode request.
|
---|
| 288 | * @note This is zero, so test for VMMDEV_REQUESTOR_USERMODE instead. */
|
---|
| 289 | #define VMMDEV_REQUESTOR_KERNEL UINT32_C(0x00000000)
|
---|
| 290 | /** User mode request. */
|
---|
| 291 | #define VMMDEV_REQUESTOR_USERMODE UINT32_C(0x00000008)
|
---|
| 292 |
|
---|
| 293 | /** Don't know the physical console association of the requestor. */
|
---|
| 294 | #define VMMDEV_REQUESTOR_CON_DONT_KNOW UINT32_C(0x00000000)
|
---|
| 295 | /** The request originates with a process that is NOT associated with the
|
---|
| 296 | * physical console. */
|
---|
| 297 | #define VMMDEV_REQUESTOR_CON_NO UINT32_C(0x00000010)
|
---|
| 298 | /** Requestor process DOES is associated with the physical console. */
|
---|
| 299 | #define VMMDEV_REQUESTOR_CON_YES UINT32_C(0x00000020)
|
---|
| 300 | /** Requestor process belongs to user on the physical console, but cannot
|
---|
| 301 | * ascertain that it is associated with that login. */
|
---|
| 302 | #define VMMDEV_REQUESTOR_CON_USER UINT32_C(0x00000030)
|
---|
[77893] | 303 | /** Mask the physical console state of the request. */
|
---|
| 304 | #define VMMDEV_REQUESTOR_CON_MASK UINT32_C(0x00000030)
|
---|
[70873] | 305 |
|
---|
| 306 | /** Requestor is member of special VirtualBox user group (not on windows). */
|
---|
| 307 | #define VMMDEV_REQUESTOR_GRP_VBOX UINT32_C(0x00000080)
|
---|
| 308 | /** Requestor is member of wheel / administrators group (SID S-1-5-32-544). */
|
---|
| 309 | #define VMMDEV_REQUESTOR_GRP_WHEEL UINT32_C(0x00000100)
|
---|
| 310 |
|
---|
| 311 | /** Requestor trust level: Unspecified */
|
---|
| 312 | #define VMMDEV_REQUESTOR_TRUST_NOT_GIVEN UINT32_C(0x00000000)
|
---|
| 313 | /** Requestor trust level: Untrusted (SID S-1-16-0) */
|
---|
| 314 | #define VMMDEV_REQUESTOR_TRUST_UNTRUSTED UINT32_C(0x00001000)
|
---|
| 315 | /** Requestor trust level: Untrusted (SID S-1-16-4096) */
|
---|
| 316 | #define VMMDEV_REQUESTOR_TRUST_LOW UINT32_C(0x00002000)
|
---|
| 317 | /** Requestor trust level: Medium (SID S-1-16-8192) */
|
---|
| 318 | #define VMMDEV_REQUESTOR_TRUST_MEDIUM UINT32_C(0x00003000)
|
---|
| 319 | /** Requestor trust level: Medium plus (SID S-1-16-8448) */
|
---|
| 320 | #define VMMDEV_REQUESTOR_TRUST_MEDIUM_PLUS UINT32_C(0x00004000)
|
---|
| 321 | /** Requestor trust level: High (SID S-1-16-12288) */
|
---|
| 322 | #define VMMDEV_REQUESTOR_TRUST_HIGH UINT32_C(0x00005000)
|
---|
| 323 | /** Requestor trust level: System (SID S-1-16-16384) */
|
---|
| 324 | #define VMMDEV_REQUESTOR_TRUST_SYSTEM UINT32_C(0x00006000)
|
---|
| 325 | /** Requestor trust level: Protected or higher (SID S-1-16-20480, S-1-16-28672)
|
---|
| 326 | * @note To avoid wasting an unnecessary bit, we combine the two top most
|
---|
| 327 | * mandatory security labels on Windows (protected and secure). */
|
---|
| 328 | #define VMMDEV_REQUESTOR_TRUST_PROTECTED UINT32_C(0x00007000)
|
---|
| 329 | /** Requestor trust level mask.
|
---|
| 330 | * The higher the value, the more the guest trusts the process. */
|
---|
| 331 | #define VMMDEV_REQUESTOR_TRUST_MASK UINT32_C(0x00007000)
|
---|
| 332 |
|
---|
[75784] | 333 | /** Requestor is using the less trusted user device node (/dev/vboxuser). */
|
---|
[70873] | 334 | #define VMMDEV_REQUESTOR_USER_DEVICE UINT32_C(0x00008000)
|
---|
[75784] | 335 | /** There is no user device node (/dev/vboxuser). */
|
---|
| 336 | #define VMMDEV_REQUESTOR_NO_USER_DEVICE UINT32_C(0x00010000)
|
---|
[70873] | 337 |
|
---|
| 338 | /** Legacy value for when VBOXGSTINFO2_F_REQUESTOR_INFO is clear.
|
---|
| 339 | * @internal Host only. */
|
---|
| 340 | #define VMMDEV_REQUESTOR_LEGACY UINT32_MAX
|
---|
[75771] | 341 | /** Lowest conceivable trust level, for error situations of getters.
|
---|
| 342 | * @internal Host only. */
|
---|
| 343 | #define VMMDEV_REQUESTOR_LOWEST ( VMMDEV_REQUESTOR_TRUST_UNTRUSTED | VMMDEV_REQUESTOR_USER_DEVICE \
|
---|
| 344 | | VMMDEV_REQUESTOR_CON_NO | VMMDEV_REQUESTOR_USERMODE \
|
---|
| 345 | | VMMDEV_REQUESTOR_USR_GUEST)
|
---|
[70873] | 346 | /** Used on the host to check whether a requestor value is present or not. */
|
---|
| 347 | #define VMMDEV_REQUESTOR_IS_PRESENT(a_fRequestor) ((a_fRequestor) != VMMDEV_REQUESTOR_LEGACY)
|
---|
| 348 | /** @} */
|
---|
| 349 |
|
---|
[68550] | 350 | /** Initialize a VMMDevRequestHeader structure.
|
---|
| 351 | * Same as VBGLREQHDR_INIT_VMMDEV(). */
|
---|
| 352 | #define VMMDEV_REQ_HDR_INIT(a_pHdr, a_cb, a_enmType) \
|
---|
| 353 | do { \
|
---|
[70873] | 354 | (a_pHdr)->size = (a_cb); \
|
---|
| 355 | (a_pHdr)->version = VMMDEV_REQUEST_HEADER_VERSION; \
|
---|
| 356 | (a_pHdr)->requestType = (a_enmType); \
|
---|
| 357 | (a_pHdr)->rc = VERR_INTERNAL_ERROR; \
|
---|
| 358 | (a_pHdr)->reserved1 = 0; \
|
---|
| 359 | (a_pHdr)->fRequestor = 0; \
|
---|
[68550] | 360 | } while (0)
|
---|
[21226] | 361 |
|
---|
[68550] | 362 |
|
---|
[21226] | 363 | /**
|
---|
| 364 | * Mouse status request structure.
|
---|
| 365 | *
|
---|
| 366 | * Used by VMMDevReq_GetMouseStatus and VMMDevReq_SetMouseStatus.
|
---|
| 367 | */
|
---|
[21223] | 368 | typedef struct
|
---|
| 369 | {
|
---|
| 370 | /** header */
|
---|
| 371 | VMMDevRequestHeader header;
|
---|
[21226] | 372 | /** Mouse feature mask. See VMMDEV_MOUSE_*. */
|
---|
[21223] | 373 | uint32_t mouseFeatures;
|
---|
[21226] | 374 | /** Mouse x position. */
|
---|
[35989] | 375 | int32_t pointerXPos;
|
---|
[21226] | 376 | /** Mouse y position. */
|
---|
[35989] | 377 | int32_t pointerYPos;
|
---|
[21223] | 378 | } VMMDevReqMouseStatus;
|
---|
[21226] | 379 | AssertCompileSize(VMMDevReqMouseStatus, 24+12);
|
---|
[21223] | 380 |
|
---|
[97790] | 381 |
|
---|
| 382 | /** @name Mouse buttons state bits for VMMDevReqMouseStatusEx::fButtons (identical to PDMIMOUSEPORT_BUTTON_XXX).
|
---|
| 383 | * @{ */
|
---|
| 384 | /** Left mouse button pressed. */
|
---|
| 385 | #define VMMDEV_MOUSE_BUTTON_LEFT RT_BIT(0)
|
---|
| 386 | /** Right mouse button pressed. */
|
---|
| 387 | #define VMMDEV_MOUSE_BUTTON_RIGHT RT_BIT(1)
|
---|
| 388 | /** Middle mouse button pressed. */
|
---|
| 389 | #define VMMDEV_MOUSE_BUTTON_MIDDLE RT_BIT(2)
|
---|
| 390 | /** X1 mouse button pressed. */
|
---|
| 391 | #define VMMDEV_MOUSE_BUTTON_X1 RT_BIT(3)
|
---|
| 392 | /** X2 mouse button pressed. */
|
---|
| 393 | #define VMMDEV_MOUSE_BUTTON_X2 RT_BIT(4)
|
---|
| 394 | /** @} */
|
---|
| 395 |
|
---|
| 396 |
|
---|
| 397 | /**
|
---|
| 398 | * Extended mouse status request structure.
|
---|
| 399 | *
|
---|
| 400 | * Used by VMMDevReq_GetMouseStatusEx.
|
---|
| 401 | */
|
---|
| 402 | typedef struct
|
---|
| 403 | {
|
---|
| 404 | /** Legacy mouse status request structure. */
|
---|
| 405 | VMMDevReqMouseStatus Core;
|
---|
| 406 | /** Mouse wheel vertical mvement. */
|
---|
| 407 | int32_t dz;
|
---|
| 408 | /** Mouse wheel horizontal movement. */
|
---|
| 409 | int32_t dw;
|
---|
| 410 | /** Mouse buttons state. */
|
---|
| 411 | uint32_t fButtons;
|
---|
| 412 | } VMMDevReqMouseStatusEx;
|
---|
| 413 | AssertCompileSize(VMMDevReqMouseStatusEx, 24+24);
|
---|
| 414 |
|
---|
| 415 |
|
---|
[21226] | 416 | /** @name Mouse capability bits (VMMDevReqMouseStatus::mouseFeatures).
|
---|
| 417 | * @{ */
|
---|
| 418 | /** The guest can (== wants to) handle absolute coordinates. */
|
---|
| 419 | #define VMMDEV_MOUSE_GUEST_CAN_ABSOLUTE RT_BIT(0)
|
---|
| 420 | /** The host can (== wants to) send absolute coordinates.
|
---|
| 421 | * (Input not captured.) */
|
---|
[32831] | 422 | #define VMMDEV_MOUSE_HOST_WANTS_ABSOLUTE RT_BIT(1)
|
---|
[21226] | 423 | /** The guest can *NOT* switch to software cursor and therefore depends on the
|
---|
| 424 | * host cursor.
|
---|
| 425 | *
|
---|
| 426 | * When guest additions are installed and the host has promised to display the
|
---|
| 427 | * cursor itself, the guest installs a hardware mouse driver. Don't ask the
|
---|
| 428 | * guest to switch to a software cursor then. */
|
---|
| 429 | #define VMMDEV_MOUSE_GUEST_NEEDS_HOST_CURSOR RT_BIT(2)
|
---|
[46093] | 430 | /** The host does NOT provide support for drawing the cursor itself. */
|
---|
[21226] | 431 | #define VMMDEV_MOUSE_HOST_CANNOT_HWPOINTER RT_BIT(3)
|
---|
| 432 | /** The guest can read VMMDev events to find out about pointer movement */
|
---|
[34754] | 433 | #define VMMDEV_MOUSE_NEW_PROTOCOL RT_BIT(4)
|
---|
[22704] | 434 | /** If the guest changes the status of the
|
---|
| 435 | * VMMDEV_MOUSE_GUEST_NEEDS_HOST_CURSOR bit, the host will honour this */
|
---|
| 436 | #define VMMDEV_MOUSE_HOST_RECHECKS_NEEDS_HOST_CURSOR RT_BIT(5)
|
---|
[27060] | 437 | /** The host supplies an absolute pointing device. The Guest Additions may
|
---|
| 438 | * wish to use this to decide whether to install their own driver */
|
---|
| 439 | #define VMMDEV_MOUSE_HOST_HAS_ABS_DEV RT_BIT(6)
|
---|
[97790] | 440 | /** The guest can read VMMDev events to find out about full mouse state */
|
---|
| 441 | #define VMMDEV_MOUSE_GUEST_USES_FULL_STATE_PROTOCOL RT_BIT(7)
|
---|
| 442 | /** The host can provide full mouse state over VMMDev events */
|
---|
[98542] | 443 | #define VMMDEV_MOUSE_HOST_SUPPORTS_FULL_STATE_PROTOCOL RT_BIT(8)
|
---|
[22096] | 444 | /** The mask of all VMMDEV_MOUSE_* flags */
|
---|
[97790] | 445 | #define VMMDEV_MOUSE_MASK UINT32_C(0x000001ff)
|
---|
[22096] | 446 | /** The mask of guest capability changes for which notification events should
|
---|
| 447 | * be sent */
|
---|
| 448 | #define VMMDEV_MOUSE_NOTIFY_HOST_MASK \
|
---|
| 449 | (VMMDEV_MOUSE_GUEST_CAN_ABSOLUTE | VMMDEV_MOUSE_GUEST_NEEDS_HOST_CURSOR)
|
---|
| 450 | /** The mask of all capabilities which the guest can legitimately change */
|
---|
| 451 | #define VMMDEV_MOUSE_GUEST_MASK \
|
---|
[97790] | 452 | (VMMDEV_MOUSE_NOTIFY_HOST_MASK | VMMDEV_MOUSE_NEW_PROTOCOL | VMMDEV_MOUSE_GUEST_USES_FULL_STATE_PROTOCOL)
|
---|
[28099] | 453 | /** The mask of host capability changes for which notification events should
|
---|
| 454 | * be sent */
|
---|
| 455 | #define VMMDEV_MOUSE_NOTIFY_GUEST_MASK \
|
---|
[32831] | 456 | VMMDEV_MOUSE_HOST_WANTS_ABSOLUTE
|
---|
[28099] | 457 | /** The mask of all capabilities which the host can legitimately change */
|
---|
| 458 | #define VMMDEV_MOUSE_HOST_MASK \
|
---|
| 459 | ( VMMDEV_MOUSE_NOTIFY_GUEST_MASK \
|
---|
| 460 | | VMMDEV_MOUSE_HOST_CANNOT_HWPOINTER \
|
---|
| 461 | | VMMDEV_MOUSE_HOST_RECHECKS_NEEDS_HOST_CURSOR \
|
---|
[97790] | 462 | | VMMDEV_MOUSE_HOST_HAS_ABS_DEV \
|
---|
[98542] | 463 | | VMMDEV_MOUSE_HOST_SUPPORTS_FULL_STATE_PROTOCOL)
|
---|
[21226] | 464 | /** @} */
|
---|
[21223] | 465 |
|
---|
[40310] | 466 | /** @name Absolute mouse reporting range
|
---|
| 467 | * @{ */
|
---|
| 468 | /** @todo Should these be here? They are needed by both host and guest. */
|
---|
| 469 | /** The minumum value our pointing device can return. */
|
---|
| 470 | #define VMMDEV_MOUSE_RANGE_MIN 0
|
---|
| 471 | /** The maximum value our pointing device can return. */
|
---|
| 472 | #define VMMDEV_MOUSE_RANGE_MAX 0xFFFF
|
---|
| 473 | /** The full range our pointing device can return. */
|
---|
| 474 | #define VMMDEV_MOUSE_RANGE (VMMDEV_MOUSE_RANGE_MAX - VMMDEV_MOUSE_RANGE_MIN)
|
---|
| 475 | /** @} */
|
---|
[21223] | 476 |
|
---|
[40310] | 477 |
|
---|
[21226] | 478 | /**
|
---|
| 479 | * Mouse pointer shape/visibility change request.
|
---|
| 480 | *
|
---|
| 481 | * Used by VMMDevReq_SetPointerShape. The size is variable.
|
---|
| 482 | */
|
---|
[21227] | 483 | typedef struct VMMDevReqMousePointer
|
---|
[21223] | 484 | {
|
---|
[21226] | 485 | /** Header. */
|
---|
[21223] | 486 | VMMDevRequestHeader header;
|
---|
[65381] | 487 | /** VBOX_MOUSE_POINTER_* bit flags from VBox/Graphics/VBoxVideo.h. */
|
---|
[21223] | 488 | uint32_t fFlags;
|
---|
[21226] | 489 | /** x coordinate of hot spot. */
|
---|
[21223] | 490 | uint32_t xHot;
|
---|
[21226] | 491 | /** y coordinate of hot spot. */
|
---|
[21223] | 492 | uint32_t yHot;
|
---|
[21226] | 493 | /** Width of the pointer in pixels. */
|
---|
[21223] | 494 | uint32_t width;
|
---|
[21226] | 495 | /** Height of the pointer in scanlines. */
|
---|
[21223] | 496 | uint32_t height;
|
---|
| 497 | /** Pointer data.
|
---|
| 498 | *
|
---|
| 499 | ****
|
---|
| 500 | * The data consists of 1 bpp AND mask followed by 32 bpp XOR (color) mask.
|
---|
| 501 | *
|
---|
| 502 | * For pointers without alpha channel the XOR mask pixels are 32 bit values: (lsb)BGR0(msb).
|
---|
| 503 | * For pointers with alpha channel the XOR mask consists of (lsb)BGRA(msb) 32 bit values.
|
---|
| 504 | *
|
---|
| 505 | * Guest driver must create the AND mask for pointers with alpha channel, so if host does not
|
---|
| 506 | * support alpha, the pointer could be displayed as a normal color pointer. The AND mask can
|
---|
| 507 | * be constructed from alpha values. For example alpha value >= 0xf0 means bit 0 in the AND mask.
|
---|
| 508 | *
|
---|
| 509 | * The AND mask is 1 bpp bitmap with byte aligned scanlines. Size of AND mask,
|
---|
| 510 | * therefore, is cbAnd = (width + 7) / 8 * height. The padding bits at the
|
---|
| 511 | * end of any scanline are undefined.
|
---|
| 512 | *
|
---|
| 513 | * The XOR mask follows the AND mask on the next 4 bytes aligned offset:
|
---|
| 514 | * uint8_t *pXor = pAnd + (cbAnd + 3) & ~3
|
---|
| 515 | * Bytes in the gap between the AND and the XOR mask are undefined.
|
---|
| 516 | * XOR mask scanlines have no gap between them and size of XOR mask is:
|
---|
| 517 | * cXor = width * 4 * height.
|
---|
| 518 | ****
|
---|
| 519 | *
|
---|
[21226] | 520 | * Preallocate 4 bytes for accessing actual data as p->pointerData.
|
---|
[21223] | 521 | */
|
---|
| 522 | char pointerData[4];
|
---|
| 523 | } VMMDevReqMousePointer;
|
---|
[21226] | 524 | AssertCompileSize(VMMDevReqMousePointer, 24+24);
|
---|
[21223] | 525 |
|
---|
[32631] | 526 | /**
|
---|
| 527 | * Get the size that a VMMDevReqMousePointer request should have for a given
|
---|
| 528 | * size of cursor, including the trailing cursor image and mask data.
|
---|
| 529 | * @note an "empty" request still has the four preallocated bytes of data
|
---|
[33676] | 530 | *
|
---|
[32631] | 531 | * @returns the size
|
---|
| 532 | * @param width the cursor width
|
---|
| 533 | * @param height the cursor height
|
---|
| 534 | */
|
---|
| 535 | DECLINLINE(size_t) vmmdevGetMousePointerReqSize(uint32_t width, uint32_t height)
|
---|
| 536 | {
|
---|
[73097] | 537 | size_t cbBase = RT_UOFFSETOF(VMMDevReqMousePointer, pointerData[0]);
|
---|
[32631] | 538 | size_t cbMask = (width + 7) / 8 * height;
|
---|
| 539 | size_t cbArgb = width * height * 4;
|
---|
[85227] | 540 | return RT_MAX(cbBase + ((cbMask + 3) & ~(size_t)3) + cbArgb,
|
---|
[32631] | 541 | sizeof(VMMDevReqMousePointer));
|
---|
| 542 | }
|
---|
| 543 |
|
---|
[21226] | 544 |
|
---|
| 545 | /**
|
---|
| 546 | * String log request structure.
|
---|
| 547 | *
|
---|
| 548 | * Used by VMMDevReq_LogString.
|
---|
| 549 | * @deprecated Use the IPRT logger or VbglR3WriteLog instead.
|
---|
| 550 | */
|
---|
[21223] | 551 | typedef struct
|
---|
| 552 | {
|
---|
| 553 | /** header */
|
---|
| 554 | VMMDevRequestHeader header;
|
---|
| 555 | /** variable length string data */
|
---|
| 556 | char szString[1];
|
---|
| 557 | } VMMDevReqLogString;
|
---|
[21226] | 558 | AssertCompileSize(VMMDevReqLogString, 24+4);
|
---|
[21223] | 559 |
|
---|
[21226] | 560 |
|
---|
| 561 | /**
|
---|
| 562 | * VirtualBox host version request structure.
|
---|
| 563 | *
|
---|
| 564 | * Used by VMMDevReq_GetHostVersion.
|
---|
[21457] | 565 | *
|
---|
| 566 | * @remarks VBGL uses this to detect the precense of new features in the
|
---|
| 567 | * interface.
|
---|
[21226] | 568 | */
|
---|
[21223] | 569 | typedef struct
|
---|
| 570 | {
|
---|
[21226] | 571 | /** Header. */
|
---|
[21223] | 572 | VMMDevRequestHeader header;
|
---|
[21226] | 573 | /** Major version. */
|
---|
[21457] | 574 | uint16_t major;
|
---|
[21226] | 575 | /** Minor version. */
|
---|
[21457] | 576 | uint16_t minor;
|
---|
[21226] | 577 | /** Build number. */
|
---|
[21223] | 578 | uint32_t build;
|
---|
[21457] | 579 | /** SVN revision. */
|
---|
| 580 | uint32_t revision;
|
---|
| 581 | /** Feature mask. */
|
---|
| 582 | uint32_t features;
|
---|
[21223] | 583 | } VMMDevReqHostVersion;
|
---|
[21457] | 584 | AssertCompileSize(VMMDevReqHostVersion, 24+16);
|
---|
[21223] | 585 |
|
---|
[75585] | 586 | /** @name VMMDEV_HVF_XXX - VMMDevReqHostVersion::features
|
---|
[21457] | 587 | * @{ */
|
---|
[21458] | 588 | /** Physical page lists are supported by HGCM. */
|
---|
[76196] | 589 | #define VMMDEV_HVF_HGCM_PHYS_PAGE_LIST RT_BIT_32(0)
|
---|
[75585] | 590 | /** HGCM supports the embedded buffer parameter type. */
|
---|
[76196] | 591 | #define VMMDEV_HVF_HGCM_EMBEDDED_BUFFERS RT_BIT_32(1)
|
---|
| 592 | /** HGCM supports the contiguous page list parameter type. */
|
---|
| 593 | #define VMMDEV_HVF_HGCM_CONTIGUOUS_PAGE_LIST RT_BIT_32(2)
|
---|
[77243] | 594 | /** HGCM supports the no-bounce page list parameter type. */
|
---|
| 595 | #define VMMDEV_HVF_HGCM_NO_BOUNCE_PAGE_LIST RT_BIT_32(3)
|
---|
[75585] | 596 | /** VMMDev supports fast IRQ acknowledgements. */
|
---|
[76196] | 597 | #define VMMDEV_HVF_FAST_IRQ_ACK RT_BIT_32(31)
|
---|
[21457] | 598 | /** @} */
|
---|
[21226] | 599 |
|
---|
[21457] | 600 |
|
---|
[21226] | 601 | /**
|
---|
[33540] | 602 | * Guest capabilities structure.
|
---|
[21226] | 603 | *
|
---|
| 604 | * Used by VMMDevReq_ReportGuestCapabilities.
|
---|
| 605 | */
|
---|
[21223] | 606 | typedef struct
|
---|
| 607 | {
|
---|
[21226] | 608 | /** Header. */
|
---|
[21223] | 609 | VMMDevRequestHeader header;
|
---|
[21226] | 610 | /** Capabilities (VMMDEV_GUEST_*). */
|
---|
| 611 | uint32_t caps;
|
---|
[21223] | 612 | } VMMDevReqGuestCapabilities;
|
---|
[21226] | 613 | AssertCompileSize(VMMDevReqGuestCapabilities, 24+4);
|
---|
[21223] | 614 |
|
---|
[68630] | 615 |
|
---|
[21226] | 616 | /**
|
---|
[33540] | 617 | * Guest capabilities structure, version 2.
|
---|
[21226] | 618 | *
|
---|
| 619 | * Used by VMMDevReq_SetGuestCapabilities.
|
---|
| 620 | */
|
---|
[21223] | 621 | typedef struct
|
---|
| 622 | {
|
---|
[21226] | 623 | /** Header. */
|
---|
[21223] | 624 | VMMDevRequestHeader header;
|
---|
[21226] | 625 | /** Mask of capabilities to be added. */
|
---|
| 626 | uint32_t u32OrMask;
|
---|
| 627 | /** Mask of capabilities to be removed. */
|
---|
| 628 | uint32_t u32NotMask;
|
---|
[21223] | 629 | } VMMDevReqGuestCapabilities2;
|
---|
[21226] | 630 | AssertCompileSize(VMMDevReqGuestCapabilities2, 24+8);
|
---|
[21223] | 631 |
|
---|
[21226] | 632 |
|
---|
| 633 | /**
|
---|
| 634 | * Idle request structure.
|
---|
| 635 | *
|
---|
| 636 | * Used by VMMDevReq_Idle.
|
---|
| 637 | */
|
---|
[21223] | 638 | typedef struct
|
---|
| 639 | {
|
---|
[21226] | 640 | /** Header. */
|
---|
[21223] | 641 | VMMDevRequestHeader header;
|
---|
| 642 | } VMMDevReqIdle;
|
---|
[21226] | 643 | AssertCompileSize(VMMDevReqIdle, 24);
|
---|
[21223] | 644 |
|
---|
[21226] | 645 |
|
---|
| 646 | /**
|
---|
| 647 | * Host time request structure.
|
---|
| 648 | *
|
---|
| 649 | * Used by VMMDevReq_GetHostTime.
|
---|
| 650 | */
|
---|
[21223] | 651 | typedef struct
|
---|
| 652 | {
|
---|
[21226] | 653 | /** Header */
|
---|
[21223] | 654 | VMMDevRequestHeader header;
|
---|
[21226] | 655 | /** OUT: Time in milliseconds since unix epoch. */
|
---|
[21223] | 656 | uint64_t time;
|
---|
| 657 | } VMMDevReqHostTime;
|
---|
[21226] | 658 | AssertCompileSize(VMMDevReqHostTime, 24+8);
|
---|
[21223] | 659 |
|
---|
[21226] | 660 |
|
---|
| 661 | /**
|
---|
| 662 | * Hypervisor info structure.
|
---|
| 663 | *
|
---|
| 664 | * Used by VMMDevReq_GetHypervisorInfo and VMMDevReq_SetHypervisorInfo.
|
---|
| 665 | */
|
---|
[21223] | 666 | typedef struct
|
---|
| 667 | {
|
---|
[21226] | 668 | /** Header. */
|
---|
[21223] | 669 | VMMDevRequestHeader header;
|
---|
[21226] | 670 | /** Guest virtual address of proposed hypervisor start.
|
---|
| 671 | * Not used by VMMDevReq_GetHypervisorInfo.
|
---|
| 672 | * @todo Make this 64-bit compatible? */
|
---|
[21225] | 673 | RTGCPTR32 hypervisorStart;
|
---|
[21226] | 674 | /** Hypervisor size in bytes. */
|
---|
[21223] | 675 | uint32_t hypervisorSize;
|
---|
| 676 | } VMMDevReqHypervisorInfo;
|
---|
[21226] | 677 | AssertCompileSize(VMMDevReqHypervisorInfo, 24+8);
|
---|
[21223] | 678 |
|
---|
[21644] | 679 | /** @name Default patch memory size .
|
---|
[21645] | 680 | * Used by VMMDevReq_RegisterPatchMemory and VMMDevReq_DeregisterPatchMemory.
|
---|
[21644] | 681 | * @{ */
|
---|
| 682 | #define VMMDEV_GUEST_DEFAULT_PATCHMEM_SIZE 8192
|
---|
| 683 | /** @} */
|
---|
[21226] | 684 |
|
---|
| 685 | /**
|
---|
[21644] | 686 | * Patching memory structure. (locked executable & read-only page from the guest's perspective)
|
---|
| 687 | *
|
---|
[21645] | 688 | * Used by VMMDevReq_RegisterPatchMemory and VMMDevReq_DeregisterPatchMemory
|
---|
[21644] | 689 | */
|
---|
| 690 | typedef struct
|
---|
| 691 | {
|
---|
| 692 | /** Header. */
|
---|
| 693 | VMMDevRequestHeader header;
|
---|
| 694 | /** Guest virtual address of the patching page(s). */
|
---|
[21738] | 695 | RTGCPTR64 pPatchMem;
|
---|
[21644] | 696 | /** Patch page size in bytes. */
|
---|
| 697 | uint32_t cbPatchMem;
|
---|
| 698 | } VMMDevReqPatchMemory;
|
---|
| 699 | AssertCompileSize(VMMDevReqPatchMemory, 24+12);
|
---|
| 700 |
|
---|
| 701 |
|
---|
| 702 | /**
|
---|
[21226] | 703 | * Guest power requests.
|
---|
| 704 | *
|
---|
| 705 | * See VMMDevReq_SetPowerStatus and VMMDevPowerStateRequest.
|
---|
| 706 | */
|
---|
[21223] | 707 | typedef enum
|
---|
| 708 | {
|
---|
| 709 | VMMDevPowerState_Invalid = 0,
|
---|
| 710 | VMMDevPowerState_Pause = 1,
|
---|
| 711 | VMMDevPowerState_PowerOff = 2,
|
---|
| 712 | VMMDevPowerState_SaveState = 3,
|
---|
| 713 | VMMDevPowerState_SizeHack = 0x7fffffff
|
---|
| 714 | } VMMDevPowerState;
|
---|
[21226] | 715 | AssertCompileSize(VMMDevPowerState, 4);
|
---|
[21223] | 716 |
|
---|
[21226] | 717 | /**
|
---|
| 718 | * VM power status structure.
|
---|
| 719 | *
|
---|
| 720 | * Used by VMMDevReq_SetPowerStatus.
|
---|
| 721 | */
|
---|
[21223] | 722 | typedef struct
|
---|
| 723 | {
|
---|
[21226] | 724 | /** Header. */
|
---|
[21223] | 725 | VMMDevRequestHeader header;
|
---|
[21226] | 726 | /** Power state request. */
|
---|
[21223] | 727 | VMMDevPowerState powerState;
|
---|
| 728 | } VMMDevPowerStateRequest;
|
---|
[21226] | 729 | AssertCompileSize(VMMDevPowerStateRequest, 24+4);
|
---|
[21223] | 730 |
|
---|
[21226] | 731 |
|
---|
| 732 | /**
|
---|
| 733 | * Pending events structure.
|
---|
| 734 | *
|
---|
| 735 | * Used by VMMDevReq_AcknowledgeEvents.
|
---|
| 736 | */
|
---|
[21223] | 737 | typedef struct
|
---|
| 738 | {
|
---|
[21226] | 739 | /** Header. */
|
---|
[21223] | 740 | VMMDevRequestHeader header;
|
---|
[21226] | 741 | /** OUT: Pending event mask. */
|
---|
[21223] | 742 | uint32_t events;
|
---|
| 743 | } VMMDevEvents;
|
---|
[21226] | 744 | AssertCompileSize(VMMDevEvents, 24+4);
|
---|
[21223] | 745 |
|
---|
[21226] | 746 |
|
---|
| 747 | /**
|
---|
| 748 | * Guest event filter mask control.
|
---|
| 749 | *
|
---|
| 750 | * Used by VMMDevReq_CtlGuestFilterMask.
|
---|
| 751 | */
|
---|
[21223] | 752 | typedef struct
|
---|
| 753 | {
|
---|
[21226] | 754 | /** Header. */
|
---|
[21223] | 755 | VMMDevRequestHeader header;
|
---|
[21226] | 756 | /** Mask of events to be added to the filter. */
|
---|
[21223] | 757 | uint32_t u32OrMask;
|
---|
[21226] | 758 | /** Mask of events to be removed from the filter. */
|
---|
[21223] | 759 | uint32_t u32NotMask;
|
---|
| 760 | } VMMDevCtlGuestFilterMask;
|
---|
[21226] | 761 | AssertCompileSize(VMMDevCtlGuestFilterMask, 24+8);
|
---|
[21223] | 762 |
|
---|
[21226] | 763 |
|
---|
| 764 | /**
|
---|
| 765 | * Guest information structure.
|
---|
| 766 | *
|
---|
| 767 | * Used by VMMDevReportGuestInfo and PDMIVMMDEVCONNECTOR::pfnUpdateGuestVersion.
|
---|
| 768 | */
|
---|
[21223] | 769 | typedef struct VBoxGuestInfo
|
---|
| 770 | {
|
---|
[31241] | 771 | /** The VMMDev interface version expected by additions.
|
---|
| 772 | * *Deprecated*, do not use anymore! Will be removed. */
|
---|
| 773 | uint32_t interfaceVersion;
|
---|
[21226] | 774 | /** Guest OS type. */
|
---|
[21223] | 775 | VBOXOSTYPE osType;
|
---|
| 776 | } VBoxGuestInfo;
|
---|
[21226] | 777 | AssertCompileSize(VBoxGuestInfo, 8);
|
---|
[21223] | 778 |
|
---|
[21226] | 779 | /**
|
---|
| 780 | * Guest information report.
|
---|
| 781 | *
|
---|
| 782 | * Used by VMMDevReq_ReportGuestInfo.
|
---|
| 783 | */
|
---|
[21223] | 784 | typedef struct
|
---|
| 785 | {
|
---|
[21226] | 786 | /** Header. */
|
---|
[21223] | 787 | VMMDevRequestHeader header;
|
---|
| 788 | /** Guest information. */
|
---|
| 789 | VBoxGuestInfo guestInfo;
|
---|
| 790 | } VMMDevReportGuestInfo;
|
---|
[21226] | 791 | AssertCompileSize(VMMDevReportGuestInfo, 24+8);
|
---|
[21223] | 792 |
|
---|
| 793 |
|
---|
[21226] | 794 | /**
|
---|
[28567] | 795 | * Guest information structure, version 2.
|
---|
| 796 | *
|
---|
| 797 | * Used by VMMDevReportGuestInfo2 and PDMIVMMDEVCONNECTOR::pfnUpdateGuestVersion2.
|
---|
| 798 | */
|
---|
| 799 | typedef struct VBoxGuestInfo2
|
---|
| 800 | {
|
---|
| 801 | /** Major version. */
|
---|
| 802 | uint16_t additionsMajor;
|
---|
| 803 | /** Minor version. */
|
---|
| 804 | uint16_t additionsMinor;
|
---|
| 805 | /** Build number. */
|
---|
| 806 | uint32_t additionsBuild;
|
---|
| 807 | /** SVN revision. */
|
---|
| 808 | uint32_t additionsRevision;
|
---|
[70873] | 809 | /** Feature mask, VBOXGSTINFO2_F_XXX. */
|
---|
[28567] | 810 | uint32_t additionsFeatures;
|
---|
[39825] | 811 | /** The intentional meaning of this field was:
|
---|
| 812 | * Some additional information, for example 'Beta 1' or something like that.
|
---|
| 813 | *
|
---|
| 814 | * The way it was implemented was implemented: VBOX_VERSION_STRING.
|
---|
| 815 | *
|
---|
| 816 | * This means the first three members are duplicated in this field (if the guest
|
---|
| 817 | * build config is sane). So, the user must check this and chop it off before
|
---|
| 818 | * usage. There is, because of the Main code's blind trust in the field's
|
---|
| 819 | * content, no way back. */
|
---|
[29043] | 820 | char szName[128];
|
---|
[28567] | 821 | } VBoxGuestInfo2;
|
---|
[31241] | 822 | AssertCompileSize(VBoxGuestInfo2, 144);
|
---|
[28567] | 823 |
|
---|
[70873] | 824 | /** @name VBOXGSTINFO2_F_XXX - Features
|
---|
| 825 | * @{ */
|
---|
| 826 | /** Request header carries requestor information. */
|
---|
| 827 | #define VBOXGSTINFO2_F_REQUESTOR_INFO RT_BIT_32(0)
|
---|
| 828 | /** @} */
|
---|
| 829 |
|
---|
| 830 |
|
---|
[28567] | 831 | /**
|
---|
| 832 | * Guest information report, version 2.
|
---|
| 833 | *
|
---|
| 834 | * Used by VMMDevReq_ReportGuestInfo2.
|
---|
| 835 | */
|
---|
| 836 | typedef struct
|
---|
| 837 | {
|
---|
| 838 | /** Header. */
|
---|
| 839 | VMMDevRequestHeader header;
|
---|
| 840 | /** Guest information. */
|
---|
| 841 | VBoxGuestInfo2 guestInfo;
|
---|
| 842 | } VMMDevReportGuestInfo2;
|
---|
[29043] | 843 | AssertCompileSize(VMMDevReportGuestInfo2, 24+144);
|
---|
[28567] | 844 |
|
---|
| 845 |
|
---|
| 846 | /**
|
---|
[68630] | 847 | * The facility class.
|
---|
[58163] | 848 | *
|
---|
[35967] | 849 | * This needs to be kept in sync with AdditionsFacilityClass of the Main API!
|
---|
| 850 | */
|
---|
| 851 | typedef enum
|
---|
| 852 | {
|
---|
| 853 | VBoxGuestFacilityClass_None = 0,
|
---|
| 854 | VBoxGuestFacilityClass_Driver = 10,
|
---|
| 855 | VBoxGuestFacilityClass_Service = 30,
|
---|
| 856 | VBoxGuestFacilityClass_Program = 50,
|
---|
| 857 | VBoxGuestFacilityClass_Feature = 100,
|
---|
| 858 | VBoxGuestFacilityClass_ThirdParty = 999,
|
---|
[35968] | 859 | VBoxGuestFacilityClass_All = 0x7ffffffe,
|
---|
[35967] | 860 | VBoxGuestFacilityClass_SizeHack = 0x7fffffff
|
---|
| 861 | } VBoxGuestFacilityClass;
|
---|
| 862 | AssertCompileSize(VBoxGuestFacilityClass, 4);
|
---|
| 863 |
|
---|
| 864 | /**
|
---|
[30758] | 865 | * Guest status structure.
|
---|
| 866 | *
|
---|
| 867 | * Used by VMMDevReqGuestStatus.
|
---|
| 868 | */
|
---|
| 869 | typedef struct VBoxGuestStatus
|
---|
| 870 | {
|
---|
[30964] | 871 | /** Facility the status is indicated for. */
|
---|
[35907] | 872 | VBoxGuestFacilityType facility;
|
---|
[30964] | 873 | /** Current guest status. */
|
---|
[35907] | 874 | VBoxGuestFacilityStatus status;
|
---|
[30964] | 875 | /** Flags, not used at the moment. */
|
---|
[30758] | 876 | uint32_t flags;
|
---|
| 877 | } VBoxGuestStatus;
|
---|
| 878 | AssertCompileSize(VBoxGuestStatus, 12);
|
---|
| 879 |
|
---|
| 880 | /**
|
---|
| 881 | * Guest Additions status structure.
|
---|
| 882 | *
|
---|
| 883 | * Used by VMMDevReq_ReportGuestStatus.
|
---|
| 884 | */
|
---|
| 885 | typedef struct
|
---|
| 886 | {
|
---|
| 887 | /** Header. */
|
---|
| 888 | VMMDevRequestHeader header;
|
---|
| 889 | /** Guest information. */
|
---|
| 890 | VBoxGuestStatus guestStatus;
|
---|
| 891 | } VMMDevReportGuestStatus;
|
---|
| 892 | AssertCompileSize(VMMDevReportGuestStatus, 24+12);
|
---|
| 893 |
|
---|
| 894 |
|
---|
| 895 | /**
|
---|
[47294] | 896 | * Guest user status updates.
|
---|
| 897 | */
|
---|
| 898 | typedef struct VBoxGuestUserStatus
|
---|
| 899 | {
|
---|
| 900 | /** The guest user state to send. */
|
---|
| 901 | VBoxGuestUserState state;
|
---|
| 902 | /** Size (in bytes) of szUser. */
|
---|
| 903 | uint32_t cbUser;
|
---|
| 904 | /** Size (in bytes) of szDomain. */
|
---|
| 905 | uint32_t cbDomain;
|
---|
| 906 | /** Size (in bytes) of aDetails. */
|
---|
| 907 | uint32_t cbDetails;
|
---|
| 908 | /** Note: Here begins the dynamically
|
---|
| 909 | * allocated region. */
|
---|
| 910 | /** Guest user to report state for. */
|
---|
| 911 | char szUser[1];
|
---|
| 912 | /** Domain the guest user is bound to. */
|
---|
| 913 | char szDomain[1];
|
---|
| 914 | /** Optional details of the state. */
|
---|
| 915 | uint8_t aDetails[1];
|
---|
| 916 | } VBoxGuestUserStatus;
|
---|
| 917 | AssertCompileSize(VBoxGuestUserStatus, 20);
|
---|
| 918 |
|
---|
| 919 |
|
---|
| 920 | /**
|
---|
| 921 | * Guest user status structure.
|
---|
| 922 | *
|
---|
| 923 | * Used by VMMDevReq_ReportGuestUserStatus.
|
---|
| 924 | */
|
---|
| 925 | typedef struct
|
---|
| 926 | {
|
---|
| 927 | /** Header. */
|
---|
| 928 | VMMDevRequestHeader header;
|
---|
| 929 | /** Guest user status. */
|
---|
| 930 | VBoxGuestUserStatus status;
|
---|
| 931 | } VMMDevReportGuestUserState;
|
---|
| 932 | AssertCompileSize(VMMDevReportGuestUserState, 24+20);
|
---|
| 933 |
|
---|
| 934 |
|
---|
| 935 | /**
|
---|
[21226] | 936 | * Guest statistics structure.
|
---|
| 937 | *
|
---|
| 938 | * Used by VMMDevReportGuestStats and PDMIVMMDEVCONNECTOR::pfnReportStatistics.
|
---|
| 939 | */
|
---|
[21223] | 940 | typedef struct VBoxGuestStatistics
|
---|
| 941 | {
|
---|
[21226] | 942 | /** Virtual CPU ID. */
|
---|
[21223] | 943 | uint32_t u32CpuId;
|
---|
[21226] | 944 | /** Reported statistics. */
|
---|
[21223] | 945 | uint32_t u32StatCaps;
|
---|
[21226] | 946 | /** Idle CPU load (0-100) for last interval. */
|
---|
[21223] | 947 | uint32_t u32CpuLoad_Idle;
|
---|
[21226] | 948 | /** Kernel CPU load (0-100) for last interval. */
|
---|
[21223] | 949 | uint32_t u32CpuLoad_Kernel;
|
---|
[21226] | 950 | /** User CPU load (0-100) for last interval. */
|
---|
[21223] | 951 | uint32_t u32CpuLoad_User;
|
---|
[21226] | 952 | /** Nr of threads. */
|
---|
[21223] | 953 | uint32_t u32Threads;
|
---|
[21226] | 954 | /** Nr of processes. */
|
---|
[21223] | 955 | uint32_t u32Processes;
|
---|
[21226] | 956 | /** Nr of handles. */
|
---|
[21223] | 957 | uint32_t u32Handles;
|
---|
[21226] | 958 | /** Memory load (0-100). */
|
---|
[21223] | 959 | uint32_t u32MemoryLoad;
|
---|
[21226] | 960 | /** Page size of guest system. */
|
---|
[21223] | 961 | uint32_t u32PageSize;
|
---|
[21226] | 962 | /** Total physical memory (in 4KB pages). */
|
---|
[21223] | 963 | uint32_t u32PhysMemTotal;
|
---|
[21226] | 964 | /** Available physical memory (in 4KB pages). */
|
---|
[21223] | 965 | uint32_t u32PhysMemAvail;
|
---|
[21226] | 966 | /** Ballooned physical memory (in 4KB pages). */
|
---|
[21223] | 967 | uint32_t u32PhysMemBalloon;
|
---|
[21226] | 968 | /** Total number of committed memory (which is not necessarily in-use) (in 4KB pages). */
|
---|
[21223] | 969 | uint32_t u32MemCommitTotal;
|
---|
[21226] | 970 | /** Total amount of memory used by the kernel (in 4KB pages). */
|
---|
[21223] | 971 | uint32_t u32MemKernelTotal;
|
---|
[21226] | 972 | /** Total amount of paged memory used by the kernel (in 4KB pages). */
|
---|
[21223] | 973 | uint32_t u32MemKernelPaged;
|
---|
[21226] | 974 | /** Total amount of nonpaged memory used by the kernel (in 4KB pages). */
|
---|
[21223] | 975 | uint32_t u32MemKernelNonPaged;
|
---|
[21226] | 976 | /** Total amount of memory used for the system cache (in 4KB pages). */
|
---|
[21223] | 977 | uint32_t u32MemSystemCache;
|
---|
[21226] | 978 | /** Pagefile size (in 4KB pages). */
|
---|
[21223] | 979 | uint32_t u32PageFileSize;
|
---|
| 980 | } VBoxGuestStatistics;
|
---|
[21226] | 981 | AssertCompileSize(VBoxGuestStatistics, 19*4);
|
---|
[21223] | 982 |
|
---|
[21226] | 983 | /** @name Guest statistics values (VBoxGuestStatistics::u32StatCaps).
|
---|
| 984 | * @{ */
|
---|
| 985 | #define VBOX_GUEST_STAT_CPU_LOAD_IDLE RT_BIT(0)
|
---|
| 986 | #define VBOX_GUEST_STAT_CPU_LOAD_KERNEL RT_BIT(1)
|
---|
| 987 | #define VBOX_GUEST_STAT_CPU_LOAD_USER RT_BIT(2)
|
---|
| 988 | #define VBOX_GUEST_STAT_THREADS RT_BIT(3)
|
---|
| 989 | #define VBOX_GUEST_STAT_PROCESSES RT_BIT(4)
|
---|
| 990 | #define VBOX_GUEST_STAT_HANDLES RT_BIT(5)
|
---|
| 991 | #define VBOX_GUEST_STAT_MEMORY_LOAD RT_BIT(6)
|
---|
| 992 | #define VBOX_GUEST_STAT_PHYS_MEM_TOTAL RT_BIT(7)
|
---|
| 993 | #define VBOX_GUEST_STAT_PHYS_MEM_AVAIL RT_BIT(8)
|
---|
| 994 | #define VBOX_GUEST_STAT_PHYS_MEM_BALLOON RT_BIT(9)
|
---|
| 995 | #define VBOX_GUEST_STAT_MEM_COMMIT_TOTAL RT_BIT(10)
|
---|
| 996 | #define VBOX_GUEST_STAT_MEM_KERNEL_TOTAL RT_BIT(11)
|
---|
| 997 | #define VBOX_GUEST_STAT_MEM_KERNEL_PAGED RT_BIT(12)
|
---|
| 998 | #define VBOX_GUEST_STAT_MEM_KERNEL_NONPAGED RT_BIT(13)
|
---|
| 999 | #define VBOX_GUEST_STAT_MEM_SYSTEM_CACHE RT_BIT(14)
|
---|
| 1000 | #define VBOX_GUEST_STAT_PAGE_FILE_SIZE RT_BIT(15)
|
---|
| 1001 | /** @} */
|
---|
| 1002 |
|
---|
| 1003 | /**
|
---|
| 1004 | * Guest statistics command structure.
|
---|
| 1005 | *
|
---|
| 1006 | * Used by VMMDevReq_ReportGuestStats.
|
---|
| 1007 | */
|
---|
[21223] | 1008 | typedef struct
|
---|
| 1009 | {
|
---|
[21226] | 1010 | /** Header. */
|
---|
[21223] | 1011 | VMMDevRequestHeader header;
|
---|
| 1012 | /** Guest information. */
|
---|
| 1013 | VBoxGuestStatistics guestStats;
|
---|
| 1014 | } VMMDevReportGuestStats;
|
---|
[21226] | 1015 | AssertCompileSize(VMMDevReportGuestStats, 24+19*4);
|
---|
[21223] | 1016 |
|
---|
| 1017 |
|
---|
[21226] | 1018 | /** Memory balloon change request structure. */
|
---|
| 1019 | #define VMMDEV_MAX_MEMORY_BALLOON(PhysMemTotal) ( (9 * (PhysMemTotal)) / 10 )
|
---|
| 1020 |
|
---|
| 1021 | /**
|
---|
| 1022 | * Poll for ballooning change request.
|
---|
| 1023 | *
|
---|
| 1024 | * Used by VMMDevReq_GetMemBalloonChangeRequest.
|
---|
| 1025 | */
|
---|
[21223] | 1026 | typedef struct
|
---|
| 1027 | {
|
---|
[21226] | 1028 | /** Header. */
|
---|
[21223] | 1029 | VMMDevRequestHeader header;
|
---|
[21226] | 1030 | /** Balloon size in megabytes. */
|
---|
[27023] | 1031 | uint32_t cBalloonChunks;
|
---|
[21226] | 1032 | /** Guest ram size in megabytes. */
|
---|
[27023] | 1033 | uint32_t cPhysMemChunks;
|
---|
[21226] | 1034 | /** Setting this to VMMDEV_EVENT_BALLOON_CHANGE_REQUEST indicates that the
|
---|
| 1035 | * request is a response to that event.
|
---|
| 1036 | * (Don't confuse this with VMMDevReq_AcknowledgeEvents.) */
|
---|
[21223] | 1037 | uint32_t eventAck;
|
---|
| 1038 | } VMMDevGetMemBalloonChangeRequest;
|
---|
[21226] | 1039 | AssertCompileSize(VMMDevGetMemBalloonChangeRequest, 24+12);
|
---|
[21223] | 1040 |
|
---|
| 1041 |
|
---|
[21226] | 1042 | /**
|
---|
| 1043 | * Change the size of the balloon.
|
---|
| 1044 | *
|
---|
| 1045 | * Used by VMMDevReq_ChangeMemBalloon.
|
---|
| 1046 | */
|
---|
[21223] | 1047 | typedef struct
|
---|
| 1048 | {
|
---|
[21226] | 1049 | /** Header. */
|
---|
[21223] | 1050 | VMMDevRequestHeader header;
|
---|
[21226] | 1051 | /** The number of pages in the array. */
|
---|
[21223] | 1052 | uint32_t cPages;
|
---|
[21226] | 1053 | /** true = inflate, false = deflate. */
|
---|
| 1054 | uint32_t fInflate;
|
---|
[21223] | 1055 | /** Physical address (RTGCPHYS) of each page, variable size. */
|
---|
| 1056 | RTGCPHYS aPhysPage[1];
|
---|
| 1057 | } VMMDevChangeMemBalloon;
|
---|
[21226] | 1058 | AssertCompileSize(VMMDevChangeMemBalloon, 24+16);
|
---|
[21223] | 1059 |
|
---|
[21226] | 1060 |
|
---|
| 1061 | /**
|
---|
| 1062 | * Guest statistics interval change request structure.
|
---|
| 1063 | *
|
---|
| 1064 | * Used by VMMDevReq_GetStatisticsChangeRequest.
|
---|
| 1065 | */
|
---|
[21223] | 1066 | typedef struct
|
---|
| 1067 | {
|
---|
[21226] | 1068 | /** Header. */
|
---|
[21223] | 1069 | VMMDevRequestHeader header;
|
---|
[21226] | 1070 | /** The interval in seconds. */
|
---|
| 1071 | uint32_t u32StatInterval;
|
---|
| 1072 | /** Setting this to VMMDEV_EVENT_STATISTICS_INTERVAL_CHANGE_REQUEST indicates
|
---|
| 1073 | * that the request is a response to that event.
|
---|
| 1074 | * (Don't confuse this with VMMDevReq_AcknowledgeEvents.) */
|
---|
[21223] | 1075 | uint32_t eventAck;
|
---|
| 1076 | } VMMDevGetStatisticsChangeRequest;
|
---|
[21226] | 1077 | AssertCompileSize(VMMDevGetStatisticsChangeRequest, 24+8);
|
---|
[21223] | 1078 |
|
---|
[21226] | 1079 |
|
---|
[30852] | 1080 | /** The size of a string field in the credentials request (including '\\0').
|
---|
[21226] | 1081 | * @see VMMDevCredentials */
|
---|
[30852] | 1082 | #define VMMDEV_CREDENTIALS_SZ_SIZE 128
|
---|
[21226] | 1083 |
|
---|
| 1084 | /**
|
---|
| 1085 | * Credentials request structure.
|
---|
| 1086 | *
|
---|
| 1087 | * Used by VMMDevReq_QueryCredentials.
|
---|
| 1088 | */
|
---|
[21223] | 1089 | typedef struct
|
---|
| 1090 | {
|
---|
[21226] | 1091 | /** Header. */
|
---|
[21223] | 1092 | VMMDevRequestHeader header;
|
---|
[21226] | 1093 | /** IN/OUT: Request flags. */
|
---|
| 1094 | uint32_t u32Flags;
|
---|
| 1095 | /** OUT: User name (UTF-8). */
|
---|
[30852] | 1096 | char szUserName[VMMDEV_CREDENTIALS_SZ_SIZE];
|
---|
[21226] | 1097 | /** OUT: Password (UTF-8). */
|
---|
[30852] | 1098 | char szPassword[VMMDEV_CREDENTIALS_SZ_SIZE];
|
---|
[21226] | 1099 | /** OUT: Domain name (UTF-8). */
|
---|
[30852] | 1100 | char szDomain[VMMDEV_CREDENTIALS_SZ_SIZE];
|
---|
[21226] | 1101 | } VMMDevCredentials;
|
---|
| 1102 | AssertCompileSize(VMMDevCredentials, 24+4+3*128);
|
---|
| 1103 |
|
---|
| 1104 | /** @name Credentials request flag (VMMDevCredentials::u32Flags)
|
---|
| 1105 | * @{ */
|
---|
| 1106 | /** query from host whether credentials are present */
|
---|
| 1107 | #define VMMDEV_CREDENTIALS_QUERYPRESENCE RT_BIT(1)
|
---|
| 1108 | /** read credentials from host (can be combined with clear) */
|
---|
| 1109 | #define VMMDEV_CREDENTIALS_READ RT_BIT(2)
|
---|
| 1110 | /** clear credentials on host (can be combined with read) */
|
---|
| 1111 | #define VMMDEV_CREDENTIALS_CLEAR RT_BIT(3)
|
---|
| 1112 | /** read credentials for judgement in the guest */
|
---|
| 1113 | #define VMMDEV_CREDENTIALS_READJUDGE RT_BIT(8)
|
---|
| 1114 | /** clear credentials for judegement on the host */
|
---|
| 1115 | #define VMMDEV_CREDENTIALS_CLEARJUDGE RT_BIT(9)
|
---|
| 1116 | /** report credentials acceptance by guest */
|
---|
| 1117 | #define VMMDEV_CREDENTIALS_JUDGE_OK RT_BIT(10)
|
---|
| 1118 | /** report credentials denial by guest */
|
---|
| 1119 | #define VMMDEV_CREDENTIALS_JUDGE_DENY RT_BIT(11)
|
---|
| 1120 | /** report that no judgement could be made by guest */
|
---|
| 1121 | #define VMMDEV_CREDENTIALS_JUDGE_NOJUDGEMENT RT_BIT(12)
|
---|
| 1122 |
|
---|
| 1123 | /** flag telling the guest that credentials are present */
|
---|
| 1124 | #define VMMDEV_CREDENTIALS_PRESENT RT_BIT(16)
|
---|
| 1125 | /** flag telling guest that local logons should be prohibited */
|
---|
| 1126 | #define VMMDEV_CREDENTIALS_NOLOCALLOGON RT_BIT(17)
|
---|
| 1127 | /** @} */
|
---|
| 1128 |
|
---|
| 1129 |
|
---|
| 1130 | /**
|
---|
| 1131 | * Seamless mode change request structure.
|
---|
| 1132 | *
|
---|
| 1133 | * Used by VMMDevReq_GetSeamlessChangeRequest.
|
---|
| 1134 | */
|
---|
| 1135 | typedef struct
|
---|
| 1136 | {
|
---|
| 1137 | /** Header. */
|
---|
| 1138 | VMMDevRequestHeader header;
|
---|
| 1139 |
|
---|
| 1140 | /** New seamless mode. */
|
---|
| 1141 | VMMDevSeamlessMode mode;
|
---|
| 1142 | /** Setting this to VMMDEV_EVENT_SEAMLESS_MODE_CHANGE_REQUEST indicates
|
---|
| 1143 | * that the request is a response to that event.
|
---|
| 1144 | * (Don't confuse this with VMMDevReq_AcknowledgeEvents.) */
|
---|
| 1145 | uint32_t eventAck;
|
---|
| 1146 | } VMMDevSeamlessChangeRequest;
|
---|
| 1147 | AssertCompileSize(VMMDevSeamlessChangeRequest, 24+8);
|
---|
| 1148 | AssertCompileMemberOffset(VMMDevSeamlessChangeRequest, eventAck, 24+4);
|
---|
| 1149 |
|
---|
| 1150 |
|
---|
| 1151 | /**
|
---|
| 1152 | * Display change request structure.
|
---|
| 1153 | *
|
---|
| 1154 | * Used by VMMDevReq_GetDisplayChangeRequest.
|
---|
| 1155 | */
|
---|
| 1156 | typedef struct
|
---|
| 1157 | {
|
---|
| 1158 | /** Header. */
|
---|
| 1159 | VMMDevRequestHeader header;
|
---|
| 1160 | /** Horizontal pixel resolution (0 = do not change). */
|
---|
[21223] | 1161 | uint32_t xres;
|
---|
[21226] | 1162 | /** Vertical pixel resolution (0 = do not change). */
|
---|
[21223] | 1163 | uint32_t yres;
|
---|
[21226] | 1164 | /** Bits per pixel (0 = do not change). */
|
---|
[21223] | 1165 | uint32_t bpp;
|
---|
[21226] | 1166 | /** Setting this to VMMDEV_EVENT_DISPLAY_CHANGE_REQUEST indicates
|
---|
| 1167 | * that the request is a response to that event.
|
---|
| 1168 | * (Don't confuse this with VMMDevReq_AcknowledgeEvents.) */
|
---|
[21223] | 1169 | uint32_t eventAck;
|
---|
| 1170 | } VMMDevDisplayChangeRequest;
|
---|
[21226] | 1171 | AssertCompileSize(VMMDevDisplayChangeRequest, 24+16);
|
---|
[21223] | 1172 |
|
---|
[21226] | 1173 |
|
---|
| 1174 | /**
|
---|
| 1175 | * Display change request structure, version 2.
|
---|
| 1176 | *
|
---|
| 1177 | * Used by VMMDevReq_GetDisplayChangeRequest2.
|
---|
| 1178 | */
|
---|
[21223] | 1179 | typedef struct
|
---|
| 1180 | {
|
---|
[21226] | 1181 | /** Header. */
|
---|
[21223] | 1182 | VMMDevRequestHeader header;
|
---|
[21226] | 1183 | /** Horizontal pixel resolution (0 = do not change). */
|
---|
[21223] | 1184 | uint32_t xres;
|
---|
[21226] | 1185 | /** Vertical pixel resolution (0 = do not change). */
|
---|
[21223] | 1186 | uint32_t yres;
|
---|
[21226] | 1187 | /** Bits per pixel (0 = do not change). */
|
---|
[21223] | 1188 | uint32_t bpp;
|
---|
[21226] | 1189 | /** Setting this to VMMDEV_EVENT_DISPLAY_CHANGE_REQUEST indicates
|
---|
| 1190 | * that the request is a response to that event.
|
---|
| 1191 | * (Don't confuse this with VMMDevReq_AcknowledgeEvents.) */
|
---|
[21223] | 1192 | uint32_t eventAck;
|
---|
| 1193 | /** 0 for primary display, 1 for the first secondary, etc. */
|
---|
| 1194 | uint32_t display;
|
---|
| 1195 | } VMMDevDisplayChangeRequest2;
|
---|
[21226] | 1196 | AssertCompileSize(VMMDevDisplayChangeRequest2, 24+20);
|
---|
[21223] | 1197 |
|
---|
[21226] | 1198 |
|
---|
| 1199 | /**
|
---|
[44130] | 1200 | * Display change request structure, version Extended.
|
---|
| 1201 | *
|
---|
| 1202 | * Used by VMMDevReq_GetDisplayChangeRequestEx.
|
---|
| 1203 | */
|
---|
| 1204 | typedef struct
|
---|
| 1205 | {
|
---|
| 1206 | /** Header. */
|
---|
| 1207 | VMMDevRequestHeader header;
|
---|
| 1208 | /** Horizontal pixel resolution (0 = do not change). */
|
---|
| 1209 | uint32_t xres;
|
---|
| 1210 | /** Vertical pixel resolution (0 = do not change). */
|
---|
| 1211 | uint32_t yres;
|
---|
| 1212 | /** Bits per pixel (0 = do not change). */
|
---|
| 1213 | uint32_t bpp;
|
---|
| 1214 | /** Setting this to VMMDEV_EVENT_DISPLAY_CHANGE_REQUEST indicates
|
---|
| 1215 | * that the request is a response to that event.
|
---|
| 1216 | * (Don't confuse this with VMMDevReq_AcknowledgeEvents.) */
|
---|
| 1217 | uint32_t eventAck;
|
---|
| 1218 | /** 0 for primary display, 1 for the first secondary, etc. */
|
---|
| 1219 | uint32_t display;
|
---|
| 1220 | /** New OriginX of secondary virtual screen */
|
---|
| 1221 | uint32_t cxOrigin;
|
---|
| 1222 | /** New OriginY of secondary virtual screen */
|
---|
| 1223 | uint32_t cyOrigin;
|
---|
| 1224 | /** Change in origin of the secondary virtaul scree is
|
---|
| 1225 | * required */
|
---|
| 1226 | bool fChangeOrigin;
|
---|
| 1227 | /** secondary virtual screen enabled or disabled */
|
---|
| 1228 | bool fEnabled;
|
---|
| 1229 | } VMMDevDisplayChangeRequestEx;
|
---|
| 1230 | AssertCompileSize(VMMDevDisplayChangeRequestEx, 24+32);
|
---|
| 1231 |
|
---|
| 1232 |
|
---|
[72352] | 1233 | /** Flags for VMMDevDisplayDef::fDisplayFlags */
|
---|
| 1234 | #define VMMDEV_DISPLAY_PRIMARY UINT32_C(0x00000001) /**< Primary display. */
|
---|
| 1235 | #define VMMDEV_DISPLAY_DISABLED UINT32_C(0x00000002) /**< Display is disabled. */
|
---|
| 1236 | #define VMMDEV_DISPLAY_ORIGIN UINT32_C(0x00000004) /**< Change position of the diplay. */
|
---|
| 1237 | #define VMMDEV_DISPLAY_CX UINT32_C(0x00000008) /**< Change the horizontal resolution of the display. */
|
---|
| 1238 | #define VMMDEV_DISPLAY_CY UINT32_C(0x00000010) /**< Change the vertical resolution of the display. */
|
---|
| 1239 | #define VMMDEV_DISPLAY_BPP UINT32_C(0x00000020) /**< Change the color depth of the display. */
|
---|
| 1240 |
|
---|
| 1241 | /** Definition of one monitor. Used by VMMDevReq_GetDisplayChangeRequestMulti. */
|
---|
| 1242 | typedef struct VMMDevDisplayDef
|
---|
| 1243 | {
|
---|
| 1244 | uint32_t fDisplayFlags; /**< VMMDEV_DISPLAY_* flags. */
|
---|
| 1245 | uint32_t idDisplay; /**< The display number. */
|
---|
| 1246 | int32_t xOrigin; /**< New OriginX of the guest screen. */
|
---|
| 1247 | int32_t yOrigin; /**< New OriginY of the guest screen. */
|
---|
| 1248 | uint32_t cx; /**< Horizontal pixel resolution. */
|
---|
| 1249 | uint32_t cy; /**< Vertical pixel resolution. */
|
---|
| 1250 | uint32_t cBitsPerPixel; /**< Bits per pixel. */
|
---|
| 1251 | } VMMDevDisplayDef;
|
---|
| 1252 | AssertCompileSize(VMMDevDisplayDef, 28);
|
---|
| 1253 |
|
---|
| 1254 | /** Multimonitor display change request structure. Used by VMMDevReq_GetDisplayChangeRequestMulti. */
|
---|
| 1255 | typedef struct VMMDevDisplayChangeRequestMulti
|
---|
| 1256 | {
|
---|
| 1257 | VMMDevRequestHeader header; /**< Header. */
|
---|
| 1258 | uint32_t eventAck; /**< Setting this to VMMDEV_EVENT_DISPLAY_CHANGE_REQUEST indicates
|
---|
| 1259 | * that the request is a response to that event.
|
---|
| 1260 | * (Don't confuse this with VMMDevReq_AcknowledgeEvents.) */
|
---|
| 1261 | uint32_t cDisplays; /**< Number of monitors. In: how many the guest expects.
|
---|
| 1262 | * Out: how many the host provided. */
|
---|
| 1263 | VMMDevDisplayDef aDisplays[1]; /**< Layout of monitors. */
|
---|
| 1264 | } VMMDevDisplayChangeRequestMulti;
|
---|
| 1265 | AssertCompileSize(VMMDevDisplayChangeRequestMulti, 24+8+28);
|
---|
| 1266 |
|
---|
| 1267 |
|
---|
[44130] | 1268 | /**
|
---|
[21226] | 1269 | * Video mode supported request structure.
|
---|
| 1270 | *
|
---|
| 1271 | * Used by VMMDevReq_VideoModeSupported.
|
---|
| 1272 | */
|
---|
[21223] | 1273 | typedef struct
|
---|
| 1274 | {
|
---|
[21226] | 1275 | /** Header. */
|
---|
[21223] | 1276 | VMMDevRequestHeader header;
|
---|
[21226] | 1277 | /** IN: Horizontal pixel resolution. */
|
---|
[21223] | 1278 | uint32_t width;
|
---|
[21226] | 1279 | /** IN: Vertical pixel resolution. */
|
---|
[21223] | 1280 | uint32_t height;
|
---|
[21226] | 1281 | /** IN: Bits per pixel. */
|
---|
[21223] | 1282 | uint32_t bpp;
|
---|
[21226] | 1283 | /** OUT: Support indicator. */
|
---|
[21223] | 1284 | bool fSupported;
|
---|
| 1285 | } VMMDevVideoModeSupportedRequest;
|
---|
[21226] | 1286 | AssertCompileSize(VMMDevVideoModeSupportedRequest, 24+16);
|
---|
[21223] | 1287 |
|
---|
[28264] | 1288 | /**
|
---|
| 1289 | * Video mode supported request structure for a specific display.
|
---|
| 1290 | *
|
---|
| 1291 | * Used by VMMDevReq_VideoModeSupported2.
|
---|
| 1292 | */
|
---|
| 1293 | typedef struct
|
---|
| 1294 | {
|
---|
| 1295 | /** Header. */
|
---|
| 1296 | VMMDevRequestHeader header;
|
---|
| 1297 | /** IN: The guest display number. */
|
---|
| 1298 | uint32_t display;
|
---|
| 1299 | /** IN: Horizontal pixel resolution. */
|
---|
| 1300 | uint32_t width;
|
---|
| 1301 | /** IN: Vertical pixel resolution. */
|
---|
| 1302 | uint32_t height;
|
---|
| 1303 | /** IN: Bits per pixel. */
|
---|
| 1304 | uint32_t bpp;
|
---|
| 1305 | /** OUT: Support indicator. */
|
---|
| 1306 | bool fSupported;
|
---|
| 1307 | } VMMDevVideoModeSupportedRequest2;
|
---|
| 1308 | AssertCompileSize(VMMDevVideoModeSupportedRequest2, 24+20);
|
---|
[21226] | 1309 |
|
---|
| 1310 | /**
|
---|
| 1311 | * Video modes height reduction request structure.
|
---|
| 1312 | *
|
---|
| 1313 | * Used by VMMDevReq_GetHeightReduction.
|
---|
| 1314 | */
|
---|
[21223] | 1315 | typedef struct
|
---|
| 1316 | {
|
---|
[21226] | 1317 | /** Header. */
|
---|
[21223] | 1318 | VMMDevRequestHeader header;
|
---|
[21226] | 1319 | /** OUT: Height reduction in pixels. */
|
---|
[21223] | 1320 | uint32_t heightReduction;
|
---|
| 1321 | } VMMDevGetHeightReductionRequest;
|
---|
[21226] | 1322 | AssertCompileSize(VMMDevGetHeightReductionRequest, 24+4);
|
---|
[21223] | 1323 |
|
---|
| 1324 |
|
---|
[21226] | 1325 | /**
|
---|
| 1326 | * VRDP change request structure.
|
---|
| 1327 | *
|
---|
| 1328 | * Used by VMMDevReq_GetVRDPChangeRequest.
|
---|
| 1329 | */
|
---|
[21223] | 1330 | typedef struct
|
---|
| 1331 | {
|
---|
[21226] | 1332 | /** Header */
|
---|
[21223] | 1333 | VMMDevRequestHeader header;
|
---|
[21226] | 1334 | /** Whether VRDP is active or not. */
|
---|
[21223] | 1335 | uint8_t u8VRDPActive;
|
---|
| 1336 | /** The configured experience level for active VRDP. */
|
---|
| 1337 | uint32_t u32VRDPExperienceLevel;
|
---|
| 1338 | } VMMDevVRDPChangeRequest;
|
---|
[21226] | 1339 | AssertCompileSize(VMMDevVRDPChangeRequest, 24+8);
|
---|
| 1340 | AssertCompileMemberOffset(VMMDevVRDPChangeRequest, u8VRDPActive, 24);
|
---|
| 1341 | AssertCompileMemberOffset(VMMDevVRDPChangeRequest, u32VRDPExperienceLevel, 24+4);
|
---|
[21223] | 1342 |
|
---|
[21226] | 1343 | /** @name VRDP Experience level (VMMDevVRDPChangeRequest::u32VRDPExperienceLevel)
|
---|
| 1344 | * @{ */
|
---|
| 1345 | #define VRDP_EXPERIENCE_LEVEL_ZERO 0 /**< Theming disabled. */
|
---|
| 1346 | #define VRDP_EXPERIENCE_LEVEL_LOW 1 /**< Full window dragging and desktop wallpaper disabled. */
|
---|
| 1347 | #define VRDP_EXPERIENCE_LEVEL_MEDIUM 2 /**< Font smoothing, gradients. */
|
---|
| 1348 | #define VRDP_EXPERIENCE_LEVEL_HIGH 3 /**< Animation effects disabled. */
|
---|
| 1349 | #define VRDP_EXPERIENCE_LEVEL_FULL 4 /**< Everything enabled. */
|
---|
| 1350 | /** @} */
|
---|
[21223] | 1351 |
|
---|
| 1352 |
|
---|
[21226] | 1353 | /**
|
---|
| 1354 | * VBVA enable request structure.
|
---|
| 1355 | *
|
---|
| 1356 | * Used by VMMDevReq_VideoAccelEnable.
|
---|
| 1357 | */
|
---|
| 1358 | typedef struct
|
---|
| 1359 | {
|
---|
| 1360 | /** Header. */
|
---|
| 1361 | VMMDevRequestHeader header;
|
---|
| 1362 | /** 0 - disable, !0 - enable. */
|
---|
| 1363 | uint32_t u32Enable;
|
---|
| 1364 | /** The size of VBVAMEMORY::au8RingBuffer expected by driver.
|
---|
| 1365 | * The host will refuse to enable VBVA if the size is not equal to
|
---|
| 1366 | * VBVA_RING_BUFFER_SIZE.
|
---|
| 1367 | */
|
---|
| 1368 | uint32_t cbRingBuffer;
|
---|
| 1369 | /** Guest initializes the status to 0. Host sets appropriate VBVA_F_STATUS_ flags. */
|
---|
| 1370 | uint32_t fu32Status;
|
---|
| 1371 | } VMMDevVideoAccelEnable;
|
---|
| 1372 | AssertCompileSize(VMMDevVideoAccelEnable, 24+12);
|
---|
| 1373 |
|
---|
| 1374 | /** @name VMMDevVideoAccelEnable::fu32Status.
|
---|
| 1375 | * @{ */
|
---|
| 1376 | #define VBVA_F_STATUS_ACCEPTED (0x01)
|
---|
| 1377 | #define VBVA_F_STATUS_ENABLED (0x02)
|
---|
| 1378 | /** @} */
|
---|
| 1379 |
|
---|
| 1380 |
|
---|
| 1381 | /**
|
---|
| 1382 | * VBVA flush request structure.
|
---|
| 1383 | *
|
---|
| 1384 | * Used by VMMDevReq_VideoAccelFlush.
|
---|
| 1385 | */
|
---|
| 1386 | typedef struct
|
---|
| 1387 | {
|
---|
| 1388 | /** Header. */
|
---|
| 1389 | VMMDevRequestHeader header;
|
---|
| 1390 | } VMMDevVideoAccelFlush;
|
---|
| 1391 | AssertCompileSize(VMMDevVideoAccelFlush, 24);
|
---|
| 1392 |
|
---|
| 1393 |
|
---|
| 1394 | /**
|
---|
| 1395 | * VBVA set visible region request structure.
|
---|
| 1396 | *
|
---|
| 1397 | * Used by VMMDevReq_VideoSetVisibleRegion.
|
---|
| 1398 | */
|
---|
| 1399 | typedef struct
|
---|
| 1400 | {
|
---|
| 1401 | /** Header. */
|
---|
| 1402 | VMMDevRequestHeader header;
|
---|
| 1403 | /** Number of rectangles */
|
---|
| 1404 | uint32_t cRect;
|
---|
| 1405 | /** Rectangle array.
|
---|
| 1406 | * @todo array is spelled aRects[1]. */
|
---|
| 1407 | RTRECT Rect;
|
---|
| 1408 | } VMMDevVideoSetVisibleRegion;
|
---|
| 1409 | AssertCompileSize(RTRECT, 16);
|
---|
| 1410 | AssertCompileSize(VMMDevVideoSetVisibleRegion, 24+4+16);
|
---|
| 1411 |
|
---|
[25848] | 1412 | /**
|
---|
[83142] | 1413 | * VBVA monitor positions update request structure.
|
---|
| 1414 | *
|
---|
| 1415 | * Used by VMMDevReq_VideoUpdateMonitorPositions.
|
---|
| 1416 | */
|
---|
| 1417 | typedef struct
|
---|
| 1418 | {
|
---|
| 1419 | /** Header. */
|
---|
| 1420 | VMMDevRequestHeader header;
|
---|
| 1421 | /** Number of monitor positions (monitors) */
|
---|
| 1422 | uint32_t cPositions;
|
---|
| 1423 | /** Positions array.*/
|
---|
| 1424 | RTPOINT aPositions[1];
|
---|
| 1425 | } VMMDevVideoUpdateMonitorPositions;
|
---|
| 1426 | AssertCompileSize(RTPOINT, 8);
|
---|
| 1427 | AssertCompileSize(VMMDevVideoUpdateMonitorPositions, 24+4+8);
|
---|
| 1428 |
|
---|
| 1429 | /**
|
---|
[25848] | 1430 | * CPU event types.
|
---|
| 1431 | */
|
---|
| 1432 | typedef enum
|
---|
| 1433 | {
|
---|
| 1434 | VMMDevCpuStatusType_Invalid = 0,
|
---|
| 1435 | VMMDevCpuStatusType_Disable = 1,
|
---|
| 1436 | VMMDevCpuStatusType_Enable = 2,
|
---|
| 1437 | VMMDevCpuStatusType_SizeHack = 0x7fffffff
|
---|
| 1438 | } VMMDevCpuStatusType;
|
---|
| 1439 |
|
---|
| 1440 | /**
|
---|
| 1441 | * CPU hotplug event status request.
|
---|
| 1442 | */
|
---|
| 1443 | typedef struct
|
---|
| 1444 | {
|
---|
| 1445 | /** Header. */
|
---|
| 1446 | VMMDevRequestHeader header;
|
---|
| 1447 | /** Status type */
|
---|
| 1448 | VMMDevCpuStatusType enmStatusType;
|
---|
| 1449 | } VMMDevCpuHotPlugStatusRequest;
|
---|
| 1450 | AssertCompileSize(VMMDevCpuHotPlugStatusRequest, 24+4);
|
---|
| 1451 |
|
---|
| 1452 | /**
|
---|
| 1453 | * Get the ID of the changed CPU and event type.
|
---|
| 1454 | */
|
---|
| 1455 | typedef struct
|
---|
| 1456 | {
|
---|
| 1457 | /** Header. */
|
---|
| 1458 | VMMDevRequestHeader header;
|
---|
| 1459 | /** Event type */
|
---|
| 1460 | VMMDevCpuEventType enmEventType;
|
---|
| 1461 | /** core id of the CPU changed */
|
---|
| 1462 | uint32_t idCpuCore;
|
---|
| 1463 | /** package id of the CPU changed */
|
---|
| 1464 | uint32_t idCpuPackage;
|
---|
| 1465 | } VMMDevGetCpuHotPlugRequest;
|
---|
| 1466 | AssertCompileSize(VMMDevGetCpuHotPlugRequest, 24+4+4+4);
|
---|
| 1467 |
|
---|
[28404] | 1468 |
|
---|
[76393] | 1469 | AssertCompileSize(VMMDEVSHAREDREGIONDESC, 16); /* structure was promoted to VBox/types.h. */
|
---|
[28404] | 1470 |
|
---|
[28415] | 1471 | #define VMMDEVSHAREDREGIONDESC_MAX 32
|
---|
| 1472 |
|
---|
[28404] | 1473 | /**
|
---|
| 1474 | * Shared module registration
|
---|
| 1475 | */
|
---|
[28434] | 1476 | typedef struct
|
---|
[28404] | 1477 | {
|
---|
| 1478 | /** Header. */
|
---|
| 1479 | VMMDevRequestHeader header;
|
---|
| 1480 | /** Shared module size. */
|
---|
| 1481 | uint32_t cbModule;
|
---|
| 1482 | /** Number of included region descriptors */
|
---|
| 1483 | uint32_t cRegions;
|
---|
| 1484 | /** Base address of the shared module. */
|
---|
[28408] | 1485 | RTGCPTR64 GCBaseAddr;
|
---|
[29307] | 1486 | /** Guest OS type. */
|
---|
| 1487 | VBOXOSFAMILY enmGuestOS;
|
---|
| 1488 | /** Alignment. */
|
---|
| 1489 | uint32_t u32Align;
|
---|
[28404] | 1490 | /** Module name */
|
---|
| 1491 | char szName[128];
|
---|
| 1492 | /** Module version */
|
---|
| 1493 | char szVersion[16];
|
---|
| 1494 | /** Shared region descriptor(s). */
|
---|
[28415] | 1495 | VMMDEVSHAREDREGIONDESC aRegions[1];
|
---|
[28404] | 1496 | } VMMDevSharedModuleRegistrationRequest;
|
---|
[29307] | 1497 | AssertCompileSize(VMMDevSharedModuleRegistrationRequest, 24+4+4+8+4+4+128+16+16);
|
---|
[28404] | 1498 |
|
---|
| 1499 |
|
---|
| 1500 | /**
|
---|
| 1501 | * Shared module unregistration
|
---|
| 1502 | */
|
---|
[28434] | 1503 | typedef struct
|
---|
[28404] | 1504 | {
|
---|
| 1505 | /** Header. */
|
---|
| 1506 | VMMDevRequestHeader header;
|
---|
| 1507 | /** Shared module size. */
|
---|
| 1508 | uint32_t cbModule;
|
---|
| 1509 | /** Align at 8 byte boundary. */
|
---|
| 1510 | uint32_t u32Alignment;
|
---|
| 1511 | /** Base address of the shared module. */
|
---|
[28408] | 1512 | RTGCPTR64 GCBaseAddr;
|
---|
[28404] | 1513 | /** Module name */
|
---|
| 1514 | char szName[128];
|
---|
| 1515 | /** Module version */
|
---|
| 1516 | char szVersion[16];
|
---|
| 1517 | } VMMDevSharedModuleUnregistrationRequest;
|
---|
| 1518 | AssertCompileSize(VMMDevSharedModuleUnregistrationRequest, 24+4+4+8+128+16);
|
---|
| 1519 |
|
---|
| 1520 |
|
---|
| 1521 | /**
|
---|
| 1522 | * Shared module periodic check
|
---|
| 1523 | */
|
---|
| 1524 | typedef struct
|
---|
| 1525 | {
|
---|
| 1526 | /** Header. */
|
---|
| 1527 | VMMDevRequestHeader header;
|
---|
| 1528 | } VMMDevSharedModuleCheckRequest;
|
---|
| 1529 | AssertCompileSize(VMMDevSharedModuleCheckRequest, 24);
|
---|
| 1530 |
|
---|
[29307] | 1531 | /**
|
---|
| 1532 | * Paging sharing enabled query
|
---|
| 1533 | */
|
---|
| 1534 | typedef struct
|
---|
| 1535 | {
|
---|
| 1536 | /** Header. */
|
---|
| 1537 | VMMDevRequestHeader header;
|
---|
| 1538 | /** Enabled flag (out) */
|
---|
| 1539 | bool fEnabled;
|
---|
| 1540 | /** Alignment */
|
---|
| 1541 | bool fAlignment[3];
|
---|
| 1542 | } VMMDevPageSharingStatusRequest;
|
---|
| 1543 | AssertCompileSize(VMMDevPageSharingStatusRequest, 24+4);
|
---|
| 1544 |
|
---|
[30040] | 1545 |
|
---|
| 1546 | /**
|
---|
| 1547 | * Page sharing status query (debug build only)
|
---|
| 1548 | */
|
---|
| 1549 | typedef struct
|
---|
| 1550 | {
|
---|
| 1551 | /** Header. */
|
---|
| 1552 | VMMDevRequestHeader header;
|
---|
| 1553 | /** Page address. */
|
---|
| 1554 | RTGCPTR GCPtrPage;
|
---|
[30061] | 1555 | /** Page flags. */
|
---|
| 1556 | uint64_t uPageFlags;
|
---|
[30040] | 1557 | /** Shared flag (out) */
|
---|
| 1558 | bool fShared;
|
---|
| 1559 | /** Alignment */
|
---|
[30061] | 1560 | bool fAlignment[3];
|
---|
[30040] | 1561 | } VMMDevPageIsSharedRequest;
|
---|
| 1562 |
|
---|
[30668] | 1563 | /**
|
---|
| 1564 | * Session id request structure.
|
---|
| 1565 | *
|
---|
| 1566 | * Used by VMMDevReq_GetSessionId.
|
---|
| 1567 | */
|
---|
| 1568 | typedef struct
|
---|
| 1569 | {
|
---|
| 1570 | /** Header */
|
---|
[68574] | 1571 | VMMDevRequestHeader header;
|
---|
[30668] | 1572 | /** OUT: unique session id; the id will be different after each start, reset or restore of the VM */
|
---|
[68574] | 1573 | uint64_t idSession;
|
---|
[30668] | 1574 | } VMMDevReqSessionId;
|
---|
| 1575 | AssertCompileSize(VMMDevReqSessionId, 24+8);
|
---|
| 1576 |
|
---|
[32313] | 1577 |
|
---|
| 1578 | /**
|
---|
| 1579 | * Write Core Dump request.
|
---|
| 1580 | *
|
---|
| 1581 | * Used by VMMDevReq_WriteCoreDump.
|
---|
| 1582 | */
|
---|
| 1583 | typedef struct
|
---|
| 1584 | {
|
---|
| 1585 | /** Header. */
|
---|
[68574] | 1586 | VMMDevRequestHeader header;
|
---|
[32313] | 1587 | /** Flags (reserved, MBZ). */
|
---|
[68574] | 1588 | uint32_t fFlags;
|
---|
[32313] | 1589 | } VMMDevReqWriteCoreDump;
|
---|
| 1590 | AssertCompileSize(VMMDevReqWriteCoreDump, 24+4);
|
---|
| 1591 |
|
---|
[73351] | 1592 |
|
---|
| 1593 | /**
|
---|
| 1594 | * Heart beat check state structure.
|
---|
| 1595 | * Used by VMMDevReq_HeartbeatConfigure.
|
---|
| 1596 | */
|
---|
[52789] | 1597 | typedef struct
|
---|
| 1598 | {
|
---|
| 1599 | /** Header. */
|
---|
[68574] | 1600 | VMMDevRequestHeader header;
|
---|
[52789] | 1601 | /** OUT: Guest heartbeat interval in nanosec. */
|
---|
[68574] | 1602 | uint64_t cNsInterval;
|
---|
[52789] | 1603 | /** Heartbeat check flag. */
|
---|
[68574] | 1604 | bool fEnabled;
|
---|
[52789] | 1605 | } VMMDevReqHeartbeat;
|
---|
| 1606 | AssertCompileSize(VMMDevReqHeartbeat, 24+12);
|
---|
[32313] | 1607 |
|
---|
[21223] | 1608 |
|
---|
[73351] | 1609 | /**
|
---|
| 1610 | * NT bug check report.
|
---|
| 1611 | * Used by VMMDevReq_NtBugCheck.
|
---|
| 1612 | * @remarks Can be issued with just the header if no more data is available.
|
---|
| 1613 | */
|
---|
| 1614 | typedef struct
|
---|
| 1615 | {
|
---|
| 1616 | /** Header. */
|
---|
| 1617 | VMMDevRequestHeader header;
|
---|
| 1618 | /** The bug check number (P0). */
|
---|
| 1619 | uint64_t uBugCheck;
|
---|
| 1620 | /** The four bug check parameters. */
|
---|
| 1621 | uint64_t auParameters[4];
|
---|
| 1622 | } VMMDevReqNtBugCheck;
|
---|
| 1623 | AssertCompileSize(VMMDevReqNtBugCheck, 24+40);
|
---|
[52789] | 1624 |
|
---|
[73351] | 1625 |
|
---|
| 1626 |
|
---|
[21223] | 1627 | #ifdef VBOX_WITH_HGCM
|
---|
| 1628 |
|
---|
[21226] | 1629 | /** @name HGCM flags.
|
---|
| 1630 | * @{
|
---|
[21223] | 1631 | */
|
---|
[21506] | 1632 | # define VBOX_HGCM_REQ_DONE RT_BIT_32(VBOX_HGCM_REQ_DONE_BIT)
|
---|
| 1633 | # define VBOX_HGCM_REQ_DONE_BIT 0
|
---|
[21226] | 1634 | # define VBOX_HGCM_REQ_CANCELLED (0x2)
|
---|
[21219] | 1635 | /** @} */
|
---|
[21223] | 1636 |
|
---|
[21226] | 1637 | /**
|
---|
| 1638 | * HGCM request header.
|
---|
| 1639 | */
|
---|
| 1640 | typedef struct VMMDevHGCMRequestHeader
|
---|
[21223] | 1641 | {
|
---|
| 1642 | /** Request header. */
|
---|
| 1643 | VMMDevRequestHeader header;
|
---|
| 1644 |
|
---|
| 1645 | /** HGCM flags. */
|
---|
| 1646 | uint32_t fu32Flags;
|
---|
| 1647 |
|
---|
| 1648 | /** Result code. */
|
---|
| 1649 | int32_t result;
|
---|
| 1650 | } VMMDevHGCMRequestHeader;
|
---|
| 1651 | AssertCompileSize(VMMDevHGCMRequestHeader, 24+8);
|
---|
| 1652 |
|
---|
[21226] | 1653 | /**
|
---|
| 1654 | * HGCM connect request structure.
|
---|
| 1655 | *
|
---|
| 1656 | * Used by VMMDevReq_HGCMConnect.
|
---|
| 1657 | */
|
---|
[21223] | 1658 | typedef struct
|
---|
| 1659 | {
|
---|
[21226] | 1660 | /** HGCM request header. */
|
---|
[21223] | 1661 | VMMDevHGCMRequestHeader header;
|
---|
| 1662 |
|
---|
| 1663 | /** IN: Description of service to connect to. */
|
---|
| 1664 | HGCMServiceLocation loc;
|
---|
| 1665 |
|
---|
| 1666 | /** OUT: Client identifier assigned by local instance of HGCM. */
|
---|
| 1667 | uint32_t u32ClientID;
|
---|
| 1668 | } VMMDevHGCMConnect;
|
---|
[21226] | 1669 | AssertCompileSize(VMMDevHGCMConnect, 32+132+4);
|
---|
[21223] | 1670 |
|
---|
[21226] | 1671 |
|
---|
| 1672 | /**
|
---|
| 1673 | * HGCM disconnect request structure.
|
---|
| 1674 | *
|
---|
| 1675 | * Used by VMMDevReq_HGCMDisconnect.
|
---|
| 1676 | */
|
---|
[21223] | 1677 | typedef struct
|
---|
| 1678 | {
|
---|
[21226] | 1679 | /** HGCM request header. */
|
---|
[21223] | 1680 | VMMDevHGCMRequestHeader header;
|
---|
| 1681 |
|
---|
| 1682 | /** IN: Client identifier. */
|
---|
| 1683 | uint32_t u32ClientID;
|
---|
| 1684 | } VMMDevHGCMDisconnect;
|
---|
[21226] | 1685 | AssertCompileSize(VMMDevHGCMDisconnect, 32+4);
|
---|
[21223] | 1686 |
|
---|
[21226] | 1687 | /**
|
---|
| 1688 | * HGCM call request structure.
|
---|
| 1689 | *
|
---|
[77056] | 1690 | * Used by VMMDevReq_HGCMCall32 and VMMDevReq_HGCMCall64.
|
---|
[21226] | 1691 | */
|
---|
[21223] | 1692 | typedef struct
|
---|
| 1693 | {
|
---|
| 1694 | /* request header */
|
---|
| 1695 | VMMDevHGCMRequestHeader header;
|
---|
| 1696 |
|
---|
| 1697 | /** IN: Client identifier. */
|
---|
| 1698 | uint32_t u32ClientID;
|
---|
| 1699 | /** IN: Service function number. */
|
---|
| 1700 | uint32_t u32Function;
|
---|
| 1701 | /** IN: Number of parameters. */
|
---|
| 1702 | uint32_t cParms;
|
---|
| 1703 | /** Parameters follow in form: HGCMFunctionParameter aParms[X]; */
|
---|
| 1704 | } VMMDevHGCMCall;
|
---|
[21226] | 1705 | AssertCompileSize(VMMDevHGCMCall, 32+12);
|
---|
[21223] | 1706 |
|
---|
[21456] | 1707 | /** @name Direction of data transfer (HGCMPageListInfo::flags). Bit flags.
|
---|
| 1708 | * @{ */
|
---|
| 1709 | #define VBOX_HGCM_F_PARM_DIRECTION_NONE UINT32_C(0x00000000)
|
---|
| 1710 | #define VBOX_HGCM_F_PARM_DIRECTION_TO_HOST UINT32_C(0x00000001)
|
---|
| 1711 | #define VBOX_HGCM_F_PARM_DIRECTION_FROM_HOST UINT32_C(0x00000002)
|
---|
| 1712 | #define VBOX_HGCM_F_PARM_DIRECTION_BOTH UINT32_C(0x00000003)
|
---|
[77243] | 1713 | #define VBOX_HGCM_F_PARM_DIRECTION_MASK UINT32_C(0x00000003)
|
---|
[21488] | 1714 | /** Macro for validating that the specified flags are valid. */
|
---|
| 1715 | #define VBOX_HGCM_F_PARM_ARE_VALID(fFlags) \
|
---|
[77243] | 1716 | ( ((fFlags) & VBOX_HGCM_F_PARM_DIRECTION_MASK) \
|
---|
| 1717 | && !((fFlags) & ~VBOX_HGCM_F_PARM_DIRECTION_MASK) )
|
---|
[21456] | 1718 | /** @} */
|
---|
| 1719 |
|
---|
| 1720 | /**
|
---|
| 1721 | * VMMDevHGCMParmType_PageList points to this structure to actually describe the
|
---|
| 1722 | * buffer.
|
---|
| 1723 | */
|
---|
[21463] | 1724 | typedef struct
|
---|
[21456] | 1725 | {
|
---|
[21463] | 1726 | uint32_t flags; /**< VBOX_HGCM_F_PARM_*. */
|
---|
| 1727 | uint16_t offFirstPage; /**< Offset in the first page where data begins. */
|
---|
| 1728 | uint16_t cPages; /**< Number of pages. */
|
---|
[33540] | 1729 | RTGCPHYS64 aPages[1]; /**< Page addresses. */
|
---|
[21456] | 1730 | } HGCMPageListInfo;
|
---|
| 1731 | AssertCompileSize(HGCMPageListInfo, 4+2+2+8);
|
---|
| 1732 |
|
---|
[21223] | 1733 |
|
---|
[21226] | 1734 | /** Get the pointer to the first parmater of a HGCM call request. */
|
---|
| 1735 | # define VMMDEV_HGCM_CALL_PARMS(a) ((HGCMFunctionParameter *)((uint8_t *)(a) + sizeof (VMMDevHGCMCall)))
|
---|
| 1736 | /** Get the pointer to the first parmater of a 32-bit HGCM call request. */
|
---|
| 1737 | # define VMMDEV_HGCM_CALL_PARMS32(a) ((HGCMFunctionParameter32 *)((uint8_t *)(a) + sizeof (VMMDevHGCMCall)))
|
---|
| 1738 |
|
---|
| 1739 | # ifdef VBOX_WITH_64_BITS_GUESTS
|
---|
[21223] | 1740 | /* Explicit defines for the host code. */
|
---|
[21226] | 1741 | # ifdef VBOX_HGCM_HOST_CODE
|
---|
| 1742 | # define VMMDEV_HGCM_CALL_PARMS32(a) ((HGCMFunctionParameter32 *)((uint8_t *)(a) + sizeof (VMMDevHGCMCall)))
|
---|
| 1743 | # define VMMDEV_HGCM_CALL_PARMS64(a) ((HGCMFunctionParameter64 *)((uint8_t *)(a) + sizeof (VMMDevHGCMCall)))
|
---|
| 1744 | # endif /* VBOX_HGCM_HOST_CODE */
|
---|
| 1745 | # endif /* VBOX_WITH_64_BITS_GUESTS */
|
---|
[21223] | 1746 |
|
---|
[21226] | 1747 | # define VBOX_HGCM_MAX_PARMS 32
|
---|
[21223] | 1748 |
|
---|
[21226] | 1749 | /**
|
---|
| 1750 | * HGCM cancel request structure.
|
---|
| 1751 | *
|
---|
| 1752 | * The Cancel request is issued using the same physical memory address as was
|
---|
| 1753 | * used for the corresponding initial HGCMCall.
|
---|
| 1754 | *
|
---|
| 1755 | * Used by VMMDevReq_HGCMCancel.
|
---|
[21223] | 1756 | */
|
---|
| 1757 | typedef struct
|
---|
| 1758 | {
|
---|
[21226] | 1759 | /** Header. */
|
---|
[21223] | 1760 | VMMDevHGCMRequestHeader header;
|
---|
| 1761 | } VMMDevHGCMCancel;
|
---|
[21226] | 1762 | AssertCompileSize(VMMDevHGCMCancel, 32);
|
---|
[21223] | 1763 |
|
---|
[21506] | 1764 | /**
|
---|
| 1765 | * HGCM cancel request structure, version 2.
|
---|
| 1766 | *
|
---|
| 1767 | * Used by VMMDevReq_HGCMCancel2.
|
---|
| 1768 | *
|
---|
| 1769 | * VINF_SUCCESS when cancelled.
|
---|
| 1770 | * VERR_NOT_FOUND if the specified request cannot be found.
|
---|
| 1771 | * VERR_INVALID_PARAMETER if the address is invalid valid.
|
---|
| 1772 | */
|
---|
| 1773 | typedef struct
|
---|
| 1774 | {
|
---|
| 1775 | /** Header. */
|
---|
| 1776 | VMMDevRequestHeader header;
|
---|
| 1777 | /** The physical address of the request to cancel. */
|
---|
| 1778 | RTGCPHYS32 physReqToCancel;
|
---|
| 1779 | } VMMDevHGCMCancel2;
|
---|
| 1780 | AssertCompileSize(VMMDevHGCMCancel2, 24+4);
|
---|
| 1781 |
|
---|
[21223] | 1782 | #endif /* VBOX_WITH_HGCM */
|
---|
| 1783 |
|
---|
| 1784 |
|
---|
| 1785 | /**
|
---|
| 1786 | * Inline helper to determine the request size for the given operation.
|
---|
[47294] | 1787 | * Returns 0 if the given operation is not handled and/or supported.
|
---|
[21223] | 1788 | *
|
---|
| 1789 | * @returns Size.
|
---|
| 1790 | * @param requestType The VMMDev request type.
|
---|
| 1791 | */
|
---|
| 1792 | DECLINLINE(size_t) vmmdevGetRequestSize(VMMDevRequestType requestType)
|
---|
| 1793 | {
|
---|
| 1794 | switch (requestType)
|
---|
| 1795 | {
|
---|
| 1796 | case VMMDevReq_GetMouseStatus:
|
---|
| 1797 | case VMMDevReq_SetMouseStatus:
|
---|
| 1798 | return sizeof(VMMDevReqMouseStatus);
|
---|
[97790] | 1799 | case VMMDevReq_GetMouseStatusEx:
|
---|
| 1800 | return sizeof(VMMDevReqMouseStatusEx);
|
---|
[21223] | 1801 | case VMMDevReq_SetPointerShape:
|
---|
| 1802 | return sizeof(VMMDevReqMousePointer);
|
---|
| 1803 | case VMMDevReq_GetHostVersion:
|
---|
| 1804 | return sizeof(VMMDevReqHostVersion);
|
---|
| 1805 | case VMMDevReq_Idle:
|
---|
| 1806 | return sizeof(VMMDevReqIdle);
|
---|
| 1807 | case VMMDevReq_GetHostTime:
|
---|
| 1808 | return sizeof(VMMDevReqHostTime);
|
---|
| 1809 | case VMMDevReq_GetHypervisorInfo:
|
---|
| 1810 | case VMMDevReq_SetHypervisorInfo:
|
---|
| 1811 | return sizeof(VMMDevReqHypervisorInfo);
|
---|
[21645] | 1812 | case VMMDevReq_RegisterPatchMemory:
|
---|
| 1813 | case VMMDevReq_DeregisterPatchMemory:
|
---|
[21644] | 1814 | return sizeof(VMMDevReqPatchMemory);
|
---|
[21223] | 1815 | case VMMDevReq_SetPowerStatus:
|
---|
| 1816 | return sizeof(VMMDevPowerStateRequest);
|
---|
| 1817 | case VMMDevReq_AcknowledgeEvents:
|
---|
| 1818 | return sizeof(VMMDevEvents);
|
---|
| 1819 | case VMMDevReq_ReportGuestInfo:
|
---|
| 1820 | return sizeof(VMMDevReportGuestInfo);
|
---|
[29043] | 1821 | case VMMDevReq_ReportGuestInfo2:
|
---|
| 1822 | return sizeof(VMMDevReportGuestInfo2);
|
---|
[30758] | 1823 | case VMMDevReq_ReportGuestStatus:
|
---|
| 1824 | return sizeof(VMMDevReportGuestStatus);
|
---|
[47294] | 1825 | case VMMDevReq_ReportGuestUserState:
|
---|
| 1826 | return sizeof(VMMDevReportGuestUserState);
|
---|
[21223] | 1827 | case VMMDevReq_GetDisplayChangeRequest:
|
---|
| 1828 | return sizeof(VMMDevDisplayChangeRequest);
|
---|
| 1829 | case VMMDevReq_GetDisplayChangeRequest2:
|
---|
| 1830 | return sizeof(VMMDevDisplayChangeRequest2);
|
---|
[44130] | 1831 | case VMMDevReq_GetDisplayChangeRequestEx:
|
---|
| 1832 | return sizeof(VMMDevDisplayChangeRequestEx);
|
---|
[72352] | 1833 | case VMMDevReq_GetDisplayChangeRequestMulti:
|
---|
[75131] | 1834 | return RT_UOFFSETOF(VMMDevDisplayChangeRequestMulti, aDisplays[0]);
|
---|
[21223] | 1835 | case VMMDevReq_VideoModeSupported:
|
---|
| 1836 | return sizeof(VMMDevVideoModeSupportedRequest);
|
---|
| 1837 | case VMMDevReq_GetHeightReduction:
|
---|
| 1838 | return sizeof(VMMDevGetHeightReductionRequest);
|
---|
| 1839 | case VMMDevReq_ReportGuestCapabilities:
|
---|
| 1840 | return sizeof(VMMDevReqGuestCapabilities);
|
---|
| 1841 | case VMMDevReq_SetGuestCapabilities:
|
---|
| 1842 | return sizeof(VMMDevReqGuestCapabilities2);
|
---|
| 1843 | #ifdef VBOX_WITH_HGCM
|
---|
| 1844 | case VMMDevReq_HGCMConnect:
|
---|
| 1845 | return sizeof(VMMDevHGCMConnect);
|
---|
| 1846 | case VMMDevReq_HGCMDisconnect:
|
---|
| 1847 | return sizeof(VMMDevHGCMDisconnect);
|
---|
| 1848 | case VMMDevReq_HGCMCall32:
|
---|
| 1849 | return sizeof(VMMDevHGCMCall);
|
---|
[77056] | 1850 | # ifdef VBOX_WITH_64_BITS_GUESTS
|
---|
[21223] | 1851 | case VMMDevReq_HGCMCall64:
|
---|
| 1852 | return sizeof(VMMDevHGCMCall);
|
---|
[77056] | 1853 | # endif
|
---|
[21223] | 1854 | case VMMDevReq_HGCMCancel:
|
---|
| 1855 | return sizeof(VMMDevHGCMCancel);
|
---|
| 1856 | #endif /* VBOX_WITH_HGCM */
|
---|
| 1857 | case VMMDevReq_VideoAccelEnable:
|
---|
| 1858 | return sizeof(VMMDevVideoAccelEnable);
|
---|
| 1859 | case VMMDevReq_VideoAccelFlush:
|
---|
| 1860 | return sizeof(VMMDevVideoAccelFlush);
|
---|
| 1861 | case VMMDevReq_VideoSetVisibleRegion:
|
---|
[37174] | 1862 | /* The original protocol didn't consider a guest with NO visible
|
---|
| 1863 | * windows */
|
---|
| 1864 | return sizeof(VMMDevVideoSetVisibleRegion) - sizeof(RTRECT);
|
---|
[21223] | 1865 | case VMMDevReq_GetSeamlessChangeRequest:
|
---|
| 1866 | return sizeof(VMMDevSeamlessChangeRequest);
|
---|
| 1867 | case VMMDevReq_QueryCredentials:
|
---|
| 1868 | return sizeof(VMMDevCredentials);
|
---|
| 1869 | case VMMDevReq_ReportGuestStats:
|
---|
| 1870 | return sizeof(VMMDevReportGuestStats);
|
---|
| 1871 | case VMMDevReq_GetMemBalloonChangeRequest:
|
---|
| 1872 | return sizeof(VMMDevGetMemBalloonChangeRequest);
|
---|
| 1873 | case VMMDevReq_GetStatisticsChangeRequest:
|
---|
| 1874 | return sizeof(VMMDevGetStatisticsChangeRequest);
|
---|
| 1875 | case VMMDevReq_ChangeMemBalloon:
|
---|
| 1876 | return sizeof(VMMDevChangeMemBalloon);
|
---|
| 1877 | case VMMDevReq_GetVRDPChangeRequest:
|
---|
| 1878 | return sizeof(VMMDevVRDPChangeRequest);
|
---|
| 1879 | case VMMDevReq_LogString:
|
---|
| 1880 | return sizeof(VMMDevReqLogString);
|
---|
[21226] | 1881 | case VMMDevReq_CtlGuestFilterMask:
|
---|
| 1882 | return sizeof(VMMDevCtlGuestFilterMask);
|
---|
[25848] | 1883 | case VMMDevReq_GetCpuHotPlugRequest:
|
---|
| 1884 | return sizeof(VMMDevGetCpuHotPlugRequest);
|
---|
| 1885 | case VMMDevReq_SetCpuHotPlugStatus:
|
---|
| 1886 | return sizeof(VMMDevCpuHotPlugStatusRequest);
|
---|
[28404] | 1887 | case VMMDevReq_RegisterSharedModule:
|
---|
| 1888 | return sizeof(VMMDevSharedModuleRegistrationRequest);
|
---|
| 1889 | case VMMDevReq_UnregisterSharedModule:
|
---|
| 1890 | return sizeof(VMMDevSharedModuleUnregistrationRequest);
|
---|
| 1891 | case VMMDevReq_CheckSharedModules:
|
---|
| 1892 | return sizeof(VMMDevSharedModuleCheckRequest);
|
---|
[29307] | 1893 | case VMMDevReq_GetPageSharingStatus:
|
---|
| 1894 | return sizeof(VMMDevPageSharingStatusRequest);
|
---|
[30040] | 1895 | case VMMDevReq_DebugIsPageShared:
|
---|
| 1896 | return sizeof(VMMDevPageIsSharedRequest);
|
---|
[30668] | 1897 | case VMMDevReq_GetSessionId:
|
---|
| 1898 | return sizeof(VMMDevReqSessionId);
|
---|
[52789] | 1899 | case VMMDevReq_HeartbeatConfigure:
|
---|
| 1900 | return sizeof(VMMDevReqHeartbeat);
|
---|
| 1901 | case VMMDevReq_GuestHeartbeat:
|
---|
| 1902 | return sizeof(VMMDevRequestHeader);
|
---|
[83142] | 1903 | case VMMDevReq_VideoUpdateMonitorPositions:
|
---|
| 1904 | return sizeof(VMMDevVideoUpdateMonitorPositions);
|
---|
[21223] | 1905 | default:
|
---|
[47294] | 1906 | break;
|
---|
[21223] | 1907 | }
|
---|
[47294] | 1908 |
|
---|
| 1909 | return 0;
|
---|
[21223] | 1910 | }
|
---|
| 1911 |
|
---|
| 1912 |
|
---|
| 1913 | /**
|
---|
| 1914 | * Initializes a request structure.
|
---|
| 1915 | *
|
---|
| 1916 | * @returns VBox status code.
|
---|
| 1917 | * @param req The request structure to initialize.
|
---|
| 1918 | * @param type The request type.
|
---|
| 1919 | */
|
---|
| 1920 | DECLINLINE(int) vmmdevInitRequest(VMMDevRequestHeader *req, VMMDevRequestType type)
|
---|
| 1921 | {
|
---|
| 1922 | uint32_t requestSize;
|
---|
| 1923 | if (!req)
|
---|
| 1924 | return VERR_INVALID_PARAMETER;
|
---|
| 1925 | requestSize = (uint32_t)vmmdevGetRequestSize(type);
|
---|
| 1926 | if (!requestSize)
|
---|
| 1927 | return VERR_INVALID_PARAMETER;
|
---|
| 1928 | req->size = requestSize;
|
---|
| 1929 | req->version = VMMDEV_REQUEST_HEADER_VERSION;
|
---|
| 1930 | req->requestType = type;
|
---|
| 1931 | req->rc = VERR_GENERAL_FAILURE;
|
---|
| 1932 | req->reserved1 = 0;
|
---|
[70873] | 1933 | req->fRequestor = 0;
|
---|
[21223] | 1934 | return VINF_SUCCESS;
|
---|
| 1935 | }
|
---|
| 1936 |
|
---|
[64207] | 1937 |
|
---|
[64192] | 1938 | /** @name VBVA ring defines.
|
---|
| 1939 | *
|
---|
| 1940 | * The VBVA ring buffer is suitable for transferring large (< 2GB) amount of
|
---|
| 1941 | * data. For example big bitmaps which do not fit to the buffer.
|
---|
| 1942 | *
|
---|
| 1943 | * Guest starts writing to the buffer by initializing a record entry in the
|
---|
| 1944 | * aRecords queue. VBVA_F_RECORD_PARTIAL indicates that the record is being
|
---|
| 1945 | * written. As data is written to the ring buffer, the guest increases off32End
|
---|
| 1946 | * for the record.
|
---|
| 1947 | *
|
---|
| 1948 | * The host reads the aRecords on flushes and processes all completed records.
|
---|
| 1949 | * When host encounters situation when only a partial record presents and
|
---|
| 1950 | * cbRecord & ~VBVA_F_RECORD_PARTIAL >= VBVA_RING_BUFFER_SIZE -
|
---|
| 1951 | * VBVA_RING_BUFFER_THRESHOLD, the host fetched all record data and updates
|
---|
| 1952 | * off32Head. After that on each flush the host continues fetching the data
|
---|
| 1953 | * until the record is completed.
|
---|
| 1954 | *
|
---|
[81369] | 1955 | * @{ */
|
---|
[64192] | 1956 | #define VMMDEV_VBVA_RING_BUFFER_SIZE (_4M - _1K)
|
---|
| 1957 | #define VMMDEV_VBVA_RING_BUFFER_THRESHOLD (4 * _1K)
|
---|
| 1958 |
|
---|
| 1959 | #define VMMDEV_VBVA_MAX_RECORDS (64)
|
---|
[21223] | 1960 | /** @} */
|
---|
[21226] | 1961 |
|
---|
[64192] | 1962 | /**
|
---|
| 1963 | * VBVA record.
|
---|
| 1964 | */
|
---|
| 1965 | typedef struct VMMDEVVBVARECORD
|
---|
| 1966 | {
|
---|
| 1967 | /** The length of the record. Changed by guest. */
|
---|
| 1968 | uint32_t cbRecord;
|
---|
| 1969 | } VMMDEVVBVARECORD;
|
---|
| 1970 | AssertCompileSize(VMMDEVVBVARECORD, 4);
|
---|
[21226] | 1971 |
|
---|
[68574] | 1972 | #if ARCH_BITS >= 32
|
---|
[64192] | 1973 |
|
---|
[21226] | 1974 | /**
|
---|
[21227] | 1975 | * VBVA memory layout.
|
---|
| 1976 | *
|
---|
| 1977 | * This is a subsection of the VMMDevMemory structure.
|
---|
| 1978 | */
|
---|
| 1979 | typedef struct VBVAMEMORY
|
---|
| 1980 | {
|
---|
| 1981 | /** VBVA_F_MODE_*. */
|
---|
| 1982 | uint32_t fu32ModeFlags;
|
---|
| 1983 |
|
---|
| 1984 | /** The offset where the data start in the buffer. */
|
---|
| 1985 | uint32_t off32Data;
|
---|
| 1986 | /** The offset where next data must be placed in the buffer. */
|
---|
| 1987 | uint32_t off32Free;
|
---|
| 1988 |
|
---|
| 1989 | /** The ring buffer for data. */
|
---|
[64192] | 1990 | uint8_t au8RingBuffer[VMMDEV_VBVA_RING_BUFFER_SIZE];
|
---|
[21227] | 1991 |
|
---|
| 1992 | /** The queue of record descriptions. */
|
---|
[64192] | 1993 | VMMDEVVBVARECORD aRecords[VMMDEV_VBVA_MAX_RECORDS];
|
---|
[21227] | 1994 | uint32_t indexRecordFirst;
|
---|
| 1995 | uint32_t indexRecordFree;
|
---|
| 1996 |
|
---|
| 1997 | /** RDP orders supported by the client. The guest reports only them
|
---|
| 1998 | * and falls back to DIRTY rects for not supported ones.
|
---|
| 1999 | *
|
---|
| 2000 | * (1 << VBVA_VRDP_*)
|
---|
| 2001 | */
|
---|
| 2002 | uint32_t fu32SupportedOrders;
|
---|
| 2003 |
|
---|
| 2004 | } VBVAMEMORY;
|
---|
| 2005 | AssertCompileSize(VBVAMEMORY, 12 + (_4M-_1K) + 4*64 + 12);
|
---|
| 2006 |
|
---|
| 2007 |
|
---|
| 2008 | /**
|
---|
[21226] | 2009 | * The layout of VMMDEV RAM region that contains information for guest.
|
---|
| 2010 | */
|
---|
[21227] | 2011 | typedef struct VMMDevMemory
|
---|
[21226] | 2012 | {
|
---|
[21227] | 2013 | /** The size of this structure. */
|
---|
[21226] | 2014 | uint32_t u32Size;
|
---|
[21227] | 2015 | /** The structure version. (VMMDEV_MEMORY_VERSION) */
|
---|
[21226] | 2016 | uint32_t u32Version;
|
---|
| 2017 |
|
---|
[21227] | 2018 | union
|
---|
| 2019 | {
|
---|
| 2020 | struct
|
---|
| 2021 | {
|
---|
| 2022 | /** Flag telling that VMMDev set the IRQ and acknowlegment is required */
|
---|
[21226] | 2023 | bool fHaveEvents;
|
---|
| 2024 | } V1_04;
|
---|
| 2025 |
|
---|
[21227] | 2026 | struct
|
---|
| 2027 | {
|
---|
[21226] | 2028 | /** Pending events flags, set by host. */
|
---|
| 2029 | uint32_t u32HostEvents;
|
---|
| 2030 | /** Mask of events the guest wants to see, set by guest. */
|
---|
| 2031 | uint32_t u32GuestEventMask;
|
---|
| 2032 | } V1_03;
|
---|
| 2033 | } V;
|
---|
| 2034 |
|
---|
| 2035 | VBVAMEMORY vbvaMemory;
|
---|
| 2036 |
|
---|
| 2037 | } VMMDevMemory;
|
---|
| 2038 | AssertCompileSize(VMMDevMemory, 8+8 + (12 + (_4M-_1K) + 4*64 + 12) );
|
---|
[46691] | 2039 | AssertCompileMemberOffset(VMMDevMemory, vbvaMemory, 16);
|
---|
[21226] | 2040 |
|
---|
| 2041 | /** Version of VMMDevMemory structure (VMMDevMemory::u32Version). */
|
---|
[68574] | 2042 | # define VMMDEV_MEMORY_VERSION (1)
|
---|
[21226] | 2043 |
|
---|
[68574] | 2044 | #endif /* ARCH_BITS >= 32 */
|
---|
| 2045 |
|
---|
[21226] | 2046 | /** @} */
|
---|
[46691] | 2047 |
|
---|
[81369] | 2048 | /** @} */
|
---|
[20374] | 2049 | RT_C_DECLS_END
|
---|
[46691] | 2050 | #pragma pack()
|
---|
[1] | 2051 |
|
---|
[76585] | 2052 | #endif /* !VBOX_INCLUDED_VMMDev_h */
|
---|