diff --git a/PInvoke/IMAPI/IMAPIv2.Enums.cs b/PInvoke/IMAPI/IMAPIv2.Enums.cs new file mode 100644 index 00000000..a2746223 --- /dev/null +++ b/PInvoke/IMAPI/IMAPIv2.Enums.cs @@ -0,0 +1,1035 @@ +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, + } + + /// 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, + + /// Reports information (but not errors) about the media state. + [Description("Mask of 'supported/informational' media flags")] + IMAPI_FORMAT2_DATA_MEDIA_STATE_INFORMATIONAL_MASK = 0x000F, + + /// Reports an unsupported media state. + [Description("Mask of 'not supported' media flags")] + IMAPI_FORMAT2_DATA_MEDIA_STATE_UNSUPPORTED_MASK = 0xFC00, + + /// 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(); + } + } + } +} \ No newline at end of file diff --git a/PInvoke/IMAPI/IMAPIv2.cs b/PInvoke/IMAPI/IMAPIv2.cs new file mode 100644 index 00000000..bbaff3b8 --- /dev/null +++ b/PInvoke/IMAPI/IMAPIv2.cs @@ -0,0 +1,4247 @@ +using System; +using System.Collections; +using System.Runtime.CompilerServices; +using System.Runtime.InteropServices; +using System.Runtime.InteropServices.ComTypes; +using System.Runtime.InteropServices.CustomMarshalers; +using Vanara.InteropServices; +using static Vanara.PInvoke.OleAut32; + +namespace Vanara.PInvoke +{ + /// Interfaces and constants for IMAPI v1 and v2. + public static partial class IMAPI + { + /// Implement this interface to receive notifications of the current write operation. + // https://docs.microsoft.com/en-us/windows/win32/api/imapi2/nn-imapi2-ddiscformat2dataevents + [PInvokeData("imapi2.h", MSDNShortId = "NN:imapi2.DDiscFormat2DataEvents")] + [ComImport, Guid("2735413C-7F64-5B0F-8F00-5D77AFBE261E"), InterfaceType(ComInterfaceType.InterfaceIsDual)] +#pragma warning disable IDE1006 // Naming Styles + public interface DDiscFormat2DataEvents + { + /// Implement this method to receive progress notification of the current write operation. + /// + /// The IDiscFormat2Data interface that initiated the write operation. + /// This parameter is a MsftDiscFormat2Data object in script. + /// + /// + /// An IDiscFormat2DataEventArgs interface that you use to determine the progress of the write operation. + /// This parameter is a MsftDiscFormat2Data object in script. + /// + /// Return values are ignored. + /// + /// Notifications are sent in response to calling the IDiscFormat2Data::Write method. + /// Notification is sent when the current action changes: + /// + /// + /// Once when initializing the hardware + /// + /// + /// Once when calibrating the power + /// + /// + /// Once when formatting the media, if required by the media type + /// + /// + /// Every 0.5 seconds during the write operation + /// + /// + /// Once after the operation completes + /// + /// + /// To stop the write process, call the IDiscFormat2Data::CancelWrite method. + /// + // https://docs.microsoft.com/en-us/windows/win32/api/imapi2/nf-imapi2-ddiscformat2dataevents-update HRESULT Update( IDispatch + // *object, IDispatch *progress ); + [DispId(0x200)] + [MethodImpl(MethodImplOptions.InternalCall, MethodCodeType = MethodCodeType.Runtime)] + [PreserveSig] + HRESULT Update([In, MarshalAs(UnmanagedType.IDispatch)] IDiscFormat2Data @object, + [In, MarshalAs(UnmanagedType.IDispatch)] IDiscFormat2DataEventArgs progress); + } + + /// Implement this interface to receive notifications of the current erase operation. + // https://docs.microsoft.com/en-us/windows/win32/api/imapi2/nn-imapi2-ddiscformat2eraseevents + [PInvokeData("imapi2.h", MSDNShortId = "NN:imapi2.DDiscFormat2EraseEvents")] + [ComImport, Guid("2735413A-7F64-5B0F-8F00-5D77AFBE261E"), InterfaceType(ComInterfaceType.InterfaceIsDual)] + public interface DDiscFormat2EraseEvents + { + /// Implement this method to receive progress notification of the current erase operation. + /// + /// The IDiscFormat2Erase interface that initiated the erase operation. + /// This parameter is a MsftDiscFormat2Erase object in script. + /// + /// Elapsed time, in seconds, of the erase operation. + /// Estimated time, in seconds, to complete the erase operation. + /// Return values are ignored. + /// + /// Notifications are sent in response to calling the IDiscFormat2Erase::EraseMedia method. + /// Notification is sent every 0.5 or 1.0 seconds depending on the method required to blank the media. + /// + /// Total time estimates for a single erasure can vary as the operation progresses. The drive provides updated information that can + /// affect the projected duration of the erasure. + /// + /// + // https://docs.microsoft.com/en-us/windows/win32/api/imapi2/nf-imapi2-ddiscformat2eraseevents-update HRESULT Update( IDispatch + // *object, LONG elapsedSeconds, LONG estimatedTotalSeconds ); + [DispId(0x200)] + [MethodImpl(MethodImplOptions.InternalCall, MethodCodeType = MethodCodeType.Runtime)] + [PreserveSig] + HRESULT Update([In, MarshalAs(UnmanagedType.IDispatch)] IDiscFormat2Erase @object, int elapsedSeconds, int estimatedTotalSeconds); + } + + /// Implement this interface to receive notifications of the current raw-image write operation. + // https://docs.microsoft.com/en-us/windows/win32/api/imapi2/nn-imapi2-ddiscformat2rawcdevents + [PInvokeData("imapi2.h", MSDNShortId = "NN:imapi2.DDiscFormat2RawCDEvents")] + [ComImport, Guid("27354142-7F64-5B0F-8F00-5D77AFBE261E"), InterfaceType(ComInterfaceType.InterfaceIsDual)] + public interface DDiscFormat2RawCDEvents + { + /// Implement this method to receive progress notification of the current raw-image write operation. + /// + /// The IDiscFormat2RawCD interface that initiated the write operation. + /// This parameter is a MsftDiscFormat2RawCD object in script. + /// + /// + /// An IDiscFormat2RawCDEventArgs interface that you use to determine the progress of the write operation. + /// This parameter is a MsftDiscFormat2RawCD object in script. + /// + /// Return values are ignored. + /// + /// Notifications are sent in response to calling the IDiscFormat2RawCD::WriteMedia or IDiscFormat2RawCD::WriteMedia2 method. + /// To stop the write process, call the IDiscFormat2RawCD::CancelWrite method. + /// + // https://docs.microsoft.com/en-us/windows/win32/api/imapi2/nf-imapi2-ddiscformat2rawcdevents-update HRESULT Update( IDispatch + // *object, IDispatch *progress ); + [DispId(0x200)] + [MethodImpl(MethodImplOptions.InternalCall, MethodCodeType = MethodCodeType.Runtime)] + [PreserveSig] + HRESULT Update([In, MarshalAs(UnmanagedType.IDispatch)] IDiscFormat2RawCD @object, + [In, MarshalAs(UnmanagedType.IDispatch)] IDiscFormat2RawCDEventArgs progress); + } + + /// Implement this interface to receive notifications of the current track-writing operation. + // https://docs.microsoft.com/en-us/windows/win32/api/imapi2/nn-imapi2-ddiscformat2trackatonceevents + [PInvokeData("imapi2.h", MSDNShortId = "NN:imapi2.DDiscFormat2TrackAtOnceEvents")] + [ComImport, Guid("2735413F-7F64-5B0F-8F00-5D77AFBE261E"), InterfaceType(ComInterfaceType.InterfaceIsDual)] + public interface DDiscFormat2TrackAtOnceEvents + { + /// Implement this method to receive progress notification of the current track-writing operation. + /// + /// The IDiscFormat2TrackAtOnce interface that initiated the write operation. + /// This parameter is a MsftDiscFormat2TrackAtOnce object in script. + /// + /// + /// An IDiscFormat2TrackAtOnceEventArgs interface that you use to determine the progress of the write operation. + /// This parameter is a MsftDiscFormat2TrackAtOnce object in script. + /// + /// Return values are ignored. + /// + /// Notifications are sent in response to calling the IDiscFormat2TrackAtOnce::AddAudioTrack method. + /// To stop the write process, call the IDiscFormat2TrackAtOnce::CancelAddTrack method. + /// + // https://docs.microsoft.com/en-us/windows/win32/api/imapi2/nf-imapi2-ddiscformat2trackatonceevents-update HRESULT Update( + // IDispatch *object, IDispatch *progress ); + [DispId(0x200)] + [MethodImpl(MethodImplOptions.InternalCall, MethodCodeType = MethodCodeType.Runtime)] + [PreserveSig] + HRESULT Update([In, MarshalAs(UnmanagedType.IDispatch)] IDiscFormat2TrackAtOnce @object, + [In, MarshalAs(UnmanagedType.IDispatch)] IDiscFormat2TrackAtOnceEventArgs progress); + } + + /// Implement this interface to receive notification when a CD or DVD device is added to or removed from the computer. + // https://docs.microsoft.com/en-us/windows/win32/api/imapi2/nn-imapi2-ddiscmaster2events + [PInvokeData("imapi2.h", MSDNShortId = "NN:imapi2.DDiscMaster2Events")] + [ComImport, Guid("27354131-7F64-5B0F-8F00-5D77AFBE261E"), InterfaceType(ComInterfaceType.InterfaceIsDual)] + public interface DDiscMaster2Events + { + /// Receives notification when an optical media device is added to the computer. + /// + /// An IDiscMaster2 interface that you can use to enumerate the devices on the computer. + /// This parameter is a MsftDiscMaster2 object in script. + /// + /// + /// String that contains an identifier that uniquely identifies the optical media device that was added to the computer. + /// + /// Return values are ignored. + // https://docs.microsoft.com/en-us/windows/win32/api/imapi2/nf-imapi2-ddiscmaster2events-notifydeviceadded HRESULT + // NotifyDeviceAdded( IDispatch *object, BSTR uniqueId ); + [DispId(0x100)] + [MethodImpl(MethodImplOptions.InternalCall, MethodCodeType = MethodCodeType.Runtime)] + [PreserveSig] + HRESULT NotifyDeviceAdded([In, MarshalAs(UnmanagedType.IDispatch)] IDiscMaster2 @object, [In, MarshalAs(UnmanagedType.BStr)] string uniqueId); + + /// Receives notification when an optical media device is removed from the computer. + /// + /// An IDiscMaster2 interface that you can use to enumerate the devices on the computer. + /// This parameter is a MsftDiscMaster2 object in script. + /// + /// + /// String that contains an identifier that uniquely identifies the optical media device that was added to the computer. + /// + /// Return values are ignored. + // https://docs.microsoft.com/en-us/windows/win32/api/imapi2/nf-imapi2-ddiscmaster2events-notifydeviceremoved HRESULT + // NotifyDeviceRemoved( IDispatch *object, BSTR uniqueId ); + [DispId(0x101)] + [MethodImpl(MethodImplOptions.InternalCall, MethodCodeType = MethodCodeType.Runtime)] + [PreserveSig] + HRESULT NotifyDeviceRemoved([In, MarshalAs(UnmanagedType.IDispatch)] IDiscMaster2 @object, [In, MarshalAs(UnmanagedType.BStr)] string uniqueId); + } + + /// Implement this interface to receive notifications of the current write operation. + // https://docs.microsoft.com/en-us/windows/win32/api/imapi2/nn-imapi2-dwriteengine2events + [PInvokeData("imapi2.h", MSDNShortId = "NN:imapi2.DWriteEngine2Events")] + [ComImport, Guid("27354137-7F64-5B0F-8F00-5D77AFBE261E"), InterfaceType(ComInterfaceType.InterfaceIsDual)] + public interface DWriteEngine2Events + { + /// Implement this method to receive progress notification of the current write operation. + /// + /// The IWriteEngine2 interface that initiated the write operation. + /// This parameter is a MsftWriteEngine2 object in script. + /// + /// + /// An IWriteEngine2EventArgs interface that you use to determine the progress of the write operation. + /// This parameter is a MsftWriteEngine2 object in script. + /// + /// Return values are ignored. + /// + /// Notifications are sent in response to calling the IWriteEngine2::WriteSection method. + /// Notification is sent: + /// + /// + /// Once before the operation begins + /// + /// + /// Every 0.5 seconds during the write operation + /// + /// + /// Once after the operation completes + /// + /// + /// To stop the write process, call the IWriteEngine2::CancelWrite method. + /// + // https://docs.microsoft.com/en-us/windows/win32/api/imapi2/nf-imapi2-dwriteengine2events-update HRESULT Update( IDispatch *object, + // IDispatch *progress ); + [DispId(0x100)] + [MethodImpl(MethodImplOptions.InternalCall, MethodCodeType = MethodCodeType.Runtime)] + [PreserveSig] + HRESULT Update([In, MarshalAs(UnmanagedType.IDispatch)] IWriteEngine2 @object, [In, MarshalAs(UnmanagedType.IDispatch)] IWriteEngine2EventArgs progress); + } + +#pragma warning restore IDE1006 // Naming Styles + + /// + /// Use this interface to retrieve information about a single continuous range of sectors on the media. This interface is typically + /// used together with the IBlockRangeList interface to describe a collection of sector ranges. + /// + /// + /// The values returned by the IBlockRange::get_StartLba and IBlockRange::get_EndLba methods define an inclusive range, i.e. both + /// the start and end sectors belong to the range. + /// + // https://docs.microsoft.com/en-us/windows/win32/api/imapi2/nn-imapi2-iblockrange + [PInvokeData("imapi2.h", MSDNShortId = "NN:imapi2.IBlockRange")] + [ComImport, Guid("B507CA25-2204-11DD-966A-001AA01BBC58"), InterfaceType(ComInterfaceType.InterfaceIsDual), CoClass(typeof(BlockRange))] + public interface IBlockRange + { + /// Retrieves the start sector of the range described by IBlockRange. + /// The start sector of the range. + // https://docs.microsoft.com/en-us/windows/win32/api/imapi2/nf-imapi2-iblockrange-get_startlba + // HRESULT get_StartLba( LONG *value ); + [DispId(0x100)] + int StartLba { get; } + + /// Retrieves the end sector of the range specified by the IBlockRange interface. + /// The end sector of the range. + /// The sector number returned by this method is included in the range. + // https://docs.microsoft.com/en-us/windows/win32/api/imapi2/nf-imapi2-iblockrange-get_endlba + // HRESULT get_EndLba( LONG *value ); + [DispId(0x101)] + int EndLba { get; } + } + + /// + /// Use this interface to retrieve a list of continuous sector ranges on the media. This interface is used to describe the sectors + /// that need to be updated on a rewritable disc when a new logical session is recorded. + /// + /// + /// + /// IBlockRangeList is returned by the IFileSystemImageResult2::ModifiedBlocks method. Alternatively, + /// IUnknown::QueryInterface can be called on the object returned by IFileSystemImageResult::get_ImageStream to get the list of + /// modified sectors in the result image represented by that object. + /// + /// + /// The order of sector ranges in IBlockRangeList is taken into account during burning. The sector ranges having lower + /// indexes in the safe array returned by IBlockRangeList::get_BlockRanges are written before those with higher indexes. + /// + /// + // https://docs.microsoft.com/en-us/windows/win32/api/imapi2/nn-imapi2-iblockrangelist + [PInvokeData("imapi2.h", MSDNShortId = "NN:imapi2.IBlockRangeList")] + [ComImport, Guid("B507CA26-2204-11DD-966A-001AA01BBC58"), InterfaceType(ComInterfaceType.InterfaceIsDual), CoClass(typeof(BlockRangeList))] + public interface IBlockRangeList + { + /// Returns the list of sector ranges in the form of a safe array of variants of type VT_Dispatch. + /// + /// List of sector ranges. Each element of the list is a VARIANT of type VT_Dispatch. Query the pdispVal member of the variant + /// for the IBlockRange interface. + /// + /// + /// The order of sector ranges in IBlockRangeList is taken into account during burning. The sector ranges having lower indexes + /// in the safe array returned by IBlockRangeList::get_BlockRanges are written before those with higher indexes. + /// + // https://docs.microsoft.com/en-us/windows/win32/api/imapi2/nf-imapi2-iblockrangelist-get_blockranges + // HRESULT get_BlockRanges( SAFEARRAY **value ); + [DispId(0x100)] + IBlockRange[] BlockRanges { [return: MarshalAs(UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof(SafeArrayMarshaler))] get; } + } + + /// + /// Use this interface with IDiscFormat2Data or IDiscFormat2TrackAtOnce to get or set the Burn Verification Level property which + /// dictates how burned media is verified for integrity after the write operation. + /// + /// + /// + /// The following example function demonstrates how the burn verification level defined by IMAPI_BURN_VERIFICATION_LEVEL, can be + /// implemented. Burn verification level should be set prior to a burn operation. + /// + /// + /// #include <imapi2.h> HRESULT setBurnVerification( IDiscFormat2Data *DataWriter, IMAPI_BURN_VERIFICATION_LEVEL VerificationLevel ) { HRESULT hr = S_OK; IBurnVerification *burnVerifier = NULL; hr = DataWriter->QueryInterface(IID_PPV_ARGS(&burnVerifier)); if (SUCCEEDED(hr)) { hr = burnVerifier->put_BurnVerificationLevel(VerificationLevel); } if (burnVerifier != NULL) { burnVerifier->Release(); burnVerifier = NULL; } return hr; } + /// + /// + /// This interface 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/nn-imapi2-iburnverification + [PInvokeData("imapi2.h", MSDNShortId = "NN:imapi2.IBurnVerification")] + [ComImport, Guid("D2FFD834-958B-426d-8470-2A13879C6A91"), InterfaceType(ComInterfaceType.InterfaceIsDual)] + public interface IBurnVerification + { + /// Retrieves the current Burn Verification Level. + /// Pointer to an IMAPI_BURN_VERIFICATION_LEVEL enumeration that specifies the current the Burn Verification Level. + /// + /// This method 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/nf-imapi2-iburnverification-get_burnverificationlevel HRESULT + // get_BurnVerificationLevel( IMAPI_BURN_VERIFICATION_LEVEL *value ); + [DispId(0x400)] + IMAPI_BURN_VERIFICATION_LEVEL BurnVerificationLevel { set; get; } + } + + /// + [ComImport, Guid("27354153-9F64-5B0F-8F00-5D77AFBE261E"), InterfaceType(ComInterfaceType.InterfaceIsDual), CoClass(typeof(MsftDiscFormat2Data))] + public interface IDiscFormat2Data : IDiskFormat2 + { + /// Determines if the recorder supports the given format. + /// An IDiscRecorder2 interface of the recorder to test. + /// Is VARIANT_TRUE if the recorder supports the given format; otherwise, VARIANT_FALSE. + /// + /// When implemented by the IDiscFormat2RawCD interface, this method will return E_IMAPI_DF2RAW_MEDIA_IS_NOT_SUPPORTED in the event + /// the recorder does not support the given format. It is important to note that in this specific scenario the value does not + /// indicate that an error has occurred, but rather the result of a successful operation. + /// + // https://docs.microsoft.com/en-us/windows/win32/api/imapi2/nf-imapi2-idiscformat2-isrecordersupported HRESULT IsRecorderSupported( + // IDiscRecorder2 *recorder, VARIANT_BOOL *value ); + [DispId(2048)] + [return: MarshalAs(UnmanagedType.VariantBool)] + new bool IsRecorderSupported(IDiscRecorder2 recorder); + + /// Determines if the current media in a supported recorder supports the given format. + /// An IDiscRecorder2 interface of the recorder to test. + /// + /// Is VARIANT_TRUE if the media in the recorder supports the given format; otherwise, VARIANT_FALSE. + /// Note VARIANT_TRUE also implies that the result from IsDiscRecorderSupported is VARIANT_TRUE. + /// + // https://docs.microsoft.com/en-us/windows/win32/api/imapi2/nf-imapi2-idiscformat2-iscurrentmediasupported HRESULT + // IsCurrentMediaSupported( IDiscRecorder2 *recorder, VARIANT_BOOL *value ); + [DispId(2049)] + [return: MarshalAs(UnmanagedType.VariantBool)] + new bool IsCurrentMediaSupported(IDiscRecorder2 recorder); + + /// Determines if the current media is reported as physically blank by the drive. + /// Is VARIANT_TRUE if the disc is physically blank; otherwise, VARIANT_FALSE. + // https://docs.microsoft.com/en-us/windows/win32/api/imapi2/nf-imapi2-idiscformat2-get_mediaphysicallyblank HRESULT + // get_MediaPhysicallyBlank( VARIANT_BOOL *value ); + [DispId(1792)] + new bool MediaPhysicallyBlank { [return: MarshalAs(UnmanagedType.VariantBool)] get; } + + /// Attempts to determine if the media is blank using heuristics (mainly for DVD+RW and DVD-RAM media). + /// Is VARIANT_TRUE if the disc is likely to be blank; otherwise; VARIANT_FALSE. + /// + /// + /// This method checks, for example, for a mounted file system on the device, verifying the first and last 2MB of the disc are + /// filled with zeros, and other media-specific checks. These checks can help to determine if the media may have files on it for + /// media that cannot be erased physically to a blank status. + /// + /// For a positive check that a disc is blank, call the IDiscFormat2::get_MediaPhysicallyBlank method. + /// + // https://docs.microsoft.com/en-us/windows/win32/api/imapi2/nf-imapi2-idiscformat2-get_mediaheuristicallyblank HRESULT + // get_MediaHeuristicallyBlank( VARIANT_BOOL *value ); + [DispId(1793)] + new bool MediaHeuristicallyBlank { [return: MarshalAs(UnmanagedType.VariantBool)] get; } + + /// Retrieves the media types that are supported by the current implementation of the IDiscFormat2 interface. + /// + /// List of media types supported by the current implementation of the IDiscFormat2 interface. Each element of the array is a + /// VARIANT of type VT_I4. The lVal member of VARIANT contains the media type. For a list of media + /// types, see the IMAPI_MEDIA_PHYSICAL_TYPE enumeration type. + /// + // https://docs.microsoft.com/en-us/windows/win32/api/imapi2/nf-imapi2-idiscformat2-get_supportedmediatypes HRESULT + // get_SupportedMediaTypes( SAFEARRAY **value ); + [DispId(1794)] + new IMAPI_MEDIA_PHYSICAL_TYPE[] SupportedMediaTypes { [return: MarshalAs(UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof(SafeArrayMarshaler))] get; } + + /// Sets the recording device to use for the write operation. + /// An IDiscRecorder2 interface that identifies the recording device to use in the write operation. + /// + /// The recorder must be compatible with the format defined by this interface. To determine compatibility, call the + /// IDiscFormat2::IsRecorderSupported method. + /// + // https://docs.microsoft.com/en-us/windows/win32/api/imapi2/nf-imapi2-idiscformat2data-put_recorder HRESULT put_Recorder( + // IDiscRecorder2 *value ); + [DispId(256)] + IDiscRecorder2 Recorder { set; [return: MarshalAs(UnmanagedType.Interface)] get; } + + /// Determines if Buffer Underrun Free recording is enabled. + /// + /// Set to VARIANT_TRUE to disable Buffer Underrun Free recording; otherwise, VARIANT_FALSE. The default is VARIANT_FALSE (enabled). + /// + /// + /// Buffer underrun can be an issue if the data stream does not enter the buffer fast enough to keep the device continuously + /// writing. In turn, the stop and start action of writing can cause data on the disc to be unusable. Buffer Underrun Free (BUF) + /// recording allows the laser to start and stop without damaging data already written to the disc. Disabling of BUF recording is + /// possible only on CD-R/RW media. + /// + // https://docs.microsoft.com/en-us/windows/win32/api/imapi2/nf-imapi2-idiscformat2data-put_bufferunderrunfreedisabled HRESULT + // put_BufferUnderrunFreeDisabled( VARIANT_BOOL value ); + [DispId(257)] + bool BufferUnderrunFreeDisabled { set; [return: MarshalAs(UnmanagedType.VariantBool)] get; } + + /// Determines if the data stream contains post-writing gaps. + /// Set to VARIANT_TRUE if the data stream contains post-writing gaps; otherwise, VARIANT_FALSE. The default is VARIANT_FALSE. + /// + /// Note that writing to CD-R/RW media will automatically append a post-gap of 150 sectors, unless this property is explicitly disabled. + /// + // https://docs.microsoft.com/en-us/windows/win32/api/imapi2/nf-imapi2-idiscformat2data-put_postgapalreadyinimage HRESULT + // put_PostgapAlreadyInImage( VARIANT_BOOL value ); + [DispId(260)] + bool PostgapAlreadyInImage { set; [return: MarshalAs(UnmanagedType.VariantBool)] get; } + + /// Retrieves the current state of the media in the device. + /// + /// State of the media in the disc device. For possible values, see the IMAPI_FORMAT2_DATA_MEDIA_STATE enumeration type. Note that + /// more than one state can be set. + /// + /// For an example that uses this property, see Checking Media Support. + // https://docs.microsoft.com/en-us/windows/win32/api/imapi2/nf-imapi2-idiscformat2data-get_currentmediastatus HRESULT + // get_CurrentMediaStatus( IMAPI_FORMAT2_DATA_MEDIA_STATE *value ); + [DispId(262)] + IMAPI_FORMAT2_DATA_MEDIA_STATE CurrentMediaStatus { get; } + + /// Retrieves the current write protect state of the media in the device. + /// + /// + /// The current write protect state of the media in the device. For possible values, see the IMAPI_MEDIA_WRITE_PROTECT_STATE + /// enumeration type. + /// + /// Note that more than one state can be set. + /// + // https://docs.microsoft.com/en-us/windows/win32/api/imapi2/nf-imapi2-idiscformat2data-get_writeprotectstatus HRESULT + // get_WriteProtectStatus( IMAPI_MEDIA_WRITE_PROTECT_STATE *value ); + [DispId(263)] + IMAPI_MEDIA_WRITE_PROTECT_STATE WriteProtectStatus { get; } + + /// Retrieves the number of sectors on the media in the device. + /// Number of sectors on the media in the device. The number includes free sectors, used sectors, and the boot sector. + /// This value does not necessarily reflect the total usable sectors on the media, not even for a blank disc. + // https://docs.microsoft.com/en-us/windows/win32/api/imapi2/nf-imapi2-idiscformat2data-get_totalsectorsonmedia HRESULT + // get_TotalSectorsOnMedia( LONG *value ); + [DispId(264)] + int TotalSectorsOnMedia { get; } + + /// Retrieves the number of free sectors on the disc for incremental recording (without overwriting existing data). + /// Number of free sectors on the media in the device. + /// + /// + /// The value of this property is effectively the number of sectors available on disc for the write operation. The value filters + /// sectors consumed in managing the disc space and data quality, such as run-out blocks and postgaps. + /// + /// + /// Note For overwritable discs, which have only one physical session, the number of free sectors indicated by value will + /// always be the total number of sectors on the disc. + /// + /// + /// If IDiscFormat2Data::put_ForceOverwrite is set to VARIANT_TRUE, use the IDiscFormat2Data::get_TotalSectorsOnMedia property instead. + /// + /// + // https://docs.microsoft.com/en-us/windows/win32/api/imapi2/nf-imapi2-idiscformat2data-get_freesectorsonmedia HRESULT + // get_FreeSectorsOnMedia( LONG *value ); + [DispId(265)] + int FreeSectorsOnMedia { get; } + + /// Retrieves the location for the next write operation. + /// Address where the next write operation begins. + /// + /// Blank media begin writing at location zero. + /// In multi-session writing, the next writable address is useful for setting up a correct file system. + /// + // https://docs.microsoft.com/en-us/windows/win32/api/imapi2/nf-imapi2-idiscformat2data-get_nextwritableaddress HRESULT + // get_NextWritableAddress( LONG *value ); + [DispId(266)] + int NextWritableAddress { get; } + + /// Retrieves the first sector of the previous write session. + /// + /// Address where the previous write operation began. + /// + /// The value is -1 if the media is blank or does not support multi-session writing (indicates that no previous session could be detected). + /// + /// + /// + /// Note This property should not be used. Instead, you should use an interface derived from IMultisession, such as + /// IMultisessionSequential, for importing file data from the previous session. + /// + // https://docs.microsoft.com/en-us/windows/win32/api/imapi2/nf-imapi2-idiscformat2data-get_startaddressofprevioussession HRESULT + // get_StartAddressOfPreviousSession( LONG *value ); + [DispId(267)] + int StartAddressOfPreviousSession { get; } + + /// Retrieves the last sector of the previous write session. + /// + /// Address where the previous write operation ended. + /// + /// The value is -1 if the media is blank or does not support multi-session writing (indicates that no previous session could be detected). + /// + /// + /// + /// Note This property should not be used. Instead, you should use an interface derived from IMultisession, such as + /// IMultisessionSequential, for importing file data from the previous session. + /// + // https://docs.microsoft.com/en-us/windows/win32/api/imapi2/nf-imapi2-idiscformat2data-get_lastwrittenaddressofprevioussession + // HRESULT get_LastWrittenAddressOfPreviousSession( LONG *value ); + [DispId(268)] + int LastWrittenAddressOfPreviousSession { get; } + + /// Determines if further additions to the file system are prevented. + /// + /// Set to VARIANT_TRUE to mark the disc as closed to prohibit additional writes when the next write session ends. + /// Set to VARIANT_FALSE to keep the disc open for subsequent write sessions. The default is VARIANT_FALSE. + /// + /// + /// + /// When the free space on a disc reaches 2% or less, the write process marks the disc closed, regardless of the value of this + /// property. This action ensures that a disc has enough free space to record a file system in a write session. + /// + /// You can erase a rewritable disc that is marked closed. + /// + /// Note that the IDiscFormat2Data::put_DisableConsumerDvdCompatibilityMode property may supersede this property. Please refer to + /// put_DisableConsumerDvdCompatibilityMode for details. + /// + /// + // https://docs.microsoft.com/en-us/windows/win32/api/imapi2/nf-imapi2-idiscformat2data-put_forcemediatobeclosed HRESULT + // put_ForceMediaToBeClosed( VARIANT_BOOL value ); + [DispId(269)] + bool ForceMediaToBeClosed { set; [return: MarshalAs(UnmanagedType.VariantBool)] get; } + + /// Determines if a DVD recording session includes tasks that can increase the chance that a device can play the DVD. + /// + /// + /// Set to VARIANT_TRUE to skip the tasks that allow the disc to play on more consumer devices. Removing compatibility reduces the + /// recording session time and the need for less free space on disc. + /// + /// Set to VARIANT_FALSE to increase the chance that a device can play the DVD. The default is VARIANT_FALSE. + /// + /// + /// This property has no affect on CD media and DVD dash media. + /// For DVD+R and DVD+DL media, this property will also affect the media closing operation. + /// + /// + /// Value of DisableConsumerDvdCompatibilityMode + /// Value of ForceMediaToBeClosed + /// Closure operation + /// + /// + /// False + /// True + /// Closes the disc in compatible mode + /// + /// + /// Fale + /// False + /// Closes the disc in compatible mode + /// + /// + /// True + /// True + /// Closes the disc normally + /// + /// + /// True + /// False + /// Closes the session for DVD+RCloses disc normally for DVD+R DL + /// + /// + /// + // https://docs.microsoft.com/en-us/windows/win32/api/imapi2/nf-imapi2-idiscformat2data-put_disableconsumerdvdcompatibilitymode + // HRESULT put_DisableConsumerDvdCompatibilityMode( VARIANT_BOOL value ); + [DispId(270)] + bool DisableConsumerDvdCompatibilityMode { set; [return: MarshalAs(UnmanagedType.VariantBool)] get; } + + /// Retrieves the type of media in the disc device. + /// Type of media in the disc device. For possible values, see the IMAPI_MEDIA_PHYSICAL_TYPEenumeration type. + // https://docs.microsoft.com/en-us/windows/win32/api/imapi2/nf-imapi2-idiscformat2data-get_currentphysicalmediatype HRESULT + // get_CurrentPhysicalMediaType( IMAPI_MEDIA_PHYSICAL_TYPE *value ); + [DispId(271)] + IMAPI_MEDIA_PHYSICAL_TYPE CurrentPhysicalMediaType { get; } + + /// Sets the friendly name of the client. + /// Name of the client application. Cannot be NULL or an empty string. + /// + /// + /// The name is used when the write operation requests exclusive access to the device. The IDiscRecorder2::get_ExclusiveAccessOwner + /// property contains the name of the client that has the lock. + /// + /// + /// Because any application with read/write access to the CDROM device during the write operation can use the + /// IOCTL_CDROM_EXCLUSIVE_ACCESS (query) control code (see the Microsoft Windows Driver Development Kit (DDK)) to access the name, + /// it is important that the name identify the program that is using this interface to write to the media. The name is restricted to + /// the same character set as required by the IOCTL_CDROM_EXCLUSIVE_ACCESS control code. + /// + /// + // https://docs.microsoft.com/en-us/windows/win32/api/imapi2/nf-imapi2-idiscformat2data-put_clientname HRESULT put_ClientName( BSTR + // value ); + [DispId(272)] + string ClientName { set; [return: MarshalAs(UnmanagedType.BStr)] get; } + + /// Retrieves the requested write speed. + /// + /// Requested write speed measured in disc sectors per second. + /// A value of 0xFFFFFFFF (-1) requests that the write occurs using the fastest supported speed for the media. + /// + /// This is the value specified in the most recent call to the IDiscFormat2Data::SetWriteSpeed method. + // https://docs.microsoft.com/en-us/windows/win32/api/imapi2/nf-imapi2-idiscformat2data-get_requestedwritespeed HRESULT + // get_RequestedWriteSpeed( LONG *value ); + [DispId(273)] + int RequestedWriteSpeed { get; } + + /// Retrieves the requested rotational-speed control type. + /// + /// Requested rotational-speed control type. Is VARIANT_TRUE for constant angular velocity (CAV) rotational-speed control type. + /// Otherwise, is VARIANT_FALSE for any other rotational-speed control type that the recorder supports. + /// + /// This is the value specified in the most recent call to the IDiscFormat2Data::SetWriteSpeed method. + // https://docs.microsoft.com/en-us/windows/win32/api/imapi2/nf-imapi2-idiscformat2data-get_requestedrotationtypeispurecav HRESULT + // get_RequestedRotationTypeIsPureCAV( VARIANT_BOOL *value ); + [DispId(274)] + bool RequestedRotationTypeIsPureCAV { [return: MarshalAs(UnmanagedType.VariantBool)] get; } + + /// Retrieves the drive's current write speed. + /// The write speed of the current media, measured in sectors per second. + /// + /// To retrieve the requested write speed, call the IDiscFormat2Data::get_RequestedWriteSpeed method. + /// + /// To retrieve a list of the write speeds that the recorder and current media supports, call the + /// IDiscFormat2Data::get_SupportedWriteSpeeds method. + /// + /// + /// Note that the write speed is based on the media write speeds. The value of this property can change when a media change occurs. + /// + /// + // https://docs.microsoft.com/en-us/windows/win32/api/imapi2/nf-imapi2-idiscformat2data-get_currentwritespeed HRESULT + // get_CurrentWriteSpeed( LONG *value ); + [DispId(275)] + int CurrentWriteSpeed { get; } + + /// Retrieves the current rotational-speed control used by the recorder. + /// + /// Is VARIANT_TRUE if constant angular velocity (CAV) rotational-speed control is in use. Otherwise, VARIANT_FALSE to indicate that + /// another rotational-speed control that the recorder supports is in use. + /// + /// + /// To retrieve the requested rotational-speed control, call the IDiscFormat2Data::get_RequestedRotationTypeIsPureCAV method. + /// Rotational-speed control types include the following: + /// + /// + /// CLV (Constant Linear Velocity). The disc is written at a constant speed. Standard rotational control. + /// + /// + /// CAV (Constant Angular Velocity). The disc is written at a constantly increasing speed. + /// + /// + /// + /// ZCAV (Zone Constant Linear Velocity). The disc is divided into zones. After each zone, the write speed increases. This is an + /// impure form of CAV. + /// + /// + /// + /// + /// PCAV (Partial Constant Angular Velocity). The disc speed increases up to a specified velocity. Once reached, the disc spins at + /// the specified velocity for the duration of the disc writing. + /// + /// + /// + /// + // https://docs.microsoft.com/en-us/windows/win32/api/imapi2/nf-imapi2-idiscformat2data-get_currentrotationtypeispurecav HRESULT + // get_CurrentRotationTypeIsPureCAV( VARIANT_BOOL *value ); + [DispId(276)] + bool CurrentRotationTypeIsPureCAV { [return: MarshalAs(UnmanagedType.VariantBool)] get; } + + /// Retrieves a list of the write speeds supported by the disc recorder and current media. + /// + /// List of the write speeds supported by the disc recorder and current media. Each element of the array is a VARIANT of type + /// VT_UI4. The ulVal member of the variant contains the number of sectors written per second. + /// + /// + /// You can use a speed from the list to set the write speed when calling the IDiscFormat2Data::SetWriteSpeed method. + /// + /// To retrieve a list of the write configurations that the recorder and current media supports, call the + /// IDiscFormat2Data::get_SupportedWriteSpeedDescriptors method. + /// + /// + // https://docs.microsoft.com/en-us/windows/win32/api/imapi2/nf-imapi2-idiscformat2data-get_supportedwritespeeds HRESULT + // get_SupportedWriteSpeeds( SAFEARRAY **supportedSpeeds ); + [DispId(277)] + uint[] SupportedWriteSpeeds { [return: MarshalAs(UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof(SafeArrayMarshaler))] get; } + + /// Retrieves a list of the detailed write configurations supported by the disc recorder and current media. + /// + /// List of the detailed write configurations supported by the disc recorder and current media. Each element of the array is a + /// VARIANT of type VT_Dispatch. Query the pdispVal member of the variant for the IWriteSpeedDescriptor + /// interface, which contains the media type, write speed, rotational-speed control type. + /// + /// + /// To retrieve a list of the write speeds that the recorder and current media supports, call the + /// IDiscFormat2Data::get_SupportedWriteSpeeds method. + /// + // https://docs.microsoft.com/en-us/windows/win32/api/imapi2/nf-imapi2-idiscformat2data-get_supportedwritespeeddescriptors HRESULT + // get_SupportedWriteSpeedDescriptors( SAFEARRAY **supportedSpeedDescriptors ); + [DispId(278)] + IWriteSpeedDescriptor[] SupportedWriteSpeedDescriptors { [return: MarshalAs(UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof(SafeArrayMarshaler))] get; } + + /// Determines if the data writer must overwrite the disc on overwritable media types. + /// + /// Is VARIANT_TRUE if the data writer must overwrite the disc on overwritable media types; otherwise, VARIANT_FALSE. The default is VARIANT_FALSE. + /// + // https://docs.microsoft.com/en-us/windows/win32/api/imapi2/nf-imapi2-idiscformat2data-put_forceoverwrite HRESULT + // put_ForceOverwrite( VARIANT_BOOL value ); + [DispId(279)] + bool ForceOverwrite { set; [return: MarshalAs(UnmanagedType.VariantBool)] get; } + + /// Retrieves a list of available multi-session interfaces. + /// + /// List of available multi-session interfaces. Each element of the array is a VARIANT of type VT_DISPATCH. Query the + /// pdispVal member of the variant for any interface that inherits from IMultisession interface, for example, IMultisessionSequential. + /// + /// The array will always contain at least one element. + // https://docs.microsoft.com/en-us/windows/win32/api/imapi2/nf-imapi2-idiscformat2data-get_multisessioninterfaces HRESULT + // get_MultisessionInterfaces( SAFEARRAY **value ); + [DispId(280)] + IMultisession[] MultisessionInterfaces { [return: MarshalAs(UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof(SafeArrayMarshaler))] get; } + + /// Writes the data stream to the device. + /// An IStream interface of the data stream to write. + /// + /// Before calling this method, you must call the following methods: + /// + /// + /// IDiscFormat2Data::put_Recorder + /// + /// + /// IDiscFormat2Data::put_ClientName + /// + /// + /// You should also consider calling the following methods if their default values are not appropriate for your application: + /// + /// + /// IDiscFormat2Data::put_BufferUnderrunFreeDisabled + /// + /// + /// IDiscFormat2Data::put_DisableConsumerDvdCompatibilityMode + /// + /// + /// IDiscFormat2Data::put_ForceMediaToBeClosed + /// + /// + /// IDiscFormat2Data::put_ForceOverwrite + /// + /// + /// IDiscFormat2Data::put_PostgapAlreadyInImage + /// + /// + /// IDiscFormat2Data::SetWriteSpeed + /// + /// + /// + /// This method is synchronous, which means that control is not returned until the provided IStream is recorded to the media. + /// To determine the progress of the write operation, you must implement the DDiscFormat2DataEvents interface. For examples that + /// show how to implement an event handler in a script, see Monitoring Progress With Events. + /// + /// + /// On sequentially recorded discs, the provided IStream is recorded as a new session. On rewritable discs, the provided + /// IStream is always recorded starting from sector 0, but the object providing the IStream interface can also provide + /// the IBlockRangeList interface listing the sectors that need to be recorded. The IBlockRangeList interface is used to + /// avoid rewriting of sectors that have not changed in multisession scenarios. If the object providing IStream does not + /// provide IBlockRangeList, it is assumed that the entire IStream needs to be recorded. + /// + /// + // https://docs.microsoft.com/en-us/windows/win32/api/imapi2/nf-imapi2-idiscformat2data-write HRESULT Write( IStream *data ); + [DispId(512)] + void Write([In, MarshalAs(UnmanagedType.Interface)] IStream data); + + /// Cancels the current write operation. + /// + /// + /// To cancel the write operation, you must call this method from the DDiscFormat2DataEvents::Update event handler that you implemented. + /// + /// + /// Note that calling this method does not immediately cancel the write operation on all media due to media-specific requirements. + /// For example, when writing to a CD, the write operation can continue for up to three more minutes. + /// + /// + /// This method leaves the media in an indeterminate state. For rewriteable media, you should call the IDiscFormat2Erase::EraseMedia + /// method after calling this method to prepare the media for future use. + /// + /// + // https://docs.microsoft.com/en-us/windows/win32/api/imapi2/nf-imapi2-idiscformat2data-cancelwrite HRESULT CancelWrite(); + [DispId(513)] + void CancelWrite(); + + /// Sets the write speed of the disc recorder. + /// + /// Requested write speed measured in disc sectors per second. + /// + /// A value of 0xFFFFFFFF (-1) requests that the write occurs using the fastest supported speed for the media. This is the default. + /// + /// + /// + /// Requested rotational-speed control type. Set to VARIANT_TRUE to request constant angular velocity (CAV) rotational-speed control + /// type. Set to VARIANT_FALSE to use another rotational-speed control type that the recorder supports. The default is VARIANT_FALSE. + /// + /// + /// + /// This method sets the write speed and type of rotational-speed control for a recorder. Requested values might differ from the + /// values set in the recorder. To specify the recorder, call the IDiscFormat2Data::put_Recorder method. + /// + /// + /// If the recorder supports the requested write speed, the disc device uses the requested value. If the recorder does not support + /// the requested write speed, the recorder uses a write speed that it does support that is closest to the requested value. The + /// IDiscFormat2Data::get_CurrentWriteSpeed property contains the value used by the recorder. + /// + /// + /// To retrieve a list of the write speeds that the recorder and current media supports, call the + /// IDiscFormat2Data::get_SupportedWriteSpeeds method. + /// + /// + /// If you request constant angular velocity (CAV) for rotational-speed control type and the recorder does not support CAV, the disc + /// device uses another type of rotational-speed control type that it supports. The + /// IDiscFormat2Data::get_CurrentRotationTypeIsPureCAV property indicates the value used by the recorder. + /// + /// + /// To retrieve the requested values, call the IDiscFormat2Data::get_RequestedWriteSpeed and + /// IDiscFormat2Data::get_RequestedRotationTypeIsPureCAV methods. + /// + /// + // https://docs.microsoft.com/en-us/windows/win32/api/imapi2/nf-imapi2-idiscformat2data-setwritespeed HRESULT SetWriteSpeed( LONG + // RequestedSectorsPerSecond, VARIANT_BOOL RotationTypeIsPureCAV ); + [DispId(514)] + void SetWriteSpeed(int RequestedSectorsPerSecond, [In, MarshalAs(UnmanagedType.VariantBool)] bool RotationTypeIsPureCAV); + } + + /// + /// Use this interface to retrieve information about the current write operation. + /// This interface is passed to the DDiscFormat2DataEvents::Update method that you implement. + /// + // https://docs.microsoft.com/en-us/windows/win32/api/imapi2/nn-imapi2-idiscformat2dataeventargs + [PInvokeData("imapi2.h", MSDNShortId = "NN:imapi2.IDiscFormat2DataEventArgs")] + [ComImport, Guid("2735413D-7F64-5B0F-8F00-5D77AFBE261E"), InterfaceType(ComInterfaceType.InterfaceIsDual)] + public interface IDiscFormat2DataEventArgs : IWriteEngine2EventArgs + { + /// Retrieves the starting logical block address (LBA) of the current write operation. + /// Starting logical block address of the write operation. Negative values for LBAs are supported. + /// This is the same value passed to the IWriteEngine2::WriteSection method. + // https://docs.microsoft.com/en-us/windows/win32/api/imapi2/nf-imapi2-iwriteengine2eventargs-get_startlba HRESULT get_StartLba( + // LONG *value ); + [DispId(0x100)] + new int StartLba { get; } + + /// Retrieves the number of sectors to write to the device in the current write operation. + /// The number of sectors to write in the current write operation. + /// This is the same value passed to the IWriteEngine2::WriteSection method. + // https://docs.microsoft.com/en-us/windows/win32/api/imapi2/nf-imapi2-iwriteengine2eventargs-get_sectorcount HRESULT + // get_SectorCount( LONG *value ); + [DispId(0x101)] + new int SectorCount { get; } + + /// Retrieves the address of the sector most recently read from the burn image. + /// Logical block address of the sector most recently read from the input data stream. + // https://docs.microsoft.com/en-us/windows/win32/api/imapi2/nf-imapi2-iwriteengine2eventargs-get_lastreadlba HRESULT + // get_LastReadLba( LONG *value ); + [DispId(0x102)] + new int LastReadLba { get; } + + /// Retrieves the address of the sector most recently written to the device. + /// Logical block address of the sector most recently written to the device. + // https://docs.microsoft.com/en-us/windows/win32/api/imapi2/nf-imapi2-iwriteengine2eventargs-get_lastwrittenlba HRESULT + // get_LastWrittenLba( LONG *value ); + [DispId(0x103)] + new int LastWrittenLba { get; } + + /// Retrieves the size of the internal data buffer that is used for writing to disc. + /// Size, in bytes, of the internal data buffer that is used for writing to disc. + // https://docs.microsoft.com/en-us/windows/win32/api/imapi2/nf-imapi2-iwriteengine2eventargs-get_totalsystembuffer HRESULT + // get_TotalSystemBuffer( LONG *value ); + [DispId(0x106)] + new int TotalSystemBuffer { get; } + + /// Retrieves the number of used bytes in the internal data buffer that is used for writing to disc. + /// Size, in bytes, of the used portion of the internal data buffer that is used for writing to disc. + /// This value increases as data is read into the buffer and decreases as data is written to disc. + // https://docs.microsoft.com/en-us/windows/win32/api/imapi2/nf-imapi2-iwriteengine2eventargs-get_usedsystembuffer HRESULT + // get_UsedSystemBuffer( LONG *value ); + [DispId(0x107)] + new int UsedSystemBuffer { get; } + + /// Retrieves the number of unused bytes in the internal data buffer that is used for writing to disc. + /// Size, in bytes, of the unused portion of the internal data buffer that is used for writing to disc. + /// This method returns the same value as if you subtracted IWriteEngine2EventArgs::get_UsedSystemBuffer from IWriteEngine2EventArgs::get_TotalSystemBuffer. + // https://docs.microsoft.com/en-us/windows/win32/api/imapi2/nf-imapi2-iwriteengine2eventargs-get_freesystembuffer HRESULT + // get_FreeSystemBuffer( LONG *value ); + [DispId(0x108)] + new int FreeSystemBuffer { get; } + + /// Retrieves the total elapsed time of the write operation. + /// Elapsed time, in seconds, of the write operation. + // https://docs.microsoft.com/en-us/windows/win32/api/imapi2/nf-imapi2-idiscformat2dataeventargs-get_elapsedtime HRESULT + // get_ElapsedTime( LONG *value ); + [DispId(768)] + int ElapsedTime { get; } + + /// Retrieves the estimated remaining time of the write operation. + /// Estimated time, in seconds, needed for the remainder of the write operation. + /// + /// The estimate for a single write operation can vary as the operation progresses. The drive provides updated information that can + /// affect the projected duration of the write operation. + /// + // https://docs.microsoft.com/en-us/windows/win32/api/imapi2/nf-imapi2-idiscformat2dataeventargs-get_remainingtime HRESULT + // get_RemainingTime( LONG *value ); + [DispId(769)] + int RemainingTime { get; } + + /// Retrieves the estimated total time for write operation. + /// Estimated time, in seconds, for write operation. + /// + /// The estimate for a single write operation can vary as the operation progresses. The drive provides updated information that can + /// affect the projected duration of the write operation. + /// + // https://docs.microsoft.com/en-us/windows/win32/api/imapi2/nf-imapi2-idiscformat2dataeventargs-get_totaltime HRESULT + // get_TotalTime( LONG *value ); + [DispId(770)] + int TotalTime { get; } + + /// Retrieves the current write action being performed. + /// + /// Current write action being performed. For a list of possible actions, see the IMAPI_FORMAT2_DATA_WRITE_ACTION enumeration type. + /// + // https://docs.microsoft.com/en-us/windows/win32/api/imapi2/nf-imapi2-idiscformat2dataeventargs-get_currentaction HRESULT + // get_CurrentAction( IMAPI_FORMAT2_DATA_WRITE_ACTION *value ); + [DispId(771)] + IMAPI_FORMAT2_DATA_WRITE_ACTION CurrentAction { get; } + } + + /// + /// Use this interface to erase data from a disc. + /// + /// To create an instance of this interface, call the CoCreateInstance function. Use__uuidof(MsftDiscFormat2Erase) for the class + /// identifier and __uuidof(IDiscFormat2Erase) for the interface identifier. + /// + /// + /// + /// To create the MsftDiscFormat2Erase object in a script, use IMAPI2.MsftDiscFormat2Erase as the program identifier when calling CreateObject. + /// + // https://docs.microsoft.com/en-us/windows/win32/api/imapi2/nn-imapi2-idiscformat2erase + [PInvokeData("imapi2.h", MSDNShortId = "NN:imapi2.IDiscFormat2Erase")] + [ComImport, Guid("27354156-8F64-5B0F-8F00-5D77AFBE261E"), InterfaceType(ComInterfaceType.InterfaceIsDual), CoClass(typeof(MsftDiscFormat2Erase))] + public interface IDiscFormat2Erase : IDiskFormat2 + { + /// Determines if the recorder supports the given format. + /// An IDiscRecorder2 interface of the recorder to test. + /// Is VARIANT_TRUE if the recorder supports the given format; otherwise, VARIANT_FALSE. + /// + /// When implemented by the IDiscFormat2RawCD interface, this method will return E_IMAPI_DF2RAW_MEDIA_IS_NOT_SUPPORTED in the event + /// the recorder does not support the given format. It is important to note that in this specific scenario the value does not + /// indicate that an error has occurred, but rather the result of a successful operation. + /// + // https://docs.microsoft.com/en-us/windows/win32/api/imapi2/nf-imapi2-idiscformat2-isrecordersupported HRESULT IsRecorderSupported( + // IDiscRecorder2 *recorder, VARIANT_BOOL *value ); + [DispId(2048)] + [return: MarshalAs(UnmanagedType.VariantBool)] + new bool IsRecorderSupported(IDiscRecorder2 recorder); + + /// Determines if the current media in a supported recorder supports the given format. + /// An IDiscRecorder2 interface of the recorder to test. + /// + /// Is VARIANT_TRUE if the media in the recorder supports the given format; otherwise, VARIANT_FALSE. + /// Note VARIANT_TRUE also implies that the result from IsDiscRecorderSupported is VARIANT_TRUE. + /// + // https://docs.microsoft.com/en-us/windows/win32/api/imapi2/nf-imapi2-idiscformat2-iscurrentmediasupported HRESULT + // IsCurrentMediaSupported( IDiscRecorder2 *recorder, VARIANT_BOOL *value ); + [DispId(2049)] + [return: MarshalAs(UnmanagedType.VariantBool)] + new bool IsCurrentMediaSupported(IDiscRecorder2 recorder); + + /// Determines if the current media is reported as physically blank by the drive. + /// Is VARIANT_TRUE if the disc is physically blank; otherwise, VARIANT_FALSE. + // https://docs.microsoft.com/en-us/windows/win32/api/imapi2/nf-imapi2-idiscformat2-get_mediaphysicallyblank HRESULT + // get_MediaPhysicallyBlank( VARIANT_BOOL *value ); + [DispId(1792)] + new bool MediaPhysicallyBlank { [return: MarshalAs(UnmanagedType.VariantBool)] get; } + + /// Attempts to determine if the media is blank using heuristics (mainly for DVD+RW and DVD-RAM media). + /// Is VARIANT_TRUE if the disc is likely to be blank; otherwise; VARIANT_FALSE. + /// + /// + /// This method checks, for example, for a mounted file system on the device, verifying the first and last 2MB of the disc are + /// filled with zeros, and other media-specific checks. These checks can help to determine if the media may have files on it for + /// media that cannot be erased physically to a blank status. + /// + /// For a positive check that a disc is blank, call the IDiscFormat2::get_MediaPhysicallyBlank method. + /// + // https://docs.microsoft.com/en-us/windows/win32/api/imapi2/nf-imapi2-idiscformat2-get_mediaheuristicallyblank HRESULT + // get_MediaHeuristicallyBlank( VARIANT_BOOL *value ); + [DispId(1793)] + new bool MediaHeuristicallyBlank { [return: MarshalAs(UnmanagedType.VariantBool)] get; } + + /// Retrieves the media types that are supported by the current implementation of the IDiscFormat2 interface. + /// + /// List of media types supported by the current implementation of the IDiscFormat2 interface. Each element of the array is a + /// VARIANT of type VT_I4. The lVal member of VARIANT contains the media type. For a list of media + /// types, see the IMAPI_MEDIA_PHYSICAL_TYPE enumeration type. + /// + // https://docs.microsoft.com/en-us/windows/win32/api/imapi2/nf-imapi2-idiscformat2-get_supportedmediatypes HRESULT + // get_SupportedMediaTypes( SAFEARRAY **value ); + [DispId(1794)] + new IMAPI_MEDIA_PHYSICAL_TYPE[] SupportedMediaTypes { [return: MarshalAs(UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof(SafeArrayMarshaler))] get; } + + /// Sets the recording device to use in the erase operation. + /// An IDiscRecorder2 interface that identifies the recording device to use in the erase operation. + /// + /// The recorder must be compatible with the format defined by this interface. To determine compatibility, call the + /// IDiscFormat2::IsRecorderSupported method. + /// + // https://docs.microsoft.com/en-us/windows/win32/api/imapi2/nf-imapi2-idiscformat2erase-put_recorder HRESULT put_Recorder( + // IDiscRecorder2 *value ); + [DispId(0x100)] + IDiscRecorder2 Recorder { set; [return: MarshalAs(UnmanagedType.Interface)] get; } + + /// Determines the quality of the disc erasure. + /// + /// Set to VARIANT_TRUE to fully erase the disc by overwriting the entire medium at least once. + /// + /// Set to VARIANT_FALSE to overwrite the directory tracks, but not the entire disc. This option requires less time to perform than + /// the full erase option. + /// + /// The default is VARIANT_FALSE. + /// + // https://docs.microsoft.com/en-us/windows/win32/api/imapi2/nf-imapi2-idiscformat2erase-put_fullerase HRESULT put_FullErase( + // VARIANT_BOOL value ); + [DispId(0x101)] + bool FullErase { set; [return: MarshalAs(UnmanagedType.VariantBool)] get; } + + /// Retrieves the type of media in the disc device. + /// Type of media in the disc device. For possible values, see the IMAPI_MEDIA_PHYSICAL_TYPEenumeration type. + // https://docs.microsoft.com/en-us/windows/win32/api/imapi2/nf-imapi2-idiscformat2erase-get_currentphysicalmediatype HRESULT + // get_CurrentPhysicalMediaType( IMAPI_MEDIA_PHYSICAL_TYPE *value ); + [DispId(0x102)] + IMAPI_MEDIA_PHYSICAL_TYPE CurrentPhysicalMediaType { get; } + + /// Sets the friendly name of the client. + /// Name of the client application. + /// + /// + /// The name is used when the write operation requests exclusive access to the device. The IDiscRecorder2::get_ExclusiveAccessOwner + /// property contains the name of the client that has the lock. + /// + /// + /// Because any application with read/write access to the CDROM device during the erase operation can use the + /// IOCTL_CDROM_EXCLUSIVE_ACCESS (query) control code (see the Microsoft Windows Driver Development Kit (DDK)) to access the name, + /// it is important that the name identify the program that is using this interface to erase to the media. The name is restricted to + /// the same character set as required by the IOCTL_CDROM_EXCLUSIVE_ACCESS control code. + /// + /// + // https://docs.microsoft.com/en-us/windows/win32/api/imapi2/nf-imapi2-idiscformat2erase-put_clientname HRESULT put_ClientName( BSTR + // value ); + [DispId(0x103)] + string ClientName { set; [return: MarshalAs(UnmanagedType.BStr)] get; } + + /// Erases the media in the active disc recorder. + /// + /// Synchronously erases the media. Progress can be reported by calling into registered events of type DDiscFormat2EraseEvents. + /// Before calling this method, you must call the following methods: + /// + /// + /// IDiscFormat2Erase::put_Recorder + /// + /// + /// IDiscFormat2Erase::put_ClientName + /// + /// + /// + /// You should also consider calling the IDiscFormat2Erase::put_FullErase method if its default value is not appropriate for your application. + /// + /// + /// This method is synchronous. To determine the progress of the erase operation, you must implement the DDiscFormat2EraseEvents + /// interface. For examples that show how to implement an event handler in a script, see Monitoring Progress With Events. + /// + /// + /// Currently, the E_IMAPI_ERASE_TOOK_LONGER_THAN_ONE_HOUR value is returned if an attempt to perform an erase on CD-RW or DVD-RW + /// media via the IDiscFormat2Erase interface fails as a result of the media being bad or a drive failure. + /// + /// + // https://docs.microsoft.com/en-us/windows/win32/api/imapi2/nf-imapi2-idiscformat2erase-erasemedia HRESULT EraseMedia(); + [DispId(0x201)] + void EraseMedia(); + } + + /// + /// + /// Use this interface to write raw images to a disc device using Disc At Once (DAO) mode (also known as uninterrupted recording). For + /// information on DAO mode, see the latest revision of the MMC specification at ftp://ftp.t10.org/t10/drafts/mmc5. + /// + /// + /// To create an instance of this interface, call the CoCreateInstance function. Use__uuidof(MsftDiscFormat2RawCD) for the class + /// identifier and __uuidof(IDiscFormat2RawCD) for the interface identifier. + /// + /// + /// + /// + /// To create the MsftDiscFormat2RawCD object in a script, use IMAPI2.MsftDiscFormat2RawCD as the program identifier when calling CreateObject. + /// + /// + /// It is possible for a power state transition to take place during a burn operation (i.e. user log-off or system suspend) which leads + /// to the interruption of the burn process and possible data loss. For programming considerations, see Preventing Logoff or Suspend + /// During a Burn. + /// + /// + // https://docs.microsoft.com/en-us/windows/win32/api/imapi2/nn-imapi2-idiscformat2rawcd + [PInvokeData("imapi2.h", MSDNShortId = "NN:imapi2.IDiscFormat2RawCD")] + [ComImport, Guid("27354155-8F64-5B0F-8F00-5D77AFBE261E"), InterfaceType(ComInterfaceType.InterfaceIsDual), CoClass(typeof(MsftDiscFormat2RawCD))] + public interface IDiscFormat2RawCD : IDiskFormat2 + { + /// Determines if the recorder supports the given format. + /// An IDiscRecorder2 interface of the recorder to test. + /// Is VARIANT_TRUE if the recorder supports the given format; otherwise, VARIANT_FALSE. + /// + /// When implemented by the IDiscFormat2RawCD interface, this method will return E_IMAPI_DF2RAW_MEDIA_IS_NOT_SUPPORTED in the event + /// the recorder does not support the given format. It is important to note that in this specific scenario the value does not + /// indicate that an error has occurred, but rather the result of a successful operation. + /// + // https://docs.microsoft.com/en-us/windows/win32/api/imapi2/nf-imapi2-idiscformat2-isrecordersupported HRESULT IsRecorderSupported( + // IDiscRecorder2 *recorder, VARIANT_BOOL *value ); + [DispId(2048)] + [return: MarshalAs(UnmanagedType.VariantBool)] + new bool IsRecorderSupported(IDiscRecorder2 recorder); + + /// Determines if the current media in a supported recorder supports the given format. + /// An IDiscRecorder2 interface of the recorder to test. + /// + /// Is VARIANT_TRUE if the media in the recorder supports the given format; otherwise, VARIANT_FALSE. + /// Note VARIANT_TRUE also implies that the result from IsDiscRecorderSupported is VARIANT_TRUE. + /// + // https://docs.microsoft.com/en-us/windows/win32/api/imapi2/nf-imapi2-idiscformat2-iscurrentmediasupported HRESULT + // IsCurrentMediaSupported( IDiscRecorder2 *recorder, VARIANT_BOOL *value ); + [DispId(2049)] + [return: MarshalAs(UnmanagedType.VariantBool)] + new bool IsCurrentMediaSupported(IDiscRecorder2 recorder); + + /// Determines if the current media is reported as physically blank by the drive. + /// Is VARIANT_TRUE if the disc is physically blank; otherwise, VARIANT_FALSE. + // https://docs.microsoft.com/en-us/windows/win32/api/imapi2/nf-imapi2-idiscformat2-get_mediaphysicallyblank HRESULT + // get_MediaPhysicallyBlank( VARIANT_BOOL *value ); + [DispId(1792)] + new bool MediaPhysicallyBlank { [return: MarshalAs(UnmanagedType.VariantBool)] get; } + + /// Attempts to determine if the media is blank using heuristics (mainly for DVD+RW and DVD-RAM media). + /// Is VARIANT_TRUE if the disc is likely to be blank; otherwise; VARIANT_FALSE. + /// + /// + /// This method checks, for example, for a mounted file system on the device, verifying the first and last 2MB of the disc are + /// filled with zeros, and other media-specific checks. These checks can help to determine if the media may have files on it for + /// media that cannot be erased physically to a blank status. + /// + /// For a positive check that a disc is blank, call the IDiscFormat2::get_MediaPhysicallyBlank method. + /// + // https://docs.microsoft.com/en-us/windows/win32/api/imapi2/nf-imapi2-idiscformat2-get_mediaheuristicallyblank HRESULT + // get_MediaHeuristicallyBlank( VARIANT_BOOL *value ); + [DispId(1793)] + new bool MediaHeuristicallyBlank { [return: MarshalAs(UnmanagedType.VariantBool)] get; } + + /// Retrieves the media types that are supported by the current implementation of the IDiscFormat2 interface. + /// + /// List of media types supported by the current implementation of the IDiscFormat2 interface. Each element of the array is a + /// VARIANT of type VT_I4. The lVal member of VARIANT contains the media type. For a list of media + /// types, see the IMAPI_MEDIA_PHYSICAL_TYPE enumeration type. + /// + // https://docs.microsoft.com/en-us/windows/win32/api/imapi2/nf-imapi2-idiscformat2-get_supportedmediatypes HRESULT + // get_SupportedMediaTypes( SAFEARRAY **value ); + [DispId(1794)] + new IMAPI_MEDIA_PHYSICAL_TYPE[] SupportedMediaTypes { [return: MarshalAs(UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof(SafeArrayMarshaler))] get; } + + /// Locks the current media for exclusive access. + /// + /// Before calling this method, you must call the IDiscFormat2RawCD::put_ClientName method. + /// + /// Also, you must call the IDiscFormat2RawCD::PrepareMedia method before calling either the IDiscFormat2RawCD::WriteMedia or + /// IDiscFormat2RawCD::WriteMedia2 method. + /// + /// + /// After the write is complete or you cancel the write operation, you must call the IDiscFormat2RawCD::ReleaseMedia method to + /// release the lock. + /// + /// + // https://docs.microsoft.com/en-us/windows/win32/api/imapi2/nf-imapi2-idiscformat2rawcd-preparemedia HRESULT PrepareMedia(); + [DispId(0x200)] + void PrepareMedia(); + + /// Writes a DAO-96 raw image to the blank media using MSF 95:00:00 as the starting address. + /// An IStream interface of the data stream to write. + /// + /// Before calling this method, you must call the IDiscFormat2RawCD::put_Recorder and IDiscFormat2RawCD::PrepareMedia methods. + /// You should also consider calling the following methods if their default values are not appropriate for your application: + /// + /// + /// IDiscFormat2RawCD::put_BufferUnderrunFreeDisabled + /// + /// + /// IDiscFormat2RawCD::put_ClientName + /// + /// + /// IDiscFormat2RawCD::put_RequestedSectorType + /// + /// + /// IDiscFormat2RawCD::SetWriteSpeed + /// + /// + /// + /// This method is synchronous. To determine the progress of the write operation, you must implement the DDiscFormat2RawCDEvents + /// interface. For examples that show how to implement an event handler in a script, see Monitoring Progress With Events. + /// + /// + /// The first sector of the raw image is written at MSF 95:00:00. If your RAW image has a different first sector, please use the + /// IDiscFormat2RawCD::WriteMedia2 method. + /// + /// + /// This method uses the IStream::Seek method to reach the appropriate starting location in the image for the current media. + /// If the IStream::Seek method fails, the method will call the IStream::Read method repeatedly until reaching the + /// starting sector. + /// + /// + /// The DAO-96 standard allows writing of any type of data to CD media. One common usage is to write audio CDs without a 2-second + /// gap between tracks. + /// + /// DAO-96 also supports variations in the subcode content, such as CD+G and CD-Text. + /// + // https://docs.microsoft.com/en-us/windows/win32/api/imapi2/nf-imapi2-idiscformat2rawcd-writemedia HRESULT WriteMedia( IStream + // *data ); + [DispId(0x201)] + void WriteMedia(IStream data); + + /// Writes a DAO-96 raw image to the blank media using a specified starting address. + /// An IStream interface of the data stream to write. + /// Starting address at which to begin writing the data stream. + /// + /// This method is identical in function to the IDiscFormat2RawCD::WriteMedia method, except that it allows for a starting + /// time other than 95:00:00. For details, please see the IDiscFormat2RawCD::WriteMedia method. + /// + // https://docs.microsoft.com/en-us/windows/win32/api/imapi2/nf-imapi2-idiscformat2rawcd-writemedia2 HRESULT WriteMedia2( IStream + // *data, LONG streamLeadInSectors ); + [DispId(0x202)] + void WriteMedia2(IStream data, int streamLeadInSectors); + + /// Cancels the current write operation. + /// + /// + /// To cancel the write operation, you must call this method from the DDiscFormat2RawCDEvents::Update event handler that you implemented. + /// + /// You must also call the IDiscFormat2RawCD::ReleaseMedia method after calling this method. + /// + /// Note that calling this method does not immediately cancel the write operation on all media due to media-specific requirements. + /// For example, when writing to a CD, the write operation can continue for up to three more minutes. + /// + /// + /// This method leaves the media in an indeterminate state. For rewriteable media, you should call the IDiscFormat2Erase::EraseMedia + /// method after calling this method to prepare the media for future use. + /// + /// + // https://docs.microsoft.com/en-us/windows/win32/api/imapi2/nf-imapi2-idiscformat2rawcd-cancelwrite HRESULT CancelWrite(); + [DispId(0x203)] + void CancelWrite(); + + /// Closes a Disc-At-Once (DAO) writing session of a raw image and releases the lock. + /// + /// This method release the lock set when you called the IDiscFormat2RawCD::PrepareMedia method. You must call this method after the + /// write operation completes or after calling IDiscFormat2RawCD::CancelWrite to cancel a writing operation. + /// + // https://docs.microsoft.com/en-us/windows/win32/api/imapi2/nf-imapi2-idiscformat2rawcd-releasemedia HRESULT ReleaseMedia(); + [DispId(0x204)] + void ReleaseMedia(); + + /// Sets the write speed of the disc recorder. + /// + /// Requested write speed measured in disc sectors per second. + /// + /// A value of 0xFFFFFFFF (-1) requests that the write occurs using the fastest supported speed for the media. This is the default. + /// + /// + /// + /// Requested rotational-speed control type. Set to VARIANT_TRUE to request constant angular velocity (CAV) rotational-speed control + /// type. Set to VARIANT_FALSE to use another rotational-speed control type that the recorder supports. The default is VARIANT_FALSE. + /// + /// + /// + /// This method sets the write speed and type of rotational-speed control for a recorder. Requested values might differ from the + /// values set in the recorder. To specify the recorder, call the IDiscFormat2RawCD::put_Recorder method. + /// + /// + /// If the recorder supports the requested write speed, the disc device uses the requested value. If the recorder does not support + /// the requested write speed, the recorder uses a write speed that it does support that is closest to the requested value. The + /// IDiscFormat2RawCD::get_CurrentWriteSpeed property contains the value used by the recorder. + /// + /// + /// To retrieve a list of the write speeds that the recorder and current media supports, call the + /// IDiscFormat2RawCD::get_SupportedWriteSpeeds method. + /// + /// + /// If you request constant angular velocity (CAV) for rotational-speed control type and the recorder does not support CAV, the disc + /// device uses another type of rotational-speed control type that it supports. The + /// IDiscFormat2RawCD::get_CurrentRotationTypeIsPureCAV property indicates the value used by the recorder. + /// + /// + /// To retrieve the requested values, call the IDiscFormat2RawCD::get_RequestedWriteSpeed and + /// IDiscFormat2RawCD::get_RequestedRotationTypeIsPureCAV methods. + /// + /// + // https://docs.microsoft.com/en-us/windows/win32/api/imapi2/nf-imapi2-idiscformat2rawcd-setwritespeed HRESULT SetWriteSpeed( LONG + // RequestedSectorsPerSecond, VARIANT_BOOL RotationTypeIsPureCAV ); + [DispId(0x205)] + void SetWriteSpeed(int RequestedSectorsPerSecond, [MarshalAs(UnmanagedType.VariantBool)] bool RotationTypeIsPureCAV); + + /// Retrieves the recording device to use for the write operation. + /// An IDiscRecorder2 interface that identifies the recording device to use in the write operation. + // https://docs.microsoft.com/en-us/windows/win32/api/imapi2/nf-imapi2-idiscformat2rawcd-get_recorder HRESULT get_Recorder( + // IDiscRecorder2 **value ); + [DispId(0x100)] + IDiscRecorder2 Recorder { set; [return: MarshalAs(UnmanagedType.Interface)] get; } + + /// Determines if Buffer Underrun Free recording is enabled. + /// + /// Set to VARIANT_TRUE to disable Buffer Underrun Free recording; otherwise, VARIANT_FALSE. The default is VARIANT_FALSE (enabled). + /// + /// + /// Buffer underrun can be an issue if the data stream does not enter the buffer fast enough to keep the device continuously + /// writing. In turn, the stop and start action of writing can cause data on the disc to be unusable. Buffer Underrun Free (BUF) + /// recording allows the laser to start and stop without damaging data already written to the disc. Disabling of BUF recording is + /// possible only on CD-R/RW media. + /// + // https://docs.microsoft.com/en-us/windows/win32/api/imapi2/nf-imapi2-idiscformat2rawcd-put_bufferunderrunfreedisabled HRESULT + // put_BufferUnderrunFreeDisabled( VARIANT_BOOL value ); + [DispId(0x102)] + bool BufferUnderrunFreeDisabled { set; [return: MarshalAs(UnmanagedType.VariantBool)] get; } + + /// Retrieves the first sector of the next session. + /// Sector number for the start of the next write operation. This value can be negative for blank media. + /// + /// The client application that creates an image must provide appropriately sized lead-in and lead-out data. The application + /// developer using the IDiscFormat2RawCD interface must understand the formats of lead-in and lead-out for the first and subsequent + /// sessions. Note that lead-in LBA for the first session is negative. + /// + // https://docs.microsoft.com/en-us/windows/win32/api/imapi2/nf-imapi2-idiscformat2rawcd-get_startofnextsession HRESULT + // get_StartOfNextSession( LONG *value ); + [DispId(0x103)] + int StartOfNextSession { get; } + + /// Retrieves the last possible starting position for the leadout area. + /// Sector address of the starting position for the leadout area. + // https://docs.microsoft.com/en-us/windows/win32/api/imapi2/nf-imapi2-idiscformat2rawcd-get_lastpossiblestartofleadout HRESULT + // get_LastPossibleStartOfLeadout( LONG *value ); + [DispId(0x104)] + int LastPossibleStartOfLeadout { get; } + + /// Retrieves the type of media in the disc device. + /// Type of media in the disc device. For possible values, see the IMAPI_MEDIA_PHYSICAL_TYPEenumeration type. + // https://docs.microsoft.com/en-us/windows/win32/api/imapi2/nf-imapi2-idiscformat2rawcd-get_currentphysicalmediatype HRESULT + // get_CurrentPhysicalMediaType( IMAPI_MEDIA_PHYSICAL_TYPE *value ); + [DispId(0x105)] + IMAPI_MEDIA_PHYSICAL_TYPE CurrentPhysicalMediaType { get; } + + /// Retrieves the supported data sector types for the current recorder. + /// + /// + /// List of data sector types for the current recorder. Each element of the list is a VARIANT of type VT_UI4. The + /// ulVal member of the variant contains the data sector type. + /// + /// For a list of values of supported sector types, see IMAPI_FORMAT2_RAW_CD_DATA_SECTOR_TYPE. + /// + // https://docs.microsoft.com/en-us/windows/win32/api/imapi2/nf-imapi2-idiscformat2rawcd-get_supportedsectortypes HRESULT + // get_SupportedSectorTypes( SAFEARRAY **value ); + [DispId(0x108)] + IMAPI_FORMAT2_RAW_CD_DATA_SECTOR_TYPE[] SupportedSectorTypes { [return: MarshalAs(UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof(SafeArrayMarshaler))] get; } + + /// Sets the requested data sector to use for writing the stream. + /// + /// Data sector to use for writing the stream. For possible values, see the IMAPI_FORMAT2_RAW_CD_DATA_SECTOR_TYPE enumeration type. + /// The default is IMAPI_FORMAT2_RAW_CD_SUBCODE_IS_COOKED. + /// + /// For a list of supported data sector types, call the IDiscFormat2RawCD::get_SupportedSectorTypes method. + // https://docs.microsoft.com/en-us/windows/win32/api/imapi2/nf-imapi2-idiscformat2rawcd-put_requestedsectortype HRESULT + // put_RequestedSectorType( IMAPI_FORMAT2_RAW_CD_DATA_SECTOR_TYPE value ); + [DispId(0x109)] + IMAPI_FORMAT2_RAW_CD_DATA_SECTOR_TYPE RequestedSectorType { set; get; } + + /// Sets the friendly name of the client. + /// Name of the client application. Cannot be NULL or an empty string. + /// + /// + /// The name is used when the write operation requests exclusive access to the device. The IDiscRecorder2::get_ExclusiveAccessOwner + /// property contains the name of the client that has the lock. + /// + /// + /// Because any application with read/write access to the CDROM device during the write operation can use the + /// IOCTL_CDROM_EXCLUSIVE_ACCESS (query) control code (see the Microsoft Windows Driver Development Kit (DDK)) to access the name, + /// it is important that the name identify the program that is using this interface to write to the media. The name is restricted to + /// the same character set as required by the IOCTL_CDROM_EXCLUSIVE_ACCESS control code. + /// + /// + // https://docs.microsoft.com/en-us/windows/win32/api/imapi2/nf-imapi2-idiscformat2rawcd-put_clientname HRESULT put_ClientName( BSTR + // value ); + [DispId(0x10A)] + string ClientName { set; [return: MarshalAs(UnmanagedType.BStr)] get; } + + /// Retrieves the requested write speed. + /// + /// Requested write speed measured in disc sectors per second. + /// A value of 0xFFFFFFFF (-1) requests that the write occurs using the fastest supported speed for the media. + /// + /// This is the value specified in the most recent call to the IDiscFormat2RawCD::SetWriteSpeed method. + // https://docs.microsoft.com/en-us/windows/win32/api/imapi2/nf-imapi2-idiscformat2rawcd-get_requestedwritespeed HRESULT + // get_RequestedWriteSpeed( LONG *value ); + [DispId(0x10B)] + int RequestedWriteSpeed { get; } + + /// Retrieves the requested rotational-speed control type. + /// + /// Requested rotational-speed control type. Is VARIANT_TRUE for constant angular velocity (CAV) rotational-speed control type. + /// Otherwise, is VARIANT_FALSE for any other rotational-speed control type that the recorder supports. + /// + /// This is the value specified in the most recent call to the IDiscFormat2RawCD::SetWriteSpeed method. + // https://docs.microsoft.com/en-us/windows/win32/api/imapi2/nf-imapi2-idiscformat2rawcd-get_requestedrotationtypeispurecav HRESULT + // get_RequestedRotationTypeIsPureCAV( VARIANT_BOOL *value ); + [DispId(0x10C)] + bool RequestedRotationTypeIsPureCAV { [return: MarshalAs(UnmanagedType.VariantBool)] get; } + + /// Retrieves the drive's current write speed. + /// The write speed of the current media, measured in sectors per second. + /// + /// To retrieve the requested write speed, call the IDiscFormat2RawCD::get_RequestedWriteSpeed method. + /// + /// To retrieve a list of the write speeds that the recorder and current media supports, call the + /// IDiscFormat2RawCD::get_SupportedWriteSpeeds method. + /// + /// + /// Note that the write speed is based on the media write speeds. The value of this property can change when a media change occurs. + /// + /// + // https://docs.microsoft.com/en-us/windows/win32/api/imapi2/nf-imapi2-idiscformat2rawcd-get_currentwritespeed HRESULT + // get_CurrentWriteSpeed( LONG *value ); + [DispId(0x10D)] + int CurrentWriteSpeed { get; } + + /// Retrieves the current rotational-speed control used by the recorder. + /// + /// Is VARIANT_TRUE if constant angular velocity (CAV) rotational-speed control is in use. Otherwise, VARIANT_FALSE to indicate that + /// another rotational-speed control that the recorder supports is in use. + /// + /// + /// To retrieve the requested rotational-speed control, call the IDiscFormat2RawCD::get_RequestedRotationTypeIsPureCAV method. + /// Rotational-speed control types include the following: + /// + /// + /// CLV (Constant Linear Velocity). The disc is written at a constant speed. Standard rotational control. + /// + /// + /// CAV (Constant Angular Velocity). The disc is written at a constantly increasing speed. + /// + /// + /// + /// ZCAV (Zone Constant Linear Velocity). The disc is divided into zones. After each zone, the write speed increases. This is an + /// impure form of CAV. + /// + /// + /// + /// + /// PCAV (Partial Constant Angular Velocity). The disc speed increases up to a specified velocity. Once reached, the disc spins at + /// the specified velocity for the duration of the disc writing. + /// + /// + /// + /// + // https://docs.microsoft.com/en-us/windows/win32/api/imapi2/nf-imapi2-idiscformat2rawcd-get_currentrotationtypeispurecav HRESULT + // get_CurrentRotationTypeIsPureCAV( VARIANT_BOOL *value ); + [DispId(0x10E)] + bool CurrentRotationTypeIsPureCAV { [return: MarshalAs(UnmanagedType.VariantBool)] get; } + + /// Retrieves a list of the write speeds supported by the disc recorder and current media. + /// + /// List of the write speeds supported by the disc recorder and current media. Each element of the list is a VARIANT of type + /// VT_UI4. The ulVal member of the variant contains the number of sectors written per second. + /// + /// + /// You can use a speed from the list to set the write speed when calling the IDiscFormat2RawCD::SetWriteSpeed method. + /// + /// To retrieve a list of the write configurations that the recorder and current media supports, call the + /// IDiscFormat2RawCD::get_SupportedWriteSpeedDescriptors method. + /// + /// + // https://docs.microsoft.com/en-us/windows/win32/api/imapi2/nf-imapi2-idiscformat2rawcd-get_supportedwritespeeds HRESULT + // get_SupportedWriteSpeeds( SAFEARRAY **supportedSpeeds ); + [DispId(0x10F)] + uint[] SupportedWriteSpeeds { [return: MarshalAs(UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof(SafeArrayMarshaler))] get; } + + /// Retrieves a list of the detailed write configurations supported by the disc recorder and current media. + /// + /// List of the detailed write configurations supported by the disc recorder and current media. Each element of the list is a + /// VARIANT of type VT_Dispatch. Query the pdispVal member of the variant for the IWriteSpeedDescriptor + /// interface, which contains the media type, write speed, rotational-speed control type. + /// + /// + /// To retrieve a list of the write speeds that the recorder and current media supports, call the + /// IDiscFormat2RawCD::get_SupportedWriteSpeeds method. + /// + // https://docs.microsoft.com/en-us/windows/win32/api/imapi2/nf-imapi2-idiscformat2rawcd-get_supportedwritespeeddescriptors HRESULT + // get_SupportedWriteSpeedDescriptors( SAFEARRAY **supportedSpeedDescriptors ); + [DispId(0x110)] + IWriteSpeedDescriptor[] SupportedWriteSpeedDescriptors { [return: MarshalAs(UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof(SafeArrayMarshaler))] get; } + } + + /// + /// Use this interface to retrieve information about the current write operation. + /// This interface is passed to the DDiscFormat2RawCDEvents::Update method that you implement. + /// + // https://docs.microsoft.com/en-us/windows/win32/api/imapi2/nn-imapi2-idiscformat2rawcdeventargs + [PInvokeData("imapi2.h", MSDNShortId = "NN:imapi2.IDiscFormat2RawCDEventArgs")] + [ComImport, Guid("27354143-7F64-5B0F-8F00-5D77AFBE261E"), InterfaceType(ComInterfaceType.InterfaceIsDual)] + public interface IDiscFormat2RawCDEventArgs : IWriteEngine2EventArgs + { + /// Retrieves the starting logical block address (LBA) of the current write operation. + /// Starting logical block address of the write operation. Negative values for LBAs are supported. + /// This is the same value passed to the IWriteEngine2::WriteSection method. + // https://docs.microsoft.com/en-us/windows/win32/api/imapi2/nf-imapi2-iwriteengine2eventargs-get_startlba HRESULT get_StartLba( + // LONG *value ); + [DispId(0x100)] + new int StartLba { get; } + + /// Retrieves the number of sectors to write to the device in the current write operation. + /// The number of sectors to write in the current write operation. + /// This is the same value passed to the IWriteEngine2::WriteSection method. + // https://docs.microsoft.com/en-us/windows/win32/api/imapi2/nf-imapi2-iwriteengine2eventargs-get_sectorcount HRESULT + // get_SectorCount( LONG *value ); + [DispId(0x101)] + new int SectorCount { get; } + + /// Retrieves the address of the sector most recently read from the burn image. + /// Logical block address of the sector most recently read from the input data stream. + // https://docs.microsoft.com/en-us/windows/win32/api/imapi2/nf-imapi2-iwriteengine2eventargs-get_lastreadlba HRESULT + // get_LastReadLba( LONG *value ); + [DispId(0x102)] + new int LastReadLba { get; } + + /// Retrieves the address of the sector most recently written to the device. + /// Logical block address of the sector most recently written to the device. + // https://docs.microsoft.com/en-us/windows/win32/api/imapi2/nf-imapi2-iwriteengine2eventargs-get_lastwrittenlba HRESULT + // get_LastWrittenLba( LONG *value ); + [DispId(0x103)] + new int LastWrittenLba { get; } + + /// Retrieves the size of the internal data buffer that is used for writing to disc. + /// Size, in bytes, of the internal data buffer that is used for writing to disc. + // https://docs.microsoft.com/en-us/windows/win32/api/imapi2/nf-imapi2-iwriteengine2eventargs-get_totalsystembuffer HRESULT + // get_TotalSystemBuffer( LONG *value ); + [DispId(0x106)] + new int TotalSystemBuffer { get; } + + /// Retrieves the number of used bytes in the internal data buffer that is used for writing to disc. + /// Size, in bytes, of the used portion of the internal data buffer that is used for writing to disc. + /// This value increases as data is read into the buffer and decreases as data is written to disc. + // https://docs.microsoft.com/en-us/windows/win32/api/imapi2/nf-imapi2-iwriteengine2eventargs-get_usedsystembuffer HRESULT + // get_UsedSystemBuffer( LONG *value ); + [DispId(0x107)] + new int UsedSystemBuffer { get; } + + /// Retrieves the number of unused bytes in the internal data buffer that is used for writing to disc. + /// Size, in bytes, of the unused portion of the internal data buffer that is used for writing to disc. + /// This method returns the same value as if you subtracted IWriteEngine2EventArgs::get_UsedSystemBuffer from IWriteEngine2EventArgs::get_TotalSystemBuffer. + // https://docs.microsoft.com/en-us/windows/win32/api/imapi2/nf-imapi2-iwriteengine2eventargs-get_freesystembuffer HRESULT + // get_FreeSystemBuffer( LONG *value ); + [DispId(0x108)] + new int FreeSystemBuffer { get; } + + /// Retrieves the current write action being performed. + /// + /// Current write action being performed. For a list of possible actions, see the IMAPI_FORMAT2_RAW_CD_WRITE_ACTION enumeration type. + /// + // https://docs.microsoft.com/en-us/windows/win32/api/imapi2/nf-imapi2-idiscformat2rawcdeventargs-get_currentaction HRESULT + // get_CurrentAction( IMAPI_FORMAT2_RAW_CD_WRITE_ACTION *value ); + [DispId(0x301)] + IMAPI_FORMAT2_RAW_CD_WRITE_ACTION CurrentAction { get; } + + /// Retrieves the total elapsed time of the write operation. + /// Elapsed time, in seconds, of the write operation. + // https://docs.microsoft.com/en-us/windows/win32/api/imapi2/nf-imapi2-idiscformat2rawcdeventargs-get_elapsedtime HRESULT + // get_ElapsedTime( LONG *value ); + [DispId(0x302)] + int ElapsedTime { get; } + + /// Retrieves the estimated remaining time of the write operation. + /// Estimated time, in seconds, needed for the remainder of the write operation. + /// + /// The estimate for a single write operation can vary as the operation progresses. The drive provides updated information that can + /// affect the projected duration of the write operation. + /// + // https://docs.microsoft.com/en-us/windows/win32/api/imapi2/nf-imapi2-idiscformat2rawcdeventargs-get_remainingtime HRESULT + // get_RemainingTime( LONG *value ); + [DispId(0x303)] + int RemainingTime { get; } + } + + /// + /// Use this interface to write audio to blank CD-R or CD-RW media in Track-At-Once mode. + /// + /// To create an instance of this interface, call the CoCreateInstance function. Use__uuidof(MsftDiscFormat2TrackAtOnce) for the + /// class identifier and __uuidof(IDiscFormat2TrackAtOnce) for the interface identifier. + /// + /// + /// + /// + /// To create the MsftDiscFormat2TrackAtOnce object in a script, use IMAPI2.MsftDiscFormat2TrackAtOnce as the program identifier + /// when calling CreateObject. + /// + /// + /// It is possible for a power state transition to take place during a burn operation (i.e. user log-off or system suspend) which leads + /// to the interruption of the burn process and possible data loss. For programming considerations, see Preventing Logoff or Suspend + /// During a Burn. + /// + /// + // https://docs.microsoft.com/en-us/windows/win32/api/imapi2/nn-imapi2-idiscformat2trackatonce + [PInvokeData("imapi2.h", MSDNShortId = "NN:imapi2.IDiscFormat2TrackAtOnce")] + [ComImport, Guid("27354154-8F64-5B0F-8F00-5D77AFBE261E"), InterfaceType(ComInterfaceType.InterfaceIsDual), CoClass(typeof(MsftDiscFormat2TrackAtOnce))] + public interface IDiscFormat2TrackAtOnce : IDiskFormat2 + { + /// Determines if the recorder supports the given format. + /// An IDiscRecorder2 interface of the recorder to test. + /// Is VARIANT_TRUE if the recorder supports the given format; otherwise, VARIANT_FALSE. + /// + /// When implemented by the IDiscFormat2RawCD interface, this method will return E_IMAPI_DF2RAW_MEDIA_IS_NOT_SUPPORTED in the event + /// the recorder does not support the given format. It is important to note that in this specific scenario the value does not + /// indicate that an error has occurred, but rather the result of a successful operation. + /// + // https://docs.microsoft.com/en-us/windows/win32/api/imapi2/nf-imapi2-idiscformat2-isrecordersupported HRESULT IsRecorderSupported( + // IDiscRecorder2 *recorder, VARIANT_BOOL *value ); + [DispId(2048)] + [return: MarshalAs(UnmanagedType.VariantBool)] + new bool IsRecorderSupported(IDiscRecorder2 recorder); + + /// Determines if the current media in a supported recorder supports the given format. + /// An IDiscRecorder2 interface of the recorder to test. + /// + /// Is VARIANT_TRUE if the media in the recorder supports the given format; otherwise, VARIANT_FALSE. + /// Note VARIANT_TRUE also implies that the result from IsDiscRecorderSupported is VARIANT_TRUE. + /// + // https://docs.microsoft.com/en-us/windows/win32/api/imapi2/nf-imapi2-idiscformat2-iscurrentmediasupported HRESULT + // IsCurrentMediaSupported( IDiscRecorder2 *recorder, VARIANT_BOOL *value ); + [DispId(2049)] + [return: MarshalAs(UnmanagedType.VariantBool)] + new bool IsCurrentMediaSupported(IDiscRecorder2 recorder); + + /// Determines if the current media is reported as physically blank by the drive. + /// Is VARIANT_TRUE if the disc is physically blank; otherwise, VARIANT_FALSE. + // https://docs.microsoft.com/en-us/windows/win32/api/imapi2/nf-imapi2-idiscformat2-get_mediaphysicallyblank HRESULT + // get_MediaPhysicallyBlank( VARIANT_BOOL *value ); + [DispId(1792)] + new bool MediaPhysicallyBlank { [return: MarshalAs(UnmanagedType.VariantBool)] get; } + + /// Attempts to determine if the media is blank using heuristics (mainly for DVD+RW and DVD-RAM media). + /// Is VARIANT_TRUE if the disc is likely to be blank; otherwise; VARIANT_FALSE. + /// + /// + /// This method checks, for example, for a mounted file system on the device, verifying the first and last 2MB of the disc are + /// filled with zeros, and other media-specific checks. These checks can help to determine if the media may have files on it for + /// media that cannot be erased physically to a blank status. + /// + /// For a positive check that a disc is blank, call the IDiscFormat2::get_MediaPhysicallyBlank method. + /// + // https://docs.microsoft.com/en-us/windows/win32/api/imapi2/nf-imapi2-idiscformat2-get_mediaheuristicallyblank HRESULT + // get_MediaHeuristicallyBlank( VARIANT_BOOL *value ); + [DispId(1793)] + new bool MediaHeuristicallyBlank { [return: MarshalAs(UnmanagedType.VariantBool)] get; } + + /// Retrieves the media types that are supported by the current implementation of the IDiscFormat2 interface. + /// + /// List of media types supported by the current implementation of the IDiscFormat2 interface. Each element of the array is a + /// VARIANT of type VT_I4. The lVal member of VARIANT contains the media type. For a list of media + /// types, see the IMAPI_MEDIA_PHYSICAL_TYPE enumeration type. + /// + // https://docs.microsoft.com/en-us/windows/win32/api/imapi2/nf-imapi2-idiscformat2-get_supportedmediatypes HRESULT + // get_SupportedMediaTypes( SAFEARRAY **value ); + [DispId(1794)] + new IMAPI_MEDIA_PHYSICAL_TYPE[] SupportedMediaTypes { [return: MarshalAs(UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof(SafeArrayMarshaler))] get; } + + /// Locks the current media for exclusive access. + /// + /// Before calling this method, you must call the IDiscFormat2TrackAtOnce::put_ClientName method. + /// + /// Also, you must call the IDiscFormat2TrackAtOnce::PrepareMedia method before calling the + /// IDiscFormat2TrackAtOnce::AddAudioTrack method. + /// + /// + /// After the write is complete or you cancel the write operation, you must call the IDiscFormat2TrackAtOnce::ReleaseMedia method to + /// release the lock. + /// + /// + /// Note that Media Change Notification (MCN) and the IDiscFormat2TrackAtOnce::put_DoNotFinalizeMedia property become read-only + /// until the session is closed. + /// + /// + // https://docs.microsoft.com/en-us/windows/win32/api/imapi2/nf-imapi2-idiscformat2trackatonce-preparemedia HRESULT PrepareMedia(); + [DispId(0x200)] + void PrepareMedia(); + + /// Writes the data stream to the current media as a new track. + /// + /// An IStream interface of the audio data to write as the next track on the media. + /// + /// The data format contains 44.1KHz, 16-bit stereo, raw audio samples. This is the same format used by the audio samples in a + /// Microsoft WAV audio file (without the header). + /// + /// + /// + /// + /// Before calling this method, you must call the IDiscFormat2TrackAtOnce::put_Recorder and IDiscFormat2TrackAtOnce::PrepareMedia methods. + /// + /// You should also consider calling the following methods if their default values are not appropriate for your application: + /// + /// + /// IDiscFormat2TrackAtOnce::put_BufferUnderrunFreeDisabled + /// + /// + /// IDiscFormat2TrackAtOnce::put_ClientName + /// + /// + /// IDiscFormat2TrackAtOnce::put_DoNotFinalizeMedia + /// + /// + /// + /// To determine the progress of the write operation, you must implement the DDiscFormat2TrackAtOnceEvents interface. For examples + /// that show how to implement an event handler in a script, see Monitoring Progress With Events. + /// + /// The media can accommodate 99 tracks of audio data. Track numbering starts at 1. The last track is 99. + /// Silence, or data samples containing zeroes, will be added to the track-writing operation in the following ways: + /// + /// + /// The minimum track size is 4 seconds and if needed, the track data will be enlarged to meet this requirement. + /// + /// + /// + /// Due to the nature of track-at-once recording, a two-second gap is added between successive audio tracks. This gap is normally + /// hidden by PC-based players, but may be noticeable on some consumer electronics equipment. + /// + /// + /// + /// + // https://docs.microsoft.com/en-us/windows/win32/api/imapi2/nf-imapi2-idiscformat2trackatonce-addaudiotrack HRESULT AddAudioTrack( + // IStream *data ); + [DispId(0x201)] + void AddAudioTrack(IStream data); + + /// Cancels the current write operation. + /// + /// + /// To cancel the write operation, you must call this method from the DDiscFormat2TrackAtOnceEvents::Update event handler that you implemented. + /// + /// You must also call the IDiscFormat2TrackAtOnce::ReleaseMedia method after calling this method. + /// + /// Note that calling this method does not immediately cancel the write operation on all media due to media-specific requirements. + /// For example, when writing to a CD, the write operation can continue for up to three more minutes. + /// + /// + /// This method may result in a partial audio track having already been recorded. The method will attempt to keep the media in a + /// usable state and will simply treat the canceled track as being shorter than originally described by the IStream. Callers + /// should query the number of tracks and track sizes after canceling to determine the disc state. + /// + /// + // https://docs.microsoft.com/en-us/windows/win32/api/imapi2/nf-imapi2-idiscformat2trackatonce-canceladdtrack HRESULT CancelAddTrack(); + [DispId(0x202)] + void CancelAddTrack(); + + /// Closes the track-writing session and releases the lock. + /// + /// This method release the lock set when you called the IDiscFormat2TrackAtOnce::PrepareMedia method. You must call this method to + /// close a writing session or after calling the IDiscFormat2TrackAtOnce::CancelAddTrack method. + /// + // https://docs.microsoft.com/en-us/windows/win32/api/imapi2/nf-imapi2-idiscformat2trackatonce-releasemedia HRESULT ReleaseMedia(); + [DispId(0x203)] + void ReleaseMedia(); + + /// Sets the write speed of the disc recorder. + /// + /// Requested write speed measured in disc sectors per second. + /// + /// A value of 0xFFFFFFFF (-1) requests that the write occurs using the fastest supported speed for the media. This is the default. + /// + /// + /// + /// Requested rotational-speed control type. Set to VARIANT_TRUE to request constant angular velocity (CAV) rotational-speed control + /// type. Set to VARIANT_FALSE to use another rotational-speed control type that the recorder supports. The default is VARIANT_FALSE. + /// + /// + /// + /// This method sets the write speed and type of rotational-speed control for a recorder. Requested values might differ from the + /// values set in the recorder. To specify the recorder, call the IDiscFormat2TrackAtOnce::put_Recorder method. + /// + /// + /// If the recorder supports the requested write speed, the disc device uses the requested value. If the recorder does not support + /// the requested write speed, the recorder uses a write speed that it does support that is closest to the requested value. The + /// IDiscFormat2TrackAtOnce::get_CurrentWriteSpeed property contains the value used by the recorder. + /// + /// + /// To retrieve a list of the write speeds that the recorder and current media supports, call the + /// IDiscFormat2TrackAtOnce::get_SupportedWriteSpeeds method. + /// + /// + /// If you request constant angular velocity (CAV) for rotational-speed control type and the recorder does not support CAV, the disc + /// device uses another type of rotational-speed control type that it supports. The + /// IDiscFormat2TrackAtOnce::get_CurrentRotationTypeIsPureCAV property indicates the value used by the recorder. + /// + /// + /// To retrieve the requested values, call the IDiscFormat2TrackAtOnce::get_RequestedWriteSpeed and + /// IDiscFormat2TrackAtOnce::get_RequestedRotationTypeIsPureCAV methods. + /// + /// + // https://docs.microsoft.com/en-us/windows/win32/api/imapi2/nf-imapi2-idiscformat2trackatonce-setwritespeed HRESULT SetWriteSpeed( + // LONG RequestedSectorsPerSecond, VARIANT_BOOL RotationTypeIsPureCAV ); + [DispId(0x204)] + void SetWriteSpeed(int RequestedSectorsPerSecond, [MarshalAs(UnmanagedType.VariantBool)] bool RotationTypeIsPureCAV); + + /// Sets the recording device to use for the write operation. + /// An IDiscRecorder2 interface that identifies the recording device to use in the write operation. + /// + /// The recorder must be compatible with the format defined by this interface. To determine compatibility, call the + /// IDiscFormat2::IsRecorderSupported method. + /// + // https://docs.microsoft.com/en-us/windows/win32/api/imapi2/nf-imapi2-idiscformat2trackatonce-put_recorder HRESULT put_Recorder( + // IDiscRecorder2 *value ); + [DispId(0x100)] + IDiscRecorder2 Recorder { set; [return: MarshalAs(UnmanagedType.Interface)] get; } + + /// Determines if Buffer Underrun Free Recording is enabled. + /// + /// Set to VARIANT_TRUE to disable Buffer Underrun Free Recording; otherwise, VARIANT_FALSE. The default is VARIANT_FALSE (enabled). + /// + /// + /// Buffer underrun can be an issue if the data stream does not enter the buffer fast enough to keep the device continuously + /// writing. In turn, the stop and start action of writing can cause data on the disc to be unusable. Buffer Underrun Free (BUF) + /// recording allows the laser to start and stop without damaging data already written to the disc. Disabling of BUF recording is + /// possible only on CD-R/RW media. + /// + // https://docs.microsoft.com/en-us/windows/win32/api/imapi2/nf-imapi2-idiscformat2trackatonce-put_bufferunderrunfreedisabled + // HRESULT put_BufferUnderrunFreeDisabled( VARIANT_BOOL value ); + [DispId(0x102)] + bool BufferUnderrunFreeDisabled { set; [return: MarshalAs(UnmanagedType.VariantBool)] get; } + + /// Retrieves the number of existing audio tracks on the media. + /// Number of completed tracks written to disc, not including the track currently being added. + /// + /// The value is zero if: + /// + /// + /// The media is blank + /// + /// + /// You call this method outside a writing session + /// + /// + /// + // https://docs.microsoft.com/en-us/windows/win32/api/imapi2/nf-imapi2-idiscformat2trackatonce-get_numberofexistingtracks HRESULT + // get_NumberOfExistingTracks( LONG *value ); + [DispId(0x103)] + int NumberOfExistingTracks { get; } + + /// Retrieves the total sectors available on the media if writing one continuous audio track. + /// Number of all sectors on the media that can be used for audio if one continuous audio track was recorded. + /// This property can be retrieved at any time; however, during writing, the value is cached. + // https://docs.microsoft.com/en-us/windows/win32/api/imapi2/nf-imapi2-idiscformat2trackatonce-get_totalsectorsonmedia HRESULT + // get_TotalSectorsOnMedia( LONG *value ); + [DispId(0x104)] + int TotalSectorsOnMedia { get; } + + /// Retrieves the number of sectors available for adding a new track to the media. + /// Number of available sectors on the media that can be used for writing audio. + /// + /// If called during an AddAudioTrack operation, the available sectors do not reflect the sectors used in writing the current audio + /// track. Instead, the reported value is the number of available sectors immediately preceding the call to AddAudioTrack. + /// + // https://docs.microsoft.com/en-us/windows/win32/api/imapi2/nf-imapi2-idiscformat2trackatonce-get_freesectorsonmedia HRESULT + // get_FreeSectorsOnMedia( LONG *value ); + [DispId(0x105)] + int FreeSectorsOnMedia { get; } + + /// Retrieves the total number of used sectors on the media. + /// Number of used sectors on the media, including audio tracks and overhead that exists between tracks. + /// If you call this method from your event handler, the number reflects the sectors used before the write began. + // https://docs.microsoft.com/en-us/windows/win32/api/imapi2/nf-imapi2-idiscformat2trackatonce-get_usedsectorsonmedia HRESULT + // get_UsedSectorsOnMedia( LONG *value ); + [DispId(0x106)] + int UsedSectorsOnMedia { get; } + + /// Determines if the media is left open for writing after writing the audio track. + /// + /// Set to VARIANT_TRUE to leave the media open for writing after writing the audio track; otherwise, VARIANT_FALSE. The default is VARIANT_FALSE. + /// + /// + /// + /// You can set this property before calling the IDiscFormat2TrackAtOnce::PrepareMedia method or after calling the + /// IDiscFormat2TrackAtOnce::ReleaseMedia method; you cannot set it during a track-writing session. + /// + /// This property is useful to create a multi-session CD with audio in the first session and data in the second session. + /// + // https://docs.microsoft.com/en-us/windows/win32/api/imapi2/nf-imapi2-idiscformat2trackatonce-put_donotfinalizemedia HRESULT + // put_DoNotFinalizeMedia( VARIANT_BOOL value ); + [DispId(0x107)] + bool DoNotFinalizeMedia { set; [return: MarshalAs(UnmanagedType.VariantBool)] get; } + + /// Retrieves the table of content for the audio tracks that were laid on the media within the track-writing session. + /// + /// Table of contents for the audio tracks that were laid on the media within the track-writing session. Each element of the list is + /// a VARIANT of type VT_BYREF|VT_UI1. The pbVal member of the variant contains a binary blob. For details of + /// the blob, see the READ TOC command at ftp://ftp.t10.org/t10/drafts/mmc5/mmc5r03.pdf. + /// + /// The property is not accessible outside a track-writing session. Nor is the property accessible if the disc is blank. + // https://docs.microsoft.com/en-us/windows/win32/api/imapi2/nf-imapi2-idiscformat2trackatonce-get_expectedtableofcontents HRESULT + // get_ExpectedTableOfContents( SAFEARRAY **value ); + [DispId(0x10A)] + IntPtr[] ExpectedTableOfContents { [return: MarshalAs(UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof(SafeArrayMarshaler))] get; } + + /// Retrieves the type of media in the disc device. + /// Type of media in the disc device. For possible values, see the IMAPI_MEDIA_PHYSICAL_TYPEenumeration type. + // https://docs.microsoft.com/en-us/windows/win32/api/imapi2/nf-imapi2-idiscformat2trackatonce-get_currentphysicalmediatype HRESULT + // get_CurrentPhysicalMediaType( IMAPI_MEDIA_PHYSICAL_TYPE *value ); + [DispId(0x10B)] + IMAPI_MEDIA_PHYSICAL_TYPE CurrentPhysicalMediaType { get; } + + /// Sets the friendly name of the client. + /// Name of the client application. + /// + /// + /// The name is used when the write operation requests exclusive access to the device. The IDiscRecorder2::get_ExclusiveAccessOwner + /// property contains the name of the client that has the lock. + /// + /// + /// Because any application with read/write access to the CDROM device during the write operation can use the + /// IOCTL_CDROM_EXCLUSIVE_ACCESS (query) control code (see the Microsoft Windows Driver Development Kit (DDK)) to access the name, + /// it is important that the name identify the program that is using this interface to write to the media. The name is restricted to + /// the same character set as required by the IOCTL_CDROM_EXCLUSIVE_ACCESS control code. + /// + /// + // https://docs.microsoft.com/en-us/windows/win32/api/imapi2/nf-imapi2-idiscformat2trackatonce-put_clientname HRESULT + // put_ClientName( BSTR value ); + [DispId(0x10E)] + string ClientName { set; [return: MarshalAs(UnmanagedType.BStr)] get; } + + /// Retrieves the requested write speed. + /// + /// Requested write speed measured in disc sectors per second. + /// A value of 0xFFFFFFFF (-1) requests that the write occurs using the fastest supported speed for the media. + /// + /// This is the value specified in the most recent call to the IDiscFormat2TrackAtOnce::SetWriteSpeed method. + // https://docs.microsoft.com/en-us/windows/win32/api/imapi2/nf-imapi2-idiscformat2trackatonce-get_requestedwritespeed HRESULT + // get_RequestedWriteSpeed( LONG *value ); + [DispId(0x10F)] + int RequestedWriteSpeed { get; } + + /// Retrieves the requested rotational-speed control type. + /// + /// Requested rotational-speed control type. Is VARIANT_TRUE for constant angular velocity (CAV) rotational-speed control type. + /// Otherwise, is VARIANT_FALSE for any other rotational-speed control type that the recorder supports. + /// + /// This is the value specified in the most recent call to the IDiscFormat2TrackAtOnce::SetWriteSpeed method. + // https://docs.microsoft.com/en-us/windows/win32/api/imapi2/nf-imapi2-idiscformat2trackatonce-get_requestedrotationtypeispurecav + // HRESULT get_RequestedRotationTypeIsPureCAV( VARIANT_BOOL *value ); + [DispId(0x110)] + bool RequestedRotationTypeIsPureCAV { [return: MarshalAs(UnmanagedType.VariantBool)] get; } + + /// Retrieves the drive's current write speed. + /// The write speed of the current media, measured in sectors per second. + /// + /// To retrieve the requested write speed, call the IDiscFormat2TrackAtOnce::get_RequestedWriteSpeed method. + /// + /// To retrieve a list of the write speeds that the recorder and current media supports, call the + /// IDiscFormat2TrackAtOnce::get_SupportedWriteSpeeds method. + /// + /// + /// Note that the write speed is based on the media write speeds. The value of this property can change when a media change occurs. + /// + /// + // https://docs.microsoft.com/en-us/windows/win32/api/imapi2/nf-imapi2-idiscformat2trackatonce-get_currentwritespeed HRESULT + // get_CurrentWriteSpeed( LONG *value ); + [DispId(0x111)] + int CurrentWriteSpeed { get; } + + /// Retrieves the current rotational-speed control used by the recorder. + /// + /// Is VARIANT_TRUE if constant angular velocity (CAV) rotational-speed control is in use. Otherwise, VARIANT_FALSE to indicate that + /// another rotational-speed control that the recorder supports is in use. + /// + /// + /// + /// To retrieve the requested rotational-speed control, call the IDiscFormat2TrackAtOnce::get_RequestedRotationTypeIsPureCAV method. + /// + /// Rotational-speed control types include the following: + /// + /// + /// CLV (Constant Linear Velocity). The disc is written at a constant speed. Standard rotational control. + /// + /// + /// CAV (Constant Angular Velocity). The disc is written at a constantly increasing speed. + /// + /// + /// + /// ZCAV (Zone Constant Angular Velocity). The disc is divided into zones. After each zone, the write speed increases. This is an + /// impure form of CAV. + /// + /// + /// + /// + /// PCAV (Partial Constant Angular Velocity). The disc speed increases up to a specified velocity. Once reached, the disc spins at + /// the specified velocity for the duration of the disc writing. + /// + /// + /// + /// + // https://docs.microsoft.com/en-us/windows/win32/api/imapi2/nf-imapi2-idiscformat2trackatonce-get_currentrotationtypeispurecav + // HRESULT get_CurrentRotationTypeIsPureCAV( VARIANT_BOOL *value ); + [DispId(0x112)] + bool CurrentRotationTypeIsPureCAV { [return: MarshalAs(UnmanagedType.VariantBool)] get; } + + /// Retrieves a list of the write speeds supported by the disc recorder and current media. + /// + /// List of the write speeds supported by the disc recorder and current media. Each element of the list is a VARIANT of type + /// VT_UI4. The ulVal member of the variant contains the number of sectors written per second. + /// + /// + /// You can use a speed from the list to set the write speed when calling the IDiscFormat2TrackAtOnce::SetWriteSpeed method. + /// + /// To retrieve a list of the write configurations that the recorder and current media supports, call the + /// IDiscFormat2TrackAtOnce::get_SupportedWriteSpeedDescriptors method. + /// + /// + // https://docs.microsoft.com/en-us/windows/win32/api/imapi2/nf-imapi2-idiscformat2trackatonce-get_supportedwritespeeds HRESULT + // get_SupportedWriteSpeeds( SAFEARRAY **supportedSpeeds ); + [DispId(0x113)] + uint[] SupportedWriteSpeeds { [return: MarshalAs(UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof(SafeArrayMarshaler))] get; } + + /// Retrieves a list of the detailed write configurations supported by the disc recorder and current media. + /// List of the detailed write configurations supported by the disc recorder and current media. Each element of the list is a VARIANT of type VT_Dispatch. Query the pdispVal member of the variant for the IWriteSpeedDescriptor interface, which contains the media type, write speed, rotational-speed control type. + /// To retrieve a list of the write speeds that the recorder and current media supports, call the IDiscFormat2TrackAtOnce::get_SupportedWriteSpeeds method. + // https://docs.microsoft.com/en-us/windows/win32/api/imapi2/nf-imapi2-idiscformat2trackatonce-get_supportedwritespeeddescriptors + // HRESULT get_SupportedWriteSpeedDescriptors( SAFEARRAY **supportedSpeedDescriptors ); + [DispId(0x114)] + IWriteSpeedDescriptor[] SupportedWriteSpeedDescriptors { [return: MarshalAs(UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof(SafeArrayMarshaler))] get; } + } + + /// + /// Use this interface to retrieve information about the current write operation. + /// This interface is passed to the DDiscFormat2TrackAtOnceEvents::Update method that you implement. + /// + // https://docs.microsoft.com/en-us/windows/win32/api/imapi2/nn-imapi2-idiscformat2trackatonceeventargs + [PInvokeData("imapi2.h", MSDNShortId = "NN:imapi2.IDiscFormat2TrackAtOnceEventArgs")] + [ComImport, Guid("27354140-7F64-5B0F-8F00-5D77AFBE261E"), InterfaceType(ComInterfaceType.InterfaceIsDual)] + public interface IDiscFormat2TrackAtOnceEventArgs : IWriteEngine2EventArgs + { + /// Retrieves the starting logical block address (LBA) of the current write operation. + /// Starting logical block address of the write operation. Negative values for LBAs are supported. + /// This is the same value passed to the IWriteEngine2::WriteSection method. + // https://docs.microsoft.com/en-us/windows/win32/api/imapi2/nf-imapi2-iwriteengine2eventargs-get_startlba HRESULT get_StartLba( + // LONG *value ); + [DispId(0x100)] + new int StartLba { get; } + + /// Retrieves the number of sectors to write to the device in the current write operation. + /// The number of sectors to write in the current write operation. + /// This is the same value passed to the IWriteEngine2::WriteSection method. + // https://docs.microsoft.com/en-us/windows/win32/api/imapi2/nf-imapi2-iwriteengine2eventargs-get_sectorcount HRESULT + // get_SectorCount( LONG *value ); + [DispId(0x101)] + new int SectorCount { get; } + + /// Retrieves the address of the sector most recently read from the burn image. + /// Logical block address of the sector most recently read from the input data stream. + // https://docs.microsoft.com/en-us/windows/win32/api/imapi2/nf-imapi2-iwriteengine2eventargs-get_lastreadlba HRESULT + // get_LastReadLba( LONG *value ); + [DispId(0x102)] + new int LastReadLba { get; } + + /// Retrieves the address of the sector most recently written to the device. + /// Logical block address of the sector most recently written to the device. + // https://docs.microsoft.com/en-us/windows/win32/api/imapi2/nf-imapi2-iwriteengine2eventargs-get_lastwrittenlba HRESULT + // get_LastWrittenLba( LONG *value ); + [DispId(0x103)] + new int LastWrittenLba { get; } + + /// Retrieves the size of the internal data buffer that is used for writing to disc. + /// Size, in bytes, of the internal data buffer that is used for writing to disc. + // https://docs.microsoft.com/en-us/windows/win32/api/imapi2/nf-imapi2-iwriteengine2eventargs-get_totalsystembuffer HRESULT + // get_TotalSystemBuffer( LONG *value ); + [DispId(0x106)] + new int TotalSystemBuffer { get; } + + /// Retrieves the number of used bytes in the internal data buffer that is used for writing to disc. + /// Size, in bytes, of the used portion of the internal data buffer that is used for writing to disc. + /// This value increases as data is read into the buffer and decreases as data is written to disc. + // https://docs.microsoft.com/en-us/windows/win32/api/imapi2/nf-imapi2-iwriteengine2eventargs-get_usedsystembuffer HRESULT + // get_UsedSystemBuffer( LONG *value ); + [DispId(0x107)] + new int UsedSystemBuffer { get; } + + /// Retrieves the number of unused bytes in the internal data buffer that is used for writing to disc. + /// Size, in bytes, of the unused portion of the internal data buffer that is used for writing to disc. + /// This method returns the same value as if you subtracted IWriteEngine2EventArgs::get_UsedSystemBuffer from IWriteEngine2EventArgs::get_TotalSystemBuffer. + // https://docs.microsoft.com/en-us/windows/win32/api/imapi2/nf-imapi2-iwriteengine2eventargs-get_freesystembuffer HRESULT + // get_FreeSystemBuffer( LONG *value ); + [DispId(0x108)] + new int FreeSystemBuffer { get; } + + /// Retrieves the current track number being written to the media. + /// Track number, ranging from 1 through 99. + // https://docs.microsoft.com/en-us/windows/win32/api/imapi2/nf-imapi2-idiscformat2trackatonceeventargs-get_currenttracknumber + // HRESULT get_CurrentTrackNumber( LONG *value ); + [DispId(0x300)] + int CurrentTrackNumber { get; } + + /// Retrieves the current write action being performed. + /// + /// Current write action being performed. For a list of possible actions, see the IMAPI_FORMAT2_TAO_WRITE_ACTION enumeration type. + /// + // https://docs.microsoft.com/en-us/windows/win32/api/imapi2/nf-imapi2-idiscformat2trackatonceeventargs-get_currentaction HRESULT + // get_CurrentAction( IMAPI_FORMAT2_TAO_WRITE_ACTION *value ); + [DispId(0x301)] + IMAPI_FORMAT2_TAO_WRITE_ACTION CurrentAction { get; } + + /// Retrieves the total elapsed time of the write operation. + /// Elapsed time, in seconds, of the write operation. + // https://docs.microsoft.com/en-us/windows/win32/api/imapi2/nf-imapi2-idiscformat2trackatonceeventargs-get_elapsedtime HRESULT + // get_ElapsedTime( LONG *value ); + [DispId(0x302)] + int ElapsedTime { get; } + + /// Retrieves the estimated remaining time of the write operation. + /// Estimated time, in seconds, needed for the remainder of the write operation. + /// + /// The estimate for a single write operation can vary as the operation progresses. The drive provides updated information that can + /// affect the projected duration of the write operation. + /// + // https://docs.microsoft.com/en-us/windows/win32/api/imapi2/nf-imapi2-idiscformat2trackatonceeventargs-get_remainingtime HRESULT + // get_RemainingTime( LONG *value ); + [DispId(0x303)] + int RemainingTime { get; } + } + + /// + /// Use this interface to enumerate the CD and DVD devices installed on the computer. + /// + /// To create an instance of this interface, call the CoCreateInstance function. Use__uuidof(MsftDiscMaster2) for the class + /// identifier and __uuidof(IDiscMaster2) for the interface identifier. + /// + /// + /// + /// + /// To create the MsftDiscMaster2 object in a script, use IMAPI2.MsftDiscMaster2 as the program identifier when calling CreateObject. + /// + /// To receive notification when a device is added or removed from the computer, implement the DDiscMaster2Events interface. + /// + // https://docs.microsoft.com/en-us/windows/win32/api/imapi2/nn-imapi2-idiscmaster2 + [PInvokeData("imapi2.h", MSDNShortId = "NN:imapi2.IDiscMaster2")] + [ComImport, Guid("27354130-7F64-5B0F-8F00-5D77AFBE261E"), InterfaceType(ComInterfaceType.InterfaceIsDual), CoClass(typeof(MsftDiscMaster2))] + public interface IDiscMaster2 : IEnumerable + { + /// Returns an enumerator that iterates through a collection. + /// An object that can be used to iterate through the collection. + [DispId(-4)] + [return: MarshalAs(UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof(EnumeratorToEnumVariantMarshaler))] + new IEnumerator GetEnumerator(); + + /// Retrieves the unique identifier of the specified disc device. + /// + /// Zero-based index of the device whose unique identifier you want to retrieve. + /// The index value can change during PNP activity when devices are added or removed from the computer, or across boot sessions. + /// + /// String that contains the unique identifier of the disc device associated with the specified index. + /// + /// To enumerate all identifiers, call the IDiscMaster2::get__NewEnum method. + /// + /// The following sample demonstrates how to re-enumerate optical drives in order to accurately account for drives added or removed + /// after the initial creation of the IDiscMaster2 object. This is accomplished via the IDiscMaster2::get_Item and + /// IDiscMaster2::get_Count methods: + /// + /// + /// #include <windows.h> #include <tchar.h> #include <imapi2.h> #include <objbase.h> #include <stdio.h> #pragma comment(lib, "ole32.lib") #pragma comment(lib, "user32.lib") int __cdecl _tmain(int argc, TCHAR* argv[]) { BSTR bstrDeviceName; HRESULT hr = S_OK; BOOL bComInitialised; IDiscMaster2* discMaster; UINT iCounter = 0; LONG lValue = 0; bComInitialised = SUCCEEDED(CoInitializeEx(0, COINIT_MULTITHREADED)); // Create an object of IDiscMaster2 if (SUCCEEDED(hr)){ CoCreateInstance( CLSID_MsftDiscMaster2, NULL, CLSCTX_ALL, IID_PPV_ARGS(&discMaster) ); if(FAILED(hr)){ _tprintf(TEXT("\nUnsuccessful in creating an instance of CLSID_MsftDiscMaster2.\n\nError returned: 0x%x\n"), hr); return 0; } } // // Loop twice and get the optical drives attached to the system, // first time just get the current configuration and second time // prompt the user to change the configuration and then get the // altered configuration. // do{ // Get the number of drives if (SUCCEEDED(hr)){ hr = discMaster->get_Count(&lValue); if (SUCCEEDED(hr)){ _tprintf(TEXT("\nTotal number of drives = %d\n"), lValue); } } // Print all the optical drives attached to the system if (SUCCEEDED(hr)){ for(LONG iCount = 0; iCount < lValue; iCount++) { hr = discMaster->get_Item(iCount, &bstrDeviceName); _tprintf(TEXT("\nUnique identifier of the disc device associated with index %d is: %s\n"), iCount, bstrDeviceName); } } // Prompt the user to unhook or add drives if (iCounter < 1){ MessageBox(NULL,TEXT("Please un-hook or add drives and hit OK"), TEXT("Manual Action"), MB_OK); _tprintf(TEXT("\nGetting the altered configuration ... \n")); } iCounter++; }while(iCounter < 2); discMaster->Release(); CoUninitialize(); bComInitialised = FALSE; return 0; + /// + /// + // https://docs.microsoft.com/en-us/windows/win32/api/imapi2/nf-imapi2-idiscmaster2-get_item HRESULT get_Item( LONG index, BSTR + // *value ); + [DispId(0)] + string this[int index] { [return: MarshalAs(UnmanagedType.BStr)] get; } + + /// Retrieves the number of the CD and DVD disc devices installed on the computer. + /// Number of CD and DVD disc devices installed on the computer. + // https://docs.microsoft.com/en-us/windows/win32/api/imapi2/nf-imapi2-idiscmaster2-get_count HRESULT get_Count( LONG *value ); + [DispId(1)] + int Count { get; } + + /// + /// Retrieves a value that determines if the environment contains one or more optical devices and the execution context has + /// permission to access the devices. + /// + /// + /// Is VARIANT_TRUE if the environment contains one or more optical devices and the execution context has permission to access the + /// devices; otherwise, VARIANT_FALSE. + /// + /// + /// + /// This method loops through all the strings in IDiscMaster2 and attempts to use each string to initialize a DiscRecorder2 object. + /// If any of the recorders on the system succeed the initialization, this method returns TRUE. + /// + /// The environment must contain at least one type-5 optical device. + /// + // https://docs.microsoft.com/en-us/windows/win32/api/imapi2/nf-imapi2-idiscmaster2-get_issupportedenvironment HRESULT + // get_IsSupportedEnvironment( VARIANT_BOOL *value ); + [DispId(2)] + bool IsSupportedEnvironment { [return: MarshalAs(UnmanagedType.VariantBool)] get; } + } + + /// + /// + /// This interface represents a physical device. You use this interface to retrieve information about a CD and DVD device installed on + /// the computer and to perform operations such as closing the tray or eject the media. + /// + /// + /// To create an instance of this interface, call the CoCreateInstance function. Use__uuidof(MsftDiscRecorder2) for the class + /// identifier and __uuidof(IDiscRecorder2) for the interface identifier. + /// + /// + /// + /// + /// To create the MsftDiscRecorder2 object in a script, use IMAPI2.MsftDiscRecorder2 as the program identifier when calling CreateObject. + /// + /// + /// To write data to media, you need to attach a recorder to a format writer, for example, to attach the recorder to a data writer, call + /// the IDiscFormat2Data::put_Recorder method. + /// + /// + /// Several properties of this interface return packet data defined by Multimedia Command (MMC). For information on the format of the + /// packet data, see the latest revision of the MMC specification at ftp://ftp.t10.org/t10/drafts/mmc5. + /// + /// + // https://docs.microsoft.com/en-us/windows/win32/api/imapi2/nn-imapi2-idiscrecorder2 + [PInvokeData("imapi2.h", MSDNShortId = "NN:imapi2.IDiscRecorder2")] + [ComImport, Guid("27354133-7F64-5B0F-8F00-5D77AFBE261E"), InterfaceType(ComInterfaceType.InterfaceIsDual), CoClass(typeof(MsftDiscRecorder2))] + public interface IDiscRecorder2 + { + /// Ejects media from the device. + // https://docs.microsoft.com/en-us/windows/win32/api/imapi2/nf-imapi2-idiscrecorder2-ejectmedia HRESULT EjectMedia(); + [DispId(256)] + void EjectMedia(); + + /// Closes the media tray. + /// + /// Note Some drives, such as those with slot-loading mechanisms, do not support this method. To determine if the device + /// supports this method, call the IDiscRecorder2::get_DeviceCanLoadMedia property. + /// + // https://docs.microsoft.com/en-us/windows/win32/api/imapi2/nf-imapi2-idiscrecorder2-closetray HRESULT CloseTray(); + [DispId(257)] + void CloseTray(); + + /// Acquires exclusive access to the device. + /// + /// Set to VARIANT_TRUE to gain exclusive access to the volume whether the file system volume can or cannot be dismounted. If + /// VARIANT_FALSE, this method gains exclusive access only when there is no file system mounted on the volume. + /// + /// + /// String that contains the friendly name of the client application requesting exclusive access. Cannot be NULL or a + /// zero-length string. The string must conform to the restrictions for the IOCTL_CDROM_EXCLUSIVE_ACCESS control code found in the DDK. + /// + /// + /// + /// You should not have to call this method to acquire the lock yourself because the write operations, such as + /// IDiscFormat2Data::Write, acquires the lock for you. + /// + /// + /// Each recorder has a lock count. The first call to a recorder locks the device for exclusive access. Applications can use the + /// AcquireExclusiveAccess method multiple times to apply multiple locks on a device. Each call increments the lock count by one. + /// + /// + /// When unlocking a recorder, the lock count must reach zero to free the device for other clients. Calling the + /// IDiscRecorder2::ReleaseExclusiveAccess method decrements the lock count by one. + /// + /// + /// An equal number of calls to the AcquireExclusiveAccess and ReleaseExclusiveAccess methods are needed to free a device. + /// Should the application exit unexpectedly or crash while holding the exclusive access, the CDROM.SYS driver will automatically + /// release these exclusive locks. + /// + /// + /// If the device is already locked, you can call IDiscRecorder2::get_ExclusiveAccessOwner to retrieve the name of the client + /// application that currently has exclusive access. + /// + /// + // https://docs.microsoft.com/en-us/windows/win32/api/imapi2/nf-imapi2-idiscrecorder2-acquireexclusiveaccess HRESULT + // AcquireExclusiveAccess( VARIANT_BOOL force, BSTR __MIDL__IDiscRecorder20000 ); + [DispId(258)] + void AcquireExclusiveAccess([MarshalAs(UnmanagedType.VariantBool)] bool force, [MarshalAs(UnmanagedType.BStr)] string clientName); + + /// Releases exclusive access to the device. + /// + /// + /// Each recorder has a lock count. The first call to a recorder locks the device for exclusive access. Applications can use the + /// IDiscRecorder2::AcquireExclusiveAccess method multiple times to apply multiple locks on a device. Each call increments the lock + /// count by one. + /// + /// + /// When unlocking a recorder, the lock count must reach zero to free the device for other clients. Calling the + /// ReleaseExclusiveAccess method decrements the lock count by one. + /// + /// + /// An equal number of calls to the AcquireExclusiveAccess and ReleaseExclusiveAccess methods are needed to free a device. + /// When the lock count reaches zero, recording device is free; the last lock has been removed. + /// + /// + // https://docs.microsoft.com/en-us/windows/win32/api/imapi2/nf-imapi2-idiscrecorder2-releaseexclusiveaccess HRESULT ReleaseExclusiveAccess(); + [DispId(259)] + void ReleaseExclusiveAccess(); + + /// Disables Media Change Notification (MCN) for the device. + /// + /// + /// MCN is the CD-ROM device driver's method of detecting media change and state changes in the CD-ROM device. For example, when you + /// change the media in a CD-ROM device, a MCN message is sent to trigger media features, such as Autoplay. To disable the features, + /// call this method. + /// + /// + /// To enable notifications, call the IDiscRecorder2::EnableMcn method. If the application crashes or closes unexpectedly, then MCN + /// is automatically re-enabled by the driver. + /// + /// + /// Note that DisableMcn increments a reference count each time it is called. The EnableMcn method decrements the count. The device + /// is enabled when the reference count is zero. + /// + /// + // https://docs.microsoft.com/en-us/windows/win32/api/imapi2/nf-imapi2-idiscrecorder2-disablemcn HRESULT DisableMcn(); + [DispId(260)] + void DisableMcn(); + + /// Enables Media Change Notification (MCN) for the device. + /// + /// + /// MCN is the CD-ROM device driver's method of detecting media change and state changes in the CD-ROM device. For example, when you + /// change the media in a CD-ROM device, a MCN message is sent to trigger media features, such as Autoplay. MCN is enabled by + /// default. Call this method to enable notifications when the notifications have been disabled using IDiscRecorder2::DisableMcn. + /// + /// + /// Note that DisableMcn increments a reference count each time it is called. The EnableMcn method decrements the count. The device + /// is enabled when the reference count is zero. + /// + /// + // https://docs.microsoft.com/ja-jp/windows/win32/api/imapi2/nf-imapi2-idiscrecorder2-enablemcn HRESULT EnableMcn(); + [DispId(261)] + void EnableMcn(); + + /// Associates the object with the specified disc device. + /// String that contains the unique identifier for the device. + /// + /// You must initialize the recorder before calling any of the methods of this interface. + /// To retrieve a list of devices on the computer and their unique identifiers, call the IDiscMaster2::get__NewEnum method. + /// + /// This method will not fail on a drive that is exclusively locked. However, if the drive is exclusively locked, several of the + /// methods of this interface may return E_IMAPI_RECORDER_LOCKED. To determine who has exclusive access, call the + /// IDiscRecorder2::get_ExclusiveAccessOwner method. + /// + /// + // https://docs.microsoft.com/en-us/windows/win32/api/imapi2/nf-imapi2-idiscrecorder2-initializediscrecorder HRESULT + // InitializeDiscRecorder( BSTR recorderUniqueId ); + [DispId(262)] + void InitializeDiscRecorder([MarshalAs(UnmanagedType.BStr)] string recorderUniqueId); + + /// Retrieves the unique identifier used to initialize the disc device. + /// Unique identifier for the device. This is the identifier you specified when calling IDiscRecorder2::InitializeDiscRecorder. + // https://docs.microsoft.com/en-us/windows/win32/api/imapi2/nf-imapi2-idiscrecorder2-get_activediscrecorder HRESULT + // get_ActiveDiscRecorder( BSTR *value ); + [DispId(0)] + string ActiveDiscRecorder { [return: MarshalAs(UnmanagedType.BStr)] get; } + + /// Retrieves the vendor ID for the device. + /// String that contains the vendor ID for the device. + // https://docs.microsoft.com/en-us/windows/win32/api/imapi2/nf-imapi2-idiscrecorder2-get_vendorid HRESULT get_VendorId( BSTR *value ); + [DispId(513)] + string VendorId { [return: MarshalAs(UnmanagedType.BStr)] get; } + + /// Retrieves the product ID of the device. + /// String that contains the product ID of the device. + // https://docs.microsoft.com/en-us/windows/win32/api/imapi2/nf-imapi2-idiscrecorder2-get_productid HRESULT get_ProductId( BSTR + // *value ); + [DispId(514)] + string ProductId { [return: MarshalAs(UnmanagedType.BStr)] get; } + + /// Retrieves the product revision code of the device. + /// String that contains the product revision code of the device. + // https://docs.microsoft.com/en-us/windows/win32/api/imapi2/nf-imapi2-idiscrecorder2-get_productrevision HRESULT + // get_ProductRevision( BSTR *value ); + [DispId(515)] + string ProductRevision { [return: MarshalAs(UnmanagedType.BStr)] get; } + + /// Retrieves the unique volume name associated with the device. + /// String that contains the unique volume name associated with the device. + /// To retrieve the drive letter assignment, call the IDiscRecorder2::get_VolumePathNames method. + // https://docs.microsoft.com/en-us/windows/win32/api/imapi2/nf-imapi2-idiscrecorder2-get_volumename HRESULT get_VolumeName( BSTR + // *value ); + [DispId(516)] + string VolumeName { [return: MarshalAs(UnmanagedType.BStr)] get; } + + /// Retrieves a list of drive letters and NTFS mount points for the device. + /// + /// List of drive letters and NTFS mount points for the device. Each element of the list is a VARIANT of type VT_BSTR. + /// The bstrVal member of the variant contains the path. + /// + // https://docs.microsoft.com/en-us/windows/win32/api/imapi2/nf-imapi2-idiscrecorder2-get_volumepathnames HRESULT + // get_VolumePathNames( SAFEARRAY **value ); + [DispId(517)] + string[] VolumePathNames { [return: MarshalAs(UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof(SafeArrayMarshaler))] get; } + + /// Determines if the device can eject and subsequently reload media. + /// + /// Is VARIANT_TRUE if the device can eject and subsequently reload media. If VARIANT_FALSE, loading media must be done manually. + /// + /// Note For slim drives or laptop drives, which utilize a manual tray-loading mechanism, this parameter can indicate an + /// incorrect value of VARIANT_TRUE. + /// + /// + // https://docs.microsoft.com/en-us/windows/win32/api/imapi2/nf-imapi2-idiscrecorder2-get_devicecanloadmedia HRESULT + // get_DeviceCanLoadMedia( VARIANT_BOOL *value ); + [DispId(518)] + bool DeviceCanLoadMedia { [return: MarshalAs(UnmanagedType.VariantBool)] get; } + + /// Retrieves the legacy device number for a CD or DVD device. + /// + /// Zero-based index number of the device, based on the order the device was installed on the computer. + /// + /// This value can change during PNP activity when devices are added or removed from the computer, or across boot sessions and + /// should not be considered a unique identifier for the device. + /// + /// + // https://docs.microsoft.com/en-us/windows/win32/api/imapi2/nf-imapi2-idiscrecorder2-get_legacydevicenumber HRESULT + // get_LegacyDeviceNumber( LONG *legacyDeviceNumber ); + [DispId(519)] + int LegacyDeviceNumber { get; } + + /// Retrieves the list of features that the device supports. + /// + /// List of features that the device supports. Each element of the list is a VARIANT of type VT_I4. The lVal + /// member of the variant contains the feature page type value. For possible values, see the IMAPI_FEATURE_PAGE_TYPE enumeration type. + /// + // https://docs.microsoft.com/en-us/windows/win32/api/imapi2/nf-imapi2-idiscrecorder2-get_supportedfeaturepages HRESULT + // get_SupportedFeaturePages( SAFEARRAY **value ); + [DispId(520)] + IMAPI_FEATURE_PAGE_TYPE[] SupportedFeaturePages { [return: MarshalAs(UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof(SafeArrayMarshaler))] get; } + + /// Retrieves the list of feature pages of the device that are marked as current. + /// + /// List of supported feature pages that are marked as current for the device. Each element of the list is a VARIANT of type + /// VT_I4. The lVal member of the variant contains the feature page type. For possible values, see the + /// IMAPI_FEATURE_PAGE_TYPE enumeration. + /// + // https://docs.microsoft.com/en-us/windows/win32/api/imapi2/nf-imapi2-idiscrecorder2-get_currentfeaturepages HRESULT + // get_CurrentFeaturePages( SAFEARRAY **value ); + [DispId(521)] + IMAPI_FEATURE_PAGE_TYPE[] CurrentFeaturePages { [return: MarshalAs(UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof(SafeArrayMarshaler))] get; } + + /// Retrieves the list of MMC profiles that the device supports. + /// + /// List of MMC profiles that the device supports. Each element of the list is a VARIANT of type VT_I4. The + /// lVal member of the variant contains the profile type value. For possible values, see the IMAPI_PROFILE_TYPE enumeration type. + /// + // https://docs.microsoft.com/en-us/windows/win32/api/imapi2/nf-imapi2-idiscrecorder2-get_supportedprofiles HRESULT + // get_SupportedProfiles( SAFEARRAY **value ); + [DispId(522)] + IMAPI_PROFILE_TYPE[] SupportedProfiles { [return: MarshalAs(UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof(SafeArrayMarshaler))] get; } + + /// Retrieves all MMC profiles of the device that are marked as current. + /// + /// List of supported profiles that are marked as current for the device. Each element of the list is a VARIANT of type + /// VT_I4. The lVal member of the variant contains the profile type. For possible values, see the IMAPI_PROFILE_TYPE enumeration. + /// + // https://docs.microsoft.com/en-us/windows/win32/api/imapi2/nf-imapi2-idiscrecorder2-get_currentprofiles HRESULT + // get_CurrentProfiles( SAFEARRAY **value ); + [DispId(523)] + IMAPI_PROFILE_TYPE[] CurrentProfiles { [return: MarshalAs(UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof(SafeArrayMarshaler))] get; } + + /// Retrieves the list of MMC mode pages that the device supports. + /// + /// List of MMC mode pages that the device supports. Each element of the list is a VARIANT of type VT_I4. The + /// lVal member of the variant contains the mode page type value. For possible values, see the IMAPI_MODE_PAGE_TYPE + /// enumeration type. + /// + // https://docs.microsoft.com/en-us/windows/win32/api/imapi2/nf-imapi2-idiscrecorder2-get_supportedmodepages HRESULT + // get_SupportedModePages( SAFEARRAY **value ); + [DispId(524)] + IMAPI_MODE_PAGE_TYPE[] SupportedModePages { [return: MarshalAs(UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof(SafeArrayMarshaler))] get; } + + /// Retrieves the name of the client application that has exclusive access to the device. + /// String that contains the name of the client application that has exclusive access to the device. + /// + /// This property returns the current exclusive access owner of the device. This value comes directly from CDROM.SYS and should be + /// queried anytime an operation fails with error E_IMAPI_RECORDER_LOCKED. + /// + // https://docs.microsoft.com/en-us/windows/win32/api/imapi2/nf-imapi2-idiscrecorder2-get_exclusiveaccessowner HRESULT + // get_ExclusiveAccessOwner( BSTR *value ); + [DispId(525)] + string ExclusiveAccessOwner { [return: MarshalAs(UnmanagedType.BStr)] get; } + } + + /// + /// + /// This interface represents a physical device. You use this interface to retrieve information about a CD and DVD device installed on + /// the computer and to perform operations such as closing the tray or ejecting the media. This interface retrieves information not + /// available through IDiscRecorder2 interface, and provides easier access to some of the same property values in IDiscRecorder2. + /// + /// + /// To get an instance of this interface, create an instance of the IDiscRecorder2 interface and then call the + /// IDiscRecorder2::QueryInterface method to retrieve the IDiscRecorder2Ex interface. + /// + /// Note that you cannot access this functionality from script. + /// + /// + /// To write data to media, you need to attach this recorder to the IWriteEngine2 data writer, using the IWriteEngine2::put_Recorder method. + /// + // https://docs.microsoft.com/en-us/windows/win32/api/imapi2/nn-imapi2-idiscrecorder2ex + [PInvokeData("imapi2.h", MSDNShortId = "NN:imapi2.IDiscRecorder2Ex")] + [ComImport, Guid("27354132-7F64-5B0F-8F00-5D77AFBE261E"), InterfaceType(ComInterfaceType.InterfaceIsIUnknown), CoClass(typeof(MsftDiscRecorder2))] + public interface IDiscRecorder2Ex + { + /// + /// Sends a MMC command to the recording device. Use this function when no data buffer is sent to nor received from the device. + /// + /// Command packet to send to the device. + /// Size, in bytes, of the command packet to send. Must be between 6 and 16 bytes. + /// Sense data returned by the recording device. + /// Time limit, in seconds, allowed for the send command to receive a result. + /// + /// + /// For details of the contents of the command packet and sense data, see the latest revision of the MMC specification at ftp://ftp.t10.org/t10/drafts/mmc5. + /// + /// + /// Client-defined commands (CDBs) used with this method must be between 6 and 16 bytes in length. In addition, the size of each + /// command must match the size defined by the operation code as defined in the following table. + /// + /// + /// + /// CDB operation code range + /// CDB group + /// Required CDB size + /// + /// + /// 0x00 — 0x1F + /// 0 + /// 6 bytes + /// + /// + /// 0x20 — 0x3F + /// 1 + /// 10 bytes + /// + /// + /// 0x40 — 0x5F + /// 2 + /// 10 bytes + /// + /// + /// 0x60 — 0x7F + /// 3 + /// Will enforce standard-specified size requirements for this opcode range in the future. + /// + /// + /// 0x80 — 0x9F + /// 4 + /// 16 bytes + /// + /// + /// 0xA0 — 0xBF + /// 5 + /// 12 bytes + /// + /// + /// 0xC0 — 0xDF + /// 6 + /// Vendor Unique - Any size allowed + /// + /// + /// 0xE0 — 0xFF + /// 7 + /// Vendor Unique - Any size allowed + /// + /// + /// + /// Some very early devices used vendor-unique opcodes and therefore some opcodes cannot be validated in this manner. The following + /// opcodes are still valid and only verify that the size is between 6 and 16 bytes: + /// + /// + /// 0x02, 0x05, 0x06, 0x09, 0x0C, 0x0D, 0x0E, 0x0F, 0x10, 0x13, 0x14, 0x19, 0x20, 0x21, 0x22, 0x23, 0x24, 0x26, 0x27, 0x29, 0x2C, 0x2D + /// + /// + // https://docs.microsoft.com/en-us/windows/win32/api/imapi2/nf-imapi2-idiscrecorder2ex-sendcommandnodata HRESULT SendCommandNoData( + // BYTE *Cdb, ULONG CdbSize, BYTE [18] SenseBuffer, ULONG Timeout ); + void SendCommandNoData([MarshalAs(UnmanagedType.LPArray, ArraySubType = UnmanagedType.U1, SizeParamIndex = 1)] byte[] Cdb, uint CdbSize, + [MarshalAs(UnmanagedType.LPArray, SizeConst = 18)] byte[] SenseBuffer, uint Timeout); + + /// Sends a MMC command and its associated data buffer to the recording device. + /// Command packet to send to the device. + /// Size, in bytes, of the command packet to send. Must be between 6 and 16 bytes. + /// Sense data returned by the recording device. + /// Time limit, in seconds, allowed for the send command to receive a result. + /// Buffer containing data associated with the send command. Must not be NULL. + /// Size, in bytes, of the data buffer to send. Must not be zero. + /// + /// + /// For details of the contents of the command packet, sense data, and input data buffer, see the latest revision of the MMC + /// specification at ftp://ftp.t10.org/t10/drafts/mmc5. + /// + /// + /// Client-defined commands (CDBs) used with this method must be between 6 and 16 bytes in length. In addition, the size of each + /// command must match the size defined by the operation code as defined in the following table. + /// + /// + /// + /// CDB operation code range + /// CDB group + /// Required CDB size + /// + /// + /// 0x00 — 0x1F + /// 0 + /// 6 bytes + /// + /// + /// 0x20 — 0x3F + /// 1 + /// 10 bytes + /// + /// + /// 0x40 — 0x5F + /// 2 + /// 10 bytes + /// + /// + /// 0x60 — 0x7F + /// 3 + /// Will enforce standard-specified size requirements for this opcode range in the future. + /// + /// + /// 0x80 — 0x9F + /// 4 + /// 16 bytes + /// + /// + /// 0xA0 — 0xBF + /// 5 + /// 12 bytes + /// + /// + /// 0xC0 — 0xDF + /// 6 + /// Vendor Unique - Any size allowed + /// + /// + /// 0xE0 — 0xFF + /// 7 + /// Vendor Unique - Any size allowed + /// + /// + /// + /// Some very early devices used vendor-unique opcodes and therefore some opcodes cannot be validated in this manner. The following + /// opcodes are still valid and only verify that the size is between 6 and 16 bytes: + /// + /// + /// 0x02, 0x05, 0x06, 0x09, 0x0C, 0x0D, 0x0E, 0x0F, 0x10, 0x13, 0x14, 0x19, 0x20, 0x21, 0x22, 0x23, 0x24, 0x26, 0x27, 0x29, 0x2C, 0x2D + /// + /// + // https://docs.microsoft.com/en-us/windows/win32/api/imapi2/nf-imapi2-idiscrecorder2ex-sendcommandsenddatatodevice HRESULT + // SendCommandSendDataToDevice( BYTE *Cdb, ULONG CdbSize, BYTE [18] SenseBuffer, ULONG Timeout, BYTE *Buffer, ULONG_IMAPI2_NONZERO + // BufferSize ); + void SendCommandSendDataToDevice([MarshalAs(UnmanagedType.LPArray, ArraySubType = UnmanagedType.U1, SizeParamIndex = 1)] byte[] Cdb, + uint CdbSize, [MarshalAs(UnmanagedType.LPArray, SizeConst = 18)] byte[] SenseBuffer, uint Timeout, + [MarshalAs(UnmanagedType.LPArray, ArraySubType = UnmanagedType.U1, SizeParamIndex = 5)] byte[] Buffer, + uint BufferSize); + + /// Sends a MMC command to the recording device requesting data from the device. + /// Command packet to send to the device. + /// Size, in bytes, of the command packet to send. Must be between 6 and 16 bytes. + /// Sense data returned by the recording device. + /// Time limit, in seconds, allowed for the send command to receive a result. + /// + /// Application-allocated data buffer that will receive data associated with the send command. Must not be NULL. + /// + /// Size, in bytes, of the Buffer data buffer. Must not be zero. + /// Size, in bytes, of the data returned in the Buffer data buffer. + /// + /// + /// For details of the contents of the command packet, sense data, and output data buffer, see the latest revision of the MMC + /// specification at ftp://ftp.t10.org/t10/drafts/mmc5. + /// + /// + /// Client-defined commands (CDBs) used with this method must be between 6 and 16 bytes in length. In addition, the size of each + /// command must match the size defined by the operation code as defined in the following table. + /// + /// + /// + /// CDB operation code range + /// CDB group + /// Required CDB size + /// + /// + /// 0x00 — 0x1F + /// 0 + /// 6 bytes + /// + /// + /// 0x20 — 0x3F + /// 1 + /// 10 bytes + /// + /// + /// 0x40 — 0x5F + /// 2 + /// 10 bytes + /// + /// + /// 0x60 — 0x7F + /// 3 + /// Will enforce standard-specified size requirements for this opcode range in the future. + /// + /// + /// 0x80 — 0x9F + /// 4 + /// 16 bytes + /// + /// + /// 0xA0 — 0xBF + /// 5 + /// 12 bytes + /// + /// + /// 0xC0 — 0xDF + /// 6 + /// Vendor Unique - Any size allowed + /// + /// + /// 0xE0 — 0xFF + /// 7 + /// Vendor Unique - Any size allowed + /// + /// + /// + /// Some very early devices used vendor-unique opcodes and therefore some opcodes cannot be validated in this manner. The following + /// opcodes are still valid and only verify that the size is between 6 and 16 bytes: + /// + /// + /// 0x02, 0x05, 0x06, 0x09, 0x0C, 0x0D, 0x0E, 0x0F, 0x10, 0x13, 0x14, 0x19, 0x20, 0x21, 0x22, 0x23, 0x24, 0x26, 0x27, 0x29, 0x2C, 0x2D + /// + /// + // https://docs.microsoft.com/en-us/windows/win32/api/imapi2/nf-imapi2-idiscrecorder2ex-sendcommandgetdatafromdevice HRESULT + // SendCommandGetDataFromDevice( BYTE *Cdb, ULONG CdbSize, BYTE [18] SenseBuffer, ULONG Timeout, BYTE *Buffer, ULONG_IMAPI2_NONZERO + // BufferSize, ULONG_IMAPI2_NOT_NEGATIVE *BufferFetched ); + void SendCommandGetDataFromDevice([MarshalAs(UnmanagedType.LPArray, ArraySubType = UnmanagedType.U1, SizeParamIndex = 1)] byte[] Cdb, + uint CdbSize, [MarshalAs(UnmanagedType.LPArray, SizeConst = 18)] byte[] SenseBuffer, uint Timeout, + [MarshalAs(UnmanagedType.LPArray, ArraySubType = UnmanagedType.U1, SizeParamIndex = 5)] byte[] Buffer, + uint BufferSize, out uint BufferFetched); + + /// Reads a DVD structure from the media. + /// + /// Format field of the command packet. Acceptable values range from zero to 0xFF. + /// Note This value is truncated to UCHAR. + /// + /// Address field of the command packet. + /// Layer field of the command packet. + /// Authentication grant ID (AGID) field of the command packet. + /// + /// + /// Data buffer that contains the DVD structure. For details of the contents of the data buffer, see the READ DISC STRUCTURE command + /// in the latest revision of the MMC specification at ftp://ftp.t10.org/t10/drafts/mmc5. + /// + /// This method removes headers from the buffer. + /// When done, call the CoTaskMemFree function to free the memory. + /// + /// Size, in bytes, of the data buffer. + /// + /// This method removes the complexity of working with the READ DISC STRUCTURE command. For details on the values to specify for the + /// format, address, layer, and agid parameters, see their field descriptions for the READ DISC STRUCTURE command in the latest + /// revision of the MMC specification at ftp://ftp.t10.org/t10/drafts/mmc5. + /// + // https://docs.microsoft.com/en-us/windows/win32/api/imapi2/nf-imapi2-idiscrecorder2ex-readdvdstructure HRESULT ReadDvdStructure( + // ULONG format, ULONG address, ULONG layer, ULONG agid, BYTE **data, ULONG_IMAPI2_DVD_STRUCTURE *count ); + void ReadDvdStructure(uint format, uint address, uint layer, uint agid, out SafeCoTaskMemHandle data, out uint count); + + /// Sends a DVD structure to the media. + /// Format field of the command packet. Acceptable values range from zero to 0xFF. + /// + /// Data buffer that contains the DVD structure to send to the media. Do not include a header; this method generates and prepends a + /// header to the DVD structure. + /// + /// Size, in bytes, of the data buffer. + /// + /// For details on specifying the fields of the structure, see the SEND DISC STRUCTURE command in the latest revision of the MMC + /// specification at ftp://ftp.t10.org/t10/drafts/mmc5. + /// + // https://docs.microsoft.com/en-us/windows/win32/api/imapi2/nf-imapi2-idiscrecorder2ex-senddvdstructure HRESULT SendDvdStructure( + // ULONG format, BYTE *data, ULONG_IMAPI2_DVD_STRUCTURE count ); + void SendDvdStructure(uint format, [MarshalAs(UnmanagedType.LPArray, ArraySubType = UnmanagedType.U1, SizeParamIndex = 2)] byte[] data, int count); + + /// Retrieves the adapter descriptor for the device. + /// + /// + /// Data buffer that contains the descriptor of the storage adapter. For details of the contents of the data buffer, see the + /// STORAGE_ADAPTER_DESCRIPTOR structure in the DDK + /// + /// When done, call the CoTaskMemFree function to free the memory. + /// + /// Size, in bytes, of the data buffer. + // https://docs.microsoft.com/en-us/windows/win32/api/imapi2/nf-imapi2-idiscrecorder2ex-getadapterdescriptor HRESULT + // GetAdapterDescriptor( BYTE **data, ULONG_IMAPI2_ADAPTER_DESCRIPTOR *byteSize ); + void GetAdapterDescriptor(out SafeCoTaskMemHandle data, out uint byteSize); + + /// Retrieves the device descriptor for the device. + /// + /// + /// Data buffer that contains the descriptor of the storage device. For details of the contents of the data buffer, see the + /// STORAGE_DEVICE_DESCRIPTOR structure in the DDK + /// + /// When done, call the CoTaskMemFree function to free the memory. + /// + /// Size, in bytes, of the data buffer. + // https://docs.microsoft.com/en-us/windows/win32/api/imapi2/nf-imapi2-idiscrecorder2ex-getdevicedescriptor HRESULT + // GetDeviceDescriptor( BYTE **data, ULONG_IMAPI2_DEVICE_DESCRIPTOR *byteSize ); + void GetDeviceDescriptor(out SafeCoTaskMemHandle data, out uint byteSize); + + /// Retrieves the disc information from the media. + /// + /// + /// Data buffer that contains disc information from the media. For details of the contents of the data buffer, see the READ DISC + /// INFORMATION command in the latest revision of the MMC specification at ftp://ftp.t10.org/t10/drafts/mmc5. + /// + /// When done, call the CoTaskMemFree function to free the memory. + /// + /// Size, in bytes, of the data buffer. + /// See the MMC specification for details regarding how to interpret the returned data. + // https://docs.microsoft.com/en-us/windows/win32/api/imapi2/nf-imapi2-idiscrecorder2ex-getdiscinformation HRESULT + // GetDiscInformation( BYTE **discInformation, ULONG_IMAPI2_DISC_INFORMATION *byteSize ); + void GetDiscInformation(out SafeCoTaskMemHandle discInformation, out uint byteSize); + + /// Retrieves the track information from the media. + /// Address field. The addressType parameter provides additional context for this parameter. + /// + /// Type of address specified in the address parameter, for example, if this is an LBA address or a track number. For possible + /// values, see the IMAPI_READ_TRACK_ADDRESS_TYPE enumeration type. + /// + /// + /// + /// Data buffer that contains the track information. For details of the contents of the data buffer, see the READ TRACK INFORMATION + /// command in the latest revision of the MMC specification at ftp://ftp.t10.org/t10/drafts/mmc5. + /// + /// When done, call the CoTaskMemFree function to free the memory. + /// + /// Size, in bytes, of the trackInformation data buffer. + // https://docs.microsoft.com/en-us/windows/win32/api/imapi2/nf-imapi2-idiscrecorder2ex-gettrackinformation HRESULT + // GetTrackInformation( ULONG address, IMAPI_READ_TRACK_ADDRESS_TYPE addressType, BYTE **trackInformation, + // ULONG_IMAPI2_TRACK_INFORMATION *byteSize ); + void GetTrackInformation(uint address, IMAPI_READ_TRACK_ADDRESS_TYPE addressType, out SafeCoTaskMemHandle trackInformation, out uint byteSize); + + /// Retrieves the specified feature page from the device. + /// Feature page to retrieve. For possible values, see the IMAPI_FEATURE_PAGE_TYPE enumeration type. + /// + /// Set to True to retrieve the feature page only when it is the current feature page. Otherwise, False to retrieve the feature page + /// regardless of it being the current feature page. + /// + /// + /// + /// Data buffer that contains the feature page. For details of the contents of the data buffer, see the GET CONFIGURATION command in + /// the latest revision of the MMC specification at ftp://ftp.t10.org/t10/drafts/mmc5. + /// + /// This method removes header information and other non-feature data before filling and sending this buffer. + /// When done, call the CoTaskMemFree function to free the memory. + /// + /// Size, in bytes, of the featureData data buffer. + // https://docs.microsoft.com/en-us/windows/win32/api/imapi2/nf-imapi2-idiscrecorder2ex-getfeaturepage HRESULT GetFeaturePage( + // IMAPI_FEATURE_PAGE_TYPE requestedFeature, BOOLEAN currentFeatureOnly, BYTE **featureData, ULONG_IMAPI2_FEATURE_PAGE *byteSize ); + void GetFeaturePage(IMAPI_FEATURE_PAGE_TYPE requestedFeature, [MarshalAs(UnmanagedType.U1)] bool currentFeatureOnly, + out SafeCoTaskMemHandle featureData, out uint byteSize); + + /// Retrieves the specified mode page from the device. + /// Mode page to retrieve. For possible values, see the IMAPI_MODE_PAGE_TYPE enumeration type. + /// + /// Type of mode page data to retrieve, for example, the current settings or the settings that are write enabled. For possible + /// values, see the IMAPI_MODE_PAGE_REQUEST_TYPE enumeration type. + /// + /// + /// + /// Data buffer that contains the mode page. For details of the contents of the data buffer, see the MODE SENSE (10) command in the + /// latest revision of the MMC specification at ftp://ftp.t10.org/t10/drafts/mmc5. + /// + /// This method removes header information and other non-page data before returning the buffer. + /// When done, call the CoTaskMemFree function to free the memory. + /// + /// Size, in bytes, of the modePageData data buffer. + // https://docs.microsoft.com/en-us/windows/win32/api/imapi2/nf-imapi2-idiscrecorder2ex-getmodepage HRESULT GetModePage( + // IMAPI_MODE_PAGE_TYPE requestedModePage, IMAPI_MODE_PAGE_REQUEST_TYPE requestType, BYTE **modePageData, ULONG_IMAPI2_MODE_PAGE + // *byteSize ); + void GetModePage(IMAPI_MODE_PAGE_TYPE requestedModePage, IMAPI_MODE_PAGE_REQUEST_TYPE requestType, out SafeCoTaskMemHandle modePageData, + out uint byteSize); + + /// Sets the mode page data for the device. + /// + /// Type of mode page data to send. For possible values, see the IMAPI_MODE_PAGE_REQUEST_TYPE enumeration type. + /// + /// + /// + /// Data buffer that contains the mode page data to send to the media. Do not include a header; this method generates and prepends a + /// header to the mode page data. + /// + /// + /// For details on specifying the fields of the mode page data, see the MODE SELECT (10) command in the latest revision of the MMC + /// specification at ftp://ftp.t10.org/t10/drafts/mmc5. + /// + /// + /// Size, in bytes, of the data buffer. + // https://docs.microsoft.com/en-us/windows/win32/api/imapi2/nf-imapi2-idiscrecorder2ex-setmodepage HRESULT SetModePage( + // IMAPI_MODE_PAGE_REQUEST_TYPE requestType, BYTE *data, ULONG_IMAPI2_MODE_PAGE byteSize ); + void SetModePage(IMAPI_MODE_PAGE_REQUEST_TYPE requestType, + [MarshalAs(UnmanagedType.LPArray, ArraySubType = UnmanagedType.U1, SizeParamIndex = 2)] byte[] data, uint byteSize); + + /// Retrieves the list of supported feature pages or the current feature pages of the device. + /// + /// Set to True to retrieve only current feature pages. Otherwise, False to retrieve all feature pages that the device supports. + /// + /// + /// + /// Data buffer that contains one or more feature page types. For possible values, see the IMAPI_FEATURE_PAGE_TYPE enumeration type. + /// + /// To get the feature page data associated with the feature page type, call the IDiscRecorder2Ex::GetFeaturePage method. + /// When done, call the CoTaskMemFree function to free the memory. + /// + /// Number of supported feature pages in the featureData data buffer. + // https://docs.microsoft.com/en-us/windows/win32/api/imapi2/nf-imapi2-idiscrecorder2ex-getsupportedfeaturepages HRESULT + // GetSupportedFeaturePages( BOOLEAN currentFeatureOnly, IMAPI_FEATURE_PAGE_TYPE **featureData, ULONG_IMAPI2_ALL_FEATURE_PAGES + // *byteSize ); + void GetSupportedFeaturePages([MarshalAs(UnmanagedType.U1)] bool currentFeatureOnly, out SafeCoTaskMemHandle featureData, out uint byteSize); + + /// Retrieves the supported profiles or the current profiles of the device. + /// + /// Set to True to retrieve the current profiles. Otherwise, False to return all supported profiles of the device. + /// + /// + /// Data buffer that contains one or more profile types. For possible values, see the IMAPI_PROFILE_TYPE enumeration type. + /// When done, call the CoTaskMemFree function to free the memory. + /// + /// Number of supported profiles in the profileTypes data buffer. + // https://docs.microsoft.com/en-us/windows/win32/api/imapi2/nf-imapi2-idiscrecorder2ex-getsupportedprofiles HRESULT + // GetSupportedProfiles( BOOLEAN currentOnly, IMAPI_PROFILE_TYPE **profileTypes, ULONG_IMAPI2_ALL_PROFILES *validProfiles ); + void GetSupportedProfiles([MarshalAs(UnmanagedType.U1)] bool currentOnly, out SafeCoTaskMemHandle profileTypes, out uint validProfiles); + + /// Retrieves the supported mode pages for the device. + /// + /// Type of mode page data to retrieve, for example, the current settings or the settings that are write enabled. For possible + /// values, see the IMAPI_MODE_PAGE_REQUEST_TYPE enumeration type. + /// + /// + /// Data buffer that contains one or more mode page types. For possible values, see the IMAPI_MODE_PAGE_TYPE enumeration type. + /// To get the mode page data associated with the mode page type, call the IDiscRecorder2Ex::GetModePage method. + /// When done, call the CoTaskMemFree function to free the memory. + /// + /// Number of mode pages in the data buffer. + // https://docs.microsoft.com/en-us/windows/win32/api/imapi2/nf-imapi2-idiscrecorder2ex-getsupportedmodepages HRESULT + // GetSupportedModePages( IMAPI_MODE_PAGE_REQUEST_TYPE requestType, IMAPI_MODE_PAGE_TYPE **modePageTypes, + // ULONG_IMAPI2_ALL_MODE_PAGES *validPages ); + void GetSupportedModePages(IMAPI_MODE_PAGE_REQUEST_TYPE requestType, out SafeCoTaskMemHandle modePageTypes, out uint validPages); + + /// Retrieves the byte alignment mask for the device. + /// + /// Byte alignment mask that you use to determine if the buffer is aligned to the correct byte boundary for the device. The byte + /// alignment value is always a number that is a power of 2. + /// + /// + /// + /// The data buffer for IDiscRecorder2Ex::SendCommandSendDataToDevice and IDiscRecorder2Ex::SendCommandGetDataFromDevice must + /// aligned to the correct byte boundary. To determine if the buffer is on the correct byte boundary, perform a bitwise logical AND + /// of the bitmask with the address of the data buffer. For example, if the address of the buffer is 0x3840958, you can test for + /// correct alignment using the following statement: + /// + /// + /// if (0x3840958 & (value - 1) == 0) { // The alignment is correct } + /// + /// + // https://docs.microsoft.com/en-us/windows/win32/api/imapi2/nf-imapi2-idiscrecorder2ex-getbytealignmentmask HRESULT + // GetByteAlignmentMask( ULONG *value ); + uint GetByteAlignmentMask(); + + /// Retrieves the maximum non-page-aligned transfer size for the device. + /// Maximum size, in bytes, of a non-page-aligned buffer. + /// + /// This is the maximum buffer size that a device can accept for a single command. Buffers of this size provide the maximum exchange + /// of data. The buffer does not need to begin on a physical memory page boundary. + /// + // https://docs.microsoft.com/en-us/windows/win32/api/imapi2/nf-imapi2-idiscrecorder2ex-getmaximumnonpagealignedtransfersize HRESULT + // GetMaximumNonPageAlignedTransferSize( ULONG *value ); + uint GetMaximumNonPageAlignedTransferSize(); + + /// Retrieves the maximum page-aligned transfer size for the device. + /// Maximum size, in bytes, of a page-aligned buffer. + /// + /// Maximum page-aligned buffer size that a device can accept for a single command. The buffer for this transfer size must begin on + /// a physical memory page boundary. + /// + // https://docs.microsoft.com/en-us/windows/win32/api/imapi2/nf-imapi2-idiscrecorder2ex-getmaximumpagealignedtransfersize HRESULT + // GetMaximumPageAlignedTransferSize( ULONG *value ); + uint GetMaximumPageAlignedTransferSize(); + } + + /// + /// This is a base interface. Use the following interfaces which inherit this interface: + /// + /// + /// IDiscFormat2Data + /// + /// + /// IDiscFormat2Erase + /// + /// + /// IDiscFormat2TrackAtOnce + /// + /// + /// IDiscFormat2RawCD + /// + /// + /// + // https://docs.microsoft.com/en-us/windows/win32/api/imapi2/nn-imapi2-idiscformat2 + [PInvokeData("imapi2.h", MSDNShortId = "NN:imapi2.IDiscFormat2")] + [ComImport, Guid("27354152-8F64-5B0F-8F00-5D77AFBE261E"), InterfaceType(ComInterfaceType.InterfaceIsDual)] + public interface IDiskFormat2 + { + /// Determines if the recorder supports the given format. + /// An IDiscRecorder2 interface of the recorder to test. + /// Is VARIANT_TRUE if the recorder supports the given format; otherwise, VARIANT_FALSE. + /// + /// When implemented by the IDiscFormat2RawCD interface, this method will return E_IMAPI_DF2RAW_MEDIA_IS_NOT_SUPPORTED in the event + /// the recorder does not support the given format. It is important to note that in this specific scenario the value does not + /// indicate that an error has occurred, but rather the result of a successful operation. + /// + // https://docs.microsoft.com/en-us/windows/win32/api/imapi2/nf-imapi2-idiscformat2-isrecordersupported HRESULT IsRecorderSupported( + // IDiscRecorder2 *recorder, VARIANT_BOOL *value ); + [DispId(2048)] + [return: MarshalAs(UnmanagedType.VariantBool)] + bool IsRecorderSupported(IDiscRecorder2 recorder); + + /// Determines if the current media in a supported recorder supports the given format. + /// An IDiscRecorder2 interface of the recorder to test. + /// + /// Is VARIANT_TRUE if the media in the recorder supports the given format; otherwise, VARIANT_FALSE. + /// Note VARIANT_TRUE also implies that the result from IsDiscRecorderSupported is VARIANT_TRUE. + /// + // https://docs.microsoft.com/en-us/windows/win32/api/imapi2/nf-imapi2-idiscformat2-iscurrentmediasupported HRESULT + // IsCurrentMediaSupported( IDiscRecorder2 *recorder, VARIANT_BOOL *value ); + [DispId(2049)] + [return: MarshalAs(UnmanagedType.VariantBool)] + bool IsCurrentMediaSupported(IDiscRecorder2 recorder); + + /// Determines if the current media is reported as physically blank by the drive. + /// Is VARIANT_TRUE if the disc is physically blank; otherwise, VARIANT_FALSE. + // https://docs.microsoft.com/en-us/windows/win32/api/imapi2/nf-imapi2-idiscformat2-get_mediaphysicallyblank HRESULT + // get_MediaPhysicallyBlank( VARIANT_BOOL *value ); + [DispId(1792)] + bool MediaPhysicallyBlank { [return: MarshalAs(UnmanagedType.VariantBool)] get; } + + /// Attempts to determine if the media is blank using heuristics (mainly for DVD+RW and DVD-RAM media). + /// Is VARIANT_TRUE if the disc is likely to be blank; otherwise; VARIANT_FALSE. + /// + /// + /// This method checks, for example, for a mounted file system on the device, verifying the first and last 2MB of the disc are + /// filled with zeros, and other media-specific checks. These checks can help to determine if the media may have files on it for + /// media that cannot be erased physically to a blank status. + /// + /// For a positive check that a disc is blank, call the IDiscFormat2::get_MediaPhysicallyBlank method. + /// + // https://docs.microsoft.com/en-us/windows/win32/api/imapi2/nf-imapi2-idiscformat2-get_mediaheuristicallyblank HRESULT + // get_MediaHeuristicallyBlank( VARIANT_BOOL *value ); + [DispId(1793)] + bool MediaHeuristicallyBlank { [return: MarshalAs(UnmanagedType.VariantBool)] get; } + + /// Retrieves the media types that are supported by the current implementation of the IDiscFormat2 interface. + /// + /// List of media types supported by the current implementation of the IDiscFormat2 interface. Each element of the array is a + /// VARIANT of type VT_I4. The lVal member of VARIANT contains the media type. For a list of media + /// types, see the IMAPI_MEDIA_PHYSICAL_TYPE enumeration type. + /// + // https://docs.microsoft.com/en-us/windows/win32/api/imapi2/nf-imapi2-idiscformat2-get_supportedmediatypes HRESULT + // get_SupportedMediaTypes( SAFEARRAY **value ); + [DispId(1794)] + IMAPI_MEDIA_PHYSICAL_TYPE[] SupportedMediaTypes { [return: MarshalAs(UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof(SafeArrayMarshaler))] get; } + } + + /// + /// Base interface containing properties common to derived multisession interfaces. + /// + /// You can derive from this interface to implement a new multi-session mechanism that is different from IMultisessionSequential and + /// IMultisessionRandomWrite. For example, you could implement a mechanism for BD-R Pseudo-Overwrite. + /// + /// + /// To access media-specific properties of a multisession interface, use the IMultisessionSequential and IMultisessionRandomWrite interface. + /// + /// + /// + /// If more than one multi-session interface exist, the application can let IFileSystemImage choose a compatible multi-session interface + /// to use or the application can specify the multi-session interface to use by setting the put_InUse property to VARIANT_TRUE. + /// + // https://docs.microsoft.com/en-us/windows/win32/api/imapi2/nn-imapi2-imultisession + [PInvokeData("imapi2.h", MSDNShortId = "NN:imapi2.IMultisession")] + [ComImport, Guid("27354150-7F64-5B0F-8F00-5D77AFBE261E"), InterfaceType(ComInterfaceType.InterfaceIsDual)] + public interface IMultisession + { + /// Determines if the multi-session type can write to the current optical media. + /// + /// Is VARIANT_TRUE if the multi-session interface can write to the current optical media in its current state. Otherwise, VARIANT_FALSE. + /// + // https://docs.microsoft.com/en-us/windows/win32/api/imapi2/nf-imapi2-imultisession-get_issupportedoncurrentmediastate HRESULT + // get_IsSupportedOnCurrentMediaState( VARIANT_BOOL *value ); + [DispId(0x100)] + bool IsSupportedOnCurrentMediaState { [return: MarshalAs(UnmanagedType.VariantBool)] get; } + + /// Determines if this multi-session interface is the one you should use on the current media. + /// + /// Set to VARIANT_TRUE if this multi-session interface is the one you should use to write to the current media. Otherwise, VARIANT_FALSE. + /// + // https://docs.microsoft.com/en-us/windows/win32/api/imapi2/nf-imapi2-imultisession-put_inuse HRESULT put_InUse( VARIANT_BOOL value ); + [DispId(0x101)] + bool InUse { set; [return: MarshalAs(UnmanagedType.VariantBool)] get; } + + /// Retrieves the disc recorder to use to import one or more previous sessions. + /// An IDiscRecorder2 interface that identifies the device that contains one or more session images to import. + /// The import recorder reads session content from the optical media and provides it to IFileSystemImage. + // https://docs.microsoft.com/en-us/windows/win32/api/imapi2/nf-imapi2-imultisession-get_importrecorder HRESULT get_ImportRecorder( + // IDiscRecorder2 **value ); + [DispId(0x102)] + IDiscRecorder2 ImportRecorder { [return: MarshalAs(UnmanagedType.Interface)] get; } + } + + /// + /// + /// Use this interface to retrieve information about the current state of media allowing random writes and not supporting the concept of + /// physical sessions. + /// + /// The following methods return a collection of IMultisession interfaces representing all supported multisession types. + /// + /// + /// IDiscFormat2Data::get_MultisessionInterfaces + /// + /// + /// IFileSystemImage::get_MultisessionInterfaces + /// + /// + /// + /// You can then call the IUnknown::QueryInterface method on each element in the collection to query for the + /// IMultisessionRandomWrite interface. + /// + /// + /// + /// + /// If more than one multi-session interface exist, the application can let IFileSystemImage choose a compatible multi-session interface + /// to use or the application can specify the multi-session interface to use by setting the put_InUse property to VARIANT_TRUE. + /// + /// + /// A file system creator would use the address properties to import the content of the previous session on the disc and to compute the + /// position of the next session it will create. These properties will return the same values as the properties of the same name of the + /// IDiscFormat2Data interface. This is a MsftMultisessionRandomWrite object in script. + /// + /// + // https://docs.microsoft.com/en-us/windows/win32/api/imapi2/nn-imapi2-imultisessionrandomwrite + [PInvokeData("imapi2.h", MSDNShortId = "NN:imapi2.IMultisessionRandomWrite")] + [ComImport, Guid("B507CA23-2204-11DD-966A-001AA01BBC58"), InterfaceType(ComInterfaceType.InterfaceIsDual), CoClass(typeof(MsftMultisessionRandomWrite))] + public interface IMultisessionRandomWrite : IMultisession + { + /// Determines if the multi-session type can write to the current optical media. + /// + /// Is VARIANT_TRUE if the multi-session interface can write to the current optical media in its current state. Otherwise, VARIANT_FALSE. + /// + // https://docs.microsoft.com/en-us/windows/win32/api/imapi2/nf-imapi2-imultisession-get_issupportedoncurrentmediastate HRESULT + // get_IsSupportedOnCurrentMediaState( VARIANT_BOOL *value ); + [DispId(0x100)] + new bool IsSupportedOnCurrentMediaState { [return: MarshalAs(UnmanagedType.VariantBool)] get; } + + /// Determines if this multi-session interface is the one you should use on the current media. + /// + /// Set to VARIANT_TRUE if this multi-session interface is the one you should use to write to the current media. Otherwise, VARIANT_FALSE. + /// + // https://docs.microsoft.com/en-us/windows/win32/api/imapi2/nf-imapi2-imultisession-put_inuse HRESULT put_InUse( VARIANT_BOOL value ); + [DispId(0x101)] + new bool InUse { set; [return: MarshalAs(UnmanagedType.VariantBool)] get; } + + /// Retrieves the disc recorder to use to import one or more previous sessions. + /// An IDiscRecorder2 interface that identifies the device that contains one or more session images to import. + /// The import recorder reads session content from the optical media and provides it to IFileSystemImage. + // https://docs.microsoft.com/en-us/windows/win32/api/imapi2/nf-imapi2-imultisession-get_importrecorder HRESULT get_ImportRecorder( + // IDiscRecorder2 **value ); + [DispId(0x102)] + new IDiscRecorder2 ImportRecorder { [return: MarshalAs(UnmanagedType.Interface)] get; } + + /// Retrieves the size of a writeable unit on the media. + /// The size of a writeable unit on the media. + /// + /// Each write performed to the disc must start from an LBA that is a multiple of the writeable unit size. The number of recorded + /// sectors must also be a multiple of the writeable unit size. + /// + // https://docs.microsoft.com/en-us/windows/win32/api/imapi2/nf-imapi2-imultisessionrandomwrite-get_writeunitsize HRESULT + // get_WriteUnitSize( LONG *value ); + [DispId(0x205)] + int WriteUnitSize { get; } + + /// Retrieves the last written address on the media. + /// The last written address on the media. + /// + /// This property can be used for wear-out leveling on the media. The property is retrieved from the drive and may not be provided + /// for some media types. If the drive does not provide the required information, this property access method returns E_NOTIMPL. + /// + // https://docs.microsoft.com/en-us/windows/win32/api/imapi2/nf-imapi2-imultisessionrandomwrite-get_lastwrittenaddress HRESULT + // get_LastWrittenAddress( LONG *value ); + [DispId(0x206)] + int LastWrittenAddress { get; } + + /// Retrieves the total number of sectors on the media. + /// The total number of sectors on the media. + // https://docs.microsoft.com/en-us/windows/win32/api/imapi2/nf-imapi2-imultisessionrandomwrite-get_totalsectorsonmedia HRESULT + // get_TotalSectorsOnMedia( LONG *value ); + [DispId(0x207)] + int TotalSectorsOnMedia { get; } + } + + + /// + /// + /// Use this interface to retrieve information about the previous import session on a sequentially recorded media, if the media + /// contains a previous session. + /// + /// The following methods return a collection of IMultisession interfaces representing all supported multisession types. + /// + /// + /// IDiscFormat2Data::get_MultisessionInterfaces + /// + /// + /// IFileSystemImage::get_MultisessionInterfaces + /// + /// + /// + /// The IMultisession::QueryInterface method can be called on each element in the collection to query for the + /// IMultisessionSequential interface. + /// + /// + /// + /// + /// If more than one multi-session interface exist, the application can let IFileSystemImage choose a compatible multi-session + /// interface to use or the application can specify the multi-session interface to use by setting the put_InUse property to VARIANT_TRUE. + /// + /// + /// A file system creator would use the address properties to import the content of the previous session on the disc and to compute + /// the position of the next session it will create. These properties will return the same values as the properties of the same name + /// of the IDiscFormat2Data interface. + /// + /// This is a MsftMultisessionSequential object in script. + /// + // https://docs.microsoft.com/en-us/windows/win32/api/imapi2/nn-imapi2-imultisessionsequential + [PInvokeData("imapi2.h", MSDNShortId = "NN:imapi2.IMultisessionSequential")] + [ComImport, Guid("27354151-7F64-5B0F-8F00-5D77AFBE261E"), InterfaceType(ComInterfaceType.InterfaceIsDual), CoClass(typeof(MsftMultisessionSequential))] + public interface IMultisessionSequential : IMultisession + { + /// Determines if the multi-session type can write to the current optical media. + /// + /// Is VARIANT_TRUE if the multi-session interface can write to the current optical media in its current state. Otherwise, VARIANT_FALSE. + /// + // https://docs.microsoft.com/en-us/windows/win32/api/imapi2/nf-imapi2-imultisession-get_issupportedoncurrentmediastate HRESULT + // get_IsSupportedOnCurrentMediaState( VARIANT_BOOL *value ); + [DispId(0x100)] + new bool IsSupportedOnCurrentMediaState { [return: MarshalAs(UnmanagedType.VariantBool)] get; } + + /// Determines if this multi-session interface is the one you should use on the current media. + /// + /// Set to VARIANT_TRUE if this multi-session interface is the one you should use to write to the current media. Otherwise, VARIANT_FALSE. + /// + // https://docs.microsoft.com/en-us/windows/win32/api/imapi2/nf-imapi2-imultisession-put_inuse HRESULT put_InUse( VARIANT_BOOL value ); + [DispId(0x101)] + new bool InUse { set; [return: MarshalAs(UnmanagedType.VariantBool)] get; } + + /// Retrieves the disc recorder to use to import one or more previous sessions. + /// An IDiscRecorder2 interface that identifies the device that contains one or more session images to import. + /// The import recorder reads session content from the optical media and provides it to IFileSystemImage. + // https://docs.microsoft.com/en-us/windows/win32/api/imapi2/nf-imapi2-imultisession-get_importrecorder HRESULT get_ImportRecorder( + // IDiscRecorder2 **value ); + [DispId(0x102)] + new IDiscRecorder2 ImportRecorder { [return: MarshalAs(UnmanagedType.Interface)] get; } + + /// Determines if this session is the first data session on the media. + /// Is VARIANT_TRUE if the session is the first data session on the media. Otherwise, the value is VARIANT_FALSE. + /// + /// This property is relevant on CD media that combine audio and data tracks/sessions, such as CD Extra and Mixed-Mode CD. + /// + // https://docs.microsoft.com/en-us/windows/win32/api/imapi2/nf-imapi2-imultisessionsequential-get_isfirstdatasession HRESULT + // get_IsFirstDataSession( VARIANT_BOOL *value ); + [DispId(0x200)] + bool IsFirstDataSession { [return: MarshalAs(UnmanagedType.VariantBool)] get; } + + /// Retrieves the first sector written in the previous session on the media. + /// Sector number that identifies the starting point of the previous write session. + // https://docs.microsoft.com/en-us/windows/win32/api/imapi2/nf-imapi2-imultisessionsequential-get_startaddressofprevioussession + // HRESULT get_StartAddressOfPreviousSession( LONG *value ); + [DispId(0x201)] + int StartAddressOfPreviousSession { get; } + + /// Retrieves the last sector of the previous write session. + /// + /// Address where the previous write operation ended. + /// + /// The value is -1 if the media is blank or does not support multi-session writing (indicates that no previous session could be detected). + /// + /// + /// + /// Note This property should not be used. Instead, you should use an interface derived from IMultisession, such as + /// IMultisessionSequential, for importing file data from the previous session. + /// + // https://docs.microsoft.com/th-th/windows/win32/api/imapi2/nf-imapi2-idiscformat2data-get_lastwrittenaddressofprevioussession + // HRESULT get_LastWrittenAddressOfPreviousSession( LONG *value ); + [DispId(0x202)] + int LastWrittenAddressOfPreviousSession { get; } + + /// Retrieves the next writable address on the media, including used sectors. + /// Sector number that identifies the next available sector that can record data or audio. + // https://docs.microsoft.com/en-us/windows/win32/api/imapi2/nf-imapi2-imultisessionsequential-get_nextwritableaddress HRESULT + // get_NextWritableAddress( LONG *value ); + [DispId(0x203)] + int NextWritableAddress { get; } + + /// Retrieves the number of free sectors available on the media. + /// Number of sectors on the disc that are available for use. + // https://docs.microsoft.com/en-us/windows/win32/api/imapi2/nf-imapi2-imultisessionsequential-get_freesectorsonmedia HRESULT + // get_FreeSectorsOnMedia( LONG *value ); + [DispId(0x204)] + int FreeSectorsOnMedia { get; } + } + + /// Use this interface to retrieve information about the size of a writeable unit on sequentially recorded media. + // https://docs.microsoft.com/en-us/windows/win32/api/imapi2/nn-imapi2-imultisessionsequential2 + [PInvokeData("imapi2.h", MSDNShortId = "NN:imapi2.IMultisessionSequential2")] + [ComImport, Guid("27354151-7F64-5B0F-8F00-5D77AFBE261E"), InterfaceType(ComInterfaceType.InterfaceIsDual), CoClass(typeof(MsftMultisessionSequential))] + public interface IMultisessionSequential2 : IMultisessionSequential + { + /// Determines if the multi-session type can write to the current optical media. + /// + /// Is VARIANT_TRUE if the multi-session interface can write to the current optical media in its current state. Otherwise, VARIANT_FALSE. + /// + // https://docs.microsoft.com/en-us/windows/win32/api/imapi2/nf-imapi2-imultisession-get_issupportedoncurrentmediastate HRESULT + // get_IsSupportedOnCurrentMediaState( VARIANT_BOOL *value ); + [DispId(0x100)] + new bool IsSupportedOnCurrentMediaState { [return: MarshalAs(UnmanagedType.VariantBool)] get; } + + /// Determines if this multi-session interface is the one you should use on the current media. + /// + /// Set to VARIANT_TRUE if this multi-session interface is the one you should use to write to the current media. Otherwise, VARIANT_FALSE. + /// + // https://docs.microsoft.com/en-us/windows/win32/api/imapi2/nf-imapi2-imultisession-put_inuse HRESULT put_InUse( VARIANT_BOOL value ); + [DispId(0x101)] + new bool InUse { set; [return: MarshalAs(UnmanagedType.VariantBool)] get; } + + /// Retrieves the disc recorder to use to import one or more previous sessions. + /// An IDiscRecorder2 interface that identifies the device that contains one or more session images to import. + /// The import recorder reads session content from the optical media and provides it to IFileSystemImage. + // https://docs.microsoft.com/en-us/windows/win32/api/imapi2/nf-imapi2-imultisession-get_importrecorder HRESULT get_ImportRecorder( + // IDiscRecorder2 **value ); + [DispId(0x102)] + new IDiscRecorder2 ImportRecorder { [return: MarshalAs(UnmanagedType.Interface)] get; } + + /// Determines if this session is the first data session on the media. + /// Is VARIANT_TRUE if the session is the first data session on the media. Otherwise, the value is VARIANT_FALSE. + /// + /// This property is relevant on CD media that combine audio and data tracks/sessions, such as CD Extra and Mixed-Mode CD. + /// + // https://docs.microsoft.com/en-us/windows/win32/api/imapi2/nf-imapi2-imultisessionsequential-get_isfirstdatasession HRESULT + // get_IsFirstDataSession( VARIANT_BOOL *value ); + [DispId(0x200)] + new bool IsFirstDataSession { [return: MarshalAs(UnmanagedType.VariantBool)] get; } + + /// Retrieves the first sector written in the previous session on the media. + /// Sector number that identifies the starting point of the previous write session. + // https://docs.microsoft.com/en-us/windows/win32/api/imapi2/nf-imapi2-imultisessionsequential-get_startaddressofprevioussession + // HRESULT get_StartAddressOfPreviousSession( LONG *value ); + [DispId(0x201)] + new int StartAddressOfPreviousSession { get; } + + /// Retrieves the last sector of the previous write session. + /// + /// Address where the previous write operation ended. + /// + /// The value is -1 if the media is blank or does not support multi-session writing (indicates that no previous session could be detected). + /// + /// + /// + /// Note This property should not be used. Instead, you should use an interface derived from IMultisession, such as + /// IMultisessionSequential, for importing file data from the previous session. + /// + // https://docs.microsoft.com/th-th/windows/win32/api/imapi2/nf-imapi2-idiscformat2data-get_lastwrittenaddressofprevioussession + // HRESULT get_LastWrittenAddressOfPreviousSession( LONG *value ); + [DispId(0x202)] + new int LastWrittenAddressOfPreviousSession { get; } + + /// Retrieves the next writable address on the media, including used sectors. + /// Sector number that identifies the next available sector that can record data or audio. + // https://docs.microsoft.com/en-us/windows/win32/api/imapi2/nf-imapi2-imultisessionsequential-get_nextwritableaddress HRESULT + // get_NextWritableAddress( LONG *value ); + [DispId(0x203)] + new int NextWritableAddress { get; } + + /// Retrieves the number of free sectors available on the media. + /// Number of sectors on the disc that are available for use. + // https://docs.microsoft.com/en-us/windows/win32/api/imapi2/nf-imapi2-imultisessionsequential-get_freesectorsonmedia HRESULT + // get_FreeSectorsOnMedia( LONG *value ); + [DispId(0x204)] + new int FreeSectorsOnMedia { get; } + + /// Retrieves the size of a writeable unit on the media. + /// The size of a writeable unit on the media in sectors. + // https://docs.microsoft.com/en-us/windows/win32/api/imapi2/nf-imapi2-imultisessionsequential2-get_writeunitsize + // HRESULT get_WriteUnitSize( LONG *value ); + [DispId(0x205)] + int WriteUnitSize { get; } + } + + /// + /// + /// Use this interface to create a RAW CD image for use in writing to CD media in Disc-at-Once (DAO) mode. Images created with this + /// interface can be written to CD media using the IDiscFormat2RawCD interface. + /// + /// + /// To create an instance of this interface, call the CoCreateInstance function. Use__uuidof(MsftRawCDImageCreator) for the class + /// identifier and __uuidof(IRawCDImageCreator) for the interface identifier. + /// + /// + /// + /// + /// Images created with this interface can be written to persistent storage for later use, or can be provided directly to the + /// IDiscFormat2RawCD interface for writing to CD media. + /// + /// DVD media does not support this type of writing. + /// + /// This interface 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/nn-imapi2-irawcdimagecreator + [PInvokeData("imapi2.h", MSDNShortId = "NN:imapi2.IRawCDImageCreator")] + [ComImport, Guid("25983550-9D65-49CE-B335-40630D901227"), InterfaceType(ComInterfaceType.InterfaceIsDual), CoClass(typeof(MsftRawCDImageCreator))] + public interface IRawCDImageCreator + { + /// Creates the final IStream object based on the current settings. + /// Pointer to the finalized IStream object. + /// + /// + /// IRawCDImageCreator::CreateResultImage can only be called once, and will result in the object becoming read-only. All + /// properties associated with this object can be read but not modified. The resulting IStream object will be a disc image + /// which starts at MSF 95:00:00, to allow writing of a single image to media with multiple starting addresses. + /// + /// + /// This method 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/nf-imapi2-irawcdimagecreator-createresultimage HRESULT + // CreateResultImage( IStream **resultStream ); + [DispId(0x200)] + IStream CreateResultImage(); + + /// Accepts the provided IStream object and saves the interface pointer as the next track in the image. + /// + /// A value, defined by IMAPI_CD_SECTOR_TYPE, that indicates the type of data. IMAPI_CD_SECTOR_AUDIO is the only value + /// supported by the IRawCDImageCreator::AddTrack method. + /// + /// Pointer to the provided IStream object. + /// A LONG value within a 1 to 99 range that will be associated with the new track. + /// + /// + /// Any additional tracks must be compatible with all existing tracks. See the IMAPI_CD_SECTOR_TYPE enumeration for information on limitations. + /// + /// + /// The data stream must be at least 4 seconds (300 sectors) long. Data stream may not cause final sector to exceed LBA 398,099 (MSF + /// 88:29:74), as leadout would then exceed the MSF 89:59:74 maximum. + /// + /// + /// This method 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/nf-imapi2-irawcdimagecreator-addtrack HRESULT AddTrack( + // IMAPI_CD_SECTOR_TYPE dataType, IStream *data, LONG *trackIndex ); + [DispId(0x201)] + int AddTrack(IMAPI_CD_SECTOR_TYPE dataType, IStream data); + + /// + /// Accepts the provided IStream object and saves the associated pointer to be used as data for the pre-gap for track 1. + /// + /// Pointer to the provided IStream object. + /// + /// + /// This method can only be called prior to adding any tracks to the image. The data stream must be at least 2 seconds (or 150 + /// sectors) long. + /// + /// + /// The data stream should not result final sector exceeding LBA 397,799 (MSF 88:25:74), as the minimal-sized track plus leadout + /// would then exceed the MSF 89:59:74 maximum. Additionally, it is recommended that the IMAPI_CD_SECTOR_TYPE value for the first + /// track is implicitly defined as "Audio". The resulting audio can then only be heard by playing the first track and "rewinding" + /// back to the start of the audio disc. + /// + /// + /// This method 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/nf-imapi2-irawcdimagecreator-addspecialpregap HRESULT AddSpecialPregap( + // IStream *data ); + [DispId(0x202)] + void AddSpecialPregap(IStream data); + + /// + /// Allows the addition of custom R-W subcode, provided by the IStream. The provided object must have a size equal to the + /// number of sectors in the raw disc image * 96 bytes when the final image is created. + /// + /// + /// The subcode data (with 96 bytes per sector), where the 2 most significant bits must always be zero (as they are the P/Q bits). + /// + /// + /// + /// May be added anytime prior to calling IRawCDImageCreator::CreateResultImage. If IRawCDImageCreator::put_ResultingImageType is + /// set to return PQ only, then this call will fail as no RW subcode will be used in the resulting image. + /// + /// + /// This method 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/nf-imapi2-irawcdimagecreator-addsubcoderwgenerator HRESULT + // AddSubcodeRWGenerator( IStream *subcode ); + [DispId(0x203)] + void AddSubcodeRWGenerator(IStream subcode); + + /// Gets or sets the value that defines the type of image file that will be generated. + /// An IMAPI_FORMAT2_RAW_CD_DATA_SECTOR_TYPE enumeration that defines the type of image file. + /// + /// + /// If the value set via IRawCDImageCreator::AddSubcodeRWGenerator is not NULL, then the PQ_ONLY type defined by + /// IMAPI_FORMAT2_RAW_CD_DATA_SECTOR_TYPE is not a valid choice, as subcode would not be generated by the resulting image. + /// + /// + /// This method 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/nf-imapi2-irawcdimagecreator-put_resultingimagetype HRESULT + // put_ResultingImageType( IMAPI_FORMAT2_RAW_CD_DATA_SECTOR_TYPE value ); + [DispId(0x100)] + IMAPI_FORMAT2_RAW_CD_DATA_SECTOR_TYPE ResultingImageType { set; get; } + + /// + /// Retrieves the value that defines the LBA for the start of the Leadout. This method can be utilized to determine if the image can + /// be written to a piece of media by comparing it against the LastPossibleStartOfLeadout for the media. + /// + /// Pointer to a LONG value that represents the LBA for the start of the Leadout. + /// + /// Use of this method requires that at least 1 track has been added to the image. + /// + /// This method 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/nf-imapi2-irawcdimagecreator-get_startofleadout HRESULT + // get_StartOfLeadout( LONG *value ); + [DispId(0x101)] + int StartOfLeadout { get; } + + /// + /// Gets or sets the StartOfLeadoutLimit property value. This value specifies if the resulting image is required to fit on a piece + /// of media with a StartOfLeadout greater than or equal to the LBA specified. + /// + /// Pointer to a LONG value that represents the current StartOfLeadoutLimit. + /// + /// This method 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/nf-imapi2-irawcdimagecreator-put_startofleadoutlimit HRESULT + // put_StartOfLeadoutLimit( LONG value ); + [DispId(0x102)] + int StartOfLeadoutLimit { set; get; } + + /// + /// Gets or sets the value that specifies if "Gapless Audio" recording is disabled. This property defaults to a value of + /// VARIANT_FALSE, which disables the use of "gapless" recording between consecutive audio tracks. + /// + /// + /// A VARIANT_BOOL value that specifies if "Gapless Audio" is disabled. Setting a value of VARIANT_FALSE disables + /// "Gapless Audio", while VARIANT_TRUE enables it. + /// + /// + /// + /// When disabled, by default, the audio tracks will have the standard 2-second (150 sector) silent gap between tracks. When + /// enabled, the last 2 seconds of audio data from the previous audio track are encoded in the pregap area of the next audio track, + /// enabling seamless transitions between tracks. + /// + /// + /// It is recommended that this property value is only set before the process of adding tracks to the image has begun as any changes + /// afterwards could result in adverse effects to other image properties. + /// + /// + /// This method 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/nf-imapi2-irawcdimagecreator-put_disablegaplessaudio HRESULT + // put_DisableGaplessAudio( VARIANT_BOOL value ); + [DispId(0x103)] + bool DisableGaplessAudio { set; [return: MarshalAs(UnmanagedType.VariantBool)] get; } + + /// Gets or sets the Media Catalog Number (MCN) for the entire audio disc. + /// A BSTR value that represents the MCN to associate with the audio disc. + /// + /// + /// The returned MCN is formatted as a 13-digit decimal number and must also be provided in the same form. Additionally, the + /// provided MCN value must have a valid checksum digit (least significant digit), or it will be rejected. For improved + /// compatibility with scripting, leading zeros may be excluded. For example, "0123456789012" can be expressed as "123456789012". + /// + /// Please refer to the MMC specification for details regarding the MCN value. + /// + /// This method 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/nf-imapi2-irawcdimagecreator-put_mediacatalognumber HRESULT + // put_MediaCatalogNumber( BSTR value ); + [DispId(0x104)] + string MediaCatalogNumber { set; [return: MarshalAs(UnmanagedType.BStr)] get; } + + /// Gets or sets the starting track number. + /// A LONG value that represents the starting track number. + /// + /// + /// This property value can only be set before the addition of tracks. If this property is set to a value other than 1, all tracks + /// added to the image must be audio tracks. + /// + /// + /// This method 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/nf-imapi2-irawcdimagecreator-put_startingtracknumber HRESULT + // put_StartingTrackNumber( LONG value ); + [DispId(0x105)] + int StartingTrackNumber { set; get; } + + /// + /// Retrieves an indexed property, which takes a LONG value with a range of 1 to 99 as the index to determine which track the + /// user is querying. The returned object is then queried/set for the particular per-track property of interest. + /// + /// A LONG value within a 1 to 99 range that is used to specify which track is queried. + /// + /// A pointer to a pointer to an IRawCDImageTrackInfo object that contains information about the track associated with the specified + /// trackInfo index value. + /// + /// + /// This method 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/nf-imapi2-irawcdimagecreator-get_trackinfo HRESULT get_TrackInfo( LONG + // trackIndex, IRawCDImageTrackInfo **value ); + [DispId(0x106)] + IRawCDImageTrackInfo get_TrackInfo(int trackIndex); + + /// Retrieves the number of existing audio tracks on the media. + /// Pointer to a LONG value that indicates the number of audio tracks that currently exist on the media. + /// + /// This method 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/nf-imapi2-irawcdimagecreator-get_numberofexistingtracks HRESULT + // get_NumberOfExistingTracks( LONG *value ); + [DispId(0x107)] + int NumberOfExistingTracks { get; } + + /// Retrieves the number of total used sectors on the current media, including any overhead between existing tracks. + /// Pointer to a LONG value that indicates the number of total used sectors on the media. + /// + /// + /// This value represents the LBA of the last sector with data that is considered part of a track, and does not include the overhead + /// of the leadin, leadout, or the two-seconds between MSF 00:00:00 and MSF 00:02:00. + /// + /// + /// This method 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/nf-imapi2-irawcdimagecreator-get_lastusedusersectorinimage HRESULT + // get_LastUsedUserSectorInImage( LONG *value ); + [DispId(0x108)] + int LastUsedUserSectorInImage { get; } + + /// Gets the SCSI-form table of contents for the resulting disc. + /// + /// The SCSI-form table of contents for the resulting disc. Accuracy of this value depends on + /// IRawCDImageCreator::get_ExpectedTableOfContents being called after all image properties have been set. + /// + /// + /// This method can only be called after at least one track has been added to the image. + /// + /// This method 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/nf-imapi2-irawcdimagecreator-get_expectedtableofcontents HRESULT + // get_ExpectedTableOfContents( SAFEARRAY **value ); + [DispId(0x109)] + object[] ExpectedTableOfContents { get; } + } + + /// Use this interface to track per-track properties that are applied to CD media. + /// + /// This interface 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/nn-imapi2-irawcdimagetrackinfo + [PInvokeData("imapi2.h", MSDNShortId = "NN:imapi2.IRawCDImageTrackInfo")] + [ComImport, Guid("25983551-9D65-49CE-B335-40630D901227"), InterfaceType(ComInterfaceType.InterfaceIsDual)] + public interface IRawCDImageTrackInfo + { + /// Retrieves the LBA of the first user sectors in this track. + /// The LBA of the first user sectors in this track. + /// + /// Most tracks also include a pregap and postgap, which are not included in this value. + /// + /// This method 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/nf-imapi2-irawcdimagetrackinfo-get_startinglba HRESULT get_StartingLba( + // LONG *value ); + [DispId(0x100)] + int StartingLba { get; } + + /// Retrieves the number of user sectors in this track. + /// The number of user sectors in this track. + /// + /// + /// The end of the track is typically the StartingLBA plus the SectorCount. The start of the next track includes both + /// of these properties plus any required pregap or postgap. + /// + /// + /// This method 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/nf-imapi2-irawcdimagetrackinfo-get_sectorcount HRESULT get_SectorCount( + // LONG *value ); + [DispId(0x101)] + int SectorCount { get; } + + /// Retrieves the track number for this track. + /// The track number for this track. + /// + /// + /// While this value is often identical to the TrackIndex property, it is possible for pure audio discs to start with a track + /// other than track number 1. This means that the more general formula is that this value is ( TrackIndex + FirstTrackNumber - 1). + /// + /// + /// This method 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/nf-imapi2-irawcdimagetrackinfo-get_tracknumber HRESULT get_TrackNumber( + // LONG *value ); + [DispId(0x102)] + int TrackNumber { get; } + + /// + /// Retrieves the type of data provided for the sectors in this track. For more detail on the possible sector types, see IMAPI_CD_SECTOR_TYPE. + /// + /// + /// A pointer to a IMAPI_CD_SECTOR_TYPE enumeration that specifies the type of data provided for the sectors on the track. + /// + /// + /// This method 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/nf-imapi2-irawcdimagetrackinfo-get_sectortype HRESULT get_SectorType( + // IMAPI_CD_SECTOR_TYPE *value ); + [DispId(0x103)] + IMAPI_CD_SECTOR_TYPE SectorType { get; } + + /// + /// Gets or sets the International Standard Recording Code (ISRC) currently associated with the track. This property value defaults + /// to NULL (or a zero-length string) and may only be set for tracks containing audio data. + /// + /// The ISRC to associate with the track. + /// + /// + /// The format of the ISRC is provided to the caller formatted per ISRC standards (DIN-31-621) recommendations, such as + /// "US-K7Y-98-12345". When set, the provided string may optionally exclude all the '-' characters. + /// + /// + /// This method 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/nf-imapi2-irawcdimagetrackinfo-put_isrc HRESULT put_ISRC( BSTR value ); + [DispId(0x104)] + bool ISRC { set; [return: MarshalAs(UnmanagedType.BStr)] get; } + + /// + /// Sets the digital audio copy "Allowed" bit to one of three values on the resulting media. Please see the + /// IMAPI_CD_TRACK_DIGITAL_COPY_SETTING enumeration for additional information on each possible value. + /// + /// The digital audio copy setting value to assign. + /// + /// This property may only be set for tracks containing audio data. + /// + /// This method 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/nf-imapi2-irawcdimagetrackinfo-put_digitalaudiocopysetting HRESULT + // put_DigitalAudioCopySetting( IMAPI_CD_TRACK_DIGITAL_COPY_SETTING value ); + [DispId(0x105)] + IMAPI_CD_TRACK_DIGITAL_COPY_SETTING DigitalAudioCopySetting { set; get; } + + /// + /// Sets the value that specifies if an audio track has an additional pre-emphasis added to the audio data prior to being written to CD. + /// + /// Value that specifies if an audio track has an additional pre-emphasis added to the audio data. + /// + /// This method 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/nf-imapi2-irawcdimagetrackinfo-put_audiohaspreemphasis HRESULT + // put_AudioHasPreemphasis( VARIANT_BOOL value ); + [DispId(0x106)] + bool AudioHasPreemphasis { set; [return: MarshalAs(UnmanagedType.VariantBool)] get; } + + /// Retrieves the one-based index of the tracks on the disc. + /// The one-based index associated with this track. + /// + /// This method 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/nf-imapi2-irawcdimagetrackinfo-get_trackindexes HRESULT + // get_TrackIndexes( SAFEARRAY **value ); + [DispId(0x107)] + int[] TrackIndexes { [return: MarshalAs(UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof(SafeArrayMarshaler))] get; } + + /// Add the specified LBA (relative to the start of the track) as an index. + /// The LBA to add. This must be a value in the range of 0 and 0x7FFFFFFF. + [DispId(0x200)] + void AddTrackIndex(int lbaOffset); + + /// Removes the specified LBA (relative to the start of the track) as an index. + /// The LBA to remove. This must be a value in the range of 0 and 0x7FFFFFFF. + [DispId(0x201)] + void ClearTrackIndex(int lbaOffset); + } + + /// + /// Use this interface to write a data stream to a device. + /// + /// This interface should be used by those developing support for new media types or formats. Writing to media typically includes the + /// following steps: + /// + /// + /// + /// Preparing the hardware by setting mode pages for the media. + /// + /// + /// Querying the hardware to verify that the media is large enough. + /// + /// + /// Initializing the write, for example, by formatting the media or setting OPC. + /// + /// + /// Performing the actual WRITE commands. + /// + /// + /// Finishing the write by stopping the formatting or closing the session or track. + /// + /// + /// + /// When developing support for new media types, you can implement steps 1, 2, 3, and 5, and use this interface to perform step 4. Note + /// that all the IDiscFormat2* interfaces use this interface to perform the write operation. + /// + /// Most client applications should use the IDiscFormat2Data interface to write images to a device. + /// + /// To create an instance of this interface, call the CoCreateInstance function. Use__uuidof(MsftWriteEngine2) for the class + /// identifier and __uuidof(IWriteEngine2) for the interface identifier. + /// + /// + /// + /// + /// To create the MsftWriteEngine2 object in a script, use IMAPI2.MsftWriteEngine2 as the program identifier when calling CreateObject. + /// + /// + /// It is possible for a power state transition to take place during a burn operation (i.e. user log-off or system suspend) which leads + /// to the interruption of the burn process and possible data loss. For programming considerations, see Preventing Logoff or Suspend + /// During a Burn. + /// + /// + // https://docs.microsoft.com/en-us/windows/win32/api/imapi2/nn-imapi2-iwriteengine2 + [PInvokeData("imapi2.h", MSDNShortId = "NN:imapi2.IWriteEngine2")] + [ComImport, Guid("27354135-7F64-5B0F-8F00-5D77AFBE261E"), InterfaceType(ComInterfaceType.InterfaceIsDual), CoClass(typeof(MsftWriteEngine2))] + public interface IWriteEngine2 + { + /// Writes a data stream to the current recorder. + /// An IStream interface of the data stream to write to the recorder. + /// Starting logical block address (LBA) of the write operation. Negative values are supported. + /// Number of blocks from the data stream to write. + /// + /// + /// Before calling this method, you must call the IWriteEngine2::put_Recorder method to specify the recording device and the + /// IWriteEngine2::put_BytesPerSector method to specify the number of bytes to use for each sector during writing. + /// + /// You should also consider calling the following methods if their default values are not appropriate for your application: + /// + /// + /// IWriteEngine2::put_EndingSectorsPerSecond + /// + /// + /// IWriteEngine2::put_StartingSectorsPerSecond + /// + /// + /// IWriteEngine2::put_UseStreamingWrite12 + /// + /// + /// + /// This method is synchronous. To determine the progress of the write operation, you must implement the DWriteEngine2Events + /// interface. For examples that show how to implement an event handler in a script, see Monitoring Progress With Events. + /// + /// + // https://docs.microsoft.com/en-us/windows/win32/api/imapi2/nf-imapi2-iwriteengine2-writesection HRESULT WriteSection( IStream + // *data, LONG startingBlockAddress, LONG numberOfBlocks ); + [DispId(0x200)] + void WriteSection([In, MarshalAs(UnmanagedType.Interface)] IStream data, int startingBlockAddress, int numberOfBlocks); + + /// Cancels a write operation that is in progress. + /// + /// To cancel the write operation, you must call this method from the DWriteEngine2Events::Update event handler that you implemented. + /// + // https://docs.microsoft.com/en-us/windows/win32/api/imapi2/nf-imapi2-iwriteengine2-cancelwrite HRESULT CancelWrite(); + [DispId(0x201)] + void CancelWrite(); + + /// Retrieves the recording device to use in the write operation. + /// An IDiscRecorder2Ex interface that identifies the recording device to use in the write operation. + // https://docs.microsoft.com/en-us/windows/win32/api/imapi2/nf-imapi2-iwriteengine2-get_recorder HRESULT get_Recorder( + // IDiscRecorder2Ex **value ); + [DispId(0x100)] + IDiscRecorder2Ex Recorder { set; [return: MarshalAs(UnmanagedType.Interface)] get; } + + /// Sets a value that indicates if the write operations use the WRITE12 or WRITE10 command. + /// + /// Set to VARIANT_TRUE to use the WRITE12 command with the streaming bit set to one when writing to disc. Otherwise, set + /// VARIANT_FALSE to use the WRITE10 command. The default is VARIANT_FALSE. + /// + // https://docs.microsoft.com/en-us/windows/win32/api/imapi2/nf-imapi2-iwriteengine2-put_usestreamingwrite12 HRESULT + // put_UseStreamingWrite12( VARIANT_BOOL value ); + [DispId(0x101)] + bool UseStreamingWrite12 { set; [return: MarshalAs(UnmanagedType.VariantBool)] get; } + + /// + /// Sets the estimated number of sectors per second that the recording device can write to the media at the start of the writing process. + /// + /// + /// Approximate number of sectors per second that the recording device can write to the media at the start of the writing process. + /// The default is -1 for maximum speed. + /// + /// This is used to optimize sleep time in the write engine. + // https://docs.microsoft.com/en-us/windows/win32/api/imapi2/nf-imapi2-iwriteengine2-put_startingsectorspersecond HRESULT + // put_StartingSectorsPerSecond( LONG value ); + [DispId(0x102)] + int StartingSectorsPerSecond { set; get; } + + /// + /// Retrieves the estimated number of sectors per second that the recording device can write to the media at the end of the writing process. + /// + /// + /// Approximate number of sectors per second that the recording device can write to the media at the end of the writing process. + /// A value of -1 indicates maximum speed. + /// + // https://docs.microsoft.com/en-us/windows/win32/api/imapi2/nf-imapi2-iwriteengine2-get_endingsectorspersecond HRESULT + // get_EndingSectorsPerSecond( LONG *value ); + [DispId(0x103)] + int EndingSectorsPerSecond { set; get; } + + /// Sets the number of bytes to use for each sector during writing. + /// + /// Number of bytes to use for each sector during writing. The minimum size is 1 byte and the maximum is MAXLONG bytes. Typically, + /// this value is 2,048 bytes for CD media, although any arbitrary size is supported (such as 2352 or 2448). This value is limited + /// to the IDiscRecorder2Ex::GetMaximumPageAlignedTransferSize, which is typically 65,536 (64K) bytes. + /// + /// You must specify a logical block size. + // https://docs.microsoft.com/en-us/windows/win32/api/imapi2/nf-imapi2-iwriteengine2-put_bytespersector HRESULT put_BytesPerSector( + // LONG value ); + [DispId(0x104)] + int BytesPerSector { set; get; } + + /// Retrieves a value that indicates whether the recorder is currently writing data to the disc. + /// + /// If VARIANT_TRUE, the recorder is currently writing data to the disc. Otherwise, if VARIANT_FALSE, the recorder is not currently + /// writing to disc. + /// + // https://docs.microsoft.com/en-us/windows/win32/api/imapi2/nf-imapi2-iwriteengine2-get_writeinprogress HRESULT + // get_WriteInProgress( VARIANT_BOOL *value ); + [DispId(0x105)] + bool WriteInProgress { [return: MarshalAs(UnmanagedType.VariantBool)] get; } + } + + /// + /// Use this interface to retrieve information about the current write operation. This interface is passed to the + /// DWriteEngine2Events::Update method that you implement. + /// + // https://docs.microsoft.com/en-us/windows/win32/api/imapi2/nn-imapi2-iwriteengine2eventargs + [PInvokeData("imapi2.h", MSDNShortId = "NN:imapi2.IWriteEngine2EventArgs")] + [ComImport, Guid("27354136-7F64-5B0F-8F00-5D77AFBE261E"), InterfaceType(ComInterfaceType.InterfaceIsDual)] + public interface IWriteEngine2EventArgs + { + /// Retrieves the starting logical block address (LBA) of the current write operation. + /// Starting logical block address of the write operation. Negative values for LBAs are supported. + /// This is the same value passed to the IWriteEngine2::WriteSection method. + // https://docs.microsoft.com/en-us/windows/win32/api/imapi2/nf-imapi2-iwriteengine2eventargs-get_startlba HRESULT get_StartLba( + // LONG *value ); + [DispId(0x100)] + int StartLba { get; } + + /// Retrieves the number of sectors to write to the device in the current write operation. + /// The number of sectors to write in the current write operation. + /// This is the same value passed to the IWriteEngine2::WriteSection method. + // https://docs.microsoft.com/en-us/windows/win32/api/imapi2/nf-imapi2-iwriteengine2eventargs-get_sectorcount HRESULT + // get_SectorCount( LONG *value ); + [DispId(0x101)] + int SectorCount { get; } + + /// Retrieves the address of the sector most recently read from the burn image. + /// Logical block address of the sector most recently read from the input data stream. + // https://docs.microsoft.com/en-us/windows/win32/api/imapi2/nf-imapi2-iwriteengine2eventargs-get_lastreadlba HRESULT + // get_LastReadLba( LONG *value ); + [DispId(0x102)] + int LastReadLba { get; } + + /// Retrieves the address of the sector most recently written to the device. + /// Logical block address of the sector most recently written to the device. + // https://docs.microsoft.com/en-us/windows/win32/api/imapi2/nf-imapi2-iwriteengine2eventargs-get_lastwrittenlba HRESULT + // get_LastWrittenLba( LONG *value ); + [DispId(0x103)] + int LastWrittenLba { get; } + + /// Retrieves the size of the internal data buffer that is used for writing to disc. + /// Size, in bytes, of the internal data buffer that is used for writing to disc. + // https://docs.microsoft.com/en-us/windows/win32/api/imapi2/nf-imapi2-iwriteengine2eventargs-get_totalsystembuffer HRESULT + // get_TotalSystemBuffer( LONG *value ); + [DispId(0x106)] + int TotalSystemBuffer { get; } + + /// Retrieves the number of used bytes in the internal data buffer that is used for writing to disc. + /// Size, in bytes, of the used portion of the internal data buffer that is used for writing to disc. + /// This value increases as data is read into the buffer and decreases as data is written to disc. + // https://docs.microsoft.com/en-us/windows/win32/api/imapi2/nf-imapi2-iwriteengine2eventargs-get_usedsystembuffer HRESULT + // get_UsedSystemBuffer( LONG *value ); + [DispId(0x107)] + int UsedSystemBuffer { get; } + + /// Retrieves the number of unused bytes in the internal data buffer that is used for writing to disc. + /// Size, in bytes, of the unused portion of the internal data buffer that is used for writing to disc. + /// This method returns the same value as if you subtracted IWriteEngine2EventArgs::get_UsedSystemBuffer from IWriteEngine2EventArgs::get_TotalSystemBuffer. + // https://docs.microsoft.com/en-us/windows/win32/api/imapi2/nf-imapi2-iwriteengine2eventargs-get_freesystembuffer HRESULT + // get_FreeSystemBuffer( LONG *value ); + [DispId(0x108)] + int FreeSystemBuffer { get; } + } + + /// + /// + /// Use this interface retrieve detailed write configurations supported by the disc recorder and current media, for example, the media + /// type, write speed, rotational-speed control type. + /// + /// To get this interface, call one of the following methods: + /// + /// + /// IDiscFormat2Data::get_SupportedWriteSpeedDescriptors + /// + /// + /// IDiscFormat2RawCD::get_SupportedWriteSpeedDescriptors + /// + /// + /// IDiscFormat2TrackAtOnce::get_SupportedWriteSpeedDescriptors + /// + /// + /// + /// This is a MsftWriteSpeedDescriptor object in script. + // https://docs.microsoft.com/en-us/windows/win32/api/imapi2/nn-imapi2-iwritespeeddescriptor + [PInvokeData("imapi2.h", MSDNShortId = "NN:imapi2.IWriteSpeedDescriptor")] + [ComImport, Guid("27354144-7F64-5B0F-8F00-5D77AFBE261E"), InterfaceType(ComInterfaceType.InterfaceIsDual), CoClass(typeof(MsftWriteSpeedDescriptor))] + public interface IWriteSpeedDescriptor + { + /// Retrieves type of media in the current drive. + /// Type of media in the current drive. For possible values, see the IMAPI_MEDIA_PHYSICAL_TYPE enumeration type. + // https://docs.microsoft.com/en-us/windows/win32/api/imapi2/nf-imapi2-iwritespeeddescriptor-get_mediatype HRESULT get_MediaType( + // IMAPI_MEDIA_PHYSICAL_TYPE *value ); + [DispId(0x101)] + IMAPI_MEDIA_PHYSICAL_TYPE MediaType { get; } + + /// Retrieves the supported rotational-speed control used by the recorder for the current media. + /// + /// Is VARIANT_TRUE if constant angular velocity (CAV) rotational-speed control is in use. Otherwise, VARIANT_FALSE to indicate that + /// another rotational-speed control that the recorder supports is in use. + /// + /// + /// Rotational-speed control types include the following: + /// + /// + /// CLV (Constant Linear Velocity). The disc is written at a constant speed. Standard rotational control. + /// + /// + /// CAV (Constant Angular Velocity). The disc is written at a constantly increasing speed. + /// + /// + /// + /// ZCAV (Zone Constant Linear Velocity). The disc is divided into zones. After each zone, the write speed increases. This is an + /// impure form of CAV. + /// + /// + /// + /// + /// PCAV (Partial Constant Angular Velocity). The disc speed increases up to a specified velocity. Once reached, the disc spins at + /// the specified velocity for the duration of the disc writing. + /// + /// + /// + /// + // https://docs.microsoft.com/en-us/windows/win32/api/imapi2/nf-imapi2-iwritespeeddescriptor-get_rotationtypeispurecav HRESULT + // get_RotationTypeIsPureCAV( VARIANT_BOOL *value ); + [DispId(0x102)] + bool RotationTypeIsPureCAV { [return: MarshalAs(UnmanagedType.VariantBool)] get; } + + /// Retrieves the supported write speed for writing to the media. + /// Write speed of the current media, measured in sectors per second. + /// The write speed is based on the media write speeds. The value of this property can change when a media change occurs. + // https://docs.microsoft.com/en-us/windows/win32/api/imapi2/nf-imapi2-iwritespeeddescriptor-get_writespeed HRESULT get_WriteSpeed( + // LONG *value ); + [DispId(0x103)] + int WriteSpeed { get; } + } + + /// CLSID_MsftDiscFormat2Data + [ComImport, Guid("2735412A-7F64-5B0F-8F00-5D77AFBE261E"), ClassInterface(ClassInterfaceType.None)] + public class MsftDiscFormat2Data + { + } + + /// CLSID_MsftDiscFormat2Erase + [ComImport, Guid("2735412B-7F64-5B0F-8F00-5D77AFBE261E"), ClassInterface(ClassInterfaceType.None)] + public class MsftDiscFormat2Erase + { + } + + /// CLSID_MsftDiscFormat2RawCD + [ComImport, Guid("27354128-7F64-5B0F-8F00-5D77AFBE261E"), ClassInterface(ClassInterfaceType.None)] + public class MsftDiscFormat2RawCD + { + } + + /// CLSID_MsftDiscFormat2TrackAtOnce + [ComImport, Guid("27354129-7F64-5B0F-8F00-5D77AFBE261E"), ClassInterface(ClassInterfaceType.None)] + public class MsftDiscFormat2TrackAtOnce + { + } + + /// CLSID_MsftDiscMaster2 + [ComImport, Guid("2735412E-7F64-5B0F-8F00-5D77AFBE261E"), ClassInterface(ClassInterfaceType.None)] + public class MsftDiscMaster2 + { + } + + /// CLSID_MsftDiscRecorder2 + [ComImport, Guid("2735412D-7F64-5B0F-8F00-5D77AFBE261E"), ClassInterface(ClassInterfaceType.None)] + public class MsftDiscRecorder2 + { + } + + /// CLSID_MsftMultisessionRandomWrite + [ComImport, Guid("B507CA24-2204-11DD-966A-001AA01BBC58"), ClassInterface(ClassInterfaceType.None)] + public class MsftMultisessionRandomWrite + { + } + + /// CLSID_MsftMultisessionSequential + [ComImport, Guid("27354122-7F64-5B0F-8F00-5D77AFBE261E"), ClassInterface(ClassInterfaceType.None)] + public class MsftMultisessionSequential + { + } + + /// CLSID_MsftRawCDImageCreator + [ComImport, Guid("25983561-9D65-49CE-B335-40630D901227"), ClassInterface(ClassInterfaceType.None)] + public class MsftRawCDImageCreator + { + } + + /// CLSID_MsftWriteEngine2 + [ComImport, Guid("2735412C-7F64-5B0F-8F00-5D77AFBE261E"), ClassInterface(ClassInterfaceType.None)] + public class MsftWriteEngine2 + { + } + + /// CLSID_MsftWriteSpeedDescriptor + [ComImport, Guid("27354123-7F64-5B0F-8F00-5D77AFBE261E"), ClassInterface(ClassInterfaceType.None)] + public class MsftWriteSpeedDescriptor + { + } + } +} \ No newline at end of file diff --git a/PInvoke/IMAPI/IMAPIv2FS.cs b/PInvoke/IMAPI/IMAPIv2FS.cs new file mode 100644 index 00000000..9c84df8e --- /dev/null +++ b/PInvoke/IMAPI/IMAPIv2FS.cs @@ -0,0 +1,3794 @@ +using System; +using System.Collections; +using System.Runtime.CompilerServices; +using System.Runtime.InteropServices; +using System.Runtime.InteropServices.ComTypes; +using System.Runtime.InteropServices.CustomMarshalers; +using Vanara.Collections; + +namespace Vanara.PInvoke +{ + /// Interfaces and constants for IMAPI v1 and v2. + public static partial class IMAPI + { + /// Defines values for media types that the boot image is intended to emulate. + /// + /// + /// Other values not defined here may exist. Consumers of this enumeration should not presume this list to be the only set of valid values. + /// + /// For complete details of these emulation types, see the "El Torito" Bootable CD-ROM format specification at http://www.phoenix.com/docs/specscdrom.pdf. + /// + // https://docs.microsoft.com/en-us/windows/win32/api/imapi2fs/ne-imapi2fs-emulationtype typedef enum EmulationType { EmulationNone, + // Emulation12MFloppy, Emulation144MFloppy, Emulation288MFloppy, EmulationHardDisk } ; + [PInvokeData("imapi2fs.h", MSDNShortId = "NE:imapi2fs.EmulationType")] + public enum EmulationType + { + /// + /// No emulation. The BIOS will not emulate any device type or special sector size for the CD during boot from the CD. + /// + EmulationNone, + + /// Emulates a 1.2 MB floppy disk. + Emulation12MFloppy, + + /// Emulates a 1.44 MB floppy disk. + Emulation144MFloppy, + + /// Emulates a 2.88 MB floppy disk. + Emulation288MFloppy, + + /// Emulates a hard disk. + EmulationHardDisk, + } + + /// Defines values for recognized file systems. + // https://docs.microsoft.com/en-us/windows/win32/api/imapi2fs/ne-imapi2fs-fsifilesystems typedef enum FsiFileSystems { + // FsiFileSystemNone, FsiFileSystemISO9660, FsiFileSystemJoliet, FsiFileSystemUDF, FsiFileSystemUnknown } ; + [PInvokeData("imapi2fs.h", MSDNShortId = "NE:imapi2fs.FsiFileSystems")] + [Flags] + public enum FsiFileSystems + { + /// The disc does not contain a recognized file system. + FsiFileSystemNone = 0x000000000, + + /// Standard CD file system. + FsiFileSystemISO9660 = 0x000000001, + + /// Joliet file system. + FsiFileSystemJoliet = 0x000000002, + + /// UDF file system. + FsiFileSystemUDF = 0x000000004, + + /// The disc appears to have a file system, but the layout does not match any of the recognized types. + FsiFileSystemUnknown = 0x040000000, + } + + /// Defines values for the file system item that was found using the IFileSystemImage::Exists method. + // https://docs.microsoft.com/en-us/windows/win32/api/imapi2fs/ne-imapi2fs-fsiitemtype typedef enum FsiItemType { FsiItemNotFound, + // FsiItemDirectory, FsiItemFile } ; + [PInvokeData("imapi2fs.h", MSDNShortId = "NE:imapi2fs.FsiItemType")] + public enum FsiItemType + { + /// The specified item was not found. + FsiItemNotFound, + + /// The specified item is a directory. + FsiItemDirectory, + + /// The specified item is a file. + FsiItemFile, + } + + /// Defines values for the operating system architecture that the boot image supports + /// + /// 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/imapi2fs/ne-imapi2fs-platformid typedef enum PlatformId { PlatformX86, + // PlatformPowerPC, PlatformMac, PlatformEFI } ; + [PInvokeData("imapi2fs.h", MSDNShortId = "NE:imapi2fs.PlatformId")] + public enum PlatformId + { + /// Intel Pentium™ series of chip sets. This entry implies a Windows operating system. + PlatformX86, + + /// Apple PowerPC family. + PlatformPowerPC, + + /// Apple Macintosh family. + PlatformMac, + + /// EFI Family. + PlatformEFI = 0xef, + } + + /// Implement this interface to receive notifications of the current write operation. + // https://docs.microsoft.com/en-us/windows/win32/api/imapi2fs/nn-imapi2fs-dfilesystemimageevents + [PInvokeData("imapi2fs.h", MSDNShortId = "NN:imapi2fs.DFileSystemImageEvents")] + [ComImport, Guid("2C941FDF-975B-59BE-A960-9A2A262853A5"), InterfaceType(ComInterfaceType.InterfaceIsDual)] + public interface DFileSystemImageEvents + { + /// + /// Implement this method to receive progress notification of the current write operation. The notifications are sent when + /// copying the content of a file or while adding directories or files to the file system image. + /// + /// + /// An IFileSystemImage interface of the file system image that is being written. + /// This parameter is a CFileSystemImage object in a script. + /// + /// String that contains the full path of the file being written. + /// Number of sectors copied. + /// Total number of sectors in the file. + /// + /// Notifications are sent in response to calling one of the following methods: + /// + /// + /// IFsiDirectoryItem::Add + /// + /// + /// IFsiDirectoryItem::AddFile + /// + /// + /// IFsiDirectoryItem::AddTree + /// + /// + /// + /// Notifications can also be sent when calling one of the following methods to import a UDF file system that was created using + /// immediate allocation (immediate allocation means that the file data is contained within the file descriptor instead of + /// having allocation descriptors in the file descriptor that point to sectors of data): + /// + /// + /// + /// IFileSystemImage::ImportFileSystem + /// + /// + /// IFileSystemImage::ImportSpecificFileSystem + /// + /// + /// Notification is sent: + /// + /// + /// Once before adding the first sector of a file (copiedSectors is 0) + /// + /// + /// For every megabyte that is written + /// + /// + /// Once after the final write if the file did not end on a megabyte boundary + /// + /// + /// + // https://docs.microsoft.com/en-us/windows/win32/api/imapi2fs/nf-imapi2fs-dfilesystemimageevents-update HRESULT Update( + // IDispatch *object, BSTR currentFile, LONG copiedSectors, LONG totalSectors ); + [DispId(0x100)] + [MethodImpl(MethodImplOptions.InternalCall, MethodCodeType = MethodCodeType.Runtime)] + void Update([In, MarshalAs(UnmanagedType.IDispatch)] IFileSystemImage @object, + [In, MarshalAs(UnmanagedType.BStr)] string currentFile, + long copiedSectors, + long totalSectors); + } + + /// Use this interface to receives notifications regarding the current file system import operation. + /// This interface supports import notifications for ISO9660, Joliet and UDF file systems. + // https://docs.microsoft.com/en-us/windows/win32/api/imapi2fs/nn-imapi2fs-dfilesystemimageimportevents + [PInvokeData("imapi2fs.h", MSDNShortId = "NN:imapi2fs.DFileSystemImageImportEvents")] + [ComImport, Guid("D25C30F9-4087-4366-9E24-E55BE286424B"), InterfaceType(ComInterfaceType.InterfaceIsDual)] + public interface DFileSystemImageImportEvents + { + /// Receives import notification for every file and directory item imported from an optical medium. + /// Pointer to an IFilesystemImage3 interface of a file system image object to which data is being imported. + /// + /// Type of the file system currently being imported. For possible values, see the FsiFileSystems enumeration type. + /// + /// A string containing the name of the file or directory being imported at the moment. + /// The number of directories imported so far. + /// The total number of directories to be imported from the optical medium. + /// The number of files imported so far. + /// The total number of files to be imported from the optical medium. + /// + /// Notifications are sent in response to calling one of the following methods for importing a file system. + /// + /// + /// IFileSystemImage::ImportFileSystem + /// + /// + /// IFileSystemImage::ImportSpecificFileSystem + /// + /// + /// UpdateImport method receives import notifications from ISO9660, Joliet and UDF file systems. A notification is sent: + /// + /// + /// Once after every individual imported file. + /// + /// + /// Once before every directory import begins. + /// + /// + /// + /// The totalFileItems parameter of an UpdateImport event is always set to (-1) for ISO9660 and Joliet file systems, + /// because of the difficulty quickly and accurately determining the total number of files in an ISO9660/Joliet file system + /// prior to import. + /// + /// Import notifications are generated only for files and directories, and not for associated named streams. + /// If the currentItem is a directory, it contains a back slash '' at the end. + /// + // https://docs.microsoft.com/en-us/windows/win32/api/imapi2fs/nf-imapi2fs-dfilesystemimageimportevents-updateimport HRESULT + // UpdateImport( IDispatch *object, FsiFileSystems fileSystem, BSTR currentItem, LONG importedDirectoryItems, LONG + // totalDirectoryItems, LONG importedFileItems, LONG totalFileItems ); + [DispId(0x101)] + [MethodImpl(MethodImplOptions.InternalCall, MethodCodeType = MethodCodeType.Runtime)] + void UpdateImport([In, MarshalAs(UnmanagedType.IDispatch)] IFileSystemImage @object, + [In, MarshalAs(UnmanagedType.I4)] FsiFileSystems fileSystem, + [In, MarshalAs(UnmanagedType.BStr)] string currentItem, + long importedDirectoryItems, + long totalDirectoryItems, + long importedFileItems, + long totalFileItems); + } + + /// + /// + /// Use this interface to specify the boot image to add to the optical disc. A boot image contains one or more sectors of code used + /// to start the computer. + /// + /// + /// To create an instance of this interface, call the CoCreateInstance function. Use__uuidof(BootOptions) for the class + /// identifier and __uuidof(IBootOptions) for the interface identifier. + /// + /// + /// + /// This interface supports the "El Torito" Bootable CD-ROM format specification. + /// To add the boot image to a file system image, call the IFileSystemImage::put_BootImageOptions method. + /// To get the boot image associated with a file system image, call the IFileSystemImage::get_BootImageOptions method. + /// To create the BootOptions object in a script, use IMAPI2.BootOptions as the program identifier when calling CreateObject. + /// + // https://docs.microsoft.com/en-us/windows/win32/api/imapi2fs/nn-imapi2fs-ibootoptions + [PInvokeData("imapi2fs.h", MSDNShortId = "NN:imapi2fs.IBootOptions")] + [ComImport, Guid("2C941FD4-975B-59BE-A960-9A2A262853A5"), InterfaceType(ComInterfaceType.InterfaceIsDual), CoClass(typeof(BootOptions))] + public interface IBootOptions + { + /// Retrieves a pointer to the boot image data stream. + /// Pointer to the IStream interface associated with the boot image data stream. + // https://docs.microsoft.com/en-us/windows/win32/api/imapi2fs/nf-imapi2fs-ibootoptions-get_bootimage HRESULT get_BootImage( + // IStream **pVal ); + [DispId(1)] + IStream BootImage { get; } + + /// Sets an identifier that identifies the manufacturer or developer of the CD. + /// + /// Identifier that identifies the manufacturer or developer of the CD. This is an ANSI string that is limited to 24 bytes. The + /// string does not need to include a NULL character; however, you must set unused bytes to 0x00. + /// + // https://docs.microsoft.com/en-us/windows/win32/api/imapi2fs/nf-imapi2fs-ibootoptions-put_manufacturer HRESULT + // put_Manufacturer( BSTR newVal ); + [DispId(2)] + string Manufacturer { [return: MarshalAs(UnmanagedType.BStr)] get; set; } + + /// Sets the platform identifier that identifies the operating system architecture that the boot image supports. + /// + /// Identifies the operating system architecture that the boot image supports. For possible values, see the PlatformId + /// enumeration type. The default value is PlatformX86 for Intel x86–based platforms. + /// + // https://docs.microsoft.com/en-us/windows/win32/api/imapi2fs/nf-imapi2fs-ibootoptions-put_platformid HRESULT put_PlatformId( + // PlatformId newVal ); + [DispId(3)] + PlatformId PlatformId { get; set; } + + /// Sets the media type that the boot image is intended to emulate. + /// + /// Media type that the boot image is intended to emulate. For possible values, see the EmulationType enumeration type. The + /// default value is EmulationNone, which means the BIOS will not emulate any device type or special sector size for the + /// CD during boot from the CD. + /// + // https://docs.microsoft.com/en-us/windows/win32/api/imapi2fs/nf-imapi2fs-ibootoptions-put_emulation HRESULT put_Emulation( + // EmulationType newVal ); + [DispId(4)] + EmulationType Emulation { get; set; } + + /// Retrieves the size of the boot image. + /// Size, in bytes, of the boot image. + // https://docs.microsoft.com/en-us/windows/win32/api/imapi2fs/nf-imapi2fs-ibootoptions-get_imagesize HRESULT get_ImageSize( + // ULONG *pVal ); + [DispId(5)] + uint ImageSize { get; } + + /// Sets the data stream that contains the boot image. + /// An IStream interface of the data stream that contains the boot image. + /// + /// + /// If the size of the newly assigned boot image is either 1.2, 1.44. or 2.88 MB, this method will automatically adjust the + /// EmulationType value to the respective "floppy" type value. It is, however, possible to override the default or previously + /// assigned EmulationType value by calling the IBootOptions::put_Emulation method. + /// + /// + /// The additional specification of the platform on which to use the boot image requires the call to the + /// IBootOptions::put_PlatformId method. + /// + /// IMAPI does not include any boot images; developers must provide their own boot images. + /// + // https://docs.microsoft.com/en-us/windows/win32/api/imapi2fs/nf-imapi2fs-ibootoptions-assignbootimage HRESULT AssignBootImage( + // IStream *newVal ); + [DispId(20)] + void AssignBootImage(IStream newVal); + } + + /// + /// Use this interface to enumerate the child directory and file items for a FsiDirectoryItem object. + /// To get this interface, call the IFsiDirectoryItem::get_EnumFsiItems method. + /// + /// This is a EnumFsiItems object in script. + // https://docs.microsoft.com/en-us/windows/win32/api/imapi2fs/nn-imapi2fs-ienumfsiitems + [PInvokeData("imapi2fs.h", MSDNShortId = "NN:imapi2fs.IEnumFsiItems")] + [ComImport, InterfaceType(ComInterfaceType.InterfaceIsIUnknown), Guid("2C941FDA-975B-59BE-A960-9A2A262853A5"), CoClass(typeof(EnumFsiItems))] + public interface IEnumFsiItems : ICOMEnum + { + /// Retrieves a specified number of items in the enumeration sequence. + /// Number of items to retrieve. + /// Array of IFsiItem interfaces. You must release each interface in rgelt when done. + /// + /// Number of elements returned in rgelt. You can set pceltFetched to NULL if celt is one. Otherwise, initialize the + /// value of pceltFetched to 0 before calling this method. + /// + /// + /// + /// S_OK is returned when the number of requested elements (celt) are returned successfully or the number of returned items + /// (pceltFetched) is less than the number of requested elements. + /// + /// + /// Other success codes may be returned as a result of implementation. The following error codes are commonly returned on + /// operation failure, but do not represent the only possible error values: + /// + /// + /// + /// Return code + /// Description + /// + /// + /// E_POINTER + /// Pointer is not valid. Value: 0x80004003 + /// + /// + /// E_OUTOFMEMORY + /// Failed to allocate the required memory. Value: 0x8007000E + /// + /// + /// E_INVALIDARG + /// One or more arguments are not valid. Value: 0x80070057 + /// + /// + /// + /// If there are fewer than the requested number of elements left in the sequence, it retrieves the remaining elements. + // https://docs.microsoft.com/en-us/windows/win32/api/imapi2fs/nf-imapi2fs-ienumfsiitems-next HRESULT Next( ULONG celt, IFsiItem + // **rgelt, ULONG *pceltFetched ); + [PreserveSig] + HRESULT Next(uint celt, [MarshalAs(UnmanagedType.LPArray, ArraySubType = UnmanagedType.Interface, SizeParamIndex = 2)] IFsiItem[] rgelt, out uint pceltFetched); + + /// Skips a specified number of items in the enumeration sequence. + /// Number of items to skip. + /// + /// + /// S_OK is returned on success, but other success codes may be returned as a result of implementation. The following error + /// codes are commonly returned on operation failure, but do not represent the only possible error values: + /// + /// + /// + /// Return code + /// Description + /// + /// + /// S_FALSE + /// Skipped less than the number of requested elements. + /// + /// + /// + /// + /// If there are fewer elements left in the sequence than the requested number of elements to skip, it skips past the last + /// element in the sequence. + /// + // https://docs.microsoft.com/en-us/windows/win32/api/imapi2fs/nf-imapi2fs-ienumfsiitems-skip HRESULT Skip( ULONG celt ); + [PreserveSig] + HRESULT Skip(uint celt); + + /// Resets the enumeration sequence to the beginning. + // https://docs.microsoft.com/en-us/windows/win32/api/imapi2fs/nf-imapi2fs-ienumfsiitems-reset HRESULT Reset(); + void Reset(); + + /// Creates another enumerator that contains the same enumeration state as the current one. + /// + /// Receives the interface pointer to the enumeration object. If the method is unsuccessful, the value of this output variable + /// is undefined. You must release ppEnum when done. + /// + /// + /// Using this method, a client can record a particular point in the enumeration sequence, and then return to that point at a + /// later time. The new enumerator supports the same interface as the original one. + /// + // https://docs.microsoft.com/en-us/windows/win32/api/imapi2fs/nf-imapi2fs-ienumfsiitems-clone HRESULT Clone( IEnumFsiItems + // **ppEnum ); + [return: MarshalAs(UnmanagedType.Interface)] + IEnumFsiItems Clone(); + } + + /// + /// Use this interface to enumerate a collection of progress items. + /// To get this interface, call the IProgressItems::get_EnumProgressItems method. + /// + /// This is a EnumProgressItems object in script. + // https://docs.microsoft.com/en-us/windows/win32/api/imapi2fs/nn-imapi2fs-ienumprogressitems + [PInvokeData("imapi2fs.h", MSDNShortId = "NN:imapi2fs.IEnumProgressItems")] + [ComImport, Guid("2C941FD6-975B-59BE-A960-9A2A262853A5"), InterfaceType(ComInterfaceType.InterfaceIsIUnknown), CoClass(typeof(EnumProgressItems))] + public interface IEnumProgressItems : ICOMEnum + { + /// Retrieves a specified number of items in the enumeration sequence. + /// Number of items to retrieve. + /// Array of IProgressItem interfaces. You must release each interface in rgelt when done. + /// + /// Number of elements returned in rgelt. You can set pceltFetched to NULL if celt is one. Otherwise, initialize the + /// value of pceltFetched to 0 before calling this method. + /// + /// + /// + /// S_OK is returned when the number of requested elements (celt) are returned successfully or the number of returned items + /// (pceltFetched) is less than the number of requested elements. + /// + /// + /// Other success codes may be returned as a result of implementation. The following error codes are commonly returned on + /// operation failure, but do not represent the only possible error values: + /// + /// + /// + /// Return code + /// Description + /// + /// + /// E_POINTER + /// Pointer is not valid. Value: 0x80004003 + /// + /// + /// E_OUTOFMEMORY + /// Failed to allocate the required memory. Value: 0x8007000E + /// + /// + /// E_INVALIDARG + /// One or more arguments are not valid. Value: 0x80070057 + /// + /// + /// + /// If there are fewer than the requested number of elements left in the sequence, it retrieves the remaining elements. + // https://docs.microsoft.com/en-us/windows/win32/api/imapi2fs/nf-imapi2fs-ienumprogressitems-next HRESULT Next( ULONG celt, + // IProgressItem **rgelt, ULONG *pceltFetched ); + [PreserveSig] + HRESULT Next(uint celt, [MarshalAs(UnmanagedType.LPArray, ArraySubType = UnmanagedType.Interface, SizeParamIndex = 2)] IProgressItem[] rgelt, out uint pceltFetched); + + /// Skips a specified number of items in the enumeration sequence. + /// Number of items to skip. + /// + /// + /// S_OK is returned on success, but other success codes may be returned as a result of implementation. The following error + /// codes are commonly returned on operation failure, but do not represent the only possible error values: + /// + /// + /// + /// Return code + /// Description + /// + /// + /// S_FALSE + /// Skipped less than the number of requested elements. + /// + /// + /// + /// + /// If there are fewer elements left in the sequence than the requested number of elements to skip, it skips past the last + /// element in the sequence. + /// + // https://docs.microsoft.com/en-us/windows/win32/api/imapi2fs/nf-imapi2fs-ienumprogressitems-skip HRESULT Skip( ULONG celt ); + [PreserveSig] + HRESULT Skip(uint celt); + + /// Resets the enumeration sequence to the beginning. + // https://docs.microsoft.com/en-us/windows/win32/api/imapi2fs/nf-imapi2fs-ienumprogressitems-reset HRESULT Reset(); + void Reset(); + + /// Creates another enumerator that contains the same enumeration state as the current one. + /// + /// Receives the interface pointer to the enumeration object. If the method is unsuccessful, the value of this output variable + /// is undefined. You must release ppEnum when done. + /// + /// + /// Using this method, a client can record a particular point in the enumeration sequence, and then return to that point at a + /// later time. The new enumerator supports the same interface as the original one. + /// + // https://docs.microsoft.com/en-us/windows/win32/api/imapi2fs/nf-imapi2fs-ienumprogressitems-clone HRESULT Clone( + // IEnumProgressItems **ppEnum ); + [return: MarshalAs(UnmanagedType.Interface)] + IEnumProgressItems Clone(); + } + + /// + /// Use this interface to build a file system image, set session parameter, and import or export an image. + /// The file system directory hierarchy is built by adding directories and files to the root or child directories. + /// + /// To create an instance of this interface, call the CoCreateInstance function. Use__uuidof(MsftFileSystemImage) for the + /// class identifier and __uuidof(IFileSystemImage) for the interface identifier. + /// + /// + /// + /// To create the CFileSystemImage object in a script, use IMAPI2.MsftFileSystemImage as the program identifier when calling CreateObject. + /// + // https://docs.microsoft.com/en-us/windows/win32/api/imapi2fs/nn-imapi2fs-ifilesystemimage + [PInvokeData("imapi2fs.h", MSDNShortId = "NN:imapi2fs.IFileSystemImage")] + [ComImport, Guid("2C941FE1-975B-59BE-A960-9A2A262853A5"), InterfaceType(ComInterfaceType.InterfaceIsDual), CoClass(typeof(MsftFileSystemImage))] + public interface IFileSystemImage + { + /// Retrieves the root directory item. + /// An IFsiDirectoryItem interface of the root directory item. + // https://docs.microsoft.com/en-us/windows/win32/api/imapi2fs/nf-imapi2fs-ifilesystemimage-get_root HRESULT get_Root( + // IFsiDirectoryItem **pVal ); + [DispId(0)] + IFsiDirectoryItem Root { [return: MarshalAs(UnmanagedType.Interface)] get; } + + /// Retrieves the starting block address for the recording session. + /// Starting block address for the recording session. + /// + /// The session starting block can be set in the following ways: + /// + /// + /// Importing a file system automatically sets the session starting block. + /// + /// + /// If the previous session is not imported, the client can call IFileSystemImage::put_SessionStartBlock to set this property. + /// + /// + /// + // https://docs.microsoft.com/en-us/windows/win32/api/imapi2fs/nf-imapi2fs-ifilesystemimage-get_sessionstartblock HRESULT + // get_SessionStartBlock( LONG *pVal ); + [DispId(1)] + int SessionStartBlock { get; set; } + + /// Retrieves the maximum number of blocks available for the image. + /// Number of blocks to use in creating the file system image. + // https://docs.microsoft.com/en-us/windows/win32/api/imapi2fs/nf-imapi2fs-ifilesystemimage-get_freemediablocks HRESULT + // get_FreeMediaBlocks( LONG *pVal ); + [DispId(2)] + int FreeMediaBlocks { get; set; } + + /// Retrieves the number of blocks in use. + /// Estimated number of blocks used in the file-system image. + // https://docs.microsoft.com/en-us/windows/win32/api/imapi2fs/nf-imapi2fs-ifilesystemimage-get_usedblocks HRESULT + // get_UsedBlocks( LONG *pVal ); + [DispId(3)] + int UsedBlocks { get; } + + /// Retrieves or sets the volume name for this file system image. + /// String that contains the volume name for this file system image. + /// To set the volume name, call the IFileSystemImage::put_VolumeName method. + // https://docs.microsoft.com/en-us/windows/win32/api/imapi2fs/nf-imapi2fs-ifilesystemimage-get_volumename HRESULT + // get_VolumeName( BSTR *pVal ); + [DispId(4)] + string VolumeName { [return: MarshalAs(UnmanagedType.BStr)] get; set; } + + /// Retrieves the volume name provided from an imported file system. + /// + /// String that contains the volume name provided from an imported file system. Is NULL until a file system is imported. + /// + /// + /// The imported volume name is provided for user information and is not automatically carried forward to subsequent sessions. + /// + // https://docs.microsoft.com/en-us/windows/win32/api/imapi2fs/nf-imapi2fs-ifilesystemimage-get_importedvolumename HRESULT + // get_ImportedVolumeName( BSTR *pVal ); + [DispId(5)] + string ImportedVolumeName { [return: MarshalAs(UnmanagedType.BStr)] get; } + + /// Retrieves the boot image that you want to add to the file system image. + /// An IBootOptions interface of the boot image to add to the disc. Is NULL if a boot image has not been specified. + // https://docs.microsoft.com/en-us/windows/win32/api/imapi2fs/nf-imapi2fs-ifilesystemimage-get_bootimageoptions HRESULT + // get_BootImageOptions( IBootOptions **pVal ); + [DispId(6)] + IBootOptions BootImageOptions { [return: MarshalAs(UnmanagedType.Interface)] get; set; } + + /// Retrieves the number of files in the file system image. + /// Number of files in the file system image. + // https://docs.microsoft.com/en-us/windows/win32/api/imapi2fs/nf-imapi2fs-ifilesystemimage-get_filecount HRESULT get_FileCount( + // LONG *pVal ); + [DispId(7)] + int FileCount { get; } + + /// Retrieves the number of directories in the file system image. + /// Number of directories in the file system image. + // https://docs.microsoft.com/en-us/windows/win32/api/imapi2fs/nf-imapi2fs-ifilesystemimage-get_directorycount HRESULT + // get_DirectoryCount( LONG *pVal ); + [DispId(8)] + int DirectoryCount { get; } + + /// Retrieves the temporary directory in which stash files are built. + /// String that contains the path to the temporary directory. + // https://docs.microsoft.com/en-us/windows/win32/api/imapi2fs/nf-imapi2fs-ifilesystemimage-get_workingdirectory HRESULT + // get_WorkingDirectory( BSTR *pVal ); + [DispId(9)] + string WorkingDirectory { [return: MarshalAs(UnmanagedType.BStr)] get; set; } + + /// Retrieves the change point identifier. + /// Change point identifier. The identifier is a count of the changes to the file system image since its inception. + /// + /// + /// An application can store the value of this property prior to making a change to the file system, then at a later point pass + /// the value to the IFileSystemImage::RollbackToChangePoint method to revert changes since that point in development. + /// + /// + /// An application can call the IFileSystemImage::LockInChangePoint method to lock the state of a file system image at any point + /// in its development. Once a lock is set, you cannot call RollbackToChangePoint to revert the file system image to its earlier state. + /// + /// + // https://docs.microsoft.com/en-us/windows/win32/api/imapi2fs/nf-imapi2fs-ifilesystemimage-get_changepoint HRESULT + // get_ChangePoint( LONG *pVal ); + [DispId(10)] + int ChangePoint { get; } + + /// Determines the compliance level for creating and developing the file-system image. + /// + /// Is VARIANT_TRUE if the file system images are created in strict compliance with applicable standards. + /// Is VARIANT_FALSE if the compliance standards are relaxed to be compatible with IMAPI version 1.0. + /// + // https://docs.microsoft.com/en-us/windows/win32/api/imapi2fs/nf-imapi2fs-ifilesystemimage-get_strictfilesystemcompliance + // HRESULT get_StrictFileSystemCompliance( VARIANT_BOOL *pVal ); + [DispId(11)] + bool StrictFileSystemCompliance { [return: MarshalAs(UnmanagedType.VariantBool)] get; set; } + + /// Determines if the file and directory names use a restricted character. + /// + /// Is VARIANT_TRUE if the file and directory names to add to the file system image must consist of characters that map directly + /// to CP_ANSI (code points 32 through 127). Otherwise, VARIANT_FALSE. + /// + // https://docs.microsoft.com/en-us/windows/win32/api/imapi2fs/nf-imapi2fs-ifilesystemimage-get_userestrictedcharacterset + // HRESULT get_UseRestrictedCharacterSet( VARIANT_BOOL *pVal ); + [DispId(12)] + bool UseRestrictedCharacterSet { [return: MarshalAs(UnmanagedType.VariantBool)] get; set; } + + /// Retrieves the types of file systems to create when generating the result stream. + /// + /// One or more file system types to create when generating the result stream. For possible values, see the FsiFileSystems + /// enumeration type. + /// + /// + /// + /// To specify the file system types, call the IFileSystemImage::put_FileSystemsToCreate method. You could also call either + /// IFilesystemImage::ChooseImageDefaults or IFilesystemImage::ChooseImageDefaultsForMediaType to have IMAPI choose the file + /// system for you. + /// + /// To retrieve a list of supported file system types, call the IFileSystemImage::get_FileSystemsSupported method. + /// + // https://docs.microsoft.com/en-us/windows/win32/api/imapi2fs/nf-imapi2fs-ifilesystemimage-get_filesystemstocreate HRESULT + // get_FileSystemsToCreate( FsiFileSystems *pVal ); + [DispId(13)] + FsiFileSystems FileSystemsToCreate { get; set; } + + /// Retrieves the list of file system types that a client can use to build a file system image. + /// + /// One or more file system types that a client can use to build a file system image. For possible values, see the + /// FsiFileSystems enumeration type. + /// + // https://docs.microsoft.com/en-us/windows/win32/api/imapi2fs/nf-imapi2fs-ifilesystemimage-get_filesystemssupported HRESULT + // get_FileSystemsSupported( FsiFileSystems *pVal ); + [DispId(14)] + FsiFileSystems FileSystemsSupported { get; } + + /// Create the result object that contains the file system and file data. + /// + /// An IFileSystemImageResult interface of the image result. + /// Client applications can stream the image to media or other long-term storage devices, such as disk drives. + /// + /// + /// + /// Currently, IFileSystemImage::CreateResultImage will require disc media access as a result of a previous + /// IFileSystemImage::IdentifyFileSystemsOnDisc method call. To resolve this issue, it is recommended that another + /// IFileSystemImage object be created specifically for the IFileSystemImage::IdentifyFileSystemsOnDisc operation. + /// + /// + /// The resulting stream can be saved as an ISO file if the file system is generated in a single session and has a start address + /// of zero. + /// + /// + // https://docs.microsoft.com/en-us/windows/win32/api/imapi2fs/nf-imapi2fs-ifilesystemimage-createresultimage HRESULT + // CreateResultImage( IFileSystemImageResult **resultStream ); + [DispId(15)] + IFileSystemImageResult CreateResultImage(); + + /// Checks for the existence of a given file or directory. + /// String that contains the fully qualified path of the directory or file to check. + /// + /// Indicates if the item is a file, a directory, or does not exist. For possible values, see the FsiItemType enumeration type. + /// + // https://docs.microsoft.com/en-us/windows/win32/api/imapi2fs/nf-imapi2fs-ifilesystemimage-exists HRESULT Exists( BSTR + // fullPath, FsiItemType *itemType ); + [DispId(16)] + FsiItemType Exists([MarshalAs(UnmanagedType.BStr)] string fullPath); + + /// Retrieves a string that identifies a disc and the sessions recorded on the disc. + /// + /// String that contains a signature that identifies the disc and the sessions on it. This string is not guaranteed to be unique + /// between discs. + /// + /// + /// + /// When layering sessions on a disc, the signature acts as a key that the client can use to ensure the session order, and to + /// distinguish sessions on disc from session images that will be laid on the disc. + /// + /// You must call IFileSystemImage::put_MultisessionInterfaces prior to calling CalculateDiscIdentifier. + /// + // https://docs.microsoft.com/en-us/windows/win32/api/imapi2fs/nf-imapi2fs-ifilesystemimage-calculatediscidentifier HRESULT + // CalculateDiscIdentifier( BSTR *discIdentifier ); + [DispId(18)] + [return: MarshalAs(UnmanagedType.BStr)] + string CalculateDiscIdentifier(); + + /// Retrieves a list of the different types of file systems on the optical media. + /// + /// An IDiscRecorder2 interface that identifies the recording device that contains the media. If this parameter is NULL, + /// the discRecorder specified in IMultisession will be used. + /// + /// One or more files systems on the disc. For possible values, see FsiFileSystems enumeration type. + /// + /// Client applications can call IFileSystemImage::GetDefaultFileSystemForImport with the value returned by this method to + /// determine the type of file system to import. + /// + // https://docs.microsoft.com/en-us/windows/win32/api/imapi2fs/nf-imapi2fs-ifilesystemimage-identifyfilesystemsondisc HRESULT + // IdentifyFileSystemsOnDisc( IDiscRecorder2 *discRecorder, FsiFileSystems *fileSystems ); + [DispId(19)] + FsiFileSystems IdentifyFileSystemsOnDisc(IDiscRecorder2 discRecorder); + + /// Retrieves the file system to import by default. + /// One or more file system values. For possible values, see the FsiFileSystems enumeration type. + /// + /// A single file system value that identifies the default file system. The value is one of the file systems specified in fileSystems + /// + /// + /// Use this method to identify the default file system to use with IFileSystemImage::ImportFileSystem. + /// To identify the supported file systems, call the IFileSystemImage::get_FileSystemsSupported method. + /// + // https://docs.microsoft.com/en-us/windows/win32/api/imapi2fs/nf-imapi2fs-ifilesystemimage-getdefaultfilesystemforimport + // HRESULT GetDefaultFileSystemForImport( FsiFileSystems fileSystems, FsiFileSystems *importDefault ); + [DispId(20)] + FsiFileSystems GetDefaultFileSystemForImport(FsiFileSystems fileSystems); + + /// Imports the default file system on the current disc. + /// Identifies the imported file system. For possible values, see the FsiFileSystems enumeration type. + /// + /// + /// You must call IFileSystemImage::put_MultisessionInterfaces prior to calling IFileSystemImage::ImportFileSystem. + /// Additionally, it is recommended that IDiscFormat2::get_MediaHeuristicallyBlank is called before + /// IFileSystemImage::put_MultisessionInterfaces to verify that the media is not blank. + /// + /// + /// If the disc contains more than one file system, only one file system is imported. This method chooses the file system to + /// import in the following order: UDF, Joliet, ISO 9660. The import includes transferring directories and files to the + /// in-memory file system structure. + /// + /// + /// You may call this method at any time during the construction of the in-memory file system. If, during import, a file or + /// directory already exists in the in-memory copy, the in-memory version will be retained; the imported file will be discarded. + /// + /// + /// To determine which file system is the default file system for the disc, call the + /// IFileSystemImage::GetDefaultFileSystemForImport method. + /// + /// + /// This method only reads the file information. If the item is a file, the file data is copied when calling + /// IFsiDirectoryItem::AddFile, IFsiDirectoryItem::AddTree, or IFsiDirectoryItem::Add method. + /// + /// + /// This method returns IMAPI_E_NO_SUPPORTED_FILE_SYSTEM if a supported file system is not found in the last session. + /// Additionally, this method returns IMAPI_E_INCOMPATIBLE_PREVIOUS_SESSION if the layout of the file system in the last + /// session is incompatible with the layout used by IMAPI for the creation of requested file systems for the result image. For + /// more details see the IFileSystemImage::put_FileSystemsToCreate method documention. + /// + /// + // https://docs.microsoft.com/en-us/windows/win32/api/imapi2fs/nf-imapi2fs-ifilesystemimage-importfilesystem HRESULT + // ImportFileSystem( FsiFileSystems *importedFileSystem ); + [DispId(21)] + FsiFileSystems ImportFileSystem(); + + /// Import a specific file system from disc. + /// + /// Identifies the file system to import. For possible values, see the FsiFileSystems enumeration type. + /// + /// + /// + /// You must call IFileSystemImage::put_MultisessionInterfaces prior to calling + /// IFileSystemImage::ImportSpecificFileSystem. Additionally, it is recommended that + /// IDiscFormat2::get_MediaHeuristicallyBlank is called before IFileSystemImage::put_MultisessionInterfaces to verify + /// that the media is not blank. + /// + /// + /// You may call this method at any time during the construction of the in-memory file system. If, during import, a file or + /// directory already exists in the in-memory copy, the in-memory version will be retained; the imported file will be discarded. + /// + /// + /// On re-writable media (DVD+/-RW, DVDRAM, BD-RE), import or burning a second session is not support if the first session has + /// an ISO9660 file system, due to file system limitations. + /// + /// + /// This method only reads the file information. If the item is a file, the file data is copied when calling + /// IFsiDirectoryItem::AddFile, IFsiDirectoryItem::AddTree, or IFsiDirectoryItem::Add method. + /// + /// + /// this method returns IMAPI_E_INCOMPATIBLE_PREVIOUS_SESSION if the layout of the file system in the last session is + /// incompatible with the layout used by IMAPI for the creation of requested file systems for the result image. For more details + /// see the IFileSystemImage::put_FileSystemsToCreate method documention. If the file system specified by fileSystemToUse has + /// not been found, this method returns IMAPI_E_FILE_SYSTEM_NOT_FOUND. + /// + /// + // https://docs.microsoft.com/en-us/windows/win32/api/imapi2fs/nf-imapi2fs-ifilesystemimage-importspecificfilesystem HRESULT + // ImportSpecificFileSystem( FsiFileSystems fileSystemToUse ); + [DispId(22)] + void ImportSpecificFileSystem(FsiFileSystems fileSystemToUse); + + /// Reverts the image back to the specified change point. + /// Change point that identifies the target state for rollback. + /// + /// + /// Typically, an application calls the IFileSystemImage::get_ChangePoint method and stores the change point value prior to + /// making a change to the file system. If necessary, you can pass the change point value to this method to revert changes since + /// that point in development. + /// + /// + /// An application can call the IFileSystemImage::LockInChangePoint method to lock the state of a file system image at any point + /// in its development. After a lock is set, you cannot call this method to revert the file system image to its earlier state. + /// + /// + // https://docs.microsoft.com/en-us/windows/win32/api/imapi2fs/nf-imapi2fs-ifilesystemimage-rollbacktochangepoint HRESULT + // RollbackToChangePoint( LONG changePoint ); + [DispId(23)] + void RollbackToChangePoint(int changePoint); + + /// Locks the file system information at the current change-point level. + /// + /// Once the change point is locked, rollback to earlier change points is not permitted. + /// Locking the change point does not change the IFileSystemImage::get_ChangePoint property. + /// + // https://docs.microsoft.com/en-us/windows/win32/api/imapi2fs/nf-imapi2fs-ifilesystemimage-lockinchangepoint HRESULT LockInChangePoint(); + [DispId(24)] + void LockInChangePoint(); + + /// Create a directory item with the specified name. + /// String that contains the name of the directory item to create. + /// + /// An IFsiDirectoryItem interface of the new directory item. When done, call the IFsiDirectoryItem::Release method to + /// release the interface. + /// + /// + /// After setting properties on the IFsiDirectoryItem interface, call the IFsiDirectoryItem::Add method on the parent directory + /// item to add it to the file system image. + /// + // https://docs.microsoft.com/en-us/windows/win32/api/imapi2fs/nf-imapi2fs-ifilesystemimage-createdirectoryitem HRESULT + // CreateDirectoryItem( BSTR name, IFsiDirectoryItem **newItem ); + [DispId(25)] + IFsiDirectoryItem CreateDirectoryItem([MarshalAs(UnmanagedType.BStr)] string name); + + /// Create a file item with the specified name. + /// String that contains the name of the file item to create. + /// + /// An IFsiFileItem interface of the new file item. When done, call the IFsiFileItem::Release method to release the interface. + /// + /// + /// After setting properties on the IFsiFileItem interface, call the IFsiDirectoryItem::Add method on the parent directory item + /// to add it to the file system image. + /// + // https://docs.microsoft.com/en-us/windows/win32/api/imapi2fs/nf-imapi2fs-ifilesystemimage-createfileitem HRESULT + // CreateFileItem( BSTR name, IFsiFileItem **newItem ); + [DispId(26)] + IFsiFileItem CreateFileItem([MarshalAs(UnmanagedType.BStr)] string name); + + /// Retrieves the volume name for the UDF system image. + /// String that contains the volume name for the UDF system image. + // https://docs.microsoft.com/en-us/windows/win32/api/imapi2fs/nf-imapi2fs-ifilesystemimage-get_volumenameudf HRESULT + // get_VolumeNameUDF( BSTR *pVal ); + [DispId(27)] + string VolumeNameUDF { [return: MarshalAs(UnmanagedType.BStr)] get; } + + /// Retrieves the volume name for the Joliet system image. + /// String that contains the volume name for the Joliet system image. + // https://docs.microsoft.com/en-us/windows/win32/api/imapi2fs/nf-imapi2fs-ifilesystemimage-get_volumenamejoliet HRESULT + // get_VolumeNameJoliet( BSTR *pVal ); + [DispId(28)] + string VolumeNameJoliet { [return: MarshalAs(UnmanagedType.BStr)] get; } + + /// Retrieves the volume name for the ISO9660 system image. + /// String that contains the volume name for the ISO9660 system image. + // https://docs.microsoft.com/en-us/windows/win32/api/imapi2fs/nf-imapi2fs-ifilesystemimage-get_volumenameiso9660 HRESULT + // get_VolumeNameISO9660( BSTR *pVal ); + [DispId(29)] + string VolumeNameISO9660 { [return: MarshalAs(UnmanagedType.BStr)] get; } + + /// Indicates if the files being added to the file system image should be staged before the burn. + /// + /// VARIANT_TRUE if the files being added to the file system image are required to be stageded in one or more stage files + /// before burning. Otherwise, VARIANT_FALSE is returned if IMAPI is permitted to optimize the image creation process by + /// not staging the files being added to the file system image. + /// + /// + /// + /// "Staging" is a process in which an image is created on the hard-drive, containing all files to be burned, prior to the + /// initiation of the burn operation. + /// + /// + /// Setting this this property to VARIANT_TRUE via IFileSystemImage::put_StageFiles will only affect files that are added + /// after the property is set: those files will always be staged. Files that were not staged prior to a specified property value + /// of VARIANT_TRUE, will not be staged. + /// + /// By specifying VARIANT_FALSE, the file system image creation process is optimized in two ways: + /// + /// + /// Less time is required for image generation + /// + /// + /// Less space is consumed on a local disk by IMAPI + /// + /// + /// + /// However, in order to avoid buffer underrun problems during burning, a certain minimum throughput is required for read + /// operations on non-staged files. In the event that file accessibility or throughput may not meet the requirements of the + /// burner, IMAPI enforces file staging regardless of the specified property value. For example, file staging is enforced for + /// source files from removable storage devices, such as USB Flash Disk. + /// + /// + // https://docs.microsoft.com/en-us/windows/win32/api/imapi2fs/nf-imapi2fs-ifilesystemimage-get_stagefiles HRESULT + // get_StageFiles( VARIANT_BOOL *pVal ); + [DispId(30)] + bool StageFiles { [return: MarshalAs(UnmanagedType.VariantBool)] get; set; } + + /// Retrieves a list of supported UDF revision levels. + /// + /// List of supported UDF revision levels. Each element of the list is VARIANT. The variant type is VT_I4. The + /// lVal member of the variant contains the revision level. + /// + /// + /// The value is encoded according to the UDF specification, except the variable size is LONG. For example, revision level 1.02 + /// is represented as 0x102. + /// + // https://docs.microsoft.com/en-us/windows/win32/api/imapi2fs/nf-imapi2fs-ifilesystemimage-get_udfrevisionssupported HRESULT + // get_UDFRevisionsSupported( SAFEARRAY **pVal ); + [DispId(31)] + int[] UDFRevisionsSupported { [return: MarshalAs(UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof(SafeArrayMarshaler))] get; } + + /// Sets the default file system types and the image size based on the current media. + /// An IDiscRecorder2 the identifies the device that contains the current media. + // https://docs.microsoft.com/en-us/windows/win32/api/imapi2fs/nf-imapi2fs-ifilesystemimage-chooseimagedefaults HRESULT + // ChooseImageDefaults( IDiscRecorder2 *discRecorder ); + [DispId(32)] + void ChooseImageDefaults(IDiscRecorder2 discRecorder); + + /// Sets the default file system types and the image size based on the specified media type. + /// + /// Identifies the physical media type that will receive the burn image. For possible values, see the IMAPI_MEDIA_PHYSICAL_TYPE + /// enumeration type. + /// + // https://docs.microsoft.com/en-us/windows/win32/api/imapi2fs/nf-imapi2fs-ifilesystemimage-chooseimagedefaultsformediatype + // HRESULT ChooseImageDefaultsForMediaType( IMAPI_MEDIA_PHYSICAL_TYPE value ); + [DispId(33)] + void ChooseImageDefaultsForMediaType(IMAPI_MEDIA_PHYSICAL_TYPE value); + + /// Retrieves the ISO9660 compatibility level to use when creating the result image. + /// Identifies the interchange level of the ISO9660 file system. + /// + /// For a list of supported compatibility levels, call the IFileSystemImage::get_ISO9660InterchangeLevelsSupported method. + /// + // https://docs.microsoft.com/en-us/windows/win32/api/imapi2fs/nf-imapi2fs-ifilesystemimage-get_iso9660interchangelevel HRESULT + // get_ISO9660InterchangeLevel( LONG *pVal ); + [DispId(34)] + int ISO9660InterchangeLevel { set; get; } + + /// Set maximum number of blocks available based on the capabilities of the recorder. + /// + /// An IDiscRecorder2 interface that identifies the recording device from which you want to set the maximum number of blocks available. + /// + // https://docs.microsoft.com/en-us/windows/win32/api/imapi2fs/nf-imapi2fs-ifilesystemimage-setmaxmediablocksfromdevice HRESULT + // SetMaxMediaBlocksFromDevice( IDiscRecorder2 *discRecorder ); + [DispId(36)] + void SetMaxMediaBlocksFromDevice(IDiscRecorder2 discRecorder); + + /// Retrieves the UDF revision level of the imported file system image. + /// UDF revision level of the imported file system image. + /// + /// The value is encoded according to the UDF specification, except the variable size is LONG. For example, revision level 1.02 + /// is represented as 0x102. + /// + // https://docs.microsoft.com/en-us/windows/win32/api/imapi2fs/nf-imapi2fs-ifilesystemimage-get_udfrevision HRESULT + // get_UDFRevision( LONG *pVal ); + [DispId(37)] + int UDFRevision { set; get; } + + /// Retrieves the supported ISO9660 compatibility levels. + /// + /// List of supported ISO9660 compatibility levels. Each item in the list is a VARIANT that identifies one supported interchange + /// level. The variant type is VT_UI4. The ulVal member of the variant contains the compatibility level. + /// + // https://docs.microsoft.com/en-us/windows/win32/api/imapi2fs/nf-imapi2fs-ifilesystemimage-get_iso9660interchangelevelssupported + // HRESULT get_ISO9660InterchangeLevelsSupported( SAFEARRAY **pVal ); + [DispId(38)] + uint[] ISO9660InterchangeLevelsSupported { [return: MarshalAs(UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof(SafeArrayMarshaler))] get; } + + /// Retrieves the list of multi-session interfaces for the optical media. + /// + /// List of multi-session interfaces for the optical media. Each element of the list is a VARIANT of type + /// VT_Dispatch. Query the pdispVal member of the variant for the IMultisession interface. + /// + /// + /// Query the IMultisession interface for a derived IMultisession interface, for example, the IMultisessionSequential interface. + /// + // https://docs.microsoft.com/en-us/windows/win32/api/imapi2fs/nf-imapi2fs-ifilesystemimage-get_multisessioninterfaces HRESULT + // get_MultisessionInterfaces( SAFEARRAY **pVal ); + [DispId(40)] + IMultisession[] MultisessionInterfaces { [return: MarshalAs(UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof(SafeArrayMarshaler))] get; set; } + } + + /// + /// Use this interface to write multiple boot entries or boot images required for the EFI/UEFI support. For example, boot media with + /// boot straps for both Windows XP and Windows Vista. + /// + /// + /// + /// Boot entries are limited by the interface to 32 per disc. The boot image must be supplied to IMAPIv2FS by outside applications + /// who invoke IMAPIv2FS to build the bootable disc. + /// + /// Section Entry Extension is not supported by IMAPIv2FS at this time. + /// + // https://docs.microsoft.com/en-us/windows/win32/api/imapi2fs/nn-imapi2fs-ifilesystemimage2 + [PInvokeData("imapi2fs.h", MSDNShortId = "NN:imapi2fs.IFileSystemImage2")] + [ComImport, Guid("D7644B2C-1537-4767-B62F-F1387B02DDFD"), InterfaceType(ComInterfaceType.InterfaceIsDual), CoClass(typeof(MsftFileSystemImage))] + public interface IFileSystemImage2 : IFileSystemImage + { + /// Retrieves the root directory item. + /// An IFsiDirectoryItem interface of the root directory item. + // https://docs.microsoft.com/en-us/windows/win32/api/imapi2fs/nf-imapi2fs-ifilesystemimage-get_root HRESULT get_Root( + // IFsiDirectoryItem **pVal ); + [DispId(0)] + new IFsiDirectoryItem Root { [return: MarshalAs(UnmanagedType.Interface)] get; } + + /// Retrieves the starting block address for the recording session. + /// Starting block address for the recording session. + /// + /// The session starting block can be set in the following ways: + /// + /// + /// Importing a file system automatically sets the session starting block. + /// + /// + /// If the previous session is not imported, the client can call IFileSystemImage::put_SessionStartBlock to set this property. + /// + /// + /// + // https://docs.microsoft.com/en-us/windows/win32/api/imapi2fs/nf-imapi2fs-ifilesystemimage-get_sessionstartblock HRESULT + // get_SessionStartBlock( LONG *pVal ); + [DispId(1)] + new int SessionStartBlock { get; set; } + + /// Retrieves the maximum number of blocks available for the image. + /// Number of blocks to use in creating the file system image. + // https://docs.microsoft.com/en-us/windows/win32/api/imapi2fs/nf-imapi2fs-ifilesystemimage-get_freemediablocks HRESULT + // get_FreeMediaBlocks( LONG *pVal ); + [DispId(2)] + new int FreeMediaBlocks { get; set; } + + /// Retrieves the number of blocks in use. + /// Estimated number of blocks used in the file-system image. + // https://docs.microsoft.com/en-us/windows/win32/api/imapi2fs/nf-imapi2fs-ifilesystemimage-get_usedblocks HRESULT + // get_UsedBlocks( LONG *pVal ); + [DispId(3)] + new int UsedBlocks { get; } + + /// Retrieves or sets the volume name for this file system image. + /// String that contains the volume name for this file system image. + /// To set the volume name, call the IFileSystemImage::put_VolumeName method. + // https://docs.microsoft.com/en-us/windows/win32/api/imapi2fs/nf-imapi2fs-ifilesystemimage-get_volumename HRESULT + // get_VolumeName( BSTR *pVal ); + [DispId(4)] + new string VolumeName { [return: MarshalAs(UnmanagedType.BStr)] get; set; } + + /// Retrieves the volume name provided from an imported file system. + /// + /// String that contains the volume name provided from an imported file system. Is NULL until a file system is imported. + /// + /// + /// The imported volume name is provided for user information and is not automatically carried forward to subsequent sessions. + /// + // https://docs.microsoft.com/en-us/windows/win32/api/imapi2fs/nf-imapi2fs-ifilesystemimage-get_importedvolumename HRESULT + // get_ImportedVolumeName( BSTR *pVal ); + [DispId(5)] + new string ImportedVolumeName { [return: MarshalAs(UnmanagedType.BStr)] get; } + + /// Retrieves the boot image that you want to add to the file system image. + /// An IBootOptions interface of the boot image to add to the disc. Is NULL if a boot image has not been specified. + // https://docs.microsoft.com/en-us/windows/win32/api/imapi2fs/nf-imapi2fs-ifilesystemimage-get_bootimageoptions HRESULT + // get_BootImageOptions( IBootOptions **pVal ); + [DispId(6)] + new IBootOptions BootImageOptions { [return: MarshalAs(UnmanagedType.Interface)] get; set; } + + /// Retrieves the number of files in the file system image. + /// Number of files in the file system image. + // https://docs.microsoft.com/en-us/windows/win32/api/imapi2fs/nf-imapi2fs-ifilesystemimage-get_filecount HRESULT get_FileCount( + // LONG *pVal ); + [DispId(7)] + new int FileCount { get; } + + /// Retrieves the number of directories in the file system image. + /// Number of directories in the file system image. + // https://docs.microsoft.com/en-us/windows/win32/api/imapi2fs/nf-imapi2fs-ifilesystemimage-get_directorycount HRESULT + // get_DirectoryCount( LONG *pVal ); + [DispId(8)] + new int DirectoryCount { get; } + + /// Retrieves the temporary directory in which stash files are built. + /// String that contains the path to the temporary directory. + // https://docs.microsoft.com/en-us/windows/win32/api/imapi2fs/nf-imapi2fs-ifilesystemimage-get_workingdirectory HRESULT + // get_WorkingDirectory( BSTR *pVal ); + [DispId(9)] + new string WorkingDirectory { [return: MarshalAs(UnmanagedType.BStr)] get; set; } + + /// Retrieves the change point identifier. + /// Change point identifier. The identifier is a count of the changes to the file system image since its inception. + /// + /// + /// An application can store the value of this property prior to making a change to the file system, then at a later point pass + /// the value to the IFileSystemImage::RollbackToChangePoint method to revert changes since that point in development. + /// + /// + /// An application can call the IFileSystemImage::LockInChangePoint method to lock the state of a file system image at any point + /// in its development. Once a lock is set, you cannot call RollbackToChangePoint to revert the file system image to its earlier state. + /// + /// + // https://docs.microsoft.com/en-us/windows/win32/api/imapi2fs/nf-imapi2fs-ifilesystemimage-get_changepoint HRESULT + // get_ChangePoint( LONG *pVal ); + [DispId(10)] + new int ChangePoint { get; } + + /// Determines the compliance level for creating and developing the file-system image. + /// + /// Is VARIANT_TRUE if the file system images are created in strict compliance with applicable standards. + /// Is VARIANT_FALSE if the compliance standards are relaxed to be compatible with IMAPI version 1.0. + /// + // https://docs.microsoft.com/en-us/windows/win32/api/imapi2fs/nf-imapi2fs-ifilesystemimage-get_strictfilesystemcompliance + // HRESULT get_StrictFileSystemCompliance( VARIANT_BOOL *pVal ); + [DispId(11)] + new bool StrictFileSystemCompliance { [return: MarshalAs(UnmanagedType.VariantBool)] get; set; } + + /// Determines if the file and directory names use a restricted character. + /// + /// Is VARIANT_TRUE if the file and directory names to add to the file system image must consist of characters that map directly + /// to CP_ANSI (code points 32 through 127). Otherwise, VARIANT_FALSE. + /// + // https://docs.microsoft.com/en-us/windows/win32/api/imapi2fs/nf-imapi2fs-ifilesystemimage-get_userestrictedcharacterset + // HRESULT get_UseRestrictedCharacterSet( VARIANT_BOOL *pVal ); + [DispId(12)] + new bool UseRestrictedCharacterSet { [return: MarshalAs(UnmanagedType.VariantBool)] get; set; } + + /// Retrieves the types of file systems to create when generating the result stream. + /// + /// One or more file system types to create when generating the result stream. For possible values, see the FsiFileSystems + /// enumeration type. + /// + /// + /// + /// To specify the file system types, call the IFileSystemImage::put_FileSystemsToCreate method. You could also call either + /// IFilesystemImage::ChooseImageDefaults or IFilesystemImage::ChooseImageDefaultsForMediaType to have IMAPI choose the file + /// system for you. + /// + /// To retrieve a list of supported file system types, call the IFileSystemImage::get_FileSystemsSupported method. + /// + // https://docs.microsoft.com/en-us/windows/win32/api/imapi2fs/nf-imapi2fs-ifilesystemimage-get_filesystemstocreate HRESULT + // get_FileSystemsToCreate( FsiFileSystems *pVal ); + [DispId(13)] + new FsiFileSystems FileSystemsToCreate { get; set; } + + /// Retrieves the list of file system types that a client can use to build a file system image. + /// + /// One or more file system types that a client can use to build a file system image. For possible values, see the + /// FsiFileSystems enumeration type. + /// + // https://docs.microsoft.com/en-us/windows/win32/api/imapi2fs/nf-imapi2fs-ifilesystemimage-get_filesystemssupported HRESULT + // get_FileSystemsSupported( FsiFileSystems *pVal ); + [DispId(14)] + new FsiFileSystems FileSystemsSupported { get; } + + /// Create the result object that contains the file system and file data. + /// + /// An IFileSystemImageResult interface of the image result. + /// Client applications can stream the image to media or other long-term storage devices, such as disk drives. + /// + /// + /// + /// Currently, IFileSystemImage::CreateResultImage will require disc media access as a result of a previous + /// IFileSystemImage::IdentifyFileSystemsOnDisc method call. To resolve this issue, it is recommended that another + /// IFileSystemImage object be created specifically for the IFileSystemImage::IdentifyFileSystemsOnDisc operation. + /// + /// + /// The resulting stream can be saved as an ISO file if the file system is generated in a single session and has a start address + /// of zero. + /// + /// + // https://docs.microsoft.com/en-us/windows/win32/api/imapi2fs/nf-imapi2fs-ifilesystemimage-createresultimage HRESULT + // CreateResultImage( IFileSystemImageResult **resultStream ); + [DispId(15)] + new IFileSystemImageResult CreateResultImage(); + + /// Checks for the existence of a given file or directory. + /// String that contains the fully qualified path of the directory or file to check. + /// + /// Indicates if the item is a file, a directory, or does not exist. For possible values, see the FsiItemType enumeration type. + /// + // https://docs.microsoft.com/en-us/windows/win32/api/imapi2fs/nf-imapi2fs-ifilesystemimage-exists HRESULT Exists( BSTR + // fullPath, FsiItemType *itemType ); + [DispId(16)] + new FsiItemType Exists([MarshalAs(UnmanagedType.BStr)] string fullPath); + + /// Retrieves a string that identifies a disc and the sessions recorded on the disc. + /// + /// String that contains a signature that identifies the disc and the sessions on it. This string is not guaranteed to be unique + /// between discs. + /// + /// + /// + /// When layering sessions on a disc, the signature acts as a key that the client can use to ensure the session order, and to + /// distinguish sessions on disc from session images that will be laid on the disc. + /// + /// You must call IFileSystemImage::put_MultisessionInterfaces prior to calling CalculateDiscIdentifier. + /// + // https://docs.microsoft.com/en-us/windows/win32/api/imapi2fs/nf-imapi2fs-ifilesystemimage-calculatediscidentifier HRESULT + // CalculateDiscIdentifier( BSTR *discIdentifier ); + [DispId(18)] + [return: MarshalAs(UnmanagedType.BStr)] + new string CalculateDiscIdentifier(); + + /// Retrieves a list of the different types of file systems on the optical media. + /// + /// An IDiscRecorder2 interface that identifies the recording device that contains the media. If this parameter is NULL, + /// the discRecorder specified in IMultisession will be used. + /// + /// One or more files systems on the disc. For possible values, see FsiFileSystems enumeration type. + /// + /// Client applications can call IFileSystemImage::GetDefaultFileSystemForImport with the value returned by this method to + /// determine the type of file system to import. + /// + // https://docs.microsoft.com/en-us/windows/win32/api/imapi2fs/nf-imapi2fs-ifilesystemimage-identifyfilesystemsondisc HRESULT + // IdentifyFileSystemsOnDisc( IDiscRecorder2 *discRecorder, FsiFileSystems *fileSystems ); + [DispId(19)] + new FsiFileSystems IdentifyFileSystemsOnDisc(IDiscRecorder2 discRecorder); + + /// Retrieves the file system to import by default. + /// One or more file system values. For possible values, see the FsiFileSystems enumeration type. + /// + /// A single file system value that identifies the default file system. The value is one of the file systems specified in fileSystems + /// + /// + /// Use this method to identify the default file system to use with IFileSystemImage::ImportFileSystem. + /// To identify the supported file systems, call the IFileSystemImage::get_FileSystemsSupported method. + /// + // https://docs.microsoft.com/en-us/windows/win32/api/imapi2fs/nf-imapi2fs-ifilesystemimage-getdefaultfilesystemforimport + // HRESULT GetDefaultFileSystemForImport( FsiFileSystems fileSystems, FsiFileSystems *importDefault ); + [DispId(20)] + new FsiFileSystems GetDefaultFileSystemForImport(FsiFileSystems fileSystems); + + /// Imports the default file system on the current disc. + /// Identifies the imported file system. For possible values, see the FsiFileSystems enumeration type. + /// + /// + /// You must call IFileSystemImage::put_MultisessionInterfaces prior to calling IFileSystemImage::ImportFileSystem. + /// Additionally, it is recommended that IDiscFormat2::get_MediaHeuristicallyBlank is called before + /// IFileSystemImage::put_MultisessionInterfaces to verify that the media is not blank. + /// + /// + /// If the disc contains more than one file system, only one file system is imported. This method chooses the file system to + /// import in the following order: UDF, Joliet, ISO 9660. The import includes transferring directories and files to the + /// in-memory file system structure. + /// + /// + /// You may call this method at any time during the construction of the in-memory file system. If, during import, a file or + /// directory already exists in the in-memory copy, the in-memory version will be retained; the imported file will be discarded. + /// + /// + /// To determine which file system is the default file system for the disc, call the + /// IFileSystemImage::GetDefaultFileSystemForImport method. + /// + /// + /// This method only reads the file information. If the item is a file, the file data is copied when calling + /// IFsiDirectoryItem::AddFile, IFsiDirectoryItem::AddTree, or IFsiDirectoryItem::Add method. + /// + /// + /// This method returns IMAPI_E_NO_SUPPORTED_FILE_SYSTEM if a supported file system is not found in the last session. + /// Additionally, this method returns IMAPI_E_INCOMPATIBLE_PREVIOUS_SESSION if the layout of the file system in the last + /// session is incompatible with the layout used by IMAPI for the creation of requested file systems for the result image. For + /// more details see the IFileSystemImage::put_FileSystemsToCreate method documention. + /// + /// + // https://docs.microsoft.com/en-us/windows/win32/api/imapi2fs/nf-imapi2fs-ifilesystemimage-importfilesystem HRESULT + // ImportFileSystem( FsiFileSystems *importedFileSystem ); + [DispId(21)] + new FsiFileSystems ImportFileSystem(); + + /// Import a specific file system from disc. + /// + /// Identifies the file system to import. For possible values, see the FsiFileSystems enumeration type. + /// + /// + /// + /// You must call IFileSystemImage::put_MultisessionInterfaces prior to calling + /// IFileSystemImage::ImportSpecificFileSystem. Additionally, it is recommended that + /// IDiscFormat2::get_MediaHeuristicallyBlank is called before IFileSystemImage::put_MultisessionInterfaces to verify + /// that the media is not blank. + /// + /// + /// You may call this method at any time during the construction of the in-memory file system. If, during import, a file or + /// directory already exists in the in-memory copy, the in-memory version will be retained; the imported file will be discarded. + /// + /// + /// On re-writable media (DVD+/-RW, DVDRAM, BD-RE), import or burning a second session is not support if the first session has + /// an ISO9660 file system, due to file system limitations. + /// + /// + /// This method only reads the file information. If the item is a file, the file data is copied when calling + /// IFsiDirectoryItem::AddFile, IFsiDirectoryItem::AddTree, or IFsiDirectoryItem::Add method. + /// + /// + /// this method returns IMAPI_E_INCOMPATIBLE_PREVIOUS_SESSION if the layout of the file system in the last session is + /// incompatible with the layout used by IMAPI for the creation of requested file systems for the result image. For more details + /// see the IFileSystemImage::put_FileSystemsToCreate method documention. If the file system specified by fileSystemToUse has + /// not been found, this method returns IMAPI_E_FILE_SYSTEM_NOT_FOUND. + /// + /// + // https://docs.microsoft.com/en-us/windows/win32/api/imapi2fs/nf-imapi2fs-ifilesystemimage-importspecificfilesystem HRESULT + // ImportSpecificFileSystem( FsiFileSystems fileSystemToUse ); + [DispId(22)] + new void ImportSpecificFileSystem(FsiFileSystems fileSystemToUse); + + /// Reverts the image back to the specified change point. + /// Change point that identifies the target state for rollback. + /// + /// + /// Typically, an application calls the IFileSystemImage::get_ChangePoint method and stores the change point value prior to + /// making a change to the file system. If necessary, you can pass the change point value to this method to revert changes since + /// that point in development. + /// + /// + /// An application can call the IFileSystemImage::LockInChangePoint method to lock the state of a file system image at any point + /// in its development. After a lock is set, you cannot call this method to revert the file system image to its earlier state. + /// + /// + // https://docs.microsoft.com/en-us/windows/win32/api/imapi2fs/nf-imapi2fs-ifilesystemimage-rollbacktochangepoint HRESULT + // RollbackToChangePoint( LONG changePoint ); + [DispId(23)] + new void RollbackToChangePoint(int changePoint); + + /// Locks the file system information at the current change-point level. + /// + /// Once the change point is locked, rollback to earlier change points is not permitted. + /// Locking the change point does not change the IFileSystemImage::get_ChangePoint property. + /// + // https://docs.microsoft.com/en-us/windows/win32/api/imapi2fs/nf-imapi2fs-ifilesystemimage-lockinchangepoint HRESULT LockInChangePoint(); + [DispId(24)] + new void LockInChangePoint(); + + /// Create a directory item with the specified name. + /// String that contains the name of the directory item to create. + /// + /// An IFsiDirectoryItem interface of the new directory item. When done, call the IFsiDirectoryItem::Release method to + /// release the interface. + /// + /// + /// After setting properties on the IFsiDirectoryItem interface, call the IFsiDirectoryItem::Add method on the parent directory + /// item to add it to the file system image. + /// + // https://docs.microsoft.com/en-us/windows/win32/api/imapi2fs/nf-imapi2fs-ifilesystemimage-createdirectoryitem HRESULT + // CreateDirectoryItem( BSTR name, IFsiDirectoryItem **newItem ); + [DispId(25)] + new IFsiDirectoryItem CreateDirectoryItem([MarshalAs(UnmanagedType.BStr)] string name); + + /// Create a file item with the specified name. + /// String that contains the name of the file item to create. + /// + /// An IFsiFileItem interface of the new file item. When done, call the IFsiFileItem::Release method to release the interface. + /// + /// + /// After setting properties on the IFsiFileItem interface, call the IFsiDirectoryItem::Add method on the parent directory item + /// to add it to the file system image. + /// + // https://docs.microsoft.com/en-us/windows/win32/api/imapi2fs/nf-imapi2fs-ifilesystemimage-createfileitem HRESULT + // CreateFileItem( BSTR name, IFsiFileItem **newItem ); + [DispId(26)] + new IFsiFileItem CreateFileItem([MarshalAs(UnmanagedType.BStr)] string name); + + /// Retrieves the volume name for the UDF system image. + /// String that contains the volume name for the UDF system image. + // https://docs.microsoft.com/en-us/windows/win32/api/imapi2fs/nf-imapi2fs-ifilesystemimage-get_volumenameudf HRESULT + // get_VolumeNameUDF( BSTR *pVal ); + [DispId(27)] + new string VolumeNameUDF { [return: MarshalAs(UnmanagedType.BStr)] get; } + + /// Retrieves the volume name for the Joliet system image. + /// String that contains the volume name for the Joliet system image. + // https://docs.microsoft.com/en-us/windows/win32/api/imapi2fs/nf-imapi2fs-ifilesystemimage-get_volumenamejoliet HRESULT + // get_VolumeNameJoliet( BSTR *pVal ); + [DispId(28)] + new string VolumeNameJoliet { [return: MarshalAs(UnmanagedType.BStr)] get; } + + /// Retrieves the volume name for the ISO9660 system image. + /// String that contains the volume name for the ISO9660 system image. + // https://docs.microsoft.com/en-us/windows/win32/api/imapi2fs/nf-imapi2fs-ifilesystemimage-get_volumenameiso9660 HRESULT + // get_VolumeNameISO9660( BSTR *pVal ); + [DispId(29)] + new string VolumeNameISO9660 { [return: MarshalAs(UnmanagedType.BStr)] get; } + + /// Indicates if the files being added to the file system image should be staged before the burn. + /// + /// VARIANT_TRUE if the files being added to the file system image are required to be stageded in one or more stage files + /// before burning. Otherwise, VARIANT_FALSE is returned if IMAPI is permitted to optimize the image creation process by + /// not staging the files being added to the file system image. + /// + /// + /// + /// "Staging" is a process in which an image is created on the hard-drive, containing all files to be burned, prior to the + /// initiation of the burn operation. + /// + /// + /// Setting this this property to VARIANT_TRUE via IFileSystemImage::put_StageFiles will only affect files that are added + /// after the property is set: those files will always be staged. Files that were not staged prior to a specified property value + /// of VARIANT_TRUE, will not be staged. + /// + /// By specifying VARIANT_FALSE, the file system image creation process is optimized in two ways: + /// + /// + /// Less time is required for image generation + /// + /// + /// Less space is consumed on a local disk by IMAPI + /// + /// + /// + /// However, in order to avoid buffer underrun problems during burning, a certain minimum throughput is required for read + /// operations on non-staged files. In the event that file accessibility or throughput may not meet the requirements of the + /// burner, IMAPI enforces file staging regardless of the specified property value. For example, file staging is enforced for + /// source files from removable storage devices, such as USB Flash Disk. + /// + /// + // https://docs.microsoft.com/en-us/windows/win32/api/imapi2fs/nf-imapi2fs-ifilesystemimage-get_stagefiles HRESULT + // get_StageFiles( VARIANT_BOOL *pVal ); + [DispId(30)] + new bool StageFiles { [return: MarshalAs(UnmanagedType.VariantBool)] get; set; } + + /// Retrieves a list of supported UDF revision levels. + /// + /// List of supported UDF revision levels. Each element of the list is VARIANT. The variant type is VT_I4. The + /// lVal member of the variant contains the revision level. + /// + /// + /// The value is encoded according to the UDF specification, except the variable size is LONG. For example, revision level 1.02 + /// is represented as 0x102. + /// + // https://docs.microsoft.com/en-us/windows/win32/api/imapi2fs/nf-imapi2fs-ifilesystemimage-get_udfrevisionssupported HRESULT + // get_UDFRevisionsSupported( SAFEARRAY **pVal ); + [DispId(31)] + new int[] UDFRevisionsSupported { [return: MarshalAs(UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof(SafeArrayMarshaler))] get; } + + /// Sets the default file system types and the image size based on the current media. + /// An IDiscRecorder2 the identifies the device that contains the current media. + // https://docs.microsoft.com/en-us/windows/win32/api/imapi2fs/nf-imapi2fs-ifilesystemimage-chooseimagedefaults HRESULT + // ChooseImageDefaults( IDiscRecorder2 *discRecorder ); + [DispId(32)] + new void ChooseImageDefaults(IDiscRecorder2 discRecorder); + + /// Sets the default file system types and the image size based on the specified media type. + /// + /// Identifies the physical media type that will receive the burn image. For possible values, see the IMAPI_MEDIA_PHYSICAL_TYPE + /// enumeration type. + /// + // https://docs.microsoft.com/en-us/windows/win32/api/imapi2fs/nf-imapi2fs-ifilesystemimage-chooseimagedefaultsformediatype + // HRESULT ChooseImageDefaultsForMediaType( IMAPI_MEDIA_PHYSICAL_TYPE value ); + [DispId(33)] + new void ChooseImageDefaultsForMediaType(IMAPI_MEDIA_PHYSICAL_TYPE value); + + /// Retrieves the ISO9660 compatibility level to use when creating the result image. + /// Identifies the interchange level of the ISO9660 file system. + /// + /// For a list of supported compatibility levels, call the IFileSystemImage::get_ISO9660InterchangeLevelsSupported method. + /// + // https://docs.microsoft.com/en-us/windows/win32/api/imapi2fs/nf-imapi2fs-ifilesystemimage-get_iso9660interchangelevel HRESULT + // get_ISO9660InterchangeLevel( LONG *pVal ); + [DispId(34)] + new int ISO9660InterchangeLevel { set; get; } + + /// Set maximum number of blocks available based on the capabilities of the recorder. + /// + /// An IDiscRecorder2 interface that identifies the recording device from which you want to set the maximum number of blocks available. + /// + // https://docs.microsoft.com/en-us/windows/win32/api/imapi2fs/nf-imapi2fs-ifilesystemimage-setmaxmediablocksfromdevice HRESULT + // SetMaxMediaBlocksFromDevice( IDiscRecorder2 *discRecorder ); + [DispId(36)] + new void SetMaxMediaBlocksFromDevice(IDiscRecorder2 discRecorder); + + /// Retrieves the UDF revision level of the imported file system image. + /// UDF revision level of the imported file system image. + /// + /// The value is encoded according to the UDF specification, except the variable size is LONG. For example, revision level 1.02 + /// is represented as 0x102. + /// + // https://docs.microsoft.com/en-us/windows/win32/api/imapi2fs/nf-imapi2fs-ifilesystemimage-get_udfrevision HRESULT + // get_UDFRevision( LONG *pVal ); + [DispId(37)] + new int UDFRevision { set; get; } + + /// Retrieves the supported ISO9660 compatibility levels. + /// + /// List of supported ISO9660 compatibility levels. Each item in the list is a VARIANT that identifies one supported interchange + /// level. The variant type is VT_UI4. The ulVal member of the variant contains the compatibility level. + /// + // https://docs.microsoft.com/en-us/windows/win32/api/imapi2fs/nf-imapi2fs-ifilesystemimage-get_iso9660interchangelevelssupported + // HRESULT get_ISO9660InterchangeLevelsSupported( SAFEARRAY **pVal ); + [DispId(38)] + new uint[] ISO9660InterchangeLevelsSupported { [return: MarshalAs(UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof(SafeArrayMarshaler))] get; } + + /// Retrieves the list of multi-session interfaces for the optical media. + /// + /// List of multi-session interfaces for the optical media. Each element of the list is a VARIANT of type + /// VT_Dispatch. Query the pdispVal member of the variant for the IMultisession interface. + /// + /// + /// Query the IMultisession interface for a derived IMultisession interface, for example, the IMultisessionSequential interface. + /// + // https://docs.microsoft.com/en-us/windows/win32/api/imapi2fs/nf-imapi2fs-ifilesystemimage-get_multisessioninterfaces HRESULT + // get_MultisessionInterfaces( SAFEARRAY **pVal ); + [DispId(40)] + new IMultisession[] MultisessionInterfaces { [return: MarshalAs(UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof(SafeArrayMarshaler))] get; set; } + + /// Retrieves the boot option array that will be utilized to generate the file system image. + /// + /// Pointer to a boot option array that contains a list of IBootOptions interfaces of boot images used to generate the file + /// system image. Each element of the list is a VARIANT of type VT_DISPATCH. + /// + /// + /// The SAFEARRAY will be a one-dimensional array. If a boot image is not specified, a zero-sized array will be returned. + /// + // https://docs.microsoft.com/en-us/windows/win32/api/imapi2fs/nf-imapi2fs-ifilesystemimage2-get_bootimageoptionsarray HRESULT + // get_BootImageOptionsArray( SAFEARRAY **pVal ); + [DispId(60)] + IBootOptions[] BootImageOptionsArray { [return: MarshalAs(UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof(SafeArrayMarshaler))] get; } + } + + /// + /// Use this interface to set or check the metadata and metadata mirror files in a UDF file system (rev 2.50 and later) to determine redundancy. + /// + /// + /// + /// If the metadata and metadata mirror files are set for redundancy, IMAPI creates identical copies of each in the file system + /// image, which results in increased level of fault tolerance. In a scenario where the metadata files are not set for redundancy, + /// IMAPI only creates a single copy in the file system image, which can save several MB of space on the burned disc. + /// + /// The metadata redundancy option is set to TRUE by default. + /// IFileSystemImage3 is the default interface of MsftFileSystemImage3 objects. + /// + /// This interface 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/imapi2fs/nn-imapi2fs-ifilesystemimage3 + [PInvokeData("imapi2fs.h", MSDNShortId = "NN:imapi2fs.IFileSystemImage3")] + [ComImport, Guid("7CFF842C-7E97-4807-8304-910DD8F7C051"), InterfaceType(ComInterfaceType.InterfaceIsDual), CoClass(typeof(MsftFileSystemImage))] + public interface IFileSystemImage3 : IFileSystemImage2 + { + /// Retrieves the root directory item. + /// An IFsiDirectoryItem interface of the root directory item. + // https://docs.microsoft.com/en-us/windows/win32/api/imapi2fs/nf-imapi2fs-ifilesystemimage-get_root HRESULT get_Root( + // IFsiDirectoryItem **pVal ); + [DispId(0)] + new IFsiDirectoryItem Root { [return: MarshalAs(UnmanagedType.Interface)] get; } + + /// Retrieves the starting block address for the recording session. + /// Starting block address for the recording session. + /// + /// The session starting block can be set in the following ways: + /// + /// + /// Importing a file system automatically sets the session starting block. + /// + /// + /// If the previous session is not imported, the client can call IFileSystemImage::put_SessionStartBlock to set this property. + /// + /// + /// + // https://docs.microsoft.com/en-us/windows/win32/api/imapi2fs/nf-imapi2fs-ifilesystemimage-get_sessionstartblock HRESULT + // get_SessionStartBlock( LONG *pVal ); + [DispId(1)] + new int SessionStartBlock { get; set; } + + /// Retrieves the maximum number of blocks available for the image. + /// Number of blocks to use in creating the file system image. + // https://docs.microsoft.com/en-us/windows/win32/api/imapi2fs/nf-imapi2fs-ifilesystemimage-get_freemediablocks HRESULT + // get_FreeMediaBlocks( LONG *pVal ); + [DispId(2)] + new int FreeMediaBlocks { get; set; } + + /// Retrieves the number of blocks in use. + /// Estimated number of blocks used in the file-system image. + // https://docs.microsoft.com/en-us/windows/win32/api/imapi2fs/nf-imapi2fs-ifilesystemimage-get_usedblocks HRESULT + // get_UsedBlocks( LONG *pVal ); + [DispId(3)] + new int UsedBlocks { get; } + + /// Retrieves or sets the volume name for this file system image. + /// String that contains the volume name for this file system image. + /// To set the volume name, call the IFileSystemImage::put_VolumeName method. + // https://docs.microsoft.com/en-us/windows/win32/api/imapi2fs/nf-imapi2fs-ifilesystemimage-get_volumename HRESULT + // get_VolumeName( BSTR *pVal ); + [DispId(4)] + new string VolumeName { [return: MarshalAs(UnmanagedType.BStr)] get; set; } + + /// Retrieves the volume name provided from an imported file system. + /// + /// String that contains the volume name provided from an imported file system. Is NULL until a file system is imported. + /// + /// + /// The imported volume name is provided for user information and is not automatically carried forward to subsequent sessions. + /// + // https://docs.microsoft.com/en-us/windows/win32/api/imapi2fs/nf-imapi2fs-ifilesystemimage-get_importedvolumename HRESULT + // get_ImportedVolumeName( BSTR *pVal ); + [DispId(5)] + new string ImportedVolumeName { [return: MarshalAs(UnmanagedType.BStr)] get; } + + /// Retrieves the boot image that you want to add to the file system image. + /// An IBootOptions interface of the boot image to add to the disc. Is NULL if a boot image has not been specified. + // https://docs.microsoft.com/en-us/windows/win32/api/imapi2fs/nf-imapi2fs-ifilesystemimage-get_bootimageoptions HRESULT + // get_BootImageOptions( IBootOptions **pVal ); + [DispId(6)] + new IBootOptions BootImageOptions { [return: MarshalAs(UnmanagedType.Interface)] get; set; } + + /// Retrieves the number of files in the file system image. + /// Number of files in the file system image. + // https://docs.microsoft.com/en-us/windows/win32/api/imapi2fs/nf-imapi2fs-ifilesystemimage-get_filecount HRESULT get_FileCount( + // LONG *pVal ); + [DispId(7)] + new int FileCount { get; } + + /// Retrieves the number of directories in the file system image. + /// Number of directories in the file system image. + // https://docs.microsoft.com/en-us/windows/win32/api/imapi2fs/nf-imapi2fs-ifilesystemimage-get_directorycount HRESULT + // get_DirectoryCount( LONG *pVal ); + [DispId(8)] + new int DirectoryCount { get; } + + /// Retrieves the temporary directory in which stash files are built. + /// String that contains the path to the temporary directory. + // https://docs.microsoft.com/en-us/windows/win32/api/imapi2fs/nf-imapi2fs-ifilesystemimage-get_workingdirectory HRESULT + // get_WorkingDirectory( BSTR *pVal ); + [DispId(9)] + new string WorkingDirectory { [return: MarshalAs(UnmanagedType.BStr)] get; set; } + + /// Retrieves the change point identifier. + /// Change point identifier. The identifier is a count of the changes to the file system image since its inception. + /// + /// + /// An application can store the value of this property prior to making a change to the file system, then at a later point pass + /// the value to the IFileSystemImage::RollbackToChangePoint method to revert changes since that point in development. + /// + /// + /// An application can call the IFileSystemImage::LockInChangePoint method to lock the state of a file system image at any point + /// in its development. Once a lock is set, you cannot call RollbackToChangePoint to revert the file system image to its earlier state. + /// + /// + // https://docs.microsoft.com/en-us/windows/win32/api/imapi2fs/nf-imapi2fs-ifilesystemimage-get_changepoint HRESULT + // get_ChangePoint( LONG *pVal ); + [DispId(10)] + new int ChangePoint { get; } + + /// Determines the compliance level for creating and developing the file-system image. + /// + /// Is VARIANT_TRUE if the file system images are created in strict compliance with applicable standards. + /// Is VARIANT_FALSE if the compliance standards are relaxed to be compatible with IMAPI version 1.0. + /// + // https://docs.microsoft.com/en-us/windows/win32/api/imapi2fs/nf-imapi2fs-ifilesystemimage-get_strictfilesystemcompliance + // HRESULT get_StrictFileSystemCompliance( VARIANT_BOOL *pVal ); + [DispId(11)] + new bool StrictFileSystemCompliance { [return: MarshalAs(UnmanagedType.VariantBool)] get; set; } + + /// Determines if the file and directory names use a restricted character. + /// + /// Is VARIANT_TRUE if the file and directory names to add to the file system image must consist of characters that map directly + /// to CP_ANSI (code points 32 through 127). Otherwise, VARIANT_FALSE. + /// + // https://docs.microsoft.com/en-us/windows/win32/api/imapi2fs/nf-imapi2fs-ifilesystemimage-get_userestrictedcharacterset + // HRESULT get_UseRestrictedCharacterSet( VARIANT_BOOL *pVal ); + [DispId(12)] + new bool UseRestrictedCharacterSet { [return: MarshalAs(UnmanagedType.VariantBool)] get; set; } + + /// Retrieves the types of file systems to create when generating the result stream. + /// + /// One or more file system types to create when generating the result stream. For possible values, see the FsiFileSystems + /// enumeration type. + /// + /// + /// + /// To specify the file system types, call the IFileSystemImage::put_FileSystemsToCreate method. You could also call either + /// IFilesystemImage::ChooseImageDefaults or IFilesystemImage::ChooseImageDefaultsForMediaType to have IMAPI choose the file + /// system for you. + /// + /// To retrieve a list of supported file system types, call the IFileSystemImage::get_FileSystemsSupported method. + /// + // https://docs.microsoft.com/en-us/windows/win32/api/imapi2fs/nf-imapi2fs-ifilesystemimage-get_filesystemstocreate HRESULT + // get_FileSystemsToCreate( FsiFileSystems *pVal ); + [DispId(13)] + new FsiFileSystems FileSystemsToCreate { get; set; } + + /// Retrieves the list of file system types that a client can use to build a file system image. + /// + /// One or more file system types that a client can use to build a file system image. For possible values, see the + /// FsiFileSystems enumeration type. + /// + // https://docs.microsoft.com/en-us/windows/win32/api/imapi2fs/nf-imapi2fs-ifilesystemimage-get_filesystemssupported HRESULT + // get_FileSystemsSupported( FsiFileSystems *pVal ); + [DispId(14)] + new FsiFileSystems FileSystemsSupported { get; } + + /// Create the result object that contains the file system and file data. + /// + /// An IFileSystemImageResult interface of the image result. + /// Client applications can stream the image to media or other long-term storage devices, such as disk drives. + /// + /// + /// + /// Currently, IFileSystemImage::CreateResultImage will require disc media access as a result of a previous + /// IFileSystemImage::IdentifyFileSystemsOnDisc method call. To resolve this issue, it is recommended that another + /// IFileSystemImage object be created specifically for the IFileSystemImage::IdentifyFileSystemsOnDisc operation. + /// + /// + /// The resulting stream can be saved as an ISO file if the file system is generated in a single session and has a start address + /// of zero. + /// + /// + // https://docs.microsoft.com/en-us/windows/win32/api/imapi2fs/nf-imapi2fs-ifilesystemimage-createresultimage HRESULT + // CreateResultImage( IFileSystemImageResult **resultStream ); + [DispId(15)] + new IFileSystemImageResult CreateResultImage(); + + /// Checks for the existence of a given file or directory. + /// String that contains the fully qualified path of the directory or file to check. + /// + /// Indicates if the item is a file, a directory, or does not exist. For possible values, see the FsiItemType enumeration type. + /// + // https://docs.microsoft.com/en-us/windows/win32/api/imapi2fs/nf-imapi2fs-ifilesystemimage-exists HRESULT Exists( BSTR + // fullPath, FsiItemType *itemType ); + [DispId(16)] + new FsiItemType Exists([MarshalAs(UnmanagedType.BStr)] string fullPath); + + /// Retrieves a string that identifies a disc and the sessions recorded on the disc. + /// + /// String that contains a signature that identifies the disc and the sessions on it. This string is not guaranteed to be unique + /// between discs. + /// + /// + /// + /// When layering sessions on a disc, the signature acts as a key that the client can use to ensure the session order, and to + /// distinguish sessions on disc from session images that will be laid on the disc. + /// + /// You must call IFileSystemImage::put_MultisessionInterfaces prior to calling CalculateDiscIdentifier. + /// + // https://docs.microsoft.com/en-us/windows/win32/api/imapi2fs/nf-imapi2fs-ifilesystemimage-calculatediscidentifier HRESULT + // CalculateDiscIdentifier( BSTR *discIdentifier ); + [DispId(18)] + [return: MarshalAs(UnmanagedType.BStr)] + new string CalculateDiscIdentifier(); + + /// Retrieves a list of the different types of file systems on the optical media. + /// + /// An IDiscRecorder2 interface that identifies the recording device that contains the media. If this parameter is NULL, + /// the discRecorder specified in IMultisession will be used. + /// + /// One or more files systems on the disc. For possible values, see FsiFileSystems enumeration type. + /// + /// Client applications can call IFileSystemImage::GetDefaultFileSystemForImport with the value returned by this method to + /// determine the type of file system to import. + /// + // https://docs.microsoft.com/en-us/windows/win32/api/imapi2fs/nf-imapi2fs-ifilesystemimage-identifyfilesystemsondisc HRESULT + // IdentifyFileSystemsOnDisc( IDiscRecorder2 *discRecorder, FsiFileSystems *fileSystems ); + [DispId(19)] + new FsiFileSystems IdentifyFileSystemsOnDisc(IDiscRecorder2 discRecorder); + + /// Retrieves the file system to import by default. + /// One or more file system values. For possible values, see the FsiFileSystems enumeration type. + /// + /// A single file system value that identifies the default file system. The value is one of the file systems specified in fileSystems + /// + /// + /// Use this method to identify the default file system to use with IFileSystemImage::ImportFileSystem. + /// To identify the supported file systems, call the IFileSystemImage::get_FileSystemsSupported method. + /// + // https://docs.microsoft.com/en-us/windows/win32/api/imapi2fs/nf-imapi2fs-ifilesystemimage-getdefaultfilesystemforimport + // HRESULT GetDefaultFileSystemForImport( FsiFileSystems fileSystems, FsiFileSystems *importDefault ); + [DispId(20)] + new FsiFileSystems GetDefaultFileSystemForImport(FsiFileSystems fileSystems); + + /// Imports the default file system on the current disc. + /// Identifies the imported file system. For possible values, see the FsiFileSystems enumeration type. + /// + /// + /// You must call IFileSystemImage::put_MultisessionInterfaces prior to calling IFileSystemImage::ImportFileSystem. + /// Additionally, it is recommended that IDiscFormat2::get_MediaHeuristicallyBlank is called before + /// IFileSystemImage::put_MultisessionInterfaces to verify that the media is not blank. + /// + /// + /// If the disc contains more than one file system, only one file system is imported. This method chooses the file system to + /// import in the following order: UDF, Joliet, ISO 9660. The import includes transferring directories and files to the + /// in-memory file system structure. + /// + /// + /// You may call this method at any time during the construction of the in-memory file system. If, during import, a file or + /// directory already exists in the in-memory copy, the in-memory version will be retained; the imported file will be discarded. + /// + /// + /// To determine which file system is the default file system for the disc, call the + /// IFileSystemImage::GetDefaultFileSystemForImport method. + /// + /// + /// This method only reads the file information. If the item is a file, the file data is copied when calling + /// IFsiDirectoryItem::AddFile, IFsiDirectoryItem::AddTree, or IFsiDirectoryItem::Add method. + /// + /// + /// This method returns IMAPI_E_NO_SUPPORTED_FILE_SYSTEM if a supported file system is not found in the last session. + /// Additionally, this method returns IMAPI_E_INCOMPATIBLE_PREVIOUS_SESSION if the layout of the file system in the last + /// session is incompatible with the layout used by IMAPI for the creation of requested file systems for the result image. For + /// more details see the IFileSystemImage::put_FileSystemsToCreate method documention. + /// + /// + // https://docs.microsoft.com/en-us/windows/win32/api/imapi2fs/nf-imapi2fs-ifilesystemimage-importfilesystem HRESULT + // ImportFileSystem( FsiFileSystems *importedFileSystem ); + [DispId(21)] + new FsiFileSystems ImportFileSystem(); + + /// Import a specific file system from disc. + /// + /// Identifies the file system to import. For possible values, see the FsiFileSystems enumeration type. + /// + /// + /// + /// You must call IFileSystemImage::put_MultisessionInterfaces prior to calling + /// IFileSystemImage::ImportSpecificFileSystem. Additionally, it is recommended that + /// IDiscFormat2::get_MediaHeuristicallyBlank is called before IFileSystemImage::put_MultisessionInterfaces to verify + /// that the media is not blank. + /// + /// + /// You may call this method at any time during the construction of the in-memory file system. If, during import, a file or + /// directory already exists in the in-memory copy, the in-memory version will be retained; the imported file will be discarded. + /// + /// + /// On re-writable media (DVD+/-RW, DVDRAM, BD-RE), import or burning a second session is not support if the first session has + /// an ISO9660 file system, due to file system limitations. + /// + /// + /// This method only reads the file information. If the item is a file, the file data is copied when calling + /// IFsiDirectoryItem::AddFile, IFsiDirectoryItem::AddTree, or IFsiDirectoryItem::Add method. + /// + /// + /// this method returns IMAPI_E_INCOMPATIBLE_PREVIOUS_SESSION if the layout of the file system in the last session is + /// incompatible with the layout used by IMAPI for the creation of requested file systems for the result image. For more details + /// see the IFileSystemImage::put_FileSystemsToCreate method documention. If the file system specified by fileSystemToUse has + /// not been found, this method returns IMAPI_E_FILE_SYSTEM_NOT_FOUND. + /// + /// + // https://docs.microsoft.com/en-us/windows/win32/api/imapi2fs/nf-imapi2fs-ifilesystemimage-importspecificfilesystem HRESULT + // ImportSpecificFileSystem( FsiFileSystems fileSystemToUse ); + [DispId(22)] + new void ImportSpecificFileSystem(FsiFileSystems fileSystemToUse); + + /// Reverts the image back to the specified change point. + /// Change point that identifies the target state for rollback. + /// + /// + /// Typically, an application calls the IFileSystemImage::get_ChangePoint method and stores the change point value prior to + /// making a change to the file system. If necessary, you can pass the change point value to this method to revert changes since + /// that point in development. + /// + /// + /// An application can call the IFileSystemImage::LockInChangePoint method to lock the state of a file system image at any point + /// in its development. After a lock is set, you cannot call this method to revert the file system image to its earlier state. + /// + /// + // https://docs.microsoft.com/en-us/windows/win32/api/imapi2fs/nf-imapi2fs-ifilesystemimage-rollbacktochangepoint HRESULT + // RollbackToChangePoint( LONG changePoint ); + [DispId(23)] + new void RollbackToChangePoint(int changePoint); + + /// Locks the file system information at the current change-point level. + /// + /// Once the change point is locked, rollback to earlier change points is not permitted. + /// Locking the change point does not change the IFileSystemImage::get_ChangePoint property. + /// + // https://docs.microsoft.com/en-us/windows/win32/api/imapi2fs/nf-imapi2fs-ifilesystemimage-lockinchangepoint HRESULT LockInChangePoint(); + [DispId(24)] + new void LockInChangePoint(); + + /// Create a directory item with the specified name. + /// String that contains the name of the directory item to create. + /// + /// An IFsiDirectoryItem interface of the new directory item. When done, call the IFsiDirectoryItem::Release method to + /// release the interface. + /// + /// + /// After setting properties on the IFsiDirectoryItem interface, call the IFsiDirectoryItem::Add method on the parent directory + /// item to add it to the file system image. + /// + // https://docs.microsoft.com/en-us/windows/win32/api/imapi2fs/nf-imapi2fs-ifilesystemimage-createdirectoryitem HRESULT + // CreateDirectoryItem( BSTR name, IFsiDirectoryItem **newItem ); + [DispId(25)] + new IFsiDirectoryItem CreateDirectoryItem([MarshalAs(UnmanagedType.BStr)] string name); + + /// Create a file item with the specified name. + /// String that contains the name of the file item to create. + /// + /// An IFsiFileItem interface of the new file item. When done, call the IFsiFileItem::Release method to release the interface. + /// + /// + /// After setting properties on the IFsiFileItem interface, call the IFsiDirectoryItem::Add method on the parent directory item + /// to add it to the file system image. + /// + // https://docs.microsoft.com/en-us/windows/win32/api/imapi2fs/nf-imapi2fs-ifilesystemimage-createfileitem HRESULT + // CreateFileItem( BSTR name, IFsiFileItem **newItem ); + [DispId(26)] + new IFsiFileItem CreateFileItem([MarshalAs(UnmanagedType.BStr)] string name); + + /// Retrieves the volume name for the UDF system image. + /// String that contains the volume name for the UDF system image. + // https://docs.microsoft.com/en-us/windows/win32/api/imapi2fs/nf-imapi2fs-ifilesystemimage-get_volumenameudf HRESULT + // get_VolumeNameUDF( BSTR *pVal ); + [DispId(27)] + new string VolumeNameUDF { [return: MarshalAs(UnmanagedType.BStr)] get; } + + /// Retrieves the volume name for the Joliet system image. + /// String that contains the volume name for the Joliet system image. + // https://docs.microsoft.com/en-us/windows/win32/api/imapi2fs/nf-imapi2fs-ifilesystemimage-get_volumenamejoliet HRESULT + // get_VolumeNameJoliet( BSTR *pVal ); + [DispId(28)] + new string VolumeNameJoliet { [return: MarshalAs(UnmanagedType.BStr)] get; } + + /// Retrieves the volume name for the ISO9660 system image. + /// String that contains the volume name for the ISO9660 system image. + // https://docs.microsoft.com/en-us/windows/win32/api/imapi2fs/nf-imapi2fs-ifilesystemimage-get_volumenameiso9660 HRESULT + // get_VolumeNameISO9660( BSTR *pVal ); + [DispId(29)] + new string VolumeNameISO9660 { [return: MarshalAs(UnmanagedType.BStr)] get; } + + /// Indicates if the files being added to the file system image should be staged before the burn. + /// + /// VARIANT_TRUE if the files being added to the file system image are required to be stageded in one or more stage files + /// before burning. Otherwise, VARIANT_FALSE is returned if IMAPI is permitted to optimize the image creation process by + /// not staging the files being added to the file system image. + /// + /// + /// + /// "Staging" is a process in which an image is created on the hard-drive, containing all files to be burned, prior to the + /// initiation of the burn operation. + /// + /// + /// Setting this this property to VARIANT_TRUE via IFileSystemImage::put_StageFiles will only affect files that are added + /// after the property is set: those files will always be staged. Files that were not staged prior to a specified property value + /// of VARIANT_TRUE, will not be staged. + /// + /// By specifying VARIANT_FALSE, the file system image creation process is optimized in two ways: + /// + /// + /// Less time is required for image generation + /// + /// + /// Less space is consumed on a local disk by IMAPI + /// + /// + /// + /// However, in order to avoid buffer underrun problems during burning, a certain minimum throughput is required for read + /// operations on non-staged files. In the event that file accessibility or throughput may not meet the requirements of the + /// burner, IMAPI enforces file staging regardless of the specified property value. For example, file staging is enforced for + /// source files from removable storage devices, such as USB Flash Disk. + /// + /// + // https://docs.microsoft.com/en-us/windows/win32/api/imapi2fs/nf-imapi2fs-ifilesystemimage-get_stagefiles HRESULT + // get_StageFiles( VARIANT_BOOL *pVal ); + [DispId(30)] + new bool StageFiles { [return: MarshalAs(UnmanagedType.VariantBool)] get; set; } + + /// Retrieves a list of supported UDF revision levels. + /// + /// List of supported UDF revision levels. Each element of the list is VARIANT. The variant type is VT_I4. The + /// lVal member of the variant contains the revision level. + /// + /// + /// The value is encoded according to the UDF specification, except the variable size is LONG. For example, revision level 1.02 + /// is represented as 0x102. + /// + // https://docs.microsoft.com/en-us/windows/win32/api/imapi2fs/nf-imapi2fs-ifilesystemimage-get_udfrevisionssupported HRESULT + // get_UDFRevisionsSupported( SAFEARRAY **pVal ); + [DispId(31)] + new int[] UDFRevisionsSupported { [return: MarshalAs(UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof(SafeArrayMarshaler))] get; } + + /// Sets the default file system types and the image size based on the current media. + /// An IDiscRecorder2 the identifies the device that contains the current media. + // https://docs.microsoft.com/en-us/windows/win32/api/imapi2fs/nf-imapi2fs-ifilesystemimage-chooseimagedefaults HRESULT + // ChooseImageDefaults( IDiscRecorder2 *discRecorder ); + [DispId(32)] + new void ChooseImageDefaults(IDiscRecorder2 discRecorder); + + /// Sets the default file system types and the image size based on the specified media type. + /// + /// Identifies the physical media type that will receive the burn image. For possible values, see the IMAPI_MEDIA_PHYSICAL_TYPE + /// enumeration type. + /// + // https://docs.microsoft.com/en-us/windows/win32/api/imapi2fs/nf-imapi2fs-ifilesystemimage-chooseimagedefaultsformediatype + // HRESULT ChooseImageDefaultsForMediaType( IMAPI_MEDIA_PHYSICAL_TYPE value ); + [DispId(33)] + new void ChooseImageDefaultsForMediaType(IMAPI_MEDIA_PHYSICAL_TYPE value); + + /// Retrieves the ISO9660 compatibility level to use when creating the result image. + /// Identifies the interchange level of the ISO9660 file system. + /// + /// For a list of supported compatibility levels, call the IFileSystemImage::get_ISO9660InterchangeLevelsSupported method. + /// + // https://docs.microsoft.com/en-us/windows/win32/api/imapi2fs/nf-imapi2fs-ifilesystemimage-get_iso9660interchangelevel HRESULT + // get_ISO9660InterchangeLevel( LONG *pVal ); + [DispId(34)] + new int ISO9660InterchangeLevel { set; get; } + + /// Set maximum number of blocks available based on the capabilities of the recorder. + /// + /// An IDiscRecorder2 interface that identifies the recording device from which you want to set the maximum number of blocks available. + /// + // https://docs.microsoft.com/en-us/windows/win32/api/imapi2fs/nf-imapi2fs-ifilesystemimage-setmaxmediablocksfromdevice HRESULT + // SetMaxMediaBlocksFromDevice( IDiscRecorder2 *discRecorder ); + [DispId(36)] + new void SetMaxMediaBlocksFromDevice(IDiscRecorder2 discRecorder); + + /// Retrieves the UDF revision level of the imported file system image. + /// UDF revision level of the imported file system image. + /// + /// The value is encoded according to the UDF specification, except the variable size is LONG. For example, revision level 1.02 + /// is represented as 0x102. + /// + // https://docs.microsoft.com/en-us/windows/win32/api/imapi2fs/nf-imapi2fs-ifilesystemimage-get_udfrevision HRESULT + // get_UDFRevision( LONG *pVal ); + [DispId(37)] + new int UDFRevision { set; get; } + + /// Retrieves the supported ISO9660 compatibility levels. + /// + /// List of supported ISO9660 compatibility levels. Each item in the list is a VARIANT that identifies one supported interchange + /// level. The variant type is VT_UI4. The ulVal member of the variant contains the compatibility level. + /// + // https://docs.microsoft.com/en-us/windows/win32/api/imapi2fs/nf-imapi2fs-ifilesystemimage-get_iso9660interchangelevelssupported + // HRESULT get_ISO9660InterchangeLevelsSupported( SAFEARRAY **pVal ); + [DispId(38)] + new uint[] ISO9660InterchangeLevelsSupported { [return: MarshalAs(UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof(SafeArrayMarshaler))] get; } + + /// Retrieves the list of multi-session interfaces for the optical media. + /// + /// List of multi-session interfaces for the optical media. Each element of the list is a VARIANT of type + /// VT_Dispatch. Query the pdispVal member of the variant for the IMultisession interface. + /// + /// + /// Query the IMultisession interface for a derived IMultisession interface, for example, the IMultisessionSequential interface. + /// + // https://docs.microsoft.com/en-us/windows/win32/api/imapi2fs/nf-imapi2fs-ifilesystemimage-get_multisessioninterfaces HRESULT + // get_MultisessionInterfaces( SAFEARRAY **pVal ); + [DispId(40)] + new IMultisession[] MultisessionInterfaces { [return: MarshalAs(UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof(SafeArrayMarshaler))] get; set; } + + /// Retrieves the boot option array that will be utilized to generate the file system image. + /// + /// Pointer to a boot option array that contains a list of IBootOptions interfaces of boot images used to generate the file + /// system image. Each element of the list is a VARIANT of type VT_DISPATCH. + /// + /// + /// The SAFEARRAY will be a one-dimensional array. If a boot image is not specified, a zero-sized array will be returned. + /// + // https://docs.microsoft.com/en-us/windows/win32/api/imapi2fs/nf-imapi2fs-ifilesystemimage2-get_bootimageoptionsarray HRESULT + // get_BootImageOptionsArray( SAFEARRAY **pVal ); + [DispId(60)] + new IBootOptions[] BootImageOptionsArray { [return: MarshalAs(UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof(SafeArrayMarshaler))] get; } + + /// Retrieves a property value that specifies if the UDF Metadata will be redundant in the file system image. + /// + /// Pointer to a value that specifies if the UDF metadata is redundant in the resultant file system image. A value of + /// VARIANT_TRUE indicates that UDF metadata will be redundant; otherwise, VARIANT_FALSE. + /// + /// + /// This method 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/imapi2fs/nf-imapi2fs-ifilesystemimage3-get_createredundantudfmetadatafiles + // HRESULT get_CreateRedundantUdfMetadataFiles( VARIANT_BOOL *pVal ); + [DispId(61)] + bool CreateRedundantUdfMetadataFiles { [return: MarshalAs(UnmanagedType.VariantBool)] get; set; } + + /// Determines if a specific file system on the current media is appendable through the IMAPI. + /// The file system on the current media to probe. + /// A VARIANT_BOOL value specifying if the specified file system is appendable. + /// + /// This method 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/imapi2fs/nf-imapi2fs-ifilesystemimage3-probespecificfilesystem HRESULT + // ProbeSpecificFileSystem( FsiFileSystems fileSystemToProbe, VARIANT_BOOL *isAppendable ); + [DispId(70)] + [return: MarshalAs(UnmanagedType.VariantBool)] + bool ProbeSpecificFileSystem(FsiFileSystems fileSystemToProbe); + } + + /// + /// Use this interface to get information about the burn image, the image data stream, and progress information. + /// To get this interface, call the IFileSystemImage::CreateResultImage method. + /// + /// This is an FileSystemImageResult object in script. + // https://docs.microsoft.com/en-us/windows/win32/api/imapi2fs/nn-imapi2fs-ifilesystemimageresult + [PInvokeData("imapi2fs.h", MSDNShortId = "NN:imapi2fs.IFileSystemImageResult")] + [ComImport, Guid("2C941FD8-975B-59BE-A960-9A2A262853A5"), InterfaceType(ComInterfaceType.InterfaceIsDual), CoClass(typeof(FileSystemImageResult))] + public interface IFileSystemImageResult + { + /// Retrieves the burn image stream. + /// An IStream interface of the burn image. + // https://docs.microsoft.com/en-us/windows/win32/api/imapi2fs/nf-imapi2fs-ifilesystemimageresult-get_imagestream HRESULT + // get_ImageStream( IStream **pVal ); + [DispId(1)] + IStream ImageStream { get; } + + /// Retrieves the progress item block mapping collection. + /// + /// An IProgressItems interface that contains a collection of progress items. Each progress item identifies the blocks written + /// since the previous progress status was taken. + /// + // https://docs.microsoft.com/en-us/windows/win32/api/imapi2fs/nf-imapi2fs-ifilesystemimageresult-get_progressitems HRESULT + // get_ProgressItems( IProgressItems **pVal ); + [DispId(2)] + IProgressItems ProgressItems { get; } + + /// Retrieves the number of blocks in the result image. + /// Number of blocks to burn on the disc. + // https://docs.microsoft.com/en-us/windows/win32/api/imapi2fs/nf-imapi2fs-ifilesystemimageresult-get_totalblocks HRESULT + // get_TotalBlocks( LONG *pVal ); + [DispId(3)] + int TotalBlocks { get; } + + /// Retrieves the size, in bytes, of a block of data. + /// Number of bytes in a block. + // https://docs.microsoft.com/en-us/windows/win32/api/imapi2fs/nf-imapi2fs-ifilesystemimageresult-get_blocksize HRESULT + // get_BlockSize( LONG *pVal ); + [DispId(4)] + int BlockSize { get; } + + /// Retrieves the disc volume name for this file system image. + /// String that contains the volume name for this file system image. + // https://docs.microsoft.com/en-us/windows/win32/api/imapi2fs/nf-imapi2fs-ifilesystemimageresult-get_discid HRESULT get_DiscId( + // BSTR *pVal ); + [DispId(5)] + string DiscId { [return: MarshalAs(UnmanagedType.BStr)] get; } + } + + /// + /// The IFileSystemImageResult2 interface allows the data recorder object to retrieve information about modified blocks in + /// images created for rewritable discs. Alternatively, IUnknown::QueryInterface can be called on the object returned by + /// IFileSystemImageResult::get_ImageStream to get the IBlockRangeList interface providing this information. + /// + /// + /// When the file system image object is used to append data to a rewritable disc, the result image contains both the previous + /// logical session and the new additions. The result image represents the binary data that must be recorded to disc starting from + /// sector 0 to get a disc containing both old and new files. However, the previous logical session remains mostly intact during + /// addition of new files, so the burn time can be substantially optimized by recording only the sectors that are new or have been modified. + /// + // https://docs.microsoft.com/en-us/windows/win32/api/imapi2fs/nn-imapi2fs-ifilesystemimageresult2 + [PInvokeData("imapi2fs.h", MSDNShortId = "NN:imapi2fs.IFileSystemImageResult2")] + [ComImport, Guid("B507CA29-2204-11DD-966A-001AA01BBC58"), InterfaceType(ComInterfaceType.InterfaceIsDual), CoClass(typeof(FileSystemImageResult))] + public interface IFileSystemImageResult2 : IFileSystemImageResult + { + /// Retrieves the burn image stream. + /// An IStream interface of the burn image. + // https://docs.microsoft.com/en-us/windows/win32/api/imapi2fs/nf-imapi2fs-ifilesystemimageresult-get_imagestream HRESULT + // get_ImageStream( IStream **pVal ); + [DispId(1)] + new IStream ImageStream { get; } + + /// Retrieves the progress item block mapping collection. + /// + /// An IProgressItems interface that contains a collection of progress items. Each progress item identifies the blocks written + /// since the previous progress status was taken. + /// + // https://docs.microsoft.com/en-us/windows/win32/api/imapi2fs/nf-imapi2fs-ifilesystemimageresult-get_progressitems HRESULT + // get_ProgressItems( IProgressItems **pVal ); + [DispId(2)] + new IProgressItems ProgressItems { get; } + + /// Retrieves the number of blocks in the result image. + /// Number of blocks to burn on the disc. + // https://docs.microsoft.com/en-us/windows/win32/api/imapi2fs/nf-imapi2fs-ifilesystemimageresult-get_totalblocks HRESULT + // get_TotalBlocks( LONG *pVal ); + [DispId(3)] + new int TotalBlocks { get; } + + /// Retrieves the size, in bytes, of a block of data. + /// Number of bytes in a block. + // https://docs.microsoft.com/en-us/windows/win32/api/imapi2fs/nf-imapi2fs-ifilesystemimageresult-get_blocksize HRESULT + // get_BlockSize( LONG *pVal ); + [DispId(4)] + new int BlockSize { get; } + + /// Retrieves the disc volume name for this file system image. + /// String that contains the volume name for this file system image. + // https://docs.microsoft.com/en-us/windows/win32/api/imapi2fs/nf-imapi2fs-ifilesystemimageresult-get_discid HRESULT get_DiscId( + // BSTR *pVal ); + [DispId(5)] + new string DiscId { [return: MarshalAs(UnmanagedType.BStr)] get; } + + /// Retrieves the list of modified blocks in the result image. + /// Pointer to an IBlockRangeList interface representing the modified block ranges in the result image. + /// + /// This method returns E_NOTIMPL if the entire result image must be recorded. If this method returns a successful return + /// code, it is sufficient to record only the sectors described by IBlockRangeList returned in pVal. It is highly recommended to + /// record the sector ranges in exactly the same order as they are listed in IBlockRangeList. + /// + // https://docs.microsoft.com/en-us/windows/win32/api/imapi2fs/nf-imapi2fs-ifilesystemimageresult2-get_modifiedblocks HRESULT + // get_ModifiedBlocks( IBlockRangeList **pVal ); + [DispId(6)] + IBlockRangeList ModifiedBlocks { [return: MarshalAs(UnmanagedType.Interface)] get; } + } + + /// + /// Use this interface to add items to or remove items from the file-system image. + /// To get this interface, call the IFileSystemImage::CreateDirectoryItem method. + /// + /// + /// Each directory item contains an enumerable collection of child items within the directory. + /// You can add and remove files and directories only after the directory item has been added to the file system image. + /// This is an FsiDirectoryItem object in script. + /// + // https://docs.microsoft.com/en-us/windows/win32/api/imapi2fs/nn-imapi2fs-ifsidirectoryitem + [PInvokeData("imapi2fs.h", MSDNShortId = "NN:imapi2fs.IFsiDirectoryItem")] + [ComImport, Guid("2C941FDC-975B-59BE-A960-9A2A262853A5"), InterfaceType(ComInterfaceType.InterfaceIsDual), CoClass(typeof(FsiDirectoryItem))] + public interface IFsiDirectoryItem : IFsiItem, IEnumerable + { + /// Retrieves the name of the directory or file item in the file system image. + /// String that contains the name of the file or directory item in the file system image. + /// To get the full path to the item, call the IFsiItem::get_FullPath method. + // https://docs.microsoft.com/en-us/windows/win32/api/imapi2fs/nf-imapi2fs-ifsiitem-get_name HRESULT get_Name( BSTR *pVal ); + [DispId(11)] + new string Name { [return: MarshalAs(UnmanagedType.BStr)] get; } + + /// Retrieves the full path of the file or directory item in the file system image. + /// String that contains the absolute path of the file or directory item in the file system image. + // https://docs.microsoft.com/en-us/windows/win32/api/imapi2fs/nf-imapi2fs-ifsiitem-get_fullpath HRESULT get_FullPath( BSTR + // *pVal ); + [DispId(12)] + new string FullPath { [return: MarshalAs(UnmanagedType.BStr)] get; } + + /// Gets or sets the date and time that the directory or file item was created and added to the file system image. + /// + /// Date and time that the directory or file item was created and added to the file system image, according to UTC time. + /// Defaults to the time the item was added to the image. + /// + /// + /// IMAPI does not support the extended attribute for CreationTime, and as a result, UDFS populates the CreationTime with the + /// value expressed by the LastAccessed property from the file entry. + /// + // https://docs.microsoft.com/en-us/windows/win32/api/imapi2fs/nf-imapi2fs-ifsiitem-put_creationtime HRESULT put_CreationTime( + // DATE newVal ); + [DispId(13)] + new DateTime CreationTime { get; set; } + + /// Gets or sets the date and time that the directory or file item was last accessed in the file system image. + /// + /// Date and time that the directory or file item was last accessed in the file system image, according to UTC time. Defaults to + /// the time the item was added to the image. + /// + /// + /// + /// UDFS (UDF) uses the LastAccessedTime value for the CreationTime, as IMAPI does not currently support the CreationTime + /// extended attribue. + /// + /// + /// CDFS (ISO 9660) sets the LastAccessedTime value to 0, as only the recording time is stored within the File/Directory descriptor. + /// + /// + // https://docs.microsoft.com/en-us/windows/win32/api/imapi2fs/nf-imapi2fs-ifsiitem-put_lastaccessedtime HRESULT + // put_LastAccessedTime( DATE newVal ); + [DispId(14)] + new DateTime LastAccessedTime { get; set; } + + /// Gets or sets the date and time that the item was last modified in the file system image. + /// + /// Date and time that the directory or file item was last modified in the file system image, according to UTC time. Defaults to + /// the time the item was added to the image. + /// + /// + /// + /// The last modified time is propagated to the attribute that users see when viewing the properties of a directory or a file. + /// + /// When implementing this method, a few things should be taken into consideration: + /// UDFS (UDF) will use the value provided by IFsiItem::put_LastModifiedTime as both the CreationTime and LastModifiedTime. + /// + /// CDFS (ISO 9660) uses the date/time of recording as the CreationTime and LastModifiedTime. As a result, CDFS sets the value + /// of LastModifiedTime to 0. + /// + /// + // https://docs.microsoft.com/en-us/windows/win32/api/imapi2fs/nf-imapi2fs-ifsiitem-put_lastmodifiedtime HRESULT + // put_LastModifiedTime( DATE newVal ); + [DispId(15)] + new DateTime LastModifiedTime { get; set; } + + /// Determines if the item's hidden attribute is set in the file system image. + /// + /// Set to VARIANT_TRUE to set the hidden attribute of the item in the file system image; otherwise, VARIANT_FALSE. The default + /// is VARIANT_FALSE. + /// + // https://docs.microsoft.com/en-us/windows/win32/api/imapi2fs/nf-imapi2fs-ifsiitem-put_ishidden HRESULT put_IsHidden( + // VARIANT_BOOL newVal ); + [DispId(16)] + new bool IsHidden { [return: MarshalAs(UnmanagedType.VariantBool)] get; set; } + + /// Retrieves the name of the item as modified to conform to the specified file system. + /// + /// File system to which the name should conform. For possible values, see the FsiFileSystems enumeration type. + /// + /// + /// String that contains the name of the item as it conforms to the specified file system. The name in the IFsiItem::get_Name + /// property is modified if the characters used and its length do not meet the requirements of the specified file system type. + /// + // https://docs.microsoft.com/en-us/windows/win32/api/imapi2fs/nf-imapi2fs-ifsiitem-filesystemname HRESULT FileSystemName( + // FsiFileSystems fileSystem, BSTR *pVal ); + [DispId(17)] + [return: MarshalAs(UnmanagedType.BStr)] + new string FileSystemName(FsiFileSystems fileSystem); + + /// Retrieves the full path of the item as modified to conform to the specified file system. + /// + /// File system to which the path should conform. For possible values, see the FsiFileSystems enumeration type. + /// + /// + /// String that contains the full path of the item as it conforms to the specified file system. The path in the + /// IFsiItem::get_FullPath property is modified if the characters used and its length do not meet the requirements of the + /// specified file system type. + /// + // https://docs.microsoft.com/en-us/windows/win32/api/imapi2fs/nf-imapi2fs-ifsiitem-filesystempath HRESULT FileSystemPath( + // FsiFileSystems fileSystem, BSTR *pVal ); + [DispId(18)] + [return: MarshalAs(UnmanagedType.BStr)] + new string FileSystemPath(FsiFileSystems fileSystem); + + /// Retrieves a list of child items contained within the directory in the file system image. + /// + /// An IEnumVariant interface that you use to enumerate the child items contained within the directory. The items of the + /// enumeration are variants whose type is VT_BSTR. Use the bstrVal member to retrieve the path to the child item. + /// + /// + /// + /// The enumeration is a snapshot of the children contained in the directory at the time of the call and will not reflect + /// children that are added and removed. + /// + /// To retrieve a single item, see the IFsiDirectoryItem::get_Item property. + /// + // https://docs.microsoft.com/en-us/windows/win32/api/imapi2fs/nf-imapi2fs-ifsidirectoryitem-get__newenum HRESULT get__NewEnum( + // IEnumVARIANT **NewEnum ); + [DispId(-4)] + [return: MarshalAs(UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof(EnumeratorToEnumVariantMarshaler))] + new IEnumerator GetEnumerator(); + + /// Retrieves the specified directory or file item from file system image. + /// String that contains the path to the item to retrieve. + /// An IFsiItem interface of the requested directory or file item. + /// + /// + /// To determine whether the item is a file item or directory item, call the IFsiItem::QueryInterface method passing + /// __uuidof(IFsiDirectoryItem) as the interface identifier. If the call succeeds, the item is a directory item; otherwise, the + /// item is a file item. + /// + /// To enumerate all children, call the IFsiDirectoryItem::get__NewEnum method. + /// + // https://docs.microsoft.com/en-us/windows/win32/api/imapi2fs/nf-imapi2fs-ifsidirectoryitem-get_item HRESULT get_Item( BSTR + // path, IFsiItem **item ); + [DispId(0)] + IFsiItem this[string path] { [return: MarshalAs(UnmanagedType.Interface)] get; } + + /// Number of child items in the enumeration. + /// Number of directory and file items within the directory in the file system image. + // https://docs.microsoft.com/en-us/windows/win32/api/imapi2fs/nf-imapi2fs-ifsidirectoryitem-get_count HRESULT get_Count( LONG + // *Count ); + [DispId(1)] + int Count { get; } + + /// Retrieves a list of child items contained within the directory in the file system image. + /// + /// An IEnumFsiItems interface that contains a collection of the child directory and file items contained within the directory. + /// + /// + /// This property returns the same results as the IFsiDirectoryItem::get__NewEnum property and is meant for use by C/C++ applications. + /// + // https://docs.microsoft.com/en-us/windows/win32/api/imapi2fs/nf-imapi2fs-ifsidirectoryitem-get_enumfsiitems HRESULT + // get_EnumFsiItems( IEnumFsiItems **NewEnum ); + [DispId(2)] + IEnumFsiItems EnumFsiItems { [return: MarshalAs(UnmanagedType.Interface)] get; } + + /// Adds a directory to the file system image. + /// + /// String that contains the relative path of directory to create. + /// Specify the full path when calling this method from the root directory item. + /// + /// The parent directory for the new subdirectory must already exist within the file system image. + // https://docs.microsoft.com/en-us/windows/win32/api/imapi2fs/nf-imapi2fs-ifsidirectoryitem-adddirectory HRESULT AddDirectory( + // BSTR path ); + [DispId(30)] + void AddDirectory([MarshalAs(UnmanagedType.BStr)] string path); + + /// Adds a file to the file system image. + /// + /// String that contains the relative path of the directory to contain the new file. + /// Specify the full path when calling this method from the root directory item. + /// + /// An IStream interface of the file (data stream) to write to the media. + /// The directory that will contain the new file must already exist within the file system image. + // https://docs.microsoft.com/en-us/windows/win32/api/imapi2fs/nf-imapi2fs-ifsidirectoryitem-addfile HRESULT AddFile( BSTR path, + // IStream *fileData ); + [DispId(31)] + void AddFile([MarshalAs(UnmanagedType.BStr)] string path, IStream fileData); + + /// Adds the contents of a directory tree to the file system image. + /// + /// String that contains the relative path of the directory tree to create. + /// Specify the full path when calling this method from the root directory item. + /// + /// + /// Set to VARIANT_TRUE to include the directory in sourceDirectory as a subdirectory in the file system image. Otherwise, VARIANT_FALSE. + /// + /// + /// The parent directory for the new subdirectory must already exist within the file system image. + /// The subdirectory structure within specified source directory is implicitly mirrored in the file system image. + /// + /// If file or directory collisions occur, the content of the specified source directory prevails. The file system image is + /// overwritten with the appropriate directories and files from the source directory. + /// + /// If an exception occurs during processing, the file system image reverts to its previous state. + /// + // https://docs.microsoft.com/en-us/windows/win32/api/imapi2fs/nf-imapi2fs-ifsidirectoryitem-addtree HRESULT AddTree( BSTR + // sourceDirectory, VARIANT_BOOL includeBaseDirectory ); + [DispId(32)] + void AddTree([MarshalAs(UnmanagedType.BStr)] string sourceDirectory, [MarshalAs(UnmanagedType.VariantBool)] bool includeBaseDirectory); + + /// Adds a file or directory described by the IFsiItem object to the file system image. + /// An IFsiItem interface of the IFsiFileItemor IFsiDirectoryItem to add to the file system image. + /// + /// + /// To create a directory item or file item, call the IFileSystemImage::CreateDirectoryItem or IFileSystemImage::CreateFileItem + /// method, respectively. + /// + /// Once an item is added to the file system image, the IFsiFileItem::get_Data property becomes read-only. + /// + // https://docs.microsoft.com/en-us/windows/win32/api/imapi2fs/nf-imapi2fs-ifsidirectoryitem-add HRESULT Add( IFsiItem *item ); + [DispId(33)] + void Add(IFsiItem item); + + /// Removes the specified item from the file system image. + /// + /// String that contains the relative path of the item to remove. The path is relative to current directory item. + /// Specify the full path when calling this method from the root directory item. + /// + /// This method is only callable on directory items present in the file system image. + // https://docs.microsoft.com/en-us/windows/win32/api/imapi2fs/nf-imapi2fs-ifsidirectoryitem-remove HRESULT Remove( BSTR path ); + [DispId(34)] + void Remove([MarshalAs(UnmanagedType.BStr)] string path); + + /// Remove the specified directory tree from the file system image. + /// String that contains the name of directory to remove. The path is relative to current directory item. + /// + /// The directory item must be present in the file system image. + /// + /// You can delete the entire file-system image by calling this method for the root directory item and setting the path to a + /// single path delimiter (\). + /// + /// + // https://docs.microsoft.com/en-us/windows/win32/api/imapi2fs/nf-imapi2fs-ifsidirectoryitem-removetree HRESULT RemoveTree( BSTR + // path ); + [DispId(35)] + void RemoveTree([MarshalAs(UnmanagedType.BStr)] string path); + } + + /// + /// Use this interface to add a directory tree, which includes all sub-directories, files, and associated named streams to a file + /// system image. + /// + /// + /// + /// All sub-directories, files, and associated named streams can only be added after the directory item has been added to the file + /// system image. + /// + /// + /// UDF must be enabled and set to UDF revision 2.00 or later in order to enable named stream support during the creation of the + /// file system image. + /// + /// + /// This interface 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/imapi2fs/nn-imapi2fs-ifsidirectoryitem2 + [PInvokeData("imapi2fs.h", MSDNShortId = "NN:imapi2fs.IFsiDirectoryItem2")] + [ComImport, Guid("F7FB4B9B-6D96-4d7b-9115-201B144811EF"), InterfaceType(ComInterfaceType.InterfaceIsDual), CoClass(typeof(FsiDirectoryItem))] + public interface IFsiDirectoryItem2 : IFsiDirectoryItem + { + /// Retrieves the name of the directory or file item in the file system image. + /// String that contains the name of the file or directory item in the file system image. + /// To get the full path to the item, call the IFsiItem::get_FullPath method. + // https://docs.microsoft.com/en-us/windows/win32/api/imapi2fs/nf-imapi2fs-ifsiitem-get_name HRESULT get_Name( BSTR *pVal ); + [DispId(11)] + new string Name { [return: MarshalAs(UnmanagedType.BStr)] get; } + + /// Retrieves the full path of the file or directory item in the file system image. + /// String that contains the absolute path of the file or directory item in the file system image. + // https://docs.microsoft.com/en-us/windows/win32/api/imapi2fs/nf-imapi2fs-ifsiitem-get_fullpath HRESULT get_FullPath( BSTR + // *pVal ); + [DispId(12)] + new string FullPath { [return: MarshalAs(UnmanagedType.BStr)] get; } + + /// Gets or sets the date and time that the directory or file item was created and added to the file system image. + /// + /// Date and time that the directory or file item was created and added to the file system image, according to UTC time. + /// Defaults to the time the item was added to the image. + /// + /// + /// IMAPI does not support the extended attribute for CreationTime, and as a result, UDFS populates the CreationTime with the + /// value expressed by the LastAccessed property from the file entry. + /// + // https://docs.microsoft.com/en-us/windows/win32/api/imapi2fs/nf-imapi2fs-ifsiitem-put_creationtime HRESULT put_CreationTime( + // DATE newVal ); + [DispId(13)] + new DateTime CreationTime { get; set; } + + /// Gets or sets the date and time that the directory or file item was last accessed in the file system image. + /// + /// Date and time that the directory or file item was last accessed in the file system image, according to UTC time. Defaults to + /// the time the item was added to the image. + /// + /// + /// + /// UDFS (UDF) uses the LastAccessedTime value for the CreationTime, as IMAPI does not currently support the CreationTime + /// extended attribue. + /// + /// + /// CDFS (ISO 9660) sets the LastAccessedTime value to 0, as only the recording time is stored within the File/Directory descriptor. + /// + /// + // https://docs.microsoft.com/en-us/windows/win32/api/imapi2fs/nf-imapi2fs-ifsiitem-put_lastaccessedtime HRESULT + // put_LastAccessedTime( DATE newVal ); + [DispId(14)] + new DateTime LastAccessedTime { get; set; } + + /// Gets or sets the date and time that the item was last modified in the file system image. + /// + /// Date and time that the directory or file item was last modified in the file system image, according to UTC time. Defaults to + /// the time the item was added to the image. + /// + /// + /// + /// The last modified time is propagated to the attribute that users see when viewing the properties of a directory or a file. + /// + /// When implementing this method, a few things should be taken into consideration: + /// UDFS (UDF) will use the value provided by IFsiItem::put_LastModifiedTime as both the CreationTime and LastModifiedTime. + /// + /// CDFS (ISO 9660) uses the date/time of recording as the CreationTime and LastModifiedTime. As a result, CDFS sets the value + /// of LastModifiedTime to 0. + /// + /// + // https://docs.microsoft.com/en-us/windows/win32/api/imapi2fs/nf-imapi2fs-ifsiitem-put_lastmodifiedtime HRESULT + // put_LastModifiedTime( DATE newVal ); + [DispId(15)] + new DateTime LastModifiedTime { get; set; } + + /// Determines if the item's hidden attribute is set in the file system image. + /// + /// Set to VARIANT_TRUE to set the hidden attribute of the item in the file system image; otherwise, VARIANT_FALSE. The default + /// is VARIANT_FALSE. + /// + // https://docs.microsoft.com/en-us/windows/win32/api/imapi2fs/nf-imapi2fs-ifsiitem-put_ishidden HRESULT put_IsHidden( + // VARIANT_BOOL newVal ); + [DispId(16)] + new bool IsHidden { [return: MarshalAs(UnmanagedType.VariantBool)] get; set; } + + /// Retrieves the name of the item as modified to conform to the specified file system. + /// + /// File system to which the name should conform. For possible values, see the FsiFileSystems enumeration type. + /// + /// + /// String that contains the name of the item as it conforms to the specified file system. The name in the IFsiItem::get_Name + /// property is modified if the characters used and its length do not meet the requirements of the specified file system type. + /// + // https://docs.microsoft.com/en-us/windows/win32/api/imapi2fs/nf-imapi2fs-ifsiitem-filesystemname HRESULT FileSystemName( + // FsiFileSystems fileSystem, BSTR *pVal ); + [DispId(17)] + [return: MarshalAs(UnmanagedType.BStr)] + new string FileSystemName(FsiFileSystems fileSystem); + + /// Retrieves the full path of the item as modified to conform to the specified file system. + /// + /// File system to which the path should conform. For possible values, see the FsiFileSystems enumeration type. + /// + /// + /// String that contains the full path of the item as it conforms to the specified file system. The path in the + /// IFsiItem::get_FullPath property is modified if the characters used and its length do not meet the requirements of the + /// specified file system type. + /// + // https://docs.microsoft.com/en-us/windows/win32/api/imapi2fs/nf-imapi2fs-ifsiitem-filesystempath HRESULT FileSystemPath( + // FsiFileSystems fileSystem, BSTR *pVal ); + [DispId(18)] + [return: MarshalAs(UnmanagedType.BStr)] + new string FileSystemPath(FsiFileSystems fileSystem); + + /// Retrieves a list of child items contained within the directory in the file system image. + /// + /// An IEnumVariant interface that you use to enumerate the child items contained within the directory. The items of the + /// enumeration are variants whose type is VT_BSTR. Use the bstrVal member to retrieve the path to the child item. + /// + /// + /// + /// The enumeration is a snapshot of the children contained in the directory at the time of the call and will not reflect + /// children that are added and removed. + /// + /// To retrieve a single item, see the IFsiDirectoryItem::get_Item property. + /// + // https://docs.microsoft.com/en-us/windows/win32/api/imapi2fs/nf-imapi2fs-ifsidirectoryitem-get__newenum HRESULT get__NewEnum( + // IEnumVARIANT **NewEnum ); + [DispId(-4)] + [return: MarshalAs(UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof(EnumeratorToEnumVariantMarshaler))] + new IEnumerator GetEnumerator(); + + /// Retrieves the specified directory or file item from file system image. + /// String that contains the path to the item to retrieve. + /// An IFsiItem interface of the requested directory or file item. + /// + /// + /// To determine whether the item is a file item or directory item, call the IFsiItem::QueryInterface method passing + /// __uuidof(IFsiDirectoryItem) as the interface identifier. If the call succeeds, the item is a directory item; otherwise, the + /// item is a file item. + /// + /// To enumerate all children, call the IFsiDirectoryItem::get__NewEnum method. + /// + // https://docs.microsoft.com/en-us/windows/win32/api/imapi2fs/nf-imapi2fs-ifsidirectoryitem-get_item HRESULT get_Item( BSTR + // path, IFsiItem **item ); + [DispId(0)] + new IFsiItem this[string path] { [return: MarshalAs(UnmanagedType.Interface)] get; } + + /// Number of child items in the enumeration. + /// Number of directory and file items within the directory in the file system image. + // https://docs.microsoft.com/en-us/windows/win32/api/imapi2fs/nf-imapi2fs-ifsidirectoryitem-get_count HRESULT get_Count( LONG + // *Count ); + [DispId(1)] + new int Count { get; } + + /// Retrieves a list of child items contained within the directory in the file system image. + /// + /// An IEnumFsiItems interface that contains a collection of the child directory and file items contained within the directory. + /// + /// + /// This property returns the same results as the IFsiDirectoryItem::get__NewEnum property and is meant for use by C/C++ applications. + /// + // https://docs.microsoft.com/en-us/windows/win32/api/imapi2fs/nf-imapi2fs-ifsidirectoryitem-get_enumfsiitems HRESULT + // get_EnumFsiItems( IEnumFsiItems **NewEnum ); + [DispId(2)] + new IEnumFsiItems EnumFsiItems { [return: MarshalAs(UnmanagedType.Interface)] get; } + + /// Adds a directory to the file system image. + /// + /// String that contains the relative path of directory to create. + /// Specify the full path when calling this method from the root directory item. + /// + /// The parent directory for the new subdirectory must already exist within the file system image. + // https://docs.microsoft.com/en-us/windows/win32/api/imapi2fs/nf-imapi2fs-ifsidirectoryitem-adddirectory HRESULT AddDirectory( + // BSTR path ); + [DispId(30)] + new void AddDirectory([MarshalAs(UnmanagedType.BStr)] string path); + + /// Adds a file to the file system image. + /// + /// String that contains the relative path of the directory to contain the new file. + /// Specify the full path when calling this method from the root directory item. + /// + /// An IStream interface of the file (data stream) to write to the media. + /// The directory that will contain the new file must already exist within the file system image. + // https://docs.microsoft.com/en-us/windows/win32/api/imapi2fs/nf-imapi2fs-ifsidirectoryitem-addfile HRESULT AddFile( BSTR path, + // IStream *fileData ); + [DispId(31)] + new void AddFile([MarshalAs(UnmanagedType.BStr)] string path, IStream fileData); + + /// Adds the contents of a directory tree to the file system image. + /// + /// String that contains the relative path of the directory tree to create. + /// Specify the full path when calling this method from the root directory item. + /// + /// + /// Set to VARIANT_TRUE to include the directory in sourceDirectory as a subdirectory in the file system image. Otherwise, VARIANT_FALSE. + /// + /// + /// The parent directory for the new subdirectory must already exist within the file system image. + /// The subdirectory structure within specified source directory is implicitly mirrored in the file system image. + /// + /// If file or directory collisions occur, the content of the specified source directory prevails. The file system image is + /// overwritten with the appropriate directories and files from the source directory. + /// + /// If an exception occurs during processing, the file system image reverts to its previous state. + /// + // https://docs.microsoft.com/en-us/windows/win32/api/imapi2fs/nf-imapi2fs-ifsidirectoryitem-addtree HRESULT AddTree( BSTR + // sourceDirectory, VARIANT_BOOL includeBaseDirectory ); + [DispId(32)] + new void AddTree([MarshalAs(UnmanagedType.BStr)] string sourceDirectory, [MarshalAs(UnmanagedType.VariantBool)] bool includeBaseDirectory); + + /// Adds a file or directory described by the IFsiItem object to the file system image. + /// An IFsiItem interface of the IFsiFileItemor IFsiDirectoryItem to add to the file system image. + /// + /// + /// To create a directory item or file item, call the IFileSystemImage::CreateDirectoryItem or IFileSystemImage::CreateFileItem + /// method, respectively. + /// + /// Once an item is added to the file system image, the IFsiFileItem::get_Data property becomes read-only. + /// + // https://docs.microsoft.com/en-us/windows/win32/api/imapi2fs/nf-imapi2fs-ifsidirectoryitem-add HRESULT Add( IFsiItem *item ); + [DispId(33)] + new void Add(IFsiItem item); + + /// Removes the specified item from the file system image. + /// + /// String that contains the relative path of the item to remove. The path is relative to current directory item. + /// Specify the full path when calling this method from the root directory item. + /// + /// This method is only callable on directory items present in the file system image. + // https://docs.microsoft.com/en-us/windows/win32/api/imapi2fs/nf-imapi2fs-ifsidirectoryitem-remove HRESULT Remove( BSTR path ); + [DispId(34)] + new void Remove([MarshalAs(UnmanagedType.BStr)] string path); + + /// Remove the specified directory tree from the file system image. + /// String that contains the name of directory to remove. The path is relative to current directory item. + /// + /// The directory item must be present in the file system image. + /// + /// You can delete the entire file-system image by calling this method for the root directory item and setting the path to a + /// single path delimiter (\). + /// + /// + // https://docs.microsoft.com/en-us/windows/win32/api/imapi2fs/nf-imapi2fs-ifsidirectoryitem-removetree HRESULT RemoveTree( BSTR + // path ); + [DispId(35)] + new void RemoveTree([MarshalAs(UnmanagedType.BStr)] string path); + + /// + /// Adds the contents of a directory tree along with named streams associated with all files to the file system image. + /// + /// + /// + /// String that contains the relative path of the directory tree to create. The path should contain only valid characters as per + /// file system naming conventions. This parameter cannot be NULL. + /// + /// Note You must specify the full path when calling this method from the root directory item. + /// + /// + /// Set to VARIANT_TRUE to include the directory in sourceDirectory as a subdirectory in the file system image. + /// Otherwise, VARIANT_FALSE. + /// + /// + /// The parent directory for the new sub-directory must already exist within the file system image. + /// + /// The sub-directory structure within specified sourceDirectory is implicitly mirrored in the file system image. If file or + /// directory collisions occur, the content of the specified source directory prevails. + /// + /// + /// The file system image is overwritten with the appropriate directories and files from the source directory. If an exception + /// occurs during processing, the file system image reverts to its previous state. + /// + /// + /// If this method is invoked for a file system object that does not contain UDF in the list of file systems enabled for + /// creation in the resultant image or if the UDF revision is below 2.00, this method returns success code + /// IMAPI_S_IMAGE_FEATURE_NOT_SUPPORTED. This indicates that the named streams have been added but will not appear in the + /// resultant file system image unless UDF revision 2.00 or higher is enabled in the file system object. + /// + /// + /// When utilizing alternate data streams (ADS) it is important to note that the file system image has a limitation of 1000 + /// streams. Exceeding this number will result in lost data. + /// + /// + /// This method 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/imapi2fs/nf-imapi2fs-ifsidirectoryitem2-addtreewithnamedstreams HRESULT + // AddTreeWithNamedStreams( BSTR sourceDirectory, VARIANT_BOOL includeBaseDirectory ); + [DispId(36)] + void AddTreeWithNamedStreams([MarshalAs(UnmanagedType.BStr)] string sourceDirectory, [MarshalAs(UnmanagedType.VariantBool)] bool includeBaseDirectory); + }; + + /// + /// Use this interface to identify the file size and data stream of the file contents. + /// To get this interface, call the IFileSystemImage::CreateFileItem method. + /// + /// + /// + /// Data streams for files contained within the file system image are read-only. File data can only be replaced by overwriting an + /// existing file item. + /// + /// This is an FsiFileItem object in script. + /// + // https://docs.microsoft.com/en-us/windows/win32/api/imapi2fs/nn-imapi2fs-ifsifileitem + [PInvokeData("imapi2fs.h", MSDNShortId = "NN:imapi2fs.IFsiFileItem")] + [ComImport, Guid("2C941FDB-975B-59BE-A960-9A2A262853A5"), InterfaceType(ComInterfaceType.InterfaceIsDual), CoClass(typeof(FsiFileItem))] + public interface IFsiFileItem : IFsiItem + { + /// Retrieves the name of the directory or file item in the file system image. + /// String that contains the name of the file or directory item in the file system image. + /// To get the full path to the item, call the IFsiItem::get_FullPath method. + // https://docs.microsoft.com/en-us/windows/win32/api/imapi2fs/nf-imapi2fs-ifsiitem-get_name HRESULT get_Name( BSTR *pVal ); + [DispId(11)] + new string Name { [return: MarshalAs(UnmanagedType.BStr)] get; } + + /// Retrieves the full path of the file or directory item in the file system image. + /// String that contains the absolute path of the file or directory item in the file system image. + // https://docs.microsoft.com/en-us/windows/win32/api/imapi2fs/nf-imapi2fs-ifsiitem-get_fullpath HRESULT get_FullPath( BSTR + // *pVal ); + [DispId(12)] + new string FullPath { [return: MarshalAs(UnmanagedType.BStr)] get; } + + /// Gets or sets the date and time that the directory or file item was created and added to the file system image. + /// + /// Date and time that the directory or file item was created and added to the file system image, according to UTC time. + /// Defaults to the time the item was added to the image. + /// + /// + /// IMAPI does not support the extended attribute for CreationTime, and as a result, UDFS populates the CreationTime with the + /// value expressed by the LastAccessed property from the file entry. + /// + // https://docs.microsoft.com/en-us/windows/win32/api/imapi2fs/nf-imapi2fs-ifsiitem-put_creationtime HRESULT put_CreationTime( + // DATE newVal ); + [DispId(13)] + new DateTime CreationTime { get; set; } + + /// Gets or sets the date and time that the directory or file item was last accessed in the file system image. + /// + /// Date and time that the directory or file item was last accessed in the file system image, according to UTC time. Defaults to + /// the time the item was added to the image. + /// + /// + /// + /// UDFS (UDF) uses the LastAccessedTime value for the CreationTime, as IMAPI does not currently support the CreationTime + /// extended attribue. + /// + /// + /// CDFS (ISO 9660) sets the LastAccessedTime value to 0, as only the recording time is stored within the File/Directory descriptor. + /// + /// + // https://docs.microsoft.com/en-us/windows/win32/api/imapi2fs/nf-imapi2fs-ifsiitem-put_lastaccessedtime HRESULT + // put_LastAccessedTime( DATE newVal ); + [DispId(14)] + new DateTime LastAccessedTime { get; set; } + + /// Gets or sets the date and time that the item was last modified in the file system image. + /// + /// Date and time that the directory or file item was last modified in the file system image, according to UTC time. Defaults to + /// the time the item was added to the image. + /// + /// + /// + /// The last modified time is propagated to the attribute that users see when viewing the properties of a directory or a file. + /// + /// When implementing this method, a few things should be taken into consideration: + /// UDFS (UDF) will use the value provided by IFsiItem::put_LastModifiedTime as both the CreationTime and LastModifiedTime. + /// + /// CDFS (ISO 9660) uses the date/time of recording as the CreationTime and LastModifiedTime. As a result, CDFS sets the value + /// of LastModifiedTime to 0. + /// + /// + // https://docs.microsoft.com/en-us/windows/win32/api/imapi2fs/nf-imapi2fs-ifsiitem-put_lastmodifiedtime HRESULT + // put_LastModifiedTime( DATE newVal ); + [DispId(15)] + new DateTime LastModifiedTime { get; set; } + + /// Determines if the item's hidden attribute is set in the file system image. + /// + /// Set to VARIANT_TRUE to set the hidden attribute of the item in the file system image; otherwise, VARIANT_FALSE. The default + /// is VARIANT_FALSE. + /// + // https://docs.microsoft.com/en-us/windows/win32/api/imapi2fs/nf-imapi2fs-ifsiitem-put_ishidden HRESULT put_IsHidden( + // VARIANT_BOOL newVal ); + [DispId(16)] + new bool IsHidden { [return: MarshalAs(UnmanagedType.VariantBool)] get; set; } + + /// Retrieves the name of the item as modified to conform to the specified file system. + /// + /// File system to which the name should conform. For possible values, see the FsiFileSystems enumeration type. + /// + /// + /// String that contains the name of the item as it conforms to the specified file system. The name in the IFsiItem::get_Name + /// property is modified if the characters used and its length do not meet the requirements of the specified file system type. + /// + // https://docs.microsoft.com/en-us/windows/win32/api/imapi2fs/nf-imapi2fs-ifsiitem-filesystemname HRESULT FileSystemName( + // FsiFileSystems fileSystem, BSTR *pVal ); + [DispId(17)] + [return: MarshalAs(UnmanagedType.BStr)] + new string FileSystemName(FsiFileSystems fileSystem); + + /// Retrieves the full path of the item as modified to conform to the specified file system. + /// + /// File system to which the path should conform. For possible values, see the FsiFileSystems enumeration type. + /// + /// + /// String that contains the full path of the item as it conforms to the specified file system. The path in the + /// IFsiItem::get_FullPath property is modified if the characters used and its length do not meet the requirements of the + /// specified file system type. + /// + // https://docs.microsoft.com/en-us/windows/win32/api/imapi2fs/nf-imapi2fs-ifsiitem-filesystempath HRESULT FileSystemPath( + // FsiFileSystems fileSystem, BSTR *pVal ); + [DispId(18)] + [return: MarshalAs(UnmanagedType.BStr)] + new string FileSystemPath(FsiFileSystems fileSystem); + + /// Retrieves the data stream of the file's content. + /// An IStream interface of the contents of the file. + /// The contents of the file becomes read-only once the file item is added to file system image. + // https://docs.microsoft.com/en-us/windows/win32/api/imapi2fs/nf-imapi2fs-ifsifileitem-get_data HRESULT get_Data( IStream + // **pVal ); + [DispId(41)] + long DataSize { get; } + + /// Retrieves the least significant 32 bits of the IFsiFileItem::get_DataSize property. + /// Least significant 32 bits of the IFsiFileItem::get_DataSize property. + /// + /// This property and IFsiFileItem::get_DataSize32BitHigh together provide the size of the file as two 32-bit numbers for + /// languages that do not support 64-bit values, such as VBScript and Visual Basic 6. + /// + // https://docs.microsoft.com/en-us/windows/win32/api/imapi2fs/nf-imapi2fs-ifsifileitem-get_datasize32bitlow HRESULT + // get_DataSize32BitLow( LONG *pVal ); + [DispId(42)] + int DataSize32BitLow { get; } + + /// Retrieves the most significant 32 bits of the IFsiFileItem::get_DataSize property. + /// Most significant 32 bits of the IFsiFileItem::get_DataSize property. + /// + /// This property and IFsiFileItem::get_DataSize32BitLow together provide the size of the file as two 32-bit numbers for + /// languages that do not support 64-bit values, such as VBScript and Visual Basic 6. + /// + // https://docs.microsoft.com/en-us/windows/win32/api/imapi2fs/nf-imapi2fs-ifsifileitem-get_datasize32bithigh HRESULT + // get_DataSize32BitHigh( LONG *pVal ); + [DispId(43)] + int DataSize32BitHigh { get; } + + /// Gets or sets the data stream of the file's content. + /// An IStream interface of the content of the file to add to the file system image. + /// The contents of the file becomes read-only once the file item is added to file system image. + // https://docs.microsoft.com/en-us/windows/win32/api/imapi2fs/nf-imapi2fs-ifsifileitem-put_data HRESULT put_Data( IStream + // *newVal ); + [DispId(44)] + IStream Data { [return: MarshalAs(UnmanagedType.Interface)] get; set; } + } + + /// + /// Use this interface to add, remove and enumerate named streams associated with a file. This interface also provides access to the + /// 'Real-Time' attribute of a file. + /// + /// + /// + /// While UDF 2.0 is the lowest required revision for named stream support, the user must enable UDF 2.01 or higher to enable the + /// use of both named streams and real-time file attributes. + /// + /// + /// The recipients of a storage medium containing such files are required to read them using special MMC commands reducing read + /// latency and increasing the worst-case read speed. + /// + /// + /// This interface 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/imapi2fs/nn-imapi2fs-ifsifileitem2 + [PInvokeData("imapi2fs.h", MSDNShortId = "NN:imapi2fs.IFsiFileItem2")] + [ComImport, Guid("199D0C19-11E1-40eb-8EC2-C8C822A07792"), InterfaceType(ComInterfaceType.InterfaceIsDual), CoClass(typeof(FsiFileItem))] + public interface IFsiFileItem2 : IFsiFileItem + { + /// Retrieves the name of the directory or file item in the file system image. + /// String that contains the name of the file or directory item in the file system image. + /// To get the full path to the item, call the IFsiItem::get_FullPath method. + // https://docs.microsoft.com/en-us/windows/win32/api/imapi2fs/nf-imapi2fs-ifsiitem-get_name HRESULT get_Name( BSTR *pVal ); + [DispId(11)] + new string Name { [return: MarshalAs(UnmanagedType.BStr)] get; } + + /// Retrieves the full path of the file or directory item in the file system image. + /// String that contains the absolute path of the file or directory item in the file system image. + // https://docs.microsoft.com/en-us/windows/win32/api/imapi2fs/nf-imapi2fs-ifsiitem-get_fullpath HRESULT get_FullPath( BSTR + // *pVal ); + [DispId(12)] + new string FullPath { [return: MarshalAs(UnmanagedType.BStr)] get; } + + /// Gets or sets the date and time that the directory or file item was created and added to the file system image. + /// + /// Date and time that the directory or file item was created and added to the file system image, according to UTC time. + /// Defaults to the time the item was added to the image. + /// + /// + /// IMAPI does not support the extended attribute for CreationTime, and as a result, UDFS populates the CreationTime with the + /// value expressed by the LastAccessed property from the file entry. + /// + // https://docs.microsoft.com/en-us/windows/win32/api/imapi2fs/nf-imapi2fs-ifsiitem-put_creationtime HRESULT put_CreationTime( + // DATE newVal ); + [DispId(13)] + new DateTime CreationTime { get; set; } + + /// Gets or sets the date and time that the directory or file item was last accessed in the file system image. + /// + /// Date and time that the directory or file item was last accessed in the file system image, according to UTC time. Defaults to + /// the time the item was added to the image. + /// + /// + /// + /// UDFS (UDF) uses the LastAccessedTime value for the CreationTime, as IMAPI does not currently support the CreationTime + /// extended attribue. + /// + /// + /// CDFS (ISO 9660) sets the LastAccessedTime value to 0, as only the recording time is stored within the File/Directory descriptor. + /// + /// + // https://docs.microsoft.com/en-us/windows/win32/api/imapi2fs/nf-imapi2fs-ifsiitem-put_lastaccessedtime HRESULT + // put_LastAccessedTime( DATE newVal ); + [DispId(14)] + new DateTime LastAccessedTime { get; set; } + + /// Gets or sets the date and time that the item was last modified in the file system image. + /// + /// Date and time that the directory or file item was last modified in the file system image, according to UTC time. Defaults to + /// the time the item was added to the image. + /// + /// + /// + /// The last modified time is propagated to the attribute that users see when viewing the properties of a directory or a file. + /// + /// When implementing this method, a few things should be taken into consideration: + /// UDFS (UDF) will use the value provided by IFsiItem::put_LastModifiedTime as both the CreationTime and LastModifiedTime. + /// + /// CDFS (ISO 9660) uses the date/time of recording as the CreationTime and LastModifiedTime. As a result, CDFS sets the value + /// of LastModifiedTime to 0. + /// + /// + // https://docs.microsoft.com/en-us/windows/win32/api/imapi2fs/nf-imapi2fs-ifsiitem-put_lastmodifiedtime HRESULT + // put_LastModifiedTime( DATE newVal ); + [DispId(15)] + new DateTime LastModifiedTime { get; set; } + + /// Determines if the item's hidden attribute is set in the file system image. + /// + /// Set to VARIANT_TRUE to set the hidden attribute of the item in the file system image; otherwise, VARIANT_FALSE. The default + /// is VARIANT_FALSE. + /// + // https://docs.microsoft.com/en-us/windows/win32/api/imapi2fs/nf-imapi2fs-ifsiitem-put_ishidden HRESULT put_IsHidden( + // VARIANT_BOOL newVal ); + [DispId(16)] + new bool IsHidden { [return: MarshalAs(UnmanagedType.VariantBool)] get; set; } + + /// Retrieves the name of the item as modified to conform to the specified file system. + /// + /// File system to which the name should conform. For possible values, see the FsiFileSystems enumeration type. + /// + /// + /// String that contains the name of the item as it conforms to the specified file system. The name in the IFsiItem::get_Name + /// property is modified if the characters used and its length do not meet the requirements of the specified file system type. + /// + // https://docs.microsoft.com/en-us/windows/win32/api/imapi2fs/nf-imapi2fs-ifsiitem-filesystemname HRESULT FileSystemName( + // FsiFileSystems fileSystem, BSTR *pVal ); + [DispId(17)] + [return: MarshalAs(UnmanagedType.BStr)] + new string FileSystemName(FsiFileSystems fileSystem); + + /// Retrieves the full path of the item as modified to conform to the specified file system. + /// + /// File system to which the path should conform. For possible values, see the FsiFileSystems enumeration type. + /// + /// + /// String that contains the full path of the item as it conforms to the specified file system. The path in the + /// IFsiItem::get_FullPath property is modified if the characters used and its length do not meet the requirements of the + /// specified file system type. + /// + // https://docs.microsoft.com/en-us/windows/win32/api/imapi2fs/nf-imapi2fs-ifsiitem-filesystempath HRESULT FileSystemPath( + // FsiFileSystems fileSystem, BSTR *pVal ); + [DispId(18)] + [return: MarshalAs(UnmanagedType.BStr)] + new string FileSystemPath(FsiFileSystems fileSystem); + + /// Retrieves the data stream of the file's content. + /// An IStream interface of the contents of the file. + /// The contents of the file becomes read-only once the file item is added to file system image. + // https://docs.microsoft.com/en-us/windows/win32/api/imapi2fs/nf-imapi2fs-ifsifileitem-get_data HRESULT get_Data( IStream + // **pVal ); + [DispId(41)] + new long DataSize { get; } + + /// Retrieves the least significant 32 bits of the IFsiFileItem::get_DataSize property. + /// Least significant 32 bits of the IFsiFileItem::get_DataSize property. + /// + /// This property and IFsiFileItem::get_DataSize32BitHigh together provide the size of the file as two 32-bit numbers for + /// languages that do not support 64-bit values, such as VBScript and Visual Basic 6. + /// + // https://docs.microsoft.com/en-us/windows/win32/api/imapi2fs/nf-imapi2fs-ifsifileitem-get_datasize32bitlow HRESULT + // get_DataSize32BitLow( LONG *pVal ); + [DispId(42)] + new int DataSize32BitLow { get; } + + /// Retrieves the most significant 32 bits of the IFsiFileItem::get_DataSize property. + /// Most significant 32 bits of the IFsiFileItem::get_DataSize property. + /// + /// This property and IFsiFileItem::get_DataSize32BitLow together provide the size of the file as two 32-bit numbers for + /// languages that do not support 64-bit values, such as VBScript and Visual Basic 6. + /// + // https://docs.microsoft.com/en-us/windows/win32/api/imapi2fs/nf-imapi2fs-ifsifileitem-get_datasize32bithigh HRESULT + // get_DataSize32BitHigh( LONG *pVal ); + [DispId(43)] + new int DataSize32BitHigh { get; } + + /// Gets or sets the data stream of the file's content. + /// An IStream interface of the content of the file to add to the file system image. + /// The contents of the file becomes read-only once the file item is added to file system image. + // https://docs.microsoft.com/en-us/windows/win32/api/imapi2fs/nf-imapi2fs-ifsifileitem-put_data HRESULT put_Data( IStream + // *newVal ); + [DispId(44)] + new IStream Data { [return: MarshalAs(UnmanagedType.Interface)] get; set; } + + /// Retrieves a collection of named streams associated with a file in the file system image. + /// Pointer to an IFsiNamedStreams object that represents a collection of named streams associated with the file. + /// + /// + /// If this method is invoked for a file item which itself represents a named stream, the IMAPI_E_PROPERTY_NOT_ACCESSIBLE + /// error code is returned, as a named streams cannot contain additional named streams. + /// + /// The user must enable UDF and set the UDF revision to 2.00 or higher to support named streams. + /// + /// This method 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/imapi2fs/nf-imapi2fs-ifsifileitem2-get_fsinamedstreams HRESULT + // get_FsiNamedStreams( IFsiNamedStreams **streams ); + [DispId(45)] + IFsiNamedStreams FsiNamedStreams { [return: MarshalAs(UnmanagedType.Interface)] get; } + + /// + /// Determines if the item is a named stream. Data streams for named streams contained within the file system image are + /// read-only. Stream data can only be replaced by overwriting the existing named stream. + /// + /// Pointer to a value that indicates if the item is a named stream. to VARIANT_TRUE if an ; otherwise, VARIANT_FALSE. + /// + /// The user must enable UDF and set the UDF revision to 2.00 or higher to support named streams. + /// + /// This method 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/imapi2fs/nf-imapi2fs-ifsifileitem2-get_isnamedstream HRESULT + // get_IsNamedStream( VARIANT_BOOL *pVal ); + [DispId(46)] + bool IsNamedStream { [return: MarshalAs(UnmanagedType.VariantBool)] get; } + + /// Associates a named stream with a specific file in the file system image. + /// + /// A string represents the name of the named stream. This should not include the path and should only contain valid characters + /// as per file system naming conventions. + /// + /// An IStream interface of the named stream used to write to the resultant file system image. + /// + /// + /// The file to which the named stream will be added must already exist within the file system image. If this method is called + /// with a name that already exists for a named stream, it will return an error and will not replace the existing named stream. + /// + /// + /// If this method is invoked for a file system object that does not contain UDF in the list of file systems enabled for + /// creation in the resultant image or if the UDF revision is below 2.00, this method returns success code + /// IMAPI_S_IMAGE_FEATURE_NOT_SUPPORTED. This success code indicates that the named stream has been added but will not + /// appear in the resultant file system image unless UDF revision 2.00 or higher is enabled in the file system object. + /// + /// + /// Currently, IMAPI_E_READONLY is returned when this method is called on an imported file system image, regardless of + /// the read only status of the image. + /// + /// + /// This method 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/imapi2fs/nf-imapi2fs-ifsifileitem2-addstream HRESULT AddStream( BSTR name, + // IStream *streamData ); + [DispId(47)] + void AddStream([MarshalAs(UnmanagedType.BStr)] string name, IStream streamData); + + /// Removes a named stream association with a file. + /// + /// String that specifies the name of the named stream association to remove. This should not include the path and should only + /// contain valid characters as per file system naming conventions. + /// + /// + /// This method can be called only for file items present in the file system image. + /// The user must enable UDF and set the UDF revision to 2.00 or higher to support named streams. + /// + /// This method 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/imapi2fs/nf-imapi2fs-ifsifileitem2-removestream HRESULT RemoveStream( BSTR + // name ); + [DispId(48)] + void RemoveStream([MarshalAs(UnmanagedType.BStr)] string name); + + /// + /// Gets or sets the 'Real-Time' attribute of a file in a file system. This attribute specifies whether or not the content + /// requires a minimum data-transfer rate when writing or reading, for example, audio and video data. + /// + /// + /// Specify VARIANT_TRUE to set the Real-Time attribute of a file in the file system image; otherwise, + /// VARIANT_FALSE. The default is VARIANT_FALSE. + /// + /// + /// + /// The IFsiDirectoryItem::AddTree and IFsiDirectoryItem2::AddTreeWithNamedStreams methods do not set the Real-Time attribute + /// while adding files to a file system image. To mark files as Real-time files, they must be enumerated after they have been + /// added to the file system image and have the Real-Time attribute set individually. + /// + /// + /// If this method is invoked for a file item representing a named stream, this method returns error code + /// IMAPI_E_PROPERTY_NOT_ACCESSIBLE as named streams do not have the Real-Time attribute. + /// + /// + /// This method 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/imapi2fs/nf-imapi2fs-ifsifileitem2-put_isrealtime HRESULT put_IsRealTime( + // VARIANT_BOOL newVal ); + [DispId(49)] + bool IsRealTime { [return: MarshalAs(UnmanagedType.VariantBool)] get; set; } + } + + /// + /// Base interface containing properties common to both file and directory items. + /// To access the properties of this interface, use the IFsiFileItem or IFsiDirectoryItem interface. + /// + // https://docs.microsoft.com/en-us/windows/win32/api/imapi2fs/nn-imapi2fs-ifsiitem + [PInvokeData("imapi2fs.h", MSDNShortId = "NN:imapi2fs.IFsiItem")] + [ComImport, Guid("2C941FD9-975B-59BE-A960-9A2A262853A5"), InterfaceType(ComInterfaceType.InterfaceIsDual)] + public interface IFsiItem + { + /// Retrieves the name of the directory or file item in the file system image. + /// String that contains the name of the file or directory item in the file system image. + /// To get the full path to the item, call the IFsiItem::get_FullPath method. + // https://docs.microsoft.com/en-us/windows/win32/api/imapi2fs/nf-imapi2fs-ifsiitem-get_name HRESULT get_Name( BSTR *pVal ); + [DispId(11)] + string Name { [return: MarshalAs(UnmanagedType.BStr)] get; } + + /// Retrieves the full path of the file or directory item in the file system image. + /// String that contains the absolute path of the file or directory item in the file system image. + // https://docs.microsoft.com/en-us/windows/win32/api/imapi2fs/nf-imapi2fs-ifsiitem-get_fullpath HRESULT get_FullPath( BSTR + // *pVal ); + [DispId(12)] + string FullPath { [return: MarshalAs(UnmanagedType.BStr)] get; } + + /// Gets or sets the date and time that the directory or file item was created and added to the file system image. + /// + /// Date and time that the directory or file item was created and added to the file system image, according to UTC time. + /// Defaults to the time the item was added to the image. + /// + /// + /// IMAPI does not support the extended attribute for CreationTime, and as a result, UDFS populates the CreationTime with the + /// value expressed by the LastAccessed property from the file entry. + /// + // https://docs.microsoft.com/en-us/windows/win32/api/imapi2fs/nf-imapi2fs-ifsiitem-put_creationtime HRESULT put_CreationTime( + // DATE newVal ); + [DispId(13)] + DateTime CreationTime { get; set; } + + /// Gets or sets the date and time that the directory or file item was last accessed in the file system image. + /// + /// Date and time that the directory or file item was last accessed in the file system image, according to UTC time. Defaults to + /// the time the item was added to the image. + /// + /// + /// + /// UDFS (UDF) uses the LastAccessedTime value for the CreationTime, as IMAPI does not currently support the CreationTime + /// extended attribue. + /// + /// + /// CDFS (ISO 9660) sets the LastAccessedTime value to 0, as only the recording time is stored within the File/Directory descriptor. + /// + /// + // https://docs.microsoft.com/en-us/windows/win32/api/imapi2fs/nf-imapi2fs-ifsiitem-put_lastaccessedtime HRESULT + // put_LastAccessedTime( DATE newVal ); + [DispId(14)] + DateTime LastAccessedTime { get; set; } + + /// Gets or sets the date and time that the item was last modified in the file system image. + /// + /// Date and time that the directory or file item was last modified in the file system image, according to UTC time. Defaults to + /// the time the item was added to the image. + /// + /// + /// + /// The last modified time is propagated to the attribute that users see when viewing the properties of a directory or a file. + /// + /// When implementing this method, a few things should be taken into consideration: + /// UDFS (UDF) will use the value provided by IFsiItem::put_LastModifiedTime as both the CreationTime and LastModifiedTime. + /// + /// CDFS (ISO 9660) uses the date/time of recording as the CreationTime and LastModifiedTime. As a result, CDFS sets the value + /// of LastModifiedTime to 0. + /// + /// + // https://docs.microsoft.com/en-us/windows/win32/api/imapi2fs/nf-imapi2fs-ifsiitem-put_lastmodifiedtime HRESULT + // put_LastModifiedTime( DATE newVal ); + [DispId(15)] + DateTime LastModifiedTime { get; set; } + + /// Determines if the item's hidden attribute is set in the file system image. + /// + /// Set to VARIANT_TRUE to set the hidden attribute of the item in the file system image; otherwise, VARIANT_FALSE. The default + /// is VARIANT_FALSE. + /// + // https://docs.microsoft.com/en-us/windows/win32/api/imapi2fs/nf-imapi2fs-ifsiitem-put_ishidden HRESULT put_IsHidden( + // VARIANT_BOOL newVal ); + [DispId(16)] + bool IsHidden { [return: MarshalAs(UnmanagedType.VariantBool)] get; set; } + + /// Retrieves the name of the item as modified to conform to the specified file system. + /// + /// File system to which the name should conform. For possible values, see the FsiFileSystems enumeration type. + /// + /// + /// String that contains the name of the item as it conforms to the specified file system. The name in the IFsiItem::get_Name + /// property is modified if the characters used and its length do not meet the requirements of the specified file system type. + /// + // https://docs.microsoft.com/en-us/windows/win32/api/imapi2fs/nf-imapi2fs-ifsiitem-filesystemname HRESULT FileSystemName( + // FsiFileSystems fileSystem, BSTR *pVal ); + [DispId(17)] + [return: MarshalAs(UnmanagedType.BStr)] + string FileSystemName(FsiFileSystems fileSystem); + + /// Retrieves the full path of the item as modified to conform to the specified file system. + /// + /// File system to which the path should conform. For possible values, see the FsiFileSystems enumeration type. + /// + /// + /// String that contains the full path of the item as it conforms to the specified file system. The path in the + /// IFsiItem::get_FullPath property is modified if the characters used and its length do not meet the requirements of the + /// specified file system type. + /// + // https://docs.microsoft.com/en-us/windows/win32/api/imapi2fs/nf-imapi2fs-ifsiitem-filesystempath HRESULT FileSystemPath( + // FsiFileSystems fileSystem, BSTR *pVal ); + [DispId(18)] + [return: MarshalAs(UnmanagedType.BStr)] + string FileSystemPath(FsiFileSystems fileSystem); + } + + /// Use this interface to enumerate the named streams associated with a file in a file system image. + /// + /// + /// To access this interface, call the IFsiFileItem2::get_FsiNamedStreams method of a file item object representing a standard or + /// 'Real-Time' file. + /// + /// + /// This interface is provided only for file item objects representing regular or 'Real-Time' files. Named streams cannot have other + /// name streams associated with them. + /// + /// UDF must be enabled and set to UDF revision 2.00 or later in order to enable named stream support. + /// + /// This interface 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/imapi2fs/nn-imapi2fs-ifsinamedstreams + [PInvokeData("imapi2fs.h", MSDNShortId = "NN:imapi2fs.IFsiNamedStreams")] + [ComImport, Guid("ED79BA56-5294-4250-8D46-F9AECEE23459"), InterfaceType(ComInterfaceType.InterfaceIsDual), CoClass(typeof(FsiNamedStreams))] + public interface IFsiNamedStreams : IEnumerable + { + /// Retrieves an IEnumVARIANT list of the named streams associated with a file in the file system image. + /// + /// Pointer to a pointer to an IEnumVariant interface that is used to enumerate the named streams associated with a file. + /// The items of the enumeration are variants whose type is VT_BSTR. Use the bstrVal member to retrieve the path + /// to the named stream. + /// + /// + /// + /// The enumeration is a snapshot of the named streams associated with the file at the time of the call and will not reflect + /// named streams that are added or removed later on. + /// + /// To retrieve a single named stream, use the IFsiNamedStreams::get_Item method. + /// + /// This method 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/imapi2fs/nf-imapi2fs-ifsinamedstreams-get__newenum HRESULT get__NewEnum( + // IEnumVARIANT **NewEnum ); + [DispId(-4)] + [return: MarshalAs(UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof(EnumeratorToEnumVariantMarshaler))] + new IEnumerator GetEnumerator(); + + /// Retrieves a single named stream associated with a file in the file system image. + /// + /// This value indicates the position of the named stream within the collection. The index number is zero-based, i.e. the first + /// item is at location 0 of the collection. + /// + /// + /// Pointer to a pointer to an IFsiFileItem2 object representing the named stream at the position specified by index. This + /// parameter is set to NULL if the specified index is not within the collection boundary. + /// + /// + /// If the index number is negative or out of range, this method returns the IMAPI_E_INVALID_PARAM. + /// + /// To fetch an IEnumVARIANT enumerator for all named streams associated with a file, use the + /// IFsiNamedStreams::get__NewEnum method. + /// + /// + /// This method 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/imapi2fs/nf-imapi2fs-ifsinamedstreams-get_item HRESULT get_Item( LONG + // index, IFsiFileItem2 **item ); + [DispId(0)] + IFsiFileItem2 this[int index] { [return: MarshalAs(UnmanagedType.Interface)] get; } + + /// Returns the number of the named streams associated with a file in the file system image. + /// Pointer to a value indicating the total number of named streams in the collection. + /// + /// This method 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/imapi2fs/nf-imapi2fs-ifsinamedstreams-get_count HRESULT get_Count( LONG + // *count ); + [DispId(81)] + int Count { get; } + + /// + /// Creates a non-variant enumerator for the collection of the named streams associated with a file in the file system image. + /// + /// Pointer to a pointer to an IEnumFsiItems object representing a collection of named streams associated with a file. + /// + /// This method 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/imapi2fs/nf-imapi2fs-ifsinamedstreams-get_enumnamedstreams HRESULT + // get_EnumNamedStreams( IEnumFsiItems **NewEnum ); + [DispId(82)] + IEnumFsiItems EnumNamedStreams { [return: MarshalAs(UnmanagedType.Interface)] get; } + } + + /// Use this interface to verify if an existing .iso file contains a valid file system for burning. + /// + /// + /// If a valid path is provided via SetPath, an IStream object will be created from the supplied image file and the + /// Stream property will be populated. If a valid IStream is provided via SetStream, it will be used directly for + /// image validation and the Path property will not be populated. + /// + /// + /// This interface 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/imapi2fs/nn-imapi2fs-iisoimagemanager + [PInvokeData("imapi2fs.h", MSDNShortId = "NN:imapi2fs.IIsoImageManager")] + [ComImport, Guid("6CA38BE5-FBBB-4800-95A1-A438865EB0D4"), InterfaceType(ComInterfaceType.InterfaceIsDual), CoClass(typeof(MsftIsoImageManager))] + public interface IIsoImageManager + { + /// Retrives the logical path to an .iso image. + /// Pointer to the logical path to an .iso image. For example, "c:\path\file.iso". + /// + /// This method 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/imapi2fs/nf-imapi2fs-iisoimagemanager-get_path HRESULT get_Path( BSTR + // *pVal ); + [DispId(0x100)] + string Path { [return: MarshalAs(UnmanagedType.BStr)] get; } + + /// Retrieves the IStream object associated with the .iso image. + /// The IStream object associated with the .iso image. + /// + /// This method 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/imapi2fs/nf-imapi2fs-iisoimagemanager-get_stream HRESULT get_Stream( + // IStream **data ); + [DispId(0x101)] + IStream Stream { [return: MarshalAs(UnmanagedType.Interface)] get; } + + /// Sets the Path property value with a logical path to an .iso image. + /// The logical path to the .iso image. For example, "c:\path\file.iso". + /// + /// This method 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/imapi2fs/nf-imapi2fs-iisoimagemanager-setpath HRESULT SetPath( BSTR Val ); + [DispId(0x200)] + void SetPath([In, MarshalAs(UnmanagedType.BStr)] string Val); + + /// Sets the Stream property with the IStream object associated with the .iso image. + /// The IStream object associated with the .iso image. + /// + /// This method 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/imapi2fs/nf-imapi2fs-iisoimagemanager-setstream HRESULT SetStream( IStream + // *data ); + [DispId(0x201)] + void SetStream([In, MarshalAs(UnmanagedType.Interface)] IStream data); + + /// + /// + /// Determines if the provided .iso image is valid. Note Support for this interface method is included in the latest + /// Windows Feature Pack for Storage Beta release offered via Microsoft Connect. + /// + /// Syntax + /// + /// void IsValid(); + /// + /// Parameters + /// This method has no parameters. + /// Return Value + /// This method does not return a value. + /// Remarks + /// Requirements + /// + /// + /// Client + /// Windows Vista or Windows XP with SP2 + /// + /// + /// Server + /// Windows Server 2008 or Windows Server 2003 + /// + /// + /// IDL + /// Imapi2.idl + /// + /// + /// See Also + /// IIsoImageManager + /// Send comments about this topic to Microsoft + /// Build date: 10/30/2008 + /// + /// + /// This method does not return a value. + /// Remarks + /// Requirements + /// + /// + /// Client + /// Windows Vista or Windows XP with SP2 + /// + /// + /// Server + /// Windows Server 2008 or Windows Server 2003 + /// + /// + /// IDL + /// Imapi2.idl + /// + /// + /// See Also + /// IIsoImageManager + /// Send comments about this topic to Microsoft + /// Build date: 10/30/2008 + /// + /// + /// Requirements + /// + /// + /// Client + /// Windows Vista or Windows XP with SP2 + /// + /// + /// Server + /// Windows Server 2008 or Windows Server 2003 + /// + /// + /// IDL + /// Imapi2.idl + /// + /// + /// See Also + /// IIsoImageManager + /// Send comments about this topic to Microsoft + /// Build date: 10/30/2008 + /// + // https://docs.microsoft.com/en-us/previous-versions/cc507536(v%3dvs.85) void IsValid(); + [DispId(0x202)] + [PreserveSig] + HRESULT Validate(); + } + + /// + /// + /// Use this interface to retrieve block information for one segment of the result file image. This can be used to determine the LBA + /// ranges of files in the resulting image. This information can then be used to display to the user which file is currently being + /// written to the media or used for other advanced burning functionality. + /// + /// To get this interface, call the IEnumProgressItems::Next or IEnumProgressItems::RemoteNext method. + /// + /// This is a ProgressItem object in script. + // https://docs.microsoft.com/en-us/windows/win32/api/imapi2fs/nn-imapi2fs-iprogressitem + [PInvokeData("imapi2fs.h", MSDNShortId = "NN:imapi2fs.IProgressItem")] + [ComImport, Guid("2C941FD5-975B-59BE-A960-9A2A262853A5"), InterfaceType(ComInterfaceType.InterfaceIsDual), CoClass(typeof(ProgressItem))] + public interface IProgressItem + { + /// Retrieves the description in the progress item. + /// String containing the description. The description contains the name of the file in the file system image. + // https://docs.microsoft.com/en-us/windows/win32/api/imapi2fs/nf-imapi2fs-iprogressitem-get_description HRESULT + // get_Description( BSTR *desc ); + [DispId(1)] + string Description { [return: MarshalAs(UnmanagedType.BStr)] get; } + + /// Retrieves the first block number in this segment of the result image. + /// First block number of this segment. + // https://docs.microsoft.com/en-us/windows/win32/api/imapi2fs/nf-imapi2fs-iprogressitem-get_firstblock HRESULT get_FirstBlock( + // ULONG *block ); + [DispId(2)] + uint FirstBlock { get; } + + /// Retrieves the last block in this segment of the result image. + /// Number of the last block of this segment. + // https://docs.microsoft.com/en-us/windows/win32/api/imapi2fs/nf-imapi2fs-iprogressitem-get_lastblock HRESULT get_LastBlock( + // ULONG *block ); + [DispId(3)] + uint LastBlock { get; } + + /// Retrieves the number of blocks in the progress item. + /// Number of blocks in the segment. + // https://docs.microsoft.com/en-us/windows/win32/api/imapi2fs/nf-imapi2fs-iprogressitem-get_blockcount HRESULT get_BlockCount( + // ULONG *blocks ); + [DispId(4)] + uint BlockCount { get; } + } + + /// + /// + /// Use this interface to enumerate the progress items in a result image. A progress item represents a segment of the result image. + /// + /// To get this interface, call the IFileSystemImageResult::get_ProgressItems method. + /// + /// This is a ProgressItems object in script. + // https://docs.microsoft.com/en-us/windows/win32/api/imapi2fs/nn-imapi2fs-iprogressitems + [PInvokeData("imapi2fs.h", MSDNShortId = "NN:imapi2fs.IProgressItems")] + [ComImport, Guid("2C941FD7-975B-59BE-A960-9A2A262853A5"), InterfaceType(ComInterfaceType.InterfaceIsDual), CoClass(typeof(ProgressItems))] + public interface IProgressItems : IEnumerable + { + /// Retrieves the list of progress items from the collection. + /// + /// An IEnumVariant interface that you use to enumerate the progress items contained within the collection. Each item of + /// the enumeration is a VARIANT whose type is VT_DISPATCH. Query the pdispVal member to retrieve the + /// IProgressItem interface. + /// + /// + /// The enumeration is a snapshot of the progress items contained in the collection at the time of the call. + /// To retrieve a single item, see the IProgressItems::get_Item property. + /// + // https://docs.microsoft.com/en-us/windows/win32/api/imapi2fs/nf-imapi2fs-iprogressitems-get__newenum HRESULT get__NewEnum( + // IEnumVARIANT **NewEnum ); + [DispId(-4)] + [return: MarshalAs(UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof(EnumeratorToEnumVariantMarshaler))] + new IEnumerator GetEnumerator(); + + /// Retrieves the specified progress item from the collection. + /// Zero-based index number corresponding to a progress item in the collection. + /// An IProgressItem interface associated with the specified index value. + /// To enumerate all progress items, call the IProgressItems::get__NewEnum method. + // https://docs.microsoft.com/en-us/windows/win32/api/imapi2fs/nf-imapi2fs-iprogressitems-get_item HRESULT get_Item( long Index, + // IProgressItem **item ); + [DispId(0)] + IProgressItem this[int item] { get; } + + /// Retrieves the number of progress items in the collection. + /// Number of progress items in the collection. + // https://docs.microsoft.com/en-us/windows/win32/api/imapi2fs/nf-imapi2fs-iprogressitems-get_count HRESULT get_Count( long + // *Count ); + [DispId(1)] + int Count { get; } + + /// Retrieves a progress item based on the specified block number. + /// + /// Block number of the progress item to retrieve. The method returns the progress item if the block number is in the first and + /// last block range of the item. + /// + /// An IProgressItem interface associated with the specified block number. + // https://docs.microsoft.com/en-us/windows/win32/api/imapi2fs/nf-imapi2fs-iprogressitems-progressitemfromblock HRESULT + // ProgressItemFromBlock( ULONG block, IProgressItem **item ); + [DispId(2)] + IProgressItem ProgressItemFromBlock(uint block); + + /// Retrieves a progress item based on the specified file name. + /// + /// String that contains the file name of the progress item to retrieve. The method returns the progress item if this string + /// matches the value for item's description property. + /// + /// An IProgressItem interface of the progress item associated with the specified file name. + // https://docs.microsoft.com/en-us/windows/win32/api/imapi2fs/nf-imapi2fs-iprogressitems-progressitemfromdescription HRESULT + // ProgressItemFromDescription( BSTR description, IProgressItem **item ); + [DispId(3)] + IProgressItem ProgressItemFromDescription([MarshalAs(UnmanagedType.BStr)] string description); + + /// Retrieves the list of progress items from the collection. + /// An IEnumProgressItems interface that contains a collection of the progress items contained in the collection. + /// + /// This property returns the same results as the IProgressItems::get__NewEnum property and is meant for use by C/C++ applications. + /// + // https://docs.microsoft.com/en-us/windows/win32/api/imapi2fs/nf-imapi2fs-iprogressitems-get_enumprogressitems HRESULT + // get_EnumProgressItems( IEnumProgressItems **NewEnum ); + [DispId(4)] + IEnumProgressItems EnumProgressItems { get; } + } + + /// CLSID_BlockRange + [ComImport, Guid("B507CA27-2204-11DD-966A-001AA01BBC58"), ClassInterface(ClassInterfaceType.None)] + public class BlockRange { } + + /// CLSID_BlockRangeList + [ComImport, Guid("B507CA28-2204-11DD-966A-001AA01BBC58"), ClassInterface(ClassInterfaceType.None)] + public class BlockRangeList { } + + /// CLSID_BootOptions + [ComImport, Guid("2C941FCE-975B-59BE-A960-9A2A262853A5"), ClassInterface(ClassInterfaceType.None)] + public class BootOptions { } + + /// CLSID_EnumFsiItems + [ComImport, Guid("2C941FC6-975B-59BE-A960-9A2A262853A5"), ClassInterface(ClassInterfaceType.None)] + public class EnumFsiItems { } + + /// CLSID_EnumProgressItems + [ComImport, Guid("2C941FCA-975B-59BE-A960-9A2A262853A5"), ClassInterface(ClassInterfaceType.None)] + public class EnumProgressItems { } + + /// CLSID_FileSystemImageResult + [ComImport, Guid("2C941FCC-975B-59BE-A960-9A2A262853A5"), ClassInterface(ClassInterfaceType.None)] + public class FileSystemImageResult { } + + /// CLSID_FsiDirectoryItem + [ComImport, Guid("2C941FC8-975B-59BE-A960-9A2A262853A5"), ClassInterface(ClassInterfaceType.None)] + public class FsiDirectoryItem { } + + /// CLSID_FsiFileItem + [ComImport, Guid("2C941FC7-975B-59BE-A960-9A2A262853A5"), ClassInterface(ClassInterfaceType.None)] + public class FsiFileItem { } + + /// CLSID_FsiNamedStreams + [ComImport, Guid("C6B6F8ED-6D19-44b4-B539-B159B793A32D"), ClassInterface(ClassInterfaceType.None)] + public class FsiNamedStreams { } + + /// CLSID_FsiStream + [ComImport, Guid("2C941FCD-975B-59BE-A960-9A2A262853A5"), ClassInterface(ClassInterfaceType.None)] + public class FsiStream { } + + /// CLSID_MsftFileSystemImage + [ComImport, Guid("2C941FC5-975B-59BE-A960-9A2A262853A5"), ClassInterface(ClassInterfaceType.None)] + public class MsftFileSystemImage { } + + /// CLSID_MsftIsoImageManager + [ComImport, Guid("CEEE3B62-8F56-4056-869B-EF16917E3EFC"), ClassInterface(ClassInterfaceType.None)] + public class MsftIsoImageManager { } + + /// CLSID_ProgressItem + [ComImport, Guid("2C941FCB-975B-59BE-A960-9A2A262853A5"), ClassInterface(ClassInterfaceType.None)] + public class ProgressItem { } + + /// CLSID_ProgressItems + [ComImport, Guid("2C941FC9-975B-59BE-A960-9A2A262853A5"), ClassInterface(ClassInterfaceType.None)] + public class ProgressItems { } + } +} \ No newline at end of file diff --git a/PInvoke/IMAPI/Vanara.PInvoke.IMAPI.csproj b/PInvoke/IMAPI/Vanara.PInvoke.IMAPI.csproj new file mode 100644 index 00000000..7cee7c16 --- /dev/null +++ b/PInvoke/IMAPI/Vanara.PInvoke.IMAPI.csproj @@ -0,0 +1,23 @@ + + + + imapi2.dll;imapi2fs.dll + + + PInvoke API (interfaces and constants) imported from Windows Image Mastering API. + $(AssemblyName) + net20;net35;net40;net45;net5.0-windows;netstandard2.0;netcoreapp2.0;netcoreapp2.1;netcoreapp3.0;netcoreapp3.1 + Vanara.PInvoke.IMAPI + $(AssemblyName) + pinvoke;vanara;net-extensions;interop;IMAPI;Image Mastering + + + + + + + + + + + \ No newline at end of file diff --git a/PInvoke/Shared/WinError/HRESULT.Values.cs b/PInvoke/Shared/WinError/HRESULT.Values.cs index 9f6ce164..f709d8e8 100644 --- a/PInvoke/Shared/WinError/HRESULT.Values.cs +++ b/PInvoke/Shared/WinError/HRESULT.Values.cs @@ -9502,5 +9502,275 @@ namespace Vanara.PInvoke public static readonly HRESULT DRT_E_INVALID_SECURITY_MODE = Make(true, 98U, 0x210e); /// public static readonly HRESULT DRT_E_CAPABILITY_MISMATCH = Make(true, 98U, 0x210f); + + /// The request was cancelled. + public const int E_IMAPI_REQUEST_CANCELLED = unchecked((int)0xC0AA0002); + + /// The request requires a current disc recorder to be selected. + public const int E_IMAPI_RECORDER_REQUIRED = unchecked((int)0xC0AA0003); + + /// The requested write speed was not supported by the drive and the speed was adjusted. + public const int S_IMAPI_SPEEDADJUSTED = unchecked((int)0x00AA0004); + + /// The requested rotation type was not supported by the drive and the rotation type was adjusted. + public const int S_IMAPI_ROTATIONADJUSTED = unchecked((int)0x00AA0005); + + /// The requested write speed and rotation type were not supported by the drive and they were both adjusted. + public const int S_IMAPI_BOTHADJUSTED = unchecked((int)0x00AA0006); + + /// The disc did not pass burn verification and may contain corrupt data or be unusable. + public const int E_IMAPI_BURN_VERIFICATION_FAILED = unchecked((int)0xC0AA0007); + + /// The device accepted the command, but returned sense data, indicating an error. + public const int S_IMAPI_COMMAND_HAS_SENSE_DATA = unchecked((int)0x00AA0200); + + /// The device reported that the requested mode page (and type) is not present. + public const int E_IMAPI_RECORDER_NO_SUCH_MODE_PAGE = unchecked((int)0xC0AA0201); + + /// There is no media in the device. + public const int E_IMAPI_RECORDER_MEDIA_NO_MEDIA = unchecked((int)0xC0AA0202); + + /// The media is not compatible or of unknown physical format. + public const int E_IMAPI_RECORDER_MEDIA_INCOMPATIBLE = unchecked((int)0xC0AA0203); + + /// The media is inserted upside down. + public const int E_IMAPI_RECORDER_MEDIA_UPSIDE_DOWN = unchecked((int)0xC0AA0204); + + /// The drive reported that it is in the process of becoming ready. Please try the request again later. + public const int E_IMAPI_RECORDER_MEDIA_BECOMING_READY = unchecked((int)0xC0AA0205); + + /// The media is currently being formatted. Please wait for the format to complete before attempting to use the media. + public const int E_IMAPI_RECORDER_MEDIA_FORMAT_IN_PROGRESS = unchecked((int)0xC0AA0206); + + /// The drive reported that it is performing a long-running operation, such as finishing a write. The drive may be unusable for a long period of time. + public const int E_IMAPI_RECORDER_MEDIA_BUSY = unchecked((int)0xC0AA0207); + + /// The drive reported that the combination of parameters provided in the mode page for a MODE SELECT command were not supported. + public const int E_IMAPI_RECORDER_INVALID_MODE_PARAMETERS = unchecked((int)0xC0AA0208); + + /// The drive reported that the media is write protected. + public const int E_IMAPI_RECORDER_MEDIA_WRITE_PROTECTED = unchecked((int)0xC0AA0209); + + /// The feature page requested is not supported by the device. + public const int E_IMAPI_RECORDER_NO_SUCH_FEATURE = unchecked((int)0xC0AA020A); + + /// The feature page requested is supported, but is not marked as current. + public const int E_IMAPI_RECORDER_FEATURE_IS_NOT_CURRENT = unchecked((int)0xC0AA020B); + + /// The drive does not support the GET CONFIGURATION command. + public const int E_IMAPI_RECORDER_GET_CONFIGURATION_NOT_SUPPORTED = unchecked((int)0xC0AA020C); + + /// The device failed to accept the command within the timeout period. This may be caused by the device having entered an inconsistent state, or the timeout value for the command may need to be increased. + public const int E_IMAPI_RECORDER_COMMAND_TIMEOUT = unchecked((int)0xC0AA020D); + + /// The DVD structure is not present. This may be caused by incompatible drive/medium used. + public const int E_IMAPI_RECORDER_DVD_STRUCTURE_NOT_PRESENT = unchecked((int)0xC0AA020E); + + /// The media's speed is incompatible with the device. This may be caused by using higher or lower speed media than the range of speeds supported by the device. + public const int E_IMAPI_RECORDER_MEDIA_SPEED_MISMATCH = unchecked((int)0xC0AA020F); + + /// The device associated with this recorder during the last operation has been exclusively locked, causing this operation to failed. + public const int E_IMAPI_RECORDER_LOCKED = unchecked((int)0xC0AA0210); + + /// The client name is not valid. + public const int E_IMAPI_RECORDER_CLIENT_NAME_IS_NOT_VALID = unchecked((int)0xC0AA0211); + + /// The media is not formatted. Please format the media before attempting to use it. + public const int E_IMAPI_RECORDER_MEDIA_NOT_FORMATTED = unchecked((int)0xC0AA0212); + + /// The device reported unexpected or invalid data for a command. + public const int E_IMAPI_RECORDER_INVALID_RESPONSE_FROM_DEVICE = unchecked((int)0xC0AA02FF); + + /// The write failed because the drive did not receive data quickly enough to continue writing. Moving the source data to the local computer, reducing the write speed, or enabling a "buffer underrun free" setting may resolve this issue. + public const int E_IMAPI_LOSS_OF_STREAMING = unchecked((int)0xC0AA0300); + + /// The write failed because the drive returned error information that could not be recovered from. + public const int E_IMAPI_UNEXPECTED_RESPONSE_FROM_DEVICE = unchecked((int)0xC0AA0301); + + /// There is no write operation currently in progress. + public const int S_IMAPI_WRITE_NOT_IN_PROGRESS = unchecked((int)0x00AA0302); + + /// There is currently a write operation in progress. + public const int E_IMAPI_DF2DATA_WRITE_IN_PROGRESS = unchecked((int)0xC0AA0400); + + /// There is no write operation currently in progress. + public const int E_IMAPI_DF2DATA_WRITE_NOT_IN_PROGRESS = unchecked((int)0xC0AA0401); + + /// The requested operation is only valid with supported media. + public const int E_IMAPI_DF2DATA_INVALID_MEDIA_STATE = unchecked((int)0xC0AA0402); + + /// The provided stream to write is not supported. + public const int E_IMAPI_DF2DATA_STREAM_NOT_SUPPORTED = unchecked((int)0xC0AA0403); + + /// The provided stream to write is too large for the currently inserted media. + public const int E_IMAPI_DF2DATA_STREAM_TOO_LARGE_FOR_CURRENT_MEDIA = unchecked((int)0xC0AA0404); + + /// Overwriting non-blank media is not allowed without the ForceOverwrite property set to VARIANT_TRUE. + public const int E_IMAPI_DF2DATA_MEDIA_NOT_BLANK = unchecked((int)0xC0AA0405); + + /// The current media type is unsupported. + public const int E_IMAPI_DF2DATA_MEDIA_IS_NOT_SUPPORTED = unchecked((int)0xC0AA0406); + + /// This device does not support the operations required by this disc format. + public const int E_IMAPI_DF2DATA_RECORDER_NOT_SUPPORTED = unchecked((int)0xC0AA0407); + + /// The client name is not valid. + public const int E_IMAPI_DF2DATA_CLIENT_NAME_IS_NOT_VALID = unchecked((int)0xC0AA0408); + + /// There is currently a write operation in progress. + public const int E_IMAPI_DF2TAO_WRITE_IN_PROGRESS = unchecked((int)0xC0AA0500); + + /// There is no write operation currently in progress. + public const int E_IMAPI_DF2TAO_WRITE_NOT_IN_PROGRESS = unchecked((int)0xC0AA0501); + + /// The requested operation is only valid when media has been "prepared". + public const int E_IMAPI_DF2TAO_MEDIA_IS_NOT_PREPARED = unchecked((int)0xC0AA0502); + + /// The requested operation is not valid when media has been "prepared" but not released. + public const int E_IMAPI_DF2TAO_MEDIA_IS_PREPARED = unchecked((int)0xC0AA0503); + + /// The property cannot be changed once the media has been written to. + public const int E_IMAPI_DF2TAO_PROPERTY_FOR_BLANK_MEDIA_ONLY = unchecked((int)0xC0AA0504); + + /// The table of contents cannot be retrieved from an empty disc. + public const int E_IMAPI_DF2TAO_TABLE_OF_CONTENTS_EMPTY_DISC = unchecked((int)0xC0AA0505); + + /// Only blank CD-R/RW media is supported. + public const int E_IMAPI_DF2TAO_MEDIA_IS_NOT_BLANK = unchecked((int)0xC0AA0506); + + /// Only blank CD-R/RW media is supported. + public const int E_IMAPI_DF2TAO_MEDIA_IS_NOT_SUPPORTED = unchecked((int)0xC0AA0507); + + /// CD-R and CD-RW media support a maximum of 99 audio tracks. + public const int E_IMAPI_DF2TAO_TRACK_LIMIT_REACHED = unchecked((int)0xC0AA0508); + + /// There is not enough space left on the media to add the provided audio track. + public const int E_IMAPI_DF2TAO_NOT_ENOUGH_SPACE = unchecked((int)0xC0AA0509); + + /// You cannot prepare the media until you choose a recorder to use. + public const int E_IMAPI_DF2TAO_NO_RECORDER_SPECIFIED = unchecked((int)0xC0AA050A); + + /// The ISRC provided is not valid. + public const int E_IMAPI_DF2TAO_INVALID_ISRC = unchecked((int)0xC0AA050B); + + /// The Media Catalog Number provided is not valid. + public const int E_IMAPI_DF2TAO_INVALID_MCN = unchecked((int)0xC0AA050C); + + /// The provided audio stream is not valid. + public const int E_IMAPI_DF2TAO_STREAM_NOT_SUPPORTED = unchecked((int)0xC0AA050D); + + /// This device does not support the operations required by this disc format. + public const int E_IMAPI_DF2TAO_RECORDER_NOT_SUPPORTED = unchecked((int)0xC0AA050E); + + /// The client name is not valid. + public const int E_IMAPI_DF2TAO_CLIENT_NAME_IS_NOT_VALID = unchecked((int)0xC0AA050F); + + /// There is currently a write operation in progress. + public const int E_IMAPI_DF2RAW_WRITE_IN_PROGRESS = unchecked((int)0xC0AA0600); + + /// There is no write operation currently in progress. + public const int E_IMAPI_DF2RAW_WRITE_NOT_IN_PROGRESS = unchecked((int)0xC0AA0601); + + /// The requested operation is only valid when media has been "prepared". + public const int E_IMAPI_DF2RAW_MEDIA_IS_NOT_PREPARED = unchecked((int)0xC0AA0602); + + /// The requested operation is not valid when media has been "prepared" but not released. + public const int E_IMAPI_DF2RAW_MEDIA_IS_PREPARED = unchecked((int)0xC0AA0603); + + /// The client name is not valid. + public const int E_IMAPI_DF2RAW_CLIENT_NAME_IS_NOT_VALID = unchecked((int)0xC0AA0604); + + /// Only blank CD-R/RW media is supported. + public const int E_IMAPI_DF2RAW_MEDIA_IS_NOT_BLANK = unchecked((int)0xC0AA0606); + + /// Only blank CD-R/RW media is supported. + public const int E_IMAPI_DF2RAW_MEDIA_IS_NOT_SUPPORTED = unchecked((int)0xC0AA0607); + + /// There is not enough space on the media to add the provided session. + public const int E_IMAPI_DF2RAW_NOT_ENOUGH_SPACE = unchecked((int)0xC0AA0609); + + /// You cannot prepare the media until you choose a recorder to use. + public const int E_IMAPI_DF2RAW_NO_RECORDER_SPECIFIED = unchecked((int)0xC0AA060A); + + /// The provided audio stream is not valid. + public const int E_IMAPI_DF2RAW_STREAM_NOT_SUPPORTED = unchecked((int)0xC0AA060D); + + /// The requested data block type is not supported by the current device. + public const int E_IMAPI_DF2RAW_DATA_BLOCK_TYPE_NOT_SUPPORTED = unchecked((int)0xC0AA060E); + + /// The stream does not contain a sufficient number of sectors in the leadin for the current media. + public const int E_IMAPI_DF2RAW_STREAM_LEADIN_TOO_SHORT = unchecked((int)0xC0AA060F); + + /// This device does not support the operations required by this disc format. + public const int E_IMAPI_DF2RAW_RECORDER_NOT_SUPPORTED = unchecked((int)0xC0AA0610); + + /// The format is currently using the disc recorder for an erase operation. Please wait for the erase to complete before attempting to set or clear the current disc recorder. + public const int E_IMAPI_ERASE_RECORDER_IN_USE = unchecked((int)0x80AA0900); + + /// The erase format only supports one recorder. You must clear the current recorder before setting a new one. + public const int E_IMAPI_ERASE_ONLY_ONE_RECORDER_SUPPORTED = unchecked((int)0x80AA0901); + + /// The drive did not report sufficient data for a READ DISC INFORMATION command. The drive may not be supported, or the media may not be correct. + public const int E_IMAPI_ERASE_DISC_INFORMATION_TOO_SMALL = unchecked((int)0x80AA0902); + + /// The drive did not report sufficient data for a MODE SENSE (page 0x2A) command. The drive may not be supported, or the media may not be correct. + public const int E_IMAPI_ERASE_MODE_PAGE_2A_TOO_SMALL = unchecked((int)0x80AA0903); + + /// The drive reported that the media is not erasable. + public const int E_IMAPI_ERASE_MEDIA_IS_NOT_ERASABLE = unchecked((int)0x80AA0904); + + /// The drive failed the erase command. + public const int E_IMAPI_ERASE_DRIVE_FAILED_ERASE_COMMAND = unchecked((int)0x80AA0905); + + /// The drive did not complete the erase in one hour. The drive may require a power cycle, media removal, or other manual intervention to resume proper operation. + public const int E_IMAPI_ERASE_TOOK_LONGER_THAN_ONE_HOUR = unchecked((int)0x80AA0906); + + /// The drive returned an unexpected error during the erase. The the media may be unusable, the erase may be complete, or the drive may still be in the process of erasing the disc. + public const int E_IMAPI_ERASE_UNEXPECTED_DRIVE_RESPONSE_DURING_ERASE = unchecked((int)0x80AA0907); + + /// The drive returned an error for a START UNIT (spinup) command. Manual intervention may be required. + public const int E_IMAPI_ERASE_DRIVE_FAILED_SPINUP_COMMAND = unchecked((int)0x80AA0908); + + /// The current media type is unsupported. + public const int E_IMAPI_ERASE_MEDIA_IS_NOT_SUPPORTED = unchecked((int)0xC0AA0909); + + /// This device does not support the operations required by this disc format. + public const int E_IMAPI_ERASE_RECORDER_NOT_SUPPORTED = unchecked((int)0xC0AA090A); + + /// The client name is not valid. + public const int E_IMAPI_ERASE_CLIENT_NAME_IS_NOT_VALID = unchecked((int)0xC0AA090B); + + /// The image has become read-only from a call to CreateResultImage(). The object can no longer be modified. + public const int E_IMAPI_RAW_IMAGE_IS_READ_ONLY = unchecked((int)0x80AA0A00); + + /// No more tracks may be added, as CD media is restricted to track numbers between 1 and 99. + public const int E_IMAPI_RAW_IMAGE_TOO_MANY_TRACKS = unchecked((int)0x80AA0A01); + + /// The requested sector type is not supported. + public const int E_IMAPI_RAW_IMAGE_SECTOR_TYPE_NOT_SUPPORTED = unchecked((int)0x80AA0A02); + + /// Tracks must be added to the image before using this function. + public const int E_IMAPI_RAW_IMAGE_NO_TRACKS = unchecked((int)0x80AA0A03); + + /// Tracks may not be added to the image prior to the use of this function. + public const int E_IMAPI_RAW_IMAGE_TRACKS_ALREADY_ADDED = unchecked((int)0x80AA0A04); + + /// Adding the track would result in exceeding the limit for the start of the leadout. + public const int E_IMAPI_RAW_IMAGE_INSUFFICIENT_SPACE = unchecked((int)0x80AA0A05); + + /// Adding the track index would result in exceeding the 99 index limit. + public const int E_IMAPI_RAW_IMAGE_TOO_MANY_TRACK_INDEXES = unchecked((int)0x80AA0A06); + + /// The specified LBA offset is not in the list of track indexes. + public const int E_IMAPI_RAW_IMAGE_TRACK_INDEX_NOT_FOUND = unchecked((int)0x80AA0A07); + + /// The specified LBA offset is already in the list of track indexes. + public const int S_IMAPI_RAW_IMAGE_TRACK_INDEX_ALREADY_EXISTS = unchecked((int)0x00AA0A08); + + /// Index 1 (LBA offset zero) may not be cleared. + public const int E_IMAPI_RAW_IMAGE_TRACK_INDEX_OFFSET_ZERO_CANNOT_BE_CLEARED = unchecked((int)0x80AA0A09); + + /// Each index must have a minimum size of ten sectors. + public const int E_IMAPI_RAW_IMAGE_TRACK_INDEX_TOO_CLOSE_TO_OTHER_INDEX = unchecked((int)0x80AA0A0A); } } \ No newline at end of file diff --git a/Vanara.sln b/Vanara.sln index 32a28d96..c7bf7a8b 100644 --- a/Vanara.sln +++ b/Vanara.sln @@ -303,6 +303,8 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Vanara.PInvoke.FunDisc", "P EndProject Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Vanara.PInvoke.WcnApi", "PInvoke\WcnApi\Vanara.PInvoke.WcnApi.csproj", "{55952C51-B68B-432E-A168-4ADD569B9274}" EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Vanara.PInvoke.IMAPI", "PInvoke\IMAPI\Vanara.PInvoke.IMAPI.csproj", "{17EFDD95-3E52-44C1-80D9-48031E3F6B3F}" +EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution Debug|Any CPU = Debug|Any CPU @@ -983,6 +985,12 @@ Global {55952C51-B68B-432E-A168-4ADD569B9274}.DebugNoTests|Any CPU.Build.0 = Debug|Any CPU {55952C51-B68B-432E-A168-4ADD569B9274}.Release|Any CPU.ActiveCfg = Release|Any CPU {55952C51-B68B-432E-A168-4ADD569B9274}.Release|Any CPU.Build.0 = Release|Any CPU + {17EFDD95-3E52-44C1-80D9-48031E3F6B3F}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {17EFDD95-3E52-44C1-80D9-48031E3F6B3F}.Debug|Any CPU.Build.0 = Debug|Any CPU + {17EFDD95-3E52-44C1-80D9-48031E3F6B3F}.DebugNoTests|Any CPU.ActiveCfg = Debug|Any CPU + {17EFDD95-3E52-44C1-80D9-48031E3F6B3F}.DebugNoTests|Any CPU.Build.0 = Debug|Any CPU + {17EFDD95-3E52-44C1-80D9-48031E3F6B3F}.Release|Any CPU.ActiveCfg = Release|Any CPU + {17EFDD95-3E52-44C1-80D9-48031E3F6B3F}.Release|Any CPU.Build.0 = Release|Any CPU EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE @@ -1115,6 +1123,7 @@ Global {6FFDB484-24E0-4338-B816-D9975AF35853} = {212ABBD0-B724-4CFA-9D6D-E3891547FA90} {D0CD8393-BE38-4B9D-911F-C372293EF62D} = {212ABBD0-B724-4CFA-9D6D-E3891547FA90} {55952C51-B68B-432E-A168-4ADD569B9274} = {212ABBD0-B724-4CFA-9D6D-E3891547FA90} + {17EFDD95-3E52-44C1-80D9-48031E3F6B3F} = {212ABBD0-B724-4CFA-9D6D-E3891547FA90} EndGlobalSection GlobalSection(ExtensibilityGlobals) = postSolution SolutionGuid = {543FAC75-2AF1-4EF1-9609-B242B63FEED4}