Commit b8c7dec6 authored by Vincent Povirk's avatar Vincent Povirk Committed by Alexandre Julliard

mscoree: Add a setting to access mono's tracing functionality.

parent 929bac96
......@@ -144,6 +144,11 @@ __int32 WINAPI _CorExeMain(void)
PROCESS_INFORMATION pi;
WCHAR *mono_exe, *cmd_line;
DWORD size, exit_code;
static const WCHAR WINE_MONO_TRACE[]={'W','I','N','E','_','M','O','N','O','_','T','R','A','C','E',0};
static const WCHAR trace_switch_start[]={'"','-','-','t','r','a','c','e','=',0};
static const WCHAR trace_switch_end[]={'"',' ',0};
int trace_size;
WCHAR trace_setting[256];
if (!(mono_exe = get_mono_exe()))
{
......@@ -151,7 +156,13 @@ __int32 WINAPI _CorExeMain(void)
return -1;
}
trace_size = GetEnvironmentVariableW(WINE_MONO_TRACE, trace_setting, sizeof(trace_setting)/sizeof(WCHAR));
size = (lstrlenW(mono_exe) + lstrlenW(GetCommandLineW()) + 1) * sizeof(WCHAR);
if (trace_size)
size += (trace_size + lstrlenW(trace_switch_start) + lstrlenW(trace_switch_end)) * sizeof(WCHAR);
if (!(cmd_line = HeapAlloc(GetProcessHeap(), 0, size)))
{
HeapFree(GetProcessHeap(), 0, mono_exe);
......@@ -160,6 +171,14 @@ __int32 WINAPI _CorExeMain(void)
lstrcpyW(cmd_line, mono_exe);
HeapFree(GetProcessHeap(), 0, mono_exe);
if (trace_size)
{
lstrcatW(cmd_line, trace_switch_start);
lstrcatW(cmd_line, trace_setting);
lstrcatW(cmd_line, trace_switch_end);
}
lstrcatW(cmd_line, GetCommandLineW());
TRACE("new command line: %s\n", debugstr_w(cmd_line));
......
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