reactos/ntoskrnl/mm/shutdown.c

64 lines
1.4 KiB
C

/*
* PROJECT: ReactOS Kernel
* LICENSE: GPL - See COPYING in the top level directory
* FILE: ntoskrnl/mm/shutdown.c
* PURPOSE: Memory Manager Shutdown
* PROGRAMMERS:
*/
/* INCLUDES ******************************************************************/
#include <ntoskrnl.h>
#define NDEBUG
#include <debug.h>
#define MODULE_INVOLVED_IN_ARM3
#include "ARM3/miarm.h"
/* PRIVATE FUNCTIONS *********************************************************/
VOID
MiShutdownSystem(VOID)
{
ULONG i;
/* 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
MmShutdownSystem(IN ULONG Phase)
{
if (Phase == 0)
{
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;
}
}