mscoree: Partially implement ICLRMetaHost RequestRuntimeLoadedNotification.
This commit is contained in:
parent
4ce0f74249
commit
73ca9d2d0b
|
@ -986,6 +986,8 @@ static const struct IEnumUnknownVtbl InstalledRuntimeEnum_Vtbl = {
|
|||
struct CLRMetaHost
|
||||
{
|
||||
ICLRMetaHost ICLRMetaHost_iface;
|
||||
|
||||
RuntimeLoadedCallbackFnPtr callback;
|
||||
};
|
||||
|
||||
static struct CLRMetaHost GlobalCLRMetaHost;
|
||||
|
@ -1168,9 +1170,16 @@ static HRESULT WINAPI CLRMetaHost_EnumerateLoadedRuntimes(ICLRMetaHost* iface,
|
|||
static HRESULT WINAPI CLRMetaHost_RequestRuntimeLoadedNotification(ICLRMetaHost* iface,
|
||||
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,
|
||||
|
|
|
@ -142,6 +142,23 @@ static void test_getruntime(void)
|
|||
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)
|
||||
{
|
||||
if (!init_pointers())
|
||||
|
@ -150,6 +167,7 @@ START_TEST(metahost)
|
|||
test_enumruntimes();
|
||||
|
||||
test_getruntime();
|
||||
test_notification();
|
||||
|
||||
cleanup();
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue