[NTOSKRNL] Dereference page file objects in MM shutdown phase 1
[reactos.git] / ntoskrnl / mm / shutdown.c
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 /* And close them */
29 ZwClose(MmPagingFile[i]->FileHandle);
30 }
31
32 UNIMPLEMENTED;
33 }
34
35 VOID
36 MmShutdownSystem(IN ULONG Phase)
37 {
38 if (Phase == 0)
39 {
40 MiShutdownSystem();
41 }
42 else if (Phase == 1)
43 {
44 ULONG i;
45
46 /* Loop through all the paging files */
47 for (i = 0; i < MmNumberOfPagingFiles; i++)
48 {
49 /* And dereference them */
50 ObDereferenceObject(MmPagingFile[i]->FileObject);
51 }
52 }
53 else
54 {
55 ASSERT(Phase == 2);
56
57 UNIMPLEMENTED;
58 }
59 }