Author: jimtabor
Date: Tue Oct 18 00:39:06 2011
New Revision: 54184
URL:
http://svn.reactos.org/svn/reactos?rev=54184&view=rev
Log:
- Add hits to track callback and winproc faults.
Modified:
trunk/reactos/dll/win32/user32/windows/message.c
Modified: trunk/reactos/dll/win32/user32/windows/message.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/user32/windows/m…
==============================================================================
--- trunk/reactos/dll/win32/user32/windows/message.c [iso-8859-1] (original)
+++ trunk/reactos/dll/win32/user32/windows/message.c [iso-8859-1] Tue Oct 18 00:39:06
2011
@@ -1133,7 +1133,7 @@
MSG UnicodeMsg;
BOOL Hook = FALSE, MsgOverride = FALSE, Dialog;
LRESULT Result = 0, PreResult = 0;
- DWORD Data = 0;
+ DWORD Hit = 0, Data = 0;
if (WndProc == NULL)
{
@@ -1189,6 +1189,7 @@
}
_SEH2_EXCEPT(EXCEPTION_EXECUTE_HANDLER)
{
+ Hit = 1;
}
_SEH2_END;
@@ -1237,6 +1238,7 @@
}
_SEH2_EXCEPT(EXCEPTION_EXECUTE_HANDLER)
{
+ Hit = 2;
}
_SEH2_END;
@@ -1258,6 +1260,18 @@
Exit:
if (Hook) EndUserApiHook();
+ if (Hit)
+ {
+ switch(Hit)
+ {
+ case 1:
+ ERR("CallWindowProcW Ansi Failed!\n");
+ break;
+ case 2:
+ ERR("CallWindowProcW Unicode Failed!\n");
+ break;
+ }
+ }
return Result;
}
@@ -1274,7 +1288,7 @@
MSG UnicodeMsg;
BOOL Hook = FALSE, MsgOverride = FALSE, Dialog;
LRESULT Result = 0, PreResult = 0;
- DWORD Data = 0;
+ DWORD Hit = 0, Data = 0;
if (WndProc == NULL)
{
@@ -1321,6 +1335,7 @@
}
_SEH2_EXCEPT(EXCEPTION_EXECUTE_HANDLER)
{
+ Hit = 1;
}
_SEH2_END;
@@ -1374,6 +1389,7 @@
}
_SEH2_EXCEPT(EXCEPTION_EXECUTE_HANDLER)
{
+ Hit = 2;
}
_SEH2_END;
@@ -1400,6 +1416,18 @@
Exit:
if (Hook) EndUserApiHook();
+ if (Hit)
+ {
+ switch(Hit)
+ {
+ case 1:
+ ERR("CallWindowProcA Ansi Failed!\n");
+ break;
+ case 2:
+ ERR("CallWindowProcA Unicode Failed!\n");
+ break;
+ }
+ }
return Result;
}
@@ -1562,6 +1590,7 @@
LRESULT Ret = 0;
MSG UnicodeMsg;
PWND Wnd;
+ BOOL Hit = FALSE;
if ( lpmsg->message & ~WM_MAXIMUM )
{
@@ -1590,7 +1619,11 @@
if ( lpmsg->message == WM_SYSTIMER )
return NtUserDispatchMessage( (PMSG)lpmsg );
- if (!NtUserValidateTimerCallback(lpmsg->hwnd, lpmsg->wParam,
lpmsg->lParam)) return 0;
+ if (!NtUserValidateTimerCallback(lpmsg->hwnd, lpmsg->wParam,
lpmsg->lParam))
+ {
+ WARN("Validating Timer Callback failed!\n");
+ return 0;
+ }
_SEH2_TRY // wine does this. Hint: Prevents call to another thread....
{
@@ -1601,6 +1634,7 @@
}
_SEH2_EXCEPT(EXCEPTION_EXECUTE_HANDLER)
{
+ Hit = TRUE;
}
_SEH2_END;
}
@@ -1630,6 +1664,11 @@
}
}
}
+
+ if (Hit)
+ {
+ WARN("Exception in Timer Callback WndProcA!\n");
+ }
return Ret;
}
@@ -1642,6 +1681,7 @@
{
LRESULT Ret = 0;
PWND Wnd;
+ BOOL Hit = FALSE;
if ( lpmsg->message & ~WM_MAXIMUM )
{
@@ -1670,7 +1710,11 @@
if ( lpmsg->message == WM_SYSTIMER )
return NtUserDispatchMessage( (PMSG) lpmsg );
- if (!NtUserValidateTimerCallback(lpmsg->hwnd, lpmsg->wParam,
lpmsg->lParam)) return 0;
+ if (!NtUserValidateTimerCallback(lpmsg->hwnd, lpmsg->wParam,
lpmsg->lParam))
+ {
+ WARN("Validating Timer Callback failed!\n");
+ return 0;
+ }
_SEH2_TRY
{
@@ -1681,6 +1725,7 @@
}
_SEH2_EXCEPT(EXCEPTION_EXECUTE_HANDLER)
{
+ Hit = TRUE;
}
_SEH2_END;
}
@@ -1699,6 +1744,10 @@
Ret = NtUserDispatchMessage( (PMSG) lpmsg );
}
+ if (Hit)
+ {
+ WARN("Exception in Timer Callback WndProcW!\n");
+ }
return Ret;
}