Commit 95258873 authored by Zebediah Figura's avatar Zebediah Figura Committed by Alexandre Julliard

advapi32: Print ReportEvent() messages one line at a time.

.NET Framework passes multiline backtraces to ReportEvent(), which get cut off when passed to debugstr_w().
parent 3939eaf8
...@@ -642,20 +642,34 @@ BOOL WINAPI ReportEventW( HANDLE hEventLog, WORD wType, WORD wCategory, DWORD dw ...@@ -642,20 +642,34 @@ BOOL WINAPI ReportEventW( HANDLE hEventLog, WORD wType, WORD wCategory, DWORD dw
for (i = 0; i < wNumStrings; i++) for (i = 0; i < wNumStrings; i++)
{ {
switch (wType) const WCHAR *line = lpStrings[i];
while (*line)
{ {
case EVENTLOG_SUCCESS: const WCHAR *next = wcschr( line, '\n' );
TRACE_(eventlog)("%s\n", debugstr_w(lpStrings[i]));
break; if (next)
case EVENTLOG_ERROR_TYPE: ++next;
ERR_(eventlog)("%s\n", debugstr_w(lpStrings[i])); else
break; next = line + wcslen( line );
case EVENTLOG_WARNING_TYPE:
WARN_(eventlog)("%s\n", debugstr_w(lpStrings[i])); switch (wType)
break; {
default: case EVENTLOG_SUCCESS:
TRACE_(eventlog)("%s\n", debugstr_w(lpStrings[i])); TRACE_(eventlog)("%s\n", debugstr_wn(line, next - line));
break; break;
case EVENTLOG_ERROR_TYPE:
ERR_(eventlog)("%s\n", debugstr_wn(line, next - line));
break;
case EVENTLOG_WARNING_TYPE:
WARN_(eventlog)("%s\n", debugstr_wn(line, next - line));
break;
default:
TRACE_(eventlog)("%s\n", debugstr_wn(line, next - line));
break;
}
line = next;
} }
} }
return TRUE; return TRUE;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment