[NTOSKRNL] Dereference page file objects in MM shutdown phase 1

Hack the call the MM shutdown phase  1
This commit is contained in:
Pierre Schweitzer 2018-08-13 08:23:44 +02:00
parent 3814a822f1
commit 5aaadf39db
No known key found for this signature in database
GPG key ID: 7545556C3D585B0B
2 changed files with 18 additions and 0 deletions

View file

@ -39,8 +39,21 @@ MmShutdownSystem(IN ULONG Phase)
{
MiShutdownSystem();
}
else if (Phase == 1)
{
ULONG i;
/* Loop through all the paging files */
for (i = 0; i < MmNumberOfPagingFiles; i++)
{
/* And dereference them */
ObDereferenceObject(MmPagingFile[i]->FileObject);
}
}
else
{
ASSERT(Phase == 2);
UNIMPLEMENTED;
}
}

View file

@ -294,6 +294,11 @@ PopGracefulShutdown(IN PVOID Context)
IoShutdownSystem(1);
CcWaitForCurrentLazyWriterActivity();
/* FIXME: Calling Mm shutdown phase 1 here to get page file dereference
* but it shouldn't be called here. Only phase 2 should be called.
*/
MmShutdownSystem(1);
/* Note that here, we should broadcast the power IRP to devices */
/* In this step, the HAL disables any wake timers */