Vincent Povirk : mscoree: Accept old framework build in exe metadata.
Module: wine Branch: stable Commit: 980ce340962c6220c6e3662588e285feeddbd0b5 URL: https://source.winehq.org/git/wine.git/?a=commit;h=980ce340962c6220c6e366258... Author: Vincent Povirk <vincent(a)codeweavers.com> Date: Sat May 4 13:25:58 2019 -0500 mscoree: Accept old framework build in exe metadata. Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=27185 Signed-off-by: Vincent Povirk <vincent(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> (cherry picked from commit 6ee29c048cbbd6291e672a0c9b4ecdf0f770673c) Signed-off-by: Michael Stefaniuc <mstefani(a)winehq.org> --- dlls/mscoree/metahost.c | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) diff --git a/dlls/mscoree/metahost.c b/dlls/mscoree/metahost.c index 422ca3112b..8719baf7ab 100644 --- a/dlls/mscoree/metahost.c +++ b/dlls/mscoree/metahost.c @@ -1336,11 +1336,35 @@ HRESULT get_runtime_info(LPCWSTR exefile, LPCWSTR version, LPCWSTR config_file, if (exefile && !version) { + DWORD major, minor, build; + hr = CLRMetaHost_GetVersionFromFile(0, exefile, local_version, &local_version_size); version = local_version; if (FAILED(hr)) return hr; + + /* When running an executable, specifically when getting the version number from + * the exe, native accepts a matching major.minor with build <= expected build. */ + if (!parse_runtime_version(version, &major, &minor, &build)) + { + ERR("Cannot parse %s\n", debugstr_w(version)); + return CLR_E_SHIM_RUNTIME; + } + + if (legacy) + i = 3; + else + i = NUM_RUNTIMES; + + while (i--) + { + if (runtimes[i].major == major && runtimes[i].minor == minor && runtimes[i].build >= build) + { + return ICLRRuntimeInfo_QueryInterface(&runtimes[i].ICLRRuntimeInfo_iface, + &IID_ICLRRuntimeInfo, (void **)result); + } + } } if (version)
participants (1)
-
Alexandre Julliard