Last modified: July 23, 2011

Applies to: Outlook

Retrieves the addresses of the MAPI memory allocation and deallocation functions (MAPIAllocateBuffer, MAPIAllocateMore, and MAPIFreeBuffer).

HRESULT GetMemAllocRoutines(
  LPALLOCATEBUFFER FAR * lppAllocateBuffer,
  LPALLOCATEMORE FAR * lppAllocateMore,
  LPFREEBUFFER FAR * lppFreeBuffer


[out] A pointer to a pointer to the MAPIAllocateBuffer function. MAPIAllocateBuffer allocates memory.


[out] A pointer to a pointer to the MAPIAllocateMore function. MAPIAllocateMore allocates additional memory for memory that was originally allocated by using MAPIAllocateBuffer.


[out] A pointer to a pointer to the MAPIFreeBuffer function. MAPIFreeBuffer frees memory.


The function addresses were successfully returned.

The IMAPISupport::GetMemAllocRoutines method is implemented for all support objects. Service providers call GetMemAllocRoutines to get the addresses of the three memory allocation functions that are passed to their initialization function (ABProviderInit, MSProviderInit, or XPProviderInit).