0211e15235fa805a2cdbeea2c79c0b9ae97b809e
[reactos.git] / include / psdk / ntddstor.h
1 /*
2 * ntddstor.h
3 *
4 * Storage class IOCTL interface.
5 *
6 * This file is part of the w32api package.
7 *
8 * Contributors:
9 * Created by Casper S. Hornstrup <chorns@users.sourceforge.net>
10 *
11 * THIS SOFTWARE IS NOT COPYRIGHTED
12 *
13 * This source code is offered for use in the public domain. You may
14 * use, modify or distribute it freely.
15 *
16 * This code is distributed in the hope that it will be useful but
17 * WITHOUT ANY WARRANTY. ALL WARRANTIES, EXPRESS OR IMPLIED ARE HEREBY
18 * DISCLAIMED. This includes but is not limited to warranties of
19 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
20 *
21 */
22
23 #ifndef _NTDDSTOR_H_
24 #define _NTDDSTOR_H_
25
26 #ifdef __cplusplus
27 extern "C" {
28 #endif
29
30 #if defined(DEFINE_GUID)
31
32 DEFINE_GUID(GUID_DEVINTERFACE_DISK,
33 0x53f56307L, 0xb6bf, 0x11d0, 0x94, 0xf2, 0x00, 0xa0, 0xc9, 0x1e, 0xfb, 0x8b);
34
35 DEFINE_GUID(GUID_DEVINTERFACE_CDROM,
36 0x53f56308L, 0xb6bf, 0x11d0, 0x94, 0xf2, 0x00, 0xa0, 0xc9, 0x1e, 0xfb, 0x8b);
37
38 DEFINE_GUID(GUID_DEVINTERFACE_PARTITION,
39 0x53f5630aL, 0xb6bf, 0x11d0, 0x94, 0xf2, 0x00, 0xa0, 0xc9, 0x1e, 0xfb, 0x8b);
40
41 DEFINE_GUID(GUID_DEVINTERFACE_TAPE,
42 0x53f5630bL, 0xb6bf, 0x11d0, 0x94, 0xf2, 0x00, 0xa0, 0xc9, 0x1e, 0xfb, 0x8b);
43
44 DEFINE_GUID(GUID_DEVINTERFACE_WRITEONCEDISK,
45 0x53f5630cL, 0xb6bf, 0x11d0, 0x94, 0xf2, 0x00, 0xa0, 0xc9, 0x1e, 0xfb, 0x8b);
46
47 DEFINE_GUID(GUID_DEVINTERFACE_VOLUME,
48 0x53f5630dL, 0xb6bf, 0x11d0, 0x94, 0xf2, 0x00, 0xa0, 0xc9, 0x1e, 0xfb, 0x8b);
49
50 DEFINE_GUID(GUID_DEVINTERFACE_MEDIUMCHANGER,
51 0x53f56310L, 0xb6bf, 0x11d0, 0x94, 0xf2, 0x00, 0xa0, 0xc9, 0x1e, 0xfb, 0x8b);
52
53 DEFINE_GUID(GUID_DEVINTERFACE_FLOPPY,
54 0x53f56311L, 0xb6bf, 0x11d0, 0x94, 0xf2, 0x00, 0xa0, 0xc9, 0x1e, 0xfb, 0x8b);
55
56 DEFINE_GUID(GUID_DEVINTERFACE_CDCHANGER,
57 0x53f56312L, 0xb6bf, 0x11d0, 0x94, 0xf2, 0x00, 0xa0, 0xc9, 0x1e, 0xfb, 0x8b);
58
59 DEFINE_GUID(GUID_DEVINTERFACE_STORAGEPORT,
60 0x2accfe60L, 0xc130, 0x11d2, 0xb0, 0x82, 0x00, 0xa0, 0xc9, 0x1e, 0xfb, 0x8b);
61
62 DEFINE_GUID(GUID_DEVINTERFACE_HIDDEN_VOLUME,
63 0x7f108a28L, 0x9833, 0x4b3b, 0xb7, 0x80, 0x2c, 0x6b, 0x5f, 0xa5, 0xc0, 0x62);
64
65 #define WDI_STORAGE_PREDICT_FAILURE_DPS_GUID \
66 {0xe9f2d03aL, 0x747c, 0x41c2, {0xbb, 0x9a, 0x02, 0xc6, 0x2b, 0x6d, 0x5f, 0xcb}};
67
68 /* Aliases for storage guids */
69 #define DiskClassGuid GUID_DEVINTERFACE_DISK
70 #define CdRomClassGuid GUID_DEVINTERFACE_CDROM
71 #define PartitionClassGuid GUID_DEVINTERFACE_PARTITION
72 #define TapeClassGuid GUID_DEVINTERFACE_TAPE
73 #define WriteOnceDiskClassGuid GUID_DEVINTERFACE_WRITEONCEDISK
74 #define VolumeClassGuid GUID_DEVINTERFACE_VOLUME
75 #define MediumChangerClassGuid GUID_DEVINTERFACE_MEDIUMCHANGER
76 #define FloppyClassGuid GUID_DEVINTERFACE_FLOPPY
77 #define CdChangerClassGuid GUID_DEVINTERFACE_CDCHANGER
78 #define StoragePortClassGuid GUID_DEVINTERFACE_STORAGEPORT
79 #define HiddenVolumeClassGuid GUID_DEVINTERFACE_HIDDEN_VOLUME
80
81 #endif /* defined(DEFINE_GUID) */
82
83 #define IOCTL_STORAGE_BASE FILE_DEVICE_MASS_STORAGE
84
85 #define IOCTL_STORAGE_CHECK_VERIFY \
86 CTL_CODE(IOCTL_STORAGE_BASE, 0x0200, METHOD_BUFFERED, FILE_READ_ACCESS)
87
88 #define IOCTL_STORAGE_CHECK_VERIFY2 \
89 CTL_CODE(IOCTL_STORAGE_BASE, 0x0200, METHOD_BUFFERED, FILE_ANY_ACCESS)
90
91 #define IOCTL_STORAGE_EJECT_MEDIA \
92 CTL_CODE(IOCTL_STORAGE_BASE, 0x0202, METHOD_BUFFERED, FILE_READ_ACCESS)
93
94 #define IOCTL_STORAGE_EJECTION_CONTROL \
95 CTL_CODE(IOCTL_STORAGE_BASE, 0x0250, METHOD_BUFFERED, FILE_ANY_ACCESS)
96
97 #define IOCTL_STORAGE_FIND_NEW_DEVICES \
98 CTL_CODE(IOCTL_STORAGE_BASE, 0x0206, METHOD_BUFFERED, FILE_READ_ACCESS)
99
100 #define IOCTL_STORAGE_GET_DEVICE_NUMBER \
101 CTL_CODE(IOCTL_STORAGE_BASE, 0x0420, METHOD_BUFFERED, FILE_ANY_ACCESS)
102
103 #define IOCTL_STORAGE_GET_MEDIA_SERIAL_NUMBER \
104 CTL_CODE(IOCTL_STORAGE_BASE, 0x0304, METHOD_BUFFERED, FILE_ANY_ACCESS)
105
106 #define IOCTL_STORAGE_GET_MEDIA_TYPES \
107 CTL_CODE(IOCTL_STORAGE_BASE, 0x0300, METHOD_BUFFERED, FILE_ANY_ACCESS)
108
109 #define IOCTL_STORAGE_GET_MEDIA_TYPES_EX \
110 CTL_CODE(IOCTL_STORAGE_BASE, 0x0301, METHOD_BUFFERED, FILE_ANY_ACCESS)
111
112 #define IOCTL_STORAGE_LOAD_MEDIA \
113 CTL_CODE(IOCTL_STORAGE_BASE, 0x0203, METHOD_BUFFERED, FILE_READ_ACCESS)
114
115 #define IOCTL_STORAGE_LOAD_MEDIA2 \
116 CTL_CODE(IOCTL_STORAGE_BASE, 0x0203, METHOD_BUFFERED, FILE_ANY_ACCESS)
117
118 #define IOCTL_STORAGE_MCN_CONTROL \
119 CTL_CODE(IOCTL_STORAGE_BASE, 0x0251, METHOD_BUFFERED, FILE_ANY_ACCESS)
120
121 #define IOCTL_STORAGE_MEDIA_REMOVAL \
122 CTL_CODE(IOCTL_STORAGE_BASE, 0x0201, METHOD_BUFFERED, FILE_READ_ACCESS)
123
124 #define IOCTL_STORAGE_PREDICT_FAILURE \
125 CTL_CODE(IOCTL_STORAGE_BASE, 0x0440, METHOD_BUFFERED, FILE_ANY_ACCESS)
126
127 #define IOCTL_STORAGE_QUERY_PROPERTY \
128 CTL_CODE(IOCTL_STORAGE_BASE, 0x0500, METHOD_BUFFERED, FILE_ANY_ACCESS)
129
130 #define IOCTL_STORAGE_RELEASE \
131 CTL_CODE(IOCTL_STORAGE_BASE, 0x0205, METHOD_BUFFERED, FILE_READ_ACCESS)
132
133 #define IOCTL_STORAGE_RESERVE \
134 CTL_CODE(IOCTL_STORAGE_BASE, 0x0204, METHOD_BUFFERED, FILE_READ_ACCESS)
135
136 #define IOCTL_STORAGE_GET_HOTPLUG_INFO \
137 CTL_CODE(IOCTL_STORAGE_BASE, 0x0305, METHOD_BUFFERED, FILE_ANY_ACCESS)
138
139 #define IOCTL_STORAGE_SET_HOTPLUG_INFO \
140 CTL_CODE(IOCTL_STORAGE_BASE, 0x0306, METHOD_BUFFERED, FILE_READ_ACCESS | FILE_WRITE_ACCESS)
141
142 #define IOCTL_STORAGE_RESET_BUS \
143 CTL_CODE(IOCTL_STORAGE_BASE, 0x0400, METHOD_BUFFERED, FILE_READ_ACCESS | FILE_WRITE_ACCESS)
144
145 #define IOCTL_STORAGE_RESET_DEVICE \
146 CTL_CODE(IOCTL_STORAGE_BASE, 0x0401, METHOD_BUFFERED, FILE_READ_ACCESS | FILE_WRITE_ACCESS)
147
148 #define IOCTL_STORAGE_BREAK_RESERVATION \
149 CTL_CODE(IOCTL_STORAGE_BASE, 0x0405, METHOD_BUFFERED, FILE_READ_ACCESS)
150
151 #define IOCTL_STORAGE_PERSISTENT_RESERVE_IN \
152 CTL_CODE(IOCTL_STORAGE_BASE, 0x0406, METHOD_BUFFERED, FILE_READ_ACCESS)
153
154 #define IOCTL_STORAGE_PERSISTENT_RESERVE_OUT \
155 CTL_CODE(IOCTL_STORAGE_BASE, 0x0407, METHOD_BUFFERED, FILE_READ_ACCESS | FILE_WRITE_ACCESS)
156
157 #define IOCTL_STORAGE_READ_CAPACITY \
158 CTL_CODE(IOCTL_STORAGE_BASE, 0x0450, METHOD_BUFFERED, FILE_READ_ACCESS)
159
160 #define IOCTL_STORAGE_MANAGE_DATA_SET_ATTRIBUTES \
161 CTL_CODE(IOCTL_STORAGE_BASE, 0x0501, METHOD_BUFFERED, FILE_WRITE_ACCESS)
162
163 #define IOCTL_STORAGE_GET_BC_PROPERTIES \
164 CTL_CODE(IOCTL_STORAGE_BASE, 0x0600, METHOD_BUFFERED, FILE_READ_ACCESS)
165
166 #define IOCTL_STORAGE_ALLOCATE_BC_STREAM \
167 CTL_CODE(IOCTL_STORAGE_BASE, 0x0601, METHOD_BUFFERED, FILE_READ_ACCESS | FILE_WRITE_ACCESS)
168
169 #define IOCTL_STORAGE_FREE_BC_STREAM \
170 CTL_CODE(IOCTL_STORAGE_BASE, 0x0602, METHOD_BUFFERED, FILE_READ_ACCESS | FILE_WRITE_ACCESS)
171
172 #define IOCTL_STORAGE_CHECK_PRIORITY_HINT_SUPPORT \
173 CTL_CODE(IOCTL_STORAGE_BASE, 0x0620, METHOD_BUFFERED, FILE_ANY_ACCESS)
174
175 #define OBSOLETE_IOCTL_STORAGE_RESET_BUS \
176 CTL_CODE(IOCTL_STORAGE_BASE, 0x0400, METHOD_BUFFERED, FILE_READ_ACCESS | FILE_WRITE_ACCESS)
177
178 #define OBSOLETE_IOCTL_STORAGE_RESET_DEVICE \
179 CTL_CODE(IOCTL_STORAGE_BASE, 0x0401, METHOD_BUFFERED, FILE_READ_ACCESS | FILE_WRITE_ACCESS)
180
181 #define RECOVERED_WRITES_VALID 0x00000001
182 #define UNRECOVERED_WRITES_VALID 0x00000002
183 #define RECOVERED_READS_VALID 0x00000004
184 #define UNRECOVERED_READS_VALID 0x00000008
185 #define WRITE_COMPRESSION_INFO_VALID 0x00000010
186 #define READ_COMPRESSION_INFO_VALID 0x00000020
187
188 #define TAPE_RETURN_STATISTICS 0L
189 #define TAPE_RETURN_ENV_INFO 1L
190 #define TAPE_RESET_STATISTICS 2L
191
192 /* DEVICE_MEDIA_INFO.DeviceSpecific.DiskInfo.MediaCharacteristics constants */
193 #define MEDIA_ERASEABLE 0x00000001
194 #define MEDIA_WRITE_ONCE 0x00000002
195 #define MEDIA_READ_ONLY 0x00000004
196 #define MEDIA_READ_WRITE 0x00000008
197 #define MEDIA_WRITE_PROTECTED 0x00000100
198 #define MEDIA_CURRENTLY_MOUNTED 0x80000000
199
200 #define StorageIdTypeNAA StorageIdTypeFCPHName
201
202 #define DeviceDsmActionFlag_NonDestructive 0x80000000
203
204 #define IsDsmActionNonDestructive(_Action) ((BOOLEAN)((_Action & DeviceDsmActionFlag_NonDestructive) != 0))
205
206 #define DeviceDsmAction_None 0
207 #define DeviceDsmAction_Trim 1
208 #define DeviceDsmAction_Notification (2 | DeviceDsmActionFlag_NonDestructive)
209
210 #define DEVICE_DSM_FLAG_ENTIRE_DATA_SET_RANGE 0x00000001
211
212 #define DEVICE_DSM_NOTIFY_FLAG_BEGIN 0x00000001
213 #define DEVICE_DSM_NOTIFY_FLAG_END 0x00000002
214
215 #define IOCTL_STORAGE_BC_VERSION 1
216
217 #define STORAGE_PRIORITY_HINT_SUPPORTED 0x0001
218
219 typedef struct _STORAGE_HOTPLUG_INFO {
220 ULONG Size;
221 BOOLEAN MediaRemovable;
222 BOOLEAN MediaHotplug;
223 BOOLEAN DeviceHotplug;
224 BOOLEAN WriteCacheEnableOverride;
225 } STORAGE_HOTPLUG_INFO, *PSTORAGE_HOTPLUG_INFO;
226
227 typedef struct _STORAGE_DEVICE_NUMBER {
228 DEVICE_TYPE DeviceType;
229 ULONG DeviceNumber;
230 ULONG PartitionNumber;
231 } STORAGE_DEVICE_NUMBER, *PSTORAGE_DEVICE_NUMBER;
232
233 typedef struct _STORAGE_BUS_RESET_REQUEST {
234 UCHAR PathId;
235 } STORAGE_BUS_RESET_REQUEST, *PSTORAGE_BUS_RESET_REQUEST;
236
237 typedef struct _STORAGE_BREAK_RESERVATION_REQUEST {
238 ULONG Length;
239 UCHAR _unused;
240 UCHAR PathId;
241 UCHAR TargetId;
242 UCHAR Lun;
243 } STORAGE_BREAK_RESERVATION_REQUEST, *PSTORAGE_BREAK_RESERVATION_REQUEST;
244
245 typedef struct _PREVENT_MEDIA_REMOVAL {
246 BOOLEAN PreventMediaRemoval;
247 } PREVENT_MEDIA_REMOVAL, *PPREVENT_MEDIA_REMOVAL;
248
249 typedef struct _CLASS_MEDIA_CHANGE_CONTEXT {
250 ULONG MediaChangeCount;
251 ULONG NewState;
252 } CLASS_MEDIA_CHANGE_CONTEXT, *PCLASS_MEDIA_CHANGE_CONTEXT;
253
254 typedef struct _TAPE_STATISTICS {
255 ULONG Version;
256 ULONG Flags;
257 LARGE_INTEGER RecoveredWrites;
258 LARGE_INTEGER UnrecoveredWrites;
259 LARGE_INTEGER RecoveredReads;
260 LARGE_INTEGER UnrecoveredReads;
261 UCHAR CompressionRatioReads;
262 UCHAR CompressionRatioWrites;
263 } TAPE_STATISTICS, *PTAPE_STATISTICS;
264
265 typedef struct _TAPE_GET_STATISTICS {
266 ULONG Operation;
267 } TAPE_GET_STATISTICS, *PTAPE_GET_STATISTICS;
268
269 typedef enum _STORAGE_MEDIA_TYPE {
270 DDS_4mm = 0x20,
271 MiniQic,
272 Travan,
273 QIC,
274 MP_8mm,
275 AME_8mm,
276 AIT1_8mm,
277 DLT,
278 NCTP,
279 IBM_3480,
280 IBM_3490E,
281 IBM_Magstar_3590,
282 IBM_Magstar_MP,
283 STK_DATA_D3,
284 SONY_DTF,
285 DV_6mm,
286 DMI,
287 SONY_D2,
288 CLEANER_CARTRIDGE,
289 CD_ROM,
290 CD_R,
291 CD_RW,
292 DVD_ROM,
293 DVD_R,
294 DVD_RW,
295 MO_3_RW,
296 MO_5_WO,
297 MO_5_RW,
298 MO_5_LIMDOW,
299 PC_5_WO,
300 PC_5_RW,
301 PD_5_RW,
302 ABL_5_WO,
303 PINNACLE_APEX_5_RW,
304 SONY_12_WO,
305 PHILIPS_12_WO,
306 HITACHI_12_WO,
307 CYGNET_12_WO,
308 KODAK_14_WO,
309 MO_NFR_525,
310 NIKON_12_RW,
311 IOMEGA_ZIP,
312 IOMEGA_JAZ,
313 SYQUEST_EZ135,
314 SYQUEST_EZFLYER,
315 SYQUEST_SYJET,
316 AVATAR_F2,
317 MP2_8mm,
318 DST_S,
319 DST_M,
320 DST_L,
321 VXATape_1,
322 VXATape_2,
323 #if (NTDDI_VERSION < NTDDI_WINXP)
324 STK_EAGLE,
325 #else
326 STK_9840,
327 #endif
328 LTO_Ultrium,
329 LTO_Accelis,
330 DVD_RAM,
331 AIT_8mm,
332 ADR_1,
333 ADR_2,
334 STK_9940,
335 SAIT,
336 VXATape
337 } STORAGE_MEDIA_TYPE, *PSTORAGE_MEDIA_TYPE;
338
339 typedef enum _STORAGE_BUS_TYPE {
340 BusTypeUnknown = 0x00,
341 BusTypeScsi,
342 BusTypeAtapi,
343 BusTypeAta,
344 BusType1394,
345 BusTypeSsa,
346 BusTypeFibre,
347 BusTypeUsb,
348 BusTypeRAID,
349 BusTypeiScsi,
350 BusTypeSas,
351 BusTypeSata,
352 BusTypeSd,
353 BusTypeMmc,
354 BusTypeVirtual,
355 BusTypeFileBackedVirtual,
356 BusTypeMax,
357 BusTypeMaxReserved = 0x7F
358 } STORAGE_BUS_TYPE, *PSTORAGE_BUS_TYPE;
359
360 typedef struct _DEVICE_MEDIA_INFO {
361 union {
362 struct {
363 LARGE_INTEGER Cylinders;
364 STORAGE_MEDIA_TYPE MediaType;
365 ULONG TracksPerCylinder;
366 ULONG SectorsPerTrack;
367 ULONG BytesPerSector;
368 ULONG NumberMediaSides;
369 ULONG MediaCharacteristics;
370 } DiskInfo;
371 struct {
372 LARGE_INTEGER Cylinders;
373 STORAGE_MEDIA_TYPE MediaType;
374 ULONG TracksPerCylinder;
375 ULONG SectorsPerTrack;
376 ULONG BytesPerSector;
377 ULONG NumberMediaSides;
378 ULONG MediaCharacteristics;
379 } RemovableDiskInfo;
380 struct {
381 STORAGE_MEDIA_TYPE MediaType;
382 ULONG MediaCharacteristics;
383 ULONG CurrentBlockSize;
384 STORAGE_BUS_TYPE BusType;
385 union {
386 struct {
387 UCHAR MediumType;
388 UCHAR DensityCode;
389 } ScsiInformation;
390 } BusSpecificData;
391 } TapeInfo;
392 } DeviceSpecific;
393 } DEVICE_MEDIA_INFO, *PDEVICE_MEDIA_INFO;
394
395 typedef struct _GET_MEDIA_TYPES {
396 ULONG DeviceType;
397 ULONG MediaInfoCount;
398 DEVICE_MEDIA_INFO MediaInfo[1];
399 } GET_MEDIA_TYPES, *PGET_MEDIA_TYPES;
400
401 typedef struct _STORAGE_PREDICT_FAILURE {
402 ULONG PredictFailure;
403 UCHAR VendorSpecific[512];
404 } STORAGE_PREDICT_FAILURE, *PSTORAGE_PREDICT_FAILURE;
405
406 typedef enum _STORAGE_QUERY_TYPE {
407 PropertyStandardQuery = 0,
408 PropertyExistsQuery,
409 PropertyMaskQuery,
410 PropertyQueryMaxDefined
411 } STORAGE_QUERY_TYPE, *PSTORAGE_QUERY_TYPE;
412
413 typedef enum _STORAGE_PROPERTY_ID {
414 StorageDeviceProperty = 0,
415 StorageAdapterProperty,
416 StorageDeviceIdProperty,
417 StorageDeviceUniqueIdProperty,
418 StorageDeviceWriteCacheProperty,
419 StorageMiniportProperty,
420 StorageAccessAlignmentProperty,
421 StorageDeviceSeekPenaltyProperty,
422 StorageDeviceTrimProperty,
423 StorageDeviceWriteAggregationProperty
424 } STORAGE_PROPERTY_ID, *PSTORAGE_PROPERTY_ID;
425
426 typedef struct _STORAGE_PROPERTY_QUERY {
427 STORAGE_PROPERTY_ID PropertyId;
428 STORAGE_QUERY_TYPE QueryType;
429 UCHAR AdditionalParameters[1];
430 } STORAGE_PROPERTY_QUERY, *PSTORAGE_PROPERTY_QUERY;
431
432 typedef struct _STORAGE_DESCRIPTOR_HEADER {
433 ULONG Version;
434 ULONG Size;
435 } STORAGE_DESCRIPTOR_HEADER, *PSTORAGE_DESCRIPTOR_HEADER;
436
437 typedef struct _STORAGE_DEVICE_DESCRIPTOR {
438 ULONG Version;
439 ULONG Size;
440 UCHAR DeviceType;
441 UCHAR DeviceTypeModifier;
442 BOOLEAN RemovableMedia;
443 BOOLEAN CommandQueueing;
444 ULONG VendorIdOffset;
445 ULONG ProductIdOffset;
446 ULONG ProductRevisionOffset;
447 ULONG SerialNumberOffset;
448 STORAGE_BUS_TYPE BusType;
449 ULONG RawPropertiesLength;
450 UCHAR RawDeviceProperties[1];
451 } STORAGE_DEVICE_DESCRIPTOR, *PSTORAGE_DEVICE_DESCRIPTOR;
452
453 typedef struct _STORAGE_ADAPTER_DESCRIPTOR {
454 ULONG Version;
455 ULONG Size;
456 ULONG MaximumTransferLength;
457 ULONG MaximumPhysicalPages;
458 ULONG AlignmentMask;
459 BOOLEAN AdapterUsesPio;
460 BOOLEAN AdapterScansDown;
461 BOOLEAN CommandQueueing;
462 BOOLEAN AcceleratedTransfer;
463 #if (NTDDI_VERSION < NTDDI_WINXP)
464 BOOLEAN BusType;
465 #else
466 UCHAR BusType;
467 #endif
468 USHORT BusMajorVersion;
469 USHORT BusMinorVersion;
470 } STORAGE_ADAPTER_DESCRIPTOR, *PSTORAGE_ADAPTER_DESCRIPTOR;
471
472 typedef struct _STORAGE_ACCESS_ALIGNMENT_DESCRIPTOR {
473 ULONG Version;
474 ULONG Size;
475 ULONG BytesPerCacheLine;
476 ULONG BytesOffsetForCacheAlignment;
477 ULONG BytesPerLogicalSector;
478 ULONG BytesPerPhysicalSector;
479 ULONG BytesOffsetForSectorAlignment;
480 } STORAGE_ACCESS_ALIGNMENT_DESCRIPTOR, *PSTORAGE_ACCESS_ALIGNMENT_DESCRIPTOR;
481
482 typedef enum _STORAGE_PORT_CODE_SET {
483 StoragePortCodeSetReserved = 0,
484 StoragePortCodeSetStorport = 1,
485 StoragePortCodeSetSCSIport = 2
486 } STORAGE_PORT_CODE_SET, *PSTORAGE_PORT_CODE_SET;
487
488 typedef struct _STORAGE_MINIPORT_DESCRIPTOR {
489 ULONG Version;
490 ULONG Size;
491 STORAGE_PORT_CODE_SET Portdriver;
492 BOOLEAN LUNResetSupported;
493 BOOLEAN TargetResetSupported;
494 } STORAGE_MINIPORT_DESCRIPTOR, *PSTORAGE_MINIPORT_DESCRIPTOR;
495
496 typedef enum _STORAGE_IDENTIFIER_CODE_SET {
497 StorageIdCodeSetReserved = 0,
498 StorageIdCodeSetBinary = 1,
499 StorageIdCodeSetAscii = 2,
500 StorageIdCodeSetUtf8 = 3
501 } STORAGE_IDENTIFIER_CODE_SET, *PSTORAGE_IDENTIFIER_CODE_SET;
502
503 typedef enum _STORAGE_IDENTIFIER_TYPE {
504 StorageIdTypeVendorSpecific = 0,
505 StorageIdTypeVendorId = 1,
506 StorageIdTypeEUI64 = 2,
507 StorageIdTypeFCPHName = 3,
508 StorageIdTypePortRelative = 4,
509 StorageIdTypeTargetPortGroup = 5,
510 StorageIdTypeLogicalUnitGroup = 6,
511 StorageIdTypeMD5LogicalUnitIdentifier = 7,
512 StorageIdTypeScsiNameString = 8
513 } STORAGE_IDENTIFIER_TYPE, *PSTORAGE_IDENTIFIER_TYPE;
514
515 typedef enum _STORAGE_ID_NAA_FORMAT {
516 StorageIdNAAFormatIEEEExtended = 2,
517 StorageIdNAAFormatIEEERegistered = 3,
518 StorageIdNAAFormatIEEEERegisteredExtended = 5
519 } STORAGE_ID_NAA_FORMAT, *PSTORAGE_ID_NAA_FORMAT;
520
521 typedef enum _STORAGE_ASSOCIATION_TYPE {
522 StorageIdAssocDevice = 0,
523 StorageIdAssocPort = 1,
524 StorageIdAssocTarget = 2
525 } STORAGE_ASSOCIATION_TYPE, *PSTORAGE_ASSOCIATION_TYPE;
526
527 typedef struct _STORAGE_IDENTIFIER {
528 STORAGE_IDENTIFIER_CODE_SET CodeSet;
529 STORAGE_IDENTIFIER_TYPE Type;
530 USHORT IdentifierSize;
531 USHORT NextOffset;
532 STORAGE_ASSOCIATION_TYPE Association;
533 UCHAR Identifier[1];
534 } STORAGE_IDENTIFIER, *PSTORAGE_IDENTIFIER;
535
536 typedef struct _STORAGE_DEVICE_ID_DESCRIPTOR {
537 ULONG Version;
538 ULONG Size;
539 ULONG NumberOfIdentifiers;
540 UCHAR Identifiers[1];
541 } STORAGE_DEVICE_ID_DESCRIPTOR, *PSTORAGE_DEVICE_ID_DESCRIPTOR;
542
543 typedef struct _DEVICE_SEEK_PENALTY_DESCRIPTOR {
544 ULONG Version;
545 ULONG Size;
546 BOOLEAN IncursSeekPenalty;
547 } DEVICE_SEEK_PENALTY_DESCRIPTOR, *PDEVICE_SEEK_PENALTY_DESCRIPTOR;
548
549 typedef struct _DEVICE_WRITE_AGGREGATION_DESCRIPTOR {
550 ULONG Version;
551 ULONG Size;
552 BOOLEAN BenefitsFromWriteAggregation;
553 } DEVICE_WRITE_AGGREGATION_DESCRIPTOR, *PDEVICE_WRITE_AGGREGATION_DESCRIPTOR;
554
555 typedef struct _DEVICE_TRIM_DESCRIPTOR {
556 ULONG Version;
557 ULONG Size;
558 BOOLEAN TrimEnabled;
559 } DEVICE_TRIM_DESCRIPTOR, *PDEVICE_TRIM_DESCRIPTOR;
560
561 typedef ULONG DEVICE_DATA_MANAGEMENT_SET_ACTION;
562
563 typedef struct _DEVICE_DATA_SET_RANGE {
564 LONGLONG StartingOffset;
565 ULONGLONG LengthInBytes;
566 } DEVICE_DATA_SET_RANGE, *PDEVICE_DATA_SET_RANGE;
567
568 typedef struct _DEVICE_MANAGE_DATA_SET_ATTRIBUTES {
569 ULONG Size;
570 DEVICE_DATA_MANAGEMENT_SET_ACTION Action;
571 ULONG Flags;
572 ULONG ParameterBlockOffset;
573 ULONG ParameterBlockLength;
574 ULONG DataSetRangesOffset;
575 ULONG DataSetRangesLength;
576 } DEVICE_MANAGE_DATA_SET_ATTRIBUTES, *PDEVICE_MANAGE_DATA_SET_ATTRIBUTES;
577
578 typedef struct _DEVICE_DSM_NOTIFICATION_PARAMETERS {
579 ULONG Size;
580 ULONG Flags;
581 ULONG NumFileTypeIDs;
582 GUID FileTypeID[1];
583 } DEVICE_DSM_NOTIFICATION_PARAMETERS, *PDEVICE_DSM_NOTIFICATION_PARAMETERS;
584
585 typedef struct _STORAGE_GET_BC_PROPERTIES_OUTPUT {
586 ULONG MaximumRequestsPerPeriod;
587 ULONG MinimumPeriod;
588 ULONGLONG MaximumRequestSize;
589 ULONG EstimatedTimePerRequest;
590 ULONG NumOutStandingRequests;
591 ULONGLONG RequestSize;
592 } STORAGE_GET_BC_PROPERTIES_OUTPUT, *PSTORAGE_GET_BC_PROPERTIES_OUTPUT;
593
594 typedef struct _STORAGE_ALLOCATE_BC_STREAM_INPUT {
595 ULONG Version;
596 ULONG RequestsPerPeriod;
597 ULONG Period;
598 BOOLEAN RetryFailures;
599 BOOLEAN Discardable;
600 BOOLEAN Reserved1[2];
601 ULONG AccessType;
602 ULONG AccessMode;
603 } STORAGE_ALLOCATE_BC_STREAM_INPUT, *PSTORAGE_ALLOCATE_BC_STREAM_INPUT;
604
605 typedef struct _STORAGE_ALLOCATE_BC_STREAM_OUTPUT {
606 ULONGLONG RequestSize;
607 ULONG NumOutStandingRequests;
608 } STORAGE_ALLOCATE_BC_STREAM_OUTPUT, *PSTORAGE_ALLOCATE_BC_STREAM_OUTPUT;
609
610 typedef struct _STORAGE_PRIORITY_HINT_SUPPORT {
611 ULONG SupportFlags;
612 } STORAGE_PRIORITY_HINT_SUPPORT, *PSTORAGE_PRIORITY_HINT_SUPPORT;
613
614 #if defined(_MSC_EXTENSIONS)
615
616 typedef struct _STORAGE_MEDIA_SERIAL_NUMBER_DATA {
617 USHORT Reserved;
618 USHORT SerialNumberLength;
619 UCHAR SerialNumber[0];
620 } STORAGE_MEDIA_SERIAL_NUMBER_DATA, *PSTORAGE_MEDIA_SERIAL_NUMBER_DATA;
621
622 typedef struct _PERSISTENT_RESERVE_COMMAND {
623 ULONG Version;
624 ULONG Size;
625 _ANONYMOUS_UNION union {
626 struct {
627 UCHAR ServiceAction:5;
628 UCHAR Reserved1:3;
629 USHORT AllocationLength;
630 } PR_IN;
631 struct {
632 UCHAR ServiceAction:5;
633 UCHAR Reserved1:3;
634 UCHAR Type:4;
635 UCHAR Scope:4;
636 UCHAR ParameterList[0];
637 } PR_OUT;
638 } DUMMYUNIONNAME;
639 } PERSISTENT_RESERVE_COMMAND, *PPERSISTENT_RESERVE_COMMAND;
640
641 #endif /* defined(_MSC_EXTENSIONS) */
642
643 typedef struct _STORAGE_READ_CAPACITY {
644 ULONG Version;
645 ULONG Size;
646 ULONG BlockLength;
647 LARGE_INTEGER NumberOfBlocks;
648 LARGE_INTEGER DiskLength;
649 } STORAGE_READ_CAPACITY, *PSTORAGE_READ_CAPACITY;
650
651 typedef enum _WRITE_CACHE_TYPE {
652 WriteCacheTypeUnknown,
653 WriteCacheTypeNone,
654 WriteCacheTypeWriteBack,
655 WriteCacheTypeWriteThrough
656 } WRITE_CACHE_TYPE;
657
658 typedef enum _WRITE_CACHE_ENABLE {
659 WriteCacheEnableUnknown,
660 WriteCacheDisabled,
661 WriteCacheEnabled
662 } WRITE_CACHE_ENABLE;
663
664 typedef enum _WRITE_CACHE_CHANGE {
665 WriteCacheChangeUnknown,
666 WriteCacheNotChangeable,
667 WriteCacheChangeable
668 } WRITE_CACHE_CHANGE;
669
670 typedef enum _WRITE_THROUGH {
671 WriteThroughUnknown,
672 WriteThroughNotSupported,
673 WriteThroughSupported
674 } WRITE_THROUGH;
675
676 typedef struct _STORAGE_WRITE_CACHE_PROPERTY {
677 ULONG Version;
678 ULONG Size;
679 WRITE_CACHE_TYPE WriteCacheType;
680 WRITE_CACHE_ENABLE WriteCacheEnabled;
681 WRITE_CACHE_CHANGE WriteCacheChangeable;
682 WRITE_THROUGH WriteThroughSupported;
683 BOOLEAN FlushCacheSupported;
684 BOOLEAN UserDefinedPowerProtection;
685 BOOLEAN NVCacheEnabled;
686 } STORAGE_WRITE_CACHE_PROPERTY, *PSTORAGE_WRITE_CACHE_PROPERTY;
687
688 #ifdef __cplusplus
689 }
690 #endif
691
692 #endif /* _NTDDSTOR_H_ */