Add many more structures to NDK which were incorrectly in the w32api IFS
Modified: trunk/reactos/include/ndk/extypes.h
Modified: trunk/reactos/include/ndk/ketypes.h
Modified: trunk/reactos/include/ndk/mmtypes.h
Modified: trunk/reactos/include/ndk/pstypes.h
Modified: trunk/reactos/include/ndk/setypes.h
Modified: trunk/reactos/w32api/include/ddk/ntifs.h

Modified: trunk/reactos/include/ndk/extypes.h
--- trunk/reactos/include/ndk/extypes.h	2005-06-25 17:01:17 UTC (rev 16268)
+++ trunk/reactos/include/ndk/extypes.h	2005-06-25 18:08:47 UTC (rev 16269)
@@ -19,7 +19,11 @@
 extern NTOSAPI POBJECT_TYPE ExTimerType;
 
 /* CONSTANTS *****************************************************************/
+
+/* FIXME: Win32k uses windows.h! */
+#ifndef __WIN32K__
 #define INVALID_HANDLE_VALUE (HANDLE)-1
+#endif
 
 /* Callback Object Access Rights */
 #define CALLBACK_ALL_ACCESS (STANDARD_RIGHTS_REQUIRED|SYNCHRONIZE|0x0001)
@@ -31,6 +35,11 @@
 
 /* TYPES *********************************************************************/
 
+/* You'll need the IFS for this, so use an equivalent version */
+#ifndef _NTIFS_
+typedef PVOID EX_RUNDOWN_REF;
+#endif
+
 /* You'll need the IFS for these, so let's not force everyone to have it */
 #ifdef _NTIFS_
 typedef struct _EX_QUEUE_WORKER_INFO 
@@ -52,6 +61,31 @@
 } EX_WORK_QUEUE, *PEX_WORK_QUEUE;
 #endif
 
+typedef struct _EX_FAST_REF
+{
+    union
+    {
+        PVOID Object;
+        ULONG RefCnt:3;
+        ULONG Value;
+    };
+} EX_FAST_REF, *PEX_FAST_REF;
+
+typedef struct _EX_PUSH_LOCK 
+{
+    union 
+    {
+        struct 
+        {
+            ULONG Waiting:1;
+            ULONG Exclusive:1;
+            ULONG Shared:30;
+        };
+        ULONG Value;
+        PVOID Ptr;
+    };
+} EX_PUSH_LOCK, *PEX_PUSH_LOCK;
+
 typedef struct _HANDLE_TABLE_ENTRY_INFO 
 {
     ULONG AuditMask;

Modified: trunk/reactos/include/ndk/ketypes.h
--- trunk/reactos/include/ndk/ketypes.h	2005-06-25 17:01:17 UTC (rev 16268)
+++ trunk/reactos/include/ndk/ketypes.h	2005-06-25 18:08:47 UTC (rev 16269)
@@ -63,6 +63,18 @@
     ULONG  DpcCount;
 } KDPC_DATA, *PKDPC_DATA;
 
+/* We don't want to force NTIFS usage only for a single structure */
+#ifndef _NTIFS_
+typedef struct _KAPC_STATE
+{
+    LIST_ENTRY  ApcListHead[2];
+    PKPROCESS   Process;
+    BOOLEAN     KernelApcInProgress;
+    BOOLEAN     KernelApcPending;
+    BOOLEAN     UserApcPending;
+} KAPC_STATE, *PKAPC_STATE, *RESTRICTED_POINTER PRKAPC_STATE;
+#endif
+
 /* FIXME: Most of these should go to i386 directory */
 typedef struct _FNSAVE_FORMAT 
 {
@@ -153,6 +165,8 @@
     USHORT Reserved9;
 } KTRAP_FRAME, *PKTRAP_FRAME;
 
