xref: /reactos/ntoskrnl/mm/shutdown.c (revision ebaf247c)
1 /*
2  * PROJECT:         ReactOS Kernel
3  * LICENSE:         GPL - See COPYING in the top level directory
4  * FILE:            ntoskrnl/mm/shutdown.c
5  * PURPOSE:         Memory Manager Shutdown
6  * PROGRAMMERS:
7  */
8 
9 /* INCLUDES ******************************************************************/
10 
11 #include <ntoskrnl.h>
12 #define NDEBUG
13 #include <debug.h>
14 
15 #define MODULE_INVOLVED_IN_ARM3
16 #include "ARM3/miarm.h"
17 
18 /* PRIVATE FUNCTIONS *********************************************************/
19 
20 VOID
21 MiShutdownSystem(VOID)
22 {
23     ULONG i;
24 
25     /* Loop through all the paging files */
26     for (i = 0; i < MmNumberOfPagingFiles; i++)
27     {
28         /* Free page file name */
29         ASSERT(MmPagingFile[i]->PageFileName.Buffer != NULL);
30         ExFreePoolWithTag(MmPagingFile[i]->PageFileName.Buffer, TAG_MM);
31         MmPagingFile[i]->PageFileName.Buffer = NULL;
32 
33         /* And close them */
34         ZwClose(MmPagingFile[i]->FileHandle);
35     }
36 
37     UNIMPLEMENTED;
38 }
39 
40 VOID
41 MmShutdownSystem(IN ULONG Phase)
42 {
43     if (Phase == 0)
44     {
45         MiShutdownSystem();
46     }
47     else if (Phase == 1)
48     {
49         ULONG i;
50 
51         /* Loop through all the paging files */
52         for (i = 0; i < MmNumberOfPagingFiles; i++)
53         {
54             /* And dereference them */
55             ObDereferenceObject(MmPagingFile[i]->FileObject);
56         }
57     }
58     else
59     {
60         ASSERT(Phase == 2);
61 
62         UNIMPLEMENTED;
63     }
64 }
65