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