diff --git a/dlls/wmp/oleobj.c b/dlls/wmp/oleobj.c index d5c2f85fc19..650682493f6 100644 --- a/dlls/wmp/oleobj.c +++ b/dlls/wmp/oleobj.c @@ -137,8 +137,11 @@ static HRESULT WINAPI OleObject_SetClientSite(IOleObject *iface, IOleClientSite static HRESULT WINAPI OleObject_GetClientSite(IOleObject *iface, IOleClientSite **ppClientSite) { WindowsMediaPlayer *This = impl_from_IOleObject(iface); - FIXME("(%p)->(%p)\n", This, ppClientSite); - return E_NOTIMPL; + + TRACE("(%p)->(%p)\n", This, ppClientSite); + + *ppClientSite = This->client_site; + return This->client_site ? S_OK : E_FAIL; } static HRESULT WINAPI OleObject_SetHostNames(IOleObject *iface, LPCOLESTR szContainerApp, LPCOLESTR szContainerObj) diff --git a/dlls/wmp/tests/oleobj.c b/dlls/wmp/tests/oleobj.c index 8578780ec29..c8fb5a30472 100644 --- a/dlls/wmp/tests/oleobj.c +++ b/dlls/wmp/tests/oleobj.c @@ -627,6 +627,7 @@ static void test_QI(IUnknown *unk) static void test_wmp(void) { IProvideClassInfo2 *class_info; + IOleClientSite *client_site; IPersistStreamInit *psi; IOleObject *oleobj; GUID guid; @@ -667,9 +668,19 @@ static void test_wmp(void) todo_wine CHECK_CALLED(GetWindow); todo_wine CHECK_CALLED(Invoke_USERMODE); + client_site = NULL; + hres = IOleObject_GetClientSite(oleobj, &client_site); + ok(hres == S_OK, "GetClientSite failed: %08x\n", hres); + ok(client_site == &ClientSite, "client_site != ClientSite\n"); + hres = IOleObject_SetClientSite(oleobj, NULL); ok(hres == S_OK, "SetClientSite failed: %08x\n", hres); + client_site = (void*)0xdeadbeef; + hres = IOleObject_GetClientSite(oleobj, &client_site); + ok(hres == E_FAIL, "GetClientSite failed: %08x\n", hres); + ok(!client_site, "client_site = %p\n", client_site); + ref = IOleObject_Release(oleobj); ok(!ref, "ref = %d\n", ref); }