- [User32] Fix timer crash when calling proc.
authorJames Tabor <james.tabor@reactos.org>
Tue, 9 Mar 2010 03:48:05 +0000 (03:48 +0000)
committerJames Tabor <james.tabor@reactos.org>
Tue, 9 Mar 2010 03:48:05 +0000 (03:48 +0000)
svn path=/trunk/; revision=46025

reactos/dll/win32/user32/windows/message.c

index bff9ee5..81d0d96 100644 (file)
@@ -1211,7 +1211,14 @@ IntCallWindowProcW(BOOL IsAnsiProc,
 
       if (PreResult) goto Exit;
 
-      Result = WndProc(AnsiMsg.hwnd, AnsiMsg.message, AnsiMsg.wParam, AnsiMsg.lParam);
+      _SEH2_TRY // wine does this.
+      {
+         Result = WndProc(AnsiMsg.hwnd, AnsiMsg.message, AnsiMsg.wParam, AnsiMsg.lParam);
+      }
+      _SEH2_EXCEPT(EXCEPTION_EXECUTE_HANDLER)
+      {
+      }
+      _SEH2_END;
 
       if (Hook && MsgOverride)
       {
@@ -1252,7 +1259,14 @@ IntCallWindowProcW(BOOL IsAnsiProc,
 
       if (PreResult) goto Exit;
 
-      Result = WndProc(hWnd, Msg, wParam, lParam);
+      _SEH2_TRY
+      {
+         Result = WndProc(hWnd, Msg, wParam, lParam);
+      }
+      _SEH2_EXCEPT(EXCEPTION_EXECUTE_HANDLER)
+      {
+      }
+      _SEH2_END;
 
       if (Hook && MsgOverride)
       {
@@ -1329,7 +1343,14 @@ IntCallWindowProcA(BOOL IsAnsiProc,
 
       if (PreResult) goto Exit;
 
-      Result = WndProc(hWnd, Msg, wParam, lParam);
+      _SEH2_TRY
+      {
+         Result = WndProc(hWnd, Msg, wParam, lParam);
+      }
+      _SEH2_EXCEPT(EXCEPTION_EXECUTE_HANDLER)
+      {
+      }
+      _SEH2_END;
 
       if (Hook && MsgOverride)
       {
@@ -1374,8 +1395,15 @@ IntCallWindowProcA(BOOL IsAnsiProc,
 
       if (PreResult) goto Exit;
 
-      Result = WndProc(UnicodeMsg.hwnd, UnicodeMsg.message,
-                       UnicodeMsg.wParam, UnicodeMsg.lParam);
+      _SEH2_TRY
+      {
+         Result = WndProc(UnicodeMsg.hwnd, UnicodeMsg.message,
+                          UnicodeMsg.wParam, UnicodeMsg.lParam);
+      }
+      _SEH2_EXCEPT(EXCEPTION_EXECUTE_HANDLER)
+      {
+      }
+      _SEH2_END;
 
       if (Hook && MsgOverride)
       {
@@ -1573,10 +1601,18 @@ DispatchMessageA(CONST MSG *lpmsg)
         if ( lpmsg->message == WM_SYSTIMER )
            return NtUserDispatchMessage( (PMSG)lpmsg );
 
-        Ret = WndProc(lpmsg->hwnd,
-                      lpmsg->message,
-                      lpmsg->wParam,
-                      GetTickCount());
+       _SEH2_TRY // wine does this.
+       {
+           Ret = WndProc(lpmsg->hwnd,
+                         lpmsg->message,
+                         lpmsg->wParam,
+                         GetTickCount());
+       }
+       _SEH2_EXCEPT(EXCEPTION_EXECUTE_HANDLER)
+       {
+       }
+       _SEH2_END;
+
     }
     else if (Wnd != NULL)
     {
@@ -1633,10 +1669,17 @@ DispatchMessageW(CONST MSG *lpmsg)
         if ( lpmsg->message == WM_SYSTIMER )
            return NtUserDispatchMessage( (PMSG) lpmsg );
 
-        Ret = WndProc(lpmsg->hwnd,
-                      lpmsg->message,
-                      lpmsg->wParam,
-                      GetTickCount());
+       _SEH2_TRY
+       {
+           Ret = WndProc(lpmsg->hwnd,
+                         lpmsg->message,
+                         lpmsg->wParam,
+                         GetTickCount());
+       }
+       _SEH2_EXCEPT(EXCEPTION_EXECUTE_HANDLER)
+       {
+       }
+       _SEH2_END;
     }
     else if (Wnd != NULL)
     {