IPixShaderMemorySpace::Read method

Reads a range of bytes from this memory space.

Syntax

HRESULT Read(
    UINT64 address,
    UINT32 numberOfBytes,
    _Out_writes_bytes_to_(numberOfBytes, *numberOfBytesRead) BYTE * values,
    UINT32 * numberOfBytesRead);

Parameters

address [in]

The address to read from.

numberOfBytes [in]

The number of bytes to read.

values [out]

Caller-allocated buffer of at least numberOfBytes bytes that receives the data.

numberOfBytesRead [out]

The number of bytes actually read, which can be less than numberOfBytes. Set to zero before reading, so it is zero on every failure.

Returns

S_OK on success, otherwise an error code.

Remarks

A read can succeed having transferred only part of what was asked for, so a caller must consult numberOfBytesRead rather than assume S_OK filled the whole buffer. Bytes past that count are left as the caller passed them in. A read that transfers nothing at all fails instead of succeeding with a count of zero, so S_OK always means at least one byte is valid.

See also