diff --git a/ntoskrnl/mm/shutdown.c b/ntoskrnl/mm/shutdown.c index 50522dd4e82..d4093015ffa 100644 --- a/ntoskrnl/mm/shutdown.c +++ b/ntoskrnl/mm/shutdown.c @@ -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; } } diff --git a/ntoskrnl/po/poshtdwn.c b/ntoskrnl/po/poshtdwn.c index 070cf67e547..8a33157fd0d 100644 --- a/ntoskrnl/po/poshtdwn.c +++ b/ntoskrnl/po/poshtdwn.c @@ -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 */