Don't corrupt the registry when deleting a REG_DWORD value

svn path=/trunk/; revision=11217
This commit is contained in:
Gé van Geldorp 2004-10-07 18:00:10 +00:00
parent 5be7877f22
commit 1541b702fa

View file

@ -2626,7 +2626,8 @@ CmiRemoveSubKey(PREGISTRY_HIVE RegistryHive,
return STATUS_UNSUCCESSFUL;
}
if (ValueCell->DataSize > sizeof(BLOCK_OFFSET))
if (!(ValueCell->DataSize & REG_DATA_IN_OFFSET)
&& ValueCell->DataSize > sizeof(BLOCK_OFFSET))
{
DataCell = CmiGetCell (RegistryHive,
ValueCell->DataOffset,
@ -3219,7 +3220,8 @@ CmiDestroyValueCell(PREGISTRY_HIVE RegistryHive,
VERIFY_VALUE_CELL(ValueCell);
/* Destroy the data cell */
if (ValueCell->DataSize > sizeof(BLOCK_OFFSET))
if (!(ValueCell->DataSize & REG_DATA_IN_OFFSET)
&& ValueCell->DataSize > sizeof(BLOCK_OFFSET))
{
DataCell = CmiGetCell (RegistryHive, ValueCell->DataOffset, &Bin);
if (DataCell == NULL)