Index: win32ss/user/user32/windows/message.c
===================================================================
--- win32ss/user/user32/windows/message.c	(revision 59990)
+++ win32ss/user/user32/windows/message.c	(working copy)
@@ -1346,7 +1346,7 @@
       }
       _SEH2_EXCEPT(EXCEPTION_EXECUTE_HANDLER)
       {
-         ERR("Got exception when calling Ansi WndProc %p Msg %d \n",WndProc,Msg);
+         ERR("Got exception when calling Ansi WndProc %p Msg %d pti %p Wndpti %p\n",WndProc,Msg,GetW32ThreadInfo(),pWnd->head.pti);
       }
       _SEH2_END;
 
@@ -1395,7 +1395,7 @@
       }
       _SEH2_EXCEPT(EXCEPTION_EXECUTE_HANDLER)
       {
-         ERR("Got exception when calling unicode WndProc %p Msg %d \n",WndProc, Msg);
+         ERR("Got exception when calling unicode WndProc %p Msg %d pti %p Wndpti %p\n",WndProc, Msg,GetW32ThreadInfo(),pWnd->head.pti);
       }
       _SEH2_END;
 
@@ -1488,7 +1488,7 @@
       }
       _SEH2_EXCEPT(EXCEPTION_EXECUTE_HANDLER)
       {
-         ERR("Got exception when calling Ansi WndProc %p Msg %d \n",WndProc,Msg);
+         ERR("Got exception when calling Ansi WndProc %p Msg %d pti %p Wndpti %p\n",WndProc,Msg,GetW32ThreadInfo(),pWnd->head.pti);
       }
       _SEH2_END;
 
@@ -1542,7 +1542,7 @@
       }
       _SEH2_EXCEPT(EXCEPTION_EXECUTE_HANDLER)
       {
-         ERR("Got exception when calling unicode WndProc %p Msg %d \n",WndProc, Msg);
+         ERR("Got exception when calling unicode WndProc %p Msg %d pti %p Wndpti %p\n",WndProc, Msg,GetW32ThreadInfo(),pWnd->head.pti);
       }
       _SEH2_END;
 
@@ -2210,7 +2210,7 @@
 
       if ( Window != NULL &&
            Window->head.pti == ti &&
-//          !IsThreadHooked(GetWin32ClientInfo()) && // Enable to test message system bug.
+          !IsThreadHooked(GetWin32ClientInfo()) && // Enable to test message system bug.
           !ISITHOOKED(WH_CALLWNDPROC) &&
           !ISITHOOKED(WH_CALLWNDPROCRET) &&
           !(Window->state & WNDS_SERVERSIDEWINDOWPROC) )
@@ -2226,6 +2226,10 @@
 
           return IntCallMessageProc(Window, Wnd, Msg, wParam, lParam, FALSE);
       }
+      else
+      {
+          ERR("SMW: Message inside a Hook!\n");
+      }
   }
 
   UMMsg.hwnd = Wnd;
@@ -2275,7 +2279,7 @@
 
       if ( Window != NULL &&
            Window->head.pti == ti &&
-//          !IsThreadHooked(GetWin32ClientInfo()) && // Enable to test message system bug.
+          !IsThreadHooked(GetWin32ClientInfo()) && // Enable to test message system bug.
           !ISITHOOKED(WH_CALLWNDPROC) &&
           !ISITHOOKED(WH_CALLWNDPROCRET) &&
           !(Window->state & WNDS_SERVERSIDEWINDOWPROC) )
@@ -2291,6 +2295,10 @@
 
           return IntCallMessageProc(Window, Wnd, Msg, wParam, lParam, TRUE);
       }
+      else
+      {
+          ERR("SMA: Message inside a Hook!\n");
+      }
   }
 
   AnsiMsg.hwnd = Wnd;
@@ -2422,8 +2430,8 @@
   MSG AnsiMsg, UcMsg;
   LRESULT Result;
   DOSENDMESSAGE dsm;
-  PWND Window;
-  PTHREADINFO ti = GetW32ThreadInfo();
+//  PWND Window;
+//  PTHREADINFO ti = GetW32ThreadInfo();
 
   if ( Msg & ~WM_MAXIMUM || fuFlags & ~(SMTO_NOTIMEOUTIFNOTHUNG|SMTO_ABORTIFHUNG|SMTO_BLOCK))
   {
@@ -2434,6 +2442,7 @@
   if (lpdwResult) *lpdwResult = 0;
 
   //// This is due to message system bug.
+#if 0
   if (hWnd != HWND_TOPMOST && hWnd != HWND_BROADCAST && (Msg < WM_DDE_FIRST || Msg > WM_DDE_LAST))
   {
       Window = ValidateHwnd(hWnd);
@@ -2449,6 +2458,7 @@
           return TRUE;
       }
   }
+#endif  
   ////
   SPY_EnterMessage(SPY_SENDMESSAGE, hWnd, Msg, wParam, lParam);
 
@@ -2499,8 +2509,8 @@
 {
   LRESULT Result;
   DOSENDMESSAGE dsm;
-  PWND Window;
-  PTHREADINFO ti = GetW32ThreadInfo();
+//  PWND Window;
+//  PTHREADINFO ti = GetW32ThreadInfo();
 
   if ( Msg & ~WM_MAXIMUM || fuFlags & ~(SMTO_NOTIMEOUTIFNOTHUNG|SMTO_ABORTIFHUNG|SMTO_BLOCK))
   {
@@ -2511,6 +2521,7 @@
   if (lpdwResult) *lpdwResult = 0;
 
   //// This is due to message system bug.
+#if 0
   if (hWnd != HWND_TOPMOST && hWnd != HWND_BROADCAST && (Msg < WM_DDE_FIRST || Msg > WM_DDE_LAST))
   {
       Window = ValidateHwnd(hWnd);
@@ -2526,6 +2537,7 @@
           return TRUE;
       }
   }
+#endif
   ////
   SPY_EnterMessage(SPY_SENDMESSAGE, hWnd, Msg, wParam, lParam);
 
