Vincent Povirk : mscoree: Accept "v4.0" as a runtime version in config files.

Alexandre Julliard julliard at wine.codeweavers.com
Tue Jul 15 15:52:43 CDT 2014


Module: wine
Branch: master
Commit: 805da6bf838158b81a7e1b3d00ae7d983268c3c1
URL:    http://source.winehq.org/git/wine.git/?a=commit;h=805da6bf838158b81a7e1b3d00ae7d983268c3c1

Author: Vincent Povirk <vincent at codeweavers.com>
Date:   Mon Jul 14 15:55:18 2014 -0500

mscoree: Accept "v4.0" as a runtime version in config files.

---

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

diff --git a/dlls/mscoree/metahost.c b/dlls/mscoree/metahost.c
index 61bd89e..2383068 100644
--- a/dlls/mscoree/metahost.c
+++ b/dlls/mscoree/metahost.c
@@ -981,14 +981,12 @@ static BOOL parse_runtime_version(LPCWSTR version, DWORD *major, DWORD *minor, D
         return FALSE;
 }
 
-HRESULT WINAPI CLRMetaHost_GetRuntime(ICLRMetaHost* iface,
-    LPCWSTR pwzVersion, REFIID iid, LPVOID *ppRuntime)
+static HRESULT get_runtime(LPCWSTR pwzVersion, BOOL allow_short,
+    REFIID iid, LPVOID *ppRuntime)
 {
     int i;
     DWORD major, minor, build;
 
-    TRACE("%s %s %p\n", debugstr_w(pwzVersion), debugstr_guid(iid), ppRuntime);
-
     if (!pwzVersion)
         return E_POINTER;
 
@@ -1003,7 +1001,7 @@ HRESULT WINAPI CLRMetaHost_GetRuntime(ICLRMetaHost* iface,
     for (i=0; i<NUM_RUNTIMES; i++)
     {
         if (runtimes[i].major == major && runtimes[i].minor == minor &&
-            runtimes[i].build == build)
+            (runtimes[i].build == build || (allow_short && major >= 4 && build == 0)))
         {
             if (runtimes[i].found)
                 return ICLRRuntimeInfo_QueryInterface(&runtimes[i].ICLRRuntimeInfo_iface, iid,
@@ -1020,6 +1018,14 @@ HRESULT WINAPI CLRMetaHost_GetRuntime(ICLRMetaHost* iface,
     return CLR_E_SHIM_RUNTIME;
 }
 
+HRESULT WINAPI CLRMetaHost_GetRuntime(ICLRMetaHost* iface,
+    LPCWSTR pwzVersion, REFIID iid, LPVOID *ppRuntime)
+{
+    TRACE("%s %s %p\n", debugstr_w(pwzVersion), debugstr_guid(iid), ppRuntime);
+
+    return get_runtime(pwzVersion, FALSE, iid, ppRuntime);
+}
+
 HRESULT WINAPI CLRMetaHost_GetVersionFromFile(ICLRMetaHost* iface,
     LPCWSTR pwzFilePath, LPWSTR pwzBuffer, DWORD *pcchBuffer)
 {
@@ -1389,7 +1395,7 @@ HRESULT get_runtime_info(LPCWSTR exefile, LPCWSTR version, LPCWSTR config_file,
             supported_runtime *entry;
             LIST_FOR_EACH_ENTRY(entry, &parsed_config.supported_runtimes, supported_runtime, entry)
             {
-                hr = CLRMetaHost_GetRuntime(0, entry->version, &IID_ICLRRuntimeInfo, (void**)result);
+                hr = get_runtime(entry->version, TRUE, &IID_ICLRRuntimeInfo, (void**)result);
                 if (SUCCEEDED(hr))
                 {
                     found = TRUE;




More information about the wine-cvs mailing list