mirror of
https://github.com/reactos/reactos.git
synced 2024-12-28 01:55:19 +00:00
Fixed value list cell resizing bug.
svn path=/trunk/; revision=4385
This commit is contained in:
parent
71c0c0f710
commit
a4e1a6d03d
1 changed files with 30 additions and 27 deletions
|
@ -33,6 +33,8 @@
|
|||
#define ROUND_UP(N, S) ((((N) + (S) - 1) / (S)) * (S))
|
||||
#define ROUND_DOWN(N, S) ((N) - ((N) % (S)))
|
||||
|
||||
#define ABS_VALUE(V) (((V) < 0) ? -(V) : (V))
|
||||
|
||||
BOOLEAN CmiDoVerify = FALSE;
|
||||
|
||||
static ULONG
|
||||
|
@ -2464,14 +2466,14 @@ CmiAddValueToKey(IN PREGISTRY_HIVE RegistryHive,
|
|||
}
|
||||
KeyCell->ValuesOffset = VLBOffset;
|
||||
}
|
||||
else if ((KeyCell->NumberOfValues
|
||||
>= (ULONG) ((LONG) (ValueListCell->CellSize - 4)) / (LONG) sizeof(BLOCK_OFFSET)))
|
||||
else if (KeyCell->NumberOfValues >=
|
||||
(((ULONG)ABS_VALUE(ValueListCell->CellSize) - 4) / sizeof(BLOCK_OFFSET)))
|
||||
{
|
||||
Status = CmiAllocateBlock(RegistryHive,
|
||||
(PVOID) &NewValueListCell,
|
||||
sizeof(BLOCK_OFFSET) * (KeyCell->NumberOfValues + REG_VALUE_LIST_CELL_MULTIPLE),
|
||||
(KeyCell->NumberOfValues + REG_VALUE_LIST_CELL_MULTIPLE) *
|
||||
sizeof(BLOCK_OFFSET),
|
||||
&VLBOffset);
|
||||
|
||||
if (!NT_SUCCESS(Status))
|
||||
{
|
||||
CmiDestroyValueCell(RegistryHive, NewValueCell, VBOffset);
|
||||
|
@ -2486,10 +2488,11 @@ CmiAddValueToKey(IN PREGISTRY_HIVE RegistryHive,
|
|||
ValueListCell = NewValueListCell;
|
||||
}
|
||||
|
||||
DPRINT("KeyCell->NumberOfValues %d, ValueListCell->CellSize %d (%d %x)\n",
|
||||
KeyCell->NumberOfValues, ValueListCell->CellSize,
|
||||
-(ValueListCell->CellSize - 4) / sizeof(BLOCK_OFFSET),
|
||||
-(ValueListCell->CellSize - 4) / sizeof(BLOCK_OFFSET));
|
||||
DPRINT("KeyCell->NumberOfValues %lu, ValueListCell->CellSize %lu (%lu %lx)\n",
|
||||
KeyCell->NumberOfValues,
|
||||
(ULONG)ABS_VALUE(ValueListCell->CellSize),
|
||||
((ULONG)ABS_VALUE(ValueListCell->CellSize) - 4) / sizeof(BLOCK_OFFSET),
|
||||
((ULONG)ABS_VALUS(ValueListCell->CellSize) - 4) / sizeof(BLOCK_OFFSET));
|
||||
|
||||
ValueListCell->Values[KeyCell->NumberOfValues] = VBOffset;
|
||||
KeyCell->NumberOfValues++;
|
||||
|
|
Loading…
Reference in a new issue