[NTOS:PO] Flush dirty pages after flushing volumes

This commit is contained in:
Jérôme Gardou 2021-01-21 16:39:27 +01:00
parent 5949d5095d
commit 48e1c8593f

View file

@ -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)