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