Author: janderwald Date: Sat Jun 3 16:48:09 2006 New Revision: 22192
URL: http://svn.reactos.ru/svn/reactos?rev=22192&view=rev Log: fix bug in CmiCreateHiveFreeCellList when a cell has size 0 which leads to inifite loop fix bug in CmiCreateTempHive where only a pointer was allocated for the first cell but not object itself
Modified: trunk/reactos/ntoskrnl/cm/regfile.c (contents, props changed)
Modified: trunk/reactos/ntoskrnl/cm/regfile.c URL: http://svn.reactos.ru/svn/reactos/trunk/reactos/ntoskrnl/cm/regfile.c?rev=22... ============================================================================== --- trunk/reactos/ntoskrnl/cm/regfile.c (original) +++ trunk/reactos/ntoskrnl/cm/regfile.c Sat Jun 3 16:48:09 2006 @@ -783,10 +783,24 @@
FreeOffset += FreeBlock->CellSize; } - else + else if (FreeBlock->CellSize < 0) { FreeOffset -= FreeBlock->CellSize; } + else + { +#ifdef HIVE_CHECK + /* Check and eventually fix a hive */ + Status = CmiCheckAndFixHive(Hive); + if (!NT_SUCCESS(Status)) + { + DPRINT1("CmiCheckAndFixHive() failed (Status %lx)\n", Status); + return(Status); + } +#else + break; +#endif + } }
BlockIndex += Bin->BinSize / REG_BLOCK_SIZE; @@ -1164,7 +1178,7 @@
/* Allocate hive block list */ Hive->BlockList = ExAllocatePool (NonPagedPool, - sizeof(PBLOCK_LIST_ENTRY)); + sizeof(BLOCK_LIST_ENTRY)); if (Hive->BlockList == NULL) { DPRINT1 ("Failed to allocate hive block list\n");
Propchange: trunk/reactos/ntoskrnl/cm/regfile.c ------------------------------------------------------------------------------ --- svn:needs-lock (original) +++ svn:needs-lock (removed) @@ -1,1 +1,0 @@ -*