Author: jimtabor
Date: Wed Jul 23 14:59:20 2008
New Revision: 34696
URL:
http://svn.reactos.org/svn/reactos?rev=34696&view=rev
Log:
- Fix NtUserCallMsgFilter to use SEH. Add support for system commands related to hooks.
Modified:
trunk/reactos/subsystems/win32/win32k/ntuser/defwnd.c
trunk/reactos/subsystems/win32/win32k/ntuser/message.c
Modified: trunk/reactos/subsystems/win32/win32k/ntuser/defwnd.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/subsystems/win32/win32k/nt…
==============================================================================
--- trunk/reactos/subsystems/win32/win32k/ntuser/defwnd.c [iso-8859-1] (original)
+++ trunk/reactos/subsystems/win32/win32k/ntuser/defwnd.c [iso-8859-1] Wed Jul 23 14:59:20
2008
@@ -12,7 +12,25 @@
#define NDEBUG
#include <debug.h>
+LRESULT FASTCALL
+IntDefWinHandleSysCommand( PWINDOW_OBJECT Window, WPARAM wParam, LPARAM lParam , BOOL
Ansi)
+{
+ DPRINT1("hwnd %p WM_SYSCOMMAND %lx %lx\n", Window->hSelf, wParam, lParam
);
+ if (!ISITHOOKED(WH_CBT)) return 0;
+
+ if (!UserCallNextHookEx(WH_CBT, HCBT_SYSCOMMAND, wParam, lParam, Ansi))
+ return 0;
+
+ switch (wParam & 0xfff0)
+ {
+ case SC_MOVE:
+ case SC_SIZE:
+ return UserCallNextHookEx(WH_CBT, HCBT_MOVESIZE, (WPARAM)Window->hSelf,
lParam, Ansi);
+ break;
+ }
+ return 1;
+}
/*
Win32k counterpart of User DefWindowProc
*/
@@ -25,6 +43,7 @@
BOOL Ansi)
{
PWINDOW Wnd;
+ LRESULT lResult = 0;
if (Msg > WM_USER) return 0;
@@ -33,6 +52,11 @@
switch (Msg)
{
+ case WM_SYSCOMMAND:
+ {
+ lResult = IntDefWinHandleSysCommand( Window, wParam, lParam, Ansi );
+ break;
+ }
case WM_SHOWWINDOW:
{
if ((Wnd->Style & WS_VISIBLE) && wParam) break;
@@ -54,7 +78,7 @@
break;
}
- return 0;
+ return lResult;
}
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] Wed Jul 23
14:59:20 2008
@@ -306,9 +306,9 @@
DPRINT("Enter NtUserCallMsgFilter\n");
UserEnterExclusive();
- if (co_HOOK_CallHooks( WH_SYSMSGFILTER, code, 0, (LPARAM)msg))
+ if ( UserCallNextHookEx( WH_SYSMSGFILTER, code, 0, (LPARAM)msg, FALSE))
RETURN( TRUE);
- RETURN( co_HOOK_CallHooks( WH_MSGFILTER, code, 0, (LPARAM)msg));
+ RETURN( UserCallNextHookEx( WH_MSGFILTER, code, 0, (LPARAM)msg, FALSE));
CLEANUP:
DPRINT("Leave NtUserCallMsgFilter. ret=%i\n", _ret_);