Structured Storage

Overview of the Structured Storage technology.

To develop Structured Storage, you need these headers:

For programming guidance for this technology, see:

Enumerations

 
LOCKTYPE

The LOCKTYPE enumeration values indicate the type of locking requested for the specified range of bytes. The values are used in the ILockBytes::LockRegion and IStream::LockRegion methods.
STATFLAG

Indicate whether the method should try to return a name in the pwcsName member of the STATSTG structure.
STGC

Specify the conditions for performing the commit operation in the IStorage::Commit and IStream::Commit methods.
STGMOVE

Indicate whether a storage element is to be moved or copied.
STGTY

The STGTY enumeration values are used in the type member of the STATSTG structure to indicate the type of the storage element. A storage element is a storage object, a stream object, or a byte-array object (LOCKBYTES).
STREAM_SEEK

The STREAM_SEEK enumeration values specify the origin from which to calculate the new seek-pointer location.

Functions

 
BeginMonitor

The BeginMonitor method is used to begin monitoring when a loading operation is started. When the operation is complete, the application must call ILayoutStorage::EndMonitor.
Clone

Creates a new enumerator that contains the same enumeration state as the current STATSTG structure enumerator.
Clone

The Clone method creates a new stream object with its own seek pointer that references the same bytes as the original stream.
Clone

The IEnumSTATPROPSETSTG::Clone method creates an enumerator that contains the same enumeration state as the current STATPROPSETSTG structure enumerator.
Clone

The IEnumSTATPROPSTG::Clone method creates an enumerator that contains the same enumeration state as the current STATPROPSTG structure enumerator.
Clone

The IEnumSTATPROPSETSTG::Clone method creates an enumerator that contains the same enumeration state as the current STATPROPSETSTG structure enumerator.
Clone

The IEnumSTATPROPSTG::Clone method creates an enumerator that contains the same enumeration state as the current STATPROPSTG structure enumerator.
Commit

The Commit method ensures that any changes made to a storage object open in transacted mode are reflected in the parent storage.
Commit

The Commit method ensures that any changes made to a stream object open in transacted mode are reflected in the parent storage.
Commit

The IPropertyStorage::Commit method saves changes made to a property storage object to the parent storage object.
Commit

The IPropertyStorage::Commit method saves changes made to a property storage object to the parent storage object.
CopyTo

Copies the entire contents of an open storage object to another storage object.
CopyTo

Copies a specified number of bytes from the current seek pointer in the stream to the current seek pointer in another stream.
Create

Creates and opens a new property set in the property set storage object.
CreateILockBytesOnHGlobal

Creates a byte array object that uses an HGLOBAL memory handle to store the bytes intended for in-memory storage of a compound file.
CreateStorage

Creates and opens a new storage object nested within this storage object with the specified name in the specified access mode.
CreateStream

Creates and opens a stream object with the specified name contained in this storage object.
CreateStreamOnHGlobal

Creates a stream object that uses an HGLOBAL memory handle to store the stream contents.
Delete

The Delete method deletes one of the property sets contained in the property set storage object.
DeleteMultiple

The IPropertyStorage::DeleteMultiple method deletes as many of the indicated properties as exist in this property set.
DeleteMultiple

The IPropertyStorage::DeleteMultiple method deletes as many of the indicated properties as exist in a property set.
DeletePropertyNames

The DeletePropertyNames method deletes specified string names from the current property set. (IPropertyStorage.DeletePropertyNames)
DeletePropertyNames

The IPropertyStorage::DeletePropertyNames method deletes specified string names from the current property set.
DestroyElement

Removes the specified storage or stream from this storage object.
EndMonitor

The EndMonitor method ends monitoring of a compound file. Must be preceded by a call to ILayoutStorage::BeginMonitor.
Enum

The Enum method creates an enumerator object which contains information on the property sets stored in this property set storage. On return, this method supplies a pointer to the IEnumSTATPROPSETSTG pointer on the enumerator object.
Enum

The IPropertyStorage::Enum method creates an enumerator object designed to enumerate data of type STATPROPSTG, which contains information on the current property set.
Enum

