Platform SDK: Network Management

NetApiBufferAllocate

The NetApiBufferAllocate function allocates memory from the heap. Use this function only when compatibility with the NetApiBufferFree function is required. Otherwise, use the memory management functions.

NET_API_STATUS NetApiBufferAllocate(
  DWORD ByteCount,  
  LPVOID *Buffer    
);

Parameters

ByteCount
[in] Specifies the number of bytes to allocate.
Buffer
[out] Receives a pointer to the allocated buffer.

Return Values

If the function succeeds, the return value is NERR_Success.

If the function fails, the return value is a Win32 API error code. For a list of error codes, see Error Codes.

Requirements

  Windows NT/2000: Requires Windows NT 3.1 or later.
  Windows 95/98: Unsupported.
  Header: Declared in Lmapibuf.h; include Lm.h.
  Library: Use Netapi32.lib.

See Also

Network Management Overview, Network Management Functions, Api Buffer Functions, NetApiBufferFree, NetApiBufferReallocate