From f9b5280dd0057462a50df9efdf472b22865f9b17 Mon Sep 17 00:00:00 2001 From: Robert Shearman Date: Wed, 24 May 2006 23:01:53 +0100 Subject: [PATCH] ole32: Implement table-weak marshaling for the free-threaded marshaler. --- dlls/ole32/ftmarshal.c | 7 ++++++- dlls/ole32/tests/marshal.c | 2 +- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/dlls/ole32/ftmarshal.c b/dlls/ole32/ftmarshal.c index 04eb7457d1b..4c327969193 100644 --- a/dlls/ole32/ftmarshal.c +++ b/dlls/ole32/ftmarshal.c @@ -191,6 +191,10 @@ FTMarshalImpl_MarshalInterface (LPMARSHAL iface, IStream * pStm, REFIID riid, vo if (FAILED(hres)) return hres; + /* don't hold a reference to table-weak marshaled interfaces */ + if (mshlflags & MSHLFLAGS_TABLEWEAK) + IUnknown_Release((IUnknown *)object); + hres = IStream_Write (pStm, &mshlflags, sizeof (mshlflags), NULL); if (hres != S_OK) return STG_E_MEDIUMFULL; @@ -258,7 +262,8 @@ FTMarshalImpl_UnmarshalInterface (LPMARSHAL iface, IStream * pStm, REFIID riid, if (hres != S_OK) return STG_E_READFAULT; hres = IUnknown_QueryInterface(object, riid, ppv); - IUnknown_Release(object); + if (!(mshlflags & MSHLFLAGS_TABLEWEAK)) + IUnknown_Release(object); return hres; } } diff --git a/dlls/ole32/tests/marshal.c b/dlls/ole32/tests/marshal.c index e2eb472f751..203a128bd7e 100644 --- a/dlls/ole32/tests/marshal.c +++ b/dlls/ole32/tests/marshal.c @@ -1734,7 +1734,7 @@ static void test_freethreadedmarshaler(void) MSHLFLAGS_TABLEWEAK); ok_ole_success(hr, IMarshal_MarshalInterface); - todo_wine ok_no_locks(); + ok_no_locks(); test_freethreadedmarshaldata(pStream, MSHCTX_INPROC, &Test_ClassFactory, MSHLFLAGS_TABLEWEAK);