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