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