Author: tkreuzer
Date: Sun Apr  1 22:25:05 2012
New Revision: 56314

URL: http://svn.reactos.org/svn/reactos?rev=56314&view=rev
Log:
[NDK]
A number of fixes for Vista/Win7, now all C_ASSERTs pass

Modified:
    trunk/reactos/include/ndk/ketypes.h

Modified: trunk/reactos/include/ndk/ketypes.h
URL: 
http://svn.reactos.org/svn/reactos/trunk/reactos/include/ndk/ketypes.h?rev=56314&r1=56313&r2=56314&view=diff
==============================================================================
--- trunk/reactos/include/ndk/ketypes.h [iso-8859-1] (original)
+++ trunk/reactos/include/ndk/ketypes.h [iso-8859-1] Sun Apr  1 22:25:05 2012
@@ -682,6 +682,42 @@
     UCHAR Spare:2;
 } KEXECUTE_OPTIONS, *PKEXECUTE_OPTIONS;
 
+#if (NTDDI_VERSION >= NTDDI_WIN7)
+typedef union _KWAIT_STATUS_REGISTER
+{
+    UCHAR Flags;
+    struct
+    {
+        UCHAR State:2;
+        UCHAR Affinity:1;
+        UCHAR Priority:1;
+        UCHAR Apc:1;
+        UCHAR UserApc:1;
+        UCHAR Alert:1;
+        UCHAR Unused:1;
+    };
+} KWAIT_STATUS_REGISTER, *PKWAIT_STATUS_REGISTER;
+
+typedef struct _COUNTER_READING
+{
+    enum _HARDWARE_COUNTER_TYPE Type;
+    ULONG Index;
+    ULONG64 Start;
+    ULONG64 Total;
+}COUNTER_READING, *PCOUNTER_READING;
+
+typedef struct _KTHREAD_COUNTERS
+{
+    ULONG64 WaitReasonBitMap;
+    struct _THREAD_PERFORMANCE_DATA* UserData;
+    ULONG Flags;
+    ULONG ContextSwitches;
+    ULONG64 CycleTimeBias;
+    ULONG64 HardwareCounters;
+    COUNTER_READING HwCounter[16];
+}KTHREAD_COUNTERS, *PKTHREAD_COUNTERS;
+#endif
+
 //
 // Kernel Thread (KTHREAD)
 //
@@ -735,15 +771,20 @@
             UCHAR ApcStateFill[FIELD_OFFSET(KAPC_STATE, UserApcPending) + 1];
 #if (NTDDI_VERSION >= NTDDI_LONGHORN) // [
             SCHAR Priority;
+#if (NTDDI_VERSION >= NTDDI_WIN7) // [
+            /* On x86, the following members "fall out" of the union */
+            volatile ULONG NextProcessor;
+            volatile ULONG DeferredProcessor;
+#else // ][
+            /* On x86, the following members "fall out" of the union */
+            volatile USHORT NextProcessor;
+            volatile USHORT DeferredProcessor;
+#endif // ]
 #else // ][
             UCHAR ApcQueueable;
-#endif // ]
             /* On x86, the following members "fall out" of the union */
             volatile UCHAR NextProcessor;
-#if (NTDDI_VERSION < NTDDI_WIN7) // [
             volatile UCHAR DeferredProcessor;
-#endif // ]
-#if (NTDDI_VERSION < NTDDI_LONGHORN) // [
             UCHAR AdjustReason;
             SCHAR AdjustIncrement;
 #endif // ]
@@ -787,8 +828,10 @@
     BOOLEAN WaitNext;
 #endif // ]
     UCHAR WaitReason;
+#if (NTDDI_VERSION < NTDDI_LONGHORN)
     SCHAR Priority;
     BOOLEAN EnableStackSwap;
+#endif // ]
     volatile UCHAR SwapBusy;
     BOOLEAN Alerted[MaximumMode];
 #endif // ]
@@ -824,13 +867,14 @@
 #if !defined(_WIN64) // [
         };
     };
+#endif // ]
 #endif // ]
             union
             {
                 struct
                 {
-                    LONG AutoAlignment:1;
-                    LONG DisableBoost:1;
+                    ULONG AutoAlignment:1;
+                    ULONG DisableBoost:1;
 #if (NTDDI_VERSION >= NTDDI_LONGHORN) // [
                     ULONG EtwStackTraceApc1Inserted:1;
                     ULONG EtwStackTraceApc2Inserted:1;
@@ -846,9 +890,15 @@
                 };
                 LONG ThreadFlags;
             };
+#if defined(_WIN64) && (NTDDI_VERSION < NTDDI_WIN7) // [
+        };
+    };
+#endif // ]
+#if (NTDDI_VERSION >= NTDDI_WIN7) // [
 #if defined(_WIN64) // [
-        };
-    };
+    ULONG Spare0;
+#else // ][
+    PVOID ServiceTable;
 #endif // ]
 #endif // ]
     union
@@ -899,9 +949,21 @@
             UCHAR WaitBlockFill6[2 * sizeof(KWAIT_BLOCK) + 
FIELD_OFFSET(KWAIT_BLOCK, SpareLong)];
             ULONG WaitTime;
         };
-        struct
-        {
+#if (NTDDI_VERSION >= NTDDI_WIN7) // [
+        struct
+        {
+            UCHAR WaitBlockFill7[168];
+            PVOID TebMappedLowVa;
+            struct _UMS_CONTROL_BLOCK* Ucb;
+        };
+#endif // ]
+        struct
+        {
+#if (NTDDI_VERSION >= NTDDI_WIN7) // [
+            UCHAR WaitBlockFill8[188];
+#else // ][
             UCHAR WaitBlockFill7[3 * sizeof(KWAIT_BLOCK) + 
FIELD_OFFSET(KWAIT_BLOCK, SpareLong)];
+#endif // ]
             union
             {
                 struct
@@ -921,7 +983,7 @@
     union                                               // 2 elements, 0x8 
bytes (sizeof)
     {
         PVOID CallbackStack;
-        ULONG64 CallbackDepth;
+        ULONG_PTR CallbackDepth;
     };
 #else // ][
     PVOID CallbackStack;
@@ -949,24 +1011,30 @@
     BOOLEAN Preempted;
     UCHAR AdjustReason;
     CHAR AdjustIncrement;
-    UINT8 Spare01;
+#if (NTDDI_VERSION >= NTDDI_WIN7)
+    UCHAR PreviousMode;
+#else
+    UCHAR Spare01;
+#endif
 #endif // ]
     CHAR Saturation;
 #if (NTDDI_VERSION >= NTDDI_LONGHORN) // [
     ULONG SystemCallNumber;
 #if (NTDDI_VERSION >= NTDDI_WIN7) // [
-    ULONG2      FreezeCount;
-#else // ][
-    ULONG Spare2;
-#endif // ]
-#endif // ]
-    KAFFINITY UserAffinity;
+    ULONG FreezeCount;
+#else // ][
+    ULONG Spare02;
+#endif // ]
+#endif // ]
+#if (NTDDI_VERSION >= NTDDI_WIN7) // [
+    GROUP_AFFINITY UserAffinity;
     struct _KPROCESS *Process;
-#if (NTDDI_VERSION >= NTDDI_WIN7) // [
     GROUP_AFFINITY Affinity;
     ULONG IdealProcessor;
     ULONG UserIdealProcessor;
 #else // ][
+    KAFFINITY UserAffinity;
+    struct _KPROCESS *Process;
     KAFFINITY Affinity;
 #endif // ]
     PKAPC_STATE ApcStatePointer[2];
@@ -993,7 +1061,7 @@
 #endif // ]
 #if (NTDDI_VERSION >= NTDDI_WIN7) // [
 #elif (NTDDI_VERSION >= NTDDI_LONGHORN) // ][
-            UCHAR Spare3;
+            UCHAR Spare03;
 #else // ][
             UCHAR CalloutActive;
 #endif // ]
@@ -1096,7 +1164,7 @@
     PKTHREAD_COUNTERS ThreadCounters;
     PXSTATE_SAVE XStateSave;
 #elif (NTDDI_VERSION >= NTDDI_LONGHORN) // ][
-    PVOID MdlForLockedteb;
+    PVOID MdlForLockedTeb;
 #endif // ]
 } KTHREAD;
 
@@ -1159,9 +1227,9 @@
     };
     ULONG StackCount;
     LIST_ENTRY ProcessListEntry;
-#if (NTDDI_VERSION >= NTDDI_LONGHORN)
+#if (NTDDI_VERSION >= NTDDI_LONGHORN) // [
     ULONGLONG CycleTime;
-#endif
+#endif // ]
 } KPROCESS;
 
 #define ASSERT_PROCESS(object) \


Reply via email to