Alexandre Julliard : user32: Use the magic format string prefix for relay traces.

Alexandre Julliard julliard at winehq.org
Mon Nov 27 15:05:39 CST 2017


Module: wine
Branch: master
Commit: 01676c5dd6f9fb61b9c4e52595f6e75e21050009
URL:    http://source.winehq.org/git/wine.git/?a=commit;h=01676c5dd6f9fb61b9c4e52595f6e75e21050009

Author: Alexandre Julliard <julliard at winehq.org>
Date:   Sat Nov 25 11:48:02 2017 +0100

user32: Use the magic format string prefix for relay traces.

Signed-off-by: Alexandre Julliard <julliard at winehq.org>

---

 dlls/user32/edit.c    |  6 ++++--
 dlls/user32/hook.c    | 22 +++++++++-------------
 dlls/user32/message.c | 28 ++++++++++------------------
 dlls/user32/winproc.c | 20 ++++++++------------
 4 files changed, 31 insertions(+), 45 deletions(-)

diff --git a/dlls/user32/edit.c b/dlls/user32/edit.c
index c93d3c3..c8903e2 100644
--- a/dlls/user32/edit.c
+++ b/dlls/user32/edit.c
@@ -342,9 +342,10 @@ static INT EDIT_CallWordBreakProc(EDITSTATE *es, INT start, INT index, INT count
 	    {
 		EDITWORDBREAKPROCW wbpW = (EDITWORDBREAKPROCW)es->word_break_proc;
 
-		TRACE_(relay)("(UNICODE wordbrk=%p,str=%s,idx=%d,cnt=%d,act=%d)\n",
+		TRACE_(relay)("\1Call wordbreakW %p (str=%s,idx=%d,cnt=%d,act=%d)\n",
 			es->word_break_proc, debugstr_wn(es->text + start, count), index, count, action);
 		ret = wbpW(es->text + start, index, count, action);
+		TRACE_(relay)("\1Ret wordbreakW %p retval=%d\n", es->word_break_proc, ret );
 	    }
 	    else
 	    {
@@ -355,10 +356,11 @@ static INT EDIT_CallWordBreakProc(EDITSTATE *es, INT start, INT index, INT count
 		countA = WideCharToMultiByte(CP_ACP, 0, es->text + start, count, NULL, 0, NULL, NULL);
 		textA = HeapAlloc(GetProcessHeap(), 0, countA);
 		WideCharToMultiByte(CP_ACP, 0, es->text + start, count, textA, countA, NULL, NULL);
-		TRACE_(relay)("(ANSI wordbrk=%p,str=%s,idx=%d,cnt=%d,act=%d)\n",
+		TRACE_(relay)("\1Call wordbreakA %p(str=%s,idx=%d,cnt=%d,act=%d)\n",
 			es->word_break_proc, debugstr_an(textA, countA), index, countA, action);
 		ret = wbpA(textA, index, countA, action);
 		HeapFree(GetProcessHeap(), 0, textA);
+		TRACE_(relay)("\1Ret wordbreakA %p retval=%d\n", es->word_break_proc, ret );
 	    }
         }
 	else
diff --git a/dlls/user32/hook.c b/dlls/user32/hook.c
index f674b2c..3aa7b33 100644
--- a/dlls/user32/hook.c
+++ b/dlls/user32/hook.c
@@ -338,17 +338,15 @@ static LRESULT call_hook_proc( HOOKPROC proc, INT id, INT code, WPARAM wparam, L
 {
     LRESULT ret;
 
-    if (TRACE_ON(relay))
-        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 );
+    TRACE_(relay)( "\1Call hook proc %p (id=%s,code=%x,wp=%08lx,lp=%08lx)\n",
+                   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))
-        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 );
+    TRACE_(relay)( "\1Ret  hook proc %p (id=%s,code=%x,wp=%08lx,lp=%08lx) retval=%08lx\n",
+                   proc, hook_names[id-WH_MINHOOK], code, wparam, lparam, ret );
 
     return ret;
 }
@@ -921,17 +919,15 @@ void WINAPI NotifyWinEvent(DWORD event, HWND hwnd, LONG object_id, LONG child_id
 
             if (!info.module[0] || (proc = get_hook_proc( proc, info.module, &free_module )) != NULL)
             {
-                if (TRACE_ON(relay))
-                    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(), proc, info.handle, event, hwnd, object_id,
-                             child_id, GetCurrentThreadId(), GetCurrentTime());
+                TRACE_(relay)( "\1Call winevent hook proc %p (hhook=%p,event=%x,hwnd=%p,object_id=%x,child_id=%x,tid=%04x,time=%x)\n",
+                               proc, info.handle, event, hwnd, object_id,
+                               child_id, GetCurrentThreadId(), GetCurrentTime());
 
                 proc( info.handle, event, hwnd, object_id, child_id,
                       GetCurrentThreadId(), GetCurrentTime());
 
-                if (TRACE_ON(relay))
-                    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(), proc, info.handle, event, hwnd, object_id,
+                TRACE_(relay)( "\1Ret  winevent hook proc %p (hhook=%p,event=%x,hwnd=%p,object_id=%x,child_id=%x,tid=%04x,time=%x)\n",
+                             proc, info.handle, event, hwnd, object_id,
                              child_id, GetCurrentThreadId(), GetCurrentTime());
 
                 if (free_module) FreeLibrary(free_module);
diff --git a/dlls/user32/message.c b/dlls/user32/message.c
index 406eff3..172d659 100644
--- a/dlls/user32/message.c
+++ b/dlls/user32/message.c
@@ -2708,15 +2708,11 @@ static inline void call_sendmsg_callback( SENDASYNCPROC callback, HWND hwnd, UIN
 {
     if (!callback) return;
 
-    if (TRACE_ON(relay))
-        DPRINTF( "%04x:Call message callback %p (hwnd=%p,msg=%s,data=%08lx,result=%08lx)\n",
-                 GetCurrentThreadId(), callback, hwnd, SPY_GetMsgName( msg, hwnd ),
-                 data, result );
+    TRACE_(relay)( "\1Call message callback %p (hwnd=%p,msg=%s,data=%08lx,result=%08lx)\n",
+                   callback, hwnd, SPY_GetMsgName( msg, hwnd ), data, result );
     callback( hwnd, msg, data, result );
-    if (TRACE_ON(relay))
-        DPRINTF( "%04x:Ret  message callback %p (hwnd=%p,msg=%s,data=%08lx,result=%08lx)\n",
-                 GetCurrentThreadId(), callback, hwnd, SPY_GetMsgName( msg, hwnd ),
-                 data, result );
+    TRACE_(relay)( "\1Ret  message callback %p (hwnd=%p,msg=%s,data=%08lx,result=%08lx)\n",
+                   callback, hwnd, SPY_GetMsgName( msg, hwnd ), data, result );
 }
 
 
@@ -2832,21 +2828,17 @@ static BOOL peek_message( MSG *msg, HWND hwnd, UINT first, UINT last, UINT flags
                     }
                 }
 
-                if (TRACE_ON(relay))
-                    DPRINTF( "%04x:Call winevent proc %p (hook=%04x,event=%x,hwnd=%p,object_id=%lx,child_id=%lx,tid=%04x,time=%x)\n",
-                             GetCurrentThreadId(), hook_proc,
-                             msg_data->winevent.hook, info.msg.message, info.msg.hwnd, info.msg.wParam,
-                             info.msg.lParam, msg_data->winevent.tid, info.msg.time);
+                TRACE_(relay)( "\1Call winevent proc %p (hook=%04x,event=%x,hwnd=%p,object_id=%lx,child_id=%lx,tid=%04x,time=%x)\n",
+                               hook_proc, msg_data->winevent.hook, info.msg.message, info.msg.hwnd,
+                               info.msg.wParam, info.msg.lParam, msg_data->winevent.tid, info.msg.time);
 
                 hook_proc( wine_server_ptr_handle( msg_data->winevent.hook ), info.msg.message,
                            info.msg.hwnd, info.msg.wParam, info.msg.lParam,
                            msg_data->winevent.tid, info.msg.time );
 
-                if (TRACE_ON(relay))
-                    DPRINTF( "%04x:Ret  winevent proc %p (hook=%04x,event=%x,hwnd=%p,object_id=%lx,child_id=%lx,tid=%04x,time=%x)\n",
-                             GetCurrentThreadId(), hook_proc,
-                             msg_data->winevent.hook, info.msg.message, info.msg.hwnd, info.msg.wParam,
-                             info.msg.lParam, msg_data->winevent.tid, info.msg.time);
+                TRACE_(relay)( "\1Ret  winevent proc %p (hook=%04x,event=%x,hwnd=%p,object_id=%lx,child_id=%lx,tid=%04x,time=%x)\n",
+                               hook_proc, msg_data->winevent.hook, info.msg.message, info.msg.hwnd,
+                               info.msg.wParam, info.msg.lParam, msg_data->winevent.tid, info.msg.time);
 
                 if (free_module) FreeLibrary(free_module);
             }
diff --git a/dlls/user32/winproc.c b/dlls/user32/winproc.c
index 904a350..73bbe95 100644
--- a/dlls/user32/winproc.c
+++ b/dlls/user32/winproc.c
@@ -238,15 +238,13 @@ static LRESULT call_window_proc( HWND hwnd, UINT msg, WPARAM wp, LPARAM lp, LRES
     USER_CheckNotLock();
 
     hwnd = WIN_GetFullHandle( hwnd );
-    if (TRACE_ON(relay))
-        DPRINTF( "%04x:Call window proc %p (hwnd=%p,msg=%s,wp=%08lx,lp=%08lx)\n",
-                 GetCurrentThreadId(), proc, hwnd, SPY_GetMsgName(msg, hwnd), wp, lp );
+    TRACE_(relay)( "\1Call window proc %p (hwnd=%p,msg=%s,wp=%08lx,lp=%08lx)\n",
+                   proc, hwnd, SPY_GetMsgName(msg, hwnd), wp, lp );
 
     *result = WINPROC_wrapper( proc, hwnd, msg, wp, lp );
 
-    if (TRACE_ON(relay))
-        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 );
+    TRACE_(relay)( "\1Ret  window proc %p (hwnd=%p,msg=%s,wp=%08lx,lp=%08lx) retval=%08lx\n",
+                   proc, hwnd, SPY_GetMsgName(msg, hwnd), wp, lp, *result );
     return *result;
 }
 
@@ -259,16 +257,14 @@ static LRESULT call_dialog_proc( HWND hwnd, UINT msg, WPARAM wp, LPARAM lp, LRES
     USER_CheckNotLock();
 
     hwnd = WIN_GetFullHandle( hwnd );
-    if (TRACE_ON(relay))
-        DPRINTF( "%04x:Call dialog proc %p (hwnd=%p,msg=%s,wp=%08lx,lp=%08lx)\n",
-                 GetCurrentThreadId(), proc, hwnd, SPY_GetMsgName(msg, hwnd), wp, lp );
+    TRACE_(relay)( "\1Call dialog proc %p (hwnd=%p,msg=%s,wp=%08lx,lp=%08lx)\n",
+                   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))
-        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 );
+    TRACE_(relay)( "\1Ret  dialog proc %p (hwnd=%p,msg=%s,wp=%08lx,lp=%08lx) retval=%08lx result=%08lx\n",
+                   proc, hwnd, SPY_GetMsgName(msg, hwnd), wp, lp, ret, *result );
     return ret;
 }
 




More information about the wine-cvs mailing list