[PATCH] user32: Add the ticks debug channel
Detlef Riekenberg
wine.dev at web.de
Sun Nov 11 13:30:19 CST 2007
---
dlls/user32/hook.c | 18 +++++++++++++++++-
dlls/user32/message.c | 17 +++++++++++++++++
dlls/user32/winproc.c | 17 +++++++++++++++++
3 files changed, 51 insertions(+), 1 deletions(-)
diff --git a/dlls/user32/hook.c b/dlls/user32/hook.c
index 75e31e4..f6755b6 100644
--- a/dlls/user32/hook.c
+++ b/dlls/user32/hook.c
@@ -81,6 +81,7 @@ #include "winternl.h"
WINE_DEFAULT_DEBUG_CHANNEL(hook);
WINE_DECLARE_DEBUG_CHANNEL(relay);
+WINE_DECLARE_DEBUG_CHANNEL(ticks);
struct hook_info
{
@@ -294,17 +295,24 @@ static LRESULT call_hook_proc( HOOKPROC
LRESULT ret;
if (TRACE_ON(relay))
+ {
+ if (TRACE_ON(ticks)) DPRINTF( "(%05u)", NtGetTickCount() );
+
DPRINTF( "%04x:Call hook proc %p (id=%s,code=%x,wp=%08lx,lp=%08lx)\n",
GetCurrentThreadId(), proc, hook_names[id-WH_MINHOOK], code, wparam, lparam );
+ }
if (!prev_unicode == !next_unicode) ret = proc( code, wparam, lparam );
else if (prev_unicode) ret = call_hook_WtoA( proc, id, code, wparam, lparam );
else ret = call_hook_AtoW( proc, id, code, wparam, lparam );
if (TRACE_ON(relay))
+ {
+ if (TRACE_ON(ticks)) DPRINTF( "(%05u)", NtGetTickCount() );
+
DPRINTF( "%04x:Ret hook proc %p (id=%s,code=%x,wp=%08lx,lp=%08lx) retval=%08lx\n",
GetCurrentThreadId(), proc, hook_names[id-WH_MINHOOK], code, wparam, lparam, ret );
-
+ }
return ret;
}
@@ -856,17 +864,25 @@ #endif
if (!info.module[0] || (info.proc = get_hook_proc( info.proc, info.module )) != NULL)
{
if (TRACE_ON(relay))
+ {
+ if (TRACE_ON(ticks)) DPRINTF( "(%05u)", NtGetTickCount() );
+
DPRINTF( "%04x:Call winevent hook proc %p (hhook=%p,event=%x,hwnd=%p,object_id=%x,child_id=%x,tid=%04x,time=%x)\n",
GetCurrentThreadId(), info.proc, info.handle, event, hwnd, object_id,
child_id, GetCurrentThreadId(), GetCurrentTime());
+ }
info.proc(info.handle, event, hwnd, object_id, child_id,
GetCurrentThreadId(), GetCurrentTime());
if (TRACE_ON(relay))
+ {
+ if (TRACE_ON(ticks)) DPRINTF( "(%05u)", NtGetTickCount() );
+
DPRINTF( "%04x:Ret winevent hook proc %p (hhook=%p,event=%x,hwnd=%p,object_id=%x,child_id=%x,tid=%04x,time=%x)\n",
GetCurrentThreadId(), info.proc, info.handle, event, hwnd, object_id,
child_id, GetCurrentThreadId(), GetCurrentTime());
+ }
}
}
else
diff --git a/dlls/user32/message.c b/dlls/user32/message.c
index 46333b6..927ac93 100644
--- a/dlls/user32/message.c
+++ b/dlls/user32/message.c
@@ -43,6 +43,7 @@ #include "wine/debug.h"
WINE_DEFAULT_DEBUG_CHANNEL(msg);
WINE_DECLARE_DEBUG_CHANNEL(relay);
+WINE_DECLARE_DEBUG_CHANNEL(ticks);
WINE_DECLARE_DEBUG_CHANNEL(key);
#define WM_NCMOUSEFIRST WM_NCMOUSEMOVE
@@ -1975,14 +1976,22 @@ static inline void call_sendmsg_callback
if (!callback) return;
if (TRACE_ON(relay))
+ {
+ if (TRACE_ON(ticks)) DPRINTF( "(%05u)", NtGetTickCount() );
+
DPRINTF( "%04x:Call message callback %p (hwnd=%p,msg=%s,data=%08lx,result=%08lx)\n",
GetCurrentThreadId(), callback, hwnd, SPY_GetMsgName( msg, hwnd ),
data, result );
+ }
callback( hwnd, msg, data, result );
if (TRACE_ON(relay))
+ {
+ if (TRACE_ON(ticks)) DPRINTF( "(%05u)", NtGetTickCount() );
+
DPRINTF( "%04x:Ret message callback %p (hwnd=%p,msg=%s,data=%08lx,result=%08lx)\n",
GetCurrentThreadId(), callback, hwnd, SPY_GetMsgName( msg, hwnd ),
data, result );
+ }
}
@@ -2118,19 +2127,27 @@ static BOOL peek_message( MSG *msg, HWND
}
if (TRACE_ON(relay))
+ {
+ if (TRACE_ON(ticks)) DPRINTF( "(%05u)", NtGetTickCount() );
+
DPRINTF( "%04x:Call winevent proc %p (hook=%p,event=%x,hwnd=%p,object_id=%lx,child_id=%lx,tid=%04x,time=%x)\n",
GetCurrentThreadId(), hook_proc,
data->hook, info.msg.message, info.msg.hwnd, info.msg.wParam,
info.msg.lParam, data->tid, info.msg.time);
+ }
hook_proc( data->hook, info.msg.message, info.msg.hwnd, info.msg.wParam,
info.msg.lParam, data->tid, info.msg.time );
if (TRACE_ON(relay))
+ {
+ if (TRACE_ON(ticks)) DPRINTF( "(%05u)", NtGetTickCount() );
+
DPRINTF( "%04x:Ret winevent proc %p (hook=%p,event=%x,hwnd=%p,object_id=%lx,child_id=%lx,tid=%04x,time=%x)\n",
GetCurrentThreadId(), hook_proc,
data->hook, info.msg.message, info.msg.hwnd, info.msg.wParam,
info.msg.lParam, data->tid, info.msg.time);
+ }
}
goto next;
case MSG_OTHER_PROCESS:
diff --git a/dlls/user32/winproc.c b/dlls/user32/winproc.c
index 32b9cb1..8532dd8 100644
--- a/dlls/user32/winproc.c
+++ b/dlls/user32/winproc.c
@@ -41,6 +41,7 @@ #include "wine/debug.h"
WINE_DECLARE_DEBUG_CHANNEL(msg);
WINE_DECLARE_DEBUG_CHANNEL(relay);
+WINE_DECLARE_DEBUG_CHANNEL(ticks);
WINE_DEFAULT_DEBUG_CHANNEL(win);
typedef struct tagWINDOWPROC
@@ -451,14 +452,22 @@ static LRESULT call_window_proc( HWND hw
hwnd = WIN_GetFullHandle( hwnd );
if (TRACE_ON(relay))
+ {
+ if (TRACE_ON(ticks)) DPRINTF( "(%05u)", NtGetTickCount() );
+
DPRINTF( "%04x:Call window proc %p (hwnd=%p,msg=%s,wp=%08lx,lp=%08lx)\n",
GetCurrentThreadId(), proc, hwnd, SPY_GetMsgName(msg, hwnd), wp, lp );
+ }
*result = WINPROC_wrapper( proc, hwnd, msg, wp, lp );
if (TRACE_ON(relay))
+ {
+ if (TRACE_ON(ticks)) DPRINTF( "(%05u)", NtGetTickCount() );
+
DPRINTF( "%04x:Ret window proc %p (hwnd=%p,msg=%s,wp=%08lx,lp=%08lx) retval=%08lx\n",
GetCurrentThreadId(), proc, hwnd, SPY_GetMsgName(msg, hwnd), wp, lp, *result );
+ }
return *result;
}
@@ -472,15 +481,23 @@ static LRESULT call_dialog_proc( HWND hw
hwnd = WIN_GetFullHandle( hwnd );
if (TRACE_ON(relay))
+ {
+ if (TRACE_ON(ticks)) DPRINTF( "(%05u)", NtGetTickCount() );
+
DPRINTF( "%04x:Call dialog proc %p (hwnd=%p,msg=%s,wp=%08lx,lp=%08lx)\n",
GetCurrentThreadId(), proc, hwnd, SPY_GetMsgName(msg, hwnd), wp, lp );
+ }
ret = WINPROC_wrapper( proc, hwnd, msg, wp, lp );
*result = GetWindowLongPtrW( hwnd, DWLP_MSGRESULT );
if (TRACE_ON(relay))
+ {
+ if (TRACE_ON(ticks)) DPRINTF( "(%05u)", NtGetTickCount() );
+
DPRINTF( "%04x:Ret dialog proc %p (hwnd=%p,msg=%s,wp=%08lx,lp=%08lx) retval=%08lx result=%08lx\n",
GetCurrentThreadId(), proc, hwnd, SPY_GetMsgName(msg, hwnd), wp, lp, ret, *result );
+ }
return ret;
}
--
1.4.1
--=-yMFmn4SY4EPseaO3bIHz--
More information about the wine-patches
mailing list