Module: wine Branch: refs/heads/master Commit: f9b5280dd0057462a50df9efdf472b22865f9b17 URL: http://source.winehq.org/git/?p=wine.git;a=commit;h=f9b5280dd0057462a50df9ef...
Author: Robert Shearman rob@codeweavers.com Date: Wed May 24 23:01:53 2006 +0100
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 04eb745..4c32796 100644 --- a/dlls/ole32/ftmarshal.c +++ b/dlls/ole32/ftmarshal.c @@ -191,6 +191,10 @@ FTMarshalImpl_MarshalInterface (LPMARSHA 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 (LPMARS 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 e2eb472..203a128 100644 --- a/dlls/ole32/tests/marshal.c +++ b/dlls/ole32/tests/marshal.c @@ -1734,7 +1734,7 @@ #endif 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);