[PSDK]
[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 #define PARTITION_FREEBSD 0xA5
201 #define PARTITION_OPENBSD 0xA6
202 #define PARTITION_NETBSD 0xA9
203 #endif
204 #define SERIAL_LSRMST_ESCAPE 0
205 #define SERIAL_LSRMST_LSR_DATA 1
206 #define SERIAL_LSRMST_LSR_NODATA 2
207 #define SERIAL_LSRMST_MST 3
208 /* Device GUIDs */
209 #ifdef DEFINE_GUID
210
211 DEFINE_GUID(GUID_DEVINTERFACE_COMPORT, 0x86E0D1E0L, 0x8089,
212 0x11D0, 0x9C, 0xE4, 0x08, 0x00, 0x3E, 0x30, 0x1F, 0x73);
213 DEFINE_GUID(GUID_DEVINTERFACE_SERENUM_BUS_ENUMERATOR, 0x4D36E978L, 0xE325,
214 0x11CE, 0xBF, 0xC1, 0x08, 0x00, 0x2B, 0xE1, 0x03, 0x18);
215
216 /* obsolete GUID names */
217 #define GUID_CLASS_COMPORT GUID_DEVINTERFACE_COMPORT
218 #define GUID_SERENUM_BUS_ENUMERATOR GUID_DEVINTERFACE_SERENUM_BUS_ENUMERATOR
219
220 #endif /* DEFINE_GUID */
221
222 #define DISK_LOGGING_START 0
223 #define DISK_LOGGING_STOP 1
224 #define DISK_LOGGING_DUMP 2
225 #define DISK_BINNING 3
226 typedef WORD BAD_TRACK_NUMBER,*PBAD_TRACK_NUMBER;
227 typedef enum _BIN_TYPES {RequestSize,RequestLocation} BIN_TYPES;
228 typedef struct _BIN_RANGE {
229 LARGE_INTEGER StartValue;
230 LARGE_INTEGER Length;
231 } BIN_RANGE,*PBIN_RANGE;
232 typedef struct _BIN_COUNT {
233 BIN_RANGE BinRange;
234 DWORD BinCount;
235 } BIN_COUNT,*PBIN_COUNT;
236 typedef struct _BIN_RESULTS {
237 DWORD NumberOfBins;
238 BIN_COUNT BinCounts[1];
239 } BIN_RESULTS,*PBIN_RESULTS;
240 typedef enum _PARTITION_STYLE {
241 PARTITION_STYLE_MBR,
242 PARTITION_STYLE_GPT,
243 PARTITION_STYLE_RAW
244 } PARTITION_STYLE;
245 typedef struct {
246 GUID DiskId;
247 DWORD MaxPartitionCount;
248 } CREATE_DISK_GPT,*PCREATE_DISK_GPT;
249 typedef struct {
250 DWORD Signature;
251 } CREATE_DISK_MBR,*PCREATE_DISK_MBR;
252 typedef struct {
253 PARTITION_STYLE PartitionStyle;
254 _ANONYMOUS_UNION union {
255 CREATE_DISK_MBR Mbr;
256 CREATE_DISK_GPT Gpt;
257 };
258 } CREATE_DISK,*PCREATE_DISK;
259 typedef enum {
260 EqualPriority,
261 KeepPrefetchedData,
262 KeepReadData
263 } DISK_CACHE_RETENTION_PRIORITY;
264 typedef struct _DISK_CACHE_INFORMATION {
265 BOOLEAN ParametersSavable;
266 BOOLEAN ReadCacheEnabled;
267 BOOLEAN WriteCacheEnabled;
268 DISK_CACHE_RETENTION_PRIORITY ReadRetentionPriority;
269 DISK_CACHE_RETENTION_PRIORITY WriteRetentionPriority;
270 WORD DisablePrefetchTransferLength;
271 BOOLEAN PrefetchScalar;
272 _ANONYMOUS_UNION union {
273 struct {
274 WORD Minimum;
275 WORD Maximum;
276 WORD MaximumBlocks;
277 } ScalarPrefetch;
278 struct {
279 WORD Minimum;
280 WORD Maximum;
281 } BlockPrefetch;
282 };
283 } DISK_CACHE_INFORMATION,*PDISK_CACHE_INFORMATION;
284 typedef enum _DETECTION_TYPE {
285 DetectNone,
286 DetectInt13,
287 DetectExInt13
288 } DETECTION_TYPE;
289 typedef struct _DISK_INT13_INFO {
290 WORD DriveSelect;
291 DWORD MaxCylinders;
292 WORD SectorsPerTrack;
293 WORD MaxHeads;
294 WORD NumberDrives;
295 } DISK_INT13_INFO,*PDISK_INT13_INFO;
296 typedef struct _DISK_EX_INT13_INFO {
297 WORD ExBufferSize;
298 WORD ExFlags;
299 DWORD ExCylinders;
300 DWORD ExHeads;
301 DWORD ExSectorsPerTrack;
302 DWORD64 ExSectorsPerDrive;
303 WORD ExSectorSize;
304 WORD ExReserved;
305 } DISK_EX_INT13_INFO,*PDISK_EX_INT13_INFO;
306 typedef struct _DISK_DETECTION_INFO {
307 DWORD SizeOfDetectInfo;
308 DETECTION_TYPE DetectionType;
309 _ANONYMOUS_UNION union {
310 _ANONYMOUS_STRUCT struct {
311 DISK_INT13_INFO Int13;
312 DISK_EX_INT13_INFO ExInt13;
313 };
314 };
315 } DISK_DETECTION_INFO,*PDISK_DETECTION_INFO;
316 typedef enum _MEDIA_TYPE {
317 Unknown,
318 F5_1Pt2_512,
319 F3_1Pt44_512,
320 F3_2Pt88_512,
321 F3_20Pt8_512,
322 F3_720_512,
323 F5_360_512,
324 F5_320_512,
325 F5_320_1024,
326 F5_180_512,
327 F5_160_512,
328 RemovableMedia,
329 FixedMedia,
330 F3_120M_512,
331 F3_640_512,
332 F5_640_512,
333 F5_720_512,
334 F3_1Pt2_512,
335 F3_1Pt23_1024,
336 F5_1Pt23_1024,
337 F3_128Mb_512,
338 F3_230Mb_512,
339 F8_256_128,
340 F3_200Mb_512,
341 F3_240M_512,
342 F3_32M_512
343 } MEDIA_TYPE,*PMEDIA_TYPE;
344 typedef struct _DISK_GEOMETRY {
345 LARGE_INTEGER Cylinders;
346 MEDIA_TYPE MediaType;
347 DWORD TracksPerCylinder;
348 DWORD SectorsPerTrack;
349 DWORD BytesPerSector;
350 } DISK_GEOMETRY,*PDISK_GEOMETRY;
351 typedef struct _DISK_GEOMETRY_EX {
352 DISK_GEOMETRY Geometry;
353 LARGE_INTEGER DiskSize;
354 BYTE Data[1];
355 } DISK_GEOMETRY_EX,*PDISK_GEOMETRY_EX;
356 typedef struct _DISK_GROW_PARTITION {
357 DWORD PartitionNumber;
358 LARGE_INTEGER BytesToGrow;
359 } DISK_GROW_PARTITION, *PDISK_GROW_PARTITION;
360 typedef struct _DISK_PARTITION_INFO {
361 DWORD SizeOfPartitionInfo;
362 PARTITION_STYLE PartitionStyle;
363 _ANONYMOUS_UNION union {
364 struct {
365 DWORD Signature;
366 } Mbr;
367 struct {
368 GUID DiskId;
369 } Gpt;
370 };
371 } DISK_PARTITION_INFO,*PDISK_PARTITION_INFO;
372 typedef struct _DISK_PERFORMANCE {
373 LARGE_INTEGER BytesRead;
374 LARGE_INTEGER BytesWritten;
375 LARGE_INTEGER ReadTime;
376 LARGE_INTEGER WriteTime;
377 LARGE_INTEGER IdleTime;
378 DWORD ReadCount;
379 DWORD WriteCount;
380 DWORD QueueDepth;
381 DWORD SplitCount;
382 LARGE_INTEGER QueryTime;
383 DWORD StorageDeviceNumber;
384 WCHAR StorageManagerName[8];
385 } DISK_PERFORMANCE, *PDISK_PERFORMANCE;
386 typedef struct _DISK_RECORD {
387 LARGE_INTEGER ByteOffset;
388 LARGE_INTEGER StartTime;
389 LARGE_INTEGER EndTime;
390 PVOID VirtualAddress;
391 DWORD NumberOfBytes;
392 BYTE DeviceNumber;
393 BOOLEAN ReadRequest;
394 } DISK_RECORD,*PDISK_RECORD;
395 typedef struct _DISK_LOGGING {
396 BYTE Function;
397 PVOID BufferAddress;
398 DWORD BufferSize;
399 } DISK_LOGGING,*PDISK_LOGGING;
400 typedef struct DiskQuotaUserInformation {
401 LONGLONG QuotaUsed;
402 LONGLONG QuotaThreshold;
403 LONGLONG QuotaLimit;
404 } DISKQUOTA_USER_INFORMATION,*PDISKQUOTA_USER_INFORMATION;
405 typedef struct _FORMAT_PARAMETERS {
406 MEDIA_TYPE MediaType;
407 DWORD StartCylinderNumber;
408 DWORD EndCylinderNumber;
409 DWORD StartHeadNumber;
410 DWORD EndHeadNumber;
411 } FORMAT_PARAMETERS,*PFORMAT_PARAMETERS;
412 typedef struct _FORMAT_EX_PARAMETERS {
413 MEDIA_TYPE MediaType;
414 DWORD StartCylinderNumber;
415 DWORD EndCylinderNumber;
416 DWORD StartHeadNumber;
417 DWORD EndHeadNumber;
418 WORD FormatGapLength;
419 WORD SectorsPerTrack;
420 WORD SectorNumber[1];
421 } FORMAT_EX_PARAMETERS,*PFORMAT_EX_PARAMETERS;
422 typedef struct {
423 LARGE_INTEGER Length;
424 } GET_LENGTH_INFORMATION;
425 typedef struct _HISTOGRAM_BUCKET {
426 DWORD Reads;
427 DWORD Writes;
428 } HISTOGRAM_BUCKET,*PHISTOGRAM_BUCKET;
429 typedef struct _DISK_HISTOGRAM {
430 LARGE_INTEGER DiskSize;
431 LARGE_INTEGER Start;
432 LARGE_INTEGER End;
433 LARGE_INTEGER Average;
434 LARGE_INTEGER AverageRead;
435 LARGE_INTEGER AverageWrite;
436 DWORD Granularity;
437 DWORD Size;
438 DWORD ReadCount;
439 DWORD WriteCount;
440 PHISTOGRAM_BUCKET Histogram;
441 } DISK_HISTOGRAM,*PDISK_HISTOGRAM;
442 typedef struct _DISK_EXTENT {
443 DWORD DiskNumber;
444 LARGE_INTEGER StartingOffset;
445 LARGE_INTEGER ExtentLength;
446 } DISK_EXTENT,*PDISK_EXTENT;
447 typedef struct _VOLUME_DISK_EXTENTS {
448 DWORD NumberOfDiskExtents;
449 DISK_EXTENT Extents[1];
450 } VOLUME_DISK_EXTENTS,*PVOLUME_DISK_EXTENTS;
451 typedef struct _PARTITION_INFORMATION {
452 LARGE_INTEGER StartingOffset;
453 LARGE_INTEGER PartitionLength;
454 DWORD HiddenSectors;
455 DWORD PartitionNumber;
456 BYTE PartitionType;
457 BOOLEAN BootIndicator;
458 BOOLEAN RecognizedPartition;
459 BOOLEAN RewritePartition;
460 } PARTITION_INFORMATION,*PPARTITION_INFORMATION;
461 typedef struct _DRIVE_LAYOUT_INFORMATION {
462 DWORD PartitionCount;
463 DWORD Signature;
464 PARTITION_INFORMATION PartitionEntry[1];
465 } DRIVE_LAYOUT_INFORMATION, *PDRIVE_LAYOUT_INFORMATION;
466 typedef struct _DRIVE_LAYOUT_INFORMATION_GPT {
467 GUID DiskId;
468 LARGE_INTEGER StartingUsableOffset;
469 LARGE_INTEGER UsableLength;
470 ULONG MaxPartitionCount;
471 } DRIVE_LAYOUT_INFORMATION_GPT,*PDRIVE_LAYOUT_INFORMATION_GPT;
472 typedef struct _DRIVE_LAYOUT_INFORMATION_MBR {
473 ULONG Signature;
474 } DRIVE_LAYOUT_INFORMATION_MBR, *PDRIVE_LAYOUT_INFORMATION_MBR;
475 typedef struct _PARTITION_INFORMATION_MBR {
476 BYTE PartitionType;
477 BOOLEAN BootIndicator;
478 BOOLEAN RecognizedPartition;
479 DWORD HiddenSectors;
480 } PARTITION_INFORMATION_MBR;
481 typedef struct _PARTITION_INFORMATION_GPT {
482 GUID PartitionType;
483 GUID PartitionId;
484 DWORD64 Attributes;
485 WCHAR Name[36];
486 } PARTITION_INFORMATION_GPT;
487 typedef struct _PARTITION_INFORMATION_EX {
488 PARTITION_STYLE PartitionStyle;
489 LARGE_INTEGER StartingOffset;
490 LARGE_INTEGER PartitionLength;
491 DWORD PartitionNumber;
492 BOOLEAN RewritePartition;
493 _ANONYMOUS_UNION union {
494 PARTITION_INFORMATION_MBR Mbr;
495 PARTITION_INFORMATION_GPT Gpt;
496 };
497 } PARTITION_INFORMATION_EX;
498 typedef struct _DRIVE_LAYOUT_INFORMATION_EX {
499 DWORD PartitionStyle;
500 DWORD PartitionCount;
501 _ANONYMOUS_UNION union {
502 DRIVE_LAYOUT_INFORMATION_MBR Mbr;
503 DRIVE_LAYOUT_INFORMATION_GPT Gpt;
504 };
505 PARTITION_INFORMATION_EX PartitionEntry[1];
506 } DRIVE_LAYOUT_INFORMATION_EX,*PDRIVE_LAYOUT_INFORMATION_EX;
507 typedef struct {
508 HANDLE FileHandle;
509 LARGE_INTEGER StartingVcn;
510 LARGE_INTEGER StartingLcn;
511 DWORD ClusterCount;
512 } MOVE_FILE_DATA,*PMOVE_FILE_DATA;
513 typedef struct _PERF_BIN {
514 DWORD NumberOfBins;
515 DWORD TypeOfBin;
516 BIN_RANGE BinsRanges[1];
517 } PERF_BIN,*PPERF_BIN;
518
519 #ifndef _NTDDSTOR_H_
520 typedef struct _PREVENT_MEDIA_REMOVAL {
521 BOOLEAN PreventMediaRemoval;
522 } PREVENT_MEDIA_REMOVAL,*PPREVENT_MEDIA_REMOVAL;
523 #endif
524
525 typedef struct RETRIEVAL_POINTERS_BUFFER {
526 DWORD ExtentCount;
527 LARGE_INTEGER StartingVcn;
528 struct {
529 LARGE_INTEGER NextVcn;
530 LARGE_INTEGER Lcn;
531 } Extents[1];
532 } RETRIEVAL_POINTERS_BUFFER,*PRETRIEVAL_POINTERS_BUFFER;
533 typedef struct _REASSIGN_BLOCKS {
534 WORD Reserved;
535 WORD Count;
536 DWORD BlockNumber[1];
537 } REASSIGN_BLOCKS,*PREASSIGN_BLOCKS;
538 typedef struct _SET_PARTITION_INFORMATION {
539 BYTE PartitionType;
540 } SET_PARTITION_INFORMATION,*PSET_PARTITION_INFORMATION;
541 typedef struct {
542 LARGE_INTEGER StartingLcn;
543 } STARTING_LCN_INPUT_BUFFER,*PSTARTING_LCN_INPUT_BUFFER;
544 typedef struct {
545 LARGE_INTEGER StartingVcn;
546 } STARTING_VCN_INPUT_BUFFER,*PSTARTING_VCN_INPUT_BUFFER;
547 typedef struct _VERIFY_INFORMATION {
548 LARGE_INTEGER StartingOffset;
549 DWORD Length;
550 } VERIFY_INFORMATION,*PVERIFY_INFORMATION;
551 typedef struct {
552 LARGE_INTEGER StartingLcn;
553 LARGE_INTEGER BitmapSize;
554 BYTE Buffer[1];
555 } VOLUME_BITMAP_BUFFER,*PVOLUME_BITMAP_BUFFER;
556 typedef struct {
557 LARGE_INTEGER VolumeSerialNumber;
558 LARGE_INTEGER NumberSectors;
559 LARGE_INTEGER TotalClusters;
560 LARGE_INTEGER FreeClusters;
561 LARGE_INTEGER TotalReserved;
562 DWORD BytesPerSector;
563 DWORD BytesPerCluster;
564 DWORD BytesPerFileRecordSegment;
565 DWORD ClustersPerFileRecordSegment;
566 LARGE_INTEGER MftValidDataLength;
567 LARGE_INTEGER MftStartLcn;
568 LARGE_INTEGER Mft2StartLcn;
569 LARGE_INTEGER MftZoneStart;
570 LARGE_INTEGER MftZoneEnd;
571 } NTFS_VOLUME_DATA_BUFFER, *PNTFS_VOLUME_DATA_BUFFER;
572 typedef struct {
573 ULONG ByteCount;
574 USHORT MajorVersion;
575 USHORT MinorVersion;
576 } NTFS_EXTENDED_VOLUME_DATA, *PNTFS_EXTENDED_VOLUME_DATA;
577 typedef struct {
578 LARGE_INTEGER FileReferenceNumber;
579 } NTFS_FILE_RECORD_INPUT_BUFFER, *PNTFS_FILE_RECORD_INPUT_BUFFER;
580 typedef struct {
581 LARGE_INTEGER FileReferenceNumber;
582 ULONG FileRecordLength;
583 UCHAR FileRecordBuffer[1];
584 } NTFS_FILE_RECORD_OUTPUT_BUFFER, *PNTFS_FILE_RECORD_OUTPUT_BUFFER;
585
586 #ifdef __REACTOS__
587 #define IsRecognizedPartition(t)\
588 (((t&PARTITION_NTFT)&&((t&~VALID_NTFT)==PARTITION_FAT_12))||\
589 ((t&PARTITION_NTFT)&&((t&~VALID_NTFT)==PARTITION_FAT_16))||\
590 ((t&PARTITION_NTFT)&&((t&~VALID_NTFT)==PARTITION_IFS))||\
591 ((t&PARTITION_NTFT)&&((t&~VALID_NTFT)==PARTITION_HUGE))||\
592 ((t&PARTITION_NTFT)&&((t&~VALID_NTFT)==PARTITION_FAT32))||\
593 ((t&PARTITION_NTFT)&&((t&~VALID_NTFT)==PARTITION_FAT32_XINT13))||\
594 ((t&PARTITION_NTFT)&&((t&~VALID_NTFT)==PARTITION_XINT13))||\
595 ((t&~PARTITION_NTFT)==PARTITION_FAT_12)||\
596 ((t&~PARTITION_NTFT)==PARTITION_FAT_16)||\
597 ((t&~PARTITION_NTFT)==PARTITION_IFS)||\
598 ((t&~PARTITION_NTFT)==PARTITION_HUGE)||\
599 ((t&~PARTITION_NTFT)==PARTITION_FAT32)||\
600 ((t&~PARTITION_NTFT)==PARTITION_FAT32_XINT13)||\
601 ((t&~PARTITION_NTFT)==PARTITION_XINT13)||\
602 ((t&~PARTITION_NTFT)==PARTITION_LINUX)||\
603 ((t&~PARTITION_NTFT)==PARTITION_OLD_LINUX)||\
604 ((t&~PARTITION_NTFT)==PARTITION_FREEBSD)||\
605 ((t&~PARTITION_NTFT)==PARTITION_OPENBSD)||\
606 ((t&~PARTITION_NTFT)==PARTITION_NETBSD))
607 #else
608 #define IsRecognizedPartition(t)\
609 (((t&PARTITION_NTFT)&&((t&~VALID_NTFT)==PARTITION_FAT_12))||\
610 ((t&PARTITION_NTFT)&&((t&~VALID_NTFT)==PARTITION_FAT_16))||\
611 ((t&PARTITION_NTFT)&&((t&~VALID_NTFT)==PARTITION_IFS))||\
612 ((t&PARTITION_NTFT)&&((t&~VALID_NTFT)==PARTITION_HUGE))||\
613 ((t&PARTITION_NTFT)&&((t&~VALID_NTFT)==PARTITION_FAT32))||\
614 ((t&PARTITION_NTFT)&&((t&~VALID_NTFT)==PARTITION_FAT32_XINT13))||\
615 ((t&PARTITION_NTFT)&&((t&~VALID_NTFT)==PARTITION_XINT13))||\
616 ((t&~PARTITION_NTFT)==PARTITION_FAT_12)||\
617 ((t&~PARTITION_NTFT)==PARTITION_FAT_16)||\
618 ((t&~PARTITION_NTFT)==PARTITION_IFS)||\
619 ((t&~PARTITION_NTFT)==PARTITION_HUGE)||\
620 ((t&~PARTITION_NTFT)==PARTITION_FAT32)||\
621 ((t&~PARTITION_NTFT)==PARTITION_FAT32_XINT13)||\
622 ((t&~PARTITION_NTFT)==PARTITION_XINT13))
623 #endif
624 #define IsContainerPartition(t)\
625 (((t&PARTITION_NTFT)&&((t&~VALID_NTFT)==PARTITION_EXTENDED))||\
626 ((t&PARTITION_NTFT)&&((t&~VALID_NTFT)==PARTITION_XINT13_EXTENDED))||\
627 ((t&~PARTITION_NTFT)==PARTITION_EXTENDED)||\
628 ((t&~PARTITION_NTFT)==PARTITION_XINT13_EXTENDED))
629
630 #ifdef _MSC_VER
631 #pragma warning(pop)
632 #endif
633
634 #ifdef __cplusplus
635 }
636 #endif
637 #endif /* _WINIOCTL_ */