VBoxHook.cpp revision 4604ab7d38c2bd2dfc255aa1facffdf81c1c9153
cc66247640b520463f925a5533fc9e5de06aa982vboxsync * VBoxHook -- Global windows hook dll
cc66247640b520463f925a5533fc9e5de06aa982vboxsync * Copyright (C) 2006-2007 Sun Microsystems, Inc.
c7814cf6e1240a519cbec0441e033d0e2470ed00vboxsync * This file is part of VirtualBox Open Source Edition (OSE), as
cc66247640b520463f925a5533fc9e5de06aa982vboxsync * available from http://www.virtualbox.org. This file is free software;
cc66247640b520463f925a5533fc9e5de06aa982vboxsync * you can redistribute it and/or modify it under the terms of the GNU
cc66247640b520463f925a5533fc9e5de06aa982vboxsync * General Public License (GPL) as published by the Free Software
cc66247640b520463f925a5533fc9e5de06aa982vboxsync * Foundation, in version 2 as it comes in the "COPYING" file of the
cc66247640b520463f925a5533fc9e5de06aa982vboxsync * VirtualBox OSE distribution. VirtualBox OSE is distributed in the
cc66247640b520463f925a5533fc9e5de06aa982vboxsync * hope that it will be useful, but WITHOUT ANY WARRANTY of any kind.
cc66247640b520463f925a5533fc9e5de06aa982vboxsync * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa
cc66247640b520463f925a5533fc9e5de06aa982vboxsync * Clara, CA 95054 USA or visit http://www.sun.com if you need
cc66247640b520463f925a5533fc9e5de06aa982vboxsync * additional information or have any questions.
cc66247640b520463f925a5533fc9e5de06aa982vboxsync#define dprintf(a) do {} while (0)
cc66247640b520463f925a5533fc9e5de06aa982vboxsync#endif /* DEBUG */
cc66247640b520463f925a5533fc9e5de06aa982vboxsyncvoid CALLBACK VBoxHandleWinEvent(HWINEVENTHOOK hook, DWORD event, HWND hwnd,
cc66247640b520463f925a5533fc9e5de06aa982vboxsync dprintf(("VBoxHandleWinEvent EVENT_OBJECT_LOCATIONCHANGE for window %x\n", hwnd));
cc66247640b520463f925a5533fc9e5de06aa982vboxsync dprintf(("VBoxHandleWinEvent EVENT_OBJECT_CREATE for window %x\n", hwnd));
cc66247640b520463f925a5533fc9e5de06aa982vboxsync dprintf(("VBoxHandleWinEvent EVENT_OBJECT_HIDE for window %x\n", hwnd));
cc66247640b520463f925a5533fc9e5de06aa982vboxsync dprintf(("VBoxHandleWinEvent EVENT_OBJECT_SHOW for window %x\n", hwnd));
cc66247640b520463f925a5533fc9e5de06aa982vboxsync dprintf(("VBoxHandleWinEvent EVENT_OBJECT_DESTROY for window %x\n", hwnd));
cc66247640b520463f925a5533fc9e5de06aa982vboxsync hNotifyEvent = OpenEvent(EVENT_MODIFY_STATE, FALSE, VBOXHOOK_GLOBAL_EVENT_NAME);
cc66247640b520463f925a5533fc9e5de06aa982vboxsync dprintf(("OpenEvent returned %x (last err=%x)\n", hNotifyEvent, GetLastError()));
cc66247640b520463f925a5533fc9e5de06aa982vboxsync dprintf(("SetEvent %x returned %d (last error %x)\n", hNotifyEvent, ret, GetLastError()));
cc66247640b520463f925a5533fc9e5de06aa982vboxsync/* Install the global message hook */
cc66247640b520463f925a5533fc9e5de06aa982vboxsync hEventHook[0] = SetWinEventHook(EVENT_OBJECT_LOCATIONCHANGE, EVENT_OBJECT_LOCATIONCHANGE,
cc66247640b520463f925a5533fc9e5de06aa982vboxsync hEventHook[1] = SetWinEventHook(EVENT_OBJECT_CREATE, EVENT_OBJECT_HIDE,
cc66247640b520463f925a5533fc9e5de06aa982vboxsync/* Remove the global message hook */
cc66247640b520463f925a5533fc9e5de06aa982vboxsync return true;
cc66247640b520463f925a5533fc9e5de06aa982vboxsyncVBGLR3DECL(int) VbglR3GRPerform(VMMDevRequestHeader *pReq)
cc66247640b520463f925a5533fc9e5de06aa982vboxsync DeviceIoControl(gVBoxDriver, IOCTL_VBOXGUEST_VMMREQUEST, pReq, pReq->size,
cc66247640b520463f925a5533fc9e5de06aa982vboxsync VMMDevReqLogString *pReq = (VMMDevReqLogString *)LogBuffer;
cc66247640b520463f925a5533fc9e5de06aa982vboxsync /* open VBox guest driver */