The IPropertyStorage::Enum method creates an enumerator object designed to enumerate data of type STATPROPSTG, which contains information on the current property set.
EnumElements

The EnumElements method retrieves a pointer to an enumerator object that can be used to enumerate the storage and stream objects contained within this storage object.
FillAppend

The FillAppend method writes a new block of bytes to the end of a byte array.
FillAt

The FillAt method writes a new block of data to a specified location in the byte array.
Flush

The Flush method ensures that any internal buffers maintained by the ILockBytes implementation are written out to the underlying physical storage.
FmtIdToPropStgName

Converts a property set format identifier (FMTID) to its storage or stream name.
FreePropVariantArray

The FreePropVariantArray function calls PropVariantClear on each of the PROPVARIANT structures in the rgvars array to make the value zero for each of the members of the array.
GetConvertStg

The GetConvertStg function returns the current value of the convert bit for the specified storage object.
GetHGlobalFromILockBytes

The GetHGlobalFromILockBytes function retrieves a global memory handle to a byte array object created using the CreateILockBytesOnHGlobal function.
GetHGlobalFromStream

The GetHGlobalFromStream function retrieves the global memory handle to a stream that was created through a call to the CreateStreamOnHGlobal function.
HaveWriteAccess

The HaveWriteAccess method indicates whether the write lock has been taken.
LayoutScript

The LayoutScript method provides explicit directions for reordering the storages, streams, and controls in a compound file to match the order in which they are accessed during the download.
LockRegion

The LockRegion method restricts access to a specified range of bytes in the byte array.
LockRegion

The LockRegion method restricts access to a specified range of bytes in the stream.
MoveElementTo

The MoveElementTo method copies or moves a substorage or stream from this storage object to another storage object.
Next

Retrieves a specified number of STATSTG structures, that follow in the enumeration sequence.
Next

The IEnumSTATPROPSETSTG::Next method retrieves a specified number of STATPROPSETSTG structures that follow subsequently in the enumeration sequence.
Next

The IEnumSTATPROPSTG::Next method retrieves a specified number of STATPROPSTG structures, that follow subsequently in the enumeration sequence.
Next

The IEnumSTATPROPSETSTG::Next method retrieves a specified number of STATPROPSETSTG structures that follow subsequently in the enumeration sequence.
Next

The IEnumSTATPROPSTG::Next method retrieves a specified number of STATPROPSTG structures, that follow subsequently in the enumeration sequence.
OleConvertIStorageToOLESTREAM

The OleConvertIStorageToOLESTREAM function converts the specified storage object from OLE 2 structured storage to the OLE 1 storage object model but does not include the presentation data. This is one of several compatibility functions.
OleConvertIStorageToOLESTREAMEx

The OleConvertIStorageToOLESTREAMEx function converts the specified storage object from OLE 2 structured storage to the OLE 1 storage object model, including the presentation data.
OleConvertOLESTREAMToIStorage

Converts the specified object from the OLE 1 storage model to an OLE 2 structured storage object without specifying presentation data.
OleConvertOLESTREAMToIStorageEx

The OleConvertOLESTREAMToIStorageEx function converts the specified object from the OLE 1 storage model to an OLE 2 structured storage object including presentation data. This is one of several compatibility functions.
Open

Opens a property set contained in the property set storage object.
OpenStorage

Opens an existing storage object with the specified name in the specified access mode.
OpenStream

Opens an existing stream object within this storage object in the specified access mode.
PropStgNameToFmtId

Converts a property set storage or stream name to its format identifier.
PropVariantClear

Frees all elements that can be freed in a given PROPVARIANT structure.
PropVariantCopy

The PropVariantCopy function copies the contents of one PROPVARIANT structure to another.
PropVariantInit

The PropVariantInit function initializes a PROPVARIANT structure.Note  This function is implemented as a macro, available by including the provided ole2.h header file.
Read

Reads a specified number of bytes from the stream object into memory, starting at the current seek pointer.
ReadAt

The ReadAt method reads a specified number of bytes starting at a specified offset from the beginning of the byte array object.
ReadClassStg

The ReadClassStg function reads the CLSID previously written to a storage object with the WriteClassStg function.
ReadClassStm

Reads the CLSID previously written to a stream object with the WriteClassStm function.
ReadFmtUserTypeStg

The ReadFmtUserTypeStg function returns the clipboard format and user type previously saved with the WriteFmtUserTypeStg function.
ReadMultiple

The IPropertyStorage::ReadMultiple method reads specified properties from the current property set.
ReadMultiple

The IPropertyStorage::ReadMultiple method reads specified properties from the current property set.
ReadPropertyNames

The IPropertyStorage::ReadPropertyNames method retrieves any existing string names for the specified property IDs.
ReadPropertyNames

The IPropertyStorage::ReadPropertyNames method retrieves any existing string names for the specified property IDs.
ReLayoutDocfile

The ReLayoutDocfile method rewrites the compound file, using the layout script obtained through monitoring, or provided through explicit layout scripting, to create a new compound file.
ReLayoutDocfileOnILockBytes

Is not implemented. If called, it returns STG_E_UNIMPLEMENTEDFUNCTION.
ReleaseWriteAccess

The ReleaseWriteAccess method releases the write lock previously obtained.
RenameElement

The RenameElement method renames the specified substorage or stream in this storage object.
Reset

Resets the enumeration sequence to the beginning of the STATSTG structure array.
Reset

The IEnumSTATPROPSETSTG::Reset method resets the enumeration sequence to the beginning of the STATPROPSETSTG structure array.
Reset

The IEnumSTATPROPSTG::Reset method resets the enumeration sequence to the beginning of the STATPROPSTG structure array.
Reset

The IEnumSTATPROPSETSTG::Reset method resets the enumeration sequence to the beginning of the STATPROPSETSTG structure array.
Reset

The IEnumSTATPROPSTG::Reset method resets the enumeration sequence to the beginning of the STATPROPSTG structure array.
Revert

The Revert method discards all changes that have been made to the storage object since the last commit operation.
Revert

The Revert method discards all changes that have been made to a transacted stream since the last IStream::Commit call. On streams open in direct mode and streams using the COM compound file implementation of IStream::Revert, this method has no effect.
Revert

The IPropertyStorage::Revert method discards all changes to the named property set since it was last opened or discards changes that were last committed to the property set.
Revert

The IPropertyStorage::Revert method discards all changes to the named property set since it was last opened or discards changes that were last committed to the property set.
Seek

Changes the seek pointer to a new location. The new location is relative to either the beginning of the stream, the end of the stream, or the current seek pointer.
SetClass

The SetClass method assigns the specified class identifier (CLSID) to this storage object.
SetClass

The IPropertyStorage::SetClass method assigns a new CLSID to the current property storage object, and persistently stores the CLSID with the object.
SetClass

The IPropertyStorage::SetClass method assigns a new CLSID to the current property storage object, and persistently stores the CLSID with the object.
SetConvertStg

The SetConvertStg function sets the convert bit in a storage object to indicate that the object is to be converted to a new class when it is opened. The setting can be retrieved with a call to the GetConvertStg function.
SetElementTimes

The SetElementTimes method sets the modification, access, and creation times of the specified storage element, if the underlying file system supports this method.
SetFillSize

The SetFillSize method sets the expected size of the byte array.
SetSize

The SetSize method changes the size of the byte array.
SetSize

Changes the size of the stream object.
SetStateBits

The SetStateBits method stores up to 32 bits of state information in this storage object.
SetTimes

The IPropertyStorage::SetTimes method sets the modification, access, and creation times of this property set, if supported by the implementation.
SetTimes

The IPropertyStorage::SetTimes method sets the modification, access, and creation times of this property set, if supported by the implementation.
Skip

Skips a specified number of STATSTG structures in the enumeration sequence.
Skip

The IEnumSTATPROPSETSTG::Skip method skips a specified number of STATPROPSETSTG structures in the enumeration sequence. (IEnumSTATPROPSETSTG.Skip)
Skip

The IEnumSTATPROPSTG::Skip method skips the specified number of STATPROPSTG structures in the enumeration sequence. (IEnumSTATPROPSTG.Skip)
Skip

The IEnumSTATPROPSETSTG::Skip method skips a specified number of STATPROPSETSTG structures in the enumeration sequence.
Skip

