Home -> IDataArray -> SetInitialData

Description

The SetInitialData method supplies initial data to use when allocating the buffer. Note that the supplied memory must remain valid and accessible until the AllocateMemory method is called.

WarningWarning

Initial data is consumed when memory is allocated. The source memory must remain valid and unmodified until allocation occurs.

Usage

SuccessToken SetInitialData(const void* sourceBuffer, size_t sourceBufferSizeInBytes);

Argument list

sourceBuffer [const void*]
The source data to use when the resource is allocated.
sourceBufferSizeInBytes [size_t]
The size, in bytes, of the source data.

Return value

[SuccessToken]
True if the operation succeeded, false otherwise. An assertion will be raised in debug builds if the result is not tested.

See also