VirtualBox

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

Last change on this file since 27988 was 27988, checked in by vboxsync, 15 years ago

wddm: more impl for guest autoresize support

  • Property svn:eol-style set to native
  • Property svn:keywords set to Author Date Id Revision
File size: 4.7 KB
Line 
1/* $Id: VBoxTray.h 27988 2010-04-05 18:39:38Z vboxsync $ */
2/** @file
3 * VBoxTray - Guest Additions Tray, Internal Header.
4 */
5
6/*
7 * Copyright (C) 2006-2007 Sun Microsystems, Inc.
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 * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa
18 * Clara, CA 95054 USA or visit http://www.sun.com if you need
19 * additional information or have any questions.
20 */
21
22#ifndef ___VBOXTRAY_H
23#define ___VBOXTRAY_H
24
25#include <windows.h>
26#include <tchar.h>
27#include <stdio.h>
28#include <stdarg.h>
29#include <process.h>
30
31#include <iprt/initterm.h>
32#include <iprt/string.h>
33
34#include <VBox/version.h>
35#include <VBox/Log.h>
36#include <VBox/VBoxGuest.h> /** @todo use the VbglR3 interface! */
37#include <VBox/VBoxGuestLib.h>
38#include <VBoxDisplay.h>
39#ifdef VBOXWDDM
40# include <d3dkmthk.h>
41#endif
42
43#define WM_VBOX_RESTORED WM_APP + 1
44#define WM_VBOX_CHECK_VRDP WM_APP + 2
45#define WM_VBOX_CHECK_HOSTVERSION WM_APP + 3
46#define WM_VBOX_TRAY WM_APP + 4
47
48#define ID_TRAYICON 2000
49
50typedef enum
51{
52 VBOXDISPIF_MODE_UNKNOWN = 0,
53 VBOXDISPIF_MODE_XPDM_NT4 = 1,
54 VBOXDISPIF_MODE_XPDM
55#ifdef VBOXWDDM
56 , VBOXDISPIF_MODE_WDDM
57#endif
58} VBOXDISPIF_MODE;
59/* display driver interface abstraction for XPDM & WDDM
60 * with WDDM we can not use ExtEscape to communicate with our driver
61 * because we do not have XPDM display driver any more, i.e. escape requests are handled by cdd
62 * that knows nothing about us
63 * NOTE: DispIf makes no checks whether the display driver is actually a VBox driver,
64 * it just switches between using different backend OS API based on the VBoxDispIfSwitchMode call
65 * It's caller's responsibility to initiate it to work in the correct mode */
66typedef struct VBOXDISPIF
67{
68 VBOXDISPIF_MODE enmMode;
69#ifdef VBOXWDDM
70 /* with WDDM the approach is to call into WDDM miniport driver via PFND3DKMT API provided by the GDI,
71 * The PFND3DKMT is supposed to be used by the OpenGL ICD according to MSDN, so this approach is a bit hacky */
72 union
73 {
74 struct
75 {
76 LONG (WINAPI * pfnChangeDisplaySettingsEx)(LPCSTR lpszDeviceName, LPDEVMODE lpDevMode, HWND hwnd, DWORD dwflags, LPVOID lParam);
77 } xpdm;
78
79 struct
80 {
81 /* open adapter */
82 PFND3DKMT_OPENADAPTERFROMHDC pfnD3DKMTOpenAdapterFromHdc;
83 PFND3DKMT_OPENADAPTERFROMGDIDISPLAYNAME pfnD3DKMTOpenAdapterFromGdiDisplayName;
84 /* close adapter */
85 PFND3DKMT_CLOSEADAPTER pfnD3DKMTCloseAdapter;
86 /* escape */
87 PFND3DKMT_ESCAPE pfnD3DKMTEscape;
88 /* auto resize support */
89 PFND3DKMT_INVALIDATEACTIVEVIDPN pfnD3DKMTInvalidateActiveVidPn;
90 } wddm;
91 } modeData;
92#endif
93} VBOXDISPIF, *PVBOXDISPIF;
94typedef const struct VBOXDISPIF *PCVBOXDISPIF;
95
96/* initializes the DispIf
97 * Initially the DispIf is configured to work in XPDM mode
98 * call VBoxDispIfSwitchMode to switch the mode to WDDM */
99DWORD VBoxDispIfInit(PVBOXDISPIF pIf);
100DWORD VBoxDispIfSwitchMode(PVBOXDISPIF pIf, VBOXDISPIF_MODE enmMode, VBOXDISPIF_MODE *penmOldMode);
101DECLINLINE(VBOXDISPIF_MODE) VBoxDispGetMode(PVBOXDISPIF pIf) { return pIf->enmMode; }
102DWORD VBoxDispIfTerm(PVBOXDISPIF pIf);
103DWORD VBoxDispIfEscape(PCVBOXDISPIF const pIf, PVBOXDISPIFESCAPE pEscape, int cbData);
104DWORD VBoxDispIfResize(PCVBOXDISPIF const pIf, ULONG Id, DWORD Width, DWORD Height, DWORD BitsPerPixel);
105
106/* The environment information for services. */
107typedef struct _VBOXSERVICEENV
108{
109 HINSTANCE hInstance;
110 HANDLE hDriver;
111 HANDLE hStopEvent;
112 /* display driver interface, XPDM - WDDM abstraction see VBOXDISPIF** definitions above */
113 VBOXDISPIF dispIf;
114} VBOXSERVICEENV;
115
116/* The service initialization info and runtime variables. */
117typedef struct _VBOXSERVICEINFO
118{
119 char *pszName;
120 int (* pfnInit) (const VBOXSERVICEENV *pEnv, void **ppInstance, bool *pfStartThread);
121 unsigned (__stdcall * pfnThread) (void *pInstance);
122 void (* pfnDestroy) (const VBOXSERVICEENV *pEnv, void *pInstance);
123
124 /* Variables. */
125 HANDLE hThread;
126 void *pInstance;
127 bool fStarted;
128
129} VBOXSERVICEINFO;
130
131
132extern HWND gToolWindow;
133extern HINSTANCE gInstance;
134
135extern void VBoxServiceReloadCursor(void);
136
137#endif /* !___VBOXTRAY_H */
138
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