SHGetMalloc must use MEMCTX_TASK, otherwise CoGetMalloc will
badly fail with E_INVALIDARG in case native OLE32 is used.
This commit is contained in:
parent
3481e8039e
commit
2c5efe31c0
|
@ -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);
|
||||
}
|
||||
|
||||
/*************************************************************************
|
||||
|
|
|
@ -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);
|
||||
|
||||
|
|
Loading…
Reference in New Issue