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

Alexandre Julliard julliard at winehq.org
Wed Mar 24 15:54:45 CDT 2010


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

Author: Vincent Povirk <vincent at codeweavers.com>
Date:   Wed Mar 24 13:35:57 2010 -0500

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

---

 dlls/mscoree/mscoree_main.c |   19 +++++++++++++++++++
 1 files changed, 19 insertions(+), 0 deletions(-)

diff --git a/dlls/mscoree/mscoree_main.c b/dlls/mscoree/mscoree_main.c
index dcdc91a..f9d8070 100644
--- a/dlls/mscoree/mscoree_main.c
+++ b/dlls/mscoree/mscoree_main.c
@@ -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));




More information about the wine-cvs mailing list