[PSDK]
[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 #ifndef _WINIOCTL_H
246 typedef struct _PREVENT_MEDIA_REMOVAL {
247 BOOLEAN PreventMediaRemoval;
248 } PREVENT_MEDIA_REMOVAL, *PPREVENT_MEDIA_REMOVAL;
249 #endif
250
251 typedef struct _CLASS_MEDIA_CHANGE_CONTEXT {
252 ULONG MediaChangeCount;
253 ULONG NewState;
254 } CLASS_MEDIA_CHANGE_CONTEXT, *PCLASS_MEDIA_CHANGE_CONTEXT;
255
256 typedef struct _TAPE_STATISTICS {
257 ULONG Version;
258 ULONG Flags;
259 LARGE_INTEGER RecoveredWrites;
260 LARGE_INTEGER UnrecoveredWrites;
261 LARGE_INTEGER RecoveredReads;
262 LARGE_INTEGER UnrecoveredReads;
263 UCHAR CompressionRatioReads;
264 UCHAR CompressionRatioWrites;
265 } TAPE_STATISTICS, *PTAPE_STATISTICS;
266
267 typedef struct _TAPE_GET_STATISTICS {
268 ULONG Operation;
269 } TAPE_GET_STATISTICS, *PTAPE_GET_STATISTICS;
270
271 typedef enum _STORAGE_MEDIA_TYPE {
272 DDS_4mm = 0x20,
273 MiniQic,
274 Travan,
275 QIC,
276 MP_8mm,
277 AME_8mm,
278 AIT1_8mm,
279 DLT,
280 NCTP,
281 IBM_3480,
282 IBM_3490E,
283 IBM_Magstar_3590,
284 IBM_Magstar_MP,
285 STK_DATA_D3,
286 SONY_DTF,
287 DV_6mm,
288 DMI,
289 SONY_D2,
290 CLEANER_CARTRIDGE,
291 CD_ROM,
292 CD_R,
293 CD_RW,
294 DVD_ROM,
295 DVD_R,
296 DVD_RW,
297 MO_3_RW,
298 MO_5_WO,
299 MO_5_RW,
300 MO_5_LIMDOW,
301 PC_5_WO,
302 PC_5_RW,
303 PD_5_RW,
304 ABL_5_WO,
305 PINNACLE_APEX_5_RW,
306 SONY_12_WO,
307 PHILIPS_12_WO,
308 HITACHI_12_WO,
309 CYGNET_12_WO,
310 KODAK_14_WO,
311 MO_NFR_525,
312 NIKON_12_RW,
313 IOMEGA_ZIP,
314 IOMEGA_JAZ,
315 SYQUEST_EZ135,
316 SYQUEST_EZFLYER,
317 SYQUEST_SYJET,
318 AVATAR_F2,
319 MP2_8mm,
320 DST_S,
321 DST_M,
322 DST_L,
323 VXATape_1,
324 VXATape_2,
325 #if (NTDDI_VERSION < NTDDI_WINXP)
326 STK_EAGLE,
327 #else
328 STK_9840,
329 #endif
330 LTO_Ultrium,
331 LTO_Accelis,
332 DVD_RAM,
333 AIT_8mm,
334 ADR_1,
335 ADR_2,
336 STK_9940,
337 SAIT,
338 VXATape
339 } STORAGE_MEDIA_TYPE, *PSTORAGE_MEDIA_TYPE;
340
341 typedef enum _STORAGE_BUS_TYPE {
342 BusTypeUnknown = 0x00,
343 BusTypeScsi,
344 BusTypeAtapi,
345 BusTypeAta,
346 BusType1394,
347 BusTypeSsa,
348 BusTypeFibre,
349 BusTypeUsb,
350 BusTypeRAID,
351 BusTypeiScsi,
352 BusTypeSas,
353 BusTypeSata,
354 BusTypeSd,
355 BusTypeMmc,
356 BusTypeVirtual,
357 BusTypeFileBackedVirtual,
358 BusTypeMax,
359 BusTypeMaxReserved = 0x7F
360 } STORAGE_BUS_TYPE, *PSTORAGE_BUS_TYPE;
361
362 typedef struct _DEVICE_MEDIA_INFO {
363 union {
364 struct {
365 LARGE_INTEGER Cylinders;
366 STORAGE_MEDIA_TYPE MediaType;
367 ULONG TracksPerCylinder;
368 ULONG SectorsPerTrack;
369 ULONG BytesPerSector;
370 ULONG NumberMediaSides;
371 ULONG MediaCharacteristics;
372 } DiskInfo;
373 struct {
374 LARGE_INTEGER Cylinders;
375 STORAGE_MEDIA_TYPE MediaType;
376 ULONG TracksPerCylinder;
377 ULONG SectorsPerTrack;
378 ULONG BytesPerSector;
379 ULONG NumberMediaSides;
380 ULONG MediaCharacteristics;
381 } RemovableDiskInfo;
382 struct {
383 STORAGE_MEDIA_TYPE MediaType;
384 ULONG MediaCharacteristics;
385 ULONG CurrentBlockSize;
386 STORAGE_BUS_TYPE BusType;
387 union {
388 struct {
389 UCHAR MediumType;
390 UCHAR DensityCode;
391 } ScsiInformation;
392 } BusSpecificData;
393 } TapeInfo;
394 } DeviceSpecific;
395 } DEVICE_MEDIA_INFO, *PDEVICE_MEDIA_INFO;
396
397 typedef struct _GET_MEDIA_TYPES {
398 ULONG DeviceType;
399 ULONG MediaInfoCount;
400 DEVICE_MEDIA_INFO MediaInfo[1];
401 } GET_MEDIA_TYPES, *PGET_MEDIA_TYPES;
402
403 typedef struct _STORAGE_PREDICT_FAILURE {
404 ULONG PredictFailure;
405 UCHAR VendorSpecific[512];
406 } STORAGE_PREDICT_FAILURE, *PSTORAGE_PREDICT_FAILURE;
407
408 typedef enum _STORAGE_QUERY_TYPE {
409 PropertyStandardQuery = 0,
410 PropertyExistsQuery,
411 PropertyMaskQuery,
412 PropertyQueryMaxDefined
413 } STORAGE_QUERY_TYPE, *PSTORAGE_QUERY_TYPE;
414
415 typedef enum _STORAGE_PROPERTY_ID {
416 StorageDeviceProperty = 0,
417 StorageAdapterProperty,
418 StorageDeviceIdProperty,
419 StorageDeviceUniqueIdProperty,
420 StorageDeviceWriteCacheProperty,
421 StorageMiniportProperty,
422 StorageAccessAlignmentProperty,
423 StorageDeviceSeekPenaltyProperty,
424 StorageDeviceTrimProperty,
425 StorageDeviceWriteAggregationProperty
426 } STORAGE_PROPERTY_ID, *PSTORAGE_PROPERTY_ID;
427
428 typedef struct _STORAGE_PROPERTY_QUERY {
429 STORAGE_PROPERTY_ID PropertyId;
430 STORAGE_QUERY_TYPE QueryType;
431 UCHAR AdditionalParameters[1];
432 } STORAGE_PROPERTY_QUERY, *PSTORAGE_PROPERTY_QUERY;
433
434 typedef struct _STORAGE_DESCRIPTOR_HEADER {
435 ULONG Version;
436 ULONG Size;
437 } STORAGE_DESCRIPTOR_HEADER, *PSTORAGE_DESCRIPTOR_HEADER;
438
439 typedef struct _STORAGE_DEVICE_DESCRIPTOR {
440 ULONG Version;
441 ULONG Size;
442 UCHAR DeviceType;
443 UCHAR DeviceTypeModifier;
444 BOOLEAN RemovableMedia;
445 BOOLEAN CommandQueueing;
446 ULONG VendorIdOffset;
447 ULONG ProductIdOffset;
448 ULONG ProductRevisionOffset;
449 ULONG SerialNumberOffset;
450 STORAGE_BUS_TYPE BusType;
451 ULONG RawPropertiesLength;
452 UCHAR RawDeviceProperties[1];
453 } STORAGE_DEVICE_DESCRIPTOR, *PSTORAGE_DEVICE_DESCRIPTOR;
454
455 typedef struct _STORAGE_ADAPTER_DESCRIPTOR {
456 ULONG Version;
457 ULONG Size;
458 ULONG MaximumTransferLength;
459 ULONG MaximumPhysicalPages;
460 ULONG AlignmentMask;
461 BOOLEAN AdapterUsesPio;
462 BOOLEAN AdapterScansDown;
463 BOOLEAN CommandQueueing;
464 BOOLEAN AcceleratedTransfer;
465 #if (NTDDI_VERSION < NTDDI_WINXP)
466 BOOLEAN BusType;
467 #else
468 UCHAR BusType;
469 #endif
470 USHORT BusMajorVersion;
471 USHORT BusMinorVersion;
472 } STORAGE_ADAPTER_DESCRIPTOR, *PSTORAGE_ADAPTER_DESCRIPTOR;
473
474 typedef struct _STORAGE_ACCESS_ALIGNMENT_DESCRIPTOR {
475 ULONG Version;
476 ULONG Size;
477 ULONG BytesPerCacheLine;
478 ULONG BytesOffsetForCacheAlignment;
479 ULONG BytesPerLogicalSector;
480 ULONG BytesPerPhysicalSector;
481 ULONG BytesOffsetForSectorAlignment;
482 } STORAGE_ACCESS_ALIGNMENT_DESCRIPTOR, *PSTORAGE_ACCESS_ALIGNMENT_DESCRIPTOR;
483
484 typedef enum _STORAGE_PORT_CODE_SET {
485 StoragePortCodeSetReserved = 0,
486 StoragePortCodeSetStorport = 1,
487 StoragePortCodeSetSCSIport = 2
488 } STORAGE_PORT_CODE_SET, *PSTORAGE_PORT_CODE_SET;
489
490 typedef struct _STORAGE_MINIPORT_DESCRIPTOR {
491 ULONG Version;
492 ULONG Size;
493 STORAGE_PORT_CODE_SET Portdriver;
494 BOOLEAN LUNResetSupported;
495 BOOLEAN TargetResetSupported;
496 } STORAGE_MINIPORT_DESCRIPTOR, *PSTORAGE_MINIPORT_DESCRIPTOR;
497
498 typedef enum _STORAGE_IDENTIFIER_CODE_SET {
499 StorageIdCodeSetReserved = 0,
500 StorageIdCodeSetBinary = 1,
501 StorageIdCodeSetAscii = 2,
502 StorageIdCodeSetUtf8 = 3
503 } STORAGE_IDENTIFIER_CODE_SET, *PSTORAGE_IDENTIFIER_CODE_SET;
504
505 typedef enum _STORAGE_IDENTIFIER_TYPE {
506 StorageIdTypeVendorSpecific = 0,
507 StorageIdTypeVendorId = 1,
508 StorageIdTypeEUI64 = 2,
509 StorageIdTypeFCPHName = 3,
510 StorageIdTypePortRelative = 4,
511 StorageIdTypeTargetPortGroup = 5,
512 StorageIdTypeLogicalUnitGroup = 6,
513 StorageIdTypeMD5LogicalUnitIdentifier = 7,
514 StorageIdTypeScsiNameString = 8
515 } STORAGE_IDENTIFIER_TYPE, *PSTORAGE_IDENTIFIER_TYPE;
516
517 typedef enum _STORAGE_ID_NAA_FORMAT {
518 StorageIdNAAFormatIEEEExtended = 2,
519 StorageIdNAAFormatIEEERegistered = 3,
520 StorageIdNAAFormatIEEEERegisteredExtended = 5
521 } STORAGE_ID_NAA_FORMAT, *PSTORAGE_ID_NAA_FORMAT;
522
523 typedef enum _STORAGE_ASSOCIATION_TYPE {
524 StorageIdAssocDevice = 0,
525 StorageIdAssocPort = 1,
526 StorageIdAssocTarget = 2
527 } STORAGE_ASSOCIATION_TYPE, *PSTORAGE_ASSOCIATION_TYPE;
528
529 typedef struct _STORAGE_IDENTIFIER {
530 STORAGE_IDENTIFIER_CODE_SET CodeSet;
531 STORAGE_IDENTIFIER_TYPE Type;
532 USHORT IdentifierSize;
533 USHORT NextOffset;
534 STORAGE_ASSOCIATION_TYPE Association;
535 UCHAR Identifier[1];
536 } STORAGE_IDENTIFIER, *PSTORAGE_IDENTIFIER;
537
538 typedef struct _STORAGE_DEVICE_ID_DESCRIPTOR {
539 ULONG Version;
540 ULONG Size;
541 ULONG NumberOfIdentifiers;
542 UCHAR Identifiers[1];
543 } STORAGE_DEVICE_ID_DESCRIPTOR, *PSTORAGE_DEVICE_ID_DESCRIPTOR;
544
545 typedef struct _DEVICE_SEEK_PENALTY_DESCRIPTOR {
546 ULONG Version;
547 ULONG Size;
548 BOOLEAN IncursSeekPenalty;
549 } DEVICE_SEEK_PENALTY_DESCRIPTOR, *PDEVICE_SEEK_PENALTY_DESCRIPTOR;
550
551 typedef struct _DEVICE_WRITE_AGGREGATION_DESCRIPTOR {
552 ULONG Version;
553 ULONG Size;
554 BOOLEAN BenefitsFromWriteAggregation;
555 } DEVICE_WRITE_AGGREGATION_DESCRIPTOR, *PDEVICE_WRITE_AGGREGATION_DESCRIPTOR;
556
557 typedef struct _DEVICE_TRIM_DESCRIPTOR {
558 ULONG Version;
559 ULONG Size;
560 BOOLEAN TrimEnabled;
561 } DEVICE_TRIM_DESCRIPTOR, *PDEVICE_TRIM_DESCRIPTOR;
562
563 typedef ULONG DEVICE_DATA_MANAGEMENT_SET_ACTION;
564
565 typedef struct _DEVICE_DATA_SET_RANGE {
566 LONGLONG StartingOffset;
567 ULONGLONG LengthInBytes;
568 } DEVICE_DATA_SET_RANGE, *PDEVICE_DATA_SET_RANGE;
569
570 typedef struct _DEVICE_MANAGE_DATA_SET_ATTRIBUTES {
571 ULONG Size;
572 DEVICE_DATA_MANAGEMENT_SET_ACTION Action;
573 ULONG Flags;
574 ULONG ParameterBlockOffset;
575 ULONG ParameterBlockLength;
576 ULONG DataSetRangesOffset;
577 ULONG DataSetRangesLength;
578 } DEVICE_MANAGE_DATA_SET_ATTRIBUTES, *PDEVICE_MANAGE_DATA_SET_ATTRIBUTES;
579
580 typedef struct _DEVICE_DSM_NOTIFICATION_PARAMETERS {
581 ULONG Size;
582 ULONG Flags;
583 ULONG NumFileTypeIDs;
584 GUID FileTypeID[1];
585 } DEVICE_DSM_NOTIFICATION_PARAMETERS, *PDEVICE_DSM_NOTIFICATION_PARAMETERS;
586
587 typedef struct _STORAGE_GET_BC_PROPERTIES_OUTPUT {
588 ULONG MaximumRequestsPerPeriod;
589 ULONG MinimumPeriod;
590 ULONGLONG MaximumRequestSize;
591 ULONG EstimatedTimePerRequest;
592 ULONG NumOutStandingRequests;
593 ULONGLONG RequestSize;
594 } STORAGE_GET_BC_PROPERTIES_OUTPUT, *PSTORAGE_GET_BC_PROPERTIES_OUTPUT;
595
596 typedef struct _STORAGE_ALLOCATE_BC_STREAM_INPUT {
597 ULONG Version;
598 ULONG RequestsPerPeriod;
599 ULONG Period;
600 BOOLEAN RetryFailures;
601 BOOLEAN Discardable;
602 BOOLEAN Reserved1[2];
603 ULONG AccessType;
604 ULONG AccessMode;
605 } STORAGE_ALLOCATE_BC_STREAM_INPUT, *PSTORAGE_ALLOCATE_BC_STREAM_INPUT;
606
607 typedef struct _STORAGE_ALLOCATE_BC_STREAM_OUTPUT {
608 ULONGLONG RequestSize;
609 ULONG NumOutStandingRequests;
610 } STORAGE_ALLOCATE_BC_STREAM_OUTPUT, *PSTORAGE_ALLOCATE_BC_STREAM_OUTPUT;
611
612 typedef struct _STORAGE_PRIORITY_HINT_SUPPORT {
613 ULONG SupportFlags;
614 } STORAGE_PRIORITY_HINT_SUPPORT, *PSTORAGE_PRIORITY_HINT_SUPPORT;
615
616 #if defined(_MSC_EXTENSIONS)
617
618 typedef struct _STORAGE_MEDIA_SERIAL_NUMBER_DATA {
619 USHORT Reserved;
620 USHORT SerialNumberLength;
621 UCHAR SerialNumber[0];
622 } STORAGE_MEDIA_SERIAL_NUMBER_DATA, *PSTORAGE_MEDIA_SERIAL_NUMBER_DATA;
623
624 typedef struct _PERSISTENT_RESERVE_COMMAND {
625 ULONG Version;
626 ULONG Size;
627 _ANONYMOUS_UNION union {
628 struct {
629 UCHAR ServiceAction:5;
630 UCHAR Reserved1:3;
631 USHORT AllocationLength;
632 } PR_IN;
633 struct {
634 UCHAR ServiceAction:5;
635 UCHAR Reserved1:3;
636 UCHAR Type:4;
637 UCHAR Scope:4;
638 UCHAR ParameterList[0];
639 } PR_OUT;
640 } DUMMYUNIONNAME;
641 } PERSISTENT_RESERVE_COMMAND, *PPERSISTENT_RESERVE_COMMAND;
642
643 #endif /* defined(_MSC_EXTENSIONS) */
644
645 typedef struct _STORAGE_READ_CAPACITY {
646 ULONG Version;
647 ULONG Size;
648 ULONG BlockLength;
649 LARGE_INTEGER NumberOfBlocks;
650 LARGE_INTEGER DiskLength;
651 } STORAGE_READ_CAPACITY, *PSTORAGE_READ_CAPACITY;
652
653 typedef enum _WRITE_CACHE_TYPE {
654 WriteCacheTypeUnknown,
655 WriteCacheTypeNone,
656 WriteCacheTypeWriteBack,
657 WriteCacheTypeWriteThrough
658 } WRITE_CACHE_TYPE;
659
660 typedef enum _WRITE_CACHE_ENABLE {
661 WriteCacheEnableUnknown,
662 WriteCacheDisabled,
663 WriteCacheEnabled
664 } WRITE_CACHE_ENABLE;
665
666 typedef enum _WRITE_CACHE_CHANGE {
667 WriteCacheChangeUnknown,
668 WriteCacheNotChangeable,
669 WriteCacheChangeable
670 } WRITE_CACHE_CHANGE;
671
672 typedef enum _WRITE_THROUGH {
673 WriteThroughUnknown,
674 WriteThroughNotSupported,
675 WriteThroughSupported
676 } WRITE_THROUGH;
677
678 typedef struct _STORAGE_WRITE_CACHE_PROPERTY {
679 ULONG Version;
680 ULONG Size;
681 WRITE_CACHE_TYPE WriteCacheType;
682 WRITE_CACHE_ENABLE WriteCacheEnabled;
683 WRITE_CACHE_CHANGE WriteCacheChangeable;
684 WRITE_THROUGH WriteThroughSupported;
685 BOOLEAN FlushCacheSupported;
686 BOOLEAN UserDefinedPowerProtection;
687 BOOLEAN NVCacheEnabled;
688 } STORAGE_WRITE_CACHE_PROPERTY, *PSTORAGE_WRITE_CACHE_PROPERTY;
689
690 #ifdef __cplusplus
691 }
692 #endif
693
694 #endif /* _NTDDSTOR_H_ */