mirror of
https://github.com/reactos/reactos.git
synced 2025-08-03 17:56:00 +00:00
Fix more wrong Mm definitions and constants and sync up with proper ones.
svn path=/trunk/; revision=12715
This commit is contained in:
parent
9b48875031
commit
d062e3d562
5 changed files with 36 additions and 35 deletions
|
@ -196,8 +196,8 @@ MmFlushImageSection (
|
||||||
BOOLEAN
|
BOOLEAN
|
||||||
STDCALL
|
STDCALL
|
||||||
MmForceSectionClosed (
|
MmForceSectionClosed (
|
||||||
DWORD Unknown0,
|
IN PSECTION_OBJECT_POINTERS SectionObjectPointer,
|
||||||
DWORD Unknown1
|
IN BOOLEAN DelayClose
|
||||||
);
|
);
|
||||||
VOID
|
VOID
|
||||||
STDCALL
|
STDCALL
|
||||||
|
@ -738,12 +738,12 @@ MmUnsecureVirtualMemory (
|
||||||
);
|
);
|
||||||
|
|
||||||
VOID STDCALL
|
VOID STDCALL
|
||||||
ProbeForRead (IN PVOID Address,
|
ProbeForRead (IN CONST VOID *Address,
|
||||||
IN ULONG Length,
|
IN ULONG Length,
|
||||||
IN ULONG Alignment);
|
IN ULONG Alignment);
|
||||||
|
|
||||||
VOID STDCALL
|
VOID STDCALL
|
||||||
ProbeForWrite (IN PVOID Address,
|
ProbeForWrite (IN CONST VOID *Address,
|
||||||
IN ULONG Length,
|
IN ULONG Length,
|
||||||
IN ULONG Alignment);
|
IN ULONG Alignment);
|
||||||
|
|
||||||
|
|
|
@ -6479,10 +6479,10 @@ ZwQuerySection(
|
||||||
|
|
||||||
typedef struct _SECTION_IMAGE_INFORMATION
|
typedef struct _SECTION_IMAGE_INFORMATION
|
||||||
{
|
{
|
||||||
ULONG EntryPoint;
|
ULONG_PTR EntryPoint;
|
||||||
ULONG Unknown1;
|
ULONG Unknown1;
|
||||||
ULONG StackReserve;
|
ULONG_PTR StackReserve;
|
||||||
ULONG StackCommit;
|
ULONG_PTR StackCommit;
|
||||||
ULONG Subsystem;
|
ULONG Subsystem;
|
||||||
USHORT MinorSubsystemVersion;
|
USHORT MinorSubsystemVersion;
|
||||||
USHORT MajorSubsystemVersion;
|
USHORT MajorSubsystemVersion;
|
||||||
|
|
|
@ -126,7 +126,7 @@ typedef struct _MM_IMAGE_SECTION_OBJECT
|
||||||
ULONG_PTR ImageBase;
|
ULONG_PTR ImageBase;
|
||||||
ULONG_PTR StackReserve;
|
ULONG_PTR StackReserve;
|
||||||
ULONG_PTR StackCommit;
|
ULONG_PTR StackCommit;
|
||||||
ULONG EntryPoint;
|
ULONG_PTR EntryPoint;
|
||||||
ULONG Subsystem;
|
ULONG Subsystem;
|
||||||
ULONG ImageCharacteristics;
|
ULONG ImageCharacteristics;
|
||||||
USHORT MinorSubsystemVersion;
|
USHORT MinorSubsystemVersion;
|
||||||
|
|
|
@ -16,7 +16,7 @@
|
||||||
* along with this program; if not, write to the Free Software
|
* along with this program; if not, write to the Free Software
|
||||||
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
* 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
|
* PROJECT: ReactOS kernel
|
||||||
* FILE: ntoskrnl/mm/section.c
|
* FILE: ntoskrnl/mm/section.c
|
||||||
|
@ -329,7 +329,7 @@ MmUnsharePageEntrySectionSegment(PSECTION_OBJECT Section,
|
||||||
Page = PFN_FROM_SSE(Entry);
|
Page = PFN_FROM_SSE(Entry);
|
||||||
FileObject = Section->FileObject;
|
FileObject = Section->FileObject;
|
||||||
if (FileObject != NULL &&
|
if (FileObject != NULL &&
|
||||||
!(Segment->Characteristics & IMAGE_SECTION_CHAR_SHARED))
|
!(Segment->Characteristics & IMAGE_SCN_MEM_SHARED))
|
||||||
{
|
{
|
||||||
|
|
||||||
if ((FileOffset % PAGE_SIZE) == 0 &&
|
if ((FileOffset % PAGE_SIZE) == 0 &&
|
||||||
|
@ -352,7 +352,7 @@ MmUnsharePageEntrySectionSegment(PSECTION_OBJECT Section,
|
||||||
{
|
{
|
||||||
if (!PageOut &&
|
if (!PageOut &&
|
||||||
((Segment->Flags & MM_PAGEFILE_SEGMENT) ||
|
((Segment->Flags & MM_PAGEFILE_SEGMENT) ||
|
||||||
(Segment->Characteristics & IMAGE_SECTION_CHAR_SHARED)))
|
(Segment->Characteristics & IMAGE_SCN_MEM_SHARED)))
|
||||||
{
|
{
|
||||||
/*
|
/*
|
||||||
* FIXME:
|
* FIXME:
|
||||||
|
@ -375,7 +375,7 @@ MmUnsharePageEntrySectionSegment(PSECTION_OBJECT Section,
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
if ((Segment->Flags & MM_PAGEFILE_SEGMENT) ||
|
if ((Segment->Flags & MM_PAGEFILE_SEGMENT) ||
|
||||||
(Segment->Characteristics & IMAGE_SECTION_CHAR_SHARED))
|
(Segment->Characteristics & IMAGE_SCN_MEM_SHARED))
|
||||||
{
|
{
|
||||||
if (!PageOut)
|
if (!PageOut)
|
||||||
{
|
{
|
||||||
|
@ -416,7 +416,7 @@ MmUnsharePageEntrySectionSegment(PSECTION_OBJECT Section,
|
||||||
BOOL MiIsPageFromCache(PMEMORY_AREA MemoryArea,
|
BOOL MiIsPageFromCache(PMEMORY_AREA MemoryArea,
|
||||||
ULONG SegOffset)
|
ULONG SegOffset)
|
||||||
{
|
{
|
||||||
if (!(MemoryArea->Data.SectionData.Segment->Characteristics & IMAGE_SECTION_CHAR_SHARED))
|
if (!(MemoryArea->Data.SectionData.Segment->Characteristics & IMAGE_SCN_MEM_SHARED))
|
||||||
{
|
{
|
||||||
PBCB Bcb;
|
PBCB Bcb;
|
||||||
PCACHE_SEGMENT CacheSeg;
|
PCACHE_SEGMENT CacheSeg;
|
||||||
|
@ -472,7 +472,7 @@ MiReadPage(PMEMORY_AREA MemoryArea,
|
||||||
*/
|
*/
|
||||||
if ((FileOffset % PAGE_SIZE) == 0 &&
|
if ((FileOffset % PAGE_SIZE) == 0 &&
|
||||||
(SegOffset + PAGE_SIZE <= RawLength || !IsImageSection) &&
|
(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 @@ MmNotPresentFaultSectionView(PMADDRESS_SPACE AddressSpace,
|
||||||
/*
|
/*
|
||||||
* Map anonymous memory for BSS sections
|
* Map anonymous memory for BSS sections
|
||||||
*/
|
*/
|
||||||
if (Segment->Characteristics & IMAGE_SECTION_CHAR_BSS)
|
if (Segment->Characteristics & IMAGE_SCN_LNK_OTHER)
|
||||||
{
|
{
|
||||||
MmUnlockSectionSegment(Segment);
|
MmUnlockSectionSegment(Segment);
|
||||||
Status = MmRequestPageMemoryConsumer(MC_USER, FALSE, &Page);
|
Status = MmRequestPageMemoryConsumer(MC_USER, FALSE, &Page);
|
||||||
|
@ -1359,7 +1359,7 @@ MmPageOutSectionView(PMADDRESS_SPACE AddressSpace,
|
||||||
FileObject = Context.Section->FileObject;
|
FileObject = Context.Section->FileObject;
|
||||||
DirectMapped = FALSE;
|
DirectMapped = FALSE;
|
||||||
if (FileObject != NULL &&
|
if (FileObject != NULL &&
|
||||||
!(Context.Segment->Characteristics & IMAGE_SECTION_CHAR_SHARED))
|
!(Context.Segment->Characteristics & IMAGE_SCN_MEM_SHARED))
|
||||||
{
|
{
|
||||||
Bcb = FileObject->SectionObjectPointer->SharedCacheMap;
|
Bcb = FileObject->SectionObjectPointer->SharedCacheMap;
|
||||||
|
|
||||||
|
@ -1405,7 +1405,7 @@ MmPageOutSectionView(PMADDRESS_SPACE AddressSpace,
|
||||||
* Prepare the context structure for the rmap delete call.
|
* Prepare the context structure for the rmap delete call.
|
||||||
*/
|
*/
|
||||||
Context.WasDirty = FALSE;
|
Context.WasDirty = FALSE;
|
||||||
if (Context.Segment->Characteristics & IMAGE_SECTION_CHAR_BSS ||
|
if (Context.Segment->Characteristics & IMAGE_SCN_LNK_OTHER ||
|
||||||
IS_SWAP_FROM_SSE(Entry) ||
|
IS_SWAP_FROM_SSE(Entry) ||
|
||||||
PFN_FROM_SSE(Entry) != Page)
|
PFN_FROM_SSE(Entry) != Page)
|
||||||
{
|
{
|
||||||
|
@ -1441,7 +1441,7 @@ MmPageOutSectionView(PMADDRESS_SPACE AddressSpace,
|
||||||
if (!Context.Private && MmGetPageEntrySectionSegment(Context.Segment, Context.Offset) != 0)
|
if (!Context.Private && MmGetPageEntrySectionSegment(Context.Segment, Context.Offset) != 0)
|
||||||
{
|
{
|
||||||
if (!(Context.Segment->Flags & MM_PAGEFILE_SEGMENT) &&
|
if (!(Context.Segment->Flags & MM_PAGEFILE_SEGMENT) &&
|
||||||
!(Context.Segment->Characteristics & IMAGE_SECTION_CHAR_SHARED))
|
!(Context.Segment->Characteristics & IMAGE_SCN_MEM_SHARED))
|
||||||
{
|
{
|
||||||
KEBUGCHECK(0);
|
KEBUGCHECK(0);
|
||||||
}
|
}
|
||||||
|
@ -1473,7 +1473,7 @@ MmPageOutSectionView(PMADDRESS_SPACE AddressSpace,
|
||||||
return(STATUS_SUCCESS);
|
return(STATUS_SUCCESS);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else if (Context.Segment->Characteristics & IMAGE_SECTION_CHAR_SHARED)
|
else if (Context.Segment->Characteristics & IMAGE_SCN_MEM_SHARED)
|
||||||
{
|
{
|
||||||
if (Context.Private)
|
if (Context.Private)
|
||||||
{
|
{
|
||||||
|
@ -1640,7 +1640,7 @@ MmPageOutSectionView(PMADDRESS_SPACE AddressSpace,
|
||||||
DPRINT("MM: Wrote section page 0x%.8X to swap!\n", Page << PAGE_SHIFT);
|
DPRINT("MM: Wrote section page 0x%.8X to swap!\n", Page << PAGE_SHIFT);
|
||||||
MmSetSavedSwapEntryPage(Page, 0);
|
MmSetSavedSwapEntryPage(Page, 0);
|
||||||
if (Context.Segment->Flags & MM_PAGEFILE_SEGMENT ||
|
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));
|
MmSetPageEntrySectionSegment(Context.Segment, Context.Offset, MAKE_SWAP_SSE(SwapEntry));
|
||||||
}
|
}
|
||||||
|
@ -1703,7 +1703,7 @@ MmWritePageSectionView(PMADDRESS_SPACE AddressSpace,
|
||||||
FileObject = Section->FileObject;
|
FileObject = Section->FileObject;
|
||||||
DirectMapped = FALSE;
|
DirectMapped = FALSE;
|
||||||
if (FileObject != NULL &&
|
if (FileObject != NULL &&
|
||||||
!(Segment->Characteristics & IMAGE_SECTION_CHAR_SHARED))
|
!(Segment->Characteristics & IMAGE_SCN_MEM_SHARED))
|
||||||
{
|
{
|
||||||
Bcb = FileObject->SectionObjectPointer->SharedCacheMap;
|
Bcb = FileObject->SectionObjectPointer->SharedCacheMap;
|
||||||
|
|
||||||
|
@ -1747,7 +1747,7 @@ MmWritePageSectionView(PMADDRESS_SPACE AddressSpace,
|
||||||
/*
|
/*
|
||||||
* Check for a private (COWed) page.
|
* 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) ||
|
IS_SWAP_FROM_SSE(Entry) ||
|
||||||
PFN_FROM_SSE(Entry) != Page)
|
PFN_FROM_SSE(Entry) != Page)
|
||||||
{
|
{
|
||||||
|
@ -1860,7 +1860,7 @@ MmAlterViewAttributes(PMADDRESS_SPACE AddressSpace,
|
||||||
Page = MmGetPfnForProcess(AddressSpace->Process, Address);
|
Page = MmGetPfnForProcess(AddressSpace->Process, Address);
|
||||||
|
|
||||||
Protect = PAGE_READONLY;
|
Protect = PAGE_READONLY;
|
||||||
if (Segment->Characteristics & IMAGE_SECTION_CHAR_BSS ||
|
if (Segment->Characteristics & IMAGE_SCN_LNK_OTHER ||
|
||||||
IS_SWAP_FROM_SSE(Entry) ||
|
IS_SWAP_FROM_SSE(Entry) ||
|
||||||
PFN_FROM_SSE(Entry) != Page)
|
PFN_FROM_SSE(Entry) != Page)
|
||||||
{
|
{
|
||||||
|
@ -2025,12 +2025,12 @@ MmpDeleteSection(PVOID ObjectBody)
|
||||||
|
|
||||||
for (i = 0; i < NrSegments; i++)
|
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]);
|
MmLockSectionSegment(&SectionSegments[i]);
|
||||||
}
|
}
|
||||||
RefCount = InterlockedDecrementUL(&SectionSegments[i].ReferenceCount);
|
RefCount = InterlockedDecrementUL(&SectionSegments[i].ReferenceCount);
|
||||||
if (SectionSegments[i].Characteristics & IMAGE_SECTION_CHAR_SHARED)
|
if (SectionSegments[i].Characteristics & IMAGE_SCN_MEM_SHARED)
|
||||||
{
|
{
|
||||||
if (RefCount == 0)
|
if (RefCount == 0)
|
||||||
{
|
{
|
||||||
|
@ -3776,7 +3776,7 @@ MmUnmapViewOfSection(PEPROCESS Process,
|
||||||
* and calculate the image base address */
|
* and calculate the image base address */
|
||||||
for (i = 0; i < NrSegments; i++)
|
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])
|
if (Segment == &SectionSegments[i])
|
||||||
{
|
{
|
||||||
|
@ -3792,7 +3792,7 @@ MmUnmapViewOfSection(PEPROCESS Process,
|
||||||
|
|
||||||
for (i = 0; i < NrSegments; i++)
|
for (i = 0; i < NrSegments; i++)
|
||||||
{
|
{
|
||||||
if (!(SectionSegments[i].Characteristics & IMAGE_SECTION_NOLOAD))
|
if (!(SectionSegments[i].Characteristics & IMAGE_SCN_TYPE_NOLOAD))
|
||||||
{
|
{
|
||||||
PVOID SBaseAddress = (PVOID)
|
PVOID SBaseAddress = (PVOID)
|
||||||
((char*)ImageBaseAddress + (ULONG_PTR)SectionSegments[i].VirtualAddress);
|
((char*)ImageBaseAddress + (ULONG_PTR)SectionSegments[i].VirtualAddress);
|
||||||
|
@ -4197,7 +4197,7 @@ MmMapViewOfSection(IN PVOID SectionObject,
|
||||||
ImageSize = 0;
|
ImageSize = 0;
|
||||||
for (i = 0; i < NrSegments; i++)
|
for (i = 0; i < NrSegments; i++)
|
||||||
{
|
{
|
||||||
if (!(SectionSegments[i].Characteristics & IMAGE_SECTION_NOLOAD))
|
if (!(SectionSegments[i].Characteristics & IMAGE_SCN_TYPE_NOLOAD))
|
||||||
{
|
{
|
||||||
ULONG MaxExtent;
|
ULONG MaxExtent;
|
||||||
MaxExtent = (ULONG)((char*)SectionSegments[i].VirtualAddress +
|
MaxExtent = (ULONG)((char*)SectionSegments[i].VirtualAddress +
|
||||||
|
@ -4227,7 +4227,7 @@ MmMapViewOfSection(IN PVOID SectionObject,
|
||||||
|
|
||||||
for (i = 0; i < NrSegments; i++)
|
for (i = 0; i < NrSegments; i++)
|
||||||
{
|
{
|
||||||
if (!(SectionSegments[i].Characteristics & IMAGE_SECTION_NOLOAD))
|
if (!(SectionSegments[i].Characteristics & IMAGE_SCN_TYPE_NOLOAD))
|
||||||
{
|
{
|
||||||
PVOID SBaseAddress = (PVOID)
|
PVOID SBaseAddress = (PVOID)
|
||||||
((char*)ImageBase + (ULONG_PTR)SectionSegments[i].VirtualAddress);
|
((char*)ImageBase + (ULONG_PTR)SectionSegments[i].VirtualAddress);
|
||||||
|
@ -4357,8 +4357,9 @@ MmFlushImageSection (IN PSECTION_OBJECT_POINTERS SectionObjectPointer,
|
||||||
* @unimplemented
|
* @unimplemented
|
||||||
*/
|
*/
|
||||||
BOOLEAN STDCALL
|
BOOLEAN STDCALL
|
||||||
MmForceSectionClosed (DWORD Unknown0,
|
MmForceSectionClosed (
|
||||||
DWORD Unknown1)
|
IN PSECTION_OBJECT_POINTERS SectionObjectPointer,
|
||||||
|
IN BOOLEAN DelayClose)
|
||||||
{
|
{
|
||||||
UNIMPLEMENTED;
|
UNIMPLEMENTED;
|
||||||
return (FALSE);
|
return (FALSE);
|
||||||
|
|
|
@ -16,7 +16,7 @@
|
||||||
* along with this program; if not, write to the Free Software
|
* along with this program; if not, write to the Free Software
|
||||||
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
* 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
|
* PROJECT: ReactOS kernel
|
||||||
* FILE: ntoskrnl/mm/virtual.c
|
* FILE: ntoskrnl/mm/virtual.c
|
||||||
|
@ -704,7 +704,7 @@ MmUnsecureVirtualMemory(PVOID SecureMem)
|
||||||
* @implemented
|
* @implemented
|
||||||
*/
|
*/
|
||||||
VOID STDCALL
|
VOID STDCALL
|
||||||
ProbeForRead (IN PVOID Address,
|
ProbeForRead (IN CONST VOID *Address,
|
||||||
IN ULONG Length,
|
IN ULONG Length,
|
||||||
IN ULONG Alignment)
|
IN ULONG Alignment)
|
||||||
{
|
{
|
||||||
|
@ -729,7 +729,7 @@ ProbeForRead (IN PVOID Address,
|
||||||
* @implemented
|
* @implemented
|
||||||
*/
|
*/
|
||||||
VOID STDCALL
|
VOID STDCALL
|
||||||
ProbeForWrite (IN PVOID Address,
|
ProbeForWrite (IN CONST VOID *Address,
|
||||||
IN ULONG Length,
|
IN ULONG Length,
|
||||||
IN ULONG Alignment)
|
IN ULONG Alignment)
|
||||||
{
|
{
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue