30
32
#ifndef ___VBox_VBoxGuest_h
31
33
#define ___VBox_VBoxGuest_h
33
#include <iprt/cdefs.h>
34
#include <iprt/types.h>
36
# include <iprt/stdarg.h>
35
#include <VBox/cdefs.h>
36
#include <VBox/types.h>
38
37
#include <iprt/assert.h>
40
#include <VBox/ostypes.h>
42
/*******************************************************************************
43
* Defined Constants And Macros *
44
*******************************************************************************/
46
/** @todo The following is a temporary fix for the problem of accessing
47
hypervisor pointers from within guest additions */
49
/** Hypervisor linear pointer size type */
50
typedef RTGCPTR32 VMMDEVHYPPTR32;
51
typedef RTGCPTR64 VMMDEVHYPPTR64;
52
/** Hypervisor physical pointer size type */
53
typedef RTGCPHYS32 VMMDEVHYPPHYS32;
54
typedef RTGCPHYS64 VMMDEVHYPPHYS64;
56
#if defined(VBOX_WITH_64_BITS_GUESTS) && ARCH_BITS == 64
57
# define VMMDEVHYPPTR VMMDEVHYPPTR64
58
# define VMMDEVHYPPHYS VMMDEVHYPPHYS64
60
# define VMMDEVHYPPTR VMMDEVHYPPTR32
61
# define VMMDEVHYPPHYS VMMDEVHYPPHYS32
64
#if defined(RT_OS_LINUX)
65
/** The support device name. */
66
# define VBOXGUEST_DEVICE_NAME "/dev/vboxadd"
67
/** The support device name of the user accessible device node. */
68
# define VBOXGUEST_USER_DEVICE_NAME "/dev/vboxuser"
70
#elif defined(RT_OS_OS2)
71
/** The support device name. */
72
# define VBOXGUEST_DEVICE_NAME "\\Dev\\VBoxGst$"
73
/** The support device name of the user accessible device node. */
74
# define VBOXGUEST_USER_DEVICE_NAME "\\Dev\\VBoxGst$"
76
#elif defined(RT_OS_SOLARIS)
77
/** The support device name. */
78
# define VBOXGUEST_DEVICE_NAME "/dev/vboxguest"
79
/** The support device name of the user accessible device node. */
80
# define VBOXGUEST_USER_DEVICE_NAME "/dev/vboxguest"
38
#include <VBox/VMMDev2.h>
39
#include <VBox/VBoxGuest2.h>
42
/** @defgroup grp_vboxguest VirtualBox Guest Additions Driver Interface
46
/** @todo it would be nice if we could have two define without paths. */
48
/** @def VBOXGUEST_DEVICE_NAME
49
* The support device name. */
50
/** @def VBOXGUEST_USER_DEVICE_NAME
51
* The support device name of the user accessible device node. */
53
#if defined(RT_OS_OS2)
54
# define VBOXGUEST_DEVICE_NAME "\\Dev\\VBoxGst$"
82
56
#elif defined(RT_OS_WINDOWS)
57
# define VBOXGUEST_DEVICE_NAME "\\\\.\\VBoxGuest"
83
59
/** The support service name. */
84
# define VBOXGUEST_SERVICE_NAME "VBoxGuest"
85
/** Win32 device name. */
86
# define VBOXGUEST_DEVICE_NAME "\\\\.\\VBoxGuest"
87
/** The support device name of the user accessible device node. */
88
# define VBOXGUEST_USER_DEVICE_NAME "\\\\.\\VBoxGuest"
60
# define VBOXGUEST_SERVICE_NAME "VBoxGuest"
89
61
/** Global name for Win2k+ */
90
# define VBOXGUEST_DEVICE_NAME_GLOBAL "\\\\.\\Global\\VBoxGuest"
62
# define VBOXGUEST_DEVICE_NAME_GLOBAL "\\\\.\\Global\\VBoxGuest"
91
63
/** Win32 driver name */
92
# define VBOXGUEST_DEVICE_NAME_NT L"\\Device\\VBoxGuest"
94
# define VBOXGUEST_DEVICE_NAME_DOS L"\\DosDevices\\VBoxGuest"
96
#elif defined(RT_OS_FREEBSD)
97
/** The support device name. */
98
# define VBOXGUEST_DEVICE_NAME "/dev/vboxguest"
99
/** The support device name of the user accessible device node. */
100
# define VBOXGUEST_USER_DEVICE_NAME "/dev/vboxguest"
106
/** VirtualBox vendor ID */
107
#define VBOX_PCI_VENDORID (0x80ee)
109
/** VMMDev PCI card identifiers */
110
#define VMMDEV_VENDORID VBOX_PCI_VENDORID
111
#define VMMDEV_DEVICEID (0xcafe)
113
/** VirtualBox graphics card identifiers */
114
#define VBOX_VENDORID VBOX_PCI_VENDORID
115
#define VBOX_VESA_VENDORID VBOX_PCI_VENDORID
116
#define VBOX_DEVICEID (0xbeef)
117
#define VBOX_VESA_DEVICEID (0xbeef)
120
* VBoxGuest port definitions
124
/** guest can (== wants to) handle absolute coordinates */
125
#define VBOXGUEST_MOUSE_GUEST_CAN_ABSOLUTE RT_BIT(0)
126
/** host can (== wants to) send absolute coordinates */
127
#define VBOXGUEST_MOUSE_HOST_CAN_ABSOLUTE RT_BIT(1)
128
/** guest can *NOT* switch to software cursor and therefore depends on the host cursor */
129
#define VBOXGUEST_MOUSE_GUEST_NEEDS_HOST_CURSOR RT_BIT(2)
130
/** host does NOT provide support for drawing the cursor itself (e.g. L4 console) */
131
#define VBOXGUEST_MOUSE_HOST_CANNOT_HWPOINTER RT_BIT(3)
132
/** The guest can read VMMDev events to find out about pointer movement */
133
#define VBOXGUEST_MOUSE_GUEST_USES_VMMDEV RT_BIT(4)
135
/** fictive start address of the hypervisor physical memory for MmMapIoSpace */
136
#define HYPERVISOR_PHYSICAL_START 0xf8000000
139
* VMMDev Generic Request Interface
142
/** port for generic request interface */
143
#define PORT_VMMDEV_REQUEST_OFFSET 0
145
/** Current version of the VMMDev interface.
147
* Additions are allowed to work only if
148
* additions_major == vmmdev_current && additions_minor <= vmmdev_current.
149
* Additions version is reported to host (VMMDev) by VMMDevReq_ReportGuestInfo.
151
* @remark These defines also live in the 16-bit and assembly versions of this header.
153
#define VMMDEV_VERSION 0x00010004
154
#define VMMDEV_VERSION_MAJOR (VMMDEV_VERSION >> 16)
155
#define VMMDEV_VERSION_MINOR (VMMDEV_VERSION & 0xffff)
157
/* Maximum request packet size */
158
#define VMMDEV_MAX_VMMDEVREQ_SIZE _1M
161
* VMMDev request types.
162
* @note when updating this, adjust vmmdevGetRequestSize() as well
166
VMMDevReq_InvalidRequest = 0,
167
VMMDevReq_GetMouseStatus = 1,
168
VMMDevReq_SetMouseStatus = 2,
169
VMMDevReq_SetPointerShape = 3,
170
/** @todo implement on host side */
171
VMMDevReq_GetHostVersion = 4,
173
VMMDevReq_GetHostTime = 10,
174
VMMDevReq_GetHypervisorInfo = 20,
175
VMMDevReq_SetHypervisorInfo = 21,
176
VMMDevReq_RegisterPatchMemory = 22,
177
VMMDevReq_DeregisterPatchMemory = 23,
178
VMMDevReq_SetPowerStatus = 30,
179
VMMDevReq_AcknowledgeEvents = 41,
180
VMMDevReq_CtlGuestFilterMask = 42,
181
VMMDevReq_ReportGuestInfo = 50,
182
VMMDevReq_GetDisplayChangeRequest = 51,
183
VMMDevReq_VideoModeSupported = 52,
184
VMMDevReq_GetHeightReduction = 53,
185
VMMDevReq_GetDisplayChangeRequest2 = 54,
186
VMMDevReq_ReportGuestCapabilities = 55,
187
VMMDevReq_SetGuestCapabilities = 56,
188
#ifdef VBOX_WITH_HGCM
189
VMMDevReq_HGCMConnect = 60,
190
VMMDevReq_HGCMDisconnect = 61,
191
#ifdef VBOX_WITH_64_BITS_GUESTS
192
VMMDevReq_HGCMCall32 = 62,
193
VMMDevReq_HGCMCall64 = 63,
195
VMMDevReq_HGCMCall = 62,
196
#endif /* VBOX_WITH_64_BITS_GUESTS */
197
VMMDevReq_HGCMCancel = 64,
199
VMMDevReq_VideoAccelEnable = 70,
200
VMMDevReq_VideoAccelFlush = 71,
201
VMMDevReq_VideoSetVisibleRegion = 72,
202
VMMDevReq_GetSeamlessChangeRequest = 73,
203
VMMDevReq_QueryCredentials = 100,
204
VMMDevReq_ReportCredentialsJudgement = 101,
205
VMMDevReq_ReportGuestStats = 110,
206
VMMDevReq_GetMemBalloonChangeRequest = 111,
207
VMMDevReq_GetStatisticsChangeRequest = 112,
208
VMMDevReq_ChangeMemBalloon = 113,
209
VMMDevReq_GetVRDPChangeRequest = 150,
210
VMMDevReq_LogString = 200,
211
VMMDevReq_SizeHack = 0x7fffffff
214
#ifdef VBOX_WITH_64_BITS_GUESTS
216
* Constants and structures are redefined for the guest.
218
* Host code MUST always use either *32 or *64 variant explicitely.
219
* Host source code will use VBOX_HGCM_HOST_CODE define to catch undefined
220
* data types and constants.
222
* This redefinition means that the new additions builds will use
223
* the *64 or *32 variants depending on the current architecture bit count (ARCH_BITS).
225
# ifndef VBOX_HGCM_HOST_CODE
227
# define VMMDevReq_HGCMCall VMMDevReq_HGCMCall64
228
# elif ARCH_BITS == 32
229
# define VMMDevReq_HGCMCall VMMDevReq_HGCMCall32
231
# error "Unsupported ARCH_BITS"
233
# endif /* !VBOX_HGCM_HOST_CODE */
234
#endif /* VBOX_WITH_64_BITS_GUESTS */
236
/** Version of VMMDevRequestHeader structure. */
237
#define VMMDEV_REQUEST_HEADER_VERSION (0x10001)
240
/** generic VMMDev request header */
243
/** size of the structure in bytes (including body). Filled by caller */
245
/** version of the structure. Filled by caller */
247
/** type of the request */
248
VMMDevRequestType requestType;
249
/** return code. Filled by VMMDev */
251
/** reserved fields */
254
} VMMDevRequestHeader;
255
AssertCompileSize(VMMDevRequestHeader, 24);
257
/** mouse status request structure */
261
VMMDevRequestHeader header;
262
/** mouse feature mask */
263
uint32_t mouseFeatures;
264
/** mouse x position */
265
uint32_t pointerXPos;
266
/** mouse y position */
267
uint32_t pointerYPos;
268
} VMMDevReqMouseStatus;
270
/** Note VBOX_MOUSE_POINTER_* flags are used in guest video driver,
271
* values must be <= 0x8000 and must not be changed.
274
/** pointer is visible */
275
#define VBOX_MOUSE_POINTER_VISIBLE (0x0001)
276
/** pointer has alpha channel */
277
#define VBOX_MOUSE_POINTER_ALPHA (0x0002)
278
/** pointerData contains new pointer shape */
279
#define VBOX_MOUSE_POINTER_SHAPE (0x0004)
281
/** mouse pointer shape/visibility change request */
285
VMMDevRequestHeader header;
286
/** VBOX_MOUSE_POINTER_* bit flags */
288
/** x coordinate of hot spot */
290
/** y coordinate of hot spot */
292
/** width of the pointer in pixels */
294
/** height of the pointer in scanlines */
299
* The data consists of 1 bpp AND mask followed by 32 bpp XOR (color) mask.
301
* For pointers without alpha channel the XOR mask pixels are 32 bit values: (lsb)BGR0(msb).
302
* For pointers with alpha channel the XOR mask consists of (lsb)BGRA(msb) 32 bit values.
304
* Guest driver must create the AND mask for pointers with alpha channel, so if host does not
305
* support alpha, the pointer could be displayed as a normal color pointer. The AND mask can
306
* be constructed from alpha values. For example alpha value >= 0xf0 means bit 0 in the AND mask.
308
* The AND mask is 1 bpp bitmap with byte aligned scanlines. Size of AND mask,
309
* therefore, is cbAnd = (width + 7) / 8 * height. The padding bits at the
310
* end of any scanline are undefined.
312
* The XOR mask follows the AND mask on the next 4 bytes aligned offset:
313
* uint8_t *pXor = pAnd + (cbAnd + 3) & ~3
314
* Bytes in the gap between the AND and the XOR mask are undefined.
315
* XOR mask scanlines have no gap between them and size of XOR mask is:
316
* cXor = width * 4 * height.
319
* Preallocate 4 bytes for accessing actual data as p->pointerData
322
} VMMDevReqMousePointer;
324
/** string log request structure */
328
VMMDevRequestHeader header;
329
/** variable length string data */
331
} VMMDevReqLogString;
333
/** host version request structure */
337
VMMDevRequestHeader header;
344
} VMMDevReqHostVersion;
346
/** guest capabilites structure */
350
VMMDevRequestHeader header;
351
/** capabilities (VMMDEV_GUEST_*) */
353
} VMMDevReqGuestCapabilities;
355
/** guest capabilites structure */
359
VMMDevRequestHeader header;
360
/** mask of capabilities to be added */
362
/** mask of capabilities to be removed */
364
} VMMDevReqGuestCapabilities2;
366
/** idle request structure */
370
VMMDevRequestHeader header;
373
/** host time request structure */
377
VMMDevRequestHeader header;
378
/** time in milliseconds since unix epoch. Filled by VMMDev. */
382
/** hypervisor info structure */
386
VMMDevRequestHeader header;
387
/** guest virtual address of proposed hypervisor start */
388
/** TODO: Make this 64-bit compatible */
389
VMMDEVHYPPTR32 hypervisorStart;
390
/** hypervisor size in bytes */
391
uint32_t hypervisorSize;
392
} VMMDevReqHypervisorInfo;
394
/** @name Default patch memory size .
395
* Used by VMMDevReq_RegisterPatchMemory and VMMDevReq_DeregisterPatchMemory.
397
#define VMMDEV_GUEST_DEFAULT_PATCHMEM_SIZE 8192
401
* Patching memory structure. (locked executable & read-only page from the guest's perspective)
403
* Used by VMMDevReq_RegisterPatchMemory and VMMDevReq_DeregisterPatchMemory
408
VMMDevRequestHeader header;
409
/** Guest virtual address of the patching page(s). */
411
/** Patch page size in bytes. */
413
} VMMDevReqPatchMemory;
414
AssertCompileSize(VMMDevReqPatchMemory, 24+12);
416
/** system power requests */
419
VMMDevPowerState_Invalid = 0,
420
VMMDevPowerState_Pause = 1,
421
VMMDevPowerState_PowerOff = 2,
422
VMMDevPowerState_SaveState = 3,
423
VMMDevPowerState_SizeHack = 0x7fffffff
426
/** system power status structure */
430
VMMDevRequestHeader header;
431
/** power state request */
432
VMMDevPowerState powerState;
433
} VMMDevPowerStateRequest;
435
/** pending events structure */
439
VMMDevRequestHeader header;
440
/** pending event bitmap */
444
/** guest filter mask control */
448
VMMDevRequestHeader header;
449
/** mask of events to be added to filter */
451
/** mask of events to be removed from filter */
453
} VMMDevCtlGuestFilterMask;
455
/** guest information structure */
456
typedef struct VBoxGuestInfo
458
/** The VMMDev interface version expected by additions. */
459
uint32_t additionsVersion;
465
/** guest information structure */
469
VMMDevRequestHeader header;
470
/** Guest information. */
471
VBoxGuestInfo guestInfo;
472
} VMMDevReportGuestInfo;
474
/** guest statistics values */
475
#define VBOX_GUEST_STAT_CPU_LOAD_IDLE RT_BIT(0)
476
#define VBOX_GUEST_STAT_CPU_LOAD_KERNEL RT_BIT(1)
477
#define VBOX_GUEST_STAT_CPU_LOAD_USER RT_BIT(2)
478
#define VBOX_GUEST_STAT_THREADS RT_BIT(3)
479
#define VBOX_GUEST_STAT_PROCESSES RT_BIT(4)
480
#define VBOX_GUEST_STAT_HANDLES RT_BIT(5)
481
#define VBOX_GUEST_STAT_MEMORY_LOAD RT_BIT(6)
482
#define VBOX_GUEST_STAT_PHYS_MEM_TOTAL RT_BIT(7)
483
#define VBOX_GUEST_STAT_PHYS_MEM_AVAIL RT_BIT(8)
484
#define VBOX_GUEST_STAT_PHYS_MEM_BALLOON RT_BIT(9)
485
#define VBOX_GUEST_STAT_MEM_COMMIT_TOTAL RT_BIT(10)
486
#define VBOX_GUEST_STAT_MEM_KERNEL_TOTAL RT_BIT(11)
487
#define VBOX_GUEST_STAT_MEM_KERNEL_PAGED RT_BIT(12)
488
#define VBOX_GUEST_STAT_MEM_KERNEL_NONPAGED RT_BIT(13)
489
#define VBOX_GUEST_STAT_MEM_SYSTEM_CACHE RT_BIT(14)
490
#define VBOX_GUEST_STAT_PAGE_FILE_SIZE RT_BIT(15)
493
/** guest statistics structure */
494
typedef struct VBoxGuestStatistics
496
/** Virtual CPU id */
498
/** Reported statistics */
499
uint32_t u32StatCaps;
500
/** Idle CPU load (0-100) for last interval */
501
uint32_t u32CpuLoad_Idle;
502
/** Kernel CPU load (0-100) for last interval */
503
uint32_t u32CpuLoad_Kernel;
504
/** User CPU load (0-100) for last interval */
505
uint32_t u32CpuLoad_User;
508
/** Nr of processes */
509
uint32_t u32Processes;
512
/** Memory load (0-100) */
513
uint32_t u32MemoryLoad;
514
/** Page size of guest system */
515
uint32_t u32PageSize;
516
/** Total physical memory (in 4kb pages) */
517
uint32_t u32PhysMemTotal;
518
/** Available physical memory (in 4kb pages) */
519
uint32_t u32PhysMemAvail;
520
/** Ballooned physical memory (in 4kb pages) */
521
uint32_t u32PhysMemBalloon;
522
/** Total number of committed memory (which is not necessarily in-use) (in 4kb pages) */
523
uint32_t u32MemCommitTotal;
524
/** Total amount of memory used by the kernel (in 4kb pages) */
525
uint32_t u32MemKernelTotal;
526
/** Total amount of paged memory used by the kernel (in 4kb pages) */
527
uint32_t u32MemKernelPaged;
528
/** Total amount of nonpaged memory used by the kernel (in 4kb pages) */
529
uint32_t u32MemKernelNonPaged;
530
/** Total amount of memory used for the system cache (in 4kb pages) */
531
uint32_t u32MemSystemCache;
532
/** Pagefile size (in 4kb pages) */
533
uint32_t u32PageFileSize;
534
} VBoxGuestStatistics;
536
/** guest statistics command structure */
540
VMMDevRequestHeader header;
541
/** Guest information. */
542
VBoxGuestStatistics guestStats;
543
} VMMDevReportGuestStats;
545
/** memory balloon change request structure */
546
#define VMMDEV_MAX_MEMORY_BALLOON(PhysMemTotal) ((90*PhysMemTotal)/100)
551
VMMDevRequestHeader header;
552
uint32_t u32BalloonSize; /* balloon size in megabytes */
553
uint32_t u32PhysMemSize; /* guest ram size in megabytes */
555
} VMMDevGetMemBalloonChangeRequest;
557
/** inflate/deflate memory balloon structure */
558
#define VMMDEV_MEMORY_BALLOON_CHUNK_PAGES (_1M/4096)
559
#define VMMDEV_MEMORY_BALLOON_CHUNK_SIZE (VMMDEV_MEMORY_BALLOON_CHUNK_PAGES*4096)
564
VMMDevRequestHeader header;
566
uint32_t fInflate; /* true = inflate, false = defalte */
567
/** Physical address (RTGCPHYS) of each page, variable size. */
568
RTGCPHYS aPhysPage[1];
569
} VMMDevChangeMemBalloon;
571
/** guest statistics interval change request structure */
575
VMMDevRequestHeader header;
576
uint32_t u32StatInterval; /* interval in seconds */
578
} VMMDevGetStatisticsChangeRequest;
580
/** display change request structure */
584
VMMDevRequestHeader header;
585
/** horizontal pixel resolution (0 = do not change) */
587
/** vertical pixel resolution (0 = do not change) */
589
/** bits per pixel (0 = do not change) */
591
/** Flag that the request is an acknowlegement for the VMMDEV_EVENT_DISPLAY_CHANGE_REQUEST.
592
* Values: 0 - just querying, VMMDEV_EVENT_DISPLAY_CHANGE_REQUEST - event acknowledged.
595
} VMMDevDisplayChangeRequest;
600
VMMDevRequestHeader header;
601
/** horizontal pixel resolution (0 = do not change) */
603
/** vertical pixel resolution (0 = do not change) */
605
/** bits per pixel (0 = do not change) */
607
/** Flag that the request is an acknowlegement for the VMMDEV_EVENT_DISPLAY_CHANGE_REQUEST.
608
* Values: 0 - just querying, VMMDEV_EVENT_DISPLAY_CHANGE_REQUEST - event acknowledged.
611
/** 0 for primary display, 1 for the first secondary, etc. */
613
} VMMDevDisplayChangeRequest2;
615
/** video mode supported request structure */
619
VMMDevRequestHeader header;
620
/** horizontal pixel resolution (input) */
622
/** vertical pixel resolution (input) */
624
/** bits per pixel (input) */
626
/** supported flag (output) */
628
} VMMDevVideoModeSupportedRequest;
630
/** video modes height reduction request structure */
634
VMMDevRequestHeader header;
635
/** height reduction in pixels (output) */
636
uint32_t heightReduction;
637
} VMMDevGetHeightReductionRequest;
639
#define VRDP_EXPERIENCE_LEVEL_ZERO 0 /* Theming disabled. */
640
#define VRDP_EXPERIENCE_LEVEL_LOW 1 /* Full window dragging and desktop wallpaper disabled. */
641
#define VRDP_EXPERIENCE_LEVEL_MEDIUM 2 /* Font smoothing, gradients. */
642
#define VRDP_EXPERIENCE_LEVEL_HIGH 3 /* Animation effects disabled. */
643
#define VRDP_EXPERIENCE_LEVEL_FULL 4 /* Everything enabled. */
648
VMMDevRequestHeader header;
649
/** Whether VRDP is active or not */
650
uint8_t u8VRDPActive;
651
/** The configured experience level for active VRDP. */
652
uint32_t u32VRDPExperienceLevel;
653
} VMMDevVRDPChangeRequest;
659
#ifdef VBOX_WITH_HGCM
664
#define VBOX_HGCM_REQ_DONE (0x1)
665
#define VBOX_HGCM_REQ_CANCELLED (0x2)
669
typedef struct _VMMDevHGCMRequestHeader
671
/** Request header. */
672
VMMDevRequestHeader header;
679
} VMMDevHGCMRequestHeader;
680
AssertCompileSize(VMMDevHGCMRequestHeader, 24+8);
682
/** HGCM service location types. */
685
VMMDevHGCMLoc_Invalid = 0,
686
VMMDevHGCMLoc_LocalHost = 1,
687
VMMDevHGCMLoc_LocalHost_Existing = 2,
688
VMMDevHGCMLoc_SizeHack = 0x7fffffff
689
} HGCMServiceLocationType;
693
char achName[128]; /**< This is really szName. */
694
} HGCMServiceLocationHost;
696
typedef struct HGCMSERVICELOCATION
698
/** Type of the location. */
699
HGCMServiceLocationType type;
703
HGCMServiceLocationHost host;
705
} HGCMServiceLocation;
710
VMMDevHGCMRequestHeader header;
712
/** IN: Description of service to connect to. */
713
HGCMServiceLocation loc;
715
/** OUT: Client identifier assigned by local instance of HGCM. */
716
uint32_t u32ClientID;
722
VMMDevHGCMRequestHeader header;
724
/** IN: Client identifier. */
725
uint32_t u32ClientID;
726
} VMMDevHGCMDisconnect;
730
VMMDevHGCMParmType_Invalid = 0,
731
VMMDevHGCMParmType_32bit = 1,
732
VMMDevHGCMParmType_64bit = 2,
733
VMMDevHGCMParmType_PhysAddr = 3,
734
VMMDevHGCMParmType_LinAddr = 4, /**< In and Out */
735
VMMDevHGCMParmType_LinAddr_In = 5, /**< In (read; host<-guest) */
736
VMMDevHGCMParmType_LinAddr_Out = 6, /**< Out (write; host->guest) */
737
VMMDevHGCMParmType_LinAddr_Locked = 7, /**< Locked In and Out */
738
VMMDevHGCMParmType_LinAddr_Locked_In = 8, /**< Locked In (read; host<-guest) */
739
VMMDevHGCMParmType_LinAddr_Locked_Out = 9, /**< Locked Out (write; host->guest) */
740
VMMDevHGCMParmType_SizeHack = 0x7fffffff
741
} HGCMFunctionParameterType;
743
#ifdef VBOX_WITH_64_BITS_GUESTS
744
typedef struct _HGCMFUNCTIONPARAMETER32
746
HGCMFunctionParameterType type;
757
VMMDEVHYPPHYS32 physAddr;
758
VMMDEVHYPPTR32 linearAddr;
763
void SetUInt32(uint32_t u32)
765
type = VMMDevHGCMParmType_32bit;
766
u.value64 = 0; /* init unused bits to 0 */
770
int GetUInt32(uint32_t *pu32)
772
if (type == VMMDevHGCMParmType_32bit)
777
return VERR_INVALID_PARAMETER;
780
void SetUInt64(uint64_t u64)
782
type = VMMDevHGCMParmType_64bit;
786
int GetUInt64(uint64_t *pu64)
788
if (type == VMMDevHGCMParmType_64bit)
793
return VERR_INVALID_PARAMETER;
796
void SetPtr(void *pv, uint32_t cb)
798
type = VMMDevHGCMParmType_LinAddr;
800
u.Pointer.u.linearAddr = (VMMDEVHYPPTR32)(uintptr_t)pv;
803
} HGCMFunctionParameter32;
805
typedef struct _HGCMFUNCTIONPARAMETER64
807
HGCMFunctionParameterType type;
818
VMMDEVHYPPHYS64 physAddr;
819
VMMDEVHYPPTR64 linearAddr;
824
void SetUInt32(uint32_t u32)
826
type = VMMDevHGCMParmType_32bit;
827
u.value64 = 0; /* init unused bits to 0 */
831
int GetUInt32(uint32_t *pu32)
833
if (type == VMMDevHGCMParmType_32bit)
838
return VERR_INVALID_PARAMETER;
841
void SetUInt64(uint64_t u64)
843
type = VMMDevHGCMParmType_64bit;
847
int GetUInt64(uint64_t *pu64)
849
if (type == VMMDevHGCMParmType_64bit)
854
return VERR_INVALID_PARAMETER;
857
void SetPtr(void *pv, uint32_t cb)
859
type = VMMDevHGCMParmType_LinAddr;
861
u.Pointer.u.linearAddr = (uintptr_t)pv;
864
} HGCMFunctionParameter64;
865
#else /* !VBOX_WITH_64_BITS_GUESTS */
866
typedef struct _HGCMFUNCTIONPARAMETER
868
HGCMFunctionParameterType type;
879
VMMDEVHYPPHYS32 physAddr;
880
VMMDEVHYPPTR32 linearAddr;
885
void SetUInt32(uint32_t u32)
887
type = VMMDevHGCMParmType_32bit;
888
u.value64 = 0; /* init unused bits to 0 */
892
int GetUInt32(uint32_t *pu32)
894
if (type == VMMDevHGCMParmType_32bit)
899
return VERR_INVALID_PARAMETER;
902
void SetUInt64(uint64_t u64)
904
type = VMMDevHGCMParmType_64bit;
908
int GetUInt64(uint64_t *pu64)
910
if (type == VMMDevHGCMParmType_64bit)
915
return VERR_INVALID_PARAMETER;
918
void SetPtr(void *pv, uint32_t cb)
920
type = VMMDevHGCMParmType_LinAddr;
922
u.Pointer.u.linearAddr = (uintptr_t)pv;
925
} HGCMFunctionParameter;
926
#endif /* !VBOX_WITH_64_BITS_GUESTS */
929
#ifdef VBOX_WITH_64_BITS_GUESTS
930
/* Redefine the structure type for the guest code. */
931
# ifndef VBOX_HGCM_HOST_CODE
933
# define HGCMFunctionParameter HGCMFunctionParameter64
934
# elif ARCH_BITS == 32
935
# define HGCMFunctionParameter HGCMFunctionParameter32
937
# error "Unsupported sizeof (void *)"
939
# endif /* !VBOX_HGCM_HOST_CODE */
940
#endif /* VBOX_WITH_64_BITS_GUESTS */
945
VMMDevHGCMRequestHeader header;
947
/** IN: Client identifier. */
948
uint32_t u32ClientID;
949
/** IN: Service function number. */
950
uint32_t u32Function;
951
/** IN: Number of parameters. */
953
/** Parameters follow in form: HGCMFunctionParameter aParms[X]; */
957
#define VMMDEV_HGCM_CALL_PARMS(a) ((HGCMFunctionParameter *)((uint8_t *)a + sizeof (VMMDevHGCMCall)))
958
#define VMMDEV_HGCM_CALL_PARMS32(a) ((HGCMFunctionParameter32 *)((uint8_t *)a + sizeof (VMMDevHGCMCall)))
960
#ifdef VBOX_WITH_64_BITS_GUESTS
961
/* Explicit defines for the host code. */
962
# ifdef VBOX_HGCM_HOST_CODE
963
# define VMMDEV_HGCM_CALL_PARMS32(a) ((HGCMFunctionParameter32 *)((uint8_t *)a + sizeof (VMMDevHGCMCall)))
964
# define VMMDEV_HGCM_CALL_PARMS64(a) ((HGCMFunctionParameter64 *)((uint8_t *)a + sizeof (VMMDevHGCMCall)))
965
# endif /* VBOX_HGCM_HOST_CODE */
966
#endif /* VBOX_WITH_64_BITS_GUESTS */
968
#define VBOX_HGCM_MAX_PARMS 32
970
/* The Cancel request is issued using the same physical memory address
971
* as was used for the corresponding initial HGCMCall.
976
VMMDevHGCMRequestHeader header;
979
#endif /* VBOX_WITH_HGCM */
982
#define VBVA_F_STATUS_ACCEPTED (0x01)
983
#define VBVA_F_STATUS_ENABLED (0x02)
987
typedef struct _VMMDevVideoAccelEnable
990
VMMDevRequestHeader header;
992
/** 0 - disable, !0 - enable. */
995
/** The size of VBVAMEMORY::au8RingBuffer expected by driver.
996
* The host will refuse to enable VBVA if the size is not equal to
997
* VBVA_RING_BUFFER_SIZE.
999
uint32_t cbRingBuffer;
1001
/** Guest initializes the status to 0. Host sets appropriate VBVA_F_STATUS_ flags. */
1002
uint32_t fu32Status;
1004
} VMMDevVideoAccelEnable;
1006
typedef struct _VMMDevVideoAccelFlush
1008
/* request header */
1009
VMMDevRequestHeader header;
1011
} VMMDevVideoAccelFlush;
1014
typedef struct _VMMDevVideoSetVisibleRegion
1016
/* request header */
1017
VMMDevRequestHeader header;
1019
/** Number of rectangles */
1022
/** Rectangle array */
1024
} VMMDevVideoSetVisibleRegion;
1027
/** Seamless mode */
1030
VMMDev_Seamless_Disabled = 0, /* normal mode; entire guest desktop displayed */
1031
VMMDev_Seamless_Visible_Region = 1, /* visible region mode; only top-level guest windows displayed */
1032
VMMDev_Seamless_Host_Window = 2 /* windowed mode; each top-level guest window is represented in a host window */
1033
} VMMDevSeamlessMode;
1038
VMMDevRequestHeader header;
1040
/** New seamless mode */
1041
VMMDevSeamlessMode mode;
1042
/** Flag that the request is an acknowlegement for the VMMDEV_EVENT_SEAMLESS_MODE_CHANGE_REQUEST.
1043
* Values: 0 - just querying, VMMDEV_EVENT_SEAMLESS_MODE_CHANGE_REQUEST - event acknowledged.
1046
} VMMDevSeamlessChangeRequest;
1051
/** VBVA command header. */
1052
typedef struct _VBVACMDHDR
1054
/** Coordinates of affected rectangle. */
1062
/* The VBVA ring buffer is suitable for transferring large (< 2gb) amount of data.
1063
* For example big bitmaps which do not fit to the buffer.
1065
* Guest starts writing to the buffer by initializing a record entry in the
1066
* aRecords queue. VBVA_F_RECORD_PARTIAL indicates that the record is being
1067
* written. As data is written to the ring buffer, the guest increases off32End
1070
* The host reads the aRecords on flushes and processes all completed records.
1071
* When host encounters situation when only a partial record presents and
1072
* cbRecord & ~VBVA_F_RECORD_PARTIAL >= VBVA_RING_BUFFER_SIZE - VBVA_RING_BUFFER_THRESHOLD,
1073
* the host fetched all record data and updates off32Head. After that on each flush
1074
* the host continues fetching the data until the record is completed.
1078
#define VBVA_RING_BUFFER_SIZE (_4M - _1K)
1079
#define VBVA_RING_BUFFER_THRESHOLD (4 * _1K)
1081
#define VBVA_MAX_RECORDS (64)
1083
#define VBVA_F_MODE_ENABLED (0x00000001)
1084
#define VBVA_F_MODE_VRDP (0x00000002)
1085
#define VBVA_F_MODE_VRDP_RESET (0x00000004)
1086
#define VBVA_F_MODE_VRDP_ORDER_MASK (0x00000008)
1088
#define VBVA_F_RECORD_PARTIAL (0x80000000)
1091
typedef struct _VBVARECORD
1093
/** The length of the record. Changed by guest. */
1097
typedef struct _VBVAMEMORY
1099
/** VBVA_F_MODE_* */
1100
uint32_t fu32ModeFlags;
1102
/** The offset where the data start in the buffer. */
1104
/** The offset where next data must be placed in the buffer. */
1107
/** The ring buffer for data. */
1108
uint8_t au8RingBuffer[VBVA_RING_BUFFER_SIZE];
1110
/** The queue of record descriptions. */
1111
VBVARECORD aRecords[VBVA_MAX_RECORDS];
1112
uint32_t indexRecordFirst;
1113
uint32_t indexRecordFree;
1115
/* RDP orders supported by the client. The guest reports only them
1116
* and falls back to DIRTY rects for not supported ones.
1118
* (1 << VBVA_VRDP_*)
1120
uint32_t fu32SupportedOrders;
1134
/** Layout of VMMDEV RAM region that contains information for guest */
1140
uint32_t u32Version;
1143
/** Flag telling that VMMDev set the IRQ and acknowlegment is required */
1149
/** Pending events flags, set by host. */
1150
uint32_t u32HostEvents;
1151
/** Mask of events the guest wants to see, set by guest. */
1152
uint32_t u32GuestEventMask;
1156
VBVAMEMORY vbvaMemory;
1161
/** Version of VMMDevMemory structure. */
1162
#define VMMDEV_MEMORY_VERSION (1)
1172
/** Host mouse capabilities has been changed. */
1173
#define VMMDEV_EVENT_MOUSE_CAPABILITIES_CHANGED RT_BIT(0)
1175
#define VMMDEV_EVENT_HGCM RT_BIT(1)
1176
/** A display change request has been issued. */
1177
#define VMMDEV_EVENT_DISPLAY_CHANGE_REQUEST RT_BIT(2)
1178
/** Credentials are available for judgement. */
1179
#define VMMDEV_EVENT_JUDGE_CREDENTIALS RT_BIT(3)
1180
/** The guest has been restored. */
1181
#define VMMDEV_EVENT_RESTORED RT_BIT(4)
1182
/** Seamless mode state changed */
1183
#define VMMDEV_EVENT_SEAMLESS_MODE_CHANGE_REQUEST RT_BIT(5)
1184
/** Memory balloon size changed */
1185
#define VMMDEV_EVENT_BALLOON_CHANGE_REQUEST RT_BIT(6)
1186
/** Statistics interval changed */
1187
#define VMMDEV_EVENT_STATISTICS_INTERVAL_CHANGE_REQUEST RT_BIT(7)
1188
/** VRDP status changed. */
1189
#define VMMDEV_EVENT_VRDP RT_BIT(8)
1190
/** New mouse position data available */
1191
#define VMMDEV_EVENT_MOUSE_POSITION_CHANGED RT_BIT(9)
64
# define VBOXGUEST_DEVICE_NAME_NT L"\\Device\\VBoxGuest"
66
# define VBOXGUEST_DEVICE_NAME_DOS L"\\DosDevices\\VBoxGuest"
69
# define VBOXGUEST_DEVICE_NAME "/dev/vboxguest"
70
# if defined(RT_OS_LINUX)
71
# define VBOXGUEST_USER_DEVICE_NAME "/dev/vboxuser"
75
#ifndef VBOXGUEST_USER_DEVICE_NAME
76
# define VBOXGUEST_USER_DEVICE_NAME VBOXGUEST_DEVICE_NAME
79
/** Fictive start address of the hypervisor physical memory for MmMapIoSpace. */
80
#define VBOXGUEST_HYPERVISOR_PHYSICAL_START UINT32_C(0xf8000000)
1196
83
#if !defined(IN_RC) && !defined(IN_RING0_AGNOSTIC) && !defined(IPRT_NO_CRT)
1388
268
AssertCompileSize(VBoxGuestFilterMaskInfo, 8);
1391
/** IOCTL to VBoxGuest to control event filter mask. */
1392
#define VBOXGUEST_IOCTL_CTL_FILTER_MASK VBOXGUEST_IOCTL_CODE_(4, sizeof(VBoxGuestFilterMaskInfo))
1394
272
/** IOCTL to VBoxGuest to check memory ballooning. */
1395
273
#define VBOXGUEST_IOCTL_CTL_CHECK_BALLOON_MASK VBOXGUEST_IOCTL_CODE_(7, 100)
1397
/** IOCTL to VBoxGuest to perform backdoor logging. */
276
/** IOCTL to VBoxGuest to perform backdoor logging.
277
* The argument is a string buffer of the specified size. */
1398
278
#define VBOXGUEST_IOCTL_LOG(Size) VBOXGUEST_IOCTL_CODE_(6, (Size))
1401
281
#ifdef VBOX_WITH_HGCM
1402
/* These structures are shared between the driver and other binaries,
1403
* therefore packing must be defined explicitely.
1406
typedef struct _VBoxGuestHGCMConnectInfo
1408
int32_t result; /**< OUT */
1409
HGCMServiceLocation Loc; /**< IN */
1410
uint32_t u32ClientID; /**< OUT */
1411
} VBoxGuestHGCMConnectInfo;
1412
AssertCompileSize(VBoxGuestHGCMConnectInfo, 4+4+128+4);
1414
typedef struct _VBoxGuestHGCMDisconnectInfo
1416
int32_t result; /**< OUT */
1417
uint32_t u32ClientID; /**< IN */
1418
} VBoxGuestHGCMDisconnectInfo;
1419
AssertCompileSize(VBoxGuestHGCMDisconnectInfo, 8);
1421
typedef struct _VBoxGuestHGCMCallInfo
1423
int32_t result; /**< OUT Host HGCM return code.*/
1424
uint32_t u32ClientID; /**< IN The id of the caller. */
1425
uint32_t u32Function; /**< IN Function number. */
1426
uint32_t cParms; /**< IN How many parms. */
1427
/* Parameters follow in form HGCMFunctionParameter aParms[cParms] */
1428
} VBoxGuestHGCMCallInfo;
1429
AssertCompileSize(VBoxGuestHGCMCallInfo, 16);
1431
typedef struct _VBoxGuestHGCMCallInfoTimed
1433
uint32_t u32Timeout; /**< IN How long to wait for completion before cancelling the call */
1434
uint32_t fInterruptible; /**< IN Is this request interruptible? */
1435
VBoxGuestHGCMCallInfo info; /**< IN/OUT The rest of the call information. Placed after the timeout
1436
* so that the parameters follow as they would for a normal call. */
1437
/* Parameters follow in form HGCMFunctionParameter aParms[cParms] */
1438
} VBoxGuestHGCMCallInfoTimed;
1439
AssertCompileSize(VBoxGuestHGCMCallInfoTimed, 8+16);
1442
# define VBOXGUEST_IOCTL_HGCM_CONNECT VBOXGUEST_IOCTL_CODE(16, sizeof(VBoxGuestHGCMConnectInfo))
1443
# define VBOXGUEST_IOCTL_HGCM_DISCONNECT VBOXGUEST_IOCTL_CODE(17, sizeof(VBoxGuestHGCMDisconnectInfo))
1444
# define VBOXGUEST_IOCTL_HGCM_CALL(Size) VBOXGUEST_IOCTL_CODE(18, (Size))
1445
# define VBOXGUEST_IOCTL_HGCM_CALL_TIMED(Size) VBOXGUEST_IOCTL_CODE(20, (Size))
1446
# define VBOXGUEST_IOCTL_CLIPBOARD_CONNECT VBOXGUEST_IOCTL_CODE_(19, sizeof(uint32_t))
282
/** IOCTL to VBoxGuest to connect to a HGCM service. */
283
# define VBOXGUEST_IOCTL_HGCM_CONNECT VBOXGUEST_IOCTL_CODE(16, sizeof(VBoxGuestHGCMConnectInfo))
285
/** IOCTL to VBoxGuest to disconnect from a HGCM service. */
286
# define VBOXGUEST_IOCTL_HGCM_DISCONNECT VBOXGUEST_IOCTL_CODE(17, sizeof(VBoxGuestHGCMDisconnectInfo))
288
/** IOCTL to VBoxGuest to make a call to a HGCM service.
289
* @see VBoxGuestHGCMCallInfo */
290
# define VBOXGUEST_IOCTL_HGCM_CALL(Size) VBOXGUEST_IOCTL_CODE(18, (Size))
292
/** IOCTL to VBoxGuest to make a timed call to a HGCM service. */
293
# define VBOXGUEST_IOCTL_HGCM_CALL_TIMED(Size) VBOXGUEST_IOCTL_CODE(20, (Size))
1447
295
# ifdef RT_ARCH_AMD64
1448
/* Following HGCM IOCtls can be used by a 32 bit application on a 64 bit guest (Windows OpenGL guest driver). */
1449
# define VBOXGUEST_IOCTL_HGCM_CONNECT_32 VBOXGUEST_IOCTL_CODE_32(16, sizeof(VBoxGuestHGCMConnectInfo))
1450
# define VBOXGUEST_IOCTL_HGCM_DISCONNECT_32 VBOXGUEST_IOCTL_CODE_32(17, sizeof(VBoxGuestHGCMDisconnectInfo))
1451
# define VBOXGUEST_IOCTL_HGCM_CALL_32(Size) VBOXGUEST_IOCTL_CODE_32(18, (Size))
1452
# define VBOXGUEST_IOCTL_HGCM_CALL_TIMED_32(Size) VBOXGUEST_IOCTL_CODE_32(20, (Size))
296
/** @name IOCTL numbers that 32-bit clients, like the Windows OpenGL guest
297
* driver, will use when taking to a 64-bit driver.
298
* @remarks These are only used by the driver implementation! */
299
# define VBOXGUEST_IOCTL_HGCM_CONNECT_32 VBOXGUEST_IOCTL_CODE_32(16, sizeof(VBoxGuestHGCMConnectInfo))
300
# define VBOXGUEST_IOCTL_HGCM_DISCONNECT_32 VBOXGUEST_IOCTL_CODE_32(17, sizeof(VBoxGuestHGCMDisconnectInfo))
301
# define VBOXGUEST_IOCTL_HGCM_CALL_32(Size) VBOXGUEST_IOCTL_CODE_32(18, (Size))
302
# define VBOXGUEST_IOCTL_HGCM_CALL_TIMED_32(Size) VBOXGUEST_IOCTL_CODE_32(20, (Size))
1453
304
# endif /* RT_ARCH_AMD64 */
1455
# define VBOXGUEST_HGCM_CALL_PARMS(a) ((HGCMFunctionParameter *)((uint8_t *)(a) + sizeof (VBoxGuestHGCMCallInfo)))
1456
# define VBOXGUEST_HGCM_CALL_PARMS32(a) ((HGCMFunctionParameter32 *)((uint8_t *)(a) + sizeof (VBoxGuestHGCMCallInfo)))
1458
#endif /* VBOX_WITH_HGCM */
1461
* Credentials request flags and structure
1464
#define VMMDEV_CREDENTIALS_STRLEN 128
1466
/** query from host whether credentials are present */
1467
#define VMMDEV_CREDENTIALS_QUERYPRESENCE RT_BIT(1)
1468
/** read credentials from host (can be combined with clear) */
1469
#define VMMDEV_CREDENTIALS_READ RT_BIT(2)
1470
/** clear credentials on host (can be combined with read) */
1471
#define VMMDEV_CREDENTIALS_CLEAR RT_BIT(3)
1472
/** read credentials for judgement in the guest */
1473
#define VMMDEV_CREDENTIALS_READJUDGE RT_BIT(8)
1474
/** clear credentials for judegement on the host */
1475
#define VMMDEV_CREDENTIALS_CLEARJUDGE RT_BIT(9)
1476
/** report credentials acceptance by guest */
1477
#define VMMDEV_CREDENTIALS_JUDGE_OK RT_BIT(10)
1478
/** report credentials denial by guest */
1479
#define VMMDEV_CREDENTIALS_JUDGE_DENY RT_BIT(11)
1480
/** report that no judgement could be made by guest */
1481
#define VMMDEV_CREDENTIALS_JUDGE_NOJUDGEMENT RT_BIT(12)
1483
/** flag telling the guest that credentials are present */
1484
#define VMMDEV_CREDENTIALS_PRESENT RT_BIT(16)
1485
/** flag telling guest that local logons should be prohibited */
1486
#define VMMDEV_CREDENTIALS_NOLOCALLOGON RT_BIT(17)
1488
/** credentials request structure */
1490
typedef struct _VMMDevCredentials
1492
/* request header */
1493
VMMDevRequestHeader header;
1494
/* request flags (in/out) */
1496
/* user name (UTF-8) (out) */
1497
char szUserName[VMMDEV_CREDENTIALS_STRLEN];
1498
/* password (UTF-8) (out) */
1499
char szPassword[VMMDEV_CREDENTIALS_STRLEN];
1500
/* domain name (UTF-8) (out) */
1501
char szDomain[VMMDEV_CREDENTIALS_STRLEN];
1502
} VMMDevCredentials;
1505
/** inline helper to determine the request size for the given operation */
1506
DECLINLINE(size_t) vmmdevGetRequestSize(VMMDevRequestType requestType)
1508
switch (requestType)
1510
case VMMDevReq_GetMouseStatus:
1511
case VMMDevReq_SetMouseStatus:
1512
return sizeof(VMMDevReqMouseStatus);
1513
case VMMDevReq_SetPointerShape:
1514
return sizeof(VMMDevReqMousePointer);
1515
case VMMDevReq_GetHostVersion:
1516
return sizeof(VMMDevReqHostVersion);
1517
case VMMDevReq_Idle:
1518
return sizeof(VMMDevReqIdle);
1519
case VMMDevReq_GetHostTime:
1520
return sizeof(VMMDevReqHostTime);
1521
case VMMDevReq_GetHypervisorInfo:
1522
case VMMDevReq_SetHypervisorInfo:
1523
return sizeof(VMMDevReqHypervisorInfo);
1524
case VMMDevReq_RegisterPatchMemory:
1525
case VMMDevReq_DeregisterPatchMemory:
1526
return sizeof(VMMDevReqPatchMemory);
1527
case VMMDevReq_SetPowerStatus:
1528
return sizeof(VMMDevPowerStateRequest);
1529
case VMMDevReq_AcknowledgeEvents:
1530
return sizeof(VMMDevEvents);
1531
case VMMDevReq_ReportGuestInfo:
1532
return sizeof(VMMDevReportGuestInfo);
1533
case VMMDevReq_GetDisplayChangeRequest:
1534
return sizeof(VMMDevDisplayChangeRequest);
1535
case VMMDevReq_GetDisplayChangeRequest2:
1536
return sizeof(VMMDevDisplayChangeRequest2);
1537
case VMMDevReq_VideoModeSupported:
1538
return sizeof(VMMDevVideoModeSupportedRequest);
1539
case VMMDevReq_GetHeightReduction:
1540
return sizeof(VMMDevGetHeightReductionRequest);
1541
case VMMDevReq_ReportGuestCapabilities:
1542
return sizeof(VMMDevReqGuestCapabilities);
1543
case VMMDevReq_SetGuestCapabilities:
1544
return sizeof(VMMDevReqGuestCapabilities2);
1545
#ifdef VBOX_WITH_HGCM
1546
case VMMDevReq_HGCMConnect:
1547
return sizeof(VMMDevHGCMConnect);
1548
case VMMDevReq_HGCMDisconnect:
1549
return sizeof(VMMDevHGCMDisconnect);
1550
#ifdef VBOX_WITH_64_BITS_GUESTS
1551
case VMMDevReq_HGCMCall32:
1552
return sizeof(VMMDevHGCMCall);
1553
case VMMDevReq_HGCMCall64:
1554
return sizeof(VMMDevHGCMCall);
1556
case VMMDevReq_HGCMCall:
1557
return sizeof(VMMDevHGCMCall);
1558
#endif /* VBOX_WITH_64_BITS_GUESTS */
1559
case VMMDevReq_HGCMCancel:
1560
return sizeof(VMMDevHGCMCancel);
1561
#endif /* VBOX_WITH_HGCM */
1562
case VMMDevReq_VideoAccelEnable:
1563
return sizeof(VMMDevVideoAccelEnable);
1564
case VMMDevReq_VideoAccelFlush:
1565
return sizeof(VMMDevVideoAccelFlush);
1566
case VMMDevReq_VideoSetVisibleRegion:
1567
return sizeof(VMMDevVideoSetVisibleRegion);
1568
case VMMDevReq_GetSeamlessChangeRequest:
1569
return sizeof(VMMDevSeamlessChangeRequest);
1570
case VMMDevReq_QueryCredentials:
1571
return sizeof(VMMDevCredentials);
1572
case VMMDevReq_ReportGuestStats:
1573
return sizeof(VMMDevReportGuestStats);
1574
case VMMDevReq_GetMemBalloonChangeRequest:
1575
return sizeof(VMMDevGetMemBalloonChangeRequest);
1576
case VMMDevReq_GetStatisticsChangeRequest:
1577
return sizeof(VMMDevGetStatisticsChangeRequest);
1578
case VMMDevReq_ChangeMemBalloon:
1579
return sizeof(VMMDevChangeMemBalloon);
1580
case VMMDevReq_GetVRDPChangeRequest:
1581
return sizeof(VMMDevVRDPChangeRequest);
1582
case VMMDevReq_LogString:
1583
return sizeof(VMMDevReqLogString);
1590
* Initializes a request structure.
1593
DECLINLINE(int) vmmdevInitRequest(VMMDevRequestHeader *req, VMMDevRequestType type)
1595
uint32_t requestSize;
1597
return VERR_INVALID_PARAMETER;
1598
requestSize = (uint32_t)vmmdevGetRequestSize(type);
1600
return VERR_INVALID_PARAMETER;
1601
req->size = requestSize;
1602
req->version = VMMDEV_REQUEST_HEADER_VERSION;
1603
req->requestType = type;
1604
req->rc = VERR_GENERAL_FAILURE;
1607
return VINF_SUCCESS;
306
/** Get the pointer to the first HGCM parameter. */
307
# define VBOXGUEST_HGCM_CALL_PARMS(a) ( (HGCMFunctionParameter *)((uint8_t *)(a) + sizeof(VBoxGuestHGCMCallInfo)) )
308
/** Get the pointer to the first HGCM parameter in a 32-bit request. */
309
# define VBOXGUEST_HGCM_CALL_PARMS32(a) ( (HGCMFunctionParameter32 *)((uint8_t *)(a) + sizeof(VBoxGuestHGCMCallInfo)) )
311
/** IOCTL to VBoxGuest to make a connect to the clipboard service.
312
* @todo Seems this is no longer is use. Try remove it. */
313
# define VBOXGUEST_IOCTL_CLIPBOARD_CONNECT VBOXGUEST_IOCTL_CODE_(19, sizeof(uint32_t))
315
#endif /* VBOX_WITH_HGCM */
1611
318
#ifdef RT_OS_OS2