4 #pragma GCC system_header
10 #define HIST_NO_OF_BUCKETS 24
11 #define HISTOGRAM_BUCKET_SIZE sizeof(HISTOGRAM_BUCKET)
12 #define DISK_HISTOGRAM_SIZE sizeof(DISK_HISTOGRAM)
13 #define CTL_CODE(t,f,m,a) (((t)<<16)|((a)<<14)|((f)<<2)|(m))
14 #define DEVICE_TYPE_FROM_CTL_CODE(c) (((DWORD)((c)&0xffff0000))>>16)
15 #define IOCTL_STORAGE_BASE FILE_DEVICE_MASS_STORAGE
16 #define IOCTL_STORAGE_CHECK_VERIFY CTL_CODE(IOCTL_STORAGE_BASE, 0x0200, METHOD_BUFFERED, FILE_READ_ACCESS)
17 #define IOCTL_STORAGE_CHECK_VERIFY2 CTL_CODE(IOCTL_STORAGE_BASE, 0x0200, METHOD_BUFFERED, FILE_ANY_ACCESS)
18 #define IOCTL_STORAGE_MEDIA_REMOVAL CTL_CODE(IOCTL_STORAGE_BASE, 0x0201, METHOD_BUFFERED, FILE_READ_ACCESS)
19 #define IOCTL_STORAGE_EJECT_MEDIA CTL_CODE(IOCTL_STORAGE_BASE, 0x0202, METHOD_BUFFERED, FILE_READ_ACCESS)
20 #define IOCTL_STORAGE_LOAD_MEDIA CTL_CODE(IOCTL_STORAGE_BASE, 0x0203, METHOD_BUFFERED, FILE_READ_ACCESS)
21 #define IOCTL_STORAGE_LOAD_MEDIA2 CTL_CODE(IOCTL_STORAGE_BASE, 0x0203, METHOD_BUFFERED, FILE_ANY_ACCESS)
22 #define IOCTL_STORAGE_RESERVE CTL_CODE(IOCTL_STORAGE_BASE, 0x0204, METHOD_BUFFERED, FILE_READ_ACCESS)
23 #define IOCTL_STORAGE_RELEASE CTL_CODE(IOCTL_STORAGE_BASE, 0x0205, METHOD_BUFFERED, FILE_READ_ACCESS)
24 #define IOCTL_STORAGE_FIND_NEW_DEVICES CTL_CODE(IOCTL_STORAGE_BASE, 0x0206, METHOD_BUFFERED, FILE_READ_ACCESS)
25 #define IOCTL_STORAGE_EJECTION_CONTROL CTL_CODE(IOCTL_STORAGE_BASE, 0x0250, METHOD_BUFFERED, FILE_ANY_ACCESS)
26 #define IOCTL_STORAGE_MCN_CONTROL CTL_CODE(IOCTL_STORAGE_BASE, 0x0251, METHOD_BUFFERED, FILE_ANY_ACCESS)
27 #define IOCTL_STORAGE_GET_MEDIA_TYPES CTL_CODE(IOCTL_STORAGE_BASE, 0x0300, METHOD_BUFFERED, FILE_ANY_ACCESS)
28 #define IOCTL_STORAGE_GET_MEDIA_TYPES_EX CTL_CODE(IOCTL_STORAGE_BASE, 0x0301, METHOD_BUFFERED, FILE_ANY_ACCESS)
29 #define IOCTL_STORAGE_RESET_BUS CTL_CODE(IOCTL_STORAGE_BASE, 0x0400, METHOD_BUFFERED, FILE_READ_ACCESS)
30 #define IOCTL_STORAGE_RESET_DEVICE CTL_CODE(IOCTL_STORAGE_BASE, 0x0401, METHOD_BUFFERED, FILE_READ_ACCESS)
31 #define IOCTL_STORAGE_GET_DEVICE_NUMBER CTL_CODE(IOCTL_STORAGE_BASE, 0x0420, METHOD_BUFFERED, FILE_ANY_ACCESS)
32 #define IOCTL_STORAGE_PREDICT_FAILURE CTL_CODE(IOCTL_STORAGE_BASE, 0x0440, METHOD_BUFFERED, FILE_ANY_ACCESS)
33 #define IOCTL_DISK_BASE FILE_DEVICE_DISK
34 #define IOCTL_DISK_GET_DRIVE_GEOMETRY CTL_CODE(IOCTL_DISK_BASE,0,METHOD_BUFFERED, FILE_ANY_ACCESS)
35 #define IOCTL_DISK_GET_PARTITION_INFO CTL_CODE(IOCTL_DISK_BASE,1,METHOD_BUFFERED,FILE_READ_ACCESS)
36 #define IOCTL_DISK_SET_PARTITION_INFO CTL_CODE(IOCTL_DISK_BASE,2,METHOD_BUFFERED,FILE_READ_ACCESS|FILE_WRITE_ACCESS)
37 #define IOCTL_DISK_GET_DRIVE_LAYOUT CTL_CODE(IOCTL_DISK_BASE,3,METHOD_BUFFERED,FILE_READ_ACCESS)
38 #define IOCTL_DISK_SET_DRIVE_LAYOUT CTL_CODE(IOCTL_DISK_BASE,4,METHOD_BUFFERED,FILE_READ_ACCESS|FILE_WRITE_ACCESS)
39 #define IOCTL_DISK_VERIFY CTL_CODE(IOCTL_DISK_BASE,5,METHOD_BUFFERED,FILE_ANY_ACCESS)
40 #define IOCTL_DISK_FORMAT_TRACKS CTL_CODE(IOCTL_DISK_BASE,6,METHOD_BUFFERED,FILE_READ_ACCESS|FILE_WRITE_ACCESS)
41 #define IOCTL_DISK_REASSIGN_BLOCKS CTL_CODE(IOCTL_DISK_BASE,7,METHOD_BUFFERED,FILE_READ_ACCESS|FILE_WRITE_ACCESS)
42 #define IOCTL_DISK_PERFORMANCE CTL_CODE(IOCTL_DISK_BASE,8,METHOD_BUFFERED,FILE_ANY_ACCESS)
43 #define IOCTL_DISK_IS_WRITABLE CTL_CODE(IOCTL_DISK_BASE,9,METHOD_BUFFERED,FILE_ANY_ACCESS)
44 #define IOCTL_DISK_LOGGING CTL_CODE(IOCTL_DISK_BASE,10,METHOD_BUFFERED,FILE_ANY_ACCESS)
45 #define IOCTL_DISK_FORMAT_TRACKS_EX CTL_CODE(IOCTL_DISK_BASE,11,METHOD_BUFFERED,FILE_READ_ACCESS|FILE_WRITE_ACCESS)
46 #define IOCTL_DISK_HISTOGRAM_STRUCTURE CTL_CODE(IOCTL_DISK_BASE,12,METHOD_BUFFERED,FILE_ANY_ACCESS)
47 #define IOCTL_DISK_HISTOGRAM_DATA CTL_CODE(IOCTL_DISK_BASE,13,METHOD_BUFFERED,FILE_ANY_ACCESS)
48 #define IOCTL_DISK_HISTOGRAM_RESET CTL_CODE(IOCTL_DISK_BASE,14,METHOD_BUFFERED,FILE_ANY_ACCESS)
49 #define IOCTL_DISK_REQUEST_STRUCTURE CTL_CODE(IOCTL_DISK_BASE,15,METHOD_BUFFERED,FILE_ANY_ACCESS)
50 #define IOCTL_DISK_REQUEST_DATA CTL_CODE(IOCTL_DISK_BASE,16,METHOD_BUFFERED,FILE_ANY_ACCESS)
51 #define IOCTL_DISK_GET_PARTITION_INFO_EX CTL_CODE(IOCTL_DISK_BASE,0x12,METHOD_BUFFERED,FILE_ANY_ACCESS)
52 #define IOCTL_DISK_SET_PARTITION_INFO_EX CTL_CODE(IOCTL_DISK_BASE,0x13,METHOD_BUFFERED,FILE_READ_ACCESS | FILE_WRITE_ACCESS)
53 #define IOCTL_DISK_GET_DRIVE_LAYOUT_EX CTL_CODE(IOCTL_DISK_BASE,0x14,METHOD_BUFFERED,FILE_ANY_ACCESS)
54 #define IOCTL_DISK_SET_DRIVE_LAYOUT_EX CTL_CODE(IOCTL_DISK_BASE,0x15,METHOD_BUFFERED,FILE_READ_ACCESS | FILE_WRITE_ACCESS)
55 #define IOCTL_DISK_CREATE_DISK CTL_CODE(IOCTL_DISK_BASE,0x16,METHOD_BUFFERED,FILE_READ_ACCESS | FILE_WRITE_ACCESS)
56 #define IOCTL_DISK_GET_LENGTH_INFO CTL_CODE(IOCTL_DISK_BASE,0x17,METHOD_BUFFERED,FILE_READ_ACCESS)
57 #define IOCTL_DISK_PERFORMANCE_OFF CTL_CODE(IOCTL_DISK_BASE,0x18,METHOD_BUFFERED,FILE_ANY_ACCESS)
58 #define IOCTL_DISK_GET_DRIVE_GEOMETRY_EX CTL_CODE(IOCTL_DISK_BASE,0x28,METHOD_BUFFERED,FILE_ANY_ACCESS)
59 #define IOCTL_DISK_GROW_PARTITION CTL_CODE(IOCTL_DISK_BASE,0x34,METHOD_BUFFERED,FILE_READ_ACCESS | FILE_WRITE_ACCESS)
60 #define IOCTL_DISK_GET_CACHE_INFORMATION CTL_CODE(IOCTL_DISK_BASE,0x35,METHOD_BUFFERED,FILE_READ_ACCESS)
61 #define IOCTL_DISK_SET_CACHE_INFORMATION CTL_CODE(IOCTL_DISK_BASE,0x36,METHOD_BUFFERED,FILE_READ_ACCESS | FILE_WRITE_ACCESS)
62 #define IOCTL_DISK_DELETE_DRIVE_LAYOUT CTL_CODE(IOCTL_DISK_BASE,0x40,METHOD_BUFFERED,FILE_READ_ACCESS | FILE_WRITE_ACCESS)
63 #define IOCTL_DISK_UPDATE_PROPERTIES CTL_CODE(IOCTL_DISK_BASE,0x50,METHOD_BUFFERED,FILE_ANY_ACCESS)
64 #define IOCTL_DISK_CHECK_VERIFY CTL_CODE(IOCTL_DISK_BASE,0x200,METHOD_BUFFERED,FILE_READ_ACCESS)
65 #define IOCTL_DISK_MEDIA_REMOVAL CTL_CODE(IOCTL_DISK_BASE,0x201,METHOD_BUFFERED,FILE_READ_ACCESS)
66 #define IOCTL_DISK_EJECT_MEDIA CTL_CODE(IOCTL_DISK_BASE,0x202,METHOD_BUFFERED,FILE_READ_ACCESS)
67 #define IOCTL_DISK_LOAD_MEDIA CTL_CODE(IOCTL_DISK_BASE,0x203,METHOD_BUFFERED,FILE_READ_ACCESS)
68 #define IOCTL_DISK_RESERVE CTL_CODE(IOCTL_DISK_BASE,0x204,METHOD_BUFFERED,FILE_READ_ACCESS)
69 #define IOCTL_DISK_RELEASE CTL_CODE(IOCTL_DISK_BASE,0x205,METHOD_BUFFERED,FILE_READ_ACCESS)
70 #define IOCTL_DISK_FIND_NEW_DEVICES CTL_CODE(IOCTL_DISK_BASE,0x206,METHOD_BUFFERED,FILE_READ_ACCESS)
71 #define IOCTL_DISK_REMOVE_DEVICE CTL_CODE(IOCTL_DISK_BASE,0x207,METHOD_BUFFERED,FILE_READ_ACCESS)
72 #define IOCTL_DISK_GET_MEDIA_TYPES CTL_CODE(IOCTL_DISK_BASE,0x300,METHOD_BUFFERED,FILE_ANY_ACCESS)
73 #define IOCTL_DISK_UPDATE_DRIVE_SIZE CTL_CODE(IOCTL_DISK_BASE, 0x0032, METHOD_BUFFERED, FILE_READ_ACCESS | FILE_WRITE_ACCESS)
74 #define IOCTL_SERIAL_LSRMST_INSERT CTL_CODE(FILE_DEVICE_SERIAL_PORT,31,METHOD_BUFFERED,FILE_ANY_ACCESS)
76 /* Also in ddk/ntddvol.h */
77 #define IOCTL_VOLUME_BASE ((ULONG) 'V')
78 #define IOCTL_VOLUME_GET_VOLUME_DISK_EXTENTS \
79 CTL_CODE(IOCTL_VOLUME_BASE, 0, METHOD_BUFFERED, FILE_ANY_ACCESS)
80 #define IOCTL_VOLUME_IS_CLUSTERED \
81 CTL_CODE(IOCTL_VOLUME_BASE, 12, METHOD_BUFFERED, FILE_ANY_ACCESS)
83 #define FSCTL_LOCK_VOLUME CTL_CODE(FILE_DEVICE_FILE_SYSTEM,6,METHOD_BUFFERED,FILE_ANY_ACCESS)
84 #define FSCTL_UNLOCK_VOLUME CTL_CODE(FILE_DEVICE_FILE_SYSTEM,7,METHOD_BUFFERED,FILE_ANY_ACCESS)
85 #define FSCTL_DISMOUNT_VOLUME CTL_CODE(FILE_DEVICE_FILE_SYSTEM,8,METHOD_BUFFERED,FILE_ANY_ACCESS)
86 #define FSCTL_MOUNT_DBLS_VOLUME CTL_CODE(FILE_DEVICE_FILE_SYSTEM,13,METHOD_BUFFERED,FILE_ANY_ACCESS)
87 #define FSCTL_GET_COMPRESSION CTL_CODE(FILE_DEVICE_FILE_SYSTEM,15,METHOD_BUFFERED,FILE_ANY_ACCESS)
88 #define FSCTL_SET_COMPRESSION CTL_CODE(FILE_DEVICE_FILE_SYSTEM,16,METHOD_BUFFERED,FILE_READ_DATA|FILE_WRITE_DATA)
89 #define FSCTL_READ_COMPRESSION CTL_CODE(FILE_DEVICE_FILE_SYSTEM,17,METHOD_NEITHER,FILE_READ_DATA)
90 #define FSCTL_WRITE_COMPRESSION CTL_CODE(FILE_DEVICE_FILE_SYSTEM,18,METHOD_NEITHER,FILE_WRITE_DATA)
91 #define FSCTL_GET_NTFS_VOLUME_DATA CTL_CODE(FILE_DEVICE_FILE_SYSTEM,25,METHOD_BUFFERED,FILE_ANY_ACCESS)
92 #define FSCTL_GET_VOLUME_BITMAP CTL_CODE(FILE_DEVICE_FILE_SYSTEM,27,METHOD_NEITHER,FILE_ANY_ACCESS)
93 #define FSCTL_GET_RETRIEVAL_POINTERS CTL_CODE(FILE_DEVICE_FILE_SYSTEM,28,METHOD_NEITHER,FILE_ANY_ACCESS)
94 #define FSCTL_MOVE_FILE CTL_CODE(FILE_DEVICE_FILE_SYSTEM,29,METHOD_BUFFERED,FILE_ANY_ACCESS)
95 #define FSCTL_GET_REPARSE_POINT CTL_CODE(FILE_DEVICE_FILE_SYSTEM, 42, METHOD_BUFFERED, FILE_ANY_ACCESS)
96 #define FSCTL_SET_REPARSE_POINT CTL_CODE(FILE_DEVICE_FILE_SYSTEM, 41, METHOD_BUFFERED, FILE_ANY_ACCESS)
97 #define FSCTL_DELETE_REPARSE_POINT CTL_CODE(FILE_DEVICE_FILE_SYSTEM, 43, METHOD_BUFFERED, FILE_ANY_ACCESS)
98 #define FSCTL_SET_SPARSE CTL_CODE(FILE_DEVICE_FILE_SYSTEM, 49, METHOD_BUFFERED, FILE_SPECIAL_ACCESS)
99 #define DEVICE_TYPE DWORD
100 #define FILE_DEVICE_BEEP 1
101 #define FILE_DEVICE_CD_ROM 2
102 #define FILE_DEVICE_CD_ROM_FILE_SYSTEM 3
103 #define FILE_DEVICE_CONTROLLER 4
104 #define FILE_DEVICE_DATALINK 5
105 #define FILE_DEVICE_DFS 6
106 #define FILE_DEVICE_DISK 7
107 #define FILE_DEVICE_DISK_FILE_SYSTEM 8
108 #define FILE_DEVICE_FILE_SYSTEM 9
109 #define FILE_DEVICE_INPORT_PORT 10
110 #define FILE_DEVICE_KEYBOARD 11
111 #define FILE_DEVICE_MAILSLOT 12
112 #define FILE_DEVICE_MIDI_IN 13
113 #define FILE_DEVICE_MIDI_OUT 14
114 #define FILE_DEVICE_MOUSE 15
115 #define FILE_DEVICE_MULTI_UNC_PROVIDER 16
116 #define FILE_DEVICE_NAMED_PIPE 17
117 #define FILE_DEVICE_NETWORK 18
118 #define FILE_DEVICE_NETWORK_BROWSER 19
119 #define FILE_DEVICE_NETWORK_FILE_SYSTEM 20
120 #define FILE_DEVICE_NULL 21
121 #define FILE_DEVICE_PARALLEL_PORT 22
122 #define FILE_DEVICE_PHYSICAL_NETCARD 23
123 #define FILE_DEVICE_PRINTER 24
124 #define FILE_DEVICE_SCANNER 25
125 #define FILE_DEVICE_SERIAL_MOUSE_PORT 26
126 #define FILE_DEVICE_SERIAL_PORT 27
127 #define FILE_DEVICE_SCREEN 28
128 #define FILE_DEVICE_SOUND 29
129 #define FILE_DEVICE_STREAMS 30
130 #define FILE_DEVICE_TAPE 31
131 #define FILE_DEVICE_TAPE_FILE_SYSTEM 32
132 #define FILE_DEVICE_TRANSPORT 33
133 #define FILE_DEVICE_UNKNOWN 34
134 #define FILE_DEVICE_VIDEO 35
135 #define FILE_DEVICE_VIRTUAL_DISK 36
136 #define FILE_DEVICE_WAVE_IN 37
137 #define FILE_DEVICE_WAVE_OUT 38
138 #define FILE_DEVICE_8042_PORT 39
139 #define FILE_DEVICE_NETWORK_REDIRECTOR 40
140 #define FILE_DEVICE_BATTERY 41
141 #define FILE_DEVICE_BUS_EXTENDER 42
142 #define FILE_DEVICE_MODEM 43
143 #define FILE_DEVICE_VDM 44
144 #define FILE_DEVICE_MASS_STORAGE 45
145 #define FILE_DEVICE_SMB 46
146 #define FILE_DEVICE_KS 47
147 #define FILE_DEVICE_CHANGER 48
148 #define FILE_DEVICE_SMARTCARD 49
149 #define FILE_DEVICE_ACPI 50
150 #define FILE_DEVICE_DVD 51
151 #define FILE_DEVICE_FULLSCREEN_VIDEO 52
152 #define FILE_DEVICE_DFS_FILE_SYSTEM 53
153 #define FILE_DEVICE_DFS_VOLUME 54
154 #define FILE_DEVICE_SERENUM 55
155 #define FILE_DEVICE_TERMSRV 56
156 #define FILE_DEVICE_KSEC 57
157 #define PARTITION_ENTRY_UNUSED 0
158 #define PARTITION_FAT_12 1
159 #define PARTITION_XENIX_1 2
160 #define PARTITION_XENIX_2 3
161 #define PARTITION_FAT_16 4
162 #define PARTITION_EXTENDED 5
163 #define PARTITION_HUGE 6
164 #define PARTITION_IFS 7
165 #define PARTITION_FAT32 0x0B
166 #define PARTITION_FAT32_XINT13 0x0C
167 #define PARTITION_XINT13 0x0E
168 #define PARTITION_XINT13_EXTENDED 0x0F
169 #define PARTITION_PREP 0x41
170 #define PARTITION_LDM 0x42
171 #define PARTITION_UNIX 0x63
172 #define PARTITION_NTFT 128
173 #define VALID_NTFT 0xC0
174 #define METHOD_BUFFERED 0
175 #define METHOD_IN_DIRECT 1
176 #define METHOD_OUT_DIRECT 2
177 #define METHOD_NEITHER 3
178 #define SERIAL_LSRMST_ESCAPE 0
179 #define SERIAL_LSRMST_LSR_DATA 1
180 #define SERIAL_LSRMST_LSR_NODATA 2
181 #define SERIAL_LSRMST_MST 3
183 /* Also in ddk/winddk.h */
184 #define FILE_ANY_ACCESS 0x00000000
185 #define FILE_SPECIAL_ACCESS FILE_ANY_ACCESS
186 #define FILE_READ_ACCESS 0x00000001
187 #define FILE_WRITE_ACCESS 0x00000002
189 #define DISK_LOGGING_START 0
190 #define DISK_LOGGING_STOP 1
191 #define DISK_LOGGING_DUMP 2
192 #define DISK_BINNING 3
193 typedef WORD BAD_TRACK_NUMBER
,*PBAD_TRACK_NUMBER
;
194 typedef enum _BIN_TYPES
{RequestSize
,RequestLocation
} BIN_TYPES
;
195 typedef struct _BIN_RANGE
{
196 LARGE_INTEGER StartValue
;
197 LARGE_INTEGER Length
;
198 } BIN_RANGE
,*PBIN_RANGE
;
199 typedef struct _BIN_COUNT
{
202 } BIN_COUNT
,*PBIN_COUNT
;
203 typedef struct _BIN_RESULTS
{
205 BIN_COUNT BinCounts
[1];
206 } BIN_RESULTS
,*PBIN_RESULTS
;
207 typedef enum _PARTITION_STYLE
{
214 DWORD MaxPartitionCount
;
215 } CREATE_DISK_GPT
,*PCREATE_DISK_GPT
;
218 } CREATE_DISK_MBR
,*PCREATE_DISK_MBR
;
220 PARTITION_STYLE PartitionStyle
;
221 _ANONYMOUS_UNION
union {
225 } CREATE_DISK
,*PCREATE_DISK
;
230 } DISK_CACHE_RETENTION_PRIORITY
;
231 typedef struct _DISK_CACHE_INFORMATION
{
232 BOOLEAN ParametersSavable
;
233 BOOLEAN ReadCacheEnabled
;
234 BOOLEAN WriteCacheEnabled
;
235 DISK_CACHE_RETENTION_PRIORITY ReadRetentionPriority
;
236 DISK_CACHE_RETENTION_PRIORITY WriteRetentionPriority
;
237 WORD DisablePrefetchTransferLength
;
238 BOOLEAN PrefetchScalar
;
239 _ANONYMOUS_UNION
union {
250 } DISK_CACHE_INFORMATION
,*PDISK_CACHE_INFORMATION
;
251 typedef enum _DETECTION_TYPE
{
256 typedef struct _DISK_INT13_INFO
{
259 WORD SectorsPerTrack
;
262 } DISK_INT13_INFO
,*PDISK_INT13_INFO
;
263 typedef struct _DISK_EX_INT13_INFO
{
268 DWORD ExSectorsPerTrack
;
269 DWORD64 ExSectorsPerDrive
;
272 } DISK_EX_INT13_INFO
,*PDISK_EX_INT13_INFO
;
273 typedef struct _DISK_DETECTION_INFO
{
274 DWORD SizeOfDetectInfo
;
275 DETECTION_TYPE DetectionType
;
276 _ANONYMOUS_UNION
union {
277 _ANONYMOUS_STRUCT
struct {
278 DISK_INT13_INFO Int13
;
279 DISK_EX_INT13_INFO ExInt13
;
282 } DISK_DETECTION_INFO
,*PDISK_DETECTION_INFO
;
283 typedef enum _MEDIA_TYPE
{
310 } MEDIA_TYPE
,*PMEDIA_TYPE
;
311 typedef struct _DISK_GEOMETRY
{
312 LARGE_INTEGER Cylinders
;
313 MEDIA_TYPE MediaType
;
314 DWORD TracksPerCylinder
;
315 DWORD SectorsPerTrack
;
316 DWORD BytesPerSector
;
317 } DISK_GEOMETRY
,*PDISK_GEOMETRY
;
318 typedef struct _DISK_GEOMETRY_EX
{
319 DISK_GEOMETRY Geometry
;
320 LARGE_INTEGER DiskSize
;
322 } DISK_GEOMETRY_EX
,*PDISK_GEOMETRY_EX
;
323 typedef struct _DISK_GROW_PARTITION
{
324 DWORD PartitionNumber
;
325 LARGE_INTEGER BytesToGrow
;
326 } DISK_GROW_PARTITION
, *PDISK_GROW_PARTITION
;
327 typedef struct _DISK_PARTITION_INFO
{
328 DWORD SizeOfPartitionInfo
;
329 PARTITION_STYLE PartitionStyle
;
330 _ANONYMOUS_UNION
union {
338 } DISK_PARTITION_INFO
,*PDISK_PARTITION_INFO
;
339 typedef struct _DISK_PERFORMANCE
{
340 LARGE_INTEGER BytesRead
;
341 LARGE_INTEGER BytesWritten
;
342 LARGE_INTEGER ReadTime
;
343 LARGE_INTEGER WriteTime
;
347 } DISK_PERFORMANCE
, *PDISK_PERFORMANCE
;
348 typedef struct _DISK_RECORD
{
349 LARGE_INTEGER ByteOffset
;
350 LARGE_INTEGER StartTime
;
351 LARGE_INTEGER EndTime
;
352 PVOID VirtualAddress
;
356 } DISK_RECORD
,*PDISK_RECORD
;
357 typedef struct _DISK_LOGGING
{
361 } DISK_LOGGING
,*PDISK_LOGGING
;
362 typedef struct DiskQuotaUserInformation
{
364 LONGLONG QuotaThreshold
;
366 } DISKQUOTA_USER_INFORMATION
,*PDISKQUOTA_USER_INFORMATION
;
367 typedef struct _FORMAT_PARAMETERS
{
368 MEDIA_TYPE MediaType
;
369 DWORD StartCylinderNumber
;
370 DWORD EndCylinderNumber
;
371 DWORD StartHeadNumber
;
373 } FORMAT_PARAMETERS
,*PFORMAT_PARAMETERS
;
374 typedef struct _FORMAT_EX_PARAMETERS
{
375 MEDIA_TYPE MediaType
;
376 DWORD StartCylinderNumber
;
377 DWORD EndCylinderNumber
;
378 DWORD StartHeadNumber
;
380 WORD FormatGapLength
;
381 WORD SectorsPerTrack
;
382 WORD SectorNumber
[1];
383 } FORMAT_EX_PARAMETERS
,*PFORMAT_EX_PARAMETERS
;
385 LARGE_INTEGER Length
;
386 } GET_LENGTH_INFORMATION
;
387 typedef struct _HISTOGRAM_BUCKET
{
390 } HISTOGRAM_BUCKET
,*PHISTOGRAM_BUCKET
;
391 typedef struct _DISK_HISTOGRAM
{
392 LARGE_INTEGER DiskSize
;
395 LARGE_INTEGER Average
;
396 LARGE_INTEGER AverageRead
;
397 LARGE_INTEGER AverageWrite
;
402 PHISTOGRAM_BUCKET Histogram
;
403 } DISK_HISTOGRAM
,*PDISK_HISTOGRAM
;
404 typedef struct _DISK_EXTENT
{
406 LARGE_INTEGER StartingOffset
;
407 LARGE_INTEGER ExtentLength
;
408 } DISK_EXTENT
,*PDISK_EXTENT
;
409 typedef struct _VOLUME_DISK_EXTENTS
{
410 DWORD NumberOfDiskExtents
;
411 DISK_EXTENT Extents
[1];
412 } VOLUME_DISK_EXTENTS
,*PVOLUME_DISK_EXTENTS
;
413 typedef struct _PARTITION_INFORMATION
{
414 LARGE_INTEGER StartingOffset
;
415 LARGE_INTEGER PartitionLength
;
417 DWORD PartitionNumber
;
419 BOOLEAN BootIndicator
;
420 BOOLEAN RecognizedPartition
;
421 BOOLEAN RewritePartition
;
422 } PARTITION_INFORMATION
,*PPARTITION_INFORMATION
;
423 typedef struct _DRIVE_LAYOUT_INFORMATION
{
424 DWORD PartitionCount
;
426 PARTITION_INFORMATION PartitionEntry
[1];
427 } DRIVE_LAYOUT_INFORMATION
, *PDRIVE_LAYOUT_INFORMATION
;
428 typedef struct _DRIVE_LAYOUT_INFORMATION_GPT
{
430 LARGE_INTEGER StartingUsableOffset
;
431 LARGE_INTEGER UsableLength
;
432 ULONG MaxPartitionCount
;
433 } DRIVE_LAYOUT_INFORMATION_GPT
,*PDRIVE_LAYOUT_INFORMATION_GPT
;
434 typedef struct _DRIVE_LAYOUT_INFORMATION_MBR
{
436 } DRIVE_LAYOUT_INFORMATION_MBR
, *PDRIVE_LAYOUT_INFORMATION_MBR
;
437 typedef struct _PARTITION_INFORMATION_MBR
{
439 BOOLEAN BootIndicator
;
440 BOOLEAN RecognizedPartition
;
442 } PARTITION_INFORMATION_MBR
;
443 typedef struct _PARTITION_INFORMATION_GPT
{
448 } PARTITION_INFORMATION_GPT
;
449 typedef struct _PARTITION_INFORMATION_EX
{
450 PARTITION_STYLE PartitionStyle
;
451 LARGE_INTEGER StartingOffset
;
452 LARGE_INTEGER PartitionLength
;
453 DWORD PartitionNumber
;
454 BOOLEAN RewritePartition
;
455 _ANONYMOUS_UNION
union {
456 PARTITION_INFORMATION_MBR Mbr
;
457 PARTITION_INFORMATION_GPT Gpt
;
459 } PARTITION_INFORMATION_EX
;
460 typedef struct _DRIVE_LAYOUT_INFORMATION_EX
{
461 DWORD PartitionStyle
;
462 DWORD PartitionCount
;
463 _ANONYMOUS_UNION
union {
464 DRIVE_LAYOUT_INFORMATION_MBR Mbr
;
465 DRIVE_LAYOUT_INFORMATION_GPT Gpt
;
467 PARTITION_INFORMATION_EX PartitionEntry
[1];
468 } DRIVE_LAYOUT_INFORMATION_EX
,*PDRIVE_LAYOUT_INFORMATION_EX
;
471 LARGE_INTEGER StartingVcn
;
472 LARGE_INTEGER StartingLcn
;
474 } MOVE_FILE_DATA
,*PMOVE_FILE_DATA
;
475 typedef struct _PERF_BIN
{
478 BIN_RANGE BinsRanges
[1];
479 } PERF_BIN
,*PPERF_BIN
;
480 typedef struct _PREVENT_MEDIA_REMOVAL
{
481 BOOLEAN PreventMediaRemoval
;
482 } PREVENT_MEDIA_REMOVAL
,*PPREVENT_MEDIA_REMOVAL
;
483 typedef struct RETRIEVAL_POINTERS_BUFFER
{
485 LARGE_INTEGER StartingVcn
;
487 LARGE_INTEGER NextVcn
;
490 } RETRIEVAL_POINTERS_BUFFER
,*PRETRIEVAL_POINTERS_BUFFER
;
491 typedef struct _REASSIGN_BLOCKS
{
494 DWORD BlockNumber
[1];
495 } REASSIGN_BLOCKS
,*PREASSIGN_BLOCKS
;
496 typedef struct _SET_PARTITION_INFORMATION
{
498 } SET_PARTITION_INFORMATION
,*PSET_PARTITION_INFORMATION
;
500 LARGE_INTEGER StartingLcn
;
501 } STARTING_LCN_INPUT_BUFFER
,*PSTARTING_LCN_INPUT_BUFFER
;
503 LARGE_INTEGER StartingVcn
;
504 } STARTING_VCN_INPUT_BUFFER
,*PSTARTING_VCN_INPUT_BUFFER
;
505 typedef struct _VERIFY_INFORMATION
{
506 LARGE_INTEGER StartingOffset
;
508 } VERIFY_INFORMATION
,*PVERIFY_INFORMATION
;
510 LARGE_INTEGER StartingLcn
;
511 LARGE_INTEGER BitmapSize
;
513 } VOLUME_BITMAP_BUFFER
,*PVOLUME_BITMAP_BUFFER
;
515 LARGE_INTEGER VolumeSerialNumber
;
516 LARGE_INTEGER NumberSectors
;
517 LARGE_INTEGER TotalClusters
;
518 LARGE_INTEGER FreeClusters
;
519 LARGE_INTEGER TotalReserved
;
520 DWORD BytesPerSector
;
521 DWORD BytesPerCluster
;
522 DWORD BytesPerFileRecordSegment
;
523 DWORD ClustersPerFileRecordSegment
;
524 LARGE_INTEGER MftValidDataLength
;
525 LARGE_INTEGER MftStartLcn
;
526 LARGE_INTEGER Mft2StartLcn
;
527 LARGE_INTEGER MftZoneStart
;
528 LARGE_INTEGER MftZoneEnd
;
529 } NTFS_VOLUME_DATA_BUFFER
, *PNTFS_VOLUME_DATA_BUFFER
;
531 #define IsRecognizedPartition(t)\
532 (((t&PARTITION_NTFT)&&((t&~VALID_NTFT)==PARTITION_FAT_12))||\
533 ((t&PARTITION_NTFT)&&((t&~VALID_NTFT)==PARTITION_FAT_16))||\
534 ((t&PARTITION_NTFT)&&((t&~VALID_NTFT)==PARTITION_IFS))||\
535 ((t&PARTITION_NTFT)&&((t&~VALID_NTFT)==PARTITION_HUGE))||\
536 ((t&PARTITION_NTFT)&&((t&~VALID_NTFT)==PARTITION_FAT32))||\
537 ((t&PARTITION_NTFT)&&((t&~VALID_NTFT)==PARTITION_FAT32_XINT13))||\
538 ((t&PARTITION_NTFT)&&((t&~VALID_NTFT)==PARTITION_XINT13))||\
539 ((t&~PARTITION_NTFT)==PARTITION_FAT_12)||\
540 ((t&~PARTITION_NTFT)==PARTITION_FAT_16)||\
541 ((t&~PARTITION_NTFT)==PARTITION_IFS)||\
542 ((t&~PARTITION_NTFT)==PARTITION_HUGE)||\
543 ((t&~PARTITION_NTFT)==PARTITION_FAT32)||\
544 ((t&~PARTITION_NTFT)==PARTITION_FAT32_XINT13)||\
545 ((t&~PARTITION_NTFT)==PARTITION_XINT13))
546 #define IsContainerPartition(t)\
547 (((t&PARTITION_NTFT)&&((t&~VALID_NTFT)==PARTITION_EXTENDED))||\
548 ((t&PARTITION_NTFT)&&((t&~VALID_NTFT)==PARTITION_XINT13_EXTENDED))||\
549 ((t&~PARTITION_NTFT)==PARTITION_EXTENDED)||\
550 ((t&~PARTITION_NTFT)==PARTITION_XINT13_EXTENDED))