mscoree [2/2]: Add stub implementations of CorBindtoRuntimeHost and GetCORVersion

James Hawkins truiken at gmail.com
Wed Oct 11 19:47:39 CDT 2006


Hi,

The Acid Pro Media Manager sub-installer tried to call these two
functions by calling GetProcAddress.  They don't check the return
value and they crash.  These stubs make the installer succeed.

Changelog:
* Add stub implementations of CorBindtoRuntimeHost and GetCORVersion.

 dlls/mscoree/mscoree.spec   |    4 ++--
 dlls/mscoree/mscoree_main.c |   32 ++++++++++++++++++++++++++++++++
 2 files changed, 34 insertions(+), 2 deletions(-)

-- 
James Hawkins
-------------- next part --------------
diff --git a/dlls/mscoree/mscoree.spec b/dlls/mscoree/mscoree.spec
index a852992..1d37747 100644
--- a/dlls/mscoree/mscoree.spec
+++ b/dlls/mscoree/mscoree.spec
@@ -13,7 +13,7 @@
 47 stub CorBindToRuntimeByPath
 48 stub CorBindToRuntimeByPathEx
 49 stub CorBindToRuntimeEx
-50 stub CorBindToRuntimeHost
+50 stdcall CorBindToRuntimeHost(wstr wstr wstr ptr long ptr ptr ptr)
 25 stub CorDllMainWorker
 51 stub CorExitProcess
 52 stub CorGetSvc
@@ -33,7 +33,7 @@
 65 stub GetCORRequiredVersion
 66 stub GetCORRootDirectory
 67 stub GetCORSystemDirectory
-68 stub GetCORVersion
+68 stdcall GetCORVersion(wstr long ptr)
 69 stub GetCompileInfo
 70 stub GetFileVersion
 71 stub GetHashFromAssemblyFile
diff --git a/dlls/mscoree/mscoree_main.c b/dlls/mscoree/mscoree_main.c
index 2dfc046..3743ff5 100644
--- a/dlls/mscoree/mscoree_main.c
+++ b/dlls/mscoree/mscoree_main.c
@@ -28,6 +28,18 @@ #include "wine/debug.h"
 
 WINE_DEFAULT_DEBUG_CHANNEL( mscoree );
 
+HRESULT WINAPI CorBindToRuntimeHost(LPCWSTR pwszVersion, LPCWSTR pwszBuildFlavor,
+                                    LPCWSTR pwszHostConfigFile, VOID *pReserved,
+                                    DWORD startupFlags, REFCLSID rclsid,
+                                    REFIID riid, LPVOID *ppv)
+{
+    FIXME("(%s, %s, %s, %p, %d, %p, %p, %p): stub!\n", debugstr_w(pwszVersion),
+          debugstr_w(pwszBuildFlavor), debugstr_w(pwszHostConfigFile), pReserved,
+          startupFlags, rclsid, riid, ppv);
+
+    return E_FAIL;
+}
+
 BOOL WINAPI DllMain(HINSTANCE hinstDLL, DWORD fdwReason, LPVOID lpvReserved)
 {
     TRACE("(%p, %d, %p)\n", hinstDLL, fdwReason, lpvReserved);
@@ -83,3 +95,23 @@ DWORD _CorValidateImage(LPCVOID* imageBa
     TRACE("(%p, %s): stub\n", imageBase, debugstr_w(imageName));
     return E_FAIL;
 }
+
+HRESULT WINAPI GetCORVersion(LPWSTR pbuffer, DWORD cchBuffer, DWORD *dwLength)
+{
+    static const WCHAR version[] = {'1','.','1','.','4','3','2','2',0};
+
+    FIXME("(%p, %d, %p): semi-stub!\n", pbuffer, cchBuffer, dwLength);
+
+    if (!dwLength)
+        return E_POINTER;
+
+    *dwLength = lstrlenW(version);
+
+    if (cchBuffer < *dwLength)
+        return ERROR_INSUFFICIENT_BUFFER;
+
+    if (pbuffer)
+        lstrcpyW(pbuffer, version);
+
+    return S_OK;
+}
-- 
1.4.2.1


More information about the wine-patches mailing list