mscoree: Use the .NET 4 interfaces to implement CorBindToRuntimeHost.
authorVincent Povirk <vincent@codeweavers.com>
Fri, 1 Oct 2010 20:43:31 +0000 (15:43 -0500)
committerAlexandre Julliard <julliard@winehq.org>
Tue, 9 Nov 2010 16:33:39 +0000 (17:33 +0100)
dlls/mscoree/mscoree_main.c

index e528360db8aed26937b1978e39b56556bfe9e883..d1f43241ee59b6437d66d99e66e703670c99fc23 100644 (file)
@@ -319,17 +319,25 @@ HRESULT WINAPI CorBindToRuntimeHost(LPCWSTR pwszVersion, LPCWSTR pwszBuildFlavor
                                     DWORD startupFlags, REFCLSID rclsid,
                                     REFIID riid, LPVOID *ppv)
 {
-    FIXME("(%s, %s, %s, %p, %d, %s, %s, %p): semi-stub!\n", debugstr_w(pwszVersion),
+    HRESULT ret;
+    ICLRRuntimeInfo *info;
+
+    TRACE("(%s, %s, %s, %p, %d, %s, %s, %p)\n", debugstr_w(pwszVersion),
           debugstr_w(pwszBuildFlavor), debugstr_w(pwszHostConfigFile), pReserved,
           startupFlags, debugstr_guid(rclsid), debugstr_guid(riid), ppv);
 
-    if (!get_mono_path(NULL))
+    *ppv = NULL;
+
+    ret = get_runtime_info(NULL, pwszVersion, pwszHostConfigFile, startupFlags, 0, TRUE, &info);
+
+    if (SUCCEEDED(ret))
     {
-        MESSAGE("wine: Install the Windows version of Mono to run .NET executables\n");
-        return E_FAIL;
+        ret = ICLRRuntimeInfo_GetInterface(info, rclsid, riid, ppv);
+
+        ICLRRuntimeInfo_Release(info);
     }
 
-    return S_OK;
+    return ret;
 }
 
 BOOL WINAPI DllMain(HINSTANCE hinstDLL, DWORD fdwReason, LPVOID lpvReserved)