+/* FIXME: Win32k uses windows.h! */
+#ifndef __WIN32K__
 typedef struct _LDT_ENTRY {
   WORD LimitLow;
   WORD BaseLow;
@@ -177,6 +191,7 @@
     } Bits;
   } HighWord;
 } LDT_ENTRY, *PLDT_ENTRY, *LPLDT_ENTRY;
+#endif
 
 typedef struct _KGDTENTRY
 {
@@ -661,7 +676,7 @@
    UCHAR             NpxIrql;             /* DA */
    UCHAR             Pad[1];              /* DB */
    PVOID             ServiceTable;        /* DC */
-   PKQUEUE           Queue;               /* E0 */
+   struct _KQUEUE    *Queue;              /* E0 */
    KSPIN_LOCK        ApcQueueLock;        /* E4 */
    KTIMER            Timer;               /* E8 */
    LIST_ENTRY        QueueListEntry;      /* 110 */

Modified: trunk/reactos/include/ndk/mmtypes.h
--- trunk/reactos/include/ndk/mmtypes.h	2005-06-25 17:01:17 UTC (rev 16268)
+++ trunk/reactos/include/ndk/mmtypes.h	2005-06-25 18:08:47 UTC (rev 16269)
@@ -30,6 +30,17 @@
 
 /* TYPES *********************************************************************/
 
+/* FIXME: Forced to do this for now, because of EPROCESS, will go away before 0.3.0 */
+typedef struct _MADDRESS_SPACE
+{
+    PVOID MemoryAreaRoot;
+    FAST_MUTEX Lock;
+    PVOID LowestAddress;
+    struct _EPROCESS* Process;
+    PUSHORT PageTableRefCountTable;
+    ULONG PageTableRefCountTableSize;
+} MADDRESS_SPACE, *PMADDRESS_SPACE;
+
 typedef struct _PP_LOOKASIDE_LIST 
 {
     struct _GENERAL_LOOKASIDE *P;
@@ -68,4 +79,83 @@
     PVOID NodeFreeHint;
 } MM_AVL_TABLE, *PMM_AVL_TABLE;
 
+typedef struct _MMWSLENTRY
+{
+    ULONG Valid:1;
+    ULONG LockedInWs:1;
+    ULONG LockedInMemory:1;
+    ULONG Protection:5;
+    ULONG Hashed:1;
+    ULONG Direct:1;
+    ULONG Age:2;
+    ULONG VirtualPageNumber:14;
+} MMWSLENTRY, *PMMWSLENTRY;
+
+typedef struct _MMWSLE
+{
+    union
+    {
+        PVOID VirtualAddress;
+        ULONG Long;
+        MMWSLENTRY e1;
+    };
+} MMWSLE, *PMMWSLE;
+
+typedef struct _MMWSLE_HASH
+{
+    PVOID Key;
+    ULONG Index;
+} MMWSLE_HASH, *PMMWSLE_HASH;
+
+typedef struct _MMWSL
+{
+    ULONG FirstFree;
+    ULONG FirstDynamic;
+    ULONG LastEntry;
+    ULONG NextSlot;
+    PMMWSLE Wsle;
+    ULONG LastInitializedWsle;
+    ULONG NonDirectcout;
+    PMMWSLE_HASH HashTable;
+    ULONG HashTableSize;
+    ULONG NumberOfCommittedPageTables;
+    PVOID HashTableStart;
+    PVOID HighestPermittedHashAddress;
+    ULONG NumberOfImageWaiters;
+    ULONG VadBitMapHint;
+    USHORT UsedPageTableEntries[768];
+    ULONG CommittedPageTables[24];
+} MMWSL, *PMMWSL;
+
+typedef struct _MMSUPPORT_FLAGS
+{
+    ULONG SessionSpace:1;
+    ULONG BeingTrimmed:1;
+    ULONG SessionLeader:1;
+    ULONG TrimHard:1;
+    ULONG WorkingSetHard:1;
+    ULONG AddressSpaceBeingDeleted :1;
+    ULONG Available:10;
+    ULONG AllowWorkingSetAdjustment:8;
+    ULONG MemoryPriority:8;
+} MMSUPPORT_FLAGS, *PMMSUPPORT_FLAGS;
+
+typedef struct _MMSUPPORT
+{
+    LARGE_INTEGER LastTrimTime;
+    MMSUPPORT_FLAGS Flags;
+    ULONG PageFaultCount;
+    ULONG PeakWorkingSetSize;
+    ULONG WorkingSetSize;
+    ULONG MinimumWorkingSetSize;
+    ULONG MaximumWorkingSetSize;
+    PMMWSL MmWorkingSetList;
+    LIST_ENTRY WorkingSetExpansionLinks;
+    ULONG Claim;
+    ULONG NextEstimationSlot;
+    ULONG NextAgingSlot;
+    ULONG EstimatedAvailable;
+    ULONG GrowthSinceLastEstimate;
+} MMSUPPORT, *PMMSUPPORT;
+
 #endif

Modified: trunk/reactos/include/ndk/pstypes.h
--- trunk/reactos/include/ndk/pstypes.h	2005-06-25 17:01:17 UTC (rev 16268)
+++ trunk/reactos/include/ndk/pstypes.h	2005-06-25 18:08:47 UTC (rev 16269)
@@ -95,8 +95,6 @@
 /* TYPES *********************************************************************/
 
 struct _ETHREAD;
-typedef struct _W32PROCESS *PW32PROCESS;
-typedef struct _W32THREAD *PW32THREAD;
 
 typedef struct _CURDIR 
 {
@@ -261,7 +259,42 @@
 #ifndef NTOS_MODE_USER
 
 #include "mmtypes.h"
-#include <internal/mm.h> /* FIXME: Forced to do this for now */
+#include "extypes.h"
+#include "setypes.h"
+
+typedef struct _EPROCESS_QUOTA_ENTRY
+{
+    ULONG Usage;
+    ULONG Limit;
+    ULONG Peak;
+    ULONG Return;
+} EPROCESS_QUOTA_ENTRY, *PEPROCESS_QUOTA_ENTRY;
+
+typedef struct _EPROCESS_QUOTA_BLOCK
+{
+    EPROCESS_QUOTA_ENTRY QuotaEntry[3];
+    LIST_ENTRY QuotaList;
+    ULONG ReferenceCount;
+    ULONG ProcessCount;
+} EPROCESS_QUOTA_BLOCK, *PEPROCESS_QUOTA_BLOCK;
+
+typedef struct _PAGEFAULT_HISTORY
+{
+    ULONG CurrentIndex;
+    ULONG MapIndex;
+    KSPIN_LOCK SpinLock;
+    PVOID Reserved;
+    PROCESS_WS_WATCH_INFORMATION WatchInfo[1];
+} PAGEFAULT_HISTORY, *PPAGEFAULT_HISTORY;
+
+typedef struct _PS_IMPERSONATION_INFORMATION
+{
+    PACCESS_TOKEN                   Token;
+    BOOLEAN                         CopyOnOpen;
+    BOOLEAN                         EffectiveOnly;
+    SECURITY_IMPERSONATION_LEVEL    ImpersonationLevel;
+} PS_IMPERSONATION_INFORMATION, *PPS_IMPERSONATION_INFORMATION;
+
 #include <pshpack4.h>
 /*
  * NAME:           ETHREAD

Modified: trunk/reactos/include/ndk/setypes.h
--- trunk/reactos/include/ndk/setypes.h	2005-06-25 17:01:17 UTC (rev 16268)
+++ trunk/reactos/include/ndk/setypes.h	2005-06-25 18:08:47 UTC (rev 16269)
@@ -88,4 +88,10 @@
     GENERIC_MAPPING GenericMapping;
     ULONG Reserved;
 } AUX_DATA, *PAUX_DATA;
+
+typedef struct _SE_AUDIT_PROCESS_CREATION_INFO
+{
+    POBJECT_NAME_INFORMATION ImageFileName;
+} SE_AUDIT_PROCESS_CREATION_INFO, *PSE_AUDIT_PROCESS_CREATION_INFO;
+
 #endif

Modified: trunk/reactos/w32api/include/ddk/ntifs.h
--- trunk/reactos/w32api/include/ddk/ntifs.h	2005-06-25 17:01:17 UTC (rev 16268)
+++ trunk/reactos/w32api/include/ddk/ntifs.h	2005-06-25 18:08:47 UTC (rev 16269)
@@ -521,16 +521,12 @@
 typedef PVOID OPLOCK, *POPLOCK;
 
 typedef struct _CACHE_MANAGER_CALLBACKS         *PCACHE_MANAGER_CALLBACKS;
-typedef struct _EPROCESS_QUOTA_BLOCK            *PEPROCESS_QUOTA_BLOCK;
 typedef struct _FILE_GET_QUOTA_INFORMATION      *PFILE_GET_QUOTA_INFORMATION;
 typedef struct _HANDLE_TABLE                    *PHANDLE_TABLE;
 typedef struct _KPROCESS                        *PKPROCESS;
 typedef struct _KQUEUE                          *PKQUEUE;
 typedef struct _KTRAP_FRAME                     *PKTRAP_FRAME;
-typedef struct _MMWSL                           *PMMWSL;
 typedef struct _OBJECT_DIRECTORY                *POBJECT_DIRECTORY;
-typedef struct _PAGEFAULT_HISTORY               *PPAGEFAULT_HISTORY;
-typedef struct _PS_IMPERSONATION_INFORMATION    *PPS_IMPERSONATION_INFORMATION;
 typedef struct _SECTION_OBJECT                  *PSECTION_OBJECT;
 typedef struct _SHARED_CACHE_MAP                *PSHARED_CACHE_MAP;
 typedef struct _VACB                            *PVACB;
@@ -590,89 +586,6 @@
     BOOLEAN     UserApcPending;
 } KAPC_STATE, *PKAPC_STATE, *RESTRICTED_POINTER PRKAPC_STATE;
 
-#if (VER_PRODUCTBUILD >= 2600)
-
-typedef struct _MMSUPPORT_FLAGS {
-    ULONG SessionSpace              : 1;
-    ULONG BeingTrimmed              : 1;
-    ULONG SessionLeader             : 1;
-    ULONG TrimHard                  : 1;
-    ULONG WorkingSetHard            : 1;
-    ULONG AddressSpaceBeingDeleted  : 1;
-    ULONG Available                 : 10;
-    ULONG AllowWorkingSetAdjustment : 8;
-    ULONG MemoryPriority            : 8;
-} MMSUPPORT_FLAGS, *PMMSUPPORT_FLAGS;
-
-#else
-
-typedef struct _MMSUPPORT_FLAGS {
-    ULONG SessionSpace      : 1;
-    ULONG BeingTrimmed      : 1;
-    ULONG ProcessInSession  : 1;
-    ULONG SessionLeader     : 1;
-    ULONG TrimHard          : 1;
-    ULONG WorkingSetHard    : 1;
-    ULONG WriteWatch        : 1;
-    ULONG Filler            : 25;
-} MMSUPPORT_FLAGS, *PMMSUPPORT_FLAGS;
-
-#endif
-
-#if (VER_PRODUCTBUILD >= 2600)
-
-typedef struct _MMSUPPORT {
-    LARGE_INTEGER   LastTrimTime;
-    MMSUPPORT_FLAGS Flags;
-    ULONG           PageFaultCount;
-    ULONG           PeakWorkingSetSize;
-    ULONG           WorkingSetSize;
-    ULONG           MinimumWorkingSetSize;
-    ULONG           MaximumWorkingSetSize;
-    PMMWSL          VmWorkingSetList;
-    LIST_ENTRY      WorkingSetExpansionLinks;
-    ULONG           Claim;
-    ULONG           NextEstimationSlot;
-    ULONG           NextAgingSlot;
-    ULONG           EstimatedAvailable;
-    ULONG           GrowthSinceLastEstimate;
-} MMSUPPORT, *PMMSUPPORT;
-
-#else
-
-typedef struct _MMSUPPORT {
-    LARGE_INTEGER   LastTrimTime;
-    ULONG           LastTrimFaultCount;
-    ULONG           PageFaultCount;
-    ULONG           PeakWorkingSetSize;
-    ULONG           WorkingSetSize;
-    ULONG           MinimumWorkingSetSize;
-    ULONG           MaximumWorkingSetSize;
-    PMMWSL          VmWorkingSetList;
-    LIST_ENTRY      WorkingSetExpansionLinks;
-    BOOLEAN         AllowWorkingSetAdjustment;
-    BOOLEAN         AddressSpaceBeingDeleted;
-    UCHAR           ForegroundSwitchCount;
-    UCHAR           MemoryPriority;
-#if (VER_PRODUCTBUILD >= 2195)
-    union {
-        ULONG           LongFlags;
-        MMSUPPORT_FLAGS Flags;
-    } u;
-    ULONG           Claim;
-    ULONG           NextEstimationSlot;
-    ULONG           NextAgingSlot;
-    ULONG           EstimatedAvailable;
-    ULONG           GrowthSinceLastEstimate;
-#endif /* (VER_PRODUCTBUILD >= 2195) */
-} MMSUPPORT, *PMMSUPPORT;
-
-#endif
-
-typedef struct _SE_AUDIT_PROCESS_CREATION_INFO {
-    POBJECT_NAME_INFORMATION ImageFileName;
-} SE_AUDIT_PROCESS_CREATION_INFO, *PSE_AUDIT_PROCESS_CREATION_INFO;
-
 typedef struct _BITMAP_RANGE {
     LIST_ENTRY      Links;
     LARGE_INTEGER   BasePage;
@@ -703,28 +616,6 @@
     ULONG   CompressedChunkSizes[ANYSIZE_ARRAY];
 } COMPRESSED_DATA_INFO, *PCOMPRESSED_DATA_INFO;
 
-#if (VER_PRODUCTBUILD >= 2600)
-
-typedef struct _EX_FAST_REF {
-    _ANONYMOUS_UNION union {
-        PVOID Object;
-        ULONG RefCnt : 3;
-        ULONG Value;
-    } DUMMYUNIONNAME;
-} EX_FAST_REF, *PEX_FAST_REF;
-
-typedef struct _EX_PUSH_LOCK {
-    _ANONYMOUS_UNION union {
-        _ANONYMOUS_STRUCT struct {
-            ULONG   Waiting     : 1;
-            ULONG   Exclusive   : 1;
-            ULONG   Shared      : 30;
-        } DUMMYSTRUCTNAME;
-        ULONG   Value;
-        PVOID   Ptr;
-    } DUMMYUNIONNAME;
-} EX_PUSH_LOCK, *PEX_PUSH_LOCK;
-
 #define EX_RUNDOWN_ACTIVE               0x1
 #define EX_RUNDOWN_COUNT_SHIFT          0x1
 #define EX_RUNDOWN_COUNT_INC            (1 << EX_RUNDOWN_COUNT_SHIFT)
@@ -736,22 +627,6 @@
     } DUMMYUNIONNAME;
 } EX_RUNDOWN_REF, *PEX_RUNDOWN_REF;
 
