- Fix incorrect PFILE_MAILSLOT_SET_INFORMATION definition
[reactos.git] / reactos / include / ndk / iotypes.h
1 /*
2 * PROJECT: ReactOS Native Headers
3 * FILE: include/ndk/iotypes.h
4 * PURPOSE: Definitions for exported I/O Manager Types not defined in DDK/IFS
5 * PROGRAMMER: Alex Ionescu (alex@relsoft.net)
6 * UPDATE HISTORY:
7 * Created 06/10/04
8 */
9
10 #ifndef _IOTYPES_H
11 #define _IOTYPES_H
12
13 /* DEPENDENCIES **************************************************************/
14
15 /* EXPORTED DATA *************************************************************/
16 #ifndef NTOS_MODE_USER
17 extern POBJECT_TYPE NTSYSAPI IoAdapterObjectType;
18 extern POBJECT_TYPE NTSYSAPI IoDeviceHandlerObjectType;
19 extern POBJECT_TYPE NTSYSAPI IoDeviceObjectType;
20 extern POBJECT_TYPE NTSYSAPI IoDriverObjectType;
21 #endif
22
23 /* CONSTANTS *****************************************************************/
24
25 #ifdef NTOS_MODE_USER
26 /* Object Access Rights */
27 #define SYMBOLIC_LINK_QUERY 0x0001
28 #define SYMBOLIC_LINK_ALL_ACCESS STANDARD_RIGHTS_REQUIRED | 0x0001
29 #endif
30
31 /* File Result Flags */
32 #define FILE_SUPERSEDED 0x00000000
33 #define FILE_OPENED 0x00000001
34 #define FILE_CREATED 0x00000002
35 #define FILE_OVERWRITTEN 0x00000003
36 #define FILE_EXISTS 0x00000004
37 #define FILE_DOES_NOT_EXIST 0x00000005
38
39 /* Pipe Flags */
40 #define FILE_PIPE_BYTE_STREAM_MODE 0x00000000
41 #define FILE_PIPE_MESSAGE_MODE 0x00000001
42 #define FILE_PIPE_QUEUE_OPERATION 0x00000000
43 #define FILE_PIPE_COMPLETE_OPERATION 0x00000001
44 #define FILE_PIPE_INBOUND 0x00000000
45 #define FILE_PIPE_OUTBOUND 0x00000001
46 #define FILE_PIPE_FULL_DUPLEX 0x00000002
47 #define FILE_PIPE_CLIENT_END 0x00000000
48 #define FILE_PIPE_SERVER_END 0x00000001
49
50 /* File Attributes */
51 #define FILE_ATTRIBUTE_VALID_FLAGS 0x00007fb7
52 #define FILE_ATTRIBUTE_VALID_SET_FLAGS 0x000031a7
53
54 /* File Flags */
55 #define FILE_SUPERSEDE 0x00000000
56 #define FILE_OPEN 0x00000001
57 #define FILE_CREATE 0x00000002
58 #define FILE_OPEN_IF 0x00000003
59 #define FILE_OVERWRITE 0x00000004
60 #define FILE_OVERWRITE_IF 0x00000005
61 #define FILE_MAXIMUM_DISPOSITION 0x00000005
62
63 /* File Types */
64 #define FILE_DIRECTORY_FILE 0x00000001
65 #define FILE_WRITE_THROUGH 0x00000002
66 #define FILE_SEQUENTIAL_ONLY 0x00000004
67 #define FILE_NO_INTERMEDIATE_BUFFERING 0x00000008
68 #define FILE_SYNCHRONOUS_IO_ALERT 0x00000010
69 #define FILE_SYNCHRONOUS_IO_NONALERT 0x00000020
70 #define FILE_NON_DIRECTORY_FILE 0x00000040
71 #define FILE_CREATE_TREE_CONNECTION 0x00000080
72 #define FILE_COMPLETE_IF_OPLOCKED 0x00000100
73 #define FILE_NO_EA_KNOWLEDGE 0x00000200
74 #define FILE_OPEN_FOR_RECOVERY 0x00000400
75 #define FILE_RANDOM_ACCESS 0x00000800
76 #define FILE_DELETE_ON_CLOSE 0x00001000
77 #define FILE_OPEN_BY_FILE_ID 0x00002000
78 #define FILE_OPEN_FOR_BACKUP_INTENT 0x00004000
79 #define FILE_NO_COMPRESSION 0x00008000
80 #define FILE_RESERVE_OPFILTER 0x00100000
81 #define FILE_OPEN_REPARSE_POINT 0x00200000
82 #define FILE_OPEN_NO_RECALL 0x00400000
83 #define FILE_OPEN_FOR_FREE_SPACE_QUERY 0x00800000
84
85 /* Device Charactertics */
86 #define FILE_REMOVABLE_MEDIA 0x00000001
87 #define FILE_REMOTE_DEVICE 0x00000010
88
89 /* Device Object Extension Flags */
90 #define DOE_UNLOAD_PENDING 0x1
91 #define DOE_DELETE_PENDING 0x2
92 #define DOE_REMOVE_PENDING 0x4
93 #define DOE_REMOVE_PROCESSED 0x8
94 #define DOE_START_PENDING 0x10
95
96 /* Device Node Flags */
97 #define DNF_PROCESSED 0x00000001
98 #define DNF_STARTED 0x00000002
99 #define DNF_START_FAILED 0x00000004
100 #define DNF_ENUMERATED 0x00000008
101 #define DNF_DELETED 0x00000010
102 #define DNF_MADEUP 0x00000020
103 #define DNF_START_REQUEST_PENDING 0x00000040
104 #define DNF_NO_RESOURCE_REQUIRED 0x00000080
105 #define DNF_INSUFFICIENT_RESOURCES 0x00000100
106 #define DNF_RESOURCE_ASSIGNED 0x00000200
107 #define DNF_RESOURCE_REPORTED 0x00000400
108 #define DNF_HAL_NODE 0x00000800 // ???
109 #define DNF_ADDED 0x00001000
110 #define DNF_ADD_FAILED 0x00002000
111 #define DNF_LEGACY_DRIVER 0x00004000
112 #define DNF_STOPPED 0x00008000
113 #define DNF_WILL_BE_REMOVED 0x00010000
114 #define DNF_NEED_TO_ENUM 0x00020000
115 #define DNF_NOT_CONFIGURED 0x00040000
116 #define DNF_REINSTALL 0x00080000
117 #define DNF_RESOURCE_REQUIREMENTS_NEED_FILTERED 0x00100000 // ???
118 #define DNF_DISABLED 0x00200000
119 #define DNF_RESTART_OK 0x00400000
120 #define DNF_NEED_RESTART 0x00800000
121 #define DNF_VISITED 0x01000000
122 #define DNF_ASSIGNING_RESOURCES 0x02000000
123 #define DNF_BEEING_ENUMERATED 0x04000000
124 #define DNF_NEED_ENUMERATION_ONLY 0x08000000
125 #define DNF_LOCKED 0x10000000
126 #define DNF_HAS_BOOT_CONFIG 0x20000000
127 #define DNF_BOOT_CONFIG_RESERVED 0x40000000
128 #define DNF_HAS_PROBLEM 0x80000000 // ???
129 /* For UserFlags field */
130 #define DNUF_DONT_SHOW_IN_UI 0x0002
131 #define DNUF_NOT_DISABLEABLE 0x0008
132
133 /* ENUMERATIONS **************************************************************/
134
135 #ifdef NTOS_MODE_USER
136 typedef enum _INTERFACE_TYPE
137 {
138 InterfaceTypeUndefined = -1,
139 Internal,
140 Isa,
141 Eisa,
142 MicroChannel,
143 TurboChannel,
144 PCIBus,
145 VMEBus,
146 NuBus,
147 PCMCIABus,
148 CBus,
149 MPIBus,
150 MPSABus,
151 ProcessorInternal,
152 InternalPowerBus,
153 PNPISABus,
154 PNPBus,
155 MaximumInterfaceType
156 }INTERFACE_TYPE, *PINTERFACE_TYPE;
157
158 typedef enum _FILE_INFORMATION_CLASS
159 {
160 FileDirectoryInformation = 1,
161 FileFullDirectoryInformation,
162 FileBothDirectoryInformation,
163 FileBasicInformation,
164 FileStandardInformation,
165 FileInternalInformation,
166 FileEaInformation,
167 FileAccessInformation,
168 FileNameInformation,
169 FileRenameInformation,
170 FileLinkInformation,
171 FileNamesInformation,
172 FileDispositionInformation,
173 FilePositionInformation,
174 FileFullEaInformation,
175 FileModeInformation,
176 FileAlignmentInformation,
177 FileAllInformation,
178 FileAllocationInformation,
179 FileEndOfFileInformation,
180 FileAlternateNameInformation,
181 FileStreamInformation,
182 FilePipeInformation,
183 FilePipeLocalInformation,
184 FilePipeRemoteInformation,
185 FileMailslotQueryInformation,
186 FileMailslotSetInformation,
187 FileCompressionInformation,
188 FileObjectIdInformation,
189 FileCompletionInformation,
190 FileMoveClusterInformation,
191 FileQuotaInformation,
192 FileReparsePointInformation,
193 FileNetworkOpenInformation,
194 FileAttributeTagInformation,
195 FileTrackingInformation,
196 FileIdBothDirectoryInformation,
197 FileIdFullDirectoryInformation,
198 FileValidDataLengthInformation,
199 FileShortNameInformation,
200 FileMaximumInformation
201 } FILE_INFORMATION_CLASS, *PFILE_INFORMATION_CLASS;
202
203 typedef enum _FSINFOCLASS
204 {
205 FileFsVolumeInformation = 1,
206 FileFsLabelInformation,
207 FileFsSizeInformation,
208 FileFsDeviceInformation,
209 FileFsAttributeInformation,
210 FileFsControlInformation,
211 FileFsFullSizeInformation,
212 FileFsObjectIdInformation,
213 FileFsDriverPathInformation,
214 FileFsMaximumInformation
215 } FS_INFORMATION_CLASS, *PFS_INFORMATION_CLASS;
216 #endif
217
218 typedef enum _PNP_DEVNODE_STATE
219 {
220 DeviceNodeUnspecified = 0x300,
221 DeviceNodeUninitialized = 0x301,
222 DeviceNodeInitialized = 0x302,
223 DeviceNodeDriversAdded = 0x303,
224 DeviceNodeResourcesAssigned = 0x304,
225 DeviceNodeStartPending = 0x305,
226 DeviceNodeStartCompletion = 0x306,
227 DeviceNodeStartPostWork = 0x307,
228 DeviceNodeStarted = 0x308,
229 DeviceNodeQueryStopped = 0x309,
230 DeviceNodeStopped = 0x30a,
231 DeviceNodeRestartCompletion = 0x30b,
232 DeviceNodeEnumeratePending = 0x30c,
233 DeviceNodeEnumerateCompletion = 0x30d,
234 DeviceNodeAwaitingQueuedDeletion = 0x30e,
235 DeviceNodeAwaitingQueuedRemoval = 0x30f,
236 DeviceNodeQueryRemoved = 0x310,
237 DeviceNodeRemovePendingCloses = 0x311,
238 DeviceNodeRemoved = 0x312,
239 DeviceNodeDeletePendingCloses = 0x313,
240 DeviceNodeDeleted = 0x314,
241 MaxDeviceNodeState = 0x315,
242 } PNP_DEVNODE_STATE;
243
244 /* TYPES *********************************************************************/
245
246 #ifdef NTOS_MODE_USER
247 typedef struct _FILE_BASIC_INFORMATION
248 {
249 LARGE_INTEGER CreationTime;
250 LARGE_INTEGER LastAccessTime;
251 LARGE_INTEGER LastWriteTime;
252 LARGE_INTEGER ChangeTime;
253 ULONG FileAttributes;
254 } FILE_BASIC_INFORMATION, *PFILE_BASIC_INFORMATION;
255
256 typedef struct _FILE_STANDARD_INFORMATION
257 {
258 LARGE_INTEGER AllocationSize;
259 LARGE_INTEGER EndOfFile;
260 ULONG NumberOfLinks;
261 BOOLEAN DeletePending;
262 BOOLEAN Directory;
263 } FILE_STANDARD_INFORMATION, *PFILE_STANDARD_INFORMATION;
264
265 typedef struct _FILE_NETWORK_OPEN_INFORMATION
266 {
267 LARGE_INTEGER CreationTime;
268 LARGE_INTEGER LastAccessTime;
269 LARGE_INTEGER LastWriteTime;
270 LARGE_INTEGER ChangeTime;
271 LARGE_INTEGER AllocationSize;
272 LARGE_INTEGER EndOfFile;
273 ULONG FileAttributes;
274 } FILE_NETWORK_OPEN_INFORMATION, *PFILE_NETWORK_OPEN_INFORMATION;
275
276 typedef struct _FILE_EA_INFORMATION
277 {
278 ULONG EaSize;
279 } FILE_EA_INFORMATION, *PFILE_EA_INFORMATION;
280
281 typedef struct _FILE_COMPRESSION_INFORMATION
282 {
283 LARGE_INTEGER CompressedFileSize;
284 USHORT CompressionFormat;
285 UCHAR CompressionUnitShift;
286 UCHAR ChunkShift;
287 UCHAR ClusterShift;
288 UCHAR Reserved[3];
289 } FILE_COMPRESSION_INFORMATION, *PFILE_COMPRESSION_INFORMATION;
290
291 typedef struct _FILE_POSITION_INFORMATION
292 {
293 LARGE_INTEGER CurrentByteOffset;
294 } FILE_POSITION_INFORMATION, *PFILE_POSITION_INFORMATION;
295
296 typedef struct _FILE_DISPOSITION_INFORMATION
297 {
298 BOOLEAN DeleteFile;
299 } FILE_DISPOSITION_INFORMATION, *PFILE_DISPOSITION_INFORMATION;
300
301 typedef struct _FILE_FULL_EA_INFORMATION
302 {
303 ULONG NextEntryOffset;
304 UCHAR Flags;
305 UCHAR EaNameLength;
306 USHORT EaValueLength;
307 CHAR EaName[1];
308 } FILE_FULL_EA_INFORMATION, *PFILE_FULL_EA_INFORMATION;
309
310 typedef struct _FILE_QUOTA_INFORMATION
311 {
312 ULONG NextEntryOffset;
313 ULONG SidLength;
314 LARGE_INTEGER ChangeTime;
315 LARGE_INTEGER QuotaUsed;
316 LARGE_INTEGER QuotaThreshold;
317 LARGE_INTEGER QuotaLimit;
318 SID Sid;
319 } FILE_QUOTA_INFORMATION, *PFILE_QUOTA_INFORMATION;
320
321 typedef struct _FILE_INTERNAL_INFORMATION
322 {
323 LARGE_INTEGER IndexNumber;
324 } FILE_INTERNAL_INFORMATION, *PFILE_INTERNAL_INFORMATION;
325
326 typedef struct _FILE_RENAME_INFORMATION
327 {
328 BOOLEAN ReplaceIfExists;
329 HANDLE RootDirectory;
330 ULONG FileNameLength;
331 WCHAR FileName[1];
332 } FILE_RENAME_INFORMATION, *PFILE_RENAME_INFORMATION;
333
334 typedef struct _FILE_PIPE_INFORMATION
335 {
336 ULONG ReadMode;
337 ULONG CompletionMode;
338 } FILE_PIPE_INFORMATION, *PFILE_PIPE_INFORMATION;
339
340 typedef struct _FILE_PIPE_LOCAL_INFORMATION
341 {
342 ULONG NamedPipeType;
343 ULONG NamedPipeConfiguration;
344 ULONG MaximumInstances;
345 ULONG CurrentInstances;
346 ULONG InboundQuota;
347 ULONG ReadDataAvailable;
348 ULONG OutboundQuota;
349 ULONG WriteQuotaAvailable;
350 ULONG NamedPipeState;
351 ULONG NamedPipeEnd;
352 } FILE_PIPE_LOCAL_INFORMATION, *PFILE_PIPE_LOCAL_INFORMATION;
353
354 typedef struct _FILE_PIPE_REMOTE_INFORMATION
355 {
356 LARGE_INTEGER CollectDataTime;
357 ULONG MaximumCollectionCount;
358 } FILE_PIPE_REMOTE_INFORMATION, *PFILE_PIPE_REMOTE_INFORMATION;
359
360 typedef struct _FILE_MAILSLOT_QUERY_INFORMATION
361 {
362 ULONG MaximumMessageSize;
363 ULONG MailslotQuota;
364 ULONG NextMessageSize;
365 ULONG MessagesAvailable;
366 LARGE_INTEGER ReadTimeout;
367 } FILE_MAILSLOT_QUERY_INFORMATION, *PFILE_MAILSLOT_QUERY_INFORMATION;
368
369 typedef struct _FILE_MAILSLOT_SET_INFORMATION
370 {
371 PLARGE_INTEGER ReadTimeout;
372 } FILE_MAILSLOT_SET_INFORMATION, *PFILE_MAILSLOT_SET_INFORMATION;
373
374 typedef struct _FILE_BOTH_DIR_INFORMATION
375 {
376 ULONG NextEntryOffset;
377 ULONG FileIndex;
378 LARGE_INTEGER CreationTime;
379 LARGE_INTEGER LastAccessTime;
380 LARGE_INTEGER LastWriteTime;
381 LARGE_INTEGER ChangeTime;
382 LARGE_INTEGER EndOfFile;
383 LARGE_INTEGER AllocationSize;
384 ULONG FileAttributes;
385 ULONG FileNameLength;
386 ULONG EaSize;
387 CCHAR ShortNameLength;
388 WCHAR ShortName[12];
389 WCHAR FileName[1];
390 } FILE_BOTH_DIR_INFORMATION, *PFILE_BOTH_DIR_INFORMATION;
391
392 typedef struct _FILE_COMPLETION_INFORMATION
393 {
394 HANDLE Port;
395 PVOID Key;
396 } FILE_COMPLETION_INFORMATION, *PFILE_COMPLETION_INFORMATION;
397
398 typedef struct _FILE_LINK_INFORMATION
399 {
400 BOOLEAN ReplaceIfExists;
401 HANDLE RootDirectory;
402 ULONG FileNameLength;
403 WCHAR FileName[1];
404 } FILE_LINK_INFORMATION, *PFILE_LINK_INFORMATION;
405
406 typedef struct _FILE_NAME_INFORMATION
407 {
408 ULONG FileNameLength;
409 WCHAR FileName[1];
410 } FILE_NAME_INFORMATION, *PFILE_NAME_INFORMATION;
411
412 typedef struct _FILE_ALLOCATION_INFORMATION
413 {
414 LARGE_INTEGER AllocationSize;
415 } FILE_ALLOCATION_INFORMATION, *PFILE_ALLOCATION_INFORMATION;
416
417 typedef struct _FILE_END_OF_FILE_INFORMATION
418 {
419 LARGE_INTEGER EndOfFile;
420 } FILE_END_OF_FILE_INFORMATION, *PFILE_END_OF_FILE_INFORMATION;
421
422 typedef struct _FILE_VALID_DATA_LENGTH_INFORMATION
423 {
424 LARGE_INTEGER ValidDataLength;
425 } FILE_VALID_DATA_LENGTH_INFORMATION, *PFILE_VALID_DATA_LENGTH_INFORMATION;
426
427 typedef struct _FILE_FS_DEVICE_INFORMATION
428 {
429 DEVICE_TYPE DeviceType;
430 ULONG Characteristics;
431 } FILE_FS_DEVICE_INFORMATION, *PFILE_FS_DEVICE_INFORMATION;
432
433 typedef struct _FILE_FS_ATTRIBUTE_INFORMATION
434 {
435 ULONG FileSystemAttributes;
436 ULONG MaximumComponentNameLength;
437 ULONG FileSystemNameLength;
438 WCHAR FileSystemName[1];
439 } FILE_FS_ATTRIBUTE_INFORMATION, *PFILE_FS_ATTRIBUTE_INFORMATION;
440
441 typedef struct _FILE_FS_SIZE_INFORMATION
442 {
443 LARGE_INTEGER TotalAllocationUnits;
444 LARGE_INTEGER AvailableAllocationUnits;
445 ULONG SectorsPerAllocationUnit;
446 ULONG BytesPerSector;
447 } FILE_FS_SIZE_INFORMATION, *PFILE_FS_SIZE_INFORMATION;
448
449 typedef struct _FILE_FS_LABEL_INFORMATION
450 {
451 ULONG VolumeLabelLength;
452 WCHAR VolumeLabel[1];
453 } FILE_FS_LABEL_INFORMATION, *PFILE_FS_LABEL_INFORMATION;
454
455 typedef struct _FILE_FS_VOLUME_INFORMATION
456 {
457 LARGE_INTEGER VolumeCreationTime;
458 ULONG VolumeSerialNumber;
459 ULONG VolumeLabelLength;
460 BOOLEAN SupportsObjects;
461 WCHAR VolumeLabel[1];
462 } FILE_FS_VOLUME_INFORMATION, *PFILE_FS_VOLUME_INFORMATION;
463
464 typedef struct _FILE_PIPE_WAIT_FOR_BUFFER
465 {
466 LARGE_INTEGER Timeout;
467 ULONG NameLength;
468 BOOLEAN TimeoutSpecified;
469 WCHAR Name[1];
470 } FILE_PIPE_WAIT_FOR_BUFFER, *PFILE_PIPE_WAIT_FOR_BUFFER;
471
472 typedef struct _FILE_PIPE_PEEK_BUFFER
473 {
474 ULONG NamedPipeState;
475 ULONG ReadDataAvailable;
476 ULONG NumberOfMessages;
477 ULONG MessageLength;
478 CHAR Data[1];
479 } FILE_PIPE_PEEK_BUFFER, *PFILE_PIPE_PEEK_BUFFER;
480
481 typedef struct _IO_STATUS_BLOCK
482 {
483 union
484 {
485 NTSTATUS Status;
486 PVOID Pointer;
487 };
488 ULONG_PTR Information;
489 } IO_STATUS_BLOCK, *PIO_STATUS_BLOCK;
490
491 typedef struct _IO_ERROR_LOG_PACKET
492 {
493 UCHAR MajorFunctionCode;
494 UCHAR RetryCount;
495 USHORT DumpDataSize;
496 USHORT NumberOfStrings;
497 USHORT StringOffset;
498 USHORT EventCategory;
499 NTSTATUS ErrorCode;
500 ULONG UniqueErrorValue;
501 NTSTATUS FinalStatus;
502 ULONG SequenceNumber;
503 ULONG IoControlCode;
504 LARGE_INTEGER DeviceOffset;
505 ULONG DumpData[1];
506 }IO_ERROR_LOG_PACKET, *PIO_ERROR_LOG_PACKET;
507
508 typedef struct _IO_ERROR_LOG_MESSAGE
509 {
510 USHORT Type;
511 USHORT Size;
512 USHORT DriverNameLength;
513 LARGE_INTEGER TimeStamp;
514 ULONG DriverNameOffset;
515 IO_ERROR_LOG_PACKET EntryData;
516 } IO_ERROR_LOG_MESSAGE, *PIO_ERROR_LOG_MESSAGE;
517 #endif
518
519 typedef struct _MAILSLOT_CREATE_PARAMETERS
520 {
521 ULONG MailslotQuota;
522 ULONG MaximumMessageSize;
523 LARGE_INTEGER ReadTimeout;
524 BOOLEAN TimeoutSpecified;
525 } MAILSLOT_CREATE_PARAMETERS, *PMAILSLOT_CREATE_PARAMETERS;
526
527 typedef struct _NAMED_PIPE_CREATE_PARAMETERS
528 {
529 ULONG NamedPipeType;
530 ULONG ReadMode;
531 ULONG CompletionMode;
532 ULONG MaximumInstances;
533 ULONG InboundQuota;
534 ULONG OutboundQuota;
535 LARGE_INTEGER DefaultTimeout;
536 BOOLEAN TimeoutSpecified;
537 } NAMED_PIPE_CREATE_PARAMETERS, *PNAMED_PIPE_CREATE_PARAMETERS;
538
539 #ifndef NTOS_MODE_USER
540 typedef struct _IO_TIMER
541 {
542 USHORT Type;
543 USHORT TimerEnabled;
544 LIST_ENTRY IoTimerList;
545 PIO_TIMER_ROUTINE TimerRoutine;
546 PVOID Context;
547 PDEVICE_OBJECT DeviceObject;
548 } IO_TIMER, *PIO_TIMER;
549
550 typedef struct _DEVICE_NODE
551 {
552 struct _DEVICE_NODE *Parent;
553 struct _DEVICE_NODE *PrevSibling;
554 struct _DEVICE_NODE *NextSibling;
555 struct _DEVICE_NODE *Child;
556 ULONG Level;
557 struct _PO_DEVICE_NOTIFY *Notify;
558 PNP_DEVNODE_STATE State;
559 PNP_DEVNODE_STATE PreviousState;
560 PNP_DEVNODE_STATE StateHistory[20];
561 ULONG StateHistoryEntry;
562 INT CompletionStatus;
563 PIRP PendingIrp;
564 ULONG Flags;
565 ULONG UserFlags;
566 ULONG Problem;
567 PDEVICE_OBJECT PhysicalDeviceObject;
568 PCM_RESOURCE_LIST ResourceList;
569 PCM_RESOURCE_LIST ResourceListTranslated;
570 UNICODE_STRING InstancePath;
571 UNICODE_STRING ServiceName;
572 PDEVICE_OBJECT DuplicatePDO;
573 PIO_RESOURCE_REQUIREMENTS_LIST ResourceRequirements;
574 INTERFACE_TYPE InterfaceType;
575 ULONG BusNumber;
576 INTERFACE_TYPE ChildInterfaceType;
577 ULONG ChildBusNumber;
578 USHORT ChildBusTypeIndex;
579 UCHAR RemovalPolicy;
580 UCHAR HardwareRemovalPolicy;
581 LIST_ENTRY TargetDeviceNotify;
582 LIST_ENTRY DeviceArbiterList;
583 LIST_ENTRY DeviceTranslatorList;
584 USHORT NoTranslatorMask;
585 USHORT QueryTranslatorMask;
586 USHORT NoArbiterMask;
587 USHORT QueryArbiterMask;
588 union
589 {
590 struct _DEVICE_NODE *LegacyDeviceNode;
591 PDEVICE_RELATIONS PendingDeviceRelations;
592 } OverUsed1;
593 union
594 {
595 struct _DEVICE_NODE *NextResourceDeviceNode;
596 } OverUsed2;
597 PCM_RESOURCE_LIST BootResources;
598 ULONG CapabilityFlags;
599 struct
600 {
601 ULONG DockStatus;
602 LIST_ENTRY ListEntry;
603 WCHAR *SerialNumber;
604 } DockInfo;
605 ULONG DisableableDepends;
606 LIST_ENTRY PendedSetInterfaceState;
607 LIST_ENTRY LegacyBusListEntry;
608 ULONG DriverUnloadRetryCount;
609 struct _DEVICE_NODE *PreviousParent;
610 ULONG DeletedChidren;
611 } DEVICE_NODE, *PDEVICE_NODE;
612
613 typedef struct _PI_RESOURCE_ARBITER_ENTRY
614 {
615 LIST_ENTRY DeviceArbiterList;
616 UCHAR ResourceType;
617 PARBITER_INTERFACE ArbiterInterface;
618 ULONG Level;
619 LIST_ENTRY ResourceList;
620 LIST_ENTRY BestResourceList;
621 LIST_ENTRY BestConfig;
622 LIST_ENTRY ActiveArbiterList;
623 UCHAR State;
624 UCHAR ResourcesChanged;
625 } PI_RESOURCE_ARBITER_ENTRY, *PPI_RESOURCE_ARBITER_ENTRY;
626
627 typedef struct _EXTENDED_DEVOBJ_EXTENSION
628 {
629 CSHORT Type;
630 USHORT Size;
631 PDEVICE_OBJECT DeviceObject;
632 ULONG PowerFlags;
633 struct DEVICE_OBJECT_POWER_EXTENSION *Dope;
634 ULONG ExtensionFlags;
635 struct _DEVICE_NODE *DeviceNode;
636 PDEVICE_OBJECT AttachedTo;
637 LONG StartIoCount;
638 LONG StartIoKey;
639 ULONG StartIoFlags;
640 struct _VPB *Vpb;
641 } EXTENDED_DEVOBJ_EXTENSION, *PEXTENDED_DEVOBJ_EXTENSION;
642
643 typedef struct _PRIVATE_DRIVER_EXTENSIONS
644 {
645 struct _PRIVATE_DRIVER_EXTENSIONS *Link;
646 PVOID ClientIdentificationAddress;
647 CHAR Extension[1];
648 } PRIVATE_DRIVER_EXTENSIONS, *PPRIVATE_DRIVER_EXTENSIONS;
649
650 #if !defined(_ALPHA_)
651 #include <pshpack4.h>
652 #endif
653 typedef struct _EXTENDED_IO_STACK_LOCATION
654 {
655 UCHAR MajorFunction;
656 UCHAR MinorFunction;
657 UCHAR Flags;
658 UCHAR Control;
659 union
660 {
661 struct
662 {
663 PIO_SECURITY_CONTEXT SecurityContext;
664 ULONG Options;
665 USHORT FileAttributes;
666 USHORT ShareAccess;
667 ULONG EaLength;
668 } Create;
669 struct
670 {
671 PIO_SECURITY_CONTEXT SecurityContext;
672 ULONG Options;
673 USHORT Reserved;
674 USHORT ShareAccess;
675 struct _NAMED_PIPE_CREATE_PARAMETERS *Parameters;
676 } CreatePipe;
677 struct
678 {
679 PIO_SECURITY_CONTEXT SecurityContext;
680 ULONG Options;
681 USHORT Reserved;
682 USHORT ShareAccess;
683 struct _MAILSLOT_CREATE_PARAMETERS *Parameters;
684 } CreateMailslot;
685 struct
686 {
687 ULONG Length;
688 ULONG Key;
689 LARGE_INTEGER ByteOffset;
690 } Read;
691 struct
692 {
693 ULONG Length;
694 ULONG Key;
695 LARGE_INTEGER ByteOffset;
696 } Write;
697 struct
698 {
699 ULONG Length;
700 PUNICODE_STRING FileName;
701 FILE_INFORMATION_CLASS FileInformationClass;
702 ULONG FileIndex;
703 } QueryDirectory;
704 struct
705 {
706 ULONG Length;
707 ULONG CompletionFilter;
708 } NotifyDirectory;
709 struct
710 {
711 ULONG Length;
712 FILE_INFORMATION_CLASS FileInformationClass;
713 } QueryFile;
714 struct
715 {
716 ULONG Length;
717 FILE_INFORMATION_CLASS FileInformationClass;
718 PFILE_OBJECT FileObject;
719 union
720 {
721 struct
722 {
723 BOOLEAN ReplaceIfExists;
724 BOOLEAN AdvanceOnly;
725 };
726 ULONG ClusterCount;
727 HANDLE DeleteHandle;
728 };
729 } SetFile;
730 struct
731 {
732 ULONG Length;
733 PVOID EaList;
734 ULONG EaListLength;
735 ULONG EaIndex;
736 } QueryEa;
737 struct
738 {
739 ULONG Length;
740 } SetEa;
741 struct
742 {
743 ULONG Length;
744 FS_INFORMATION_CLASS FsInformationClass;
745 } QueryVolume;
746 struct
747 {
748 ULONG Length;
749 FS_INFORMATION_CLASS FsInformationClass;
750 } SetVolume;
751 struct
752 {
753 ULONG OutputBufferLength;
754 ULONG InputBufferLength;
755 ULONG FsControlCode;
756 PVOID Type3InputBuffer;
757 } FileSystemControl;
758 struct
759 {
760 PLARGE_INTEGER Length;
761 ULONG Key;
762 LARGE_INTEGER ByteOffset;
763 } LockControl;
764 struct
765 {
766 ULONG OutputBufferLength;
767 ULONG InputBufferLength;
768 ULONG IoControlCode;
769 PVOID Type3InputBuffer;
770 } DeviceIoControl;
771 struct
772 {
773 SECURITY_INFORMATION SecurityInformation;
774 ULONG POINTER_ALIGNMENT Length;
775 } QuerySecurity;
776 struct
777 {
778 SECURITY_INFORMATION SecurityInformation;
779 PSECURITY_DESCRIPTOR SecurityDescriptor;
780 } SetSecurity;
781 struct
782 {
783 PVPB Vpb;
784 PDEVICE_OBJECT DeviceObject;
785 } MountVolume;
786 struct
787 {
788 PVPB Vpb;
789 PDEVICE_OBJECT DeviceObject;
790 } VerifyVolume;
791 struct
792 {
793 struct _SCSI_REQUEST_BLOCK *Srb;
794 } Scsi;
795 struct
796 {
797 ULONG Length;
798 PSID StartSid;
799 struct _FILE_GET_QUOTA_INFORMATION *SidList;
800 ULONG SidListLength;
801 } QueryQuota;
802 struct
803 {
804 ULONG Length;
805 } SetQuota;
806 struct
807 {
808 DEVICE_RELATION_TYPE Type;
809 } QueryDeviceRelations;
810 struct
811 {
812 CONST GUID *InterfaceType;
813 USHORT Size;
814 USHORT Version;
815 PINTERFACE Interface;
816 PVOID InterfaceSpecificData;
817 } QueryInterface;
818 struct
819 {
820 PDEVICE_CAPABILITIES Capabilities;
821 } DeviceCapabilities;
822 struct
823 {
824 PIO_RESOURCE_REQUIREMENTS_LIST IoResourceRequirementList;
825 } FilterResourceRequirements;
826 struct
827 {
828 ULONG WhichSpace;
829 PVOID Buffer;
830 ULONG Offset;
831 ULONG Length;
832 } ReadWriteConfig;
833 struct
834 {
835 BOOLEAN Lock;
836 } SetLock;
837 struct
838 {
839 BUS_QUERY_ID_TYPE IdType;
840 } QueryId;
841 struct
842 {
843 DEVICE_TEXT_TYPE DeviceTextType;
844 LCID LocaleId;
845 } QueryDeviceText;
846 struct
847 {
848 BOOLEAN InPath;
849 BOOLEAN Reserved[3];
850 DEVICE_USAGE_NOTIFICATION_TYPE Type;
851 } UsageNotification;
852 struct
853 {
854 SYSTEM_POWER_STATE PowerState;
855 } WaitWake;
856 struct
857 {
858 PPOWER_SEQUENCE PowerSequence;
859 } PowerSequence;
860 struct
861 {
862 ULONG SystemContext;
863 POWER_STATE_TYPE Type;
864 POWER_STATE State;
865 POWER_ACTION ShutdownType;
866 } Power;
867 struct
868 {
869 PCM_RESOURCE_LIST AllocatedResources;
870 PCM_RESOURCE_LIST AllocatedResourcesTranslated;
871 } StartDevice;
872 struct
873 {
874 ULONG_PTR ProviderId;
875 PVOID DataPath;
876 ULONG BufferSize;
877 PVOID Buffer;
878 } WMI;
879 struct
880 {
881 PVOID Argument1;
882 PVOID Argument2;
883 PVOID Argument3;
884 PVOID Argument4;
885 } Others;
886 } Parameters;
887 PDEVICE_OBJECT DeviceObject;
888 PFILE_OBJECT FileObject;
889 PIO_COMPLETION_ROUTINE CompletionRoutine;
890 PVOID Context;
891 } EXTENDED_IO_STACK_LOCATION, *PEXTENDED_IO_STACK_LOCATION;
892 #if !defined(_ALPHA_)
893 #include <poppack.h>
894 #endif
895 #endif
896
897 /* FUNCTION TYPES ************************************************************/
898
899 typedef VOID
900 (NTAPI *PIO_APC_ROUTINE)(
901 IN PVOID ApcContext,
902 IN PIO_STATUS_BLOCK IoStatusBlock,
903 IN ULONG Reserved);
904
905 /* I/O CONTROL CODES *********************************************************/
906
907 #ifdef NTOS_MODE_USER
908 /* Mailslots */
909 #define FSCTL_MAILSLOT_PEEK \
910 CTL_CODE(FILE_DEVICE_MAILSLOT, 0, METHOD_NEITHER, FILE_READ_DATA)
911
912 /* Pipes */
913 #define FSCTL_PIPE_ASSIGN_EVENT \
914 CTL_CODE(FILE_DEVICE_NAMED_PIPE, 0, METHOD_BUFFERED, FILE_ANY_ACCESS)
915 #define FSCTL_PIPE_DISCONNECT \
916 CTL_CODE(FILE_DEVICE_NAMED_PIPE, 1, METHOD_BUFFERED, FILE_ANY_ACCESS)
917 #define FSCTL_PIPE_LISTEN \
918 CTL_CODE(FILE_DEVICE_NAMED_PIPE, 2, METHOD_BUFFERED, FILE_ANY_ACCESS)
919 #define FSCTL_PIPE_PEEK \
920 CTL_CODE(FILE_DEVICE_NAMED_PIPE, 3, METHOD_BUFFERED, FILE_READ_DATA)
921 #define FSCTL_PIPE_QUERY_EVENT \
922 CTL_CODE(FILE_DEVICE_NAMED_PIPE, 4, METHOD_BUFFERED, FILE_ANY_ACCESS)
923 #define FSCTL_PIPE_TRANSCEIVE \
924 CTL_CODE(FILE_DEVICE_NAMED_PIPE, 5, METHOD_NEITHER, FILE_READ_DATA | FILE_WRITE_DATA)
925 #define FSCTL_PIPE_WAIT \
926 CTL_CODE(FILE_DEVICE_NAMED_PIPE, 6, METHOD_BUFFERED, FILE_ANY_ACCESS)
927 #define FSCTL_PIPE_IMPERSONATE \
928 CTL_CODE(FILE_DEVICE_NAMED_PIPE, 7, METHOD_BUFFERED, FILE_ANY_ACCESS)
929 #define FSCTL_PIPE_SET_CLIENT_PROCESS \
930 CTL_CODE(FILE_DEVICE_NAMED_PIPE, 8, METHOD_BUFFERED, FILE_ANY_ACCESS)
931 #define FSCTL_PIPE_QUERY_CLIENT_PROCESS \
932 CTL_CODE(FILE_DEVICE_NAMED_PIPE, 9, METHOD_BUFFERED, FILE_ANY_ACCESS)
933 #define FSCTL_PIPE_INTERNAL_READ \
934 CTL_CODE(FILE_DEVICE_NAMED_PIPE, 2045, METHOD_BUFFERED, FILE_READ_DATA)
935 #define FSCTL_PIPE_INTERNAL_WRITE \
936 CTL_CODE(FILE_DEVICE_NAMED_PIPE, 2046, METHOD_BUFFERED, FILE_WRITE_DATA)
937 #define FSCTL_PIPE_INTERNAL_TRANSCEIVE \
938 CTL_CODE(FILE_DEVICE_NAMED_PIPE, 2047, METHOD_NEITHER, FILE_READ_DATA | FILE_WRITE_DATA)
939 #define FSCTL_PIPE_INTERNAL_READ_OVFLOW \
940 CTL_CODE(FILE_DEVICE_NAMED_PIPE, 2048, METHOD_BUFFERED, FILE_READ_DATA)
941
942 /* Tapes */
943 #define IOCTL_TAPE_ERASE \
944 CTL_CODE(FILE_DEVICE_TAPE, 0, METHOD_BUFFERED, FILE_READ_ACCESS | FILE_WRITE_ACCESS)
945 #define IOCTL_TAPE_PREPARE \
946 CTL_CODE(FILE_DEVICE_TAPE, 1, METHOD_BUFFERED, FILE_READ_ACCESS)
947 #define IOCTL_TAPE_WRITE_MARKS \
948 CTL_CODE(FILE_DEVICE_TAPE, 2, METHOD_BUFFERED, FILE_READ_ACCESS | FILE_WRITE_ACCESS)
949 #define IOCTL_TAPE_GET_POSITION \
950 CTL_CODE(FILE_DEVICE_TAPE, 3, METHOD_BUFFERED, FILE_READ_ACCESS)
951 #define IOCTL_TAPE_SET_POSITION \
952 CTL_CODE(FILE_DEVICE_TAPE, 4, METHOD_BUFFERED, FILE_READ_ACCESS)
953 #define IOCTL_TAPE_GET_DRIVE_PARAMS \
954 CTL_CODE(FILE_DEVICE_TAPE, 5, METHOD_BUFFERED, FILE_READ_ACCESS)
955 #define IOCTL_TAPE_SET_DRIVE_PARAMS \
956 CTL_CODE(FILE_DEVICE_TAPE, 6, METHOD_BUFFERED, FILE_READ_ACCESS | FILE_WRITE_ACCESS)
957 #define IOCTL_TAPE_GET_MEDIA_PARAMS \
958 CTL_CODE(FILE_DEVICE_TAPE, 7, METHOD_BUFFERED, FILE_READ_ACCESS)
959 #define IOCTL_TAPE_SET_MEDIA_PARAMS \
960 CTL_CODE(FILE_DEVICE_TAPE, 8, METHOD_BUFFERED, FILE_READ_ACCESS)
961 #define IOCTL_TAPE_GET_STATUS \
962 CTL_CODE(FILE_DEVICE_TAPE, 9, METHOD_BUFFERED, FILE_READ_ACCESS)
963 #define IOCTL_TAPE_CREATE_PARTITION \
964 CTL_CODE(FILE_DEVICE_TAPE, 10, METHOD_BUFFERED, FILE_READ_ACCESS | FILE_WRITE_ACCESS)
965
966 #endif
967 #endif
968