update for HEAD-2003091401
[reactos.git] / include / ddk / iotypes.h
index 81dbf8e..1c36c57 100644 (file)
@@ -5,6 +5,7 @@
 #ifndef __INCLUDE_DDK_IOTYPES_H
 #define __INCLUDE_DDK_IOTYPES_H
 
+#include <ntos/obtypes.h>
 #include <ntos/disk.h>
 #include <ntos/file.h>
 
@@ -22,6 +23,11 @@ extern POBJECT_TYPE IMPORTED IoDriverObjectType;
 extern POBJECT_TYPE IMPORTED IoFileObjectType;
 #endif
 
+
+/* from winddk.h */
+#define POINTER_ALIGNMENT
+
+
 /*
  * These are referenced before they can be fully defined
  */
@@ -38,6 +44,7 @@ enum
 {
    DeallocateObject,
    KeepObject,
+   DeallocateObjectKeepRegisters
 };
 
 
@@ -293,6 +300,8 @@ typedef struct
 /*
  * PURPOSE: IRP stack location
  */
+
+/*
 typedef struct __attribute__((packed)) _IO_STACK_LOCATION
 {
   UCHAR MajorFunction;
@@ -461,9 +470,9 @@ typedef struct __attribute__((packed)) _IO_STACK_LOCATION
          PCM_RESOURCE_LIST AllocatedResources;
          PCM_RESOURCE_LIST AllocatedResourcesTranslated;
        } StartDevice;
-
+*/
       /* Parameters for IRP_MN_SCSI_CLASS */
-      struct
+/*      struct
        {
          struct _SCSI_REQUEST_BLOCK *Srb;
        } Scsi;
@@ -475,9 +484,9 @@ typedef struct __attribute__((packed)) _IO_STACK_LOCATION
       ULONG Key;
       LARGE_INTEGER ByteOffset;
     } LockControl;
-
+*/
       /* Paramters for other calls */
