Louis Lenders : mscoree: Add stub for CorIsLatestSvc to hint user at broken .NET installation.

Alexandre Julliard julliard at winehq.org
Fri Jul 13 15:01:46 CDT 2018


Module: wine
Branch: master
Commit: 27f2f4199fde170a1ff2b3090506ad3c9e6d1bfa
URL:    https://source.winehq.org/git/wine.git/?a=commit;h=27f2f4199fde170a1ff2b3090506ad3c9e6d1bfa

Author: Louis Lenders <xerox.xerox2000x at gmail.com>
Date:   Wed Jul 11 19:58:54 2018 +0200

mscoree: Add stub for CorIsLatestSvc to hint user at broken .NET installation.

Signed-off-by: Louis Lenders <xerox.xerox2000x at gmail.com>
Signed-off-by: Vincent Povirk <vincent at codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard at winehq.org>

---

 dlls/mscoree/mscoree.spec    |  2 +-
 dlls/mscoree/mscoree_main.c  | 11 +++++++++++
 dlls/mscoree/tests/mscoree.c |  7 ++++++-
 3 files changed, 18 insertions(+), 2 deletions(-)

diff --git a/dlls/mscoree/mscoree.spec b/dlls/mscoree/mscoree.spec
index 3715b7c..ec4668b 100644
--- a/dlls/mscoree/mscoree.spec
+++ b/dlls/mscoree/mscoree.spec
@@ -25,7 +25,7 @@
 @ stub CorDllMainWorker
 @ stdcall CorExitProcess(long)
 @ stub CorGetSvc
-@ stub CorIsLatestSvc
+@ stdcall CorIsLatestSvc(ptr ptr)
 @ stub CorMarkThreadInThreadPool
 @ stub CorTickleSvc
 @ stdcall CreateConfigStream(wstr ptr)
diff --git a/dlls/mscoree/mscoree_main.c b/dlls/mscoree/mscoree_main.c
index 9561405..42f8169 100644
--- a/dlls/mscoree/mscoree_main.c
+++ b/dlls/mscoree/mscoree_main.c
@@ -49,6 +49,7 @@
 #include "wine/debug.h"
 
 WINE_DEFAULT_DEBUG_CHANNEL( mscoree );
+WINE_DECLARE_DEBUG_CHANNEL(winediag);
 
 static HINSTANCE MSCOREE_hInstance;
 
@@ -309,6 +310,16 @@ HRESULT WINAPI GetCORVersion(LPWSTR pbuffer, DWORD cchBuffer, DWORD *dwLength)
     return ret;
 }
 
+HRESULT WINAPI CorIsLatestSvc(int *unk1, int *unk2)
+{
+    ERR_(winediag)("If this function is called, it is likely the result of a broken .NET installation\n");
+
+    if (!unk1 || !unk2)
+        return E_POINTER;
+
+    return S_OK;
+}
+
 HRESULT WINAPI GetRequestedRuntimeInfo(LPCWSTR pExe, LPCWSTR pwszVersion, LPCWSTR pConfigurationFile,
     DWORD startupFlags, DWORD runtimeInfoFlags, LPWSTR pDirectory, DWORD dwDirectory, DWORD *dwDirectoryLength,
     LPWSTR pVersion, DWORD cchBuffer, DWORD *dwlength)
diff --git a/dlls/mscoree/tests/mscoree.c b/dlls/mscoree/tests/mscoree.c
index 63517dc..dd4724d 100644
--- a/dlls/mscoree/tests/mscoree.c
+++ b/dlls/mscoree/tests/mscoree.c
@@ -35,6 +35,7 @@ static const WCHAR v4_0[] = {'v','4','.','0','.','3','0','3','1','9',0};
 static HMODULE hmscoree;
 
 static HRESULT (WINAPI *pGetCORVersion)(LPWSTR, DWORD, DWORD*);
+static HRESULT (WINAPI *pCorIsLatestSvc)(INT*, INT*);
 static HRESULT (WINAPI *pGetCORSystemDirectory)(LPWSTR, DWORD, DWORD*);
 static HRESULT (WINAPI *pGetRequestedRuntimeInfo)(LPCWSTR, LPCWSTR, LPCWSTR, DWORD, DWORD, LPWSTR, DWORD, DWORD*, LPWSTR, DWORD, DWORD*);
 static HRESULT (WINAPI *pLoadLibraryShim)(LPCWSTR, LPCWSTR, LPVOID, HMODULE*);
@@ -55,6 +56,7 @@ static BOOL init_functionpointers(void)
     }
 
     pGetCORVersion = (void *)GetProcAddress(hmscoree, "GetCORVersion");
+    pCorIsLatestSvc = (void *)GetProcAddress(hmscoree, "CorIsLatestSvc");
     pGetCORSystemDirectory = (void *)GetProcAddress(hmscoree, "GetCORSystemDirectory");
     pGetRequestedRuntimeInfo = (void *)GetProcAddress(hmscoree, "GetRequestedRuntimeInfo");
     pLoadLibraryShim = (void *)GetProcAddress(hmscoree, "LoadLibraryShim");
@@ -63,7 +65,7 @@ static BOOL init_functionpointers(void)
     pCLRCreateInstance = (void *)GetProcAddress(hmscoree, "CLRCreateInstance");
 
     if (!pGetCORVersion || !pGetCORSystemDirectory || !pGetRequestedRuntimeInfo || !pLoadLibraryShim ||
-        !pCreateInterface || !pCLRCreateInstance
+        !pCreateInterface || !pCLRCreateInstance || !pCorIsLatestSvc
         )
     {
         win_skip("functions not available\n");
@@ -289,6 +291,9 @@ static void test_versioninfo(void)
     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));
+
+    hr =  pCorIsLatestSvc(NULL, NULL);
+    ok(hr == E_POINTER, "CorIsLatestSvc returned %08x\n", hr);
 }
 
 static void test_loadlibraryshim(void)




More information about the wine-cvs mailing list