CoGetMalloc

Retrieves the default OLE task memory allocator (a pointer to the system implementation of the IMalloc interface) so applications can use it to manage memory.

HRESULT CoGetMalloc(

DWORD dwMemContext,
//Indicates if memory is private or shared
LPMALLOC * ppMalloc
//Receives pointer to memory allocator on return
);

Parameters

dwMemContext

Indicates this is reserved; the value must be 1.

ppMalloc

Receives a pointer to the memory allocator on return.

Return Values

S_OK

Indicates the allocator was retrieved successfully.

E_INVALIDARG

Indicates either dwMemContext is not equal to 1, or ppMalloc is an invalid out pointer.

E_OUTOFMEMORY

Inidcates pointer wasn't returned because the system is out of memory.

Comments

The pointer to the IMalloc interface pointer received through the ppMalloc parameter cannot be called from a remote processpics/OLE00090000.gifeach process must have its own allocator.

See Also

IMalloc, CoTaskMemAlloc

Software for developers
Delphi Components
.Net Components
Software for Android Developers
More information resources
MegaDetailed.Net
Unix Manual Pages
Delphi Examples
Databases for Amazon shops developers
Amazon Categories Database
Browse Nodes Database