[PATCH 3/7] msado15: Implement Dispatch functions in _Stream

Alistair Leslie-Hughes leslie_alistair at hotmail.com
Fri Feb 26 02:02:23 CST 2021


Signed-off-by: Alistair Leslie-Hughes <leslie_alistair at hotmail.com>
---
 dlls/msado15/main.c            |  1 +
 dlls/msado15/msado15_private.h |  1 +
 dlls/msado15/stream.c          | 44 +++++++++++++++++++++++++++-------
 3 files changed, 38 insertions(+), 8 deletions(-)

diff --git a/dlls/msado15/main.c b/dlls/msado15/main.c
index f4ecf3247f1..33657b26217 100644
--- a/dlls/msado15/main.c
+++ b/dlls/msado15/main.c
@@ -181,6 +181,7 @@ static ITypeInfo *typeinfos[LAST_tid];
 static REFIID tid_ids[] = {
     &IID__Command,
     &IID__Connection,
+    &IID__Stream,
 };
 
 static HRESULT load_typelib(void)
diff --git a/dlls/msado15/msado15_private.h b/dlls/msado15/msado15_private.h
index a95a24b6dfa..b9fa01ef90d 100644
--- a/dlls/msado15/msado15_private.h
+++ b/dlls/msado15/msado15_private.h
@@ -45,6 +45,7 @@ static inline WCHAR *strdupW( const WCHAR *src )
 typedef enum tid_t {
     Command_tid,
     Connection_tid,
+    Stream_tid,
     LAST_tid
 } tid_t;
 
diff --git a/dlls/msado15/stream.c b/dlls/msado15/stream.c
index b40f664dcf1..961aed6a739 100644
--- a/dlls/msado15/stream.c
+++ b/dlls/msado15/stream.c
@@ -91,29 +91,57 @@ static HRESULT WINAPI stream_QueryInterface( _Stream *iface, REFIID riid, void *
 
 static HRESULT WINAPI stream_GetTypeInfoCount( _Stream *iface, UINT *count )
 {
-    FIXME( "%p, %p\n", iface, count );
-    return E_NOTIMPL;
+    struct stream *stream = impl_from_Stream( iface );
+    TRACE( "%p, %p\n", stream, count );
+    *count = 1;
+    return S_OK;
 }
 
 static HRESULT WINAPI stream_GetTypeInfo( _Stream *iface, UINT index, LCID lcid, ITypeInfo **info )
 {
-    FIXME( "%p, %u, %u, %p\n", iface, index, lcid, info );
-    return E_NOTIMPL;
+    struct stream *stream = impl_from_Stream( iface );
+    TRACE( "%p, %u, %u, %p\n", stream, index, lcid, info );
+    return get_typeinfo(Stream_tid, info);
 }
 
 static HRESULT WINAPI stream_GetIDsOfNames( _Stream *iface, REFIID riid, LPOLESTR *names, UINT count,
                                             LCID lcid, DISPID *dispid )
 {
-    FIXME( "%p, %s, %p, %u, %u, %p\n", iface, debugstr_guid(riid), names, count, lcid, dispid );
-    return E_NOTIMPL;
+    struct stream *stream = impl_from_Stream( iface );
+    HRESULT hr;
+    ITypeInfo *typeinfo;
+
+    TRACE( "%p, %s, %p, %u, %u, %p\n", stream, debugstr_guid(riid), names, count, lcid, dispid );
+
+    hr = get_typeinfo(Connection_tid, &typeinfo);
+    if(SUCCEEDED(hr))
+    {
+        hr = ITypeInfo_GetIDsOfNames(typeinfo, names, count, dispid);
+        ITypeInfo_Release(typeinfo);
+    }
+
+    return hr;
 }
 
 static HRESULT WINAPI stream_Invoke( _Stream *iface, DISPID member, REFIID riid, LCID lcid, WORD flags,
                                      DISPPARAMS *params, VARIANT *result, EXCEPINFO *excep_info, UINT *arg_err )
 {
-    FIXME( "%p, %d, %s, %d, %d, %p, %p, %p, %p\n", iface, member, debugstr_guid(riid), lcid, flags, params,
+    struct stream *stream = impl_from_Stream( iface );
+    HRESULT hr;
+    ITypeInfo *typeinfo;
+
+    TRACE( "%p, %d, %s, %d, %d, %p, %p, %p, %p\n", stream, member, debugstr_guid(riid), lcid, flags, params,
            result, excep_info, arg_err );
-    return E_NOTIMPL;
+
+    hr = get_typeinfo(Connection_tid, &typeinfo);
+    if(SUCCEEDED(hr))
+    {
+        hr = ITypeInfo_Invoke(typeinfo, &stream->Stream_iface, member, flags, params,
+                               result, excep_info, arg_err);
+        ITypeInfo_Release(typeinfo);
+    }
+
+    return hr;
 }
 
 static HRESULT WINAPI stream_get_Size( _Stream *iface, LONG *size )
-- 
2.30.0




More information about the wine-devel mailing list