VirtualBox

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

Last change on this file since 79506 was 78937, checked in by vboxsync, 6 years ago

VBoxTray: Use RTSystemGetNtVersion() rather than GetVersion or GetVersionEx for determining the actual windows version. Some cleanups.

  • Property svn:eol-style set to native
  • Property svn:keywords set to Author Date Id Revision
File size: 5.2 KB
Line 
1/* $Id: VBoxTray.h 78937 2019-06-03 13:52:06Z vboxsync $ */
2/** @file
3 * VBoxTray - Guest Additions Tray, Internal Header.
4 */
5
6/*
7 * Copyright (C) 2006-2019 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 GA_INCLUDED_SRC_WINNT_VBoxTray_VBoxTray_h
19#define GA_INCLUDED_SRC_WINNT_VBoxTray_VBoxTray_h
20#ifndef RT_WITHOUT_PRAGMA_ONCE
21# pragma once
22#endif
23
24#include <iprt/win/windows.h>
25
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#include <iprt/thread.h>
34
35#include <VBox/version.h>
36#include <VBox/VBoxGuestLib.h>
37#include <VBoxDisplay.h>
38
39#include "VBoxDispIf.h"
40
41/*
42 * Windows messsages.
43 */
44
45/**
46 * General VBoxTray messages.
47 */
48#define WM_VBOXTRAY_TRAY_ICON WM_APP + 40
49
50/* The tray icon's ID. */
51#define ID_TRAYICON 2000
52
53/*
54 * Timer IDs.
55 */
56#define TIMERID_VBOXTRAY_CHECK_HOSTVERSION 1000
57#define TIMERID_VBOXTRAY_CAPS_TIMER 1001
58#define TIMERID_VBOXTRAY_DT_TIMER 1002
59#define TIMERID_VBOXTRAY_ST_DELAYED_INIT_TIMER 1003
60
61/**
62 * The environment information for services.
63 */
64typedef struct _VBOXSERVICEENV
65{
66 /** hInstance of VBoxTray. */
67 HINSTANCE hInstance;
68 /* Display driver interface, XPDM - WDDM abstraction see VBOXDISPIF** definitions above */
69 /** @todo r=andy Argh. Needed by the "display" + "seamless" services (which in turn get called
70 * by the VBoxCaps facility. See #8037. */
71 VBOXDISPIF dispIf;
72} VBOXSERVICEENV;
73/** Pointer to a VBoxTray service env info structure. */
74typedef VBOXSERVICEENV *PVBOXSERVICEENV;
75/** Pointer to a const VBoxTray service env info structure. */
76typedef VBOXSERVICEENV const *PCVBOXSERVICEENV;
77
78/**
79 * A service descriptor.
80 */
81typedef struct _VBOXSERVICEDESC
82{
83 /** The service's name. RTTHREAD_NAME_LEN maximum characters. */
84 char *pszName;
85 /** The service description. */
86 char *pszDesc;
87
88 /** Callbacks. */
89
90 /**
91 * Initializes a service.
92 * @returns VBox status code.
93 * @param pEnv
94 * @param ppInstance Where to return the thread-specific instance data.
95 * @todo r=bird: The pEnv type is WRONG! Please check all your const pointers.
96 */
97 DECLCALLBACKMEMBER(int, pfnInit) (const PVBOXSERVICEENV pEnv, void **ppInstance);
98
99 /** Called from the worker thread.
100 *
101 * @returns VBox status code.
102 * @retval VINF_SUCCESS if exitting because *pfShutdown was set.
103 * @param pInstance Pointer to thread-specific instance data.
104 * @param pfShutdown Pointer to a per service termination flag to check
105 * before and after blocking.
106 */
107 DECLCALLBACKMEMBER(int, pfnWorker) (void *pInstance, bool volatile *pfShutdown);
108
109 /**
110 * Stops a service.
111 */
112 DECLCALLBACKMEMBER(int, pfnStop) (void *pInstance);
113
114 /**
115 * Does termination cleanups.
116 *
117 * @remarks This may be called even if pfnInit hasn't been called!
118 */
119 DECLCALLBACKMEMBER(void, pfnDestroy)(void *pInstance);
120} VBOXSERVICEDESC, *PVBOXSERVICEDESC;
121
122extern VBOXSERVICEDESC g_SvcDescDisplay;
123#ifdef VBOX_WITH_SHARED_CLIPBOARD
124extern VBOXSERVICEDESC g_SvcDescClipboard;
125#endif
126extern VBOXSERVICEDESC g_SvcDescSeamless;
127extern VBOXSERVICEDESC g_SvcDescVRDP;
128extern VBOXSERVICEDESC g_SvcDescIPC;
129extern VBOXSERVICEDESC g_SvcDescLA;
130#ifdef VBOX_WITH_DRAG_AND_DROP
131extern VBOXSERVICEDESC g_SvcDescDnD;
132#endif
133
134/**
135 * The service initialization info and runtime variables.
136 */
137typedef struct _VBOXSERVICEINFO
138{
139 /** Pointer to the service descriptor. */
140 PVBOXSERVICEDESC pDesc;
141 /** Thread handle. */
142 RTTHREAD hThread;
143 /** Pointer to service-specific instance data.
144 * Must be free'd by the service itself. */
145 void *pInstance;
146 /** Whether Pre-init was called. */
147 bool fPreInited;
148 /** Shutdown indicator. */
149 bool volatile fShutdown;
150 /** Indicator set by the service thread exiting. */
151 bool volatile fStopped;
152 /** Whether the service was started or not. */
153 bool fStarted;
154 /** Whether the service is enabled or not. */
155 bool fEnabled;
156} VBOXSERVICEINFO, *PVBOXSERVICEINFO;
157
158/* Globally unique (system wide) message registration. */
159typedef struct _VBOXGLOBALMESSAGE
160{
161 /** Message name. */
162 char *pszName;
163 /** Function pointer for handling the message. */
164 int (* pfnHandler) (WPARAM wParam, LPARAM lParam);
165
166 /* Variables. */
167
168 /** Message ID;
169 * to be filled in when registering the actual message. */
170 UINT uMsgID;
171} VBOXGLOBALMESSAGE, *PVBOXGLOBALMESSAGE;
172
173extern HINSTANCE g_hInstance;
174extern HWND g_hwndToolWindow;
175extern uint32_t g_fGuestDisplaysChanged;
176
177RTEXITCODE VBoxTrayShowError(const char *pszFormat, ...);
178
179#endif /* !GA_INCLUDED_SRC_WINNT_VBoxTray_VBoxTray_h */
180
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