-#endif
-
-typedef struct _EPROCESS_QUOTA_ENTRY {
-    ULONG Usage;
-    ULONG Limit;
-    ULONG Peak;
-    ULONG Return;
-} EPROCESS_QUOTA_ENTRY, *PEPROCESS_QUOTA_ENTRY;
-
-typedef struct _EPROCESS_QUOTA_BLOCK {
-    EPROCESS_QUOTA_ENTRY    QuotaEntry[3];
-    LIST_ENTRY              QuotaList;
-    ULONG                   ReferenceCount;
-    ULONG                   ProcessCount;
-} EPROCESS_QUOTA_BLOCK, *PEPROCESS_QUOTA_BLOCK;
-
 typedef struct _FILE_ACCESS_INFORMATION {
     ACCESS_MASK AccessFlags;
 } FILE_ACCESS_INFORMATION, *PFILE_ACCESS_INFORMATION;
@@ -1391,13 +1266,6 @@
 
 #endif
 
-typedef struct _PS_IMPERSONATION_INFORMATION {
-    PACCESS_TOKEN                   Token;
-    BOOLEAN                         CopyOnOpen;
-    BOOLEAN                         EffectiveOnly;
-    SECURITY_IMPERSONATION_LEVEL    ImpersonationLevel;
-} PS_IMPERSONATION_INFORMATION, *PPS_IMPERSONATION_INFORMATION;
-
 typedef struct _PUBLIC_BCB {
     CSHORT          NodeTypeCode;
     CSHORT          NodeByteSize;
@@ -1490,54 +1358,6 @@
 
 } SE_EXPORTS, *PSE_EXPORTS;
 
