[NDK]: Add all the definitions regarding VADs.
authorSir Richard <sir_richard@svn.reactos.org>
Thu, 22 Jul 2010 01:41:20 +0000 (01:41 +0000)
committerSir Richard <sir_richard@svn.reactos.org>
Thu, 22 Jul 2010 01:41:20 +0000 (01:41 +0000)
svn path=/trunk/; revision=48172

reactos/include/ndk/mmtypes.h

index 05f4cbe..bb545ad 100644 (file)
@@ -171,6 +171,21 @@ typedef enum _SECTION_INFORMATION_CLASS
     SectionImageInformation,
 } SECTION_INFORMATION_CLASS;
 
+//
+// Kinds of VADs
+//
+typedef enum _MI_VAD_TYPE
+{
+    VadNone,
+    VadDevicePhysicalMemory,
+    VadImageMap,
+    VadAwe,
+    VadWriteWatch,
+    VadLargePages,
+    VadRotatePhysical,
+    VadLargePageSection
+} MI_VAD_TYPE, *PMI_VAD_TYPE;
+
 #ifdef NTOS_MODE_USER
 
 //
@@ -614,6 +629,113 @@ typedef struct _MM_AVL_TABLE
     PVOID NodeFreeHint;
 } MM_AVL_TABLE, *PMM_AVL_TABLE;
 
+//
+// Virtual Adress List used in VADs
+//
+typedef struct _MMADDRESS_LIST
+{
+    ULONG StartVpn;
+    ULONG EndVpn;
+} MMADDRESS_LIST, *PMMADDRESS_LIST;
+
+//
+// Flags used in the VAD
+//
+typedef struct _MMVAD_FLAGS
+{
+    ULONG CommitCharge:19;
+    ULONG NoChange:1;
+    ULONG VadType:3;
+    ULONG MemCommit:1;
+    ULONG Protection:5;
+    ULONG Spare:2;
+    ULONG PrivateMemory:1;
+} MMVAD_FLAGS, *PMMVAD_FLAGS;
+
+//
+// Extended flags used in the VAD
+//
+typedef struct _MMVAD_FLAGS2
+{
+    ULONG FileOffset:24;
+    ULONG SecNoChange:1;
+    ULONG OneSecured:1;
+    ULONG MultipleSecured:1;
+    ULONG ReadOnly:1;
+    ULONG LongVad:1;
+    ULONG ExtendableFile:1;
+    ULONG Inherit:1;
+    ULONG CopyOnWrite:1;
+} MMVAD_FLAGS2, *PMMVAD_FLAGS2;
+
+//
+// Virtual Address Descriptor (VAD) Structure
+//
+typedef struct _MMVAD
+{
+    union
+    {
+        LONG_PTR Balance:2;
+        struct _MMVAD *Parent;
+    } u1;
+    struct _MMVAD *LeftChild;
+    struct _MMVAD *RightChild;
+    ULONG StartingVpn;
+    ULONG EndingVpn;
+    union
+    {
+        ULONG LongFlags;
+        MMVAD_FLAGS VadFlags;
+    } u;
+    PCONTROL_AREA ControlArea;
+    PMMPTE FirstPrototypePte;
+    PMMPTE LastContiguousPte;
+    union
+    {
+        ULONG LongFlags2;
+        MMVAD_FLAGS2 VadFlags2;
+    } u2;
+} MMVAD, *PMMVAD;
+
+//
+// Long VAD used in section and private allocations
+//
+typedef struct _MMVAD_LONG 
+{
+    union
+    {
+        LONG_PTR Balance:2;
+        PMMVAD Parent;
+    } u1;
+    PMMVAD LeftChild;
+    PMMVAD RightChild;
+    ULONG StartingVpn;
+    ULONG EndingVpn;
+    union
+    {
+        ULONG LongFlags;
+        MMVAD_FLAGS VadFlags;
+    } u;
+    PCONTROL_AREA ControlArea;
+    PMMPTE FirstPrototypePte;
+    PMMPTE LastContiguousPte;
+    union
+    {
+        ULONG LongFlags2;
+        MMVAD_FLAGS2 VadFlags2;
+    } u2;
+    union
+    {
+        LIST_ENTRY List;
+        MMADDRESS_LIST Secured;
+    } u3;
+    union
+    {
+        PVOID Banked;
+        PMMEXTEND_INFO ExtendedInfo;
+    } u4;
+} MMVAD_LONG, *PMMVAD_LONG;
+
 //
 // Actual Section Object
 //