VBoxGuest.h revision 25b47a1efb63828291dbfb50fcddd1083ef8d691
9055f61bb57d2a625c6434d55beac7565c3b3c0dvboxsync * VBoxGuest - VirtualBox Guest Additions interface
9055f61bb57d2a625c6434d55beac7565c3b3c0dvboxsync * Copyright (C) 2006-2007 innotek GmbH
9055f61bb57d2a625c6434d55beac7565c3b3c0dvboxsync * This file is part of VirtualBox Open Source Edition (OSE), as
9055f61bb57d2a625c6434d55beac7565c3b3c0dvboxsync * available from http://www.virtualbox.org. This file is free software;
9055f61bb57d2a625c6434d55beac7565c3b3c0dvboxsync * you can redistribute it and/or modify it under the terms of the GNU
9055f61bb57d2a625c6434d55beac7565c3b3c0dvboxsync * General Public License as published by the Free Software Foundation,
9055f61bb57d2a625c6434d55beac7565c3b3c0dvboxsync * in version 2 as it comes in the "COPYING" file of the VirtualBox OSE
9055f61bb57d2a625c6434d55beac7565c3b3c0dvboxsync * distribution. VirtualBox OSE is distributed in the hope that it will
9055f61bb57d2a625c6434d55beac7565c3b3c0dvboxsync * be useful, but WITHOUT ANY WARRANTY of any kind.
9055f61bb57d2a625c6434d55beac7565c3b3c0dvboxsync/*******************************************************************************
9055f61bb57d2a625c6434d55beac7565c3b3c0dvboxsync* Defined Constants And Macros *
9055f61bb57d2a625c6434d55beac7565c3b3c0dvboxsync*******************************************************************************/
9055f61bb57d2a625c6434d55beac7565c3b3c0dvboxsync/** @todo The following is a temporary fix for the problem of accessing
9055f61bb57d2a625c6434d55beac7565c3b3c0dvboxsync hypervisor pointers from within guest additions */
9055f61bb57d2a625c6434d55beac7565c3b3c0dvboxsync/** Hypervisor linear pointer size type */
9055f61bb57d2a625c6434d55beac7565c3b3c0dvboxsync/** Hypervisor physical pointer size type */
9055f61bb57d2a625c6434d55beac7565c3b3c0dvboxsync/** The support device name. */
9055f61bb57d2a625c6434d55beac7565c3b3c0dvboxsync/** The support device name. */
9055f61bb57d2a625c6434d55beac7565c3b3c0dvboxsync/** The support service name. */
9055f61bb57d2a625c6434d55beac7565c3b3c0dvboxsync/** Win32 Device name. */
9055f61bb57d2a625c6434d55beac7565c3b3c0dvboxsync/** Global name for Win2k+ */
9055f61bb57d2a625c6434d55beac7565c3b3c0dvboxsync# define VBOXGUEST_DEVICE_NAME_GLOBAL "\\\\.\\Global\\VBoxGuest"
9055f61bb57d2a625c6434d55beac7565c3b3c0dvboxsync/** Win32 driver name */
3a343ca21a267ec3c54e2317e2ed18fe99b8ebbbvboxsync# define VBOXGUEST_DEVICE_NAME_NT L"\\Device\\VBoxGuest"
9055f61bb57d2a625c6434d55beac7565c3b3c0dvboxsync/** device name */
9055f61bb57d2a625c6434d55beac7565c3b3c0dvboxsync# define VBOXGUEST_DEVICE_NAME_DOS L"\\DosDevices\\VBoxGuest"
9055f61bb57d2a625c6434d55beac7565c3b3c0dvboxsync/* PORTME */
9055f61bb57d2a625c6434d55beac7565c3b3c0dvboxsync/** VirtualBox vendor ID */
3a343ca21a267ec3c54e2317e2ed18fe99b8ebbbvboxsync/** VMMDev PCI card identifiers */
9055f61bb57d2a625c6434d55beac7565c3b3c0dvboxsync/** VirtualBox graphics card identifiers */
9055f61bb57d2a625c6434d55beac7565c3b3c0dvboxsync * VBoxGuest port definitions
9055f61bb57d2a625c6434d55beac7565c3b3c0dvboxsync/** guest can (== wants to) handle absolute coordinates */
9055f61bb57d2a625c6434d55beac7565c3b3c0dvboxsync/** host can (== wants to) send absolute coordinates */
9055f61bb57d2a625c6434d55beac7565c3b3c0dvboxsync/** guest can *NOT* switch to software cursor and therefore depends on the host cursor */
9055f61bb57d2a625c6434d55beac7565c3b3c0dvboxsync#define VBOXGUEST_MOUSE_GUEST_NEEDS_HOST_CURSOR BIT(2)
9055f61bb57d2a625c6434d55beac7565c3b3c0dvboxsync/** host does NOT provide support for drawing the cursor itself (e.g. L4 console) */
9055f61bb57d2a625c6434d55beac7565c3b3c0dvboxsync#define VBOXGUEST_MOUSE_HOST_CANNOT_HWPOINTER BIT(3)
9055f61bb57d2a625c6434d55beac7565c3b3c0dvboxsync/** fictive start address of the hypervisor physical memory for MmMapIoSpace */
9055f61bb57d2a625c6434d55beac7565c3b3c0dvboxsync * VMMDev Generic Request Interface
9055f61bb57d2a625c6434d55beac7565c3b3c0dvboxsync/** port for generic request interface */
9055f61bb57d2a625c6434d55beac7565c3b3c0dvboxsync/** Current version of the VMMDev interface.
9055f61bb57d2a625c6434d55beac7565c3b3c0dvboxsync * Additions are allowed to work only if
9055f61bb57d2a625c6434d55beac7565c3b3c0dvboxsync * additions_major == vmmdev_current && additions_minor <= vmmdev_current.
9055f61bb57d2a625c6434d55beac7565c3b3c0dvboxsync * Additions version is reported to host (VMMDev) by VMMDevReq_ReportGuestInfo.
9055f61bb57d2a625c6434d55beac7565c3b3c0dvboxsync * @remark These defines also live in the 16-bit and assembly versions of this header.
9055f61bb57d2a625c6434d55beac7565c3b3c0dvboxsync#define VMMDEV_VERSION ((VMMDEV_VERSION_MAJOR << 16) | VMMDEV_VERSION_MINOR)
9055f61bb57d2a625c6434d55beac7565c3b3c0dvboxsync * VMMDev request types.
9055f61bb57d2a625c6434d55beac7565c3b3c0dvboxsync * @note when updating this, adjust vmmdevGetRequestSize() as well
9055f61bb57d2a625c6434d55beac7565c3b3c0dvboxsynctypedef enum
9055f61bb57d2a625c6434d55beac7565c3b3c0dvboxsync /** @todo implement on host side */
9055f61bb57d2a625c6434d55beac7565c3b3c0dvboxsync/** Version of VMMDevRequestHeader structure. */
9055f61bb57d2a625c6434d55beac7565c3b3c0dvboxsync/** generic VMMDev request header */
9055f61bb57d2a625c6434d55beac7565c3b3c0dvboxsynctypedef struct
9055f61bb57d2a625c6434d55beac7565c3b3c0dvboxsync /** size of the structure in bytes (including body). Filled by caller */
9055f61bb57d2a625c6434d55beac7565c3b3c0dvboxsync /** version of the structure. Filled by caller */
9055f61bb57d2a625c6434d55beac7565c3b3c0dvboxsync /** type of the request */
9055f61bb57d2a625c6434d55beac7565c3b3c0dvboxsync /** return code. Filled by VMMDev */
9055f61bb57d2a625c6434d55beac7565c3b3c0dvboxsync /** reserved fields */
9055f61bb57d2a625c6434d55beac7565c3b3c0dvboxsync/** mouse status request structure */
9055f61bb57d2a625c6434d55beac7565c3b3c0dvboxsynctypedef struct
9055f61bb57d2a625c6434d55beac7565c3b3c0dvboxsync /** header */
9055f61bb57d2a625c6434d55beac7565c3b3c0dvboxsync /** mouse feature mask */
9055f61bb57d2a625c6434d55beac7565c3b3c0dvboxsync /** mouse x position */
9055f61bb57d2a625c6434d55beac7565c3b3c0dvboxsync /** mouse y position */
9055f61bb57d2a625c6434d55beac7565c3b3c0dvboxsync/** Note VBOX_MOUSE_POINTER_* flags are used in guest video driver,
9055f61bb57d2a625c6434d55beac7565c3b3c0dvboxsync * values must be <= 0x8000 and must not be changed.
9055f61bb57d2a625c6434d55beac7565c3b3c0dvboxsync/** pointer is visible */
9055f61bb57d2a625c6434d55beac7565c3b3c0dvboxsync/** pointer has alpha channel */
9055f61bb57d2a625c6434d55beac7565c3b3c0dvboxsync/** pointerData contains new pointer shape */
9055f61bb57d2a625c6434d55beac7565c3b3c0dvboxsync/** mouse pointer shape/visibility change request */
9055f61bb57d2a625c6434d55beac7565c3b3c0dvboxsynctypedef struct
9055f61bb57d2a625c6434d55beac7565c3b3c0dvboxsync /** header */
9055f61bb57d2a625c6434d55beac7565c3b3c0dvboxsync /** VBOX_MOUSE_POINTER_* bit flags */
9055f61bb57d2a625c6434d55beac7565c3b3c0dvboxsync /** x coordinate of hot spot */
9055f61bb57d2a625c6434d55beac7565c3b3c0dvboxsync /** y coordinate of hot spot */
9055f61bb57d2a625c6434d55beac7565c3b3c0dvboxsync /** width of the pointer in pixels */
9055f61bb57d2a625c6434d55beac7565c3b3c0dvboxsync /** height of the pointer in scanlines */
9055f61bb57d2a625c6434d55beac7565c3b3c0dvboxsync /** Pointer data.
9055f61bb57d2a625c6434d55beac7565c3b3c0dvboxsync * The data consists of 1 bpp AND mask followed by 32 bpp XOR (color) mask.
9055f61bb57d2a625c6434d55beac7565c3b3c0dvboxsync * For pointers without alpha channel the XOR mask pixels are 32 bit values: (lsb)BGR0(msb).
9055f61bb57d2a625c6434d55beac7565c3b3c0dvboxsync * For pointers with alpha channel the XOR mask consists of (lsb)BGRA(msb) 32 bit values.
9055f61bb57d2a625c6434d55beac7565c3b3c0dvboxsync * Guest driver must create the AND mask for pointers with alpha channel, so if host does not
9055f61bb57d2a625c6434d55beac7565c3b3c0dvboxsync * support alpha, the pointer could be displayed as a normal color pointer. The AND mask can
9055f61bb57d2a625c6434d55beac7565c3b3c0dvboxsync * be constructed from alpha values. For example alpha value >= 0xf0 means bit 0 in the AND mask.
9055f61bb57d2a625c6434d55beac7565c3b3c0dvboxsync * The AND mask is 1 bpp bitmap with byte aligned scanlines. Size of AND mask,
9055f61bb57d2a625c6434d55beac7565c3b3c0dvboxsync * therefore, is cbAnd = (width + 7) / 8 * height. The padding bits at the
9055f61bb57d2a625c6434d55beac7565c3b3c0dvboxsync * end of any scanline are undefined.
9055f61bb57d2a625c6434d55beac7565c3b3c0dvboxsync * The XOR mask follows the AND mask on the next 4 bytes aligned offset:
9055f61bb57d2a625c6434d55beac7565c3b3c0dvboxsync * uint8_t *pXor = pAnd + (cbAnd + 3) & ~3
9055f61bb57d2a625c6434d55beac7565c3b3c0dvboxsync * Bytes in the gap between the AND and the XOR mask are undefined.
9055f61bb57d2a625c6434d55beac7565c3b3c0dvboxsync * XOR mask scanlines have no gap between them and size of XOR mask is:
9055f61bb57d2a625c6434d55beac7565c3b3c0dvboxsync * cXor = width * 4 * height.
9055f61bb57d2a625c6434d55beac7565c3b3c0dvboxsync * Preallocate 4 bytes for accessing actual data as p->pointerData
9055f61bb57d2a625c6434d55beac7565c3b3c0dvboxsync/** string log request structure */
9055f61bb57d2a625c6434d55beac7565c3b3c0dvboxsynctypedef struct
9055f61bb57d2a625c6434d55beac7565c3b3c0dvboxsync /** header */
9055f61bb57d2a625c6434d55beac7565c3b3c0dvboxsync /** variable length string data */
9055f61bb57d2a625c6434d55beac7565c3b3c0dvboxsync/** host version request structure */
9055f61bb57d2a625c6434d55beac7565c3b3c0dvboxsynctypedef struct
9055f61bb57d2a625c6434d55beac7565c3b3c0dvboxsync /** header */
9055f61bb57d2a625c6434d55beac7565c3b3c0dvboxsync /** major version */
9055f61bb57d2a625c6434d55beac7565c3b3c0dvboxsync /** minor version */
9055f61bb57d2a625c6434d55beac7565c3b3c0dvboxsync /** build number */
9055f61bb57d2a625c6434d55beac7565c3b3c0dvboxsync/** guest capabilites structure */
9055f61bb57d2a625c6434d55beac7565c3b3c0dvboxsynctypedef struct
9055f61bb57d2a625c6434d55beac7565c3b3c0dvboxsync /** header */
9055f61bb57d2a625c6434d55beac7565c3b3c0dvboxsync /** capabilities (VMMDEV_GUEST_*) */
9055f61bb57d2a625c6434d55beac7565c3b3c0dvboxsync/** idle request structure */
9055f61bb57d2a625c6434d55beac7565c3b3c0dvboxsynctypedef struct
9055f61bb57d2a625c6434d55beac7565c3b3c0dvboxsync /** header */
9055f61bb57d2a625c6434d55beac7565c3b3c0dvboxsync/** host time request structure */
9055f61bb57d2a625c6434d55beac7565c3b3c0dvboxsynctypedef struct
9055f61bb57d2a625c6434d55beac7565c3b3c0dvboxsync /** header */
9055f61bb57d2a625c6434d55beac7565c3b3c0dvboxsync /** time in milliseconds since unix epoch. Filled by VMMDev. */
9055f61bb57d2a625c6434d55beac7565c3b3c0dvboxsync/** hypervisor info structure */
9055f61bb57d2a625c6434d55beac7565c3b3c0dvboxsynctypedef struct
9055f61bb57d2a625c6434d55beac7565c3b3c0dvboxsync /** header */
9055f61bb57d2a625c6434d55beac7565c3b3c0dvboxsync /** guest virtual address of proposed hypervisor start */
9055f61bb57d2a625c6434d55beac7565c3b3c0dvboxsync /** hypervisor size in bytes */
9055f61bb57d2a625c6434d55beac7565c3b3c0dvboxsync/** system power requests */
9055f61bb57d2a625c6434d55beac7565c3b3c0dvboxsynctypedef enum
9055f61bb57d2a625c6434d55beac7565c3b3c0dvboxsync/** system power status structure */
9055f61bb57d2a625c6434d55beac7565c3b3c0dvboxsynctypedef struct
9055f61bb57d2a625c6434d55beac7565c3b3c0dvboxsync /** header */
9055f61bb57d2a625c6434d55beac7565c3b3c0dvboxsync /** power state request */
9055f61bb57d2a625c6434d55beac7565c3b3c0dvboxsync/** pending events structure */
9055f61bb57d2a625c6434d55beac7565c3b3c0dvboxsynctypedef struct
340ee06f35257fee1bd68223ab3504cf2b1d0c3evboxsync /** header */
340ee06f35257fee1bd68223ab3504cf2b1d0c3evboxsync /** pending event bitmap */
340ee06f35257fee1bd68223ab3504cf2b1d0c3evboxsync/** guest filter mask control */
340ee06f35257fee1bd68223ab3504cf2b1d0c3evboxsynctypedef struct
340ee06f35257fee1bd68223ab3504cf2b1d0c3evboxsync /** header */
340ee06f35257fee1bd68223ab3504cf2b1d0c3evboxsync /** mask of events to be added to filter */
340ee06f35257fee1bd68223ab3504cf2b1d0c3evboxsync /** mask of events to be removed from filter */
340ee06f35257fee1bd68223ab3504cf2b1d0c3evboxsync/** guest information structure */
340ee06f35257fee1bd68223ab3504cf2b1d0c3evboxsync /** The VMMDev interface version expected by additions. */
340ee06f35257fee1bd68223ab3504cf2b1d0c3evboxsync /** guest OS type */
340ee06f35257fee1bd68223ab3504cf2b1d0c3evboxsync /** @todo */
340ee06f35257fee1bd68223ab3504cf2b1d0c3evboxsync/** guest information structure */
340ee06f35257fee1bd68223ab3504cf2b1d0c3evboxsynctypedef struct
340ee06f35257fee1bd68223ab3504cf2b1d0c3evboxsync /** header */
340ee06f35257fee1bd68223ab3504cf2b1d0c3evboxsync /** Guest information. */
340ee06f35257fee1bd68223ab3504cf2b1d0c3evboxsync/** guest statistics values */
340ee06f35257fee1bd68223ab3504cf2b1d0c3evboxsync/** guest statistics structure */
340ee06f35257fee1bd68223ab3504cf2b1d0c3evboxsync /** Virtual CPU id */
340ee06f35257fee1bd68223ab3504cf2b1d0c3evboxsync /** Reported statistics */
340ee06f35257fee1bd68223ab3504cf2b1d0c3evboxsync /** Idle CPU load (0-100) for last interval */
340ee06f35257fee1bd68223ab3504cf2b1d0c3evboxsync /** Kernel CPU load (0-100) for last interval */
340ee06f35257fee1bd68223ab3504cf2b1d0c3evboxsync /** User CPU load (0-100) for last interval */
340ee06f35257fee1bd68223ab3504cf2b1d0c3evboxsync /** Nr of threads */
340ee06f35257fee1bd68223ab3504cf2b1d0c3evboxsync /** Nr of processes */
340ee06f35257fee1bd68223ab3504cf2b1d0c3evboxsync /** Nr of handles */
340ee06f35257fee1bd68223ab3504cf2b1d0c3evboxsync /** Memory load (0-100) */
340ee06f35257fee1bd68223ab3504cf2b1d0c3evboxsync /** Page size of guest system */
340ee06f35257fee1bd68223ab3504cf2b1d0c3evboxsync /** Total physical memory (in 4kb pages) */
340ee06f35257fee1bd68223ab3504cf2b1d0c3evboxsync /** Available physical memory (in 4kb pages) */
340ee06f35257fee1bd68223ab3504cf2b1d0c3evboxsync /** Ballooned physical memory (in 4kb pages) */
340ee06f35257fee1bd68223ab3504cf2b1d0c3evboxsync /** Total number of committed memory (which is not necessarily in-use) (in 4kb pages) */
340ee06f35257fee1bd68223ab3504cf2b1d0c3evboxsync /** Total amount of memory used by the kernel (in 4kb pages) */
340ee06f35257fee1bd68223ab3504cf2b1d0c3evboxsync /** Total amount of paged memory used by the kernel (in 4kb pages) */
340ee06f35257fee1bd68223ab3504cf2b1d0c3evboxsync /** Total amount of nonpaged memory used by the kernel (in 4kb pages) */
340ee06f35257fee1bd68223ab3504cf2b1d0c3evboxsync /** Total amount of memory used for the system cache (in 4kb pages) */
340ee06f35257fee1bd68223ab3504cf2b1d0c3evboxsync /** Pagefile size (in 4kb pages) */
340ee06f35257fee1bd68223ab3504cf2b1d0c3evboxsync/** guest statistics command structure */
340ee06f35257fee1bd68223ab3504cf2b1d0c3evboxsynctypedef struct
340ee06f35257fee1bd68223ab3504cf2b1d0c3evboxsync /** header */
340ee06f35257fee1bd68223ab3504cf2b1d0c3evboxsync /** Guest information. */
340ee06f35257fee1bd68223ab3504cf2b1d0c3evboxsync/** memory balloon change request structure */
340ee06f35257fee1bd68223ab3504cf2b1d0c3evboxsync#define VMMDEV_MAX_MEMORY_BALLOON(PhysMemTotal) ((90*PhysMemTotal)/100)
340ee06f35257fee1bd68223ab3504cf2b1d0c3evboxsynctypedef struct
340ee06f35257fee1bd68223ab3504cf2b1d0c3evboxsync /** header */
340ee06f35257fee1bd68223ab3504cf2b1d0c3evboxsync uint32_t u32BalloonSize; /* balloon size in megabytes */
340ee06f35257fee1bd68223ab3504cf2b1d0c3evboxsync uint32_t u32PhysMemSize; /* guest ram size in megabytes */
340ee06f35257fee1bd68223ab3504cf2b1d0c3evboxsync/** inflate/deflate memory balloon structure */
340ee06f35257fee1bd68223ab3504cf2b1d0c3evboxsync#define VMMDEV_MEMORY_BALLOON_CHUNK_PAGES (_1M/4096)
340ee06f35257fee1bd68223ab3504cf2b1d0c3evboxsync#define VMMDEV_MEMORY_BALLOON_CHUNK_SIZE (VMMDEV_MEMORY_BALLOON_CHUNK_PAGES*4096)
340ee06f35257fee1bd68223ab3504cf2b1d0c3evboxsynctypedef struct
340ee06f35257fee1bd68223ab3504cf2b1d0c3evboxsync /** header */
340ee06f35257fee1bd68223ab3504cf2b1d0c3evboxsync uint32_t fInflate; /* true = inflate, false = defalte */
340ee06f35257fee1bd68223ab3504cf2b1d0c3evboxsync/** guest statistics interval change request structure */
340ee06f35257fee1bd68223ab3504cf2b1d0c3evboxsynctypedef struct
340ee06f35257fee1bd68223ab3504cf2b1d0c3evboxsync /** header */
340ee06f35257fee1bd68223ab3504cf2b1d0c3evboxsync uint32_t u32StatInterval; /* interval in seconds */
340ee06f35257fee1bd68223ab3504cf2b1d0c3evboxsync/** display change request structure */
340ee06f35257fee1bd68223ab3504cf2b1d0c3evboxsynctypedef struct
340ee06f35257fee1bd68223ab3504cf2b1d0c3evboxsync /** header */
340ee06f35257fee1bd68223ab3504cf2b1d0c3evboxsync /** horizontal pixel resolution (0 = do not change) */
340ee06f35257fee1bd68223ab3504cf2b1d0c3evboxsync /** vertical pixel resolution (0 = do not change) */
340ee06f35257fee1bd68223ab3504cf2b1d0c3evboxsync /** bits per pixel (0 = do not change) */
340ee06f35257fee1bd68223ab3504cf2b1d0c3evboxsync /** Flag that the request is an acknowlegement for the VMMDEV_EVENT_DISPLAY_CHANGE_REQUEST.
340ee06f35257fee1bd68223ab3504cf2b1d0c3evboxsync * Values: 0 - just querying, VMMDEV_EVENT_DISPLAY_CHANGE_REQUEST - event acknowledged.
340ee06f35257fee1bd68223ab3504cf2b1d0c3evboxsynctypedef struct
340ee06f35257fee1bd68223ab3504cf2b1d0c3evboxsync /** header */
340ee06f35257fee1bd68223ab3504cf2b1d0c3evboxsync /** horizontal pixel resolution (0 = do not change) */
340ee06f35257fee1bd68223ab3504cf2b1d0c3evboxsync /** vertical pixel resolution (0 = do not change) */
340ee06f35257fee1bd68223ab3504cf2b1d0c3evboxsync /** bits per pixel (0 = do not change) */
9cdd4d805ecb43126372f7cf12e4032836cb738avboxsync /** Flag that the request is an acknowlegement for the VMMDEV_EVENT_DISPLAY_CHANGE_REQUEST.
340ee06f35257fee1bd68223ab3504cf2b1d0c3evboxsync * Values: 0 - just querying, VMMDEV_EVENT_DISPLAY_CHANGE_REQUEST - event acknowledged.
340ee06f35257fee1bd68223ab3504cf2b1d0c3evboxsync /** 0 for primary display, 1 for the first secondary, etc. */
340ee06f35257fee1bd68223ab3504cf2b1d0c3evboxsync/** video mode supported request structure */
340ee06f35257fee1bd68223ab3504cf2b1d0c3evboxsynctypedef struct
340ee06f35257fee1bd68223ab3504cf2b1d0c3evboxsync /** header */
340ee06f35257fee1bd68223ab3504cf2b1d0c3evboxsync /** horizontal pixel resolution (input) */
340ee06f35257fee1bd68223ab3504cf2b1d0c3evboxsync /** vertical pixel resolution (input) */
340ee06f35257fee1bd68223ab3504cf2b1d0c3evboxsync /** bits per pixel (input) */
340ee06f35257fee1bd68223ab3504cf2b1d0c3evboxsync /** supported flag (output) */
340ee06f35257fee1bd68223ab3504cf2b1d0c3evboxsync/** video modes height reduction request structure */
340ee06f35257fee1bd68223ab3504cf2b1d0c3evboxsynctypedef struct
340ee06f35257fee1bd68223ab3504cf2b1d0c3evboxsync /** header */
340ee06f35257fee1bd68223ab3504cf2b1d0c3evboxsync /** height reduction in pixels (output) */
340ee06f35257fee1bd68223ab3504cf2b1d0c3evboxsync#define VRDP_EXPERIENCE_LEVEL_ZERO 0 /* Theming disabled. */
340ee06f35257fee1bd68223ab3504cf2b1d0c3evboxsync#define VRDP_EXPERIENCE_LEVEL_LOW 1 /* Full window dragging and desktop wallpaper disabled. */
340ee06f35257fee1bd68223ab3504cf2b1d0c3evboxsync#define VRDP_EXPERIENCE_LEVEL_MEDIUM 2 /* Font smoothing, gradients. */
340ee06f35257fee1bd68223ab3504cf2b1d0c3evboxsync#define VRDP_EXPERIENCE_LEVEL_HIGH 3 /* Animation effects disabled. */
340ee06f35257fee1bd68223ab3504cf2b1d0c3evboxsync#define VRDP_EXPERIENCE_LEVEL_FULL 4 /* Everything enabled. */
340ee06f35257fee1bd68223ab3504cf2b1d0c3evboxsynctypedef struct
340ee06f35257fee1bd68223ab3504cf2b1d0c3evboxsync /** header */
340ee06f35257fee1bd68223ab3504cf2b1d0c3evboxsync /** Whether VRDP is active or not */
340ee06f35257fee1bd68223ab3504cf2b1d0c3evboxsync /** The configured experience level for active VRDP. */
340ee06f35257fee1bd68223ab3504cf2b1d0c3evboxsync/** HGCM flags.
340ee06f35257fee1bd68223ab3504cf2b1d0c3evboxsync /** Request header. */
340ee06f35257fee1bd68223ab3504cf2b1d0c3evboxsync /** HGCM flags. */
340ee06f35257fee1bd68223ab3504cf2b1d0c3evboxsync /** Result code. */
340ee06f35257fee1bd68223ab3504cf2b1d0c3evboxsync/** HGCM service location types. */
340ee06f35257fee1bd68223ab3504cf2b1d0c3evboxsynctypedef enum
340ee06f35257fee1bd68223ab3504cf2b1d0c3evboxsynctypedef struct
340ee06f35257fee1bd68223ab3504cf2b1d0c3evboxsync /** Type of the location. */
340ee06f35257fee1bd68223ab3504cf2b1d0c3evboxsynctypedef struct
340ee06f35257fee1bd68223ab3504cf2b1d0c3evboxsync /* request header */
340ee06f35257fee1bd68223ab3504cf2b1d0c3evboxsync /** IN: Description of service to connect to. */
340ee06f35257fee1bd68223ab3504cf2b1d0c3evboxsync /** OUT: Client identifier assigned by local instance of HGCM. */
340ee06f35257fee1bd68223ab3504cf2b1d0c3evboxsynctypedef struct
340ee06f35257fee1bd68223ab3504cf2b1d0c3evboxsync /* request header */
340ee06f35257fee1bd68223ab3504cf2b1d0c3evboxsync /** IN: Client identifier. */
340ee06f35257fee1bd68223ab3504cf2b1d0c3evboxsynctypedef enum
9055f61bb57d2a625c6434d55beac7565c3b3c0dvboxsync VMMDevHGCMParmType_LinAddr_In = 5, /**< In (read; host<-guest) */
9055f61bb57d2a625c6434d55beac7565c3b3c0dvboxsync VMMDevHGCMParmType_LinAddr_Out = 6, /**< Out (write; host->guest) */
9055f61bb57d2a625c6434d55beac7565c3b3c0dvboxsync VMMDevHGCMParmType_LinAddr_Locked = 7, /**< Locked In and Out */
9055f61bb57d2a625c6434d55beac7565c3b3c0dvboxsync VMMDevHGCMParmType_LinAddr_Locked_In = 8, /**< Locked In (read; host<-guest) */
9055f61bb57d2a625c6434d55beac7565c3b3c0dvboxsync VMMDevHGCMParmType_LinAddr_Locked_Out = 9, /**< Locked Out (write; host->guest) */
9055f61bb57d2a625c6434d55beac7565c3b3c0dvboxsynctypedef struct
9055f61bb57d2a625c6434d55beac7565c3b3c0dvboxsync /* request header */
9055f61bb57d2a625c6434d55beac7565c3b3c0dvboxsync /** IN: Client identifier. */
9055f61bb57d2a625c6434d55beac7565c3b3c0dvboxsync /** IN: Service function number. */
9055f61bb57d2a625c6434d55beac7565c3b3c0dvboxsync /** IN: Number of parameters. */
9055f61bb57d2a625c6434d55beac7565c3b3c0dvboxsync /** Parameters follow in form: HGCMFunctionParameter aParms[X]; */
9055f61bb57d2a625c6434d55beac7565c3b3c0dvboxsync#define VMMDEV_HGCM_CALL_PARMS(a) ((HGCMFunctionParameter *)((char *)a + sizeof (VMMDevHGCMCall)))
9055f61bb57d2a625c6434d55beac7565c3b3c0dvboxsync#endif /* VBOX_HGCM */
9055f61bb57d2a625c6434d55beac7565c3b3c0dvboxsync /* request header */
9055f61bb57d2a625c6434d55beac7565c3b3c0dvboxsync /** 0 - disable, !0 - enable. */
9055f61bb57d2a625c6434d55beac7565c3b3c0dvboxsync /** The size of VBVAMEMORY::au8RingBuffer expected by driver.
9055f61bb57d2a625c6434d55beac7565c3b3c0dvboxsync * The host will refuse to enable VBVA if the size is not equal to
9055f61bb57d2a625c6434d55beac7565c3b3c0dvboxsync * VBVA_RING_BUFFER_SIZE.
9055f61bb57d2a625c6434d55beac7565c3b3c0dvboxsync /** Guest initializes the status to 0. Host sets appropriate VBVA_F_STATUS_ flags. */
9055f61bb57d2a625c6434d55beac7565c3b3c0dvboxsync /* request header */
9055f61bb57d2a625c6434d55beac7565c3b3c0dvboxsync /* request header */
9055f61bb57d2a625c6434d55beac7565c3b3c0dvboxsync /** Number of rectangles */
9055f61bb57d2a625c6434d55beac7565c3b3c0dvboxsync /** Rectangle array */
9055f61bb57d2a625c6434d55beac7565c3b3c0dvboxsync/** Seamless mode */
9055f61bb57d2a625c6434d55beac7565c3b3c0dvboxsynctypedef enum
9055f61bb57d2a625c6434d55beac7565c3b3c0dvboxsync VMMDev_Seamless_Disabled = 0, /* normal mode; entire guest desktop displayed */
9055f61bb57d2a625c6434d55beac7565c3b3c0dvboxsync VMMDev_Seamless_Visible_Region = 1, /* visible region mode; only top-level guest windows displayed */
9055f61bb57d2a625c6434d55beac7565c3b3c0dvboxsync VMMDev_Seamless_Host_Window = 2 /* windowed mode; each top-level guest window is represented in a host window */
9055f61bb57d2a625c6434d55beac7565c3b3c0dvboxsynctypedef struct
9055f61bb57d2a625c6434d55beac7565c3b3c0dvboxsync /** header */
9055f61bb57d2a625c6434d55beac7565c3b3c0dvboxsync /** New seamless mode */
9055f61bb57d2a625c6434d55beac7565c3b3c0dvboxsync /** Flag that the request is an acknowlegement for the VMMDEV_EVENT_SEAMLESS_MODE_CHANGE_REQUEST.
9055f61bb57d2a625c6434d55beac7565c3b3c0dvboxsync * Values: 0 - just querying, VMMDEV_EVENT_SEAMLESS_MODE_CHANGE_REQUEST - event acknowledged.
9055f61bb57d2a625c6434d55beac7565c3b3c0dvboxsync/** VBVA command header. */
9055f61bb57d2a625c6434d55beac7565c3b3c0dvboxsynctypedef struct _VBVACMDHDR
9055f61bb57d2a625c6434d55beac7565c3b3c0dvboxsync /** Coordinates of affected rectangle. */
9055f61bb57d2a625c6434d55beac7565c3b3c0dvboxsync/* VBVA order codes. Must be >= 0, because the VRDP server internally
9055f61bb57d2a625c6434d55beac7565c3b3c0dvboxsync * uses negative values to mark some operations.
9055f61bb57d2a625c6434d55beac7565c3b3c0dvboxsync * Values are important since they are used as an index in the
9055f61bb57d2a625c6434d55beac7565c3b3c0dvboxsync * "supported orders" bit mask.
9055f61bb57d2a625c6434d55beac7565c3b3c0dvboxsync#define VBVA_VRDP_INDEX_TO_BIT(__index) (1 << (__index))
9055f61bb57d2a625c6434d55beac7565c3b3c0dvboxsync/* 128 bit bitmap hash. */
9055f61bb57d2a625c6434d55beac7565c3b3c0dvboxsync/* Header for bitmap bits in VBVA VRDP operations. */
9055f61bb57d2a625c6434d55beac7565c3b3c0dvboxsync /* Size of bitmap data without the header. */
9055f61bb57d2a625c6434d55beac7565c3b3c0dvboxsync /* VRDPDATABITS and the bitmap data follows. */
9055f61bb57d2a625c6434d55beac7565c3b3c0dvboxsync#endif /* VRDP_NO_COM */
9055f61bb57d2a625c6434d55beac7565c3b3c0dvboxsync/* The VBVA ring buffer is suitable for transferring large (< 2gb) amount of data.
9055f61bb57d2a625c6434d55beac7565c3b3c0dvboxsync * For example big bitmaps which do not fit to the buffer.
9055f61bb57d2a625c6434d55beac7565c3b3c0dvboxsync * Guest starts writing to the buffer by initializing a record entry in the
9055f61bb57d2a625c6434d55beac7565c3b3c0dvboxsync * aRecords queue. VBVA_F_RECORD_PARTIAL indicates that the record is being
9055f61bb57d2a625c6434d55beac7565c3b3c0dvboxsync * written. As data is written to the ring buffer, the guest increases off32End
9055f61bb57d2a625c6434d55beac7565c3b3c0dvboxsync * for the record.
9055f61bb57d2a625c6434d55beac7565c3b3c0dvboxsync * The host reads the aRecords on flushes and processes all completed records.
9055f61bb57d2a625c6434d55beac7565c3b3c0dvboxsync * When host encounters situation when only a partial record presents and
9055f61bb57d2a625c6434d55beac7565c3b3c0dvboxsync * cbRecord & ~VBVA_F_RECORD_PARTIAL >= VBVA_RING_BUFFER_SIZE - VBVA_RING_BUFFER_THRESHOLD,
9055f61bb57d2a625c6434d55beac7565c3b3c0dvboxsync * the host fetched all record data and updates off32Head. After that on each flush
9055f61bb57d2a625c6434d55beac7565c3b3c0dvboxsync * the host continues fetching the data until the record is completed.
9055f61bb57d2a625c6434d55beac7565c3b3c0dvboxsynctypedef struct _VBVARECORD
9055f61bb57d2a625c6434d55beac7565c3b3c0dvboxsync /** The length of the record. Changed by guest. */
9055f61bb57d2a625c6434d55beac7565c3b3c0dvboxsynctypedef struct _VBVAMEMORY
9055f61bb57d2a625c6434d55beac7565c3b3c0dvboxsync /** VBVA_F_MODE_* */
9055f61bb57d2a625c6434d55beac7565c3b3c0dvboxsync /** The offset where the data start in the buffer. */
9055f61bb57d2a625c6434d55beac7565c3b3c0dvboxsync /** The offset where next data must be placed in the buffer. */
9055f61bb57d2a625c6434d55beac7565c3b3c0dvboxsync /** The ring buffer for data. */
9055f61bb57d2a625c6434d55beac7565c3b3c0dvboxsync /** The queue of record descriptions. */
9055f61bb57d2a625c6434d55beac7565c3b3c0dvboxsync /* RDP orders supported by the client. The guest reports only them
9055f61bb57d2a625c6434d55beac7565c3b3c0dvboxsync * and falls back to DIRTY rects for not supported ones.
9055f61bb57d2a625c6434d55beac7565c3b3c0dvboxsync * (1 << VBVA_VRDP_*)
9055f61bb57d2a625c6434d55beac7565c3b3c0dvboxsync * VMMDev RAM
9055f61bb57d2a625c6434d55beac7565c3b3c0dvboxsync/** Layout of VMMDEV RAM region that contains information for guest */
9055f61bb57d2a625c6434d55beac7565c3b3c0dvboxsynctypedef struct
9055f61bb57d2a625c6434d55beac7565c3b3c0dvboxsync /** size */
9055f61bb57d2a625c6434d55beac7565c3b3c0dvboxsync /** version */
9055f61bb57d2a625c6434d55beac7565c3b3c0dvboxsync /** Flag telling that VMMDev set the IRQ and acknowlegment is required */
9055f61bb57d2a625c6434d55beac7565c3b3c0dvboxsync /** Pending events flags, set by host. */
9055f61bb57d2a625c6434d55beac7565c3b3c0dvboxsync /** Mask of events the guest wants to see, set by guest. */
9055f61bb57d2a625c6434d55beac7565c3b3c0dvboxsync/** Version of VMMDevMemory structure. */
9055f61bb57d2a625c6434d55beac7565c3b3c0dvboxsync * VMMDev events.
9055f61bb57d2a625c6434d55beac7565c3b3c0dvboxsync/** Host mouse capabilities has been changed. */
9055f61bb57d2a625c6434d55beac7565c3b3c0dvboxsync#define VMMDEV_EVENT_MOUSE_CAPABILITIES_CHANGED BIT(0)
9055f61bb57d2a625c6434d55beac7565c3b3c0dvboxsync/** HGCM event. */
9055f61bb57d2a625c6434d55beac7565c3b3c0dvboxsync/** A display change request has been issued. */
9055f61bb57d2a625c6434d55beac7565c3b3c0dvboxsync/** Credentials are available for judgement. */
9055f61bb57d2a625c6434d55beac7565c3b3c0dvboxsync/** The guest has been restored. */
9055f61bb57d2a625c6434d55beac7565c3b3c0dvboxsync/** Seamless mode state changed */
9055f61bb57d2a625c6434d55beac7565c3b3c0dvboxsync#define VMMDEV_EVENT_SEAMLESS_MODE_CHANGE_REQUEST BIT(5)
9055f61bb57d2a625c6434d55beac7565c3b3c0dvboxsync/** Memory balloon size changed */
9055f61bb57d2a625c6434d55beac7565c3b3c0dvboxsync/** Statistics interval changed */
9055f61bb57d2a625c6434d55beac7565c3b3c0dvboxsync#define VMMDEV_EVENT_STATISTICS_INTERVAL_CHANGE_REQUEST BIT(7)
9055f61bb57d2a625c6434d55beac7565c3b3c0dvboxsync/** VRDP status changed. */
9055f61bb57d2a625c6434d55beac7565c3b3c0dvboxsync * VBoxGuest IOCTL codes and structures.
9055f61bb57d2a625c6434d55beac7565c3b3c0dvboxsync * The range 0..15 is for basic driver communication.
9055f61bb57d2a625c6434d55beac7565c3b3c0dvboxsync * The range 16..31 is for HGCM communcation.
9055f61bb57d2a625c6434d55beac7565c3b3c0dvboxsync * The range 32..47 is reserved for future use.
9055f61bb57d2a625c6434d55beac7565c3b3c0dvboxsync * The range 48..63 is for OS specific communcation.
9055f61bb57d2a625c6434d55beac7565c3b3c0dvboxsync * The 7th bit is reserved for future hacks.
9055f61bb57d2a625c6434d55beac7565c3b3c0dvboxsync * The 8th bit is reserved for distinguishing between 32-bit and 64-bit
9055f61bb57d2a625c6434d55beac7565c3b3c0dvboxsync * processes in future 64-bit guest additions.
9055f61bb57d2a625c6434d55beac7565c3b3c0dvboxsync * While windows IOCTL function number has to start at 2048 and stop at 4096 there
9055f61bb57d2a625c6434d55beac7565c3b3c0dvboxsync * never was any need to do this for everyone. A simple ((Function) | 0x800) would
9055f61bb57d2a625c6434d55beac7565c3b3c0dvboxsync * have sufficed. On Linux we're now intruding upon the type field. Fortunately
9055f61bb57d2a625c6434d55beac7565c3b3c0dvboxsync * this hasn't caused any trouble because the FILE_DEVICE_UNKNOWN value was set
9055f61bb57d2a625c6434d55beac7565c3b3c0dvboxsync * to 0x22 (if it were 0x2C it would not have worked soo smoothly). The situation
9055f61bb57d2a625c6434d55beac7565c3b3c0dvboxsync * would've been the same for *BSD and Darwin since they seems to share common
9055f61bb57d2a625c6434d55beac7565c3b3c0dvboxsync * _IOC() heritage.
9055f61bb57d2a625c6434d55beac7565c3b3c0dvboxsync * However, on good old OS/2 we only have 8-bit handy for the function number. The
9055f61bb57d2a625c6434d55beac7565c3b3c0dvboxsync * result from using the old IOCTL function numbers her would've been overlapping
9055f61bb57d2a625c6434d55beac7565c3b3c0dvboxsync * between the two ranges.
9055f61bb57d2a625c6434d55beac7565c3b3c0dvboxsync * To fix this problem and get rid of all the unnecessary windowsy crap that I
9055f61bb57d2a625c6434d55beac7565c3b3c0dvboxsync * bet was copied from my SUPDRVIOC.h once upon a time (although the concept of
9055f61bb57d2a625c6434d55beac7565c3b3c0dvboxsync * prefixing macros with the purpose of avoid clashes with system stuff and
9055f61bb57d2a625c6434d55beac7565c3b3c0dvboxsync * to indicate exactly how owns them seems to have been lost somewhere along
9055f61bb57d2a625c6434d55beac7565c3b3c0dvboxsync * the way), I've introduced a VBOXGUEST_IOCTL_CODE for defining generic IN/OUT
9055f61bb57d2a625c6434d55beac7565c3b3c0dvboxsync * IOCtls on new ports of the additions.
9055f61bb57d2a625c6434d55beac7565c3b3c0dvboxsync * @remark When creating new IOCtl interfaces keep in mind that not all OSes supports
9055f61bb57d2a625c6434d55beac7565c3b3c0dvboxsync * reporting back the output size. (This got messed up a little bit in VBoxDrv.)
9055f61bb57d2a625c6434d55beac7565c3b3c0dvboxsync * OS/2 restricts the in/out data size to 64KB, while Linux, BSD and Darwin are
9055f61bb57d2a625c6434d55beac7565c3b3c0dvboxsync * limited by a 14 bits size field (16KB). So, special considerations need to
9055f61bb57d2a625c6434d55beac7565c3b3c0dvboxsync * be taken if more input/output needs to be passed around.
9055f61bb57d2a625c6434d55beac7565c3b3c0dvboxsync * When passing variable sized input/output special care need to be taken on
9055f61bb57d2a625c6434d55beac7565c3b3c0dvboxsync * Unix platforms (if we're going to play by the rules) since the size is
9055f61bb57d2a625c6434d55beac7565c3b3c0dvboxsync * passed as part of the IOCtl code there. IIRC Darwin will use the size to
9055f61bb57d2a625c6434d55beac7565c3b3c0dvboxsync * perform locking and in/out copying, I don't quite know about linux and *BSD.
9055f61bb57d2a625c6434d55beac7565c3b3c0dvboxsync * @remark If adding interfaces that only has input or only has output, some new macros
9055f61bb57d2a625c6434d55beac7565c3b3c0dvboxsync * needs to be created so the most efficient IOCtl data buffering method can be
9055f61bb57d2a625c6434d55beac7565c3b3c0dvboxsync# define IOCTL_CODE(DeviceType, Function, Method, Access, DataSize_ignored) \
9055f61bb57d2a625c6434d55beac7565c3b3c0dvboxsync ( ((DeviceType) << 16) | ((Access) << 14) | ((Function) << 2) | (Method))
9055f61bb57d2a625c6434d55beac7565c3b3c0dvboxsync# define VBOXGUEST_IOCTL_CODE(Function, Size) ((unsigned char)(Function))
9055f61bb57d2a625c6434d55beac7565c3b3c0dvboxsync# define VBOXGUEST_IOCTL_CATEGORY_FAST 0xc3 /**< Also defined in VBoxGuestA-os2.asm. */
9055f61bb57d2a625c6434d55beac7565c3b3c0dvboxsync# define VBOXGUEST_IOCTL_CODE_FAST(Function) ((unsigned char)(Function))
9055f61bb57d2a625c6434d55beac7565c3b3c0dvboxsync# define IOCTL_CODE(DeviceType, Function, Method_ignored, Access_ignored, DataSize) \
9055f61bb57d2a625c6434d55beac7565c3b3c0dvboxsync ( (3 << 30) | ((DeviceType) << 8) | (Function) | ((DataSize) << 16) )
9055f61bb57d2a625c6434d55beac7565c3b3c0dvboxsync#elif 0 /* BSD style - needs some adjusting _IORW takes a type and not a size. */
9055f61bb57d2a625c6434d55beac7565c3b3c0dvboxsync# define VBOXGUEST_IOCTL_CODE(Function, Size) _IORW('V', (Function) | VBOXGUEST_IOCTL_FLAG, (Size))
9055f61bb57d2a625c6434d55beac7565c3b3c0dvboxsync# define VBOXGUEST_IOCTL_CODE_FAST(Function) _IO( 'V', (Function) | VBOXGUEST_IOCTL_FLAG)
9055f61bb57d2a625c6434d55beac7565c3b3c0dvboxsync/* PORTME */
9055f61bb57d2a625c6434d55beac7565c3b3c0dvboxsync/** IOCTL to VBoxGuest to query the VMMDev IO port region start. */
9055f61bb57d2a625c6434d55beac7565c3b3c0dvboxsync# define VBOXGUEST_IOCTL_GETVMMDEVPORT VBOXGUEST_IOCTL_CODE(1, sizeof(VBoxGuestPortInfo))
9055f61bb57d2a625c6434d55beac7565c3b3c0dvboxsync# define IOCTL_VBOXGUEST_GETVMMDEVPORT VBOXGUEST_IOCTL_GETVMMDEVPORT
9055f61bb57d2a625c6434d55beac7565c3b3c0dvboxsync# define IOCTL_VBOXGUEST_GETVMMDEVPORT IOCTL_CODE(FILE_DEVICE_UNKNOWN, 2048, METHOD_BUFFERED, FILE_WRITE_ACCESS, sizeof(VBoxGuestPortInfo))
9055f61bb57d2a625c6434d55beac7565c3b3c0dvboxsync/** IOCTL to VBoxGuest to wait for a VMMDev host notification */
9055f61bb57d2a625c6434d55beac7565c3b3c0dvboxsync# define VBOXGUEST_IOCTL_WAITEVENT VBOXGUEST_IOCTL_CODE(2, sizeof(VBoxGuestWaitEventInfo))
9055f61bb57d2a625c6434d55beac7565c3b3c0dvboxsync# define IOCTL_VBOXGUEST_WAITEVENT VBOXGUEST_IOCTL_WAITEVENT
9055f61bb57d2a625c6434d55beac7565c3b3c0dvboxsync# define IOCTL_VBOXGUEST_WAITEVENT IOCTL_CODE(FILE_DEVICE_UNKNOWN, 2049, METHOD_BUFFERED, FILE_WRITE_ACCESS, sizeof(VBoxGuestWaitEventInfo))
9055f61bb57d2a625c6434d55beac7565c3b3c0dvboxsync * Result codes for VBoxGuestWaitEventInfo::u32Result
9055f61bb57d2a625c6434d55beac7565c3b3c0dvboxsync/** Successful completion, an event occured. */
9055f61bb57d2a625c6434d55beac7565c3b3c0dvboxsync/** Successful completion, timed out. */
9055f61bb57d2a625c6434d55beac7565c3b3c0dvboxsync/** Wait was interrupted. */
9055f61bb57d2a625c6434d55beac7565c3b3c0dvboxsync/** An error occured while processing the request. */
9055f61bb57d2a625c6434d55beac7565c3b3c0dvboxsync/** Input and output buffers layout of the IOCTL_VBOXGUEST_WAITEVENT */
9055f61bb57d2a625c6434d55beac7565c3b3c0dvboxsync /** timeout in milliseconds */
9055f61bb57d2a625c6434d55beac7565c3b3c0dvboxsync /** events to wait for */
9055f61bb57d2a625c6434d55beac7565c3b3c0dvboxsync /** result code */
9055f61bb57d2a625c6434d55beac7565c3b3c0dvboxsync /** events occured */
9055f61bb57d2a625c6434d55beac7565c3b3c0dvboxsync/** IOCTL to VBoxGuest to perform a VMM request
9055f61bb57d2a625c6434d55beac7565c3b3c0dvboxsync * @remark The data buffer for this IOCtl has an variable size, keep this in mind
9055f61bb57d2a625c6434d55beac7565c3b3c0dvboxsync * on systems where this matters. */
9055f61bb57d2a625c6434d55beac7565c3b3c0dvboxsync# define VBOXGUEST_IOCTL_VMMREQUEST(Size) VBOXGUEST_IOCTL_CODE(3, sizeof(VMMDevRequestHeader))
9055f61bb57d2a625c6434d55beac7565c3b3c0dvboxsync# define IOCTL_VBOXGUEST_VMMREQUEST VBOXGUEST_IOCTL_VMMREQUEST(sizeof(VMMDevRequestHeader))
9055f61bb57d2a625c6434d55beac7565c3b3c0dvboxsync# define IOCTL_VBOXGUEST_VMMREQUEST IOCTL_CODE(FILE_DEVICE_UNKNOWN, 2050, METHOD_BUFFERED, FILE_WRITE_ACCESS, sizeof(VMMDevRequestHeader))
9055f61bb57d2a625c6434d55beac7565c3b3c0dvboxsync/** Input and output buffer layout of the IOCTL_VBOXGUEST_CTL_FILTER_MASK. */
9055f61bb57d2a625c6434d55beac7565c3b3c0dvboxsync/** IOCTL to VBoxGuest to control event filter mask */
9055f61bb57d2a625c6434d55beac7565c3b3c0dvboxsync# define VBOXGUEST_IOCTL_CTL_FILTER_MASK VBOXGUEST_IOCTL_CODE(4, sizeof(VBoxGuestFilterMaskInfo))
9055f61bb57d2a625c6434d55beac7565c3b3c0dvboxsync# define IOCTL_VBOXGUEST_CTL_FILTER_MASK VBOXGUEST_IOCTL_CTL_FILTER_MASK
9055f61bb57d2a625c6434d55beac7565c3b3c0dvboxsync# define IOCTL_VBOXGUEST_CTL_FILTER_MASK IOCTL_CODE(FILE_DEVICE_UNKNOWN, 2051, METHOD_BUFFERED, FILE_WRITE_ACCESS, sizeof (VBoxGuestFilterMaskInfo))
9055f61bb57d2a625c6434d55beac7565c3b3c0dvboxsync/** IOCTL to VBoxGuest to check memory ballooning */
9055f61bb57d2a625c6434d55beac7565c3b3c0dvboxsync# define VBOXGUEST_IOCTL_CTL_CHECK_BALLOON_MASK VBOXGUEST_IOCTL_CODE(4, 100)
9055f61bb57d2a625c6434d55beac7565c3b3c0dvboxsync# define IOCTL_VBOXGUEST_CTL_CHECK_BALLOON VBOXGUEST_IOCTL_CTL_CHECK_BALLOON_MASK
9055f61bb57d2a625c6434d55beac7565c3b3c0dvboxsync# define IOCTL_VBOXGUEST_CTL_CHECK_BALLOON IOCTL_CODE(FILE_DEVICE_UNKNOWN, 2052, METHOD_BUFFERED, FILE_WRITE_ACCESS, 0)
9055f61bb57d2a625c6434d55beac7565c3b3c0dvboxsync/* These structures are shared between the driver and other binaries,
9055f61bb57d2a625c6434d55beac7565c3b3c0dvboxsync * therefore packing must be defined explicitely.
9055f61bb57d2a625c6434d55beac7565c3b3c0dvboxsync uint32_t u32ClientID; /**< IN The id of the caller. */
9055f61bb57d2a625c6434d55beac7565c3b3c0dvboxsync /* Parameters follow in form HGCMFunctionParameter aParms[cParms] */
9055f61bb57d2a625c6434d55beac7565c3b3c0dvboxsync# define VBOXGUEST_IOCTL_HGCM_CONNECT VBOXGUEST_IOCTL_CODE(16, sizeof(VBoxGuestHGCMConnectInfo))
c58dc77ef4af214d7ae06910fa5ab18587d2ae08vboxsync# define IOCTL_VBOXGUEST_HGCM_CONNECT VBOXGUEST_IOCTL_HGCM_CONNECT
9055f61bb57d2a625c6434d55beac7565c3b3c0dvboxsync# define VBOXGUEST_IOCTL_HGCM_DISCONNECT VBOXGUEST_IOCTL_CODE(17, sizeof(VBoxGuestHGCMDisconnectInfo))
9055f61bb57d2a625c6434d55beac7565c3b3c0dvboxsync# define IOCTL_VBOXGUEST_HGCM_DISCONNECT VBOXGUEST_IOCTL_HGCM_DISCONNECT
9055f61bb57d2a625c6434d55beac7565c3b3c0dvboxsync# define VBOXGUEST_IOCTL_HGCM_CALL(Size) VBOXGUEST_IOCTL_CODE(18, (Size))
9055f61bb57d2a625c6434d55beac7565c3b3c0dvboxsync# define IOCTL_VBOXGUEST_HGCM_CALL VBOXGUEST_IOCTL_HGCM_CALL(sizeof(VBoxGuestHGCMCallInfo))
9055f61bb57d2a625c6434d55beac7565c3b3c0dvboxsync# define VBOXGUEST_IOCTL_CLIPBOARD_CONNECT VBOXGUEST_IOCTL_CODE(19, sizeof(uint32_t))
9055f61bb57d2a625c6434d55beac7565c3b3c0dvboxsync# define IOCTL_VBOXGUEST_CLIPBOARD_CONNECT VBOXGUEST_IOCTL_CLIPBOARD_CONNECT
9055f61bb57d2a625c6434d55beac7565c3b3c0dvboxsync# define IOCTL_VBOXGUEST_HGCM_CONNECT IOCTL_CODE(FILE_DEVICE_UNKNOWN, 3072, METHOD_BUFFERED, FILE_WRITE_ACCESS, sizeof(VBoxGuestHGCMConnectInfo))
9055f61bb57d2a625c6434d55beac7565c3b3c0dvboxsync# define IOCTL_VBOXGUEST_HGCM_DISCONNECT IOCTL_CODE(FILE_DEVICE_UNKNOWN, 3073, METHOD_BUFFERED, FILE_WRITE_ACCESS, sizeof(VBoxGuestHGCMDisconnectInfo))
9055f61bb57d2a625c6434d55beac7565c3b3c0dvboxsync# define IOCTL_VBOXGUEST_HGCM_CALL IOCTL_CODE(FILE_DEVICE_UNKNOWN, 3074, METHOD_BUFFERED, FILE_WRITE_ACCESS, sizeof(VBoxGuestHGCMCallInfo))
c58dc77ef4af214d7ae06910fa5ab18587d2ae08vboxsync# define IOCTL_VBOXGUEST_CLIPBOARD_CONNECT IOCTL_CODE(FILE_DEVICE_UNKNOWN, 3075, METHOD_BUFFERED, FILE_WRITE_ACCESS, sizeof(uint32_t))
9055f61bb57d2a625c6434d55beac7565c3b3c0dvboxsync#define VBOXGUEST_HGCM_CALL_PARMS(a) ((HGCMFunctionParameter *)((uint8_t *)(a) + sizeof (VBoxGuestHGCMCallInfo)))
9055f61bb57d2a625c6434d55beac7565c3b3c0dvboxsync#endif /* VBOX_HGCM */
9055f61bb57d2a625c6434d55beac7565c3b3c0dvboxsync * Credentials request flags and structure
9055f61bb57d2a625c6434d55beac7565c3b3c0dvboxsync/** query from host whether credentials are present */
9055f61bb57d2a625c6434d55beac7565c3b3c0dvboxsync/** read credentials from host (can be combined with clear) */
9055f61bb57d2a625c6434d55beac7565c3b3c0dvboxsync/** clear credentials on host (can be combined with read) */
9055f61bb57d2a625c6434d55beac7565c3b3c0dvboxsync/** read credentials for judgement in the guest */
9055f61bb57d2a625c6434d55beac7565c3b3c0dvboxsync/** clear credentials for judegement on the host */
9055f61bb57d2a625c6434d55beac7565c3b3c0dvboxsync/** report credentials acceptance by guest */
9055f61bb57d2a625c6434d55beac7565c3b3c0dvboxsync/** report credentials denial by guest */
9055f61bb57d2a625c6434d55beac7565c3b3c0dvboxsync/** report that no judgement could be made by guest */
9055f61bb57d2a625c6434d55beac7565c3b3c0dvboxsync#define VMMDEV_CREDENTIALS_JUDGE_NOJUDGEMENT BIT(12)
9055f61bb57d2a625c6434d55beac7565c3b3c0dvboxsync/** flag telling the guest that credentials are present */
9055f61bb57d2a625c6434d55beac7565c3b3c0dvboxsync/** flag telling guest that local logons should be prohibited */
9055f61bb57d2a625c6434d55beac7565c3b3c0dvboxsync/** credentials request structure */
9055f61bb57d2a625c6434d55beac7565c3b3c0dvboxsync /* request header */
9055f61bb57d2a625c6434d55beac7565c3b3c0dvboxsync /* request flags (in/out) */
9055f61bb57d2a625c6434d55beac7565c3b3c0dvboxsync /* user name (UTF-8) (out) */
9055f61bb57d2a625c6434d55beac7565c3b3c0dvboxsync /* password (UTF-8) (out) */
9055f61bb57d2a625c6434d55beac7565c3b3c0dvboxsync /* domain name (UTF-8) (out) */
9055f61bb57d2a625c6434d55beac7565c3b3c0dvboxsync/** inline helper to determine the request size for the given operation */
9055f61bb57d2a625c6434d55beac7565c3b3c0dvboxsyncDECLINLINE(size_t) vmmdevGetRequestSize(VMMDevRequestType requestType)
9055f61bb57d2a625c6434d55beac7565c3b3c0dvboxsync return sizeof(VMMDevReqMouseStatus);
9055f61bb57d2a625c6434d55beac7565c3b3c0dvboxsync return sizeof(VMMDevReqHostVersion);
9055f61bb57d2a625c6434d55beac7565c3b3c0dvboxsync return sizeof(VMMDevReqIdle);
9055f61bb57d2a625c6434d55beac7565c3b3c0dvboxsync return sizeof(VMMDevReqHostTime);
9055f61bb57d2a625c6434d55beac7565c3b3c0dvboxsync return sizeof(VMMDevEvents);
9055f61bb57d2a625c6434d55beac7565c3b3c0dvboxsync return sizeof(VMMDevHGCMConnect);
9055f61bb57d2a625c6434d55beac7565c3b3c0dvboxsync return sizeof(VMMDevHGCMDisconnect);
9cdd4d805ecb43126372f7cf12e4032836cb738avboxsync return sizeof(VMMDevHGCMCall);
9055f61bb57d2a625c6434d55beac7565c3b3c0dvboxsync return sizeof(VMMDevCredentials);
9055f61bb57d2a625c6434d55beac7565c3b3c0dvboxsync return sizeof(VMMDevReqLogString);
9055f61bb57d2a625c6434d55beac7565c3b3c0dvboxsync * Initializes a request structure.
9055f61bb57d2a625c6434d55beac7565c3b3c0dvboxsyncDECLINLINE(int) vmmdevInitRequest(VMMDevRequestHeader *req, VMMDevRequestType type)
9055f61bb57d2a625c6434d55beac7565c3b3c0dvboxsync requestSize = (uint32_t)vmmdevGetRequestSize(type);
9055f61bb57d2a625c6434d55beac7565c3b3c0dvboxsync * The data buffer layout for the IDC entry point (AttachDD).
9055f61bb57d2a625c6434d55beac7565c3b3c0dvboxsync * @remark This is defined in multiple 16-bit headers / sources.
9055f61bb57d2a625c6434d55beac7565c3b3c0dvboxsync * Some places it's called VBGOS2IDC to short things a bit.
9055f61bb57d2a625c6434d55beac7565c3b3c0dvboxsync /** VMMDEV_VERSION. */
9055f61bb57d2a625c6434d55beac7565c3b3c0dvboxsync /** Opaque session handle. */
9055f61bb57d2a625c6434d55beac7565c3b3c0dvboxsync * The 32-bit service entry point.
9055f61bb57d2a625c6434d55beac7565c3b3c0dvboxsync * @returns VBox status code.
9055f61bb57d2a625c6434d55beac7565c3b3c0dvboxsync * @param u32Session The above session handle.
9055f61bb57d2a625c6434d55beac7565c3b3c0dvboxsync * @param iFunction The requested function.
9055f61bb57d2a625c6434d55beac7565c3b3c0dvboxsync * @param pvData The input/output data buffer. The caller ensures that this
9055f61bb57d2a625c6434d55beac7565c3b3c0dvboxsync * cannot be swapped out, or that it's acceptable to take a
9055f61bb57d2a625c6434d55beac7565c3b3c0dvboxsync * page in fault in the current context. If the request doesn't
9055f61bb57d2a625c6434d55beac7565c3b3c0dvboxsync * take input or produces output, apssing NULL is okay.
9055f61bb57d2a625c6434d55beac7565c3b3c0dvboxsync * @param cbData The size of the data buffer.
9055f61bb57d2a625c6434d55beac7565c3b3c0dvboxsync * @param pcbDataReturned Where to store the amount of data that's returned.
9055f61bb57d2a625c6434d55beac7565c3b3c0dvboxsync * This can be NULL if pvData is NULL.
9055f61bb57d2a625c6434d55beac7565c3b3c0dvboxsync DECLCALLBACKMEMBER(int, pfnServiceEP)(uint32_t u32Session, unsigned iFunction, void *pvData, size_t cbData, size_t *pcbDataReturned);
9055f61bb57d2a625c6434d55beac7565c3b3c0dvboxsync /** The 16-bit service entry point for C code (cdecl).
9055f61bb57d2a625c6434d55beac7565c3b3c0dvboxsync * It's the same as the 32-bit entry point, but the types has
9055f61bb57d2a625c6434d55beac7565c3b3c0dvboxsync * changed to 16-bit equivalents.
9055f61bb57d2a625c6434d55beac7565c3b3c0dvboxsync * int far cdecl
9055f61bb57d2a625c6434d55beac7565c3b3c0dvboxsync * VBoxGuestOs2IDCService16(uint32_t u32Session, uint16_t iFunction,
9055f61bb57d2a625c6434d55beac7565c3b3c0dvboxsync * void far *fpvData, uint16_t cbData, uint16_t far *pcbDataReturned);
9055f61bb57d2a625c6434d55beac7565c3b3c0dvboxsync /** The 16-bit service entry point for Assembly code (register).
9055f61bb57d2a625c6434d55beac7565c3b3c0dvboxsync * This is just a wrapper around fpfnServiceEP to simplify calls
9055f61bb57d2a625c6434d55beac7565c3b3c0dvboxsync * from 16-bit assembly code.
9055f61bb57d2a625c6434d55beac7565c3b3c0dvboxsync * @returns (e)ax: VBox status code; cx: The amount of data returned.
9055f61bb57d2a625c6434d55beac7565c3b3c0dvboxsync * @param u32Session eax - The above session handle.
9055f61bb57d2a625c6434d55beac7565c3b3c0dvboxsync * @param iFunction dl - The requested function.
9055f61bb57d2a625c6434d55beac7565c3b3c0dvboxsync * @param pvData es:bx - The input/output data buffer.
9055f61bb57d2a625c6434d55beac7565c3b3c0dvboxsync * @param cbData cx - The size of the data buffer.
9055f61bb57d2a625c6434d55beac7565c3b3c0dvboxsync/** Pointer to VBOXGUESTOS2IDCCONNECT buffer. */
9055f61bb57d2a625c6434d55beac7565c3b3c0dvboxsynctypedef VBOXGUESTOS2IDCCONNECT *PVBOXGUESTOS2IDCCONNECT;
9055f61bb57d2a625c6434d55beac7565c3b3c0dvboxsync/** OS/2 specific: IDC client disconnect request.
9055f61bb57d2a625c6434d55beac7565c3b3c0dvboxsync * This takes no input and it doesn't return anything. Obviously this
9055f61bb57d2a625c6434d55beac7565c3b3c0dvboxsync * is only recognized if it arrives thru the IDC service EP.
9055f61bb57d2a625c6434d55beac7565c3b3c0dvboxsync#define VBOXGUEST_IOCTL_OS2_IDC_DISCONNECT VBOXGUEST_IOCTL_CODE(48, sizeof(uint32_t))
9055f61bb57d2a625c6434d55beac7565c3b3c0dvboxsync#endif /* RT_OS_OS2 */
9055f61bb57d2a625c6434d55beac7565c3b3c0dvboxsync/** @def VBGLR3DECL
9055f61bb57d2a625c6434d55beac7565c3b3c0dvboxsync * Ring 3 VBGL declaration.
9055f61bb57d2a625c6434d55beac7565c3b3c0dvboxsync * @param type The return type of the function declaration.
9055f61bb57d2a625c6434d55beac7565c3b3c0dvboxsync/* General-purpose functions */
9055f61bb57d2a625c6434d55beac7565c3b3c0dvboxsyncVBGLR3DECL(int) VbglR3GRPerform(VMMDevRequestHeader *pReq);
9055f61bb57d2a625c6434d55beac7565c3b3c0dvboxsyncVBGLR3DECL(int) VbglR3GetHostTime(PRTTIMESPEC pTime);
9055f61bb57d2a625c6434d55beac7565c3b3c0dvboxsync/* Shared clipboard */
9055f61bb57d2a625c6434d55beac7565c3b3c0dvboxsyncVBGLR3DECL(int) VbglR3ClipboardConnect(uint32_t *pu32ClientId);
9055f61bb57d2a625c6434d55beac7565c3b3c0dvboxsyncVBGLR3DECL(int) VbglR3ClipboardDisconnect(uint32_t u32ClientId);
9055f61bb57d2a625c6434d55beac7565c3b3c0dvboxsyncVBGLR3DECL(int) VbglR3ClipboardGetHostMsg(uint32_t u32ClientId, uint32_t *pMsg, uint32_t *pfFormats);
441b60f8b0601cc1718368c9c3ef082223ad12a2vboxsyncVBGLR3DECL(int) VbglR3ClipboardReadData(uint32_t u32ClientId, uint32_t fFormat, void *pv, uint32_t cb, uint32_t *pcb);
441b60f8b0601cc1718368c9c3ef082223ad12a2vboxsyncVBGLR3DECL(int) VbglR3ClipboardReportFormats(uint32_t u32ClientId, uint32_t fFormats);
441b60f8b0601cc1718368c9c3ef082223ad12a2vboxsyncVBGLR3DECL(int) VbglR3ClipboardWriteData(uint32_t u32ClientId, uint32_t fFormat, void *pv, uint32_t cb);
441b60f8b0601cc1718368c9c3ef082223ad12a2vboxsync/* Seamless mode */
441b60f8b0601cc1718368c9c3ef082223ad12a2vboxsyncVBGLR3DECL(int) VbglR3SeamlessWaitEvent(VMMDevSeamlessMode *pMode);
441b60f8b0601cc1718368c9c3ef082223ad12a2vboxsyncVBGLR3DECL(int) VbglR3SeamlessSendRects(uint32_t cRects, PRTRECT pRects);
9055f61bb57d2a625c6434d55beac7565c3b3c0dvboxsync#endif /* IN_RING3 */