SHGetMalloc must use MEMCTX_TASK, otherwise CoGetMalloc will

badly fail with E_INVALIDARG in case native OLE32 is used.
This commit is contained in:
Andreas Mohr 2000-12-13 21:29:35 +00:00 committed by Alexandre Julliard
parent 3481e8039e
commit 2c5efe31c0
2 changed files with 10 additions and 1 deletions

View file

@ -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);
}
/*************************************************************************

View file

@ -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);