Microsoft DirectX 9.0

IAsyncReader::SyncRead

The SyncRead method performs a synchronous read. The method blocks until the request is completed. The file positions and the buffer address do not have to be aligned. If the request is not aligned, the method performs a buffered read operation.

Syntax

HRESULT SyncRead(
  LONGLONG llPosition,
  LONG lLength,
  BYTE *pBuffer
);

Parameters

llPosition

[in] Specifies the byte offset at which to begin reading. The method fails if this value is beyond the end of the file.

lLength

[in] Specifies the number of bytes to read.

pBuffer

[out] Pointer to a buffer that receives the data.

Return Values

Returns an HRESULT value. Possible values include the following.

Return code Description
S_FALSE Retrieved fewer bytes than requested. (Probably the end of the file was reached.)
S_OK Success.

Remarks

This method works even if the filter is stopped.

See Also