Jacek Caban : wmp: Added GetClientSite implementation.

Alexandre Julliard julliard at winehq.org
Mon Feb 10 13:06:56 CST 2014


Module: wine
Branch: master
Commit: 83c45eaa3ce8e9ac69c7b160445dab54267997cf
URL:    http://source.winehq.org/git/wine.git/?a=commit;h=83c45eaa3ce8e9ac69c7b160445dab54267997cf

Author: Jacek Caban <jacek at codeweavers.com>
Date:   Mon Feb 10 11:51:12 2014 +0100

wmp: Added GetClientSite implementation.

---

 dlls/wmp/oleobj.c       |    7 +++++--
 dlls/wmp/tests/oleobj.c |   11 +++++++++++
 2 files changed, 16 insertions(+), 2 deletions(-)

diff --git a/dlls/wmp/oleobj.c b/dlls/wmp/oleobj.c
index d5c2f85..6506824 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 8578780..c8fb5a3 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);
 }




More information about the wine-cvs mailing list