Click here to Skip to main content
15,896,348 members
Articles / Programming Languages / C#

SCSI Library in C# - Burn CDs and DVDs, Access Hard Disks, etc.

Rate me:
Please Sign up or sign in to vote.
4.77/5 (48 votes)
19 Jun 2017Ms-PL6 min read 146.3K   8.1K   146  
Ever wonder how programs like Nero work? They make their own SCSI libraries... like this!
using System.Runtime.InteropServices;
using System.Diagnostics;
using System.Collections.ObjectModel;
using System.Collections.Generic;
using System;
using Helper;
using System.ComponentModel;
namespace Scsi.Multimedia
{
	[StructLayout(LayoutKind.Sequential, Pack = 1)]
	public abstract class Feature : IMarshalable
	{
		[DebuggerBrowsable(DebuggerBrowsableState.Never)]
		private const byte VERSION_MASK = 0x3C;
		[DebuggerBrowsable(DebuggerBrowsableState.Never)]
		private static readonly IntPtr FEATURE_CODE_OFFSET = Marshal.OffsetOf(typeof(Feature), "_FeatureCode");
		[DebuggerBrowsable(DebuggerBrowsableState.Never)]
		private static readonly IntPtr ADDITIONAL_LENGTH_OFFSET = Marshal.OffsetOf(typeof(Feature), "_AdditionalLength");
		private static IDictionary<MultimediaProfile, ReadOnlyCollection<FeatureCode>> __Profiles;

		protected Feature(FeatureCode featureCode) : base() { this.FeatureCode = featureCode; }

		[DebuggerBrowsable(DebuggerBrowsableState.Never)]
		private FeatureCode _FeatureCode;
		public FeatureCode FeatureCode { get { return Bits.BigEndian(this._FeatureCode); } private set { this._FeatureCode = Bits.BigEndian(value); } }
		[DebuggerBrowsable(DebuggerBrowsableState.Never)]
		private BitVector8 byte2;
		public bool Current { get { return this.byte2[0]; } protected set { this.byte2[0] = value; } }
		public bool Persistent { get { return this.byte2[1]; } protected set { this.byte2[1] = value; } }
		public byte Version
		{
			get { return Bits.GetValueMask((byte)this.byte2, 2, VERSION_MASK); }
			protected set { this.byte2 = (BitVector8)Bits.PutValueMask((byte)this.byte2, value, 2, VERSION_MASK); }
		}
		[DebuggerBrowsable(DebuggerBrowsableState.Never)]
		private byte _AdditionalLength;
		public byte AdditionalLength { get { return this._AdditionalLength; } protected set { this._AdditionalLength = value; } }

		public abstract IList<ScsiCommandCode> GetSupportedOperations();

		protected virtual void MarshalFrom(BufferWithSize buffer)
		{
			FeatureCode previousFeatureCode = this.FeatureCode;
			Marshaler.DefaultPtrToStructure(buffer, this);
			System.Diagnostics.Debug.Assert(previousFeatureCode == this.FeatureCode);
		}

		[DebuggerBrowsable(DebuggerBrowsableState.Never)]
		protected virtual int MarshaledSize { get { return Marshal.SizeOf(this) + this.AdditionalLength; } }

		protected virtual void MarshalTo(Helper.BufferWithSize buffer) { Marshaler.DefaultStructureToPtr((object)this, buffer); }

		public override string ToString()
		{
			return this.GetType().Name;
		}

		internal static Feature FromPtr(BufferWithSize buffer) { FeatureCode code = Feature.ReadFeatureCode(buffer); Feature result = CreateInstance(code); if (result != null) { result.MarshalFrom(buffer); } return result; }

		internal static Feature CreateInstance(FeatureCode code)
		{
			Feature result;
			switch (code)
			{
				case FeatureCode.ProfileList:
					result = new ProfileListFeature();
					break;
				case FeatureCode.Core:
					result = new CoreFeature();
					break;
				case FeatureCode.Morphing:
					result = new MorphingFeature();
					break;
				case FeatureCode.RemovableMedium:
					result = new RemovableMediumFeature();
					break;
				case FeatureCode.WriteProtect:
					result = new WriteProtectFeature();
					break;
				case FeatureCode.RandomReadable:
					result = new RandomReadableFeature();
					break;
				case FeatureCode.MultiRead:
					result = new MultiReadFeature();
					break;
				case FeatureCode.CDRead:
					result = new CDReadFeature();
					break;
				case FeatureCode.DvdRead:
					result = new DvdReadFeature();
					break;
				case FeatureCode.RandomWritable:
					result = new RandomWritableFeature();
					break;
				case FeatureCode.IncrementalStreamingWritable:
					result = new IncrementalStreamingWritableFeature();
					break;
				case FeatureCode.SectorErasable:
					result = new SectorErasableFeature();
					break;
				case FeatureCode.Formattable:
					result = new FormattableFeature();
					break;
				case FeatureCode.DefectManagement:
					result = new DefectManagementFeature();
					break;
				case FeatureCode.WriteOnce:
					result = new WriteOnceFeature();
					break;
				case FeatureCode.RestrictedOverwrite:
					result = new RestrictedOverwriteFeature();
					break;
				case FeatureCode.CDRWConstantAngularVelocityWrite:
					result = new CDRWConstantAngularVelocityWriteFeature();
					break;
				case FeatureCode.MountRainierRewritable:
					result = new MountRainierRewritableFeature();
					break;
				case FeatureCode.EnhancedDefectReporting:
					result = new EnhancedDefectReportingFeature();
					break;
				case FeatureCode.DvdPlusRW:
					result = new DvdPlusRWFeature();
					break;
				case FeatureCode.DvdPlusR:
					result = new DvdPlusRFeature();
					break;
				case FeatureCode.RigidRestrictedOverwrite:
					result = new RigidRestrictedOverwriteFeature();
					break;
				case FeatureCode.CDTrackAtOnce:
					result = new CDTrackAtOnceFeature();
					break;
				case FeatureCode.CDMastering:
					result = new CDMasteringFeature();
					break;
				case FeatureCode.DvdMinusRWWrite:
					result = new DvdMinusRWWriteFeature();
					break;
				case FeatureCode.DoubleDensityCDRead:
					result = new DoubleDensityCDReadFeature();
					break;
				case FeatureCode.DoubleDensityCDRWrite:
					result = new DoubleDensityCDRWriteFeature();
					break;
				case FeatureCode.DoubleDensityCDRWWrite:
					result = new DoubleDensityCDRWWriteFeature();
					break;
				case FeatureCode.LayerJumpRecording:
					result = new LayerJumpRecordingFeature();
					break;
				case FeatureCode.LayerJumpRigidRestrictedOverwrite:
					result = new LayerJumpRigidRestrictedOverwriteFeature();
					break;
				case FeatureCode.StopLongOperation:
					result = new StopLongOperationFeature();
					break;
				case FeatureCode.CDRWMediaWriteSupport:
					result = new CDRWMediaWriteSupportFeature();
					break;
				case FeatureCode.BDRPseudoOverwrite:
					result = new BDRPseudoOverwriteFeature();
					break;
				case FeatureCode.DvdPlusRWDualLayer:
					result = new DvdPlusRWDualLayerFeature();
					break;
				case FeatureCode.DvdPlusRDualLayer:
					result = new DvdPlusRDualLayerFeature();
					break;
				case FeatureCode.BDRead:
					result = new BDReadFeature();
					break;
				case FeatureCode.BDWrite:
					result = new BDWriteFeature();
					break;
				case FeatureCode.TimelySafeRecording:
					result = new TimelySafeRecordingFeature();
					break;
				case FeatureCode.HDDvdRead:
					result = new HDDvdReadFeature();
					break;
				case FeatureCode.HDDvdWrite:
					result = new HDDvdWriteFeature();
					break;
				case FeatureCode.HDDvdRWFragmentRecording:
					result = new HDDvdRWFragmentRecordingFeature();
					break;
				case FeatureCode.HybridDisc:
					result = new HybridDiscFeature();
					break;
				case FeatureCode.PowerManagement:
					result = new PowerManagementFeature();
					break;
				case FeatureCode.SelfMonitoringAnalysisAndReportingTechnology:
					result = new SelfMonitoringAnalysisAndReportingTechnologyFeature();
					break;
				case FeatureCode.EmbeddedChanger:
					result = new EmbeddedChangerFeature();
					break;
				case FeatureCode.CDAudioExternalPlay:
					result = new CDAudioExternalPlayFeature();
					break;
				case FeatureCode.MicrocodeUpgrade:
					result = new MicrocodeUpgradeFeature();
					break;
				case FeatureCode.Timeout:
					result = new TimeoutFeature();
					break;
				case FeatureCode.DvdContentScramblingSystem:
					result = new DvdContentScramblingSystemFeature();
					break;
				case FeatureCode.RealTimeStreaming:
					result = new RealTimeStreamingFeature();
					break;
				case FeatureCode.DriveSerialNumber:
					result = new driveSerialNumberFeature();
					break;
				case FeatureCode.MediaSerialNumber:
					result = new MediaSerialNumberFeature();
					break;
				case FeatureCode.DiscControlBlocks:
					result = new DiscControlBlocksFeature();
					break;
				case FeatureCode.DvdContentProtectionForRecordableMedia:
					result = new DvdContentProtectionForRecordableMediaFeature();
					break;
				case FeatureCode.FirmwareInformation:
					result = new FirmwareInformationFeature();
					break;
				case FeatureCode.AdvancedAccessContentSystem:
					result = new AdvancedAccessContentSystemFeature();
					break;
				case FeatureCode.DvdContentScramblingSystemManagedRecording:
					result = new DvdContentScramblingSystemManagedRecordingFeature();
					break;
				case FeatureCode.VCPS:
					result = new VCPSFeature();
					break;
				case FeatureCode.SecurDisc:
					result = new SecurDiscFeature();
					break;
				default:
					if (!Enum.IsDefined(typeof(FeatureCode), code)) { throw new ArgumentOutOfRangeException("code", code, "Invalid feature code."); }
					result = null;
					break;
			}
			return result;
		}

		internal static FeatureCode ReadFeatureCode(BufferWithSize buffer) { return Bits.BigEndian(buffer.Read<FeatureCode>(FEATURE_CODE_OFFSET)); }
		internal static byte ReadAdditionalLength(BufferWithSize buffer) { return Bits.BigEndian(buffer.Read<byte>(ADDITIONAL_LENGTH_OFFSET)); }

		public static IDictionary<MultimediaProfile, ReadOnlyCollection<FeatureCode>> KnownProfiles
		{
			get
			{
				if (__Profiles == null)
				{
					var profiles = new Dictionary<MultimediaProfile, ReadOnlyCollection<FeatureCode>>();
					profiles.Add(MultimediaProfile.NonRemovableDisc, new ReadOnlyCollection<FeatureCode>(new FeatureCode[] { FeatureCode.ProfileList, FeatureCode.Core, FeatureCode.RandomReadable, FeatureCode.RandomWritable, FeatureCode.DefectManagement, FeatureCode.PowerManagement, FeatureCode.SelfMonitoringAnalysisAndReportingTechnology }));
					profiles.Add(MultimediaProfile.RemovableDisc, new ReadOnlyCollection<FeatureCode>(new FeatureCode[] { FeatureCode.ProfileList, FeatureCode.Core, FeatureCode.Morphing, FeatureCode.RemovableMedium, FeatureCode.RandomReadable, FeatureCode.RandomWritable, FeatureCode.Formattable, FeatureCode.DefectManagement, FeatureCode.PowerManagement, FeatureCode.Timeout }));
					profiles.Add(MultimediaProfile.MagnetoOpticalErasable, new ReadOnlyCollection<FeatureCode>(new FeatureCode[] { FeatureCode.ProfileList, FeatureCode.Core, FeatureCode.Morphing, FeatureCode.RemovableMedium, FeatureCode.RandomReadable, FeatureCode.RandomWritable, FeatureCode.SectorErasable, FeatureCode.Formattable, FeatureCode.DefectManagement, FeatureCode.PowerManagement, FeatureCode.Timeout }));
					profiles.Add(MultimediaProfile.OpticalWriteOnce, new ReadOnlyCollection<FeatureCode>(new FeatureCode[] { FeatureCode.ProfileList, FeatureCode.Core, FeatureCode.Morphing, FeatureCode.RemovableMedium, FeatureCode.RandomReadable, FeatureCode.DefectManagement, FeatureCode.WriteOnce, FeatureCode.PowerManagement, FeatureCode.Timeout }));
					profiles.Add(MultimediaProfile.ASMO, new ReadOnlyCollection<FeatureCode>(new FeatureCode[] { FeatureCode.ProfileList, FeatureCode.Core, FeatureCode.Morphing, FeatureCode.RemovableMedium, FeatureCode.RandomReadable, FeatureCode.RandomWritable, FeatureCode.Formattable, FeatureCode.DefectManagement, FeatureCode.PowerManagement, FeatureCode.Timeout, FeatureCode.RealTimeStreaming }));
					profiles.Add(MultimediaProfile.CDROM, new ReadOnlyCollection<FeatureCode>(new FeatureCode[] { FeatureCode.ProfileList, FeatureCode.Core, FeatureCode.Morphing, FeatureCode.RemovableMedium, FeatureCode.RandomReadable, FeatureCode.CDRead, FeatureCode.PowerManagement, FeatureCode.Timeout }));
					profiles.Add(MultimediaProfile.CDR, new ReadOnlyCollection<FeatureCode>(new FeatureCode[] { FeatureCode.ProfileList, FeatureCode.Core, FeatureCode.Morphing, FeatureCode.RemovableMedium, FeatureCode.RandomReadable, FeatureCode.CDRead, FeatureCode.IncrementalStreamingWritable, FeatureCode.CDTrackAtOnce, FeatureCode.PowerManagement, FeatureCode.Timeout, FeatureCode.RealTimeStreaming }));
					profiles.Add(MultimediaProfile.CDRW, new ReadOnlyCollection<FeatureCode>(new FeatureCode[] { FeatureCode.ProfileList, FeatureCode.Core, FeatureCode.Morphing, FeatureCode.RemovableMedium, FeatureCode.RandomReadable, FeatureCode.MultiRead, FeatureCode.CDRead, FeatureCode.IncrementalStreamingWritable, FeatureCode.Formattable, FeatureCode.RestrictedOverwrite, FeatureCode.CDTrackAtOnce, FeatureCode.PowerManagement, FeatureCode.Timeout, FeatureCode.RealTimeStreaming }));
					profiles.Add(MultimediaProfile.DvdRom, new ReadOnlyCollection<FeatureCode>(new FeatureCode[] { FeatureCode.ProfileList, FeatureCode.Core, FeatureCode.Morphing, FeatureCode.RemovableMedium, FeatureCode.RandomReadable, FeatureCode.DvdRead, FeatureCode.PowerManagement, FeatureCode.Timeout, FeatureCode.RealTimeStreaming }));
					profiles.Add(MultimediaProfile.DvdMinusRSequentialRecording, new ReadOnlyCollection<FeatureCode>(new FeatureCode[] { FeatureCode.ProfileList, FeatureCode.Core, FeatureCode.Morphing, FeatureCode.RemovableMedium, FeatureCode.RandomReadable, FeatureCode.DvdRead, FeatureCode.IncrementalStreamingWritable, FeatureCode.DvdMinusRWWrite, FeatureCode.PowerManagement, FeatureCode.Timeout, FeatureCode.RealTimeStreaming, FeatureCode.DriveSerialNumber }));
					profiles.Add(MultimediaProfile.DvdRam, new ReadOnlyCollection<FeatureCode>(new FeatureCode[] { FeatureCode.ProfileList, FeatureCode.Core, FeatureCode.Morphing, FeatureCode.RemovableMedium, FeatureCode.RandomReadable, FeatureCode.DvdRead, FeatureCode.RandomWritable, FeatureCode.Formattable, FeatureCode.DefectManagement, FeatureCode.PowerManagement, FeatureCode.Timeout, FeatureCode.RealTimeStreaming }));
					profiles.Add(MultimediaProfile.DvdMinusRWRestrictedOverwrite, new ReadOnlyCollection<FeatureCode>(new FeatureCode[] { FeatureCode.ProfileList, FeatureCode.Core, FeatureCode.Morphing, FeatureCode.RemovableMedium, FeatureCode.RandomReadable, FeatureCode.DvdRead, FeatureCode.Formattable, FeatureCode.RigidRestrictedOverwrite, FeatureCode.PowerManagement, FeatureCode.Timeout, FeatureCode.RealTimeStreaming, FeatureCode.DriveSerialNumber }));
					profiles.Add(MultimediaProfile.DvdMinusRWSequentialRecording, new ReadOnlyCollection<FeatureCode>(new FeatureCode[] { FeatureCode.ProfileList, FeatureCode.Core, FeatureCode.Morphing, FeatureCode.RemovableMedium, FeatureCode.RandomReadable, FeatureCode.DvdRead, FeatureCode.IncrementalStreamingWritable, FeatureCode.DvdMinusRWWrite, FeatureCode.PowerManagement, FeatureCode.Timeout, FeatureCode.RealTimeStreaming, FeatureCode.DriveSerialNumber }));
					profiles.Add(MultimediaProfile.DvdMinusRDualLayerSequentialRecording, new ReadOnlyCollection<FeatureCode>(new FeatureCode[] { FeatureCode.ProfileList, FeatureCode.Core, FeatureCode.Morphing, FeatureCode.RemovableMedium, FeatureCode.RandomReadable, FeatureCode.DvdRead, FeatureCode.IncrementalStreamingWritable, FeatureCode.DvdMinusRWWrite, FeatureCode.PowerManagement, FeatureCode.Timeout, FeatureCode.DriveSerialNumber }));
					profiles.Add(MultimediaProfile.DvdMinusRDualLayerJumpRecording, new ReadOnlyCollection<FeatureCode>(new FeatureCode[] { FeatureCode.ProfileList, FeatureCode.Core, FeatureCode.Morphing, FeatureCode.RemovableMedium, FeatureCode.DvdRead, FeatureCode.LayerJumpRecording, FeatureCode.PowerManagement, FeatureCode.Timeout, FeatureCode.RealTimeStreaming, FeatureCode.DriveSerialNumber }));
					profiles.Add(MultimediaProfile.DvdMinusRWDualLayer, new ReadOnlyCollection<FeatureCode>(new FeatureCode[] { FeatureCode.ProfileList, FeatureCode.Core, FeatureCode.Morphing, FeatureCode.RemovableMedium, FeatureCode.RandomReadable, FeatureCode.DvdRead, FeatureCode.Formattable, FeatureCode.RigidRestrictedOverwrite, FeatureCode.StopLongOperation, FeatureCode.PowerManagement, FeatureCode.Timeout, FeatureCode.RealTimeStreaming, FeatureCode.DriveSerialNumber }));
					profiles.Add(MultimediaProfile.DvdDownloadDiscRecording, new ReadOnlyCollection<FeatureCode>(new FeatureCode[] { FeatureCode.ProfileList, FeatureCode.Core, FeatureCode.Morphing, FeatureCode.RemovableMedium, FeatureCode.RandomReadable, FeatureCode.DvdRead, FeatureCode.IncrementalStreamingWritable, FeatureCode.DvdMinusRWWrite, FeatureCode.PowerManagement, FeatureCode.Timeout, FeatureCode.RealTimeStreaming, FeatureCode.DriveSerialNumber, FeatureCode.DvdContentScramblingSystemManagedRecording }));
					profiles.Add(MultimediaProfile.DvdPlusRW, new ReadOnlyCollection<FeatureCode>(new FeatureCode[] { FeatureCode.ProfileList, FeatureCode.Core, FeatureCode.Morphing, FeatureCode.RemovableMedium, FeatureCode.RandomReadable, FeatureCode.DvdRead, FeatureCode.RandomWritable, FeatureCode.Formattable, FeatureCode.DvdPlusRW, FeatureCode.PowerManagement, FeatureCode.Timeout, FeatureCode.RealTimeStreaming, FeatureCode.DiscControlBlocks }));
					profiles.Add(MultimediaProfile.DvdPlusR, new ReadOnlyCollection<FeatureCode>(new FeatureCode[] { FeatureCode.ProfileList, FeatureCode.Core, FeatureCode.Morphing, FeatureCode.RemovableMedium, FeatureCode.RandomReadable, FeatureCode.DvdRead, FeatureCode.DvdPlusR, FeatureCode.PowerManagement, FeatureCode.Timeout, FeatureCode.RealTimeStreaming, FeatureCode.DiscControlBlocks }));
					profiles.Add(MultimediaProfile.DvdPlusRWDualLayer, new ReadOnlyCollection<FeatureCode>(new FeatureCode[] { FeatureCode.ProfileList, FeatureCode.Core, FeatureCode.Morphing, FeatureCode.RemovableMedium, FeatureCode.RandomReadable, FeatureCode.DvdRead, FeatureCode.RandomWritable, FeatureCode.Formattable, FeatureCode.DvdPlusRW, FeatureCode.DvdPlusRWDualLayer, FeatureCode.PowerManagement, FeatureCode.Timeout, FeatureCode.RealTimeStreaming, FeatureCode.DiscControlBlocks }));
					profiles.Add(MultimediaProfile.DvdPlusRDualLayer, new ReadOnlyCollection<FeatureCode>(new FeatureCode[] { FeatureCode.ProfileList, FeatureCode.Core, FeatureCode.Morphing, FeatureCode.RandomReadable, FeatureCode.DvdRead, FeatureCode.DvdPlusRDualLayer, FeatureCode.PowerManagement, FeatureCode.Timeout, FeatureCode.RealTimeStreaming, FeatureCode.DiscControlBlocks }));
					/*
					profiles.Add(MultimediaProfile.BDROM, new ReadOnlyCollection<FeatureCode>(new FeatureCode[] { FeatureCode.ProfileList, FeatureCode.Core, FeatureCode }));
					profiles.Add(MultimediaProfile.BDRSequentialRecording, new ReadOnlyCollection<FeatureCode>(new FeatureCode[] { FeatureCode.ProfileList, FeatureCode.Core, FeatureCode }));
					profiles.Add(MultimediaProfile.BDRERandomRecording, new ReadOnlyCollection<FeatureCode>(new FeatureCode[] { FeatureCode.ProfileList, FeatureCode.Core, FeatureCode }));
					profiles.Add(MultimediaProfile.BDRE, new ReadOnlyCollection<FeatureCode>(new FeatureCode[] { FeatureCode.ProfileList, FeatureCode.Core, FeatureCode }));
					profiles.Add(MultimediaProfile.HDDvdRom, new ReadOnlyCollection<FeatureCode>(new FeatureCode[] { FeatureCode.ProfileList, FeatureCode.Core, FeatureCode }));
					profiles.Add(MultimediaProfile.HDDvdR, new ReadOnlyCollection<FeatureCode>(new FeatureCode[] { FeatureCode.ProfileList, FeatureCode.Core, FeatureCode }));
					profiles.Add(MultimediaProfile.HDDvdRam, new ReadOnlyCollection<FeatureCode>(new FeatureCode[] { FeatureCode.ProfileList, FeatureCode.Core, FeatureCode }));
					profiles.Add(MultimediaProfile.HDDvdRW, new ReadOnlyCollection<FeatureCode>(new FeatureCode[] { FeatureCode.ProfileList, FeatureCode.Core, FeatureCode }));
					profiles.Add(MultimediaProfile.HDDvdRDualLayer, new ReadOnlyCollection<FeatureCode>(new FeatureCode[] { FeatureCode.ProfileList, FeatureCode.Core, FeatureCode }));
					profiles.Add(MultimediaProfile.HDDvdRWDualLayer, new ReadOnlyCollection<FeatureCode>(new FeatureCode[] { FeatureCode.ProfileList, FeatureCode.Core, FeatureCode }));
					profiles.Add(MultimediaProfile.Nonstandard, new ReadOnlyCollection<FeatureCode>(new FeatureCode[] { FeatureCode.ProfileList, FeatureCode.Core }));
					//*/
					System.Threading.Interlocked.CompareExchange(ref __Profiles, profiles, null);
				}
				return __Profiles;
			}
		}


		void IMarshalable.MarshalFrom(BufferWithSize buffer) { this.MarshalFrom(buffer); }
		void IMarshalable.MarshalTo(BufferWithSize buffer) { this.MarshalTo(buffer); }
		[DebuggerBrowsable(DebuggerBrowsableState.Never)]
		int IMarshalable.MarshaledSize { get { return this.MarshaledSize; } }
	}

	/// <summary>This feature identifies profiles supported by the drive.</summary>
	[StructLayout(LayoutKind.Sequential, Pack = 1)]
	public class ProfileListFeature : Feature
	{
		[DebuggerBrowsable(DebuggerBrowsableState.Never)]
		private static readonly IntPtr PROFILE_DESCRIPTORS_OFFSET = Marshal.OffsetOf(typeof(ProfileListFeature), "_ProfileDescriptors");
		[DebuggerBrowsable(DebuggerBrowsableState.Never)]
		private static readonly ScsiCommandCode[] __SupportedOperations = new ScsiCommandCode[] { };
		public override IList<ScsiCommandCode> GetSupportedOperations() { return __SupportedOperations; }

		public ProfileListFeature() : base(FeatureCode.ProfileList) { }

		[DebuggerBrowsable(DebuggerBrowsableState.Never)]
		[MarshalAs(UnmanagedType.ByValArray, SizeConst = 1)]
		private ProfileDescriptor[] _ProfileDescriptors;
		public ProfileDescriptor[] ProfileDescriptors
		{
			get { return this._ProfileDescriptors; }
			set
			{
				this._ProfileDescriptors = value;
				this.AdditionalLength = (byte)(value == null ? 0 : Marshaler.DefaultSizeOf<ProfileDescriptor>() * value.Length);
			}
		}

		protected override void MarshalFrom(BufferWithSize buffer)
		{
			Marshaler.DefaultPtrToStructure(buffer, this);
			var count = this.AdditionalLength / Marshaler.DefaultSizeOf<ProfileDescriptor>();
			this._ProfileDescriptors = new ProfileDescriptor[count];
			unsafe
			{
				var descriptors = buffer.ExtractSegment(PROFILE_DESCRIPTORS_OFFSET);
				for (int i = 0; i < count; i++)
				{
					this._ProfileDescriptors[i] = descriptors.Read<ProfileDescriptor>(i * sizeof(ProfileDescriptor));
				}
			}
		}

		protected override void MarshalTo(BufferWithSize buffer)
		{
			Marshaler.DefaultStructureToPtr((object)this, buffer);
			if (this._ProfileDescriptors != null)
			{
				unsafe
				{
					var descriptors = buffer.ExtractSegment(PROFILE_DESCRIPTORS_OFFSET);
					for (int i = 0; i < this._ProfileDescriptors.Length; i++)
					{
						descriptors.Write(this._ProfileDescriptors[i], i * sizeof(ProfileDescriptor));
					}
				}
			}
		}

		[StructLayout(LayoutKind.Sequential, Pack = 1, Size = 4)]
		public struct ProfileDescriptor : IMarshalable
		{
			[DebuggerBrowsable(DebuggerBrowsableState.Never)]
			private MultimediaProfile _ProfileNumber;
			[DebuggerBrowsable(DebuggerBrowsableState.Never)]
			public MultimediaProfile ProfileNumber { get { return Bits.BigEndian(this._ProfileNumber); } set { this._ProfileNumber = Bits.BigEndian(value); } }
			[DebuggerBrowsable(DebuggerBrowsableState.Never)]
			private BitVector8 byte2;
			[DebuggerBrowsable(DebuggerBrowsableState.Never)]
			public bool CurrentProfile { get { return this.byte2[0]; } set { this.byte2[0] = value; } }
			[DebuggerBrowsable(DebuggerBrowsableState.Never)]
			private byte byte3;

			public void MarshalFrom(BufferWithSize buffer) { this = buffer.Read<ProfileDescriptor>(); }
			public void MarshalTo(BufferWithSize buffer) { buffer.Write(this); }
			[DebuggerBrowsable(DebuggerBrowsableState.Never)]
			public int MarshaledSize { get { return Marshaler.DefaultSizeOf<ProfileDescriptor>(); } }

			public override string ToString() { return string.Format("ProfileDescriptor {{Profile = {0}, Current = {1}}}", this.ProfileNumber, this.CurrentProfile); }
		}
	}

	/// <summary>This feature identifies a drive that supports functionality common to all devices.</summary>
	[StructLayout(LayoutKind.Sequential, Pack = 1)]
	public class CoreFeature : Feature
	{
		[DebuggerBrowsable(DebuggerBrowsableState.Never)]
		private static readonly ScsiCommandCode[] __SupportedOperations = new ScsiCommandCode[] { ScsiCommandCode.GetConfiguration, ScsiCommandCode.GetEventStatusNotification, ScsiCommandCode.Inquiry, ScsiCommandCode.ModeSelect10, ScsiCommandCode.ModeSense10, ScsiCommandCode.RequestSense, ScsiCommandCode.TestUnitReady };
		public override IList<ScsiCommandCode> GetSupportedOperations() { return __SupportedOperations; }

		public CoreFeature() : base(FeatureCode.Core) { }

		[DebuggerBrowsable(DebuggerBrowsableState.Never)]
		private PhysicalInterfaceStandard _PhysicalInterfaceStandard;
		public PhysicalInterfaceStandard PhysicalInterfaceStandard { get { return Bits.BigEndian(this._PhysicalInterfaceStandard); } set { this._PhysicalInterfaceStandard = Bits.BigEndian(value); } }
	}

	/// <summary>This feature identifies the ability of the drive to notify a host about operational changes and accept host requests to prevent operational changes.</summary>
	[StructLayout(LayoutKind.Sequential, Pack = 1)]
	public class MorphingFeature : Feature
	{
		[DebuggerBrowsable(DebuggerBrowsableState.Never)]
		private static readonly ScsiCommandCode[] __SupportedOperations = new ScsiCommandCode[] { ScsiCommandCode.GetConfiguration, ScsiCommandCode.GetEventStatusNotification, ScsiCommandCode.PreventAllowMediumRemoval };
		public override IList<ScsiCommandCode> GetSupportedOperations() { return __SupportedOperations; }
		public MorphingFeature() : base(FeatureCode.Morphing) { }

		[DebuggerBrowsable(DebuggerBrowsableState.Never)]
		private BitVector8 byte4;
		public bool Async { get { return this.byte4[0]; } set { this.byte4[0] = value; } }
		[DebuggerBrowsable(DebuggerBrowsableState.Never)]
		private byte byte5;
		[DebuggerBrowsable(DebuggerBrowsableState.Never)]
		private byte byte6;
		[DebuggerBrowsable(DebuggerBrowsableState.Never)]
		private byte byte7;
	}

	/// <summary>
	/// This feature identifies a drive that has a medium that is removable.
	/// Media is be considered removable if it is possible to remove it from the loaded position, i.e., a single mechanism changer, even if the media is captive to the changer.
	///</summary>
	[StructLayout(LayoutKind.Sequential, Pack = 1)]
	public class RemovableMediumFeature : Feature
	{
		[DebuggerBrowsable(DebuggerBrowsableState.Never)]
		private static readonly ScsiCommandCode[] __SupportedOperations = new ScsiCommandCode[] { ScsiCommandCode.GetEventStatusNotification, ScsiCommandCode.MechanismStatus, ScsiCommandCode.PreventAllowMediumRemoval, ScsiCommandCode.StartStopUnit };
		public override IList<ScsiCommandCode> GetSupportedOperations() { return __SupportedOperations; }

		[DebuggerBrowsable(DebuggerBrowsableState.Never)]
		private const byte LOADING_MECHANISM_TYPE_MASK = 0xE0;

		public RemovableMediumFeature() : base(FeatureCode.RemovableMedium) { }

		[DebuggerBrowsable(DebuggerBrowsableState.Never)]
		private BitVector8 byte4;
		public bool Lock { get { return this.byte4[0]; } set { this.byte4[0] = value; } }
		public bool PreventJumper { get { return this.byte4[2]; } set { this.byte4[2] = value; } }
		public bool Eject { get { return this.byte4[3]; } set { this.byte4[3] = value; } }
		public LoadingMechanism LoadingMechanismType
		{
			get { return (LoadingMechanism)Bits.GetValueMask((byte)this.byte4, 5, LOADING_MECHANISM_TYPE_MASK); }
			set { this.byte4 = (BitVector8)Bits.PutValueMask((byte)this.byte4, (byte)value, 5, LOADING_MECHANISM_TYPE_MASK); }
		}
		[DebuggerBrowsable(DebuggerBrowsableState.Never)]
		private byte byte5;
		[DebuggerBrowsable(DebuggerBrowsableState.Never)]
		private byte byte6;
		[DebuggerBrowsable(DebuggerBrowsableState.Never)]
		private byte byte7;
	}

	/// <summary>This feature identifies reporting capability and changing capability for write protection status of the drive.</summary>
	[StructLayout(LayoutKind.Sequential, Pack = 1)]
	public class WriteProtectFeature : Feature
	{
		[DebuggerBrowsable(DebuggerBrowsableState.Never)]
		private static readonly ScsiCommandCode[] __SupportedOperations = new ScsiCommandCode[] { ScsiCommandCode.ReadDiscInformation, ScsiCommandCode.ReadDiscStructure, ScsiCommandCode.SendDiscStructure };
		public override IList<ScsiCommandCode> GetSupportedOperations() { return __SupportedOperations; }

		public WriteProtectFeature() : base(FeatureCode.WriteProtect) { }

		[DebuggerBrowsable(DebuggerBrowsableState.Never)]
		private BitVector8 byte4;
		public bool SupportsPWP { get { return this.byte4[1]; } set { this.byte4[1] = value; } }
		public bool SupportsSWPP { get { return this.byte4[0]; } set { this.byte4[0] = value; } }
		[DebuggerBrowsable(DebuggerBrowsableState.Never)]
		private byte byte5;
		[DebuggerBrowsable(DebuggerBrowsableState.Never)]
		private byte byte6;
		[DebuggerBrowsable(DebuggerBrowsableState.Never)]
		private byte byte7;
	}

	/// <summary>This feature identifies a drive that is able to read data from logical blocks referenced by logical block addresses, but not requiring that either the addresses or the read sequences occur in any particular order.</summary>
	[StructLayout(LayoutKind.Sequential, Pack = 1)]
	public class RandomReadableFeature : Feature
	{
		[DebuggerBrowsable(DebuggerBrowsableState.Never)]
		private static readonly ScsiCommandCode[] __SupportedOperations = new ScsiCommandCode[] { ScsiCommandCode.ReadCapacity, ScsiCommandCode.Read10 };
		public override IList<ScsiCommandCode> GetSupportedOperations() { return __SupportedOperations; }
		public RandomReadableFeature() : base(FeatureCode.RandomReadable) { }

		[DebuggerBrowsable(DebuggerBrowsableState.Never)]
		private uint _LogicalBlockSize;
		public uint LogicalBlockSize { get { return Bits.BigEndian(this._LogicalBlockSize); } set { this._LogicalBlockSize = Bits.BigEndian(value); } }
		[DebuggerBrowsable(DebuggerBrowsableState.Never)]
		private ushort _Blocking;
		public ushort Blocking { get { return Bits.BigEndian(this._Blocking); } set { this._Blocking = Bits.BigEndian(value); } }
		[DebuggerBrowsable(DebuggerBrowsableState.Never)]
		private BitVector8 byte10;
		public bool PagePresent { get { return this.byte10[0]; } set { this.byte10[0] = value; } }
		[DebuggerBrowsable(DebuggerBrowsableState.Never)]
		private byte byte11;
	}

	/// <summary>The drive conforms to the OSTA Multi-Read specification 1.00, with the exception of CD play capability (the <see cref="CDAudioExternalPlayFeature"/> is not required).</summary>
	[StructLayout(LayoutKind.Sequential, Pack = 1)]
	public class MultiReadFeature : Feature
	{
		[DebuggerBrowsable(DebuggerBrowsableState.Never)]
		private static readonly ScsiCommandCode[] __SupportedOperations = new ScsiCommandCode[] { ScsiCommandCode.Read10, ScsiCommandCode.ReadCD, ScsiCommandCode.ReadDiscInformation, ScsiCommandCode.ReadTrackInformation };
		public override IList<ScsiCommandCode> GetSupportedOperations() { return __SupportedOperations; }
		public MultiReadFeature() : base(FeatureCode.MultiRead) { }
	}

	/// <summary>This feature identifies a drive that is able to read CD specific information from the media and is able to read user data from all types of CD sectors.</summary>
	[StructLayout(LayoutKind.Sequential, Pack = 1)]
	public class CDReadFeature : Feature
	{
		[DebuggerBrowsable(DebuggerBrowsableState.Never)]
		private static readonly ScsiCommandCode[] __SupportedOperations = new ScsiCommandCode[] { ScsiCommandCode.ReadCD, ScsiCommandCode.ReadCDMinuteSecondFrame, ScsiCommandCode.ReadTableOfContentsProgramMemoryAreaAbsoluteTimeInPreGroove };
		public override IList<ScsiCommandCode> GetSupportedOperations() { return __SupportedOperations; }
		public CDReadFeature() : base(FeatureCode.CDRead) { }

		[DebuggerBrowsable(DebuggerBrowsableState.Never)]
		private BitVector8 byte4;
		public bool C2Flags { get { return this.byte4[1]; } set { this.byte4[1] = value; } }
		public bool CDText { get { return this.byte4[0]; } set { this.byte4[0] = value; } }
		[DebuggerBrowsable(DebuggerBrowsableState.Never)]
		private byte byte5;
		[DebuggerBrowsable(DebuggerBrowsableState.Never)]
		private byte byte6;
		[DebuggerBrowsable(DebuggerBrowsableState.Never)]
		private byte byte7;
	}

	/// <summary>This feature identifies a drive that is able to read DVD specific information from the media.</summary>
	[StructLayout(LayoutKind.Sequential, Pack = 1)]
	public class DvdReadFeature : Feature
	{
		[DebuggerBrowsable(DebuggerBrowsableState.Never)]
		private static readonly ScsiCommandCode[] __SupportedOperations = new ScsiCommandCode[] { ScsiCommandCode.Read10, ScsiCommandCode.Read12, ScsiCommandCode.ReadDiscStructure, ScsiCommandCode.ReadTableOfContentsProgramMemoryAreaAbsoluteTimeInPreGroove };
		public override IList<ScsiCommandCode> GetSupportedOperations() { return __SupportedOperations; }
		public DvdReadFeature() : base(FeatureCode.DvdRead) { }
	}

	/// <summary>This feature identifies a drive that is able to write data to logical blocks specified by logical block addresses. There is no requirement that the addresses in sequences of writes occur in any particular order.</summary>
	[StructLayout(LayoutKind.Sequential, Pack = 1)]
	public class RandomWritableFeature : Feature
	{
		[DebuggerBrowsable(DebuggerBrowsableState.Never)]
		private static readonly ScsiCommandCode[] __SupportedOperations = new ScsiCommandCode[] { ScsiCommandCode.ReadCapacity, ScsiCommandCode.Write10, ScsiCommandCode.WriteAndVerify10, ScsiCommandCode.SynchronizeCache10 };
		public override IList<ScsiCommandCode> GetSupportedOperations() { return __SupportedOperations; }
		public RandomWritableFeature() : base(FeatureCode.RandomWritable) { }

		[DebuggerBrowsable(DebuggerBrowsableState.Never)]
		private uint _LastLogicalBlockAddress;
		public uint LastLogicalBlockAddress { get { return Bits.BigEndian(this._LastLogicalBlockAddress); } set { this._LastLogicalBlockAddress = Bits.BigEndian(value); } }
		[DebuggerBrowsable(DebuggerBrowsableState.Never)]
		private uint _LogicalBlockSize;
		public uint LogicalBlockSize { get { return Bits.BigEndian(this._LogicalBlockSize); } set { this._LogicalBlockSize = Bits.BigEndian(value); } }
		[DebuggerBrowsable(DebuggerBrowsableState.Never)]
		private ushort _Blocking;
		public ushort Blocking { get { return Bits.BigEndian(this._Blocking); } set { this._Blocking = Bits.BigEndian(value); } }
		[DebuggerBrowsable(DebuggerBrowsableState.Never)]
		private BitVector8 byte10;
		public bool PagePresent { get { return this.byte10[0]; } set { this.byte10[0] = value; } }
		[DebuggerBrowsable(DebuggerBrowsableState.Never)]
		private byte byte15;
	}

	/// <summary>
	/// This feature identifies a drive 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.
	/// On CD media, this is known as packet recording, on DVD and HD DVD media it is known as Incremental Recording, and on a BD-R disc it is known as SRM recording.
	///</summary>
	[StructLayout(LayoutKind.Sequential, Pack = 1)]
	public class IncrementalStreamingWritableFeature : Feature
	{
		[DebuggerBrowsable(DebuggerBrowsableState.Never)]
		private static readonly IntPtr LINK_SIZES_OFFSET = Marshal.OffsetOf(typeof(IncrementalStreamingWritableFeature), "_LinkSizes");
		[DebuggerBrowsable(DebuggerBrowsableState.Never)]
		private static readonly ScsiCommandCode[] __SupportedOperations = new ScsiCommandCode[] { ScsiCommandCode.Blank, ScsiCommandCode.CloseSessionOrTrack, ScsiCommandCode.ReadDiscInformation, ScsiCommandCode.ReadTrackInformation, ScsiCommandCode.ReserveTrack, ScsiCommandCode.SendOpcInformation, ScsiCommandCode.SynchronizeCache10, ScsiCommandCode.Write10 };
		public override IList<ScsiCommandCode> GetSupportedOperations() { return __SupportedOperations; }

		public IncrementalStreamingWritableFeature() : base(FeatureCode.IncrementalStreamingWritable) { }

		[DebuggerBrowsable(DebuggerBrowsableState.Never)]
		private BitVector16 _DataBlockTypesSupported;
		public BitVector16 DataBlockTypesSupported { get { return this._DataBlockTypesSupported; } set { this._DataBlockTypesSupported = value; } }
		[DebuggerBrowsable(DebuggerBrowsableState.Never)]
		private BitVector8 byte6;
		/// <summary>This bit, if set to <c>true</c>, indicates that the logical unit is capable of zero loss linking.</summary>
		public bool Buffer { get { return this.byte6[0]; } set { this.byte6[0] = value; } }
		[DebuggerBrowsable(DebuggerBrowsableState.Never)]
		private byte _NumberOfLinkSizes;
		[DebuggerBrowsable(DebuggerBrowsableState.Never)]
		[MarshalAs(UnmanagedType.ByValArray, SizeConst = 1)]
		private byte[] _LinkSizes;
		public byte[] LinkSizes
		{
			get { return this._LinkSizes; }
			set
			{
				this._LinkSizes = value;
				this._NumberOfLinkSizes = value == null ? (byte)0 : (byte)value.Length;
				this.AdditionalLength = (byte)(4 + this.CalculatePadBytes() + this._NumberOfLinkSizes); ;
			}
		}

		protected override void MarshalFrom(BufferWithSize buffer)
		{
			Marshaler.DefaultPtrToStructure(buffer, this);
			this._LinkSizes = new byte[this.AdditionalLength - this._NumberOfLinkSizes - this.CalculatePadBytes()];
			buffer.CopyTo(LINK_SIZES_OFFSET, this._LinkSizes, IntPtr.Zero, (IntPtr)this._LinkSizes.Length);
		}

		protected override void MarshalTo(BufferWithSize buffer)
		{
			Marshaler.DefaultStructureToPtr((object)this, buffer);
			buffer.CopyFrom(LINK_SIZES_OFFSET, this._LinkSizes, IntPtr.Zero, (IntPtr)this._LinkSizes.Length);
		}

		private byte CalculatePadBytes() { return (byte)(4 * /*Integer Part only*/((this._NumberOfLinkSizes + 3) / 4) - this._NumberOfLinkSizes); }
	}

	/// <summary></summary>
	[StructLayout(LayoutKind.Sequential, Pack = 1)]
	public class SectorErasableFeature : Feature
	{
		[DebuggerBrowsable(DebuggerBrowsableState.Never)]
		private static readonly ScsiCommandCode[] __SupportedOperations = new ScsiCommandCode[] { };
		public override IList<ScsiCommandCode> GetSupportedOperations() { throw new NotImplementedException(); }
		public SectorErasableFeature() : base(FeatureCode.SectorErasable) { }
	}

	/// <summary>This feature identifies a drive that is able to format media into logical blocks.</summary>
	[StructLayout(LayoutKind.Sequential, Pack = 1)]
	public class FormattableFeature : Feature
	{
		[DebuggerBrowsable(DebuggerBrowsableState.Never)]
		private static readonly ScsiCommandCode[] __SupportedOperations = new ScsiCommandCode[] { ScsiCommandCode.Format, ScsiCommandCode.ReadFormatCapacities, ScsiCommandCode.RequestSense, ScsiCommandCode.Verify10 };
		public override IList<ScsiCommandCode> GetSupportedOperations() { return __SupportedOperations; }
		public FormattableFeature() : base(FeatureCode.Formattable) { }
	}

	/// <summary>This feature identifies a drive that has defect management available to provide a defect-free contiguous address space.</summary>
	[StructLayout(LayoutKind.Sequential, Pack = 1)]
	public class DefectManagementFeature : Feature
	{
		[DebuggerBrowsable(DebuggerBrowsableState.Never)]
		private static readonly ScsiCommandCode[] __SupportedOperations = new ScsiCommandCode[] { ScsiCommandCode.ReadDiscStructure };
		public override IList<ScsiCommandCode> GetSupportedOperations() { return __SupportedOperations; }
		public DefectManagementFeature() : base(FeatureCode.DefectManagement) { }

		[DebuggerBrowsable(DebuggerBrowsableState.Never)]
		private BitVector8 byte4;
		public bool SpareAreaInformation { get { return this.byte4[7]; } set { this.byte4[7] = value; } }
		[DebuggerBrowsable(DebuggerBrowsableState.Never)]
		private byte byte5;
		[DebuggerBrowsable(DebuggerBrowsableState.Never)]
		private byte byte6;
		[DebuggerBrowsable(DebuggerBrowsableState.Never)]
		private byte byte7;
	}

	/// <summary>This feature identifies a drive that has the ability to record to any previously unrecorded logical block. The recording of logical blocks may occur in any order. Previously recorded blocks are not overwritten.</summary>
	[StructLayout(LayoutKind.Sequential, Pack = 1)]
	public class WriteOnceFeature : Feature
	{
		[DebuggerBrowsable(DebuggerBrowsableState.Never)]
		private static readonly ScsiCommandCode[] __SupportedOperations = new ScsiCommandCode[] { ScsiCommandCode.ReadCapacity, ScsiCommandCode.SynchronizeCache10, ScsiCommandCode.Write10, ScsiCommandCode.WriteAndVerify10 };
		public override IList<ScsiCommandCode> GetSupportedOperations() { return __SupportedOperations; }
		public WriteOnceFeature() : base(FeatureCode.WriteOnce) { }

		[DebuggerBrowsable(DebuggerBrowsableState.Never)]
		private uint _LogicalBlockSize;
		public uint LogicalBlockSize { get { return Bits.BigEndian(this._LogicalBlockSize); } set { this._LogicalBlockSize = Bits.BigEndian(value); } }
		[DebuggerBrowsable(DebuggerBrowsableState.Never)]
		private ushort _Blocking;
		public ushort Blocking { get { return Bits.BigEndian(this._Blocking); } set { this._Blocking = Bits.BigEndian(value); } }
		[DebuggerBrowsable(DebuggerBrowsableState.Never)]
		private BitVector8 byte10;
		public bool PagePresent { get { return this.byte10[0]; } set { this.byte10[0] = value; } }
		[DebuggerBrowsable(DebuggerBrowsableState.Never)]
		private byte byte15;
	}

	/// <summary>This feature identifies a drive that has the ability to overwrite logical blocks only in fixed sets at a time.</summary>
	[StructLayout(LayoutKind.Sequential, Pack = 1)]
	public class RestrictedOverwriteFeature : Feature
	{
		[DebuggerBrowsable(DebuggerBrowsableState.Never)]
		private static readonly ScsiCommandCode[] __SupportedOperations = new ScsiCommandCode[] { ScsiCommandCode.ReadCapacity, ScsiCommandCode.ReadDiscInformation, ScsiCommandCode.ReadTrackInformation, ScsiCommandCode.SynchronizeCache10, ScsiCommandCode.Write10 };
		public override IList<ScsiCommandCode> GetSupportedOperations() { return __SupportedOperations; }
		public RestrictedOverwriteFeature() : base(FeatureCode.RestrictedOverwrite) { }
	}

	/// <summary>
	/// This feature identifies a drive that has the ability to write CD-RW media that is designed for constant angular velocity recording.
	/// The drive conforms to the Orange Book Part 3 Volume 2 specification.
	/// This feature is not current if high-speed recordable CD-RW media is not mounted.
	///</summary>
	[StructLayout(LayoutKind.Sequential, Pack = 1)]
	public class CDRWConstantAngularVelocityWriteFeature : Feature
	{
		[DebuggerBrowsable(DebuggerBrowsableState.Never)]
		private static readonly ScsiCommandCode[] __SupportedOperations = new ScsiCommandCode[] { ScsiCommandCode.ReadCapacity, ScsiCommandCode.ReadDiscInformation, ScsiCommandCode.ReadTrackInformation, ScsiCommandCode.SynchronizeCache10, ScsiCommandCode.Write10 };
		public override IList<ScsiCommandCode> GetSupportedOperations() { return __SupportedOperations; }
		public CDRWConstantAngularVelocityWriteFeature() : base(FeatureCode.CDRWConstantAngularVelocityWrite) { }

		[DebuggerBrowsable(DebuggerBrowsableState.Never)]
		private byte byte4;
		[DebuggerBrowsable(DebuggerBrowsableState.Never)]
		private byte byte5;
		[DebuggerBrowsable(DebuggerBrowsableState.Never)]
		private byte byte6;
		[DebuggerBrowsable(DebuggerBrowsableState.Never)]
		private byte byte7;
	}

	/// <summary>This feature indicates that the drive is capable of reading a disc with the MRW format.</summary>
	[StructLayout(LayoutKind.Sequential, Pack = 1)]
	public class MountRainierRewritableFeature : Feature
	{
		[DebuggerBrowsable(DebuggerBrowsableState.Never)]
		private static readonly ScsiCommandCode[] __SupportedOperations = new ScsiCommandCode[] { ScsiCommandCode.GetEventStatusNotification, ScsiCommandCode.Read10, ScsiCommandCode.Read12, ScsiCommandCode.ReadCapacity, ScsiCommandCode.ReadDiscInformation,
																				/*The rest are for write only*/ScsiCommandCode.CloseSessionOrTrack, ScsiCommandCode.Format, ScsiCommandCode.Write10, ScsiCommandCode.WriteAndVerify10, ScsiCommandCode.Verify10, ScsiCommandCode.ReadFormatCapacities };
		public override IList<ScsiCommandCode> GetSupportedOperations() { return __SupportedOperations; }
		public MountRainierRewritableFeature() : base(FeatureCode.MountRainierRewritable) { }

		[DebuggerBrowsable(DebuggerBrowsableState.Never)]
		private BitVector8 byte4;
		public bool Write { get { return this.byte4[0]; } set { this.byte4[0] = value; } }
		[DebuggerBrowsable(DebuggerBrowsableState.Never)]
		private byte byte5;
		[DebuggerBrowsable(DebuggerBrowsableState.Never)]
		private byte byte6;
		[DebuggerBrowsable(DebuggerBrowsableState.Never)]
		private byte byte7;
	}

	/// <summary>
	/// This feature identifies a drive that has the ability to perform media certification and RECOVERED ERROR reporting for drive assisted software defect management. In case of Persistent-DM mode, the <see cref="Read12Command"/> command with Streaming bit = 1 may be performed without medium certification.
	/// When this feature is current, the <see cref="DefectManagementFeature"/> is not current. This feature may be current when Restricted Overwrite formatted media or Rigid Restricted Overwrite formatted media is present.
	///</summary>
	[StructLayout(LayoutKind.Sequential, Pack = 1)]
	public class EnhancedDefectReportingFeature : Feature
	{
		[DebuggerBrowsable(DebuggerBrowsableState.Never)]
		private static readonly ScsiCommandCode[] __SupportedOperations = new ScsiCommandCode[] { ScsiCommandCode.GetPerformance, ScsiCommandCode.Read10, ScsiCommandCode.Read12, ScsiCommandCode.ReadDiscInformation, ScsiCommandCode.Write10, ScsiCommandCode.Write12, ScsiCommandCode.Verify10, ScsiCommandCode.WriteAndVerify10, ScsiCommandCode.SynchronizeCache10, ScsiCommandCode.SetStreaming };
		public override IList<ScsiCommandCode> GetSupportedOperations() { return __SupportedOperations; }
		public EnhancedDefectReportingFeature() : base(FeatureCode.EnhancedDefectReporting) { }

		[DebuggerBrowsable(DebuggerBrowsableState.Never)]
		private BitVector8 byte4;
		public bool DRTDM { get { return this.byte4[0]; } set { this.byte4[0] = value; } }
		[DebuggerBrowsable(DebuggerBrowsableState.Never)]
		private byte _NumberOfDefectiveBlockInformationCacheZones;
		public byte NumberOfDefectiveBlockInformationCacheZones { get { return this._NumberOfDefectiveBlockInformationCacheZones; } set { this._NumberOfDefectiveBlockInformationCacheZones = value; } }
		[DebuggerBrowsable(DebuggerBrowsableState.Never)]
		private ushort _NumberOfEntries;
		public ushort NumberOfEntries { get { return Bits.BigEndian(this._NumberOfEntries); } set { this._NumberOfEntries = Bits.BigEndian(value); } }
	}

	/// <summary>This feature indicates that the drive is capable of reading a recorded DVD+RW disc that is formatted according to [DVD+Ref2].</summary>
	[StructLayout(LayoutKind.Sequential, Pack = 1)]
	public class DvdPlusRWFeature : Feature
	{
		[DebuggerBrowsable(DebuggerBrowsableState.Never)]
		private static readonly ScsiCommandCode[] __SupportedOperations = new ScsiCommandCode[] { ScsiCommandCode.CloseSessionOrTrack, ScsiCommandCode.Format, ScsiCommandCode.ReadDiscStructure, ScsiCommandCode.ReadTableOfContentsProgramMemoryAreaAbsoluteTimeInPreGroove, ScsiCommandCode.SendDiscStructure, ScsiCommandCode.Write10, ScsiCommandCode.Write12, ScsiCommandCode.WriteAndVerify10 };
		public override IList<ScsiCommandCode> GetSupportedOperations() { return __SupportedOperations; }
		public DvdPlusRWFeature() : base(FeatureCode.DvdPlusRW) { }

		[DebuggerBrowsable(DebuggerBrowsableState.Never)]
		private BitVector8 byte4;
		public bool Write { get { return this.byte4[0]; } set { this.byte4[0] = value; } }
		[DebuggerBrowsable(DebuggerBrowsableState.Never)]
		private BitVector8 byte5;
		public bool CloseOnly { get { return this.byte5[0]; } set { this.byte5[0] = value; } }
		[DebuggerBrowsable(DebuggerBrowsableState.Never)]
		private byte byte6;
		[DebuggerBrowsable(DebuggerBrowsableState.Never)]
		private byte byte7;
	}

	/// <summary>This feature indicates that the drive is capable of reading a recorded DVD+R disc that is written according to [DVD+Ref1]. Specifically, this includes the capability of reading DCBs.</summary>
	[StructLayout(LayoutKind.Sequential, Pack = 1)]
	public class DvdPlusRFeature : Feature
	{
		[DebuggerBrowsable(DebuggerBrowsableState.Never)]
		private static readonly ScsiCommandCode[] __SupportedOperations = new ScsiCommandCode[] { ScsiCommandCode.CloseSessionOrTrack, ScsiCommandCode.ReadDiscInformation, ScsiCommandCode.ReadDiscStructure, ScsiCommandCode.ReadTableOfContentsProgramMemoryAreaAbsoluteTimeInPreGroove, ScsiCommandCode.ReadTrackInformation, ScsiCommandCode.ReserveTrack, ScsiCommandCode.SendDiscStructure, ScsiCommandCode.SynchronizeCache10, ScsiCommandCode.Write10, ScsiCommandCode.Write12 };
		public override IList<ScsiCommandCode> GetSupportedOperations() { return __SupportedOperations; }
		public DvdPlusRFeature() : base(FeatureCode.DvdPlusR) { }

		[DebuggerBrowsable(DebuggerBrowsableState.Never)]
		private BitVector8 byte4;
		public bool Write { get { return this.byte4[0]; } set { this.byte4[0] = value; } }
		[DebuggerBrowsable(DebuggerBrowsableState.Never)]
		private byte byte5;
		[DebuggerBrowsable(DebuggerBrowsableState.Never)]
		private byte byte6;
		[DebuggerBrowsable(DebuggerBrowsableState.Never)]
		private byte byte7;
	}

	/// <summary>
	/// This feature identifies a drive that has the ability to perform writing only on blocking boundaries.
	/// This feature is different from the <see cref="RestrictedOverwriteFeature"/> feature because each write command is also required to end on a blocking boundary.
	/// This feature replaces the <see cref="RandomWritableFeature"/> for drives that do not perform readmodify- write operations on write requests smaller than blocking.
	/// This feature may be present when DVD-RW Restricted Over Writable media is loaded. Drives with write protected media do not have this feature current.
	/// This feature is not current if the <see cref="RandomWritableFeature"/> is current.
	/// If this feature is current, the <see cref="RandomWritableFeature"/> feature is not current.
	///</summary>
	[StructLayout(LayoutKind.Sequential, Pack = 1)]
	public class RigidRestrictedOverwriteFeature : Feature
	{
		[DebuggerBrowsable(DebuggerBrowsableState.Never)]
		private static readonly ScsiCommandCode[] __SupportedOperations = new ScsiCommandCode[] { ScsiCommandCode.Blank, ScsiCommandCode.GetPerformance, ScsiCommandCode.ReadDiscInformation, ScsiCommandCode.ReadTrackInformation, ScsiCommandCode.ReadCapacity, ScsiCommandCode.SynchronizeCache10, ScsiCommandCode.Verify10, ScsiCommandCode.Write10 };
		public override IList<ScsiCommandCode> GetSupportedOperations() { return __SupportedOperations; }
		public RigidRestrictedOverwriteFeature() : base(FeatureCode.RigidRestrictedOverwrite) { }

		[DebuggerBrowsable(DebuggerBrowsableState.Never)]
		private BitVector8 byte4;
		public bool DefectStatusDataGenerate { get { return this.byte4[3]; } set { this.byte4[3] = value; } }
		public bool DefectStatusDataRead { get { return this.byte4[2]; } set { this.byte4[2] = value; } }
		public bool Intermediate { get { return this.byte4[1]; } set { this.byte4[1] = value; } }
		public bool Blank { get { return this.byte4[0]; } set { this.byte4[0] = value; } }
		[DebuggerBrowsable(DebuggerBrowsableState.Never)]
		private byte byte5;
		[DebuggerBrowsable(DebuggerBrowsableState.Never)]
		private byte byte6;
		[DebuggerBrowsable(DebuggerBrowsableState.Never)]
		private byte byte7;
	}


	//SupportedOperations not implemented yet from here after


	/// <summary>This feature identifies a drive that is able to write data to a CD track.</summary>
	[StructLayout(LayoutKind.Sequential, Pack = 1)]
	public class CDTrackAtOnceFeature : Feature
	{
		[DebuggerBrowsable(DebuggerBrowsableState.Never)]
		private static readonly ScsiCommandCode[] __SupportedOperations = new ScsiCommandCode[] { };
		public override IList<ScsiCommandCode> GetSupportedOperations() { return __SupportedOperations; }
		public CDTrackAtOnceFeature() : base(FeatureCode.CDTrackAtOnce) { }

		[DebuggerBrowsable(DebuggerBrowsableState.Never)]
		private BitVector8 byte4;
		public bool Buffer { get { return this.byte4[6]; } set { this.byte4[6] = value; } }
		public bool RWRaw { get { return this.byte4[4]; } set { this.byte4[4] = value; } }
		public bool RWPack { get { return this.byte4[3]; } set { this.byte4[3] = value; } }
		public bool TestWrite { get { return this.byte4[2]; } set { this.byte4[2] = value; } }
		public bool CDRW { get { return this.byte4[1]; } set { this.byte4[1] = value; } }
		public bool RWSubCode { get { return this.byte4[0]; } set { this.byte4[0] = value; } }
		[DebuggerBrowsable(DebuggerBrowsableState.Never)]
		private byte byte5;
		[DebuggerBrowsable(DebuggerBrowsableState.Never)]
		private ushort _DataTypeSupported;
		public ushort DataTypeSupported { get { return Bits.BigEndian(this._DataTypeSupported); } set { this._DataTypeSupported = Bits.BigEndian(value); } }
	}

	/// <summary>This feature identifies a drive that is able to write a CD in session-at-once or raw mode.</summary>
	[StructLayout(LayoutKind.Sequential, Pack = 1)]
	public class CDMasteringFeature : Feature
	{
		[DebuggerBrowsable(DebuggerBrowsableState.Never)]
		private static readonly ScsiCommandCode[] __SupportedOperations = new ScsiCommandCode[] { };
		public override IList<ScsiCommandCode> GetSupportedOperations() { return __SupportedOperations; }
		public CDMasteringFeature() : base(FeatureCode.CDMastering) { }

		[DebuggerBrowsable(DebuggerBrowsableState.Never)]
		private BitVector8 byte4;
		public bool Buffer { get { return this.byte4[6]; } set { this.byte4[6] = value; } }
		public bool SessionAtOnce { get { return this.byte4[5]; } set { this.byte4[5] = value; } }
		public bool RawMS { get { return this.byte4[4]; } set { this.byte4[4] = value; } }
		public bool Raw { get { return this.byte4[3]; } set { this.byte4[3] = value; } }
		public bool TestWrite { get { return this.byte4[2]; } set { this.byte4[2] = value; } }
		public bool CDRW { get { return this.byte4[1]; } set { this.byte4[1] = value; } }
		public bool ReadWrite { get { return this.byte4[0]; } set { this.byte4[0] = value; } }
		[DebuggerBrowsable(DebuggerBrowsableState.Never)]
		private byte _byte5; //msb
		[DebuggerBrowsable(DebuggerBrowsableState.Never)]
		private byte _byte6;
		[DebuggerBrowsable(DebuggerBrowsableState.Never)]
		private byte _byte7; //lsb
		public uint MaximumCueSheetLength
		{
			get { unchecked { return (uint)this._byte7 | ((uint)this._byte6 << 8) | ((uint)this._byte5 << 16); } }
			set { unchecked { this._byte7 = (byte)(value >> 0); this._byte6 = (byte)(value >> 8); this._byte5 = (byte)(value >> 16); } }
		}
	}

	/// <summary>This feature identifies a drive that has the ability to write data to DVD-R/-RW in disc at once mode.</summary>
	[StructLayout(LayoutKind.Sequential, Pack = 1)]
	public class DvdMinusRWWriteFeature : Feature
	{
		[DebuggerBrowsable(DebuggerBrowsableState.Never)]
		private static readonly ScsiCommandCode[] __SupportedOperations = new ScsiCommandCode[] { };
		public override IList<ScsiCommandCode> GetSupportedOperations() { return __SupportedOperations; }
		public DvdMinusRWWriteFeature() : base(FeatureCode.DvdMinusRWWrite) { }

		[DebuggerBrowsable(DebuggerBrowsableState.Never)]
		private BitVector8 byte4;
		public bool Buffer { get { return this.byte4[6]; } set { this.byte4[6] = value; } }
		public bool TestWrite { get { return this.byte4[2]; } set { this.byte4[2] = value; } }
		public bool DvdMinusRW { get { return this.byte4[1]; } set { this.byte4[1] = value; } }
		[DebuggerBrowsable(DebuggerBrowsableState.Never)]
		private byte byte5;
		[DebuggerBrowsable(DebuggerBrowsableState.Never)]
		private byte byte6;
		[DebuggerBrowsable(DebuggerBrowsableState.Never)]
		private byte byte7;
	}

	/// <summary></summary>
	[StructLayout(LayoutKind.Sequential, Pack = 1)]
	public class DoubleDensityCDReadFeature : Feature
	{
		[DebuggerBrowsable(DebuggerBrowsableState.Never)]
		private static readonly ScsiCommandCode[] __SupportedOperations = new ScsiCommandCode[] { };
		public override IList<ScsiCommandCode> GetSupportedOperations() { return __SupportedOperations; }
		public DoubleDensityCDReadFeature() : base(FeatureCode.DoubleDensityCDRead) { }
	}

