Dmitry Timoshkov : dllhost: Implement IMarshal::MarshalInterface().

Alexandre Julliard julliard at winehq.org
Thu Mar 10 16:10:15 CST 2022


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

Author: Dmitry Timoshkov <dmitry at baikal.ru>
Date:   Wed Mar  9 10:45:50 2022 +0300

dllhost: Implement IMarshal::MarshalInterface().

Signed-off-by: Dmitry Timoshkov <dmitry at baikal.ru>
Signed-off-by: Huw Davies <huw at codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard at winehq.org>

---

 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 bfe1d4cbbd6..241b79d13a0 100644
--- a/programs/dllhost/dllhost.c
+++ b/programs/dllhost/dllhost.c
@@ -147,9 +147,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,
@@ -163,8 +165,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,




More information about the wine-cvs mailing list