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

Signed-off-by: Piotr Caban <piotr@codeweavers.com>
Signed-off-by: Huw Davies <huw@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
Piotr Caban 2018-10-11 19:11:40 +02:00 committed by Alexandre Julliard
parent 475b2d6b5f
commit 0725276f0f
1 changed files with 10 additions and 10 deletions

View File

@ -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);