mirror of
https://github.com/reactos/reactos.git
synced 2024-12-28 01:55:19 +00:00
Revert r18064 and correctly set the cell size for hash cells.
svn path=/trunk/; revision=18070
This commit is contained in:
parent
800ecc9875
commit
7df1c3d13b
1 changed files with 7 additions and 12 deletions
|
@ -3033,6 +3033,7 @@ CmiAllocateHashTableCell (IN PREGISTRY_HIVE RegistryHive,
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
ASSERT(SubKeyCount <= 0xffff); /* should really be USHORT_MAX or similar */
|
ASSERT(SubKeyCount <= 0xffff); /* should really be USHORT_MAX or similar */
|
||||||
|
NewHashBlock->CellSize = -NewHashSize;
|
||||||
NewHashBlock->Id = REG_HASH_TABLE_CELL_ID;
|
NewHashBlock->Id = REG_HASH_TABLE_CELL_ID;
|
||||||
NewHashBlock->HashTableSize = (USHORT)SubKeyCount;
|
NewHashBlock->HashTableSize = (USHORT)SubKeyCount;
|
||||||
*HashBlock = NewHashBlock;
|
*HashBlock = NewHashBlock;
|
||||||
|
@ -3456,20 +3457,14 @@ CmiDestroyCell (PREGISTRY_HIVE RegistryHive,
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
PCELL_HEADER pFree = Cell;
|
PCELL_HEADER pFree = Cell;
|
||||||
PHASH_TABLE_CELL pHash = Cell;
|
|
||||||
LONG CellSize;
|
|
||||||
|
|
||||||
if (pHash->Id == REG_HASH_TABLE_CELL_ID)
|
if (pFree->CellSize < 0)
|
||||||
CellSize = sizeof(HASH_TABLE_CELL) + pHash->HashTableSize * sizeof(HASH_RECORD);
|
pFree->CellSize = -pFree->CellSize;
|
||||||
else
|
|
||||||
CellSize = abs(pFree->CellSize);
|
/* Clear block (except the block size) */
|
||||||
|
RtlZeroMemory(((char*)pFree) + sizeof(ULONG),
|
||||||
|
pFree->CellSize - sizeof(ULONG));
|
||||||
|
|
||||||
/* Clear block */
|
|
||||||
RtlZeroMemory(pFree, CellSize);
|
|
||||||
|
|
||||||
/* restore CellSize */
|
|
||||||
pFree->CellSize = CellSize;
|
|
||||||
|
|
||||||
/* Add block to the list of free blocks */
|
/* Add block to the list of free blocks */
|
||||||
CmiAddFree(RegistryHive, Cell, CellOffset, TRUE);
|
CmiAddFree(RegistryHive, Cell, CellOffset, TRUE);
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue