VirtualBox

source: vbox/trunk/src/VBox/Additions/WINNT/VBoxTray/VBoxDispIf.h@ 55628

Last change on this file since 55628 was 55401, checked in by vboxsync, 10 years ago

added a couple of missing Id headers

  • Property svn:eol-style set to native
  • Property svn:keywords set to Author Date Id Revision
File size: 4.3 KB
Line 
1/* $Id: VBoxDispIf.h 55401 2015-04-23 10:03:17Z vboxsync $ */
2/** @file
3 * VBoxTray - Display Settings Interface abstraction for XPDM & WDDM
4 */
5
6/*
7 * Copyright (C) 2006-2012 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#include <iprt/cdefs.h>
18
19#ifdef VBOX_WITH_WDDM
20# define D3DKMDT_SPECIAL_MULTIPLATFORM_TOOL
21# include <d3dkmthk.h>
22# include "../Graphics/Video/disp/wddm/VBoxDispKmt.h"
23#endif
24
25#include <VBoxDisplay.h>
26
27typedef enum
28{
29 VBOXDISPIF_MODE_UNKNOWN = 0,
30 VBOXDISPIF_MODE_XPDM_NT4 = 1,
31 VBOXDISPIF_MODE_XPDM
32#ifdef VBOX_WITH_WDDM
33 , VBOXDISPIF_MODE_WDDM
34 , VBOXDISPIF_MODE_WDDM_W7
35#endif
36} VBOXDISPIF_MODE;
37/* display driver interface abstraction for XPDM & WDDM
38 * with WDDM we can not use ExtEscape to communicate with our driver
39 * because we do not have XPDM display driver any more, i.e. escape requests are handled by cdd
40 * that knows nothing about us
41 * NOTE: DispIf makes no checks whether the display driver is actually a VBox driver,
42 * it just switches between using different backend OS API based on the VBoxDispIfSwitchMode call
43 * It's caller's responsibility to initiate it to work in the correct mode */
44typedef struct VBOXDISPIF
45{
46 VBOXDISPIF_MODE enmMode;
47 /* with WDDM the approach is to call into WDDM miniport driver via PFND3DKMT API provided by the GDI,
48 * The PFND3DKMT is supposed to be used by the OpenGL ICD according to MSDN, so this approach is a bit hacky */
49 union
50 {
51 struct
52 {
53 LONG (WINAPI * pfnChangeDisplaySettingsEx)(LPCSTR lpszDeviceName, LPDEVMODE lpDevMode, HWND hwnd, DWORD dwflags, LPVOID lParam);
54 } xpdm;
55#ifdef VBOX_WITH_WDDM
56 struct
57 {
58 /* ChangeDisplaySettingsEx does not exist in NT. ResizeDisplayDevice uses the function. */
59 LONG (WINAPI * pfnChangeDisplaySettingsEx)(LPCTSTR lpszDeviceName, LPDEVMODE lpDevMode, HWND hwnd, DWORD dwflags, LPVOID lParam);
60
61 /* EnumDisplayDevices does not exist in NT. isVBoxDisplayDriverActive et al. are using these functions. */
62 BOOL (WINAPI * pfnEnumDisplayDevices)(IN LPCSTR lpDevice, IN DWORD iDevNum, OUT PDISPLAY_DEVICEA lpDisplayDevice, IN DWORD dwFlags);
63
64 VBOXDISPKMT_CALLBACKS KmtCallbacks;
65 } wddm;
66#endif
67 } modeData;
68} VBOXDISPIF, *PVBOXDISPIF;
69typedef const struct VBOXDISPIF *PCVBOXDISPIF;
70
71/* initializes the DispIf
72 * Initially the DispIf is configured to work in XPDM mode
73 * call VBoxDispIfSwitchMode to switch the mode to WDDM */
74DWORD VBoxDispIfInit(PVBOXDISPIF pIf);
75DWORD VBoxDispIfSwitchMode(PVBOXDISPIF pIf, VBOXDISPIF_MODE enmMode, VBOXDISPIF_MODE *penmOldMode);
76DECLINLINE(VBOXDISPIF_MODE) VBoxDispGetMode(PVBOXDISPIF pIf) { return pIf->enmMode; }
77DWORD VBoxDispIfTerm(PVBOXDISPIF pIf);
78DWORD VBoxDispIfEscape(PCVBOXDISPIF const pIf, PVBOXDISPIFESCAPE pEscape, int cbData);
79DWORD VBoxDispIfEscapeInOut(PCVBOXDISPIF const pIf, PVBOXDISPIFESCAPE pEscape, int cbData);
80DWORD VBoxDispIfResizeModes(PCVBOXDISPIF const pIf, UINT iChangedMode, BOOL fEnable, BOOL fExtDispSup, DISPLAY_DEVICE *paDisplayDevices, DEVMODE *paDeviceModes, UINT cDevModes);
81DWORD VBoxDispIfCancelPendingResize(PCVBOXDISPIF const pIf);
82
83DWORD VBoxDispIfResizeStarted(PCVBOXDISPIF const pIf);
84
85
86typedef struct VBOXDISPIF_SEAMLESS
87{
88 PCVBOXDISPIF pIf;
89
90 union
91 {
92#ifdef VBOX_WITH_WDDM
93 struct
94 {
95 VBOXDISPKMT_ADAPTER Adapter;
96# ifdef VBOX_DISPIF_WITH_OPCONTEXT
97 VBOXDISPKMT_DEVICE Device;
98 VBOXDISPKMT_CONTEXT Context;
99# endif
100 } wddm;
101#endif
102 } modeData;
103} VBOXDISPIF_SEAMLESS;
104
105DECLINLINE(bool) VBoxDispIfSeamlesIsValid(VBOXDISPIF_SEAMLESS *pSeamless)
106{
107 return !!pSeamless->pIf;
108}
109
110DWORD VBoxDispIfSeamlesCreate(PCVBOXDISPIF const pIf, VBOXDISPIF_SEAMLESS *pSeamless, HANDLE hEvent);
111DWORD VBoxDispIfSeamlesTerm(VBOXDISPIF_SEAMLESS *pSeamless);
112DWORD VBoxDispIfSeamlesSubmit(VBOXDISPIF_SEAMLESS *pSeamless, VBOXDISPIFESCAPE *pData, int cbData);
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