mirror of
https://github.com/reactos/reactos.git
synced 2025-06-12 14:48:29 +00:00
[NTOS:MM] Fix regression of MmCanFileBeTruncated
This commit is contained in:
parent
7f7abc9838
commit
c0bf352069
1 changed files with 7 additions and 1 deletions
|
@ -4115,7 +4115,7 @@ MmCanFileBeTruncated (IN PSECTION_OBJECT_POINTERS SectionObjectPointer,
|
||||||
}
|
}
|
||||||
|
|
||||||
MmLockSectionSegment(Segment);
|
MmLockSectionSegment(Segment);
|
||||||
if ((Segment->SectionCount == 1) && (SectionObjectPointer->SharedCacheMap != NULL))
|
if ((Segment->SectionCount == 0) || ((Segment->SectionCount == 1) && (SectionObjectPointer->SharedCacheMap != NULL)))
|
||||||
{
|
{
|
||||||
/* If the cache is the only one holding a reference to the segment, then it's fine to resize */
|
/* If the cache is the only one holding a reference to the segment, then it's fine to resize */
|
||||||
Ret = TRUE;
|
Ret = TRUE;
|
||||||
|
@ -4124,6 +4124,12 @@ MmCanFileBeTruncated (IN PSECTION_OBJECT_POINTERS SectionObjectPointer,
|
||||||
{
|
{
|
||||||
/* We can't shrink, but we can extend */
|
/* We can't shrink, but we can extend */
|
||||||
Ret = NewFileSize->QuadPart >= Segment->RawLength.QuadPart;
|
Ret = NewFileSize->QuadPart >= Segment->RawLength.QuadPart;
|
||||||
|
#if DBG
|
||||||
|
if (!Ret)
|
||||||
|
{
|
||||||
|
DPRINT1("Cannot truncate data: New Size %I64d, Segment Size %I64d\n", NewFileSize->QuadPart, Segment->RawLength.QuadPart);
|
||||||
|
}
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
MmUnlockSectionSegment(Segment);
|
MmUnlockSectionSegment(Segment);
|
||||||
MmDereferenceSegment(Segment);
|
MmDereferenceSegment(Segment);
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue