Author: tfaber
Date: Fri Sep 18 09:25:58 2015
New Revision: 69262
URL:
http://svn.reactos.org/svn/reactos?rev=69262&view=rev
Log:
[NTOS:CM]
- Improve pool tagging
Modified:
trunk/reactos/lib/cmlib/cmlib.h
trunk/reactos/ntoskrnl/config/cmalloc.c
trunk/reactos/ntoskrnl/config/cmapi.c
trunk/reactos/ntoskrnl/config/cminit.c
trunk/reactos/ntoskrnl/config/cmse.c
trunk/reactos/ntoskrnl/config/cmsysini.c
Modified: trunk/reactos/lib/cmlib/cmlib.h
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/lib/cmlib/cmlib.h?rev=6926…
==============================================================================
--- trunk/reactos/lib/cmlib/cmlib.h [iso-8859-1] (original)
+++ trunk/reactos/lib/cmlib/cmlib.h [iso-8859-1] Fri Sep 18 09:25:58 2015
@@ -143,7 +143,10 @@
#endif
#endif
-#define TAG_CM 'CM25'
+#define TAG_CM ' MC'
+#define TAG_KCB 'bkMC'
+#define TAG_CMHIVE 'vHMC'
+#define TAG_CMSD 'DSMC'
#define CMAPI NTAPI
Modified: trunk/reactos/ntoskrnl/config/cmalloc.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/ntoskrnl/config/cmalloc.c?…
==============================================================================
--- trunk/reactos/ntoskrnl/config/cmalloc.c [iso-8859-1] (original)
+++ trunk/reactos/ntoskrnl/config/cmalloc.c [iso-8859-1] Fri Sep 18 09:25:58 2015
@@ -64,7 +64,7 @@
if (!Kcb->PrivateAlloc)
{
/* Free it from the pool */
- CmpFree(Kcb, 0);
+ CmpFree(Kcb, TAG_KCB);
return;
}
@@ -99,7 +99,7 @@
}
/* Free the page */
- CmpFree(AllocPage, 0);
+ CmpFree(AllocPage, TAG_KCB);
}
/* Release the lock */
@@ -152,7 +152,7 @@
}
/* Allocate an allocation page */
- AllocPage = CmpAllocate(PAGE_SIZE, TRUE, TAG_CM);
+ AllocPage = CmpAllocate(PAGE_SIZE, TRUE, TAG_KCB);
if (AllocPage)
{
/* Set default entries */
@@ -179,7 +179,7 @@
}
/* Allocate a KCB only */
- CurrentKcb = CmpAllocate(sizeof(CM_KEY_CONTROL_BLOCK), TRUE, TAG_CM);
+ CurrentKcb = CmpAllocate(sizeof(CM_KEY_CONTROL_BLOCK), TRUE, TAG_KCB);
if (CurrentKcb)
{
/* Set it up */
Modified: trunk/reactos/ntoskrnl/config/cmapi.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/ntoskrnl/config/cmapi.c?re…
==============================================================================
--- trunk/reactos/ntoskrnl/config/cmapi.c [iso-8859-1] (original)
+++ trunk/reactos/ntoskrnl/config/cmapi.c [iso-8859-1] Fri Sep 18 09:25:58 2015
@@ -2252,10 +2252,10 @@
/* Delete the flusher lock */
ExDeleteResourceLite(CmHive->FlusherLock);
- ExFreePoolWithTag(CmHive->FlusherLock, TAG_CM);
+ ExFreePoolWithTag(CmHive->FlusherLock, TAG_CMHIVE);
/* Delete the view lock */
- ExFreePoolWithTag(CmHive->ViewLock, TAG_CM);
+ ExFreePoolWithTag(CmHive->ViewLock, TAG_CMHIVE);
/* Free the hive */
CmpFree(CmHive, TAG_CM);
Modified: trunk/reactos/ntoskrnl/config/cminit.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/ntoskrnl/config/cminit.c?r…
==============================================================================
--- trunk/reactos/ntoskrnl/config/cminit.c [iso-8859-1] (original)
+++ trunk/reactos/ntoskrnl/config/cminit.c [iso-8859-1] Fri Sep 18 09:25:58 2015
@@ -84,7 +84,7 @@
}
/* Allocate the hive */
- Hive = ExAllocatePoolWithTag(NonPagedPool, sizeof(CMHIVE), TAG_CM);
+ Hive = ExAllocatePoolWithTag(NonPagedPool, sizeof(CMHIVE), TAG_CMHIVE);
if (!Hive) return STATUS_INSUFFICIENT_RESOURCES;
/* Setup null fields */
@@ -115,23 +115,23 @@
/* Allocate the view log */
Hive->ViewLock = ExAllocatePoolWithTag(NonPagedPool,
sizeof(KGUARDED_MUTEX),
- TAG_CM);
+ TAG_CMHIVE);
if (!Hive->ViewLock)
{
/* Cleanup allocation and fail */
- ExFreePoolWithTag(Hive, TAG_CM);
+ ExFreePoolWithTag(Hive, TAG_CMHIVE);
return STATUS_INSUFFICIENT_RESOURCES;
}
/* Allocate the flush lock */
Hive->FlusherLock = ExAllocatePoolWithTag(NonPagedPool,
sizeof(ERESOURCE),
- TAG_CM);
+ TAG_CMHIVE);
if (!Hive->FlusherLock)
{
/* Cleanup allocations and fail */
- ExFreePoolWithTag(Hive->ViewLock, TAG_CM);
- ExFreePoolWithTag(Hive, TAG_CM);
+ ExFreePoolWithTag(Hive->ViewLock, TAG_CMHIVE);
+ ExFreePoolWithTag(Hive, TAG_CMHIVE);
return STATUS_INSUFFICIENT_RESOURCES;
}
@@ -202,9 +202,9 @@
{
/* Cleanup allocations and fail */
ExDeleteResourceLite(Hive->FlusherLock);
- ExFreePoolWithTag(Hive->FlusherLock, TAG_CM);
- ExFreePoolWithTag(Hive->ViewLock, TAG_CM);
- ExFreePoolWithTag(Hive, TAG_CM);
+ ExFreePoolWithTag(Hive->FlusherLock, TAG_CMHIVE);
+ ExFreePoolWithTag(Hive->ViewLock, TAG_CMHIVE);
+ ExFreePoolWithTag(Hive, TAG_CMHIVE);
return Status;
}
@@ -220,9 +220,9 @@
{
/* Cleanup allocations and fail */
ExDeleteResourceLite(Hive->FlusherLock);
- ExFreePoolWithTag(Hive->FlusherLock, TAG_CM);
- ExFreePoolWithTag(Hive->ViewLock, TAG_CM);
- ExFreePoolWithTag(Hive, TAG_CM);
+ ExFreePoolWithTag(Hive->FlusherLock, TAG_CMHIVE);
+ ExFreePoolWithTag(Hive->ViewLock, TAG_CMHIVE);
+ ExFreePoolWithTag(Hive, TAG_CMHIVE);
return STATUS_REGISTRY_CORRUPT;
}
}
@@ -252,10 +252,10 @@
/* Delete the flusher lock */
ExDeleteResourceLite(CmHive->FlusherLock);
- ExFreePoolWithTag(CmHive->FlusherLock, TAG_CM);
+ ExFreePoolWithTag(CmHive->FlusherLock, TAG_CMHIVE);
/* Delete the view lock */
- ExFreePoolWithTag(CmHive->ViewLock, TAG_CM);
+ ExFreePoolWithTag(CmHive->ViewLock, TAG_CMHIVE);
/* Destroy the security descriptor cache */
CmpDestroySecurityCache(CmHive);
Modified: trunk/reactos/ntoskrnl/config/cmse.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/ntoskrnl/config/cmse.c?rev…
==============================================================================
--- trunk/reactos/ntoskrnl/config/cmse.c [iso-8859-1] (original)
+++ trunk/reactos/ntoskrnl/config/cmse.c [iso-8859-1] Fri Sep 18 09:25:58 2015
@@ -34,11 +34,11 @@
/* Phase 1: Allocate SIDs */
SidLength = RtlLengthRequiredSid(1);
- Sid[0] = ExAllocatePoolWithTag(PagedPool, SidLength, TAG_CM);
- Sid[1] = ExAllocatePoolWithTag(PagedPool, SidLength, TAG_CM);
- Sid[2] = ExAllocatePoolWithTag(PagedPool, SidLength, TAG_CM);
+ Sid[0] = ExAllocatePoolWithTag(PagedPool, SidLength, TAG_CMSD);
+ Sid[1] = ExAllocatePoolWithTag(PagedPool, SidLength, TAG_CMSD);
+ Sid[2] = ExAllocatePoolWithTag(PagedPool, SidLength, TAG_CMSD);
SidLength = RtlLengthRequiredSid(2);
- Sid[3] = ExAllocatePoolWithTag(PagedPool, SidLength, TAG_CM);
+ Sid[3] = ExAllocatePoolWithTag(PagedPool, SidLength, TAG_CMSD);
/* Make sure all SIDs were allocated */
if (!(Sid[0]) || !(Sid[1]) || !(Sid[2]) || !(Sid[3]))
@@ -78,7 +78,7 @@
}
/* Phase 3: Allocate the ACL */
- Acl = ExAllocatePoolWithTag(PagedPool, AclLength, TAG_CM);
+ Acl = ExAllocatePoolWithTag(PagedPool, AclLength, TAG_CMSD);
if (!Acl) KeBugCheckEx(REGISTRY_ERROR, 11, 3, 0, 0);
/* Phase 4: Create the ACL */
@@ -110,7 +110,7 @@
SecurityDescriptor = ExAllocatePoolWithTag(PagedPool,
sizeof(SECURITY_DESCRIPTOR) +
AclLength,
- TAG_CM);
+ TAG_CMSD);
if (!SecurityDescriptor) KeBugCheckEx(REGISTRY_ERROR, 11, 6, 0, 0);
/* Phase 6: Make a copy of the ACL */
@@ -130,8 +130,8 @@
if (!NT_SUCCESS(Status)) KeBugCheckEx(REGISTRY_ERROR, 11, 8, Status, 0);
/* Free the SIDs and original ACL */
- for (i = 0; i < 4; i++) ExFreePoolWithTag(Sid[i], TAG_CM);
- ExFreePoolWithTag(Acl, TAG_CM);
+ for (i = 0; i < 4; i++) ExFreePoolWithTag(Sid[i], TAG_CMSD);
+ ExFreePoolWithTag(Acl, TAG_CMSD);
/* Return the security descriptor */
return SecurityDescriptor;
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] Fri Sep 18 09:25:58 2015
@@ -980,7 +980,7 @@
SecurityDescriptor);
/* Free the security descriptor */
- ExFreePoolWithTag(SecurityDescriptor, TAG_CM);
+ ExFreePoolWithTag(SecurityDescriptor, TAG_CMSD);
if (!NT_SUCCESS(Status)) return FALSE;
/* Add the hive to the hive list */
@@ -1124,7 +1124,7 @@
0,
0,
(PVOID*)&RootKey);
- ExFreePoolWithTag(SecurityDescriptor, TAG_CM);
+ ExFreePoolWithTag(SecurityDescriptor, TAG_CMSD);
if (!NT_SUCCESS(Status)) return FALSE;
/* Sanity check, and get the key cell */
@@ -1551,7 +1551,7 @@
}
/* Get rid of the SD */
- ExFreePoolWithTag(SecurityDescriptor, TAG_CM);
+ ExFreePoolWithTag(SecurityDescriptor, TAG_CMSD);
/* Link SECURITY to SAM */
CmpLinkKeyToHive(L"\\Registry\\Machine\\Security\\SAM",
@@ -1747,7 +1747,7 @@
CmpAddToHiveFileList(HardwareHive);
/* Free the security descriptor */
- ExFreePoolWithTag(SecurityDescriptor, TAG_CM);
+ ExFreePoolWithTag(SecurityDescriptor, TAG_CMSD);
/* Fill out the Hardware key with the ARC Data from the Loader */
Status = CmpInitializeHardwareConfiguration(KeLoaderBlock);