Initial bulk commit for "Git on MSys"
[msysgit/historical-msysgit.git] / mingw / include / winioctl.h
blob87f121fe56488548b37918857d10a3bc19fe4576
1 #ifndef _WINIOCTL_H
2 #define _WINIOCTL_H
3 #if __GNUC__ >=3
4 #pragma GCC system_header
5 #endif
7 #ifdef __cplusplus
8 extern "C" {
9 #endif
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 {
200 BIN_RANGE BinRange;
201 DWORD BinCount;
202 } BIN_COUNT,*PBIN_COUNT;
203 typedef struct _BIN_RESULTS {
204 DWORD NumberOfBins;
205 BIN_COUNT BinCounts[1];
206 } BIN_RESULTS,*PBIN_RESULTS;
207 typedef enum _PARTITION_STYLE {
208 PARTITION_STYLE_MBR,
209 PARTITION_STYLE_GPT,
210 PARTITION_STYLE_RAW
211 } PARTITION_STYLE;
212 typedef struct {
213 GUID DiskId;
214 DWORD MaxPartitionCount;
215 } CREATE_DISK_GPT,*PCREATE_DISK_GPT;
216 typedef struct {
217 DWORD Signature;
218 } CREATE_DISK_MBR,*PCREATE_DISK_MBR;
219 typedef struct {
220 PARTITION_STYLE PartitionStyle;
221 _ANONYMOUS_UNION union {
222 CREATE_DISK_MBR Mbr;
223 CREATE_DISK_GPT Gpt;
225 } CREATE_DISK,*PCREATE_DISK;
226 typedef enum {
227 EqualPriority,
228 KeepPrefetchedData,
229 KeepReadData
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 {
240 struct {
241 WORD Minimum;
242 WORD Maximum;
243 WORD MaximumBlocks;
244 } ScalarPrefetch;
245 struct {
246 WORD Minimum;
247 WORD Maximum;
248 } BlockPrefetch;
250 } DISK_CACHE_INFORMATION,*PDISK_CACHE_INFORMATION;
251 typedef enum _DETECTION_TYPE {
252 DetectNone,
253 DetectInt13,
254 DetectExInt13
255 } DETECTION_TYPE;
256 typedef struct _DISK_INT13_INFO {
257 WORD DriveSelect;
258 DWORD MaxCylinders;
259 WORD SectorsPerTrack;
260 WORD MaxHeads;
261 WORD NumberDrives;
262 } DISK_INT13_INFO,*PDISK_INT13_INFO;
263 typedef struct _DISK_EX_INT13_INFO {
264 WORD ExBufferSize;
265 WORD ExFlags;
266 DWORD ExCylinders;
267 DWORD ExHeads;
268 DWORD ExSectorsPerTrack;
269 DWORD64 ExSectorsPerDrive;
270 WORD ExSectorSize;
271 WORD ExReserved;
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 {
284 Unknown,
285 F5_1Pt2_512,
286 F3_1Pt44_512,
287 F3_2Pt88_512,
288 F3_20Pt8_512,
289 F3_720_512,
290 F5_360_512,
291 F5_320_512,
292 F5_320_1024,
293 F5_180_512,
294 F5_160_512,
295 RemovableMedia,
296 FixedMedia,
297 F3_120M_512,
298 F3_640_512,
299 F5_640_512,
300 F5_720_512,
301 F3_1Pt2_512,
302 F3_1Pt23_1024,
303 F5_1Pt23_1024,
304 F3_128Mb_512,
305 F3_230Mb_512,
306 F8_256_128,
307 F3_200Mb_512,
308 F3_240M_512,
309 F3_32M_512
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;
321 BYTE Data[1];
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 {
331 struct {
332 DWORD Signature;
333 } Mbr;
334 struct {
335 GUID DiskId;
336 } Gpt;
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;
344 DWORD ReadCount;
345 DWORD WriteCount;
346 DWORD QueueDepth;
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;
353 DWORD NumberOfBytes;
354 BYTE DeviceNumber;
355 BOOLEAN ReadRequest;
356 } DISK_RECORD,*PDISK_RECORD;
357 typedef struct _DISK_LOGGING {
358 BYTE Function;
359 PVOID BufferAddress;
360 DWORD BufferSize;
361 } DISK_LOGGING,*PDISK_LOGGING;
362 typedef struct DiskQuotaUserInformation {
363 LONGLONG QuotaUsed;
364 LONGLONG QuotaThreshold;
365 LONGLONG QuotaLimit;
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;
372 DWORD EndHeadNumber;
373 } FORMAT_PARAMETERS,*PFORMAT_PARAMETERS;
374 typedef struct _FORMAT_EX_PARAMETERS {
375 MEDIA_TYPE MediaType;
376 DWORD StartCylinderNumber;
377 DWORD EndCylinderNumber;
378 DWORD StartHeadNumber;
379 DWORD EndHeadNumber;
380 WORD FormatGapLength;
381 WORD SectorsPerTrack;
382 WORD SectorNumber[1];
383 } FORMAT_EX_PARAMETERS,*PFORMAT_EX_PARAMETERS;
384 typedef struct {
385 LARGE_INTEGER Length;
386 } GET_LENGTH_INFORMATION;
387 typedef struct _HISTOGRAM_BUCKET {
388 DWORD Reads;
389 DWORD Writes;
390 } HISTOGRAM_BUCKET,*PHISTOGRAM_BUCKET;
391 typedef struct _DISK_HISTOGRAM {
392 LARGE_INTEGER DiskSize;
393 LARGE_INTEGER Start;
394 LARGE_INTEGER End;
395 LARGE_INTEGER Average;
396 LARGE_INTEGER AverageRead;
397 LARGE_INTEGER AverageWrite;
398 DWORD Granularity;
399 DWORD Size;
400 DWORD ReadCount;
401 DWORD WriteCount;
402 PHISTOGRAM_BUCKET Histogram;
403 } DISK_HISTOGRAM,*PDISK_HISTOGRAM;
404 typedef struct _DISK_EXTENT {
405 DWORD DiskNumber;
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;
416 DWORD HiddenSectors;
417 DWORD PartitionNumber;
418 BYTE PartitionType;
419 BOOLEAN BootIndicator;
420 BOOLEAN RecognizedPartition;
421 BOOLEAN RewritePartition;
422 } PARTITION_INFORMATION,*PPARTITION_INFORMATION;
423 typedef struct _DRIVE_LAYOUT_INFORMATION {
424 DWORD PartitionCount;
425 DWORD Signature;
426 PARTITION_INFORMATION PartitionEntry[1];
427 } DRIVE_LAYOUT_INFORMATION, *PDRIVE_LAYOUT_INFORMATION;
428 typedef struct _DRIVE_LAYOUT_INFORMATION_GPT {
429 GUID DiskId;
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 {
435 ULONG Signature;
436 } DRIVE_LAYOUT_INFORMATION_MBR, *PDRIVE_LAYOUT_INFORMATION_MBR;
437 typedef struct _PARTITION_INFORMATION_MBR {
438 BYTE PartitionType;
439 BOOLEAN BootIndicator;
440 BOOLEAN RecognizedPartition;
441 DWORD HiddenSectors;
442 } PARTITION_INFORMATION_MBR;
443 typedef struct _PARTITION_INFORMATION_GPT {
444 GUID PartitionType;
445 GUID PartitionId;
446 DWORD64 Attributes;
447 WCHAR Name[36];
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;
469 typedef struct {
470 HANDLE FileHandle;
471 LARGE_INTEGER StartingVcn;
472 LARGE_INTEGER StartingLcn;
473 DWORD ClusterCount;
474 } MOVE_FILE_DATA,*PMOVE_FILE_DATA;
475 typedef struct _PERF_BIN {
476 DWORD NumberOfBins;
477 DWORD TypeOfBin;
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 {
484 DWORD ExtentCount;
485 LARGE_INTEGER StartingVcn;
486 struct {
487 LARGE_INTEGER NextVcn;
488 LARGE_INTEGER Lcn;
489 } Extents[1];
490 } RETRIEVAL_POINTERS_BUFFER,*PRETRIEVAL_POINTERS_BUFFER;
491 typedef struct _REASSIGN_BLOCKS {
492 WORD Reserved;
493 WORD Count;
494 DWORD BlockNumber[1];
495 } REASSIGN_BLOCKS,*PREASSIGN_BLOCKS;
496 typedef struct _SET_PARTITION_INFORMATION {
497 BYTE PartitionType;
498 } SET_PARTITION_INFORMATION,*PSET_PARTITION_INFORMATION;
499 typedef struct {
500 LARGE_INTEGER StartingLcn;
501 } STARTING_LCN_INPUT_BUFFER,*PSTARTING_LCN_INPUT_BUFFER;
502 typedef struct {
503 LARGE_INTEGER StartingVcn;
504 } STARTING_VCN_INPUT_BUFFER,*PSTARTING_VCN_INPUT_BUFFER;
505 typedef struct _VERIFY_INFORMATION {
506 LARGE_INTEGER StartingOffset;
507 DWORD Length;
508 } VERIFY_INFORMATION,*PVERIFY_INFORMATION;
509 typedef struct {
510 LARGE_INTEGER StartingLcn;
511 LARGE_INTEGER BitmapSize;
512 BYTE Buffer[1];
513 } VOLUME_BITMAP_BUFFER,*PVOLUME_BITMAP_BUFFER;
514 typedef struct {
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))
551 #ifdef __cplusplus
553 #endif
554 #endif