VirtualBox

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

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

Use separate IO control codes for 32 bit and 64 bit requests in the guest driver.

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

© 2024 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette