[PATCH 2/2 v3] mscoree: add stub for CorGetSvc to hint user at broken .Net installation, and show some tips to correct this.
Louis Lenders
xerox.xerox2000x at gmail.com
Wed Jul 11 03:07:17 CDT 2018
v3: no changes
See bug https://www.winehq.org/pipermail/wine-bugs/2018-July/494631.html.
This patch shows users some hints to fix broken .Net installation, instead of crashing and leaving user in the dark
Signed-off-by: Louis Lenders <xerox.xerox2000x at gmail.com>
---
dlls/mscoree/mscoree.spec | 2 +-
dlls/mscoree/mscoree_main.c | 22 ++++++++++++++++++++++
2 files changed, 23 insertions(+), 1 deletion(-)
diff --git a/dlls/mscoree/mscoree.spec b/dlls/mscoree/mscoree.spec
index ec4668bc3c..7fa68bf8b1 100644
--- a/dlls/mscoree/mscoree.spec
+++ b/dlls/mscoree/mscoree.spec
@@ -24,7 +24,7 @@
@ stdcall CorBindToRuntimeHost(wstr wstr wstr ptr long ptr ptr ptr)
@ stub CorDllMainWorker
@ stdcall CorExitProcess(long)
-@ stub CorGetSvc
+@ stdcall CorGetSvc(ptr)
@ stdcall CorIsLatestSvc(ptr ptr)
@ stub CorMarkThreadInThreadPool
@ stub CorTickleSvc
diff --git a/dlls/mscoree/mscoree_main.c b/dlls/mscoree/mscoree_main.c
index f3ea417f9e..4e3898aab7 100644
--- a/dlls/mscoree/mscoree_main.c
+++ b/dlls/mscoree/mscoree_main.c
@@ -319,6 +319,28 @@ HRESULT WINAPI CorIsLatestSvc(int *unk1, int *unk2)
return S_OK;
}
+HRESULT WINAPI CorGetSvc(IUnknown **pIUnknown)
+{
+ typedef INT (WINAPI *MessageBoxA)(HWND,LPCSTR,LPCSTR,UINT);
+ HMODULE hUser32 = LoadLibraryA("user32");
+ MessageBoxA pMessageBoxA = (void *)GetProcAddress(hUser32, "MessageBoxA");
+
+ FIXME("%p stub\n",pIUnknown);
+ if (pMessageBoxA)
+ {
+ pMessageBoxA(NULL,
+ "Something is broken in your .Net installation.\n"
+ "Apparently you tried to run an app with MS .NET Framework but have Wine-Mono installed. "
+ "Please use 'winetricks' to install .NET Frameworks "
+ "and redo the installation in a new WINEPREFIX.\n",
+ "Wine: Unimplemented CorGetSvc",
+ 0x10);
+ ExitProcess(1);
+
+ }
+ 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)
--
2.17.1
More information about the wine-devel
mailing list