[PATCH 6/8] dllhost: Implement IMarshal::MarshalInterface().

Dmitry Timoshkov dmitry at baikal.ru
Tue Feb 22 04:02:46 CST 2022


Signed-off-by: Dmitry Timoshkov <dmitry at baikal.ru>
---
 programs/dllhost/dllhost.c | 21 +++++++++++++++++----
 1 file changed, 17 insertions(+), 4 deletions(-)

diff --git a/programs/dllhost/dllhost.c b/programs/dllhost/dllhost.c
index bcd56c1ad50..8baf5c7c371 100644
--- a/programs/dllhost/dllhost.c
+++ b/programs/dllhost/dllhost.c
@@ -164,9 +164,11 @@ static ULONG WINAPI marshal_Release(IMarshal *iface)
 static HRESULT WINAPI marshal_GetUnmarshalClass(IMarshal *iface, REFIID iid, void *pv,
         DWORD dwDestContext, void *pvDestContext, DWORD mshlflags, CLSID *clsid)
 {
-    FIXME("(%p,%s,%p,%08lx,%p,%08lx,%p): stub\n", iface, wine_dbgstr_guid(iid), pv,
+    TRACE("(%p,%s,%p,%08lx,%p,%08lx,%p)\n", iface, wine_dbgstr_guid(iid), pv,
           dwDestContext, pvDestContext, mshlflags, clsid);
-    return E_NOTIMPL;
+
+    *clsid = CLSID_StdMarshal;
+    return S_OK;
 }
 
 static HRESULT WINAPI marshal_GetMarshalSizeMax(IMarshal *iface, REFIID iid, void *pv,
@@ -180,8 +182,19 @@ static HRESULT WINAPI marshal_GetMarshalSizeMax(IMarshal *iface, REFIID iid, voi
 static HRESULT WINAPI marshal_MarshalInterface(IMarshal *iface, IStream *stream, REFIID iid,
         void *pv, DWORD dwDestContext, void *pvDestContext, DWORD mshlflags)
 {
-    FIXME("(%p,%s,%p,%08lx,%p,%08lx): stub\n", stream, wine_dbgstr_guid(iid), pv, dwDestContext, pvDestContext, mshlflags);
-    return E_NOTIMPL;
+    struct factory *factory = impl_from_IMarshal(iface);
+    IUnknown *object;
+    HRESULT hr;
+
+    TRACE("(%p,%s,%p,%08lx,%p,%08lx)\n", stream, wine_dbgstr_guid(iid), pv, dwDestContext, pvDestContext, mshlflags);
+
+    hr = CoGetClassObject(&factory->clsid, CLSCTX_INPROC_SERVER, NULL, iid, (void **)&object);
+    if (hr == S_OK)
+    {
+        hr = CoMarshalInterface(stream, iid, object, dwDestContext, pvDestContext, mshlflags);
+        IUnknown_Release(object);
+    }
+    return hr;
 }
 
 static HRESULT WINAPI marshal_UnmarshalInterface(IMarshal *iface, IStream *stream,
-- 
2.35.1




More information about the wine-devel mailing list