mscoree: Better support RUNTIME_INFO_UPGRADE_VERSION in, GetRequestedRuntimeInfo (try 3)

Alistair Leslie-Hughes leslie_alistair at hotmail.com
Mon Mar 12 04:37:49 CDT 2012


Hi,
Fall through if GetRuntime failed. Thanks Vincent

Changelog:
       mscoree: Better support RUNTIME_INFO_UPGRADE_VERSION in
    GetRequestedRuntimeInfo


Best Regards
    Alistair Leslie-Hughes


-------------- next part --------------
>From f08e30b441b18e28dde01ee100b3ee0d83855035 Mon Sep 17 00:00:00 2001
From: Alistair Leslie-Hughes <leslie_alistair at hotmail.com>
Date: Mon, 12 Mar 2012 16:15:31 +1100
Subject: [PATCH] Better support RUNTIME_INFO_UPGRADE_VERSION in,
 GetRequestedRuntimeInfo
To: wine-patches <wine-patches at winehq.org>

---
 dlls/mscoree/metahost.c      |    6 ++++--
 dlls/mscoree/tests/mscoree.c |   21 +++++++++++++++++++++
 2 files changed, 25 insertions(+), 2 deletions(-)

diff --git a/dlls/mscoree/metahost.c b/dlls/mscoree/metahost.c
index 49fb0ee..3087eca 100644
--- a/dlls/mscoree/metahost.c
+++ b/dlls/mscoree/metahost.c
@@ -1041,7 +1041,7 @@ HRESULT WINAPI CLRMetaHost_GetRuntime(ICLRMetaHost* iface,
         }
     }
 
-    FIXME("Unrecognized version %s\n", debugstr_w(pwzVersion));
+    WARN("Unrecognized version %s\n", debugstr_w(pwzVersion));
     return CLR_E_SHIM_RUNTIME;
 }
 
@@ -1310,7 +1310,9 @@ HRESULT get_runtime_info(LPCWSTR exefile, LPCWSTR version, LPCWSTR config_file,
 
     if (version)
     {
-        return CLRMetaHost_GetRuntime(0, version, &IID_ICLRRuntimeInfo, (void**)result);
+        hr = CLRMetaHost_GetRuntime(0, version, &IID_ICLRRuntimeInfo, (void**)result);
+        if(SUCCEEDED(hr))
+            return hr;
     }
 
     if (runtimeinfo_flags & RUNTIME_INFO_UPGRADE_VERSION)
diff --git a/dlls/mscoree/tests/mscoree.c b/dlls/mscoree/tests/mscoree.c
index 56351c3..ecf1fa7 100644
--- a/dlls/mscoree/tests/mscoree.c
+++ b/dlls/mscoree/tests/mscoree.c
@@ -61,7 +61,9 @@ static BOOL init_functionpointers(void)
 static void test_versioninfo(void)
 {
     const WCHAR v2_0[] = {'v','2','.','0','.','5','0','7','2','7',0};
+    const WCHAR v2_0_0[] = {'v','2','.','0','.','0',0};
     const WCHAR v1_1[] = {'v','1','.','1','.','4','3','2','2',0};
+    const WCHAR v1_1_0[] = {'v','1','.','1','.','0',0};
 
     WCHAR version[MAX_PATH];
     WCHAR path[MAX_PATH];
@@ -143,6 +145,25 @@ static void test_versioninfo(void)
     hr = pGetRequestedRuntimeInfo( NULL, v2_0, NULL, 0, 0, path, MAX_PATH, &path_len, version, MAX_PATH, NULL);
     ok(hr == S_OK, "GetRequestedRuntimeInfo returned %08x\n", hr);
     ok(!winetest_strcmpW(version, v2_0), "version is %s , expected %s\n", wine_dbgstr_w(version), wine_dbgstr_w(v2_0));
+
+    /*Invalid Version and RUNTIME_INFO_UPGRADE_VERSION flag*/
+    memset(version, 0, sizeof(version));
+    hr = pGetRequestedRuntimeInfo( NULL, v1_1_0, NULL, 0, 0, path, MAX_PATH, &path_len, version, MAX_PATH, NULL);
+    ok(hr == CLR_E_SHIM_RUNTIME, "GetRequestedRuntimeInfo returned %08x\n", hr);
+
+    memset(version, 0, sizeof(version));
+    hr = pGetRequestedRuntimeInfo( NULL, v1_1_0, NULL, 0, RUNTIME_INFO_UPGRADE_VERSION, path, MAX_PATH, &path_len, version, MAX_PATH, NULL);
+    ok(hr == S_OK, "GetRequestedRuntimeInfo returned %08x\n", hr);
+    ok(!winetest_strcmpW(version, v2_0), "version is %s , expected %s\n", wine_dbgstr_w(version), wine_dbgstr_w(v2_0));
+
+    memset(version, 0, sizeof(version));
+    hr = pGetRequestedRuntimeInfo( NULL, v2_0_0, NULL, 0, 0, path, MAX_PATH, &path_len, version, MAX_PATH, NULL);
+    ok(hr == CLR_E_SHIM_RUNTIME, "GetRequestedRuntimeInfo returned %08x\n", hr);
+
+    memset(version, 0, sizeof(version));
+    hr = pGetRequestedRuntimeInfo( NULL, v2_0_0, NULL, 0, RUNTIME_INFO_UPGRADE_VERSION, path, MAX_PATH, &path_len, version, MAX_PATH, NULL);
+    ok(hr == S_OK, "GetRequestedRuntimeInfo returned %08x\n", hr);
+    ok(!winetest_strcmpW(version, v2_0), "version is %s , expected %s\n", wine_dbgstr_w(version), wine_dbgstr_w(v2_0));
 }
 
 static void test_loadlibraryshim(void)
-- 
1.7.5.4



More information about the wine-patches mailing list