combase: Move CoMarshalInterThreadInterfaceInStream().

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:28 +03:00 committed by Alexandre Julliard
parent 4c9db7fa22
commit 0bcbc4693e
4 changed files with 31 additions and 47 deletions

View File

@ -129,7 +129,7 @@
@ stdcall CoIsHandlerConnected(ptr) ole32.CoIsHandlerConnected
@ stdcall CoLockObjectExternal(ptr long long) ole32.CoLockObjectExternal
@ stdcall CoMarshalHresult(ptr long)
@ stdcall CoMarshalInterThreadInterfaceInStream(ptr ptr ptr) ole32.CoMarshalInterThreadInterfaceInStream
@ stdcall CoMarshalInterThreadInterfaceInStream(ptr ptr ptr)
@ stdcall CoMarshalInterface(ptr ptr ptr long ptr long) ole32.CoMarshalInterface
@ stub CoPopServiceDomain
@ stub CoPushServiceDomain

View File

@ -55,3 +55,32 @@ HRESULT WINAPI CoGetInterfaceAndReleaseStream(IStream *stream, REFIID riid, void
IStream_Release(stream);
return hr;
}
/***********************************************************************
* CoMarshalInterThreadInterfaceInStream (combase.@)
*/
HRESULT WINAPI CoMarshalInterThreadInterfaceInStream(REFIID riid, IUnknown *unk, IStream **stream)
{
ULARGE_INTEGER xpos;
LARGE_INTEGER seekto;
HRESULT hr;
TRACE("%s, %p, %p\n", debugstr_guid(riid), unk, stream);
hr = CreateStreamOnHGlobal(NULL, TRUE, stream);
if (FAILED(hr)) return hr;
hr = CoMarshalInterface(*stream, riid, unk, MSHCTX_INPROC, NULL, MSHLFLAGS_NORMAL);
if (SUCCEEDED(hr))
{
memset(&seekto, 0, sizeof(seekto));
IStream_Seek(*stream, seekto, STREAM_SEEK_SET, &xpos);
}
else
{
IStream_Release(*stream);
*stream = NULL;
}
return hr;
}

View File

@ -2079,51 +2079,6 @@ HRESULT WINAPI CoReleaseMarshalData(IStream *pStream)
return hr;
}
/***********************************************************************
* CoMarshalInterThreadInterfaceInStream [OLE32.@]
*
* Marshal an interface across threads in the same process.
*
* PARAMS
* riid [I] Identifier of the interface to be marshalled.
* pUnk [I] Pointer to IUnknown-derived interface that will be marshalled.
* ppStm [O] Pointer to IStream object that is created and then used to store the marshalled interface.
*
* RETURNS
* Success: S_OK
* Failure: E_OUTOFMEMORY and other COM error codes
*
* SEE ALSO
* CoMarshalInterface(), CoUnmarshalInterface() and CoGetInterfaceAndReleaseStream()
*/
HRESULT WINAPI CoMarshalInterThreadInterfaceInStream(
REFIID riid, LPUNKNOWN pUnk, LPSTREAM * ppStm)
{
ULARGE_INTEGER xpos;
LARGE_INTEGER seekto;
HRESULT hres;
TRACE("(%s, %p, %p)\n",debugstr_guid(riid), pUnk, ppStm);
hres = CreateStreamOnHGlobal(NULL, TRUE, ppStm);
if (FAILED(hres)) return hres;
hres = CoMarshalInterface(*ppStm, riid, pUnk, MSHCTX_INPROC, NULL, MSHLFLAGS_NORMAL);
if (SUCCEEDED(hres))
{
memset(&seekto, 0, sizeof(seekto));
IStream_Seek(*ppStm, seekto, STREAM_SEEK_SET, &xpos);
}
else
{
IStream_Release(*ppStm);
*ppStm = NULL;
}
return hres;
}
static HRESULT WINAPI StdMarshalCF_QueryInterface(LPCLASSFACTORY iface,
REFIID riid, LPVOID *ppv)
{

View File

@ -58,7 +58,7 @@
@ stdcall CoLoadLibrary(wstr long)
@ stdcall CoLockObjectExternal(ptr long long)
@ stdcall CoMarshalHresult(ptr long) combase.CoMarshalHresult
@ stdcall CoMarshalInterThreadInterfaceInStream(ptr ptr ptr)
@ stdcall CoMarshalInterThreadInterfaceInStream(ptr ptr ptr) combase.CoMarshalInterThreadInterfaceInStream
@ stdcall CoMarshalInterface(ptr ptr ptr long ptr long)
@ stub CoQueryAuthenticationServices
@ stdcall CoQueryClientBlanket(ptr ptr ptr ptr ptr ptr ptr) combase.CoQueryClientBlanket