diff --git a/ntoskrnl/config/cmsysini.c b/ntoskrnl/config/cmsysini.c index 5260cb69a42..572f8a342f8 100644 --- a/ntoskrnl/config/cmsysini.c +++ b/ntoskrnl/config/cmsysini.c @@ -1956,11 +1956,6 @@ CmpUnlockRegistry(VOID) CmpDoFlushAll(TRUE); CmpFlushOnLockRelease = FALSE; } - else - { - /* Lazy flush the registry */ - CmpLazyFlush(); - } /* Release the lock and leave the critical region */ ExReleaseResourceLite(&CmpRegistryLock); diff --git a/sdk/lib/cmlib/hivecell.c b/sdk/lib/cmlib/hivecell.c index 9820ab8de22..2354631ad8c 100644 --- a/sdk/lib/cmlib/hivecell.c +++ b/sdk/lib/cmlib/hivecell.c @@ -9,6 +9,16 @@ #define NDEBUG #include +/* DECLARATIONS *************************************************************/ + +#if !defined(CMLIB_HOST) && !defined(_BLDR_) +VOID +NTAPI +CmpLazyFlush(VOID); +#endif + +/* FUNCTIONS *****************************************************************/ + static __inline PHCELL CMAPI HvpGetCellHeader( PHHIVE RegistryHive, @@ -118,6 +128,24 @@ HvMarkCellDirty( RtlSetBits(&RegistryHive->DirtyVector, CellBlock, CellLastBlock - CellBlock); RegistryHive->DirtyCount++; + + /* + * FIXME: Querying a lazy flush operation is needed to + * ensure that the dirty data is being flushed to disk + * accordingly. However, this operation has to be done + * in a helper like HvMarkDirty that marks specific parts + * of the hive as dirty. Since we do not have such kind + * of helper we have to perform an eventual lazy flush + * when marking cells as dirty here for the moment being, + * so that not only we flush dirty data but also write + * logs. + */ +#if !defined(CMLIB_HOST) && !defined(_BLDR_) + if (!(RegistryHive->HiveFlags & HIVE_NOLAZYFLUSH)) + { + CmpLazyFlush(); + } +#endif return TRUE; }