Export (0) Print
Expand All

IStream_Read function

Reads bytes from a specified stream and returns a value that indicates whether all bytes were successfully read.

Syntax


HRESULT IStream_Read(
  _In_   IStream *pstm,
  _Out_  VOID *pv,
  _In_   ULONG cb
);

Parameters

pstm [in]

Type: IStream*

A pointer to the IStream interface of the stream from which to read.

pv [out]

Type: VOID*

A pointer to a buffer to receive the stream data from pstm. This buffer must be at least cb bytes in size.

cb [in]

Type: ULONG

The number of bytes of data that the function should attempt to read from the input stream.

Return value

Type: HRESULT

Returns S_OK if the function successfully reads the specified number of bytes from the stream, or a COM failure code otherwise. In particular, if the read attempt was successful but fewer than cb bytes were read, the function returns E_FAIL.

Remarks

This function calls the ISequentialStream::Read method to read data from the specified stream into the buffer. If the function fails for any reason, the contents of the output buffer and the position of the read pointer in the input stream are undefined.

Requirements

Minimum supported client

Windows 2000 Professional, Windows XP [desktop apps only]

Minimum supported server

Windows 2000 Server, Windows Server 2003 [desktop apps only]

Header

Shlwapi.h

DLL

Shlwapi.dll (version 5.0 or later)

See also

ISequentialStream::Read

 

 

Community Additions

ADD
Show:
© 2014 Microsoft