The IEnumSTATPROPSTG::Skip method skips the specified number of STATPROPSTG structures in the enumeration sequence.
Stat

The Stat method retrieves a STATSTG structure containing information for this byte array object.
Stat

The Stat method retrieves the STATSTG structure for this open storage object.
Stat

The Stat method retrieves the STATSTG structure for this stream.
Stat

The IPropertyStorage::Stat method retrieves information about the current open property set. (IPropertyStorage.Stat)
Stat

The IPropertyStorage::Stat method retrieves information about the current open property set. (IPropertyStorage.Stat)
StgConvertPropertyToVariant

Converts a SERIALIZEDPROPERTYVALUE data type to a PROPVARIANT data type.
StgConvertVariantToProperty

Converts a PROPVARIANT data type to a SERIALIZEDPROPERTYVALUE data type.
StgCreateDocfile

Creates a new compound file storage object using the COM-provided compound file implementation for the IStorage interface.
StgCreateDocfileOnILockBytes

Creates and opens a new compound file storage object on top of a byte-array object provided by the caller.
StgCreatePropSetStg

Creates a property set storage object from a specified storage object.
StgCreatePropStg

Creates and opens a property set in a specified storage or stream object.
StgCreateStorageEx

Creates a new storage object using a provided implementation for the IStorage or IPropertySetStorage interfaces.
StgDeserializePropVariant

The StgDeserializePropVariant function converts a SERIALIZEDPROPERTYVALUE data type to a PROPVARIANT data type.
StgGetIFillLockBytesOnFile

Opens a wrapper object on a temporary file.
StgGetIFillLockBytesOnILockBytes

Creates a new wrapper object on a byte array object provided by the caller.
StgIsStorageFile

The StgIsStorageFile function indicates whether a particular disk file contains a storage object.
StgIsStorageILockBytes

The StgIsStorageILockBytes function indicates whether the specified byte array contains a storage object.
StgOpenAsyncDocfileOnIFillLockBytes

Opens an existing root asynchronous storage object on a byte-array wrapper object provided by the caller.
StgOpenLayoutDocfile

Opens a compound file on an ILockBytes implementation that is capable of monitoring sector data.
StgOpenPropStg

Opens a specified property set in a specified storage or stream object.
StgOpenStorage

Opens an existing root storage object in the file system.
StgOpenStorageEx

Opens an existing root storage object in the file system. Use this function to open Compound Files and regular files.
StgOpenStorageOnILockBytes

The StgOpenStorageOnILockBytes function opens an existing storage object that does not reside in a disk file, but instead has an underlying byte array provided by the caller.
StgPropertyLengthAsVariant

The StgPropertyLengthAsVariant function examines a SERIALIZEDPROPERTYVALUE and returns the amount of memory that this property would occupy as a PROPVARIANT.
StgSerializePropVariant

The StgSerializePropVariant function converts a PROPVARIANT data type to a SERIALIZEDPROPERTYVALUE data type.
StgSetTimes

The StgSetTimes function sets the creation, access, and modification times of the indicated file, if supported by the underlying file system.
SwitchToFile

The SwitchToFile method copies the current file associated with the storage object to a new file.
Terminate

The Terminate method informs the byte array that the download has been terminated, either successfully or unsuccessfully.
UnlockRegion

The UnlockRegion method removes the access restriction on a previously locked range of bytes.
UnlockRegion

The UnlockRegion method removes the access restriction on a range of bytes previously restricted with IStream::LockRegion.
WaitForWriteAccess

The WaitForWriteAccess method obtains exclusive write access to a storage object.
Write

Writes a specified number of bytes into the stream object starting at the current seek pointer.
WriteAt

The WriteAt method writes the specified number of bytes starting at a specified offset from the beginning of the byte array.
WriteClassStg

The WriteClassStg function stores the specified class identifier (CLSID) in a storage object.
WriteClassStm

The WriteClassStm function stores the specified CLSID in the stream.
WriteFmtUserTypeStg

The WriteFmtUserTypeStg function writes a clipboard format and user type to the storage object.
WriteMultiple

The IPropertyStorage::WriteMultiple method writes a specified group of properties to the current property set.
WriteMultiple

