[SDK] One step further towards ReactOS source code tree restructure: the sdk folder...
[reactos.git] / reactos / sdk / include / psdk / winioctl.h
1 #ifndef _WINIOCTL_
2 #define _WINIOCTL_
3
4 #ifdef __cplusplus
5 extern "C" {
6 #endif
7
8 #ifdef _MSC_VER
9 #pragma warning(push)
10 #pragma warning(disable:4201)
11 #pragma warning(disable:4820)
12 #endif
13
14 #define HIST_NO_OF_BUCKETS 24
15 #define HISTOGRAM_BUCKET_SIZE sizeof(HISTOGRAM_BUCKET)
16 #define DISK_HISTOGRAM_SIZE sizeof(DISK_HISTOGRAM)
17
18 #ifndef _NTDDSTOR_H_
19 #define IOCTL_STORAGE_BASE FILE_DEVICE_MASS_STORAGE
20 #define IOCTL_STORAGE_CHECK_VERIFY CTL_CODE(IOCTL_STORAGE_BASE, 0x0200, METHOD_BUFFERED, FILE_READ_ACCESS)
21 #define IOCTL_STORAGE_CHECK_VERIFY2 CTL_CODE(IOCTL_STORAGE_BASE, 0x0200, METHOD_BUFFERED, FILE_ANY_ACCESS)
22 #define IOCTL_STORAGE_MEDIA_REMOVAL CTL_CODE(IOCTL_STORAGE_BASE, 0x0201, METHOD_BUFFERED, FILE_READ_ACCESS)
23 #define IOCTL_STORAGE_EJECT_MEDIA CTL_CODE(IOCTL_STORAGE_BASE, 0x0202, METHOD_BUFFERED, FILE_READ_ACCESS)
24 #define IOCTL_STORAGE_LOAD_MEDIA CTL_CODE(IOCTL_STORAGE_BASE, 0x0203, METHOD_BUFFERED, FILE_READ_ACCESS)
25 #define IOCTL_STORAGE_LOAD_MEDIA2 CTL_CODE(IOCTL_STORAGE_BASE, 0x0203, METHOD_BUFFERED, FILE_ANY_ACCESS)
26 #define IOCTL_STORAGE_RESERVE CTL_CODE(IOCTL_STORAGE_BASE, 0x0204, METHOD_BUFFERED, FILE_READ_ACCESS)
27 #define IOCTL_STORAGE_RELEASE CTL_CODE(IOCTL_STORAGE_BASE, 0x0205, METHOD_BUFFERED, FILE_READ_ACCESS)
28 #define IOCTL_STORAGE_FIND_NEW_DEVICES CTL_CODE(IOCTL_STORAGE_BASE, 0x0206, METHOD_BUFFERED, FILE_READ_ACCESS)
29 #define IOCTL_STORAGE_EJECTION_CONTROL CTL_CODE(IOCTL_STORAGE_BASE, 0x0250, METHOD_BUFFERED, FILE_ANY_ACCESS)
30 #define IOCTL_STORAGE_MCN_CONTROL CTL_CODE(IOCTL_STORAGE_BASE, 0x0251, METHOD_BUFFERED, FILE_ANY_ACCESS)
31 #define IOCTL_STORAGE_GET_MEDIA_TYPES CTL_CODE(IOCTL_STORAGE_BASE, 0x0300, METHOD_BUFFERED, FILE_ANY_ACCESS)
32 #define IOCTL_STORAGE_GET_MEDIA_TYPES_EX CTL_CODE(IOCTL_STORAGE_BASE, 0x0301, METHOD_BUFFERED, FILE_ANY_ACCESS)
33 #define IOCTL_STORAGE_RESET_BUS CTL_CODE(IOCTL_STORAGE_BASE, 0x0400, METHOD_BUFFERED, FILE_READ_ACCESS)
34 #define IOCTL_STORAGE_RESET_DEVICE CTL_CODE(IOCTL_STORAGE_BASE, 0x0401, METHOD_BUFFERED, FILE_READ_ACCESS)
35 #define IOCTL_STORAGE_GET_DEVICE_NUMBER CTL_CODE(IOCTL_STORAGE_BASE, 0x0420, METHOD_BUFFERED, FILE_ANY_ACCESS)
36 #define IOCTL_STORAGE_PREDICT_FAILURE CTL_CODE(IOCTL_STORAGE_BASE, 0x0440, METHOD_BUFFERED, FILE_ANY_ACCESS)
37 #endif
38
39 #define IOCTL_DISK_BASE FILE_DEVICE_DISK
40 #define IOCTL_DISK_GET_DRIVE_GEOMETRY CTL_CODE(IOCTL_DISK_BASE,0,METHOD_BUFFERED, FILE_ANY_ACCESS)
41 #define IOCTL_DISK_GET_PARTITION_INFO CTL_CODE(IOCTL_DISK_BASE,1,METHOD_BUFFERED,FILE_READ_ACCESS)
42 #define IOCTL_DISK_SET_PARTITION_INFO CTL_CODE(IOCTL_DISK_BASE,2,METHOD_BUFFERED,FILE_READ_ACCESS|FILE_WRITE_ACCESS)
43 #define IOCTL_DISK_GET_DRIVE_LAYOUT CTL_CODE(IOCTL_DISK_BASE,3,METHOD_BUFFERED,FILE_READ_ACCESS)
44 #define IOCTL_DISK_SET_DRIVE_LAYOUT CTL_CODE(IOCTL_DISK_BASE,4,METHOD_BUFFERED,FILE_READ_ACCESS|FILE_WRITE_ACCESS)
45 #define IOCTL_DISK_VERIFY CTL_CODE(IOCTL_DISK_BASE,5,METHOD_BUFFERED,FILE_ANY_ACCESS)
46 #define IOCTL_DISK_FORMAT_TRACKS CTL_CODE(IOCTL_DISK_BASE,6,METHOD_BUFFERED,FILE_READ_ACCESS|FILE_WRITE_ACCESS)
47 #define IOCTL_DISK_REASSIGN_BLOCKS CTL_CODE(IOCTL_DISK_BASE,7,METHOD_BUFFERED,FILE_READ_ACCESS|FILE_WRITE_ACCESS)
48 #define IOCTL_DISK_PERFORMANCE CTL_CODE(IOCTL_DISK_BASE,8,METHOD_BUFFERED,FILE_ANY_ACCESS)
49 #define IOCTL_DISK_IS_WRITABLE CTL_CODE(IOCTL_DISK_BASE,9,METHOD_BUFFERED,FILE_ANY_ACCESS)
50 #define IOCTL_DISK_LOGGING CTL_CODE(IOCTL_DISK_BASE,10,METHOD_BUFFERED,FILE_ANY_ACCESS)
51 #define IOCTL_DISK_FORMAT_TRACKS_EX CTL_CODE(IOCTL_DISK_BASE,11,METHOD_BUFFERED,FILE_READ_ACCESS|FILE_WRITE_ACCESS)
52 #define IOCTL_DISK_HISTOGRAM_STRUCTURE CTL_CODE(IOCTL_DISK_BASE,12,METHOD_BUFFERED,FILE_ANY_ACCESS)
53 #define IOCTL_DISK_HISTOGRAM_DATA CTL_CODE(IOCTL_DISK_BASE,13,METHOD_BUFFERED,FILE_ANY_ACCESS)
54 #define IOCTL_DISK_HISTOGRAM_RESET CTL_CODE(IOCTL_DISK_BASE,14,METHOD_BUFFERED,FILE_ANY_ACCESS)
55 #define IOCTL_DISK_REQUEST_STRUCTURE CTL_CODE(IOCTL_DISK_BASE,15,METHOD_BUFFERED,FILE_ANY_ACCESS)
56 #define IOCTL_DISK_REQUEST_DATA CTL_CODE(IOCTL_DISK_BASE,16,METHOD_BUFFERED,FILE_ANY_ACCESS)
57 #define IOCTL_DISK_GET_PARTITION_INFO_EX CTL_CODE(IOCTL_DISK_BASE,0x12,METHOD_BUFFERED,FILE_ANY_ACCESS)
58 #define IOCTL_DISK_SET_PARTITION_INFO_EX CTL_CODE(IOCTL_DISK_BASE,0x13,METHOD_BUFFERED,FILE_READ_ACCESS | FILE_WRITE_ACCESS)
59 #define IOCTL_DISK_GET_DRIVE_LAYOUT_EX CTL_CODE(IOCTL_DISK_BASE,0x14,METHOD_BUFFERED,FILE_ANY_ACCESS)
60 #define IOCTL_DISK_SET_DRIVE_LAYOUT_EX CTL_CODE(IOCTL_DISK_BASE,0x15,METHOD_BUFFERED,FILE_READ_ACCESS | FILE_WRITE_ACCESS)
61 #define IOCTL_DISK_CREATE_DISK CTL_CODE(IOCTL_DISK_BASE,0x16,METHOD_BUFFERED,FILE_READ_ACCESS | FILE_WRITE_ACCESS)
62 #define IOCTL_DISK_GET_LENGTH_INFO CTL_CODE(IOCTL_DISK_BASE,0x17,METHOD_BUFFERED,FILE_READ_ACCESS)
63 #define IOCTL_DISK_PERFORMANCE_OFF CTL_CODE(IOCTL_DISK_BASE,0x18,METHOD_BUFFERED,FILE_ANY_ACCESS)
64 #define IOCTL_DISK_GET_DRIVE_GEOMETRY_EX CTL_CODE(IOCTL_DISK_BASE,0x28,METHOD_BUFFERED,FILE_ANY_ACCESS)
65 #define IOCTL_DISK_GROW_PARTITION CTL_CODE(IOCTL_DISK_BASE,0x34,METHOD_BUFFERED,FILE_READ_ACCESS | FILE_WRITE_ACCESS)
66 #define IOCTL_DISK_GET_CACHE_INFORMATION CTL_CODE(IOCTL_DISK_BASE,0x35,METHOD_BUFFERED,FILE_READ_ACCESS)
67 #define IOCTL_DISK_SET_CACHE_INFORMATION CTL_CODE(IOCTL_DISK_BASE,0x36,METHOD_BUFFERED,FILE_READ_ACCESS | FILE_WRITE_ACCESS)
68 #define IOCTL_DISK_DELETE_DRIVE_LAYOUT CTL_CODE(IOCTL_DISK_BASE,0x40,METHOD_BUFFERED,FILE_READ_ACCESS | FILE_WRITE_ACCESS)
69 #define IOCTL_DISK_UPDATE_PROPERTIES CTL_CODE(IOCTL_DISK_BASE,0x50,METHOD_BUFFERED,FILE_ANY_ACCESS)
70 #define IOCTL_DISK_CHECK_VERIFY CTL_CODE(IOCTL_DISK_BASE,0x200,METHOD_BUFFERED,FILE_READ_ACCESS)
71 #define IOCTL_DISK_MEDIA_REMOVAL CTL_CODE(IOCTL_DISK_BASE,0x201,METHOD_BUFFERED,FILE_READ_ACCESS)
72 #define IOCTL_DISK_EJECT_MEDIA CTL_CODE(IOCTL_DISK_BASE,0x202,METHOD_BUFFERED,FILE_READ_ACCESS)
73 #define IOCTL_DISK_LOAD_MEDIA CTL_CODE(IOCTL_DISK_BASE,0x203,METHOD_BUFFERED,FILE_READ_ACCESS)
74 #define IOCTL_DISK_RESERVE CTL_CODE(IOCTL_DISK_BASE,0x204,METHOD_BUFFERED,FILE_READ_ACCESS)
75 #define IOCTL_DISK_RELEASE CTL_CODE(IOCTL_DISK_BASE,0x205,METHOD_BUFFERED,FILE_READ_ACCESS)
76 #define IOCTL_DISK_FIND_NEW_DEVICES CTL_CODE(IOCTL_DISK_BASE,0x206,METHOD_BUFFERED,FILE_READ_ACCESS)
77 #define IOCTL_DISK_REMOVE_DEVICE CTL_CODE(IOCTL_DISK_BASE,0x207,METHOD_BUFFERED,FILE_READ_ACCESS)
78 #define IOCTL_DISK_GET_MEDIA_TYPES CTL_CODE(IOCTL_DISK_BASE,0x300,METHOD_BUFFERED,FILE_ANY_ACCESS)
79 #define IOCTL_DISK_UPDATE_DRIVE_SIZE CTL_CODE(IOCTL_DISK_BASE, 0x0032, METHOD_BUFFERED, FILE_READ_ACCESS | FILE_WRITE_ACCESS)
80 #define IOCTL_SERIAL_LSRMST_INSERT CTL_CODE(FILE_DEVICE_SERIAL_PORT,31,METHOD_BUFFERED,FILE_ANY_ACCESS)
81 #define IOCTL_VOLUME_BASE ((DWORD)'V')
82 #define IOCTL_VOLUME_GET_VOLUME_DISK_EXTENTS CTL_CODE(IOCTL_VOLUME_BASE, 0, 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_PIPE_IMPERSONATE CTL_CODE(FILE_DEVICE_NAMED_PIPE, 7, METHOD_BUFFERED, FILE_ANY_ACCESS)
86 #define FSCTL_DISMOUNT_VOLUME CTL_CODE(FILE_DEVICE_FILE_SYSTEM,8,METHOD_BUFFERED,FILE_ANY_ACCESS)
87 #define FSCTL_MOUNT_DBLS_VOLUME CTL_CODE(FILE_DEVICE_FILE_SYSTEM,13,METHOD_BUFFERED,FILE_ANY_ACCESS)
88 #define FSCTL_GET_COMPRESSION CTL_CODE(FILE_DEVICE_FILE_SYSTEM,15,METHOD_BUFFERED,FILE_ANY_ACCESS)
89 #define FSCTL_SET_COMPRESSION CTL_CODE(FILE_DEVICE_FILE_SYSTEM,16,METHOD_BUFFERED,FILE_READ_DATA|FILE_WRITE_DATA)
90 #define FSCTL_READ_COMPRESSION CTL_CODE(FILE_DEVICE_FILE_SYSTEM,17,METHOD_NEITHER,FILE_READ_DATA)
91 #define FSCTL_WRITE_COMPRESSION CTL_CODE(FILE_DEVICE_FILE_SYSTEM,18,METHOD_NEITHER,FILE_WRITE_DATA)
92 #define FSCTL_GET_NTFS_VOLUME_DATA CTL_CODE(FILE_DEVICE_FILE_SYSTEM,25,METHOD_BUFFERED,FILE_ANY_ACCESS)
93 #define FSCTL_GET_NTFS_FILE_RECORD CTL_CODE(FILE_DEVICE_FILE_SYSTEM,26,METHOD_BUFFERED,FILE_ANY_ACCESS)
94 #define FSCTL_GET_VOLUME_BITMAP CTL_CODE(FILE_DEVICE_FILE_SYSTEM,27,METHOD_NEITHER,FILE_ANY_ACCESS)
95 #define FSCTL_GET_RETRIEVAL_POINTERS CTL_CODE(FILE_DEVICE_FILE_SYSTEM,28,METHOD_NEITHER,FILE_ANY_ACCESS)
96 #define FSCTL_MOVE_FILE CTL_CODE(FILE_DEVICE_FILE_SYSTEM,29,METHOD_BUFFERED,FILE_ANY_ACCESS)
97 #define FSCTL_GET_REPARSE_POINT CTL_CODE(FILE_DEVICE_FILE_SYSTEM, 42, METHOD_BUFFERED, FILE_ANY_ACCESS)
98 #define FSCTL_SET_REPARSE_POINT CTL_CODE(FILE_DEVICE_FILE_SYSTEM, 41, METHOD_BUFFERED, FILE_ANY_ACCESS)
99 #define FSCTL_DELETE_REPARSE_POINT CTL_CODE(FILE_DEVICE_FILE_SYSTEM, 43, METHOD_BUFFERED, FILE_ANY_ACCESS)
100 #define FSCTL_SET_SPARSE CTL_CODE(FILE_DEVICE_FILE_SYSTEM, 49, METHOD_BUFFERED, FILE_SPECIAL_ACCESS)
101
102 #ifndef _DEVIOCTL_
103 #define _DEVIOCTL_
104
105 #define DEVICE_TYPE DWORD
106 #define FILE_DEVICE_BEEP 1
107 #define FILE_DEVICE_CD_ROM 2
108 #define FILE_DEVICE_CD_ROM_FILE_SYSTEM 3
109 #define FILE_DEVICE_CONTROLLER 4
110 #define FILE_DEVICE_DATALINK 5
111 #define FILE_DEVICE_DFS 6
112 #define FILE_DEVICE_DISK 7
113 #define FILE_DEVICE_DISK_FILE_SYSTEM 8
114 #define FILE_DEVICE_FILE_SYSTEM 9
115 #define FILE_DEVICE_INPORT_PORT 10
116 #define FILE_DEVICE_KEYBOARD 11
117 #define FILE_DEVICE_MAILSLOT 12
118 #define FILE_DEVICE_MIDI_IN 13
119 #define FILE_DEVICE_MIDI_OUT 14
120 #define FILE_DEVICE_MOUSE 15
121 #define FILE_DEVICE_MULTI_UNC_PROVIDER 16
122 #define FILE_DEVICE_NAMED_PIPE 17
123 #define FILE_DEVICE_NETWORK 18
124 #define FILE_DEVICE_NETWORK_BROWSER 19
125 #define FILE_DEVICE_NETWORK_FILE_SYSTEM 20
126 #define FILE_DEVICE_NULL 21
127 #define FILE_DEVICE_PARALLEL_PORT 22
128 #define FILE_DEVICE_PHYSICAL_NETCARD 23
129 #define FILE_DEVICE_PRINTER 24
130 #define FILE_DEVICE_SCANNER 25
131 #define FILE_DEVICE_SERIAL_MOUSE_PORT 26
132 #define FILE_DEVICE_SERIAL_PORT 27
133 #define FILE_DEVICE_SCREEN 28
134 #define FILE_DEVICE_SOUND 29
135 #define FILE_DEVICE_STREAMS 30
136 #define FILE_DEVICE_TAPE 31
137 #define FILE_DEVICE_TAPE_FILE_SYSTEM 32
138 #define FILE_DEVICE_TRANSPORT 33
139 #define FILE_DEVICE_UNKNOWN 34
140 #define FILE_DEVICE_VIDEO 35
141 #define FILE_DEVICE_VIRTUAL_DISK 36
142 #define FILE_DEVICE_WAVE_IN 37
143 #define FILE_DEVICE_WAVE_OUT 38
144 #define FILE_DEVICE_8042_PORT 39
145 #define FILE_DEVICE_NETWORK_REDIRECTOR 40
146 #define FILE_DEVICE_BATTERY 41
147 #define FILE_DEVICE_BUS_EXTENDER 42
148 #define FILE_DEVICE_MODEM 43
149 #define FILE_DEVICE_VDM 44
150 #define FILE_DEVICE_MASS_STORAGE 45
151 #define FILE_DEVICE_SMB 46
152 #define FILE_DEVICE_KS 47
153 #define FILE_DEVICE_CHANGER 48
154 #define FILE_DEVICE_SMARTCARD 49
155 #define FILE_DEVICE_ACPI 50
156 #define FILE_DEVICE_DVD 51
157 #define FILE_DEVICE_FULLSCREEN_VIDEO 52
158 #define FILE_DEVICE_DFS_FILE_SYSTEM 53
159 #define FILE_DEVICE_DFS_VOLUME 54
160 #define FILE_DEVICE_SERENUM 55
161 #define FILE_DEVICE_TERMSRV 56
162 #define FILE_DEVICE_KSEC 57
163
164 /* Also in ddk/winddk.h */
165 #define FILE_ANY_ACCESS 0x00000000
166 #define FILE_SPECIAL_ACCESS FILE_ANY_ACCESS
167 #define FILE_READ_ACCESS 0x00000001
168 #define FILE_WRITE_ACCESS 0x00000002
169
170 #define METHOD_BUFFERED 0
171 #define METHOD_IN_DIRECT 1
172 #define METHOD_OUT_DIRECT 2
173 #define METHOD_NEITHER 3
174
175 #define CTL_CODE(t,f,m,a) (((t)<<16)|((a)<<14)|((f)<<2)|(m))
176 #define DEVICE_TYPE_FROM_CTL_CODE(c) (((DWORD)((c)&0xffff0000))>>16)
177
178 #endif /* _DEVIOCTL_ */
179
180 #define PARTITION_ENTRY_UNUSED 0
181 #define PARTITION_FAT_12 1
182 #define PARTITION_XENIX_1 2
183 #define PARTITION_XENIX_2 3
184 #define PARTITION_FAT_16 4
185 #define PARTITION_EXTENDED 5
186 #define PARTITION_HUGE 6
187 #define PARTITION_IFS 7
188 #define PARTITION_FAT32 0x0B
189 #define PARTITION_FAT32_XINT13 0x0C
190 #define PARTITION_XINT13 0x0E
191 #define PARTITION_XINT13_EXTENDED 0x0F
192 #define PARTITION_PREP 0x41
193 #define PARTITION_LDM 0x42
194 #define PARTITION_UNIX 0x63
195 #define PARTITION_NTFT 0x80
196 #define VALID_NTFT 0xC0
197 #ifdef __REACTOS__
198 #define PARTITION_OLD_LINUX 0x43
199 #define PARTITION_LINUX 0x83
200 #endif
201 #define SERIAL_LSRMST_ESCAPE 0
202 #define SERIAL_LSRMST_LSR_DATA 1
203 #define SERIAL_LSRMST_LSR_NODATA 2
204 #define SERIAL_LSRMST_MST 3
205 /* Device GUIDs */
206 #ifdef DEFINE_GUID
207
208 DEFINE_GUID(GUID_DEVINTERFACE_COMPORT, 0x86E0D1E0L, 0x8089,
209 0x11D0, 0x9C, 0xE4, 0x08, 0x00, 0x3E, 0x30, 0x1F, 0x73);
210 DEFINE_GUID(GUID_DEVINTERFACE_SERENUM_BUS_ENUMERATOR, 0x4D36E978L, 0xE325,
211 0x11CE, 0xBF, 0xC1, 0x08, 0x00, 0x2B, 0xE1, 0x03, 0x18);
212
213 /* obsolete GUID names */
214 #define GUID_CLASS_COMPORT GUID_DEVINTERFACE_COMPORT
215 #define GUID_SERENUM_BUS_ENUMERATOR GUID_DEVINTERFACE_SERENUM_BUS_ENUMERATOR
216
217 #endif /* DEFINE_GUID */
218
219 #define DISK_LOGGING_START 0
220 #define DISK_LOGGING_STOP 1
221 #define DISK_LOGGING_DUMP 2
222 #define DISK_BINNING 3
223 typedef WORD BAD_TRACK_NUMBER,*PBAD_TRACK_NUMBER;
224 typedef enum _BIN_TYPES {RequestSize,RequestLocation} BIN_TYPES;
225 typedef struct _BIN_RANGE {
226 LARGE_INTEGER StartValue;
227 LARGE_INTEGER Length;
228 } BIN_RANGE,*PBIN_RANGE;
229 typedef struct _BIN_COUNT {
230 BIN_RANGE BinRange;
231 DWORD BinCount;
232 } BIN_COUNT,*PBIN_COUNT;
233 typedef struct _BIN_RESULTS {
234 DWORD NumberOfBins;
235 BIN_COUNT BinCounts[1];
236 } BIN_RESULTS,*PBIN_RESULTS;
237 typedef enum _PARTITION_STYLE {
238 PARTITION_STYLE_MBR,
239 PARTITION_STYLE_GPT,
240 PARTITION_STYLE_RAW
241 } PARTITION_STYLE;
242 typedef struct {
243 GUID DiskId;
244 DWORD MaxPartitionCount;
245 } CREATE_DISK_GPT,*PCREATE_DISK_GPT;
246 typedef struct {
247 DWORD Signature;
248 } CREATE_DISK_MBR,*PCREATE_DISK_MBR;
249 typedef struct {
250 PARTITION_STYLE PartitionStyle;
251 _ANONYMOUS_UNION union {
252 CREATE_DISK_MBR Mbr;
253 CREATE_DISK_GPT Gpt;
254 };
255 } CREATE_DISK,*PCREATE_DISK;
256 typedef enum {
257 EqualPriority,
258 KeepPrefetchedData,
259 KeepReadData
260 } DISK_CACHE_RETENTION_PRIORITY;
261 typedef struct _DISK_CACHE_INFORMATION {
262 BOOLEAN ParametersSavable;
263 BOOLEAN ReadCacheEnabled;
264 BOOLEAN WriteCacheEnabled;
265 DISK_CACHE_RETENTION_PRIORITY ReadRetentionPriority;
266 DISK_CACHE_RETENTION_PRIORITY WriteRetentionPriority;
267 WORD DisablePrefetchTransferLength;
268 BOOLEAN PrefetchScalar;
269 _ANONYMOUS_UNION union {
270 struct {
271 WORD Minimum;
272 WORD Maximum;
273 WORD MaximumBlocks;
274 } ScalarPrefetch;
275 struct {
276 WORD Minimum;
277 WORD Maximum;
278 } BlockPrefetch;
279 };
280 } DISK_CACHE_INFORMATION,*PDISK_CACHE_INFORMATION;
281 typedef enum _DETECTION_TYPE {
282 DetectNone,
283 DetectInt13,
284 DetectExInt13
285 } DETECTION_TYPE;
286 typedef struct _DISK_INT13_INFO {
287 WORD DriveSelect;
288 DWORD MaxCylinders;
289 WORD SectorsPerTrack;
290 WORD MaxHeads;
291 WORD NumberDrives;
292 } DISK_INT13_INFO,*PDISK_INT13_INFO;
293 typedef struct _DISK_EX_INT13_INFO {
294 WORD ExBufferSize;
295 WORD ExFlags;
296 DWORD ExCylinders;
297 DWORD ExHeads;
298 DWORD ExSectorsPerTrack;
299 DWORD64 ExSectorsPerDrive;
300 WORD ExSectorSize;
301 WORD ExReserved;
302 } DISK_EX_INT13_INFO,*PDISK_EX_INT13_INFO;
303 typedef struct _DISK_DETECTION_INFO {
304 DWORD SizeOfDetectInfo;
305 DETECTION_TYPE DetectionType;
306 _ANONYMOUS_UNION union {
307 _ANONYMOUS_STRUCT struct {
308 DISK_INT13_INFO Int13;
309 DISK_EX_INT13_INFO ExInt13;
310 };
311 };
312 } DISK_DETECTION_INFO,*PDISK_DETECTION_INFO;
313 typedef enum _MEDIA_TYPE {
314 Unknown,
315 F5_1Pt2_512,
316 F3_1Pt44_512,
317 F3_2Pt88_512,
318 F3_20Pt8_512,
319 F3_720_512,
320 F5_360_512,
321 F5_320_512,
322 F5_320_1024,
323 F5_180_512,
324 F5_160_512,
325 RemovableMedia,
326 FixedMedia,
327 F3_120M_512,
328 F3_640_512,
329 F5_640_512,
330 F5_720_512,
331 F3_1Pt2_512,
332 F3_1Pt23_1024,
333 F5_1Pt23_1024,
334 F3_128Mb_512,
335 F3_230Mb_512,
336 F8_256_128,
337 F3_200Mb_512,
338 F3_240M_512,
339 F3_32M_512
340 } MEDIA_TYPE,*PMEDIA_TYPE;
341 typedef struct _DISK_GEOMETRY {
342 LARGE_INTEGER Cylinders;
343 MEDIA_TYPE MediaType;
344 DWORD TracksPerCylinder;
345 DWORD SectorsPerTrack;
346 DWORD BytesPerSector;
347 } DISK_GEOMETRY,*PDISK_GEOMETRY;
348 typedef struct _DISK_GEOMETRY_EX {
349 DISK_GEOMETRY Geometry;
350 LARGE_INTEGER DiskSize;
351 BYTE Data[1];
352 } DISK_GEOMETRY_EX,*PDISK_GEOMETRY_EX;
353 typedef struct _DISK_GROW_PARTITION {
354 DWORD PartitionNumber;
355 LARGE_INTEGER BytesToGrow;
356 } DISK_GROW_PARTITION, *PDISK_GROW_PARTITION;
357 typedef struct _DISK_PARTITION_INFO {
358 DWORD SizeOfPartitionInfo;
359 PARTITION_STYLE PartitionStyle;
360 _ANONYMOUS_UNION union {
361 struct {
362 DWORD Signature;
363 } Mbr;
364 struct {
365 GUID DiskId;
366 } Gpt;
367 };
368 } DISK_PARTITION_INFO,*PDISK_PARTITION_INFO;
369 typedef struct _DISK_PERFORMANCE {
370 LARGE_INTEGER BytesRead;
371 LARGE_INTEGER BytesWritten;
372 LARGE_INTEGER ReadTime;
373 LARGE_INTEGER WriteTime;
374 LARGE_INTEGER IdleTime;
375 DWORD ReadCount;
376 DWORD WriteCount;
377 DWORD QueueDepth;
378 DWORD SplitCount;
379 LARGE_INTEGER QueryTime;
380 DWORD StorageDeviceNumber;
381 WCHAR StorageManagerName[8];
382 } DISK_PERFORMANCE, *PDISK_PERFORMANCE;
383 typedef struct _DISK_RECORD {
384 LARGE_INTEGER ByteOffset;
385 LARGE_INTEGER StartTime;
386 LARGE_INTEGER EndTime;
387 PVOID VirtualAddress;
388 DWORD NumberOfBytes;
389 BYTE DeviceNumber;
390 BOOLEAN ReadRequest;
391 } DISK_RECORD,*PDISK_RECORD;
392 typedef struct _DISK_LOGGING {
393 BYTE Function;
394 PVOID BufferAddress;
395 DWORD BufferSize;
396 } DISK_LOGGING,*PDISK_LOGGING;
397 typedef struct DiskQuotaUserInformation {
398 LONGLONG QuotaUsed;
399 LONGLONG QuotaThreshold;
400 LONGLONG QuotaLimit;
401 } DISKQUOTA_USER_INFORMATION,*PDISKQUOTA_USER_INFORMATION;
402 typedef struct _FORMAT_PARAMETERS {
403 MEDIA_TYPE MediaType;
404 DWORD StartCylinderNumber;
405 DWORD EndCylinderNumber;
406 DWORD StartHeadNumber;
407 DWORD EndHeadNumber;
408 } FORMAT_PARAMETERS,*PFORMAT_PARAMETERS;
409 typedef struct _FORMAT_EX_PARAMETERS {
410 MEDIA_TYPE MediaType;
411 DWORD StartCylinderNumber;
412 DWORD EndCylinderNumber;
413 DWORD StartHeadNumber;
414 DWORD EndHeadNumber;
415 WORD FormatGapLength;
416 WORD SectorsPerTrack;
417 WORD SectorNumber[1];
418 } FORMAT_EX_PARAMETERS,*PFORMAT_EX_PARAMETERS;
419 typedef struct {
420 LARGE_INTEGER Length;
421 } GET_LENGTH_INFORMATION;
422 typedef struct _HISTOGRAM_BUCKET {
423 DWORD Reads;
424 DWORD Writes;
425 } HISTOGRAM_BUCKET,*PHISTOGRAM_BUCKET;
426 typedef struct _DISK_HISTOGRAM {
427 LARGE_INTEGER DiskSize;
428 LARGE_INTEGER Start;
429 LARGE_INTEGER End;
430 LARGE_INTEGER Average;
431 LARGE_INTEGER AverageRead;
432 LARGE_INTEGER AverageWrite;
433 DWORD Granularity;
434 DWORD Size;
435 DWORD ReadCount;
436 DWORD WriteCount;
437 PHISTOGRAM_BUCKET Histogram;
438 } DISK_HISTOGRAM,*PDISK_HISTOGRAM;
439 typedef struct _DISK_EXTENT {
440 DWORD DiskNumber;
441 LARGE_INTEGER StartingOffset;
442 LARGE_INTEGER ExtentLength;
443 } DISK_EXTENT,*PDISK_EXTENT;
444 typedef struct _VOLUME_DISK_EXTENTS {
445 DWORD NumberOfDiskExtents;
446 DISK_EXTENT Extents[1];
447 } VOLUME_DISK_EXTENTS,*PVOLUME_DISK_EXTENTS;
448 typedef struct _PARTITION_INFORMATION {
449 LARGE_INTEGER StartingOffset;
450 LARGE_INTEGER PartitionLength;
451 DWORD HiddenSectors;
452 DWORD PartitionNumber;
453 BYTE PartitionType;
454 BOOLEAN BootIndicator;
455 BOOLEAN RecognizedPartition;
456 BOOLEAN RewritePartition;
457 } PARTITION_INFORMATION,*PPARTITION_INFORMATION;
458 typedef struct _DRIVE_LAYOUT_INFORMATION {
459 DWORD PartitionCount;
460 DWORD Signature;
461 PARTITION_INFORMATION PartitionEntry[1];
462 } DRIVE_LAYOUT_INFORMATION, *PDRIVE_LAYOUT_INFORMATION;
463 typedef struct _DRIVE_LAYOUT_INFORMATION_GPT {
464 GUID DiskId;
465 LARGE_INTEGER StartingUsableOffset;
466 LARGE_INTEGER UsableLength;
467 ULONG MaxPartitionCount;
468 } DRIVE_LAYOUT_INFORMATION_GPT,*PDRIVE_LAYOUT_INFORMATION_GPT;
469 typedef struct _DRIVE_LAYOUT_INFORMATION_MBR {
470 ULONG Signature;
471 } DRIVE_LAYOUT_INFORMATION_MBR, *PDRIVE_LAYOUT_INFORMATION_MBR;
472 typedef struct _PARTITION_INFORMATION_MBR {
473 BYTE PartitionType;
474 BOOLEAN BootIndicator;
475 BOOLEAN RecognizedPartition;
476 DWORD HiddenSectors;
477 } PARTITION_INFORMATION_MBR;
478 typedef struct _PARTITION_INFORMATION_GPT {
479 GUID PartitionType;
480 GUID PartitionId;
481 DWORD64 Attributes;
482 WCHAR Name[36];
483 } PARTITION_INFORMATION_GPT;
484 typedef struct _PARTITION_INFORMATION_EX {
485 PARTITION_STYLE PartitionStyle;
486 LARGE_INTEGER StartingOffset;
487 LARGE_INTEGER PartitionLength;
488 DWORD PartitionNumber;
489 BOOLEAN RewritePartition;
490 _ANONYMOUS_UNION union {
491 PARTITION_INFORMATION_MBR Mbr;
492 PARTITION_INFORMATION_GPT Gpt;
493 };
494 } PARTITION_INFORMATION_EX;
495 typedef struct _DRIVE_LAYOUT_INFORMATION_EX {
496 DWORD PartitionStyle;
497 DWORD PartitionCount;
498 _ANONYMOUS_UNION union {
499 DRIVE_LAYOUT_INFORMATION_MBR Mbr;
500 DRIVE_LAYOUT_INFORMATION_GPT Gpt;
501 };
502 PARTITION_INFORMATION_EX PartitionEntry[1];
503 } DRIVE_LAYOUT_INFORMATION_EX,*PDRIVE_LAYOUT_INFORMATION_EX;
504 typedef struct {
505 HANDLE FileHandle;
506 LARGE_INTEGER StartingVcn;
507 LARGE_INTEGER StartingLcn;
508 DWORD ClusterCount;
509 } MOVE_FILE_DATA,*PMOVE_FILE_DATA;
510 typedef struct _PERF_BIN {
511 DWORD NumberOfBins;
512 DWORD TypeOfBin;
513 BIN_RANGE BinsRanges[1];
514 } PERF_BIN,*PPERF_BIN;
515
516 #ifndef _NTDDSTOR_H_
517 typedef struct _PREVENT_MEDIA_REMOVAL {
518 BOOLEAN PreventMediaRemoval;
519 } PREVENT_MEDIA_REMOVAL,*PPREVENT_MEDIA_REMOVAL;
520 #endif
521
522 typedef struct RETRIEVAL_POINTERS_BUFFER {
523 DWORD ExtentCount;
524 LARGE_INTEGER StartingVcn;
525 struct {
526 LARGE_INTEGER NextVcn;
527 LARGE_INTEGER Lcn;
528 } Extents[1];
529 } RETRIEVAL_POINTERS_BUFFER,*PRETRIEVAL_POINTERS_BUFFER;
530 typedef struct _REASSIGN_BLOCKS {
531 WORD Reserved;
532 WORD Count;
533 DWORD BlockNumber[1];
534 } REASSIGN_BLOCKS,*PREASSIGN_BLOCKS;
535 typedef struct _SET_PARTITION_INFORMATION {
536 BYTE PartitionType;
537 } SET_PARTITION_INFORMATION,*PSET_PARTITION_INFORMATION;
538 typedef struct {
539 LARGE_INTEGER StartingLcn;
540 } STARTING_LCN_INPUT_BUFFER,*PSTARTING_LCN_INPUT_BUFFER;
541 typedef struct {
542 LARGE_INTEGER StartingVcn;
543 } STARTING_VCN_INPUT_BUFFER,*PSTARTING_VCN_INPUT_BUFFER;
544 typedef struct _VERIFY_INFORMATION {
545 LARGE_INTEGER StartingOffset;
546 DWORD Length;
547 } VERIFY_INFORMATION,*PVERIFY_INFORMATION;
548 typedef struct {
549 LARGE_INTEGER StartingLcn;
550 LARGE_INTEGER BitmapSize;
551 BYTE Buffer[1];
552 } VOLUME_BITMAP_BUFFER,*PVOLUME_BITMAP_BUFFER;
553 typedef struct {
554 LARGE_INTEGER VolumeSerialNumber;
555 LARGE_INTEGER NumberSectors;
556 LARGE_INTEGER TotalClusters;
557 LARGE_INTEGER FreeClusters;
558 LARGE_INTEGER TotalReserved;
559 DWORD BytesPerSector;
560 DWORD BytesPerCluster;
561 DWORD BytesPerFileRecordSegment;
562 DWORD ClustersPerFileRecordSegment;
563 LARGE_INTEGER MftValidDataLength;
564 LARGE_INTEGER MftStartLcn;
565 LARGE_INTEGER Mft2StartLcn;
566 LARGE_INTEGER MftZoneStart;
567 LARGE_INTEGER MftZoneEnd;
568 } NTFS_VOLUME_DATA_BUFFER, *PNTFS_VOLUME_DATA_BUFFER;
569 typedef struct {
570 ULONG ByteCount;
571 USHORT MajorVersion;
572 USHORT MinorVersion;
573 } NTFS_EXTENDED_VOLUME_DATA, *PNTFS_EXTENDED_VOLUME_DATA;
574 typedef struct {
575 LARGE_INTEGER FileReferenceNumber;
576 } NTFS_FILE_RECORD_INPUT_BUFFER, *PNTFS_FILE_RECORD_INPUT_BUFFER;
577 typedef struct {
578 LARGE_INTEGER FileReferenceNumber;
579 ULONG FileRecordLength;
580 UCHAR FileRecordBuffer[1];
581 } NTFS_FILE_RECORD_OUTPUT_BUFFER, *PNTFS_FILE_RECORD_OUTPUT_BUFFER;
582
583 #ifdef __REACTOS__
584 #define IsRecognizedPartition(t)\
585 (((t&PARTITION_NTFT)&&((t&~VALID_NTFT)==PARTITION_FAT_12))||\
586 ((t&PARTITION_NTFT)&&((t&~VALID_NTFT)==PARTITION_FAT_16))||\
587 ((t&PARTITION_NTFT)&&((t&~VALID_NTFT)==PARTITION_IFS))||\
588 ((t&PARTITION_NTFT)&&((t&~VALID_NTFT)==PARTITION_HUGE))||\
589 ((t&PARTITION_NTFT)&&((t&~VALID_NTFT)==PARTITION_FAT32))||\
590 ((t&PARTITION_NTFT)&&((t&~VALID_NTFT)==PARTITION_FAT32_XINT13))||\
591 ((t&PARTITION_NTFT)&&((t&~VALID_NTFT)==PARTITION_XINT13))||\
592 ((t&~PARTITION_NTFT)==PARTITION_FAT_12)||\
593 ((t&~PARTITION_NTFT)==PARTITION_FAT_16)||\
594 ((t&~PARTITION_NTFT)==PARTITION_IFS)||\
595 ((t&~PARTITION_NTFT)==PARTITION_HUGE)||\
596 ((t&~PARTITION_NTFT)==PARTITION_FAT32)||\
597 ((t&~PARTITION_NTFT)==PARTITION_FAT32_XINT13)||\
598 ((t&~PARTITION_NTFT)==PARTITION_XINT13)||\
599 ((t&~PARTITION_NTFT)==PARTITION_LINUX)||\
600 ((t&~PARTITION_NTFT)==PARTITION_OLD_LINUX))
601 #else
602 #define IsRecognizedPartition(t)\
603 (((t&PARTITION_NTFT)&&((t&~VALID_NTFT)==PARTITION_FAT_12))||\
604 ((t&PARTITION_NTFT)&&((t&~VALID_NTFT)==PARTITION_FAT_16))||\
605 ((t&PARTITION_NTFT)&&((t&~VALID_NTFT)==PARTITION_IFS))||\
606 ((t&PARTITION_NTFT)&&((t&~VALID_NTFT)==PARTITION_HUGE))||\
607 ((t&PARTITION_NTFT)&&((t&~VALID_NTFT)==PARTITION_FAT32))||\
608 ((t&PARTITION_NTFT)&&((t&~VALID_NTFT)==PARTITION_FAT32_XINT13))||\
609 ((t&PARTITION_NTFT)&&((t&~VALID_NTFT)==PARTITION_XINT13))||\
610 ((t&~PARTITION_NTFT)==PARTITION_FAT_12)||\
611 ((t&~PARTITION_NTFT)==PARTITION_FAT_16)||\
612 ((t&~PARTITION_NTFT)==PARTITION_IFS)||\
613 ((t&~PARTITION_NTFT)==PARTITION_HUGE)||\
614 ((t&~PARTITION_NTFT)==PARTITION_FAT32)||\
615 ((t&~PARTITION_NTFT)==PARTITION_FAT32_XINT13)||\
616 ((t&~PARTITION_NTFT)==PARTITION_XINT13))
617 #endif
618 #define IsContainerPartition(t)\
619 (((t&PARTITION_NTFT)&&((t&~VALID_NTFT)==PARTITION_EXTENDED))||\
620 ((t&PARTITION_NTFT)&&((t&~VALID_NTFT)==PARTITION_XINT13_EXTENDED))||\
621 ((t&~PARTITION_NTFT)==PARTITION_EXTENDED)||\
622 ((t&~PARTITION_NTFT)==PARTITION_XINT13_EXTENDED))
623
624 #ifdef _MSC_VER
625 #pragma warning(pop)
626 #endif
627
628 #ifdef __cplusplus
629 }
630 #endif
631 #endif /* _WINIOCTL_ */