	/// <summary></summary>
	[StructLayout(LayoutKind.Sequential, Pack = 1)]
	public class DoubleDensityCDRWriteFeature : Feature
	{
		[DebuggerBrowsable(DebuggerBrowsableState.Never)]
		private static readonly ScsiCommandCode[] __SupportedOperations = new ScsiCommandCode[] { };
		public override IList<ScsiCommandCode> GetSupportedOperations() { return __SupportedOperations; }
		public DoubleDensityCDRWriteFeature() : base(FeatureCode.DoubleDensityCDRWrite) { }

		[DebuggerBrowsable(DebuggerBrowsableState.Never)]
		private BitVector8 byte4;
		public bool TestWrite { get { return this.byte4[2]; } set { this.byte4[2] = value; } }
		[DebuggerBrowsable(DebuggerBrowsableState.Never)]
		private byte byte5;
		[DebuggerBrowsable(DebuggerBrowsableState.Never)]
		private byte byte6;
		[DebuggerBrowsable(DebuggerBrowsableState.Never)]
		private byte byte7;
	}

	/// <summary></summary>
	[StructLayout(LayoutKind.Sequential, Pack = 1)]
	public class DoubleDensityCDRWWriteFeature : Feature
	{
		[DebuggerBrowsable(DebuggerBrowsableState.Never)]
		private static readonly ScsiCommandCode[] __SupportedOperations = new ScsiCommandCode[] { };
		public override IList<ScsiCommandCode> GetSupportedOperations() { return __SupportedOperations; }
		public DoubleDensityCDRWWriteFeature() : base(FeatureCode.DoubleDensityCDRWWrite) { }

		[DebuggerBrowsable(DebuggerBrowsableState.Never)]
		private BitVector8 byte4;
		public bool Intermediate { get { return this.byte4[1]; } set { this.byte4[1] = value; } }
		public bool Blank { get { return this.byte4[0]; } set { this.byte4[0] = value; } }
		[DebuggerBrowsable(DebuggerBrowsableState.Never)]
		private byte byte5;
		[DebuggerBrowsable(DebuggerBrowsableState.Never)]
		private byte byte6;
		[DebuggerBrowsable(DebuggerBrowsableState.Never)]
		private byte byte7;
	}

	/// <summary>
	/// This feature identifies a drive that is able to write data to contiguous regions that are allocated on multiple layers,
	/// and is able to append data to a limited number of locations on the media. The drive may write two or more recording layers sequentially and alternately.
	///</summary>
	[StructLayout(LayoutKind.Sequential, Pack = 1)]
	public class LayerJumpRecordingFeature : Feature
	{
		[DebuggerBrowsable(DebuggerBrowsableState.Never)]
		private static readonly IntPtr LINK_SIZES_OFFSET = Marshal.OffsetOf(typeof(LayerJumpRecordingFeature), "_LinkSizes");
		[DebuggerBrowsable(DebuggerBrowsableState.Never)]
		private static readonly ScsiCommandCode[] __SupportedOperations = new ScsiCommandCode[] { };
		public override IList<ScsiCommandCode> GetSupportedOperations() { return __SupportedOperations; }
		public LayerJumpRecordingFeature() : base(FeatureCode.LayerJumpRecording) { }

		[DebuggerBrowsable(DebuggerBrowsableState.Never)]
		private byte byte4;
		[DebuggerBrowsable(DebuggerBrowsableState.Never)]
		private byte byte5;
		[DebuggerBrowsable(DebuggerBrowsableState.Never)]
		private byte byte6;
		[DebuggerBrowsable(DebuggerBrowsableState.Never)]
		private byte _NumberOfLinkSizes;
		[DebuggerBrowsable(DebuggerBrowsableState.Never)]
		[MarshalAs(UnmanagedType.ByValArray, SizeConst = 1)]
		private byte[] _LinkSizes;
		public byte[] LinkSizes
		{
			get { return this._LinkSizes; }
			set
			{
				this._LinkSizes = value;
				this._NumberOfLinkSizes = value == null ? (byte)0 : (byte)value.Length;
				this.AdditionalLength = (byte)(4 + this._NumberOfLinkSizes + 7 + this.CalculatePadBytes()); ;
			}
		}

		protected override void MarshalFrom(BufferWithSize buffer)
		{
			Marshaler.DefaultPtrToStructure(buffer, this);
			this._LinkSizes = new byte[this.AdditionalLength - this._NumberOfLinkSizes - this.CalculatePadBytes()];
			buffer.CopyTo(LINK_SIZES_OFFSET, this._LinkSizes, IntPtr.Zero, (IntPtr)this._LinkSizes.Length);
		}

		protected override void MarshalTo(BufferWithSize buffer)
		{
			Marshaler.DefaultStructureToPtr((object)this, buffer);
			buffer.CopyFrom(LINK_SIZES_OFFSET, this._LinkSizes, IntPtr.Zero, (IntPtr)this._LinkSizes.Length);
		}

		private byte CalculatePadBytes() { return (byte)(3 - (this._NumberOfLinkSizes + 3) % 4); }
	}

	/// <summary>
	/// This feature indicate the ability to write in layer jump recording mode and the ability to overwrite the logically recorded blocks, but only in blocking boundaries. The layer Jump <see cref="RigidRestrictedOverwriteFeature"/> and the <see cref="RandomWritableFeature"/> are not be concurrently current. If the mounted medium is write protected, this feature is not current.
	/// This feature and the <see cref="RigidRestrictedOverwriteFeature"/> may be concurrently current, but when the current recording mode of the mounted disc is layer jump recording mode, <see cref="RigidRestrictedOverwriteFeature"/> is not current.
	///</summary>
	[StructLayout(LayoutKind.Sequential, Pack = 1)]
	public class LayerJumpRigidRestrictedOverwriteFeature : Feature
	{
		[DebuggerBrowsable(DebuggerBrowsableState.Never)]
		private static readonly ScsiCommandCode[] __SupportedOperations = new ScsiCommandCode[] { };
		public override IList<ScsiCommandCode> GetSupportedOperations() { return __SupportedOperations; }
		public LayerJumpRigidRestrictedOverwriteFeature() : base(FeatureCode.LayerJumpRigidRestrictedOverwrite) { }

		[DebuggerBrowsable(DebuggerBrowsableState.Never)]
		private BitVector8 byte4;
		public bool CloseLayerJumpBlock { get { return this.byte4[0]; } set { this.byte4[0] = value; } }
		[DebuggerBrowsable(DebuggerBrowsableState.Never)]
		private byte byte5;
		[DebuggerBrowsable(DebuggerBrowsableState.Never)]
		private byte byte6;
		[DebuggerBrowsable(DebuggerBrowsableState.Never)]
		private byte byte7;
		public byte BufferBlockSize;
	}

	/// <summary>This feature identifies the ability to stop the long immediate operation (e.g., formatting and closing) by a command.</summary>
	[StructLayout(LayoutKind.Sequential, Pack = 1)]
	public class StopLongOperationFeature : Feature
	{
		[DebuggerBrowsable(DebuggerBrowsableState.Never)]
		private static readonly ScsiCommandCode[] __SupportedOperations = new ScsiCommandCode[] { };
		public override IList<ScsiCommandCode> GetSupportedOperations() { return __SupportedOperations; }
		public StopLongOperationFeature() : base(FeatureCode.StopLongOperation) { }
	}

	/// <summary>This feature identifies a drive that has the ability to perform writing CD-RW media. This feature is not current if CD-RW media is not mounted.</summary>
	[StructLayout(LayoutKind.Sequential, Pack = 1)]
	public class CDRWMediaWriteSupportFeature : Feature
	{
		[DebuggerBrowsable(DebuggerBrowsableState.Never)]
		private static readonly ScsiCommandCode[] __SupportedOperations = new ScsiCommandCode[] { };
		public override IList<ScsiCommandCode> GetSupportedOperations() { return __SupportedOperations; }
		public CDRWMediaWriteSupportFeature() : base(FeatureCode.CDRWMediaWriteSupport) { }

		[DebuggerBrowsable(DebuggerBrowsableState.Never)]
		private byte byte4;
		[DebuggerBrowsable(DebuggerBrowsableState.Never)]
		private BitVector8 _MediaSubtypeSupport;
		public BitVector8 MediaSubtypeSupport { get { return this._MediaSubtypeSupport; } set { this._MediaSubtypeSupport = value; } }
		[DebuggerBrowsable(DebuggerBrowsableState.Never)]
		private byte byte6;
		[DebuggerBrowsable(DebuggerBrowsableState.Never)]
		private byte byte7;
	}

	/// <summary>A drive that reports the feature is able to provide logical block overwrite service on BD-R discs that are formatted as SRM+POW.</summary>
	[StructLayout(LayoutKind.Sequential, Pack = 1)]
	public class BDRPseudoOverwriteFeature : Feature
	{
		[DebuggerBrowsable(DebuggerBrowsableState.Never)]
		private static readonly ScsiCommandCode[] __SupportedOperations = new ScsiCommandCode[] { };
		public override IList<ScsiCommandCode> GetSupportedOperations() { return __SupportedOperations; }
		public BDRPseudoOverwriteFeature() : base(FeatureCode.BDRPseudoOverwrite) { }

		[DebuggerBrowsable(DebuggerBrowsableState.Never)]
		private byte byte4;
		[DebuggerBrowsable(DebuggerBrowsableState.Never)]
		private byte byte5;
		[DebuggerBrowsable(DebuggerBrowsableState.Never)]
		private byte byte6;
		[DebuggerBrowsable(DebuggerBrowsableState.Never)]
		private byte byte7;
	} //Good model

	/// <summary>This feature indicates that the drive is capable of reading a recorded DVD+RW DL disc that is formatted according to [DVD+Ref4]. Specifically, this includes the capability of reading DCBs.</summary>
	[StructLayout(LayoutKind.Sequential, Pack = 1)]
	public class DvdPlusRWDualLayerFeature : Feature
	{
		[DebuggerBrowsable(DebuggerBrowsableState.Never)]
		private static readonly ScsiCommandCode[] __SupportedOperations = new ScsiCommandCode[] { };
		public override IList<ScsiCommandCode> GetSupportedOperations() { return __SupportedOperations; }
		public DvdPlusRWDualLayerFeature() : base(FeatureCode.DvdPlusRWDualLayer) { }

		[DebuggerBrowsable(DebuggerBrowsableState.Never)]
		private BitVector8 byte4;
		public bool Write { get { return this.byte4[0]; } set { this.byte4[0] = value; } }
		[DebuggerBrowsable(DebuggerBrowsableState.Never)]
		private BitVector8 byte5;
		public bool QuickStart { get { return this.byte5[1]; } set { this.byte5[1] = value; } }
		public bool CloseOnly { get { return this.byte5[0]; } set { this.byte5[0] = value; } }
		[DebuggerBrowsable(DebuggerBrowsableState.Never)]
		private byte byte6;
		[DebuggerBrowsable(DebuggerBrowsableState.Never)]
		private byte byte7;
	}

	/// <summary>This feature indicates that the drive is capable of reading a recorded DVD+R Dual Layer disc that is written according to [DVD+Ref3].</summary>
	[StructLayout(LayoutKind.Sequential, Pack = 1)]
	public class DvdPlusRDualLayerFeature : Feature
	{
		[DebuggerBrowsable(DebuggerBrowsableState.Never)]
		private static readonly ScsiCommandCode[] __SupportedOperations = new ScsiCommandCode[] { };
		public override IList<ScsiCommandCode> GetSupportedOperations() { return __SupportedOperations; }
		public DvdPlusRDualLayerFeature() : base(FeatureCode.DvdPlusRDualLayer) { }

		[DebuggerBrowsable(DebuggerBrowsableState.Never)]
		private BitVector8 byte4;
		public bool Write { get { return this.byte4[0]; } set { this.byte4[0] = value; } }
		[DebuggerBrowsable(DebuggerBrowsableState.Never)]
		private byte byte5;
		[DebuggerBrowsable(DebuggerBrowsableState.Never)]
		private byte byte6;
		[DebuggerBrowsable(DebuggerBrowsableState.Never)]
		private byte byte7;
	}

	/// <summary>This feature identifies a drive that is able to read control structures and user data from the BD disc.</summary>
	[StructLayout(LayoutKind.Sequential, Pack = 1)]
	public class BDReadFeature : Feature
	{
		[DebuggerBrowsable(DebuggerBrowsableState.Never)]
		private static readonly ScsiCommandCode[] __SupportedOperations = new ScsiCommandCode[] { };
		public override IList<ScsiCommandCode> GetSupportedOperations() { return __SupportedOperations; }
		public BDReadFeature() : base(FeatureCode.BDRead) { }

		[DebuggerBrowsable(DebuggerBrowsableState.Never)]
		private byte byte4;
		[DebuggerBrowsable(DebuggerBrowsableState.Never)]
		private byte byte5;
		[DebuggerBrowsable(DebuggerBrowsableState.Never)]
		private byte byte6;
		[DebuggerBrowsable(DebuggerBrowsableState.Never)]
		private byte byte7;
		[DebuggerBrowsable(DebuggerBrowsableState.Never)]
		[MarshalAs(UnmanagedType.ByValArray, SizeConst = 4)]
		private BitVector16[] _BDREReadSupportBitmap = new BitVector16[4];
		public BitVector16[] BDREReadSupportBitmap { get { return this._BDREReadSupportBitmap; } }
		[DebuggerBrowsable(DebuggerBrowsableState.Never)]
		[MarshalAs(UnmanagedType.ByValArray, SizeConst = 8)]
		private BitVector16[] _BDRReadSupportBitmap = new BitVector16[8];
		public BitVector16[] BDRReadSupportBitmap { get { return this._BDRReadSupportBitmap; } }
		[DebuggerBrowsable(DebuggerBrowsableState.Never)]
		[MarshalAs(UnmanagedType.ByValArray, SizeConst = 8)]
		private BitVector16[] _BDROMReadSupportBitmap = new BitVector16[8];
		public BitVector16[] BDROMReadSupportBitmap { get { return this._BDROMReadSupportBitmap; } }

	}

	/// <summary>This feature identifies a drive that is able to write control structures and user data to certain BD discs.</summary>
	[StructLayout(LayoutKind.Sequential, Pack = 1)]
	public class BDWriteFeature : Feature
	{
		[DebuggerBrowsable(DebuggerBrowsableState.Never)]
		private static readonly ScsiCommandCode[] __SupportedOperations = new ScsiCommandCode[] { };
		public override IList<ScsiCommandCode> GetSupportedOperations() { return __SupportedOperations; }
		public BDWriteFeature() : base(FeatureCode.BDWrite) { }

		[DebuggerBrowsable(DebuggerBrowsableState.Never)]
		private byte byte4;
		[DebuggerBrowsable(DebuggerBrowsableState.Never)]
		private byte byte5;
		[DebuggerBrowsable(DebuggerBrowsableState.Never)]
		private byte byte6;
		[DebuggerBrowsable(DebuggerBrowsableState.Never)]
		private byte byte7;
		[DebuggerBrowsable(DebuggerBrowsableState.Never)]
		[MarshalAs(UnmanagedType.ByValArray, SizeConst = 4)]
		private BitVector16[] _BDREWriteSupportBitmap = new BitVector16[4];
		public BitVector16[] BDREWriteSupportBitmap { get { return this._BDREWriteSupportBitmap; } }
		[DebuggerBrowsable(DebuggerBrowsableState.Never)]
		[MarshalAs(UnmanagedType.ByValArray, SizeConst = 8)]
		private BitVector16[] _BDRWriteSupportBitmap = new BitVector16[8];
		public BitVector16[] BDRWriteSupportBitmap { get { return this._BDRWriteSupportBitmap; } }

	}

	/// <summary>A drive that reports this feature is able to detect and report defective writable units and to manage the defect or not according to instructions from the host.</summary>
	[StructLayout(LayoutKind.Sequential, Pack = 1)]
	public class TimelySafeRecordingFeature : Feature
	{
		[DebuggerBrowsable(DebuggerBrowsableState.Never)]
		private static readonly ScsiCommandCode[] __SupportedOperations = new ScsiCommandCode[] { };
		public override IList<ScsiCommandCode> GetSupportedOperations() { return __SupportedOperations; }
		public TimelySafeRecordingFeature() : base(FeatureCode.TimelySafeRecording) { }
	}

