Author: jimtabor
Date: Mon Jul 14 02:26:13 2008
New Revision: 34498
URL:
http://svn.reactos.org/svn/reactos?rev=34498&view=rev
Log:
Added WH_GETMESSAGE support.
Modified:
trunk/reactos/subsystems/win32/win32k/ntuser/hook.c
trunk/reactos/subsystems/win32/win32k/ntuser/message.c
Modified: trunk/reactos/subsystems/win32/win32k/ntuser/hook.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/subsystems/win32/win32k/nt…
==============================================================================
--- trunk/reactos/subsystems/win32/win32k/ntuser/hook.c [iso-8859-1] (original)
+++ trunk/reactos/subsystems/win32/win32k/ntuser/hook.c [iso-8859-1] Mon Jul 14 02:26:13
2008
@@ -570,7 +570,7 @@
/* We only (partially) support local WH_CBT hooks and
* WH_KEYBOARD_LL/WH_MOUSE_LL hooks for now */
if ((WH_CBT != HookId || Global)
- && WH_KEYBOARD_LL != HookId && WH_MOUSE_LL != HookId)
+ && WH_KEYBOARD_LL != HookId && WH_MOUSE_LL != HookId &&
WH_GETMESSAGE != HookId)
{
#if 0 /* Removed to get winEmbed working again */
UNIMPLEMENTED
Modified: trunk/reactos/subsystems/win32/win32k/ntuser/message.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/subsystems/win32/win32k/nt…
==============================================================================
--- trunk/reactos/subsystems/win32/win32k/ntuser/message.c [iso-8859-1] (original)
+++ trunk/reactos/subsystems/win32/win32k/ntuser/message.c [iso-8859-1] Mon Jul 14
02:26:13 2008
@@ -856,6 +856,10 @@
}
Present = co_IntPeekMessage(&Msg, hWnd, MsgFilterMin, MsgFilterMax, RemoveMsg);
+ // The WH_GETMESSAGE hook enables an application to monitor messages about to
+ // be returned by the GetMessage or PeekMessage function.
+ co_HOOK_CallHooks( WH_GETMESSAGE, HC_ACTION, RemoveMsg & PM_REMOVE,
(LPARAM)&Msg);
+
if (Present)
{
Info.Msg = Msg.Msg;
@@ -1845,6 +1849,7 @@
{
LRESULT lResult = 0;
PWINDOW_OBJECT Window = NULL;
+ USER_REFERENCE_ENTRY Ref;
UserEnterExclusive();
@@ -1852,15 +1857,15 @@
if (hWnd && (hWnd != INVALID_HANDLE_VALUE) && !(Window =
UserGetWindowObject(hWnd)))
{
return 0;
- }
-
+ }
+ UserRefObjectCo(Window, &Ref);
switch(dwType)
{
case NUMC_DEFWINDOWPROC:
lResult = IntDefWindowProc(Window, Msg, wParam, lParam);
break;
}
-
+ UserDerefObjectCo(Window);
UserLeave();
return lResult;
}