VBoxHook.cpp revision 0758ccd1bec500cced35c8dfe52fcceacc2469d5
/** @file
*
* VBoxHook -- Global windows hook dll
*
* Copyright (C) 2006-2007 Sun Microsystems, Inc.
*
* 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.
*
* Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa
* Clara, CA 95054 USA or visit http://www.sun.com if you need
* additional information or have any questions.
*/
#include <Windows.h>
#include <VBoxHook.h>
#include <VBox/VBoxGuestLib.h>
#include <stdio.h>
#pragma data_seg("SHARED")
#pragma data_seg()
static HANDLE hNotifyEvent = 0;
#ifdef DEBUG
#else
#define dprintf(a) do {} while (0)
#endif /* DEBUG */
{
if ( idObject != OBJID_WINDOW
|| !hwnd)
return;
return;
switch(event)
{
if (!(dwStyle & WS_VISIBLE))
return;
case EVENT_OBJECT_CREATE:
case EVENT_OBJECT_DESTROY:
case EVENT_OBJECT_HIDE:
case EVENT_OBJECT_SHOW:
#ifdef DEBUG
switch(event)
{
break;
case EVENT_OBJECT_CREATE:
break;
case EVENT_OBJECT_HIDE:
break;
case EVENT_OBJECT_SHOW:
break;
case EVENT_OBJECT_DESTROY:
break;
}
#endif
if (!hNotifyEvent)
{
}
break;
}
}
/* Install the global message hook */
{
return TRUE;
hDll,
0, 0,
hDll,
0, 0,
return !!hEventHook[0];
}
/* Remove the global message hook */
{
{
UnhookWinEvent(hEventHook[0]);
}
return true;
}
#ifdef DEBUG
#include <VBox/VBoxGuest.h>
static char LogBuffer[1024];
{
return VINF_SUCCESS;
}
{
int rc;
/* open VBox guest driver */
if (gVBoxDriver == INVALID_HANDLE_VALUE)
NULL,
NULL);
if (gVBoxDriver == INVALID_HANDLE_VALUE)
return;
return;
}
#endif