Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/mpc-hc/mpc-hc.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorXhmikosR <xhmikosr@users.sourceforge.net>2010-04-09 18:12:59 +0400
committerXhmikosR <xhmikosr@users.sourceforge.net>2010-04-09 18:12:59 +0400
commitefbc9d9043ff8ff92716ddd00a5f61412d535593 (patch)
tree8f3e621f756cf1f5b4d64d97964c7e7abd8aaf08 /include/winddk
parentdf6b139a6d9027156f614b68687e039e3a5854db (diff)
revert r1783
git-svn-id: https://mpc-hc.svn.sourceforge.net/svnroot/mpc-hc/trunk@1785 10f7b99b-c216-0410-bff0-8a66a9350fd8
Diffstat (limited to 'include/winddk')
-rw-r--r--include/winddk/ntddcdrm.h507
-rw-r--r--include/winddk/ntddcdvd.h314
-rw-r--r--include/winddk/ntdddisk.h768
-rw-r--r--include/winddk/ntddstor.h762
4 files changed, 1111 insertions, 1240 deletions
diff --git a/include/winddk/ntddcdrm.h b/include/winddk/ntddcdrm.h
index 225e1d0a8..6b77f707a 100644
--- a/include/winddk/ntddcdrm.h
+++ b/include/winddk/ntddcdrm.h
@@ -121,15 +121,14 @@ extern "C" {
//
// READ_TOC_EX structure
//
- typedef struct _CDROM_READ_TOC_EX
- {
- UCHAR Format : 4;
- UCHAR Reserved1 : 3; // future expansion
- UCHAR Msf : 1;
- UCHAR SessionTrack;
- UCHAR Reserved2; // future expansion
- UCHAR Reserved3; // future expansion
- } CDROM_READ_TOC_EX, *PCDROM_READ_TOC_EX;
+typedef struct _CDROM_READ_TOC_EX {
+ UCHAR Format : 4;
+ UCHAR Reserved1 : 3; // future expansion
+ UCHAR Msf : 1;
+ UCHAR SessionTrack;
+ UCHAR Reserved2; // future expansion
+ UCHAR Reserved3; // future expansion
+} CDROM_READ_TOC_EX, *PCDROM_READ_TOC_EX;
#define CDROM_READ_TOC_EX_FORMAT_TOC 0x00
#define CDROM_READ_TOC_EX_FORMAT_SESSION 0x01
@@ -143,33 +142,31 @@ extern "C" {
// Format 0 - Get table of contents
//
- typedef struct _TRACK_DATA
- {
- UCHAR Reserved;
- UCHAR Control : 4;
- UCHAR Adr : 4;
- UCHAR TrackNumber;
- UCHAR Reserved1;
- UCHAR Address[4];
- } TRACK_DATA, *PTRACK_DATA;
+typedef struct _TRACK_DATA {
+ UCHAR Reserved;
+ UCHAR Control : 4;
+ UCHAR Adr : 4;
+ UCHAR TrackNumber;
+ UCHAR Reserved1;
+ UCHAR Address[4];
+} TRACK_DATA, *PTRACK_DATA;
- typedef struct _CDROM_TOC
- {
+typedef struct _CDROM_TOC {
- //
- // Header
- //
+ //
+ // Header
+ //
- UCHAR Length[2]; // add two bytes for this field
- UCHAR FirstTrack;
- UCHAR LastTrack;
+ UCHAR Length[2]; // add two bytes for this field
+ UCHAR FirstTrack;
+ UCHAR LastTrack;
- //
- // Track data
- //
+ //
+ // Track data
+ //
- TRACK_DATA TrackData[MAXIMUM_NUMBER_TRACKS];
- } CDROM_TOC, *PCDROM_TOC;
+ TRACK_DATA TrackData[MAXIMUM_NUMBER_TRACKS];
+} CDROM_TOC, *PCDROM_TOC;
#define CDROM_TOC_SIZE sizeof(CDROM_TOC)
@@ -178,25 +175,24 @@ extern "C" {
// Format 1 - Session Information
//
- typedef struct _CDROM_TOC_SESSION_DATA
- {
+typedef struct _CDROM_TOC_SESSION_DATA {
+
+ //
+ // Header
+ //
- //
- // Header
- //
+ UCHAR Length[2]; // add two bytes for this field
+ UCHAR FirstCompleteSession;
+ UCHAR LastCompleteSession;
- UCHAR Length[2]; // add two bytes for this field
- UCHAR FirstCompleteSession;
- UCHAR LastCompleteSession;
+ //
+ // One track, representing the first track
+ // of the last finished session
+ //
- //
- // One track, representing the first track
- // of the last finished session
- //
+ TRACK_DATA TrackData[1];
- TRACK_DATA TrackData[1];
-
- } CDROM_TOC_SESSION_DATA, *PCDROM_TOC_SESSION_DATA;
+} CDROM_TOC_SESSION_DATA, *PCDROM_TOC_SESSION_DATA;
//
@@ -204,159 +200,151 @@ extern "C" {
// Format 2 - Full TOC
//
- typedef struct _CDROM_TOC_FULL_TOC_DATA_BLOCK
- {
- UCHAR SessionNumber;
- UCHAR Control : 4;
- UCHAR Adr : 4;
- UCHAR Reserved1;
- UCHAR Point;
- UCHAR MsfExtra[3];
- UCHAR Zero;
- UCHAR Msf[3];
- } CDROM_TOC_FULL_TOC_DATA_BLOCK, *PCDROM_TOC_FULL_TOC_DATA_BLOCK;
-
- typedef struct _CDROM_TOC_FULL_TOC_DATA
- {
+typedef struct _CDROM_TOC_FULL_TOC_DATA_BLOCK {
+ UCHAR SessionNumber;
+ UCHAR Control : 4;
+ UCHAR Adr : 4;
+ UCHAR Reserved1;
+ UCHAR Point;
+ UCHAR MsfExtra[3];
+ UCHAR Zero;
+ UCHAR Msf[3];
+} CDROM_TOC_FULL_TOC_DATA_BLOCK, *PCDROM_TOC_FULL_TOC_DATA_BLOCK;
- //
- // Header
- //
+typedef struct _CDROM_TOC_FULL_TOC_DATA {
+
+ //
+ // Header
+ //
- UCHAR Length[2]; // add two bytes for this field
- UCHAR FirstCompleteSession;
- UCHAR LastCompleteSession;
+ UCHAR Length[2]; // add two bytes for this field
+ UCHAR FirstCompleteSession;
+ UCHAR LastCompleteSession;
- //
- // one to N descriptors included
- //
+ //
+ // one to N descriptors included
+ //
- CDROM_TOC_FULL_TOC_DATA_BLOCK Descriptors[0];
+ CDROM_TOC_FULL_TOC_DATA_BLOCK Descriptors[0];
- } CDROM_TOC_FULL_TOC_DATA, *PCDROM_TOC_FULL_TOC_DATA;
+} CDROM_TOC_FULL_TOC_DATA, *PCDROM_TOC_FULL_TOC_DATA;
//
// CD ROM Table OF Contents
// Format 3 - Program Memory Area
//
- typedef struct _CDROM_TOC_PMA_DATA
- {
-
- //
- // Header
- //
+typedef struct _CDROM_TOC_PMA_DATA {
+
+ //
+ // Header
+ //
- UCHAR Length[2]; // add two bytes for this field
- UCHAR Reserved1;
- UCHAR Reserved2;
+ UCHAR Length[2]; // add two bytes for this field
+ UCHAR Reserved1;
+ UCHAR Reserved2;
- //
- // one to N descriptors included
- //
+ //
+ // one to N descriptors included
+ //
- CDROM_TOC_FULL_TOC_DATA_BLOCK Descriptors[0];
+ CDROM_TOC_FULL_TOC_DATA_BLOCK Descriptors[0];
- } CDROM_TOC_PMA_DATA, *PCDROM_TOC_PMA_DATA;
+} CDROM_TOC_PMA_DATA, *PCDROM_TOC_PMA_DATA;
//
// CD ROM Table OF Contents
// Format 4 - Absolute Time In Pregroove
//
- typedef struct _CDROM_TOC_ATIP_DATA_BLOCK
- {
-
- UCHAR CdrwReferenceSpeed : 3;
- UCHAR Reserved3 : 1;
- UCHAR WritePower : 3;
- UCHAR True1 : 1;
- UCHAR Reserved4 : 6;
- UCHAR UnrestrictedUse : 1;
- UCHAR Reserved5 : 1;
- UCHAR A3Valid : 1;
- UCHAR A2Valid : 1;
- UCHAR A1Valid : 1;
- UCHAR DiscSubType : 3;
- UCHAR IsCdrw : 1;
- UCHAR True2 : 1;
- UCHAR Reserved7;
-
- UCHAR LeadInMsf[3];
- UCHAR Reserved8;
-
- UCHAR LeadOutMsf[3];
- UCHAR Reserved9;
-
- UCHAR A1Values[3];
- UCHAR Reserved10;
-
- UCHAR A2Values[3];
- UCHAR Reserved11;
-
- UCHAR A3Values[3];
- UCHAR Reserved12;
-
- } CDROM_TOC_ATIP_DATA_BLOCK, *PCDROM_TOC_ATIP_DATA_BLOCK;
-
- typedef struct _CDROM_TOC_ATIP_DATA
- {
-
- //
- // Header
- //
-
- UCHAR Length[2]; // add two bytes for this field
- UCHAR Reserved1;
- UCHAR Reserved2;
-
- //
- // zero? to N descriptors included.
- //
-
- CDROM_TOC_ATIP_DATA_BLOCK Descriptors[0];
-
- } CDROM_TOC_ATIP_DATA, *PCDROM_TOC_ATIP_DATA;
+typedef struct _CDROM_TOC_ATIP_DATA_BLOCK {
+
+ UCHAR CdrwReferenceSpeed : 3;
+ UCHAR Reserved3 : 1;
+ UCHAR WritePower : 3;
+ UCHAR True1 : 1;
+ UCHAR Reserved4 : 6;
+ UCHAR UnrestrictedUse : 1;
+ UCHAR Reserved5 : 1;
+ UCHAR A3Valid : 1;
+ UCHAR A2Valid : 1;
+ UCHAR A1Valid : 1;
+ UCHAR DiscSubType : 3;
+ UCHAR IsCdrw : 1;
+ UCHAR True2 : 1;
+ UCHAR Reserved7;
+
+ UCHAR LeadInMsf[3];
+ UCHAR Reserved8;
+
+ UCHAR LeadOutMsf[3];
+ UCHAR Reserved9;
+
+ UCHAR A1Values[3];
+ UCHAR Reserved10;
+
+ UCHAR A2Values[3];
+ UCHAR Reserved11;
+
+ UCHAR A3Values[3];
+ UCHAR Reserved12;
+
+} CDROM_TOC_ATIP_DATA_BLOCK, *PCDROM_TOC_ATIP_DATA_BLOCK;
+
+typedef struct _CDROM_TOC_ATIP_DATA {
+
+ //
+ // Header
+ //
+
+ UCHAR Length[2]; // add two bytes for this field
+ UCHAR Reserved1;
+ UCHAR Reserved2;
+
+ //
+ // zero? to N descriptors included.
+ //
+
+ CDROM_TOC_ATIP_DATA_BLOCK Descriptors[0];
+
+} CDROM_TOC_ATIP_DATA, *PCDROM_TOC_ATIP_DATA;
//
// CD ROM Table OF Contents
// Format 5 - CD Text Info
//
- typedef struct _CDROM_TOC_CD_TEXT_DATA_BLOCK
- {
- UCHAR PackType;
- UCHAR TrackNumber : 7;
- UCHAR ExtensionFlag : 1; // should be zero!
- UCHAR SequenceNumber;
- UCHAR CharacterPosition : 4;
- UCHAR BlockNumber : 3;
- UCHAR Unicode : 1;
- union
- {
- UCHAR Text[12];
- WCHAR WText[6];
- };
- UCHAR CRC[2];
- } CDROM_TOC_CD_TEXT_DATA_BLOCK, *PCDROM_TOC_CD_TEXT_DATA_BLOCK;
-
- typedef struct _CDROM_TOC_CD_TEXT_DATA
- {
-
- //
- // Header
- //
-
- UCHAR Length[2]; // add two bytes for this field
- UCHAR Reserved1;
- UCHAR Reserved2;
-
- //
- // the text info comes in discrete blocks of
- // a heavily-overloaded structure
- //
-
- CDROM_TOC_CD_TEXT_DATA_BLOCK Descriptors[0];
-
- } CDROM_TOC_CD_TEXT_DATA, *PCDROM_TOC_CD_TEXT_DATA;
+typedef struct _CDROM_TOC_CD_TEXT_DATA_BLOCK {
+ UCHAR PackType;
+ UCHAR TrackNumber : 7;
+ UCHAR ExtensionFlag : 1; // should be zero!
+ UCHAR SequenceNumber;
+ UCHAR CharacterPosition : 4;
+ UCHAR BlockNumber : 3;
+ UCHAR Unicode : 1;
+ union {
+ UCHAR Text[12];
+ WCHAR WText[6];
+ };
+ UCHAR CRC[2];
+} CDROM_TOC_CD_TEXT_DATA_BLOCK, *PCDROM_TOC_CD_TEXT_DATA_BLOCK;
+
+typedef struct _CDROM_TOC_CD_TEXT_DATA {
+
+ //
+ // Header
+ //
+
+ UCHAR Length[2]; // add two bytes for this field
+ UCHAR Reserved1;
+ UCHAR Reserved2;
+
+ //
+ // the text info comes in discrete blocks of
+ // a heavily-overloaded structure
+ //
+
+ CDROM_TOC_CD_TEXT_DATA_BLOCK Descriptors[0];
+
+} CDROM_TOC_CD_TEXT_DATA, *PCDROM_TOC_CD_TEXT_DATA;
//
// These are the types used for PackType field in CDROM_TOC_CD_TEXT_DATA_BLOCK
@@ -380,38 +368,35 @@ extern "C" {
// Play audio starting at MSF and ending at MSF
//
- typedef struct _CDROM_PLAY_AUDIO_MSF
- {
- UCHAR StartingM;
- UCHAR StartingS;
- UCHAR StartingF;
- UCHAR EndingM;
- UCHAR EndingS;
- UCHAR EndingF;
- } CDROM_PLAY_AUDIO_MSF, *PCDROM_PLAY_AUDIO_MSF;
+typedef struct _CDROM_PLAY_AUDIO_MSF {
+ UCHAR StartingM;
+ UCHAR StartingS;
+ UCHAR StartingF;
+ UCHAR EndingM;
+ UCHAR EndingS;
+ UCHAR EndingF;
+} CDROM_PLAY_AUDIO_MSF, *PCDROM_PLAY_AUDIO_MSF;
//
// Seek to MSF
//
- typedef struct _CDROM_SEEK_AUDIO_MSF
- {
- UCHAR M;
- UCHAR S;
- UCHAR F;
- } CDROM_SEEK_AUDIO_MSF, *PCDROM_SEEK_AUDIO_MSF;
+typedef struct _CDROM_SEEK_AUDIO_MSF {
+ UCHAR M;
+ UCHAR S;
+ UCHAR F;
+} CDROM_SEEK_AUDIO_MSF, *PCDROM_SEEK_AUDIO_MSF;
//
// Flags for the disk type
//
- typedef struct _CDROM_DISK_DATA
- {
+typedef struct _CDROM_DISK_DATA {
- ULONG DiskData;
+ ULONG DiskData;
- } CDROM_DISK_DATA, *PCDROM_DISK_DATA;
+} CDROM_DISK_DATA, *PCDROM_DISK_DATA;
#define CDROM_DISK_AUDIO_TRACK (0x00000001)
#define CDROM_DISK_DATA_TRACK (0x00000002)
@@ -425,64 +410,58 @@ extern "C" {
#define IOCTL_CDROM_MEDIA_CATALOG 0x02
#define IOCTL_CDROM_TRACK_ISRC 0x03
- typedef struct _CDROM_SUB_Q_DATA_FORMAT
- {
- UCHAR Format;
- UCHAR Track;
- } CDROM_SUB_Q_DATA_FORMAT, *PCDROM_SUB_Q_DATA_FORMAT;
+typedef struct _CDROM_SUB_Q_DATA_FORMAT {
+ UCHAR Format;
+ UCHAR Track;
+} CDROM_SUB_Q_DATA_FORMAT, *PCDROM_SUB_Q_DATA_FORMAT;
//
// CD ROM Sub-Q Channel Data Format
//
- typedef struct _SUB_Q_HEADER
- {
- UCHAR Reserved;
- UCHAR AudioStatus;
- UCHAR DataLength[2];
- } SUB_Q_HEADER, *PSUB_Q_HEADER;
-
- typedef struct _SUB_Q_CURRENT_POSITION
- {
- SUB_Q_HEADER Header;
- UCHAR FormatCode;
- UCHAR Control : 4;
- UCHAR ADR : 4;
- UCHAR TrackNumber;
- UCHAR IndexNumber;
- UCHAR AbsoluteAddress[4];
- UCHAR TrackRelativeAddress[4];
- } SUB_Q_CURRENT_POSITION, *PSUB_Q_CURRENT_POSITION;
-
- typedef struct _SUB_Q_MEDIA_CATALOG_NUMBER
- {
- SUB_Q_HEADER Header;
- UCHAR FormatCode;
- UCHAR Reserved[3];
- UCHAR Reserved1 : 7;
- UCHAR Mcval : 1;
- UCHAR MediaCatalog[15];
- } SUB_Q_MEDIA_CATALOG_NUMBER, *PSUB_Q_MEDIA_CATALOG_NUMBER;
-
- typedef struct _SUB_Q_TRACK_ISRC
- {
- SUB_Q_HEADER Header;
- UCHAR FormatCode;
- UCHAR Reserved0;
- UCHAR Track;
- UCHAR Reserved1;
- UCHAR Reserved2 : 7;
- UCHAR Tcval : 1;
- UCHAR TrackIsrc[15];
- } SUB_Q_TRACK_ISRC, *PSUB_Q_TRACK_ISRC;
-
- typedef union _SUB_Q_CHANNEL_DATA
- {
- SUB_Q_CURRENT_POSITION CurrentPosition;
- SUB_Q_MEDIA_CATALOG_NUMBER MediaCatalog;
- SUB_Q_TRACK_ISRC TrackIsrc;
- } SUB_Q_CHANNEL_DATA, *PSUB_Q_CHANNEL_DATA;
+typedef struct _SUB_Q_HEADER {
+ UCHAR Reserved;
+ UCHAR AudioStatus;
+ UCHAR DataLength[2];
+} SUB_Q_HEADER, *PSUB_Q_HEADER;
+
+typedef struct _SUB_Q_CURRENT_POSITION {
+ SUB_Q_HEADER Header;
+ UCHAR FormatCode;
+ UCHAR Control : 4;
+ UCHAR ADR : 4;
+ UCHAR TrackNumber;
+ UCHAR IndexNumber;
+ UCHAR AbsoluteAddress[4];
+ UCHAR TrackRelativeAddress[4];
+} SUB_Q_CURRENT_POSITION, *PSUB_Q_CURRENT_POSITION;
+
+typedef struct _SUB_Q_MEDIA_CATALOG_NUMBER {
+ SUB_Q_HEADER Header;
+ UCHAR FormatCode;
+ UCHAR Reserved[3];
+ UCHAR Reserved1 : 7;
+ UCHAR Mcval : 1;
+ UCHAR MediaCatalog[15];
+} SUB_Q_MEDIA_CATALOG_NUMBER, *PSUB_Q_MEDIA_CATALOG_NUMBER;
+
+typedef struct _SUB_Q_TRACK_ISRC {
+ SUB_Q_HEADER Header;
+ UCHAR FormatCode;
+ UCHAR Reserved0;
+ UCHAR Track;
+ UCHAR Reserved1;
+ UCHAR Reserved2 : 7;
+ UCHAR Tcval : 1;
+ UCHAR TrackIsrc[15];
+} SUB_Q_TRACK_ISRC, *PSUB_Q_TRACK_ISRC;
+
+typedef union _SUB_Q_CHANNEL_DATA {
+ SUB_Q_CURRENT_POSITION CurrentPosition;
+ SUB_Q_MEDIA_CATALOG_NUMBER MediaCatalog;
+ SUB_Q_TRACK_ISRC TrackIsrc;
+} SUB_Q_CHANNEL_DATA, *PSUB_Q_CHANNEL_DATA;
//
// Audio Status Codes
@@ -517,11 +496,10 @@ extern "C" {
// Get Audio control parameters
//
- typedef struct _CDROM_AUDIO_CONTROL
- {
- UCHAR LbaFormat;
- USHORT LogicalBlocksPerSecond;
- } CDROM_AUDIO_CONTROL, *PCDROM_AUDIO_CONTROL;
+typedef struct _CDROM_AUDIO_CONTROL {
+ UCHAR LbaFormat;
+ USHORT LogicalBlocksPerSecond;
+} CDROM_AUDIO_CONTROL, *PCDROM_AUDIO_CONTROL;
//
// Volume control - Volume takes a value between 1 and 0xFF.
@@ -529,28 +507,25 @@ extern "C" {
// Independent volume control.
//
- typedef struct _VOLUME_CONTROL
- {
- UCHAR PortVolume[4];
- } VOLUME_CONTROL, *PVOLUME_CONTROL;
+typedef struct _VOLUME_CONTROL {
+ UCHAR PortVolume[4];
+} VOLUME_CONTROL, *PVOLUME_CONTROL;
- typedef enum _TRACK_MODE_TYPE
- {
- YellowMode2,
- XAForm2,
- CDDA
- } TRACK_MODE_TYPE, *PTRACK_MODE_TYPE;
+typedef enum _TRACK_MODE_TYPE {
+ YellowMode2,
+ XAForm2,
+ CDDA
+} TRACK_MODE_TYPE, *PTRACK_MODE_TYPE;
//
// Passed to cdrom to describe the raw read, ie. Mode 2, Form 2, CDDA...
//
- typedef struct __RAW_READ_INFO
- {
- LARGE_INTEGER DiskOffset;
- ULONG SectorCount;
- TRACK_MODE_TYPE TrackMode;
- } RAW_READ_INFO, *PRAW_READ_INFO;
+typedef struct __RAW_READ_INFO {
+ LARGE_INTEGER DiskOffset;
+ ULONG SectorCount;
+ TRACK_MODE_TYPE TrackMode;
+} RAW_READ_INFO, *PRAW_READ_INFO;
#ifdef __cplusplus
}
diff --git a/include/winddk/ntddcdvd.h b/include/winddk/ntddcdvd.h
index b76e6bb2d..e6d22d1ad 100644
--- a/include/winddk/ntddcdvd.h
+++ b/include/winddk/ntddcdvd.h
@@ -86,34 +86,31 @@ Revision History:
extern "C" {
#endif
- typedef enum {
- DvdChallengeKey = 0x01,
- DvdBusKey1,
- DvdBusKey2,
- DvdTitleKey,
- DvdAsf,
- DvdSetRpcKey = 0x6,
- DvdGetRpcKey = 0x8,
- DvdDiskKey = 0x80,
- DvdInvalidateAGID = 0x3f
- }
- DVD_KEY_TYPE;
-
- typedef ULONG DVD_SESSION_ID, *PDVD_SESSION_ID;
-
- typedef struct _DVD_COPY_PROTECT_KEY
- {
- ULONG KeyLength;
- DVD_SESSION_ID SessionId;
- DVD_KEY_TYPE KeyType;
- ULONG KeyFlags;
- union
- {
- HANDLE FileHandle;
- LARGE_INTEGER TitleOffset;
- } Parameters;
- UCHAR KeyData[0];
- } DVD_COPY_PROTECT_KEY, *PDVD_COPY_PROTECT_KEY;
+typedef enum {
+ DvdChallengeKey = 0x01,
+ DvdBusKey1,
+ DvdBusKey2,
+ DvdTitleKey,
+ DvdAsf,
+ DvdSetRpcKey = 0x6,
+ DvdGetRpcKey = 0x8,
+ DvdDiskKey = 0x80,
+ DvdInvalidateAGID = 0x3f
+} DVD_KEY_TYPE;
+
+typedef ULONG DVD_SESSION_ID, *PDVD_SESSION_ID;
+
+typedef struct _DVD_COPY_PROTECT_KEY {
+ ULONG KeyLength;
+ DVD_SESSION_ID SessionId;
+ DVD_KEY_TYPE KeyType;
+ ULONG KeyFlags;
+ union {
+ HANDLE FileHandle;
+ LARGE_INTEGER TitleOffset;
+ } Parameters;
+ UCHAR KeyData[0];
+} DVD_COPY_PROTECT_KEY, *PDVD_COPY_PROTECT_KEY;
//
// Predefined (Mt. Fuji) key sizes
@@ -154,145 +151,132 @@ extern "C" {
#define DVD_SECTOR_NOT_PROTECTED 0x00000000
#define DVD_SECTOR_PROTECTED 0x00000020
- /*++
-
- IOCTL_STORAGE_SET_READ_AHEAD
-
- Requests that the storage device skip to TargetAddress once it has run across
- TriggerAddress during the course of it's read-ahead caching operations.
-
- Input:
-
- a STORAGE_SET_READ_AHEAD structure which contains:
- * the trigger address
- * the target address
-
- Output:
-
- none
-
- --*/
-
- typedef struct _STORAGE_SET_READ_AHEAD
- {
- LARGE_INTEGER TriggerAddress;
- LARGE_INTEGER TargetAddress;
- } STORAGE_SET_READ_AHEAD, *PSTORAGE_SET_READ_AHEAD;
-
- /*++
-
- IOCTL_DVD_READ_STRUCTURE
-
- Issues a READ_DVD_STRUCTURE command to the drive.
-
- Input:
-
- a DVD_READ_STRUCTURE describing what information is requested
-
- Output:
-
- a DVD Layer Descriptor as defined below
-
- --*/
-
- typedef enum DVD_STRUCTURE_FORMAT
- {
- DvdPhysicalDescriptor,
- DvdCopyrightDescriptor,
- DvdDiskKeyDescriptor,
- DvdBCADescriptor,
- DvdManufacturerDescriptor,
- DvdMaxDescriptor
- } DVD_STRUCTURE_FORMAT, *PDVD_STRUCTURE_FORMAT;
-
- typedef struct DVD_READ_STRUCTURE
- {
- LARGE_INTEGER BlockByteOffset;
- DVD_STRUCTURE_FORMAT Format;
- DVD_SESSION_ID SessionId;
- UCHAR LayerNumber;
- } DVD_READ_STRUCTURE, *PDVD_READ_STRUCTURE;
-
- typedef struct _DVD_DESCRIPTOR_HEADER
- {
- USHORT Length;
- UCHAR Reserved[2];
- UCHAR Data[0];
- } DVD_DESCRIPTOR_HEADER, *PDVD_DESCRIPTOR_HEADER;
-
- typedef struct _DVD_LAYER_DESCRIPTOR
- {
- UCHAR BookVersion : 4;
- UCHAR BookType : 4;
- UCHAR MinimumRate : 4;
- UCHAR DiskSize : 4;
- UCHAR LayerType : 4;
- UCHAR TrackPath : 1;
- UCHAR NumberOfLayers : 2;
- UCHAR Reserved1 : 1;
- UCHAR TrackDensity : 4;
- UCHAR LinearDensity : 4;
- ULONG StartingDataSector;
- ULONG EndDataSector;
- ULONG EndLayerZeroSector;
- UCHAR Reserved5 : 7;
- UCHAR BCAFlag : 1;
- UCHAR Reserved6;
- } DVD_LAYER_DESCRIPTOR, *PDVD_LAYER_DESCRIPTOR;
-
- typedef struct _DVD_COPYRIGHT_DESCRIPTOR
- {
- UCHAR CopyrightProtectionType;
- UCHAR RegionManagementInformation;
- USHORT Reserved;
- } DVD_COPYRIGHT_DESCRIPTOR, *PDVD_COPYRIGHT_DESCRIPTOR;
-
- typedef struct _DVD_DISK_KEY_DESCRIPTOR
- {
- UCHAR DiskKeyData[2048];
- } DVD_DISK_KEY_DESCRIPTOR, *PDVD_DISK_KEY_DESCRIPTOR;
-
- typedef struct _DVD_BCA_DESCRIPTOR
- {
- UCHAR BCAInformation[0];
- } DVD_BCA_DESCRIPTOR, *PDVD_BCA_DESCRIPTOR;
-
- typedef struct _DVD_MANUFACTURER_DESCRIPTOR
- {
- UCHAR ManufacturingInformation[2048];
- } DVD_MANUFACTURER_DESCRIPTOR, *PDVD_MANUFACTURER_DESCRIPTOR;
-
- typedef struct _DVD_RPC_KEY
- {
- UCHAR UserResetsAvailable: 3;
- UCHAR ManufacturerResetsAvailable: 3;
- UCHAR TypeCode: 2;
- UCHAR RegionMask;
- UCHAR RpcScheme;
- UCHAR Reserved2[1];
- } DVD_RPC_KEY, * PDVD_RPC_KEY;
-
- typedef struct _DVD_SET_RPC_KEY
- {
- UCHAR PreferredDriveRegionCode;
- UCHAR Reserved[3];
- } DVD_SET_RPC_KEY, * PDVD_SET_RPC_KEY;
-
- typedef struct _DVD_ASF
- {
- UCHAR Reserved0[3];
- UCHAR SuccessFlag: 1;
- UCHAR Reserved1: 7;
- } DVD_ASF, * PDVD_ASF;
+/*++
+
+IOCTL_STORAGE_SET_READ_AHEAD
+
+Requests that the storage device skip to TargetAddress once it has run across
+TriggerAddress during the course of it's read-ahead caching operations.
+
+Input:
+
+ a STORAGE_SET_READ_AHEAD structure which contains:
+ * the trigger address
+ * the target address
+
+Output:
+
+ none
+
+--*/
+
+typedef struct _STORAGE_SET_READ_AHEAD {
+ LARGE_INTEGER TriggerAddress;
+ LARGE_INTEGER TargetAddress;
+} STORAGE_SET_READ_AHEAD, *PSTORAGE_SET_READ_AHEAD;
+
+/*++
+
+IOCTL_DVD_READ_STRUCTURE
+
+Issues a READ_DVD_STRUCTURE command to the drive.
+
+Input:
+
+ a DVD_READ_STRUCTURE describing what information is requested
+
+Output:
+
+ a DVD Layer Descriptor as defined below
+
+--*/
+
+typedef enum DVD_STRUCTURE_FORMAT {
+ DvdPhysicalDescriptor,
+ DvdCopyrightDescriptor,
+ DvdDiskKeyDescriptor,
+ DvdBCADescriptor,
+ DvdManufacturerDescriptor,
+ DvdMaxDescriptor
+} DVD_STRUCTURE_FORMAT, *PDVD_STRUCTURE_FORMAT;
+
+typedef struct DVD_READ_STRUCTURE {
+ LARGE_INTEGER BlockByteOffset;
+ DVD_STRUCTURE_FORMAT Format;
+ DVD_SESSION_ID SessionId;
+ UCHAR LayerNumber;
+} DVD_READ_STRUCTURE, *PDVD_READ_STRUCTURE;
+
+typedef struct _DVD_DESCRIPTOR_HEADER {
+ USHORT Length;
+ UCHAR Reserved[2];
+ UCHAR Data[0];
+} DVD_DESCRIPTOR_HEADER, *PDVD_DESCRIPTOR_HEADER;
+
+typedef struct _DVD_LAYER_DESCRIPTOR {
+ UCHAR BookVersion : 4;
+ UCHAR BookType : 4;
+ UCHAR MinimumRate : 4;
+ UCHAR DiskSize : 4;
+ UCHAR LayerType : 4;
+ UCHAR TrackPath : 1;
+ UCHAR NumberOfLayers : 2;
+ UCHAR Reserved1 : 1;
+ UCHAR TrackDensity : 4;
+ UCHAR LinearDensity : 4;
+ ULONG StartingDataSector;
+ ULONG EndDataSector;
+ ULONG EndLayerZeroSector;
+ UCHAR Reserved5 : 7;
+ UCHAR BCAFlag : 1;
+ UCHAR Reserved6;
+} DVD_LAYER_DESCRIPTOR, *PDVD_LAYER_DESCRIPTOR;
+
+typedef struct _DVD_COPYRIGHT_DESCRIPTOR {
+ UCHAR CopyrightProtectionType;
+ UCHAR RegionManagementInformation;
+ USHORT Reserved;
+} DVD_COPYRIGHT_DESCRIPTOR, *PDVD_COPYRIGHT_DESCRIPTOR;
+
+typedef struct _DVD_DISK_KEY_DESCRIPTOR {
+ UCHAR DiskKeyData[2048];
+} DVD_DISK_KEY_DESCRIPTOR, *PDVD_DISK_KEY_DESCRIPTOR;
+
+typedef struct _DVD_BCA_DESCRIPTOR {
+ UCHAR BCAInformation[0];
+} DVD_BCA_DESCRIPTOR, *PDVD_BCA_DESCRIPTOR;
+
+typedef struct _DVD_MANUFACTURER_DESCRIPTOR {
+ UCHAR ManufacturingInformation[2048];
+} DVD_MANUFACTURER_DESCRIPTOR, *PDVD_MANUFACTURER_DESCRIPTOR;
+
+typedef struct _DVD_RPC_KEY {
+ UCHAR UserResetsAvailable:3;
+ UCHAR ManufacturerResetsAvailable:3;
+ UCHAR TypeCode:2;
+ UCHAR RegionMask;
+ UCHAR RpcScheme;
+ UCHAR Reserved2[1];
+} DVD_RPC_KEY, * PDVD_RPC_KEY;
+
+typedef struct _DVD_SET_RPC_KEY {
+ UCHAR PreferredDriveRegionCode;
+ UCHAR Reserved[3];
+} DVD_SET_RPC_KEY, * PDVD_SET_RPC_KEY;
+
+typedef struct _DVD_ASF {
+ UCHAR Reserved0[3];
+ UCHAR SuccessFlag:1;
+ UCHAR Reserved1:7;
+} DVD_ASF, * PDVD_ASF;
#if 0
- typedef struct _DVD_REGION
- {
- UCHAR CopySystem;
- UCHAR RegionData; // current media region (not playable when set)
- UCHAR SystemRegion; // current drive region (playable when set)
- UCHAR ResetCount; // number of resets available
- } DVD_REGION, *PDVD_REGION;
+typedef struct _DVD_REGION {
+ UCHAR CopySystem;
+ UCHAR RegionData; // current media region (not playable when set)
+ UCHAR SystemRegion; // current drive region (playable when set)
+ UCHAR ResetCount; // number of resets available
+} DVD_REGION, *PDVD_REGION;
#endif
#ifdef __cplusplus
diff --git a/include/winddk/ntdddisk.h b/include/winddk/ntdddisk.h
index 2ffcc5ef8..6a6a892f7 100644
--- a/include/winddk/ntdddisk.h
+++ b/include/winddk/ntdddisk.h
@@ -303,49 +303,47 @@ extern "C" {
// Define the media types supported by the driver.
//
- typedef enum _MEDIA_TYPE {
- Unknown, // Format is unknown
- F5_1Pt2_512, // 5.25", 1.2MB, 512 bytes/sector
- F3_1Pt44_512, // 3.5", 1.44MB, 512 bytes/sector
- F3_2Pt88_512, // 3.5", 2.88MB, 512 bytes/sector
- F3_20Pt8_512, // 3.5", 20.8MB, 512 bytes/sector
- F3_720_512, // 3.5", 720KB, 512 bytes/sector
- F5_360_512, // 5.25", 360KB, 512 bytes/sector
- F5_320_512, // 5.25", 320KB, 512 bytes/sector
- F5_320_1024, // 5.25", 320KB, 1024 bytes/sector
- F5_180_512, // 5.25", 180KB, 512 bytes/sector
- F5_160_512, // 5.25", 160KB, 512 bytes/sector
- RemovableMedia, // Removable media other than floppy
- FixedMedia, // Fixed hard disk media
- F3_120M_512, // 3.5", 120M Floppy
- F3_640_512, // 3.5" , 640KB, 512 bytes/sector
- F5_640_512, // 5.25", 640KB, 512 bytes/sector
- F5_720_512, // 5.25", 720KB, 512 bytes/sector
- F3_1Pt2_512, // 3.5" , 1.2Mb, 512 bytes/sector
- F3_1Pt23_1024, // 3.5" , 1.23Mb, 1024 bytes/sector
- F5_1Pt23_1024, // 5.25", 1.23MB, 1024 bytes/sector
- F3_128Mb_512, // 3.5" MO 128Mb 512 bytes/sector
- F3_230Mb_512, // 3.5" MO 230Mb 512 bytes/sector
- F8_256_128, // 8", 256KB, 128 bytes/sector
- F3_200Mb_512, // 3.5", 200M Floppy (HiFD)
- F3_240M_512, // 3.5", 240Mb Floppy (HiFD)
- F3_32M_512 // 3.5", 32Mb Floppy
- }
- MEDIA_TYPE, *PMEDIA_TYPE;
+typedef enum _MEDIA_TYPE {
+ Unknown, // Format is unknown
+ F5_1Pt2_512, // 5.25", 1.2MB, 512 bytes/sector
+ F3_1Pt44_512, // 3.5", 1.44MB, 512 bytes/sector
+ F3_2Pt88_512, // 3.5", 2.88MB, 512 bytes/sector
+ F3_20Pt8_512, // 3.5", 20.8MB, 512 bytes/sector
+ F3_720_512, // 3.5", 720KB, 512 bytes/sector
+ F5_360_512, // 5.25", 360KB, 512 bytes/sector
+ F5_320_512, // 5.25", 320KB, 512 bytes/sector
+ F5_320_1024, // 5.25", 320KB, 1024 bytes/sector
+ F5_180_512, // 5.25", 180KB, 512 bytes/sector
+ F5_160_512, // 5.25", 160KB, 512 bytes/sector
+ RemovableMedia, // Removable media other than floppy
+ FixedMedia, // Fixed hard disk media
+ F3_120M_512, // 3.5", 120M Floppy
+ F3_640_512, // 3.5" , 640KB, 512 bytes/sector
+ F5_640_512, // 5.25", 640KB, 512 bytes/sector
+ F5_720_512, // 5.25", 720KB, 512 bytes/sector
+ F3_1Pt2_512, // 3.5" , 1.2Mb, 512 bytes/sector
+ F3_1Pt23_1024, // 3.5" , 1.23Mb, 1024 bytes/sector
+ F5_1Pt23_1024, // 5.25", 1.23MB, 1024 bytes/sector
+ F3_128Mb_512, // 3.5" MO 128Mb 512 bytes/sector
+ F3_230Mb_512, // 3.5" MO 230Mb 512 bytes/sector
+ F8_256_128, // 8", 256KB, 128 bytes/sector
+ F3_200Mb_512, // 3.5", 200M Floppy (HiFD)
+ F3_240M_512, // 3.5", 240Mb Floppy (HiFD)
+ F3_32M_512 // 3.5", 32Mb Floppy
+} MEDIA_TYPE, *PMEDIA_TYPE;
//
// Define the input buffer structure for the driver, when
// it is called with IOCTL_DISK_FORMAT_TRACKS.
//
- typedef struct _FORMAT_PARAMETERS
- {
- MEDIA_TYPE MediaType;
- ULONG StartCylinderNumber;
- ULONG EndCylinderNumber;
- ULONG StartHeadNumber;
- ULONG EndHeadNumber;
- } FORMAT_PARAMETERS, *PFORMAT_PARAMETERS;
+typedef struct _FORMAT_PARAMETERS {
+ MEDIA_TYPE MediaType;
+ ULONG StartCylinderNumber;
+ ULONG EndCylinderNumber;
+ ULONG StartHeadNumber;
+ ULONG EndHeadNumber;
+} FORMAT_PARAMETERS, *PFORMAT_PARAMETERS;
//
// Define the BAD_TRACK_NUMBER type. An array of elements of this type is
@@ -354,25 +352,24 @@ extern "C" {
// reported in the `Information' field of the I/O Status Block.
//
- typedef USHORT BAD_TRACK_NUMBER;
- typedef USHORT *PBAD_TRACK_NUMBER;
+typedef USHORT BAD_TRACK_NUMBER;
+typedef USHORT *PBAD_TRACK_NUMBER;
//
// Define the input buffer structure for the driver, when
// it is called with IOCTL_DISK_FORMAT_TRACKS_EX.
//
- typedef struct _FORMAT_EX_PARAMETERS
- {
- MEDIA_TYPE MediaType;
- ULONG StartCylinderNumber;
- ULONG EndCylinderNumber;
- ULONG StartHeadNumber;
- ULONG EndHeadNumber;
- USHORT FormatGapLength;
- USHORT SectorsPerTrack;
- USHORT SectorNumber[1];
- } FORMAT_EX_PARAMETERS, *PFORMAT_EX_PARAMETERS;
+typedef struct _FORMAT_EX_PARAMETERS {
+ MEDIA_TYPE MediaType;
+ ULONG StartCylinderNumber;
+ ULONG EndCylinderNumber;
+ ULONG StartHeadNumber;
+ ULONG EndHeadNumber;
+ USHORT FormatGapLength;
+ USHORT SectorsPerTrack;
+ USHORT SectorNumber[1];
+} FORMAT_EX_PARAMETERS, *PFORMAT_EX_PARAMETERS;
//
// The following structure is returned on an IOCTL_DISK_GET_DRIVE_GEOMETRY
@@ -380,14 +377,13 @@ extern "C" {
// request.
//
- typedef struct _DISK_GEOMETRY
- {
- LARGE_INTEGER Cylinders;
- MEDIA_TYPE MediaType;
- ULONG TracksPerCylinder;
- ULONG SectorsPerTrack;
- ULONG BytesPerSector;
- } DISK_GEOMETRY, *PDISK_GEOMETRY;
+typedef struct _DISK_GEOMETRY {
+ LARGE_INTEGER Cylinders;
+ MEDIA_TYPE MediaType;
+ ULONG TracksPerCylinder;
+ ULONG SectorsPerTrack;
+ ULONG BytesPerSector;
+} DISK_GEOMETRY, *PDISK_GEOMETRY;
@@ -404,17 +400,16 @@ extern "C" {
// to change the drive layout, IOCTL_DISK_SET_DRIVE_LAYOUT.
//
- typedef struct _PARTITION_INFORMATION
- {
- LARGE_INTEGER StartingOffset;
- LARGE_INTEGER PartitionLength;
- ULONG HiddenSectors;
- ULONG PartitionNumber;
- UCHAR PartitionType;
- BOOLEAN BootIndicator;
- BOOLEAN RecognizedPartition;
- BOOLEAN RewritePartition;
- } PARTITION_INFORMATION, *PPARTITION_INFORMATION;
+typedef struct _PARTITION_INFORMATION {
+ LARGE_INTEGER StartingOffset;
+ LARGE_INTEGER PartitionLength;
+ ULONG HiddenSectors;
+ ULONG PartitionNumber;
+ UCHAR PartitionType;
+ BOOLEAN BootIndicator;
+ BOOLEAN RecognizedPartition;
+ BOOLEAN RewritePartition;
+} PARTITION_INFORMATION, *PPARTITION_INFORMATION;
//
// The following structure is used to change the partition type of a
@@ -422,45 +417,41 @@ extern "C" {
// request.
//
- typedef struct _SET_PARTITION_INFORMATION
- {
- UCHAR PartitionType;
- } SET_PARTITION_INFORMATION, *PSET_PARTITION_INFORMATION;
+typedef struct _SET_PARTITION_INFORMATION {
+ UCHAR PartitionType;
+} SET_PARTITION_INFORMATION, *PSET_PARTITION_INFORMATION;
//
// The following structures is returned on an IOCTL_DISK_GET_DRIVE_LAYOUT
// request and given as input to an IOCTL_DISK_SET_DRIVE_LAYOUT request.
//
- typedef struct _DRIVE_LAYOUT_INFORMATION
- {
- ULONG PartitionCount;
- ULONG Signature;
- PARTITION_INFORMATION PartitionEntry[1];
- } DRIVE_LAYOUT_INFORMATION, *PDRIVE_LAYOUT_INFORMATION;
+typedef struct _DRIVE_LAYOUT_INFORMATION {
+ ULONG PartitionCount;
+ ULONG Signature;
+ PARTITION_INFORMATION PartitionEntry[1];
+} DRIVE_LAYOUT_INFORMATION, *PDRIVE_LAYOUT_INFORMATION;
//
// The following structure is passed in on an IOCTL_DISK_VERIFY request.
// The offset and length parameters are both given in bytes.
//
- typedef struct _VERIFY_INFORMATION
- {
- LARGE_INTEGER StartingOffset;
- ULONG Length;
- } VERIFY_INFORMATION, *PVERIFY_INFORMATION;
+typedef struct _VERIFY_INFORMATION {
+ LARGE_INTEGER StartingOffset;
+ ULONG Length;
+} VERIFY_INFORMATION, *PVERIFY_INFORMATION;
//
// The following structure is passed in on an IOCTL_DISK_REASSIGN_BLOCKS
// request.
//
- typedef struct _REASSIGN_BLOCKS
- {
- USHORT Reserved;
- USHORT Count;
- ULONG BlockNumber[1];
- } REASSIGN_BLOCKS, *PREASSIGN_BLOCKS;
+typedef struct _REASSIGN_BLOCKS {
+ USHORT Reserved;
+ USHORT Count;
+ ULONG BlockNumber[1];
+} REASSIGN_BLOCKS, *PREASSIGN_BLOCKS;
#if(_WIN32_WINNT >= 0x500)
@@ -477,12 +468,11 @@ extern "C" {
// do with a RAW partititon.
//
- typedef enum _PARTITION_STYLE
- {
- PARTITION_STYLE_MBR,
- PARTITION_STYLE_GPT,
- PARTITION_STYLE_RAW
- } PARTITION_STYLE;
+typedef enum _PARTITION_STYLE {
+ PARTITION_STYLE_MBR,
+ PARTITION_STYLE_GPT,
+ PARTITION_STYLE_RAW
+} PARTITION_STYLE;
//
@@ -490,13 +480,12 @@ extern "C" {
// not common to both GPT and MBR partitions.
//
- typedef struct _PARTITION_INFORMATION_GPT
- {
- GUID PartitionType; // Partition type. See table 16-3.
- GUID PartitionId; // Unique GUID for this partition.
- ULONG64 Attributes; // See table 16-4.
- WCHAR Name [36]; // Partition Name in Unicode.
- } PARTITION_INFORMATION_GPT, *PPARTITION_INFORMATION_GPT;
+typedef struct _PARTITION_INFORMATION_GPT {
+ GUID PartitionType; // Partition type. See table 16-3.
+ GUID PartitionId; // Unique GUID for this partition.
+ ULONG64 Attributes; // See table 16-4.
+ WCHAR Name [36]; // Partition Name in Unicode.
+} PARTITION_INFORMATION_GPT, *PPARTITION_INFORMATION_GPT;
//
// The following are GPT partition attributes applicable for any
@@ -519,13 +508,12 @@ extern "C" {
// common to both GPT and MBR partitions.
//
- typedef struct _PARTITION_INFORMATION_MBR
- {
- UCHAR PartitionType;
- BOOLEAN BootIndicator;
- BOOLEAN RecognizedPartition;
- ULONG HiddenSectors;
- } PARTITION_INFORMATION_MBR, *PPARTITION_INFORMATION_MBR;
+typedef struct _PARTITION_INFORMATION_MBR {
+ UCHAR PartitionType;
+ BOOLEAN BootIndicator;
+ BOOLEAN RecognizedPartition;
+ ULONG HiddenSectors;
+} PARTITION_INFORMATION_MBR, *PPARTITION_INFORMATION_MBR;
//
@@ -536,19 +524,17 @@ extern "C" {
// you can get.
//
- typedef SET_PARTITION_INFORMATION SET_PARTITION_INFORMATION_MBR;
- typedef PARTITION_INFORMATION_GPT SET_PARTITION_INFORMATION_GPT;
+typedef SET_PARTITION_INFORMATION SET_PARTITION_INFORMATION_MBR;
+typedef PARTITION_INFORMATION_GPT SET_PARTITION_INFORMATION_GPT;
- typedef struct _SET_PARTITION_INFORMATION_EX
- {
- PARTITION_STYLE PartitionStyle;
- union
- {
- SET_PARTITION_INFORMATION_MBR Mbr;
- SET_PARTITION_INFORMATION_GPT Gpt;
- };
- } SET_PARTITION_INFORMATION_EX, *PSET_PARTITION_INFORMATION_EX;
+typedef struct _SET_PARTITION_INFORMATION_EX {
+ PARTITION_STYLE PartitionStyle;
+ union {
+ SET_PARTITION_INFORMATION_MBR Mbr;
+ SET_PARTITION_INFORMATION_GPT Gpt;
+ };
+} SET_PARTITION_INFORMATION_EX, *PSET_PARTITION_INFORMATION_EX;
//
@@ -556,32 +542,28 @@ extern "C" {
// to initialize an virgin disk with an empty GPT partition table.
//
- typedef struct _CREATE_DISK_GPT
- {
- GUID DiskId; // Unique disk id for the disk.
- ULONG MaxPartitionCount; // Maximim number of partitions allowable.
- } CREATE_DISK_GPT, *PCREATE_DISK_GPT;
+typedef struct _CREATE_DISK_GPT {
+ GUID DiskId; // Unique disk id for the disk.
+ ULONG MaxPartitionCount; // Maximim number of partitions allowable.
+} CREATE_DISK_GPT, *PCREATE_DISK_GPT;
//
// The structure CREATE_DISK_MBR with the ioctl IOCTL_DISK_CREATE_DISK
// to initialize an virgin disk with an empty MBR partition table.
//
- typedef struct _CREATE_DISK_MBR
- {
- ULONG Signature;
- } CREATE_DISK_MBR, *PCREATE_DISK_MBR;
+typedef struct _CREATE_DISK_MBR {
+ ULONG Signature;
+} CREATE_DISK_MBR, *PCREATE_DISK_MBR;
- typedef struct _CREATE_DISK
- {
- PARTITION_STYLE PartitionStyle;
- union
- {
- CREATE_DISK_MBR Mbr;
- CREATE_DISK_GPT Gpt;
- };
- } CREATE_DISK, *PCREATE_DISK;
+typedef struct _CREATE_DISK {
+ PARTITION_STYLE PartitionStyle;
+ union {
+ CREATE_DISK_MBR Mbr;
+ CREATE_DISK_GPT Gpt;
+ };
+} CREATE_DISK, *PCREATE_DISK;
//
@@ -590,10 +572,9 @@ extern "C" {
// disk, partition, or volume.
//
- typedef struct _GET_LENGTH_INFORMATION
- {
- LARGE_INTEGER Length;
- } GET_LENGTH_INFORMATION, *PGET_LENGTH_INFORMATION;
+typedef struct _GET_LENGTH_INFORMATION {
+ LARGE_INTEGER Length;
+} GET_LENGTH_INFORMATION, *PGET_LENGTH_INFORMATION;
//
// The PARTITION_INFORMATION_EX structure is used with the
@@ -601,59 +582,53 @@ extern "C" {
// IOCTL_DISK_GET_PARTITION_INFO_EX and IOCTL_DISK_GET_PARTITION_INFO_EX calls.
//
- typedef struct _PARTITION_INFORMATION_EX
- {
- PARTITION_STYLE PartitionStyle;
- LARGE_INTEGER StartingOffset;
- LARGE_INTEGER PartitionLength;
- ULONG PartitionNumber;
- BOOLEAN RewritePartition;
- union
- {
- PARTITION_INFORMATION_MBR Mbr;
- PARTITION_INFORMATION_GPT Gpt;
- };
- } PARTITION_INFORMATION_EX, *PPARTITION_INFORMATION_EX;
+typedef struct _PARTITION_INFORMATION_EX {
+ PARTITION_STYLE PartitionStyle;
+ LARGE_INTEGER StartingOffset;
+ LARGE_INTEGER PartitionLength;
+ ULONG PartitionNumber;
+ BOOLEAN RewritePartition;
+ union {
+ PARTITION_INFORMATION_MBR Mbr;
+ PARTITION_INFORMATION_GPT Gpt;
+ };
+} PARTITION_INFORMATION_EX, *PPARTITION_INFORMATION_EX;
//
// GPT specific drive layout information.
//
- typedef struct _DRIVE_LAYOUT_INFORMATION_GPT
- {
- GUID DiskId;
- LARGE_INTEGER StartingUsableOffset;
- LARGE_INTEGER UsableLength;
- ULONG MaxPartitionCount;
- } DRIVE_LAYOUT_INFORMATION_GPT, *PDRIVE_LAYOUT_INFORMATION_GPT;
+typedef struct _DRIVE_LAYOUT_INFORMATION_GPT {
+ GUID DiskId;
+ LARGE_INTEGER StartingUsableOffset;
+ LARGE_INTEGER UsableLength;
+ ULONG MaxPartitionCount;
+} DRIVE_LAYOUT_INFORMATION_GPT, *PDRIVE_LAYOUT_INFORMATION_GPT;
//
// MBR specific drive layout information.
//
- typedef struct _DRIVE_LAYOUT_INFORMATION_MBR
- {
- ULONG Signature;
- } DRIVE_LAYOUT_INFORMATION_MBR, *PDRIVE_LAYOUT_INFORMATION_MBR;
+typedef struct _DRIVE_LAYOUT_INFORMATION_MBR {
+ ULONG Signature;
+} DRIVE_LAYOUT_INFORMATION_MBR, *PDRIVE_LAYOUT_INFORMATION_MBR;
//
// The structure DRIVE_LAYOUT_INFORMATION_EX is used with the
// IOCTL_SET_DRIVE_LAYOUT_EX and IOCTL_GET_DRIVE_LAYOUT_EX calls.
//
- typedef struct _DRIVE_LAYOUT_INFORMATION_EX
- {
- ULONG PartitionStyle;
- ULONG PartitionCount;
- union
- {
- DRIVE_LAYOUT_INFORMATION_MBR Mbr;
- DRIVE_LAYOUT_INFORMATION_GPT Gpt;
- };
- PARTITION_INFORMATION_EX PartitionEntry[1];
- } DRIVE_LAYOUT_INFORMATION_EX, *PDRIVE_LAYOUT_INFORMATION_EX;
+typedef struct _DRIVE_LAYOUT_INFORMATION_EX {
+ ULONG PartitionStyle;
+ ULONG PartitionCount;
+ union {
+ DRIVE_LAYOUT_INFORMATION_MBR Mbr;
+ DRIVE_LAYOUT_INFORMATION_GPT Gpt;
+ };
+ PARTITION_INFORMATION_EX PartitionEntry[1];
+} DRIVE_LAYOUT_INFORMATION_EX, *PDRIVE_LAYOUT_INFORMATION_EX;
#endif // (_WIN32_WINNT >= 0x0500)
@@ -666,24 +641,21 @@ extern "C" {
// IOCTL_DISK_GET_DRIVE_GEOMETRY_EX ioctl.
//
- typedef enum _DETECTION_TYPE
- {
+typedef enum _DETECTION_TYPE {
DetectNone,
DetectInt13,
DetectExInt13
- } DETECTION_TYPE;
+} DETECTION_TYPE;
- typedef struct _DISK_INT13_INFO
- {
+typedef struct _DISK_INT13_INFO {
USHORT DriveSelect;
ULONG MaxCylinders;
USHORT SectorsPerTrack;
USHORT MaxHeads;
USHORT NumberDrives;
- } DISK_INT13_INFO, *PDISK_INT13_INFO;
+} DISK_INT13_INFO, *PDISK_INT13_INFO;
- typedef struct _DISK_EX_INT13_INFO
- {
+typedef struct _DISK_EX_INT13_INFO {
USHORT ExBufferSize;
USHORT ExFlags;
ULONG ExCylinders;
@@ -692,52 +664,45 @@ extern "C" {
ULONG64 ExSectorsPerDrive;
USHORT ExSectorSize;
USHORT ExReserved;
- } DISK_EX_INT13_INFO, *PDISK_EX_INT13_INFO;
+} DISK_EX_INT13_INFO, *PDISK_EX_INT13_INFO;
- typedef struct _DISK_DETECTION_INFO
- {
+typedef struct _DISK_DETECTION_INFO {
ULONG SizeOfDetectInfo;
DETECTION_TYPE DetectionType;
- union
- {
- struct
- {
+ union {
+ struct {
- //
- // If DetectionType == DETECTION_INT13 then we have just the Int13
- // information.
- //
+ //
+ // If DetectionType == DETECTION_INT13 then we have just the Int13
+ // information.
+ //
- DISK_INT13_INFO Int13;
+ DISK_INT13_INFO Int13;
- //
- // If DetectionType == DETECTION_EX_INT13, then we have the
- // extended int 13 information.
- //
+ //
+ // If DetectionType == DETECTION_EX_INT13, then we have the
+ // extended int 13 information.
+ //
- DISK_EX_INT13_INFO ExInt13; // If DetectionType == DetectExInt13
- };
+ DISK_EX_INT13_INFO ExInt13; // If DetectionType == DetectExInt13
+ };
};
- } DISK_DETECTION_INFO, *PDISK_DETECTION_INFO;
+} DISK_DETECTION_INFO, *PDISK_DETECTION_INFO;
- typedef struct _DISK_PARTITION_INFO
- {
+typedef struct _DISK_PARTITION_INFO {
ULONG SizeOfPartitionInfo;
PARTITION_STYLE PartitionStyle; // PartitionStyle = RAW, GPT or MBR
- union
- {
- struct // If PartitionStyle == MBR
- {
- ULONG Signature; // MBR Signature
- ULONG CheckSum; // MBR CheckSum
- } Mbr;
- struct // If PartitionStyle == GPT
- {
- GUID DiskId;
- } Gpt;
+ union {
+ struct { // If PartitionStyle == MBR
+ ULONG Signature; // MBR Signature
+ ULONG CheckSum; // MBR CheckSum
+ } Mbr;
+ struct { // If PartitionStyle == GPT
+ GUID DiskId;
+ } Gpt;
};
- } DISK_PARTITION_INFO, *PDISK_PARTITION_INFO;
+} DISK_PARTITION_INFO, *PDISK_PARTITION_INFO;
//
@@ -753,12 +718,11 @@ extern "C" {
((PDISK_DETECTION_INFO)(((PBYTE)DiskGeometryGetPartition(Geometry)+\
DiskGeometryGetPartition(Geometry)->SizeOfPartitionInfo)))
- typedef struct _DISK_GEOMETRY_EX
- {
+typedef struct _DISK_GEOMETRY_EX {
DISK_GEOMETRY Geometry; // Standard disk geometry: may be faked by driver.
LARGE_INTEGER DiskSize; // Must always be correct
UCHAR Data[1]; // Partition, Detect info
- } DISK_GEOMETRY_EX, *PDISK_GEOMETRY_EX;
+} DISK_GEOMETRY_EX, *PDISK_GEOMETRY_EX;
#endif // (_WIN32_WINNT > 0x0500)
@@ -769,11 +733,10 @@ extern "C" {
// is attached to the primary or secondary IDE controller.
//
- typedef struct _DISK_CONTROLLER_NUMBER
- {
- ULONG ControllerNumber;
- ULONG DiskNumber;
- } DISK_CONTROLLER_NUMBER, *PDISK_CONTROLLER_NUMBER;
+typedef struct _DISK_CONTROLLER_NUMBER {
+ ULONG ControllerNumber;
+ ULONG DiskNumber;
+} DISK_CONTROLLER_NUMBER, *PDISK_CONTROLLER_NUMBER;
#endif /* _WIN32_WINNT >= 0x0400 */
#if(_WIN32_WINNT >= 0x0500)
@@ -793,95 +756,89 @@ extern "C" {
// changes are made
//
- typedef enum
- {
- EqualPriority,
- KeepPrefetchedData,
- KeepReadData
- } DISK_CACHE_RETENTION_PRIORITY;
-
- typedef enum _DISK_WRITE_CACHE_STATE
- {
- DiskWriteCacheNormal,
- DiskWriteCacheForceDisable,
- DiskWriteCacheDisableNotSupported
- } DISK_WRITE_CACHE_STATE, *PDISK_WRITE_CACHE_STATE;
-
-
- typedef struct _DISK_CACHE_INFORMATION
- {
-
- //
- // on return indicates that the device is capable of saving any parameters
- // in non-volatile storage. On send indicates that the device should
- // save the state in non-volatile storage.
- //
-
- BOOLEAN ParametersSavable;
-
- //
- // Indicates whether the write and read caches are enabled.
- //
-
- BOOLEAN ReadCacheEnabled;
- BOOLEAN WriteCacheEnabled;
-
- //
- // Controls the likelyhood of data remaining in the cache depending on how
- // it got there. Data cached from a READ or WRITE operation may be given
- // higher, lower or equal priority to data entered into the cache for other
- // means (like prefetch)
- //
-
- DISK_CACHE_RETENTION_PRIORITY ReadRetentionPriority;
- DISK_CACHE_RETENTION_PRIORITY WriteRetentionPriority;
-
- //
- // Requests for a larger number of blocks than this may have prefetching
- // disabled. If this value is set to 0 prefetch will be disabled.
- //
-
- USHORT DisablePrefetchTransferLength;
-
- //
- // If TRUE then ScalarPrefetch (below) will be valid. If FALSE then
- // the minimum and maximum values should be treated as a block count
- // (BlockPrefetch)
- //
-
- BOOLEAN PrefetchScalar;
-
- //
- // Contains the minimum and maximum amount of data which will be
- // will be prefetched into the cache on a disk operation. This value
- // may either be a scalar multiplier of the transfer length of the request,
- // or an abolute number of disk blocks. PrefetchScalar (above) indicates
- // which interpretation is used.
- //
-
- union
- {
- struct
- {
- USHORT Minimum;
- USHORT Maximum;
-
- //
- // The maximum number of blocks which will be prefetched - useful
- // with the scalar limits to set definite upper limits.
- //
-
- USHORT MaximumBlocks;
- } ScalarPrefetch;
-
- struct
- {
- USHORT Minimum;
- USHORT Maximum;
- } BlockPrefetch;
- };
+typedef enum {
+ EqualPriority,
+ KeepPrefetchedData,
+ KeepReadData
+} DISK_CACHE_RETENTION_PRIORITY;
+
+typedef enum _DISK_WRITE_CACHE_STATE {
+ DiskWriteCacheNormal,
+ DiskWriteCacheForceDisable,
+ DiskWriteCacheDisableNotSupported
+} DISK_WRITE_CACHE_STATE, *PDISK_WRITE_CACHE_STATE;
+
+
+typedef struct _DISK_CACHE_INFORMATION {
+
+ //
+ // on return indicates that the device is capable of saving any parameters
+ // in non-volatile storage. On send indicates that the device should
+ // save the state in non-volatile storage.
+ //
+
+ BOOLEAN ParametersSavable;
+
+ //
+ // Indicates whether the write and read caches are enabled.
+ //
+
+ BOOLEAN ReadCacheEnabled;
+ BOOLEAN WriteCacheEnabled;
+
+ //
+ // Controls the likelyhood of data remaining in the cache depending on how
+ // it got there. Data cached from a READ or WRITE operation may be given
+ // higher, lower or equal priority to data entered into the cache for other
+ // means (like prefetch)
+ //
+
+ DISK_CACHE_RETENTION_PRIORITY ReadRetentionPriority;
+ DISK_CACHE_RETENTION_PRIORITY WriteRetentionPriority;
+
+ //
+ // Requests for a larger number of blocks than this may have prefetching
+ // disabled. If this value is set to 0 prefetch will be disabled.
+ //
+
+ USHORT DisablePrefetchTransferLength;
+
+ //
+ // If TRUE then ScalarPrefetch (below) will be valid. If FALSE then
+ // the minimum and maximum values should be treated as a block count
+ // (BlockPrefetch)
+ //
+
+ BOOLEAN PrefetchScalar;
+
+ //
+ // Contains the minimum and maximum amount of data which will be
+ // will be prefetched into the cache on a disk operation. This value
+ // may either be a scalar multiplier of the transfer length of the request,
+ // or an abolute number of disk blocks. PrefetchScalar (above) indicates
+ // which interpretation is used.
+ //
+
+ union {
+ struct {
+ USHORT Minimum;
+ USHORT Maximum;
+
+ //
+ // The maximum number of blocks which will be prefetched - useful
+ // with the scalar limits to set definite upper limits.
+ //
+
+ USHORT MaximumBlocks;
+ } ScalarPrefetch;
+
+ struct {
+ USHORT Minimum;
+ USHORT Maximum;
+ } BlockPrefetch;
+ };
- } DISK_CACHE_INFORMATION, *PDISK_CACHE_INFORMATION;
+} DISK_CACHE_INFORMATION, *PDISK_CACHE_INFORMATION;
//
// IOCTL_DISK_GROW_PARTITION will update the size of a partition
@@ -889,11 +846,10 @@ extern "C" {
// predetermined by examining PARTITION_INFORMATION.
//
- typedef struct _DISK_GROW_PARTITION
- {
- ULONG PartitionNumber;
- LARGE_INTEGER BytesToGrow;
- } DISK_GROW_PARTITION, *PDISK_GROW_PARTITION;
+typedef struct _DISK_GROW_PARTITION {
+ ULONG PartitionNumber;
+ LARGE_INTEGER BytesToGrow;
+} DISK_GROW_PARTITION, *PDISK_GROW_PARTITION;
#endif /* _WIN32_WINNT >= 0x0500 */
///////////////////////////////////////////////////////
@@ -914,28 +870,26 @@ extern "C" {
#define HIST_NO_OF_BUCKETS 24
- typedef struct _HISTOGRAM_BUCKET
- {
- ULONG Reads;
- ULONG Writes;
- } HISTOGRAM_BUCKET, *PHISTOGRAM_BUCKET;
+typedef struct _HISTOGRAM_BUCKET {
+ ULONG Reads;
+ ULONG Writes;
+} HISTOGRAM_BUCKET, *PHISTOGRAM_BUCKET;
#define HISTOGRAM_BUCKET_SIZE sizeof(HISTOGRAM_BUCKET)
- typedef struct _DISK_HISTOGRAM
- {
- LARGE_INTEGER DiskSize;
- LARGE_INTEGER Start;
- LARGE_INTEGER End;
- LARGE_INTEGER Average;
- LARGE_INTEGER AverageRead;
- LARGE_INTEGER AverageWrite;
- ULONG Granularity;
- ULONG Size;
- ULONG ReadCount;
- ULONG WriteCount;
- PHISTOGRAM_BUCKET Histogram;
- } DISK_HISTOGRAM, *PDISK_HISTOGRAM;
+typedef struct _DISK_HISTOGRAM {
+ LARGE_INTEGER DiskSize;
+ LARGE_INTEGER Start;
+ LARGE_INTEGER End;
+ LARGE_INTEGER Average;
+ LARGE_INTEGER AverageRead;
+ LARGE_INTEGER AverageWrite;
+ ULONG Granularity;
+ ULONG Size;
+ ULONG ReadCount;
+ ULONG WriteCount;
+ PHISTOGRAM_BUCKET Histogram;
+} DISK_HISTOGRAM, *PDISK_HISTOGRAM;
#define DISK_HISTOGRAM_SIZE sizeof(DISK_HISTOGRAM)
@@ -959,8 +913,7 @@ extern "C" {
// in measuring performance.
//
- typedef struct _DISK_PERFORMANCE
- {
+typedef struct _DISK_PERFORMANCE {
LARGE_INTEGER BytesRead;
LARGE_INTEGER BytesWritten;
LARGE_INTEGER ReadTime;
@@ -973,7 +926,7 @@ extern "C" {
LARGE_INTEGER QueryTime;
ULONG StorageDeviceNumber;
WCHAR StorageManagerName[8];
- } DISK_PERFORMANCE, *PDISK_PERFORMANCE;
+} DISK_PERFORMANCE, *PDISK_PERFORMANCE;
//
// This structure defines the disk logging record. When disk logging
@@ -981,28 +934,26 @@ extern "C" {
// disk request.
//
- typedef struct _DISK_RECORD
- {
- LARGE_INTEGER ByteOffset;
- LARGE_INTEGER StartTime;
- LARGE_INTEGER EndTime;
- PVOID VirtualAddress;
- ULONG NumberOfBytes;
- UCHAR DeviceNumber;
- BOOLEAN ReadRequest;
- } DISK_RECORD, *PDISK_RECORD;
+typedef struct _DISK_RECORD {
+ LARGE_INTEGER ByteOffset;
+ LARGE_INTEGER StartTime;
+ LARGE_INTEGER EndTime;
+ PVOID VirtualAddress;
+ ULONG NumberOfBytes;
+ UCHAR DeviceNumber;
+ BOOLEAN ReadRequest;
+} DISK_RECORD, *PDISK_RECORD;
//
// The following structure is exchanged on an IOCTL_DISK_LOG request.
// Not all fields are valid with each function type.
//
- typedef struct _DISK_LOGGING
- {
- UCHAR Function;
- PVOID BufferAddress;
- ULONG BufferSize;
- } DISK_LOGGING, *PDISK_LOGGING;
+typedef struct _DISK_LOGGING {
+ UCHAR Function;
+ PVOID BufferAddress;
+ ULONG BufferSize;
+} DISK_LOGGING, *PDISK_LOGGING;
//
// Disk logging functions
@@ -1040,52 +991,47 @@ extern "C" {
// Bin types
//
- typedef enum _BIN_TYPES
- {
- RequestSize,
- RequestLocation
- } BIN_TYPES;
+typedef enum _BIN_TYPES {
+ RequestSize,
+ RequestLocation
+} BIN_TYPES;
//
// Bin ranges
//
- typedef struct _BIN_RANGE
- {
- LARGE_INTEGER StartValue;
- LARGE_INTEGER Length;
- } BIN_RANGE, *PBIN_RANGE;
+typedef struct _BIN_RANGE {
+ LARGE_INTEGER StartValue;
+ LARGE_INTEGER Length;
+} BIN_RANGE, *PBIN_RANGE;
//
// Bin definition
//
- typedef struct _PERF_BIN
- {
- ULONG NumberOfBins;
- ULONG TypeOfBin;
- BIN_RANGE BinsRanges[1];
- } PERF_BIN, *PPERF_BIN ;
+typedef struct _PERF_BIN {
+ ULONG NumberOfBins;
+ ULONG TypeOfBin;
+ BIN_RANGE BinsRanges[1];
+} PERF_BIN, *PPERF_BIN ;
//
// Bin count
//
- typedef struct _BIN_COUNT
- {
- BIN_RANGE BinRange;
- ULONG BinCount;
- } BIN_COUNT, *PBIN_COUNT;
+typedef struct _BIN_COUNT {
+ BIN_RANGE BinRange;
+ ULONG BinCount;
+} BIN_COUNT, *PBIN_COUNT;
//
// Bin results
//
- typedef struct _BIN_RESULTS
- {
- ULONG NumberOfBins;
- BIN_COUNT BinCounts[1];
- } BIN_RESULTS, *PBIN_RESULTS;
+typedef struct _BIN_RESULTS {
+ ULONG NumberOfBins;
+ BIN_COUNT BinCounts[1];
+} BIN_RESULTS, *PBIN_RESULTS;
#if(_WIN32_WINNT >= 0x0400)
//
@@ -1096,15 +1042,14 @@ extern "C" {
//
#include <pshpack1.h>
- typedef struct _GETVERSIONINPARAMS
- {
+typedef struct _GETVERSIONINPARAMS {
UCHAR bVersion; // Binary driver version.
UCHAR bRevision; // Binary driver revision.
UCHAR bReserved; // Not used.
UCHAR bIDEDeviceMap; // Bit map of IDE devices.
ULONG fCapabilities; // Bit mask of driver capabilities.
ULONG dwReserved[4]; // For future use.
- } GETVERSIONINPARAMS, *PGETVERSIONINPARAMS, *LPGETVERSIONINPARAMS;
+} GETVERSIONINPARAMS, *PGETVERSIONINPARAMS, *LPGETVERSIONINPARAMS;
#include <poppack.h>
//
@@ -1120,8 +1065,7 @@ extern "C" {
//
#include <pshpack1.h>
- typedef struct _IDEREGS
- {
+typedef struct _IDEREGS {
UCHAR bFeaturesReg; // Used for specifying SMART "commands".
UCHAR bSectorCountReg; // IDE sector count register
UCHAR bSectorNumberReg; // IDE sector number register
@@ -1130,7 +1074,7 @@ extern "C" {
UCHAR bDriveHeadReg; // IDE drive/head register
UCHAR bCommandReg; // Actual IDE command.
UCHAR bReserved; // reserved for future use. Must be zero.
- } IDEREGS, *PIDEREGS, *LPIDEREGS;
+} IDEREGS, *PIDEREGS, *LPIDEREGS;
#include <poppack.h>
//
@@ -1140,8 +1084,8 @@ extern "C" {
#define ATAPI_ID_CMD 0xA1 // Returns ID sector for ATAPI.
#define ID_CMD 0xEC // Returns ID sector for ATA.
#define SMART_CMD 0xB0 // Performs SMART cmd.
- // Requires valid bFeaturesReg,
- // bCylLowReg, and bCylHighReg
+ // Requires valid bFeaturesReg,
+ // bCylLowReg, and bCylHighReg
//
// Cylinder register defines for SMART command
@@ -1157,16 +1101,15 @@ extern "C" {
//
#include <pshpack1.h>
- typedef struct _SENDCMDINPARAMS
- {
+typedef struct _SENDCMDINPARAMS {
ULONG cBufferSize; // Buffer size in bytes
IDEREGS irDriveRegs; // Structure with drive register values.
UCHAR bDriveNumber; // Physical drive number to send
- // command to (0,1,2,3).
+ // command to (0,1,2,3).
UCHAR bReserved[3]; // Reserved for future expansion.
ULONG dwReserved[4]; // For future use.
UCHAR bBuffer[1]; // Input buffer.
- } SENDCMDINPARAMS, *PSENDCMDINPARAMS, *LPSENDCMDINPARAMS;
+} SENDCMDINPARAMS, *PSENDCMDINPARAMS, *LPSENDCMDINPARAMS;
#include <poppack.h>
//
@@ -1174,16 +1117,15 @@ extern "C" {
//
#include <pshpack1.h>
- typedef struct _DRIVERSTATUS
- {
+typedef struct _DRIVERSTATUS {
UCHAR bDriverError; // Error code from driver,
- // or 0 if no error.
+ // or 0 if no error.
UCHAR bIDEError; // Contents of IDE Error register.
- // Only valid when bDriverError
- // is SMART_IDE_ERROR.
+ // Only valid when bDriverError
+ // is SMART_IDE_ERROR.
UCHAR bReserved[2]; // Reserved for future expansion.
ULONG dwReserved[2]; // Reserved for future expansion.
- } DRIVERSTATUS, *PDRIVERSTATUS, *LPDRIVERSTATUS;
+} DRIVERSTATUS, *PDRIVERSTATUS, *LPDRIVERSTATUS;
#include <poppack.h>
//
@@ -1201,7 +1143,7 @@ extern "C" {
#define SMART_INVALID_REGISTER 8 // Some IDE Register not valid
#define SMART_NOT_SUPPORTED 9 // Invalid cmd flag set
#define SMART_NO_IDE_DEVICE 10 // Cmd issued to device not present
- // although drive number is valid
+ // although drive number is valid
//
// SMART sub commands for execute offline diags
//
@@ -1214,12 +1156,11 @@ extern "C" {
#include <pshpack1.h>
- typedef struct _SENDCMDOUTPARAMS
- {
+typedef struct _SENDCMDOUTPARAMS {
ULONG cBufferSize; // Size of bBuffer in bytes
DRIVERSTATUS DriverStatus; // Driver status structure.
UCHAR bBuffer[1]; // Buffer of arbitrary length in which to store the data read from the // drive.
- } SENDCMDOUTPARAMS, *PSENDCMDOUTPARAMS, *LPSENDCMDOUTPARAMS;
+} SENDCMDOUTPARAMS, *PSENDCMDOUTPARAMS, *LPSENDCMDOUTPARAMS;
#include <poppack.h>
@@ -1259,14 +1200,13 @@ extern "C" {
// Queue link for mapped addresses stored for unmapping.
//
- typedef struct _MAPPED_ADDRESS
- {
- struct _MAPPED_ADDRESS *NextMappedAddress;
- PVOID MappedAddress;
- ULONG NumberOfBytes;
- LARGE_INTEGER IoAddress;
- ULONG BusNumber;
- } MAPPED_ADDRESS, *PMAPPED_ADDRESS;
+typedef struct _MAPPED_ADDRESS {
+ struct _MAPPED_ADDRESS *NextMappedAddress;
+ PVOID MappedAddress;
+ ULONG NumberOfBytes;
+ LARGE_INTEGER IoAddress;
+ ULONG BusNumber;
+} MAPPED_ADDRESS, *PMAPPED_ADDRESS;
#ifdef __cplusplus
diff --git a/include/winddk/ntddstor.h b/include/winddk/ntddstor.h
index ec1aa569b..83f7fe019 100644
--- a/include/winddk/ntddstor.h
+++ b/include/winddk/ntddstor.h
@@ -138,14 +138,13 @@ extern "C" {
// IOCTL_STORAGE_GET_HOTPLUG_INFO
//
- typedef struct _STORAGE_HOTPLUG_INFO
- {
- ULONG Size; // version
- BOOLEAN MediaRemovable; // ie. zip, jaz, cdrom, mo, etc. vs hdd
- BOOLEAN MediaHotplug; // ie. does the device succeed a lock even though its not lockable media?
- BOOLEAN DeviceHotplug; // ie. 1394, USB, etc.
- BOOLEAN WriteCacheEnableOverride; // This field should not be relied upon because it is no longer used
- } STORAGE_HOTPLUG_INFO, *PSTORAGE_HOTPLUG_INFO;
+typedef struct _STORAGE_HOTPLUG_INFO {
+ ULONG Size; // version
+ BOOLEAN MediaRemovable; // ie. zip, jaz, cdrom, mo, etc. vs hdd
+ BOOLEAN MediaHotplug; // ie. does the device succeed a lock even though its not lockable media?
+ BOOLEAN DeviceHotplug; // ie. 1394, USB, etc.
+ BOOLEAN WriteCacheEnableOverride; // This field should not be relied upon because it is no longer used
+} STORAGE_HOTPLUG_INFO, *PSTORAGE_HOTPLUG_INFO;
//
// IOCTL_STORAGE_GET_DEVICE_NUMBER
@@ -158,37 +157,35 @@ extern "C" {
// guaranteed to be persistant across boots.
//
- typedef struct _STORAGE_DEVICE_NUMBER
- {
+typedef struct _STORAGE_DEVICE_NUMBER {
- //
- // The FILE_DEVICE_XXX type for this device.
- //
+ //
+ // The FILE_DEVICE_XXX type for this device.
+ //
- DEVICE_TYPE DeviceType;
+ DEVICE_TYPE DeviceType;
- //
- // The number of this device
- //
+ //
+ // The number of this device
+ //
- ULONG DeviceNumber;
+ ULONG DeviceNumber;
- //
- // If the device is partitionable, the partition number of the device.
- // Otherwise -1
- //
+ //
+ // If the device is partitionable, the partition number of the device.
+ // Otherwise -1
+ //
- ULONG PartitionNumber;
- } STORAGE_DEVICE_NUMBER, *PSTORAGE_DEVICE_NUMBER;
+ ULONG PartitionNumber;
+} STORAGE_DEVICE_NUMBER, *PSTORAGE_DEVICE_NUMBER;
//
// Define the structures for scsi resets
//
- typedef struct _STORAGE_BUS_RESET_REQUEST
- {
- UCHAR PathId;
- } STORAGE_BUS_RESET_REQUEST, *PSTORAGE_BUS_RESET_REQUEST;
+typedef struct _STORAGE_BUS_RESET_REQUEST {
+ UCHAR PathId;
+} STORAGE_BUS_RESET_REQUEST, *PSTORAGE_BUS_RESET_REQUEST;
//
// IOCTL_STORAGE_MEDIA_REMOVAL disables the mechanism
@@ -200,25 +197,23 @@ extern "C" {
// FALSE means allow media removal.
//
- typedef struct _PREVENT_MEDIA_REMOVAL
- {
- BOOLEAN PreventMediaRemoval;
- } PREVENT_MEDIA_REMOVAL, *PPREVENT_MEDIA_REMOVAL;
+typedef struct _PREVENT_MEDIA_REMOVAL {
+ BOOLEAN PreventMediaRemoval;
+} PREVENT_MEDIA_REMOVAL, *PPREVENT_MEDIA_REMOVAL;
// begin_ntminitape
- typedef struct _TAPE_STATISTICS
- {
- ULONG Version;
- ULONG Flags;
- LARGE_INTEGER RecoveredWrites;
- LARGE_INTEGER UnrecoveredWrites;
- LARGE_INTEGER RecoveredReads;
- LARGE_INTEGER UnrecoveredReads;
- UCHAR CompressionRatioReads;
- UCHAR CompressionRatioWrites;
- } TAPE_STATISTICS, *PTAPE_STATISTICS;
+typedef struct _TAPE_STATISTICS {
+ ULONG Version;
+ ULONG Flags;
+ LARGE_INTEGER RecoveredWrites;
+ LARGE_INTEGER UnrecoveredWrites;
+ LARGE_INTEGER RecoveredReads;
+ LARGE_INTEGER UnrecoveredReads;
+ UCHAR CompressionRatioReads;
+ UCHAR CompressionRatioWrites;
+} TAPE_STATISTICS, *PTAPE_STATISTICS;
#define RECOVERED_WRITES_VALID 0x00000001
#define UNRECOVERED_WRITES_VALID 0x00000002
@@ -227,10 +222,9 @@ extern "C" {
#define WRITE_COMPRESSION_INFO_VALID 0x00000010
#define READ_COMPRESSION_INFO_VALID 0x00000020
- typedef struct _TAPE_GET_STATISTICS
- {
- ULONG Operation;
- } TAPE_GET_STATISTICS, *PTAPE_GET_STATISTICS;
+typedef struct _TAPE_GET_STATISTICS {
+ ULONG Operation;
+} TAPE_GET_STATISTICS, *PTAPE_GET_STATISTICS;
#define TAPE_RETURN_STATISTICS 0L
#define TAPE_RETURN_ENV_INFO 1L
@@ -241,98 +235,97 @@ extern "C" {
// structures, one per supported type, embedded in the GET_MEDIA_TYPES struct.
//
- typedef enum _STORAGE_MEDIA_TYPE
- {
- //
- // Following are defined in ntdddisk.h in the MEDIA_TYPE enum
- //
- // Unknown, // Format is unknown
- // F5_1Pt2_512, // 5.25", 1.2MB, 512 bytes/sector
- // F3_1Pt44_512, // 3.5", 1.44MB, 512 bytes/sector
- // F3_2Pt88_512, // 3.5", 2.88MB, 512 bytes/sector
- // F3_20Pt8_512, // 3.5", 20.8MB, 512 bytes/sector
- // F3_720_512, // 3.5", 720KB, 512 bytes/sector
- // F5_360_512, // 5.25", 360KB, 512 bytes/sector
- // F5_320_512, // 5.25", 320KB, 512 bytes/sector
- // F5_320_1024, // 5.25", 320KB, 1024 bytes/sector
- // F5_180_512, // 5.25", 180KB, 512 bytes/sector
- // F5_160_512, // 5.25", 160KB, 512 bytes/sector
- // RemovableMedia, // Removable media other than floppy
- // FixedMedia, // Fixed hard disk media
- // F3_120M_512, // 3.5", 120M Floppy
- // F3_640_512, // 3.5" , 640KB, 512 bytes/sector
- // F5_640_512, // 5.25", 640KB, 512 bytes/sector
- // F5_720_512, // 5.25", 720KB, 512 bytes/sector
- // F3_1Pt2_512, // 3.5" , 1.2Mb, 512 bytes/sector
- // F3_1Pt23_1024, // 3.5" , 1.23Mb, 1024 bytes/sector
- // F5_1Pt23_1024, // 5.25", 1.23MB, 1024 bytes/sector
- // F3_128Mb_512, // 3.5" MO 128Mb 512 bytes/sector
- // F3_230Mb_512, // 3.5" MO 230Mb 512 bytes/sector
- // F8_256_128, // 8", 256KB, 128 bytes/sector
- // F3_200Mb_512, // 3.5", 200M Floppy (HiFD)
- //
-
- DDS_4mm = 0x20, // Tape - DAT DDS1,2,... (all vendors)
- MiniQic, // Tape - miniQIC Tape
- Travan, // Tape - Travan TR-1,2,3,...
- QIC, // Tape - QIC
- MP_8mm, // Tape - 8mm Exabyte Metal Particle
- AME_8mm, // Tape - 8mm Exabyte Advanced Metal Evap
- AIT1_8mm, // Tape - 8mm Sony AIT
- DLT, // Tape - DLT Compact IIIxt, IV
- NCTP, // Tape - Philips NCTP
- IBM_3480, // Tape - IBM 3480
- IBM_3490E, // Tape - IBM 3490E
- IBM_Magstar_3590, // Tape - IBM Magstar 3590
- IBM_Magstar_MP, // Tape - IBM Magstar MP
- STK_DATA_D3, // Tape - STK Data D3
- SONY_DTF, // Tape - Sony DTF
- DV_6mm, // Tape - 6mm Digital Video
- DMI, // Tape - Exabyte DMI and compatibles
- SONY_D2, // Tape - Sony D2S and D2L
- CLEANER_CARTRIDGE, // Cleaner - All Drive types that support Drive Cleaners
- CD_ROM, // Opt_Disk - CD
- CD_R, // Opt_Disk - CD-Recordable (Write Once)
- CD_RW, // Opt_Disk - CD-Rewriteable
- DVD_ROM, // Opt_Disk - DVD-ROM
- DVD_R, // Opt_Disk - DVD-Recordable (Write Once)
- DVD_RW, // Opt_Disk - DVD-Rewriteable
- MO_3_RW, // Opt_Disk - 3.5" Rewriteable MO Disk
- MO_5_WO, // Opt_Disk - MO 5.25" Write Once
- MO_5_RW, // Opt_Disk - MO 5.25" Rewriteable (not LIMDOW)
- MO_5_LIMDOW, // Opt_Disk - MO 5.25" Rewriteable (LIMDOW)
- PC_5_WO, // Opt_Disk - Phase Change 5.25" Write Once Optical
- PC_5_RW, // Opt_Disk - Phase Change 5.25" Rewriteable
- PD_5_RW, // Opt_Disk - PhaseChange Dual Rewriteable
- ABL_5_WO, // Opt_Disk - Ablative 5.25" Write Once Optical
- PINNACLE_APEX_5_RW, // Opt_Disk - Pinnacle Apex 4.6GB Rewriteable Optical
- SONY_12_WO, // Opt_Disk - Sony 12" Write Once
- PHILIPS_12_WO, // Opt_Disk - Philips/LMS 12" Write Once
- HITACHI_12_WO, // Opt_Disk - Hitachi 12" Write Once
- CYGNET_12_WO, // Opt_Disk - Cygnet/ATG 12" Write Once
- KODAK_14_WO, // Opt_Disk - Kodak 14" Write Once
- MO_NFR_525, // Opt_Disk - Near Field Recording (Terastor)
- NIKON_12_RW, // Opt_Disk - Nikon 12" Rewriteable
- IOMEGA_ZIP, // Mag_Disk - Iomega Zip
- IOMEGA_JAZ, // Mag_Disk - Iomega Jaz
- SYQUEST_EZ135, // Mag_Disk - Syquest EZ135
- SYQUEST_EZFLYER, // Mag_Disk - Syquest EzFlyer
- SYQUEST_SYJET, // Mag_Disk - Syquest SyJet
- AVATAR_F2, // Mag_Disk - 2.5" Floppy
- MP2_8mm, // Tape - 8mm Hitachi
- DST_S, // Ampex DST Small Tapes
- DST_M, // Ampex DST Medium Tapes
- DST_L, // Ampex DST Large Tapes
- VXATape_1, // Ecrix 8mm Tape
- VXATape_2, // Ecrix 8mm Tape
- STK_9840, // STK 9840
- LTO_Ultrium, // IBM, HP, Seagate LTO Ultrium
- LTO_Accelis, // IBM, HP, Seagate LTO Accelis
- DVD_RAM, // Opt_Disk - DVD-RAM
- AIT_8mm, // AIT2 or higher
- ADR_1, // OnStream ADR Mediatypes
- ADR_2
- } STORAGE_MEDIA_TYPE, *PSTORAGE_MEDIA_TYPE;
+typedef enum _STORAGE_MEDIA_TYPE {
+ //
+ // Following are defined in ntdddisk.h in the MEDIA_TYPE enum
+ //
+ // Unknown, // Format is unknown
+ // F5_1Pt2_512, // 5.25", 1.2MB, 512 bytes/sector
+ // F3_1Pt44_512, // 3.5", 1.44MB, 512 bytes/sector
+ // F3_2Pt88_512, // 3.5", 2.88MB, 512 bytes/sector
+ // F3_20Pt8_512, // 3.5", 20.8MB, 512 bytes/sector
+ // F3_720_512, // 3.5", 720KB, 512 bytes/sector
+ // F5_360_512, // 5.25", 360KB, 512 bytes/sector
+ // F5_320_512, // 5.25", 320KB, 512 bytes/sector
+ // F5_320_1024, // 5.25", 320KB, 1024 bytes/sector
+ // F5_180_512, // 5.25", 180KB, 512 bytes/sector
+ // F5_160_512, // 5.25", 160KB, 512 bytes/sector
+ // RemovableMedia, // Removable media other than floppy
+ // FixedMedia, // Fixed hard disk media
+ // F3_120M_512, // 3.5", 120M Floppy
+ // F3_640_512, // 3.5" , 640KB, 512 bytes/sector
+ // F5_640_512, // 5.25", 640KB, 512 bytes/sector
+ // F5_720_512, // 5.25", 720KB, 512 bytes/sector
+ // F3_1Pt2_512, // 3.5" , 1.2Mb, 512 bytes/sector
+ // F3_1Pt23_1024, // 3.5" , 1.23Mb, 1024 bytes/sector
+ // F5_1Pt23_1024, // 5.25", 1.23MB, 1024 bytes/sector
+ // F3_128Mb_512, // 3.5" MO 128Mb 512 bytes/sector
+ // F3_230Mb_512, // 3.5" MO 230Mb 512 bytes/sector
+ // F8_256_128, // 8", 256KB, 128 bytes/sector
+ // F3_200Mb_512, // 3.5", 200M Floppy (HiFD)
+ //
+
+ DDS_4mm = 0x20, // Tape - DAT DDS1,2,... (all vendors)
+ MiniQic, // Tape - miniQIC Tape
+ Travan, // Tape - Travan TR-1,2,3,...
+ QIC, // Tape - QIC
+ MP_8mm, // Tape - 8mm Exabyte Metal Particle
+ AME_8mm, // Tape - 8mm Exabyte Advanced Metal Evap
+ AIT1_8mm, // Tape - 8mm Sony AIT
+ DLT, // Tape - DLT Compact IIIxt, IV
+ NCTP, // Tape - Philips NCTP
+ IBM_3480, // Tape - IBM 3480
+ IBM_3490E, // Tape - IBM 3490E
+ IBM_Magstar_3590, // Tape - IBM Magstar 3590
+ IBM_Magstar_MP, // Tape - IBM Magstar MP
+ STK_DATA_D3, // Tape - STK Data D3
+ SONY_DTF, // Tape - Sony DTF
+ DV_6mm, // Tape - 6mm Digital Video
+ DMI, // Tape - Exabyte DMI and compatibles
+ SONY_D2, // Tape - Sony D2S and D2L
+ CLEANER_CARTRIDGE, // Cleaner - All Drive types that support Drive Cleaners
+ CD_ROM, // Opt_Disk - CD
+ CD_R, // Opt_Disk - CD-Recordable (Write Once)
+ CD_RW, // Opt_Disk - CD-Rewriteable
+ DVD_ROM, // Opt_Disk - DVD-ROM
+ DVD_R, // Opt_Disk - DVD-Recordable (Write Once)
+ DVD_RW, // Opt_Disk - DVD-Rewriteable
+ MO_3_RW, // Opt_Disk - 3.5" Rewriteable MO Disk
+ MO_5_WO, // Opt_Disk - MO 5.25" Write Once
+ MO_5_RW, // Opt_Disk - MO 5.25" Rewriteable (not LIMDOW)
+ MO_5_LIMDOW, // Opt_Disk - MO 5.25" Rewriteable (LIMDOW)
+ PC_5_WO, // Opt_Disk - Phase Change 5.25" Write Once Optical
+ PC_5_RW, // Opt_Disk - Phase Change 5.25" Rewriteable
+ PD_5_RW, // Opt_Disk - PhaseChange Dual Rewriteable
+ ABL_5_WO, // Opt_Disk - Ablative 5.25" Write Once Optical
+ PINNACLE_APEX_5_RW, // Opt_Disk - Pinnacle Apex 4.6GB Rewriteable Optical
+ SONY_12_WO, // Opt_Disk - Sony 12" Write Once
+ PHILIPS_12_WO, // Opt_Disk - Philips/LMS 12" Write Once
+ HITACHI_12_WO, // Opt_Disk - Hitachi 12" Write Once
+ CYGNET_12_WO, // Opt_Disk - Cygnet/ATG 12" Write Once
+ KODAK_14_WO, // Opt_Disk - Kodak 14" Write Once
+ MO_NFR_525, // Opt_Disk - Near Field Recording (Terastor)
+ NIKON_12_RW, // Opt_Disk - Nikon 12" Rewriteable
+ IOMEGA_ZIP, // Mag_Disk - Iomega Zip
+ IOMEGA_JAZ, // Mag_Disk - Iomega Jaz
+ SYQUEST_EZ135, // Mag_Disk - Syquest EZ135
+ SYQUEST_EZFLYER, // Mag_Disk - Syquest EzFlyer
+ SYQUEST_SYJET, // Mag_Disk - Syquest SyJet
+ AVATAR_F2, // Mag_Disk - 2.5" Floppy
+ MP2_8mm, // Tape - 8mm Hitachi
+ DST_S, // Ampex DST Small Tapes
+ DST_M, // Ampex DST Medium Tapes
+ DST_L, // Ampex DST Large Tapes
+ VXATape_1, // Ecrix 8mm Tape
+ VXATape_2, // Ecrix 8mm Tape
+ STK_9840, // STK 9840
+ LTO_Ultrium, // IBM, HP, Seagate LTO Ultrium
+ LTO_Accelis, // IBM, HP, Seagate LTO Accelis
+ DVD_RAM, // Opt_Disk - DVD-RAM
+ AIT_8mm, // AIT2 or higher
+ ADR_1, // OnStream ADR Mediatypes
+ ADR_2
+} STORAGE_MEDIA_TYPE, *PSTORAGE_MEDIA_TYPE;
#define MEDIA_ERASEABLE 0x00000001
#define MEDIA_WRITE_ONCE 0x00000002
@@ -347,76 +340,67 @@ extern "C" {
// Bus types below 128 (0x80) are reserved for Microsoft use
//
- typedef enum _STORAGE_BUS_TYPE
- {
- BusTypeUnknown = 0x00,
- BusTypeScsi,
- BusTypeAtapi,
- BusTypeAta,
- BusType1394,
- BusTypeSsa,
- BusTypeFibre,
- BusTypeUsb,
- BusTypeRAID,
- BusTypeMaxReserved = 0x7F
- } STORAGE_BUS_TYPE, *PSTORAGE_BUS_TYPE;
-
- typedef struct _DEVICE_MEDIA_INFO
- {
- union
- {
- struct
- {
- LARGE_INTEGER Cylinders;
- STORAGE_MEDIA_TYPE MediaType;
- ULONG TracksPerCylinder;
- ULONG SectorsPerTrack;
- ULONG BytesPerSector;
- ULONG NumberMediaSides;
- ULONG MediaCharacteristics; // Bitmask of MEDIA_XXX values.
- } DiskInfo;
-
- struct
- {
- LARGE_INTEGER Cylinders;
- STORAGE_MEDIA_TYPE MediaType;
- ULONG TracksPerCylinder;
- ULONG SectorsPerTrack;
- ULONG BytesPerSector;
- ULONG NumberMediaSides;
- ULONG MediaCharacteristics; // Bitmask of MEDIA_XXX values.
- } RemovableDiskInfo;
-
- struct
- {
- STORAGE_MEDIA_TYPE MediaType;
- ULONG MediaCharacteristics; // Bitmask of MEDIA_XXX values.
- ULONG CurrentBlockSize;
- STORAGE_BUS_TYPE BusType;
-
- //
- // Bus specific information describing the medium supported.
- //
-
- union
- {
- struct
- {
- UCHAR MediumType;
- UCHAR DensityCode;
- } ScsiInformation;
- } BusSpecificData;
-
- } TapeInfo;
- } DeviceSpecific;
- } DEVICE_MEDIA_INFO, *PDEVICE_MEDIA_INFO;
-
- typedef struct _GET_MEDIA_TYPES
- {
- ULONG DeviceType; // FILE_DEVICE_XXX values
- ULONG MediaInfoCount;
- DEVICE_MEDIA_INFO MediaInfo[1];
- } GET_MEDIA_TYPES, *PGET_MEDIA_TYPES;
+typedef enum _STORAGE_BUS_TYPE {
+ BusTypeUnknown = 0x00,
+ BusTypeScsi,
+ BusTypeAtapi,
+ BusTypeAta,
+ BusType1394,
+ BusTypeSsa,
+ BusTypeFibre,
+ BusTypeUsb,
+ BusTypeRAID,
+ BusTypeMaxReserved = 0x7F
+} STORAGE_BUS_TYPE, *PSTORAGE_BUS_TYPE;
+
+typedef struct _DEVICE_MEDIA_INFO {
+ union {
+ struct {
+ LARGE_INTEGER Cylinders;
+ STORAGE_MEDIA_TYPE MediaType;
+ ULONG TracksPerCylinder;
+ ULONG SectorsPerTrack;
+ ULONG BytesPerSector;
+ ULONG NumberMediaSides;
+ ULONG MediaCharacteristics; // Bitmask of MEDIA_XXX values.
+ } DiskInfo;
+
+ struct {
+ LARGE_INTEGER Cylinders;
+ STORAGE_MEDIA_TYPE MediaType;
+ ULONG TracksPerCylinder;
+ ULONG SectorsPerTrack;
+ ULONG BytesPerSector;
+ ULONG NumberMediaSides;
+ ULONG MediaCharacteristics; // Bitmask of MEDIA_XXX values.
+ } RemovableDiskInfo;
+
+ struct {
+ STORAGE_MEDIA_TYPE MediaType;
+ ULONG MediaCharacteristics; // Bitmask of MEDIA_XXX values.
+ ULONG CurrentBlockSize;
+ STORAGE_BUS_TYPE BusType;
+
+ //
+ // Bus specific information describing the medium supported.
+ //
+
+ union {
+ struct {
+ UCHAR MediumType;
+ UCHAR DensityCode;
+ } ScsiInformation;
+ } BusSpecificData;
+
+ } TapeInfo;
+ } DeviceSpecific;
+} DEVICE_MEDIA_INFO, *PDEVICE_MEDIA_INFO;
+
+typedef struct _GET_MEDIA_TYPES {
+ ULONG DeviceType; // FILE_DEVICE_XXX values
+ ULONG MediaInfoCount;
+ DEVICE_MEDIA_INFO MediaInfo[1];
+} GET_MEDIA_TYPES, *PGET_MEDIA_TYPES;
//
@@ -431,11 +415,11 @@ extern "C" {
// VendorSpecific returns 512 bytes of vendor specific information
// if a failure is predicted
//
- typedef struct _STORAGE_PREDICT_FAILURE
- {
- ULONG PredictFailure;
- UCHAR VendorSpecific[512];
- } STORAGE_PREDICT_FAILURE, *PSTORAGE_PREDICT_FAILURE;
+typedef struct _STORAGE_PREDICT_FAILURE
+{
+ ULONG PredictFailure;
+ UCHAR VendorSpecific[512];
+} STORAGE_PREDICT_FAILURE, *PSTORAGE_PREDICT_FAILURE;
// end_ntminitape
// end_winioctl
@@ -464,66 +448,62 @@ extern "C" {
// Types of queries
//
- typedef enum _STORAGE_QUERY_TYPE
- {
- PropertyStandardQuery = 0, // Retrieves the descriptor
- PropertyExistsQuery, // Used to test whether the descriptor is supported
- PropertyMaskQuery, // Used to retrieve a mask of writeable fields in the descriptor
- PropertyQueryMaxDefined // use to validate the value
- } STORAGE_QUERY_TYPE, *PSTORAGE_QUERY_TYPE;
+typedef enum _STORAGE_QUERY_TYPE {
+ PropertyStandardQuery = 0, // Retrieves the descriptor
+ PropertyExistsQuery, // Used to test whether the descriptor is supported
+ PropertyMaskQuery, // Used to retrieve a mask of writeable fields in the descriptor
+ PropertyQueryMaxDefined // use to validate the value
+} STORAGE_QUERY_TYPE, *PSTORAGE_QUERY_TYPE;
//
// define some initial property id's
//
- typedef enum _STORAGE_PROPERTY_ID
- {
- StorageDeviceProperty = 0,
- StorageAdapterProperty,
- StorageDeviceIdProperty
- } STORAGE_PROPERTY_ID, *PSTORAGE_PROPERTY_ID;
+typedef enum _STORAGE_PROPERTY_ID {
+ StorageDeviceProperty = 0,
+ StorageAdapterProperty,
+ StorageDeviceIdProperty
+} STORAGE_PROPERTY_ID, *PSTORAGE_PROPERTY_ID;
//
// Query structure - additional parameters for specific queries can follow
// the header
//
- typedef struct _STORAGE_PROPERTY_QUERY
- {
+typedef struct _STORAGE_PROPERTY_QUERY {
- //
- // ID of the property being retrieved
- //
+ //
+ // ID of the property being retrieved
+ //
- STORAGE_PROPERTY_ID PropertyId;
+ STORAGE_PROPERTY_ID PropertyId;
- //
- // Flags indicating the type of query being performed
- //
+ //
+ // Flags indicating the type of query being performed
+ //
- STORAGE_QUERY_TYPE QueryType;
+ STORAGE_QUERY_TYPE QueryType;
- //
- // Space for additional parameters if necessary
- //
+ //
+ // Space for additional parameters if necessary
+ //
- UCHAR AdditionalParameters[1];
+ UCHAR AdditionalParameters[1];
- } STORAGE_PROPERTY_QUERY, *PSTORAGE_PROPERTY_QUERY;
+} STORAGE_PROPERTY_QUERY, *PSTORAGE_PROPERTY_QUERY;
//
// Standard property descriptor header. All property pages should use this
// as their first element or should contain these two elements
//
- typedef struct _STORAGE_DESCRIPTOR_HEADER
- {
+typedef struct _STORAGE_DESCRIPTOR_HEADER {
- ULONG Version;
+ ULONG Version;
- ULONG Size;
+ ULONG Size;
- } STORAGE_DESCRIPTOR_HEADER, *PSTORAGE_DESCRIPTOR_HEADER;
+} STORAGE_DESCRIPTOR_HEADER, *PSTORAGE_DESCRIPTOR_HEADER;
//
// Device property descriptor - this is really just a rehash of the inquiry
@@ -533,100 +513,99 @@ extern "C" {
// will result in an error
//
- typedef struct _STORAGE_DEVICE_DESCRIPTOR
- {
+typedef struct _STORAGE_DEVICE_DESCRIPTOR {
- //
- // Sizeof(STORAGE_DEVICE_DESCRIPTOR)
- //
+ //
+ // Sizeof(STORAGE_DEVICE_DESCRIPTOR)
+ //
- ULONG Version;
+ ULONG Version;
- //
- // Total size of the descriptor, including the space for additional
- // data and id strings
- //
+ //
+ // Total size of the descriptor, including the space for additional
+ // data and id strings
+ //
- ULONG Size;
+ ULONG Size;
- //
- // The SCSI-2 device type
- //
+ //
+ // The SCSI-2 device type
+ //
- UCHAR DeviceType;
+ UCHAR DeviceType;
- //
- // The SCSI-2 device type modifier (if any) - this may be zero
- //
+ //
+ // The SCSI-2 device type modifier (if any) - this may be zero
+ //
- UCHAR DeviceTypeModifier;
+ UCHAR DeviceTypeModifier;
- //
- // Flag indicating whether the device's media (if any) is removable. This
- // field should be ignored for media-less devices
- //
+ //
+ // Flag indicating whether the device's media (if any) is removable. This
+ // field should be ignored for media-less devices
+ //
- BOOLEAN RemovableMedia;
+ BOOLEAN RemovableMedia;
- //
- // Flag indicating whether the device can support mulitple outstanding
- // commands. The actual synchronization in this case is the responsibility
- // of the port driver.
- //
+ //
+ // Flag indicating whether the device can support mulitple outstanding
+ // commands. The actual synchronization in this case is the responsibility
+ // of the port driver.
+ //
- BOOLEAN CommandQueueing;
+ BOOLEAN CommandQueueing;
- //
- // Byte offset to the zero-terminated ascii string containing the device's
- // vendor id string. For devices with no such ID this will be zero
- //
+ //
+ // Byte offset to the zero-terminated ascii string containing the device's
+ // vendor id string. For devices with no such ID this will be zero
+ //
- ULONG VendorIdOffset;
+ ULONG VendorIdOffset;
- //
- // Byte offset to the zero-terminated ascii string containing the device's
- // product id string. For devices with no such ID this will be zero
- //
+ //
+ // Byte offset to the zero-terminated ascii string containing the device's
+ // product id string. For devices with no such ID this will be zero
+ //
- ULONG ProductIdOffset;
+ ULONG ProductIdOffset;
- //
- // Byte offset to the zero-terminated ascii string containing the device's
- // product revision string. For devices with no such string this will be
- // zero
- //
+ //
+ // Byte offset to the zero-terminated ascii string containing the device's
+ // product revision string. For devices with no such string this will be
+ // zero
+ //
- ULONG ProductRevisionOffset;
+ ULONG ProductRevisionOffset;
- //
- // Byte offset to the zero-terminated ascii string containing the device's
- // serial number. For devices with no serial number this will be zero
- //
+ //
+ // Byte offset to the zero-terminated ascii string containing the device's
+ // serial number. For devices with no serial number this will be zero
+ //
- ULONG SerialNumberOffset;
+ ULONG SerialNumberOffset;
- //
- // Contains the bus type (as defined above) of the device. It should be
- // used to interpret the raw device properties at the end of this structure
- // (if any)
- //
+ //
+ // Contains the bus type (as defined above) of the device. It should be
+ // used to interpret the raw device properties at the end of this structure
+ // (if any)
+ //
- STORAGE_BUS_TYPE BusType;
+ STORAGE_BUS_TYPE BusType;
- //
- // The number of bytes of bus-specific data which have been appended to
- // this descriptor
- //
+ //
+ // The number of bytes of bus-specific data which have been appended to
+ // this descriptor
+ //
- ULONG RawPropertiesLength;
+ ULONG RawPropertiesLength;
- //
- // Place holder for the first byte of the bus specific property data
- //
+ //
+ // Place holder for the first byte of the bus specific property data
+ //
- UCHAR RawDeviceProperties[1];
+ UCHAR RawDeviceProperties[1];
- } STORAGE_DEVICE_DESCRIPTOR, *PSTORAGE_DEVICE_DESCRIPTOR;
+} STORAGE_DEVICE_DESCRIPTOR, *PSTORAGE_DEVICE_DESCRIPTOR;
//
@@ -637,34 +616,33 @@ extern "C" {
// forward the request to the underlying bus
//
- typedef struct _STORAGE_ADAPTER_DESCRIPTOR
- {
+typedef struct _STORAGE_ADAPTER_DESCRIPTOR {
- ULONG Version;
+ ULONG Version;
- ULONG Size;
+ ULONG Size;
- ULONG MaximumTransferLength;
+ ULONG MaximumTransferLength;
- ULONG MaximumPhysicalPages;
+ ULONG MaximumPhysicalPages;
- ULONG AlignmentMask;
+ ULONG AlignmentMask;
- BOOLEAN AdapterUsesPio;
+ BOOLEAN AdapterUsesPio;
- BOOLEAN AdapterScansDown;
+ BOOLEAN AdapterScansDown;
- BOOLEAN CommandQueueing;
+ BOOLEAN CommandQueueing;
- BOOLEAN AcceleratedTransfer;
+ BOOLEAN AcceleratedTransfer;
- UCHAR BusType;
+ UCHAR BusType;
- USHORT BusMajorVersion;
+ USHORT BusMajorVersion;
- USHORT BusMinorVersion;
+ USHORT BusMinorVersion;
- } STORAGE_ADAPTER_DESCRIPTOR, *PSTORAGE_ADAPTER_DESCRIPTOR;
+} STORAGE_ADAPTER_DESCRIPTOR, *PSTORAGE_ADAPTER_DESCRIPTOR;
//
// Storage identification descriptor.
@@ -672,96 +650,90 @@ extern "C" {
// device identifier page.
//
- typedef enum _STORAGE_IDENTIFIER_CODE_SET
- {
- StorageIdCodeSetReserved = 0,
- StorageIdCodeSetBinary = 1,
- StorageIdCodeSetAscii = 2
- } STORAGE_IDENTIFIER_CODE_SET, *PSTORAGE_IDENTIFIER_CODE_SET;
+typedef enum _STORAGE_IDENTIFIER_CODE_SET {
+ StorageIdCodeSetReserved = 0,
+ StorageIdCodeSetBinary = 1,
+ StorageIdCodeSetAscii = 2
+} STORAGE_IDENTIFIER_CODE_SET, *PSTORAGE_IDENTIFIER_CODE_SET;
- typedef enum _STORAGE_IDENTIFIER_TYPE
- {
- StorageIdTypeVendorSpecific = 0,
- StorageIdTypeVendorId = 1,
- StorageIdTypeEUI64 = 2,
- StorageIdTypeFCPHName = 3,
- StorageIdTypePortRelative = 4
- } STORAGE_IDENTIFIER_TYPE, *PSTORAGE_IDENTIFIER_TYPE;
+typedef enum _STORAGE_IDENTIFIER_TYPE {
+ StorageIdTypeVendorSpecific = 0,
+ StorageIdTypeVendorId = 1,
+ StorageIdTypeEUI64 = 2,
+ StorageIdTypeFCPHName = 3,
+ StorageIdTypePortRelative = 4
+} STORAGE_IDENTIFIER_TYPE, *PSTORAGE_IDENTIFIER_TYPE;
- typedef enum _STORAGE_ASSOCIATION_TYPE
- {
- StorageIdAssocDevice = 0,
- StorageIdAssocPort = 1
- } STORAGE_ASSOCIATION_TYPE, *PSTORAGE_ASSOCIATION_TYPE;
+typedef enum _STORAGE_ASSOCIATION_TYPE {
+ StorageIdAssocDevice = 0,
+ StorageIdAssocPort = 1
+} STORAGE_ASSOCIATION_TYPE, *PSTORAGE_ASSOCIATION_TYPE;
- typedef struct _STORAGE_IDENTIFIER
- {
- STORAGE_IDENTIFIER_CODE_SET CodeSet;
- STORAGE_IDENTIFIER_TYPE Type;
- USHORT IdentifierSize;
- USHORT NextOffset;
+typedef struct _STORAGE_IDENTIFIER {
+ STORAGE_IDENTIFIER_CODE_SET CodeSet;
+ STORAGE_IDENTIFIER_TYPE Type;
+ USHORT IdentifierSize;
+ USHORT NextOffset;
- //
- // Add new fields here since existing code depends on
- // the above layout not changing.
- //
+ //
+ // Add new fields here since existing code depends on
+ // the above layout not changing.
+ //
- STORAGE_ASSOCIATION_TYPE Association;
+ STORAGE_ASSOCIATION_TYPE Association;
- //
- // The identifier is a variable length array of bytes.
- //
+ //
+ // The identifier is a variable length array of bytes.
+ //
- UCHAR Identifier[1];
- } STORAGE_IDENTIFIER, *PSTORAGE_IDENTIFIER;
+ UCHAR Identifier[1];
+} STORAGE_IDENTIFIER, *PSTORAGE_IDENTIFIER;
- typedef struct _STORAGE_DEVICE_ID_DESCRIPTOR
- {
+typedef struct _STORAGE_DEVICE_ID_DESCRIPTOR {
- ULONG Version;
+ ULONG Version;
- ULONG Size;
+ ULONG Size;
- //
- // The number of identifiers reported by the device.
- //
+ //
+ // The number of identifiers reported by the device.
+ //
- ULONG NumberOfIdentifiers;
+ ULONG NumberOfIdentifiers;
- //
- // The following field is actually a variable length array of identification
- // descriptors. Unfortunately there's no C notation for an array of
- // variable length structures so we're forced to just pretend.
- //
+ //
+ // The following field is actually a variable length array of identification
+ // descriptors. Unfortunately there's no C notation for an array of
+ // variable length structures so we're forced to just pretend.
+ //
- UCHAR Identifiers[1];
- } STORAGE_DEVICE_ID_DESCRIPTOR, *PSTORAGE_DEVICE_ID_DESCRIPTOR;
+ UCHAR Identifiers[1];
+} STORAGE_DEVICE_ID_DESCRIPTOR, *PSTORAGE_DEVICE_ID_DESCRIPTOR;
#pragma warning(push)
#pragma warning(disable:4200)
- typedef struct _STORAGE_MEDIA_SERIAL_NUMBER_DATA
- {
+typedef struct _STORAGE_MEDIA_SERIAL_NUMBER_DATA {
- USHORT Reserved;
+ USHORT Reserved;
- //
- // the SerialNumberLength will be set to zero
- // if the command is supported and the media
- // does not have a valid serial number.
- //
+ //
+ // the SerialNumberLength will be set to zero
+ // if the command is supported and the media
+ // does not have a valid serial number.
+ //
- USHORT SerialNumberLength;
+ USHORT SerialNumberLength;
- //
- // the following data is binary, and is not guaranteed
- // to be NULL terminated. this is an excercise for the
- // caller.
- //
+ //
+ // the following data is binary, and is not guaranteed
+ // to be NULL terminated. this is an excercise for the
+ // caller.
+ //
- UCHAR SerialNumber[0];
+ UCHAR SerialNumber[0];
- } STORAGE_MEDIA_SERIAL_NUMBER_DATA, *PSTORAGE_MEDIA_SERIAL_NUMBER_DATA;
+} STORAGE_MEDIA_SERIAL_NUMBER_DATA, *PSTORAGE_MEDIA_SERIAL_NUMBER_DATA;
#pragma warning(push)