From: Alistair Leslie-Hughes Subject: mscoree: Attempt to load the assembly from the application directory Message-Id: <520B1DFF.3010000@hotmail.com> Date: Wed, 14 Aug 2013 16:04:47 +1000 Hi, Changelog: mscoree: Attempt to load the assembly from the application directory Best Regards Alistair Leslie-Hughes From 51309e2809620bea0553932cffe85a3bad8fb024 Mon Sep 17 00:00:00 2001 From: Alistair Leslie-Hughes Date: Wed, 14 Aug 2013 15:59:53 +1000 Subject: [PATCH] Attempt to load the assembly from the application directory To: wine-patches --- dlls/mscoree/corruntimehost.c | 18 ++++++++++++++++-- 1 file changed, 16 insertions(+), 2 deletions(-) diff --git a/dlls/mscoree/corruntimehost.c b/dlls/mscoree/corruntimehost.c index 76b7d65..2795866 100644 --- a/dlls/mscoree/corruntimehost.c +++ b/dlls/mscoree/corruntimehost.c @@ -1241,6 +1241,7 @@ HRESULT create_monodata(REFIID riid, LPVOID *ppObj ) static const WCHAR wszFileSlash[] = {'f','i','l','e',':','/','/','/',0}; static const WCHAR wszCLSIDSlash[] = {'C','L','S','I','D','\\',0}; static const WCHAR wszInprocServer32[] = {'\\','I','n','p','r','o','c','S','e','r','v','e','r','3','2',0}; + static const WCHAR wszDLL[] = {'.','d','l','l',0}; WCHAR path[CHARS_IN_GUID + ARRAYSIZE(wszCLSIDSlash) + ARRAYSIZE(wszInprocServer32) - 1]; MonoDomain *domain; MonoAssembly *assembly; @@ -1310,10 +1311,23 @@ HRESULT create_monodata(REFIID riid, LPVOID *ppObj ) goto cleanup; hr = get_file_from_strongname(codebase, filename, MAX_PATH); if (!SUCCEEDED(hr)) - goto cleanup; + { + WCHAR *ns; + + WARN("Attempt to load from the application directory."); + GetModuleFileNameW(NULL, filename, MAX_PATH); + ns = strrchrW(filename, '\\'); + *(ns+1) = '\0'; + + ns = strrchrW(classname, '.'); + *(ns) = '\0'; + strcatW(filename, classname); + *(ns) = '.'; + strcatW(filename, wszDLL); + } } - TRACE("codebase (%s)\n", debugstr_w(filename)); + TRACE("filename (%s)\n", debugstr_w(filename)); *ppObj = NULL; -- 1.8.1.2