mscoree: Don't modify the PATH environment variable.

Vincent Povirk madewokherd at gmail.com
Thu Sep 3 15:49:15 CDT 2015


For bug 36732.

Wine Mono 4.5.4 eliminated the need for this.
-------------- next part --------------
From db3e8e190567ca394ed57495cb8b287631622add Mon Sep 17 00:00:00 2001
From: Vincent Povirk <vincent at codeweavers.com>
Date: Thu, 3 Sep 2015 15:44:24 -0500
Subject: [PATCH] mscoree: Don't modify the PATH environment variable.

---
 dlls/mscoree/metahost.c | 22 +---------------------
 1 file changed, 1 insertion(+), 21 deletions(-)

diff --git a/dlls/mscoree/metahost.c b/dlls/mscoree/metahost.c
index fb0068d..5e32ecb 100644
--- a/dlls/mscoree/metahost.c
+++ b/dlls/mscoree/metahost.c
@@ -111,21 +111,6 @@ static MonoAssembly* mono_assembly_preload_hook_fn(MonoAssemblyName *aname, char
 
 static void mono_shutdown_callback_fn(MonoProfiler *prof);
 
-static void set_environment(LPCWSTR bin_path)
-{
-    WCHAR path_env[MAX_PATH];
-    int len;
-
-    static const WCHAR pathW[] = {'P','A','T','H',0};
-
-    /* We have to modify PATH as Mono loads other DLLs from this directory. */
-    GetEnvironmentVariableW(pathW, path_env, sizeof(path_env)/sizeof(WCHAR));
-    len = strlenW(path_env);
-    path_env[len++] = ';';
-    strcpyW(path_env+len, bin_path);
-    SetEnvironmentVariableW(pathW, path_env);
-}
-
 static MonoImage* CDECL image_open_module_handle_dummy(HMODULE module_handle,
     char* fname, UINT has_entry_point, MonoImageOpenStatus* status)
 {
@@ -139,10 +124,9 @@ static void missing_runtime_message(void)
 
 static HRESULT load_mono(LPCWSTR mono_path)
 {
-    static const WCHAR bin[] = {'\\','b','i','n',0};
     static const WCHAR lib[] = {'\\','l','i','b',0};
     static const WCHAR etc[] = {'\\','e','t','c',0};
-    WCHAR mono_dll_path[MAX_PATH+16], mono_bin_path[MAX_PATH+4];
+    WCHAR mono_dll_path[MAX_PATH+16];
     WCHAR mono_lib_path[MAX_PATH+4], mono_etc_path[MAX_PATH+4];
     char mono_lib_path_a[MAX_PATH], mono_etc_path_a[MAX_PATH];
     int trace_size;
@@ -158,10 +142,6 @@ static HRESULT load_mono(LPCWSTR mono_path)
 
     if (!mono_handle)
     {
-        strcpyW(mono_bin_path, mono_path);
-        strcatW(mono_bin_path, bin);
-        set_environment(mono_bin_path);
-
         strcpyW(mono_lib_path, mono_path);
         strcatW(mono_lib_path, lib);
         WideCharToMultiByte(CP_UTF8, 0, mono_lib_path, -1, mono_lib_path_a, MAX_PATH, NULL, NULL);
-- 
2.1.4



More information about the wine-patches mailing list