diff --git a/dlls/combase/combase.spec b/dlls/combase/combase.spec index 3214f54550c..8bcac10cdc8 100644 --- a/dlls/combase/combase.spec +++ b/dlls/combase/combase.spec @@ -112,7 +112,7 @@ @ stdcall CoGetInstanceFromIStorage(ptr ptr ptr long ptr long ptr) @ stdcall CoGetInterfaceAndReleaseStream(ptr ptr ptr) @ stdcall CoGetMalloc(long ptr) -@ stdcall CoGetMarshalSizeMax(ptr ptr ptr long ptr long) ole32.CoGetMarshalSizeMax +@ stdcall CoGetMarshalSizeMax(ptr ptr ptr long ptr long) @ stub CoGetModuleType @ stdcall CoGetObjectContext(ptr ptr) @ stdcall CoGetPSClsid(ptr ptr) ole32.CoGetPSClsid diff --git a/dlls/combase/marshal.c b/dlls/combase/marshal.c index 2b0c0058125..3c577a9bff1 100644 --- a/dlls/combase/marshal.c +++ b/dlls/combase/marshal.c @@ -24,6 +24,7 @@ #include "wine/debug.h" #include "wine/heap.h" +#include "wine/orpc.h" WINE_DEFAULT_DEBUG_CHANNEL(ole); @@ -379,3 +380,34 @@ HRESULT WINAPI CoCreateFreeThreadedMarshaler(IUnknown *outer, IUnknown **marshal return S_OK; } + +/*********************************************************************** + * CoGetMarshalSizeMax (combase.@) + */ +HRESULT WINAPI CoGetMarshalSizeMax(ULONG *size, REFIID riid, IUnknown *unk, + DWORD dest_context, void *pvDestContext, DWORD mshlFlags) +{ + BOOL std_marshal = FALSE; + IMarshal *marshal; + HRESULT hr; + + if (!unk) + return E_POINTER; + + hr = IUnknown_QueryInterface(unk, &IID_IMarshal, (void **)&marshal); + if (hr != S_OK) + { + std_marshal = TRUE; + hr = CoGetStandardMarshal(riid, unk, dest_context, pvDestContext, mshlFlags, &marshal); + } + if (hr != S_OK) + return hr; + + hr = IMarshal_GetMarshalSizeMax(marshal, riid, unk, dest_context, pvDestContext, mshlFlags, size); + if (!std_marshal) + /* add on the size of the whole OBJREF structure like native does */ + *size += sizeof(OBJREF); + + IMarshal_Release(marshal); + return hr; +} diff --git a/dlls/ole32/marshal.c b/dlls/ole32/marshal.c index cf1e55babed..ea8432e2ee6 100644 --- a/dlls/ole32/marshal.c +++ b/dlls/ole32/marshal.c @@ -1777,58 +1777,6 @@ static HRESULT get_unmarshaler_from_stream(IStream *stream, IMarshal **marshal, return hr; } -/*********************************************************************** - * CoGetMarshalSizeMax [OLE32.@] - * - * Gets the maximum amount of data that will be needed by a marshal. - * - * PARAMS - * pulSize [O] Address where maximum marshal size will be stored. - * riid [I] Identifier of the interface to marshal. - * pUnk [I] Pointer to the object to marshal. - * dwDestContext [I] Destination. Used to enable or disable optimizations. - * pvDestContext [I] Reserved. Must be NULL. - * mshlFlags [I] Flags that affect the marshaling. See CoMarshalInterface(). - * - * RETURNS - * Success: S_OK. - * Failure: HRESULT code. - * - * SEE ALSO - * CoMarshalInterface(). - */ -HRESULT WINAPI CoGetMarshalSizeMax(ULONG *pulSize, REFIID riid, IUnknown *pUnk, - DWORD dwDestContext, void *pvDestContext, - DWORD mshlFlags) -{ - HRESULT hr; - LPMARSHAL pMarshal; - BOOL std_marshal = FALSE; - - if(!pUnk) - return E_POINTER; - - hr = IUnknown_QueryInterface(pUnk, &IID_IMarshal, (void**)&pMarshal); - if (hr != S_OK) - { - 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 (!std_marshal) - /* add on the size of the whole OBJREF structure like native does */ - *pulSize += sizeof(OBJREF); - - IMarshal_Release(pMarshal); - return hr; -} - - static void dump_MSHLFLAGS(MSHLFLAGS flags) { if (flags & MSHLFLAGS_TABLESTRONG) diff --git a/dlls/ole32/ole32.spec b/dlls/ole32/ole32.spec index a19264127f9..772599b4cff 100644 --- a/dlls/ole32/ole32.spec +++ b/dlls/ole32/ole32.spec @@ -39,7 +39,7 @@ @ stdcall CoGetInstanceFromIStorage(ptr ptr ptr long ptr long ptr) combase.CoGetInstanceFromIStorage @ stdcall CoGetInterfaceAndReleaseStream(ptr ptr ptr) combase.CoGetInterfaceAndReleaseStream @ stdcall CoGetMalloc(long ptr) combase.CoGetMalloc -@ stdcall CoGetMarshalSizeMax(ptr ptr ptr long ptr long) +@ stdcall CoGetMarshalSizeMax(ptr ptr ptr long ptr long) combase.CoGetMarshalSizeMax @ stdcall CoGetObject(wstr ptr ptr ptr) @ stdcall CoGetObjectContext(ptr ptr) combase.CoGetObjectContext @ stdcall CoGetPSClsid(ptr ptr)