IStream::Commit
Ensures that any changes made to a stream object open in transacted mode are
reflected in the parent storage. If the stream object is open in direct mode,
IStream::Commit has no effect other than flushing all memory buffers to the next level
storage object. The OLE-provided implementation of streams does not support opening
streams in transacted mode.
HRESULT Commit(
DWORD grfCommitFlags
| //Specifies how changes are committed
|
);
|
|
Parameter
grfCommitFlags
[in]Controls how the changes for the stream object are committed. See the
STGC enumeration for a definition of these values.
Return Values
S_OK
Changes to the stream object were successfully committed to the parent level.
STG_E_MEDIUMFULL
The commit operation failed due to lack of space on the storage device.
Comments
This method ensures that changes to a stream object opened in transacted mode
are reflected in the parent storage. Changes that have been made to the stream
since it was opened or last committed are reflected to the parent storage
object. If the parent is opened in transacted mode, the parent may still revert at a
later time rolling back the changes to this stream object.
If the stream is open in direct mode, this method ensures that any memory
buffers have been flushed out to the underlying storage object. This is much like a
flush in traditional file systems.
The
IStream::Commit method is useful on a direct mode stream when the implementation of the
IStream interface is a wrapper for underlying file system APIs. In this case,
IStream::Commit would be connected to the file system's flush call.
Notes to Callers
The OLE-provided implementation of stream objects
does not support transacted streams. Also, stream objects only exist within
storage objects in this implementation. Thus, the OLE implementation of
IStream::Commit has no effect other than flushing internal memory buffers to the parent
storage object. With this implementation, it does not matter if you commit changes
to streams. You can just commit changes for storage objects.
See Also
IStorage::Commit
- Software for developers
-
Delphi Components
.Net Components
Software for Android Developers
- More information resources
-
MegaDetailed.Net
Unix Manual Pages
Delphi Examples
- Databases for Amazon shops developers
-
Amazon Categories Database
Browse Nodes Database