The IPropertyStorage::WriteMultiple method writes a specified group of properties to the current property set.
WritePropertyNames

The IPropertyStorage::WritePropertyNames method assigns string IPropertyStoragenames to a specified array of property IDs in the current property set.
WritePropertyNames

The IPropertyStorage::WritePropertyNames method assigns string IPropertyStoragenames to a specified array of property IDs in the current property set.

Interfaces

 
IDirectWriterLock

The IDirectWriterLock interface enables a single writer to obtain exclusive write access to a root storage object opened in direct mode while allowing concurrent access by multiple readers.
IEnumSTATPROPSETSTG

The IEnumSTATPROPSETSTG interface iterates through an array of STATPROPSETSTG structures containing statistical data about the property sets managed by the current IPropertySetStorage instance.
IEnumSTATPROPSETSTG

The IEnumSTATPROPSETSTG interface iterates through an array of STATPROPSETSTG structures containing statistical data about the property sets managed by the current IPropertySetStorage instance.
IEnumSTATPROPSTG

The IEnumSTATPROPSTG interface iterates through an array of STATPROPSTG structures. The STATPROPSTG structures contain statistical data about properties in a property set.
IEnumSTATPROPSTG

The IEnumSTATPROPSTG interface iterates through an array of STATPROPSTG structures containing statistical data about properties in a property set.
IEnumSTATSTG

Enumerates an array of STATSTG structures.
IFillLockBytes

The IFillLockBytes interface enables downloading code to write data asynchronously to a structured storage byte array.
ILayoutStorage

The ILayoutStorage interface enables an application to optimize the layout of its compound files for efficient downloading across a slow link.
ILockBytes

The ILockBytes interface is implemented on a byte array object that is backed by some physical storage, such as a disk file, global memory, or a database.
IPropertySetStorage

The IPropertySetStorage interface creates, opens, deletes, and enumerates property set storages that support instances of the IPropertyStorage interface.
IPropertyStorage

The IPropertyStorage interface manages the persistent properties of a single property set. (IPropertyStorage interface)
IPropertyStorage

The IPropertyStorage interface manages the persistent properties of a single property set. (IPropertyStorage interface)
IRootStorage

The IRootStorage interface contains a single method that switches a storage object to a different underlying file and saves the storage object to that file.
ISequentialStream

The ISequentialStream interface supports simplified sequential access to stream objects. The IStream interface inherits its Read and Write methods from ISequentialStream.
IStorage

The IStorage interface supports the creation and management of structured storage objects.
IStream

The IStream interface lets you read and write data to stream objects.

Structures

 
PROPSPEC

The PROPSPEC structure is used by many of the methods of IPropertyStorage to specify a property either by its property identifier (ID) or the associated string name.
PROPSPEC

The PROPSPEC structure is used by many of the methods of IPropertyStorage to specify a property either by its property identifier (ID) or the associated string name.
PROPVARIANT

The PROPVARIANT structure is used in the ReadMultiple and WriteMultiple methods of IPropertyStorage to define the type tag and the value of a property in a property set.
PROPVARIANT

The PROPVARIANT structure is used in the ReadMultiple and WriteMultiple methods of IPropertyStorage to define the type tag and the value of a property in a property set.
RemSNB

The RemSNB structure is used for marshaling the SNB data type.Defined in the IStorage interface (Storag.idl).
STATPROPSETSTG

The STATPROPSETSTG structure contains information about a property set. (STATPROPSETSTG structure)
STATPROPSETSTG

The STATPROPSETSTG structure contains information about a property set. (STATPROPSETSTG structure)
STATPROPSTG

The STATPROPSTG structure contains data about a single property in a property set. This data is the property ID and type tag, and the optional string name that may be associated with the property.
STATPROPSTG

The STATPROPSTG structure contains data about a single property in a property set. This data is the property ID and type tag, and the optional string name that may be associated with the property.
STATSTG

Contains statistical data about an open storage, stream, or byte-array object.
STGOPTIONS

Specifies features of the storage object, such as sector size, in the StgCreateStorageEx and StgOpenStorageEx functions.
StorageLayout

Describes a single block of data, including its name, location, and length.