Commit 0bcbc469 authored by Nikolay Sivov's avatar Nikolay Sivov Committed by Alexandre Julliard

combase: Move CoMarshalInterThreadInterfaceInStream().

parent 4c9db7fa
......@@ -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
......
......@@ -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;
}
......@@ -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)
{
......
......@@ -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
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment