Define FILE_WRITE_TO_END_OF_FILE.
[reactos.git] / reactos / include / ddk / iodef.h
1 #ifndef __INCLUDE_DDK_IODEF_H
2 #define __INCLUDE_DDK_IODEF_H
3
4 typedef enum _IO_QUERY_DEVICE_DESCRIPTION
5 {
6 IoQueryDeviceIdentifier = 0,
7 IoQueryDeviceConfigurationData,
8 IoQueryDeviceComponentInformation,
9 IoQueryDeviceDataFormatMaximum,
10 } IO_QUERY_DEVICE_DESCRIPTION, *PIO_QUERY_DEVICE_DESCRIPTION;
11
12 typedef enum _CONFIGURATION_TYPE
13 {
14 ArcSystem,
15 CentralProcessor,
16 FloatingPointProcessor,
17 PrimaryIcache,
18 PrimaryDcache,
19 SecondaryIcache,
20 SecondaryDcache,
21 SecondaryCache,
22 EisaAdapter,
23 TcAdapter,
24 ScsiAdapter,
25 DtiAdapter,
26 MultiFunctionAdapter,
27 DiskController,
28 TapeController,
29 CdromController,
30 WorkController,
31 SerialController,
32 NetworkController,
33 DisplayController,
34 ParallelController,
35 PointerController,
36 KeyboardController,
37 AudioController,
38 OtherController,
39 DiskPeripheral,
40 FloppyDiskPeripheral,
41 TapePeripheral,
42 ModemPeripheral,
43 MonitorPeripheral,
44 PrinterPeripheral,
45 PointerPeripheral,
46 KeyboardPeripheral,
47 TerminalPeripheral,
48 OtherPeripheral,
49 LinePeripheral,
50 NetworkPeripheral,
51 SystemMemory,
52 DockingInformation,
53 RealModeIrqRoutingTable,
54 RealModePCIEnumeration,
55 MaximumType
56 } CONFIGURATION_TYPE, *PCONFIGURATION_TYPE;
57
58
59 typedef int CM_RESOURCE_TYPE;
60
61 #define CmResourceTypeNull 0
62 #define CmResourceTypePort 1
63 #define CmResourceTypeInterrupt 2
64 #define CmResourceTypeMemory 3
65 #define CmResourceTypeDma 4
66 #define CmResourceTypeDeviceSpecific 5
67 #define CmResourceTypeBusNumber 6
68 #define CmResourceTypeMaximum 7
69
70
71 typedef enum _CM_SHARE_DISPOSITION
72 {
73 CmResourceShareUndetermined = 0,
74 CmResourceShareDeviceExclusive,
75 CmResourceShareDriverExclusive,
76 CmResourceShareShared,
77 } CM_SHARE_DISPOSITION;
78
79
80 #define CM_RESOURCE_INTERRUPT_LEVEL_SENSITIVE 0
81 #define CM_RESOURCE_INTERRUPT_LATCHED 1
82
83
84 #define CM_RESOURCE_MEMORY_READ_WRITE 0x0000
85 #define CM_RESOURCE_MEMORY_READ_ONLY 0x0001
86 #define CM_RESOURCE_MEMORY_WRITE_ONLY 0x0002
87 #define CM_RESOURCE_MEMORY_PREFETCHABLE 0x0004
88 #define CM_RESOURCE_MEMORY_COMBINEDWRITE 0x0008
89 #define CM_RESOURCE_MEMORY_24 0x0010
90
91
92 #define CM_RESOURCE_PORT_MEMORY 0x0000
93 #define CM_RESOURCE_PORT_IO 0x0001
94 #define CM_RESOURCE_PORT_FORWARD_FIRST_256_OF_EACH_1024 0x0002
95 #define CM_RESOURCE_PORT_10_BIT_DECODE 0x0004
96 #define CM_RESOURCE_PORT_12_BIT_DECODE 0x0008
97 #define CM_RESOURCE_PORT_16_BIT_DECODE 0x0010
98 #define CM_RESOURCE_PORT_POSITIVE_DECODE 0x0020
99 #define CM_RESOURCE_PORT_PASSIVE_DECODE 0x0040
100 #define CM_RESOURCE_PORT_WINDOW_DECODE 0x0080
101
102
103 #define CM_RESOURCE_DMA_8 0x0000
104 #define CM_RESOURCE_DMA_16 0x0001
105 #define CM_RESOURCE_DMA_32 0x0002
106 #define CM_RESOURCE_DMA_8_AND_16 0x0004
107 #define CM_RESOURCE_DMA_BUS_MASTER 0x0008
108 #define CM_RESOURCE_DMA_TYPE_A 0x0010
109 #define CM_RESOURCE_DMA_TYPE_B 0x0020
110 #define CM_RESOURCE_DMA_TYPE_F 0x0040
111
112
113 /*
114 * PURPOSE: Irp flags
115 */
116 enum
117 {
118 IRP_NOCACHE = 0x1,
119 IRP_PAGING_IO = 0x2,
120 IRP_MOUNT_COMPLETION = 0x2,
121 IRP_SYNCHRONOUS_API = 0x4,
122 IRP_ASSOCIATED_IRP = 0x8,
123 IRP_BUFFERED_IO = 0x10,
124 IRP_DEALLOCATE_BUFFER = 0x20,
125 IRP_INPUT_OPERATION = 0x40,
126 IRP_SYNCHRONOUS_PAGING_IO = 0x40,
127 IRP_CREATE_OPERATION = 0x80,
128 IRP_READ_OPERATION = 0x100,
129 IRP_WRITE_OPERATION = 0x200,
130 IRP_CLOSE_OPERATION = 0x400,
131 IRP_DEFER_IO_COMPLETION = 0x800,
132 IRP_OB_QUERY_NAME = 0x1000,
133 IRP_HOLD_DEVICE_QUEUE = 0x2000,
134 IRP_RETRY_IO_COMPLETION = 0x4000
135 };
136
137 #define SL_FORCE_ACCESS_CHECK (0x1)
138 #define SL_OPEN_PAGING_FILE (0x2)
139 #define SL_OPEN_TARGET_DIRECTORY (0x4)
140 #define SL_CASE_SENSITIVE (0x80)
141
142 #define SL_KEY_SPECIFIED (0x1)
143 #define SL_OVERRIDE_VERIFY_VOLUME (0x2)
144 #define SL_WRITE_THROUGHT (0x4)
145 #define SL_FT_SEQUENTIAL_WRITE (0x8)
146
147 #define SL_FAIL_IMMEDIATELY (0x1)
148 #define SL_EXCLUSIVE_LOCK (0x2)
149
150 #define SL_WATCH_TREE (0x1)
151
152 #define SL_RESTART_SCAN (0x1)
153 #define SL_RETURN_SINGLE_ENTRY (0x2)
154 #define SL_INDEX_SPECIFIED (0x4)
155
156 #define SL_ALLOW_RAW_MOUNT (0x1)
157
158 #define SL_PENDING_RETURNED 0x01
159 #define SL_INVOKE_ON_CANCEL 0x20
160 #define SL_INVOKE_ON_SUCCESS 0x40
161 #define SL_INVOKE_ON_ERROR 0x80
162
163 /*
164 * Possible flags for the device object flags
165 */
166 #define DO_UNLOAD_PENDING 0x00000001
167 #define DO_VERIFY_VOLUME 0x00000002
168 #define DO_BUFFERED_IO 0x00000004
169 #define DO_EXCLUSIVE 0x00000008
170 #define DO_DIRECT_IO 0x00000010
171 #define DO_MAP_IO_BUFFER 0x00000020
172 #define DO_DEVICE_HAS_NAME 0x00000040
173 #define DO_DEVICE_INITIALIZING 0x00000080
174 #define DO_SYSTEM_BOOT_PARTITION 0x00000100
175 #define DO_LONG_TERM_REQUESTS 0x00000200
176 #define DO_NEVER_LAST_DEVICE 0x00000400
177 #define DO_SHUTDOWN_REGISTERED 0x00000800
178 #define DO_BUS_ENUMERATED_DEVICE 0x00001000
179 #define DO_POWER_PAGABLE 0x00002000
180 #define DO_POWER_INRUSH 0x00004000
181 #define DO_LOW_PRIORITY_FILESYSTEM 0x00010000
182
183 /*
184 * Possible device types
185 */
186 #define FILE_DEVICE_BEEP 0x00000001
187 #define FILE_DEVICE_CD_ROM 0x00000002
188 #define FILE_DEVICE_CD_ROM_FILE_SYSTEM 0x00000003
189 #define FILE_DEVICE_CONTROLLER 0x00000004
190 #define FILE_DEVICE_DATALINK 0x00000005
191 #define FILE_DEVICE_DFS 0x00000006
192 #define FILE_DEVICE_DISK 0x00000007
193 #define FILE_DEVICE_DISK_FILE_SYSTEM 0x00000008
194 #define FILE_DEVICE_FILE_SYSTEM 0x00000009
195 #define FILE_DEVICE_INPORT_PORT 0x0000000a
196 #define FILE_DEVICE_KEYBOARD 0x0000000b
197 #define FILE_DEVICE_MAILSLOT 0x0000000c
198 #define FILE_DEVICE_MIDI_IN 0x0000000d
199 #define FILE_DEVICE_MIDI_OUT 0x0000000e
200 #define FILE_DEVICE_MOUSE 0x0000000f
201 #define FILE_DEVICE_MULTI_UNC_PROVIDER 0x00000010
202 #define FILE_DEVICE_NAMED_PIPE 0x00000011
203 #define FILE_DEVICE_NETWORK 0x00000012
204 #define FILE_DEVICE_NETWORK_BROWSER 0x00000013
205 #define FILE_DEVICE_NETWORK_FILE_SYSTEM 0x00000014
206 #define FILE_DEVICE_NULL 0x00000015
207 #define FILE_DEVICE_PARALLEL_PORT 0x00000016
208 #define FILE_DEVICE_PHYSICAL_NETCARD 0x00000017
209 #define FILE_DEVICE_PRINTER 0x00000018
210 #define FILE_DEVICE_SCANNER 0x00000019
211 #define FILE_DEVICE_SERIAL_MOUSE_PORT 0x0000001a
212 #define FILE_DEVICE_SERIAL_PORT 0x0000001b
213 #define FILE_DEVICE_SCREEN 0x0000001c
214 #define FILE_DEVICE_SOUND 0x0000001d
215 #define FILE_DEVICE_STREAMS 0x0000001e
216 #define FILE_DEVICE_TAPE 0x0000001f
217 #define FILE_DEVICE_TAPE_FILE_SYSTEM 0x00000020
218 #define FILE_DEVICE_TRANSPORT 0x00000021
219 #define FILE_DEVICE_UNKNOWN 0x00000022
220 #define FILE_DEVICE_VIDEO 0x00000023
221 #define FILE_DEVICE_VIRTUAL_DISK 0x00000024
222 #define FILE_DEVICE_WAVE_IN 0x00000025
223 #define FILE_DEVICE_WAVE_OUT 0x00000026
224 #define FILE_DEVICE_8042_PORT 0x00000027
225 #define FILE_DEVICE_NETWORK_REDIRECTOR 0x00000028
226 #define FILE_DEVICE_BATTERY 0x00000029
227 #define FILE_DEVICE_BUS_EXTENDER 0x0000002a
228 #define FILE_DEVICE_MODEM 0x0000002b
229 #define FILE_DEVICE_VDM 0x0000002c
230 #define FILE_DEVICE_MASS_STORAGE 0x0000002d
231 #define FILE_DEVICE_SMB 0x0000002e
232 #define FILE_DEVICE_KS 0x0000002f
233 #define FILE_DEVICE_CHANGER 0x00000030
234 #define FILE_DEVICE_SMARTCARD 0x00000031
235 #define FILE_DEVICE_ACPI 0x00000032
236 #define FILE_DEVICE_DVD 0x00000033
237 #define FILE_DEVICE_FULLSCREEN_VIDEO 0x00000034
238 #define FILE_DEVICE_DFS_FILE_SYSTEM 0x00000035
239 #define FILE_DEVICE_DFS_VOLUME 0x00000036
240 #define FILE_DEVICE_SERENUM 0x00000037
241 #define FILE_DEVICE_TERMSRV 0x00000038
242 #define FILE_DEVICE_KSEC 0x00000039
243
244 #define FILE_REMOVABLE_MEDIA 0x00000001
245 #define FILE_READ_ONLY_DEVICE 0x00000002
246 #define FILE_FLOPPY_DISKETTE 0x00000004
247 #define FILE_WRITE_ONCE_MEDIA 0x00000008
248 #define FILE_REMOTE_DEVICE 0x00000010
249 #define FILE_DEVICE_IS_MOUNTED 0x00000020
250 #define FILE_VIRTUAL_VOLUME 0x00000040
251 #define FILE_AUTOGENERATED_DEVICE_NAME 0x00000080
252 #define FILE_DEVICE_SECURE_OPEN 0x00000100
253
254
255 /*
256 * PURPOSE: Bus types
257 */
258 typedef enum _INTERFACE_TYPE
259 {
260 InterfaceTypeUndefined = -1,
261 Internal,
262 Isa,
263 Eisa,
264 MicroChannel,
265 TurboChannel,
266 PCIBus,
267 VMEBus,
268 NuBus,
269 PCMCIABus,
270 CBus,
271 MPIBus,
272 MPSABus,
273 ProcessorInternal,
274 InternalPowerBus,
275 PNPISABus,
276 MaximumInterfaceType
277 } INTERFACE_TYPE, *PINTERFACE_TYPE;
278
279
280 enum
281 {
282 IRP_MJ_CREATE,
283 IRP_MJ_CREATE_NAMED_PIPE,
284 IRP_MJ_CLOSE,
285 IRP_MJ_READ,
286 IRP_MJ_WRITE,
287 IRP_MJ_QUERY_INFORMATION,
288 IRP_MJ_SET_INFORMATION,
289 IRP_MJ_QUERY_EA,
290 IRP_MJ_SET_EA,
291 IRP_MJ_FLUSH_BUFFERS,
292 IRP_MJ_QUERY_VOLUME_INFORMATION,
293 IRP_MJ_SET_VOLUME_INFORMATION,
294 IRP_MJ_DIRECTORY_CONTROL,
295 IRP_MJ_FILE_SYSTEM_CONTROL,
296 IRP_MJ_DEVICE_CONTROL,
297 IRP_MJ_INTERNAL_DEVICE_CONTROL,
298 IRP_MJ_SHUTDOWN,
299 IRP_MJ_LOCK_CONTROL,
300 IRP_MJ_CLEANUP,
301 IRP_MJ_CREATE_MAILSLOT,
302 IRP_MJ_QUERY_SECURITY,
303 IRP_MJ_SET_SECURITY,
304 IRP_MJ_POWER,
305 IRP_MJ_SYSTEM_CONTROL,
306 IRP_MJ_DEVICE_CHANGE,
307 IRP_MJ_QUERY_QUOTA,
308 IRP_MJ_SET_QUOTA,
309 IRP_MJ_PNP,
310 IRP_MJ_MAXIMUM_FUNCTION,
311 };
312
313 #define IRP_MJ_SCSI IRP_MJ_INTERNAL_DEVICE_CONTROL
314
315 /*
316 * Minor function numbers for IRP_MJ_LOCK_CONTROL
317 */
318 #define IRP_MN_LOCK 0x01
319 #define IRP_MN_UNLOCK_SINGLE 0x02
320 #define IRP_MN_UNLOCK_ALL 0x03
321 #define IRP_MN_UNLOCK_ALL_BY_KEY 0x04
322
323 /*
324 * Minor function numbers for IRP_MJ_FILE_SYSTEM_CONTROL
325 */
326 #define IRP_MN_USER_FS_REQUEST 0x00
327 #define IRP_MN_MOUNT_VOLUME 0x01
328 #define IRP_MN_VERIFY_VOLUME 0x02
329 #define IRP_MN_LOAD_FILE_SYSTEM 0x03
330
331 /*
332 * Minor function numbers for IRP_MJ_SCSI
333 */
334 #define IRP_MN_SCSI_CLASS 0x01
335
336 /*
337 * Minor function codes for IRP_MJ_POWER
338 */
339 #define IRP_MN_WAIT_WAKE 0x00
340 #define IRP_MN_POWER_SEQUENCE 0x01
341 #define IRP_MN_SET_POWER 0x02
342 #define IRP_MN_QUERY_POWER 0x03
343
344 /*
345 * Minor function codes for IRP_MJ_PNP
346 */
347 #define IRP_MN_START_DEVICE 0x00
348 #define IRP_MN_QUERY_REMOVE_DEVICE 0x01
349 #define IRP_MN_REMOVE_DEVICE 0x02
350 #define IRP_MN_CANCEL_REMOVE_DEVICE 0x03
351 #define IRP_MN_STOP_DEVICE 0x04
352 #define IRP_MN_QUERY_STOP_DEVICE 0x05
353 #define IRP_MN_CANCEL_STOP_DEVICE 0x06
354 #define IRP_MN_QUERY_DEVICE_RELATIONS 0x07
355 #define IRP_MN_QUERY_INTERFACE 0x08
356 #define IRP_MN_QUERY_CAPABILITIES 0x09
357 #define IRP_MN_QUERY_RESOURCES 0x0A
358 #define IRP_MN_QUERY_RESOURCE_REQUIREMENTS 0x0B
359 #define IRP_MN_QUERY_DEVICE_TEXT 0x0C
360 #define IRP_MN_FILTER_RESOURCE_REQUIREMENTS 0x0D
361 #define IRP_MN_READ_CONFIG 0x0F
362 #define IRP_MN_WRITE_CONFIG 0x10
363 #define IRP_MN_EJECT 0x11
364 #define IRP_MN_SET_LOCK 0x12
365 #define IRP_MN_QUERY_ID 0x13
366 #define IRP_MN_QUERY_PNP_DEVICE_STATE 0x14
367 #define IRP_MN_QUERY_BUS_INFORMATION 0x15
368 #define IRP_MN_DEVICE_USAGE_NOTIFICATION 0x16
369 #define IRP_MN_SURPRISE_REMOVAL 0x17
370 #define IRP_MN_QUERY_LEGACY_BUS_INFORMATION 0x18
371
372
373 /*
374 * Priority increments
375 */
376 #define EVENT_INCREMENT 1
377 #define IO_NO_INCREMENT 0
378 #define IO_CD_ROM_INCREMENT 1
379 #define IO_DISK_INCREMENT 4
380 #define IO_KEYBOARD_INCREMENT 6
381 #define IO_MAILSLOT_INCREMENT 2
382 #define IO_MOUSE_INCREMENT 6
383 #define IO_NAMED_PIPE_INCREMENT 2
384 #define IO_NETWORK_INCREMENT 2
385 #define IO_PARALLEL_INCREMENT 1
386 #define IO_SERIAL_INCREMENT 2
387 #define IO_SOUND_INCREMENT 8
388 #define IO_VIDEO_INCREMENT 1
389 #define MUTANT_INCREMENT 1
390 #define SEMAPHORE_INCREMENT 1
391
392 #define FILE_BYTE_ALIGNMENT 0x00000000
393 #define FILE_WORD_ALIGNMENT 0x00000001
394 #define FILE_LONG_ALIGNMENT 0x00000003
395 #define FILE_QUAD_ALIGNMENT 0x00000007
396 #define FILE_OCTA_ALIGNMENT 0x0000000f
397 #define FILE_32_BYTE_ALIGNMENT 0x0000001f
398 #define FILE_64_BYTE_ALIGNMENT 0x0000003f
399 #define FILE_128_BYTE_ALIGNMENT 0x0000007f
400 #define FILE_256_BYTE_ALIGNMENT 0x000000ff
401 #define FILE_512_BYTE_ALIGNMENT 0x000001ff
402
403 /*
404 * File disposition values
405 */
406 #define FILE_SUPERSEDED 0x0000
407 #define FILE_OPENED 0x0001
408 #define FILE_CREATED 0x0002
409 #define FILE_OVERWRITTEN 0x0003
410 #define FILE_EXISTS 0x0004
411 #define FILE_DOES_NOT_EXIST 0x0005
412
413
414 /*
415 * file creation flags
416 */
417 #define FILE_DIRECTORY_FILE 0x00000001
418 #define FILE_WRITE_THROUGH 0x00000002
419 #define FILE_SEQUENTIAL_ONLY 0x00000004
420 #define FILE_NO_INTERMEDIATE_BUFFERING 0x00000008
421
422 #define FILE_SYNCHRONOUS_IO_ALERT 0x00000010
423 #define FILE_SYNCHRONOUS_IO_NONALERT 0x00000020
424 #define FILE_NON_DIRECTORY_FILE 0x00000040
425 #define FILE_CREATE_TREE_CONNECTION 0x00000080
426
427 #define FILE_COMPLETE_IF_OPLOCKED 0x00000100
428 #define FILE_NO_EA_KNOWLEDGE 0x00000200
429 #define FILE_OPEN_FOR_RECOVERY 0x00000400
430 #define FILE_RANDOM_ACCESS 0x00000800
431
432 #define FILE_DELETE_ON_CLOSE 0x00001000
433 #define FILE_OPEN_BY_FILE_ID 0x00002000
434 #define FILE_OPEN_FOR_BACKUP_INTENT 0x00004000
435 #define FILE_NO_COMPRESSION 0x00008000
436
437 #define FILE_RESERVE_OPFILTER 0x00100000
438 #define FILE_TRANSACTED_MODE 0x00200000
439 #define FILE_OPEN_OFFLINE_FILE 0x00400000
440
441 #define FILE_VALID_OPTION_FLAGS 0x007fffff
442 #define FILE_VALID_PIPE_OPTION_FLAGS 0x00000032
443 #define FILE_VALID_MAILSLOT_OPTION_FLAGS 0x00000032
444 #define FILE_VALID_SET_FLAGS 0x00001036
445
446 #define FILE_OPEN_REPARSE_POINT 0x00200000
447
448 /*
449 * special ByteOffset values
450 */
451 #define FILE_WRITE_TO_END_OF_FILE 0xffffffff
452 #define FILE_USE_FILE_POINTER_POSITION 0xfffffffe
453
454 typedef ULONG FS_INFORMATION_CLASS, *PFS_INFORMATION_CLASS;
455
456 /*
457 * file system information class values
458 */
459 #define FileFsVolumeInformation 1
460 #define FileFsLabelInformation 2
461 #define FileFsSizeInformation 3
462 #define FileFsDeviceInformation 4
463 #define FileFsAttributeInformation 5
464 #define FileFsControlInformation 6
465 #define FileFsQuotaQueryInformation 7
466 #define FileFsQuotaSetInformation 8
467 #define FileFsMaximumInformation 9
468
469 #define IRP_MN_QUERY_DIRECTORY 0x01
470 #define IRP_MN_NOTIFY_CHANGE_DIRECTORY 0x02
471
472
473 typedef struct _FILE_QUOTA_INFORMATION {
474 ULONG NextEntryOffset;
475 ULONG SidLength;
476 LARGE_INTEGER ChangeTime;
477 LARGE_INTEGER QuotaUsed;
478 LARGE_INTEGER QuotaThreshold;
479 LARGE_INTEGER QuotaLimit;
480 LARGE_INTEGER Sid;
481 } FILE_QUOTA_INFORMATION, *PFILE_QUOTA_INFORMATION;
482
483 /*
484 * Floppy device data type
485 */
486 typedef struct _CM_FLOPPY_DEVICE_DATA
487 {
488 USHORT Version;
489 USHORT Revision;
490 CHAR Size[8];
491 ULONG MaxDensity;
492 ULONG MountDensity;
493 UCHAR StepRateHeadUnloadTime;
494 UCHAR HeadLoadTime;
495 UCHAR MotorOffTime;
496 UCHAR SectorLengthCode;
497 UCHAR SectorPerTrack;
498 UCHAR ReadWriteGapLength;
499 UCHAR DataTransferLength;
500 UCHAR FormatGapLength;
501 UCHAR FormatFillCharacter;
502 UCHAR HeadSettleTime;
503 UCHAR MotorSettleTime;
504 UCHAR MaximumTrackValue;
505 UCHAR DataTransferRate;
506 } CM_FLOPPY_DEVICE_DATA, *PCM_FLOPPY_DEVICE_DATA;
507
508 #endif
509