Skip to content

Commit 39d44d6

Browse files
committed
ExtendedTools: Revert StartTrace precedence from 41f5d8b (Fixes advapi32 eventlog spam)
1 parent 7dd5964 commit 39d44d6

File tree

1 file changed

+14
-14
lines changed

1 file changed

+14
-14
lines changed

plugins/ExtendedTools/etwmon.c

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -145,26 +145,26 @@ VOID EtStartEtwSession(
145145
if (EtWindowsVersion >= WINDOWS_8)
146146
EtpTraceProperties->LogFileMode |= EVENT_TRACE_SYSTEM_LOGGER_MODE;
147147

148-
status = StartTrace(
149-
&traceHandle,
148+
// Get the existing session handle.
149+
status = ControlTrace(
150+
0,
150151
EtpActualKernelLoggerName->Buffer,
151-
EtpTraceProperties
152+
EtpTraceProperties,
153+
EVENT_TRACE_CONTROL_QUERY
152154
);
153155

154-
if (status == ERROR_ALREADY_EXISTS)
156+
if (status == ERROR_SUCCESS)
155157
{
156-
// Get the existing session handle.
157-
status = ControlTrace(
158-
0,
158+
traceHandle = EtpTraceProperties->Wnode.HistoricalContext;
159+
}
160+
else
161+
{
162+
EtpTraceProperties->LogFileNameOffset = 0;
163+
status = StartTrace(
164+
&traceHandle,
159165
EtpActualKernelLoggerName->Buffer,
160-
EtpTraceProperties,
161-
EVENT_TRACE_CONTROL_QUERY
166+
EtpTraceProperties
162167
);
163-
164-
if (status == ERROR_SUCCESS)
165-
{
166-
traceHandle = EtpTraceProperties->Wnode.HistoricalContext;
167-
}
168168
}
169169

170170
// Enable stack tracing.

0 commit comments

Comments
 (0)