From b97e40c6558c0dd270da99a02c291d642a47bbeb Mon Sep 17 00:00:00 2001 From: Aleksey Bragin Date: Sun, 18 May 2008 11:26:36 +0000 Subject: [PATCH] - Add a comment describing behavior in case of HvSyncHive failure. svn path=/trunk/; revision=33574 --- reactos/ntoskrnl/config/cmapi.c | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/reactos/ntoskrnl/config/cmapi.c b/reactos/ntoskrnl/config/cmapi.c index 4c169affd28..c8d6fbf191c 100644 --- a/reactos/ntoskrnl/config/cmapi.c +++ b/reactos/ntoskrnl/config/cmapi.c @@ -18,18 +18,18 @@ BOOLEAN NTAPI CmpDoFlushAll(IN BOOLEAN ForceFlush) { - NTSTATUS Status; PLIST_ENTRY NextEntry; PCMHIVE Hive; - BOOLEAN Result = TRUE; + NTSTATUS Status; + BOOLEAN Result = TRUE; /* Make sure that the registry isn't read-only now */ if (CmpNoWrite) return TRUE; - + /* Otherwise, acquire the hive list lock and disable force flush */ CmpForceForceFlush = FALSE; ExAcquirePushLockShared(&CmpHiveListHeadLock); - + /* Loop the hive list */ NextEntry = CmpHiveListHead.Flink; while (NextEntry != &CmpHiveListHead) @@ -43,6 +43,8 @@ CmpDoFlushAll(IN BOOLEAN ForceFlush) /* Do the sync */ Status = HvSyncHive(&Hive->Hive); + + /* If something failed - set the flag and continue looping*/ if (!NT_SUCCESS(Status)) Result = FALSE; /* Release the flusher lock */ @@ -52,7 +54,7 @@ CmpDoFlushAll(IN BOOLEAN ForceFlush) /* Try the next entry */ NextEntry = NextEntry->Flink; } - + /* Release lock and return */ ExReleasePushLock(&CmpHiveListHeadLock); return Result;