Commit 2c5efe31 authored by Andreas Mohr's avatar Andreas Mohr Committed by Alexandre Julliard

SHGetMalloc must use MEMCTX_TASK, otherwise CoGetMalloc will

badly fail with E_INVALIDARG in case native OLE32 is used.
parent 3481e803
...@@ -146,7 +146,7 @@ DWORD WINAPI SHCLSIDFromStringAW (LPVOID clsid, CLSID *id) ...@@ -146,7 +146,7 @@ DWORD WINAPI SHCLSIDFromStringAW (LPVOID clsid, CLSID *id)
DWORD WINAPI SHGetMalloc(LPMALLOC *lpmal) DWORD WINAPI SHGetMalloc(LPMALLOC *lpmal)
{ {
TRACE("(%p)\n", lpmal); TRACE("(%p)\n", lpmal);
return CoGetMalloc(0,lpmal); return CoGetMalloc(MEMCTX_TASK, lpmal);
} }
/************************************************************************* /*************************************************************************
......
...@@ -701,6 +701,15 @@ ICOM_DEFINE(IMalloc,IUnknown) ...@@ -701,6 +701,15 @@ ICOM_DEFINE(IMalloc,IUnknown)
#define IMalloc_DidAlloc(p,a) ICOM_CALL1(DidAlloc,p,a) #define IMalloc_DidAlloc(p,a) ICOM_CALL1(DidAlloc,p,a)
#define IMalloc_HeapMinimize(p) ICOM_CALL (HeapMinimize,p) #define IMalloc_HeapMinimize(p) ICOM_CALL (HeapMinimize,p)
/* values passed to CoGetMalloc */
#define MEMCTX_TASK 1 /* private task memory */
#define MEMCTX_SHARED 2 /* shared memory */
#ifdef _MAC
#define MEMCTX_MACSYSTEM 3 /* system heap on mac */
#endif
/* mainly for internal use... */
#define MEMCTX_UNKNOWN -1
#define MEMCTX_SAME -2
HRESULT WINAPI CoGetMalloc(DWORD dwMemContext,LPMALLOC* lpMalloc); HRESULT WINAPI CoGetMalloc(DWORD dwMemContext,LPMALLOC* lpMalloc);
......
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