https://git.reactos.org/?p=reactos.git;a=commitdiff;h=48e1c8593f97b278ce02a…
commit 48e1c8593f97b278ce02a78cd3002368ee92d907
Author: Jérôme Gardou <jerome.gardou(a)reactos.org>
AuthorDate: Thu Jan 21 16:39:27 2021 +0100
Commit: Jérôme Gardou <jerome.gardou(a)reactos.org>
CommitDate: Wed Feb 3 09:41:23 2021 +0100
[NTOS:PO] Flush dirty pages after flushing volumes
---
ntoskrnl/po/power.c | 11 ++++++-----
1 file changed, 6 insertions(+), 5 deletions(-)
diff --git a/ntoskrnl/po/power.c b/ntoskrnl/po/power.c
index 6dee7054c02..125edbc11df 100644
--- a/ntoskrnl/po/power.c
+++ b/ntoskrnl/po/power.c
@@ -1072,18 +1072,19 @@ NtSetSystemPowerState(IN POWER_ACTION SystemAction,
/* Check if we're still in an invalid status */
if (!NT_SUCCESS(Status)) break;
+ /* Flush all volumes and the registry */
+ DPRINT("Flushing volumes\n");
+ PopFlushVolumes(PopAction.Shutdown);
+
#ifndef NEWCC
/* Flush dirty cache pages */
/* XXX: Is that still mandatory? As now we'll wait on lazy writer to
complete? */
- CcRosFlushDirtyPages(MAXULONG, &Dummy, TRUE, FALSE); //HACK: We really should
wait here!
+ CcRosFlushDirtyPages(MAXULONG, &Dummy, TRUE, FALSE);
+ DPRINT("Cache flushed %lu pages\n", Dummy);
#else
Dummy = 0;
#endif
- /* Flush all volumes and the registry */
- DPRINT("Flushing volumes, cache flushed %lu pages\n", Dummy);
- PopFlushVolumes(PopAction.Shutdown);
-
/* Set IRP for drivers */
PopAction.IrpMinor = IRP_MN_SET_POWER;
if (PopAction.Shutdown)