Author: jimtabor
Date: Fri Jul 25 18:08:50 2008
New Revision: 34794
URL:
http://svn.reactos.org/svn/reactos?rev=34794&view=rev
Log:
- Fix NtUserCallMsgFilter so it initiates the hook call.
Modified:
trunk/reactos/subsystems/win32/win32k/ntuser/message.c
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] Fri Jul 25
18:08:50 2008
@@ -298,17 +298,57 @@
BOOL
STDCALL
NtUserCallMsgFilter(
- LPMSG msg,
+ LPMSG lpmsg,
INT code)
{
+ BOOL BadChk = FALSE;
+ MSG Msg;
DECLARE_RETURN(BOOL);
DPRINT("Enter NtUserCallMsgFilter\n");
UserEnterExclusive();
-
- if ( UserCallNextHookEx( WH_SYSMSGFILTER, code, 0, (LPARAM)msg, FALSE))
- RETURN( TRUE);
- RETURN( UserCallNextHookEx( WH_MSGFILTER, code, 0, (LPARAM)msg, FALSE));
+ if (lpmsg)
+ {
+ _SEH_TRY
+ {
+ ProbeForRead((PVOID)lpmsg,
+ sizeof(MSG),
+ 1);
+ RtlCopyMemory( &Msg,
+ (PVOID)lpmsg,
+ sizeof(MSG));
+ }
+ _SEH_HANDLE
+ {
+ BadChk = TRUE;
+ }
+ _SEH_END;
+ }
+ else
+ RETURN( FALSE);
+
+ if (BadChk) RETURN( FALSE);
+
+ if (!co_HOOK_CallHooks( WH_SYSMSGFILTER, code, 0, (LPARAM)&Msg))
+ {
+ co_HOOK_CallHooks( WH_MSGFILTER, code, 0, (LPARAM)&Msg);
+ }
+
+ _SEH_TRY
+ {
+ ProbeForWrite((PVOID)lpmsg,
+ sizeof(MSG),
+ 1);
+ RtlCopyMemory((PVOID)lpmsg,
+ &Msg,
+ sizeof(MSG));
+ }
+ _SEH_HANDLE
+ {
+ BadChk = TRUE;
+ }
+ _SEH_END;
+ if (BadChk) RETURN( FALSE);
CLEANUP:
DPRINT("Leave NtUserCallMsgFilter. ret=%i\n", _ret_);