using System; using System.ComponentModel; using System.Linq; using System.Runtime.InteropServices; using System.Runtime.InteropServices.ComTypes; using static Vanara.PInvoke.OleAut32; namespace Vanara.PInvoke { public static partial class IMAPI { /// public const uint IMAPI_SECTOR_SIZE = 2048; /// Defines values for the burn verification implemented by the IBurnVerification interface. /// /// /// Depending on the format used for the burned media, the values defined by this enumeration will elicit the following behavior during verification: /// /// /// /// MsftDiscFormat2Data /// /// /// /// None /// No burn verification. /// /// /// Quick Verification /// /// /// /// Full Verification /// /// /// /// /// /// MsftDiscFormat2TrackAtOnce /// /// /// /// None /// No burn verification. /// /// /// Quick Verification /// After adding each track: When finishing the disc: /// /// /// Full Verification /// Full verification is not supported with this format. /// /// /// The time required for a full verification is relative to the read speed of the device and storage medium. /// /// This enumeration is supported in Windows Server 2003 with Service Pack 1 (SP1), Windows XP with Service Pack 2 (SP2), and Windows /// Vista via the Windows Feature Pack for Storage. All features provided by this update package are supported natively in Windows 7 and /// Windows Server 2008 R2. /// /// // https://docs.microsoft.com/en-us/windows/win32/api/imapi2/ne-imapi2-imapi_burn_verification_level typedef enum // _IMAPI_BURN_VERIFICATION_LEVEL { IMAPI_BURN_VERIFICATION_NONE, IMAPI_BURN_VERIFICATION_QUICK, IMAPI_BURN_VERIFICATION_FULL } // IMAPI_BURN_VERIFICATION_LEVEL, *PIMAPI_BURN_VERIFICATION_LEVEL; [PInvokeData("imapi2.h", MSDNShortId = "NE:imapi2._IMAPI_BURN_VERIFICATION_LEVEL")] [Serializable] public enum IMAPI_BURN_VERIFICATION_LEVEL { /// No burn verification. [Description("No write verification")] IMAPI_BURN_VERIFICATION_NONE, /// A quick, heuristic burn verification. [Description("Quick write verification")] IMAPI_BURN_VERIFICATION_QUICK, /// /// This verification compares the checksum to the referenced stream for either the last session or each track. A full verification /// includes the heuristic checks of a quick verification for both burn formats. /// [Description("Full write verification")] IMAPI_BURN_VERIFICATION_FULL, } /// Defines the sector types that can be written to CD media. /// /// /// Some sector types are not compatible with other sector types within a single image. The following are typical examples of this condition: /// /// /// /// If the first track is audio, then all tracks must be audio. /// /// /// If the first track is Mode1, then all tracks must be Mode1. /// /// /// /// Only the three Mode2 (XA) sectors (Mode 2 Form 0, Mode 2 Form 1, and Mode 2 Form 2) may be mixed within a single disc image, and /// even then, only with other Mode 2 (XA) sector types. /// /// /// /// // https://docs.microsoft.com/en-us/windows/win32/api/imapi2/ne-imapi2-imapi_cd_sector_type typedef enum _IMAPI_CD_SECTOR_TYPE { // IMAPI_CD_SECTOR_AUDIO, IMAPI_CD_SECTOR_MODE_ZERO, IMAPI_CD_SECTOR_MODE1, IMAPI_CD_SECTOR_MODE2FORM0, IMAPI_CD_SECTOR_MODE2FORM1, // IMAPI_CD_SECTOR_MODE2FORM2, IMAPI_CD_SECTOR_MODE1RAW, IMAPI_CD_SECTOR_MODE2FORM0RAW, IMAPI_CD_SECTOR_MODE2FORM1RAW, // IMAPI_CD_SECTOR_MODE2FORM2RAW } IMAPI_CD_SECTOR_TYPE, *PIMAPI_CD_SECTOR_TYPE; [PInvokeData("imapi2.h", MSDNShortId = "NE:imapi2._IMAPI_CD_SECTOR_TYPE")] [Serializable] public enum IMAPI_CD_SECTOR_TYPE : int { /// /// With this sector type, Audio data has 2352 bytes per sector/frame. This can be broken down into 588 contiguous samples, each /// sample being four bytes. The layout of a single sample matches the 16-bit stereo 44.1KHz WAV file data. This type of sector has /// no additional error correcting codes. /// [Description("2352 bytes per sector of audio data")] IMAPI_CD_SECTOR_AUDIO, /// /// With this sector type, user data has 2336 bytes per sector/frame. This seldom-used sector type contains all zero data, and is /// almost never seen in media today. /// [Description("2336 bytes per sector of zeros, rare")] IMAPI_CD_SECTOR_MODE_ZERO, /// /// With this sector type, user data has 2048 bytes per sector/frame. Mode1 data is the most common data form for pressed CD-ROM /// media. This data type also provides the greatest level of ECC/EDC among the standard sector types. /// [Description("2048 bytes per sector of user data")] IMAPI_CD_SECTOR_MODE1, /// /// With this sector type, user data has 2336 bytes per sector/frame. All Mode 2 sector types are also known as "CD-ROM XA" modes, /// which allows mixing of audio and data tracks on a single disc. This sector type is also known as Mode 2 "Formless", is /// considered deprecated, and is very seldom used. /// [Description("2336 bytes per sector, rare XA form")] IMAPI_CD_SECTOR_MODE2FORM0, /// /// With this sector type, user data has 2048 bytes per sector/frame. All Mode 2 sector types are also known as "CD-ROM XA" modes, /// which allows mixing of audio and data tracks on a single disc. /// [Description("2048 bytes per sector, data XA form")] IMAPI_CD_SECTOR_MODE2FORM1, /// /// With this sector type, user data has 2336 bytes per sector/frame, of which the final four bytes are an optional CRC code (zero /// if not used). All Mode 2 sector types are also known as "CD-ROM XA" modes, which allows mixing of audio and data tracks on a /// single disc. This sector type is most often used when writing VideoCD discs. /// [Description("2336 bytes per sector, VideoCD form")] IMAPI_CD_SECTOR_MODE2FORM2, /// /// With this sector type, user data has 2352 bytes per sector/frame. This is pre-processed Mode1Cooked data sectors, with sector /// header, ECC/EDC, and scrambling already added to the data stream. /// [Description("2352 bytes per sector, Mode1 data (with EDC/ECC/scrambling)")] IMAPI_CD_SECTOR_MODE1RAW, /// /// With this sector type, user data has 2352 bytes per sector/frame. This is pre-processed Mode2Form0 data sectors, with sector /// header, ECC/EDC, and scrambling already added to the data stream. /// [Description("2352 bytes per sector, Mode2Form0 data (with EDC/ECC/scrambling)")] IMAPI_CD_SECTOR_MODE2FORM0RAW, /// /// With this sector type, user data has 2352 bytes per sector/frame. This is pre-processed Mode2Form1 data sectors, with sector /// header, ECC/EDC, and scrambling already added to the data stream. /// [Description("2352 bytes per sector, Mode2Form1 data (with EDC/ECC/scrambling)")] IMAPI_CD_SECTOR_MODE2FORM1RAW, /// /// With this sector type, user data has 2352 bytes per sector/frame. This is pre-processed Mode2Form2 data sectors, with sector /// header, ECC/EDC, and scrambling already added to the data stream. /// [Description("2352 bytes per sector, Mode2Form2 data (with EDC/ECC/scrambling)")] IMAPI_CD_SECTOR_MODE2FORM2RAW, } /// Defines the digital copy setting values available for a given track. // https://docs.microsoft.com/en-us/windows/win32/api/imapi2/ne-imapi2-imapi_cd_track_digital_copy_setting typedef enum // _IMAPI_CD_TRACK_DIGITAL_COPY_SETTING { IMAPI_CD_TRACK_DIGITAL_COPY_PERMITTED, IMAPI_CD_TRACK_DIGITAL_COPY_PROHIBITED, // IMAPI_CD_TRACK_DIGITAL_COPY_SCMS } IMAPI_CD_TRACK_DIGITAL_COPY_SETTING, *PIMAPI_CD_TRACK_DIGITAL_COPY_SETTING; [PInvokeData("imapi2.h", MSDNShortId = "NE:imapi2._IMAPI_CD_TRACK_DIGITAL_COPY_SETTING")] [Serializable] public enum IMAPI_CD_TRACK_DIGITAL_COPY_SETTING : int { /// Digital copies of the given track are allowed. [Description("Digital Copies Allowed")] IMAPI_CD_TRACK_DIGITAL_COPY_PERMITTED, /// /// Digital copies of the given track are not allowed using consumer electronics CD recorders. This condition typically has no /// effect on PC-based CD players. /// [Description("Digital Copies Not Allowed")] IMAPI_CD_TRACK_DIGITAL_COPY_PROHIBITED, /// /// The given track is a digital copy of a copy protected track. No further copies using consumer electronics CD recorders will be /// allowed. This condition typically has no effect on PC-based CD players. /// [Description("Copy of an Original Copy Prohibited Track")] IMAPI_CD_TRACK_DIGITAL_COPY_SCMS, } /// Defines values for the feature that are supported by the logical unit (CD and DVD device). /// /// /// Note that the range of feature type values is 0x0000 to 0xFFFF. This enumeration contains those features defined in the Multmedia /// Commands - 5 (MMC) specification. For a complete definition of each feature, see Feature Definitions in the latest release of the /// MMC specification at ftp://ftp.t10.org/t10/drafts/mmc5. /// /// /// Other values not defined here may exist. Consumers of this enumeration should not presume this list to be the only set of valid values. /// /// // https://docs.microsoft.com/en-us/windows/win32/api/imapi2/ne-imapi2-imapi_feature_page_type typedef enum _IMAPI_FEATURE_PAGE_TYPE { // IMAPI_FEATURE_PAGE_TYPE_PROFILE_LIST, IMAPI_FEATURE_PAGE_TYPE_CORE, IMAPI_FEATURE_PAGE_TYPE_MORPHING, // IMAPI_FEATURE_PAGE_TYPE_REMOVABLE_MEDIUM, IMAPI_FEATURE_PAGE_TYPE_WRITE_PROTECT, IMAPI_FEATURE_PAGE_TYPE_RANDOMLY_READABLE, // IMAPI_FEATURE_PAGE_TYPE_CD_MULTIREAD, IMAPI_FEATURE_PAGE_TYPE_CD_READ, IMAPI_FEATURE_PAGE_TYPE_DVD_READ, // IMAPI_FEATURE_PAGE_TYPE_RANDOMLY_WRITABLE, IMAPI_FEATURE_PAGE_TYPE_INCREMENTAL_STREAMING_WRITABLE, // IMAPI_FEATURE_PAGE_TYPE_SECTOR_ERASABLE, IMAPI_FEATURE_PAGE_TYPE_FORMATTABLE, IMAPI_FEATURE_PAGE_TYPE_HARDWARE_DEFECT_MANAGEMENT, // IMAPI_FEATURE_PAGE_TYPE_WRITE_ONCE, IMAPI_FEATURE_PAGE_TYPE_RESTRICTED_OVERWRITE, IMAPI_FEATURE_PAGE_TYPE_CDRW_CAV_WRITE, // IMAPI_FEATURE_PAGE_TYPE_MRW, IMAPI_FEATURE_PAGE_TYPE_ENHANCED_DEFECT_REPORTING, IMAPI_FEATURE_PAGE_TYPE_DVD_PLUS_RW, // IMAPI_FEATURE_PAGE_TYPE_DVD_PLUS_R, IMAPI_FEATURE_PAGE_TYPE_RIGID_RESTRICTED_OVERWRITE, IMAPI_FEATURE_PAGE_TYPE_CD_TRACK_AT_ONCE, // IMAPI_FEATURE_PAGE_TYPE_CD_MASTERING, IMAPI_FEATURE_PAGE_TYPE_DVD_DASH_WRITE, IMAPI_FEATURE_PAGE_TYPE_DOUBLE_DENSITY_CD_READ, // IMAPI_FEATURE_PAGE_TYPE_DOUBLE_DENSITY_CD_R_WRITE, IMAPI_FEATURE_PAGE_TYPE_DOUBLE_DENSITY_CD_RW_WRITE, // IMAPI_FEATURE_PAGE_TYPE_LAYER_JUMP_RECORDING, IMAPI_FEATURE_PAGE_TYPE_CD_RW_MEDIA_WRITE_SUPPORT, // IMAPI_FEATURE_PAGE_TYPE_BD_PSEUDO_OVERWRITE, IMAPI_FEATURE_PAGE_TYPE_DVD_PLUS_R_DUAL_LAYER, IMAPI_FEATURE_PAGE_TYPE_BD_READ, // IMAPI_FEATURE_PAGE_TYPE_BD_WRITE, IMAPI_FEATURE_PAGE_TYPE_HD_DVD_READ, IMAPI_FEATURE_PAGE_TYPE_HD_DVD_WRITE, // IMAPI_FEATURE_PAGE_TYPE_POWER_MANAGEMENT, IMAPI_FEATURE_PAGE_TYPE_SMART, IMAPI_FEATURE_PAGE_TYPE_EMBEDDED_CHANGER, // IMAPI_FEATURE_PAGE_TYPE_CD_ANALOG_PLAY, IMAPI_FEATURE_PAGE_TYPE_MICROCODE_UPDATE, IMAPI_FEATURE_PAGE_TYPE_TIMEOUT, // IMAPI_FEATURE_PAGE_TYPE_DVD_CSS, IMAPI_FEATURE_PAGE_TYPE_REAL_TIME_STREAMING, IMAPI_FEATURE_PAGE_TYPE_LOGICAL_UNIT_SERIAL_NUMBER, // IMAPI_FEATURE_PAGE_TYPE_MEDIA_SERIAL_NUMBER, IMAPI_FEATURE_PAGE_TYPE_DISC_CONTROL_BLOCKS, IMAPI_FEATURE_PAGE_TYPE_DVD_CPRM, // IMAPI_FEATURE_PAGE_TYPE_FIRMWARE_INFORMATION, IMAPI_FEATURE_PAGE_TYPE_AACS, IMAPI_FEATURE_PAGE_TYPE_VCPS } IMAPI_FEATURE_PAGE_TYPE, *PIMAPI_FEATURE_PAGE_TYPE; [PInvokeData("imapi2.h", MSDNShortId = "NE:imapi2._IMAPI_FEATURE_PAGE_TYPE")] [Serializable] public enum IMAPI_FEATURE_PAGE_TYPE { /// Identifies profiles supported by the logical unit. IMAPI_FEATURE_PAGE_TYPE_PROFILE_LIST = 0x0, /// Identifies a logical unit that supports functionality common to all devices. IMAPI_FEATURE_PAGE_TYPE_CORE = 0x1, /// /// Identifies the ability of the logical unit to notify an initiator about operational changes and accept initiator requests to /// prevent operational changes. /// IMAPI_FEATURE_PAGE_TYPE_MORPHING = 0x2, /// Identifies a logical unit that has a medium that is removable. IMAPI_FEATURE_PAGE_TYPE_REMOVABLE_MEDIUM = 0x3, /// Identifies reporting capability and changing capability for write protection status of the logical unit. IMAPI_FEATURE_PAGE_TYPE_WRITE_PROTECT = 0x4, /// Identifies a logical unit that is able to read data from logical blocks specified by Logical Block Addresses. IMAPI_FEATURE_PAGE_TYPE_RANDOMLY_READABLE = 0x10, /// /// Identifies a logical unit that conforms to the OSTA Multi-Read specification 1.00, with the exception of CD Play capability (the /// CD Audio Feature is not required). /// IMAPI_FEATURE_PAGE_TYPE_CD_MULTIREAD = 0x1D, /// /// Identifies a logical unit that is able to read CD specific information from the media and is able to read user data from all /// types of CD blocks. /// IMAPI_FEATURE_PAGE_TYPE_CD_READ = 0x1E, /// Identifies a logical unit that is able to read DVD specific information from the media. IMAPI_FEATURE_PAGE_TYPE_DVD_READ = 0x1F, /// Identifies a logical unit that is able to write data to logical blocks specified by Logical Block Addresses. IMAPI_FEATURE_PAGE_TYPE_RANDOMLY_WRITABLE = 0x20, /// /// Identifies a logical unit that is able to write data to a contiguous region, and is able to append data to a limited number of /// locations on the media. /// IMAPI_FEATURE_PAGE_TYPE_INCREMENTAL_STREAMING_WRITABLE = 0x21, /// /// Identifies a logical unit that supports erasable media and media that requires an erase pass before overwrite, such as some /// magneto-optical technologies. /// IMAPI_FEATURE_PAGE_TYPE_SECTOR_ERASABLE = 0x22, /// Identifies a logical unit that can format media into logical blocks. IMAPI_FEATURE_PAGE_TYPE_FORMATTABLE = 0x23, /// Identifies a logical unit that has defect management available to provide a defect-free contiguous address space. IMAPI_FEATURE_PAGE_TYPE_HARDWARE_DEFECT_MANAGEMENT = 0x24, /// Identifies a logical unit that has the ability to record to any previously unrecorded logical block. IMAPI_FEATURE_PAGE_TYPE_WRITE_ONCE = 0x25, /// Identifies a logical unit that has the ability to overwrite logical blocks only in fixed sets at a time. IMAPI_FEATURE_PAGE_TYPE_RESTRICTED_OVERWRITE = 0x26, /// Identifies a logical unit that has the ability to write CD-RW media that is designed for CAV recording. IMAPI_FEATURE_PAGE_TYPE_CDRW_CAV_WRITE = 0x27, /// Indicates that the logical unit is capable of reading a disc with the MRW format. IMAPI_FEATURE_PAGE_TYPE_MRW = 0x28, /// /// Identifies a logical unit that has the ability to perform media certification and recovered error reporting for logical unit /// assisted software defect management. /// IMAPI_FEATURE_PAGE_TYPE_ENHANCED_DEFECT_REPORTING = 0x29, /// Indicates that the logical unit is capable of reading a recorded DVD+RW disc. IMAPI_FEATURE_PAGE_TYPE_DVD_PLUS_RW = 0x2A, /// Indicates that the logical unit is capable of reading a recorded DVD+R disc. IMAPI_FEATURE_PAGE_TYPE_DVD_PLUS_R = 0x2B, /// Identifies a logical unit that has the ability to perform writing only on Blocking boundaries. IMAPI_FEATURE_PAGE_TYPE_RIGID_RESTRICTED_OVERWRITE = 0x2C, /// Identifies a logical unit that is able to write data to a CD track. IMAPI_FEATURE_PAGE_TYPE_CD_TRACK_AT_ONCE = 0x2D, /// Identifies a logical unit that is able to write a CD in Session at Once mode or Raw mode. IMAPI_FEATURE_PAGE_TYPE_CD_MASTERING = 0x2E, /// Identifies a logical unit that has the ability to write data to DVD-R/-RW in Disc at Once mode. IMAPI_FEATURE_PAGE_TYPE_DVD_DASH_WRITE = 0x2F, /// Identifies a logical unit that has the ability to read double density CD specific information from the media. IMAPI_FEATURE_PAGE_TYPE_DOUBLE_DENSITY_CD_READ = 0x30, /// Identifies a logical unit that has the ability to write to double density CD media. IMAPI_FEATURE_PAGE_TYPE_DOUBLE_DENSITY_CD_R_WRITE = 0x31, /// Identifies a logical unit that has the ability to write to double density CD-RW media. IMAPI_FEATURE_PAGE_TYPE_DOUBLE_DENSITY_CD_RW_WRITE = 0x32, /// /// Identifies a drive that is able to write data to contiguous regions that are allocated on multiplelayers, and is able to append /// data to a limited number of locations on the media. /// IMAPI_FEATURE_PAGE_TYPE_LAYER_JUMP_RECORDING = 0x33, /// Identifies a logical unit that has the ability to perform writing CD-RW media. IMAPI_FEATURE_PAGE_TYPE_CD_RW_MEDIA_WRITE_SUPPORT = 0x37, /// Identifies a drive that provides Logical Block overwrite service on BD-R discs that areformatted as SRM+POW. IMAPI_FEATURE_PAGE_TYPE_BD_PSEUDO_OVERWRITE = 0x38, /// Indicates that the drive is capable of reading a recorded DVD+R Double Layer disc IMAPI_FEATURE_PAGE_TYPE_DVD_PLUS_R_DUAL_LAYER = 0x3B, /// Identifies a logical unit that is able to read control structures and user data from the Blu-ray disc. IMAPI_FEATURE_PAGE_TYPE_BD_READ = 0x40, /// Identifies a drive that is able to write control structures and user data to writeable Blu-ray discs. IMAPI_FEATURE_PAGE_TYPE_BD_WRITE = 0x41, /// Identifies a drive that is able to read HD DVD specific information from the media. IMAPI_FEATURE_PAGE_TYPE_HD_DVD_READ = 0x50, /// Indicates the ability to write to HD DVD-R/-RW media. IMAPI_FEATURE_PAGE_TYPE_HD_DVD_WRITE = 0x51, /// Identifies a logical unit that is able to perform initiator and logical unit directed power management. IMAPI_FEATURE_PAGE_TYPE_POWER_MANAGEMENT = 0x100, /// Identifies a logical unit that is able to perform Self-Monitoring Analysis and Reporting Technology (S.M.A.R.T.). IMAPI_FEATURE_PAGE_TYPE_SMART, /// Identifies a logical unit that is able to move media from a storage area to a mechanism and back. IMAPI_FEATURE_PAGE_TYPE_EMBEDDED_CHANGER, /// Identifies a logical unit that is able to play CD Audio data directly to an external output. IMAPI_FEATURE_PAGE_TYPE_CD_ANALOG_PLAY, /// Identifies a logical unit that is able to upgrade its internal microcode via the interface. IMAPI_FEATURE_PAGE_TYPE_MICROCODE_UPDATE, /// Identifies a logical unit that is able to always respond to commands within a set time period. IMAPI_FEATURE_PAGE_TYPE_TIMEOUT, /// /// Identifies a logical unit that is able to perform DVD CSS/CPPM authentication and key management. This feature also indicates /// that the logical unit supports CSS for DVD-Video and CPPM for DVD-Audio. /// IMAPI_FEATURE_PAGE_TYPE_DVD_CSS, /// /// Identifies a logical unit that is able to perform reading and writing within initiator specified (and logical unit verified) /// performance ranges. This Feature also indicates whether the logical unit supports the stream playback operation. /// IMAPI_FEATURE_PAGE_TYPE_REAL_TIME_STREAMING, /// Identifies a logical unit that has a unique serial number. IMAPI_FEATURE_PAGE_TYPE_LOGICAL_UNIT_SERIAL_NUMBER, /// Identifies a logical unit that is capable of reading a media serial number of the currently installed media. IMAPI_FEATURE_PAGE_TYPE_MEDIA_SERIAL_NUMBER, /// Identifies a logical unit that is able to read and/or write Disc Control Blocks from or to the media. IMAPI_FEATURE_PAGE_TYPE_DISC_CONTROL_BLOCKS, /// Identifies a logical unit that is able to perform DVD CPRM and is able to perform CPRM authentication and key management. IMAPI_FEATURE_PAGE_TYPE_DVD_CPRM, /// /// Indicates that the logical unit provides the date and time of the creation of the current firmware revision loaded on the device. /// IMAPI_FEATURE_PAGE_TYPE_FIRMWARE_INFORMATION, /// Identifies a drive that supports AACS and is able to perform AACS authentication process. IMAPI_FEATURE_PAGE_TYPE_AACS, /// Identifies a Drive that is able to process disc data structures that are specified in theVCPS. IMAPI_FEATURE_PAGE_TYPE_VCPS = 0x110, } /// Reports information (but not errors) about the media state. [Description("Mask of 'supported/informational' media flags")] public const IMAPI_FORMAT2_DATA_MEDIA_STATE IMAPI_FORMAT2_DATA_MEDIA_STATE_INFORMATIONAL_MASK = (IMAPI_FORMAT2_DATA_MEDIA_STATE)0x000F; /// Reports an unsupported media state. [Description("Mask of 'not supported' media flags")] public const IMAPI_FORMAT2_DATA_MEDIA_STATE IMAPI_FORMAT2_DATA_MEDIA_STATE_UNSUPPORTED_MASK = (IMAPI_FORMAT2_DATA_MEDIA_STATE)0xFC00; /// Defines values for the possible media states. /// /// This enumeration should be treated as a bitmask. Nearly all of the values set one bit set to one and the other bits to zero. Three /// exceptions to this rule were added: unknown, unsupported media mask, and informational mask. For example, to test for unsupported /// media, check the value against IMAPI_FORMAT2_DATA_MEDIA_STATE_UNSUPPORTED_MASK. /// // https://docs.microsoft.com/en-us/windows/win32/api/imapi2/ne-imapi2-imapi_format2_data_media_state typedef enum // _IMAPI_FORMAT2_DATA_MEDIA_STATE { IMAPI_FORMAT2_DATA_MEDIA_STATE_UNKNOWN, IMAPI_FORMAT2_DATA_MEDIA_STATE_INFORMATIONAL_MASK, // IMAPI_FORMAT2_DATA_MEDIA_STATE_UNSUPPORTED_MASK, IMAPI_FORMAT2_DATA_MEDIA_STATE_OVERWRITE_ONLY, // IMAPI_FORMAT2_DATA_MEDIA_STATE_RANDOMLY_WRITABLE, IMAPI_FORMAT2_DATA_MEDIA_STATE_BLANK, IMAPI_FORMAT2_DATA_MEDIA_STATE_APPENDABLE, // IMAPI_FORMAT2_DATA_MEDIA_STATE_FINAL_SESSION, IMAPI_FORMAT2_DATA_MEDIA_STATE_DAMAGED, IMAPI_FORMAT2_DATA_MEDIA_STATE_ERASE_REQUIRED, // IMAPI_FORMAT2_DATA_MEDIA_STATE_NON_EMPTY_SESSION, IMAPI_FORMAT2_DATA_MEDIA_STATE_WRITE_PROTECTED, // IMAPI_FORMAT2_DATA_MEDIA_STATE_FINALIZED, IMAPI_FORMAT2_DATA_MEDIA_STATE_UNSUPPORTED_MEDIA } IMAPI_FORMAT2_DATA_MEDIA_STATE, *PIMAPI_FORMAT2_DATA_MEDIA_STATE; [PInvokeData("imapi2.h", MSDNShortId = "NE:imapi2._IMAPI_FORMAT2_DATA_MEDIA_STATE")] [Flags] [Serializable] public enum IMAPI_FORMAT2_DATA_MEDIA_STATE { /// Indicates that the interface does not know the media state. [Description("Unknown")] IMAPI_FORMAT2_DATA_MEDIA_STATE_UNKNOWN = 0x0, /// Write operations can occur on used portions of the disc. [Description("Media may only be overwritten")] IMAPI_FORMAT2_DATA_MEDIA_STATE_OVERWRITE_ONLY = 0x0001, /// Media has never been used, or has been erased. [Description("Media is blank")] IMAPI_FORMAT2_DATA_MEDIA_STATE_BLANK = 0x0002, /// Media is appendable (supports multiple sessions). [Description("Media is appendable")] IMAPI_FORMAT2_DATA_MEDIA_STATE_APPENDABLE = 0x0004, /// Media can have only one additional session added to it, or the media does not support multiple sessions. [Description("Media may only be written to one more time, or does not support multiple sessions")] IMAPI_FORMAT2_DATA_MEDIA_STATE_FINAL_SESSION = 0x0008, /// Media is not usable by this interface. The media might require an erase or other recovery. [Description("Media is not usable by data writer (may require erase or other recovery)")] IMAPI_FORMAT2_DATA_MEDIA_STATE_DAMAGED = 0x0400, /// Media must be erased prior to use by this interface. [Description("Media must be erased before use")] IMAPI_FORMAT2_DATA_MEDIA_STATE_ERASE_REQUIRED = 0x0800, /// Media has a partially written last session, which is not supported by this interface. [Description("Media has a partially written last session, which is not supported")] IMAPI_FORMAT2_DATA_MEDIA_STATE_NON_EMPTY_SESSION = 0x1000, /// Media or drive is write-protected. [Description("Media (or drive) is write protected")] IMAPI_FORMAT2_DATA_MEDIA_STATE_WRITE_PROTECTED = 0x2000, /// Media cannot be written to (finalized). [Description("Media cannot be written to (finalized)")] IMAPI_FORMAT2_DATA_MEDIA_STATE_FINALIZED = 0x4000, /// Media is not supported by this interface. [Description("Media is not supported by data writer")] IMAPI_FORMAT2_DATA_MEDIA_STATE_UNSUPPORTED_MEDIA = 0x8000, } /// Defines values that indicate the current state of the write operation when using the IDiscFormat2DataEventArgs interface. // https://docs.microsoft.com/en-us/windows/win32/api/imapi2/ne-imapi2-imapi_format2_data_write_action typedef enum // _IMAPI_FORMAT2_DATA_WRITE_ACTION { IMAPI_FORMAT2_DATA_WRITE_ACTION_VALIDATING_MEDIA, // IMAPI_FORMAT2_DATA_WRITE_ACTION_FORMATTING_MEDIA, IMAPI_FORMAT2_DATA_WRITE_ACTION_INITIALIZING_HARDWARE, // IMAPI_FORMAT2_DATA_WRITE_ACTION_CALIBRATING_POWER, IMAPI_FORMAT2_DATA_WRITE_ACTION_WRITING_DATA, // IMAPI_FORMAT2_DATA_WRITE_ACTION_FINALIZATION, IMAPI_FORMAT2_DATA_WRITE_ACTION_COMPLETED, IMAPI_FORMAT2_DATA_WRITE_ACTION_VERIFYING } // IMAPI_FORMAT2_DATA_WRITE_ACTION, *PIMAPI_FORMAT2_DATA_WRITE_ACTION; [PInvokeData("imapi2.h", MSDNShortId = "NE:imapi2._IMAPI_FORMAT2_DATA_WRITE_ACTION")] [Serializable] public enum IMAPI_FORMAT2_DATA_WRITE_ACTION { /// Validating that the current media is supported. [Description("Validating the current media is supported")] IMAPI_FORMAT2_DATA_WRITE_ACTION_VALIDATING_MEDIA, /// Formatting media, when required. [Description("Formatting media, when required (i.e. DVD+RW)")] IMAPI_FORMAT2_DATA_WRITE_ACTION_FORMATTING_MEDIA, /// Initializing the hardware, for example, setting drive write speeds. [Description("Initializing the drive")] IMAPI_FORMAT2_DATA_WRITE_ACTION_INITIALIZING_HARDWARE, /// Optimizing laser intensity for writing to the media. [Description("Calibrating the drive's write power")] IMAPI_FORMAT2_DATA_WRITE_ACTION_CALIBRATING_POWER, /// Writing data to the media. [Description("Writing user data to the media")] IMAPI_FORMAT2_DATA_WRITE_ACTION_WRITING_DATA, /// /// Finalizing the write. This state is media dependent and can include items such as closing the track or session, or finishing /// background formatting. /// [Description("Finalizing the media (synchronizing the cache, closing tracks/sessions, etc.")] IMAPI_FORMAT2_DATA_WRITE_ACTION_FINALIZATION, /// Successfully finished the write process. [Description("The write process has completed")] IMAPI_FORMAT2_DATA_WRITE_ACTION_COMPLETED, /// Verifying the integrity of the burned media. [Description("Performing requested burn verification")] IMAPI_FORMAT2_DATA_WRITE_ACTION_VERIFYING, } /// Defines values that indicate the type of sub-channel data. /// /// For details on the format of the sub-channel data, see Sub-Channel Field Formats in the latest release of the MMC specification at ftp://ftp.t10.org/t10/drafts/mmc5. /// // https://docs.microsoft.com/en-us/windows/win32/api/imapi2/ne-imapi2-imapi_format2_raw_cd_data_sector_type typedef enum // _IMAPI_FORMAT2_RAW_CD_DATA_SECTOR_TYPE { IMAPI_FORMAT2_RAW_CD_SUBCODE_PQ_ONLY, IMAPI_FORMAT2_RAW_CD_SUBCODE_IS_COOKED, // IMAPI_FORMAT2_RAW_CD_SUBCODE_IS_RAW } IMAPI_FORMAT2_RAW_CD_DATA_SECTOR_TYPE, *PIMAPI_FORMAT2_RAW_CD_DATA_SECTOR_TYPE; [PInvokeData("imapi2.h", MSDNShortId = "NE:imapi2._IMAPI_FORMAT2_RAW_CD_DATA_SECTOR_TYPE")] [Serializable] public enum IMAPI_FORMAT2_RAW_CD_DATA_SECTOR_TYPE { /// The data contains P and Q sub-channel data. [Description("Raw Main Channel P an Q Sub-channel data (type 0x01)")] IMAPI_FORMAT2_RAW_CD_SUBCODE_PQ_ONLY = 1, /// The data contains corrected and de-interleaved R-W sub-channel data. [Description("Raw Main Channel With Cooked P-W Subcode (type 0x02)")] IMAPI_FORMAT2_RAW_CD_SUBCODE_IS_COOKED, /// The data contains raw P-W sub-channel data that is returned in the order received from the disc surface. [Description("Raw Main Channel With Raw P-W Subcode (type 0x03)")] IMAPI_FORMAT2_RAW_CD_SUBCODE_IS_RAW, } /// Defines values that indicate the current state of the write operation when using the IDiscFormat2RawCDEventArgs interface. // https://docs.microsoft.com/en-us/windows/win32/api/imapi2/ne-imapi2-imapi_format2_raw_cd_write_action typedef enum // _IMAPI_FORMAT2_RAW_CD_WRITE_ACTION { IMAPI_FORMAT2_RAW_CD_WRITE_ACTION_UNKNOWN, IMAPI_FORMAT2_RAW_CD_WRITE_ACTION_PREPARING, // IMAPI_FORMAT2_RAW_CD_WRITE_ACTION_WRITING, IMAPI_FORMAT2_RAW_CD_WRITE_ACTION_FINISHING } IMAPI_FORMAT2_RAW_CD_WRITE_ACTION, *PIMAPI_FORMAT2_RAW_CD_WRITE_ACTION; [PInvokeData("imapi2.h", MSDNShortId = "NE:imapi2._IMAPI_FORMAT2_RAW_CD_WRITE_ACTION")] [Serializable] public enum IMAPI_FORMAT2_RAW_CD_WRITE_ACTION { /// Indicates an unknown state. [Description("Unknown")] IMAPI_FORMAT2_RAW_CD_WRITE_ACTION_UNKNOWN, /// Preparing to write the session. [Description("Preparing to write media")] IMAPI_FORMAT2_RAW_CD_WRITE_ACTION_PREPARING, /// Writing session data. [Description("Writing the media")] IMAPI_FORMAT2_RAW_CD_WRITE_ACTION_WRITING, /// Synchronizing the drive's cache with the end of the data written to disc. [Description("Finishing writing the media")] IMAPI_FORMAT2_RAW_CD_WRITE_ACTION_FINISHING, } /// /// Defines values that indicate the current state of the write operation when using the IDiscFormat2TrackAtOnceEventArgs interface. /// // https://docs.microsoft.com/en-us/windows/win32/api/imapi2/ne-imapi2-imapi_format2_tao_write_action typedef enum // _IMAPI_FORMAT2_TAO_WRITE_ACTION { IMAPI_FORMAT2_TAO_WRITE_ACTION_UNKNOWN, IMAPI_FORMAT2_TAO_WRITE_ACTION_PREPARING, // IMAPI_FORMAT2_TAO_WRITE_ACTION_WRITING, IMAPI_FORMAT2_TAO_WRITE_ACTION_FINISHING, IMAPI_FORMAT2_TAO_WRITE_ACTION_VERIFYING } // IMAPI_FORMAT2_TAO_WRITE_ACTION, *PIMAPI_FORMAT2_TAO_WRITE_ACTION; [PInvokeData("imapi2.h", MSDNShortId = "NE:imapi2._IMAPI_FORMAT2_TAO_WRITE_ACTION")] [Serializable] public enum IMAPI_FORMAT2_TAO_WRITE_ACTION { /// Indicates an unknown state. [Description("Unknown")] IMAPI_FORMAT2_TAO_WRITE_ACTION_UNKNOWN, /// Preparing to write the track. [Description("Preparing to write track")] IMAPI_FORMAT2_TAO_WRITE_ACTION_PREPARING, /// Writing the track. [Description("writing the track")] IMAPI_FORMAT2_TAO_WRITE_ACTION_WRITING, /// Closing the track or closing the session. [Description("closing the track")] IMAPI_FORMAT2_TAO_WRITE_ACTION_FINISHING, /// [Description("verifying track data")] IMAPI_FORMAT2_TAO_WRITE_ACTION_VERIFYING, } /// Defines values for the currently known media types supported by IMAPI. /// /// The values in the range 0x00000000..0x0000FFFF inclusive are reserved for extension by Microsoft. If third parties wish to report a /// media type not in this list using this enumeration (for example, if implementing IDiscFormat2Data::get_CurrentPhysicalMediaType to /// support a non-listed format) they should define values only in the range 0x00010000..0xFFFFFFFF for these media types. /// // https://docs.microsoft.com/en-us/windows/win32/api/imapi2/ne-imapi2-imapi_media_physical_type typedef enum _IMAPI_MEDIA_PHYSICAL_TYPE // { IMAPI_MEDIA_TYPE_UNKNOWN, IMAPI_MEDIA_TYPE_CDROM, IMAPI_MEDIA_TYPE_CDR, IMAPI_MEDIA_TYPE_CDRW, IMAPI_MEDIA_TYPE_DVDROM, // IMAPI_MEDIA_TYPE_DVDRAM, IMAPI_MEDIA_TYPE_DVDPLUSR, IMAPI_MEDIA_TYPE_DVDPLUSRW, IMAPI_MEDIA_TYPE_DVDPLUSR_DUALLAYER, // IMAPI_MEDIA_TYPE_DVDDASHR, IMAPI_MEDIA_TYPE_DVDDASHRW, IMAPI_MEDIA_TYPE_DVDDASHR_DUALLAYER, IMAPI_MEDIA_TYPE_DISK, // IMAPI_MEDIA_TYPE_DVDPLUSRW_DUALLAYER, IMAPI_MEDIA_TYPE_HDDVDROM, IMAPI_MEDIA_TYPE_HDDVDR, IMAPI_MEDIA_TYPE_HDDVDRAM, // IMAPI_MEDIA_TYPE_BDROM, IMAPI_MEDIA_TYPE_BDR, IMAPI_MEDIA_TYPE_BDRE, IMAPI_MEDIA_TYPE_MAX } IMAPI_MEDIA_PHYSICAL_TYPE, *PIMAPI_MEDIA_PHYSICAL_TYPE; [PInvokeData("imapi2.h", MSDNShortId = "NE:imapi2._IMAPI_MEDIA_PHYSICAL_TYPE")] [Serializable] public enum IMAPI_MEDIA_PHYSICAL_TYPE : int { /// The disc recorder contains an unknown media type or the recorder is empty. [Description("Media not present or unrecognized")] IMAPI_MEDIA_TYPE_UNKNOWN, /// The drive contains CD-ROM or CD-R/RW media. [Description("CD-ROM media")] IMAPI_MEDIA_TYPE_CDROM, /// The drive contains write once (CD-R) media. [Description("CD-R media")] IMAPI_MEDIA_TYPE_CDR, /// The drive contains rewritable (CD-RW) media. [Description("CD-RW media")] IMAPI_MEDIA_TYPE_CDRW, /// Either the DVD drive or DVD media is read-only. [Description("DVD-ROM media")] IMAPI_MEDIA_TYPE_DVDROM, /// The drive contains DVD-RAM media. [Description("DVD-RAM media")] IMAPI_MEDIA_TYPE_DVDRAM, /// The drive contains write once media that supports the DVD plus format (DVD+R) . [Description("DVD+R media")] IMAPI_MEDIA_TYPE_DVDPLUSR, /// The drive contains rewritable media that supports the DVD plus format (DVD+RW). [Description("DVD+RW media")] IMAPI_MEDIA_TYPE_DVDPLUSRW, /// The drive contains write once dual layer media that supports the DVD plus format (DVD+R DL). [Description("DVD+R dual layer media")] IMAPI_MEDIA_TYPE_DVDPLUSR_DUALLAYER, /// The drive contains write once media that supports the DVD dash format (DVD-R). [Description("DVD-R media")] IMAPI_MEDIA_TYPE_DVDDASHR, /// The drive contains rewritable media that supports the DVD dash format (DVD-RW). [Description("DVD-RW media")] IMAPI_MEDIA_TYPE_DVDDASHRW, /// The drive contains write once dual layer media that supports the DVD dash format (DVD-R DL). [Description("DVD-R dual layer media")] IMAPI_MEDIA_TYPE_DVDDASHR_DUALLAYER, /// /// The drive contains a media type that supports random-access writes. This media type supports hardware defect management that /// identifies and avoids using damaged tracks. /// [Description("Randomly writable media")] IMAPI_MEDIA_TYPE_DISK, /// The drive contains rewritable dual layer media that supports the DVD plus format (DVD+RW DL). [Description("DVD+RW dual layer media")] IMAPI_MEDIA_TYPE_DVDPLUSRW_DUALLAYER, /// The drive contains high definition read only DVD media (HD DVD-ROM). [Description("HD DVD-ROM media")] IMAPI_MEDIA_TYPE_HDDVDROM, /// The drive contains write once high definition media (HD DVD-R). [Description("HD DVD-R media")] IMAPI_MEDIA_TYPE_HDDVDR, /// The drive contains random access high definition media (HD DVD-RAM). [Description("HD DVD-RAM media")] IMAPI_MEDIA_TYPE_HDDVDRAM, /// The drive contains read only Blu-ray media (BD-ROM). [Description("BD-ROM media")] IMAPI_MEDIA_TYPE_BDROM, /// The drive contains write once Blu-ray media (BD-R). [Description("BD-R media")] IMAPI_MEDIA_TYPE_BDR, /// The drive contains rewritable Blu-ray media (BD-RE) media. [Description("BD-RE media")] IMAPI_MEDIA_TYPE_BDRE, /// This value is the maximum value defined in IMAPI_MEDIA_PHYSICAL_TYPE. [Description("Max value for a media type")] IMAPI_MEDIA_TYPE_MAX, } /// /// Defines values that indicate the media write protect status. One or more write protect values can be set on a given drive. /// // https://docs.microsoft.com/en-us/windows/win32/api/imapi2/ne-imapi2-imapi_media_write_protect_state typedef enum // _IMAPI_MEDIA_WRITE_PROTECT_STATE { IMAPI_WRITEPROTECTED_UNTIL_POWERDOWN, IMAPI_WRITEPROTECTED_BY_CARTRIDGE, // IMAPI_WRITEPROTECTED_BY_MEDIA_SPECIFIC_REASON, IMAPI_WRITEPROTECTED_BY_SOFTWARE_WRITE_PROTECT, // IMAPI_WRITEPROTECTED_BY_DISC_CONTROL_BLOCK, IMAPI_WRITEPROTECTED_READ_ONLY_MEDIA } IMAPI_MEDIA_WRITE_PROTECT_STATE, *PIMAPI_MEDIA_WRITE_PROTECT_STATE; [PInvokeData("imapi2.h", MSDNShortId = "NE:imapi2._IMAPI_MEDIA_WRITE_PROTECT_STATE")] [Flags] [Serializable] public enum IMAPI_MEDIA_WRITE_PROTECT_STATE { /// Power to the drive needs to be cycled before allowing writes to the media. [Description("Software Write Protected Until Powerdown")] IMAPI_WRITEPROTECTED_UNTIL_POWERDOWN = 0x00001, /// The media is in a cartridge with the write protect tab set. [Description("Cartridge Write Protect")] IMAPI_WRITEPROTECTED_BY_CARTRIDGE = 0x00002, /// The drive is disallowing writes for a media-specific reason. For example: [Description("Media Specific Write Inhibit")] IMAPI_WRITEPROTECTED_BY_MEDIA_SPECIFIC_REASON = 0x00004, /// /// A write-protect flag on the media is set. Various media types, such as DVD-RAM and DVD-RW, support a special area on the media /// to indicate the disc's write protect status. /// [Description("Persistent Write Protect")] IMAPI_WRITEPROTECTED_BY_SOFTWARE_WRITE_PROTECT = 0x00008, /// /// A write-protect flag in the disc control block of a DVD+RW disc is set. DVD+RW media can persistently alter the write protect /// state of media by writing a device control block (DCB) to the media. This value has limited usefulness because some DVD+RW /// drives do not recognize or honor this setting. /// [Description("Write Inhibit by Disc Control Block")] IMAPI_WRITEPROTECTED_BY_DISC_CONTROL_BLOCK = 0x00010, /// The drive does not recognize write capability of the media. [Description("Read-only media")] IMAPI_WRITEPROTECTED_READ_ONLY_MEDIA = 0x04000, } /// Defines values that indicate requests sent to a device using the MODE_SENSE10 MMC command. // https://docs.microsoft.com/en-us/windows/win32/api/imapi2/ne-imapi2-imapi_mode_page_request_type typedef enum // _IMAPI_MODE_PAGE_REQUEST_TYPE { IMAPI_MODE_PAGE_REQUEST_TYPE_CURRENT_VALUES, IMAPI_MODE_PAGE_REQUEST_TYPE_CHANGEABLE_VALUES, // IMAPI_MODE_PAGE_REQUEST_TYPE_DEFAULT_VALUES, IMAPI_MODE_PAGE_REQUEST_TYPE_SAVED_VALUES } IMAPI_MODE_PAGE_REQUEST_TYPE, *PIMAPI_MODE_PAGE_REQUEST_TYPE; [PInvokeData("imapi2.h", MSDNShortId = "NE:imapi2._IMAPI_MODE_PAGE_REQUEST_TYPE")] [Serializable] public enum IMAPI_MODE_PAGE_REQUEST_TYPE { /// /// Requests current settings of the mode page. This is the most common request type, and the most commonly supported type of this command. /// [Description("Request the current mode page")] IMAPI_MODE_PAGE_REQUEST_TYPE_CURRENT_VALUES, /// /// Requests a mask that indicates settings that are write enabled. A write-enabled setting has a corresponding bit that is set to /// one in the mask. A read-only setting has a corresponding bit that is set to zero in the mask . /// [Description("Request the changeable bitmask for a mode page")] IMAPI_MODE_PAGE_REQUEST_TYPE_CHANGEABLE_VALUES, /// Requests the power-on settings of the drive. [Description("Request the default mode page")] IMAPI_MODE_PAGE_REQUEST_TYPE_DEFAULT_VALUES, /// Requests a saved configuration for a drive. This functionality might not be supported on all devices. [Description("Request the saved mode page (if supported by device)")] IMAPI_MODE_PAGE_REQUEST_TYPE_SAVED_VALUES, } /// Defines values for the mode pages that are supported by CD and DVD devices. /// /// Note that the range of mode page type values is 0x0000 to 0xFFFF. This enumeration contains those features defined in the Multmedia /// Commands - 5 (MMC) specification. For a complete definition of each feature, see Mode Parameters for Multi-Media Devices in the /// latest release of the MMC specification at ftp://ftp.t10.org/t10/drafts/mmc5. /// // https://docs.microsoft.com/en-us/windows/win32/api/imapi2/ne-imapi2-imapi_mode_page_type typedef enum _IMAPI_MODE_PAGE_TYPE { // IMAPI_MODE_PAGE_TYPE_READ_WRITE_ERROR_RECOVERY, IMAPI_MODE_PAGE_TYPE_MRW, IMAPI_MODE_PAGE_TYPE_WRITE_PARAMETERS, // IMAPI_MODE_PAGE_TYPE_CACHING, IMAPI_MODE_PAGE_TYPE_INFORMATIONAL_EXCEPTIONS, IMAPI_MODE_PAGE_TYPE_TIMEOUT_AND_PROTECT, // IMAPI_MODE_PAGE_TYPE_POWER_CONDITION, IMAPI_MODE_PAGE_TYPE_LEGACY_CAPABILITIES } IMAPI_MODE_PAGE_TYPE, *PIMAPI_MODE_PAGE_TYPE; [PInvokeData("imapi2.h", MSDNShortId = "NE:imapi2._IMAPI_MODE_PAGE_TYPE")] [Serializable] public enum IMAPI_MODE_PAGE_TYPE { /// /// The mode page specifies the error recovery parameters thedrive uses during any command that performs a data read or write /// operation from the media. /// [Description("The parameters to use for error recovery during read and write operations")] IMAPI_MODE_PAGE_TYPE_READ_WRITE_ERROR_RECOVERY = 0x01, /// The mode page provides a method by which the host may control the special features of aMRW CD-RW Drive. [Description("Mt. Rainier (MRW) mode page for controlling MRW-specific features")] IMAPI_MODE_PAGE_TYPE_MRW = 0x03, /// The mode page provides parameters that are often needed in the execution ofcommands that write to the media. [Description("The parameters required to setup writing to and from some legacy media types")] IMAPI_MODE_PAGE_TYPE_WRITE_PARAMETERS = 0x05, /// The mode page contains parameters to enable or disable caching during read or write operations. [Description("The parameters to enable or disable the use of caching for read and/or write operations")] IMAPI_MODE_PAGE_TYPE_CACHING = 0x08, /// /// The mode page contains parameters for exception reporting mechanisms that result in specific sense code errors when failures are /// predicted. This mode page is related to the S.M.A.R.T. feature. /// [Description("The parameters for exception reporting mechanisms which result in specific sense codes errors when failures are predicted")] IMAPI_MODE_PAGE_TYPE_INFORMATIONAL_EXCEPTIONS = 0x1C, //? /// The mode page contains command time-out values that are suggested by the device. [Description("Default timeouts for commands")] IMAPI_MODE_PAGE_TYPE_TIMEOUT_AND_PROTECT = 0x1D, /// /// The mode page contains power management settings for the drive. The parameters define how long the logical unit delays before /// changing its internal power state. /// [Description("The parameters which define how long the logical unit delays before changing its power state")] IMAPI_MODE_PAGE_TYPE_POWER_CONDITION = 0x1A, /// /// The mode page contains legacy device capabilities. These are superseded by the feature pages returned through the /// GetConfiguration command. /// [Description("Legacy device capabilities, superceded by the feature pages returned by GetConfiguration command")] IMAPI_MODE_PAGE_TYPE_LEGACY_CAPABILITIES = 0x2A, } /// /// Defines values for the possible profiles of a CD and DVD device. A profile defines the type of media and features that the device supports. /// /// /// /// Note that the range of feature type values is 0x0000 to 0xFFFF. This enumeration contains those features defined in the Multmedia /// Commands - 5 (MMC) specification. For a complete definition of each profile, see Profile Definitions in the latest release of the /// MMC specification at ftp://ftp.t10.org/t10/drafts/mmc5. /// /// /// Other values not defined here may exist. Consumers of this enumeration should not presume this list to be the only set of valid values. /// /// // https://docs.microsoft.com/en-us/windows/win32/api/imapi2/ne-imapi2-imapi_profile_type typedef enum _IMAPI_PROFILE_TYPE { // IMAPI_PROFILE_TYPE_INVALID, IMAPI_PROFILE_TYPE_NON_REMOVABLE_DISK, IMAPI_PROFILE_TYPE_REMOVABLE_DISK, IMAPI_PROFILE_TYPE_MO_ERASABLE, // IMAPI_PROFILE_TYPE_MO_WRITE_ONCE, IMAPI_PROFILE_TYPE_AS_MO, IMAPI_PROFILE_TYPE_CDROM, IMAPI_PROFILE_TYPE_CD_RECORDABLE, // IMAPI_PROFILE_TYPE_CD_REWRITABLE, IMAPI_PROFILE_TYPE_DVDROM, IMAPI_PROFILE_TYPE_DVD_DASH_RECORDABLE, IMAPI_PROFILE_TYPE_DVD_RAM, // IMAPI_PROFILE_TYPE_DVD_DASH_REWRITABLE, IMAPI_PROFILE_TYPE_DVD_DASH_RW_SEQUENTIAL, IMAPI_PROFILE_TYPE_DVD_DASH_R_DUAL_SEQUENTIAL, // IMAPI_PROFILE_TYPE_DVD_DASH_R_DUAL_LAYER_JUMP, IMAPI_PROFILE_TYPE_DVD_PLUS_RW, IMAPI_PROFILE_TYPE_DVD_PLUS_R, // IMAPI_PROFILE_TYPE_DDCDROM, IMAPI_PROFILE_TYPE_DDCD_RECORDABLE, IMAPI_PROFILE_TYPE_DDCD_REWRITABLE, // IMAPI_PROFILE_TYPE_DVD_PLUS_RW_DUAL, IMAPI_PROFILE_TYPE_DVD_PLUS_R_DUAL, IMAPI_PROFILE_TYPE_BD_ROM, // IMAPI_PROFILE_TYPE_BD_R_SEQUENTIAL, IMAPI_PROFILE_TYPE_BD_R_RANDOM_RECORDING, IMAPI_PROFILE_TYPE_BD_REWRITABLE, // IMAPI_PROFILE_TYPE_HD_DVD_ROM, IMAPI_PROFILE_TYPE_HD_DVD_RECORDABLE, IMAPI_PROFILE_TYPE_HD_DVD_RAM, IMAPI_PROFILE_TYPE_NON_STANDARD } // IMAPI_PROFILE_TYPE, *PIMAPI_PROFILE_TYPE; [PInvokeData("imapi2.h", MSDNShortId = "NE:imapi2._IMAPI_PROFILE_TYPE")] [Serializable] public enum IMAPI_PROFILE_TYPE { /// The profile is not valid. IMAPI_PROFILE_TYPE_INVALID = 0, /// The hard disk it not removable. IMAPI_PROFILE_TYPE_NON_REMOVABLE_DISK, /// The hard disk is removable. IMAPI_PROFILE_TYPE_REMOVABLE_DISK, /// An Magneto-Optical Erasable drive. IMAPI_PROFILE_TYPE_MO_ERASABLE, /// A write once optical drive. IMAPI_PROFILE_TYPE_MO_WRITE_ONCE, /// An advance storage Magneto-Optical drive. IMAPI_PROFILE_TYPE_AS_MO, /// A CD-ROM drive. IMAPI_PROFILE_TYPE_CDROM = 0x08, /// A CD-R drive. IMAPI_PROFILE_TYPE_CD_RECORDABLE, /// A CD-RW or CD+RW drive. IMAPI_PROFILE_TYPE_CD_REWRITABLE, /// A DVD-ROM drive. IMAPI_PROFILE_TYPE_DVDROM = 0x10, /// A DVD-R sequential recording drive. IMAPI_PROFILE_TYPE_DVD_DASH_RECORDABLE, /// A DVD-RAM drive. IMAPI_PROFILE_TYPE_DVD_RAM, /// A DVD-RW restricted overwrite drive. IMAPI_PROFILE_TYPE_DVD_DASH_REWRITABLE, /// A DVD-RW sequential recording drive. IMAPI_PROFILE_TYPE_DVD_DASH_RW_SEQUENTIAL, /// A DVD-R dual layer sequential recording drive. IMAPI_PROFILE_TYPE_DVD_DASH_R_DUAL_SEQUENTIAL, /// A DVD-R dual layer jump recording drive. IMAPI_PROFILE_TYPE_DVD_DASH_R_DUAL_LAYER_JUMP, /// A DVD+RW drive. IMAPI_PROFILE_TYPE_DVD_PLUS_RW = 0x1a, /// A DVD+R drive. IMAPI_PROFILE_TYPE_DVD_PLUS_R, /// A double density CD drive. IMAPI_PROFILE_TYPE_DDCDROM = 0x20, /// A double density CD-R drive. IMAPI_PROFILE_TYPE_DDCD_RECORDABLE, /// A double density CD-RW drive. IMAPI_PROFILE_TYPE_DDCD_REWRITABLE, /// A DVD+RW dual layer drive. IMAPI_PROFILE_TYPE_DVD_PLUS_RW_DUAL = 0x2a, /// A DVD+R dual layer drive. IMAPI_PROFILE_TYPE_DVD_PLUS_R_DUAL, /// A Blu-ray read only drive. IMAPI_PROFILE_TYPE_BD_ROM = 0x40, /// A write once Blu-ray drive with sequential recording. IMAPI_PROFILE_TYPE_BD_R_SEQUENTIAL, /// A write once Blu-ray drive with random-access recording capability. IMAPI_PROFILE_TYPE_BD_R_RANDOM_RECORDING, /// A rewritable Blu-ray drive. IMAPI_PROFILE_TYPE_BD_REWRITABLE, /// A read only high density DVD drive. IMAPI_PROFILE_TYPE_HD_DVD_ROM = 0x50, /// A write once high density DVD drive. IMAPI_PROFILE_TYPE_HD_DVD_RECORDABLE, /// A high density DVD drive with random access positioning. IMAPI_PROFILE_TYPE_HD_DVD_RAM, /// Nonstandard drive. IMAPI_PROFILE_TYPE_NON_STANDARD = 0xffff, } /// /// Defines values that indicate how to interpret track addresses for the current disc profile of a randomly-writable, /// hardware-defect-managed media type. /// // https://docs.microsoft.com/en-us/windows/win32/api/imapi2/ne-imapi2-imapi_read_track_address_type typedef enum // _IMAPI_READ_TRACK_ADDRESS_TYPE { IMAPI_READ_TRACK_ADDRESS_TYPE_LBA, IMAPI_READ_TRACK_ADDRESS_TYPE_TRACK, // IMAPI_READ_TRACK_ADDRESS_TYPE_SESSION } IMAPI_READ_TRACK_ADDRESS_TYPE, *PIMAPI_READ_TRACK_ADDRESS_TYPE; [PInvokeData("imapi2.h", MSDNShortId = "NE:imapi2._IMAPI_READ_TRACK_ADDRESS_TYPE")] [Serializable] public enum IMAPI_READ_TRACK_ADDRESS_TYPE { /// /// Interpret the address field as an LBA (sector address). The returned data should reflect the information for the track which /// contains the specified LBA. /// IMAPI_READ_TRACK_ADDRESS_TYPE_LBA, /// /// Interpret the address field as a track number. The returned data should reflect the information for the specified track. This /// version of the command has the greatest compatibility with legacy devices. /// IMAPI_READ_TRACK_ADDRESS_TYPE_TRACK, /// /// Interpret the address field as a session number. The returned data should reflect the information for the first track which /// exists in the specified session. Note that not all drives support this method. /// IMAPI_READ_TRACK_ADDRESS_TYPE_SESSION, } internal class SafeArrayMarshaler : ICustomMarshaler { public static ICustomMarshaler GetInstance(string cookie) => new SafeArrayMarshaler(); void ICustomMarshaler.CleanUpManagedData(object ManagedObj) { } void ICustomMarshaler.CleanUpNativeData(IntPtr pNativeData) => SafeArrayDestroy(pNativeData); int ICustomMarshaler.GetNativeDataSize() => -1; IntPtr ICustomMarshaler.MarshalManagedToNative(object ManagedObj) => throw new NotImplementedException(); object ICustomMarshaler.MarshalNativeToManaged(IntPtr pNativeData) { var sa = new SafeSAFEARRAY(pNativeData, false); return sa.ToArray().Cast().ToArray(); } } } }