[NTOSKRNL]
[reactos.git] / reactos / ntoskrnl / include / internal / mm.h
index f306da2..4cace38 100644 (file)
@@ -216,18 +216,9 @@ typedef struct _MM_SECTION_SEGMENT
 
 typedef struct _MM_IMAGE_SECTION_OBJECT
 {
-    ULONG_PTR ImageBase;
-    ULONG_PTR StackReserve;
-    ULONG_PTR StackCommit;
-    ULONG_PTR EntryPoint;
-    USHORT Subsystem;
-    USHORT ImageCharacteristics;
-    USHORT MinorSubsystemVersion;
-    USHORT MajorSubsystemVersion;
-    USHORT Machine;
-    BOOLEAN Executable;
+    SECTION_IMAGE_INFORMATION ImageInformation;
+    PVOID BasedAddress;
     ULONG NrSegments;
-    ULONG ImageSize;
     PMM_SECTION_SEGMENT Segments;
 } MM_IMAGE_SECTION_OBJECT, *PMM_IMAGE_SECTION_OBJECT;
 
@@ -257,7 +248,7 @@ typedef struct _MEMORY_AREA
     ULONG Protect;
     ULONG Flags;
     BOOLEAN DeleteInProgress;
-    ULONG PageOpCount;
+    ULONG Magic;
     PVOID Vad;
     union
     {
@@ -348,10 +339,13 @@ typedef struct _MMPFN
     union
     {
         PFN_NUMBER Flink;
-        ULONG WsIndex;                       // SavedSwapEntry
+        ULONG WsIndex;
         PKEVENT Event;
         NTSTATUS ReadStatus;
         SINGLE_LIST_ENTRY NextStackPfn;
+
+        // HACK for ROSPFN
+        SWAPENTRY SwapEntry;
     } u1;
     PMMPTE PteAddress;
     union
@@ -363,7 +357,7 @@ typedef struct _MMPFN
     {
         struct
         {
-            USHORT ReferenceCount;           // ReferenceCount
+            USHORT ReferenceCount;
             MMPFNENTRY e1;
         };
         struct
@@ -375,7 +369,10 @@ typedef struct _MMPFN
     union
     {
         MMPTE OriginalPte;
-        LONG AweReferenceCount;              // RmapListHead
+        LONG AweReferenceCount;
+
+        // HACK for ROSPFN
+        PMM_RMAP_ENTRY RmapListHead;
     };
     union
     {
@@ -496,6 +493,18 @@ MmIsSessionAddress(
     IN PVOID Address
 );
 
+ULONG
+NTAPI
+MmGetSessionId(
+    IN PEPROCESS Process
+);
+
+ULONG
+NTAPI
+MmGetSessionIdEx(
+    IN PEPROCESS Process
+);
+
 /* marea.c *******************************************************************/
 
 NTSTATUS
@@ -509,7 +518,7 @@ MmCreateMemoryArea(
     PMEMORY_AREA *Result,
     BOOLEAN FixedAddress,
     ULONG AllocationFlags,
-    PHYSICAL_ADDRESS BoundaryAddressMultiple OPTIONAL
+    ULONG AllocationGranularity
 );
 
 PMEMORY_AREA
@@ -580,6 +589,15 @@ MmMapMemoryArea(PVOID BaseAddress,
                 ULONG Consumer,
                 ULONG Protection);
 
+VOID
+NTAPI
+MiRosCheckMemoryAreas(
+   PMMSUPPORT AddressSpace);
+
+VOID
+NTAPI
+MiCheckAllProcessMemoryAreas(VOID);
+
 /* npool.c *******************************************************************/
 
 VOID
@@ -1278,15 +1296,6 @@ VOID
 NTAPI
 MmInitGlobalKernelPageDirectory(VOID);
 
-VOID
-NTAPI
-MmDisableVirtualMapping(
-    struct _EPROCESS *Process,
-    PVOID Address,
-    BOOLEAN* WasDirty,
-    PPFN_NUMBER Page
-);
-
 VOID
 NTAPI
 MmEnableVirtualMapping(
@@ -1294,11 +1303,6 @@ MmEnableVirtualMapping(
     PVOID Address
 );
 
-VOID
-NTAPI
-MmRawDeleteVirtualMapping(PVOID Address);
-
-
 VOID
 NTAPI
 MmGetPageFileMapping(
@@ -1533,6 +1537,12 @@ MmFindRegion(
 
 /* section.c *****************************************************************/
 
+VOID
+NTAPI
+MmGetImageInformation(
+    OUT PSECTION_IMAGE_INFORMATION ImageInformation
+);
+
 PFILE_OBJECT
 NTAPI
 MmGetFileObjectForSection(
@@ -1712,17 +1722,13 @@ VOID
 MmLockAddressSpace(PMMSUPPORT AddressSpace)
 {
     KeAcquireGuardedMutex(&CONTAINING_RECORD(AddressSpace, EPROCESS, Vm)->AddressCreationLock);
-    //ASSERT(Thread->OwnsProcessAddressSpaceExclusive == 0);
-    //Thread->OwnsProcessAddressSpaceExclusive = TRUE;
 }
 
 FORCEINLINE
 VOID
 MmUnlockAddressSpace(PMMSUPPORT AddressSpace)
 {
-    //ASSERT(Thread->OwnsProcessAddressSpaceExclusive == 1);
     KeReleaseGuardedMutex(&CONTAINING_RECORD(AddressSpace, EPROCESS, Vm)->AddressCreationLock);
-    //Thread->OwnsProcessAddressSpaceExclusive = 0;
 }
 
 FORCEINLINE
@@ -1746,3 +1752,46 @@ MmGetKernelAddressSpace(VOID)
 {
     return MmKernelAddressSpace;
 }
+
+
+/* expool.c ******************************************************************/
+
+VOID
+NTAPI
+ExpCheckPoolAllocation(
+    PVOID P,
+    POOL_TYPE PoolType,
+    ULONG Tag);
+
+
+/* session.c *****************************************************************/
+
+_IRQL_requires_max_(APC_LEVEL)
+NTSTATUS
+NTAPI
+MmAttachSession(
+    _Inout_ PVOID SessionEntry,
+    _Out_ PKAPC_STATE ApcState);
+
+_IRQL_requires_max_(APC_LEVEL)
+VOID
+NTAPI
+MmDetachSession(
+    _Inout_ PVOID SessionEntry,
+    _Out_ PKAPC_STATE ApcState);
+
+VOID
+NTAPI
+MmQuitNextSession(
+    _Inout_ PVOID SessionEntry);
+
+PVOID
+NTAPI
+MmGetSessionById(
+    _In_ ULONG SessionId);
+
+_IRQL_requires_max_(APC_LEVEL)
+VOID
+NTAPI
+MmSetSessionLocaleId(
+    _In_ LCID LocaleId);