From 5ed7007451f8f4906a36ae29eb880650d81629af Mon Sep 17 00:00:00 2001 From: Vincent Povirk Date: Fri, 1 Oct 2010 16:05:36 -0500 Subject: [PATCH 05/18] mscoree: Support searching for .NET runtimes by exe file. --- dlls/mscoree/metahost.c | 15 ++++++++++++--- 1 files changed, 12 insertions(+), 3 deletions(-) diff --git a/dlls/mscoree/metahost.c b/dlls/mscoree/metahost.c index 5506946..17554a9 100644 --- a/dlls/mscoree/metahost.c +++ b/dlls/mscoree/metahost.c @@ -925,9 +925,9 @@ HRESULT get_runtime_info(LPCWSTR exefile, LPCWSTR version, LPCWSTR config_file, static const DWORD supported_startup_flags = 0; static const DWORD supported_runtime_flags = RUNTIME_INFO_UPGRADE_VERSION; int i; - - if (exefile) - FIXME("ignoring exe filename %s\n", debugstr_w(exefile)); + WCHAR local_version[MAX_PATH]; + ULONG local_version_size = MAX_PATH; + HRESULT hr; if (config_file) FIXME("ignoring config filename %s\n", debugstr_w(config_file)); @@ -938,6 +938,15 @@ HRESULT get_runtime_info(LPCWSTR exefile, LPCWSTR version, LPCWSTR config_file, if (runtimeinfo_flags & ~supported_runtime_flags) FIXME("unsupported runtimeinfo flags %x\n", runtimeinfo_flags & ~supported_runtime_flags); + if (exefile && !version) + { + hr = CLRMetaHost_GetVersionFromFile(0, exefile, local_version, &local_version_size); + + version = local_version; + + if (FAILED(hr)) return hr; + } + if (version) { return CLRMetaHost_GetRuntime(0, version, &IID_ICLRRuntimeInfo, (void**)result); -- 1.7.1