	/// <summary>This feature identifies a drive that is able to read HD DVD specific information from the media. This feature indicates support for reading HD DVD specific structures.</summary>
	[StructLayout(LayoutKind.Sequential, Pack = 1)]
	public class HDDvdReadFeature : Feature
	{
		[DebuggerBrowsable(DebuggerBrowsableState.Never)]
		private static readonly ScsiCommandCode[] __SupportedOperations = new ScsiCommandCode[] { };
		public override IList<ScsiCommandCode> GetSupportedOperations() { return __SupportedOperations; }
		public HDDvdReadFeature() : base(FeatureCode.HDDvdRead) { }

		[DebuggerBrowsable(DebuggerBrowsableState.Never)]
		private BitVector8 byte4;
		public bool HDDvdR { get { return this.byte4[0]; } set { this.byte4[0] = value; } }
		[DebuggerBrowsable(DebuggerBrowsableState.Never)]
		private byte byte5;
		[DebuggerBrowsable(DebuggerBrowsableState.Never)]
		private BitVector8 byte6;
		public bool HDDvdRam { get { return this.byte6[0]; } set { this.byte6[0] = value; } }
		[DebuggerBrowsable(DebuggerBrowsableState.Never)]
		private byte byte7;
	}

	/// <summary>This feature indicates the ability to write to HD DVD-R/-RW media.</summary>
	[StructLayout(LayoutKind.Sequential, Pack = 1)]
	public class HDDvdWriteFeature : Feature
	{
		[DebuggerBrowsable(DebuggerBrowsableState.Never)]
		private static readonly ScsiCommandCode[] __SupportedOperations = new ScsiCommandCode[] { };
		public override IList<ScsiCommandCode> GetSupportedOperations() { return __SupportedOperations; }
		public HDDvdWriteFeature() : base(FeatureCode.HDDvdWrite) { }

		[DebuggerBrowsable(DebuggerBrowsableState.Never)]
		private BitVector8 byte4;
		public bool HDDvdR { get { return this.byte4[0]; } set { this.byte4[0] = value; } }
		[DebuggerBrowsable(DebuggerBrowsableState.Never)]
		private byte byte5;
		[DebuggerBrowsable(DebuggerBrowsableState.Never)]
		private BitVector8 byte6;
		public bool HDDvdRam { get { return this.byte6[0]; } set { this.byte6[0] = value; } }
		[DebuggerBrowsable(DebuggerBrowsableState.Never)]
		private byte byte7;
	}

	/// <summary>
	/// This feature indicates the ability to perform writing on any part of the data recordable area in multiples of blocking factor.
	/// If the currently mounted medium is write protected, this feature is not current.
	/// Writing from the host into the media must be in units of blocking. Writing begins and stops at blocking boundaries.
	///</summary>
	[StructLayout(LayoutKind.Sequential, Pack = 1)]
	public class HDDvdRWFragmentRecordingFeature : Feature
	{
		[DebuggerBrowsable(DebuggerBrowsableState.Never)]
		private static readonly ScsiCommandCode[] __SupportedOperations = new ScsiCommandCode[] { };
		public override IList<ScsiCommandCode> GetSupportedOperations() { return __SupportedOperations; }
		public HDDvdRWFragmentRecordingFeature() : base(FeatureCode.HDDvdRWFragmentRecording) { }

		[DebuggerBrowsable(DebuggerBrowsableState.Never)]
		private BitVector8 byte4;
		public bool BackgroundPadding { get { return this.byte4[0]; } set { this.byte4[0] = value; } }
		[DebuggerBrowsable(DebuggerBrowsableState.Never)]
		private byte byte5;
		[DebuggerBrowsable(DebuggerBrowsableState.Never)]
		private byte byte6;
		[DebuggerBrowsable(DebuggerBrowsableState.Never)]
		private byte byte7;
	}

	/// <summary>This feature is present when the drive is able to access some Hybrid Discs.</summary>
	[StructLayout(LayoutKind.Sequential, Pack = 1)]
	public class HybridDiscFeature : Feature
	{
		[DebuggerBrowsable(DebuggerBrowsableState.Never)]
		private static readonly ScsiCommandCode[] __SupportedOperations = new ScsiCommandCode[] { };
		public override IList<ScsiCommandCode> GetSupportedOperations() { return __SupportedOperations; }
		public HybridDiscFeature() : base(FeatureCode.HybridDisc) { }

		[DebuggerBrowsable(DebuggerBrowsableState.Never)]
		private BitVector8 byte4;
		public bool ResetImmunity { get { return this.byte4[0]; } set { this.byte4[0] = value; } }
		[DebuggerBrowsable(DebuggerBrowsableState.Never)]
		private byte byte5;
		[DebuggerBrowsable(DebuggerBrowsableState.Never)]
		private byte byte6;
		[DebuggerBrowsable(DebuggerBrowsableState.Never)]
		private byte byte7;
	}

	/// <summary>This feature identifies a drive that is able to perform host and drive directed power management.</summary>
	[StructLayout(LayoutKind.Sequential, Pack = 1)]
	public class PowerManagementFeature : Feature
	{
		[DebuggerBrowsable(DebuggerBrowsableState.Never)]
		private static readonly ScsiCommandCode[] __SupportedOperations = new ScsiCommandCode[] { };
		public override IList<ScsiCommandCode> GetSupportedOperations() { return __SupportedOperations; }
		public PowerManagementFeature() : base(FeatureCode.PowerManagement) { }
	}

	/// <summary>
	/// The S.M.A.R.T. Feature identifies a drive that is able to perform Self-Monitoring Analysis and Reporting Technology.
	/// S.M.A.R.T. was developed to manage the reliability of data storage drives.
	/// S.M.A.R.T. Peripheral data storage drives may suffer performance degradation or failure due to a single event or a combination of events.
	/// Some events are immediate and catastrophic while others cause a gradual degradation of the drive’s ability to perform.
	/// It is possible to predict a portion of the failures, but S.M.A.R.T. is unable to and does not predict all future drive failures.
	///</summary>
	[StructLayout(LayoutKind.Sequential, Pack = 1)]
	public class SelfMonitoringAnalysisAndReportingTechnologyFeature : Feature
	{
		[DebuggerBrowsable(DebuggerBrowsableState.Never)]
		private static readonly ScsiCommandCode[] __SupportedOperations = new ScsiCommandCode[] { };
		public override IList<ScsiCommandCode> GetSupportedOperations() { return __SupportedOperations; }
		public SelfMonitoringAnalysisAndReportingTechnologyFeature() : base(FeatureCode.SelfMonitoringAnalysisAndReportingTechnology) { }

		[DebuggerBrowsable(DebuggerBrowsableState.Never)]
		private BitVector8 byte4;
		public bool PagePresent { get { return this.byte4[0]; } set { this.byte4[0] = value; } }
		[DebuggerBrowsable(DebuggerBrowsableState.Never)]
		private byte byte5;
		[DebuggerBrowsable(DebuggerBrowsableState.Never)]
		private byte byte6;
		[DebuggerBrowsable(DebuggerBrowsableState.Never)]
		private byte byte7;
	}

	/// <summary>This feature identifies a drive that is able to move media from a storage area to a mechanism and back.</summary>
	[StructLayout(LayoutKind.Sequential, Pack = 1)]
	public class EmbeddedChangerFeature : Feature
	{
		[DebuggerBrowsable(DebuggerBrowsableState.Never)]
		private const byte HIGHEST_SLOT_NUMBER_MASK = 0x1F;
		[DebuggerBrowsable(DebuggerBrowsableState.Never)]
		private static readonly ScsiCommandCode[] __SupportedOperations = new ScsiCommandCode[] { };
		public override IList<ScsiCommandCode> GetSupportedOperations() { return __SupportedOperations; }
		public EmbeddedChangerFeature() : base(FeatureCode.EmbeddedChanger) { }

		[DebuggerBrowsable(DebuggerBrowsableState.Never)]
		private BitVector8 byte4;
		public bool SupportsDiscPresent { get { return this.byte4[2]; } set { this.byte4[2] = value; } }
		public bool SideChangeCapable { get { return this.byte4[4]; } set { this.byte4[4] = value; } }
		[DebuggerBrowsable(DebuggerBrowsableState.Never)]
		private byte byte5;
		[DebuggerBrowsable(DebuggerBrowsableState.Never)]
		private byte byte6;
		[DebuggerBrowsable(DebuggerBrowsableState.Never)]
		private BitVector8 byte7;
		public byte HighestSlotNumber
		{
			get { return Bits.GetValueMask((byte)this.byte7, 0, HIGHEST_SLOT_NUMBER_MASK); }
			set { this.byte7 = (BitVector8)Bits.PutValueMask((byte)this.byte7, value, 0, HIGHEST_SLOT_NUMBER_MASK); }
		}
	}

	/// <summary></summary>
	[StructLayout(LayoutKind.Sequential, Pack = 1)]
	public class CDAudioExternalPlayFeature : Feature
	{
		[DebuggerBrowsable(DebuggerBrowsableState.Never)]
		private static readonly ScsiCommandCode[] __SupportedOperations = new ScsiCommandCode[] { };
		public override IList<ScsiCommandCode> GetSupportedOperations() { return __SupportedOperations; }
		public CDAudioExternalPlayFeature() : base(FeatureCode.CDAudioExternalPlay) { }

		[DebuggerBrowsable(DebuggerBrowsableState.Never)]
		private BitVector8 byte4;
		public bool Scan { get { return this.byte4[2]; } set { this.byte4[2] = value; } }
		public bool SeparateChannelMute { get { return this.byte4[1]; } set { this.byte4[1] = value; } }
		public bool SeparateVolume { get { return this.byte4[0]; } set { this.byte4[0] = value; } }
		[DebuggerBrowsable(DebuggerBrowsableState.Never)]
		private byte byte5;
		[DebuggerBrowsable(DebuggerBrowsableState.Never)]
		private byte byte6;
		[DebuggerBrowsable(DebuggerBrowsableState.Never)]
		private ushort _NumberOfVolumeLevels;
		public ushort NumberOfVolumeLevels { get { return Bits.BigEndian(this._NumberOfVolumeLevels); } set { this._NumberOfVolumeLevels = Bits.BigEndian(value); } }
	}

	/// <summary>This feature identifies a drive that is able to upgrade its internal microcode via the interface.</summary>
	[StructLayout(LayoutKind.Sequential, Pack = 1)]
	public class MicrocodeUpgradeFeature : Feature
	{
		[DebuggerBrowsable(DebuggerBrowsableState.Never)]
		private static readonly ScsiCommandCode[] __SupportedOperations = new ScsiCommandCode[] { };
		public override IList<ScsiCommandCode> GetSupportedOperations() { return __SupportedOperations; }
		public MicrocodeUpgradeFeature() : base(FeatureCode.MicrocodeUpgrade) { }
	}

	/// <summary>This feature identifies a drive that is able to always respond to commands within a set time period. If a command is unable to complete normally within the allotted time, it completes with an error.</summary>
	[StructLayout(LayoutKind.Sequential, Pack = 1)]
	public class TimeoutFeature : Feature
	{
		[DebuggerBrowsable(DebuggerBrowsableState.Never)]
		private static readonly ScsiCommandCode[] __SupportedOperations = new ScsiCommandCode[] { };
		public override IList<ScsiCommandCode> GetSupportedOperations() { return __SupportedOperations; }
		public TimeoutFeature() : base(FeatureCode.Timeout) { }
	}

	/// <summary>
	/// This feature identifies a drive that is able to perform DVD CSS/CPPM authentication and key management.
	/// This feature identifies drives that support CSS for DVD-Video and CPPM for DVD-Audio.
	/// The drive maintains the integrity of the keys by only using DVD CSS authentication and key management procedures.
	/// This feature is current only if a media containing CSS-protected DVD-Video and/or CPPM-protected DVDAudio content is loaded.
	///</summary>
	[StructLayout(LayoutKind.Sequential, Pack = 1)]
	public class DvdContentScramblingSystemFeature : Feature
	{
		[DebuggerBrowsable(DebuggerBrowsableState.Never)]
		private static readonly ScsiCommandCode[] __SupportedOperations = new ScsiCommandCode[] { };
		public override IList<ScsiCommandCode> GetSupportedOperations() { return __SupportedOperations; }
		public DvdContentScramblingSystemFeature() : base(FeatureCode.DvdContentScramblingSystem) { }

		[DebuggerBrowsable(DebuggerBrowsableState.Never)]
		private byte byte4;
		[DebuggerBrowsable(DebuggerBrowsableState.Never)]
		private byte byte5;
		[DebuggerBrowsable(DebuggerBrowsableState.Never)]
		private byte byte6;
		[DebuggerBrowsable(DebuggerBrowsableState.Never)]
		private byte _ContentScramblingSystemVersion;
		public byte ContentScramblingSystemVersion { get { return this._ContentScramblingSystemVersion; } set { this._ContentScramblingSystemVersion = value; } }
	}

	/// <summary>This feature identifies a drive that is able to perform reading and writing within host specified (and drive verified) performance ranges. This feature also indicates whether the drive supports the Stream playback.</summary>
	[StructLayout(LayoutKind.Sequential, Pack = 1)]
	public class RealTimeStreamingFeature : Feature
	{
		[DebuggerBrowsable(DebuggerBrowsableState.Never)]
		private static readonly ScsiCommandCode[] __SupportedOperations = new ScsiCommandCode[] { };
		public override IList<ScsiCommandCode> GetSupportedOperations() { return __SupportedOperations; }
		public RealTimeStreamingFeature() : base(FeatureCode.RealTimeStreaming) { }

		[DebuggerBrowsable(DebuggerBrowsableState.Never)]
		private BitVector8 byte4;
		public bool ReadBufferCapacityBlock { get { return this.byte4[4]; } set { this.byte4[4] = value; } }
		public bool SetCDSpeed { get { return this.byte4[3]; } set { this.byte4[3] = value; } }
		public bool ModePage2A { get { return this.byte4[2]; } set { this.byte4[2] = value; } }
		public bool WriteSpeedPerformanceDescriptor { get { return this.byte4[1]; } set { this.byte4[1] = value; } }
		public bool StreamWriting { get { return this.byte4[0]; } set { this.byte4[0] = value; } }
		[DebuggerBrowsable(DebuggerBrowsableState.Never)]
		private byte byte5;
		[DebuggerBrowsable(DebuggerBrowsableState.Never)]
		private byte byte6;
		[DebuggerBrowsable(DebuggerBrowsableState.Never)]
		private byte byte7;
	}

	/// <summary>This feature identifies a drive that has a unique serial number. The vendor ID, model ID, and serial number is able to uniquely identify a drive that has this feature.</summary>
	[StructLayout(LayoutKind.Sequential, Pack = 1)]
	public class driveSerialNumberFeature : Feature
	{
		[DebuggerBrowsable(DebuggerBrowsableState.Never)]
		private static readonly IntPtr SERIAL_NUMBER_OFFSET = Marshal.OffsetOf(typeof(driveSerialNumberFeature), "_SerialNumber");
		[DebuggerBrowsable(DebuggerBrowsableState.Never)]
		private static readonly ScsiCommandCode[] __SupportedOperations = new ScsiCommandCode[] { };
		public override IList<ScsiCommandCode> GetSupportedOperations() { return __SupportedOperations; }
		public driveSerialNumberFeature() : base(FeatureCode.DriveSerialNumber) { }

		[DebuggerBrowsable(DebuggerBrowsableState.Never)]
		[MarshalAs(UnmanagedType.ByValArray, SizeConst = 1)]
		private byte[] _SerialNumber;
		public byte[] SerialNumber
		{
			get { return this._SerialNumber; }
			set
			{
				this._SerialNumber = value;
				this.AdditionalLength = (byte)(1 * (value == null ? 0 : value.Length));
			}
		}

		protected override void MarshalFrom(BufferWithSize buffer)
		{
			Marshaler.DefaultPtrToStructure(buffer, this);
			this._SerialNumber = new byte[this.AdditionalLength / 1];
			buffer.CopyTo(SERIAL_NUMBER_OFFSET, this._SerialNumber, IntPtr.Zero, (IntPtr)this._SerialNumber.Length);
		}

