Author: fireball Date: Tue Dec 25 15:35:15 2007 New Revision: 31430
URL: http://svn.reactos.org/svn/reactos?rev=31430&view=rev Log: - Do CmpShutdownWorkers only when the registry was actually initialized. - Guard HvSyncHive with a flusher lock in CmpDoFlushAll. - Misc typo fixes / spaces cleanup in cmlazy.c.
Modified: trunk/reactos/ntoskrnl/config/cmapi.c trunk/reactos/ntoskrnl/config/cmlazy.c trunk/reactos/ntoskrnl/config/cmsysini.c
Modified: trunk/reactos/ntoskrnl/config/cmapi.c URL: http://svn.reactos.org/svn/reactos/trunk/reactos/ntoskrnl/config/cmapi.c?rev... ============================================================================== --- trunk/reactos/ntoskrnl/config/cmapi.c (original) +++ trunk/reactos/ntoskrnl/config/cmapi.c Tue Dec 25 15:35:15 2007 @@ -38,9 +38,15 @@ Hive = CONTAINING_RECORD(NextEntry, CMHIVE, HiveList); if (!(Hive->Hive.HiveFlags & HIVE_NOLAZYFLUSH)) { + /* Acquire the flusher lock */ + ExAcquirePushLockExclusive((PVOID)&Hive->FlusherLock); + /* Do the sync */ Status = HvSyncHive(&Hive->Hive); if (!NT_SUCCESS(Status)) Result = FALSE; + + /* Release the flusher lock */ + ExReleasePushLock((PVOID)&Hive->FlusherLock); }
/* Try the next entry */
Modified: trunk/reactos/ntoskrnl/config/cmlazy.c URL: http://svn.reactos.org/svn/reactos/trunk/reactos/ntoskrnl/config/cmlazy.c?re... ============================================================================== --- trunk/reactos/ntoskrnl/config/cmlazy.c (original) +++ trunk/reactos/ntoskrnl/config/cmlazy.c Tue Dec 25 15:35:15 2007 @@ -187,7 +187,7 @@ }
/* Flush the next hive */ - MoreWork = CmpDoFlushNextHive(ForceFlush, &Result, &DirtyCount); + MoreWork = CmpDoFlushNextHive(ForceFlush, &Result, &DirtyCount); if (!MoreWork) { /* We're done */ @@ -232,7 +232,7 @@ KeSetTimer(&CmpEnableLazyFlushTimer, DueTime, &CmpEnableLazyFlushDpc);
/* Setup flush variables */ - CmpNoWrite = CmpMiniNTBoot; + CmpNoWrite = CmpMiniNTBoot; CmpWasSetupBoot = SetupBoot;
/* Testing: Force Lazy Flushing */ @@ -260,7 +260,7 @@ 0, NewHive, Allocate, - CheckFlags); + CheckFlags); if (((Status == STATUS_ACCESS_DENIED) || (Status == STATUS_NO_SUCH_USER) || (Status == STATUS_WRONG_PASSWORD) || @@ -278,8 +278,8 @@ 0, NewHive, Allocate, - CheckFlags); - + CheckFlags); + /* Restore impersonation token */ PsRevertToSelf(); }
Modified: trunk/reactos/ntoskrnl/config/cmsysini.c URL: http://svn.reactos.org/svn/reactos/trunk/reactos/ntoskrnl/config/cmsysini.c?... ============================================================================== --- trunk/reactos/ntoskrnl/config/cmsysini.c (original) +++ trunk/reactos/ntoskrnl/config/cmsysini.c Tue Dec 25 15:35:15 2007 @@ -29,6 +29,8 @@ BOOLEAN CmpNoWrite; BOOLEAN CmpForceForceFlush; BOOLEAN CmpWasSetupBoot; + +extern BOOLEAN CmFirstTime;
/* FUNCTIONS *****************************************************************/
@@ -1637,7 +1639,7 @@ { ASSERT((GET_HASH_ENTRY(CmpCacheTable, ConvKey1).Owner == KeGetCurrentThread()) || (CmpTestRegistryLockExclusive())); - CmpReleaseKcbLockByKey(ConvKey1); + CmpReleaseKcbLockByKey(ConvKey1); } CmpReleaseKcbLockByKey(ConvKey2); } @@ -1647,7 +1649,7 @@ NTAPI CmShutdownSystem(VOID) { - /* Kill the workers and fush all hives */ - CmpShutdownWorkers(); + /* Kill the workers and flush all hives */ + if (!CmFirstTime) CmpShutdownWorkers(); CmpDoFlushAll(TRUE); }