mirror of
https://github.com/reactos/reactos.git
synced 2024-12-27 09:34:43 +00:00
[NTOS:MM] Flush dirty pages after closing the page files.
CORE-17462
This commit is contained in:
parent
b493a2f8ab
commit
73fd52a164
1 changed files with 13 additions and 15 deletions
|
@ -24,8 +24,20 @@ MiShutdownSystem(VOID)
|
||||||
PFN_NUMBER Page;
|
PFN_NUMBER Page;
|
||||||
BOOLEAN Dirty;
|
BOOLEAN Dirty;
|
||||||
|
|
||||||
|
/* Loop through all the paging files */
|
||||||
|
for (i = 0; i < MmNumberOfPagingFiles; i++)
|
||||||
|
{
|
||||||
|
/* Free page file name */
|
||||||
|
ASSERT(MmPagingFile[i]->PageFileName.Buffer != NULL);
|
||||||
|
ExFreePoolWithTag(MmPagingFile[i]->PageFileName.Buffer, TAG_MM);
|
||||||
|
MmPagingFile[i]->PageFileName.Buffer = NULL;
|
||||||
|
|
||||||
|
/* And close them */
|
||||||
|
ZwClose(MmPagingFile[i]->FileHandle);
|
||||||
|
}
|
||||||
|
|
||||||
/* Loop through all the pages owned by the legacy Mm and page them out, if needed. */
|
/* Loop through all the pages owned by the legacy Mm and page them out, if needed. */
|
||||||
/* We do it twice, since flushing can cause the FS to dirtify new pages */
|
/* We do it as long as there are dirty pages, since flushing can cause the FS to dirtify new ones. */
|
||||||
do
|
do
|
||||||
{
|
{
|
||||||
Dirty = FALSE;
|
Dirty = FALSE;
|
||||||
|
@ -59,20 +71,6 @@ MiShutdownSystem(VOID)
|
||||||
Page = MmGetLRUNextUserPage(Page, FALSE);
|
Page = MmGetLRUNextUserPage(Page, FALSE);
|
||||||
}
|
}
|
||||||
} while (Dirty);
|
} while (Dirty);
|
||||||
|
|
||||||
/* Loop through all the paging files */
|
|
||||||
for (i = 0; i < MmNumberOfPagingFiles; i++)
|
|
||||||
{
|
|
||||||
/* Free page file name */
|
|
||||||
ASSERT(MmPagingFile[i]->PageFileName.Buffer != NULL);
|
|
||||||
ExFreePoolWithTag(MmPagingFile[i]->PageFileName.Buffer, TAG_MM);
|
|
||||||
MmPagingFile[i]->PageFileName.Buffer = NULL;
|
|
||||||
|
|
||||||
/* And close them */
|
|
||||||
ZwClose(MmPagingFile[i]->FileHandle);
|
|
||||||
}
|
|
||||||
|
|
||||||
UNIMPLEMENTED;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
VOID
|
VOID
|
||||||
|
|
Loading…
Reference in a new issue