include/winioctl.h: Import definitions from ntddstor.h.

Signed-off-by: Mark Harmstone <mark@harmstone.com>
Signed-off-by: Liu Hao <lh_mouse@126.com>
This commit is contained in:
Mark Harmstone 2021-05-10 18:24:07 +01:00 committed by Liu Hao
parent cbe78b1156
commit 1fb9f4338c

View File

@ -19,6 +19,7 @@ DEFINE_GUID(GUID_DEVINTERFACE_MEDIUMCHANGER,0x53f56310,0xb6bf,0x11d0,0x94,0xf2,0
DEFINE_GUID(GUID_DEVINTERFACE_FLOPPY,0x53f56311,0xb6bf,0x11d0,0x94,0xf2,0x00,0xa0,0xc9,0x1e,0xfb,0x8b);
DEFINE_GUID(GUID_DEVINTERFACE_CDCHANGER,0x53f56312,0xb6bf,0x11d0,0x94,0xf2,0x00,0xa0,0xc9,0x1e,0xfb,0x8b);
DEFINE_GUID(GUID_DEVINTERFACE_STORAGEPORT,0x2accfe60,0xc130,0x11d2,0xb0,0x82,0x00,0xa0,0xc9,0x1e,0xfb,0x8b);
DEFINE_GUID(GUID_DEVINTERFACE_HIDDEN_VOLUME,0x7f108a28,0x9833,0x4b3b,0xb7,0x80,0x2c,0x6b,0x5f,0xa5,0xc0,0x62);
DEFINE_GUID(GUID_DEVINTERFACE_COMPORT,0x86e0d1e0,0x8089,0x11d0,0x9c,0xe4,0x08,0x00,0x3e,0x30,0x1f,0x73);
DEFINE_GUID(GUID_DEVINTERFACE_SERENUM_BUS_ENUMERATOR,0x4D36E978,0xE325,0x11CE,0xBF,0xC1,0x08,0x00,0x2B,0xE1,0x03,0x18);
@ -32,6 +33,7 @@ DEFINE_GUID(GUID_DEVINTERFACE_SERENUM_BUS_ENUMERATOR,0x4D36E978,0xE325,0x11CE,0x
#define FloppyClassGuid GUID_DEVINTERFACE_FLOPPY
#define CdChangerClassGuid GUID_DEVINTERFACE_CDCHANGER
#define StoragePortClassGuid GUID_DEVINTERFACE_STORAGEPORT
#define HiddenVolumeClassGuid GUID_DEVINTERFACE_HIDDEN_VOLUME
#define GUID_CLASS_COMPORT GUID_DEVINTERFACE_COMPORT
#define GUID_SERENUM_BUS_ENUMERATOR GUID_DEVINTERFACE_SERENUM_BUS_ENUMERATOR
#endif /* DEFINE_GUID */
@ -183,11 +185,18 @@ extern "C" {
#define IOCTL_STORAGE_RESET_BUS CTL_CODE(IOCTL_STORAGE_BASE,0x0400,METHOD_BUFFERED,FILE_READ_ACCESS)
#define IOCTL_STORAGE_RESET_DEVICE CTL_CODE(IOCTL_STORAGE_BASE,0x0401,METHOD_BUFFERED,FILE_READ_ACCESS)
#define IOCTL_STORAGE_BREAK_RESERVATION CTL_CODE(IOCTL_STORAGE_BASE,0x0405,METHOD_BUFFERED,FILE_READ_ACCESS)
#define IOCTL_STORAGE_PERSISTENT_RESERVE_IN CTL_CODE(IOCTL_STORAGE_BASE, 0x0406, METHOD_BUFFERED, FILE_READ_ACCESS)
#define IOCTL_STORAGE_PERSISTENT_RESERVE_OUT CTL_CODE(IOCTL_STORAGE_BASE, 0x0407, METHOD_BUFFERED, FILE_READ_ACCESS | FILE_WRITE_ACCESS)
#define IOCTL_STORAGE_GET_DEVICE_NUMBER CTL_CODE(IOCTL_STORAGE_BASE,0x0420,METHOD_BUFFERED,FILE_ANY_ACCESS)
#define IOCTL_STORAGE_PREDICT_FAILURE CTL_CODE(IOCTL_STORAGE_BASE,0x0440,METHOD_BUFFERED,FILE_ANY_ACCESS)
#define IOCTL_STORAGE_READ_CAPACITY CTL_CODE(IOCTL_STORAGE_BASE,0x0450,METHOD_BUFFERED,FILE_READ_ACCESS)
#define IOCTL_STORAGE_GET_BC_PROPERTIES CTL_CODE(IOCTL_STORAGE_BASE, 0x0600, METHOD_BUFFERED, FILE_READ_ACCESS)
#define IOCTL_STORAGE_ALLOCATE_BC_STREAM CTL_CODE(IOCTL_STORAGE_BASE, 0x0601, METHOD_BUFFERED, FILE_READ_ACCESS | FILE_WRITE_ACCESS)
#define IOCTL_STORAGE_FREE_BC_STREAM CTL_CODE(IOCTL_STORAGE_BASE, 0x0602, METHOD_BUFFERED, FILE_READ_ACCESS | FILE_WRITE_ACCESS)
#define IOCTL_STORAGE_CHECK_PRIORITY_HINT_SUPPORT CTL_CODE(IOCTL_STORAGE_BASE, 0x0620, METHOD_BUFFERED, FILE_ANY_ACCESS)
#define OBSOLETE_IOCTL_STORAGE_RESET_BUS CTL_CODE(IOCTL_STORAGE_BASE,0x0400,METHOD_BUFFERED,FILE_READ_ACCESS | FILE_WRITE_ACCESS)
#define OBSOLETE_IOCTL_STORAGE_RESET_DEVICE CTL_CODE(IOCTL_STORAGE_BASE,0x0401,METHOD_BUFFERED,FILE_READ_ACCESS | FILE_WRITE_ACCESS)
@ -209,6 +218,13 @@ typedef struct _STORAGE_READ_CAPACITY {
#define DEVICE_DSM_FLAG_ENTIRE_DATA_SET_RANGE __MSABI_LONG(0x00000001)
#define DEVICE_DSM_NOTIFY_FLAG_BEGIN 0x00000001
#define DEVICE_DSM_NOTIFY_FLAG_END 0x00000002
#define IOCTL_STORAGE_BC_VERSION 1
#define STORAGE_PRIORITY_HINT_SUPPORTED 0x0001
typedef DWORD DEVICE_DATA_MANAGEMENT_SET_ACTION;
typedef struct _DEVICE_MANAGE_DATA_SET_ATTRIBUTES {
DWORD Size;
@ -225,6 +241,71 @@ typedef struct _STORAGE_READ_CAPACITY {
DWORDLONG LengthInBytes;
} DEVICE_DATA_SET_RANGE, *PDEVICE_DATA_SET_RANGE;
typedef struct _DEVICE_DSM_NOTIFICATION_PARAMETERS {
ULONG Size;
ULONG Flags;
ULONG NumFileTypeIDs;
GUID FileTypeID[1];
} DEVICE_DSM_NOTIFICATION_PARAMETERS, *PDEVICE_DSM_NOTIFICATION_PARAMETERS;
typedef struct _STORAGE_GET_BC_PROPERTIES_OUTPUT {
ULONG MaximumRequestsPerPeriod;
ULONG MinimumPeriod;
ULONGLONG MaximumRequestSize;
ULONG EstimatedTimePerRequest;
ULONG NumOutStandingRequests;
ULONGLONG RequestSize;
} STORAGE_GET_BC_PROPERTIES_OUTPUT, *PSTORAGE_GET_BC_PROPERTIES_OUTPUT;
typedef struct _STORAGE_ALLOCATE_BC_STREAM_INPUT {
ULONG Version;
ULONG RequestsPerPeriod;
ULONG Period;
BOOLEAN RetryFailures;
BOOLEAN Discardable;
BOOLEAN Reserved1[2];
ULONG AccessType;
ULONG AccessMode;
} STORAGE_ALLOCATE_BC_STREAM_INPUT, *PSTORAGE_ALLOCATE_BC_STREAM_INPUT;
typedef struct _STORAGE_ALLOCATE_BC_STREAM_OUTPUT {
ULONGLONG RequestSize;
ULONG NumOutStandingRequests;
} STORAGE_ALLOCATE_BC_STREAM_OUTPUT, *PSTORAGE_ALLOCATE_BC_STREAM_OUTPUT;
typedef struct _STORAGE_PRIORITY_HINT_SUPPORT {
ULONG SupportFlags;
} STORAGE_PRIORITY_HINT_SUPPORT, *PSTORAGE_PRIORITY_HINT_SUPPORT;
#if defined(_MSC_EXTENSIONS) || defined(__GNUC__)
typedef struct _STORAGE_MEDIA_SERIAL_NUMBER_DATA {
USHORT Reserved;
USHORT SerialNumberLength;
UCHAR SerialNumber[0];
} STORAGE_MEDIA_SERIAL_NUMBER_DATA, *PSTORAGE_MEDIA_SERIAL_NUMBER_DATA;
typedef struct _PERSISTENT_RESERVE_COMMAND {
ULONG Version;
ULONG Size;
__C89_NAMELESS union {
struct {
UCHAR ServiceAction:5;
UCHAR Reserved1:3;
USHORT AllocationLength;
} PR_IN;
struct {
UCHAR ServiceAction:5;
UCHAR Reserved1:3;
UCHAR Type:4;
UCHAR Scope:4;
UCHAR ParameterList[0];
} PR_OUT;
} DUMMYUNIONNAME;
} PERSISTENT_RESERVE_COMMAND, *PPERSISTENT_RESERVE_COMMAND;
#endif /* defined(_MSC_EXTENSIONS) */
typedef struct _STORAGE_HOTPLUG_INFO {
DWORD Size;
BOOLEAN MediaRemovable;
@ -1788,7 +1869,8 @@ typedef enum _STORAGE_PROPERTY_ID {
StorageMiniportProperty = 5,
StorageAccessAlignmentProperty = 6,
StorageDeviceSeekPenaltyProperty = 7,
StorageDeviceTrimProperty = 8
StorageDeviceTrimProperty = 8,
StorageDeviceWriteAggregationProperty = 9
} STORAGE_PROPERTY_ID, *PSTORAGE_PROPERTY_ID;
typedef enum _STORAGE_QUERY_TYPE {
@ -2229,6 +2311,48 @@ typedef struct _STORAGE_MINIPORT_DESCRIPTOR {
BOOLEAN TargetResetSupported;
} STORAGE_MINIPORT_DESCRIPTOR, *PSTORAGE_MINIPORT_DESCRIPTOR;
typedef enum _STORAGE_IDENTIFIER_CODE_SET {
StorageIdCodeSetReserved = 0,
StorageIdCodeSetBinary = 1,
StorageIdCodeSetAscii = 2,
StorageIdCodeSetUtf8 = 3
} STORAGE_IDENTIFIER_CODE_SET, *PSTORAGE_IDENTIFIER_CODE_SET;
typedef enum _STORAGE_IDENTIFIER_TYPE {
StorageIdTypeVendorSpecific = 0,
StorageIdTypeVendorId = 1,
StorageIdTypeEUI64 = 2,
StorageIdTypeFCPHName = 3,
StorageIdTypePortRelative = 4,
StorageIdTypeTargetPortGroup = 5,
StorageIdTypeLogicalUnitGroup = 6,
StorageIdTypeMD5LogicalUnitIdentifier = 7,
StorageIdTypeScsiNameString = 8
} STORAGE_IDENTIFIER_TYPE, *PSTORAGE_IDENTIFIER_TYPE;
#define StorageIdTypeNAA StorageIdTypeFCPHName
typedef enum _STORAGE_ID_NAA_FORMAT {
StorageIdNAAFormatIEEEExtended = 2,
StorageIdNAAFormatIEEERegistered = 3,
StorageIdNAAFormatIEEEERegisteredExtended = 5
} STORAGE_ID_NAA_FORMAT, *PSTORAGE_ID_NAA_FORMAT;
typedef enum _STORAGE_ASSOCIATION_TYPE {
StorageIdAssocDevice = 0,
StorageIdAssocPort = 1,
StorageIdAssocTarget = 2
} STORAGE_ASSOCIATION_TYPE, *PSTORAGE_ASSOCIATION_TYPE;
typedef struct _STORAGE_IDENTIFIER {
STORAGE_IDENTIFIER_CODE_SET CodeSet;
STORAGE_IDENTIFIER_TYPE Type;
USHORT IdentifierSize;
USHORT NextOffset;
STORAGE_ASSOCIATION_TYPE Association;
UCHAR Identifier[1];
} STORAGE_IDENTIFIER, *PSTORAGE_IDENTIFIER;
typedef struct _STORAGE_ACCESS_ALIGNMENT_DESCRIPTOR {
DWORD Version;
DWORD Size;
@ -2246,6 +2370,12 @@ typedef struct _DEVICE_SEEK_PENALTY_DESCRIPTOR {
BOOLEAN IncursSeekPenalty;
} DEVICE_SEEK_PENALTY_DESCRIPTOR, *PDEVICE_SEEK_PENALTY_DESCRIPTOR;
typedef struct _DEVICE_WRITE_AGGREGATION_DESCRIPTOR {
ULONG Version;
ULONG Size;
BOOLEAN BenefitsFromWriteAggregation;
} DEVICE_WRITE_AGGREGATION_DESCRIPTOR, *PDEVICE_WRITE_AGGREGATION_DESCRIPTOR;
typedef struct _DEVICE_TRIM_DESCRIPTOR {
DWORD Version;
DWORD Size;