Zebediah Figura : quartz/filtergraph: Implement the IDispatch methods for IMediaControl.

Alexandre Julliard julliard at winehq.org
Wed Feb 2 16:38:02 CST 2022


Module: wine
Branch: master
Commit: e68a1009ad0f2f07b56113bb285695d50c912c86
URL:    https://source.winehq.org/git/wine.git/?a=commit;h=e68a1009ad0f2f07b56113bb285695d50c912c86

Author: Zebediah Figura <z.figura12 at gmail.com>
Date:   Tue Feb  1 22:37:42 2022 -0600

quartz/filtergraph: Implement the IDispatch methods for IMediaControl.

Signed-off-by: Zebediah Figura <zfigura at codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard at winehq.org>

---

 dlls/quartz/filtergraph.c | 57 ++++++++++++++++++++++++++---------------------
 1 file changed, 31 insertions(+), 26 deletions(-)

diff --git a/dlls/quartz/filtergraph.c b/dlls/quartz/filtergraph.c
index d20687c1b38..a98b0360e20 100644
--- a/dlls/quartz/filtergraph.c
+++ b/dlls/quartz/filtergraph.c
@@ -1650,47 +1650,52 @@ static ULONG WINAPI MediaControl_Release(IMediaControl *iface)
 
 }
 
-/*** IDispatch methods ***/
-static HRESULT WINAPI MediaControl_GetTypeInfoCount(IMediaControl *iface, UINT *pctinfo)
+static HRESULT WINAPI MediaControl_GetTypeInfoCount(IMediaControl *iface, UINT *count)
 {
-    struct filter_graph *This = impl_from_IMediaControl(iface);
-
-    TRACE("(%p/%p)->(%p): stub !!!\n", This, iface, pctinfo);
-
+    TRACE("iface %p, count %p.\n", iface, count);
+    *count = 1;
     return S_OK;
 }
 
-static HRESULT WINAPI MediaControl_GetTypeInfo(IMediaControl *iface, UINT iTInfo, LCID lcid,
-        ITypeInfo **ppTInfo)
+static HRESULT WINAPI MediaControl_GetTypeInfo(IMediaControl *iface, UINT index,
+        LCID lcid, ITypeInfo **typeinfo)
 {
-    struct filter_graph *This = impl_from_IMediaControl(iface);
-
-    TRACE("(%p/%p)->(%d, %d, %p): stub !!!\n", This, iface, iTInfo, lcid, ppTInfo);
-
-    return S_OK;
+    TRACE("iface %p, index %u, lcid %#x, typeinfo %p.\n", iface, index, lcid, typeinfo);
+    return strmbase_get_typeinfo(IMediaControl_tid, typeinfo);
 }
 
-static HRESULT WINAPI MediaControl_GetIDsOfNames(IMediaControl *iface, REFIID riid,
-        LPOLESTR *rgszNames, UINT cNames, LCID lcid, DISPID *rgDispId)
+static HRESULT WINAPI MediaControl_GetIDsOfNames(IMediaControl *iface, REFIID iid,
+        LPOLESTR *names, UINT count, LCID lcid, DISPID *ids)
 {
-    struct filter_graph *This = impl_from_IMediaControl(iface);
+    ITypeInfo *typeinfo;
+    HRESULT hr;
 
-    TRACE("(%p/%p)->(%s, %p, %d, %d, %p): stub !!!\n", This, iface, debugstr_guid(riid), rgszNames,
-            cNames, lcid, rgDispId);
+    TRACE("iface %p, iid %s, names %p, count %u, lcid %#x, ids %p.\n",
+            iface, debugstr_guid(iid), names, count, lcid, ids);
 
-    return S_OK;
+    if (SUCCEEDED(hr = strmbase_get_typeinfo(IMediaControl_tid, &typeinfo)))
+    {
+        hr = ITypeInfo_GetIDsOfNames(typeinfo, names, count, ids);
+        ITypeInfo_Release(typeinfo);
+    }
+    return hr;
 }
 
-static HRESULT WINAPI MediaControl_Invoke(IMediaControl *iface, DISPID dispIdMember, REFIID riid,
-        LCID lcid, WORD wFlags, DISPPARAMS *pDispParams, VARIANT *pVarResult, EXCEPINFO *pExepInfo,
-        UINT *puArgErr)
+static HRESULT WINAPI MediaControl_Invoke(IMediaControl *iface, DISPID id, REFIID iid, LCID lcid,
+        WORD flags, DISPPARAMS *params, VARIANT *result, EXCEPINFO *excepinfo, UINT *error_arg)
 {
-    struct filter_graph *This = impl_from_IMediaControl(iface);
+    ITypeInfo *typeinfo;
+    HRESULT hr;
 
-    TRACE("(%p/%p)->(%d, %s, %d, %04x, %p, %p, %p, %p): stub !!!\n", This, iface, dispIdMember,
-            debugstr_guid(riid), lcid, wFlags, pDispParams, pVarResult, pExepInfo, puArgErr);
+    TRACE("iface %p, id %d, iid %s, lcid %#x, flags %#x, params %p, result %p, excepinfo %p, error_arg %p.\n",
+            iface, id, debugstr_guid(iid), lcid, flags, params, result, excepinfo, error_arg);
 
-    return S_OK;
+    if (SUCCEEDED(hr = strmbase_get_typeinfo(IMediaControl_tid, &typeinfo)))
+    {
+        hr = ITypeInfo_Invoke(typeinfo, iface, id, flags, params, result, excepinfo, error_arg);
+        ITypeInfo_Release(typeinfo);
+    }
+    return hr;
 }
 
 static void update_render_count(struct filter_graph *graph)




More information about the wine-cvs mailing list