diff --git a/dlls/combase/combase.spec b/dlls/combase/combase.spec index 8c471f5ef69..5ee52d950ee 100644 --- a/dlls/combase/combase.spec +++ b/dlls/combase/combase.spec @@ -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 diff --git a/dlls/combase/marshal.c b/dlls/combase/marshal.c index 54151e21c8e..fe4c2f3adf8 100644 --- a/dlls/combase/marshal.c +++ b/dlls/combase/marshal.c @@ -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; +} diff --git a/dlls/ole32/marshal.c b/dlls/ole32/marshal.c index 51db5a7e699..cf1e55babed 100644 --- a/dlls/ole32/marshal.c +++ b/dlls/ole32/marshal.c @@ -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) { diff --git a/dlls/ole32/ole32.spec b/dlls/ole32/ole32.spec index d5e5607e036..1587f926381 100644 --- a/dlls/ole32/ole32.spec +++ b/dlls/ole32/ole32.spec @@ -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