[SDK][NDK] Move SYSTEM_POWER_INFORMATION to ntpoapi.h (#869)
[reactos.git] / sdk / include / xdk / iotypes.h
index 20aaa54..8abcd02 100644 (file)
@@ -498,80 +498,6 @@ typedef struct _SHARE_ACCESS {
   ULONG SharedDelete;
 } SHARE_ACCESS, *PSHARE_ACCESS;
 
-/* While MS WDK uses inheritance in C++, we cannot do this with gcc, as
-   inheritance, even from a struct renders the type non-POD. So we use
-   this hack */
-#define PCI_COMMON_HEADER_LAYOUT                \
-  USHORT VendorID;                              \
-  USHORT DeviceID;                              \
-  USHORT Command;                               \
-  USHORT Status;                                \
-  UCHAR RevisionID;                             \
-  UCHAR ProgIf;                                 \
-  UCHAR SubClass;                               \
-  UCHAR BaseClass;                              \
-  UCHAR CacheLineSize;                          \
-  UCHAR LatencyTimer;                           \
-  UCHAR HeaderType;                             \
-  UCHAR BIST;                                   \
-  union {                                       \
-    struct _PCI_HEADER_TYPE_0 {                 \
-      ULONG BaseAddresses[PCI_TYPE0_ADDRESSES]; \
-      ULONG CIS;                                \
-      USHORT SubVendorID;                       \
-      USHORT SubSystemID;                       \
-      ULONG ROMBaseAddress;                     \
-      UCHAR CapabilitiesPtr;                    \
-      UCHAR Reserved1[3];                       \
-      ULONG Reserved2;                          \
-      UCHAR InterruptLine;                      \
-      UCHAR InterruptPin;                       \
-      UCHAR MinimumGrant;                       \
-      UCHAR MaximumLatency;                     \
-    } type0;                                    \
-    struct _PCI_HEADER_TYPE_1 {                 \
-      ULONG BaseAddresses[PCI_TYPE1_ADDRESSES]; \
-      UCHAR PrimaryBus;                         \
-      UCHAR SecondaryBus;                       \
-      UCHAR SubordinateBus;                     \
-      UCHAR SecondaryLatency;                   \
-      UCHAR IOBase;                             \
-      UCHAR IOLimit;                            \
-      USHORT SecondaryStatus;                   \
-      USHORT MemoryBase;                        \
-      USHORT MemoryLimit;                       \
-      USHORT PrefetchBase;                      \
-      USHORT PrefetchLimit;                     \
-      ULONG PrefetchBaseUpper32;                \
-      ULONG PrefetchLimitUpper32;               \
-      USHORT IOBaseUpper16;                     \
-      USHORT IOLimitUpper16;                    \
-      UCHAR CapabilitiesPtr;                    \
-      UCHAR Reserved1[3];                       \
-      ULONG ROMBaseAddress;                     \
-      UCHAR InterruptLine;                      \
-      UCHAR InterruptPin;                       \
-      USHORT BridgeControl;                     \
-    } type1;                                    \
-    struct _PCI_HEADER_TYPE_2 {                 \
-      ULONG SocketRegistersBaseAddress;         \
-      UCHAR CapabilitiesPtr;                    \
-      UCHAR Reserved;                           \
-      USHORT SecondaryStatus;                   \
-      UCHAR PrimaryBus;                         \
-      UCHAR SecondaryBus;                       \
-      UCHAR SubordinateBus;                     \
-      UCHAR SecondaryLatency;                   \
-      struct {                                  \
-        ULONG Base;                             \
-        ULONG Limit;                            \
-      } Range[PCI_TYPE2_ADDRESSES-1];           \
-      UCHAR InterruptLine;                      \
-      UCHAR InterruptPin;                       \
-      USHORT BridgeControl;                     \
-    } type2;                                    \
-  } u;
-
 typedef enum _CREATE_FILE_TYPE {
   CreateFileTypeNone,
   CreateFileTypeNamedPipe,
@@ -1346,6 +1272,11 @@ typedef enum _FILE_INFORMATION_CLASS {
   FileMaximumInformation
 } FILE_INFORMATION_CLASS, *PFILE_INFORMATION_CLASS;
 
+typedef enum _DIRECTORY_NOTIFY_INFORMATION_CLASS {
+  DirectoryNotifyInformation = 1,
+  DirectoryNotifyExtendedInformation
+} DIRECTORY_NOTIFY_INFORMATION_CLASS, *PDIRECTORY_NOTIFY_INFORMATION_CLASS;
+
 typedef struct _FILE_POSITION_INFORMATION {
   LARGE_INTEGER CurrentByteOffset;
 } FILE_POSITION_INFORMATION, *PFILE_POSITION_INFORMATION;
@@ -1836,7 +1767,7 @@ typedef struct _IO_COMPLETION_CONTEXT {
 #define VPB_RAW_MOUNT                     0x0010
 #define VPB_DIRECT_WRITES_ALLOWED         0x0020
 
-/* IRP.Flags */
+/* IO_STACK_LOCATION.Flags */
 
 #define SL_FORCE_ACCESS_CHECK             0x01
 #define SL_OPEN_PAGING_FILE               0x02
@@ -1876,6 +1807,8 @@ $if (_WDMDDK_ || _DEVIOCTL_)
 
 $endif (_WDMDDK_ || _DEVIOCTL_)
 $if (_WDMDDK_)
+
+/* IRP.Flags */
 #define IRP_NOCACHE                     0x00000001
 #define IRP_PAGING_IO                   0x00000002
 #define IRP_MOUNT_COMPLETION            0x00000002
@@ -1896,6 +1829,7 @@ $if (_WDMDDK_)
 #define IRP_RETRY_IO_COMPLETION         0x00004000
 #define IRP_CLASS_CACHE_OPERATION       0x00008000
 
+/* IRP.AllocationFlags */
 #define IRP_QUOTA_CHARGED                 0x01
 #define IRP_ALLOCATED_MUST_SUCCEED        0x02
 #define IRP_ALLOCATED_FIXED_SIZE          0x04
@@ -2044,6 +1978,13 @@ typedef struct _IO_ERROR_LOG_MESSAGE {
   IO_ERROR_LOG_PACKET EntryData;
 } IO_ERROR_LOG_MESSAGE, *PIO_ERROR_LOG_MESSAGE;
 
+/* See ndk/lpctypes.h */
+#ifdef _WIN64
+#define PORT_MAXIMUM_MESSAGE_LENGTH 512
+#else
+#define PORT_MAXIMUM_MESSAGE_LENGTH 256
+#endif
+
 #define ERROR_LOG_LIMIT_SIZE               240
 #define IO_ERROR_LOG_MESSAGE_HEADER_LENGTH (sizeof(IO_ERROR_LOG_MESSAGE) - \
                                             sizeof(IO_ERROR_LOG_PACKET) + \
@@ -2057,12 +1998,6 @@ typedef struct _IO_ERROR_LOG_MESSAGE {
 #define ERROR_LOG_MAXIMUM_SIZE (IO_ERROR_LOG_MESSAGE_LENGTH -                 \
                                 IO_ERROR_LOG_MESSAGE_HEADER_LENGTH)
 
-#ifdef _WIN64
-#define PORT_MAXIMUM_MESSAGE_LENGTH    512
-#else
-#define PORT_MAXIMUM_MESSAGE_LENGTH    256
-#endif
-
 typedef enum _DMA_WIDTH {
   Width8Bits,
   Width16Bits,
@@ -2209,13 +2144,23 @@ typedef VOID
 typedef DRIVER_UNLOAD *PDRIVER_UNLOAD;
 
 _Function_class_(DRIVER_DISPATCH)
-_IRQL_requires_(PASSIVE_LEVEL)
+_IRQL_requires_max_(DISPATCH_LEVEL)
 _IRQL_requires_same_
 typedef NTSTATUS
 (NTAPI DRIVER_DISPATCH)(
   _In_ struct _DEVICE_OBJECT *DeviceObject,
   _Inout_ struct _IRP *Irp);
 typedef DRIVER_DISPATCH *PDRIVER_DISPATCH;
+typedef DRIVER_DISPATCH DRIVER_DISPATCH_RAISED;
+
+_Function_class_(DRIVER_DISPATCH)
+_IRQL_requires_(PASSIVE_LEVEL)
+_IRQL_requires_same_
+typedef NTSTATUS
+(NTAPI DRIVER_DISPATCH_PAGED)(
+  _In_ struct _DEVICE_OBJECT *DeviceObject,
+  _Inout_ struct _IRP *Irp);
+typedef DRIVER_DISPATCH_PAGED *PDRIVER_DISPATCH_PAGED;
 
 typedef struct _DRIVER_OBJECT {
   CSHORT Type;
@@ -2801,9 +2746,10 @@ typedef struct _ACPI_INTERFACE_STANDARD2 {
   PUNREGISTER_FOR_DEVICE_NOTIFICATIONS2 UnregisterForDeviceNotifications;
 } ACPI_INTERFACE_STANDARD2, *PACPI_INTERFACE_STANDARD2;
 
-#if !defined(_AMD64_) && !defined(_IA64_)
+#if !defined(_AMD64_) && !defined(_ARM_)
 #include <pshpack4.h>
 #endif
+
 typedef struct _IO_STACK_LOCATION {
   UCHAR MajorFunction;
   UCHAR MinorFunction;
@@ -2817,6 +2763,20 @@ typedef struct _IO_STACK_LOCATION {
       USHORT ShareAccess;
       ULONG POINTER_ALIGNMENT EaLength;
     } Create;
+    struct {
+      struct _IO_SECURITY_CONTEXT *SecurityContext;
+      ULONG Options;
+      USHORT POINTER_ALIGNMENT Reserved;
+      USHORT ShareAccess;
+      struct _NAMED_PIPE_CREATE_PARAMETERS *Parameters;
+    } CreatePipe;
+    struct {
+      PIO_SECURITY_CONTEXT SecurityContext;
+      ULONG Options;
+      USHORT POINTER_ALIGNMENT Reserved;
+      USHORT ShareAccess;
+      struct _MAILSLOT_CREATE_PARAMETERS *Parameters;
+    } CreateMailslot;
     struct {
       ULONG Length;
       ULONG POINTER_ALIGNMENT Key;
@@ -2831,12 +2791,17 @@ typedef struct _IO_STACK_LOCATION {
       ULONG Length;
       PUNICODE_STRING FileName;
       FILE_INFORMATION_CLASS FileInformationClass;
-      ULONG FileIndex;
+      ULONG POINTER_ALIGNMENT FileIndex;
     } QueryDirectory;
     struct {
       ULONG Length;
-      ULONG CompletionFilter;
+      ULONG POINTER_ALIGNMENT CompletionFilter;
     } NotifyDirectory;
+    struct {
+      ULONG Length;
+      ULONG POINTER_ALIGNMENT CompletionFilter;
+      DIRECTORY_NOTIFY_INFORMATION_CLASS POINTER_ALIGNMENT DirectoryNotifyInformationClass;
+    } NotifyDirectoryEx;
     struct {
       ULONG Length;
       FILE_INFORMATION_CLASS POINTER_ALIGNMENT FileInformationClass;
@@ -2858,7 +2823,7 @@ typedef struct _IO_STACK_LOCATION {
       ULONG Length;
       PVOID EaList;
       ULONG EaListLength;
-      ULONG EaIndex;
+      ULONG POINTER_ALIGNMENT EaIndex;
     } QueryEa;
     struct {
       ULONG Length;
@@ -2869,17 +2834,17 @@ typedef struct _IO_STACK_LOCATION {
     } QueryVolume;
     struct {
       ULONG Length;
-      FS_INFORMATION_CLASS FsInformationClass;
+      FS_INFORMATION_CLASS POINTER_ALIGNMENT FsInformationClass;
     } SetVolume;
     struct {
       ULONG OutputBufferLength;
-      ULONG InputBufferLength;
-      ULONG FsControlCode;
+      ULONG POINTER_ALIGNMENT InputBufferLength;
+      ULONG POINTER_ALIGNMENT FsControlCode;
       PVOID Type3InputBuffer;
     } FileSystemControl;
     struct {
       PLARGE_INTEGER Length;
-      ULONG Key;
+      ULONG POINTER_ALIGNMENT Key;
       LARGE_INTEGER ByteOffset;
     } LockControl;
     struct {
@@ -2960,7 +2925,12 @@ typedef struct _IO_STACK_LOCATION {
       PPOWER_SEQUENCE PowerSequence;
     } PowerSequence;
     struct {
-      ULONG SystemContext;
+      union {
+        ULONG SystemContext;
+#if (NTDDI_VERSION >= NTDDI_VISTA)
+        SYSTEM_POWER_STATE_CONTEXT SystemPowerStateContext;
+#endif // (NTDDI_VERSION >= NTDDI_VISTA)
+      };
       POWER_STATE_TYPE POINTER_ALIGNMENT Type;
       POWER_STATE POINTER_ALIGNMENT State;
       POWER_ACTION POINTER_ALIGNMENT ShutdownType;
@@ -2987,10 +2957,12 @@ typedef struct _IO_STACK_LOCATION {
   PIO_COMPLETION_ROUTINE CompletionRoutine;
   PVOID Context;
 } IO_STACK_LOCATION, *PIO_STACK_LOCATION;
-#if !defined(_AMD64_) && !defined(_IA64_)
-#include <poppack.h>
+
+#if !defined(_AMD64_) && !defined(_ARM_)
+#include "poppack.h"
 #endif
 
+
 /* IO_STACK_LOCATION.Control */
 
 #define SL_PENDING_RETURNED               0x01
@@ -3056,6 +3028,7 @@ $if (_WDMDDK_)
 #define FILE_ATTRIBUTE_OFFLINE            0x00001000
 #define FILE_ATTRIBUTE_NOT_CONTENT_INDEXED 0x00002000
 #define FILE_ATTRIBUTE_ENCRYPTED          0x00004000
+#define FILE_ATTRIBUTE_INTEGRITY_STREAM   0x00008000
 #define FILE_ATTRIBUTE_VIRTUAL            0x00010000
 
 #define FILE_ATTRIBUTE_VALID_FLAGS        0x00007fb7
@@ -3171,6 +3144,80 @@ typedef struct _PCI_SLOT_NUMBER {
 #define PCI_TYPE1_ADDRESSES               2
 #define PCI_TYPE2_ADDRESSES               5
 
+/* While MS WDK uses inheritance in C++, we cannot do this with gcc, as
+   inheritance, even from a struct renders the type non-POD. So we use
+   this hack */
+#define PCI_COMMON_HEADER_LAYOUT                \
+  USHORT VendorID;                              \
+  USHORT DeviceID;                              \
+  USHORT Command;                               \
+  USHORT Status;                                \
+  UCHAR RevisionID;                             \
+  UCHAR ProgIf;                                 \
+  UCHAR SubClass;                               \
+  UCHAR BaseClass;                              \
+  UCHAR CacheLineSize;                          \
+  UCHAR LatencyTimer;                           \
+  UCHAR HeaderType;                             \
+  UCHAR BIST;                                   \
+  union {                                       \
+    struct _PCI_HEADER_TYPE_0 {                 \
+      ULONG BaseAddresses[PCI_TYPE0_ADDRESSES]; \
+      ULONG CIS;                                \
+      USHORT SubVendorID;                       \
+      USHORT SubSystemID;                       \
+      ULONG ROMBaseAddress;                     \
+      UCHAR CapabilitiesPtr;                    \
+      UCHAR Reserved1[3];                       \
+      ULONG Reserved2;                          \
+      UCHAR InterruptLine;                      \
+      UCHAR InterruptPin;                       \
+      UCHAR MinimumGrant;                       \
+      UCHAR MaximumLatency;                     \
+    } type0;                                    \
+    struct _PCI_HEADER_TYPE_1 {                 \
+      ULONG BaseAddresses[PCI_TYPE1_ADDRESSES]; \
+      UCHAR PrimaryBus;                         \
+      UCHAR SecondaryBus;                       \
+      UCHAR SubordinateBus;                     \
+      UCHAR SecondaryLatency;                   \
+      UCHAR IOBase;                             \
+      UCHAR IOLimit;                            \
+      USHORT SecondaryStatus;                   \
+      USHORT MemoryBase;                        \
+      USHORT MemoryLimit;                       \
+      USHORT PrefetchBase;                      \
+      USHORT PrefetchLimit;                     \
+      ULONG PrefetchBaseUpper32;                \
+      ULONG PrefetchLimitUpper32;               \
+      USHORT IOBaseUpper16;                     \
+      USHORT IOLimitUpper16;                    \
+      UCHAR CapabilitiesPtr;                    \
+      UCHAR Reserved1[3];                       \
+      ULONG ROMBaseAddress;                     \
+      UCHAR InterruptLine;                      \
+      UCHAR InterruptPin;                       \
+      USHORT BridgeControl;                     \
+    } type1;                                    \
+    struct _PCI_HEADER_TYPE_2 {                 \
+      ULONG SocketRegistersBaseAddress;         \
+      UCHAR CapabilitiesPtr;                    \
+      UCHAR Reserved;                           \
+      USHORT SecondaryStatus;                   \
+      UCHAR PrimaryBus;                         \
+      UCHAR SecondaryBus;                       \
+      UCHAR SubordinateBus;                     \
+      UCHAR SecondaryLatency;                   \
+      struct {                                  \
+        ULONG Base;                             \
+        ULONG Limit;                            \
+      } Range[PCI_TYPE2_ADDRESSES-1];           \
+      UCHAR InterruptLine;                      \
+      UCHAR InterruptPin;                       \
+      USHORT BridgeControl;                     \
+    } type2;                                    \
+  } u;
+
 typedef struct _PCI_COMMON_HEADER {
   PCI_COMMON_HEADER_LAYOUT
 } PCI_COMMON_HEADER, *PPCI_COMMON_HEADER;
@@ -5255,6 +5302,10 @@ $if (_NTIFS_)
 #define FILE_SUPPORTS_EXTENDED_ATTRIBUTES   0x00800000
 #define FILE_SUPPORTS_OPEN_BY_FILE_ID       0x01000000
 #define FILE_SUPPORTS_USN_JOURNAL           0x02000000
+#define FILE_SUPPORTS_INTEGRITY_STREAMS     0x04000000
+#define FILE_SUPPORTS_BLOCK_REFCOUNTING     0x08000000
+#define FILE_SUPPORTS_SPARSE_VDL            0x10000000
+#define FILE_DAX_VOLUME                     0x20000000
 
 #define FILE_NEED_EA                    0x00000080
 
@@ -5809,6 +5860,12 @@ typedef struct _CSV_NAMESPACE_INFO {
 
 #endif
 
+#if (_WIN32_WINNT >= 0x0603)
+
+#define FSCTL_DUPLICATE_EXTENTS_TO_FILE     CTL_CODE(FILE_DEVICE_FILE_SYSTEM, 209, METHOD_BUFFERED, FILE_WRITE_DATA)
+
+#endif
+
 #define FSCTL_MARK_AS_SYSTEM_HIVE           FSCTL_SET_BOOTLOADER_ACCESSED
 
 typedef struct _PATHNAME_BUFFER {