Robert Shearman : ole32: Implement table-strong marshaling and ReleaseMarshalData for the free-threaded marshaler .

Alexandre Julliard julliard at wine.codeweavers.com
Thu May 25 04:16:16 CDT 2006


Module: wine
Branch: refs/heads/master
Commit: 2c57189a97a24109958d6df7a3e4624a055b6bac
URL:    http://source.winehq.org/git/?p=wine.git;a=commit;h=2c57189a97a24109958d6df7a3e4624a055b6bac

Author: Robert Shearman <rob at codeweavers.com>
Date:   Wed May 24 23:02:14 2006 +0100

ole32: Implement table-strong marshaling and ReleaseMarshalData for the free-threaded marshaler.

---

 dlls/ole32/ftmarshal.c     |   44 ++++++++++++++++++++++++++++++++++++++++----
 dlls/ole32/tests/marshal.c |    6 +++---
 2 files changed, 43 insertions(+), 7 deletions(-)

diff --git a/dlls/ole32/ftmarshal.c b/dlls/ole32/ftmarshal.c
index 4c32796..5255f60 100644
--- a/dlls/ole32/ftmarshal.c
+++ b/dlls/ole32/ftmarshal.c
@@ -262,7 +262,7 @@ FTMarshalImpl_UnmarshalInterface (LPMARS
         if (hres != S_OK) return STG_E_READFAULT;
 
         hres = IUnknown_QueryInterface(object, riid, ppv);
-        if (!(mshlflags & MSHLFLAGS_TABLEWEAK))
+        if (!(mshlflags & (MSHLFLAGS_TABLEWEAK|MSHLFLAGS_TABLESTRONG)))
             IUnknown_Release(object);
         return hres;
     }
@@ -270,13 +270,49 @@ FTMarshalImpl_UnmarshalInterface (LPMARS
 
 static HRESULT WINAPI FTMarshalImpl_ReleaseMarshalData (LPMARSHAL iface, IStream * pStm)
 {
-    FIXME ("(), stub!\n");
-    return S_OK;
+    DWORD mshlflags;
+    HRESULT hres;
+
+    TRACE ("(%p)\n", pStm);
+
+    hres = IStream_Read (pStm, &mshlflags, sizeof (mshlflags), NULL);
+    if (hres != S_OK) return STG_E_READFAULT;
+
+    if (mshlflags == 0x57dfd54d /* MEOW */) {
+        IMarshal *pMarshal;
+
+        hres = CoCreateInstance (&CLSID_DfMarshal, NULL, CLSCTX_INPROC, &IID_IMarshal, (void **)&pMarshal);
+        if (FAILED(hres)) return hres;
+
+        hres = IMarshal_ReleaseMarshalData (pMarshal, pStm);
+        IMarshal_Release (pMarshal);
+        return hres;
+    }
+    else {
+        IUnknown *object;
+        DWORD constant;
+        GUID unknown_guid;
+
+        hres = IStream_Read (pStm, &object, sizeof (object), NULL);
+        if (hres != S_OK) return STG_E_READFAULT;
+
+        hres = IStream_Read (pStm, &constant, sizeof (constant), NULL);
+        if (hres != S_OK) return STG_E_READFAULT;
+        if (constant != 0)
+            FIXME("constant is 0x%lx instead of 0\n", constant);
+
+        hres = IStream_Read (pStm, &unknown_guid, sizeof (unknown_guid), NULL);
+        if (hres != S_OK) return STG_E_READFAULT;
+
+        IUnknown_Release(object);
+        return S_OK;
+    }
 }
 
 static HRESULT WINAPI FTMarshalImpl_DisconnectObject (LPMARSHAL iface, DWORD dwReserved)
 {
-    FIXME ("(), stub!\n");
+    TRACE ("()\n");
+    /* nothing to do */
     return S_OK;
 }
 
diff --git a/dlls/ole32/tests/marshal.c b/dlls/ole32/tests/marshal.c
index 203a128..7aba67e 100644
--- a/dlls/ole32/tests/marshal.c
+++ b/dlls/ole32/tests/marshal.c
@@ -1718,7 +1718,7 @@ #endif
 
     IUnknown_Release(pProxy);
 
-    todo_wine ok_more_than_one_lock();
+    ok_more_than_one_lock();
 
     IStream_Seek(pStream, llZero, STREAM_SEEK_SET, NULL);
     hr = IMarshal_ReleaseMarshalData(pFTMarshal, pStream);
@@ -1767,7 +1767,7 @@ #endif
     hr = IMarshal_ReleaseMarshalData(pFTMarshal, pStream);
     ok_ole_success(hr, IMarshal_ReleaseMarshalData);
 
-    todo_wine ok_no_locks();
+    ok_no_locks();
 
     /* doesn't enforce marshaling rules here and allows us to unmarshal the
      * interface, even though it was freed above */
@@ -1775,7 +1775,7 @@ #endif
     hr = IMarshal_UnmarshalInterface(pFTMarshal, pStream, &IID_IUnknown, (void **)&pProxy);
     ok_ole_success(hr, IMarshal_UnmarshalInterface);
 
-    todo_wine ok_no_locks();
+    ok_no_locks();
 
     IStream_Release(pStream);
     IMarshal_Release(pFTMarshal);




More information about the wine-cvs mailing list