This function asks a property bag to write an IStream interface as the value of a named property.


SHPropertyBag_WriteStream (
    IPropertyBag *ppb,
    LPCWSTR pszPropName,
    IStream *pStream);


The ppb argument provides the address of an IPropertyBag interface.

The pszPropName argument provides the address of a null-terminated Unicode string that names the property.

The pStream argument provides the IStream interface pointer.

Return Value

The function returns zero for success, else an error code.


If any of the ppb, pszPropName and pStream arguments are NULL, the function fails, with E_INVALIDARG as the error code. If the property bag’s Write method cannot write the interface pointer as a VT_UNKNOWN type, the function fails.


The SHPropertyBag_WriteStream function is exported from SHLWAPI as ordinal 532 in version 6.00.

Though this function dates from 2001, it was still not documented by Microsoft in the MSDN Library at least as late as the CD edition dated January 2004.