5 #ifndef __INCLUDE_DDK_IOTYPES_H
6 #define __INCLUDE_DDK_IOTYPES_H
8 #include <ntos/obtypes.h>
10 #include <ntos/file.h>
13 extern POBJECT_TYPE EXPORTED IoAdapterObjectType;
14 extern POBJECT_TYPE EXPORTED IoDeviceHandlerObjectType;
15 extern POBJECT_TYPE EXPORTED IoDeviceObjectType;
16 extern POBJECT_TYPE EXPORTED IoDriverObjectType;
17 extern POBJECT_TYPE EXPORTED IoFileObjectType;
19 extern POBJECT_TYPE IMPORTED IoAdapterObjectType;
20 extern POBJECT_TYPE IMPORTED IoDeviceHandlerObjectType;
21 extern POBJECT_TYPE IMPORTED IoDeviceObjectType;
22 extern POBJECT_TYPE IMPORTED IoDriverObjectType;
23 extern POBJECT_TYPE IMPORTED IoFileObjectType;
28 #define POINTER_ALIGNMENT
32 * These are referenced before they can be fully defined
34 struct _DRIVER_OBJECT;
36 struct _DEVICE_OBJECT;
38 struct _IO_STATUS_BLOCK;
39 struct _SCSI_REQUEST_BLOCK;
41 /* SIMPLE TYPES *************************************************************/
47 DeallocateObjectKeepRegisters
51 typedef enum _CREATE_FILE_TYPE
54 CreateFileTypeNamedPipe,
55 CreateFileTypeMailslot
59 typedef struct _SHARE_ACCESS
68 } SHARE_ACCESS, *PSHARE_ACCESS;
70 /* FUNCTION TYPES ************************************************************/
72 typedef VOID STDCALL_FUNC
73 (*PDRIVER_REINITIALIZE)(struct _DRIVER_OBJECT* DriverObject,
77 typedef NTSTATUS STDCALL_FUNC
78 (*PIO_QUERY_DEVICE_ROUTINE)(PVOID Context,
79 PUNICODE_STRING Pathname,
80 INTERFACE_TYPE BusType,
82 PKEY_VALUE_FULL_INFORMATION* BI,
83 CONFIGURATION_TYPE ControllerType,
84 ULONG ControllerNumber,
85 PKEY_VALUE_FULL_INFORMATION* CI,
86 CONFIGURATION_TYPE PeripheralType,
87 ULONG PeripheralNumber,
88 PKEY_VALUE_FULL_INFORMATION* PI);
90 typedef NTSTATUS STDCALL_FUNC
91 (*PIO_COMPLETION_ROUTINE)(struct _DEVICE_OBJECT* DeviceObject,
95 typedef VOID STDCALL_FUNC
96 (*PIO_APC_ROUTINE)(PVOID ApcContext,
97 struct _IO_STATUS_BLOCK* IoStatusBlock,
101 /* STRUCTURE TYPES ***********************************************************/
103 typedef struct _ADAPTER_OBJECT ADAPTER_OBJECT, *PADAPTER_OBJECT;
106 * PURPOSE: Special timer associated with each device
107 * NOTES: This is a guess
109 typedef struct _IO_TIMER
113 } IO_TIMER, *PIO_TIMER;
115 typedef struct _IO_SECURITY_CONTEXT
117 PSECURITY_QUALITY_OF_SERVICE SecurityQos;
118 PACCESS_STATE AccessState;
119 ACCESS_MASK DesiredAccess;
120 ULONG FullCreateOptions;
121 } IO_SECURITY_CONTEXT, *PIO_SECURITY_CONTEXT;
124 typedef struct _IO_RESOURCE_DESCRIPTOR
128 UCHAR ShareDisposition;
131 * Reserved for system use
138 * Reserved for system use
148 PHYSICAL_ADDRESS MinimumAddress;
149 PHYSICAL_ADDRESS MaximumAddress;
155 PHYSICAL_ADDRESS MinimumAddress;
156 PHYSICAL_ADDRESS MaximumAddress;
165 ULONG MinimumChannel;
166 ULONG MaximumChannel;
169 } IO_RESOURCE_DESCRIPTOR, *PIO_RESOURCE_DESCRIPTOR;
171 // IO_RESOURCE_DESCRIPTOR Options
172 #define IO_RESOURCE_REQUIRED 0x00
173 #define IO_RESOURCE_PREFERRED 0x01
174 #define IO_RESOURCE_DEFAULT 0x02
175 #define IO_RESOURCE_ALTERNATIVE 0x08
177 typedef struct _IO_RESOURCE_LIST
182 IO_RESOURCE_DESCRIPTOR Descriptors[1];
183 } IO_RESOURCE_LIST, *PIO_RESOURCE_LIST;
185 typedef struct _IO_RESOURCE_REQUIREMENTS_LIST
193 * System defined enum for the bus
195 INTERFACE_TYPE InterfaceType;
200 ULONG AlternativeLists;
201 IO_RESOURCE_LIST List[1];
202 } IO_RESOURCE_REQUIREMENTS_LIST, *PIO_RESOURCE_REQUIREMENTS_LIST;
205 /* MicroChannel bus data */
207 typedef struct _CM_MCA_POS_DATA
214 } CM_MCA_POS_DATA, *PCM_MCA_POS_DATA;
217 /* Int13 drive geometry data */
219 typedef struct _CM_INT13_DRIVE_PARAMETER
223 USHORT SectorsPerTrack;
226 } CM_INT13_DRIVE_PARAMETER, *PCM_INT13_DRIVE_PARAMETER;
229 /* Extended drive geometry data */
231 typedef struct _CM_DISK_GEOMETRY_DEVICE_DATA
233 ULONG BytesPerSector;
234 ULONG NumberOfCylinders;
235 ULONG SectorsPerTrack;
237 } CM_DISK_GEOMETRY_DEVICE_DATA, *PCM_DISK_GEOMETRY_DEVICE_DATA;
243 UCHAR ShareDisposition;
249 PHYSICAL_ADDRESS Start;
251 } __attribute__((packed)) Port;
257 } __attribute__((packed))Interrupt;
260 PHYSICAL_ADDRESS Start;
262 } __attribute__((packed))Memory;
268 } __attribute__((packed))Dma;
274 } __attribute__((packed))DeviceSpecificData;
275 } __attribute__((packed)) u;
276 } __attribute__((packed)) CM_PARTIAL_RESOURCE_DESCRIPTOR, *PCM_PARTIAL_RESOURCE_DESCRIPTOR;
283 CM_PARTIAL_RESOURCE_DESCRIPTOR PartialDescriptors[1];
284 } __attribute__((packed))CM_PARTIAL_RESOURCE_LIST, *PCM_PARTIAL_RESOURCE_LIST;
288 INTERFACE_TYPE InterfaceType;
290 CM_PARTIAL_RESOURCE_LIST PartialResourceList;
291 } __attribute__((packed)) CM_FULL_RESOURCE_DESCRIPTOR, *PCM_FULL_RESOURCE_DESCRIPTOR;
296 CM_FULL_RESOURCE_DESCRIPTOR List[1];
297 } CM_RESOURCE_LIST, *PCM_RESOURCE_LIST;
301 * PURPOSE: IRP stack location
305 typedef struct __attribute__((packed)) _IO_STACK_LOCATION
316 PIO_SECURITY_CONTEXT SecurityContext;
318 USHORT FileAttributes;
326 LARGE_INTEGER ByteOffset;
332 LARGE_INTEGER ByteOffset;
336 ULONG OutputBufferLength;
337 ULONG InputBufferLength;
339 PVOID Type3InputBuffer;
343 ULONG OutputBufferLength;
344 ULONG InputBufferLength;
346 PVOID Type3InputBuffer;
351 struct _DEVICE_OBJECT* DeviceObject;
356 struct _DEVICE_OBJECT* DeviceObject;
361 FILE_INFORMATION_CLASS FileInformationClass;
366 FS_INFORMATION_CLASS FsInformationClass;
371 FS_INFORMATION_CLASS FsInformationClass;
376 FILE_INFORMATION_CLASS FileInformationClass;
377 struct _FILE_OBJECT* FileObject;
382 BOOLEAN ReplaceIfExists;
392 PUNICODE_STRING FileName;
393 FILE_INFORMATION_CLASS FileInformationClass;
397 // Parameters for IRP_MN_QUERY_DEVICE_RELATIONS
400 DEVICE_RELATION_TYPE Type;
401 } QueryDeviceRelations;
403 // Parameters for IRP_MN_QUERY_INTERFACE
406 CONST GUID *InterfaceType;
409 PINTERFACE Interface;
410 PVOID InterfaceSpecificData;
413 // Parameters for IRP_MN_QUERY_CAPABILITIES
416 PDEVICE_CAPABILITIES Capabilities;
417 } DeviceCapabilities;
419 // Parameters for IRP_MN_FILTER_RESOURCE_REQUIREMENTS
422 PIO_RESOURCE_REQUIREMENTS_LIST IoResourceRequirementList;
423 } FilterResourceRequirements;
425 // Parameters for IRP_MN_QUERY_ID
428 BUS_QUERY_ID_TYPE IdType;
431 // Parameters for IRP_MN_QUERY_DEVICE_TEXT
434 DEVICE_TEXT_TYPE DeviceTextType;
438 // Parameters for IRP_MN_DEVICE_USAGE_NOTIFICATION
443 DEVICE_USAGE_NOTIFICATION_TYPE Type;
446 // Parameters for IRP_MN_WAIT_WAKE
449 SYSTEM_POWER_STATE PowerState;
452 // Parameter for IRP_MN_POWER_SEQUENCE
455 PPOWER_SEQUENCE PowerSequence;
458 // Parameters for IRP_MN_SET_POWER and IRP_MN_QUERY_POWER
462 POWER_STATE_TYPE Type;
464 POWER_ACTION ShutdownType;
467 // Parameters for IRP_MN_START_DEVICE
470 PCM_RESOURCE_LIST AllocatedResources;
471 PCM_RESOURCE_LIST AllocatedResourcesTranslated;
474 /* Parameters for IRP_MN_SCSI_CLASS */
477 struct _SCSI_REQUEST_BLOCK *Srb;
480 //byte range file locking
483 PLARGE_INTEGER Length;
485 LARGE_INTEGER ByteOffset;
488 /* Paramters for other calls */
498 struct _DEVICE_OBJECT* DeviceObject;
499 struct _FILE_OBJECT* FileObject;
501 PIO_COMPLETION_ROUTINE CompletionRoutine;
502 PVOID CompletionContext;
504 } __attribute__((packed)) IO_STACK_LOCATION, *PIO_STACK_LOCATION;*/
506 typedef struct _IO_STACK_LOCATION {
513 PIO_SECURITY_CONTEXT SecurityContext;
515 USHORT POINTER_ALIGNMENT FileAttributes;
517 ULONG POINTER_ALIGNMENT EaLength;
521 ULONG POINTER_ALIGNMENT Key;
522 LARGE_INTEGER ByteOffset;
526 ULONG POINTER_ALIGNMENT Key;
527 LARGE_INTEGER ByteOffset;
531 FILE_INFORMATION_CLASS POINTER_ALIGNMENT FileInformationClass;
535 FILE_INFORMATION_CLASS POINTER_ALIGNMENT FileInformationClass;
536 struct _FILE_OBJECT* FileObject;
539 BOOLEAN ReplaceIfExists;
548 FS_INFORMATION_CLASS POINTER_ALIGNMENT FsInformationClass;
551 ULONG OutputBufferLength;
552 ULONG POINTER_ALIGNMENT InputBufferLength;
553 ULONG POINTER_ALIGNMENT IoControlCode;
554 PVOID Type3InputBuffer;
557 SECURITY_INFORMATION SecurityInformation;
558 ULONG POINTER_ALIGNMENT Length;
561 SECURITY_INFORMATION SecurityInformation;
562 PSECURITY_DESCRIPTOR SecurityDescriptor;
566 struct _DEVICE_OBJECT* DeviceObject;
570 struct _DEVICE_OBJECT* DeviceObject;
573 struct _SCSI_REQUEST_BLOCK *Srb;
576 DEVICE_RELATION_TYPE Type;
577 } QueryDeviceRelations;
579 CONST GUID *InterfaceType;
582 PINTERFACE Interface;
583 PVOID InterfaceSpecificData;
586 PDEVICE_CAPABILITIES Capabilities;
587 } DeviceCapabilities;
589 PIO_RESOURCE_REQUIREMENTS_LIST IoResourceRequirementList;
590 } FilterResourceRequirements;
595 ULONG POINTER_ALIGNMENT Length;
601 BUS_QUERY_ID_TYPE IdType;
604 DEVICE_TEXT_TYPE DeviceTextType;
605 LCID POINTER_ALIGNMENT LocaleId;
610 DEVICE_USAGE_NOTIFICATION_TYPE POINTER_ALIGNMENT Type;
613 SYSTEM_POWER_STATE PowerState;
616 PPOWER_SEQUENCE PowerSequence;
620 POWER_STATE_TYPE POINTER_ALIGNMENT Type;
621 POWER_STATE POINTER_ALIGNMENT State;
622 POWER_ACTION POINTER_ALIGNMENT ShutdownType;
625 PCM_RESOURCE_LIST AllocatedResources;
626 PCM_RESOURCE_LIST AllocatedResourcesTranslated;
629 ULONG_PTR ProviderId;
641 struct _DEVICE_OBJECT* DeviceObject;
642 struct _FILE_OBJECT* FileObject;
643 PIO_COMPLETION_ROUTINE CompletionRoutine;
645 } IO_STACK_LOCATION, *PIO_STACK_LOCATION;
648 // AG: The commented lines in this structure are due to PMAILSLOT_CREATE_PARAMETERS
649 // and PNAMED_PIPE_CREATE_PARAMETERS and PFILE_GET_QUOTA_INFORMATION not being
652 typedef struct _EXTENDED_IO_STACK_LOCATION {
654 /* Included for padding */
663 // PIO_SECURITY_CONTEXT SecurityContext;
666 // USHORT ShareAccess;
667 // PMAILSLOT_CREATE_PARAMETERS Parameters;
671 // PIO_SECURITY_CONTEXT SecurityContext;
674 // USHORT ShareAccess;
675 // PNAMED_PIPE_CREATE_PARAMETERS Parameters;
679 ULONG OutputBufferLength;
680 ULONG InputBufferLength;
682 PVOID Type3InputBuffer;
686 PLARGE_INTEGER Length;
688 LARGE_INTEGER ByteOffset;
693 ULONG CompletionFilter;
698 PUNICODE_STRING FileName;
699 FILE_INFORMATION_CLASS FileInformationClass;
713 // PFILE_GET_QUOTA_INFORMATION SidList;
714 // ULONG SidListLength;
727 FS_INFORMATION_CLASS FsInformationClass;
731 struct _DEVICE_OBJECT* DeviceObject;
732 struct _FILE_OBJECT* FileObject;
733 PIO_COMPLETION_ROUTINE CompletionRoutine;
736 } EXTENDED_IO_STACK_LOCATION, *PEXTENDED_IO_STACK_LOCATION;
740 typedef struct _IO_STATUS_BLOCK
744 } IO_STATUS_BLOCK, *PIO_STATUS_BLOCK;
748 * Driver entry point declaration
750 typedef NTSTATUS STDCALL_FUNC
751 (*PDRIVER_INITIALIZE)(struct _DRIVER_OBJECT* DriverObject,
752 PUNICODE_STRING RegistryPath);
755 * Driver cancel declaration
757 typedef NTSTATUS STDCALL_FUNC
758 (*PDRIVER_CANCEL)(struct _DEVICE_OBJECT* DeviceObject,
759 struct _IRP* RegistryPath);
762 typedef struct _SECTION_OBJECT_POINTERS
764 PVOID DataSectionObject;
765 PVOID SharedCacheMap;
766 PVOID ImageSectionObject;
767 } SECTION_OBJECT_POINTERS, *PSECTION_OBJECT_POINTERS;
769 typedef struct _IO_COMPLETION_CONTEXT
773 } IO_COMPLETION_CONTEXT, *PIO_COMPLETION_CONTEXT;
775 #define FO_FILE_OPEN 0x00000001
776 #define FO_SYNCHRONOUS_IO 0x00000002
777 #define FO_ALERTABLE_IO 0x00000004
778 #define FO_NO_INTERMEDIATE_BUFFERING 0x00000008
779 #define FO_WRITE_THROUGH 0x00000010
780 #define FO_SEQUENTIAL_ONLY 0x00000020
781 #define FO_CACHE_SUPPORTED 0x00000040
782 #define FO_NAMED_PIPE 0x00000080
783 #define FO_STREAM_FILE 0x00000100
784 #define FO_MAILSLOT 0x00000200
785 #define FO_GENERATE_AUDIT_ON_CLOSE 0x00000400
786 #define FO_DIRECT_DEVICE_OPEN 0x00000800
787 #define FO_FILE_MODIFIED 0x00001000
788 #define FO_FILE_SIZE_CHANGED 0x00002000
789 #define FO_CLEANUP_COMPLETE 0x00004000
790 #define FO_TEMPORARY_FILE 0x00008000
791 #define FO_DELETE_ON_CLOSE 0x00010000
792 #define FO_OPENED_CASE_SENSITIVE 0x00020000
793 #define FO_HANDLE_CREATED 0x00040000
794 #define FO_FILE_FAST_IO_READ 0x00080000
797 * ReactOS specific flags
799 #define FO_DIRECT_CACHE_READ 0x72000001
800 #define FO_DIRECT_CACHE_WRITE 0x72000002
801 #define FO_DIRECT_CACHE_PAGING_READ 0x72000004
802 #define FO_DIRECT_CACHE_PAGING_WRITE 0x72000008
803 #define FO_FCB_IS_VALID 0x72000010
805 typedef struct _FILE_OBJECT
809 struct _DEVICE_OBJECT* DeviceObject;
813 PSECTION_OBJECT_POINTERS SectionObjectPointer;
814 PVOID PrivateCacheMap;
815 NTSTATUS FinalStatus;
816 struct _FILE_OBJECT* RelatedFileObject;
817 BOOLEAN LockOperation;
818 BOOLEAN DeletePending;
821 BOOLEAN DeleteAccess;
824 BOOLEAN SharedDelete;
826 UNICODE_STRING FileName;
827 LARGE_INTEGER CurrentByteOffset;
833 PIO_COMPLETION_CONTEXT CompletionContext;
834 } FILE_OBJECT, *PFILE_OBJECT;
845 struct _IRP* MasterIrp;
849 LIST_ENTRY ThreadListEntry;
850 IO_STATUS_BLOCK IoStatus;
851 KPROCESSOR_MODE RequestorMode;
852 BOOLEAN PendingReturned;
854 CHAR CurrentLocation;
857 CCHAR ApcEnvironment;// CCHAR or PVOID?
858 UCHAR AllocationFlags;//UCHAR or ULONG?
859 PIO_STATUS_BLOCK UserIosb;
865 PIO_APC_ROUTINE UserApcRoutine;
866 PVOID UserApcContext;
867 } AsynchronousParameters;
868 LARGE_INTEGER AllocationSize;
870 PDRIVER_CANCEL CancelRoutine;
877 KDEVICE_QUEUE_ENTRY DeviceQueueEntry;
878 PVOID DriverContext[4];
880 struct _ETHREAD* Thread;
881 PCHAR AuxiliaryBuffer;
882 LIST_ENTRY ListEntry;
883 struct _IO_STACK_LOCATION* CurrentStackLocation;
884 PFILE_OBJECT OriginalFileObject;
889 IO_STACK_LOCATION Stack[1];
892 #define VPB_MOUNTED 0x00000001
893 #define VPB_LOCKED 0x00000002
894 #define VPB_PERSISTENT 0x00000004
895 #define VPB_REMOVE_PENDING 0x00000008
902 USHORT VolumeLabelLength;
903 struct _DEVICE_OBJECT* DeviceObject;
904 struct _DEVICE_OBJECT* RealDevice;
906 ULONG ReferenceCount;
907 WCHAR VolumeLabel[MAXIMUM_VOLUME_LABEL_LENGTH];
911 typedef struct _DEVICE_OBJECT
916 struct _DRIVER_OBJECT* DriverObject;
917 struct _DEVICE_OBJECT* NextDevice;
918 struct _DEVICE_OBJECT* AttachedDevice;
919 struct _IRP* CurrentIrp;
922 ULONG Characteristics;
924 PVOID DeviceExtension;
925 DEVICE_TYPE DeviceType;
930 WAIT_CONTEXT_BLOCK Wcb;
932 ULONG AlignmentRequirement;
933 KDEVICE_QUEUE DeviceQueue;
935 ULONG ActiveThreadCount;
936 PSECURITY_DESCRIPTOR SecurityDescriptor;
940 struct _DEVOBJ_EXTENSION* DeviceObjectExtension;
942 } DEVICE_OBJECT, *PDEVICE_OBJECT;
946 * Fast i/o routine type declaration
948 //typedef NTSTATUS (*PFAST_IO_DISPATCH)(struct _DEVICE_OBJECT*, IRP*);
949 //FIXME : this type is ok for read and write, but not for all routines
950 typedef BOOLEAN STDCALL_FUNC
951 (*PFAST_IO_ROUTINE)(IN struct _FILE_OBJECT *FileObject,
952 IN PLARGE_INTEGER FileOffset,
957 OUT PIO_STATUS_BLOCK IoStatus,
958 IN struct _DEVICE_OBJECT *DeviceObject);
960 typedef struct _FAST_IO_DISPATCH {
961 ULONG SizeOfFastIoDispatch;
962 PFAST_IO_ROUTINE FastIoCheckIfPossible;
963 PFAST_IO_ROUTINE FastIoRead;
964 PFAST_IO_ROUTINE FastIoWrite;
965 PFAST_IO_ROUTINE FastIoQueryBasicInfo;
966 PFAST_IO_ROUTINE FastIoQueryStandardInfo;
967 PFAST_IO_ROUTINE FastIoLock;
968 PFAST_IO_ROUTINE FastIoUnlockSingle;
969 PFAST_IO_ROUTINE FastIoUnlockAll;
970 PFAST_IO_ROUTINE FastIoUnlockAllByKey;
971 PFAST_IO_ROUTINE FastIoDeviceControl;
972 PFAST_IO_ROUTINE AcquireFileForNtCreateSection;
973 PFAST_IO_ROUTINE ReleaseFileForNtCreateSection;
974 PFAST_IO_ROUTINE FastIoDetachDevice;
975 PFAST_IO_ROUTINE FastIoQueryNetworkOpenInfo;
976 PFAST_IO_ROUTINE AcquireForModWrite;
977 PFAST_IO_ROUTINE MdlRead;
978 PFAST_IO_ROUTINE MdlReadComplete;
979 PFAST_IO_ROUTINE PrepareMdlWrite;
980 PFAST_IO_ROUTINE MdlWriteComplete;
981 PFAST_IO_ROUTINE FastIoReadCompressed;
982 PFAST_IO_ROUTINE FastIoWriteCompressed;
983 PFAST_IO_ROUTINE MdlReadCompleteCompressed;
984 PFAST_IO_ROUTINE MdlWriteCompleteCompressed;
985 PFAST_IO_ROUTINE FastIoQueryOpen;
986 PFAST_IO_ROUTINE ReleaseForModWrite;
987 PFAST_IO_ROUTINE AcquireForCcFlush;
988 PFAST_IO_ROUTINE ReleaseForCcFlush;
989 } FAST_IO_DISPATCH, *PFAST_IO_DISPATCH;
992 * Dispatch routine type declaration
994 typedef NTSTATUS STDCALL_FUNC
995 (*PDRIVER_DISPATCH)(IN struct _DEVICE_OBJECT *DeviceObject,
996 IN struct _IRP *Irp);
999 * StartIo routine type declaration
1001 typedef VOID STDCALL_FUNC
1002 (*PDRIVER_STARTIO)(IN PDEVICE_OBJECT DeviceObject,
1006 * Unload routine type declaration
1008 typedef VOID STDCALL_FUNC
1009 (*PDRIVER_UNLOAD)(IN struct _DRIVER_OBJECT *DriverObject);
1012 * AddDevice routine type declaration
1014 typedef NTSTATUS STDCALL_FUNC
1015 (*PDRIVER_ADD_DEVICE)(IN struct _DRIVER_OBJECT *DriverObject,
1016 IN struct _DEVICE_OBJECT *PhysicalDeviceObject);
1019 typedef struct _DRIVER_EXTENSION
1021 struct _DRIVER_OBJECT* DriverObject;
1022 PDRIVER_ADD_DEVICE AddDevice;
1024 UNICODE_STRING ServiceKeyName;
1025 } DRIVER_EXTENSION, *PDRIVER_EXTENSION;
1029 struct _FAST_IO_DISPATCH_TABLE
1032 PFAST_IO_DISPATCH Dispatch;
1034 } FAST_IO_DISPATCH_TABLE, * PFAST_IO_DISPATCH_TABLE;
1037 typedef struct _DRIVER_OBJECT
1041 PDEVICE_OBJECT DeviceObject;
1045 PVOID DriverSection;
1046 PDRIVER_EXTENSION DriverExtension;
1047 UNICODE_STRING DriverName;
1048 PUNICODE_STRING HardwareDatabase;
1050 PFAST_IO_DISPATCH_TABLE FastIoDispatch;
1052 PFAST_IO_DISPATCH FastIoDispatch;
1054 PDRIVER_INITIALIZE DriverInit;
1055 PDRIVER_STARTIO DriverStartIo;
1056 PDRIVER_UNLOAD DriverUnload;
1057 PDRIVER_DISPATCH MajorFunction[IRP_MJ_MAXIMUM_FUNCTION + 1];
1058 } DRIVER_OBJECT, *PDRIVER_OBJECT;
1061 typedef struct _CONFIGURATION_INFORMATION
1067 ULONG ScsiPortCount;
1069 ULONG ParallelCount;
1070 BOOLEAN AtDiskPrimaryAddressClaimed;
1071 BOOLEAN AtDiskSecondaryAddressClaimed;
1072 } CONFIGURATION_INFORMATION, *PCONFIGURATION_INFORMATION;
1074 typedef VOID STDCALL_FUNC
1075 (*PIO_DPC_ROUTINE)(PKDPC Dpc,
1076 PDEVICE_OBJECT DeviceObject,
1080 typedef VOID STDCALL_FUNC
1081 (*PIO_TIMER_ROUTINE)(PDEVICE_OBJECT DeviceObject,
1084 typedef struct _IO_WORKITEM *PIO_WORKITEM;
1085 typedef VOID (*PIO_WORKITEM_ROUTINE)(IN PDEVICE_OBJECT DeviceObject, IN PVOID Context);
1087 #if WINDOWS_STRUCTS_DOESNT_ALREADY_DEFINE_THIS
1088 typedef struct _PARTITION_INFORMATION
1090 LARGE_INTEGER StartingOffset;
1091 LARGE_INTEGER PartitionLength;
1092 ULONG HiddenSectors;
1093 ULONG PartitionNumber;
1094 UCHAR PartitionType;
1095 BOOLEAN BootIndicator;
1096 BOOLEAN RecognizedPartition;
1097 BOOLEAN RewritePartition;
1098 } PARTITION_INFORMATION, *PPARTITION_INFORMATION;
1101 typedef struct _DRIVER_LAYOUT_INFORMATION
1103 ULONG PartitionCount;
1105 PARTITION_INFORMATION PartitionEntry[1];
1106 } DRIVER_LAYOUT_INFORMATION, *PDRIVER_LAYOUT_INFORMATION;
1109 typedef IO_ALLOCATION_ACTION STDCALL_FUNC
1110 (*PDRIVER_CONTROL)(PDEVICE_OBJECT DeviceObject,
1112 PVOID MapRegisterBase,
1114 #if (_WIN32_WINNT >= 0x0400)
1115 typedef VOID STDCALL_FUNC
1116 (*PFSDNOTIFICATIONPROC)(IN PDEVICE_OBJECT PtrTargetFileSystemDeviceObject,
1117 IN BOOLEAN DriverActive);
1118 #endif // (_WIN32_WINNT >= 0x0400)
1121 typedef struct _IO_PIPE_CREATE_BUFFER
1123 BOOLEAN WriteModeMessage;
1124 BOOLEAN ReadModeMessage;
1125 BOOLEAN NonBlocking;
1128 ULONG OutBufferSize;
1129 LARGE_INTEGER TimeOut;
1130 } IO_PIPE_CREATE_BUFFER, *PIO_PIPE_CREATE_BUFFER;
1132 typedef struct _IO_MAILSLOT_CREATE_BUFFER
1134 ULONG Param; /* ?? */
1135 ULONG MaxMessageSize;
1136 LARGE_INTEGER TimeOut;
1137 } IO_MAILSLOT_CREATE_BUFFER, *PIO_MAILSLOT_CREATE_BUFFER;
1139 #endif /* __INCLUDE_DDK_IOTYPES_H */