Support unrar64.dll
[xy_vsfilter.git] / include / winddk / ntdddisk.h
blob6a6a892f741212305a4d48908a85a53d4cf11275
1 /*++
3 Copyright (c) Microsoft Corporation. All rights reserved.
5 Module Name:
7 ntdddisk.h
9 Abstract:
11 This is the include file that defines all constants and types for
12 accessing the Disk device.
14 Revision History:
16 --*/
19 #ifndef _NTDDDISK_H_
20 #define _NTDDDISK_H_
22 #if _MSC_VER > 1000
23 #pragma once
24 #endif
26 #include <diskguid.h>
28 #ifdef __cplusplus
29 extern "C" {
30 #endif
33 // Device Name - this string is the name of the device. It is the name
34 // that should be passed to NtOpenFile when accessing the device.
36 // Note: For devices that support multiple units, it should be suffixed
37 // with the Ascii representation of the unit number.
40 #define DD_DISK_DEVICE_NAME "\\Device\\UNKNOWN"
44 // NtDeviceIoControlFile
46 // begin_winioctl
49 // IoControlCode values for disk devices.
52 #define IOCTL_DISK_BASE FILE_DEVICE_DISK
53 #define IOCTL_DISK_GET_DRIVE_GEOMETRY CTL_CODE(IOCTL_DISK_BASE, 0x0000, METHOD_BUFFERED, FILE_ANY_ACCESS)
54 #define IOCTL_DISK_GET_PARTITION_INFO CTL_CODE(IOCTL_DISK_BASE, 0x0001, METHOD_BUFFERED, FILE_READ_ACCESS)
55 #define IOCTL_DISK_SET_PARTITION_INFO CTL_CODE(IOCTL_DISK_BASE, 0x0002, METHOD_BUFFERED, FILE_READ_ACCESS | FILE_WRITE_ACCESS)
56 #define IOCTL_DISK_GET_DRIVE_LAYOUT CTL_CODE(IOCTL_DISK_BASE, 0x0003, METHOD_BUFFERED, FILE_READ_ACCESS)
57 #define IOCTL_DISK_SET_DRIVE_LAYOUT CTL_CODE(IOCTL_DISK_BASE, 0x0004, METHOD_BUFFERED, FILE_READ_ACCESS | FILE_WRITE_ACCESS)
58 #define IOCTL_DISK_VERIFY CTL_CODE(IOCTL_DISK_BASE, 0x0005, METHOD_BUFFERED, FILE_ANY_ACCESS)
59 #define IOCTL_DISK_FORMAT_TRACKS CTL_CODE(IOCTL_DISK_BASE, 0x0006, METHOD_BUFFERED, FILE_READ_ACCESS | FILE_WRITE_ACCESS)
60 #define IOCTL_DISK_REASSIGN_BLOCKS CTL_CODE(IOCTL_DISK_BASE, 0x0007, METHOD_BUFFERED, FILE_READ_ACCESS | FILE_WRITE_ACCESS)
61 #define IOCTL_DISK_PERFORMANCE CTL_CODE(IOCTL_DISK_BASE, 0x0008, METHOD_BUFFERED, FILE_ANY_ACCESS)
62 #define IOCTL_DISK_IS_WRITABLE CTL_CODE(IOCTL_DISK_BASE, 0x0009, METHOD_BUFFERED, FILE_ANY_ACCESS)
63 #define IOCTL_DISK_LOGGING CTL_CODE(IOCTL_DISK_BASE, 0x000a, METHOD_BUFFERED, FILE_ANY_ACCESS)
64 #define IOCTL_DISK_FORMAT_TRACKS_EX CTL_CODE(IOCTL_DISK_BASE, 0x000b, METHOD_BUFFERED, FILE_READ_ACCESS | FILE_WRITE_ACCESS)
65 #define IOCTL_DISK_HISTOGRAM_STRUCTURE CTL_CODE(IOCTL_DISK_BASE, 0x000c, METHOD_BUFFERED, FILE_ANY_ACCESS)
66 #define IOCTL_DISK_HISTOGRAM_DATA CTL_CODE(IOCTL_DISK_BASE, 0x000d, METHOD_BUFFERED, FILE_ANY_ACCESS)
67 #define IOCTL_DISK_HISTOGRAM_RESET CTL_CODE(IOCTL_DISK_BASE, 0x000e, METHOD_BUFFERED, FILE_ANY_ACCESS)
68 #define IOCTL_DISK_REQUEST_STRUCTURE CTL_CODE(IOCTL_DISK_BASE, 0x000f, METHOD_BUFFERED, FILE_ANY_ACCESS)
69 #define IOCTL_DISK_REQUEST_DATA CTL_CODE(IOCTL_DISK_BASE, 0x0010, METHOD_BUFFERED, FILE_ANY_ACCESS)
70 #define IOCTL_DISK_PERFORMANCE_OFF CTL_CODE(IOCTL_DISK_BASE, 0x0018, METHOD_BUFFERED, FILE_ANY_ACCESS)
74 #if(_WIN32_WINNT >= 0x0400)
75 #define IOCTL_DISK_CONTROLLER_NUMBER CTL_CODE(IOCTL_DISK_BASE, 0x0011, METHOD_BUFFERED, FILE_ANY_ACCESS)
78 // IOCTL support for SMART drive fault prediction.
81 #define SMART_GET_VERSION CTL_CODE(IOCTL_DISK_BASE, 0x0020, METHOD_BUFFERED, FILE_READ_ACCESS)
82 #define SMART_SEND_DRIVE_COMMAND CTL_CODE(IOCTL_DISK_BASE, 0x0021, METHOD_BUFFERED, FILE_READ_ACCESS | FILE_WRITE_ACCESS)
83 #define SMART_RCV_DRIVE_DATA CTL_CODE(IOCTL_DISK_BASE, 0x0022, METHOD_BUFFERED, FILE_READ_ACCESS | FILE_WRITE_ACCESS)
85 #endif /* _WIN32_WINNT >= 0x0400 */
87 #if (_WIN32_WINNT >= 0x500)
90 // New IOCTLs for GUID Partition tabled disks.
93 #define IOCTL_DISK_GET_PARTITION_INFO_EX CTL_CODE(IOCTL_DISK_BASE, 0x0012, METHOD_BUFFERED, FILE_ANY_ACCESS)
94 #define IOCTL_DISK_SET_PARTITION_INFO_EX CTL_CODE(IOCTL_DISK_BASE, 0x0013, METHOD_BUFFERED, FILE_READ_ACCESS | FILE_WRITE_ACCESS)
95 #define IOCTL_DISK_GET_DRIVE_LAYOUT_EX CTL_CODE(IOCTL_DISK_BASE, 0x0014, METHOD_BUFFERED, FILE_ANY_ACCESS)
96 #define IOCTL_DISK_SET_DRIVE_LAYOUT_EX CTL_CODE(IOCTL_DISK_BASE, 0x0015, METHOD_BUFFERED, FILE_READ_ACCESS | FILE_WRITE_ACCESS)
97 #define IOCTL_DISK_CREATE_DISK CTL_CODE(IOCTL_DISK_BASE, 0x0016, METHOD_BUFFERED, FILE_READ_ACCESS | FILE_WRITE_ACCESS)
98 #define IOCTL_DISK_GET_LENGTH_INFO CTL_CODE(IOCTL_DISK_BASE, 0x0017, METHOD_BUFFERED, FILE_READ_ACCESS)
99 #define IOCTL_DISK_GET_DRIVE_GEOMETRY_EX CTL_CODE(IOCTL_DISK_BASE, 0x0028, METHOD_BUFFERED, FILE_ANY_ACCESS)
101 #endif /* _WIN32_WINNT >= 0x0500 */
104 #if(_WIN32_WINNT >= 0x0500)
105 #define IOCTL_DISK_UPDATE_DRIVE_SIZE CTL_CODE(IOCTL_DISK_BASE, 0x0032, METHOD_BUFFERED, FILE_READ_ACCESS | FILE_WRITE_ACCESS)
106 #define IOCTL_DISK_GROW_PARTITION CTL_CODE(IOCTL_DISK_BASE, 0x0034, METHOD_BUFFERED, FILE_READ_ACCESS | FILE_WRITE_ACCESS)
108 #define IOCTL_DISK_GET_CACHE_INFORMATION CTL_CODE(IOCTL_DISK_BASE, 0x0035, METHOD_BUFFERED, FILE_READ_ACCESS)
109 #define IOCTL_DISK_SET_CACHE_INFORMATION CTL_CODE(IOCTL_DISK_BASE, 0x0036, METHOD_BUFFERED, FILE_READ_ACCESS | FILE_WRITE_ACCESS)
110 #define IOCTL_DISK_GET_WRITE_CACHE_STATE CTL_CODE(IOCTL_DISK_BASE, 0x0037, METHOD_BUFFERED, FILE_READ_ACCESS)
112 #define IOCTL_DISK_DELETE_DRIVE_LAYOUT CTL_CODE(IOCTL_DISK_BASE, 0x0040, METHOD_BUFFERED, FILE_READ_ACCESS | FILE_WRITE_ACCESS)
115 // Called to flush cached information that the driver may have about this
116 // device's characteristics. Not all drivers cache characteristics, and not
117 // cached properties can be flushed. This simply serves as an update to the
118 // driver that it may want to do an expensive reexamination of the device's
119 // characteristics now (fixed media size, partition table, etc...)
122 #define IOCTL_DISK_UPDATE_PROPERTIES CTL_CODE(IOCTL_DISK_BASE, 0x0050, METHOD_BUFFERED, FILE_ANY_ACCESS)
125 // Special IOCTLs needed to support PC-98 machines in Japan
128 #define IOCTL_DISK_FORMAT_DRIVE CTL_CODE(IOCTL_DISK_BASE, 0x00f3, METHOD_BUFFERED, FILE_READ_ACCESS | FILE_WRITE_ACCESS)
129 #define IOCTL_DISK_SENSE_DEVICE CTL_CODE(IOCTL_DISK_BASE, 0x00f8, METHOD_BUFFERED, FILE_ANY_ACCESS)
131 #endif /* _WIN32_WINNT >= 0x0500 */
133 // end_winioctl
136 // Internal disk driver device controls to maintain the verify status bit
137 // for the device object.
140 #define IOCTL_DISK_INTERNAL_SET_VERIFY CTL_CODE(IOCTL_DISK_BASE, 0x0100, METHOD_NEITHER, FILE_ANY_ACCESS)
141 #define IOCTL_DISK_INTERNAL_CLEAR_VERIFY CTL_CODE(IOCTL_DISK_BASE, 0x0101, METHOD_NEITHER, FILE_ANY_ACCESS)
144 // Internal disk driver device control to set notification routine for
145 // the device object. Used in DiskPerf.
148 #define IOCTL_DISK_INTERNAL_SET_NOTIFY CTL_CODE(IOCTL_DISK_BASE, 0x0102, METHOD_BUFFERED, FILE_ANY_ACCESS)
150 // begin_winioctl
152 // The following device control codes are common for all class drivers. The
153 // functions codes defined here must match all of the other class drivers.
155 // Warning: these codes will be replaced in the future by equivalent
156 // IOCTL_STORAGE codes
159 #define IOCTL_DISK_CHECK_VERIFY CTL_CODE(IOCTL_DISK_BASE, 0x0200, METHOD_BUFFERED, FILE_READ_ACCESS)
160 #define IOCTL_DISK_MEDIA_REMOVAL CTL_CODE(IOCTL_DISK_BASE, 0x0201, METHOD_BUFFERED, FILE_READ_ACCESS)
161 #define IOCTL_DISK_EJECT_MEDIA CTL_CODE(IOCTL_DISK_BASE, 0x0202, METHOD_BUFFERED, FILE_READ_ACCESS)
162 #define IOCTL_DISK_LOAD_MEDIA CTL_CODE(IOCTL_DISK_BASE, 0x0203, METHOD_BUFFERED, FILE_READ_ACCESS)
163 #define IOCTL_DISK_RESERVE CTL_CODE(IOCTL_DISK_BASE, 0x0204, METHOD_BUFFERED, FILE_READ_ACCESS)
164 #define IOCTL_DISK_RELEASE CTL_CODE(IOCTL_DISK_BASE, 0x0205, METHOD_BUFFERED, FILE_READ_ACCESS)
165 #define IOCTL_DISK_FIND_NEW_DEVICES CTL_CODE(IOCTL_DISK_BASE, 0x0206, METHOD_BUFFERED, FILE_READ_ACCESS)
166 #define IOCTL_DISK_GET_MEDIA_TYPES CTL_CODE(IOCTL_DISK_BASE, 0x0300, METHOD_BUFFERED, FILE_ANY_ACCESS)
168 // end_winioctl
171 // The following file contains the IOCTL_STORAGE class ioctls
174 #include <ntddstor.h>
176 // begin_winioctl
178 // Define the partition types returnable by known disk drivers.
181 #define PARTITION_ENTRY_UNUSED 0x00 // Entry unused
182 #define PARTITION_FAT_12 0x01 // 12-bit FAT entries
183 #define PARTITION_XENIX_1 0x02 // Xenix
184 #define PARTITION_XENIX_2 0x03 // Xenix
185 #define PARTITION_FAT_16 0x04 // 16-bit FAT entries
186 #define PARTITION_EXTENDED 0x05 // Extended partition entry
187 #define PARTITION_HUGE 0x06 // Huge partition MS-DOS V4
188 #define PARTITION_IFS 0x07 // IFS Partition
189 #define PARTITION_OS2BOOTMGR 0x0A // OS/2 Boot Manager/OPUS/Coherent swap
190 #define PARTITION_FAT32 0x0B // FAT32
191 #define PARTITION_FAT32_XINT13 0x0C // FAT32 using extended int13 services
192 #define PARTITION_XINT13 0x0E // Win95 partition using extended int13 services
193 #define PARTITION_XINT13_EXTENDED 0x0F // Same as type 5 but uses extended int13 services
194 #define PARTITION_PREP 0x41 // PowerPC Reference Platform (PReP) Boot Partition
195 #define PARTITION_LDM 0x42 // Logical Disk Manager partition
196 #define PARTITION_UNIX 0x63 // Unix
198 #define VALID_NTFT 0xC0 // NTFT uses high order bits
201 // The high bit of the partition type code indicates that a partition
202 // is part of an NTFT mirror or striped array.
205 #define PARTITION_NTFT 0x80 // NTFT partition
208 // The following macro is used to determine which partitions should be
209 // assigned drive letters.
212 //++
214 // BOOLEAN
215 // IsRecognizedPartition(
216 // IN ULONG PartitionType
217 // )
219 // Routine Description:
221 // This macro is used to determine to which partitions drive letters
222 // should be assigned.
224 // Arguments:
226 // PartitionType - Supplies the type of the partition being examined.
228 // Return Value:
230 // The return value is TRUE if the partition type is recognized,
231 // otherwise FALSE is returned.
233 //--
235 #define IsRecognizedPartition( PartitionType ) ( \
236 ((PartitionType & PARTITION_NTFT) && ((PartitionType & ~0xC0) == PARTITION_FAT_12)) || \
237 ((PartitionType & PARTITION_NTFT) && ((PartitionType & ~0xC0) == PARTITION_IFS)) || \
238 ((PartitionType & PARTITION_NTFT) && ((PartitionType & ~0xC0) == PARTITION_HUGE)) || \
239 ((PartitionType & PARTITION_NTFT) && ((PartitionType & ~0xC0) == PARTITION_FAT32)) || \
240 ((PartitionType & PARTITION_NTFT) && ((PartitionType & ~0xC0) == PARTITION_FAT32_XINT13)) || \
241 ((PartitionType & PARTITION_NTFT) && ((PartitionType & ~0xC0) == PARTITION_XINT13)) || \
242 ((PartitionType) == PARTITION_FAT_12) || \
243 ((PartitionType) == PARTITION_FAT_16) || \
244 ((PartitionType) == PARTITION_IFS) || \
245 ((PartitionType) == PARTITION_HUGE) || \
246 ((PartitionType) == PARTITION_FAT32) || \
247 ((PartitionType) == PARTITION_FAT32_XINT13) || \
248 ((PartitionType) == PARTITION_XINT13) )
250 //++
252 // BOOLEAN
253 // IsContainerPartition(
254 // IN ULONG PartitionType
255 // )
257 // Routine Description:
259 // This macro is used to determine to which partition types are actually
260 // containers for other partitions (ie, extended partitions).
262 // Arguments:
264 // PartitionType - Supplies the type of the partition being examined.
266 // Return Value:
268 // The return value is TRUE if the partition type is a container,
269 // otherwise FALSE is returned.
271 //--
273 #define IsContainerPartition( PartitionType ) \
274 ((PartitionType == PARTITION_EXTENDED) || (PartitionType == PARTITION_XINT13_EXTENDED))
276 //++
278 // BOOLEAN
279 // IsFTPartition(
280 // IN ULONG PartitionType
281 // )
283 // Routine Description:
285 // This macro is used to determine if the given partition is an FT
286 // partition.
288 // Arguments:
290 // PartitionType - Supplies the type of the partition being examined.
292 // Return Value:
294 // The return value is TRUE if the partition type is an FT partition,
295 // otherwise FALSE is returned.
297 //--
299 #define IsFTPartition( PartitionType ) \
300 (((PartitionType)&PARTITION_NTFT) && IsRecognizedPartition(PartitionType))
303 // Define the media types supported by the driver.
306 typedef enum _MEDIA_TYPE {
307 Unknown, // Format is unknown
308 F5_1Pt2_512, // 5.25", 1.2MB, 512 bytes/sector
309 F3_1Pt44_512, // 3.5", 1.44MB, 512 bytes/sector
310 F3_2Pt88_512, // 3.5", 2.88MB, 512 bytes/sector
311 F3_20Pt8_512, // 3.5", 20.8MB, 512 bytes/sector
312 F3_720_512, // 3.5", 720KB, 512 bytes/sector
313 F5_360_512, // 5.25", 360KB, 512 bytes/sector
314 F5_320_512, // 5.25", 320KB, 512 bytes/sector
315 F5_320_1024, // 5.25", 320KB, 1024 bytes/sector
316 F5_180_512, // 5.25", 180KB, 512 bytes/sector
317 F5_160_512, // 5.25", 160KB, 512 bytes/sector
318 RemovableMedia, // Removable media other than floppy
319 FixedMedia, // Fixed hard disk media
320 F3_120M_512, // 3.5", 120M Floppy
321 F3_640_512, // 3.5" , 640KB, 512 bytes/sector
322 F5_640_512, // 5.25", 640KB, 512 bytes/sector
323 F5_720_512, // 5.25", 720KB, 512 bytes/sector
324 F3_1Pt2_512, // 3.5" , 1.2Mb, 512 bytes/sector
325 F3_1Pt23_1024, // 3.5" , 1.23Mb, 1024 bytes/sector
326 F5_1Pt23_1024, // 5.25", 1.23MB, 1024 bytes/sector
327 F3_128Mb_512, // 3.5" MO 128Mb 512 bytes/sector
328 F3_230Mb_512, // 3.5" MO 230Mb 512 bytes/sector
329 F8_256_128, // 8", 256KB, 128 bytes/sector
330 F3_200Mb_512, // 3.5", 200M Floppy (HiFD)
331 F3_240M_512, // 3.5", 240Mb Floppy (HiFD)
332 F3_32M_512 // 3.5", 32Mb Floppy
333 } MEDIA_TYPE, *PMEDIA_TYPE;
336 // Define the input buffer structure for the driver, when
337 // it is called with IOCTL_DISK_FORMAT_TRACKS.
340 typedef struct _FORMAT_PARAMETERS {
341 MEDIA_TYPE MediaType;
342 ULONG StartCylinderNumber;
343 ULONG EndCylinderNumber;
344 ULONG StartHeadNumber;
345 ULONG EndHeadNumber;
346 } FORMAT_PARAMETERS, *PFORMAT_PARAMETERS;
349 // Define the BAD_TRACK_NUMBER type. An array of elements of this type is
350 // returned by the driver on IOCTL_DISK_FORMAT_TRACKS requests, to indicate
351 // what tracks were bad during formatting. The length of that array is
352 // reported in the `Information' field of the I/O Status Block.
355 typedef USHORT BAD_TRACK_NUMBER;
356 typedef USHORT *PBAD_TRACK_NUMBER;
359 // Define the input buffer structure for the driver, when
360 // it is called with IOCTL_DISK_FORMAT_TRACKS_EX.
363 typedef struct _FORMAT_EX_PARAMETERS {
364 MEDIA_TYPE MediaType;
365 ULONG StartCylinderNumber;
366 ULONG EndCylinderNumber;
367 ULONG StartHeadNumber;
368 ULONG EndHeadNumber;
369 USHORT FormatGapLength;
370 USHORT SectorsPerTrack;
371 USHORT SectorNumber[1];
372 } FORMAT_EX_PARAMETERS, *PFORMAT_EX_PARAMETERS;
375 // The following structure is returned on an IOCTL_DISK_GET_DRIVE_GEOMETRY
376 // request and an array of them is returned on an IOCTL_DISK_GET_MEDIA_TYPES
377 // request.
380 typedef struct _DISK_GEOMETRY {
381 LARGE_INTEGER Cylinders;
382 MEDIA_TYPE MediaType;
383 ULONG TracksPerCylinder;
384 ULONG SectorsPerTrack;
385 ULONG BytesPerSector;
386 } DISK_GEOMETRY, *PDISK_GEOMETRY;
391 // This wmi guid returns a DISK_GEOMETRY structure
393 #define WMI_DISK_GEOMETRY_GUID { 0x25007f51, 0x57c2, 0x11d1, { 0xa5, 0x28, 0x0, 0xa0, 0xc9, 0x6, 0x29, 0x10 } }
398 // The following structure is returned on an IOCTL_DISK_GET_PARTITION_INFO
399 // and an IOCTL_DISK_GET_DRIVE_LAYOUT request. It is also used in a request
400 // to change the drive layout, IOCTL_DISK_SET_DRIVE_LAYOUT.
403 typedef struct _PARTITION_INFORMATION {
404 LARGE_INTEGER StartingOffset;
405 LARGE_INTEGER PartitionLength;
406 ULONG HiddenSectors;
407 ULONG PartitionNumber;
408 UCHAR PartitionType;
409 BOOLEAN BootIndicator;
410 BOOLEAN RecognizedPartition;
411 BOOLEAN RewritePartition;
412 } PARTITION_INFORMATION, *PPARTITION_INFORMATION;
415 // The following structure is used to change the partition type of a
416 // specified disk partition using an IOCTL_DISK_SET_PARTITION_INFO
417 // request.
420 typedef struct _SET_PARTITION_INFORMATION {
421 UCHAR PartitionType;
422 } SET_PARTITION_INFORMATION, *PSET_PARTITION_INFORMATION;
425 // The following structures is returned on an IOCTL_DISK_GET_DRIVE_LAYOUT
426 // request and given as input to an IOCTL_DISK_SET_DRIVE_LAYOUT request.
429 typedef struct _DRIVE_LAYOUT_INFORMATION {
430 ULONG PartitionCount;
431 ULONG Signature;
432 PARTITION_INFORMATION PartitionEntry[1];
433 } DRIVE_LAYOUT_INFORMATION, *PDRIVE_LAYOUT_INFORMATION;
436 // The following structure is passed in on an IOCTL_DISK_VERIFY request.
437 // The offset and length parameters are both given in bytes.
440 typedef struct _VERIFY_INFORMATION {
441 LARGE_INTEGER StartingOffset;
442 ULONG Length;
443 } VERIFY_INFORMATION, *PVERIFY_INFORMATION;
446 // The following structure is passed in on an IOCTL_DISK_REASSIGN_BLOCKS
447 // request.
450 typedef struct _REASSIGN_BLOCKS {
451 USHORT Reserved;
452 USHORT Count;
453 ULONG BlockNumber[1];
454 } REASSIGN_BLOCKS, *PREASSIGN_BLOCKS;
457 #if(_WIN32_WINNT >= 0x500)
460 // Support for GUID Partition Table (GPT) disks.
464 // There are currently two ways a disk can be partitioned. With a traditional
465 // AT-style master boot record (PARTITION_STYLE_MBR) and with a new, GPT
466 // partition table (PARTITION_STYLE_GPT). RAW is for an unrecognizable
467 // partition style. There are a very limited number of things you can
468 // do with a RAW partititon.
471 typedef enum _PARTITION_STYLE {
472 PARTITION_STYLE_MBR,
473 PARTITION_STYLE_GPT,
474 PARTITION_STYLE_RAW
475 } PARTITION_STYLE;
479 // The following structure defines information in a GPT partition that is
480 // not common to both GPT and MBR partitions.
483 typedef struct _PARTITION_INFORMATION_GPT {
484 GUID PartitionType; // Partition type. See table 16-3.
485 GUID PartitionId; // Unique GUID for this partition.
486 ULONG64 Attributes; // See table 16-4.
487 WCHAR Name [36]; // Partition Name in Unicode.
488 } PARTITION_INFORMATION_GPT, *PPARTITION_INFORMATION_GPT;
491 // The following are GPT partition attributes applicable for any
492 // partition type. These attributes are not OS-specific
495 #define GPT_ATTRIBUTE_PLATFORM_REQUIRED (0x0000000000000001)
498 // The following are GPT partition attributes applicable when the
499 // PartitionType is PARTITION_BASIC_DATA_GUID.
502 #define GPT_BASIC_DATA_ATTRIBUTE_NO_DRIVE_LETTER (0x8000000000000000)
503 #define GPT_BASIC_DATA_ATTRIBUTE_HIDDEN (0x4000000000000000)
504 #define GPT_BASIC_DATA_ATTRIBUTE_READ_ONLY (0x1000000000000000)
507 // The following structure defines information in an MBR partition that is not
508 // common to both GPT and MBR partitions.
511 typedef struct _PARTITION_INFORMATION_MBR {
512 UCHAR PartitionType;
513 BOOLEAN BootIndicator;
514 BOOLEAN RecognizedPartition;
515 ULONG HiddenSectors;
516 } PARTITION_INFORMATION_MBR, *PPARTITION_INFORMATION_MBR;
520 // The structure SET_PARTITION_INFO_EX is used with the ioctl
521 // IOCTL_SET_PARTITION_INFO_EX to set information about a specific
522 // partition. Note that for MBR partitions, you can only set the partition
523 // signature, whereas GPT partitions allow setting of all fields that
524 // you can get.
527 typedef SET_PARTITION_INFORMATION SET_PARTITION_INFORMATION_MBR;
528 typedef PARTITION_INFORMATION_GPT SET_PARTITION_INFORMATION_GPT;
531 typedef struct _SET_PARTITION_INFORMATION_EX {
532 PARTITION_STYLE PartitionStyle;
533 union {
534 SET_PARTITION_INFORMATION_MBR Mbr;
535 SET_PARTITION_INFORMATION_GPT Gpt;
537 } SET_PARTITION_INFORMATION_EX, *PSET_PARTITION_INFORMATION_EX;
541 // The structure CREATE_DISK_GPT with the ioctl IOCTL_DISK_CREATE_DISK
542 // to initialize an virgin disk with an empty GPT partition table.
545 typedef struct _CREATE_DISK_GPT {
546 GUID DiskId; // Unique disk id for the disk.
547 ULONG MaxPartitionCount; // Maximim number of partitions allowable.
548 } CREATE_DISK_GPT, *PCREATE_DISK_GPT;
551 // The structure CREATE_DISK_MBR with the ioctl IOCTL_DISK_CREATE_DISK
552 // to initialize an virgin disk with an empty MBR partition table.
555 typedef struct _CREATE_DISK_MBR {
556 ULONG Signature;
557 } CREATE_DISK_MBR, *PCREATE_DISK_MBR;
560 typedef struct _CREATE_DISK {
561 PARTITION_STYLE PartitionStyle;
562 union {
563 CREATE_DISK_MBR Mbr;
564 CREATE_DISK_GPT Gpt;
566 } CREATE_DISK, *PCREATE_DISK;
570 // The structure GET_LENGTH_INFORMATION is used with the ioctl
571 // IOCTL_DISK_GET_LENGTH_INFO to obtain the length, in bytes, of the
572 // disk, partition, or volume.
575 typedef struct _GET_LENGTH_INFORMATION {
576 LARGE_INTEGER Length;
577 } GET_LENGTH_INFORMATION, *PGET_LENGTH_INFORMATION;
580 // The PARTITION_INFORMATION_EX structure is used with the
581 // IOCTL_DISK_GET_DRIVE_LAYOUT_EX, IOCTL_DISK_SET_DRIVE_LAYOUT_EX,
582 // IOCTL_DISK_GET_PARTITION_INFO_EX and IOCTL_DISK_GET_PARTITION_INFO_EX calls.
585 typedef struct _PARTITION_INFORMATION_EX {
586 PARTITION_STYLE PartitionStyle;
587 LARGE_INTEGER StartingOffset;
588 LARGE_INTEGER PartitionLength;
589 ULONG PartitionNumber;
590 BOOLEAN RewritePartition;
591 union {
592 PARTITION_INFORMATION_MBR Mbr;
593 PARTITION_INFORMATION_GPT Gpt;
595 } PARTITION_INFORMATION_EX, *PPARTITION_INFORMATION_EX;
599 // GPT specific drive layout information.
602 typedef struct _DRIVE_LAYOUT_INFORMATION_GPT {
603 GUID DiskId;
604 LARGE_INTEGER StartingUsableOffset;
605 LARGE_INTEGER UsableLength;
606 ULONG MaxPartitionCount;
607 } DRIVE_LAYOUT_INFORMATION_GPT, *PDRIVE_LAYOUT_INFORMATION_GPT;
611 // MBR specific drive layout information.
614 typedef struct _DRIVE_LAYOUT_INFORMATION_MBR {
615 ULONG Signature;
616 } DRIVE_LAYOUT_INFORMATION_MBR, *PDRIVE_LAYOUT_INFORMATION_MBR;
619 // The structure DRIVE_LAYOUT_INFORMATION_EX is used with the
620 // IOCTL_SET_DRIVE_LAYOUT_EX and IOCTL_GET_DRIVE_LAYOUT_EX calls.
623 typedef struct _DRIVE_LAYOUT_INFORMATION_EX {
624 ULONG PartitionStyle;
625 ULONG PartitionCount;
626 union {
627 DRIVE_LAYOUT_INFORMATION_MBR Mbr;
628 DRIVE_LAYOUT_INFORMATION_GPT Gpt;
630 PARTITION_INFORMATION_EX PartitionEntry[1];
631 } DRIVE_LAYOUT_INFORMATION_EX, *PDRIVE_LAYOUT_INFORMATION_EX;
634 #endif // (_WIN32_WINNT >= 0x0500)
637 #if(_WIN32_WINNT >= 0x0500)
640 // The DISK_GEOMETRY_EX structure is returned on issuing an
641 // IOCTL_DISK_GET_DRIVE_GEOMETRY_EX ioctl.
644 typedef enum _DETECTION_TYPE {
645 DetectNone,
646 DetectInt13,
647 DetectExInt13
648 } DETECTION_TYPE;
650 typedef struct _DISK_INT13_INFO {
651 USHORT DriveSelect;
652 ULONG MaxCylinders;
653 USHORT SectorsPerTrack;
654 USHORT MaxHeads;
655 USHORT NumberDrives;
656 } DISK_INT13_INFO, *PDISK_INT13_INFO;
658 typedef struct _DISK_EX_INT13_INFO {
659 USHORT ExBufferSize;
660 USHORT ExFlags;
661 ULONG ExCylinders;
662 ULONG ExHeads;
663 ULONG ExSectorsPerTrack;
664 ULONG64 ExSectorsPerDrive;
665 USHORT ExSectorSize;
666 USHORT ExReserved;
667 } DISK_EX_INT13_INFO, *PDISK_EX_INT13_INFO;
669 typedef struct _DISK_DETECTION_INFO {
670 ULONG SizeOfDetectInfo;
671 DETECTION_TYPE DetectionType;
672 union {
673 struct {
676 // If DetectionType == DETECTION_INT13 then we have just the Int13
677 // information.
680 DISK_INT13_INFO Int13;
683 // If DetectionType == DETECTION_EX_INT13, then we have the
684 // extended int 13 information.
687 DISK_EX_INT13_INFO ExInt13; // If DetectionType == DetectExInt13
690 } DISK_DETECTION_INFO, *PDISK_DETECTION_INFO;
693 typedef struct _DISK_PARTITION_INFO {
694 ULONG SizeOfPartitionInfo;
695 PARTITION_STYLE PartitionStyle; // PartitionStyle = RAW, GPT or MBR
696 union {
697 struct { // If PartitionStyle == MBR
698 ULONG Signature; // MBR Signature
699 ULONG CheckSum; // MBR CheckSum
700 } Mbr;
701 struct { // If PartitionStyle == GPT
702 GUID DiskId;
703 } Gpt;
705 } DISK_PARTITION_INFO, *PDISK_PARTITION_INFO;
709 // The Geometry structure is a variable length structure composed of a
710 // DISK_GEOMETRY_EX structure followed by a DISK_PARTITION_INFO structure
711 // followed by a DISK_DETECTION_DATA structure.
714 #define DiskGeometryGetPartition(Geometry)\
715 ((PDISK_PARTITION_INFO)((Geometry)+1))
717 #define DiskGeometryGetDetect(Geometry)\
718 ((PDISK_DETECTION_INFO)(((PBYTE)DiskGeometryGetPartition(Geometry)+\
719 DiskGeometryGetPartition(Geometry)->SizeOfPartitionInfo)))
721 typedef struct _DISK_GEOMETRY_EX {
722 DISK_GEOMETRY Geometry; // Standard disk geometry: may be faked by driver.
723 LARGE_INTEGER DiskSize; // Must always be correct
724 UCHAR Data[1]; // Partition, Detect info
725 } DISK_GEOMETRY_EX, *PDISK_GEOMETRY_EX;
727 #endif // (_WIN32_WINNT > 0x0500)
729 #if(_WIN32_WINNT >= 0x0400)
731 // IOCTL_DISK_CONTROLLER_NUMBER returns the controller and disk
732 // number for the handle. This is used to determine if a disk
733 // is attached to the primary or secondary IDE controller.
736 typedef struct _DISK_CONTROLLER_NUMBER {
737 ULONG ControllerNumber;
738 ULONG DiskNumber;
739 } DISK_CONTROLLER_NUMBER, *PDISK_CONTROLLER_NUMBER;
740 #endif /* _WIN32_WINNT >= 0x0400 */
742 #if(_WIN32_WINNT >= 0x0500)
746 // IOCTL_DISK_SET_CACHE allows the caller to get or set the state of the disk
747 // read/write caches.
749 // If the structure is provided as the input buffer for the ioctl the read &
750 // write caches will be enabled or disabled depending on the parameters
751 // provided.
753 // If the structure is provided as an output buffer for the ioctl the state
754 // of the read & write caches will be returned. If both input and outut buffers
755 // are provided the output buffer will contain the cache state BEFORE any
756 // changes are made
759 typedef enum {
760 EqualPriority,
761 KeepPrefetchedData,
762 KeepReadData
763 } DISK_CACHE_RETENTION_PRIORITY;
765 typedef enum _DISK_WRITE_CACHE_STATE {
766 DiskWriteCacheNormal,
767 DiskWriteCacheForceDisable,
768 DiskWriteCacheDisableNotSupported
769 } DISK_WRITE_CACHE_STATE, *PDISK_WRITE_CACHE_STATE;
772 typedef struct _DISK_CACHE_INFORMATION {
775 // on return indicates that the device is capable of saving any parameters
776 // in non-volatile storage. On send indicates that the device should
777 // save the state in non-volatile storage.
780 BOOLEAN ParametersSavable;
783 // Indicates whether the write and read caches are enabled.
786 BOOLEAN ReadCacheEnabled;
787 BOOLEAN WriteCacheEnabled;
790 // Controls the likelyhood of data remaining in the cache depending on how
791 // it got there. Data cached from a READ or WRITE operation may be given
792 // higher, lower or equal priority to data entered into the cache for other
793 // means (like prefetch)
796 DISK_CACHE_RETENTION_PRIORITY ReadRetentionPriority;
797 DISK_CACHE_RETENTION_PRIORITY WriteRetentionPriority;
800 // Requests for a larger number of blocks than this may have prefetching
801 // disabled. If this value is set to 0 prefetch will be disabled.
804 USHORT DisablePrefetchTransferLength;
807 // If TRUE then ScalarPrefetch (below) will be valid. If FALSE then
808 // the minimum and maximum values should be treated as a block count
809 // (BlockPrefetch)
812 BOOLEAN PrefetchScalar;
815 // Contains the minimum and maximum amount of data which will be
816 // will be prefetched into the cache on a disk operation. This value
817 // may either be a scalar multiplier of the transfer length of the request,
818 // or an abolute number of disk blocks. PrefetchScalar (above) indicates
819 // which interpretation is used.
822 union {
823 struct {
824 USHORT Minimum;
825 USHORT Maximum;
828 // The maximum number of blocks which will be prefetched - useful
829 // with the scalar limits to set definite upper limits.
832 USHORT MaximumBlocks;
833 } ScalarPrefetch;
835 struct {
836 USHORT Minimum;
837 USHORT Maximum;
838 } BlockPrefetch;
841 } DISK_CACHE_INFORMATION, *PDISK_CACHE_INFORMATION;
844 // IOCTL_DISK_GROW_PARTITION will update the size of a partition
845 // by adding sectors to the length. The number of sectors must be
846 // predetermined by examining PARTITION_INFORMATION.
849 typedef struct _DISK_GROW_PARTITION {
850 ULONG PartitionNumber;
851 LARGE_INTEGER BytesToGrow;
852 } DISK_GROW_PARTITION, *PDISK_GROW_PARTITION;
853 #endif /* _WIN32_WINNT >= 0x0500 */
855 ///////////////////////////////////////////////////////
856 // //
857 // The following structures define disk performance //
858 // statistics: specifically the locations of all the //
859 // reads and writes which have occured on the disk. //
860 // //
861 // To use these structures, you must issue an IOCTL_ //
862 // DISK_HIST_STRUCTURE (with a DISK_HISTOGRAM) to //
863 // obtain the basic histogram information. The //
864 // number of buckets which must allocated is part of //
865 // this structure. Allocate the required number of //
866 // buckets and call an IOCTL_DISK_HIST_DATA to fill //
867 // in the data //
868 // //
869 ///////////////////////////////////////////////////////
871 #define HIST_NO_OF_BUCKETS 24
873 typedef struct _HISTOGRAM_BUCKET {
874 ULONG Reads;
875 ULONG Writes;
876 } HISTOGRAM_BUCKET, *PHISTOGRAM_BUCKET;
878 #define HISTOGRAM_BUCKET_SIZE sizeof(HISTOGRAM_BUCKET)
880 typedef struct _DISK_HISTOGRAM {
881 LARGE_INTEGER DiskSize;
882 LARGE_INTEGER Start;
883 LARGE_INTEGER End;
884 LARGE_INTEGER Average;
885 LARGE_INTEGER AverageRead;
886 LARGE_INTEGER AverageWrite;
887 ULONG Granularity;
888 ULONG Size;
889 ULONG ReadCount;
890 ULONG WriteCount;
891 PHISTOGRAM_BUCKET Histogram;
892 } DISK_HISTOGRAM, *PDISK_HISTOGRAM;
894 #define DISK_HISTOGRAM_SIZE sizeof(DISK_HISTOGRAM)
896 ///////////////////////////////////////////////////////
897 // //
898 // The following structures define disk debugging //
899 // capabilities. The IOCTLs are directed to one of //
900 // the two disk filter drivers. //
901 // //
902 // DISKPERF is a utilty for collecting disk request //
903 // statistics. //
904 // //
905 // SIMBAD is a utility for injecting faults in //
906 // IO requests to disks. //
907 // //
908 ///////////////////////////////////////////////////////
911 // The following structure is exchanged on an IOCTL_DISK_GET_PERFORMANCE
912 // request. This ioctl collects summary disk request statistics used
913 // in measuring performance.
916 typedef struct _DISK_PERFORMANCE {
917 LARGE_INTEGER BytesRead;
918 LARGE_INTEGER BytesWritten;
919 LARGE_INTEGER ReadTime;
920 LARGE_INTEGER WriteTime;
921 LARGE_INTEGER IdleTime;
922 ULONG ReadCount;
923 ULONG WriteCount;
924 ULONG QueueDepth;
925 ULONG SplitCount;
926 LARGE_INTEGER QueryTime;
927 ULONG StorageDeviceNumber;
928 WCHAR StorageManagerName[8];
929 } DISK_PERFORMANCE, *PDISK_PERFORMANCE;
932 // This structure defines the disk logging record. When disk logging
933 // is enabled, one of these is written to an internal buffer for each
934 // disk request.
937 typedef struct _DISK_RECORD {
938 LARGE_INTEGER ByteOffset;
939 LARGE_INTEGER StartTime;
940 LARGE_INTEGER EndTime;
941 PVOID VirtualAddress;
942 ULONG NumberOfBytes;
943 UCHAR DeviceNumber;
944 BOOLEAN ReadRequest;
945 } DISK_RECORD, *PDISK_RECORD;
948 // The following structure is exchanged on an IOCTL_DISK_LOG request.
949 // Not all fields are valid with each function type.
952 typedef struct _DISK_LOGGING {
953 UCHAR Function;
954 PVOID BufferAddress;
955 ULONG BufferSize;
956 } DISK_LOGGING, *PDISK_LOGGING;
959 // Disk logging functions
961 // Start disk logging. Only the Function and BufferSize fields are valid.
964 #define DISK_LOGGING_START 0
967 // Stop disk logging. Only the Function field is valid.
970 #define DISK_LOGGING_STOP 1
973 // Return disk log. All fields are valid. Data will be copied from internal
974 // buffer to buffer specified for the number of bytes requested.
977 #define DISK_LOGGING_DUMP 2
980 // DISK BINNING
982 // DISKPERF will keep counters for IO that falls in each of these ranges.
983 // The application determines the number and size of the ranges.
984 // Joe Lin wanted me to keep it flexible as possible, for instance, IO
985 // sizes are interesting in ranges like 0-4096, 4097-16384, 16385-65536, 65537+.
988 #define DISK_BINNING 3
991 // Bin types
994 typedef enum _BIN_TYPES {
995 RequestSize,
996 RequestLocation
997 } BIN_TYPES;
1000 // Bin ranges
1003 typedef struct _BIN_RANGE {
1004 LARGE_INTEGER StartValue;
1005 LARGE_INTEGER Length;
1006 } BIN_RANGE, *PBIN_RANGE;
1009 // Bin definition
1012 typedef struct _PERF_BIN {
1013 ULONG NumberOfBins;
1014 ULONG TypeOfBin;
1015 BIN_RANGE BinsRanges[1];
1016 } PERF_BIN, *PPERF_BIN ;
1019 // Bin count
1022 typedef struct _BIN_COUNT {
1023 BIN_RANGE BinRange;
1024 ULONG BinCount;
1025 } BIN_COUNT, *PBIN_COUNT;
1028 // Bin results
1031 typedef struct _BIN_RESULTS {
1032 ULONG NumberOfBins;
1033 BIN_COUNT BinCounts[1];
1034 } BIN_RESULTS, *PBIN_RESULTS;
1036 #if(_WIN32_WINNT >= 0x0400)
1038 // Data structures for SMART drive fault prediction.
1040 // GETVERSIONINPARAMS contains the data returned from the
1041 // Get Driver Version function.
1044 #include <pshpack1.h>
1045 typedef struct _GETVERSIONINPARAMS {
1046 UCHAR bVersion; // Binary driver version.
1047 UCHAR bRevision; // Binary driver revision.
1048 UCHAR bReserved; // Not used.
1049 UCHAR bIDEDeviceMap; // Bit map of IDE devices.
1050 ULONG fCapabilities; // Bit mask of driver capabilities.
1051 ULONG dwReserved[4]; // For future use.
1052 } GETVERSIONINPARAMS, *PGETVERSIONINPARAMS, *LPGETVERSIONINPARAMS;
1053 #include <poppack.h>
1056 // Bits returned in the fCapabilities member of GETVERSIONINPARAMS
1059 #define CAP_ATA_ID_CMD 1 // ATA ID command supported
1060 #define CAP_ATAPI_ID_CMD 2 // ATAPI ID command supported
1061 #define CAP_SMART_CMD 4 // SMART commannds supported
1064 // IDE registers
1067 #include <pshpack1.h>
1068 typedef struct _IDEREGS {
1069 UCHAR bFeaturesReg; // Used for specifying SMART "commands".
1070 UCHAR bSectorCountReg; // IDE sector count register
1071 UCHAR bSectorNumberReg; // IDE sector number register
1072 UCHAR bCylLowReg; // IDE low order cylinder value
1073 UCHAR bCylHighReg; // IDE high order cylinder value
1074 UCHAR bDriveHeadReg; // IDE drive/head register
1075 UCHAR bCommandReg; // Actual IDE command.
1076 UCHAR bReserved; // reserved for future use. Must be zero.
1077 } IDEREGS, *PIDEREGS, *LPIDEREGS;
1078 #include <poppack.h>
1081 // Valid values for the bCommandReg member of IDEREGS.
1084 #define ATAPI_ID_CMD 0xA1 // Returns ID sector for ATAPI.
1085 #define ID_CMD 0xEC // Returns ID sector for ATA.
1086 #define SMART_CMD 0xB0 // Performs SMART cmd.
1087 // Requires valid bFeaturesReg,
1088 // bCylLowReg, and bCylHighReg
1091 // Cylinder register defines for SMART command
1094 #define SMART_CYL_LOW 0x4F
1095 #define SMART_CYL_HI 0xC2
1099 // SENDCMDINPARAMS contains the input parameters for the
1100 // Send Command to Drive function.
1103 #include <pshpack1.h>
1104 typedef struct _SENDCMDINPARAMS {
1105 ULONG cBufferSize; // Buffer size in bytes
1106 IDEREGS irDriveRegs; // Structure with drive register values.
1107 UCHAR bDriveNumber; // Physical drive number to send
1108 // command to (0,1,2,3).
1109 UCHAR bReserved[3]; // Reserved for future expansion.
1110 ULONG dwReserved[4]; // For future use.
1111 UCHAR bBuffer[1]; // Input buffer.
1112 } SENDCMDINPARAMS, *PSENDCMDINPARAMS, *LPSENDCMDINPARAMS;
1113 #include <poppack.h>
1116 // Status returned from driver
1119 #include <pshpack1.h>
1120 typedef struct _DRIVERSTATUS {
1121 UCHAR bDriverError; // Error code from driver,
1122 // or 0 if no error.
1123 UCHAR bIDEError; // Contents of IDE Error register.
1124 // Only valid when bDriverError
1125 // is SMART_IDE_ERROR.
1126 UCHAR bReserved[2]; // Reserved for future expansion.
1127 ULONG dwReserved[2]; // Reserved for future expansion.
1128 } DRIVERSTATUS, *PDRIVERSTATUS, *LPDRIVERSTATUS;
1129 #include <poppack.h>
1132 // bDriverError values
1135 #define SMART_NO_ERROR 0 // No error
1136 #define SMART_IDE_ERROR 1 // Error from IDE controller
1137 #define SMART_INVALID_FLAG 2 // Invalid command flag
1138 #define SMART_INVALID_COMMAND 3 // Invalid command byte
1139 #define SMART_INVALID_BUFFER 4 // Bad buffer (null, invalid addr..)
1140 #define SMART_INVALID_DRIVE 5 // Drive number not valid
1141 #define SMART_INVALID_IOCTL 6 // Invalid IOCTL
1142 #define SMART_ERROR_NO_MEM 7 // Could not lock user's buffer
1143 #define SMART_INVALID_REGISTER 8 // Some IDE Register not valid
1144 #define SMART_NOT_SUPPORTED 9 // Invalid cmd flag set
1145 #define SMART_NO_IDE_DEVICE 10 // Cmd issued to device not present
1146 // although drive number is valid
1148 // SMART sub commands for execute offline diags
1150 #define SMART_OFFLINE_ROUTINE_OFFLINE 0
1151 #define SMART_SHORT_SELFTEST_OFFLINE 1
1152 #define SMART_EXTENDED_SELFTEST_OFFLINE 2
1153 #define SMART_ABORT_OFFLINE_SELFTEST 127
1154 #define SMART_SHORT_SELFTEST_CAPTIVE 129
1155 #define SMART_EXTENDED_SELFTEST_CAPTIVE 130
1158 #include <pshpack1.h>
1159 typedef struct _SENDCMDOUTPARAMS {
1160 ULONG cBufferSize; // Size of bBuffer in bytes
1161 DRIVERSTATUS DriverStatus; // Driver status structure.
1162 UCHAR bBuffer[1]; // Buffer of arbitrary length in which to store the data read from the // drive.
1163 } SENDCMDOUTPARAMS, *PSENDCMDOUTPARAMS, *LPSENDCMDOUTPARAMS;
1164 #include <poppack.h>
1167 #define READ_ATTRIBUTE_BUFFER_SIZE 512
1168 #define IDENTIFY_BUFFER_SIZE 512
1169 #define READ_THRESHOLD_BUFFER_SIZE 512
1170 #define SMART_LOG_SECTOR_SIZE 512
1173 // Feature register defines for SMART "sub commands"
1176 #define READ_ATTRIBUTES 0xD0
1177 #define READ_THRESHOLDS 0xD1
1178 #define ENABLE_DISABLE_AUTOSAVE 0xD2
1179 #define SAVE_ATTRIBUTE_VALUES 0xD3
1180 #define EXECUTE_OFFLINE_DIAGS 0xD4
1181 #define SMART_READ_LOG 0xD5
1182 #define SMART_WRITE_LOG 0xd6
1183 #define ENABLE_SMART 0xD8
1184 #define DISABLE_SMART 0xD9
1185 #define RETURN_SMART_STATUS 0xDA
1186 #define ENABLE_DISABLE_AUTO_OFFLINE 0xDB
1187 #endif /* _WIN32_WINNT >= 0x0400 */
1190 // end_winioctl
1193 // The following device control code is for the SIMBAD simulated bad
1194 // sector facility. See SIMBAD.H in this directory for related structures.
1197 #define IOCTL_DISK_SIMBAD CTL_CODE(IOCTL_DISK_BASE, 0x0400, METHOD_BUFFERED, FILE_READ_ACCESS | FILE_WRITE_ACCESS)
1200 // Queue link for mapped addresses stored for unmapping.
1203 typedef struct _MAPPED_ADDRESS {
1204 struct _MAPPED_ADDRESS *NextMappedAddress;
1205 PVOID MappedAddress;
1206 ULONG NumberOfBytes;
1207 LARGE_INTEGER IoAddress;
1208 ULONG BusNumber;
1209 } MAPPED_ADDRESS, *PMAPPED_ADDRESS;
1212 #ifdef __cplusplus
1214 #endif
1216 #endif // _NTDDDISK_H_