VirtualBox

source: vbox/trunk/src/VBox/Additions/WINNT/Graphics/Video/common/xpdm/VBoxVideoIOCTL.h@ 85121

Last change on this file since 85121 was 85121, checked in by vboxsync, 4 years ago

iprt/cdefs.h: Refactored the typedef use of DECLCALLBACK as well as DECLCALLBACKMEMBER to wrap the whole expression, similar to the DECLR?CALLBACKMEMBER macros. This allows adding a throw() at the end when compiling with the VC++ compiler to indicate that the callbacks won't throw anything, so we can stop supressing the C5039 warning about passing functions that can potential throw C++ exceptions to extern C code that can't necessarily cope with such (unwind,++). Introduced a few _EX variations that allows specifying different/no calling convention too, as that's handy when dynamically resolving host APIs. Fixed numerous places missing DECLCALLBACK and such. Left two angry @todos regarding use of CreateThread. bugref:9794

  • Property svn:eol-style set to native
  • Property svn:keywords set to Author Date Id Revision
File size: 5.6 KB
Line 
1/* $Id: VBoxVideoIOCTL.h 85121 2020-07-08 19:33:26Z vboxsync $ */
2/** @file
3 * VBox Miniport IOCTL related header
4 */
5
6/*
7 * Copyright (C) 2011-2020 Oracle Corporation
8 *
9 * This file is part of VirtualBox Open Source Edition (OSE), as
10 * available from http://www.virtualbox.org. This file is free software;
11 * you can redistribute it and/or modify it under the terms of the GNU
12 * General Public License (GPL) as published by the Free Software
13 * Foundation, in version 2 as it comes in the "COPYING" file of the
14 * VirtualBox OSE distribution. VirtualBox OSE is distributed in the
15 * hope that it will be useful, but WITHOUT ANY WARRANTY of any kind.
16 */
17
18#ifndef GA_INCLUDED_SRC_WINNT_Graphics_Video_common_xpdm_VBoxVideoIOCTL_h
19#define GA_INCLUDED_SRC_WINNT_Graphics_Video_common_xpdm_VBoxVideoIOCTL_h
20#ifndef RT_WITHOUT_PRAGMA_ONCE
21# pragma once
22#endif
23
24#include <VBox/VMMDev.h> /* VBVAMEMORY */
25#include <HGSMI.h>
26
27/* ==================== VirtualBox specific VRP's ==================== */
28
29/* Called by the display driver when it is ready to
30 * switch to VBVA operation mode.
31 * Successful return means that VBVA can be used and
32 * output buffer contains VBVAENABLERESULT data.
33 * An error means that VBVA can not be used
34 * (disabled or not supported by the host).
35 */
36#define IOCTL_VIDEO_VBVA_ENABLE \
37 CTL_CODE(FILE_DEVICE_VIDEO, 0x400, METHOD_BUFFERED, FILE_ANY_ACCESS)
38
39/* Called to get video port api function pointers */
40#define IOCTL_VIDEO_HGSMI_QUERY_PORTPROCS \
41 CTL_CODE(FILE_DEVICE_VIDEO, 0x434, METHOD_BUFFERED, FILE_ANY_ACCESS)
42
43/* Called to get HGSMI related callbacks */
44#define IOCTL_VIDEO_HGSMI_QUERY_CALLBACKS \
45 CTL_CODE(FILE_DEVICE_VIDEO, 0x431, METHOD_BUFFERED, FILE_ANY_ACCESS)
46
47/* Called to get adapter's HGSMI information */
48#define IOCTL_VIDEO_QUERY_HGSMI_INFO \
49 CTL_CODE(FILE_DEVICE_VIDEO, 0x430, METHOD_BUFFERED, FILE_ANY_ACCESS)
50
51/* Called to enable HGSMI miniport channel */
52#define IOCTL_VIDEO_HGSMI_HANDLER_ENABLE \
53 CTL_CODE(FILE_DEVICE_VIDEO, 0x432, METHOD_BUFFERED, FILE_ANY_ACCESS)
54
55/* Called to disable HGSMI miniport channel */
56#define IOCTL_VIDEO_HGSMI_HANDLER_DISABLE \
57 CTL_CODE(FILE_DEVICE_VIDEO, 0x433, METHOD_BUFFERED, FILE_ANY_ACCESS)
58
59/* Called to get framebuffer offset */
60#define IOCTL_VIDEO_VHWA_QUERY_INFO \
61 CTL_CODE(FILE_DEVICE_VIDEO, 0x435, METHOD_BUFFERED, FILE_ANY_ACCESS)
62
63/* Called to get adapter's generic information */
64#define IOCTL_VIDEO_QUERY_VBOXVIDEO_INFO \
65 CTL_CODE(FILE_DEVICE_VIDEO, 0x436, METHOD_BUFFERED, FILE_ANY_ACCESS)
66
67/* ==================== Data structures used by VirtualBox VRPS's ==================== */
68typedef void* HVBOXVIDEOHGSMI;
69
70/** Complete host commands addressed to the display */
71typedef DECLCALLBACKTYPE(void, FNVBOXVIDEOHGSMICOMPLETION,(HVBOXVIDEOHGSMI hHGSMI,
72 struct VBVAHOSTCMD RT_UNTRUSTED_VOLATILE_HOST * pCmd));
73typedef FNVBOXVIDEOHGSMICOMPLETION *PFNVBOXVIDEOHGSMICOMPLETION;
74
75/** request the host commands addressed to the display */
76typedef DECLCALLBACKTYPE(int, FNVBOXVIDEOHGSMICOMMANDS,(HVBOXVIDEOHGSMI hHGSMI, uint8_t u8Channel, uint32_t iDevice,
77 struct VBVAHOSTCMD RT_UNTRUSTED_VOLATILE_HOST ** ppCmd));
78typedef FNVBOXVIDEOHGSMICOMMANDS *PFNVBOXVIDEOHGSMICOMMANDS;
79
80/** post guest command (offset) to the host */
81typedef DECLCALLBACKTYPE(void, FNVBOXVIDEOHGSMIPOSTCOMMAND,(HVBOXVIDEOHGSMI hHGSMI, HGSMIOFFSET offCmd));
82typedef FNVBOXVIDEOHGSMIPOSTCOMMAND *PFNVBOXVIDEOHGSMIPOSTCOMMAND;
83
84#pragma pack(1)
85/* Data returned by IOCTL_VIDEO_VBVA_ENABLE. */
86typedef struct _VBVAENABLERESULT
87{
88 /* Pointer to VBVAMemory part of VMMDev memory region. */
89 VBVAMEMORY *pVbvaMemory;
90
91 /* Called to force the host to process VBVA memory,
92 * when there is no more free space in VBVA memory.
93 * Normally this never happens.
94 *
95 * The other purpose is to perform a synchronous command.
96 * But the goal is to have no such commands at all.
97 */
98 DECLR0CALLBACKMEMBER(void, pfnFlush, (void *pvFlush));
99
100 /* Pointer required by the pfnFlush callback. */
101 void *pvFlush;
102
103} VBVAENABLERESULT;
104
105/* Data returned by IOCTL_VIDEO_HGSMI_QUERY_PORTPROCS. */
106typedef struct _HGSMIQUERYCPORTPROCS
107{
108 PVOID pContext;
109 VBOXVIDEOPORTPROCS VideoPortProcs;
110} HGSMIQUERYCPORTPROCS;
111
112/** Data returned by IOCTL_VIDEO_HGSMI_QUERY_CALLBACKS. */
113typedef struct _HGSMIQUERYCALLBACKS
114{
115 HVBOXVIDEOHGSMI hContext;
116 PFNVBOXVIDEOHGSMICOMPLETION pfnCompletionHandler;
117 PFNVBOXVIDEOHGSMICOMMANDS pfnRequestCommandsHandler;
118} HGSMIQUERYCALLBACKS;
119
120/* Data returned by IOCTL_VIDEO_QUERY_HGSMI_INFO. */
121typedef struct _QUERYHGSMIRESULT
122{
123 /* Device index (0 for primary) */
124 ULONG iDevice;
125
126 /* Flags. Currently none are defined and the field must be initialized to 0. */
127 ULONG ulFlags;
128
129 /* Describes VRAM chunk for this display device. */
130 HGSMIAREA areaDisplay;
131
132 /* Size of the display information area. */
133 uint32_t u32DisplayInfoSize;
134
135 /* Minimum size of the VBVA buffer. */
136 uint32_t u32MinVBVABufferSize;
137
138 /* IO port to submit guest HGSMI commands. */
139 RTIOPORT IOPortGuestCommand;
140} QUERYHGSMIRESULT;
141
142/* Data passed to IOCTL_VIDEO_HGSMI_HANDLER_ENABLE. */
143typedef struct _HGSMIHANDLERENABLE
144{
145 uint8_t u8Channel;
146} HGSMIHANDLERENABLE;
147
148#ifdef VBOX_WITH_VIDEOHWACCEL
149/* Data returned by IOCTL_VIDEO_VHWA_QUERY_INFO. */
150typedef struct _VHWAQUERYINFO
151{
152 ULONG_PTR offVramBase;
153} VHWAQUERYINFO;
154#endif
155#pragma pack()
156
157/* IOCTL_VIDEO_QUERY_INFO */
158#define VBOXVIDEO_INFO_LEVEL_REGISTRY_FLAGS 1
159
160#define VBOXVIDEO_REGISTRY_FLAGS_DISABLE_BITMAP_CACHE 0x00000001
161
162#endif /* !GA_INCLUDED_SRC_WINNT_Graphics_Video_common_xpdm_VBoxVideoIOCTL_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