mirror of
https://github.com/reactos/reactos.git
synced 2025-02-24 01:15:09 +00:00
[NTOS:MM] Various fixes.
Fix MmFlushImageSection behaviour Remove an invalid ASSERT
This commit is contained in:
parent
30f71c7fc0
commit
3141668724
1 changed files with 14 additions and 34 deletions
|
@ -4095,43 +4095,23 @@ BOOLEAN NTAPI
|
||||||
MmFlushImageSection (IN PSECTION_OBJECT_POINTERS SectionObjectPointer,
|
MmFlushImageSection (IN PSECTION_OBJECT_POINTERS SectionObjectPointer,
|
||||||
IN MMFLUSH_TYPE FlushType)
|
IN MMFLUSH_TYPE FlushType)
|
||||||
{
|
{
|
||||||
BOOLEAN Result = TRUE;
|
|
||||||
#ifdef NEWCC
|
|
||||||
PMM_SECTION_SEGMENT Segment;
|
|
||||||
#endif
|
|
||||||
|
|
||||||
switch(FlushType)
|
switch(FlushType)
|
||||||
{
|
{
|
||||||
case MmFlushForDelete:
|
case MmFlushForDelete:
|
||||||
if (SectionObjectPointer->ImageSectionObject ||
|
|
||||||
SectionObjectPointer->DataSectionObject)
|
|
||||||
{
|
|
||||||
return FALSE;
|
|
||||||
}
|
|
||||||
#ifndef NEWCC
|
|
||||||
CcRosRemoveIfClosed(SectionObjectPointer);
|
|
||||||
#endif
|
|
||||||
return TRUE;
|
|
||||||
case MmFlushForWrite:
|
case MmFlushForWrite:
|
||||||
{
|
{
|
||||||
DPRINT("MmFlushImageSection(%d)\n", FlushType);
|
BOOLEAN Ret = TRUE;
|
||||||
#ifdef NEWCC
|
KIRQL OldIrql = MiAcquirePfnLock();
|
||||||
Segment = (PMM_SECTION_SEGMENT)SectionObjectPointer->DataSectionObject;
|
|
||||||
#endif
|
|
||||||
|
|
||||||
if (SectionObjectPointer->ImageSectionObject)
|
if (SectionObjectPointer->ImageSectionObject)
|
||||||
{
|
{
|
||||||
DPRINT1("SectionObject has ImageSection\n");
|
PMM_IMAGE_SECTION_OBJECT ImageSectionObject = SectionObjectPointer->ImageSectionObject;
|
||||||
return FALSE;
|
if (!(ImageSectionObject->SegFlags & MM_SEGMENT_INDELETE))
|
||||||
|
Ret = FALSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifdef NEWCC
|
MiReleasePfnLock(OldIrql);
|
||||||
CcpLock();
|
return Ret;
|
||||||
Result = !SectionObjectPointer->SharedCacheMap || (Segment->ReferenceCount == CcpCountCacheSections((PNOCC_CACHE_MAP)SectionObjectPointer->SharedCacheMap));
|
|
||||||
CcpUnlock();
|
|
||||||
DPRINT("Result %d\n", Result);
|
|
||||||
#endif
|
|
||||||
return Result;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return FALSE;
|
return FALSE;
|
||||||
|
|
Loading…
Reference in a new issue