VirtualBox

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

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

Automated rebranding to Oracle copyright/license strings via filemuncher

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