Commit 0725276f authored by Piotr Caban's avatar Piotr Caban Committed by Alexandre Julliard

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

parent 475b2d6b
...@@ -1804,24 +1804,24 @@ HRESULT WINAPI CoGetMarshalSizeMax(ULONG *pulSize, REFIID riid, IUnknown *pUnk, ...@@ -1804,24 +1804,24 @@ HRESULT WINAPI CoGetMarshalSizeMax(ULONG *pulSize, REFIID riid, IUnknown *pUnk,
{ {
HRESULT hr; HRESULT hr;
LPMARSHAL pMarshal; LPMARSHAL pMarshal;
CLSID marshaler_clsid; BOOL std_marshal = FALSE;
hr = get_marshaler(riid, pUnk, dwDestContext, pvDestContext, mshlFlags, &pMarshal); if(!pUnk)
if (hr != S_OK) return E_POINTER;
return hr;
hr = IMarshal_GetUnmarshalClass(pMarshal, riid, pUnk, dwDestContext, hr = IUnknown_QueryInterface(pUnk, &IID_IMarshal, (void**)&pMarshal);
pvDestContext, mshlFlags, &marshaler_clsid);
if (hr != S_OK) if (hr != S_OK)
{ {
ERR("IMarshal::GetUnmarshalClass failed, 0x%08x\n", hr); std_marshal = TRUE;
IMarshal_Release(pMarshal); hr = CoGetStandardMarshal(riid, pUnk, dwDestContext, pvDestContext,
return hr; mshlFlags, &pMarshal);
} }
if (hr != S_OK)
return hr;
hr = IMarshal_GetMarshalSizeMax(pMarshal, riid, pUnk, dwDestContext, hr = IMarshal_GetMarshalSizeMax(pMarshal, riid, pUnk, dwDestContext,
pvDestContext, mshlFlags, pulSize); pvDestContext, mshlFlags, pulSize);
if (!IsEqualCLSID(&marshaler_clsid, &CLSID_StdMarshal)) if (!std_marshal)
/* add on the size of the whole OBJREF structure like native does */ /* add on the size of the whole OBJREF structure like native does */
*pulSize += sizeof(OBJREF); *pulSize += sizeof(OBJREF);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment