###User Defined Function###
_WinAPI_CreateBufferFromStruct

###Description###
Allocates a block of memory from the internal library heap and initializes it with the structure's data.

###Syntax###
#include <WinAPISys.au3>
_WinAPI_CreateBufferFromStruct ( $tStruct [, $pBuffer = 0 [, $fAbort = 1]] )


###Parameters###
@@ParamTable@@
$tStruct
	The structure that contains data to initialize the buffer.
$pBuffer
	[optional] A pointer to the existing buffer that to be replaced by a new buffer.
	If this parameter is a valid buffer pointer, the memory will be reallocated for a new buffer. However, the new memory is allocated at a different location.
	Therefore, you should always use the pointer that returns this function.
	If this parameter is 0 (Default) or invalid buffer pointer, the function just allocates a new memory.
$fAbort
	[optional] Specifies whether to exit the script if not enough memory, valid values:
	True    - Displaying an error message and exit the script with error code 1 (Default).
	False   - Continue the script and return an error.
@@End@@

###ReturnValue###
@@ReturnTable@@
Success 	A pointer to the new buffer.
Failure 	0 and sets the @error flag to non-zero (if an exceptions is not set).
@@End@@


###Remarks###
This function creates a buffer of size equal to the size of the specified structure and then copies all data from this structure.

When a buffer is no longer needed, you must destroy it by calling the <a href="_WinAPI_FreeMemory.htm">_WinAPI_FreeMemory()</a> function.


###Related###
_WinAPI_FreeMemory
