From 1541b702fab259140baed842c13b530e58972b9b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?G=C3=A9=20van=20Geldorp?= Date: Thu, 7 Oct 2004 18:00:10 +0000 Subject: [PATCH] Don't corrupt the registry when deleting a REG_DWORD value svn path=/trunk/; revision=11217 --- reactos/ntoskrnl/cm/regfile.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/reactos/ntoskrnl/cm/regfile.c b/reactos/ntoskrnl/cm/regfile.c index ac5f99b7e9f..912ad8acee6 100644 --- a/reactos/ntoskrnl/cm/regfile.c +++ b/reactos/ntoskrnl/cm/regfile.c @@ -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)