The NetApiBufferReallocate function changes the size of a buffer allocated with NetApiBufferAllocate.
NET_API_STATUS NetApiBufferReallocate(
LPVOID OldBuffer,
DWORD NewByteCount,
LPVOID NewBuffer
);
NetApiBufferAllocate