# Function Reference

# _WinAPI_CopyStruct

Creates a duplicate of a specified structure

#include <WinAPIMisc.au3>
_WinAPI_CopyStruct ( $tStruct [, $sStruct = ''] )

## Parameters

$tStruct | The structure to be duplicated.
$sStruct | [optional] The string representing the structure (same as for the DllStructCreate() function).

## Return Value

Success: | "byte[n]" or $sStruct structure that was created.
Failure: | Sets the @error flag to non-zero.

## Example

    #include <WinAPIMem.au3>
    #include <WinAPIMisc.au3>

    Local $tStruct1 = DllStructCreate('byte[8]')
    _WinAPI_FillMemory($tStruct1, 8, 0x1D)

    Local $tStruct2 = _WinAPI_CopyStruct($tStruct1)

    ConsoleWrite('Source:      ' & DllStructGetData($tStruct1, 1) & @CRLF)
    ConsoleWrite('Destination: ' & DllStructGetData($tStruct2, 1) & @CRLF)