using System; namespace ShellExtensions.Interop.Common { /// /// The STGM constants are flags that indicate /// conditions for creating and deleting the object and access modes /// for the object. /// /// You can combine these flags, but you can only choose one flag /// from each group of related flags. Typically one flag from each /// of the access and sharing groups must be specified for all /// functions and methods which use these constants. /// [Flags] public enum AccessModes { /// /// Indicates that, in direct mode, each change to a storage /// or stream element is written as it occurs. /// Direct = 0x00000000, /// /// Indicates that, in transacted mode, changes are buffered /// and written only if an explicit commit operation is called. /// Transacted = 0x00010000, /// /// Provides a faster implementation of a compound file /// in a limited, but frequently used, case. /// Simple = 0x08000000, /// /// Indicates that the object is read-only, /// meaning that modifications cannot be made. /// Read = 0x00000000, /// /// Enables you to save changes to the object, /// but does not permit access to its data. /// Write = 0x00000001, /// /// Enables access and modification of object data. /// ReadWrite = 0x00000002, /// /// Specifies that subsequent openings of the object are /// not denied read or write access. /// ShareDenyNone = 0x00000040, /// /// Prevents others from subsequently opening the object in Read mode. /// ShareDenyRead = 0x00000030, /// /// Prevents others from subsequently opening the object /// for Write or ReadWrite access. /// ShareDenyWrite = 0x00000020, /// /// Prevents others from subsequently opening the object in any mode. /// ShareExclusive = 0x00000010, /// /// Opens the storage object with exclusive access to the most /// recently committed version. /// Priority = 0x00040000, /// /// Indicates that the underlying file is to be automatically destroyed when the root /// storage object is released. This feature is most useful for creating temporary files. /// DeleteOnRelease = 0x04000000, /// /// Indicates that, in transacted mode, a temporary scratch file is usually used /// to save modifications until the Commit method is called. /// Specifying NoScratch permits the unused portion of the original file /// to be used as work space instead of creating a new file for that purpose. /// NoScratch = 0x00100000, /// /// Indicates that an existing storage object /// or stream should be removed before the new object replaces it. /// Create = 0x00001000, /// /// Creates the new object while preserving existing data in a stream named "Contents". /// Convert = 0x00020000, /// /// Causes the create operation to fail if an existing object with the specified name exists. /// FailIfThere = 0x00000000, /// /// This flag is used when opening a storage object with Transacted /// and without ShareExclusive or ShareDenyWrite. /// In this case, specifying NoSnapshot prevents the system-provided /// implementation from creating a snapshot copy of the file. /// Instead, changes to the file are written to the end of the file. /// NoSnapshot = 0x00200000, /// /// Supports direct mode for single-writer, multireader file operations. /// DirectSingleWriterMultipleReader = 0x00400000 } }