VirtualBox

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

Last change on this file since 3269 was 3269, checked in by vboxsync, 17 years ago

type callingconvention function().

  • Property svn:eol-style set to native
  • Property svn:keywords set to Author Date Id Revision
File size: 38.7 KB
Line 
1/** @file
2 * VBoxGuest - VirtualBox Guest Additions interface
3 */
4
5/*
6 * Copyright (C) 2006-2007 innotek GmbH
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 as published by the Free Software Foundation,
12 * in version 2 as it comes in the "COPYING" file of the VirtualBox OSE
13 * distribution. VirtualBox OSE is distributed in the hope that it will
14 * be useful, but WITHOUT ANY WARRANTY of any kind.
15 *
16 * If you received this file as part of a commercial VirtualBox
17 * distribution, then only the terms of your commercial VirtualBox
18 * license agreement apply instead of the previous paragraph.
19 */
20
21#ifndef __VBox_VBoxGuest_h__
22#define __VBox_VBoxGuest_h__
23
24#include <iprt/cdefs.h>
25#include <iprt/types.h>
26#include <VBox/err.h>
27#include <VBox/ostypes.h>
28
29/*******************************************************************************
30* Defined Constants And Macros *
31*******************************************************************************/
32
33/** @todo The following is a temporary fix for the problem of accessing
34 hypervisor pointers from within guest additions */
35
36/** Hypervisor linear pointer size type */
37typedef uint32_t vmmDevHypPtr;
38/** Hypervisor physical pointer size type */
39typedef uint32_t vmmDevHypPhys;
40
41#if defined(__LINUX__)
42/** The support device name. */
43# define VBOXGUEST_DEVICE_NAME "/dev/vboxadd"
44
45#elif defined(__OS2__)
46/** The support device name. */
47# define VBOXGUEST_DEVICE_NAME "\\Dev\\VBoxGst$"
48
49#elif defined(__WIN__)
50/** The support service name. */
51# define VBOXGUEST_SERVICE_NAME "VBoxGuest"
52/** Win32 Device name. */
53# define VBOXGUEST_DEVICE_NAME "\\\\.\\VBoxGuest"
54/** Global name for Win2k+ */
55# define VBOXGUEST_DEVICE_NAME_GLOBAL "\\\\.\\Global\\VBoxGuest"
56/** Win32 driver name */
57# define VBOXGUEST_DEVICE_NAME_NT L"\\Device\\VBoxGuest"
58/** device name */
59# define VBOXGUEST_DEVICE_NAME_DOS L"\\DosDevices\\VBoxGuest"
60
61#else
62/* PORTME */
63#endif
64
65/** VirtualBox vendor ID */
66#define VBOX_PCI_VENDORID (0x80ee)
67
68/** VMMDev PCI card identifiers */
69#define VMMDEV_VENDORID VBOX_PCI_VENDORID
70#define VMMDEV_DEVICEID (0xcafe)
71
72/** VirtualBox graphics card identifiers */
73#define VBOX_VENDORID VBOX_PCI_VENDORID
74#define VBOX_VESA_VENDORID VBOX_PCI_VENDORID
75#define VBOX_DEVICEID (0xbeef)
76#define VBOX_VESA_DEVICEID (0xbeef)
77
78/**
79 * VBoxGuest port definitions
80 * @{
81 */
82
83/** guest can (== wants to) handle absolute coordinates */
84#define VBOXGUEST_MOUSE_GUEST_CAN_ABSOLUTE BIT(0)
85/** host can (== wants to) send absolute coordinates */
86#define VBOXGUEST_MOUSE_HOST_CAN_ABSOLUTE BIT(1)
87/** guest can *NOT* switch to software cursor and therefore depends on the host cursor */
88#define VBOXGUEST_MOUSE_GUEST_NEEDS_HOST_CURSOR BIT(2)
89/** host does NOT provide support for drawing the cursor itself (e.g. L4 console) */
90#define VBOXGUEST_MOUSE_HOST_CANNOT_HWPOINTER BIT(3)
91
92/** fictive start address of the hypervisor physical memory for MmMapIoSpace */
93#define HYPERVISOR_PHYSICAL_START 0xf8000000
94
95/*
96 * VMMDev Generic Request Interface
97 */
98
99/** port for generic request interface */
100#define PORT_VMMDEV_REQUEST_OFFSET 0
101
102/** Current version of the VMMDev interface.
103 *
104 * Additions are allowed to work only if
105 * additions_major == vmmdev_current && additions_minor <= vmmdev_current.
106 * Additions version is reported to host (VMMDev) by VMMDevReq_ReportGuestInfo.
107 *
108 * @remark These defines also live in the 16-bit and assembly versions of this header.
109 */
110#define VMMDEV_VERSION_MAJOR (0x1)
111#define VMMDEV_VERSION_MINOR (0x4)
112#define VMMDEV_VERSION ((VMMDEV_VERSION_MAJOR << 16) | VMMDEV_VERSION_MINOR)
113
114/**
115 * VMMDev request types.
116 * @note when updating this, adjust vmmdevGetRequestSize() as well
117 */
118typedef enum
119{
120 VMMDevReq_InvalidRequest = 0,
121 VMMDevReq_GetMouseStatus = 1,
122 VMMDevReq_SetMouseStatus = 2,
123 VMMDevReq_SetPointerShape = 3,
124 /** @todo implement on host side */
125 VMMDevReq_GetHostVersion = 4,
126 VMMDevReq_Idle = 5,
127 VMMDevReq_GetHostTime = 10,
128 VMMDevReq_GetHypervisorInfo = 20,
129 VMMDevReq_SetHypervisorInfo = 21,
130 VMMDevReq_SetPowerStatus = 30,
131 VMMDevReq_AcknowledgeEvents = 41,
132 VMMDevReq_CtlGuestFilterMask = 42,
133 VMMDevReq_ReportGuestInfo = 50,
134 VMMDevReq_GetDisplayChangeRequest = 51,
135 VMMDevReq_VideoModeSupported = 52,
136 VMMDevReq_GetHeightReduction = 53,
137 VMMDevReq_GetDisplayChangeRequest2 = 54,
138#ifdef VBOX_HGCM
139 VMMDevReq_HGCMConnect = 60,
140 VMMDevReq_HGCMDisconnect = 61,
141 VMMDevReq_HGCMCall = 62,
142#endif
143 VMMDevReq_VideoAccelEnable = 70,
144 VMMDevReq_VideoAccelFlush = 71,
145 VMMDevReq_QueryCredentials = 100,
146 VMMDevReq_ReportCredentialsJudgement = 101,
147 VMMDevReq_SizeHack = 0x7fffffff
148} VMMDevRequestType;
149
150/** Version of VMMDevRequestHeader structure. */
151#define VMMDEV_REQUEST_HEADER_VERSION (0x10001)
152
153#pragma pack(4)
154/** generic VMMDev request header */
155typedef struct
156{
157 /** size of the structure in bytes (including body). Filled by caller */
158 uint32_t size;
159 /** version of the structure. Filled by caller */
160 uint32_t version;
161 /** type of the request */
162 VMMDevRequestType requestType;
163 /** return code. Filled by VMMDev */
164 int32_t rc;
165 /** reserved fields */
166 uint32_t reserved1;
167 uint32_t reserved2;
168} VMMDevRequestHeader;
169
170/** mouse status request structure */
171typedef struct
172{
173 /** header */
174 VMMDevRequestHeader header;
175 /** mouse feature mask */
176 uint32_t mouseFeatures;
177 /** mouse x position */
178 uint32_t pointerXPos;
179 /** mouse y position */
180 uint32_t pointerYPos;
181} VMMDevReqMouseStatus;
182
183/** Note VBOX_MOUSE_POINTER_* flags are used in guest video driver,
184 * values must be <= 0x8000 and must not be changed.
185 */
186
187/** pointer is visible */
188#define VBOX_MOUSE_POINTER_VISIBLE (0x0001)
189/** pointer has alpha channel */
190#define VBOX_MOUSE_POINTER_ALPHA (0x0002)
191/** pointerData contains new pointer shape */
192#define VBOX_MOUSE_POINTER_SHAPE (0x0004)
193
194/** mouse pointer shape/visibility change request */
195typedef struct
196{
197 /** header */
198 VMMDevRequestHeader header;
199 /** VBOX_MOUSE_POINTER_* bit flags */
200 uint32_t fFlags;
201 /** x coordinate of hot spot */
202 uint32_t xHot;
203 /** y coordinate of hot spot */
204 uint32_t yHot;
205 /** width of the pointer in pixels */
206 uint32_t width;
207 /** height of the pointer in scanlines */
208 uint32_t height;
209 /** Pointer data.
210 *
211 ****
212 * The data consists of 1 bpp AND mask followed by 32 bpp XOR (color) mask.
213 *
214 * For pointers without alpha channel the XOR mask pixels are 32 bit values: (lsb)BGR0(msb).
215 * For pointers with alpha channel the XOR mask consists of (lsb)BGRA(msb) 32 bit values.
216 *
217 * Guest driver must create the AND mask for pointers with alpha channel, so if host does not
218 * support alpha, the pointer could be displayed as a normal color pointer. The AND mask can
219 * be constructed from alpha values. For example alpha value >= 0xf0 means bit 0 in the AND mask.
220 *
221 * The AND mask is 1 bpp bitmap with byte aligned scanlines. Size of AND mask,
222 * therefore, is cbAnd = (width + 7) / 8 * height. The padding bits at the
223 * end of any scanline are undefined.
224 *
225 * The XOR mask follows the AND mask on the next 4 bytes aligned offset:
226 * uint8_t *pXor = pAnd + (cbAnd + 3) & ~3
227 * Bytes in the gap between the AND and the XOR mask are undefined.
228 * XOR mask scanlines have no gap between them and size of XOR mask is:
229 * cXor = width * 4 * height.
230 ****
231 *
232 * Preallocate 4 bytes for accessing actual data as p->pointerData
233 */
234 char pointerData[4];
235} VMMDevReqMousePointer;
236
237/** host version request structure */
238typedef struct
239{
240 /** header */
241 VMMDevRequestHeader header;
242 /** major version */
243 uint32_t major;
244 /** minor version */
245 uint32_t minor;
246 /** build number */
247 uint32_t build;
248} VMMDevReqHostVersion;
249
250/** idle request structure */
251typedef struct
252{
253 /** header */
254 VMMDevRequestHeader header;
255} VMMDevReqIdle;
256
257/** host time request structure */
258typedef struct
259{
260 /** header */
261 VMMDevRequestHeader header;
262 /** time in milliseconds since unix epoch. Filled by VMMDev. */
263 uint64_t time;
264} VMMDevReqHostTime;
265
266/** hypervisor info structure */
267typedef struct
268{
269 /** header */
270 VMMDevRequestHeader header;
271 /** guest virtual address of proposed hypervisor start */
272 vmmDevHypPtr hypervisorStart;
273 /** hypervisor size in bytes */
274 uint32_t hypervisorSize;
275} VMMDevReqHypervisorInfo;
276
277/** system power requests */
278typedef enum
279{
280 VMMDevPowerState_Invalid = 0,
281 VMMDevPowerState_Pause = 1,
282 VMMDevPowerState_PowerOff = 2,
283 VMMDevPowerState_SaveState = 3,
284 VMMDevPowerState_SizeHack = 0x7fffffff
285} VMMDevPowerState;
286
287/** system power status structure */
288typedef struct
289{
290 /** header */
291 VMMDevRequestHeader header;
292 /** power state request */
293 VMMDevPowerState powerState;
294} VMMDevPowerStateRequest;
295
296/** pending events structure */
297typedef struct
298{
299 /** header */
300 VMMDevRequestHeader header;
301 /** pending event bitmap */
302 uint32_t events;
303} VMMDevEvents;
304
305/** guest filter mask control */
306typedef struct
307{
308 /** header */
309 VMMDevRequestHeader header;
310 /** mask of events to be added to filter */
311 uint32_t u32OrMask;
312 /** mask of events to be removed from filter */
313 uint32_t u32NotMask;
314} VMMDevCtlGuestFilterMask;
315
316/** guest information structure */
317typedef struct VBoxGuestInfo
318{
319 /** The VMMDev interface version expected by additions. */
320 uint32_t additionsVersion;
321 /** guest OS type */
322 OSType osType;
323 /** @todo */
324} VBoxGuestInfo;
325
326/** guest information structure */
327typedef struct
328{
329 /** header */
330 VMMDevRequestHeader header;
331 /** Guest information. */
332 VBoxGuestInfo guestInfo;
333} VMMDevReportGuestInfo;
334
335/** display change request structure */
336typedef struct
337{
338 /** header */
339 VMMDevRequestHeader header;
340 /** horizontal pixel resolution (0 = do not change) */
341 uint32_t xres;
342 /** vertical pixel resolution (0 = do not change) */
343 uint32_t yres;
344 /** bits per pixel (0 = do not change) */
345 uint32_t bpp;
346 /** Flag that the request is an acknowlegement for the VMMDEV_EVENT_DISPLAY_CHANGE_REQUEST.
347 * Values: 0 - just querying, VMMDEV_EVENT_DISPLAY_CHANGE_REQUEST - event acknowledged.
348 */
349 uint32_t eventAck;
350} VMMDevDisplayChangeRequest;
351
352typedef struct
353{
354 /** header */
355 VMMDevRequestHeader header;
356 /** horizontal pixel resolution (0 = do not change) */
357 uint32_t xres;
358 /** vertical pixel resolution (0 = do not change) */
359 uint32_t yres;
360 /** bits per pixel (0 = do not change) */
361 uint32_t bpp;
362 /** Flag that the request is an acknowlegement for the VMMDEV_EVENT_DISPLAY_CHANGE_REQUEST.
363 * Values: 0 - just querying, VMMDEV_EVENT_DISPLAY_CHANGE_REQUEST - event acknowledged.
364 */
365 uint32_t eventAck;
366 /** 0 for primary display, 1 for the first secondary, etc. */
367 uint32_t display;
368} VMMDevDisplayChangeRequest2;
369
370/** video mode supported request structure */
371typedef struct
372{
373 /** header */
374 VMMDevRequestHeader header;
375 /** horizontal pixel resolution (input) */
376 uint32_t width;
377 /** vertical pixel resolution (input) */
378 uint32_t height;
379 /** bits per pixel (input) */
380 uint32_t bpp;
381 /** supported flag (output) */
382 bool fSupported;
383} VMMDevVideoModeSupportedRequest;
384
385/** video modes height reduction request structure */
386typedef struct
387{
388 /** header */
389 VMMDevRequestHeader header;
390 /** height reduction in pixels (output) */
391 uint32_t heightReduction;
392} VMMDevGetHeightReductionRequest;
393
394#pragma pack()
395
396#ifdef VBOX_HGCM
397
398/** HGCM flags.
399 * @{
400 */
401#define VBOX_HGCM_REQ_DONE (0x1)
402#define VBOX_HGCM_REQ_CANCELLED (0x2)
403/** @} */
404
405#pragma pack(4)
406typedef struct _VMMDevHGCMRequestHeader
407{
408 /** Request header. */
409 VMMDevRequestHeader header;
410
411 /** HGCM flags. */
412 uint32_t fu32Flags;
413
414 /** Result code. */
415 int32_t result;
416} VMMDevHGCMRequestHeader;
417
418/** HGCM service location types. */
419typedef enum
420{
421 VMMDevHGCMLoc_Invalid = 0,
422 VMMDevHGCMLoc_LocalHost = 1,
423 VMMDevHGCMLoc_LocalHost_Existing = 2,
424 VMMDevHGCMLoc_SizeHack = 0x7fffffff
425} HGCMServiceLocationType;
426
427typedef struct
428{
429 char achName[128];
430} HGCMServiceLocationHost;
431
432typedef struct HGCMSERVICELOCATION
433{
434 /** Type of the location. */
435 HGCMServiceLocationType type;
436
437 union
438 {
439 HGCMServiceLocationHost host;
440 } u;
441} HGCMServiceLocation;
442
443typedef struct
444{
445 /* request header */
446 VMMDevHGCMRequestHeader header;
447
448 /** IN: Description of service to connect to. */
449 HGCMServiceLocation loc;
450
451 /** OUT: Client identifier assigned by local instance of HGCM. */
452 uint32_t u32ClientID;
453} VMMDevHGCMConnect;
454
455typedef struct
456{
457 /* request header */
458 VMMDevHGCMRequestHeader header;
459
460 /** IN: Client identifier. */
461 uint32_t u32ClientID;
462} VMMDevHGCMDisconnect;
463
464typedef enum
465{
466 VMMDevHGCMParmType_Invalid = 0,
467 VMMDevHGCMParmType_32bit = 1,
468 VMMDevHGCMParmType_64bit = 2,
469 VMMDevHGCMParmType_PhysAddr = 3,
470 VMMDevHGCMParmType_LinAddr = 4, /**< In and Out */
471 VMMDevHGCMParmType_LinAddr_In = 5, /**< In (read) */
472 VMMDevHGCMParmType_LinAddr_Out= 6, /**< Out (write) */
473 VMMDevHGCMParmType_SizeHack = 0x7fffffff
474} HGCMFunctionParameterType;
475
476typedef struct _HGCMFUNCTIONPARAMETER
477{
478 HGCMFunctionParameterType type;
479 union
480 {
481 uint32_t value32;
482 uint64_t value64;
483 struct
484 {
485 uint32_t size;
486
487 union
488 {
489 vmmDevHypPhys physAddr;
490 vmmDevHypPtr linearAddr;
491 } u;
492 } Pointer;
493 } u;
494} HGCMFunctionParameter;
495
496typedef struct
497{
498 /* request header */
499 VMMDevHGCMRequestHeader header;
500
501 /** IN: Client identifier. */
502 uint32_t u32ClientID;
503 /** IN: Service function number. */
504 uint32_t u32Function;
505 /** IN: Number of parameters. */
506 uint32_t cParms;
507 /** Parameters follow in form: HGCMFunctionParameter aParms[X]; */
508} VMMDevHGCMCall;
509#pragma pack()
510
511#define VMMDEV_HGCM_CALL_PARMS(a) ((HGCMFunctionParameter *)((char *)a + sizeof (VMMDevHGCMCall)))
512
513#define VBOX_HGCM_MAX_PARMS 256
514
515#endif /* VBOX_HGCM */
516
517
518#define VBVA_F_STATUS_ACCEPTED (0x01)
519#define VBVA_F_STATUS_ENABLED (0x02)
520
521#pragma pack(4)
522
523typedef struct _VMMDevVideoAccelEnable
524{
525 /* request header */
526 VMMDevRequestHeader header;
527
528 /** 0 - disable, !0 - enable. */
529 uint32_t u32Enable;
530
531 /** The size of VBVAMEMORY::au8RingBuffer expected by driver.
532 * The host will refuse to enable VBVA if the size is not equal to
533 * VBVA_RING_BUFFER_SIZE.
534 */
535 uint32_t cbRingBuffer;
536
537 /** Guest initializes the status to 0. Host sets appropriate VBVA_F_STATUS_ flags. */
538 uint32_t fu32Status;
539
540} VMMDevVideoAccelEnable;
541
542typedef struct _VMMDevVideoAccelFlush
543{
544 /* request header */
545 VMMDevRequestHeader header;
546
547} VMMDevVideoAccelFlush;
548
549#pragma pack()
550
551#pragma pack(1)
552
553/** VBVA command header. */
554typedef struct _VBVACMDHDR
555{
556 /** Coordinates of affected rectangle. */
557 int16_t x;
558 int16_t y;
559 uint16_t w;
560 uint16_t h;
561} VBVACMDHDR;
562
563/* VBVA order codes. Must be >= 0, because the VRDP server internally
564 * uses negative values to mark some operations.
565 * Values are important since they are used as an index in the
566 * "supported orders" bit mask.
567 */
568#define VBVA_VRDP_DIRTY_RECT (0)
569#define VBVA_VRDP_SOLIDRECT (1)
570#define VBVA_VRDP_SOLIDBLT (2)
571#define VBVA_VRDP_DSTBLT (3)
572#define VBVA_VRDP_SCREENBLT (4)
573#define VBVA_VRDP_PATBLTBRUSH (5)
574#define VBVA_VRDP_MEMBLT (6)
575#define VBVA_VRDP_CACHED_BITMAP (7)
576#define VBVA_VRDP_DELETED_BITMAP (8)
577#define VBVA_VRDP_LINE (9)
578#define VBVA_VRDP_BOUNDS (10)
579#define VBVA_VRDP_REPEAT (11)
580#define VBVA_VRDP_POLYLINE (12)
581#define VBVA_VRDP_ELLIPSE (13)
582#define VBVA_VRDP_SAVESCREEN (14)
583
584#define VBVA_VRDP_INDEX_TO_BIT(__index) (1 << (__index))
585
586/* 128 bit bitmap hash. */
587typedef uint8_t VRDPBITMAPHASH[16];
588
589typedef struct _VRDPORDERPOINT
590{
591 int16_t x;
592 int16_t y;
593} VRDPORDERPOINT;
594
595typedef struct _VRDPORDERPOLYPOINTS
596{
597 uint8_t c;
598 VRDPORDERPOINT a[16];
599} VRDPORDERPOLYPOINTS;
600
601typedef struct _VRDPORDERAREA
602{
603 int16_t x;
604 int16_t y;
605 uint16_t w;
606 uint16_t h;
607} VRDPORDERAREA;
608
609typedef struct _VRDPORDERBOUNDS
610{
611 VRDPORDERPOINT pt1;
612 VRDPORDERPOINT pt2;
613} VRDPORDERBOUNDS;
614
615typedef struct _VRDPORDERREPEAT
616{
617 VRDPORDERBOUNDS bounds;
618} VRDPORDERREPEAT;
619
620
621/* Header for bitmap bits in VBVA VRDP operations. */
622typedef struct _VRDPDATABITS
623{
624 /* Size of bitmap data without the header. */
625 uint32_t cb;
626 int16_t x;
627 int16_t y;
628 uint16_t cWidth;
629 uint16_t cHeight;
630 uint8_t cbPixel;
631} VRDPDATABITS;
632
633typedef struct _VRDPORDERSOLIDRECT
634{
635 int16_t x;
636 int16_t y;
637 uint16_t w;
638 uint16_t h;
639 uint32_t rgb;
640} VRDPORDERSOLIDRECT;
641
642typedef struct _VRDPORDERSOLIDBLT
643{
644 int16_t x;
645 int16_t y;
646 uint16_t w;
647 uint16_t h;
648 uint32_t rgb;
649 uint8_t rop;
650} VRDPORDERSOLIDBLT;
651
652typedef struct _VRDPORDERDSTBLT
653{
654 int16_t x;
655 int16_t y;
656 uint16_t w;
657 uint16_t h;
658 uint8_t rop;
659} VRDPORDERDSTBLT;
660
661typedef struct _VRDPORDERSCREENBLT
662{
663 int16_t x;
664 int16_t y;
665 uint16_t w;
666 uint16_t h;
667 int16_t xSrc;
668 int16_t ySrc;
669 uint8_t rop;
670} VRDPORDERSCREENBLT;
671
672typedef struct _VRDPORDERPATBLTBRUSH
673{
674 int16_t x;
675 int16_t y;
676 uint16_t w;
677 uint16_t h;
678 int8_t xSrc;
679 int8_t ySrc;
680 uint32_t rgbFG;
681 uint32_t rgbBG;
682 uint8_t rop;
683 uint8_t pattern[8];
684} VRDPORDERPATBLTBRUSH;
685
686typedef struct _VRDPORDERMEMBLT
687{
688 int16_t x;
689 int16_t y;
690 uint16_t w;
691 uint16_t h;
692 int16_t xSrc;
693 int16_t ySrc;
694 uint8_t rop;
695 VRDPBITMAPHASH hash;
696} VRDPORDERMEMBLT;
697
698typedef struct _VRDPORDERCACHEDBITMAP
699{
700 VRDPBITMAPHASH hash;
701 /* VRDPDATABITS and the bitmap data follows. */
702} VRDPORDERCACHEDBITMAP;
703
704typedef struct _VRDPORDERDELETEDBITMAP
705{
706 VRDPBITMAPHASH hash;
707} VRDPORDERDELETEDBITMAP;
708
709typedef struct _VRDPORDERLINE
710{
711 int16_t x1;
712 int16_t y1;
713 int16_t x2;
714 int16_t y2;
715 int16_t xBounds1;
716 int16_t yBounds1;
717 int16_t xBounds2;
718 int16_t yBounds2;
719 uint8_t mix;
720 uint32_t rgb;
721} VRDPORDERLINE;
722
723typedef struct _VRDPORDERPOLYLINE
724{
725 VRDPORDERPOINT ptStart;
726 uint8_t mix;
727 uint32_t rgb;
728 VRDPORDERPOLYPOINTS points;
729} VRDPORDERPOLYLINE;
730
731typedef struct _VRDPORDERELLIPSE
732{
733 VRDPORDERPOINT pt1;
734 VRDPORDERPOINT pt2;
735 uint8_t mix;
736 uint8_t fillMode;
737 uint32_t rgb;
738} VRDPORDERELLIPSE;
739
740typedef struct _VRDPORDERSAVESCREEN
741{
742 VRDPORDERPOINT pt1;
743 VRDPORDERPOINT pt2;
744 uint8_t ident;
745 uint8_t restore;
746} VRDPORDERSAVESCREEN;
747#pragma pack()
748
749/* The VBVA ring buffer is suitable for transferring large (< 2gb) amount of data.
750 * For example big bitmaps which do not fit to the buffer.
751 *
752 * Guest starts writing to the buffer by initializing a record entry in the
753 * aRecords queue. VBVA_F_RECORD_PARTIAL indicates that the record is being
754 * written. As data is written to the ring buffer, the guest increases off32End
755 * for the record.
756 *
757 * The host reads the aRecords on flushes and processes all completed records.
758 * When host encounters situation when only a partial record presents and
759 * cbRecord & ~VBVA_F_RECORD_PARTIAL >= VBVA_RING_BUFFER_SIZE - VBVA_RING_BUFFER_THRESHOLD,
760 * the host fetched all record data and updates off32Head. After that on each flush
761 * the host continues fetching the data until the record is completed.
762 *
763 */
764
765#define VBVA_RING_BUFFER_SIZE (_4M - _1K)
766#define VBVA_RING_BUFFER_THRESHOLD (4 * _1K)
767
768#define VBVA_MAX_RECORDS (64)
769
770#define VBVA_F_MODE_ENABLED (0x00000001)
771#define VBVA_F_MODE_VRDP (0x00000002)
772#define VBVA_F_MODE_VRDP_RESET (0x00000004)
773#define VBVA_F_MODE_VRDP_ORDER_MASK (0x00000008)
774
775#define VBVA_F_RECORD_PARTIAL (0x80000000)
776
777#pragma pack(1)
778typedef struct _VBVARECORD
779{
780 /** The length of the record. Changed by guest. */
781 uint32_t cbRecord;
782} VBVARECORD;
783
784typedef struct _VBVAMEMORY
785{
786 /** VBVA_F_MODE_* */
787 uint32_t fu32ModeFlags;
788
789 /** The offset where the data start in the buffer. */
790 uint32_t off32Data;
791 /** The offset where next data must be placed in the buffer. */
792 uint32_t off32Free;
793
794 /** The ring buffer for data. */
795 uint8_t au8RingBuffer[VBVA_RING_BUFFER_SIZE];
796
797 /** The queue of record descriptions. */
798 VBVARECORD aRecords[VBVA_MAX_RECORDS];
799 uint32_t indexRecordFirst;
800 uint32_t indexRecordFree;
801
802 /* RDP orders supported by the client. The guest reports only them
803 * and falls back to DIRTY rects for not supported ones.
804 *
805 * (1 << VBVA_VRDP_*)
806 */
807 uint32_t fu32SupportedOrders;
808
809} VBVAMEMORY;
810#pragma pack()
811
812/** @} */
813
814
815/**
816 * VMMDev RAM
817 * @{
818 */
819
820#pragma pack(1)
821/** Layout of VMMDEV RAM region that contains information for guest */
822typedef struct
823{
824 /** size */
825 uint32_t u32Size;
826 /** version */
827 uint32_t u32Version;
828
829 union {
830 /** Flag telling that VMMDev set the IRQ and acknowlegment is required */
831 struct {
832 bool fHaveEvents;
833 } V1_04;
834
835 struct {
836 /** Pending events flags, set by host. */
837 uint32_t u32HostEvents;
838 /** Mask of events the guest wants to see, set by guest. */
839 uint32_t u32GuestEventMask;
840 } V1_03;
841 } V;
842
843 VBVAMEMORY vbvaMemory;
844
845} VMMDevMemory;
846#pragma pack()
847
848/** Version of VMMDevMemory structure. */
849#define VMMDEV_MEMORY_VERSION (1)
850
851/** @} */
852
853
854/**
855 * VMMDev events.
856 * @{
857 */
858
859/** Host mouse capabilities has been changed. */
860#define VMMDEV_EVENT_MOUSE_CAPABILITIES_CHANGED BIT(0)
861/** HGCM event. */
862#define VMMDEV_EVENT_HGCM BIT(1)
863/** A display change request has been issued. */
864#define VMMDEV_EVENT_DISPLAY_CHANGE_REQUEST BIT(2)
865/** Credentials are available for judgement. */
866#define VMMDEV_EVENT_JUDGE_CREDENTIALS BIT(3)
867/** The guest has been restored. */
868#define VMMDEV_EVENT_RESTORED BIT(4)
869
870/** @} */
871
872
873/**
874 * VBoxGuest IOCTL codes and structures.
875 *
876 * The range 0..15 is for basic driver communication.
877 * The range 16..31 is for HGCM communcation.
878 * The range 32..47 is reserved for future use.
879 * The range 48..63 is for OS specific communcation.
880 * The 7th bit is reserved for future hacks.
881 * The 8th bit is reserved for distinguishing between 32-bit and 64-bit
882 * processes in future 64-bit guest additions.
883 *
884 * While windows IOCTL function number has to start at 2048 and stop at 4096 there
885 * never was any need to do this for everyone. A simple ((Function) | 0x800) would
886 * have sufficed. On Linux we're now intruding upon the type field. Fortunately
887 * this hasn't caused any trouble because the FILE_DEVICE_UNKNOWN value was set
888 * to 0x22 (if it were 0x2C it would not have worked soo smoothly). The situation
889 * would've been the same for *BSD and Darwin since they seems to share common
890 * _IOC() heritage.
891 *
892 * However, on good old OS/2 we only have 8-bit handy for the function number. The
893 * result from using the old IOCTL function numbers her would've been overlapping
894 * between the two ranges.
895 *
896 * To fix this problem and get rid of all the unnecessary windowsy crap that I
897 * bet was copied from my SUPDRVIOC.h once upon a time (although the concept of
898 * prefixing macros with the purpose of avoid clashes with system stuff and
899 * to indicate exactly how owns them seems to have been lost somewhere along
900 * the way), I've introduced a VBOXGUEST_IOCTL_CODE for defining generic IN/OUT
901 * IOCtls on new ports of the additions.
902 *
903 * @remark When creating new IOCtl interfaces keep in mind that not all OSes supports
904 * reporting back the output size. (This got messed up a little bit in VBoxDrv.)
905 *
906 * OS/2 restricts the in/out data size to 64KB, while Linux, BSD and Darwin are
907 * limited by a 14 bits size field (16KB). So, special considerations need to
908 * be taken if more input/output needs to be passed around.
909 *
910 * When passing variable sized input/output special care need to be taken on
911 * Unix platforms (if we're going to play by the rules) since the size is
912 * passed as part of the IOCtl code there. IIRC Darwin will use the size to
913 * perform locking and in/out copying, I don't quite know about linux and *BSD.
914 *
915 * @remark If adding interfaces that only has input or only has output, some new macros
916 * needs to be created so the most efficient IOCtl data buffering method can be
917 * used.
918 *
919 * @{
920 */
921#ifdef __AMD64__
922# define VBOXGUEST_IOCTL_FLAG 128
923#elif defined(__X86__)
924# define VBOXGUEST_IOCTL_FLAG 0
925#else
926# error "dunno which arch this is!"
927#endif
928
929#if defined(__WIN__)
930# define IOCTL_CODE(DeviceType, Function, Method, Access, DataSize_ignored) \
931 ( ((DeviceType) << 16) | ((Access) << 14) | ((Function) << 2) | (Method))
932
933#elif defined(__OS2__)
934# define VBOXGUEST_IOCTL_CATEGORY 0xc2
935# define VBOXGUEST_IOCTL_CODE(Function, Size) ((unsigned char)(Function))
936# define VBOXGUEST_IOCTL_CATEGORY_FAST 0xc3 /**< Also defined in VBoxGuestA-os2.asm. */
937# define VBOXGUEST_IOCTL_CODE_FAST(Function) ((unsigned char)(Function))
938
939#elif defined(__LINUX__)
940# define IOCTL_CODE(DeviceType, Function, Method_ignored, Access_ignored, DataSize) \
941 ( (3 << 30) | ((DeviceType) << 8) | (Function) | ((DataSize) << 16) )
942# define METHOD_BUFFERED 0
943# define FILE_WRITE_ACCESS 0x0002
944# define FILE_DEVICE_UNKNOWN 0x00000022
945
946#elif 0 /* BSD style - needs some adjusting _IORW takes a type and not a size. */
947# include <sys/ioccom.h>
948# define VBOXGUEST_IOCTL_CODE(Function, Size) _IORW('V', (Function) | VBOXGUEST_IOCTL_FLAG, (Size))
949# define VBOXGUEST_IOCTL_CODE_FAST(Function) _IO( 'V', (Function) | VBOXGUEST_IOCTL_FLAG)
950
951#else
952/* PORTME */
953#endif
954
955/** IOCTL to VBoxGuest to query the VMMDev IO port region start. */
956#ifdef VBOXGUEST_IOCTL_CODE
957# define VBOXGUEST_IOCTL_GETVMMDEVPORT VBOXGUEST_IOCTL_CODE(1, sizeof(VBoxGuestPortInfo))
958# define IOCTL_VBOXGUEST_GETVMMDEVPORT VBOXGUEST_IOCTL_GETVMMDEVPORT
959#else
960# define IOCTL_VBOXGUEST_GETVMMDEVPORT IOCTL_CODE(FILE_DEVICE_UNKNOWN, 2048, METHOD_BUFFERED, FILE_WRITE_ACCESS, sizeof(VBoxGuestPortInfo))
961#endif
962
963#pragma pack(4)
964typedef struct _VBoxGuestPortInfo
965{
966 uint32_t portAddress;
967 VMMDevMemory *pVMMDevMemory;
968} VBoxGuestPortInfo;
969
970/** IOCTL to VBoxGuest to wait for a VMMDev host notification */
971#ifdef VBOXGUEST_IOCTL_CODE
972# define VBOXGUEST_IOCTL_WAITEVENT VBOXGUEST_IOCTL_CODE(2, sizeof(VBoxGuestWaitEventInfo))
973# define IOCTL_VBOXGUEST_WAITEVENT VBOXGUEST_IOCTL_WAITEVENT
974#else
975# define IOCTL_VBOXGUEST_WAITEVENT IOCTL_CODE(FILE_DEVICE_UNKNOWN, 2049, METHOD_BUFFERED, FILE_WRITE_ACCESS, sizeof(VBoxGuestWaitEventInfo))
976#endif
977
978/**
979 * Result codes for VBoxGuestWaitEventInfo::u32Result
980 * @{
981 */
982/** Successful completion, an event occured. */
983#define VBOXGUEST_WAITEVENT_OK (0)
984/** Successful completion, timed out. */
985#define VBOXGUEST_WAITEVENT_TIMEOUT (1)
986/** Wait was interrupted. */
987#define VBOXGUEST_WAITEVENT_INTERRUPTED (2)
988/** An error occured while processing the request. */
989#define VBOXGUEST_WAITEVENT_ERROR (3)
990/** @} */
991
992/** Input and output buffers layout of the IOCTL_VBOXGUEST_WAITEVENT */
993typedef struct _VBoxGuestWaitEventInfo
994{
995 /** timeout in milliseconds */
996 uint32_t u32TimeoutIn;
997 /** events to wait for */
998 uint32_t u32EventMaskIn;
999 /** result code */
1000 uint32_t u32Result;
1001 /** events occured */
1002 uint32_t u32EventFlagsOut;
1003} VBoxGuestWaitEventInfo;
1004
1005/** IOCTL to VBoxGuest to perform a VMM request
1006 * @remark The data buffer for this IOCtl has an variable size, keep this in mind
1007 * on systems where this matters. */
1008#ifdef VBOXGUEST_IOCTL_CODE
1009# define VBOXGUEST_IOCTL_VMMREQUEST(Size) VBOXGUEST_IOCTL_CODE(3, sizeof(VMMDevRequestHeader))
1010# define IOCTL_VBOXGUEST_VMMREQUEST VBOXGUEST_IOCTL_VMMREQUEST(sizeof(VMMDevRequestHeader))
1011#else
1012# define IOCTL_VBOXGUEST_VMMREQUEST IOCTL_CODE(FILE_DEVICE_UNKNOWN, 2050, METHOD_BUFFERED, FILE_WRITE_ACCESS, sizeof(VMMDevRequestHeader))
1013#endif
1014
1015/** Input and output buffer layout of the IOCTL_VBOXGUEST_CTL_FILTER_MASK. */
1016typedef struct _VBoxGuestFilterMaskInfo
1017{
1018 uint32_t u32OrMask;
1019 uint32_t u32NotMask;
1020} VBoxGuestFilterMaskInfo;
1021#pragma pack()
1022
1023/** IOCTL to VBoxGuest to control event filter mask */
1024#ifdef VBOXGUEST_IOCTL_CODE
1025# define VBOXGUEST_IOCTL_CTL_FILTER_MASK VBOXGUEST_IOCTL_CODE(4, sizeof(VBoxGuestFilterMaskInfo))
1026# define IOCTL_VBOXGUEST_CTL_FILTER_MASK VBOXGUEST_IOCTL_CTL_FILTER_MASK
1027#else
1028# define IOCTL_VBOXGUEST_CTL_FILTER_MASK IOCTL_CODE(FILE_DEVICE_UNKNOWN, 2051, METHOD_BUFFERED, FILE_WRITE_ACCESS, sizeof (VBoxGuestFilterMaskInfo))
1029#endif
1030
1031#ifdef VBOX_HGCM
1032/* These structures are shared between the driver and other binaries,
1033 * therefore packing must be defined explicitely.
1034 */
1035#pragma pack(1)
1036typedef struct _VBoxGuestHGCMConnectInfo
1037{
1038 uint32_t result; /**< OUT */
1039 HGCMServiceLocation Loc; /**< IN */
1040 uint32_t u32ClientID; /**< OUT */
1041} VBoxGuestHGCMConnectInfo;
1042
1043typedef struct _VBoxGuestHGCMDisconnectInfo
1044{
1045 uint32_t result; /**< OUT */
1046 uint32_t u32ClientID; /**< IN */
1047} VBoxGuestHGCMDisconnectInfo;
1048
1049typedef struct _VBoxGuestHGCMCallInfo
1050{
1051 uint32_t result; /**< OUT Host HGCM return code.*/
1052 uint32_t u32ClientID; /**< IN The id of the caller. */
1053 uint32_t u32Function; /**< IN Function number. */
1054 uint32_t cParms; /**< IN How many parms. */
1055 /* Parameters follow in form HGCMFunctionParameter aParms[cParms] */
1056} VBoxGuestHGCMCallInfo;
1057#pragma pack()
1058
1059#ifdef VBOXGUEST_IOCTL_CODE
1060# define VBOXGUEST_IOCTL_HGCM_CONNECT VBOXGUEST_IOCTL_CODE(16, sizeof(VBoxGuestHGCMConnectInfo))
1061# define IOCTL_VBOXGUEST_HGCM_CONNECT VBOXGUEST_IOCTL_HGCM_CONNECT
1062# define VBOXGUEST_IOCTL_HGCM_DISCONNECT VBOXGUEST_IOCTL_CODE(17, sizeof(VBoxGuestHGCMDisconnectInfo))
1063# define IOCTL_VBOXGUEST_HGCM_DISCONNECT VBOXGUEST_IOCTL_HGCM_DISCONNECT
1064# define VBOXGUEST_IOCTL_HGCM_CALL(Size) VBOXGUEST_IOCTL_CODE(18, (Size))
1065# define IOCTL_VBOXGUEST_HGCM_CALL VBOXGUEST_IOCTL_HGCM_CALL(sizeof(VBoxGuestHGCMCallInfo))
1066# define VBOXGUEST_IOCTL_CLIPBOARD_CONNECT VBOXGUEST_IOCTL_CODE(19, sizeof(uint32_t))
1067# define IOCTL_VBOXGUEST_CLIPBOARD_CONNECT VBOXGUEST_IOCTL_CLIPBOARD_CONNECT
1068#else
1069# define IOCTL_VBOXGUEST_HGCM_CONNECT IOCTL_CODE(FILE_DEVICE_UNKNOWN, 3072, METHOD_BUFFERED, FILE_WRITE_ACCESS, sizeof(VBoxGuestHGCMConnectInfo))
1070# define IOCTL_VBOXGUEST_HGCM_DISCONNECT IOCTL_CODE(FILE_DEVICE_UNKNOWN, 3073, METHOD_BUFFERED, FILE_WRITE_ACCESS, sizeof(VBoxGuestHGCMDisconnectInfo))
1071# define IOCTL_VBOXGUEST_HGCM_CALL IOCTL_CODE(FILE_DEVICE_UNKNOWN, 3074, METHOD_BUFFERED, FILE_WRITE_ACCESS, sizeof(VBoxGuestHGCMCallInfo))
1072# define IOCTL_VBOXGUEST_CLIPBOARD_CONNECT IOCTL_CODE(FILE_DEVICE_UNKNOWN, 3075, METHOD_BUFFERED, FILE_WRITE_ACCESS, sizeof(uint32_t))
1073#endif
1074
1075#define VBOXGUEST_HGCM_CALL_PARMS(a) ((HGCMFunctionParameter *)((uint8_t *)(a) + sizeof (VBoxGuestHGCMCallInfo)))
1076
1077#endif /* VBOX_HGCM */
1078
1079/*
1080 * Credentials request flags and structure
1081 */
1082
1083#define VMMDEV_CREDENTIALS_STRLEN 128
1084
1085/** query from host whether credentials are present */
1086#define VMMDEV_CREDENTIALS_QUERYPRESENCE BIT(1)
1087/** read credentials from host (can be combined with clear) */
1088#define VMMDEV_CREDENTIALS_READ BIT(2)
1089/** clear credentials on host (can be combined with read) */
1090#define VMMDEV_CREDENTIALS_CLEAR BIT(3)
1091/** read credentials for judgement in the guest */
1092#define VMMDEV_CREDENTIALS_READJUDGE BIT(8)
1093/** clear credentials for judegement on the host */
1094#define VMMDEV_CREDENTIALS_CLEARJUDGE BIT(9)
1095/** report credentials acceptance by guest */
1096#define VMMDEV_CREDENTIALS_JUDGE_OK BIT(10)
1097/** report credentials denial by guest */
1098#define VMMDEV_CREDENTIALS_JUDGE_DENY BIT(11)
1099/** report that no judgement could be made by guest */
1100#define VMMDEV_CREDENTIALS_JUDGE_NOJUDGEMENT BIT(12)
1101
1102/** flag telling the guest that credentials are present */
1103#define VMMDEV_CREDENTIALS_PRESENT BIT(16)
1104/** flag telling guest that local logons should be prohibited */
1105#define VMMDEV_CREDENTIALS_NOLOCALLOGON BIT(17)
1106
1107/** credentials request structure */
1108#pragma pack(4)
1109typedef struct _VMMDevCredentials
1110{
1111 /* request header */
1112 VMMDevRequestHeader header;
1113 /* request flags (in/out) */
1114 uint32_t u32Flags;
1115 /* user name (UTF-8) (out) */
1116 char szUserName[VMMDEV_CREDENTIALS_STRLEN];
1117 /* password (UTF-8) (out) */
1118 char szPassword[VMMDEV_CREDENTIALS_STRLEN];
1119 /* domain name (UTF-8) (out) */
1120 char szDomain[VMMDEV_CREDENTIALS_STRLEN];
1121} VMMDevCredentials;
1122#pragma pack()
1123
1124/** inline helper to determine the request size for the given operation */
1125DECLINLINE(size_t) vmmdevGetRequestSize(VMMDevRequestType requestType)
1126{
1127 switch (requestType)
1128 {
1129 case VMMDevReq_GetMouseStatus:
1130 case VMMDevReq_SetMouseStatus:
1131 return sizeof(VMMDevReqMouseStatus);
1132 case VMMDevReq_SetPointerShape:
1133 return sizeof(VMMDevReqMousePointer);
1134 case VMMDevReq_GetHostVersion:
1135 return sizeof(VMMDevReqHostVersion);
1136 case VMMDevReq_Idle:
1137 return sizeof(VMMDevReqIdle);
1138 case VMMDevReq_GetHostTime:
1139 return sizeof(VMMDevReqHostTime);
1140 case VMMDevReq_GetHypervisorInfo:
1141 case VMMDevReq_SetHypervisorInfo:
1142 return sizeof(VMMDevReqHypervisorInfo);
1143 case VMMDevReq_SetPowerStatus:
1144 return sizeof(VMMDevPowerStateRequest);
1145 case VMMDevReq_AcknowledgeEvents:
1146 return sizeof(VMMDevEvents);
1147 case VMMDevReq_ReportGuestInfo:
1148 return sizeof(VMMDevReportGuestInfo);
1149 case VMMDevReq_GetDisplayChangeRequest:
1150 return sizeof(VMMDevDisplayChangeRequest);
1151 case VMMDevReq_GetDisplayChangeRequest2:
1152 return sizeof(VMMDevDisplayChangeRequest2);
1153 case VMMDevReq_VideoModeSupported:
1154 return sizeof(VMMDevVideoModeSupportedRequest);
1155 case VMMDevReq_GetHeightReduction:
1156 return sizeof(VMMDevGetHeightReductionRequest);
1157#ifdef VBOX_HGCM
1158 case VMMDevReq_HGCMConnect:
1159 return sizeof(VMMDevHGCMConnect);
1160 case VMMDevReq_HGCMDisconnect:
1161 return sizeof(VMMDevHGCMDisconnect);
1162 case VMMDevReq_HGCMCall:
1163 return sizeof(VMMDevHGCMCall);
1164#endif
1165 case VMMDevReq_VideoAccelEnable:
1166 return sizeof(VMMDevVideoAccelEnable);
1167 case VMMDevReq_VideoAccelFlush:
1168 return sizeof(VMMDevVideoAccelFlush);
1169 case VMMDevReq_QueryCredentials:
1170 return sizeof(VMMDevCredentials);
1171 default:
1172 return 0;
1173 }
1174}
1175
1176/**
1177 * Initializes a request structure.
1178 *
1179 */
1180DECLINLINE(int) vmmdevInitRequest(VMMDevRequestHeader *req, VMMDevRequestType type)
1181{
1182 uint32_t requestSize;
1183 if (!req)
1184 return VERR_INVALID_PARAMETER;
1185 requestSize = (uint32_t)vmmdevGetRequestSize(type);
1186 if (!requestSize)
1187 return VERR_INVALID_PARAMETER;
1188 req->size = requestSize;
1189 req->version = VMMDEV_REQUEST_HEADER_VERSION;
1190 req->requestType = type;
1191 req->rc = VERR_GENERAL_FAILURE;
1192 req->reserved1 = 0;
1193 req->reserved2 = 0;
1194 return VINF_SUCCESS;
1195}
1196
1197
1198#ifdef __OS2__
1199
1200/**
1201 * The data buffer layout for the IDC entry point (AttachDD).
1202 *
1203 * @remark This is defined in multiple 16-bit headers / sources.
1204 * Some places it's called VBGOS2IDC to short things a bit.
1205 */
1206typedef struct VBOXGUESTOS2IDCCONNECT
1207{
1208 /** VMMDEV_VERSION. */
1209 uint32_t u32Version;
1210 /** Opaque session handle. */
1211 uint32_t u32Session;
1212
1213 /**
1214 * The 32-bit service entry point.
1215 *
1216 * @returns VBox status code.
1217 * @param u32Session The above session handle.
1218 * @param iFunction The requested function.
1219 * @param pvData The input/output data buffer. The caller ensures that this
1220 * cannot be swapped out, or that it's acceptable to take a
1221 * page in fault in the current context. If the request doesn't
1222 * take input or produces output, apssing NULL is okay.
1223 * @param cbData The size of the data buffer.
1224 * @param pcbDataReturned Where to store the amount of data that's returned.
1225 * This can be NULL if pvData is NULL.
1226 */
1227 DECLCALLBACKMEMBER(int, pfnServiceEP)(uint32_t u32Session, unsigned iFunction, void *pvData, size_t cbData, size_t *pcbDataReturned);
1228
1229 /** The 16-bit service entry point for C code (cdecl).
1230 *
1231 * It's the same as the 32-bit entry point, but the types has
1232 * changed to 16-bit equivalents.
1233 *
1234 * @code
1235 * int far cdecl
1236 * VBoxGuestOs2IDCService16(uint32_t u32Session, uint16_t iFunction,
1237 * void far *fpvData, uint16_t cbData, uint16_t far *pcbDataReturned);
1238 * @endcode
1239 */
1240 RTFAR16 fpfnServiceEP;
1241
1242 /** The 16-bit service entry point for Assembly code (register).
1243 *
1244 * This is just a wrapper around fpfnServiceEP to simplify calls
1245 * from 16-bit assembly code.
1246 *
1247 * @returns (e)ax: VBox status code; cx: The amount of data returned.
1248 *
1249 * @param u32Session eax - The above session handle.
1250 * @param iFunction dl - The requested function.
1251 * @param pvData es:bx - The input/output data buffer.
1252 * @param cbData cx - The size of the data buffer.
1253 */
1254 RTFAR16 fpfnServiceAsmEP;
1255} VBOXGUESTOS2IDCCONNECT;
1256/** Pointer to VBOXGUESTOS2IDCCONNECT buffer. */
1257typedef VBOXGUESTOS2IDCCONNECT *PVBOXGUESTOS2IDCCONNECT;
1258
1259/** OS/2 specific: IDC client disconnect request.
1260 *
1261 * This takes no input and it doesn't return anything. Obviously this
1262 * is only recognized if it arrives thru the IDC service EP.
1263 */
1264#define VBOXGUEST_IOCTL_OS2_IDC_DISCONNECT VBOXGUEST_IOCTL_CODE(48, sizeof(uint32_t))
1265
1266#endif /* __OS2__ */
1267
1268/** @} */
1269
1270
1271#ifdef IN_RING3
1272
1273/** @def VBGLR3DECL
1274 * Ring 3 VBGL declaration.
1275 * @param type The return type of the function declaration.
1276 */
1277#define VBGLR3DECL(type) type VBOXCALL
1278
1279__BEGIN_DECLS
1280VBGLR3DECL(int) VbglR3Init(void);
1281VBGLR3DECL(void) VbglR3Term(void);
1282VBGLR3DECL(int) VbglR3GRPerform(VMMDevRequestHeader *pReq);
1283# ifdef __iprt_time_h__
1284VBGLR3DECL(int) VbglR3GetHostTime(PRTTIMESPEC pTime);
1285# endif
1286
1287__END_DECLS
1288
1289#endif /* IN_RING3 */
1290
1291#endif /* __VBox_VBoxGuest_h__ */
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