VBoxTray.cpp revision e62cb87bae732e9968199a3ad153cc94004b7182
1324N/A * available from http://www.virtualbox.org. This file is free software;
1324N/A * Clara, CA 95054 USA or visit http://www.sun.com if you need
1324N/A#include "VBoxTray.h"
1324N/A#include "VBoxSeamless.h"
3232N/A#include "VBoxClipboard.h"
1324N/A#include "VBoxDisplay.h"
1324N/A#include "VBoxRestore.h"
1324N/A#include "VBoxVRDP.h"
1324N/A#include "VBoxStatistics.h"
1324N/A#include "VBoxMemBalloon.h"
1324N/A#include <VBoxHook.h>
#include "resource.h"
#include <malloc.h>
#include <VBoxGuestInternal.h>
#include "helpers.h"
#include <sddl.h>
#ifdef DEBUG
#ifdef VBOX_WITH_MANAGEMENT
return VERR_NOT_SUPPORTED;
bool fStartThread = false;
unsigned threadid;
&threadid);
pTable++;
return VINF_SUCCESS;
pTable++;
NULL,
NULL);
dprintf(("VBoxService: could not open VBox Guest Additions driver! Please install / start it first! rc = %d\n", GetLastError()));
if (!gToolWindow)
/* We need to setup a security descriptor to allow other processes modify access to the seamless notification event semaphore */
if (!ret)
dprintf(("VBoxService: Windows version major %d minor %d\n", info.dwMajorVersion, info.dwMinorVersion));
BOOL (WINAPI * pfnConvertStringSecurityDescriptorToSecurityDescriptorA)(LPCSTR StringSecurityDescriptor, DWORD StringSDRevision, PSECURITY_DESCRIPTOR *SecurityDescriptor, PULONG SecurityDescriptorSize);
if (hModule)
*(uintptr_t *)&pfnConvertStringSecurityDescriptorToSecurityDescriptorA = (uintptr_t)GetProcAddress(hModule, "ConvertStringSecurityDescriptorToSecurityDescriptorA");
dprintf(("pfnConvertStringSecurityDescriptorToSecurityDescriptorA = %x\n", pfnConvertStringSecurityDescriptorToSecurityDescriptorA));
ret = pfnConvertStringSecurityDescriptorToSecurityDescriptorA("S:(ML;;NW;;;LW)", /* this means "low integrity" */
if (!ret)
if (!ret)
if (!ret)
sprintf(ndata.szTip, "Sun xVM VirtualBox Guest Additions %d.%d.%dr%d", VBOX_VERSION_MAJOR, VBOX_VERSION_MINOR, VBOX_VERSION_BUILD, VBOX_SVN_REV);
/* Boost thread priority to make sure we wake up early for seamless window notifications (not sure if it actually makes any difference though) */
if (0 == ghSeamlessNotifyEvent) /* If seamless mode is not active / supported, reduce event array count */
if (waitResult == 0)
else if ((waitResult == 1) && (ghSeamlessNotifyEvent!=0)) /* Only jump in, if seamless is active! */
if (!fTrayIconCreated)
switch (msg)
case WM_CLOSE:
case WM_DESTROY:
case WM_VBOX_SEAMLESS_UPDATE:
case WM_VBOX_RESTORED:
case WM_VBOX_CHECK_VRDP: