G
Guest
I'm having difficulties converting the GET_CONFIGURATION_HEADER from the
IOCTL_CDROM_GET_CONDIGURATION DeviceIoControl command to usable C# code.
The C struct look like this:
typedef struct _GET_CONFIGURATION_HEADER {
UCHAR DataLength[4];
UCHAR Reserved[2];
UCHAR CurrentProfile[2];
UCHAR Data[0];
} GET_CONFIGURATION_HEADER, *PGET_CONFIGURATION_HEADER;
Where the CurrentProfile is
actually an enumerator value of type FEATURE_PROFILE_TYPE:
typedef enum _FEATURE_PROFILE_TYPE {
ProfileInvalid = 0x0000,
ProfileNonRemovableDisk = 0x0001,
ProfileRemovableDisk = 0x0002,
ProfileMOErasable = 0x0003,
ProfileMOWriteOnce = 0x0004,
ProfileAS_MO = 0x0005,
// Reserved 0x0006 - 0x0007
ProfileCdrom = 0x0008,
ProfileCdRecordable = 0x0009,
ProfileCdRewritable = 0x000a,
ProfileDvdRom = 0x0010,
ProfileDvdRecordable = 0x0011,
ProfileDvdRam = 0x0012,
ProfileDvdRewritable = 0x0013,
ProfileDvdRWSequential = 0x0013,
// Reserved - 0x0014,
ProfileDvdPlusRW = 0x001a,
// Reserved - 0x001b,
ProfileDDCdrom = 0x0020,
ProfileDDCdRecordable = 0x0021,
ProfileDDCdRewritable = 0x0022,
// Reserved - 0x0023,
ProfileNonStandard = 0xffff
} FEATURE_PROFILE_TYPE, *PFEATURE_PROFILE_TYPE;
And the Data is FEATURE_HEADER struct:
typedef struct _FEATURE_HEADER {
UCHAR FeatureCode[2];
UCHAR Current:1;
UCHAR Persistent:1;
UCHAR Version:3;
UCHAR Reserved0:2;
UCHAR AdditionalLength;
} FEATURE_HEADER, *PFEATURE_HEADER;
Where FeatureCode is an enumerator value of type FEATURE_NUMBER:
typedef enum _FEATURE_NUMBER {
FeatureProfileList = 0x0000,
FeatureCore = 0x0001,
FeatureMorphing = 0x0002,
FeatureRemovableMedium = 0x0003,
FeatureWriteProtect = 0x0004,
// Reserved 0x0005 - 0x000f
FeatureRandomReadable = 0x0010,
// Reserved 0x0011 - 0x001c
FeatureMultiRead = 0x001d,
FeatureCdRead = 0x001e,
FeatureDvdRead = 0x001f,
FeatureRandomWritable = 0x0020,
FeatureIncrementalStreamingWritable = 0x0021,
FeatureSectorErasable = 0x0022,
FeatureFormattable = 0x0023,
FeatureDefectManagement = 0x0024,
FeatureWriteOnce = 0x0025,
FeatureRestrictedOverwrite = 0x0026,
FeatureCdrwCAVWrite = 0x0027,
FeatureMrw = 0x0028,
// Reserved - 0x0029
FeatureDvdPlusRW = 0x002a,
// Reserved - 0x002b
FeatureRigidRestrictedOverwrite = 0x002c,
FeatureCdTrackAtOnce = 0x002d,
FeatureCdMastering = 0x002e,
FeatureDvdRecordableWrite = 0x002f,
FeatureDDCDRead = 0x0030,
FeatureDDCDRWrite = 0x0031,
FeatureDDCDRWWrite = 0x0032,
// Reserved 0x0030 - 0x00ff
FeaturePowerManagement = 0x0100,
FeatureSMART = 0x0101,
FeatureEmbeddedChanger = 0x0102,
FeatureCDAudioAnalogPlay = 0x0103,
FeatureMicrocodeUpgrade = 0x0104,
FeatureTimeout = 0x0105,
FeatureDvdCSS = 0x0106,
FeatureRealTimeStreaming = 0x0107,
FeatureLogicalUnitSerialNumber = 0x0108,
// Reserved = 0x0109,
FeatureDiscControlBlocks = 0x010a,
FeatureDvdCPRM = 0x010b
// Reserved 0x010c - 0xfeff
// Vendor Unique 0xff00 - 0xffff
} FEATURE_NUMBER, *PFEATURE_NUMBER;
Taken from this site
http://msdn.microsoft.com/library/d..._f15044b6-5bbe-4d82-9826-dbe0c96a488c.xml.asp
I hope there is a helpful soul out there who can help me out? Previous
attempts doesn't seem to work...
IOCTL_CDROM_GET_CONDIGURATION DeviceIoControl command to usable C# code.
The C struct look like this:
typedef struct _GET_CONFIGURATION_HEADER {
UCHAR DataLength[4];
UCHAR Reserved[2];
UCHAR CurrentProfile[2];
UCHAR Data[0];
} GET_CONFIGURATION_HEADER, *PGET_CONFIGURATION_HEADER;
Where the CurrentProfile is
actually an enumerator value of type FEATURE_PROFILE_TYPE:
typedef enum _FEATURE_PROFILE_TYPE {
ProfileInvalid = 0x0000,
ProfileNonRemovableDisk = 0x0001,
ProfileRemovableDisk = 0x0002,
ProfileMOErasable = 0x0003,
ProfileMOWriteOnce = 0x0004,
ProfileAS_MO = 0x0005,
// Reserved 0x0006 - 0x0007
ProfileCdrom = 0x0008,
ProfileCdRecordable = 0x0009,
ProfileCdRewritable = 0x000a,
ProfileDvdRom = 0x0010,
ProfileDvdRecordable = 0x0011,
ProfileDvdRam = 0x0012,
ProfileDvdRewritable = 0x0013,
ProfileDvdRWSequential = 0x0013,
// Reserved - 0x0014,
ProfileDvdPlusRW = 0x001a,
// Reserved - 0x001b,
ProfileDDCdrom = 0x0020,
ProfileDDCdRecordable = 0x0021,
ProfileDDCdRewritable = 0x0022,
// Reserved - 0x0023,
ProfileNonStandard = 0xffff
} FEATURE_PROFILE_TYPE, *PFEATURE_PROFILE_TYPE;
And the Data is FEATURE_HEADER struct:
typedef struct _FEATURE_HEADER {
UCHAR FeatureCode[2];
UCHAR Current:1;
UCHAR Persistent:1;
UCHAR Version:3;
UCHAR Reserved0:2;
UCHAR AdditionalLength;
} FEATURE_HEADER, *PFEATURE_HEADER;
Where FeatureCode is an enumerator value of type FEATURE_NUMBER:
typedef enum _FEATURE_NUMBER {
FeatureProfileList = 0x0000,
FeatureCore = 0x0001,
FeatureMorphing = 0x0002,
FeatureRemovableMedium = 0x0003,
FeatureWriteProtect = 0x0004,
// Reserved 0x0005 - 0x000f
FeatureRandomReadable = 0x0010,
// Reserved 0x0011 - 0x001c
FeatureMultiRead = 0x001d,
FeatureCdRead = 0x001e,
FeatureDvdRead = 0x001f,
FeatureRandomWritable = 0x0020,
FeatureIncrementalStreamingWritable = 0x0021,
FeatureSectorErasable = 0x0022,
FeatureFormattable = 0x0023,
FeatureDefectManagement = 0x0024,
FeatureWriteOnce = 0x0025,
FeatureRestrictedOverwrite = 0x0026,
FeatureCdrwCAVWrite = 0x0027,
FeatureMrw = 0x0028,
// Reserved - 0x0029
FeatureDvdPlusRW = 0x002a,
// Reserved - 0x002b
FeatureRigidRestrictedOverwrite = 0x002c,
FeatureCdTrackAtOnce = 0x002d,
FeatureCdMastering = 0x002e,
FeatureDvdRecordableWrite = 0x002f,
FeatureDDCDRead = 0x0030,
FeatureDDCDRWrite = 0x0031,
FeatureDDCDRWWrite = 0x0032,
// Reserved 0x0030 - 0x00ff
FeaturePowerManagement = 0x0100,
FeatureSMART = 0x0101,
FeatureEmbeddedChanger = 0x0102,
FeatureCDAudioAnalogPlay = 0x0103,
FeatureMicrocodeUpgrade = 0x0104,
FeatureTimeout = 0x0105,
FeatureDvdCSS = 0x0106,
FeatureRealTimeStreaming = 0x0107,
FeatureLogicalUnitSerialNumber = 0x0108,
// Reserved = 0x0109,
FeatureDiscControlBlocks = 0x010a,
FeatureDvdCPRM = 0x010b
// Reserved 0x010c - 0xfeff
// Vendor Unique 0xff00 - 0xffff
} FEATURE_NUMBER, *PFEATURE_NUMBER;
Taken from this site
http://msdn.microsoft.com/library/d..._f15044b6-5bbe-4d82-9826-dbe0c96a488c.xml.asp
I hope there is a helpful soul out there who can help me out? Previous
attempts doesn't seem to work...