ReactOS 0.4.15-dev-7934-g1dc8d80
shutdown.c File Reference
#include <ntoskrnl.h>
#include <debug.h>
#include "ARM3/miarm.h"
Include dependency graph for shutdown.c:

Go to the source code of this file.

Macros

#define NDEBUG
 
#define MODULE_INVOLVED_IN_ARM3
 

Functions

VOID MiShutdownSystem (VOID)
 
VOID MmShutdownSystem (IN ULONG Phase)
 

Macro Definition Documentation

◆ MODULE_INVOLVED_IN_ARM3

#define MODULE_INVOLVED_IN_ARM3

Definition at line 15 of file shutdown.c.

◆ NDEBUG

#define NDEBUG

Definition at line 12 of file shutdown.c.

Function Documentation

◆ MiShutdownSystem()

VOID MiShutdownSystem ( VOID  )

Definition at line 21 of file shutdown.c.

22{
23 ULONG i;
25 BOOLEAN Dirty;
26
27 /* Loop through all the paging files */
28 for (i = 0; i < MmNumberOfPagingFiles; i++)
29 {
30 /* Free page file name */
31 ASSERT(MmPagingFile[i]->PageFileName.Buffer != NULL);
32 ExFreePoolWithTag(MmPagingFile[i]->PageFileName.Buffer, TAG_MM);
34
35 /* And close them */
37 }
38
39 /* Loop through all the pages owned by the legacy Mm and page them out, if needed. */
40 /* We do it as long as there are dirty pages, since flushing can cause the FS to dirtify new ones. */
41 do
42 {
43 Dirty = FALSE;
44
46 while (Page)
47 {
48 LARGE_INTEGER SegmentOffset;
50
51 if (Segment)
52 {
53 if ((*Segment->Flags) & MM_DATAFILE_SEGMENT)
54 {
56
58
60 {
61 Dirty = TRUE;
62 MmCheckDirtySegment(Segment, &SegmentOffset, FALSE, TRUE);
63 }
64
66 }
67
68 MmDereferenceSegment(Segment);
69 }
70
72 }
73 } while (Dirty);
74}
unsigned char BOOLEAN
#define NULL
Definition: types.h:112
#define TRUE
Definition: types.h:120
#define FALSE
Definition: types.h:117
_Must_inspect_result_ _In_opt_ PFLT_INSTANCE _Out_ PHANDLE FileHandle
Definition: fltkernel.h:1231
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble const GLfloat const GLdouble const GLfloat GLint i
Definition: glfuncs.h:248
#define ASSERT(a)
Definition: mode.c:44
#define ExFreePoolWithTag(_P, _T)
Definition: module.h:1109
NTSYSAPI NTSTATUS NTAPI ZwClose(_In_ HANDLE Handle)
PMMPAGING_FILE MmPagingFile[MAX_PAGING_FILES]
Definition: pagefile.c:57
#define MmGetPageEntrySectionSegment(S, O)
Definition: mm.h:1602
#define MmLockSectionSegment(x)
Definition: mm.h:1397
#define MmUnlockSectionSegment(x)
Definition: mm.h:1405
_In_ PVOID _Out_opt_ BOOLEAN _Out_opt_ PPFN_NUMBER Page
Definition: mm.h:1306
#define IS_DIRTY_SSE(E)
Definition: mm.h:1377
PFN_NUMBER NTAPI MmGetLRUFirstUserPage(VOID)
Definition: freelist.c:45
BOOLEAN NTAPI MmCheckDirtySegment(PMM_SECTION_SEGMENT Segment, PLARGE_INTEGER Offset, BOOLEAN ForceDirty, BOOLEAN PageOut)
ULONG MmNumberOfPagingFiles
Definition: pagefile.c:63
PFN_NUMBER NTAPI MmGetLRUNextUserPage(PFN_NUMBER PreviousPage, BOOLEAN MoveToLast)
Definition: freelist.c:125
#define IS_SWAP_FROM_SSE(E)
Definition: mm.h:1369
#define MM_DATAFILE_SEGMENT
Definition: mm.h:238
ULONG PFN_NUMBER
Definition: ke.h:9
PMM_SECTION_SEGMENT NTAPI MmGetSectionAssociation(PFN_NUMBER Page, PLARGE_INTEGER Offset)
Definition: sptab.c:374
base of all file and directory entries
Definition: entries.h:83
UNICODE_STRING PageFileName
Definition: mm.h:507
#define TAG_MM
Definition: tag.h:113
uint32_t ULONG_PTR
Definition: typedefs.h:65
uint32_t ULONG
Definition: typedefs.h:59
_Inout_ PVOID Segment
Definition: exfuncs.h:1101

Referenced by MmShutdownSystem().

◆ MmShutdownSystem()

VOID MmShutdownSystem ( IN ULONG  Phase)

Definition at line 77 of file shutdown.c.

78{
79 if (Phase == 0)
80 {
82 }
83 else if (Phase == 1)
84 {
85 ULONG i;
86
87 /* Loop through all the paging files */
88 for (i = 0; i < MmNumberOfPagingFiles; i++)
89 {
90 /* And dereference them */
92 }
93 }
94 else
95 {
96 ASSERT(Phase == 2);
97
99 }
100}
#define UNIMPLEMENTED
Definition: debug.h:115
VOID MiShutdownSystem(VOID)
Definition: shutdown.c:21
_In_ WDFREQUEST _In_ WDFFILEOBJECT FileObject
Definition: wdfdevice.h:550
#define ObDereferenceObject
Definition: obfuncs.h:203

Referenced by PopGracefulShutdown().