-#if (VER_PRODUCTBUILD >= 2600)
-
-typedef struct _SHARED_CACHE_MAP {
-    CSHORT                      NodeTypeCode;
-    CSHORT                      NodeByteSize;
-    ULONG                       OpenCount;
-    LARGE_INTEGER               FileSize;
-    LIST_ENTRY                  BcbList;
-    LARGE_INTEGER               SectionSize;
-    LARGE_INTEGER               ValidDataLength;
-    LARGE_INTEGER               ValidDataGoal;
-    PVACB                       InitialVacbs[4];
-    PVACB                       *Vacbs;
-    PFILE_OBJECT                FileObject;
-    PVACB                       ActiveVacb;
-    PVOID                       NeedToZero;
-    ULONG                       ActivePage;
-    ULONG                       NeedToZeroPage;
-    KSPIN_LOCK                  ActiveVacbSpinLock;
-    ULONG                       VacbActiveCount;
-    ULONG                       DirtyPages;
-    LIST_ENTRY                  SharedCacheMapLinks;
-    ULONG                       Flags;
-    NTSTATUS                    Status;
-    PMBCB                       Mbcb;
-    PVOID                       Section;
-    PKEVENT                     CreateEvent;
-    PKEVENT                     WaitOnActiveCount;
-    ULONG                       PagesToWrite;
-    LONGLONG                    BeyondLastFlush;
-    PCACHE_MANAGER_CALLBACKS    Callbacks;
-    PVOID                       LazyWriteContext;
-    LIST_ENTRY                  PrivateList;
-    PVOID                       LogHandle;
-    PVOID                       FlushToLsnRoutine;
-    ULONG                       DirtyPageThreshold;
-    ULONG                       LazyWritePassCount;
-    PCACHE_UNINITIALIZE_EVENT   UninitializeEvent;
-    PVACB                       NeedToZeroVacb;
-    KSPIN_LOCK                  BcbSpinLock;
-    PVOID                       Reserved;
-    KEVENT                      Event;
-    EX_PUSH_LOCK                VacbPushLock;
-    PRIVATE_CACHE_MAP           PrivateCacheMap;
-} SHARED_CACHE_MAP, *PSHARED_CACHE_MAP;
-
-#endif
-
 typedef struct _STARTING_VCN_INPUT_BUFFER {
     LARGE_INTEGER StartingVcn;
 } STARTING_VCN_INPUT_BUFFER, *PSTARTING_VCN_INPUT_BUFFER;