- 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.

svn path=/trunk/; revision=31430
This commit is contained in:
Aleksey Bragin 2007-12-25 12:35:15 +00:00
parent c60950760b
commit 13db85781b
3 changed files with 16 additions and 8 deletions

View file

@ -38,9 +38,15 @@ CmpDoFlushAll(IN BOOLEAN ForceFlush)
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 */

View file

@ -260,7 +260,7 @@ CmpCmdHiveOpen(IN POBJECT_ATTRIBUTES FileAttributes,
0,
NewHive,
Allocate,
CheckFlags);
CheckFlags);
if (((Status == STATUS_ACCESS_DENIED) ||
(Status == STATUS_NO_SUCH_USER) ||
(Status == STATUS_WRONG_PASSWORD) ||
@ -278,7 +278,7 @@ CmpCmdHiveOpen(IN POBJECT_ATTRIBUTES FileAttributes,
0,
NewHive,
Allocate,
CheckFlags);
CheckFlags);
/* Restore impersonation token */
PsRevertToSelf();

View file

@ -30,6 +30,8 @@ BOOLEAN CmpNoWrite;
BOOLEAN CmpForceForceFlush;
BOOLEAN CmpWasSetupBoot;
extern BOOLEAN CmFirstTime;
/* FUNCTIONS *****************************************************************/
VOID
@ -1647,7 +1649,7 @@ VOID
NTAPI
CmShutdownSystem(VOID)
{
/* Kill the workers and fush all hives */
CmpShutdownWorkers();
/* Kill the workers and flush all hives */
if (!CmFirstTime) CmpShutdownWorkers();
CmpDoFlushAll(TRUE);
}