Manually applying Gunnars patch became it's easier this way - and a good chance to...
[reactos.git] / reactos / include / ddk / iotypes.h
1 /* $Id: iotypes.h,v 1.44 2002/11/07 02:44:49 robd Exp $
2 *
3 */
4
5 #ifndef __INCLUDE_DDK_IOTYPES_H
6 #define __INCLUDE_DDK_IOTYPES_H
7
8 #include <ntos/disk.h>
9 #include <ntos/file.h>
10
11 #ifdef __NTOSKRNL__
12 extern POBJECT_TYPE EXPORTED IoAdapterObjectType;
13 extern POBJECT_TYPE EXPORTED IoDeviceHandlerObjectType;
14 extern POBJECT_TYPE EXPORTED IoDeviceObjectType;
15 extern POBJECT_TYPE EXPORTED IoDriverObjectType;
16 extern POBJECT_TYPE EXPORTED IoFileObjectType;
17 #else
18 extern POBJECT_TYPE IMPORTED IoAdapterObjectType;
19 extern POBJECT_TYPE IMPORTED IoDeviceHandlerObjectType;
20 extern POBJECT_TYPE IMPORTED IoDeviceObjectType;
21 extern POBJECT_TYPE IMPORTED IoDriverObjectType;
22 extern POBJECT_TYPE IMPORTED IoFileObjectType;
23 #endif
24
25 /*
26 * These are referenced before they can be fully defined
27 */
28 struct _DRIVER_OBJECT;
29 struct _FILE_OBJECT;
30 struct _DEVICE_OBJECT;
31 struct _IRP;
32 struct _IO_STATUS_BLOCK;
33 struct _SCSI_REQUEST_BLOCK;
34
35 /* SIMPLE TYPES *************************************************************/
36
37 enum
38 {
39 DeallocateObject,
40 KeepObject,
41 };
42
43
44 typedef enum _CREATE_FILE_TYPE
45 {
46 CreateFileTypeNone,
47 CreateFileTypeNamedPipe,
48 CreateFileTypeMailslot
49 } CREATE_FILE_TYPE;
50
51
52 typedef struct _SHARE_ACCESS
53 {
54 ULONG OpenCount;
55 ULONG Readers;
56 ULONG Writers;
57 ULONG Deleters;
58 ULONG SharedRead;
59 ULONG SharedWrite;
60 ULONG SharedDelete;
61 } SHARE_ACCESS, *PSHARE_ACCESS;
62
63 /* FUNCTION TYPES ************************************************************/
64
65 typedef VOID STDCALL
66 (*PDRIVER_REINITIALIZE)(struct _DRIVER_OBJECT* DriverObject,
67 PVOID Context,
68 ULONG Count);
69
70 typedef NTSTATUS STDCALL
71 (*PIO_QUERY_DEVICE_ROUTINE)(PVOID Context,
72 PUNICODE_STRING Pathname,
73 INTERFACE_TYPE BusType,
74 ULONG BusNumber,
75 PKEY_VALUE_FULL_INFORMATION* BI,
76 CONFIGURATION_TYPE ControllerType,
77 ULONG ControllerNumber,
78 PKEY_VALUE_FULL_INFORMATION* CI,
79 CONFIGURATION_TYPE PeripheralType,
80 ULONG PeripheralNumber,
81 PKEY_VALUE_FULL_INFORMATION* PI);
82
83 typedef NTSTATUS STDCALL
84 (*PIO_COMPLETION_ROUTINE)(struct _DEVICE_OBJECT* DeviceObject,
85 struct _IRP* Irp,
86 PVOID Context);
87
88 typedef VOID STDCALL
89 (*PIO_APC_ROUTINE)(PVOID ApcContext,
90 struct _IO_STATUS_BLOCK* IoStatusBlock,
91 ULONG Reserved);
92
93
94 /* STRUCTURE TYPES ***********************************************************/
95
96 typedef struct _ADAPTER_OBJECT ADAPTER_OBJECT, *PADAPTER_OBJECT;
97
98 /*
99 * PURPOSE: Special timer associated with each device
100 * NOTES: This is a guess
101 */
102 typedef struct _IO_TIMER
103 {
104 KTIMER timer;
105 KDPC dpc;
106 } IO_TIMER, *PIO_TIMER;
107
108 typedef struct _IO_SECURITY_CONTEXT
109 {
110 PSECURITY_QUALITY_OF_SERVICE SecurityQos;
111 PACCESS_STATE AccessState;
112 ACCESS_MASK DesiredAccess;
113 ULONG FullCreateOptions;
114 } IO_SECURITY_CONTEXT, *PIO_SECURITY_CONTEXT;
115
116
117 typedef struct _IO_RESOURCE_DESCRIPTOR
118 {
119 UCHAR Option;
120 UCHAR Type;
121 UCHAR ShareDisposition;
122
123 /*
124 * Reserved for system use
125 */
126 UCHAR Spare1;
127
128 USHORT Flags;
129
130 /*
131 * Reserved for system use
132 */
133 UCHAR Spare2;
134
135 union
136 {
137 struct
138 {
139 ULONG Length;
140 ULONG Alignment;
141 PHYSICAL_ADDRESS MinimumAddress;
142 PHYSICAL_ADDRESS MaximumAddress;
143 } Port;
144 struct
145 {
146 ULONG Length;
147 ULONG Alignment;
148 PHYSICAL_ADDRESS MinimumAddress;
149 PHYSICAL_ADDRESS MaximumAddress;
150 } Memory;
151 struct
152 {
153 ULONG MinimumVector;
154 ULONG MaximumVector;
155 } Interrupt;
156 struct
157 {
158 ULONG MinimumChannel;
159 ULONG MaximumChannel;
160 } Dma;
161 } u;
162 } IO_RESOURCE_DESCRIPTOR, *PIO_RESOURCE_DESCRIPTOR;
163
164 // IO_RESOURCE_DESCRIPTOR Options
165 #define IO_RESOURCE_REQUIRED 0x00
166 #define IO_RESOURCE_PREFERRED 0x01
167 #define IO_RESOURCE_DEFAULT 0x02
168 #define IO_RESOURCE_ALTERNATIVE 0x08
169
170 typedef struct _IO_RESOURCE_LIST
171 {
172 USHORT Version;
173 USHORT Revision;
174 ULONG Count;
175 IO_RESOURCE_DESCRIPTOR Descriptors[1];
176 } IO_RESOURCE_LIST, *PIO_RESOURCE_LIST;
177
178 typedef struct _IO_RESOURCE_REQUIREMENTS_LIST
179 {
180 /*
181 * List size in bytes
182 */
183 ULONG ListSize;
184
185 /*
186 * System defined enum for the bus
187 */
188 INTERFACE_TYPE InterfaceType;
189
190 ULONG BusNumber;
191 ULONG SlotNumber;
192 ULONG Reserved[3];
193 ULONG AlternativeLists;
194 IO_RESOURCE_LIST List[1];
195 } IO_RESOURCE_REQUIREMENTS_LIST, *PIO_RESOURCE_REQUIREMENTS_LIST;
196
197 typedef struct
198 {
199 UCHAR Type;
200 UCHAR ShareDisposition;
201 USHORT Flags;
202 union
203 {
204 struct
205 {
206 PHYSICAL_ADDRESS Start;
207 ULONG Length;
208 } __attribute__((packed)) Port;
209 struct
210 {
211 ULONG Level;
212 ULONG Vector;
213 ULONG Affinity;
214 } __attribute__((packed))Interrupt;
215 struct
216 {
217 PHYSICAL_ADDRESS Start;
218 ULONG Length;
219 } __attribute__((packed))Memory;
220 struct
221 {
222 ULONG Channel;
223 ULONG Port;
224 ULONG Reserved1;
225 } __attribute__((packed))Dma;
226 struct
227 {
228 ULONG DataSize;
229 ULONG Reserved1;
230 ULONG Reserved2;
231 } __attribute__((packed))DeviceSpecificData;
232 } __attribute__((packed)) u;
233 } __attribute__((packed)) CM_PARTIAL_RESOURCE_DESCRIPTOR, *PCM_PARTIAL_RESOURCE_DESCRIPTOR;
234
235 typedef struct
236 {
237 USHORT Version;
238 USHORT Revision;
239 ULONG Count;
240 CM_PARTIAL_RESOURCE_DESCRIPTOR PartialDescriptors[1];
241 } __attribute__((packed))CM_PARTIAL_RESOURCE_LIST, *PCM_PARTIAL_RESOURCE_LIST;
242
243 typedef struct
244 {
245 INTERFACE_TYPE InterfaceType;
246 ULONG BusNumber;
247 CM_PARTIAL_RESOURCE_LIST PartialResourceList;
248 } __attribute__((packed)) CM_FULL_RESOURCE_DESCRIPTOR;
249
250 typedef struct
251 {
252 ULONG Count;
253 CM_FULL_RESOURCE_DESCRIPTOR List[1];
254 } CM_RESOURCE_LIST, *PCM_RESOURCE_LIST;
255
256
257 /*
258 * PURPOSE: IRP stack location
259 */
260 typedef struct __attribute__((packed)) _IO_STACK_LOCATION
261 {
262 UCHAR MajorFunction;
263 UCHAR MinorFunction;
264 UCHAR Flags;
265 UCHAR Control;
266
267 union
268 {
269 struct
270 {
271 PIO_SECURITY_CONTEXT SecurityContext;
272 ULONG Options;
273 USHORT FileAttributes;
274 USHORT ShareAccess;
275 ULONG EaLength;
276 } Create;
277 struct
278 {
279 ULONG Length;
280 ULONG Key;
281 LARGE_INTEGER ByteOffset;
282 } Read;
283 struct
284 {
285 ULONG Length;
286 ULONG Key;
287 LARGE_INTEGER ByteOffset;
288 } Write;
289 struct
290 {
291 ULONG OutputBufferLength;
292 ULONG InputBufferLength;
293 ULONG IoControlCode;
294 PVOID Type3InputBuffer;
295 } DeviceIoControl;
296 struct
297 {
298 ULONG OutputBufferLength;
299 ULONG InputBufferLength;
300 ULONG IoControlCode;
301 PVOID Type3InputBuffer;
302 } FileSystemControl;
303 struct
304 {
305 struct _VPB* Vpb;
306 struct _DEVICE_OBJECT* DeviceObject;
307 } MountVolume;
308 struct
309 {
310 struct _VPB* Vpb;
311 struct _DEVICE_OBJECT* DeviceObject;
312 } VerifyVolume;
313 struct
314 {
315 ULONG Length;
316 FILE_INFORMATION_CLASS FileInformationClass;
317 } QueryFile;
318 struct
319 {
320 ULONG Length;
321 FS_INFORMATION_CLASS FsInformationClass;
322 } QueryVolume;
323 struct
324 {
325 ULONG Length;
326 FS_INFORMATION_CLASS FsInformationClass;
327 } SetVolume;
328 struct
329 {
330 ULONG Length;
331 FILE_INFORMATION_CLASS FileInformationClass;
332 struct _FILE_OBJECT* FileObject;
333 union
334 {
335 struct
336 {
337 BOOLEAN ReplaceIfExists;
338 BOOLEAN AdvanceOnly;
339 } d;
340 ULONG ClusterCount;
341 HANDLE DeleteHandle;
342 } u;
343 } SetFile;
344 struct
345 {
346 ULONG Length;
347 PUNICODE_STRING FileName;
348 FILE_INFORMATION_CLASS FileInformationClass;
349 ULONG FileIndex;
350 } QueryDirectory;
351
352 // Parameters for IRP_MN_QUERY_DEVICE_RELATIONS
353 struct
354 {
355 DEVICE_RELATION_TYPE Type;
356 } QueryDeviceRelations;
357
358 // Parameters for IRP_MN_QUERY_INTERFACE
359 struct
360 {
361 CONST GUID *InterfaceType;
362 USHORT Size;
363 USHORT Version;
364 PINTERFACE Interface;
365 PVOID InterfaceSpecificData;
366 } QueryInterface;
367
368 // Parameters for IRP_MN_QUERY_CAPABILITIES
369 struct
370 {
371 PDEVICE_CAPABILITIES Capabilities;
372 } DeviceCapabilities;
373
374 // Parameters for IRP_MN_FILTER_RESOURCE_REQUIREMENTS
375 struct
376 {
377 PIO_RESOURCE_REQUIREMENTS_LIST IoResourceRequirementList;
378 } FilterResourceRequirements;
379
380 // Parameters for IRP_MN_QUERY_ID
381 struct
382 {
383 BUS_QUERY_ID_TYPE IdType;
384 } QueryId;
385
386 // Parameters for IRP_MN_QUERY_DEVICE_TEXT
387 struct
388 {
389 DEVICE_TEXT_TYPE DeviceTextType;
390 LCID LocaleId;
391 } QueryDeviceText;
392
393 // Parameters for IRP_MN_DEVICE_USAGE_NOTIFICATION
394 struct
395 {
396 BOOLEAN InPath;
397 BOOLEAN Reserved[3];
398 DEVICE_USAGE_NOTIFICATION_TYPE Type;
399 } UsageNotification;
400
401 // Parameters for IRP_MN_WAIT_WAKE
402 struct
403 {
404 SYSTEM_POWER_STATE PowerState;
405 } WaitWake;
406
407 // Parameter for IRP_MN_POWER_SEQUENCE
408 struct
409 {
410 PPOWER_SEQUENCE PowerSequence;
411 } PowerSequence;
412
413 // Parameters for IRP_MN_SET_POWER and IRP_MN_QUERY_POWER
414 struct
415 {
416 ULONG SystemContext;
417 POWER_STATE_TYPE Type;
418 POWER_STATE State;
419 POWER_ACTION ShutdownType;
420 } Power;
421
422 // Parameters for IRP_MN_START_DEVICE
423 struct
424 {
425 PCM_RESOURCE_LIST AllocatedResources;
426 PCM_RESOURCE_LIST AllocatedResourcesTranslated;
427 } StartDevice;
428
429 /* Parameters for IRP_MN_SCSI_CLASS */
430 struct
431 {
432 struct _SCSI_REQUEST_BLOCK *Srb;
433 } Scsi;
434
435 //byte range file locking
436 struct
437 {
438 PLARGE_INTEGER Length;
439 ULONG Key;
440 LARGE_INTEGER ByteOffset;
441 } LockControl;
442
443 /* Paramters for other calls */
444 struct
445 {
446 PVOID Argument1;
447 PVOID Argument2;
448 PVOID Argument3;
449 PVOID Argument4;
450 } Others;
451 } Parameters;
452
453 struct _DEVICE_OBJECT* DeviceObject;
454 struct _FILE_OBJECT* FileObject;
455
456 PIO_COMPLETION_ROUTINE CompletionRoutine;
457 PVOID CompletionContext;
458
459 } __attribute__((packed)) IO_STACK_LOCATION, *PIO_STACK_LOCATION;
460
461
462 typedef struct _IO_STATUS_BLOCK
463 {
464 NTSTATUS Status;
465 ULONG Information;
466 } IO_STATUS_BLOCK, *PIO_STATUS_BLOCK;
467
468
469 typedef struct _IO_PIPE_CREATE_BUFFER
470 {
471 BOOLEAN WriteModeMessage;
472 BOOLEAN ReadModeMessage;
473 BOOLEAN NonBlocking;
474 ULONG MaxInstances;
475 ULONG InBufferSize;
476 ULONG OutBufferSize;
477 LARGE_INTEGER TimeOut;
478 } IO_PIPE_CREATE_BUFFER, *PIO_PIPE_CREATE_BUFFER;
479
480
481 typedef struct _IO_MAILSLOT_CREATE_BUFFER
482 {
483 ULONG Param; /* ?? */
484 ULONG MaxMessageSize;
485 LARGE_INTEGER TimeOut;
486 } IO_MAILSLOT_CREATE_BUFFER, *PIO_MAILSLOT_CREATE_BUFFER;
487
488
489 /*
490 * Driver entry point declaration
491 */
492 typedef NTSTATUS STDCALL
493 (*PDRIVER_INITIALIZE)(struct _DRIVER_OBJECT* DriverObject,
494 PUNICODE_STRING RegistryPath);
495
496 /*
497 * Driver cancel declaration
498 */
499 typedef NTSTATUS STDCALL
500 (*PDRIVER_CANCEL)(struct _DEVICE_OBJECT* DeviceObject,
501 struct _IRP* RegistryPath);
502
503
504 typedef struct _SECTION_OBJECT_POINTERS
505 {
506 PVOID DataSectionObject;
507 PVOID SharedCacheMap;
508 PVOID ImageSectionObject;
509 } SECTION_OBJECT_POINTERS, *PSECTION_OBJECT_POINTERS;
510
511 typedef struct _IO_COMPLETION_CONTEXT
512 {
513 PVOID Port;
514 ULONG Key;
515 } IO_COMPLETION_CONTEXT, *PIO_COMPLETION_CONTEXT;
516
517 #define FO_FILE_OPEN 0x00000001
518 #define FO_SYNCHRONOUS_IO 0x00000002
519 #define FO_ALERTABLE_IO 0x00000004
520 #define FO_NO_INTERMEDIATE_BUFFERING 0x00000008
521 #define FO_WRITE_THROUGH 0x00000010
522 #define FO_SEQUENTIAL_ONLY 0x00000020
523 #define FO_CACHE_SUPPORTED 0x00000040
524 #define FO_NAMED_PIPE 0x00000080
525 #define FO_STREAM_FILE 0x00000100
526 #define FO_MAILSLOT 0x00000200
527 #define FO_GENERATE_AUDIT_ON_CLOSE 0x00000400
528 #define FO_DIRECT_DEVICE_OPEN 0x00000800
529 #define FO_FILE_MODIFIED 0x00001000
530 #define FO_FILE_SIZE_CHANGED 0x00002000
531 #define FO_CLEANUP_COMPLETE 0x00004000
532 #define FO_TEMPORARY_FILE 0x00008000
533 #define FO_DELETE_ON_CLOSE 0x00010000
534 #define FO_OPENED_CASE_SENSITIVE 0x00020000
535 #define FO_HANDLE_CREATED 0x00040000
536 #define FO_FILE_FAST_IO_READ 0x00080000
537
538 /*
539 * ReactOS specific flags
540 */
541 #define FO_DIRECT_CACHE_READ 0x72000001
542 #define FO_DIRECT_CACHE_WRITE 0x72000002
543 #define FO_DIRECT_CACHE_PAGING_READ 0x72000004
544 #define FO_DIRECT_CACHE_PAGING_WRITE 0x72000008
545 #define FO_FCB_IS_VALID 0x72000010
546
547 typedef struct _FILE_OBJECT
548 {
549 CSHORT Type;
550 CSHORT Size;
551 struct _DEVICE_OBJECT* DeviceObject;
552 struct _VPB* Vpb;
553 PVOID FsContext;
554 PVOID FsContext2;
555 PSECTION_OBJECT_POINTERS SectionObjectPointers;
556 PVOID PrivateCacheMap;
557 NTSTATUS FinalStatus;
558 struct _FILE_OBJECT* RelatedFileObject;
559 BOOLEAN LockOperation;
560 BOOLEAN DeletePending;
561 BOOLEAN ReadAccess;
562 BOOLEAN WriteAccess;
563 BOOLEAN DeleteAccess;
564 BOOLEAN SharedRead;
565 BOOLEAN SharedWrite;
566 BOOLEAN SharedDelete;
567 ULONG Flags;
568 UNICODE_STRING FileName;
569 LARGE_INTEGER CurrentByteOffset;
570 ULONG Waiters;
571 ULONG Busy;
572 PVOID LastLock;
573 KEVENT Lock;
574 KEVENT Event;
575 PIO_COMPLETION_CONTEXT CompletionContext;
576 } FILE_OBJECT, *PFILE_OBJECT;
577
578
579 typedef struct _IRP
580 {
581 CSHORT Type;
582 USHORT Size;
583 PMDL MdlAddress;
584 ULONG Flags;
585 union
586 {
587 struct _IRP* MasterIrp;
588 LONG IrpCount;
589 PVOID SystemBuffer;
590 } AssociatedIrp;
591 LIST_ENTRY ThreadListEntry;
592 IO_STATUS_BLOCK IoStatus;
593 KPROCESSOR_MODE RequestorMode;
594 BOOLEAN PendingReturned;
595 CHAR StackCount;
596 CHAR CurrentLocation;
597 BOOLEAN Cancel;
598 KIRQL CancelIrql;
599 CCHAR ApcEnvironment;// CCHAR or PVOID?
600 UCHAR AllocationFlags;//UCHAR or ULONG?
601 PIO_STATUS_BLOCK UserIosb;
602 PKEVENT UserEvent;
603 union
604 {
605 struct
606 {
607 PIO_APC_ROUTINE UserApcRoutine;
608 PVOID UserApcContext;
609 } AsynchronousParameters;
610 LARGE_INTEGER AllocationSize;
611 } Overlay;
612 PDRIVER_CANCEL CancelRoutine;
613 PVOID UserBuffer;
614 union
615 {
616 struct
617 {
618 union {
619 KDEVICE_QUEUE_ENTRY DeviceQueueEntry;
620 PVOID DriverContext[4];
621 };
622 struct _ETHREAD* Thread;
623 PCHAR AuxiliaryBuffer;
624 LIST_ENTRY ListEntry;
625 struct _IO_STACK_LOCATION* CurrentStackLocation;
626 PFILE_OBJECT OriginalFileObject;
627 } Overlay;
628 KAPC Apc;
629 ULONG CompletionKey;
630 } Tail;
631 IO_STACK_LOCATION Stack[1];
632 } IRP, *PIRP;
633
634 #define VPB_MOUNTED 0x00000001
635 #define VPB_LOCKED 0x00000002
636 #define VPB_PERSISTENT 0x00000004
637 #define VPB_REMOVE_PENDING 0x00000008
638
639 typedef struct _VPB
640 {
641 CSHORT Type;
642 CSHORT Size;
643 USHORT Flags;
644 USHORT VolumeLabelLength;
645 struct _DEVICE_OBJECT* DeviceObject;
646 struct _DEVICE_OBJECT* RealDevice;
647 ULONG SerialNumber;
648 ULONG ReferenceCount;
649 WCHAR VolumeLabel[MAXIMUM_VOLUME_LABEL_LENGTH];
650 } VPB, *PVPB;
651
652
653 typedef struct _DEVICE_OBJECT
654 {
655 CSHORT Type;
656 CSHORT Size;
657 LONG ReferenceCount;
658 struct _DRIVER_OBJECT* DriverObject;
659 struct _DEVICE_OBJECT* NextDevice;
660 struct _DEVICE_OBJECT* AttachedDevice;
661 struct _IRP* CurrentIrp;
662 PIO_TIMER Timer;
663 ULONG Flags;
664 ULONG Characteristics;
665 PVPB Vpb;
666 PVOID DeviceExtension;
667 DEVICE_TYPE DeviceType;
668 CCHAR StackSize;
669 union
670 {
671 LIST_ENTRY ListHead;
672 WAIT_CONTEXT_BLOCK Wcb;
673 } Queue;
674 ULONG AlignmentRequirement;
675 KDEVICE_QUEUE DeviceQueue;
676 KDPC Dpc;
677 ULONG ActiveThreadCount;
678 PSECURITY_DESCRIPTOR SecurityDescriptor;
679 KEVENT DeviceLock;
680 USHORT SectorSize;
681 USHORT Spare1;
682 struct _DEVOBJ_EXTENSION* DeviceObjectExtension;
683 PVOID Reserved;
684 } DEVICE_OBJECT, *PDEVICE_OBJECT;
685
686
687 /*
688 * Fast i/o routine type declaration
689 */
690 //typedef NTSTATUS (*PFAST_IO_DISPATCH)(struct _DEVICE_OBJECT*, IRP*);
691 //FIXME : this type is ok for read and write, but not for all routines
692 typedef BOOLEAN STDCALL
693 (*PFAST_IO_ROUTINE)(IN struct _FILE_OBJECT *FileObject,
694 IN PLARGE_INTEGER FileOffset,
695 IN ULONG Length,
696 IN BOOLEAN Wait,
697 IN ULONG LockKey,
698 OUT PVOID Buffer,
699 OUT PIO_STATUS_BLOCK IoStatus,
700 IN struct _DEVICE_OBJECT *DeviceObject);
701
702 typedef struct _FAST_IO_DISPATCH {
703 ULONG SizeOfFastIoDispatch;
704 PFAST_IO_ROUTINE FastIoCheckIfPossible;
705 PFAST_IO_ROUTINE FastIoRead;
706 PFAST_IO_ROUTINE FastIoWrite;
707 PFAST_IO_ROUTINE FastIoQueryBasicInfo;
708 PFAST_IO_ROUTINE FastIoQueryStandardInfo;
709 PFAST_IO_ROUTINE FastIoLock;
710 PFAST_IO_ROUTINE FastIoUnlockSingle;
711 PFAST_IO_ROUTINE FastIoUnlockAll;
712 PFAST_IO_ROUTINE FastIoUnlockAllByKey;
713 PFAST_IO_ROUTINE FastIoDeviceControl;
714 PFAST_IO_ROUTINE AcquireFileForNtCreateSection;
715 PFAST_IO_ROUTINE ReleaseFileForNtCreateSection;
716 PFAST_IO_ROUTINE FastIoDetachDevice;
717 PFAST_IO_ROUTINE FastIoQueryNetworkOpenInfo;
718 PFAST_IO_ROUTINE AcquireForModWrite;
719 PFAST_IO_ROUTINE MdlRead;
720 PFAST_IO_ROUTINE MdlReadComplete;
721 PFAST_IO_ROUTINE PrepareMdlWrite;
722 PFAST_IO_ROUTINE MdlWriteComplete;
723 PFAST_IO_ROUTINE FastIoReadCompressed;
724 PFAST_IO_ROUTINE FastIoWriteCompressed;
725 PFAST_IO_ROUTINE MdlReadCompleteCompressed;
726 PFAST_IO_ROUTINE MdlWriteCompleteCompressed;
727 PFAST_IO_ROUTINE FastIoQueryOpen;
728 PFAST_IO_ROUTINE ReleaseForModWrite;
729 PFAST_IO_ROUTINE AcquireForCcFlush;
730 PFAST_IO_ROUTINE ReleaseForCcFlush;
731 } FAST_IO_DISPATCH, *PFAST_IO_DISPATCH;
732
733 /*
734 * Dispatch routine type declaration
735 */
736 typedef NTSTATUS STDCALL
737 (*PDRIVER_DISPATCH)(IN struct _DEVICE_OBJECT *DeviceObject,
738 IN struct _IRP *Irp);
739
740 /*
741 * StartIo routine type declaration
742 */
743 typedef VOID STDCALL
744 (*PDRIVER_STARTIO)(IN PDEVICE_OBJECT DeviceObject,
745 IN PIRP Irp);
746
747 /*
748 * Unload routine type declaration
749 */
750 typedef VOID STDCALL
751 (*PDRIVER_UNLOAD)(IN struct _DRIVER_OBJECT *DriverObject);
752
753 /*
754 * AddDevice routine type declaration
755 */
756 typedef NTSTATUS STDCALL
757 (*PDRIVER_ADD_DEVICE)(IN struct _DRIVER_OBJECT *DriverObject,
758 IN struct _DEVICE_OBJECT *PhysicalDeviceObject);
759
760
761 typedef struct _DRIVER_EXTENSION
762 {
763 struct _DRIVER_OBJECT* DriverObject;
764 PDRIVER_ADD_DEVICE AddDevice;
765 ULONG Count;
766 UNICODE_STRING ServiceKeyName;
767 } DRIVER_EXTENSION, *PDRIVER_EXTENSION;
768
769 #if 0
770 typedef
771 struct _FAST_IO_DISPATCH_TABLE
772 {
773 ULONG Count;
774 PFAST_IO_DISPATCH Dispatch;
775
776 } FAST_IO_DISPATCH_TABLE, * PFAST_IO_DISPATCH_TABLE;
777 #endif
778
779 typedef struct _DRIVER_OBJECT
780 {
781 CSHORT Type;
782 CSHORT Size;
783 PDEVICE_OBJECT DeviceObject;
784 ULONG Flags;
785 PVOID DriverStart;
786 ULONG DriverSize;
787 PVOID DriverSection;
788 PDRIVER_EXTENSION DriverExtension;
789 UNICODE_STRING DriverName;
790 PUNICODE_STRING HardwareDatabase;
791 #if 0
792 PFAST_IO_DISPATCH_TABLE FastIoDispatch;
793 #else
794 PFAST_IO_DISPATCH FastIoDispatch;
795 #endif
796 PDRIVER_INITIALIZE DriverInit;
797 PDRIVER_STARTIO DriverStartIo;
798 PDRIVER_UNLOAD DriverUnload;
799 PDRIVER_DISPATCH MajorFunction[IRP_MJ_MAXIMUM_FUNCTION + 1];
800 } DRIVER_OBJECT, *PDRIVER_OBJECT;
801
802
803 typedef struct _CONFIGURATION_INFORMATION
804 {
805 ULONG DiskCount;
806 ULONG FloppyCount;
807 ULONG CDRomCount;
808 ULONG TapeCount;
809 ULONG ScsiPortCount;
810 ULONG SerialCount;
811 ULONG ParallelCount;
812 BOOLEAN AtDiskPrimaryAddressClaimed;
813 BOOLEAN AtDiskSecondaryAddressClaimed;
814 } CONFIGURATION_INFORMATION, *PCONFIGURATION_INFORMATION;
815
816 typedef VOID STDCALL
817 (*PIO_DPC_ROUTINE)(PKDPC Dpc,
818 PDEVICE_OBJECT DeviceObject,
819 PIRP Irp,
820 PVOID Context);
821
822 typedef VOID STDCALL
823 (*PIO_TIMER_ROUTINE)(PDEVICE_OBJECT DeviceObject,
824 PVOID Context);
825
826 typedef struct _IO_WORKITEM *PIO_WORKITEM;
827 typedef VOID (*PIO_WORKITEM_ROUTINE)(IN PDEVICE_OBJECT DeviceObject, IN PVOID Context);
828
829 #if WINDOWS_STRUCTS_DOESNT_ALREADY_DEFINE_THIS
830 typedef struct _PARTITION_INFORMATION
831 {
832 LARGE_INTEGER StartingOffset;
833 LARGE_INTEGER PartitionLength;
834 ULONG HiddenSectors;
835 ULONG PartitionNumber;
836 UCHAR PartitionType;
837 BOOLEAN BootIndicator;
838 BOOLEAN RecognizedPartition;
839 BOOLEAN RewritePartition;
840 } PARTITION_INFORMATION, *PPARTITION_INFORMATION;
841 #endif
842
843 typedef struct _DRIVER_LAYOUT_INFORMATION
844 {
845 ULONG PartitionCount;
846 ULONG Signature;
847 PARTITION_INFORMATION PartitionEntry[1];
848 } DRIVER_LAYOUT_INFORMATION, *PDRIVER_LAYOUT_INFORMATION;
849
850
851 typedef IO_ALLOCATION_ACTION STDCALL
852 (*PDRIVER_CONTROL)(PDEVICE_OBJECT DeviceObject,
853 PIRP Irp,
854 PVOID MapRegisterBase,
855 PVOID Context);
856 #if (_WIN32_WINNT >= 0x0400)
857 typedef VOID STDCALL
858 (*PFSDNOTIFICATIONPROC)(IN PDEVICE_OBJECT PtrTargetFileSystemDeviceObject,
859 IN BOOLEAN DriverActive);
860 #endif // (_WIN32_WINNT >= 0x0400)
861
862 #endif /* __INCLUDE_DDK_IOTYPES_H */