Author: fireball
Date: Wed Mar 31 16:27:11 2010
New Revision: 46619
URL:
http://svn.reactos.org/svn/reactos?rev=46619&view=rev
Log:
[NTOSKRNL/CONFIG]
- Implement new (correct) hive flusher lock/release routines, unused right now.
Modified:
trunk/reactos/ntoskrnl/config/cmsysini.c
trunk/reactos/ntoskrnl/include/internal/cm.h
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 [iso-8859-1] (original)
+++ trunk/reactos/ntoskrnl/config/cmsysini.c [iso-8859-1] Wed Mar 31 16:27:11 2010
@@ -27,6 +27,7 @@
BOOLEAN CmpSpecialBootCondition;
BOOLEAN CmpNoWrite;
BOOLEAN CmpWasSetupBoot;
+BOOLEAN CmpProfileLoaded;
ULONG CmpTraceLevel = 0;
extern LONG CmpFlushStarveWriters;
@@ -1624,6 +1625,56 @@
VOID
NTAPI
+CmpLockHiveFlusherExclusive(IN PCMHIVE Hive)
+{
+ /* Lock the flusher. We should already be in a critical section */
+ CMP_ASSERT_REGISTRY_LOCK_OR_LOADING(Hive);
+ ASSERT((ExIsResourceAcquiredShared(Hive->FlusherLock) == 0) &&
+ (ExIsResourceAcquiredExclusiveLite(Hive->FlusherLock) == 0));
+ ExAcquireResourceExclusiveLite(Hive->FlusherLock, TRUE);
+}
+
+VOID
+NTAPI
+CmpLockHiveFlusherShared(IN PCMHIVE Hive)
+{
+ /* Lock the flusher. We should already be in a critical section */
+ CMP_ASSERT_REGISTRY_LOCK_OR_LOADING(Hive);
+ ASSERT((ExIsResourceAcquiredShared(Hive->FlusherLock) == 0) &&
+ (ExIsResourceAcquiredExclusiveLite(Hive->FlusherLock) == 0));
+ ExAcquireResourceSharedLite(Hive->FlusherLock, TRUE);
+}
+
+VOID
+NTAPI
+CmpUnlockHiveFlusher(IN PCMHIVE Hive)
+{
+ /* Sanity check */
+ CMP_ASSERT_REGISTRY_LOCK_OR_LOADING(Hive);
+ CMP_ASSERT_FLUSH_LOCK(Hive);
+
+ /* Release the lock */
+ ExReleaseResourceLite(Hive->FlusherLock);
+}
+
+BOOLEAN
+NTAPI
+CmpTestHiveFlusherLockShared(IN PCMHIVE Hive)
+{
+ /* Test the lock */
+ return !ExIsResourceAcquiredSharedLite(Hive->FlusherLock) ? FALSE : TRUE;
+}
+
+BOOLEAN
+NTAPI
+CmpTestHiveFlusherLockExclusive(IN PCMHIVE Hive)
+{
+ /* Test the lock */
+ return !ExIsResourceAcquiredExclusiveLite(Hive->FlusherLock) ? FALSE : TRUE;
+}
+
+VOID
+NTAPI
CmpUnlockRegistry(VOID)
{
/* Sanity check */
Modified: trunk/reactos/ntoskrnl/include/internal/cm.h
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/ntoskrnl/include/internal/…
==============================================================================
--- trunk/reactos/ntoskrnl/include/internal/cm.h [iso-8859-1] (original)
+++ trunk/reactos/ntoskrnl/include/internal/cm.h [iso-8859-1] Wed Mar 31 16:27:11 2010
@@ -622,6 +622,24 @@
);
//
+// Hive List Routines
+//
+NTSTATUS
+NTAPI
+CmpAddToHiveFileList(
+ IN PCMHIVE Hive
+);
+
+//
+// Quota Routines
+//
+VOID
+NTAPI
+CmpSetGlobalQuotaAllowed(
+ VOID
+);
+
+//
// Notification Routines
//
VOID
@@ -631,6 +649,13 @@
IN PHHIVE Hive,
IN HCELL_INDEX Cell,
IN ULONG Filter
+);
+
+VOID
+NTAPI
+CmpFlushNotify(
+ IN PCM_KEY_BODY KeyBody,
+ IN BOOLEAN LockHeld
);
VOID
@@ -822,6 +847,36 @@
VOID
);
+VOID
+NTAPI
+CmpLockHiveFlusherExclusive(
+ IN PCMHIVE Hive
+);
+
+VOID
+NTAPI
+CmpLockHiveFlusherShared(
+ IN PCMHIVE Hive
+);
+
+BOOLEAN
+NTAPI
+CmpTestHiveFlusherLockExclusive(
+ IN PCMHIVE Hive
+);
+
+BOOLEAN
+NTAPI
+CmpTestHiveFlusherLockShared(
+ IN PCMHIVE Hive
+);
+
+VOID
+NTAPI
+CmpUnlockHiveFlusher(
+ IN PCMHIVE Hive
+);
+
//
// Delay Functions
//
@@ -976,6 +1031,13 @@
CmpReleaseTwoKcbLockByKey(
IN ULONG ConvKey1,
IN ULONG ConvKey2
+);
+
+VOID
+NTAPI
+CmpFlushNotifiesOnKeyBodyList(
+ IN PCM_KEY_CONTROL_BLOCK Kcb,
+ IN BOOLEAN LockHeld
);
//
@@ -1507,6 +1569,7 @@
extern BOOLEAN CmpNoWrite;
extern BOOLEAN CmpForceForceFlush;
extern BOOLEAN CmpWasSetupBoot;
+extern BOOLEAN CmpProfileLoaded;
extern PCMHIVE CmiVolatileHive;
extern LIST_ENTRY CmiKeyObjectListHead;
extern BOOLEAN CmpHoldLazyFlush;