combase: Move CoGetInterfaceAndReleaseStream().

Signed-off-by: Nikolay Sivov <nsivov@codeweavers.com>
Signed-off-by: Huw Davies <huw@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
Nikolay Sivov 2020-08-12 11:12:27 +03:00 committed by Alexandre Julliard
parent f87171c601
commit 4c9db7fa22
4 changed files with 21 additions and 32 deletions

View File

@ -109,7 +109,7 @@
@ stub CoGetErrorInfo
@ stdcall CoGetInstanceFromFile(ptr ptr ptr long long wstr long ptr)
@ stdcall CoGetInstanceFromIStorage(ptr ptr ptr long ptr long ptr)
@ stdcall CoGetInterfaceAndReleaseStream(ptr ptr ptr) ole32.CoGetInterfaceAndReleaseStream
@ stdcall CoGetInterfaceAndReleaseStream(ptr ptr ptr)
@ stdcall CoGetMalloc(long ptr)
@ stdcall CoGetMarshalSizeMax(ptr ptr ptr long ptr long) ole32.CoGetMarshalSizeMax
@ stub CoGetModuleType

View File

@ -21,6 +21,10 @@
#define COBJMACROS
#include "objbase.h"
#include "wine/debug.h"
WINE_DEFAULT_DEBUG_CHANNEL(ole);
/***********************************************************************
* CoMarshalHresult (combase.@)
*/
@ -36,3 +40,18 @@ HRESULT WINAPI CoUnmarshalHresult(IStream *stream, HRESULT *phresult)
{
return IStream_Read(stream, phresult, sizeof(*phresult), NULL);
}
/***********************************************************************
* CoGetInterfaceAndReleaseStream (combase.@)
*/
HRESULT WINAPI CoGetInterfaceAndReleaseStream(IStream *stream, REFIID riid, void **obj)
{
HRESULT hr;
TRACE("%p, %s, %p\n", stream, debugstr_guid(riid), obj);
if (!stream) return E_INVALIDARG;
hr = CoUnmarshalInterface(stream, riid, obj);
IStream_Release(stream);
return hr;
}

View File

@ -2124,36 +2124,6 @@ HRESULT WINAPI CoMarshalInterThreadInterfaceInStream(
return hres;
}
/***********************************************************************
* CoGetInterfaceAndReleaseStream [OLE32.@]
*
* Unmarshalls an interface from a stream and then releases the stream.
*
* PARAMS
* pStm [I] Stream that contains the marshalled interface.
* riid [I] Interface identifier of the object to unmarshall.
* ppv [O] Address of pointer where the requested interface object will be stored.
*
* RETURNS
* Success: S_OK
* Failure: A COM error code
*
* SEE ALSO
* CoMarshalInterThreadInterfaceInStream() and CoUnmarshalInterface()
*/
HRESULT WINAPI CoGetInterfaceAndReleaseStream(LPSTREAM pStm, REFIID riid,
LPVOID *ppv)
{
HRESULT hres;
TRACE("(%p, %s, %p)\n", pStm, debugstr_guid(riid), ppv);
if(!pStm) return E_INVALIDARG;
hres = CoUnmarshalInterface(pStm, riid, ppv);
IStream_Release(pStm);
return hres;
}
static HRESULT WINAPI StdMarshalCF_QueryInterface(LPCLASSFACTORY iface,
REFIID riid, LPVOID *ppv)
{

View File

@ -37,7 +37,7 @@
@ stdcall CoGetDefaultContext(long ptr ptr) combase.CoGetDefaultContext
@ stdcall CoGetInstanceFromFile(ptr ptr ptr long long wstr long ptr) combase.CoGetInstanceFromFile
@ stdcall CoGetInstanceFromIStorage(ptr ptr ptr long ptr long ptr) combase.CoGetInstanceFromIStorage
@ stdcall CoGetInterfaceAndReleaseStream(ptr ptr ptr)
@ stdcall CoGetInterfaceAndReleaseStream(ptr ptr ptr) combase.CoGetInterfaceAndReleaseStream
@ stdcall CoGetMalloc(long ptr) combase.CoGetMalloc
@ stdcall CoGetMarshalSizeMax(ptr ptr ptr long ptr long)
@ stdcall CoGetObject(wstr ptr ptr ptr)