mirror of
https://github.com/reactos/reactos.git
synced 2025-02-23 17:05:46 +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,
|
||||
IN MMFLUSH_TYPE FlushType)
|
||||
{
|
||||
BOOLEAN Result = TRUE;
|
||||
#ifdef NEWCC
|
||||
PMM_SECTION_SEGMENT Segment;
|
||||
#endif
|
||||
|
||||
switch(FlushType)
|
||||
{
|
||||
case MmFlushForDelete:
|
||||
if (SectionObjectPointer->ImageSectionObject ||
|
||||
SectionObjectPointer->DataSectionObject)
|
||||
{
|
||||
return FALSE;
|
||||
}
|
||||
#ifndef NEWCC
|
||||
CcRosRemoveIfClosed(SectionObjectPointer);
|
||||
#endif
|
||||
return TRUE;
|
||||
case MmFlushForWrite:
|
||||
{
|
||||
DPRINT("MmFlushImageSection(%d)\n", FlushType);
|
||||
#ifdef NEWCC
|
||||
Segment = (PMM_SECTION_SEGMENT)SectionObjectPointer->DataSectionObject;
|
||||
#endif
|
||||
BOOLEAN Ret = TRUE;
|
||||
KIRQL OldIrql = MiAcquirePfnLock();
|
||||
|
||||
if (SectionObjectPointer->ImageSectionObject)
|
||||
{
|
||||
DPRINT1("SectionObject has ImageSection\n");
|
||||
return FALSE;
|
||||
PMM_IMAGE_SECTION_OBJECT ImageSectionObject = SectionObjectPointer->ImageSectionObject;
|
||||
if (!(ImageSectionObject->SegFlags & MM_SEGMENT_INDELETE))
|
||||
Ret = FALSE;
|
||||
}
|
||||
|
||||
#ifdef NEWCC
|
||||
CcpLock();
|
||||
Result = !SectionObjectPointer->SharedCacheMap || (Segment->ReferenceCount == CcpCountCacheSections((PNOCC_CACHE_MAP)SectionObjectPointer->SharedCacheMap));
|
||||
CcpUnlock();
|
||||
DPRINT("Result %d\n", Result);
|
||||
#endif
|
||||
return Result;
|
||||
MiReleasePfnLock(OldIrql);
|
||||
return Ret;
|
||||
}
|
||||
}
|
||||
return FALSE;
|
||||
|
|
Loading…
Reference in a new issue