Alistair Leslie-Hughes <leslie_alistair(a)hotmail.com> writes:
> @@ -99,8 +99,28 @@ static HRESULT WINAPI CorDebug_Terminate(ICorDebug *iface)
> static HRESULT WINAPI CorDebug_SetManagedHandler(ICorDebug *iface, ICorDebugManagedCallback *pCallback)
> {
> RuntimeHost *This = impl_from_ICorDebug( iface );
> - FIXME("stub %p %p\n", This, pCallback);
> - return E_NOTIMPL;
> + HRESULT hr;
> +
> + TRACE("%p (%p)\n", This, pCallback);
> +
> + if(!pCallback)
> + return E_INVALIDARG;
> +
> + if(This->pCallback2)
> + ICorDebugManagedCallback2_Release(This->pCallback2);
> +
> + if(This->pCallback)
> + ICorDebugManagedCallback_Release(This->pCallback);
> +
> + hr = ICorDebugManagedCallback_QueryInterface(pCallback, &IID_ICorDebugManagedCallback2, (void**)&This->pCallback2);
> + if(hr == S_OK)
> + {
> + This->pCallback = pCallback;
> +
> + ICorDebugManagedCallback_AddRef(This->pCallback);
> + }
You can't release the old interfaces before the new ones are in place.
--
Alexandre Julliard
julliard(a)winehq.org