mirror of
https://github.com/reactos/reactos.git
synced 2025-05-19 17:14:32 +00:00
[SDK:CMLIB] Use Hive->Allocate / Hive->Free where possible.
This commit is contained in:
parent
b79fbe2333
commit
6a03fb7099
2 changed files with 6 additions and 10 deletions
|
@ -793,9 +793,7 @@ CmpMarkIndexDirty(IN PHHIVE Hive,
|
||||||
SearchName.Length = CmpCompressedNameSize(Node->Name,
|
SearchName.Length = CmpCompressedNameSize(Node->Name,
|
||||||
Node->NameLength);
|
Node->NameLength);
|
||||||
SearchName.MaximumLength = SearchName.Length;
|
SearchName.MaximumLength = SearchName.Length;
|
||||||
SearchName.Buffer = CmpAllocate(SearchName.Length,
|
SearchName.Buffer = Hive->Allocate(SearchName.Length, TRUE, TAG_CM);
|
||||||
TRUE,
|
|
||||||
TAG_CM);
|
|
||||||
if (!SearchName.Buffer)
|
if (!SearchName.Buffer)
|
||||||
{
|
{
|
||||||
/* Fail */
|
/* Fail */
|
||||||
|
@ -889,7 +887,7 @@ CmpMarkIndexDirty(IN PHHIVE Hive,
|
||||||
if (Child != HCELL_NIL)
|
if (Child != HCELL_NIL)
|
||||||
{
|
{
|
||||||
/* We found it, free the name now */
|
/* We found it, free the name now */
|
||||||
if (IsCompressed) CmpFree(SearchName.Buffer, 0);
|
if (IsCompressed) Hive->Free(SearchName.Buffer, 0);
|
||||||
|
|
||||||
/* Release the parent key */
|
/* Release the parent key */
|
||||||
HvReleaseCell(Hive, ParentKey);
|
HvReleaseCell(Hive, ParentKey);
|
||||||
|
@ -914,7 +912,7 @@ Quickie:
|
||||||
if (CellToRelease != HCELL_NIL) HvReleaseCell(Hive, CellToRelease);
|
if (CellToRelease != HCELL_NIL) HvReleaseCell(Hive, CellToRelease);
|
||||||
|
|
||||||
/* Free the search name and return failure */
|
/* Free the search name and return failure */
|
||||||
if (IsCompressed) CmpFree(SearchName.Buffer, 0);
|
if (IsCompressed) Hive->Free(SearchName.Buffer, 0);
|
||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1731,9 +1729,7 @@ CmpRemoveSubKey(IN PHHIVE Hive,
|
||||||
if (SearchName.MaximumLength > sizeof(Buffer))
|
if (SearchName.MaximumLength > sizeof(Buffer))
|
||||||
{
|
{
|
||||||
/* Allocate one */
|
/* Allocate one */
|
||||||
SearchName.Buffer = CmpAllocate(SearchName.Length,
|
SearchName.Buffer = Hive->Allocate(SearchName.Length, TRUE, TAG_CM);
|
||||||
TRUE,
|
|
||||||
TAG_CM);
|
|
||||||
if (!SearchName.Buffer) return FALSE;
|
if (!SearchName.Buffer) return FALSE;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
@ -1872,7 +1868,7 @@ Exit:
|
||||||
if ((IsCompressed) && (SearchName.MaximumLength > sizeof(Buffer)))
|
if ((IsCompressed) && (SearchName.MaximumLength > sizeof(Buffer)))
|
||||||
{
|
{
|
||||||
/* Free the buffer we allocated */
|
/* Free the buffer we allocated */
|
||||||
CmpFree(SearchName.Buffer, 0);
|
Hive->Free(SearchName.Buffer, 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Return the result */
|
/* Return the result */
|
||||||
|
|
|
@ -194,7 +194,7 @@ CmpValueToData(IN PHHIVE Hive,
|
||||||
if (BufferAllocated)
|
if (BufferAllocated)
|
||||||
{
|
{
|
||||||
/* Free the buffer and bugcheck */
|
/* Free the buffer and bugcheck */
|
||||||
CmpFree(Buffer, 0);
|
Hive->Free(Buffer, 0);
|
||||||
KeBugCheckEx(REGISTRY_ERROR, 8, 0, (ULONG_PTR)Hive, (ULONG_PTR)Value);
|
KeBugCheckEx(REGISTRY_ERROR, 8, 0, (ULONG_PTR)Hive, (ULONG_PTR)Value);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue