Alexandre Julliard : mscoree: Store the Mono base directory in Unicode.

Alexandre Julliard julliard at winehq.org
Mon Nov 18 16:19:17 CST 2019


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

Author: Alexandre Julliard <julliard at winehq.org>
Date:   Sun Nov 17 16:09:37 2019 +0100

mscoree: Store the Mono base directory in Unicode.

---

 dlls/mscoree/metahost.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/dlls/mscoree/metahost.c b/dlls/mscoree/metahost.c
index 18232a4568..4c1e4e97c1 100644
--- a/dlls/mscoree/metahost.c
+++ b/dlls/mscoree/metahost.c
@@ -711,7 +711,7 @@ static BOOL get_mono_path_registry(LPWSTR path)
 static BOOL get_mono_path_dos(const WCHAR *dir, LPWSTR path)
 {
     static const WCHAR unix_prefix[] = {'\\','\\','?','\\','u','n','i','x','\\'};
-    static const char basedir[] = "\\wine-mono-" WINE_MONO_VERSION;
+    static const WCHAR basedir[] = L"\\wine-mono-" WINE_MONO_VERSION;
     LPWSTR dos_dir;
     WCHAR mono_dll_path[MAX_PATH];
     DWORD len;
@@ -720,10 +720,10 @@ static BOOL get_mono_path_dos(const WCHAR *dir, LPWSTR path)
     if (memcmp(dir, unix_prefix, sizeof(unix_prefix)) == 0)
         return FALSE;  /* No drive letter for this directory */
 
-    len = lstrlenW( dir ) + MultiByteToWideChar( CP_UNIXCP, 0, basedir, -1, NULL, 0 );
+    len = lstrlenW( dir ) + lstrlenW( basedir ) + 1;
     if (!(dos_dir = heap_alloc( len * sizeof(WCHAR) ))) return FALSE;
     lstrcpyW( dos_dir, dir );
-    MultiByteToWideChar( CP_UNIXCP, 0, basedir, -1, dos_dir + lstrlenW(dos_dir), len - lstrlenW(dos_dir));
+    lstrcatW( dos_dir, basedir );
 
     ret = find_mono_dll(dos_dir, mono_dll_path);
     if (ret)




More information about the wine-cvs mailing list