Author: hpoussin
Date: Sun Aug 30 21:20:30 2009
New Revision: 42974
URL:
http://svn.reactos.org/svn/reactos?rev=42974&view=rev
Log:
Use memory wrappers instead of ExAllocatePool/ExFreePool directly
Modified:
trunk/reactos/ntoskrnl/config/cmalloc.c
trunk/reactos/ntoskrnl/config/cmindex.c
trunk/reactos/ntoskrnl/config/cmkcbncb.c
trunk/reactos/ntoskrnl/config/cmvalche.c
trunk/reactos/ntoskrnl/config/cmvalue.c
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] Sun Aug 30 21:20:30 2009
@@ -62,7 +62,7 @@
if (!Kcb->PrivateAlloc)
{
/* Free it from the pool */
- ExFreePoolWithTag(Kcb, TAG_CM);
+ CmpFree(Kcb, 0);
return;
}
@@ -98,7 +98,7 @@
}
/* Free the page */
- ExFreePoolWithTag(AllocPage, TAG_CM);
+ CmpFree(AllocPage, 0);
}
/* Release the lock */
@@ -151,7 +151,7 @@
}
/* Allocate an allocation page */
- AllocPage = ExAllocatePoolWithTag(PagedPool, PAGE_SIZE, TAG_CM);
+ AllocPage = CmpAllocate(PAGE_SIZE, TRUE, TAG_CM);
if (AllocPage)
{
/* Set default entries */
@@ -178,9 +178,9 @@
}
/* Allocate a KCB only */
- CurrentKcb = ExAllocatePoolWithTag(PagedPool,
- sizeof(CM_KEY_CONTROL_BLOCK),
- TAG_CM);
+ CurrentKcb = CmpAllocate(sizeof(CM_KEY_CONTROL_BLOCK),
+ TRUE,
+ TAG_CM);
if (CurrentKcb)
{
/* Set it up */
@@ -231,7 +231,7 @@
}
/* Allocate an allocation page */
- AllocPage = ExAllocatePoolWithTag(PagedPool, PAGE_SIZE, TAG_CM);
+ AllocPage = CmpAllocate(PAGE_SIZE, TRUE, TAG_CM);
if (AllocPage)
{
/* Set default entries */
@@ -295,7 +295,7 @@
}
/* Now free the page */
- ExFreePoolWithTag(AllocPage, TAG_CM);
+ CmpFree(AllocPage, 0);
}
/* Release the lock */
Modified: trunk/reactos/ntoskrnl/config/cmindex.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/ntoskrnl/config/cmindex.c?…
==============================================================================
--- trunk/reactos/ntoskrnl/config/cmindex.c [iso-8859-1] (original)
+++ trunk/reactos/ntoskrnl/config/cmindex.c [iso-8859-1] Sun Aug 30 21:20:30 2009
@@ -821,9 +821,9 @@
SearchName.Length = CmpCompressedNameSize(Node->Name,
Node->NameLength);
SearchName.MaximumLength = SearchName.Length;
- SearchName.Buffer = ExAllocatePoolWithTag(PagedPool,
- SearchName.Length,
- TAG_CM);
+ SearchName.Buffer = CmpAllocate(SearchName.Length,
+ TRUE,
+ TAG_CM);
if (!SearchName.Buffer)
{
/* Fail */
@@ -917,7 +917,7 @@
if (Child != HCELL_NIL)
{
/* We found it, free the name now */
- if (IsCompressed) ExFreePool(SearchName.Buffer);
+ if (IsCompressed) CmpFree(SearchName.Buffer, 0);
/* Release the parent key */
HvReleaseCell(Hive, ParentKey);
@@ -942,7 +942,7 @@
if (CellToRelease != HCELL_NIL) HvReleaseCell(Hive, CellToRelease);
/* Free the search name and return failure */
- if (IsCompressed) ExFreePool(SearchName.Buffer);
+ if (IsCompressed) CmpFree(SearchName.Buffer, 0);
return FALSE;
}
@@ -1758,9 +1758,9 @@
if (SearchName.MaximumLength > sizeof(Buffer))
{
/* Allocate one */
- SearchName.Buffer = ExAllocatePoolWithTag(PagedPool,
- SearchName.Length,
- TAG_CM);
+ SearchName.Buffer = CmpAllocate(SearchName.Length,
+ TRUE,
+ TAG_CM);
if (!SearchName.Buffer) return FALSE;
}
else
@@ -1899,7 +1899,7 @@
if ((IsCompressed) && (SearchName.MaximumLength > sizeof(Buffer)))
{
/* Free the buffer we allocated */
- ExFreePool(SearchName.Buffer);
+ CmpFree(SearchName.Buffer, 0);
}
/* Return the result */
Modified: trunk/reactos/ntoskrnl/config/cmkcbncb.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/ntoskrnl/config/cmkcbncb.c…
==============================================================================
--- trunk/reactos/ntoskrnl/config/cmkcbncb.c [iso-8859-1] (original)
+++ trunk/reactos/ntoskrnl/config/cmkcbncb.c [iso-8859-1] Sun Aug 30 21:20:30 2009
@@ -32,7 +32,7 @@
Length = CmpHashTableSize * sizeof(CM_KEY_HASH_TABLE_ENTRY);
/* Allocate it */
- CmpCacheTable = ExAllocatePoolWithTag(PagedPool, Length, TAG_CM);
+ CmpCacheTable = CmpAllocate(Length, TRUE, TAG_CM);
if (!CmpCacheTable)
{
/* Take the system down */
@@ -53,7 +53,7 @@
Length = CmpHashTableSize * sizeof(CM_NAME_HASH_TABLE_ENTRY);
/* Now allocate the name cache table */
- CmpNameCacheTable = ExAllocatePoolWithTag(PagedPool, Length, TAG_CM);
+ CmpNameCacheTable = CmpAllocate(Length, TRUE, TAG_CM);
if (!CmpNameCacheTable)
{
/* Take the system down */
@@ -249,7 +249,7 @@
{
/* Allocate one */
NcbSize = FIELD_OFFSET(CM_NAME_CONTROL_BLOCK, Name) + Length;
- Ncb = ExAllocatePoolWithTag(PagedPool, NcbSize, TAG_CM);
+ Ncb = CmpAllocate(NcbSize, TRUE, TAG_CM);
if (!Ncb)
{
/* Release the lock and fail */
@@ -343,7 +343,7 @@
}
/* Found it, now free it */
- ExFreePool(Ncb);
+ CmpFree(Ncb, 0);
}
/* Release the lock */
@@ -446,12 +446,12 @@
if (CMP_IS_CELL_CACHED(CachedList[i]))
{
/* Free it */
- ExFreePool((PVOID)CMP_GET_CACHED_CELL(CachedList[i]));
+ CmpFree((PVOID)CMP_GET_CACHED_CELL(CachedList[i]), 0);
}
}
/* Now free the list */
- ExFreePool((PVOID)CMP_GET_CACHED_CELL(Kcb->ValueCache.ValueList));
+ CmpFree((PVOID)CMP_GET_CACHED_CELL(Kcb->ValueCache.ValueList), 0);
Kcb->ValueCache.ValueList = HCELL_NIL;
}
else if (Kcb->ExtFlags & CM_KCB_SYM_LINK_FOUND)
@@ -490,7 +490,7 @@
CmpDereferenceNameControlBlockWithLock(Kcb->NameBlock);
/* Check if we have an index hint block and free it */
- if (Kcb->ExtFlags & CM_KCB_SUBKEY_HINT) ExFreePool(Kcb->IndexHint);
+ if (Kcb->ExtFlags & CM_KCB_SUBKEY_HINT) CmpFree(Kcb->IndexHint, 0);
/* Check if we were already deleted */
Parent = Kcb->ParentKcb;
@@ -529,7 +529,7 @@
if (Kcb->ExtFlags & (CM_KCB_SUBKEY_HINT))
{
/* Kill it */
- ExFreePool(Kcb->IndexHint);
+ CmpFree(Kcb->IndexHint, 0);
}
/* Remove subkey flags */
@@ -931,9 +931,9 @@
}
/* Allocate the unicode string now */
- KeyName = ExAllocatePoolWithTag(PagedPool,
- NameLength + sizeof(UNICODE_STRING),
- TAG_CM);
+ KeyName = CmpAllocate(NameLength + sizeof(UNICODE_STRING),
+ TRUE,
+ TAG_CM);
if (!KeyName) return NULL;
@@ -954,7 +954,7 @@
MyKcb->ExtFlags & CM_KCB_KEY_NON_EXIST)
{
/* Failure */
- ExFreePool(KeyName);
+ CmpFree(KeyName, 0);
return NULL;
}
@@ -967,7 +967,7 @@
if (!KeyNode)
{
/* Failure */
- ExFreePool(KeyName);
+ CmpFree(KeyName, 0);
return NULL;
}
}
Modified: trunk/reactos/ntoskrnl/config/cmvalche.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/ntoskrnl/config/cmvalche.c…
==============================================================================
--- trunk/reactos/ntoskrnl/config/cmvalche.c [iso-8859-1] (original)
+++ trunk/reactos/ntoskrnl/config/cmvalche.c [iso-8859-1] Sun Aug 30 21:20:30 2009
@@ -797,7 +797,7 @@
if (ValueCellToRelease) HvReleaseCell(Kcb->KeyHive, ValueCellToRelease);
/* Free the buffer */
- if (BufferAllocated) ExFreePool(Buffer);
+ if (BufferAllocated) CmpFree(Buffer, 0);
/* Free the cell */
if (CellToRelease) HvReleaseCell(Kcb->KeyHive, CellToRelease);
Modified: trunk/reactos/ntoskrnl/config/cmvalue.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/ntoskrnl/config/cmvalue.c?…
==============================================================================
--- trunk/reactos/ntoskrnl/config/cmvalue.c [iso-8859-1] (original)
+++ trunk/reactos/ntoskrnl/config/cmvalue.c [iso-8859-1] Sun Aug 30 21:20:30 2009
@@ -188,7 +188,7 @@
if (BufferAllocated)
{
/* Free the buffer and bugcheck */
- ExFreePool(Buffer);
+ CmpFree(Buffer, 0);
KeBugCheckEx(REGISTRY_ERROR, 8, 0, (ULONG_PTR)Hive, (ULONG_PTR)Value);
}