mscoree: Search for an arch-specific mono dll first.
Vincent Povirk
madewokherd at gmail.com
Mon Mar 19 12:59:05 CDT 2012
-------------- next part --------------
From 4aa53451cb7625c85a2e5b43ea358efda860080e Mon Sep 17 00:00:00 2001
From: Vincent Povirk <vincent at codeweavers.com>
Date: Mon, 19 Mar 2012 12:54:55 -0500
Subject: [PATCH] mscoree: Search for an arch-specific mono dll first.
This makes it possible to use a single mono tree for multiple architectures.
---
dlls/mscoree/metahost.c | 17 ++++++++++++++++-
1 files changed, 16 insertions(+), 1 deletions(-)
diff --git a/dlls/mscoree/metahost.c b/dlls/mscoree/metahost.c
index e15a638..f915d73 100644
--- a/dlls/mscoree/metahost.c
+++ b/dlls/mscoree/metahost.c
@@ -564,6 +564,14 @@ HRESULT ICLRRuntimeInfo_GetRuntimeHost(ICLRRuntimeInfo *iface, RuntimeHost **res
return CLRRuntimeInfo_GetRuntimeHost(This, result);
}
+#ifdef __i386__
+static const WCHAR libmono2_arch_dll[] = {'\\','b','i','n','\\','l','i','b','m','o','n','o','-','2','.','0','-','x','8','6','.','d','l','l',0};
+#elif defined(__x86_64__)
+static const WCHAR libmono2_arch_dll[] = {'\\','b','i','n','\\','l','i','b','m','o','n','o','-','2','.','0','-','x','8','6','_','6','4','.','d','l','l',0};
+#else
+static const WCHAR libmono2_arch_dll[] = {'\\','b','i','n','\\','l','i','b','m','o','n','o','-','2','.','0','.','d','l','l',0};
+#endif
+
static BOOL find_mono_dll(LPCWSTR path, LPWSTR dll_path, int abi_version)
{
static const WCHAR mono_dll[] = {'\\','b','i','n','\\','m','o','n','o','.','d','l','l',0};
@@ -588,12 +596,19 @@ static BOOL find_mono_dll(LPCWSTR path, LPWSTR dll_path, int abi_version)
else if (abi_version == 2)
{
strcpyW(dll_path, path);
- strcatW(dll_path, mono2_dll);
+ strcatW(dll_path, libmono2_arch_dll);
attributes = GetFileAttributesW(dll_path);
if (attributes == INVALID_FILE_ATTRIBUTES)
{
strcpyW(dll_path, path);
+ strcatW(dll_path, mono2_dll);
+ attributes = GetFileAttributesW(dll_path);
+ }
+
+ if (attributes == INVALID_FILE_ATTRIBUTES)
+ {
+ strcpyW(dll_path, path);
strcatW(dll_path, libmono2_dll);
attributes = GetFileAttributesW(dll_path);
}
--
1.7.9.1
More information about the wine-patches
mailing list