From 6262cc325f1ee03e207ae494d3fd7867dcb7262d Mon Sep 17 00:00:00 2001 From: Dmitry Timoshkov Date: Mon, 19 Oct 2015 10:28:31 +0800 Subject: [PATCH] ntdll: Return from snoop tracing helpers earlier if tracing is disabled. This allows turning off and on snooping from task manager. Signed-off-by: Dmitry Timoshkov Signed-off-by: Alexandre Julliard --- dlls/ntdll/relay.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/dlls/ntdll/relay.c b/dlls/ntdll/relay.c index ef0af0f4d8a..997de1fdcf7 100644 --- a/dlls/ntdll/relay.c +++ b/dlls/ntdll/relay.c @@ -1085,6 +1085,8 @@ void WINAPI __regs_SNOOP_Entry( CONTEXT *context ) context->Eip = (DWORD)fun->origfun; + if (!TRACE_ON(snoop)) return; + if (TRACE_ON(timestamp)) print_timestamp(); if (fun->name) DPRINTF("%04x:CALL %s.%s(",GetCurrentThreadId(),dll->name,fun->name); @@ -1121,6 +1123,12 @@ void WINAPI __regs_SNOOP_Return( CONTEXT *context ) if (ret->dll->funs[ret->ordinal].nrofargs<0) ret->dll->funs[ret->ordinal].nrofargs=(context->Esp - ret->origESP-4)/4; context->Eip = (DWORD)ret->origreturn; + + if (!TRACE_ON(snoop)) { + ret->origreturn = NULL; /* mark as empty */ + return; + } + if (TRACE_ON(timestamp)) print_timestamp(); if (ret->args) {