Click to Rate and Give Feedback
MSDN
MSDN Library
COM
COM Fundamentals
Reference
Functions
 CoGetMalloc Function

  Switch on low bandwidth view
CoGetMalloc Function

Retrieves a pointer to the default OLE task memory allocator (which supports the system implementation of the IMalloc interface) so applications can call its methods to manage memory.

Syntax

C++
HRESULT CoGetMalloc(
  __in   DWORD dwMemContext,
  __out  LPMALLOC *ppMalloc
);

Parameters

dwMemContext [in]

This parameter must be 1.

ppMalloc [out]

The address of an IMalloc* pointer variable that receives the interface pointer to the memory allocator.

Return Value

This function can return the standard return values S_OK, E_INVALIDARG, and E_OUTOFMEMORY.

Remarks

The pointer to the IMalloc interface pointer received through the ppMalloc parameter cannot be used from a remote process; each process must have its own allocator.

Requirements

Minimum supported clientWindows 2000 Professional
Minimum supported serverWindows 2000 Server
HeaderObjbase.h
LibraryOle32.lib
DLLOle32.dll

See Also

CoTaskMemAlloc
IMalloc

Send comments about this topic to Microsoft

Build date: 7/9/2009

Tags What's this?: Add a tag
Community Content   What is Community Content?
Add new content RSS  Annotations
vb.net syntax      dmex   |   Edit   |   Show History
<DllImport("ole32.dll")> _
Public Shared Function CoGetMalloc(ByVal dwReserved As Integer, <Out> ByRef pMalloc As IMalloc) As Integer End Function
Flag as ContentBug
C# syntax      dmex   |   Edit   |   Show History
[DllImport("ole32.dll")]
public static extern int CoGetMalloc(int dwReserved, out IMalloc pMalloc);
Tags What's this?: c# (x) syntax (x) Add a tag
Flag as ContentBug
Processing
© 2009 Microsoft Corporation. All rights reserved. Terms of Use  |  Trademarks  |  Privacy Statement
Page view tracker