		protected override void MarshalTo(BufferWithSize buffer)
		{
			Marshaler.DefaultStructureToPtr(this, buffer);
			buffer.CopyFrom(SERIAL_NUMBER_OFFSET, this._SerialNumber, IntPtr.Zero, (IntPtr)this._SerialNumber.Length);
		}
	}

	/// <summary>This feature identifies a drive that is capable of reading a media serial number of the currently installed media.</summary>
	[StructLayout(LayoutKind.Sequential, Pack = 1)]
	public class MediaSerialNumberFeature : Feature
	{
		[DebuggerBrowsable(DebuggerBrowsableState.Never)]
		private static readonly ScsiCommandCode[] __SupportedOperations = new ScsiCommandCode[] { };
		public override IList<ScsiCommandCode> GetSupportedOperations() { return __SupportedOperations; }
		public MediaSerialNumberFeature() : base(FeatureCode.MediaSerialNumber) { }
	}

	/// <summary>This feature identifies a drive that is able to read and/or write DCBs from or to the media.</summary>
	[StructLayout(LayoutKind.Sequential, Pack = 1)]
	public class DiscControlBlocksFeature : Feature
	{
		[DebuggerBrowsable(DebuggerBrowsableState.Never)]
		private static readonly IntPtr DCB_ENTRIES_OFFSET = Marshal.OffsetOf(typeof(DiscControlBlocksFeature), "_DCBEntries");
		[DebuggerBrowsable(DebuggerBrowsableState.Never)]
		private static readonly ScsiCommandCode[] __SupportedOperations = new ScsiCommandCode[] { };
		public override IList<ScsiCommandCode> GetSupportedOperations() { return __SupportedOperations; }
		public DiscControlBlocksFeature() : base(FeatureCode.DiscControlBlocks) { }

		[DebuggerBrowsable(DebuggerBrowsableState.Never)]
		[MarshalAs(UnmanagedType.ByValArray, SizeConst = 1)]
		private uint[] _DCBEntries;
		public uint[] DCBEntries
		{
			get { return this._DCBEntries; }
			set
			{
				this._DCBEntries = value;
				this.AdditionalLength = (byte)(4 * (value == null ? 0 : value.Length));
			}
		}

		protected override void MarshalFrom(BufferWithSize buffer)
		{
			Marshaler.DefaultPtrToStructure(buffer, this);
			this._DCBEntries = new uint[this.AdditionalLength / 4];
			unsafe
			{
				var entriesBuffer = buffer.ExtractSegment(DCB_ENTRIES_OFFSET);
				for (int i = 0; i < this._DCBEntries.Length; i++)
				{
					this._DCBEntries[i] = Bits.BigEndian(entriesBuffer.Read<uint>(i * sizeof(uint)));
				}
			}
		}

		protected override void MarshalTo(BufferWithSize buffer)
		{
			Marshaler.DefaultStructureToPtr(this, buffer);
			unsafe
			{
				var entries = buffer.ExtractSegment(DCB_ENTRIES_OFFSET);
				for (int i = 0; i < this._DCBEntries.Length; i++)
				{
					entries.Write(Bits.BigEndian(this._DCBEntries[i]), i * sizeof(uint));
				}
			}
		}
	}

	/// <summary>This feature identifies a drive that is able to perform DVD CPRM and is able to perform CPRM authentication and key management. This feature is current only if a DVD CPRM recordable or rewritable medium is loaded.</summary>
	[StructLayout(LayoutKind.Sequential, Pack = 1)]
	public class DvdContentProtectionForRecordableMediaFeature : Feature
	{
		[DebuggerBrowsable(DebuggerBrowsableState.Never)]
		private static readonly ScsiCommandCode[] __SupportedOperations = new ScsiCommandCode[] { };
		public override IList<ScsiCommandCode> GetSupportedOperations() { return __SupportedOperations; }
		public DvdContentProtectionForRecordableMediaFeature() : base(FeatureCode.DvdContentProtectionForRecordableMedia) { }

		[DebuggerBrowsable(DebuggerBrowsableState.Never)]
		private byte byte4;
		[DebuggerBrowsable(DebuggerBrowsableState.Never)]
		private byte byte5;
		[DebuggerBrowsable(DebuggerBrowsableState.Never)]
		private byte byte6;
		[DebuggerBrowsable(DebuggerBrowsableState.Never)]
		private byte _ContentProtectionForRecordableMediaVersion;
		public byte ContentProtectionForRecordableMediaVersion { get { return this._ContentProtectionForRecordableMediaVersion; } set { this._ContentProtectionForRecordableMediaVersion = value; } }
	}

	/// <summary>
	/// This feature indicates that the drive provides the date and time of the creation of the current firmware revision loaded on the device.
	/// The date and time is the date and time of creation of the firmware version. The date and time is GMT.
	/// The date and time do not change for a given firmware revision. The date and time is later on “newer” firmware for a given device.
	/// This feature is persistent and current if present. No commands are required for this feature.
	///</summary>
	[StructLayout(LayoutKind.Sequential, Pack = 1)]
	public class FirmwareInformationFeature : Feature
	{
		[DebuggerBrowsable(DebuggerBrowsableState.Never)]
		private static readonly ScsiCommandCode[] __SupportedOperations = new ScsiCommandCode[] { };
		public override IList<ScsiCommandCode> GetSupportedOperations() { return __SupportedOperations; }
		public FirmwareInformationFeature() : base(FeatureCode.FirmwareInformation) { }
		[DebuggerBrowsable(DebuggerBrowsableState.Never)]
		private ushort _Century;
		public ushort Century { get { return Bits.BigEndian(this._Century); } set { this._Century = Bits.BigEndian(value); } }
		[DebuggerBrowsable(DebuggerBrowsableState.Never)]
		private ushort _Year;
		public ushort Year { get { return Bits.BigEndian(this._Year); } set { this._Year = Bits.BigEndian(value); } }
		[DebuggerBrowsable(DebuggerBrowsableState.Never)]
		private ushort _Month;
		public ushort Month { get { return Bits.BigEndian(this._Month); } set { this._Month = Bits.BigEndian(value); } }
		[DebuggerBrowsable(DebuggerBrowsableState.Never)]
		private ushort _Day;
		public ushort Day { get { return Bits.BigEndian(this._Day); } set { this._Day = Bits.BigEndian(value); } }
		[DebuggerBrowsable(DebuggerBrowsableState.Never)]
		private ushort _Hour;
		public ushort Hour { get { return Bits.BigEndian(this._Hour); } set { this._Hour = Bits.BigEndian(value); } }
		[DebuggerBrowsable(DebuggerBrowsableState.Never)]
		private ushort _Minute;
		public ushort Minute { get { return Bits.BigEndian(this._Minute); } set { this._Minute = Bits.BigEndian(value); } }
		[DebuggerBrowsable(DebuggerBrowsableState.Never)]
		private ushort _Second;
		public ushort Second { get { return Bits.BigEndian(this._Second); } set { this._Second = Bits.BigEndian(value); } }
		[DebuggerBrowsable(DebuggerBrowsableState.Never)]
		private byte byte18;
		[DebuggerBrowsable(DebuggerBrowsableState.Never)]
		private byte byte19;
	}

	/// <summary>This feature identifies a drive that supports AACS and is able to perform AACS authentication process.</summary>
	[StructLayout(LayoutKind.Sequential, Pack = 1)]
	public class AdvancedAccessContentSystemFeature : Feature
	{
		[DebuggerBrowsable(DebuggerBrowsableState.Never)]
		private const byte NUMBER_OF_AuthenticationGrantIdS_MASK = 0x0F;
		[DebuggerBrowsable(DebuggerBrowsableState.Never)]
		private static readonly ScsiCommandCode[] __SupportedOperations = new ScsiCommandCode[] { };
		public override IList<ScsiCommandCode> GetSupportedOperations() { return __SupportedOperations; }
		public AdvancedAccessContentSystemFeature() : base(FeatureCode.AdvancedAccessContentSystem) { }

		[DebuggerBrowsable(DebuggerBrowsableState.Never)]
		private BitVector8 byte4;
		public bool BindingNonce { get { return this.byte4[0]; } set { this.byte4[0] = value; } }
		[DebuggerBrowsable(DebuggerBrowsableState.Never)]
		private byte _BindingNonceBlockCount;
		public byte BindingNonceBlockCount { get { return this._BindingNonceBlockCount; } set { this._BindingNonceBlockCount = value; } }
		[DebuggerBrowsable(DebuggerBrowsableState.Never)]
		private BitVector8 byte6;
		public byte AuthenticationGrantIdCount
		{
			get { return Bits.GetValueMask((byte)this.byte6, 0, NUMBER_OF_AuthenticationGrantIdS_MASK); }
			set { this.byte6 = (BitVector8)Bits.PutValueMask((byte)this.byte6, value, 0, NUMBER_OF_AuthenticationGrantIdS_MASK); }
		}
		[DebuggerBrowsable(DebuggerBrowsableState.Never)]
		private byte _AdvancedAccessContentSystemVersion;
		public byte AdvancedAccessContentSystemVersion { get { return this._AdvancedAccessContentSystemVersion; } set { this._AdvancedAccessContentSystemVersion = value; } }
	}

	/// <summary>This feature identifies a drive that supports CSS Managed recording on DVDDownload disc. This feature is current only if a recordable DVD-Download disc is loaded.</summary>
	[StructLayout(LayoutKind.Sequential, Pack = 1)]
	public class DvdContentScramblingSystemManagedRecordingFeature : Feature
	{
		[DebuggerBrowsable(DebuggerBrowsableState.Never)]
		private static readonly ScsiCommandCode[] __SupportedOperations = new ScsiCommandCode[] { };
		public override IList<ScsiCommandCode> GetSupportedOperations() { return __SupportedOperations; }
		public DvdContentScramblingSystemManagedRecordingFeature() : base(FeatureCode.DvdContentScramblingSystemManagedRecording) { }

		[DebuggerBrowsable(DebuggerBrowsableState.Never)]
		private byte _MaximumNumberOfScrambledExtentInformationSeries;
		public byte MaximumNumberOfScrambledExtentInformationSeries { get { return this._MaximumNumberOfScrambledExtentInformationSeries; } set { this._MaximumNumberOfScrambledExtentInformationSeries = value; } }
		[DebuggerBrowsable(DebuggerBrowsableState.Never)]
		private byte byte5;
		[DebuggerBrowsable(DebuggerBrowsableState.Never)]
		private byte byte6;
		[DebuggerBrowsable(DebuggerBrowsableState.Never)]
		private byte byte7;
	}

	/// <summary>This feature specifies that the drive is able to process disc data structures that are specified in the [VCPS].</summary>
	[StructLayout(LayoutKind.Sequential, Pack = 1)]
	public class VCPSFeature : Feature
	{
		[DebuggerBrowsable(DebuggerBrowsableState.Never)]
		private static readonly ScsiCommandCode[] __SupportedOperations = new ScsiCommandCode[] { };
		public override IList<ScsiCommandCode> GetSupportedOperations() { return __SupportedOperations; }
		public VCPSFeature() : base(FeatureCode.VCPS) { }

		[DebuggerBrowsable(DebuggerBrowsableState.Never)]
		private byte byte4;
		[DebuggerBrowsable(DebuggerBrowsableState.Never)]
		private byte byte5;
		[DebuggerBrowsable(DebuggerBrowsableState.Never)]
		private byte byte6;
		[DebuggerBrowsable(DebuggerBrowsableState.Never)]
		private byte byte7;
	}

	/// <summary>
	/// This feature identifies a drive that supports SecurDisc content protection and is able to perform SecurDisc authentication process.
	/// This feature is current only when an optical disc currently in the drive can be used with SecurDisc. The feature is current regardless of whether an optical disc has already been written to using SecurDisc or not.
	///</summary>
	[StructLayout(LayoutKind.Sequential, Pack = 1)]
	public class SecurDiscFeature : Feature
	{
		[DebuggerBrowsable(DebuggerBrowsableState.Never)]
		private static readonly ScsiCommandCode[] __SupportedOperations = new ScsiCommandCode[] { };
		public override IList<ScsiCommandCode> GetSupportedOperations() { return __SupportedOperations; }
		public SecurDiscFeature() : base(FeatureCode.SecurDisc) { }
	}


	//Needed structures

