VBoxControl.cpp revision 62592281fc2971692c6755401b5ce1ed61b96d7c
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * VBoxControl - Guest Additions Command Line Management Interface
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * Copyright (C) 2007 Sun Microsystems, Inc.
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * This file is part of VirtualBox Open Source Edition (OSE), as
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * available from http://www.virtualbox.org. This file is free software;
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * you can redistribute it and/or modify it under the terms of the GNU
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * General Public License (GPL) as published by the Free Software
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * Foundation, in version 2 as it comes in the "COPYING" file of the
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * VirtualBox OSE distribution. VirtualBox OSE is distributed in the
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * hope that it will be useful, but WITHOUT ANY WARRANTY of any kind.
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * Clara, CA 95054 USA or visit http://www.sun.com if you need
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * additional information or have any questions.
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte/*******************************************************************************
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte* Header Files *
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte*******************************************************************************/
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte/*******************************************************************************
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte* Global Variables *
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte*******************************************************************************/
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte/** The program name (derived from argv[0]). */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte/** The current verbosity level. */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * Displays the program usage message.
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * @param u64Which
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte/** Helper function */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Fortestatic void doUsage(char const *line, char const *name = "", char const *command = "")
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte RTPrintf("%s %-*s%s", name, 32 - strlen(name), command, line);
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte/** Enumerate the different parts of the usage we might want to print out */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte RTPrintf("%s [-v|-version] print version number and exit\n", g_pszProgName);
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte RTPrintf("%s -nologo ... suppress the logo\n\n", g_pszProgName);
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte if ((GET_VIDEO_ACCEL == eWhich) || (USAGE_ALL == eWhich))
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte doUsage("\n", g_pszProgName, "getvideoacceleration");
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte if ((SET_VIDEO_ACCEL == eWhich) || (USAGE_ALL == eWhich))
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte doUsage("<on|off>\n", g_pszProgName, "setvideoacceleration");
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte if ((LIST_CUST_MODES == eWhich) || (USAGE_ALL == eWhich))
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte if ((ADD_CUST_MODE == eWhich) || (USAGE_ALL == eWhich))
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte doUsage("<width> <height> <bpp>\n", g_pszProgName, "addcustommode");
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte if ((REMOVE_CUST_MODE == eWhich) || (USAGE_ALL == eWhich))
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte doUsage("<width> <height> <bpp>\n", g_pszProgName, "removecustommode");
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte if ((SET_VIDEO_MODE == eWhich) || (USAGE_ALL == eWhich))
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte doUsage("<width> <height> <bpp> <screen>\n", g_pszProgName, "setvideomode");
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte if ((GUEST_PROP == eWhich) || (USAGE_ALL == eWhich))
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte doUsage("get <property> [-verbose]\n", g_pszProgName, "guestproperty");
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte doUsage("set <property> [<value>] [-flags <flags>]\n", g_pszProgName, "guestproperty");
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte doUsage("enumerate [-patterns <patterns>]\n", g_pszProgName, "guestproperty");
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * Displays an error message.
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * @param pszFormat The message text.
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * @param ... Format arguments.
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Fortestatic void VBoxControlError(const char *pszFormat, ...)
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte // RTStrmPrintf(g_pStdErr, "%s: error: ", g_pszProgName);
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn ForteLONG (WINAPI * gpfnChangeDisplaySettingsEx)(LPCTSTR lpszDeviceName, LPDEVMODE lpDevMode, HWND hwnd, DWORD dwflags, LPVOID lParam);
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Fortestatic unsigned nextAdjacentRectXP (RECTL *paRects, unsigned nRects, unsigned iRect)
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte for (i = 0; i < nRects; i++)
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Fortestatic unsigned nextAdjacentRectXN (RECTL *paRects, unsigned nRects, unsigned iRect)
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte for (i = 0; i < nRects; i++)
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Fortestatic unsigned nextAdjacentRectYP (RECTL *paRects, unsigned nRects, unsigned iRect)
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte for (i = 0; i < nRects; i++)
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forteunsigned nextAdjacentRectYN (RECTL *paRects, unsigned nRects, unsigned iRect)
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte for (i = 0; i < nRects; i++)
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Fortevoid resizeRect(RECTL *paRects, unsigned nRects, unsigned iPrimary, unsigned iResized, int NewWidth, int NewHeight)
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte RECTL *paNewRects = (RECTL *)alloca (sizeof (RECTL) * nRects);
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte memcpy (paNewRects, paRects, sizeof (RECTL) * nRects);
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte paNewRects[iResized].right += NewWidth - (paNewRects[iResized].right - paNewRects[iResized].left);
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte paNewRects[iResized].bottom += NewHeight - (paNewRects[iResized].bottom - paNewRects[iResized].top);
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte /* Verify all pairs of originally adjacent rectangles for all 4 directions.
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * If the pair has a "good" delta (that is the first rectangle intersects the second)
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * at a direction and the second rectangle is not primary one (which can not be moved),
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * move the second rectangle to make it adjacent to the first one.
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte /* X positive. */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte /* Find the next adjacent original rect in x positive direction. */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte unsigned iNextRect = nextAdjacentRectXP (paRects, nRects, iRect);
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte /* Check whether there is an X intesection between these adjacent rects in the new rectangles
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * and fix the intersection if delta is "good".
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte int delta = paNewRects[iRect].right - paNewRects[iNextRect].left;
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte Log(("XP intersection right %d left %d, diff %d\n",
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte paNewRects[iRect].right, paNewRects[iNextRect].left,
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte /* X negative. */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte /* Find the next adjacent original rect in x negative direction. */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte unsigned iNextRect = nextAdjacentRectXN (paRects, nRects, iRect);
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte /* Check whether there is an X intesection between these adjacent rects in the new rectangles
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * and fix the intersection if delta is "good".
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte int delta = paNewRects[iRect].left - paNewRects[iNextRect].right;
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte Log(("XN intersection left %d right %d, diff %d\n",
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte paNewRects[iRect].left, paNewRects[iNextRect].right,
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte /* Y positive (in the computer sence, top->down). */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte /* Find the next adjacent original rect in y positive direction. */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte unsigned iNextRect = nextAdjacentRectYP (paRects, nRects, iRect);
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte /* Check whether there is an Y intesection between these adjacent rects in the new rectangles
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * and fix the intersection if delta is "good".
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte int delta = paNewRects[iRect].bottom - paNewRects[iNextRect].top;
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte Log(("YP intersection bottom %d top %d, diff %d\n",
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte paNewRects[iRect].bottom, paNewRects[iNextRect].top,
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte /* Y negative (in the computer sence, down->top). */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte /* Find the next adjacent original rect in x negative direction. */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte unsigned iNextRect = nextAdjacentRectYN (paRects, nRects, iRect);
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte /* Check whether there is an Y intesection between these adjacent rects in the new rectangles
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * and fix the intersection if delta is "good".
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte int delta = paNewRects[iRect].top - paNewRects[iNextRect].bottom;
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte Log(("YN intersection top %d bottom %d, diff %d\n",
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte paNewRects[iRect].top, paNewRects[iNextRect].bottom,
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte memcpy (paRects, paNewRects, sizeof (RECTL) * nRects);
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte/* Returns TRUE to try again. */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Fortestatic BOOL ResizeDisplayDevice(ULONG Id, DWORD Width, DWORD Height, DWORD BitsPerPixel)
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte BOOL fModeReset = (Width == 0 && Height == 0 && BitsPerPixel == 0);
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte ZeroMemory(&DisplayDevice, sizeof(DisplayDevice));
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte /* Find out how many display devices the system has */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte while (EnumDisplayDevices (NULL, i, &DisplayDevice, 0))
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte if (DisplayDevice.StateFlags & DISPLAY_DEVICE_PRIMARY_DEVICE)
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte Log(("Found primary device. err %d\n", GetLastError ()));
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte else if (!(DisplayDevice.StateFlags & DISPLAY_DEVICE_MIRRORING_DRIVER))
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte Log(("Found secondary device. err %d\n", GetLastError ()));
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte ZeroMemory(&DisplayDevice, sizeof(DisplayDevice));
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte Log(("Found total %d devices. err %d\n", NumDevices, GetLastError ()));
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte Log(("Requested identifier %d is invalid. err %d\n", Id, GetLastError ()));
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte DISPLAY_DEVICE *paDisplayDevices = (DISPLAY_DEVICE *)alloca (sizeof (DISPLAY_DEVICE) * NumDevices);
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte DEVMODE *paDeviceModes = (DEVMODE *)alloca (sizeof (DEVMODE) * NumDevices);
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte RECTL *paRects = (RECTL *)alloca (sizeof (RECTL) * NumDevices);
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte /* Fetch information about current devices and modes. */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte ZeroMemory(&DisplayDevice, sizeof(DISPLAY_DEVICE));
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte while (EnumDisplayDevices (NULL, i, &DisplayDevice, 0))
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte Log(("[%d(%d)] %s\n", i, DevNum, DisplayDevice.DeviceName));
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte if (DisplayDevice.StateFlags & DISPLAY_DEVICE_PRIMARY_DEVICE)
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte Log(("Found primary device. err %d\n", GetLastError ()));
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte else if (!(DisplayDevice.StateFlags & DISPLAY_DEVICE_MIRRORING_DRIVER))
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte Log(("Found secondary device. err %d\n", GetLastError ()));
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte ZeroMemory(&paDeviceModes[DevNum], sizeof(DEVMODE));
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte if (!EnumDisplaySettings((LPSTR)DisplayDevice.DeviceName,
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte Log(("EnumDisplaySettings err %d\n", GetLastError ()));
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte paRects[DevNum].left = paDeviceModes[DevNum].dmPosition.x;
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte paRects[DevNum].top = paDeviceModes[DevNum].dmPosition.y;
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte paRects[DevNum].right = paDeviceModes[DevNum].dmPosition.x + paDeviceModes[DevNum].dmPelsWidth;
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte paRects[DevNum].bottom = paDeviceModes[DevNum].dmPosition.y + paDeviceModes[DevNum].dmPelsHeight;
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte ZeroMemory(&DisplayDevice, sizeof(DISPLAY_DEVICE));
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte /* Check whether a mode reset or a change is requested. */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte && paRects[Id].bottom - paRects[Id].top == Height
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte && paDeviceModes[Id].dmBitsPerPel == BitsPerPixel)
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte Log(("VBoxDisplayThread : already at desired resolution.\n"));
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte resizeRect(paRects, NumDevices, DevPrimaryNum, Id, Width, Height);
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte for (i = 0; i < NumDevices; i++)
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte#endif /* Log */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte /* Without this, Windows will not ask the miniport for its
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * mode table but uses an internal cache instead.
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte EnumDisplaySettings(NULL, 0xffffff, &tempDevMode);
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte /* Assign the new rectangles to displays. */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte for (i = 0; i < NumDevices; i++)
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte paDeviceModes[i].dmPelsWidth = paRects[i].right - paRects[i].left;
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte paDeviceModes[i].dmPelsHeight = paRects[i].bottom - paRects[i].top;
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte paDeviceModes[i].dmFields = DM_POSITION | DM_PELSHEIGHT | DM_PELSWIDTH;
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte Log(("calling pfnChangeDisplaySettingsEx %x\n", gpfnChangeDisplaySettingsEx));
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte gpfnChangeDisplaySettingsEx((LPSTR)paDisplayDevices[i].DeviceName,
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte &paDeviceModes[i], NULL, CDS_NORESET | CDS_UPDATEREGISTRY, NULL);
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte Log(("ChangeDisplaySettings position err %d\n", GetLastError ()));
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte /* A second call to ChangeDisplaySettings updates the monitor. */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte Log(("ChangeDisplaySettings update status %d\n", status));
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte if (status == DISP_CHANGE_SUCCESSFUL || status == DISP_CHANGE_BADMODE)
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte /* Successfully set new video mode or our driver can not set the requested mode. Stop trying. */
return TRUE;
if (hUser)
*(uintptr_t *)&gpfnChangeDisplaySettingsEx = (uintptr_t)GetProcAddress(hUser, "ChangeDisplaySettingsExA");
status = RegOpenKeyExA(HKEY_LOCAL_MACHINE, "HARDWARE\\DEVICEMAP\\VIDEO", 0, KEY_READ, &hkeyDeviceMap);
szVideoLocation[0] = 0;
status = RegQueryValueExA(hkeyDeviceMap, "\\Device\\Video0", NULL, &dwKeyType, (LPBYTE)szVideoLocation, &len);
status = RegOpenKeyExA(HKEY_LOCAL_MACHINE, &szVideoLocation[18], 0, KEY_READ | (writable ? KEY_WRITE : 0), &hkeyVideo);
return hkeyVideo;
if (hkeyVideo)
status = RegQueryValueExA(hkeyVideo, "EnableVideoAccel", NULL, &dwKeyType, (LPBYTE)&fAcceleration, &len);
if (hkeyVideo)
int fAccel = 0;
status = RegSetValueExA(hkeyVideo, "EnableVideoAccel", 0, REG_DWORD, (LPBYTE)&fAccel, sizeof(fAccel));
int curMode = 0;
++curMode;
int tableIndex = 0;
int modeIndex = 0;
for (int i = 0; i < MAX_CUSTOM_MODES; i++)
tableIndex++;
RTPrintf("writing mode %d (%dx%dx%d)\n", modeIndex, customModes[tableIndex].xres, customModes[tableIndex].yres, customModes[tableIndex].bpp);
modeIndex++;
tableIndex++;
if (argc != 0)
if (hkeyVideo)
if (hkeyVideo)
int fModeExists = 0;
for (i = 0; i < MAX_CUSTOM_MODES; i++)
if (!fModeExists)
for (i = 0; i < MAX_CUSTOM_MODES; i++)
if (hkeyVideo)
for (int i = 0; i < MAX_CUSTOM_MODES; i++)
#ifdef VBOX_WITH_GUEST_PROPS
using namespace guestProp;
bool verbose = false;
verbose = true;
bool finish = false;
&cbBuf);
finish = true;
if (verbose)
if (u32ClientId != 0)
bool usageOK = true;
usageOK = false;
usageOK = false;
usageOK = false;
if (!usageOK)
if (u32ClientId != 0)
else if (argc != 0)
if (u32ClientId != 0)
if (0 == argc)
struct COMMANDHANDLER
const char *command;
} g_commandHandlers[] =
#ifdef RT_OS_WINDOWS
#ifdef VBOX_WITH_GUEST_PROPS
int rc = 0;
bool showlogo = true;
bool dohelp = false;
bool onlyinfo = false;
bool done = false;
onlyinfo = true;
showlogo = false;
done = true;
showlogo = false;
onlyinfo = true;
dohelp = true;
done = true;
done = true;
if (!done)
++iArg;
if (showlogo)
if (dohelp)
usage();
if (!onlyinfo)
if (0 == rc)
char *converted;
bool found = false;
unsigned index = 0;
&& !found
found = true;
++index;
if (found)
usage();
usage();
return rc;