Skip to content

Latest commit

 

History

History
121 lines (91 loc) · 5.51 KB

nf-objidl-istorage-createstream.md

File metadata and controls

121 lines (91 loc) · 5.51 KB
UID title description helpviewer_keywords old-location tech.root ms.assetid ms.date ms.keywords req.header req.include-header req.target-type req.target-min-winverclnt req.target-min-winversvr req.kmdf-ver req.umdf-ver req.ddi-compliance req.unicode-ansi req.idl req.max-support req.namespace req.assembly req.type-library req.lib req.dll req.irql targetos req.typenames req.redist ms.custom f1_keywords dev_langs topic_type api_type api_location api_name
NF:objidl.IStorage.CreateStream
IStorage::CreateStream (objidl.h)
Creates and opens a stream object with the specified name contained in this storage object.
CreateStream
CreateStream method [Structured Storage]
CreateStream method [Structured Storage]
IStorage interface
IStorage interface [Structured Storage]
CreateStream method
IStorage.CreateStream
IStorage::CreateStream
_stg_istorage_createstream
objidl/IStorage::CreateStream
stg.istorage_createstream
stg\istorage_createstream.htm
Stg
168f5ac9-8a72-4356-82a4-de3a7ec72c05
12/05/2018
CreateStream, CreateStream method [Structured Storage], CreateStream method [Structured Storage],IStorage interface, IStorage interface [Structured Storage],CreateStream method, IStorage.CreateStream, IStorage::CreateStream, _stg_istorage_createstream, objidl/IStorage::CreateStream, stg.istorage_createstream
objidl.h
Windows
Windows 2000 Professional [desktop apps \| UWP apps]
Windows 2000 Server [desktop apps \| UWP apps]
Objidl.idl
Uuid.lib
Ole32.dll
Windows
19H1
IStorage::CreateStream
objidl/IStorage::CreateStream
c++
APIRef
kbSyntax
COM
Ole32.dll
IStorage.CreateStream

IStorage::CreateStream

-description

The CreateStream method creates and opens a stream object with the specified name contained in this storage object. All elements within a storage objects, both streams and other storage objects, are kept in the same name space.

-parameters

-param pwcsName [in]

A pointer to a wide character null-terminated Unicode string that contains the name of the newly created stream. The name can be used later to open or reopen the stream. The name must not exceed 31 characters in length, not including the string terminator. 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.

-param grfMode [in]

Specifies the access mode to use when opening the newly created stream. For more information and descriptions of the possible values, see STGM Constants.

-param reserved1 [in]

Reserved for future use; must be zero.

-param reserved2 [in]

Reserved for future use; must be zero.

-param ppstm [out]

On return, pointer to the location of the new IStream interface pointer. This is only valid if the operation is successful. When an error occurs, this parameter is set to NULL.

-returns

This method can return one of these values.

Return code Description
S_OK The new stream was successfully created.
E_PENDING Asynchronous Storage only: Part or all of the necessary data is currently unavailable.
STG_E_ACCESSDENIED Not enough permissions to create stream.
STG_E_FILEALREADYEXISTS The name specified for the stream already exists in the storage object and the grfMode parameter includes the value STGM_FAILIFTHERE.
STG_E_INSUFFICIENTMEMORY The stream was not created due to a lack of memory.
STG_E_INVALIDFLAG The value specified for the grfMode parameter is not a valid STGM constants value.
STG_E_INVALIDFUNCTION The specified combination of flags in the grfMode parameter is not supported; for example, when this method is 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 created because there are too many open files.

-remarks

If a stream with the name specified in the pwcsName parameter already exists and the grfMode parameter includes the STGM_CREATE flag, the existing stream is replaced by a newly created one. Both the destruction of the old stream and the creation of the new stream object are subject to the transaction mode on the parent storage object.

The COM-provided compound file implementation of the IStorage::CreateStream method does not support the following behaviors:

  • The STGM_DELETEONRELEASE flag is not supported.
  • Transacted mode (STGM_TRANSACTED) is not supported for stream objects.
  • Opening the same stream more than once from the same storage is not supported. The STGM_SHARE_EXCLUSIVE sharing-mode flag must be specified in the grfMode parameter.
If the stream already exists and grfMode is set to STGM_FAILIFTHERE, this method fails with the return value STG_E_FILEALREADYEXISTS.

-see-also

IStorage - Compound File Implementation

IStorage::OpenStream

IStream