ed4a9facc2a6aae57a3f0a5924da15e572679d72
[reactos.git] / sdk / include / ndk / iotypes.h
1 /*++ NDK Version: 0098
2
3 Copyright (c) Alex Ionescu. All rights reserved.
4
5 Header Name:
6
7 iotypes.h
8
9 Abstract:
10
11 Type definitions for the I/O Manager.
12
13 Author:
14
15 Alex Ionescu (alexi@tinykrnl.org) - Updated - 27-Feb-2006
16
17 --*/
18 #ifndef _IOTYPES_H
19 #define _IOTYPES_H
20
21 //
22 // Dependencies
23 //
24 #include <umtypes.h>
25 #include <ifssupp.h>
26 #include <potypes.h>
27
28 //
29 // I/O Completion Access Rights
30 //
31 #define IO_COMPLETION_QUERY_STATE 0x0001
32 #ifndef NTOS_MODE_USER
33 #define IO_COMPLETION_MODIFY_STATE 0x0002
34 #define IO_COMPLETION_ALL_ACCESS (STANDARD_RIGHTS_REQUIRED | \
35 SYNCHRONIZE | \
36 0x3)
37
38 //
39 // Kernel Exported Object Types
40 //
41 extern POBJECT_TYPE NTSYSAPI IoAdapterObjectType;
42 extern POBJECT_TYPE NTSYSAPI IoDeviceHandlerObjectType;
43 extern POBJECT_TYPE NTSYSAPI IoDeviceObjectType;
44 extern POBJECT_TYPE NTSYSAPI IoDriverObjectType;
45
46 #else
47
48 //
49 // Symbolic Link Access Rights
50 //
51 #define SYMBOLIC_LINK_QUERY 0x0001
52 #define SYMBOLIC_LINK_ALL_ACCESS STANDARD_RIGHTS_REQUIRED | 0x0001
53 #endif
54
55 #ifdef NTOS_MODE_USER
56
57 /* File System Attributes Flags */
58 #define FILE_READ_ONLY_VOLUME 0x00080000
59
60 #endif
61
62 //
63 // NtCreateFile Result Flags
64 //
65 #define FILE_SUPERSEDED 0x00000000
66 #define FILE_OPENED 0x00000001
67 #define FILE_CREATED 0x00000002
68 #define FILE_OVERWRITTEN 0x00000003
69 #define FILE_EXISTS 0x00000004
70 #define FILE_DOES_NOT_EXIST 0x00000005
71
72 //
73 // Pipe Flags
74 //
75 #define FILE_PIPE_BYTE_STREAM_TYPE 0x00000000
76 #define FILE_PIPE_MESSAGE_TYPE 0x00000001
77 #define FILE_PIPE_BYTE_STREAM_MODE 0x00000000
78 #define FILE_PIPE_MESSAGE_MODE 0x00000001
79 #define FILE_PIPE_QUEUE_OPERATION 0x00000000
80 #define FILE_PIPE_COMPLETE_OPERATION 0x00000001
81 #define FILE_PIPE_INBOUND 0x00000000
82 #define FILE_PIPE_OUTBOUND 0x00000001
83 #define FILE_PIPE_FULL_DUPLEX 0x00000002
84 #define FILE_PIPE_CLIENT_END 0x00000000
85 #define FILE_PIPE_SERVER_END 0x00000001
86
87 //
88 // NtCreateFile Attributes
89 //
90 #define FILE_ATTRIBUTE_VALID_FLAGS 0x00007fb7
91 #define FILE_ATTRIBUTE_VALID_SET_FLAGS 0x000031a7
92
93 //
94 // NtCreateFile OpenType Flags
95 //
96 #define FILE_SUPERSEDE 0x00000000
97 #define FILE_OPEN 0x00000001
98 #define FILE_CREATE 0x00000002
99 #define FILE_OPEN_IF 0x00000003
100 #define FILE_OVERWRITE 0x00000004
101 #define FILE_OVERWRITE_IF 0x00000005
102 #define FILE_MAXIMUM_DISPOSITION 0x00000005
103
104 //
105 // NtCreateFile Flags
106 //
107 #define FILE_DIRECTORY_FILE 0x00000001
108 #define FILE_WRITE_THROUGH 0x00000002
109 #define FILE_SEQUENTIAL_ONLY 0x00000004
110 #define FILE_NO_INTERMEDIATE_BUFFERING 0x00000008
111 #define FILE_SYNCHRONOUS_IO_ALERT 0x00000010
112 #define FILE_SYNCHRONOUS_IO_NONALERT 0x00000020
113 #define FILE_NON_DIRECTORY_FILE 0x00000040
114 #define FILE_CREATE_TREE_CONNECTION 0x00000080
115 #define FILE_COMPLETE_IF_OPLOCKED 0x00000100
116 #define FILE_NO_EA_KNOWLEDGE 0x00000200
117 #define FILE_OPEN_REMOTE_INSTANCE 0x00000400
118 #define FILE_RANDOM_ACCESS 0x00000800
119 #define FILE_DELETE_ON_CLOSE 0x00001000
120 #define FILE_OPEN_BY_FILE_ID 0x00002000
121 #define FILE_OPEN_FOR_BACKUP_INTENT 0x00004000
122 #define FILE_NO_COMPRESSION 0x00008000
123 #define FILE_RESERVE_OPFILTER 0x00100000
124 #define FILE_OPEN_REPARSE_POINT 0x00200000
125 #define FILE_OPEN_NO_RECALL 0x00400000
126 #define FILE_OPEN_FOR_FREE_SPACE_QUERY 0x00800000
127
128 //
129 // Device Charactertics
130 //
131 #define FILE_REMOVABLE_MEDIA 0x00000001
132 #define FILE_READ_ONLY_DEVICE 0x00000002
133 #define FILE_FLOPPY_DISKETTE 0x00000004
134 #define FILE_WRITE_ONCE_MEDIA 0x00000008
135 #define FILE_REMOTE_DEVICE 0x00000010
136 #define FILE_DEVICE_IS_MOUNTED 0x00000020
137 #define FILE_VIRTUAL_VOLUME 0x00000040
138 #define FILE_AUTOGENERATED_DEVICE_NAME 0x00000080
139 #define FILE_DEVICE_SECURE_OPEN 0x00000100
140
141 //
142 // File Object Flags
143 //
144 #define FO_FILE_OBJECT_HAS_EXTENSION 0x00800000
145
146 //
147 // Device Object Extension Flags
148 //
149 #define DOE_UNLOAD_PENDING 0x1
150 #define DOE_DELETE_PENDING 0x2
151 #define DOE_REMOVE_PENDING 0x4
152 #define DOE_REMOVE_PROCESSED 0x8
153 #define DOE_START_PENDING 0x10
154
155 //
156 // Device Object StartIo Flags
157 //
158 #define DOE_SIO_NO_KEY 0x20
159 #define DOE_SIO_WITH_KEY 0x40
160 #define DOE_SIO_CANCELABLE 0x80
161 #define DOE_SIO_DEFERRED 0x100
162 #define DOE_SIO_NO_CANCEL 0x200
163
164 //
165 // Device Node Flags
166 //
167 #define DNF_PROCESSED 0x00000001
168 #define DNF_STARTED 0x00000002
169 #define DNF_START_FAILED 0x00000004
170 #define DNF_ENUMERATED 0x00000008
171 #define DNF_DELETED 0x00000010
172 #define DNF_MADEUP 0x00000020
173 #define DNF_START_REQUEST_PENDING 0x00000040
174 #define DNF_NO_RESOURCE_REQUIRED 0x00000080
175 #define DNF_INSUFFICIENT_RESOURCES 0x00000100
176 #define DNF_RESOURCE_ASSIGNED 0x00000200
177 #define DNF_RESOURCE_REPORTED 0x00000400
178 #define DNF_HAL_NODE 0x00000800 // ???
179 #define DNF_ADDED 0x00001000
180 #define DNF_ADD_FAILED 0x00002000
181 #define DNF_LEGACY_DRIVER 0x00004000
182 #define DNF_STOPPED 0x00008000
183 #define DNF_WILL_BE_REMOVED 0x00010000
184 #define DNF_LEGACY_RESOURCE_DEVICENODE 0x00020000
185 #define DNF_NOT_CONFIGURED 0x00040000
186 #define DNF_REINSTALL 0x00080000
187 #define DNF_RESOURCE_REQUIREMENTS_NEED_FILTERED 0x00100000 // ???
188 #define DNF_DISABLED 0x00200000
189 #define DNF_RESTART_OK 0x00400000
190 #define DNF_NEED_RESTART 0x00800000
191 #define DNF_VISITED 0x01000000
192 #define DNF_ASSIGNING_RESOURCES 0x02000000
193 #define DNF_BEEING_ENUMERATED 0x04000000
194 #define DNF_NEED_ENUMERATION_ONLY 0x08000000
195 #define DNF_LOCKED 0x10000000
196 #define DNF_HAS_BOOT_CONFIG 0x20000000
197 #define DNF_BOOT_CONFIG_RESERVED 0x40000000
198 #define DNF_HAS_PROBLEM 0x80000000 // ???
199
200 //
201 // Device Node User Flags
202 //
203 #define DNUF_DONT_SHOW_IN_UI 0x0002
204 #define DNUF_NOT_DISABLEABLE 0x0008
205
206 //
207 // Internal Option Flags
208 //
209 #define IO_ATTACH_DEVICE_API 0x80000000
210
211 //
212 // Undocumented WMI Registration Flags
213 //
214 #define WMIREG_FLAG_TRACE_PROVIDER 0x00010000
215 #define WMIREG_FLAG_TRACE_NOTIFY_MASK 0x00F00000
216 #define WMIREG_NOTIFY_DISK_IO 0x00100000
217 #define WMIREG_NOTIFY_TDI_IO 0x00200000
218
219 //
220 // I/O Completion Information Class for NtQueryIoCompletionInformation
221 //
222 typedef enum _IO_COMPLETION_INFORMATION_CLASS
223 {
224 IoCompletionBasicInformation
225 } IO_COMPLETION_INFORMATION_CLASS;
226
227 #ifdef NTOS_MODE_USER
228
229 //
230 // Hardware Interface Type
231 //
232 typedef enum _INTERFACE_TYPE
233 {
234 InterfaceTypeUndefined = -1,
235 Internal,
236 Isa,
237 Eisa,
238 MicroChannel,
239 TurboChannel,
240 PCIBus,
241 VMEBus,
242 NuBus,
243 PCMCIABus,
244 CBus,
245 MPIBus,
246 MPSABus,
247 ProcessorInternal,
248 InternalPowerBus,
249 PNPISABus,
250 PNPBus,
251 MaximumInterfaceType
252 }INTERFACE_TYPE, *PINTERFACE_TYPE;
253
254 typedef enum _BUS_DATA_TYPE
255 {
256 ConfigurationSpaceUndefined = -1,
257 Cmos,
258 EisaConfiguration,
259 Pos,
260 CbusConfiguration,
261 PCIConfiguration,
262 VMEConfiguration,
263 NuBusConfiguration,
264 PCMCIAConfiguration,
265 MPIConfiguration,
266 MPSAConfiguration,
267 PNPISAConfiguration,
268 SgiInternalConfiguration,
269 MaximumBusDataType
270 } BUS_DATA_TYPE, *PBUS_DATA_TYPE;
271
272 //
273 // File Information Classes for NtQueryInformationFile
274 //
275 typedef enum _FILE_INFORMATION_CLASS
276 {
277 FileDirectoryInformation = 1,
278 FileFullDirectoryInformation,
279 FileBothDirectoryInformation,
280 FileBasicInformation,
281 FileStandardInformation,
282 FileInternalInformation,
283 FileEaInformation,
284 FileAccessInformation,
285 FileNameInformation,
286 FileRenameInformation,
287 FileLinkInformation,
288 FileNamesInformation,
289 FileDispositionInformation,
290 FilePositionInformation,
291 FileFullEaInformation,
292 FileModeInformation,
293 FileAlignmentInformation,
294 FileAllInformation,
295 FileAllocationInformation,
296 FileEndOfFileInformation,
297 FileAlternateNameInformation,
298 FileStreamInformation,
299 FilePipeInformation,
300 FilePipeLocalInformation,
301 FilePipeRemoteInformation,
302 FileMailslotQueryInformation,
303 FileMailslotSetInformation,
304 FileCompressionInformation,
305 FileObjectIdInformation,
306 FileCompletionInformation,
307 FileMoveClusterInformation,
308 FileQuotaInformation,
309 FileReparsePointInformation,
310 FileNetworkOpenInformation,
311 FileAttributeTagInformation,
312 FileTrackingInformation,
313 FileIdBothDirectoryInformation,
314 FileIdFullDirectoryInformation,
315 FileValidDataLengthInformation,
316 FileShortNameInformation,
317 #if (NTDDI_VERSION >= NTDDI_VISTA)
318 FileIoCompletionNotificationInformation,
319 FileIoStatusBlockRangeInformation,
320 FileIoPriorityHintInformation,
321 FileSfioReserveInformation,
322 FileSfioVolumeInformation,
323 FileHardLinkInformation,
324 FileProcessIdsUsingFileInformation,
325 FileNormalizedNameInformation,
326 FileNetworkPhysicalNameInformation,
327 #endif
328 #if (NTDDI_VERSION >= NTDDI_WIN7)
329 FileIdGlobalTxDirectoryInformation,
330 FileIsRemoteDeviceInformation,
331 FileUnusedInformation,
332 FileNumaNodeInformation,
333 FileStandardLinkInformation,
334 FileRemoteProtocolInformation,
335 #endif
336 FileMaximumInformation
337 } FILE_INFORMATION_CLASS, *PFILE_INFORMATION_CLASS;
338
339 //
340 // File Information Classes for NtQueryInformationFileSystem
341 //
342 typedef enum _FSINFOCLASS
343 {
344 FileFsVolumeInformation = 1,
345 FileFsLabelInformation,
346 FileFsSizeInformation,
347 FileFsDeviceInformation,
348 FileFsAttributeInformation,
349 FileFsControlInformation,
350 FileFsFullSizeInformation,
351 FileFsObjectIdInformation,
352 FileFsDriverPathInformation,
353 FileFsMaximumInformation
354 } FS_INFORMATION_CLASS, *PFS_INFORMATION_CLASS;
355
356 #endif
357
358 //
359 // Dock Profile Status
360 //
361 typedef enum _PROFILE_STATUS
362 {
363 DOCK_NOTDOCKDEVICE,
364 DOCK_QUIESCENT,
365 DOCK_ARRIVING,
366 DOCK_DEPARTING,
367 DOCK_EJECTIRP_COMPLETED
368 } PROFILE_STATUS, *PPROFILE_STATUS;
369
370 //
371 // Device Node States
372 //
373 typedef enum _PNP_DEVNODE_STATE
374 {
375 DeviceNodeUnspecified = 0x300,
376 DeviceNodeUninitialized = 0x301,
377 DeviceNodeInitialized = 0x302,
378 DeviceNodeDriversAdded = 0x303,
379 DeviceNodeResourcesAssigned = 0x304,
380 DeviceNodeStartPending = 0x305,
381 DeviceNodeStartCompletion = 0x306,
382 DeviceNodeStartPostWork = 0x307,
383 DeviceNodeStarted = 0x308,
384 DeviceNodeQueryStopped = 0x309,
385 DeviceNodeStopped = 0x30a,
386 DeviceNodeRestartCompletion = 0x30b,
387 DeviceNodeEnumeratePending = 0x30c,
388 DeviceNodeEnumerateCompletion = 0x30d,
389 DeviceNodeAwaitingQueuedDeletion = 0x30e,
390 DeviceNodeAwaitingQueuedRemoval = 0x30f,
391 DeviceNodeQueryRemoved = 0x310,
392 DeviceNodeRemovePendingCloses = 0x311,
393 DeviceNodeRemoved = 0x312,
394 DeviceNodeDeletePendingCloses = 0x313,
395 DeviceNodeDeleted = 0x314,
396 MaxDeviceNodeState = 0x315,
397 } PNP_DEVNODE_STATE;
398
399 #ifdef NTOS_MODE_USER
400
401 //
402 // I/O Status Block
403 //
404 typedef struct _IO_STATUS_BLOCK
405 {
406 union
407 {
408 NTSTATUS Status;
409 PVOID Pointer;
410 };
411 ULONG_PTR Information;
412 } IO_STATUS_BLOCK, *PIO_STATUS_BLOCK;
413
414 //
415 // File Information structures for NtQueryInformationFile
416 //
417 typedef struct _FILE_BASIC_INFORMATION
418 {
419 LARGE_INTEGER CreationTime;
420 LARGE_INTEGER LastAccessTime;
421 LARGE_INTEGER LastWriteTime;
422 LARGE_INTEGER ChangeTime;
423 ULONG FileAttributes;
424 } FILE_BASIC_INFORMATION, *PFILE_BASIC_INFORMATION;
425
426 typedef struct _FILE_STANDARD_INFORMATION
427 {
428 LARGE_INTEGER AllocationSize;
429 LARGE_INTEGER EndOfFile;
430 ULONG NumberOfLinks;
431 BOOLEAN DeletePending;
432 BOOLEAN Directory;
433 } FILE_STANDARD_INFORMATION, *PFILE_STANDARD_INFORMATION;
434
435 typedef struct _FILE_STREAM_INFORMATION
436 {
437 ULONG NextEntryOffset;
438 ULONG StreamNameLength;
439 LARGE_INTEGER StreamSize;
440 LARGE_INTEGER StreamAllocationSize;
441 WCHAR StreamName[1];
442 } FILE_STREAM_INFORMATION, *PFILE_STREAM_INFORMATION;
443
444 typedef struct _FILE_NETWORK_OPEN_INFORMATION
445 {
446 LARGE_INTEGER CreationTime;
447 LARGE_INTEGER LastAccessTime;
448 LARGE_INTEGER LastWriteTime;
449 LARGE_INTEGER ChangeTime;
450 LARGE_INTEGER AllocationSize;
451 LARGE_INTEGER EndOfFile;
452 ULONG FileAttributes;
453 } FILE_NETWORK_OPEN_INFORMATION, *PFILE_NETWORK_OPEN_INFORMATION;
454
455 typedef struct _FILE_EA_INFORMATION
456 {
457 ULONG EaSize;
458 } FILE_EA_INFORMATION, *PFILE_EA_INFORMATION;
459
460 typedef struct _FILE_ACCESS_INFORMATION
461 {
462 ACCESS_MASK AccessFlags;
463 } FILE_ACCESS_INFORMATION, *PFILE_ACCESS_INFORMATION;
464
465 typedef struct _FILE_COMPRESSION_INFORMATION
466 {
467 LARGE_INTEGER CompressedFileSize;
468 USHORT CompressionFormat;
469 UCHAR CompressionUnitShift;
470 UCHAR ChunkShift;
471 UCHAR ClusterShift;
472 UCHAR Reserved[3];
473 } FILE_COMPRESSION_INFORMATION, *PFILE_COMPRESSION_INFORMATION;
474
475 typedef struct _FILE_POSITION_INFORMATION
476 {
477 LARGE_INTEGER CurrentByteOffset;
478 } FILE_POSITION_INFORMATION, *PFILE_POSITION_INFORMATION;
479
480 typedef struct _FILE_DISPOSITION_INFORMATION
481 {
482 BOOLEAN DeleteFile;
483 } FILE_DISPOSITION_INFORMATION, *PFILE_DISPOSITION_INFORMATION;
484
485 typedef struct _FILE_FULL_EA_INFORMATION
486 {
487 ULONG NextEntryOffset;
488 UCHAR Flags;
489 UCHAR EaNameLength;
490 USHORT EaValueLength;
491 CHAR EaName[1];
492 } FILE_FULL_EA_INFORMATION, *PFILE_FULL_EA_INFORMATION;
493
494 typedef struct _FILE_QUOTA_INFORMATION
495 {
496 ULONG NextEntryOffset;
497 ULONG SidLength;
498 LARGE_INTEGER ChangeTime;
499 LARGE_INTEGER QuotaUsed;
500 LARGE_INTEGER QuotaThreshold;
501 LARGE_INTEGER QuotaLimit;
502 SID Sid;
503 } FILE_QUOTA_INFORMATION, *PFILE_QUOTA_INFORMATION;
504
505 typedef struct _FILE_INTERNAL_INFORMATION
506 {
507 LARGE_INTEGER IndexNumber;
508 } FILE_INTERNAL_INFORMATION, *PFILE_INTERNAL_INFORMATION;
509
510 typedef struct _FILE_RENAME_INFORMATION
511 {
512 BOOLEAN ReplaceIfExists;
513 HANDLE RootDirectory;
514 ULONG FileNameLength;
515 WCHAR FileName[1];
516 } FILE_RENAME_INFORMATION, *PFILE_RENAME_INFORMATION;
517
518 typedef struct _FILE_PIPE_INFORMATION
519 {
520 ULONG ReadMode;
521 ULONG CompletionMode;
522 } FILE_PIPE_INFORMATION, *PFILE_PIPE_INFORMATION;
523
524 typedef struct _FILE_PIPE_LOCAL_INFORMATION
525 {
526 ULONG NamedPipeType;
527 ULONG NamedPipeConfiguration;
528 ULONG MaximumInstances;
529 ULONG CurrentInstances;
530 ULONG InboundQuota;
531 ULONG ReadDataAvailable;
532 ULONG OutboundQuota;
533 ULONG WriteQuotaAvailable;
534 ULONG NamedPipeState;
535 ULONG NamedPipeEnd;
536 } FILE_PIPE_LOCAL_INFORMATION, *PFILE_PIPE_LOCAL_INFORMATION;
537
538 typedef struct _FILE_PIPE_REMOTE_INFORMATION
539 {
540 LARGE_INTEGER CollectDataTime;
541 ULONG MaximumCollectionCount;
542 } FILE_PIPE_REMOTE_INFORMATION, *PFILE_PIPE_REMOTE_INFORMATION;
543
544 typedef struct _FILE_MAILSLOT_QUERY_INFORMATION
545 {
546 ULONG MaximumMessageSize;
547 ULONG MailslotQuota;
548 ULONG NextMessageSize;
549 ULONG MessagesAvailable;
550 LARGE_INTEGER ReadTimeout;
551 } FILE_MAILSLOT_QUERY_INFORMATION, *PFILE_MAILSLOT_QUERY_INFORMATION;
552
553 typedef struct _FILE_MAILSLOT_SET_INFORMATION
554 {
555 PLARGE_INTEGER ReadTimeout;
556 } FILE_MAILSLOT_SET_INFORMATION, *PFILE_MAILSLOT_SET_INFORMATION;
557
558 typedef struct _FILE_FULL_DIR_INFORMATION
559 {
560 ULONG NextEntryOffset;
561 ULONG FileIndex;
562 LARGE_INTEGER CreationTime;
563 LARGE_INTEGER LastAccessTime;
564 LARGE_INTEGER LastWriteTime;
565 LARGE_INTEGER ChangeTime;
566 LARGE_INTEGER EndOfFile;
567 LARGE_INTEGER AllocationSize;
568 ULONG FileAttributes;
569 ULONG FileNameLength;
570 ULONG EaSize;
571 WCHAR FileName[1];
572 } FILE_FULL_DIR_INFORMATION, *PFILE_FULL_DIR_INFORMATION;
573
574 typedef struct _FILE_BOTH_DIR_INFORMATION
575 {
576 ULONG NextEntryOffset;
577 ULONG FileIndex;
578 LARGE_INTEGER CreationTime;
579 LARGE_INTEGER LastAccessTime;
580 LARGE_INTEGER LastWriteTime;
581 LARGE_INTEGER ChangeTime;
582 LARGE_INTEGER EndOfFile;
583 LARGE_INTEGER AllocationSize;
584 ULONG FileAttributes;
585 ULONG FileNameLength;
586 ULONG EaSize;
587 CCHAR ShortNameLength;
588 WCHAR ShortName[12];
589 WCHAR FileName[1];
590 } FILE_BOTH_DIR_INFORMATION, *PFILE_BOTH_DIR_INFORMATION;
591
592 typedef struct _FILE_COMPLETION_INFORMATION
593 {
594 HANDLE Port;
595 PVOID Key;
596 } FILE_COMPLETION_INFORMATION, *PFILE_COMPLETION_INFORMATION;
597
598 typedef struct _FILE_LINK_INFORMATION
599 {
600 BOOLEAN ReplaceIfExists;
601 HANDLE RootDirectory;
602 ULONG FileNameLength;
603 WCHAR FileName[1];
604 } FILE_LINK_INFORMATION, *PFILE_LINK_INFORMATION;
605
606 typedef struct _FILE_NAME_INFORMATION
607 {
608 ULONG FileNameLength;
609 WCHAR FileName[1];
610 } FILE_NAME_INFORMATION, *PFILE_NAME_INFORMATION;
611
612 typedef struct _FILE_ALLOCATION_INFORMATION
613 {
614 LARGE_INTEGER AllocationSize;
615 } FILE_ALLOCATION_INFORMATION, *PFILE_ALLOCATION_INFORMATION;
616
617 typedef struct _FILE_END_OF_FILE_INFORMATION
618 {
619 LARGE_INTEGER EndOfFile;
620 } FILE_END_OF_FILE_INFORMATION, *PFILE_END_OF_FILE_INFORMATION;
621
622 typedef struct _FILE_VALID_DATA_LENGTH_INFORMATION
623 {
624 LARGE_INTEGER ValidDataLength;
625 } FILE_VALID_DATA_LENGTH_INFORMATION, *PFILE_VALID_DATA_LENGTH_INFORMATION;
626
627 typedef struct _FILE_DIRECTORY_INFORMATION
628 {
629 ULONG NextEntryOffset;
630 ULONG FileIndex;
631 LARGE_INTEGER CreationTime;
632 LARGE_INTEGER LastAccessTime;
633 LARGE_INTEGER LastWriteTime;
634 LARGE_INTEGER ChangeTime;
635 LARGE_INTEGER EndOfFile;
636 LARGE_INTEGER AllocationSize;
637 ULONG FileAttributes;
638 ULONG FileNameLength;
639 WCHAR FileName[1];
640 } FILE_DIRECTORY_INFORMATION, *PFILE_DIRECTORY_INFORMATION;
641
642 typedef struct _FILE_IO_COMPLETION_INFORMATION
643 {
644 PVOID KeyContext;
645 PVOID ApcContext;
646 IO_STATUS_BLOCK IoStatusBlock;
647 } FILE_IO_COMPLETION_INFORMATION, *PFILE_IO_COMPLETION_INFORMATION;
648
649 typedef struct _FILE_ATTRIBUTE_TAG_INFORMATION
650 {
651 ULONG FileAttributes;
652 ULONG ReparseTag;
653 } FILE_ATTRIBUTE_TAG_INFORMATION, *PFILE_ATTRIBUTE_TAG_INFORMATION;
654
655 typedef struct _FILE_TRACKING_INFORMATION
656 {
657 HANDLE DestinationFile;
658 ULONG ObjectInformationLength;
659 CHAR ObjectInformation[1];
660 } FILE_TRACKING_INFORMATION, *PFILE_TRACKING_INFORMATION;
661
662 //
663 // File System Information structures for NtQueryInformationFile
664 //
665 typedef struct _FILE_FS_DEVICE_INFORMATION
666 {
667 DEVICE_TYPE DeviceType;
668 ULONG Characteristics;
669 } FILE_FS_DEVICE_INFORMATION, *PFILE_FS_DEVICE_INFORMATION;
670
671 typedef struct _FILE_FS_ATTRIBUTE_INFORMATION
672 {
673 ULONG FileSystemAttributes;
674 ULONG MaximumComponentNameLength;
675 ULONG FileSystemNameLength;
676 WCHAR FileSystemName[1];
677 } FILE_FS_ATTRIBUTE_INFORMATION, *PFILE_FS_ATTRIBUTE_INFORMATION;
678
679 typedef struct _FILE_FS_SIZE_INFORMATION
680 {
681 LARGE_INTEGER TotalAllocationUnits;
682 LARGE_INTEGER AvailableAllocationUnits;
683 ULONG SectorsPerAllocationUnit;
684 ULONG BytesPerSector;
685 } FILE_FS_SIZE_INFORMATION, *PFILE_FS_SIZE_INFORMATION;
686
687 typedef struct _FILE_FS_FULL_SIZE_INFORMATION
688 {
689 LARGE_INTEGER TotalAllocationUnits;
690 LARGE_INTEGER CallerAvailableAllocationUnits;
691 LARGE_INTEGER ActualAvailableAllocationUnits;
692 ULONG SectorsPerAllocationUnit;
693 ULONG BytesPerSector;
694 } FILE_FS_FULL_SIZE_INFORMATION, *PFILE_FS_FULL_SIZE_INFORMATION;
695
696 typedef struct _FILE_FS_LABEL_INFORMATION
697 {
698 ULONG VolumeLabelLength;
699 WCHAR VolumeLabel[1];
700 } FILE_FS_LABEL_INFORMATION, *PFILE_FS_LABEL_INFORMATION;
701
702 typedef struct _FILE_FS_VOLUME_INFORMATION
703 {
704 LARGE_INTEGER VolumeCreationTime;
705 ULONG VolumeSerialNumber;
706 ULONG VolumeLabelLength;
707 BOOLEAN SupportsObjects;
708 WCHAR VolumeLabel[1];
709 } FILE_FS_VOLUME_INFORMATION, *PFILE_FS_VOLUME_INFORMATION;
710
711 //
712 // Pipe Structures for IOCTL_PIPE_XXX
713 //
714 typedef struct _FILE_PIPE_WAIT_FOR_BUFFER
715 {
716 LARGE_INTEGER Timeout;
717 ULONG NameLength;
718 BOOLEAN TimeoutSpecified;
719 WCHAR Name[1];
720 } FILE_PIPE_WAIT_FOR_BUFFER, *PFILE_PIPE_WAIT_FOR_BUFFER;
721
722 typedef struct _FILE_PIPE_PEEK_BUFFER
723 {
724 ULONG NamedPipeState;
725 ULONG ReadDataAvailable;
726 ULONG NumberOfMessages;
727 ULONG MessageLength;
728 CHAR Data[1];
729 } FILE_PIPE_PEEK_BUFFER, *PFILE_PIPE_PEEK_BUFFER;
730
731 //
732 // I/O Error Log Structures
733 //
734 typedef struct _IO_ERROR_LOG_PACKET
735 {
736 UCHAR MajorFunctionCode;
737 UCHAR RetryCount;
738 USHORT DumpDataSize;
739 USHORT NumberOfStrings;
740 USHORT StringOffset;
741 USHORT EventCategory;
742 NTSTATUS ErrorCode;
743 ULONG UniqueErrorValue;
744 NTSTATUS FinalStatus;
745 ULONG SequenceNumber;
746 ULONG IoControlCode;
747 LARGE_INTEGER DeviceOffset;
748 ULONG DumpData[1];
749 } IO_ERROR_LOG_PACKET, *PIO_ERROR_LOG_PACKET;
750
751 typedef struct _IO_ERROR_LOG_MESSAGE
752 {
753 USHORT Type;
754 USHORT Size;
755 USHORT DriverNameLength;
756 LARGE_INTEGER TimeStamp;
757 ULONG DriverNameOffset;
758 IO_ERROR_LOG_PACKET EntryData;
759 } IO_ERROR_LOG_MESSAGE, *PIO_ERROR_LOG_MESSAGE;
760
761 #endif
762
763 //
764 // I/O Completion Information structures
765 //
766 typedef struct _IO_COMPLETION_BASIC_INFORMATION
767 {
768 LONG Depth;
769 } IO_COMPLETION_BASIC_INFORMATION, *PIO_COMPLETION_BASIC_INFORMATION;
770
771 //
772 // Parameters for NtCreateMailslotFile/NtCreateNamedPipeFile
773 //
774 typedef struct _MAILSLOT_CREATE_PARAMETERS
775 {
776 ULONG MailslotQuota;
777 ULONG MaximumMessageSize;
778 LARGE_INTEGER ReadTimeout;
779 BOOLEAN TimeoutSpecified;
780 } MAILSLOT_CREATE_PARAMETERS, *PMAILSLOT_CREATE_PARAMETERS;
781
782 typedef struct _NAMED_PIPE_CREATE_PARAMETERS
783 {
784 ULONG NamedPipeType;
785 ULONG ReadMode;
786 ULONG CompletionMode;
787 ULONG MaximumInstances;
788 ULONG InboundQuota;
789 ULONG OutboundQuota;
790 LARGE_INTEGER DefaultTimeout;
791 BOOLEAN TimeoutSpecified;
792 } NAMED_PIPE_CREATE_PARAMETERS, *PNAMED_PIPE_CREATE_PARAMETERS;
793
794 #ifndef NTOS_MODE_USER
795
796 //
797 // I/O Timer Object
798 //
799 typedef struct _IO_TIMER
800 {
801 USHORT Type;
802 USHORT TimerEnabled;
803 LIST_ENTRY IoTimerList;
804 PIO_TIMER_ROUTINE TimerRoutine;
805 PVOID Context;
806 PDEVICE_OBJECT DeviceObject;
807 } IO_TIMER;
808
809 //
810 // Driver Extension
811 //
812 typedef struct _IO_CLIENT_EXTENSION
813 {
814 struct _IO_CLIENT_EXTENSION *NextExtension;
815 PVOID ClientIdentificationAddress;
816 } IO_CLIENT_EXTENSION, *PIO_CLIENT_EXTENSION;
817
818 //
819 // Device Node
820 //
821 typedef struct _DEVICE_NODE
822 {
823 struct _DEVICE_NODE *Sibling;
824 struct _DEVICE_NODE *Child;
825 struct _DEVICE_NODE *Parent;
826 struct _DEVICE_NODE *LastChild;
827 ULONG Level;
828 struct _PO_DEVICE_NOTIFY *Notify;
829 PO_IRP_MANAGER PoIrpManager;
830 PNP_DEVNODE_STATE State;
831 PNP_DEVNODE_STATE PreviousState;
832 PNP_DEVNODE_STATE StateHistory[20];
833 ULONG StateHistoryEntry;
834 NTSTATUS CompletionStatus;
835 PIRP PendingIrp;
836 ULONG Flags;
837 ULONG UserFlags;
838 ULONG Problem;
839 PDEVICE_OBJECT PhysicalDeviceObject;
840 PCM_RESOURCE_LIST ResourceList;
841 PCM_RESOURCE_LIST ResourceListTranslated;
842 UNICODE_STRING InstancePath;
843 UNICODE_STRING ServiceName;
844 PDEVICE_OBJECT DuplicatePDO;
845 PIO_RESOURCE_REQUIREMENTS_LIST ResourceRequirements;
846 INTERFACE_TYPE InterfaceType;
847 ULONG BusNumber;
848 INTERFACE_TYPE ChildInterfaceType;
849 ULONG ChildBusNumber;
850 USHORT ChildBusTypeIndex;
851 UCHAR RemovalPolicy;
852 UCHAR HardwareRemovalPolicy;
853 LIST_ENTRY TargetDeviceNotify;
854 LIST_ENTRY DeviceArbiterList;
855 LIST_ENTRY DeviceTranslatorList;
856 USHORT NoTranslatorMask;
857 USHORT QueryTranslatorMask;
858 USHORT NoArbiterMask;
859 USHORT QueryArbiterMask;
860 union
861 {
862 struct _DEVICE_NODE *LegacyDeviceNode;
863 PDEVICE_RELATIONS PendingDeviceRelations;
864 } OverUsed1;
865 union
866 {
867 struct _DEVICE_NODE *NextResourceDeviceNode;
868 } OverUsed2;
869 PCM_RESOURCE_LIST BootResources;
870 #if (NTDDI_VERSION >= NTDDI_LONGHORN)
871 PCM_RESOURCE_LIST BootResourcesTranslated;
872 #endif
873 ULONG CapabilityFlags;
874 struct
875 {
876 PROFILE_STATUS DockStatus;
877 LIST_ENTRY ListEntry;
878 WCHAR *SerialNumber;
879 } DockInfo;
880 ULONG DisableableDepends;
881 LIST_ENTRY PendedSetInterfaceState;
882 LIST_ENTRY LegacyBusListEntry;
883 ULONG DriverUnloadRetryCount;
884 struct _DEVICE_NODE *PreviousParent;
885 ULONG DeletedChidren;
886 #if (NTDDI_VERSION >= NTDDI_LONGHORN)
887 ULONG NumaNodeIndex;
888 #endif
889 } DEVICE_NODE, *PDEVICE_NODE;
890
891 //
892 // Resource Aribtrer Entry
893 //
894 typedef struct _PI_RESOURCE_ARBITER_ENTRY
895 {
896 LIST_ENTRY DeviceArbiterList;
897 UCHAR ResourceType;
898 PARBITER_INTERFACE ArbiterInterface;
899 ULONG Level;
900 LIST_ENTRY ResourceList;
901 LIST_ENTRY BestResourceList;
902 LIST_ENTRY BestConfig;
903 LIST_ENTRY ActiveArbiterList;
904 UCHAR State;
905 UCHAR ResourcesChanged;
906 } PI_RESOURCE_ARBITER_ENTRY, *PPI_RESOURCE_ARBITER_ENTRY;
907
908 //
909 // Extended Device Object Extension Structure
910 //
911 typedef struct _EXTENDED_DEVOBJ_EXTENSION
912 {
913 CSHORT Type;
914 USHORT Size;
915 PDEVICE_OBJECT DeviceObject;
916 ULONG PowerFlags;
917 struct _DEVICE_OBJECT_POWER_EXTENSION *Dope;
918 ULONG ExtensionFlags;
919 struct _DEVICE_NODE *DeviceNode;
920 PDEVICE_OBJECT AttachedTo;
921 LONG StartIoCount;
922 LONG StartIoKey;
923 ULONG StartIoFlags;
924 struct _VPB *Vpb;
925 } EXTENDED_DEVOBJ_EXTENSION, *PEXTENDED_DEVOBJ_EXTENSION;
926
927 //
928 // Extended Driver Object Extension Structure
929 //
930 typedef struct _EXTENDED_DRIVER_EXTENSION
931 {
932 struct _DRIVER_OBJECT *DriverObject;
933 PDRIVER_ADD_DEVICE AddDevice;
934 ULONG Count;
935 UNICODE_STRING ServiceKeyName;
936 PIO_CLIENT_EXTENSION ClientDriverExtension;
937 PFS_FILTER_CALLBACKS FsFilterCallbacks;
938 } EXTENDED_DRIVER_EXTENSION, *PEXTENDED_DRIVER_EXTENSION;
939
940 //
941 // Extended I/O Stack Location Structure
942 //
943 typedef struct _EXTENDED_IO_STACK_LOCATION
944 {
945 UCHAR MajorFunction;
946 UCHAR MinorFunction;
947 UCHAR Flags;
948 UCHAR Control;
949 union
950 {
951 struct
952 {
953 PIO_SECURITY_CONTEXT SecurityContext;
954 ULONG Options;
955 USHORT POINTER_ALIGNMENT FileAttributes;
956 USHORT ShareAccess;
957 ULONG POINTER_ALIGNMENT EaLength;
958 } Create;
959 struct
960 {
961 PIO_SECURITY_CONTEXT SecurityContext;
962 ULONG Options;
963 USHORT POINTER_ALIGNMENT Reserved;
964 USHORT ShareAccess;
965 struct _NAMED_PIPE_CREATE_PARAMETERS *Parameters;
966 } CreatePipe;
967 struct
968 {
969 PIO_SECURITY_CONTEXT SecurityContext;
970 ULONG Options;
971 USHORT POINTER_ALIGNMENT Reserved;
972 USHORT ShareAccess;
973 struct _MAILSLOT_CREATE_PARAMETERS *Parameters;
974 } CreateMailslot;
975 struct
976 {
977 ULONG Length;
978 ULONG POINTER_ALIGNMENT Key;
979 LARGE_INTEGER ByteOffset;
980 } Read;
981 struct
982 {
983 ULONG Length;
984 ULONG POINTER_ALIGNMENT Key;
985 LARGE_INTEGER ByteOffset;
986 } Write;
987 struct
988 {
989 ULONG Length;
990 PUNICODE_STRING FileName;
991 FILE_INFORMATION_CLASS FileInformationClass;
992 ULONG POINTER_ALIGNMENT FileIndex;
993 } QueryDirectory;
994 struct
995 {
996 ULONG Length;
997 ULONG POINTER_ALIGNMENT CompletionFilter;
998 } NotifyDirectory;
999 struct
1000 {
1001 ULONG Length;
1002 ULONG POINTER_ALIGNMENT CompletionFilter;
1003 enum _DIRECTORY_NOTIFY_INFORMATION_CLASS POINTER_ALIGNMENT DirectoryNotifyInformationClass;
1004 } NotifyDirectoryEx;
1005 struct
1006 {
1007 ULONG Length;
1008 FILE_INFORMATION_CLASS POINTER_ALIGNMENT FileInformationClass;
1009 } QueryFile;
1010 struct
1011 {
1012 ULONG Length;
1013 FILE_INFORMATION_CLASS POINTER_ALIGNMENT FileInformationClass;
1014 PFILE_OBJECT FileObject;
1015 union
1016 {
1017 struct
1018 {
1019 BOOLEAN ReplaceIfExists;
1020 BOOLEAN AdvanceOnly;
1021 };
1022 ULONG ClusterCount;
1023 HANDLE DeleteHandle;
1024 };
1025 } SetFile;
1026 struct
1027 {
1028 ULONG Length;
1029 PVOID EaList;
1030 ULONG EaListLength;
1031 ULONG POINTER_ALIGNMENT EaIndex;
1032 } QueryEa;
1033 struct
1034 {
1035 ULONG Length;
1036 } SetEa;
1037 struct
1038 {
1039 ULONG Length;
1040 FS_INFORMATION_CLASS POINTER_ALIGNMENT FsInformationClass;
1041 } QueryVolume;
1042 struct
1043 {
1044 ULONG Length;
1045 FS_INFORMATION_CLASS POINTER_ALIGNMENT FsInformationClass;
1046 } SetVolume;
1047 struct
1048 {
1049 ULONG OutputBufferLength;
1050 ULONG POINTER_ALIGNMENT InputBufferLength;
1051 ULONG POINTER_ALIGNMENT FsControlCode;
1052 PVOID Type3InputBuffer;
1053 } FileSystemControl;
1054 struct
1055 {
1056 PLARGE_INTEGER Length;
1057 ULONG POINTER_ALIGNMENT Key;
1058 LARGE_INTEGER ByteOffset;
1059 } LockControl;
1060 struct
1061 {
1062 ULONG OutputBufferLength;
1063 ULONG POINTER_ALIGNMENT InputBufferLength;
1064 ULONG POINTER_ALIGNMENT IoControlCode;
1065 PVOID Type3InputBuffer;
1066 } DeviceIoControl;
1067 struct
1068 {
1069 SECURITY_INFORMATION SecurityInformation;
1070 ULONG POINTER_ALIGNMENT Length;
1071 } QuerySecurity;
1072 struct
1073 {
1074 SECURITY_INFORMATION SecurityInformation;
1075 PSECURITY_DESCRIPTOR SecurityDescriptor;
1076 } SetSecurity;
1077 struct
1078 {
1079 PVPB Vpb;
1080 PDEVICE_OBJECT DeviceObject;
1081 } MountVolume;
1082 struct
1083 {
1084 PVPB Vpb;
1085 PDEVICE_OBJECT DeviceObject;
1086 } VerifyVolume;
1087 struct
1088 {
1089 struct _SCSI_REQUEST_BLOCK *Srb;
1090 } Scsi;
1091 struct
1092 {
1093 ULONG Length;
1094 PSID StartSid;
1095 struct _FILE_GET_QUOTA_INFORMATION *SidList;
1096 ULONG SidListLength;
1097 } QueryQuota;
1098 struct
1099 {
1100 ULONG Length;
1101 } SetQuota;
1102 struct
1103 {
1104 DEVICE_RELATION_TYPE Type;
1105 } QueryDeviceRelations;
1106 struct
1107 {
1108 CONST GUID *InterfaceType;
1109 USHORT Size;
1110 USHORT Version;
1111 PINTERFACE Interface;
1112 PVOID InterfaceSpecificData;
1113 } QueryInterface;
1114 struct
1115 {
1116 PDEVICE_CAPABILITIES Capabilities;
1117 } DeviceCapabilities;
1118 struct
1119 {
1120 PIO_RESOURCE_REQUIREMENTS_LIST IoResourceRequirementList;
1121 } FilterResourceRequirements;
1122 struct
1123 {
1124 ULONG WhichSpace;
1125 PVOID Buffer;
1126 ULONG Offset;
1127 ULONG POINTER_ALIGNMENT Length;
1128 } ReadWriteConfig;
1129 struct
1130 {
1131 BOOLEAN Lock;
1132 } SetLock;
1133 struct
1134 {
1135 BUS_QUERY_ID_TYPE IdType;
1136 } QueryId;
1137 struct
1138 {
1139 DEVICE_TEXT_TYPE DeviceTextType;
1140 LCID POINTER_ALIGNMENT LocaleId;
1141 } QueryDeviceText;
1142 struct
1143 {
1144 BOOLEAN InPath;
1145 BOOLEAN Reserved[3];
1146 DEVICE_USAGE_NOTIFICATION_TYPE POINTER_ALIGNMENT Type;
1147 } UsageNotification;
1148 struct
1149 {
1150 SYSTEM_POWER_STATE PowerState;
1151 } WaitWake;
1152 struct
1153 {
1154 PPOWER_SEQUENCE PowerSequence;
1155 } PowerSequence;
1156 struct
1157 {
1158 union
1159 {
1160 ULONG SystemContext;
1161 #if (NTDDI_VERSION >= NTDDI_VISTA)
1162 SYSTEM_POWER_STATE_CONTEXT SystemPowerStateContext;
1163 #endif // (NTDDI_VERSION >= NTDDI_VISTA)
1164 };
1165 POWER_STATE_TYPE POINTER_ALIGNMENT Type;
1166 POWER_STATE POINTER_ALIGNMENT State;
1167 POWER_ACTION POINTER_ALIGNMENT ShutdownType;
1168 } Power;
1169 struct
1170 {
1171 PCM_RESOURCE_LIST AllocatedResources;
1172 PCM_RESOURCE_LIST AllocatedResourcesTranslated;
1173 } StartDevice;
1174 struct
1175 {
1176 ULONG_PTR ProviderId;
1177 PVOID DataPath;
1178 ULONG BufferSize;
1179 PVOID Buffer;
1180 } WMI;
1181 struct
1182 {
1183 PVOID Argument1;
1184 PVOID Argument2;
1185 PVOID Argument3;
1186 PVOID Argument4;
1187 } Others;
1188 } Parameters;
1189 PDEVICE_OBJECT DeviceObject;
1190 PFILE_OBJECT FileObject;
1191 PIO_COMPLETION_ROUTINE CompletionRoutine;
1192 PVOID Context;
1193 } EXTENDED_IO_STACK_LOCATION, *PEXTENDED_IO_STACK_LOCATION;
1194 #endif
1195
1196 //
1197 // Firmware Boot File Path
1198 //
1199 typedef struct _FILE_PATH
1200 {
1201 ULONG Version;
1202 ULONG Length;
1203 ULONG Type;
1204 CHAR FilePath[1];
1205 } FILE_PATH, *PFILE_PATH;
1206
1207 //
1208 // Firmware Boot Options
1209 //
1210 typedef struct _BOOT_OPTIONS
1211 {
1212 ULONG Version;
1213 ULONG Length;
1214 ULONG Timeout;
1215 ULONG CurrentBootEntryId;
1216 ULONG NextBootEntryId;
1217 WCHAR HeadlessRedirection[1];
1218 } BOOT_OPTIONS, *PBOOT_OPTIONS;
1219
1220 //
1221 // Firmware Boot Entry
1222 //
1223 typedef struct _BOOT_ENTRY
1224 {
1225 ULONG Version;
1226 ULONG Length;
1227 ULONG Id;
1228 ULONG Attributes;
1229 ULONG FriendlyNameOffset;
1230 ULONG BootFilePathOffset;
1231 ULONG OsOptionsLength;
1232 CHAR OsOptions[1];
1233 } BOOT_ENTRY, *PBOOT_ENTRY;
1234
1235 //
1236 // Firmware Driver Entry
1237 //
1238 typedef struct _EFI_DRIVER_ENTRY
1239 {
1240 ULONG Version;
1241 ULONG Length;
1242 ULONG Id;
1243 ULONG Attributes;
1244 ULONG FriendlyNameOffset;
1245 ULONG DriverFilePathOffset;
1246 } EFI_DRIVER_ENTRY, *PEFI_DRIVER_ENTRY;
1247
1248 #ifdef NTOS_MODE_USER
1249
1250 //
1251 // APC Callback for NtCreateFile
1252 //
1253 typedef VOID
1254 (NTAPI *PIO_APC_ROUTINE)(
1255 _In_ PVOID ApcContext,
1256 _In_ PIO_STATUS_BLOCK IoStatusBlock,
1257 _In_ ULONG Reserved);
1258
1259 //
1260 // Mailslot IOCTL Codes
1261 //
1262 #define FSCTL_MAILSLOT_PEEK \
1263 CTL_CODE(FILE_DEVICE_MAILSLOT, 0, METHOD_NEITHER, FILE_READ_DATA)
1264
1265 //
1266 // Pipe IOCTL Codes
1267 //
1268 #define FSCTL_PIPE_ASSIGN_EVENT \
1269 CTL_CODE(FILE_DEVICE_NAMED_PIPE, 0, METHOD_BUFFERED, FILE_ANY_ACCESS)
1270 #define FSCTL_PIPE_DISCONNECT \
1271 CTL_CODE(FILE_DEVICE_NAMED_PIPE, 1, METHOD_BUFFERED, FILE_ANY_ACCESS)
1272 #define FSCTL_PIPE_LISTEN \
1273 CTL_CODE(FILE_DEVICE_NAMED_PIPE, 2, METHOD_BUFFERED, FILE_ANY_ACCESS)
1274 #define FSCTL_PIPE_PEEK \
1275 CTL_CODE(FILE_DEVICE_NAMED_PIPE, 3, METHOD_BUFFERED, FILE_READ_DATA)
1276 #define FSCTL_PIPE_QUERY_EVENT \
1277 CTL_CODE(FILE_DEVICE_NAMED_PIPE, 4, METHOD_BUFFERED, FILE_ANY_ACCESS)
1278 #define FSCTL_PIPE_TRANSCEIVE \
1279 CTL_CODE(FILE_DEVICE_NAMED_PIPE, 5, METHOD_NEITHER, FILE_READ_DATA | FILE_WRITE_DATA)
1280 #define FSCTL_PIPE_WAIT \
1281 CTL_CODE(FILE_DEVICE_NAMED_PIPE, 6, METHOD_BUFFERED, FILE_ANY_ACCESS)
1282 #define FSCTL_PIPE_IMPERSONATE \
1283 CTL_CODE(FILE_DEVICE_NAMED_PIPE, 7, METHOD_BUFFERED, FILE_ANY_ACCESS)
1284 #define FSCTL_PIPE_SET_CLIENT_PROCESS \
1285 CTL_CODE(FILE_DEVICE_NAMED_PIPE, 8, METHOD_BUFFERED, FILE_ANY_ACCESS)
1286 #define FSCTL_PIPE_QUERY_CLIENT_PROCESS \
1287 CTL_CODE(FILE_DEVICE_NAMED_PIPE, 9, METHOD_BUFFERED, FILE_ANY_ACCESS)
1288 #define FSCTL_PIPE_INTERNAL_READ \
1289 CTL_CODE(FILE_DEVICE_NAMED_PIPE, 2045, METHOD_BUFFERED, FILE_READ_DATA)
1290 #define FSCTL_PIPE_INTERNAL_WRITE \
1291 CTL_CODE(FILE_DEVICE_NAMED_PIPE, 2046, METHOD_BUFFERED, FILE_WRITE_DATA)
1292 #define FSCTL_PIPE_INTERNAL_TRANSCEIVE \
1293 CTL_CODE(FILE_DEVICE_NAMED_PIPE, 2047, METHOD_NEITHER, FILE_READ_DATA | FILE_WRITE_DATA)
1294 #define FSCTL_PIPE_INTERNAL_READ_OVFLOW \
1295 CTL_CODE(FILE_DEVICE_NAMED_PIPE, 2048, METHOD_BUFFERED, FILE_READ_DATA)
1296
1297 //
1298 // Tape IOCTL Codes
1299 //
1300 #define IOCTL_TAPE_ERASE \
1301 CTL_CODE(FILE_DEVICE_TAPE, 0, METHOD_BUFFERED, FILE_READ_ACCESS | FILE_WRITE_ACCESS)
1302 #define IOCTL_TAPE_PREPARE \
1303 CTL_CODE(FILE_DEVICE_TAPE, 1, METHOD_BUFFERED, FILE_READ_ACCESS)
1304 #define IOCTL_TAPE_WRITE_MARKS \
1305 CTL_CODE(FILE_DEVICE_TAPE, 2, METHOD_BUFFERED, FILE_READ_ACCESS | FILE_WRITE_ACCESS)
1306 #define IOCTL_TAPE_GET_POSITION \
1307 CTL_CODE(FILE_DEVICE_TAPE, 3, METHOD_BUFFERED, FILE_READ_ACCESS)
1308 #define IOCTL_TAPE_SET_POSITION \
1309 CTL_CODE(FILE_DEVICE_TAPE, 4, METHOD_BUFFERED, FILE_READ_ACCESS)
1310 #define IOCTL_TAPE_GET_DRIVE_PARAMS \
1311 CTL_CODE(FILE_DEVICE_TAPE, 5, METHOD_BUFFERED, FILE_READ_ACCESS)
1312 #define IOCTL_TAPE_SET_DRIVE_PARAMS \
1313 CTL_CODE(FILE_DEVICE_TAPE, 6, METHOD_BUFFERED, FILE_READ_ACCESS | FILE_WRITE_ACCESS)
1314 #define IOCTL_TAPE_GET_MEDIA_PARAMS \
1315 CTL_CODE(FILE_DEVICE_TAPE, 7, METHOD_BUFFERED, FILE_READ_ACCESS)
1316 #define IOCTL_TAPE_SET_MEDIA_PARAMS \
1317 CTL_CODE(FILE_DEVICE_TAPE, 8, METHOD_BUFFERED, FILE_READ_ACCESS)
1318 #define IOCTL_TAPE_GET_STATUS \
1319 CTL_CODE(FILE_DEVICE_TAPE, 9, METHOD_BUFFERED, FILE_READ_ACCESS)
1320 #define IOCTL_TAPE_CREATE_PARTITION \
1321 CTL_CODE(FILE_DEVICE_TAPE, 10, METHOD_BUFFERED, FILE_READ_ACCESS | FILE_WRITE_ACCESS)
1322
1323 //
1324 // Reparse points
1325 //
1326
1327 #define SYMLINK_FLAG_RELATIVE 1
1328
1329 typedef struct _REPARSE_DATA_BUFFER {
1330 ULONG ReparseTag;
1331 USHORT ReparseDataLength;
1332 USHORT Reserved;
1333 _ANONYMOUS_UNION union {
1334 struct {
1335 USHORT SubstituteNameOffset;
1336 USHORT SubstituteNameLength;
1337 USHORT PrintNameOffset;
1338 USHORT PrintNameLength;
1339 ULONG Flags;
1340 WCHAR PathBuffer[1];
1341 } SymbolicLinkReparseBuffer;
1342 struct {
1343 USHORT SubstituteNameOffset;
1344 USHORT SubstituteNameLength;
1345 USHORT PrintNameOffset;
1346 USHORT PrintNameLength;
1347 WCHAR PathBuffer[1];
1348 } MountPointReparseBuffer;
1349 struct {
1350 UCHAR DataBuffer[1];
1351 } GenericReparseBuffer;
1352 } DUMMYUNIONNAME;
1353 } REPARSE_DATA_BUFFER, *PREPARSE_DATA_BUFFER;
1354
1355 #endif // NTOS_MODE_USER
1356
1357 #endif