Fix more wrong Mm definitions and constants and sync up with proper ones.
Modified: trunk/reactos/include/ddk/mmfuncs.h
Modified: trunk/reactos/include/ntos/zw.h
Modified: trunk/reactos/ntoskrnl/include/internal/mm.h
Modified: trunk/reactos/ntoskrnl/mm/section.c
Modified: trunk/reactos/ntoskrnl/mm/virtual.c

Modified: trunk/reactos/include/ddk/mmfuncs.h
--- trunk/reactos/include/ddk/mmfuncs.h	2005-01-02 05:36:43 UTC (rev 12714)
+++ trunk/reactos/include/ddk/mmfuncs.h	2005-01-02 07:04:56 UTC (rev 12715)
@@ -196,9 +196,9 @@
 BOOLEAN
 STDCALL
 MmForceSectionClosed (
-	DWORD	Unknown0,
-	DWORD	Unknown1
-	);
+    IN PSECTION_OBJECT_POINTERS SectionObjectPointer,
+    IN BOOLEAN                  DelayClose
+    );
 VOID
 STDCALL
 MmFreeContiguousMemory (
@@ -738,12 +738,12 @@
 	);
 
 VOID STDCALL
-ProbeForRead (IN PVOID Address,
+ProbeForRead (IN CONST VOID *Address,
 	      IN ULONG Length,
 	      IN ULONG Alignment);
 
 VOID STDCALL
-ProbeForWrite (IN PVOID Address,
+ProbeForWrite (IN CONST VOID *Address,
 	       IN ULONG Length,
 	       IN ULONG Alignment);
 

Modified: trunk/reactos/include/ntos/zw.h
--- trunk/reactos/include/ntos/zw.h	2005-01-02 05:36:43 UTC (rev 12714)
+++ trunk/reactos/include/ntos/zw.h	2005-01-02 07:04:56 UTC (rev 12715)
@@ -6479,10 +6479,10 @@
 
 typedef struct _SECTION_IMAGE_INFORMATION
 {
-  ULONG EntryPoint;
+  ULONG_PTR EntryPoint;
   ULONG Unknown1;
-  ULONG StackReserve;
-  ULONG StackCommit;
+  ULONG_PTR StackReserve;
+  ULONG_PTR StackCommit;
   ULONG Subsystem;
   USHORT MinorSubsystemVersion;
   USHORT MajorSubsystemVersion;

Modified: trunk/reactos/ntoskrnl/include/internal/mm.h
--- trunk/reactos/ntoskrnl/include/internal/mm.h	2005-01-02 05:36:43 UTC (rev 12714)
+++ trunk/reactos/ntoskrnl/include/internal/mm.h	2005-01-02 07:04:56 UTC (rev 12715)
@@ -126,7 +126,7 @@
   ULONG_PTR ImageBase;
   ULONG_PTR StackReserve;
   ULONG_PTR StackCommit;
-  ULONG EntryPoint;
+  ULONG_PTR EntryPoint;
   ULONG Subsystem;
   ULONG ImageCharacteristics;
   USHORT MinorSubsystemVersion;

Modified: trunk/reactos/ntoskrnl/mm/section.c
--- trunk/reactos/ntoskrnl/mm/section.c	2005-01-02 05:36:43 UTC (rev 12714)
+++ trunk/reactos/ntoskrnl/mm/section.c	2005-01-02 07:04:56 UTC (rev 12715)
@@ -16,7 +16,7 @@
  *  along with this program; if not, write to the Free Software
  *  Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
  */
-/* $Id: section.c,v 1.169 2004/12/30 08:05:11 hyperion Exp $
+/* $Id$
  *
  * PROJECT:         ReactOS kernel
  * FILE:            ntoskrnl/mm/section.c
@@ -329,7 +329,7 @@
       Page = PFN_FROM_SSE(Entry);
       FileObject = Section->FileObject;
       if (FileObject != NULL &&
-            !(Segment->Characteristics & IMAGE_SECTION_CHAR_SHARED))
+            !(Segment->Characteristics & IMAGE_SCN_MEM_SHARED))
       {
 
          if ((FileOffset % PAGE_SIZE) == 0 &&
@@ -352,7 +352,7 @@
       {
          if (!PageOut &&
                ((Segment->Flags & MM_PAGEFILE_SEGMENT) ||
-                (Segment->Characteristics & IMAGE_SECTION_CHAR_SHARED)))
+                (Segment->Characteristics & IMAGE_SCN_MEM_SHARED)))
          {
             /*
              * FIXME:
@@ -375,7 +375,7 @@
       else
       {
          if ((Segment->Flags & MM_PAGEFILE_SEGMENT) ||
-               (Segment->Characteristics & IMAGE_SECTION_CHAR_SHARED))
+               (Segment->Characteristics & IMAGE_SCN_MEM_SHARED))
          {
             if (!PageOut)
             {
@@ -416,7 +416,7 @@
 BOOL MiIsPageFromCache(PMEMORY_AREA MemoryArea,
                        ULONG SegOffset)
 {
-   if (!(MemoryArea->Data.SectionData.Segment->Characteristics & IMAGE_SECTION_CHAR_SHARED))
+   if (!(MemoryArea->Data.SectionData.Segment->Characteristics & IMAGE_SCN_MEM_SHARED))
    {
       PBCB Bcb;
       PCACHE_SEGMENT CacheSeg;
@@ -472,7 +472,7 @@
     */
    if ((FileOffset % PAGE_SIZE) == 0 &&
        (SegOffset + PAGE_SIZE <= RawLength || !IsImageSection) &&
-       !(MemoryArea->Data.SectionData.Segment->Characteristics & IMAGE_SECTION_CHAR_SHARED))
+       !(MemoryArea->Data.SectionData.Segment->Characteristics & IMAGE_SCN_MEM_SHARED))
    {
 
       /*
@@ -873,7 +873,7 @@
    /*
     * Map anonymous memory for BSS sections
     */
-   if (Segment->Characteristics & IMAGE_SECTION_CHAR_BSS)
+   if (Segment->Characteristics & IMAGE_SCN_LNK_OTHER)
    {
       MmUnlockSectionSegment(Segment);
       Status = MmRequestPageMemoryConsumer(MC_USER, FALSE, &Page);
@@ -1359,7 +1359,7 @@
    FileObject = Context.Section->FileObject;
    DirectMapped = FALSE;
    if (FileObject != NULL &&
-       !(Context.Segment->Characteristics & IMAGE_SECTION_CHAR_SHARED))
+       !(Context.Segment->Characteristics & IMAGE_SCN_MEM_SHARED))
    {
       Bcb = FileObject->SectionObjectPointer->SharedCacheMap;
 
@@ -1405,7 +1405,7 @@
     * Prepare the context structure for the rmap delete call.
     */
    Context.WasDirty = FALSE;
-   if (Context.Segment->Characteristics & IMAGE_SECTION_CHAR_BSS ||
+   if (Context.Segment->Characteristics & IMAGE_SCN_LNK_OTHER ||
          IS_SWAP_FROM_SSE(Entry) ||
          PFN_FROM_SSE(Entry) != Page)
    {
@@ -1441,7 +1441,7 @@
    if (!Context.Private && MmGetPageEntrySectionSegment(Context.Segment, Context.Offset) != 0)
    {
       if (!(Context.Segment->Flags & MM_PAGEFILE_SEGMENT) &&
-            !(Context.Segment->Characteristics & IMAGE_SECTION_CHAR_SHARED))
+            !(Context.Segment->Characteristics & IMAGE_SCN_MEM_SHARED))
       {
          KEBUGCHECK(0);
       }
@@ -1473,7 +1473,7 @@
          return(STATUS_SUCCESS);
       }
    }
-   else if (Context.Segment->Characteristics & IMAGE_SECTION_CHAR_SHARED)
+   else if (Context.Segment->Characteristics & IMAGE_SCN_MEM_SHARED)
    {
       if (Context.Private)
       {
@@ -1640,7 +1640,7 @@
    DPRINT("MM: Wrote section page 0x%.8X to swap!\n", Page << PAGE_SHIFT);
    MmSetSavedSwapEntryPage(Page, 0);
    if (Context.Segment->Flags & MM_PAGEFILE_SEGMENT ||
-         Context.Segment->Characteristics & IMAGE_SECTION_CHAR_SHARED)
+         Context.Segment->Characteristics & IMAGE_SCN_MEM_SHARED)
    {
       MmSetPageEntrySectionSegment(Context.Segment, Context.Offset, MAKE_SWAP_SSE(SwapEntry));
    }
@@ -1703,7 +1703,7 @@
    FileObject = Section->FileObject;
    DirectMapped = FALSE;
    if (FileObject != NULL &&
-         !(Segment->Characteristics & IMAGE_SECTION_CHAR_SHARED))
+         !(Segment->Characteristics & IMAGE_SCN_MEM_SHARED))
    {
       Bcb = FileObject->SectionObjectPointer->SharedCacheMap;
 
@@ -1747,7 +1747,7 @@
    /*
     * Check for a private (COWed) page.
     */
-   if (Segment->Characteristics & IMAGE_SECTION_CHAR_BSS ||
+   if (Segment->Characteristics & IMAGE_SCN_LNK_OTHER ||
          IS_SWAP_FROM_SSE(Entry) ||
          PFN_FROM_SSE(Entry) != Page)
    {
@@ -1860,7 +1860,7 @@
             Page = MmGetPfnForProcess(AddressSpace->Process, Address);
 
             Protect = PAGE_READONLY;
-            if (Segment->Characteristics & IMAGE_SECTION_CHAR_BSS ||
+            if (Segment->Characteristics & IMAGE_SCN_LNK_OTHER ||
                   IS_SWAP_FROM_SSE(Entry) ||
                   PFN_FROM_SSE(Entry) != Page)
             {
@@ -2025,12 +2025,12 @@
 
       for (i = 0; i < NrSegments; i++)
       {
-         if (SectionSegments[i].Characteristics & IMAGE_SECTION_CHAR_SHARED)
+         if (SectionSegments[i].Characteristics & IMAGE_SCN_MEM_SHARED)
          {
             MmLockSectionSegment(&SectionSegments[i]);
          }
          RefCount = InterlockedDecrementUL(&SectionSegments[i].ReferenceCount);
-         if (SectionSegments[i].Characteristics & IMAGE_SECTION_CHAR_SHARED)
+         if (SectionSegments[i].Characteristics & IMAGE_SCN_MEM_SHARED)
          {
             if (RefCount == 0)
             {
@@ -3776,7 +3776,7 @@
        * and calculate the image base address */
       for (i = 0; i < NrSegments; i++)
       {
-         if (!(SectionSegments[i].Characteristics & IMAGE_SECTION_NOLOAD))
+         if (!(SectionSegments[i].Characteristics & IMAGE_SCN_TYPE_NOLOAD))
          {
             if (Segment == &SectionSegments[i])
             {
@@ -3792,7 +3792,7 @@
 
       for (i = 0; i < NrSegments; i++)
       {
-         if (!(SectionSegments[i].Characteristics & IMAGE_SECTION_NOLOAD))
+         if (!(SectionSegments[i].Characteristics & IMAGE_SCN_TYPE_NOLOAD))
          {
             PVOID SBaseAddress = (PVOID)
                                  ((char*)ImageBaseAddress + (ULONG_PTR)SectionSegments[i].VirtualAddress);
@@ -4197,7 +4197,7 @@
       ImageSize = 0;
       for (i = 0; i < NrSegments; i++)
       {
-         if (!(SectionSegments[i].Characteristics & IMAGE_SECTION_NOLOAD))
+         if (!(SectionSegments[i].Characteristics & IMAGE_SCN_TYPE_NOLOAD))
          {
             ULONG MaxExtent;
             MaxExtent = (ULONG)((char*)SectionSegments[i].VirtualAddress +
@@ -4227,7 +4227,7 @@
 
       for (i = 0; i < NrSegments; i++)
       {
-         if (!(SectionSegments[i].Characteristics & IMAGE_SECTION_NOLOAD))
+         if (!(SectionSegments[i].Characteristics & IMAGE_SCN_TYPE_NOLOAD))
          {
             PVOID SBaseAddress = (PVOID)
                                  ((char*)ImageBase + (ULONG_PTR)SectionSegments[i].VirtualAddress);
@@ -4357,8 +4357,9 @@
  * @unimplemented
  */
 BOOLEAN STDCALL
-MmForceSectionClosed (DWORD Unknown0,
-                      DWORD Unknown1)
+MmForceSectionClosed (
+    IN PSECTION_OBJECT_POINTERS SectionObjectPointer,
+    IN BOOLEAN                  DelayClose)
 {
    UNIMPLEMENTED;
    return (FALSE);

Modified: trunk/reactos/ntoskrnl/mm/virtual.c
--- trunk/reactos/ntoskrnl/mm/virtual.c	2005-01-02 05:36:43 UTC (rev 12714)
+++ trunk/reactos/ntoskrnl/mm/virtual.c	2005-01-02 07:04:56 UTC (rev 12715)
@@ -16,7 +16,7 @@
  *  along with this program; if not, write to the Free Software
  *  Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
  */
-/* $Id: virtual.c,v 1.87 2004/12/30 18:30:44 ion Exp $
+/* $Id$
  *
  * PROJECT:     ReactOS kernel
  * FILE:        ntoskrnl/mm/virtual.c
@@ -704,7 +704,7 @@
  * @implemented
  */
 VOID STDCALL
-ProbeForRead (IN PVOID Address,
+ProbeForRead (IN CONST VOID *Address,
               IN ULONG Length,
               IN ULONG Alignment)
 {
@@ -729,7 +729,7 @@
  * @implemented
  */
 VOID STDCALL
-ProbeForWrite (IN PVOID Address,
+ProbeForWrite (IN CONST VOID *Address,
                IN ULONG Length,
                IN ULONG Alignment)
 {