---
name: "MAPIAllocateBuffer"
section: "3w"
platform: "linux"
package: "libwine-dev"
version: "1.4.1-4"
release: "Debian 7 (Wheezy)"
platforms: ["linux"]
url: "https://new.carta.tech/MAPIAllocateBuffer"
---

# MAPIAllocateBuffer(3w)

## NAME

**MAPIAllocateBuffer** (MAPI32.12)

## SYNOPSIS

SCODE MAPIAllocateBuffer\
  (\
   ULONG   *cbSize*,\
   LPVOID\* *lppBuffer*\
  )

## DESCRIPTION

MAPIAllocateBuffer@8 (**MAPI32**.**13**).

Allocate a block of memory.

## PARAMS

*cbSize* **\[In\]**  Size of the block to allocate in bytes.

*lppBuffer* **\[Out\]**  Destination for pointer to allocated memory.

## RETURNS

**Success:** **S\_OK**. \**lppBuffer* is filled with a pointer to a memory block of length *cbSize* bytes.

**Failure:** **MAPI\_E\_INVALID\_PARAMETER**, if *lppBuffer* is **NULL**. **MAPI\_E\_NOT\_ENOUGH\_MEMORY**, if the memory allocation fails.

## NOTES

Memory allocated with this function should be freed with **[MAPIFreeBuffer(3w)](/MAPIFreeBuffer/3w.md)**. Further allocations of memory may be linked to the pointer returned using MAPIAllocateMore(). Linked allocations are freed when the initial pointer is feed.

## IMPLEMENTATION

Declared in **"util.h"**.

Implemented in **"dlls/mapi32/util.c"**.

Debug channel **"mapi"**.
