VirtualBox

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

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

wddm: more impl for autoresize support

  • Property svn:eol-style set to native
  • Property svn:keywords set to Author Date Id Revision
File size: 4.3 KB
Line 
1/* $Id: VBoxTray.h 27984 2010-04-05 13:28:29Z 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 = 1
54#ifdef VBOXWDDM
55 , VBOXDISPIF_MODE_WDDM = 2
56#endif
57} VBOXDISPIF_MODE;
58/* display driver interface abstraction for XPDM & WDDM
59 * with WDDM we can not use ExtEscape to communicate with our driver
60 * because we do not have XPDM display driver any more, i.e. escape requests are handled by cdd
61 * that knows nothing about us
62 * NOTE: DispIf makes no checks whether the display driver is actually a VBox driver,
63 * it just switches between using different backend OS API based on the VBoxDispIfSwitchMode call
64 * It's caller's responsibility to initiate it to work in the correct mode */
65typedef struct VBOXDISPIF
66{
67 VBOXDISPIF_MODE enmMode;
68#ifdef VBOXWDDM
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 /* open adapter */
76 PFND3DKMT_OPENADAPTERFROMHDC pfnD3DKMTOpenAdapterFromHdc;
77 PFND3DKMT_OPENADAPTERFROMGDIDISPLAYNAME pfnD3DKMTOpenAdapterFromGdiDisplayName;
78 /* close adapter */
79 PFND3DKMT_CLOSEADAPTER pfnD3DKMTCloseAdapter;
80 /* escape */
81 PFND3DKMT_ESCAPE pfnD3DKMTEscape;
82 PFND3DKMT_INVALIDATEACTIVEVIDPN pfnD3DKMTInvalidateActiveVidPn;
83 } wddm;
84 } modeData;
85#endif
86} VBOXDISPIF, *PVBOXDISPIF;
87typedef const struct VBOXDISPIF *PCVBOXDISPIF;
88
89/* initializes the DispIf
90 * Initially the DispIf is configured to work in XPDM mode
91 * call VBoxDispIfSwitchMode to switch the mode to WDDM */
92DWORD VBoxDispIfInit(PVBOXDISPIF pIf);
93DWORD VBoxDispIfSwitchMode(PVBOXDISPIF pIf, VBOXDISPIF_MODE enmMode, VBOXDISPIF_MODE *penmOldMode);
94DECLINLINE(VBOXDISPIF_MODE) VBoxDispGetMode(PVBOXDISPIF pIf) { return pIf->enmMode; }
95DWORD VBoxDispIfTerm(PVBOXDISPIF pIf);
96DWORD VBoxDispIfEscape(PCVBOXDISPIF const pIf, PVBOXDISPIFESCAPE pEscape, int cbData);
97
98/* The environment information for services. */
99typedef struct _VBOXSERVICEENV
100{
101 HINSTANCE hInstance;
102 HANDLE hDriver;
103 HANDLE hStopEvent;
104 /* display driver interface, XPDM - WDDM abstraction see VBOXDISPIF** definitions above */
105 VBOXDISPIF dispIf;
106} VBOXSERVICEENV;
107
108/* The service initialization info and runtime variables. */
109typedef struct _VBOXSERVICEINFO
110{
111 char *pszName;
112 int (* pfnInit) (const VBOXSERVICEENV *pEnv, void **ppInstance, bool *pfStartThread);
113 unsigned (__stdcall * pfnThread) (void *pInstance);
114 void (* pfnDestroy) (const VBOXSERVICEENV *pEnv, void *pInstance);
115
116 /* Variables. */
117 HANDLE hThread;
118 void *pInstance;
119 bool fStarted;
120
121} VBOXSERVICEINFO;
122
123
124extern HWND gToolWindow;
125extern HINSTANCE gInstance;
126
127extern void VBoxServiceReloadCursor(void);
128
129#endif /* !___VBOXTRAY_H */
130
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