VirtualBox

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

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

wddm: bugfix

  • 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 27992 2010-04-05 19:32:50Z 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 /* with WDDM the approach is to call into WDDM miniport driver via PFND3DKMT API provided by the GDI,
70 * The PFND3DKMT is supposed to be used by the OpenGL ICD according to MSDN, so this approach is a bit hacky */
71 union
72 {
73 struct
74 {
75 LONG (WINAPI * pfnChangeDisplaySettingsEx)(LPCSTR lpszDeviceName, LPDEVMODE lpDevMode, HWND hwnd, DWORD dwflags, LPVOID lParam);
76 } xpdm;
77#ifdef VBOXWDDM
78 struct
79 {
80 /* open adapter */
81 PFND3DKMT_OPENADAPTERFROMHDC pfnD3DKMTOpenAdapterFromHdc;
82 PFND3DKMT_OPENADAPTERFROMGDIDISPLAYNAME pfnD3DKMTOpenAdapterFromGdiDisplayName;
83 /* close adapter */
84 PFND3DKMT_CLOSEADAPTER pfnD3DKMTCloseAdapter;
85 /* escape */
86 PFND3DKMT_ESCAPE pfnD3DKMTEscape;
87 /* auto resize support */
88 PFND3DKMT_INVALIDATEACTIVEVIDPN pfnD3DKMTInvalidateActiveVidPn;
89 } wddm;
90#endif
91 } modeData;
92} VBOXDISPIF, *PVBOXDISPIF;
93typedef const struct VBOXDISPIF *PCVBOXDISPIF;
94
95/* initializes the DispIf
96 * Initially the DispIf is configured to work in XPDM mode
97 * call VBoxDispIfSwitchMode to switch the mode to WDDM */
98DWORD VBoxDispIfInit(PVBOXDISPIF pIf);
99DWORD VBoxDispIfSwitchMode(PVBOXDISPIF pIf, VBOXDISPIF_MODE enmMode, VBOXDISPIF_MODE *penmOldMode);
100DECLINLINE(VBOXDISPIF_MODE) VBoxDispGetMode(PVBOXDISPIF pIf) { return pIf->enmMode; }
101DWORD VBoxDispIfTerm(PVBOXDISPIF pIf);
102DWORD VBoxDispIfEscape(PCVBOXDISPIF const pIf, PVBOXDISPIFESCAPE pEscape, int cbData);
103DWORD VBoxDispIfResize(PCVBOXDISPIF const pIf, ULONG Id, DWORD Width, DWORD Height, DWORD BitsPerPixel);
104
105/* The environment information for services. */
106typedef struct _VBOXSERVICEENV
107{
108 HINSTANCE hInstance;
109 HANDLE hDriver;
110 HANDLE hStopEvent;
111 /* display driver interface, XPDM - WDDM abstraction see VBOXDISPIF** definitions above */
112 VBOXDISPIF dispIf;
113} VBOXSERVICEENV;
114
115/* The service initialization info and runtime variables. */
116typedef struct _VBOXSERVICEINFO
117{
118 char *pszName;
119 int (* pfnInit) (const VBOXSERVICEENV *pEnv, void **ppInstance, bool *pfStartThread);
120 unsigned (__stdcall * pfnThread) (void *pInstance);
121 void (* pfnDestroy) (const VBOXSERVICEENV *pEnv, void *pInstance);
122
123 /* Variables. */
124 HANDLE hThread;
125 void *pInstance;
126 bool fStarted;
127
128} VBOXSERVICEINFO;
129
130
131extern HWND gToolWindow;
132extern HINSTANCE gInstance;
133
134extern void VBoxServiceReloadCursor(void);
135
136#endif /* !___VBOXTRAY_H */
137
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