Piotr Caban : ole32: Change returned size in CoGetMarshalSizeMax if object implements IMarshal.

Alexandre Julliard julliard at winehq.org
Mon Oct 15 16:15:27 CDT 2018


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

Author: Piotr Caban <piotr at codeweavers.com>
Date:   Thu Oct 11 19:11:40 2018 +0200

ole32: Change returned size in CoGetMarshalSizeMax if object implements IMarshal.

Signed-off-by: Piotr Caban <piotr at codeweavers.com>
Signed-off-by: Huw Davies <huw at codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard at winehq.org>

---

 dlls/ole32/marshal.c | 20 ++++++++++----------
 1 file changed, 10 insertions(+), 10 deletions(-)

diff --git a/dlls/ole32/marshal.c b/dlls/ole32/marshal.c
index 21d0e6f..b12082c 100644
--- a/dlls/ole32/marshal.c
+++ b/dlls/ole32/marshal.c
@@ -1804,24 +1804,24 @@ HRESULT WINAPI CoGetMarshalSizeMax(ULONG *pulSize, REFIID riid, IUnknown *pUnk,
 {
     HRESULT hr;
     LPMARSHAL pMarshal;
-    CLSID marshaler_clsid;
+    BOOL std_marshal = FALSE;
 
-    hr = get_marshaler(riid, pUnk, dwDestContext, pvDestContext, mshlFlags, &pMarshal);
-    if (hr != S_OK)
-        return hr;
+    if(!pUnk)
+        return E_POINTER;
 
-    hr = IMarshal_GetUnmarshalClass(pMarshal, riid, pUnk, dwDestContext,
-                                    pvDestContext, mshlFlags, &marshaler_clsid);
+    hr = IUnknown_QueryInterface(pUnk, &IID_IMarshal, (void**)&pMarshal);
     if (hr != S_OK)
     {
-        ERR("IMarshal::GetUnmarshalClass failed, 0x%08x\n", hr);
-        IMarshal_Release(pMarshal);
-        return hr;
+        std_marshal = TRUE;
+        hr = CoGetStandardMarshal(riid, pUnk, dwDestContext, pvDestContext,
+                                  mshlFlags, &pMarshal);
     }
+    if (hr != S_OK)
+        return hr;
 
     hr = IMarshal_GetMarshalSizeMax(pMarshal, riid, pUnk, dwDestContext,
                                     pvDestContext, mshlFlags, pulSize);
-    if (!IsEqualCLSID(&marshaler_clsid, &CLSID_StdMarshal))
+    if (!std_marshal)
         /* add on the size of the whole OBJREF structure like native does */
         *pulSize += sizeof(OBJREF);
 




More information about the wine-cvs mailing list