// /*************************************************************************** // The Disc Image Chef // ---------------------------------------------------------------------------- // // Filename : Enums.cs // Author(s) : Natalia Portillo // // Component : Windows direct device access. // // --[ Description ] ---------------------------------------------------------- // // Contains enumerations necessary for directly interfacing devices under // Windows. // // --[ License ] -------------------------------------------------------------- // // This library is free software; you can redistribute it and/or modify // it under the terms of the GNU Lesser General Public License as // published by the Free Software Foundation; either version 2.1 of the // License, or (at your option) any later version. // // This library is distributed in the hope that it will be useful, but // WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU // Lesser General Public License for more details. // // You should have received a copy of the GNU Lesser General Public // License along with this library; if not, see . // // ---------------------------------------------------------------------------- // Copyright © 2011-2017 Natalia Portillo // ****************************************************************************/ using System; namespace DiscImageChef.Devices.Windows { [Flags] enum FileAttributes : uint { /// /// FILE_ATTRIBUTE_ARCHIVE /// Archive = 0x20, /// /// FILE_ATTRIBUTE_COMPRESSED /// Compressed = 0x800, /// /// FILE_ATTRIBUTE_DEVICE /// Device = 0x40, /// /// FILE_ATTRIBUTE_DIRECTORY /// Directory = 0x10, /// /// FILE_ATTRIBUTE_ENCRYPTED /// Encrypted = 0x4000, /// /// FILE_ATTRIBUTE_HIDDEN /// Hidden = 0x02, /// /// FILE_ATTRIBUTE_INTEGRITY_STREAM /// IntegrityStream = 0x8000, /// /// FILE_ATTRIBUTE_NORMAL /// Normal = 0x80, /// /// FILE_ATTRIBUTE_NOT_CONTENT_INDEXED /// NotContentIndexed = 0x2000, /// /// FILE_ATTRIBUTE_NO_SCRUB_DATA /// NoScrubData = 0x20000, /// /// FILE_ATTRIBUTE_OFFLINE /// Offline = 0x1000, /// /// FILE_ATTRIBUTE_READONLY /// Readonly = 0x01, /// /// FILE_ATTRIBUTE_REPARSE_POINT /// ReparsePoint = 0x400, /// /// FILE_ATTRIBUTE_SPARSE_FILE /// SparseFile = 0x200, /// /// FILE_ATTRIBUTE_SYSTEM /// System = 0x04, /// /// FILE_ATTRIBUTE_TEMPORARY /// Temporary = 0x100, /// /// FILE_ATTRIBUTE_VIRTUAL /// Virtual = 0x10000 } [Flags] enum FileAccess : uint { /// /// FILE_READ_DATA /// ReadData = 0x0001, /// /// FILE_LIST_DIRECTORY /// ListDirectory = ReadData, /// /// FILE_WRITE_DATA /// WriteData = 0x0002, /// /// FILE_ADD_FILE /// AddFile = WriteData, /// /// FILE_APPEND_DATA /// AppendData = 0x0004, /// /// FILE_ADD_SUBDIRECTORY /// AddSubdirectory = AppendData, /// /// FILE_CREATE_PIPE_INSTANCE /// CreatePipeInstance = AppendData, /// /// FILE_READ_EA /// ReadEA = 0x0008, /// /// FILE_WRITE_EA /// WriteEA = 0x0010, /// /// FILE_EXECUTE /// Execute = 0x0020, /// /// FILE_TRAVERSE /// Traverse = Execute, /// /// FILE_DELETE_CHILD /// DeleteChild = 0x0040, /// /// FILE_READ_ATTRIBUTES /// ReadAttributes = 0x0080, /// /// FILE_WRITE_ATTRIBUTES /// WriteAttributes = 0x0100, /// /// GENERIC_READ /// GenericRead = 0x80000000, /// /// GENERIC_WRITE /// GenericWrite = 0x40000000, /// /// GENERIC_EXECUTE /// GenericExecute = 0x20000000, /// /// GENERIC_ALL /// GenericAll = 0x10000000 } [Flags] enum FileShare : uint { /// /// FILE_SHARE_NONE /// None = 0x00, /// /// FILE_SHARE_READ /// Read = 0x01, /// /// FILE_SHARE_WRITE /// Write = 0x02, /// /// FILE_SHARE_DELETE /// Delete = 0x03 } [Flags] enum FileMode : uint { /// /// NEW /// New = 0x01, /// /// CREATE_ALWAYS /// CreateAlways = 0x02, /// /// OPEN_EXISTING /// OpenExisting = 0x03, /// /// OPEN_ALWAYS /// OpenAlways = 0x04, /// /// TRUNCATE_EXISTING /// TruncateExisting = 0x05 } /// /// Direction of SCSI transfer /// enum ScsiIoctlDirection : byte { /// /// From host to device /// SCSI_IOCTL_DATA_OUT /// Out = 0, /// /// From device to host /// SCSI_IOCTL_DATA_IN /// In = 1, /// /// Unspecified direction, or bidirectional, or no data /// SCSI_IOCTL_DATA_UNSPECIFIED /// Unspecified = 2 } enum WindowsIoctl : uint { IOCTL_ATA_PASS_THROUGH = 0x4D02C, IOCTL_ATA_PASS_THROUGH_DIRECT = 0x4D030, /// /// ScsiPassThrough /// IOCTL_SCSI_PASS_THROUGH = 0x4D004, /// /// ScsiPassThroughDirect /// IOCTL_SCSI_PASS_THROUGH_DIRECT = 0x4D014, /// /// ScsiGetAddress /// IOCTL_SCSI_GET_ADDRESS = 0x41018 } [Flags] enum AtaFlags : ushort { /// /// ATA_FLAGS_DRDY_REQUIRED /// DrdyRequired = 0x01, /// /// ATA_FLAGS_DATA_IN /// DataIn = 0x02, /// /// ATA_FLAGS_DATA_OUT /// DataOut = 0x04, /// /// ATA_FLAGS_48BIT_COMMAND /// ExtendedCommand = 0x08, /// /// ATA_FLAGS_USE_DMA /// DMA = 0x10, /// /// ATA_FLAGS_NO_MULTIPLE /// NoMultiple = 0x20 } }