Jacek Caban : wmp: Added IConnectionPointContainer stub implementation.

Alexandre Julliard julliard at winehq.org
Wed Feb 12 13:44:39 CST 2014


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

Author: Jacek Caban <jacek at codeweavers.com>
Date:   Wed Feb 12 11:33:07 2014 +0100

wmp: Added IConnectionPointContainer stub implementation.

---

 dlls/wmp/oleobj.c       |   55 +++++++++++++++++++++++++++++++++++++++++++++++
 dlls/wmp/tests/oleobj.c |    4 ++++
 2 files changed, 59 insertions(+)

diff --git a/dlls/wmp/oleobj.c b/dlls/wmp/oleobj.c
index 773b0b0..26f338a 100644
--- a/dlls/wmp/oleobj.c
+++ b/dlls/wmp/oleobj.c
@@ -17,6 +17,7 @@
  */
 
 #include "wmp_private.h"
+#include "olectl.h"
 
 #include "wine/debug.h"
 
@@ -27,6 +28,7 @@ struct WindowsMediaPlayer {
     IProvideClassInfo2 IProvideClassInfo2_iface;
     IPersistStreamInit IPersistStreamInit_iface;
     IOleInPlaceObjectWindowless IOleInPlaceObjectWindowless_iface;
+    IConnectionPointContainer IConnectionPointContainer_iface;
 
     LONG ref;
 
@@ -78,6 +80,9 @@ static HRESULT WINAPI OleObject_QueryInterface(IOleObject *iface, REFIID riid, v
     }else if(IsEqualGUID(riid, &IID_IOleInPlaceObjectWindowless)) {
         TRACE("(%p)->(IID_IOleInPlaceObjectWindowless %p)\n", This, ppv);
         *ppv = &This->IOleInPlaceObjectWindowless_iface;
+    }else if(IsEqualGUID(riid, &IID_IConnectionPointContainer)) {
+        TRACE("(%p)->(IID_IConnectionPointContainer %p)\n", This, ppv);
+        *ppv = &This->IConnectionPointContainer_iface;
     }else {
         FIXME("(%p)->(%s %p)\n", This, debugstr_guid(riid), ppv);
         *ppv = NULL;
@@ -559,6 +564,55 @@ static const IPersistStreamInitVtbl PersistStreamInitVtbl = {
     PersistStreamInit_InitNew
 };
 
+static inline WindowsMediaPlayer *impl_from_IConnectionPointContainer(IConnectionPointContainer *iface)
+{
+    return CONTAINING_RECORD(iface, WindowsMediaPlayer, IConnectionPointContainer_iface);
+}
+
+static HRESULT WINAPI ConnectionPointContainer_QueryInterface(IConnectionPointContainer *iface,
+        REFIID riid, LPVOID *ppv)
+{
+    WindowsMediaPlayer *This = impl_from_IConnectionPointContainer(iface);
+    return IOleObject_QueryInterface(&This->IOleObject_iface, riid, ppv);
+}
+
+static ULONG WINAPI ConnectionPointContainer_AddRef(IConnectionPointContainer *iface)
+{
+    WindowsMediaPlayer *This = impl_from_IConnectionPointContainer(iface);
+    return IOleObject_AddRef(&This->IOleObject_iface);
+}
+
+static ULONG WINAPI ConnectionPointContainer_Release(IConnectionPointContainer *iface)
+{
+    WindowsMediaPlayer *This = impl_from_IConnectionPointContainer(iface);
+    return IOleObject_Release(&This->IOleObject_iface);
+}
+
+static HRESULT WINAPI ConnectionPointContainer_EnumConnectionPoints(IConnectionPointContainer *iface,
+        IEnumConnectionPoints **ppEnum)
+{
+    WindowsMediaPlayer *This = impl_from_IConnectionPointContainer(iface);
+    FIXME("(%p)->(%p)\n", This, ppEnum);
+    return E_NOTIMPL;
+}
+
+static HRESULT WINAPI ConnectionPointContainer_FindConnectionPoint(IConnectionPointContainer *iface,
+        REFIID riid, IConnectionPoint **ppCP)
+{
+    WindowsMediaPlayer *This = impl_from_IConnectionPointContainer(iface);
+    FIXME("(%p)->(%s %p)\n", This, debugstr_guid(riid), ppCP);
+    return CONNECT_E_NOCONNECTION;
+}
+
+static const IConnectionPointContainerVtbl ConnectionPointContainerVtbl =
+{
+    ConnectionPointContainer_QueryInterface,
+    ConnectionPointContainer_AddRef,
+    ConnectionPointContainer_Release,
+    ConnectionPointContainer_EnumConnectionPoints,
+    ConnectionPointContainer_FindConnectionPoint
+};
+
 HRESULT WINAPI WMPFactory_CreateInstance(IClassFactory *iface, IUnknown *outer,
         REFIID riid, void **ppv)
 {
@@ -575,6 +629,7 @@ HRESULT WINAPI WMPFactory_CreateInstance(IClassFactory *iface, IUnknown *outer,
     wmp->IProvideClassInfo2_iface.lpVtbl = &ProvideClassInfo2Vtbl;
     wmp->IPersistStreamInit_iface.lpVtbl = &PersistStreamInitVtbl;
     wmp->IOleInPlaceObjectWindowless_iface.lpVtbl = &OleInPlaceObjectWindowlessVtbl;
+    wmp->IConnectionPointContainer_iface.lpVtbl = &ConnectionPointContainerVtbl;
 
     wmp->ref = 1;
 
diff --git a/dlls/wmp/tests/oleobj.c b/dlls/wmp/tests/oleobj.c
index 8f2eed2..fba35e5 100644
--- a/dlls/wmp/tests/oleobj.c
+++ b/dlls/wmp/tests/oleobj.c
@@ -626,6 +626,10 @@ static void test_QI(IUnknown *unk)
     hres = IUnknown_QueryInterface(unk, &IID_IOleInPlaceObjectWindowless, (void**)&tmp);
     ok(hres == S_OK, "Could not get IOleInPlaceObjectWindowless iface: %08x\n", hres);
     IUnknown_Release(tmp);
+
+    hres = IUnknown_QueryInterface(unk, &IID_IConnectionPointContainer, (void**)&tmp);
+    ok(hres == S_OK, "Could not get IConnectionPointContainer iface: %08x\n", hres);
+    IUnknown_Release(tmp);
 }
 
 static void test_wmp(void)




More information about the wine-cvs mailing list