summary |
shortlog |
log |
commit | commitdiff |
tree
raw |
patch |
inline | side by side (from parent 1:
800ecc9)
svn path=/trunk/; revision=18070
else
{
ASSERT(SubKeyCount <= 0xffff); /* should really be USHORT_MAX or similar */
else
{
ASSERT(SubKeyCount <= 0xffff); /* should really be USHORT_MAX or similar */
+ NewHashBlock->CellSize = -NewHashSize;
NewHashBlock->Id = REG_HASH_TABLE_CELL_ID;
NewHashBlock->HashTableSize = (USHORT)SubKeyCount;
*HashBlock = NewHashBlock;
NewHashBlock->Id = REG_HASH_TABLE_CELL_ID;
NewHashBlock->HashTableSize = (USHORT)SubKeyCount;
*HashBlock = NewHashBlock;
else
{
PCELL_HEADER pFree = Cell;
else
{
PCELL_HEADER pFree = Cell;
- PHASH_TABLE_CELL pHash = Cell;
- LONG CellSize;
- if (pHash->Id == REG_HASH_TABLE_CELL_ID)
- CellSize = sizeof(HASH_TABLE_CELL) + pHash->HashTableSize * sizeof(HASH_RECORD);
- else
- CellSize = abs(pFree->CellSize);
-
- /* Clear block */
- RtlZeroMemory(pFree, CellSize);
-
- /* restore CellSize */
- pFree->CellSize = CellSize;
-
+ if (pFree->CellSize < 0)
+ pFree->CellSize = -pFree->CellSize;
+
+ /* Clear block (except the block size) */
+ RtlZeroMemory(((char*)pFree) + sizeof(ULONG),
+ pFree->CellSize - sizeof(ULONG));
+
/* Add block to the list of free blocks */
CmiAddFree(RegistryHive, Cell, CellOffset, TRUE);
/* Add block to the list of free blocks */
CmiAddFree(RegistryHive, Cell, CellOffset, TRUE);