VBoxHook.cpp revision 20100beba9f76a1cd0c620b8ef4432f0228ce887
/** @file
*
* VBoxHook -- Global windows hook dll
*
* Copyright (C) 2006-2007 innotek GmbH
*
* 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 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 <windows.h>
#include <VBoxHook.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