/** @file
* helpers - Guest Additions Service helper functions
*/
/*
* Copyright (C) 2006-2011 Oracle Corporation
*
* This file is part of VirtualBox Open Source Edition (OSE), as
* available from http://www.virtualbox.org. This file is free software;
* General Public License (GPL) as published by the Free Software
* Foundation, in version 2 as it comes in the "COPYING" file of the
* VirtualBox OSE distribution. VirtualBox OSE is distributed in the
* hope that it will be useful, but WITHOUT ANY WARRANTY of any kind.
*/
#include <malloc.h>
#include <windows.h>
#include <VBox/VBoxGuestLib.h>
#include <VBoxGuestInternal.h>
#include "VBoxHelpers.h"
#include "resource.h"
{
0 /* Flags */);
if (RT_FAILURE(rc))
return rc;
}
/**
* Attempt to force Windows to reload the cursor image by attaching to the
* thread of the window currently under the mouse, hiding the cursor and
* showing it again. This could fail to work in any number of ways (no
* window under the cursor, the cursor has moved to a different window while
* we are processing), but we just accept this, as the cursor will be reloaded
* at some point anyway.
*/
void hlpReloadCursor(void)
{
if (hWin)
{
if (hCurrentThread != hThread)
}
ShowCursor(false);
ShowCursor(true);
}
{
unsigned i;
for (i = 0; i < nRects; i++)
{
return i;
}
return ~0;
}
{
unsigned i;
for (i = 0; i < nRects; i++)
{
return i;
}
return ~0;
}
{
unsigned i;
for (i = 0; i < nRects; i++)
{
return i;
}
return ~0;
}
{
unsigned i;
for (i = 0; i < nRects; i++)
{
return i;
}
return ~0;
}
{
DDCLOG(("nRects %d, iPrimary %d, iResized %d, NewWidth %d, NewHeight %d\n", nRects, uPrimary, uResized, iNewWidth, iNewHeight));
paNewRects[uResized].bottom += iNewHeight - (paNewRects[uResized].bottom - paNewRects[uResized].top);
/* Verify all pairs of originally adjacent rectangles for all 4 directions.
* If the pair has a "good" delta (that is the first rectangle intersects the second)
* at a direction and the second rectangle is not primary one (which can not be moved),
* move the second rectangle to make it adjacent to the first one.
*/
/* X positive. */
unsigned iRect;
{
/* Find the next adjacent original rect in x positive direction. */
{
continue;
}
/* Check whether there is an X intersection between these adjacent rects in the new rectangles
* and fix the intersection if delta is "good".
*/
if (delta != 0)
{
DDCLOG(("XP intersection right %d left %d, diff %d\n",
delta));
}
}
/* X negative. */
{
/* Find the next adjacent original rect in x negative direction. */
{
continue;
}
/* Check whether there is an X intersection between these adjacent rects in the new rectangles
* and fix the intersection if delta is "good".
*/
if (delta != 0)
{
DDCLOG(("XN intersection left %d right %d, diff %d\n",
delta));
}
}
/* Y positive (in the computer sense, top->down). */
{
/* Find the next adjacent original rect in y positive direction. */
{
continue;
}
/* Check whether there is an Y intersection between these adjacent rects in the new rectangles
* and fix the intersection if delta is "good".
*/
if (delta != 0)
{
DDCLOG(("YP intersection bottom %d top %d, diff %d\n",
delta));
}
}
/* Y negative (in the computer sense, down->top). */
{
/* Find the next adjacent original rect in x negative direction. */
{
continue;
}
/* Check whether there is an Y intersection between these adjacent rects in the new rectangles
* and fix the intersection if delta is "good".
*/
if (delta != 0)
{
DDCLOG(("YN intersection top %d bottom %d, diff %d\n",
delta));
}
}
return;
}
{
/* If not timeout set, set it to 5sec. */
if (uTimeout == 0)
uTimeout = 5000;
/* If no info flag (info, warning, error) set,
* set it to info by default. */
if (dwInfoFlags == 0)
/* Do we want to have */
/* Get running OS version. */
return RTErrConvertFromWin32(GetLastError());
/* Is the current OS supported (at least WinXP) for displaying
* our own icon and do we actually *want* to display our own stuff? */
&& (dwInfoFlags & NIIF_INFO))
{
/* Load (or retrieve handle of) the app's icon. */
if (hIcon)
{
/* Use an own icon instead of the default one. */
}
{
/* Use an own icon instead of the default one. */
}
}
else
{
/* This might be a warning, error message or a to old OS. Use the
* standard icons provided by Windows (if any). */
}
{
return RTErrConvertFromWin32(dwErr);
}
return VINF_SUCCESS;
}