This method of the IStorage interface opens an existing stream object within this storage object in the specified access mode.
public IStream OpenStream(String pwcsName, int reserved1, int grfMode, int reserved2);
S_OK -- The stream was successfully opened.
E_PENDING -- Asynchronous storage only: Part or all the stream's data is currently unavailable.
STG_E_ACCESSDENIED -- Insufficient permissions to open stream.
STG_E_FILENOTFOUND -- The stream with specified name does not exist.
STG_E_INSUFFICIENTMEMORY -- The stream was not opened due to a lack of memory.
STG_E_INVALIDFLAG -- The value specified for the grfMode flag is not a valid STGM enumeration value.
STG_E_INVALIDFUNCTION -- The specified combination of grfMode flags is not supported. For example, if this method was called without the STGM_SHARE_EXCLUSIVE flag.
STG_E_INVALIDNAME -- Invalid value for pwcsName.
STG_E_INVALIDPOINTER -- The pointer specified for the stream object was invalid.
STG_E_INVALIDPARAMETER -- One of the parameters was invalid.
STG_E_REVERTED -- The storage object has been invalidated by a revert operation above it in the transaction tree.
STG_E_TOOMANYOPENFILES -- The stream was not opened because there are too many open files.
pwcsName | [in] Points to a wide character string that contains the name of the stream to open. |
reserved1 | [in] Reserved for future use; must be 0 (zero). |
grfMode | [in] Specifies the access mode to be assigned to the open stream. For descriptions of the possible values, see the STGM enumeration values. Whatever other modes you may choose, you must at least specify STGM_SHARE_EXCLUSIVE when calling this method in the compound file implementation. |
reserved2 | [in] Reserved for future use; must be 0 (zero). |