[NTOSKRNL] Keep page file name along the page file and free it on shutdown

This commit is contained in:
Pierre Schweitzer 2018-08-13 08:24:39 +02:00
parent 5aaadf39db
commit 34e8f45122
No known key found for this signature in database
GPG key ID: 7545556C3D585B0B
3 changed files with 77 additions and 26 deletions

View file

@ -25,6 +25,11 @@ MiShutdownSystem(VOID)
/* 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);
}