[PATCH 1/6] combase: Move CoGetInterfaceAndReleaseStream().
Nikolay Sivov
nsivov at codeweavers.com
Wed Aug 12 03:12:27 CDT 2020
Signed-off-by: Nikolay Sivov <nsivov at codeweavers.com>
---
dlls/combase/combase.spec | 2 +-
dlls/combase/marshal.c | 19 +++++++++++++++++++
dlls/ole32/marshal.c | 30 ------------------------------
dlls/ole32/ole32.spec | 2 +-
4 files changed, 21 insertions(+), 32 deletions(-)
diff --git a/dlls/combase/combase.spec b/dlls/combase/combase.spec
index 56dc63c4f72..8c471f5ef69 100644
--- a/dlls/combase/combase.spec
+++ b/dlls/combase/combase.spec
@@ -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
diff --git a/dlls/combase/marshal.c b/dlls/combase/marshal.c
index dfe6426db9a..54151e21c8e 100644
--- a/dlls/combase/marshal.c
+++ b/dlls/combase/marshal.c
@@ -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;
+}
diff --git a/dlls/ole32/marshal.c b/dlls/ole32/marshal.c
index 90d24805952..51db5a7e699 100644
--- a/dlls/ole32/marshal.c
+++ b/dlls/ole32/marshal.c
@@ -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)
{
diff --git a/dlls/ole32/ole32.spec b/dlls/ole32/ole32.spec
index 001e7b7ad2b..d5e5607e036 100644
--- a/dlls/ole32/ole32.spec
+++ b/dlls/ole32/ole32.spec
@@ -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)
--
2.28.0
More information about the wine-devel
mailing list