IStorage::OpenStream method

The OpenStream method opens an existing stream object within this storage object in the specified access mode.

Syntax

HRESULT OpenStream(
  const OLECHAR *pwcsName,
  void          *reserved1,
  DWORD         grfMode,
  DWORD         reserved2,
  IStream       **ppstm
);

Parameters

pwcsName

A pointer to a wide character null-terminated Unicode string that contains the name of the stream to open. The 000 through 01f characters, serving as the first character of the stream/storage name, are reserved for use by OLE. This is a compound file restriction, not a structured storage restriction.

reserved1

Reserved for future use; must be NULL.

grfMode

Specifies the access mode to be assigned to the open stream. For more information and descriptions of possible values, see STGM Constants. Other modes you choose must at least specify STGM_SHARE_EXCLUSIVE when calling this method in the compound file implementation.

reserved2

Reserved for future use; must be zero.

ppstm

A pointer to IStream pointer variable that receives the interface pointer to the newly opened stream object. If an error occurs, *ppstm must be set to NULL.

Return Value

This method can return one of these values.

Remarks

IStorage::OpenStream opens an existing stream object within this storage object in the access mode specified in grfMode. There are restrictions on the permissions that can be given in grfMode. For example, the permissions on this storage object restrict the permissions on its streams. In general, access restrictions on streams need to be stricter than those on their parent storages. Compound-file streams must be opened with STGM_SHARE_EXCLUSIVE.

Requirements

   
Minimum supported client Windows 2000 Professional [desktop apps | UWP apps]
Minimum supported server Windows 2000 Server [desktop apps | UWP apps]
Target Platform Windows
Header objidl.h
Library Uuid.lib
DLL Ole32.dll

See Also

IStorage - Compound File Implementation

IStorage::CreateStream

IStream