IStream_Write function (shlwapi.h)

Writes data of unknown format from a buffer to a specified stream.


LWSTDAPI IStream_Write(
  [in] IStream    *pstm,
  [in] const void *pv,
  [in] ULONG      cb


[in] pstm

Type: IStream*

An IStream pointer that specifies the target stream.

[in] pv

Type: const void*

Pointer to a buffer that holds the data to send to the target stream. This buffer must be at least cb bytes in size.

[in] cb


The number of bytes of data to write to the target stream.

Return value


Returns S_OK if the function successfully wrote the specified number of bytes to the stream, or an error value otherwise. In particular, if less than cb bytes was written to the target stream, even if some data was successfully written, the function returns E_FAIL.


Minimum supported client Windows Vista [desktop apps only]
Minimum supported server Windows Server 2008 [desktop apps only]
Target Platform Windows
Header shlwapi.h
DLL Shlwapi.dll (version 5.0 or later)