Commit 601b240f authored by Vincent Povirk's avatar Vincent Povirk Committed by Alexandre Julliard

mscoree: Use the .NET 4 interfaces to implement CorBindToRuntimeEx.

parent 84ef0fca
......@@ -42,7 +42,6 @@ struct RuntimeHost
const CLRRuntimeInfo *version;
const loaded_mono *mono;
LONG ref;
BOOL legacy; /* if True, this was created by create_corruntimehost, and Release frees it */
};
static inline RuntimeHost *impl_from_ICorRuntimeHost( ICorRuntimeHost *iface )
......@@ -86,10 +85,6 @@ static ULONG WINAPI corruntimehost_Release(ICorRuntimeHost* iface)
ULONG ref;
ref = InterlockedDecrement( &This->ref );
if ( ref == 0 && This->legacy )
{
RuntimeHost_Destroy(This);
}
return ref;
}
......@@ -289,7 +284,6 @@ HRESULT RuntimeHost_Construct(const CLRRuntimeInfo *runtime_version,
This->ref = 1;
This->version = runtime_version;
This->mono = loaded_mono;
This->legacy = FALSE;
*result = This;
......@@ -318,24 +312,3 @@ HRESULT RuntimeHost_Destroy(RuntimeHost *This)
HeapFree( GetProcessHeap(), 0, This );
return S_OK;
}
IUnknown* create_corruntimehost(void)
{
RuntimeHost *This;
IUnknown *result;
if (FAILED(RuntimeHost_Construct(NULL, NULL, &This)))
return NULL;
This->legacy = TRUE;
if (FAILED(RuntimeHost_GetInterface(This, &CLSID_CorRuntimeHost, &IID_IUnknown, (void**)&result)))
{
RuntimeHost_Destroy(This);
return NULL;
}
FIXME("return iface %p\n", result);
return result;
}
......@@ -628,16 +628,24 @@ HRESULT WINAPI LoadStringRC(UINT resId, LPWSTR pBuffer, int iBufLen, int bQuiet)
HRESULT WINAPI CorBindToRuntimeEx(LPWSTR szVersion, LPWSTR szBuildFlavor, DWORD nflags, REFCLSID rslsid,
REFIID riid, LPVOID *ppv)
{
FIXME("%s %s %d %s %s %p\n", debugstr_w(szVersion), debugstr_w(szBuildFlavor), nflags, debugstr_guid( rslsid ),
HRESULT ret;
ICLRRuntimeInfo *info;
TRACE("%s %s %d %s %s %p\n", debugstr_w(szVersion), debugstr_w(szBuildFlavor), nflags, debugstr_guid( rslsid ),
debugstr_guid( riid ), ppv);
if(IsEqualGUID( riid, &IID_ICorRuntimeHost ))
*ppv = NULL;
ret = get_runtime_info(NULL, szVersion, NULL, nflags, 0, TRUE, &info);
if (SUCCEEDED(ret))
{
*ppv = create_corruntimehost();
return S_OK;
ret = ICLRRuntimeInfo_GetInterface(info, rslsid, riid, ppv);
ICLRRuntimeInfo_Release(info);
}
*ppv = NULL;
return E_NOTIMPL;
return ret;
}
HRESULT WINAPI CorBindToCurrentRuntime(LPCWSTR filename, REFCLSID rclsid, REFIID riid, LPVOID *ppv)
......
......@@ -20,8 +20,6 @@
#ifndef __MSCOREE_PRIVATE__
#define __MSCOREE_PRIVATE__
extern IUnknown* create_corruntimehost(void);
extern HRESULT CLRMetaHost_CreateInstance(REFIID riid, void **ppobj);
typedef struct tagASSEMBLY ASSEMBLY;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment