31711967b986b488798e89eb8d7d39fe9a42912evboxsync/* $Id$ */
e62cb87bae732e9968199a3ad153cc94004b7182vboxsync/** @file
35396ee506ef68dd1c161f1ef2c3c0b68a146ff2vboxsync * VBoxTray - Guest Additions Tray, Internal Header.
e62cb87bae732e9968199a3ad153cc94004b7182vboxsync */
e62cb87bae732e9968199a3ad153cc94004b7182vboxsync
e62cb87bae732e9968199a3ad153cc94004b7182vboxsync/*
a29027bb2378172c7c88610ad5311548b66f96f6vboxsync * Copyright (C) 2006-2014 Oracle Corporation
e62cb87bae732e9968199a3ad153cc94004b7182vboxsync *
e62cb87bae732e9968199a3ad153cc94004b7182vboxsync * This file is part of VirtualBox Open Source Edition (OSE), as
e62cb87bae732e9968199a3ad153cc94004b7182vboxsync * available from http://www.virtualbox.org. This file is free software;
e62cb87bae732e9968199a3ad153cc94004b7182vboxsync * you can redistribute it and/or modify it under the terms of the GNU
e62cb87bae732e9968199a3ad153cc94004b7182vboxsync * General Public License (GPL) as published by the Free Software
e62cb87bae732e9968199a3ad153cc94004b7182vboxsync * Foundation, in version 2 as it comes in the "COPYING" file of the
e62cb87bae732e9968199a3ad153cc94004b7182vboxsync * VirtualBox OSE distribution. VirtualBox OSE is distributed in the
e62cb87bae732e9968199a3ad153cc94004b7182vboxsync * hope that it will be useful, but WITHOUT ANY WARRANTY of any kind.
e62cb87bae732e9968199a3ad153cc94004b7182vboxsync */
31711967b986b488798e89eb8d7d39fe9a42912evboxsync
0d20048b3955267f206c0e521dd43fbb0da0b954vboxsync#ifndef ___VBOXTRAY_H
0d20048b3955267f206c0e521dd43fbb0da0b954vboxsync#define ___VBOXTRAY_H
e62cb87bae732e9968199a3ad153cc94004b7182vboxsync
92717ff0762d9966fec99b209450611e42af2ca1vboxsync# define _InterlockedExchange _InterlockedExchange_StupidDDKVsCompilerCrap
92717ff0762d9966fec99b209450611e42af2ca1vboxsync# define _InterlockedExchangeAdd _InterlockedExchangeAdd_StupidDDKVsCompilerCrap
92717ff0762d9966fec99b209450611e42af2ca1vboxsync# define _InterlockedCompareExchange _InterlockedCompareExchange_StupidDDKVsCompilerCrap
92717ff0762d9966fec99b209450611e42af2ca1vboxsync# define _InterlockedAddLargeStatistic _InterlockedAddLargeStatistic_StupidDDKVsCompilerCrap
92717ff0762d9966fec99b209450611e42af2ca1vboxsync# define _interlockedbittestandset _interlockedbittestandset_StupidDDKVsCompilerCrap
92717ff0762d9966fec99b209450611e42af2ca1vboxsync# define _interlockedbittestandreset _interlockedbittestandreset_StupidDDKVsCompilerCrap
92717ff0762d9966fec99b209450611e42af2ca1vboxsync# define _interlockedbittestandset64 _interlockedbittestandset64_StupidDDKVsCompilerCrap
92717ff0762d9966fec99b209450611e42af2ca1vboxsync# define _interlockedbittestandreset64 _interlockedbittestandreset64_StupidDDKVsCompilerCrap
92717ff0762d9966fec99b209450611e42af2ca1vboxsync# pragma warning(disable : 4163)
e62cb87bae732e9968199a3ad153cc94004b7182vboxsync#include <windows.h>
92717ff0762d9966fec99b209450611e42af2ca1vboxsync# pragma warning(default : 4163)
92717ff0762d9966fec99b209450611e42af2ca1vboxsync# undef _InterlockedExchange
92717ff0762d9966fec99b209450611e42af2ca1vboxsync# undef _InterlockedExchangeAdd
92717ff0762d9966fec99b209450611e42af2ca1vboxsync# undef _InterlockedCompareExchange
92717ff0762d9966fec99b209450611e42af2ca1vboxsync# undef _InterlockedAddLargeStatistic
92717ff0762d9966fec99b209450611e42af2ca1vboxsync# undef _interlockedbittestandset
92717ff0762d9966fec99b209450611e42af2ca1vboxsync# undef _interlockedbittestandreset
92717ff0762d9966fec99b209450611e42af2ca1vboxsync# undef _interlockedbittestandset64
92717ff0762d9966fec99b209450611e42af2ca1vboxsync# undef _interlockedbittestandreset64
92717ff0762d9966fec99b209450611e42af2ca1vboxsync
e62cb87bae732e9968199a3ad153cc94004b7182vboxsync#include <tchar.h>
e62cb87bae732e9968199a3ad153cc94004b7182vboxsync#include <stdio.h>
e62cb87bae732e9968199a3ad153cc94004b7182vboxsync#include <stdarg.h>
e62cb87bae732e9968199a3ad153cc94004b7182vboxsync#include <process.h>
e62cb87bae732e9968199a3ad153cc94004b7182vboxsync
315ad5b8dea4f6f933a01420cfb1e0fe19183c45vboxsync#include <iprt/initterm.h>
315ad5b8dea4f6f933a01420cfb1e0fe19183c45vboxsync#include <iprt/string.h>
e62cb87bae732e9968199a3ad153cc94004b7182vboxsync
315ad5b8dea4f6f933a01420cfb1e0fe19183c45vboxsync#include <VBox/version.h>
0758ccd1bec500cced35c8dfe52fcceacc2469d5vboxsync#include <VBox/VBoxGuest.h> /** @todo use the VbglR3 interface! */
0758ccd1bec500cced35c8dfe52fcceacc2469d5vboxsync#include <VBox/VBoxGuestLib.h>
485a153f0c2ddf3738d940d5158c72939f080cc8vboxsync#include <VBoxDisplay.h>
a35f129abd041420af48b967c6e1c0d98a23b1cdvboxsync
a35f129abd041420af48b967c6e1c0d98a23b1cdvboxsync#include "VBoxDispIf.h"
e62cb87bae732e9968199a3ad153cc94004b7182vboxsync
74804912a237136f06d0b49682a119577135902bvboxsync/*
74804912a237136f06d0b49682a119577135902bvboxsync * Windows messsages.
74804912a237136f06d0b49682a119577135902bvboxsync */
0eb559db79133da4f6679b2fec099ae477cac90dvboxsync
74804912a237136f06d0b49682a119577135902bvboxsync/**
74804912a237136f06d0b49682a119577135902bvboxsync * General VBoxTray messages.
74804912a237136f06d0b49682a119577135902bvboxsync */
74804912a237136f06d0b49682a119577135902bvboxsync#define WM_VBOXTRAY_TRAY_ICON WM_APP + 40
74804912a237136f06d0b49682a119577135902bvboxsync
74804912a237136f06d0b49682a119577135902bvboxsync
74804912a237136f06d0b49682a119577135902bvboxsync/* The tray icon's ID. */
bce65c32ad6982f6113537cc2c90d8999f19ed78vboxsync#define ID_TRAYICON 2000
e62cb87bae732e9968199a3ad153cc94004b7182vboxsync
e62cb87bae732e9968199a3ad153cc94004b7182vboxsync
74804912a237136f06d0b49682a119577135902bvboxsync/*
74804912a237136f06d0b49682a119577135902bvboxsync * Timer IDs.
74804912a237136f06d0b49682a119577135902bvboxsync */
74804912a237136f06d0b49682a119577135902bvboxsync#define TIMERID_VBOXTRAY_CHECK_HOSTVERSION 1000
2aa23aff01ee136a4dab274f37529b1cf4499195vboxsync#define TIMERID_VBOXTRAY_CAPS_TIMER 1001
cd5a95880f12fbcfffe6da174ba7f32cdb9139e1vboxsync#define TIMERID_VBOXTRAY_DT_TIMER 1002
eecf19a57b0707068132259ce2997fb935ebdb9cvboxsync#define TIMERID_VBOXTRAY_ST_DELAYED_INIT_TIMER 1003
74804912a237136f06d0b49682a119577135902bvboxsync
e62cb87bae732e9968199a3ad153cc94004b7182vboxsync/* The environment information for services. */
e62cb87bae732e9968199a3ad153cc94004b7182vboxsynctypedef struct _VBOXSERVICEENV
e62cb87bae732e9968199a3ad153cc94004b7182vboxsync{
e62cb87bae732e9968199a3ad153cc94004b7182vboxsync HINSTANCE hInstance;
e62cb87bae732e9968199a3ad153cc94004b7182vboxsync HANDLE hDriver;
e62cb87bae732e9968199a3ad153cc94004b7182vboxsync HANDLE hStopEvent;
485a153f0c2ddf3738d940d5158c72939f080cc8vboxsync /* display driver interface, XPDM - WDDM abstraction see VBOXDISPIF** definitions above */
485a153f0c2ddf3738d940d5158c72939f080cc8vboxsync VBOXDISPIF dispIf;
e62cb87bae732e9968199a3ad153cc94004b7182vboxsync} VBOXSERVICEENV;
e62cb87bae732e9968199a3ad153cc94004b7182vboxsync
e62cb87bae732e9968199a3ad153cc94004b7182vboxsync/* The service initialization info and runtime variables. */
e62cb87bae732e9968199a3ad153cc94004b7182vboxsynctypedef struct _VBOXSERVICEINFO
e62cb87bae732e9968199a3ad153cc94004b7182vboxsync{
e62cb87bae732e9968199a3ad153cc94004b7182vboxsync char *pszName;
e62cb87bae732e9968199a3ad153cc94004b7182vboxsync int (* pfnInit) (const VBOXSERVICEENV *pEnv, void **ppInstance, bool *pfStartThread);
e62cb87bae732e9968199a3ad153cc94004b7182vboxsync unsigned (__stdcall * pfnThread) (void *pInstance);
cdf44790f2126d0f093dbe7647a5cebbdb33f63bvboxsync void (* pfnStop) (const VBOXSERVICEENV *pEnv, void *pInstance);
e62cb87bae732e9968199a3ad153cc94004b7182vboxsync void (* pfnDestroy) (const VBOXSERVICEENV *pEnv, void *pInstance);
e62cb87bae732e9968199a3ad153cc94004b7182vboxsync
e62cb87bae732e9968199a3ad153cc94004b7182vboxsync /* Variables. */
bce65c32ad6982f6113537cc2c90d8999f19ed78vboxsync HANDLE hThread;
bce65c32ad6982f6113537cc2c90d8999f19ed78vboxsync void *pInstance;
bce65c32ad6982f6113537cc2c90d8999f19ed78vboxsync bool fStarted;
e62cb87bae732e9968199a3ad153cc94004b7182vboxsync} VBOXSERVICEINFO;
e62cb87bae732e9968199a3ad153cc94004b7182vboxsync
bce65c32ad6982f6113537cc2c90d8999f19ed78vboxsync/* Globally unique (system wide) message registration. */
bce65c32ad6982f6113537cc2c90d8999f19ed78vboxsynctypedef struct _VBOXGLOBALMESSAGE
bce65c32ad6982f6113537cc2c90d8999f19ed78vboxsync{
bce65c32ad6982f6113537cc2c90d8999f19ed78vboxsync /** Message name. */
bce65c32ad6982f6113537cc2c90d8999f19ed78vboxsync char *pszName;
bce65c32ad6982f6113537cc2c90d8999f19ed78vboxsync /** Function pointer for handling the message. */
57a6df100ffc5829424669c98a45c40b171e973evboxsync int (* pfnHandler) (WPARAM wParam, LPARAM lParam);
bce65c32ad6982f6113537cc2c90d8999f19ed78vboxsync
bce65c32ad6982f6113537cc2c90d8999f19ed78vboxsync /* Variables. */
bce65c32ad6982f6113537cc2c90d8999f19ed78vboxsync
bce65c32ad6982f6113537cc2c90d8999f19ed78vboxsync /** Message ID;
bce65c32ad6982f6113537cc2c90d8999f19ed78vboxsync * to be filled in when registering the actual message. */
bce65c32ad6982f6113537cc2c90d8999f19ed78vboxsync UINT uMsgID;
bce65c32ad6982f6113537cc2c90d8999f19ed78vboxsync} VBOXGLOBALMESSAGE, *PVBOXGLOBALMESSAGE;
e62cb87bae732e9968199a3ad153cc94004b7182vboxsync
549ab60b5ac3df6bcc26916617bd2a32cc8b7f9bvboxsyncextern HWND ghwndToolWindow;
549ab60b5ac3df6bcc26916617bd2a32cc8b7f9bvboxsyncextern HINSTANCE ghInstance;
e62cb87bae732e9968199a3ad153cc94004b7182vboxsync
0d20048b3955267f206c0e521dd43fbb0da0b954vboxsync#endif /* !___VBOXTRAY_H */
31711967b986b488798e89eb8d7d39fe9a42912evboxsync