1 #ifndef __INCLUDE_DDK_IODEF_H
2 #define __INCLUDE_DDK_IODEF_H
4 typedef enum _IO_QUERY_DEVICE_DESCRIPTION
6 IoQueryDeviceIdentifier = 0,
7 IoQueryDeviceConfigurationData,
8 IoQueryDeviceComponentInformation,
9 IoQueryDeviceDataFormatMaximum,
10 } IO_QUERY_DEVICE_DESCRIPTION, *PIO_QUERY_DEVICE_DESCRIPTION;
12 typedef enum _CONFIGURATION_TYPE
17 } CONFIGURATION_TYPE, *PCONFIGURATION_TYPE;
19 typedef enum _CM_RESOURCE_TYPE
21 CmResourceTypePort = 1,
22 CmResourceTypeInterrupt,
25 CmResourceTypeDeviceSpecific,
26 CmResourceTypeMaximum,
29 typedef enum _CM_SHARE_DISPOSITION
31 CmResourceShareDeviceExclusive = 1,
32 CmResourceShareDriverExclusive,
33 CmResourceShareShared,
34 CmResourceShareMaximum,
35 } CM_SHARE_DISPOSITION;
39 CM_RESOURCE_INTERRUPT_LEVEL_SENSITIVE,
40 CM_RESOURCE_INTERRUPT_LATCHED,
45 CM_RESOURCE_MEMORY_READ_WRITE = 0x0000,
46 CM_RESOURCE_MEMORY_READ_ONLY = 0x0001,
47 CM_RESOURCE_MEMORY_WRITE_ONLY = 0x0002,
48 CM_RESOURCE_MEMORY_PREFETCHABLE = 0x0004,
49 CM_RESOURCE_MEMORY_COMBINEDWRITE = 0x0008,
50 CM_RESOURCE_MEMORY_24 = 0x0010
56 CM_RESOURCE_PORT_MEMORY,
67 IRP_MOUNT_COMPLETION = 0x2,
68 IRP_SYNCHRONOUS_API = 0x4,
69 IRP_ASSOCIATED_IRP = 0x8,
70 IRP_BUFFERED_IO = 0x10,
71 IRP_DEALLOCATE_BUFFER = 0x20,
72 IRP_INPUT_OPERATION = 0x40,
73 IRP_SYNCHRONOUS_PAGING_IO = 0x40,
74 IRP_CREATE_OPERATION = 0x80,
75 IRP_READ_OPERATION = 0x100,
76 IRP_WRITE_OPERATION = 0x200,
77 IRP_CLOSE_OPERATION = 0x400,
78 IRP_DEFER_IO_COMPLETION = 0x800,
79 IRP_OB_QUERY_NAME = 0x1000,
80 IRP_HOLD_DEVICE_QUEUE = 0x2000,
81 IRP_RETRY_IO_COMPLETION = 0x4000
84 #define SL_FORCE_ACCESS_CHECK (0x1)
85 #define SL_OPEN_PAGING_FILE (0x2)
86 #define SL_OPEN_TARGET_DIRECTORY (0x4)
87 #define SL_CASE_SENSITIVE (0x80)
89 #define SL_KEY_SPECIFIED (0x1)
90 #define SL_OVERRIDE_VERIFY_VOLUME (0x2)
91 #define SL_WRITE_THROUGHT (0x4)
92 #define SL_FT_SEQUENTIAL_WRITE (0x8)
94 #define SL_FAIL_IMMEDIATELY (0x1)
95 #define SL_EXCLUSIVE_LOCK (0x2)
97 #define SL_WATCH_TREE (0x1)
99 #define SL_RESTART_SCAN (0x1)
100 #define SL_RETURN_SINGLE_ENTRY (0x2)
101 #define SL_INDEX_SPECIFIED (0x4)
103 #define SL_ALLOW_RAW_MOUNT (0x1)
105 #define SL_PENDING_RETURNED 0x01
106 #define SL_INVOKE_ON_CANCEL 0x20
107 #define SL_INVOKE_ON_SUCCESS 0x40
108 #define SL_INVOKE_ON_ERROR 0x80
111 * Possible flags for the device object flags
113 #define DO_UNLOAD_PENDING 0x00000001
114 #define DO_VERIFY_VOLUME 0x00000002
115 #define DO_BUFFERED_IO 0x00000004
116 #define DO_EXCLUSIVE 0x00000008
117 #define DO_DIRECT_IO 0x00000010
118 #define DO_MAP_IO_BUFFER 0x00000020
119 #define DO_DEVICE_HAS_NAME 0x00000040
120 #define DO_DEVICE_INITIALIZING 0x00000080
121 #define DO_SYSTEM_BOOT_PARTITION 0x00000100
122 #define DO_LONG_TERM_REQUESTS 0x00000200
123 #define DO_NEVER_LAST_DEVICE 0x00000400
124 #define DO_SHUTDOWN_REGISTERED 0x00000800
125 #define DO_BUS_ENUMERATED_DEVICE 0x00001000
126 #define DO_POWER_PAGABLE 0x00002000
127 #define DO_POWER_INRUSH 0x00004000
128 #define DO_LOW_PRIORITY_FILESYSTEM 0x00010000
131 * Possible device types
133 #define FILE_DEVICE_BEEP 0x00000001
134 #define FILE_DEVICE_CD_ROM 0x00000002
135 #define FILE_DEVICE_CD_ROM_FILE_SYSTEM 0x00000003
136 #define FILE_DEVICE_CONTROLLER 0x00000004
137 #define FILE_DEVICE_DATALINK 0x00000005
138 #define FILE_DEVICE_DFS 0x00000006
139 #define FILE_DEVICE_DISK 0x00000007
140 #define FILE_DEVICE_DISK_FILE_SYSTEM 0x00000008
141 #define FILE_DEVICE_FILE_SYSTEM 0x00000009
142 #define FILE_DEVICE_INPORT_PORT 0x0000000a
143 #define FILE_DEVICE_KEYBOARD 0x0000000b
144 #define FILE_DEVICE_MAILSLOT 0x0000000c
145 #define FILE_DEVICE_MIDI_IN 0x0000000d
146 #define FILE_DEVICE_MIDI_OUT 0x0000000e
147 #define FILE_DEVICE_MOUSE 0x0000000f
148 #define FILE_DEVICE_MULTI_UNC_PROVIDER 0x00000010
149 #define FILE_DEVICE_NAMED_PIPE 0x00000011
150 #define FILE_DEVICE_NETWORK 0x00000012
151 #define FILE_DEVICE_NETWORK_BROWSER 0x00000013
152 #define FILE_DEVICE_NETWORK_FILE_SYSTEM 0x00000014
153 #define FILE_DEVICE_NULL 0x00000015
154 #define FILE_DEVICE_PARALLEL_PORT 0x00000016
155 #define FILE_DEVICE_PHYSICAL_NETCARD 0x00000017
156 #define FILE_DEVICE_PRINTER 0x00000018
157 #define FILE_DEVICE_SCANNER 0x00000019
158 #define FILE_DEVICE_SERIAL_MOUSE_PORT 0x0000001a
159 #define FILE_DEVICE_SERIAL_PORT 0x0000001b
160 #define FILE_DEVICE_SCREEN 0x0000001c
161 #define FILE_DEVICE_SOUND 0x0000001d
162 #define FILE_DEVICE_STREAMS 0x0000001e
163 #define FILE_DEVICE_TAPE 0x0000001f
164 #define FILE_DEVICE_TAPE_FILE_SYSTEM 0x00000020
165 #define FILE_DEVICE_TRANSPORT 0x00000021
166 #define FILE_DEVICE_UNKNOWN 0x00000022
167 #define FILE_DEVICE_VIDEO 0x00000023
168 #define FILE_DEVICE_VIRTUAL_DISK 0x00000024
169 #define FILE_DEVICE_WAVE_IN 0x00000025
170 #define FILE_DEVICE_WAVE_OUT 0x00000026
171 #define FILE_DEVICE_8042_PORT 0x00000027
172 #define FILE_DEVICE_NETWORK_REDIRECTOR 0x00000028
173 #define FILE_DEVICE_BATTERY 0x00000029
174 #define FILE_DEVICE_BUS_EXTENDER 0x0000002a
175 #define FILE_DEVICE_MODEM 0x0000002b
176 #define FILE_DEVICE_VDM 0x0000002c
177 #define FILE_DEVICE_MASS_STORAGE 0x0000002d
178 #define FILE_DEVICE_SMB 0x0000002e
179 #define FILE_DEVICE_KS 0x0000002f
180 #define FILE_DEVICE_CHANGER 0x00000030
181 #define FILE_DEVICE_SMARTCARD 0x00000031
182 #define FILE_DEVICE_ACPI 0x00000032
183 #define FILE_DEVICE_DVD 0x00000033
184 #define FILE_DEVICE_FULLSCREEN_VIDEO 0x00000034
185 #define FILE_DEVICE_DFS_FILE_SYSTEM 0x00000035
186 #define FILE_DEVICE_DFS_VOLUME 0x00000036
187 #define FILE_DEVICE_SERENUM 0x00000037
188 #define FILE_DEVICE_TERMSRV 0x00000038
189 #define FILE_DEVICE_KSEC 0x00000039
191 #define FILE_REMOVABLE_MEDIA 0x00000001
192 #define FILE_READ_ONLY_DEVICE 0x00000002
193 #define FILE_FLOPPY_DISKETTE 0x00000004
194 #define FILE_WRITE_ONCE_MEDIA 0x00000008
195 #define FILE_REMOTE_DEVICE 0x00000010
196 #define FILE_DEVICE_IS_MOUNTED 0x00000020
197 #define FILE_VIRTUAL_VOLUME 0x00000040
198 #define FILE_AUTOGENERATED_DEVICE_NAME 0x00000080
199 #define FILE_DEVICE_SECURE_OPEN 0x00000100
205 typedef enum _INTERFACE_TYPE
207 InterfaceTypeUndefined = -1,
224 } INTERFACE_TYPE, *PINTERFACE_TYPE;
227 /* Type is the first CSHORT of any structure (type NODETYPECODE),
228 * it is usually code 'Type' field by reactos.
230 #define IO_TYPE_ADAPTER 0x00000001
231 #define IO_TYPE_CONTROLLER 0x00000002
232 #define IO_TYPE_DEVICE 0x00000003
233 #define IO_TYPE_DRIVER 0x00000004
234 #define IO_TYPE_FILE 0x00000005
235 #define IO_TYPE_IRP 0x00000006
236 #define IO_TYPE_MASTER_ADAPTER 0x00000007
237 #define IO_TYPE_OPEN_PACKET 0x00000008
238 #define IO_TYPE_TIMER 0x00000009
239 #define IO_TYPE_VPB 0x0000000a
240 #define IO_TYPE_ERROR_LOG 0x0000000b
241 #define IO_TYPE_ERROR_MESSAGE 0x0000000c
242 #define IO_TYPE_DEVICE_OBJECT_EXTENSION 0x0000000d
248 IRP_MJ_CREATE_NAMED_PIPE,
252 IRP_MJ_QUERY_INFORMATION,
253 IRP_MJ_SET_INFORMATION,
256 IRP_MJ_FLUSH_BUFFERS,
257 IRP_MJ_QUERY_VOLUME_INFORMATION,
258 IRP_MJ_SET_VOLUME_INFORMATION,
259 IRP_MJ_DIRECTORY_CONTROL,
260 IRP_MJ_FILE_SYSTEM_CONTROL,
261 IRP_MJ_DEVICE_CONTROL,
262 IRP_MJ_INTERNAL_DEVICE_CONTROL,
266 IRP_MJ_CREATE_MAILSLOT,
267 IRP_MJ_QUERY_SECURITY,
270 IRP_MJ_SYSTEM_CONTROL,
271 IRP_MJ_DEVICE_CHANGE,
275 IRP_MJ_MAXIMUM_FUNCTION,
278 #define IRP_MJ_SCSI IRP_MJ_INTERNAL_DEVICE_CONTROL
281 * Minor function numbers for IRP_MJ_LOCK_CONTROL
283 #define IRP_MN_LOCK 0x01
284 #define IRP_MN_UNLOCK_SINGLE 0x02
285 #define IRP_MN_UNLOCK_ALL 0x03
286 #define IRP_MN_UNLOCK_ALL_BY_KEY 0x04
289 * Minor function numbers for IRP_MJ_FILE_SYSTEM_CONTROL
291 #define IRP_MN_USER_FS_REQUEST 0x00
292 #define IRP_MN_MOUNT_VOLUME 0x01
293 #define IRP_MN_VERIFY_VOLUME 0x02
294 #define IRP_MN_LOAD_FILE_SYSTEM 0x03
297 * Minor function numbers for IRP_MJ_SCSI
299 #define IRP_MN_SCSI_CLASS 0x01
302 * Minor function codes for IRP_MJ_POWER
304 #define IRP_MN_WAIT_WAKE 0x00
305 #define IRP_MN_POWER_SEQUENCE 0x01
306 #define IRP_MN_SET_POWER 0x02
307 #define IRP_MN_QUERY_POWER 0x03
310 * Minor function codes for IRP_MJ_PNP
312 #define IRP_MN_START_DEVICE 0x00
313 #define IRP_MN_QUERY_REMOVE_DEVICE 0x01
314 #define IRP_MN_REMOVE_DEVICE 0x02
315 #define IRP_MN_CANCEL_REMOVE_DEVICE 0x03
316 #define IRP_MN_STOP_DEVICE 0x04
317 #define IRP_MN_QUERY_STOP_DEVICE 0x05
318 #define IRP_MN_CANCEL_STOP_DEVICE 0x06
319 #define IRP_MN_QUERY_DEVICE_RELATIONS 0x07
320 #define IRP_MN_QUERY_INTERFACE 0x08
321 #define IRP_MN_QUERY_CAPABILITIES 0x09
322 #define IRP_MN_QUERY_RESOURCES 0x0A
323 #define IRP_MN_QUERY_RESOURCE_REQUIREMENTS 0x0B
324 #define IRP_MN_QUERY_DEVICE_TEXT 0x0C
325 #define IRP_MN_FILTER_RESOURCE_REQUIREMENTS 0x0D
326 #define IRP_MN_READ_CONFIG 0x0F
327 #define IRP_MN_WRITE_CONFIG 0x10
328 #define IRP_MN_EJECT 0x11
329 #define IRP_MN_SET_LOCK 0x12
330 #define IRP_MN_QUERY_ID 0x13
331 #define IRP_MN_QUERY_PNP_DEVICE_STATE 0x14
332 #define IRP_MN_QUERY_BUS_INFORMATION 0x15
333 #define IRP_MN_DEVICE_USAGE_NOTIFICATION 0x16
334 #define IRP_MN_SURPRISE_REMOVAL 0x17
335 #define IRP_MN_QUERY_LEGACY_BUS_INFORMATION 0x18
339 * Priority increments
341 #define EVENT_INCREMENT 1
342 #define IO_NO_INCREMENT 0
343 #define IO_CD_ROM_INCREMENT 1
344 #define IO_DISK_INCREMENT 4
345 #define IO_KEYBOARD_INCREMENT 6
346 #define IO_MAILSLOT_INCREMENT 2
347 #define IO_MOUSE_INCREMENT 6
348 #define IO_NAMED_PIPE_INCREMENT 2
349 #define IO_NETWORK_INCREMENT 2
350 #define IO_PARALLEL_INCREMENT 1
351 #define IO_SERIAL_INCREMENT 2
352 #define IO_SOUND_INCREMENT 8
353 #define IO_VIDEO_INCREMENT 1
354 #define MUTANT_INCREMENT 1
355 #define SEMAPHORE_INCREMENT 1
357 #define FILE_BYTE_ALIGNMENT 0x00000000
358 #define FILE_WORD_ALIGNMENT 0x00000001
359 #define FILE_LONG_ALIGNMENT 0x00000003
360 #define FILE_QUAD_ALIGNMENT 0x00000007
361 #define FILE_OCTA_ALIGNMENT 0x0000000f
362 #define FILE_32_BYTE_ALIGNMENT 0x0000001f
363 #define FILE_64_BYTE_ALIGNMENT 0x0000003f
364 #define FILE_128_BYTE_ALIGNMENT 0x0000007f
365 #define FILE_256_BYTE_ALIGNMENT 0x000000ff
366 #define FILE_512_BYTE_ALIGNMENT 0x000001ff
369 * File disposition values
371 #define FILE_SUPERSEDED 0x0000
372 #define FILE_OPENED 0x0001
373 #define FILE_CREATED 0x0002
374 #define FILE_OVERWRITTEN 0x0003
375 #define FILE_EXISTS 0x0004
376 #define FILE_DOES_NOT_EXIST 0x0005
380 * file creation flags
382 #define FILE_DIRECTORY_FILE 0x00000001
383 #define FILE_WRITE_THROUGH 0x00000002
384 #define FILE_SEQUENTIAL_ONLY 0x00000004
385 #define FILE_NO_INTERMEDIATE_BUFFERING 0x00000008
387 #define FILE_SYNCHRONOUS_IO_ALERT 0x00000010
388 #define FILE_SYNCHRONOUS_IO_NONALERT 0x00000020
389 #define FILE_NON_DIRECTORY_FILE 0x00000040
390 #define FILE_CREATE_TREE_CONNECTION 0x00000080
392 #define FILE_COMPLETE_IF_OPLOCKED 0x00000100
393 #define FILE_NO_EA_KNOWLEDGE 0x00000200
394 #define FILE_OPEN_FOR_RECOVERY 0x00000400
395 #define FILE_RANDOM_ACCESS 0x00000800
397 #define FILE_DELETE_ON_CLOSE 0x00001000
398 #define FILE_OPEN_BY_FILE_ID 0x00002000
399 #define FILE_OPEN_FOR_BACKUP_INTENT 0x00004000
400 #define FILE_NO_COMPRESSION 0x00008000
402 #define FILE_RESERVE_OPFILTER 0x00100000
403 #define FILE_TRANSACTED_MODE 0x00200000
404 #define FILE_OPEN_OFFLINE_FILE 0x00400000
406 #define FILE_VALID_OPTION_FLAGS 0x007fffff
407 #define FILE_VALID_PIPE_OPTION_FLAGS 0x00000032
408 #define FILE_VALID_MAILSLOT_OPTION_FLAGS 0x00000032
409 #define FILE_VALID_SET_FLAGS 0x00001036
412 typedef ULONG FS_INFORMATION_CLASS, *PFS_INFORMATION_CLASS;
415 * file system information class values
417 #define FileFsVolumeInformation 1
418 #define FileFsLabelInformation 2
419 #define FileFsSizeInformation 3
420 #define FileFsDeviceInformation 4
421 #define FileFsAttributeInformation 5
422 #define FileFsControlInformation 6
423 #define FileFsFullSizeInformation 7
424 #define FileFsObjectIdInformation 8
425 #define FileFsDriverPathInformation 9
426 #define FileFsMaximumInformation 10
428 #define IRP_MN_QUERY_DIRECTORY 0x01
429 #define IRP_MN_NOTIFY_CHANGE_DIRECTORY 0x02