From 2c5efe31c007c1760416d4aa4eb607ec541caf5a Mon Sep 17 00:00:00 2001 From: Andreas Mohr Date: Wed, 13 Dec 2000 21:29:35 +0000 Subject: [PATCH] SHGetMalloc must use MEMCTX_TASK, otherwise CoGetMalloc will badly fail with E_INVALIDARG in case native OLE32 is used. --- dlls/shell32/shellole.c | 2 +- include/wine/obj_base.h | 9 +++++++++ 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/dlls/shell32/shellole.c b/dlls/shell32/shellole.c index f88228f631b..4eb090bd5ed 100644 --- a/dlls/shell32/shellole.c +++ b/dlls/shell32/shellole.c @@ -146,7 +146,7 @@ DWORD WINAPI SHCLSIDFromStringAW (LPVOID clsid, CLSID *id) DWORD WINAPI SHGetMalloc(LPMALLOC *lpmal) { TRACE("(%p)\n", lpmal); - return CoGetMalloc(0,lpmal); + return CoGetMalloc(MEMCTX_TASK, lpmal); } /************************************************************************* diff --git a/include/wine/obj_base.h b/include/wine/obj_base.h index 8c915737d10..9789b6109c2 100644 --- a/include/wine/obj_base.h +++ b/include/wine/obj_base.h @@ -701,6 +701,15 @@ ICOM_DEFINE(IMalloc,IUnknown) #define IMalloc_DidAlloc(p,a) ICOM_CALL1(DidAlloc,p,a) #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);