-      struct
+/*      struct
        {
          PVOID Argument1;
          PVOID Argument2;
@@ -492,7 +501,240 @@ typedef struct __attribute__((packed)) _IO_STACK_LOCATION
   PIO_COMPLETION_ROUTINE CompletionRoutine;
   PVOID CompletionContext;
 
-} __attribute__((packed)) IO_STACK_LOCATION, *PIO_STACK_LOCATION;
+} __attribute__((packed)) IO_STACK_LOCATION, *PIO_STACK_LOCATION;*/
+
+typedef struct _IO_STACK_LOCATION {
+  UCHAR  MajorFunction;
+  UCHAR  MinorFunction;
+  UCHAR  Flags;
+  UCHAR  Control;
+  union {
+    struct {
+      PIO_SECURITY_CONTEXT  SecurityContext;
+      ULONG  Options;
+      USHORT POINTER_ALIGNMENT  FileAttributes;
+      USHORT  ShareAccess;
+      ULONG POINTER_ALIGNMENT  EaLength;
+    } Create;
+    struct {
+      ULONG  Length;
+      ULONG POINTER_ALIGNMENT  Key;
+      LARGE_INTEGER  ByteOffset;
+    } Read;
+    struct {
+      ULONG  Length;
+      ULONG POINTER_ALIGNMENT  Key;
+      LARGE_INTEGER  ByteOffset;
+    } Write;
+    struct {
+      ULONG  Length;
+      FILE_INFORMATION_CLASS POINTER_ALIGNMENT  FileInformationClass;
+    } QueryFile;
+    struct {
+      ULONG  Length;
+      FILE_INFORMATION_CLASS POINTER_ALIGNMENT  FileInformationClass;
+      struct _FILE_OBJECT*  FileObject;
+      union {
+        struct {
+          BOOLEAN  ReplaceIfExists;
+          BOOLEAN  AdvanceOnly;
+        };
+        ULONG  ClusterCount;
+        HANDLE  DeleteHandle;
+      };
+    } SetFile;
+    struct {
+      ULONG  Length;
+      FS_INFORMATION_CLASS POINTER_ALIGNMENT  FsInformationClass;
+    } QueryVolume;
+    struct {
+      ULONG  OutputBufferLength;
+      ULONG POINTER_ALIGNMENT  InputBufferLength;
+      ULONG POINTER_ALIGNMENT  IoControlCode;
+      PVOID  Type3InputBuffer;
+    } DeviceIoControl;
+    struct {
+      SECURITY_INFORMATION  SecurityInformation;
+      ULONG POINTER_ALIGNMENT  Length;
+    } QuerySecurity;
+    struct {
+      SECURITY_INFORMATION  SecurityInformation;
+      PSECURITY_DESCRIPTOR  SecurityDescriptor;
+    } SetSecurity;
+    struct {
+      struct _VPB*  Vpb;
+      struct _DEVICE_OBJECT*  DeviceObject;
+    } MountVolume;
+    struct {
+      struct _VPB*  Vpb;
+      struct _DEVICE_OBJECT*  DeviceObject;
+    } VerifyVolume;
+    struct {
+      struct _SCSI_REQUEST_BLOCK  *Srb;
+    } Scsi;
+    struct {
+      DEVICE_RELATION_TYPE  Type;
+    } QueryDeviceRelations;
+    struct {
+      CONST GUID  *InterfaceType;
+      USHORT  Size;
+      USHORT  Version;
+      PINTERFACE  Interface;
+      PVOID  InterfaceSpecificData;
+    } QueryInterface;
+    struct {
+      PDEVICE_CAPABILITIES  Capabilities;
+    } DeviceCapabilities;
+    struct {
+      PIO_RESOURCE_REQUIREMENTS_LIST  IoResourceRequirementList;
+    } FilterResourceRequirements;
+    struct {
+      ULONG  WhichSpace;
+      PVOID  Buffer;
+      ULONG  Offset;
+      ULONG POINTER_ALIGNMENT  Length;
+    } ReadWriteConfig;
+    struct {
+      BOOLEAN  Lock;
+    } SetLock;
+    struct {
+      BUS_QUERY_ID_TYPE  IdType;
+    } QueryId;
+    struct {
+      DEVICE_TEXT_TYPE  DeviceTextType;
+      LCID POINTER_ALIGNMENT  LocaleId;
+    } QueryDeviceText;
+    struct {
+      BOOLEAN  InPath;
+      BOOLEAN  Reserved[3];
+      DEVICE_USAGE_NOTIFICATION_TYPE POINTER_ALIGNMENT  Type;
+    } UsageNotification;
+    struct {
+      SYSTEM_POWER_STATE  PowerState;
+    } WaitWake;
+    struct {
+      PPOWER_SEQUENCE  PowerSequence;
+    } PowerSequence;
+    struct {
+      ULONG  SystemContext;
+      POWER_STATE_TYPE POINTER_ALIGNMENT  Type;
+      POWER_STATE POINTER_ALIGNMENT  State;
+      POWER_ACTION POINTER_ALIGNMENT  ShutdownType;
+    } Power;
+    struct {
+      PCM_RESOURCE_LIST  AllocatedResources;
+      PCM_RESOURCE_LIST  AllocatedResourcesTranslated;
+    } StartDevice;
+    struct {
+      ULONG_PTR  ProviderId;
+      PVOID  DataPath;
+      ULONG  BufferSize;
+      PVOID  Buffer;
+    } WMI;
+    struct {
+      PVOID  Argument1;
+      PVOID  Argument2;
+      PVOID  Argument3;
+      PVOID  Argument4;
+    } Others;
+  } Parameters;
+  struct _DEVICE_OBJECT*  DeviceObject;
+  struct _FILE_OBJECT*  FileObject;
+  PIO_COMPLETION_ROUTINE  CompletionRoutine;
+  PVOID  Context;
+} IO_STACK_LOCATION, *PIO_STACK_LOCATION;
+
+
+// AG: The commented lines in this structure are due to PMAILSLOT_CREATE_PARAMETERS
+// and PNAMED_PIPE_CREATE_PARAMETERS and PFILE_GET_QUOTA_INFORMATION not being
+// defined.
+
+typedef struct _EXTENDED_IO_STACK_LOCATION {
+
+    /* Included for padding */
+    UCHAR MajorFunction;
+    UCHAR MinorFunction;
+    UCHAR Flags;
+    UCHAR Control;
+
+    union {
+
+//       struct {
+//          PIO_SECURITY_CONTEXT              SecurityContext;
+//          ULONG                             Options;
+//          USHORT                            Reserved;
+//          USHORT                            ShareAccess;
+//          PMAILSLOT_CREATE_PARAMETERS       Parameters;
+//       } CreateMailslot;
+
+//        struct {
+//            PIO_SECURITY_CONTEXT            SecurityContext;
+//            ULONG                           Options;
+//            USHORT                          Reserved;
+//            USHORT                          ShareAccess;
+//            PNAMED_PIPE_CREATE_PARAMETERS   Parameters;
+//        } CreatePipe;
+
+        struct {
+            ULONG                           OutputBufferLength;
+            ULONG                           InputBufferLength;
+            ULONG                           FsControlCode;
+            PVOID                           Type3InputBuffer;
+        } FileSystemControl;
+
+        struct {
+            PLARGE_INTEGER                  Length;
+            ULONG                           Key;
+            LARGE_INTEGER                   ByteOffset;
+        } LockControl;
+
+        struct {
+            ULONG                           Length;
+            ULONG                           CompletionFilter;
+        } NotifyDirectory;
+
+        struct {
+            ULONG                           Length;
+            PUNICODE_STRING                 FileName;
+            FILE_INFORMATION_CLASS          FileInformationClass;
+            ULONG                           FileIndex;
+        } QueryDirectory;
+
+        struct {
+            ULONG                           Length;
+            PVOID                           EaList;
+            ULONG                           EaListLength;
+            ULONG                           EaIndex;
+        } QueryEa;
+
+//        struct {
+//            ULONG                           Length;
+//            PSID                            StartSid;
+//            PFILE_GET_QUOTA_INFORMATION     SidList;
+//            ULONG                           SidListLength;
+//        } QueryQuota;
+
+        struct {
+            ULONG                           Length;
+        } SetEa;
+
+        struct {
+            ULONG                           Length;
+        } SetQuota;
+
+        struct {
+            ULONG                           Length;
+            FS_INFORMATION_CLASS            FsInformationClass;
+        } SetVolume;
+
+    } Parameters;
+    struct _DEVICE_OBJECT*  DeviceObject;
+    struct _FILE_OBJECT*  FileObject;
+    PIO_COMPLETION_ROUTINE  CompletionRoutine;
+    PVOID  Context;
+
+} EXTENDED_IO_STACK_LOCATION, *PEXTENDED_IO_STACK_LOCATION;
+
 
 
 typedef struct _IO_STATUS_BLOCK
