From 945450876abba9ee45d08c9aeb6866b00fb16bba Mon Sep 17 00:00:00 2001 From: Hartmut Birr Date: Thu, 30 Jan 2003 18:28:10 +0000 Subject: [PATCH] Write back dirty pages from cache manager at shutdown. svn path=/trunk/; revision=4085 --- reactos/ntoskrnl/ex/power.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/reactos/ntoskrnl/ex/power.c b/reactos/ntoskrnl/ex/power.c index 34c63a657e8..5b57a97b686 100644 --- a/reactos/ntoskrnl/ex/power.c +++ b/reactos/ntoskrnl/ex/power.c @@ -17,6 +17,7 @@ #include #include #include +#include #include @@ -34,12 +35,19 @@ NtSetSystemPowerState(IN POWER_ACTION SystemAction, NTSTATUS STDCALL NtShutdownSystem(IN SHUTDOWN_ACTION Action) { + ULONG Count; if (Action > ShutdownPowerOff) return STATUS_INVALID_PARAMETER; IoShutdownRegisteredDevices(); CmShutdownRegistry(); IoShutdownRegisteredFileSystems(); + /* FIXME: IoShutdownRegisteredFileSystems should unmount the filesystems and + this writes back all modified data. This doesn't work at the moment. */ + CcRosFlushDirtyPages(0xFFFFFFFF, &Count); + CcRosFlushDirtyPages(0xFFFFFFFF, &Count); + CcRosFlushDirtyPages(0xFFFFFFFF, &Count); + PiShutdownProcessManager(); MiShutdownMemoryManager();