	public enum FeatureCode : short
	{
		/// <summary>This feature identifies profiles supported by the drive.</summary>
		ProfileList = 0x0000,
		/// <summary>This feature identifies a drive that supports functionality common to all devices.</summary>
		[Description("This feature identifies a drive that supports functionality common to all devices.")]
		Core = 0x0001,
		/// <summary>This feature identifies the ability of the drive to notify a host about operational changes and accept host requests to prevent operational changes.</summary>
		[Description("This feature identifies the ability of the drive to notify a host about operational changes and accept host requests to prevent operational changes.")]
		Morphing = 0x0002,
		/// <summary>This feature identifies a drive that has a medium that is removable. Media is be considered removable if it is possible to remove it from the loaded position, i.e., a single mechanism changer, even if the media is captive to the changer.</summary>
		[Description("This feature identifies a drive that has a medium that is removable. Media is be considered removable if it is possible to remove it from the loaded position, i.e., a single mechanism changer, even if the media is captive to the changer.")]
		RemovableMedium = 0x0003,
		/// <summary>This feature identifies reporting capability and changing capability for write protection status of the drive.</summary>
		[Description("This feature identifies reporting capability and changing capability for write protection status of the drive.")]
		WriteProtect = 0x0004,
		//0x0005-0x0010 reserved
		/// <summary>This feature identifies a drive that is able to read data from logical blocks referenced by logical block addresses, but not requiring that either the addresses or the read sequences occur in any particular order.</summary>
		[Description("This feature identifies a drive that is able to read data from logical blocks referenced by logical block addresses, but not requiring that either the addresses or the read sequences occur in any particular order.")]
		RandomReadable = 0x0010,
		//0x0011-0x001C reserved
		/// <summary>The drive conforms to the OSTA Multi-Read specification 1.00, with the exception of CD play capability (the <see cref="CDAudioExternalPlayFeature"/> is not required).</summary>
		[Description("The drive conforms to the OSTA Multi-Read specification 1.00, with the exception of CD play capability (the CDAudioExternalPlayFeature) is not required).")]
		MultiRead = 0x001D,
		/// <summary>This feature identifies a drive that is able to read CD specific information from the media and is able to read user data from all types of CD sectors.</summary>
		[Description("This feature identifies a drive that is able to read CD specific information from the media and is able to read user data from all types of CD sectors.")]
		CDRead = 0x001E,
		/// <summary>This feature identifies a drive that is able to read DVD specific information from the media.</summary>
		[Description("This feature identifies a drive that is able to read DVD specific information from the media.")]
		DvdRead = 0x001F,
		/// <summary>This feature identifies a drive that is able to write data to logical blocks specified by logical block addresses. There is no requirement that the addresses in sequences of writes occur in any particular order.</summary>
		[Description("This feature identifies a drive that is able to write data to logical blocks specified by logical block addresses. There is no requirement that the addresses in sequences of writes occur in any particular order.")]
		RandomWritable = 0x0020,
		/// <summary>This feature identifies a drive 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. On CD media, this is known as packet recording, on DVD and HD DVD media it is known as Incremental Recording, and on a BD-R disc it is known as SRM recording.</summary>
		[Description("This feature identifies a drive 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. On CD media, this is known as packet recording, on DVD and HD DVD media it is known as Incremental Recording, and on a BD-R disc it is known as SRM recording.")]
		IncrementalStreamingWritable = 0x0021,
		/// <summary></summary>
		SectorErasable = 0x0022,
		/// <summary>This feature identifies a drive that is able to format media into logical blocks.</summary>
		[Description("This feature identifies a drive that is able to format media into logical blocks.")]
		Formattable = 0x0023,
		/// <summary>This feature identifies a drive that has defect management available to provide a defect-free contiguous address space.</summary>
		[Description("This feature identifies a drive that has defect management available to provide a defect-free contiguous address space.")]
		DefectManagement = 0x0024,
		/// <summary>This feature identifies a drive that has the ability to record to any previously unrecorded logical block. The recording of logical blocks may occur in any order. Previously recorded blocks are not overwritten.</summary>
		[Description("This feature identifies a drive that has the ability to record to any previously unrecorded logical block. The recording of logical blocks may occur in any order. Previously recorded blocks are not overwritten.")]
		WriteOnce = 0x0025,
		/// <summary>This feature identifies a drive that has the ability to overwrite logical blocks only in fixed sets at a time.</summary>
		[Description("This feature identifies a drive that has the ability to overwrite logical blocks only in fixed sets at a time.")]
		RestrictedOverwrite = 0x0026,
		/// <summary>This feature identifies a drive that has the ability to write CD-RW media that is designed for constant angular velocity recording. The drive conforms to the Orange Book Part 3 Volume 2 specification. This feature is not current if high-speed recordable CD-RW media is not mounted.</summary>
		[Description("This feature identifies a drive that has the ability to write CD-RW media that is designed for constant angular velocity recording. The drive conforms to the Orange Book Part 3 Volume 2 specification. This feature is not current if high-speed recordable CD-RW media is not mounted.")]
		CDRWConstantAngularVelocityWrite = 0x0027,
		/// <summary>This feature indicates that the drive is capable of reading a disc with the MRW format.</summary>
		[Description("This feature indicates that the drive is capable of reading a disc with the MRW format.")]
		MountRainierRewritable = 0x0028,
		/// <summary>This feature identifies a drive that has the ability to perform media certification and RECOVERED ERROR reporting for drive assisted software defect management. In case of Persistent-DM mode, the <see cref="Read12Command"/> command with Streaming bit = 1 may be performed without medium certification. When this feature is current, the <see cref="DefectManagementFeature"/> is not current. This feature may be current when Restricted Overwrite formatted media or Rigid Restricted Overwrite formatted media is present.</summary>
		[Description("This feature identifies a drive that has the ability to perform media certification and RECOVERED ERROR reporting for drive assisted software defect management. In case of Persistent-DM mode, the Read12Command command with Streaming bit = 1 may be performed without medium certification. When this feature is current, the DefectManagementFeature is not current. This feature may be current when Restricted Overwrite formatted media or Rigid Restricted Overwrite formatted media is present.")]
		EnhancedDefectReporting = 0x0029, //added
		/// <summary>This feature indicates that the drive is capable of reading a recorded DVD+RW disc that is formatted according to [DVD+Ref2].</summary>
		[Description("This feature indicates that the drive is capable of reading a recorded DVD+RW disc that is formatted according to [DVD+Ref2].")]
		DvdPlusRW = 0x002A,
		/// <summary>This feature indicates that the drive is capable of reading a recorded DVD+R disc that is written according to [DVD+Ref1]. Specifically, this includes the capability of reading DCBs.</summary>
		[Description("This feature indicates that the drive is capable of reading a recorded DVD+R disc that is written according to [DVD+Ref1]. Specifically, this includes the capability of reading DCBs.")]
		DvdPlusR = 0x002B, //added
		/// <summary>This feature identifies a drive that has the ability to perform writing only on blocking boundaries. This feature is different from the <see cref="RestrictedOverwriteFeature"/> feature because each write command is also required to end on a blocking boundary. This feature replaces the <see cref="RandomWritableFeature"/> for drives that do not perform readmodify- write operations on write requests smaller than blocking. This feature may be present when DVD-RW Restricted Over Writable media is loaded. Drives with write protected media do not have this feature current. This feature is not current if the <see cref="RandomWritableFeature"/> is current. If this feature is current, the <see cref="RandomWritableFeature"/> feature is not current.</summary>
		[Description("This feature identifies a drive that has the ability to perform writing only on blocking boundaries. This feature is different from the RestrictedOverwriteFeature feature because each write command is also required to end on a blocking boundary. This feature replaces the RandomWritableFeature for drives that do not perform readmodify- write operations on write requests smaller than blocking. This feature may be present when DVD-RW Restricted Over Writable media is loaded. Drives with write protected media do not have this feature current. This feature is not current if the RandomWritableFeature is current. If this feature is current, the RandomWritableFeature feature is not current.")]
		RigidRestrictedOverwrite = 0x002C,
		/// <summary>This feature identifies a drive that is able to write data to a CD track.</summary>
		[Description("This feature identifies a drive that is able to write data to a CD track.")]
		CDTrackAtOnce = 0x002D,
		/// <summary>This feature identifies a drive that is able to write a CD in session-at-once or raw mode.</summary>
		[Description("This feature identifies a drive that is able to write a CD in session-at-once or raw mode.")]
		CDMastering = 0x002E,
		/// <summary>This feature identifies a drive that has the ability to write data to DVD-R/-RW in disc at once mode.</summary>
		[Description("This feature identifies a drive that has the ability to write data to DVD-R/-RW in disc at once mode.")]
		DvdMinusRWWrite = 0x002F,
		/// <summary></summary>
		DoubleDensityCDRead = 0x0030,
		/// <summary></summary>
		DoubleDensityCDRWrite = 0x0031,
		/// <summary></summary>
		DoubleDensityCDRWWrite = 0x0032,
		/// <summary>This feature identifies a drive that is able to write data to contiguous regions that are allocated on multiple layers, and is able to append data to a limited number of locations on the media. The drive may write two or more recording layers sequentially and alternately.</summary>
		[Description("This feature identifies a drive that is able to write data to contiguous regions that are allocated on multiple layers, and is able to append data to a limited number of locations on the media. The drive may write two or more recording layers sequentially and alternately.")]
		LayerJumpRecording = 0x0033, //added
		/// <summary>This feature indicate the ability to write in layer jump recording mode and the ability to overwrite the logically recorded blocks, but only in blocking boundaries. The layer Jump <see cref="RigidRestrictedOverwriteFeature"/> and the <see cref="RandomWritableFeature"/> are not be concurrently current. If the mounted medium is write protected, this feature is not current. This feature and the <see cref="RigidRestrictedOverwriteFeature"/> may be concurrently current, but when the current recording mode of the mounted disc is layer jump recording mode, <see cref="RigidRestrictedOverwriteFeature"/> is not current.</summary>
		[Description("This feature indicate the ability to write in layer jump recording mode and the ability to overwrite the logically recorded blocks, but only in blocking boundaries. The layer Jump RigidRestrictedOverwriteFeature and the RandomWritableFeature are not be concurrently current. If the mounted medium is write protected, this feature is not current. This feature and the RigidRestrictedOverwriteFeature may be concurrently current, but when the current recording mode of the mounted disc is layer jump recording mode, RigidRestrictedOverwriteFeature is not current.")]
		LayerJumpRigidRestrictedOverwrite = 0x0034, //added
		/// <summary>This feature identifies the ability to stop the long immediate operation (e.g., formatting and closing) by a command.</summary>
		[Description("This feature identifies the ability to stop the long immediate operation (e.g., formatting and closing) by a command.")]
		StopLongOperation = 0x0035, //added
		//0x0036 reserved
		/// <summary>This feature identifies a drive that has the ability to perform writing CD-RW media. This feature is not current if CD-RW media is not mounted.</summary>
		[Description("This feature identifies a drive that has the ability to perform writing CD-RW media. This feature is not current if CD-RW media is not mounted.")]
		CDRWMediaWriteSupport = 0x0037, //added
		/// <summary>A drive that reports the feature is able to provide logical block overwrite service on BD-R discs that are formatted as SRM+POW.</summary>
		[Description("A drive that reports the feature is able to provide logical block overwrite service on BD-R discs that are formatted as SRM+POW.")]
		BDRPseudoOverwrite = 0x0038, //added
		//0x0039 reserved
		/// <summary>This feature indicates that the drive is capable of reading a recorded DVD+RW DL disc that is formatted according to [DVD+Ref4]. Specifically, this includes the capability of reading DCBs.</summary>
		[Description("This feature indicates that the drive is capable of reading a recorded DVD+RW DL disc that is formatted according to [DVD+Ref4]. Specifically, this includes the capability of reading DCBs.")]
		DvdPlusRWDualLayer = 0x003A, //added
		/// <summary>This feature indicates that the drive is capable of reading a recorded DVD+R Dual Layer disc that is written according to [DVD+Ref3].</summary>
		[Description("This feature indicates that the drive is capable of reading a recorded DVD+R Dual Layer disc that is written according to [DVD+Ref3].")]
		DvdPlusRDualLayer = 0x003B, //added
		//0x003C-0x003F reserved
		/// <summary>This feature identifies a drive that is able to read control structures and user data from the BD disc.</summary>
		[Description("This feature identifies a drive that is able to read control structures and user data from the BD disc.")]
		BDRead = 0x0040, //added
		/// <summary>This feature identifies a drive that is able to write control structures and user data to certain BD discs.</summary>
		[Description("This feature identifies a drive that is able to write control structures and user data to certain BD discs.")]
		BDWrite = 0x0041, //added
		/// <summary>A drive that reports this feature is able to detect and report defective writable units and to manage the defect or not according to instructions from the host.</summary>
		[Description("A drive that reports this feature is able to detect and report defective writable units and to manage the defect or not according to instructions from the host.")]
		TimelySafeRecording = 0x0042, //added
		//0x0043-0x004F reserved
		/// <summary>This feature identifies a drive that is able to read HD DVD specific information from the media. This feature indicates support for reading HD DVD specific structures.</summary>
		[Description("This feature identifies a drive that is able to read HD DVD specific information from the media. This feature indicates support for reading HD DVD specific structures.")]
		HDDvdRead = 0x0050, //added
		/// <summary>This feature indicates the ability to write to HD DVD-R/-RW media.</summary>
		[Description("This feature indicates the ability to write to HD DVD-R/-RW media.")]
		HDDvdWrite = 0x0051, //added
		/// <summary>This feature indicates the ability to perform writing on any part of the data recordable area in multiples of blocking factor. If the currently mounted medium is write protected, this feature is not current. Writing from the host into the media must be in units of blocking. Writing begins and stops at blocking boundaries.</summary>
		[Description("This feature indicates the ability to perform writing on any part of the data recordable area in multiples of blocking factor. If the currently mounted medium is write protected, this feature is not current. Writing from the host into the media must be in units of blocking. Writing begins and stops at blocking boundaries.")]
		HDDvdRWFragmentRecording = 0x0052, //added
		//0x0053-0x007F reserved
		/// <summary>This feature is present when the drive is able to access some Hybrid Discs.</summary>
		[Description("This feature is present when the drive is able to access some Hybrid Discs.")]
		HybridDisc = 0x0080, //added
		//0x0081-0x00FF reserved
		/// <summary>This feature identifies a drive that is able to perform host and drive directed power management.</summary>
		[Description("This feature identifies a drive that is able to perform host and drive directed power management.")]
		PowerManagement = 0x0100,
		/// <summary>The S.M.A.R.T. Feature identifies a drive that is able to perform Self-Monitoring Analysis and Reporting Technology. S.M.A.R.T. was developed to manage the reliability of data storage drives. S.M.A.R.T. Peripheral data storage drives may suffer performance degradation or failure due to a single event or a combination of events. Some events are immediate and catastrophic while others cause a gradual degradation of the drive’s ability to perform. It is possible to predict a portion of the failures, but S.M.A.R.T. is unable to and does not predict all future drive failures.</summary>
		[Description("The S.M.A.R.T. Feature identifies a drive that is able to perform Self-Monitoring Analysis and Reporting Technology. S.M.A.R.T. was developed to manage the reliability of data storage drives. S.M.A.R.T. Peripheral data storage drives may suffer performance degradation or failure due to a single event or a combination of events. Some events are immediate and catastrophic while others cause a gradual degradation of the drive’s ability to perform. It is possible to predict a portion of the failures, but S.M.A.R.T. is unable to and does not predict all future drive failures.")]
		SelfMonitoringAnalysisAndReportingTechnology = 0x0101,
		/// <summary>This feature identifies a drive that is able to move media from a storage area to a mechanism and back.</summary>
		[Description("This feature identifies a drive that is able to move media from a storage area to a mechanism and back.")]
		EmbeddedChanger = 0x0102,
		/// <summary></summary>
		CDAudioExternalPlay = 0x0103,
		/// <summary>This feature identifies a drive that is able to upgrade its internal microcode via the interface.</summary>
		[Description("This feature identifies a drive that is able to upgrade its internal microcode via the interface.")]
		MicrocodeUpgrade = 0x0104,
		/// <summary>This feature identifies a drive that is able to always respond to commands within a set time period. If a command is unable to complete normally within the allotted time, it completes with an error.</summary>
		[Description("This feature identifies a drive that is able to always respond to commands within a set time period. If a command is unable to complete normally within the allotted time, it completes with an error.")]
		Timeout = 0x0105,
		/// <summary>This feature identifies a drive that is able to perform DVD CSS/CPPM authentication and key management. This feature identifies drives that support CSS for DVD-Video and CPPM for DVD-Audio. The drive maintains the integrity of the keys by only using DVD CSS authentication and key management procedures. This feature is current only if a media containing CSS-protected DVD-Video and/or CPPM-protected DVDAudio content is loaded.</summary>
		[Description("This feature identifies a drive that is able to perform DVD CSS/CPPM authentication and key management. This feature identifies drives that support CSS for DVD-Video and CPPM for DVD-Audio. The drive maintains the integrity of the keys by only using DVD CSS authentication and key management procedures. This feature is current only if a media containing CSS-protected DVD-Video and/or CPPM-protected DVDAudio content is loaded.")]
		DvdContentScramblingSystem = 0x0106,
		/// <summary>This feature identifies a drive that is able to perform reading and writing within host specified (and drive verified) performance ranges. This feature also indicates whether the drive supports the Stream playback.</summary>
		[Description("This feature identifies a drive that is able to perform reading and writing within host specified (and drive verified) performance ranges. This feature also indicates whether the drive supports the Stream playback.")]
		RealTimeStreaming = 0x0107,
		/// <summary>This feature identifies a drive that has a unique serial number. The vendor ID, model ID, and serial number is able to uniquely identify a drive that has this feature.</summary>
		[Description("This feature identifies a drive that has a unique serial number. The vendor ID, model ID, and serial number is able to uniquely identify a drive that has this feature.")]
		DriveSerialNumber = 0x0108,
		/// <summary>This feature identifies a drive that is capable of reading a media serial number of the currently installed media.</summary>
		[Description("This feature identifies a drive that is capable of reading a media serial number of the currently installed media.")]
		MediaSerialNumber = 0x0109, //added
		/// <summary>This feature identifies a drive that is able to read and/or write DCBs from or to the media.</summary>
		DiscControlBlocks = 0x010A,
		/// <summary>This feature identifies a drive that is able to perform DVD CPRM and is able to perform CPRM authentication and key management. This feature is current only if a DVD CPRM recordable or rewritable medium is loaded.</summary>
		DvdContentProtectionForRecordableMedia = 0x010B,
		/// <summary>This feature indicates that the drive provides the date and time of the creation of the current firmware revision loaded on the device. The date and time is the date and time of creation of the firmware version. The date and time is GMT. The date and time do not change for a given firmware revision. The date and time is later on “newer” firmware for a given device. This feature is persistent and current if present. No commands are required for this feature.</summary>
		FirmwareInformation = 0x010C, //added
		/// <summary>This feature identifies a drive that supports AACS and is able to perform AACS authentication process.</summary>
		AdvancedAccessContentSystem = 0x010D, //added
		/// <summary>This feature identifies a drive that supports CSS Managed recording on DVDDownload disc. This feature is current only if a recordable DVD-Download disc is loaded.</summary>
		DvdContentScramblingSystemManagedRecording = 0x010E, //added
		//0x010F reserved
		/// <summary>This feature specifies that the drive is able to process disc data structures that are specified in the [VCPS].</summary>
		VCPS = 0x0110, //added
		//0x0111-0x0112 reserved
		/// <summary>This feature identifies a drive that supports SecurDisc content protection and is able to perform SecurDisc authentication process. This feature is current only when an optical disc currently in the drive can be used with SecurDisc. The feature is current regardless of whether an optical disc has already been written to using SecurDisc or not.</summary>
		SecurDisc = 0x0113, //added
		//0x0114-0xFEFF reserved
		//0xFF00-0xFFFF Vendor Specific
	}
}

By viewing downloads associated with this article you agree to the Terms of Service and the article's licence.

If a file you wish to view isn't highlighted, and is a text file (not binary), please let us know and we'll add colourisation support for it.

License

This article, along with any associated source code and files, is licensed under The Microsoft Public License (Ms-PL)


Written By
United States United States
This member has not yet provided a Biography. Assume it's interesting and varied, and probably something to do with programming.

Comments and Discussions