@@ -501,32 +743,6 @@ typedef struct _IO_STATUS_BLOCK
   ULONG Information;
 } IO_STATUS_BLOCK, *PIO_STATUS_BLOCK;
 
-typedef struct _IO_COMPLETION_PACKET{
-   ULONG             Key;
-   ULONG             Overlapped;
-   IO_STATUS_BLOCK   IoStatus;
-   LIST_ENTRY        ListEntry;
-} IO_COMPLETION_PACKET, *PIO_COMPLETION_PACKET;
-
-typedef struct _IO_PIPE_CREATE_BUFFER
-{
-   BOOLEAN WriteModeMessage;
-   BOOLEAN ReadModeMessage;
-   BOOLEAN NonBlocking;
-   ULONG MaxInstances;
-   ULONG InBufferSize;
-   ULONG OutBufferSize;
-   LARGE_INTEGER TimeOut;
-} IO_PIPE_CREATE_BUFFER, *PIO_PIPE_CREATE_BUFFER;
-
-
-typedef struct _IO_MAILSLOT_CREATE_BUFFER
-{
-   ULONG Param; /* ?? */
-   ULONG MaxMessageSize;
-   LARGE_INTEGER TimeOut;
-} IO_MAILSLOT_CREATE_BUFFER, *PIO_MAILSLOT_CREATE_BUFFER;
-
 
 /*
  * Driver entry point declaration
@@ -594,7 +810,7 @@ typedef struct _FILE_OBJECT
    struct _VPB* Vpb;
    PVOID FsContext;
    PVOID FsContext2;
-   PSECTION_OBJECT_POINTERS SectionObjectPointers;
+   PSECTION_OBJECT_POINTERS SectionObjectPointer;
    PVOID PrivateCacheMap;
    NTSTATUS FinalStatus;
    struct _FILE_OBJECT* RelatedFileObject;
@@ -846,7 +1062,7 @@ typedef struct _CONFIGURATION_INFORMATION
 {
    ULONG DiskCount;
    ULONG FloppyCount;
-   ULONG CDRomCount;
+   ULONG CdRomCount;
    ULONG TapeCount;
    ULONG ScsiPortCount;
    ULONG SerialCount;
@@ -901,4 +1117,23 @@ typedef VOID STDCALL_FUNC
                        IN BOOLEAN DriverActive);
 #endif // (_WIN32_WINNT >= 0x0400)
 
+
+typedef struct _IO_PIPE_CREATE_BUFFER
+{
+   BOOLEAN WriteModeMessage;
+   BOOLEAN ReadModeMessage;
+   BOOLEAN NonBlocking;
+   ULONG MaxInstances;
+   ULONG InBufferSize;
+   ULONG OutBufferSize;
+   LARGE_INTEGER TimeOut;
+} IO_PIPE_CREATE_BUFFER, *PIO_PIPE_CREATE_BUFFER;
+
+typedef struct _IO_MAILSLOT_CREATE_BUFFER
+{
+   ULONG Param; /* ?? */
+   ULONG MaxMessageSize;
+   LARGE_INTEGER TimeOut;
+} IO_MAILSLOT_CREATE_BUFFER, *PIO_MAILSLOT_CREATE_BUFFER;
+
 #endif /* __INCLUDE_DDK_IOTYPES_H */