Commit 73ca9d2d authored by Alistair Leslie-Hughes's avatar Alistair Leslie-Hughes Committed by Alexandre Julliard

mscoree: Partially implement ICLRMetaHost RequestRuntimeLoadedNotification.

parent 4ce0f742
...@@ -986,6 +986,8 @@ static const struct IEnumUnknownVtbl InstalledRuntimeEnum_Vtbl = { ...@@ -986,6 +986,8 @@ static const struct IEnumUnknownVtbl InstalledRuntimeEnum_Vtbl = {
struct CLRMetaHost struct CLRMetaHost
{ {
ICLRMetaHost ICLRMetaHost_iface; ICLRMetaHost ICLRMetaHost_iface;
RuntimeLoadedCallbackFnPtr callback;
}; };
static struct CLRMetaHost GlobalCLRMetaHost; static struct CLRMetaHost GlobalCLRMetaHost;
...@@ -1168,9 +1170,16 @@ static HRESULT WINAPI CLRMetaHost_EnumerateLoadedRuntimes(ICLRMetaHost* iface, ...@@ -1168,9 +1170,16 @@ static HRESULT WINAPI CLRMetaHost_EnumerateLoadedRuntimes(ICLRMetaHost* iface,
static HRESULT WINAPI CLRMetaHost_RequestRuntimeLoadedNotification(ICLRMetaHost* iface, static HRESULT WINAPI CLRMetaHost_RequestRuntimeLoadedNotification(ICLRMetaHost* iface,
RuntimeLoadedCallbackFnPtr pCallbackFunction) RuntimeLoadedCallbackFnPtr pCallbackFunction)
{ {
FIXME("%p\n", pCallbackFunction); TRACE("%p\n", pCallbackFunction);
return E_NOTIMPL; if(!pCallbackFunction)
return E_POINTER;
WARN("Callback currently will not be called.\n");
GlobalCLRMetaHost.callback = pCallbackFunction;
return S_OK;
} }
static HRESULT WINAPI CLRMetaHost_QueryLegacyV2RuntimeBinding(ICLRMetaHost* iface, static HRESULT WINAPI CLRMetaHost_QueryLegacyV2RuntimeBinding(ICLRMetaHost* iface,
......
...@@ -142,6 +142,23 @@ static void test_getruntime(void) ...@@ -142,6 +142,23 @@ static void test_getruntime(void)
ok(hr == CLR_E_SHIM_RUNTIME, "GetVersion failed, hr=%x\n", hr); ok(hr == CLR_E_SHIM_RUNTIME, "GetVersion failed, hr=%x\n", hr);
} }
static void WINAPI notification_callback(ICLRRuntimeInfo *pRuntimeInfo, CallbackThreadSetFnPtr pfnCallbackThreadSet,
CallbackThreadUnsetFnPtr pfnCallbackThreadUnset)
{
ok(0, "Unexpected call\n");
}
static void test_notification(void)
{
HRESULT hr;
hr = ICLRMetaHost_RequestRuntimeLoadedNotification(metahost, NULL);
ok(hr == E_POINTER, "GetVersion failed, hr=%x\n", hr);
hr = ICLRMetaHost_RequestRuntimeLoadedNotification(metahost,notification_callback);
ok(hr == S_OK, "GetVersion failed, hr=%x\n", hr);
}
START_TEST(metahost) START_TEST(metahost)
{ {
if (!init_pointers()) if (!init_pointers())
...@@ -150,6 +167,7 @@ START_TEST(metahost) ...@@ -150,6 +167,7 @@ START_TEST(metahost)
test_enumruntimes(); test_enumruntimes();
test_getruntime(); test_getruntime();
test_notification();
cleanup(); cleanup();
} }
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