mirror of
https://github.com/reactos/reactos.git
synced 2024-12-27 17:44:45 +00:00
- Fix usage of RtlFindSetBits and loops in CmiStartLogUpdate and CmiStartHiveUpdate.
svn path=/trunk/; revision=11054
This commit is contained in:
parent
3823d945f5
commit
630b1b2eb3
1 changed files with 8 additions and 6 deletions
|
@ -1397,6 +1397,7 @@ CmiStartLogUpdate(PREGISTRY_HIVE RegistryHive)
|
|||
PUCHAR Buffer;
|
||||
PUCHAR Ptr;
|
||||
ULONG BlockIndex;
|
||||
ULONG LastIndex;
|
||||
PVOID BlockPtr;
|
||||
NTSTATUS Status;
|
||||
|
||||
|
@ -1486,13 +1487,13 @@ CmiStartLogUpdate(PREGISTRY_HIVE RegistryHive)
|
|||
/* Write dirty blocks */
|
||||
FileOffset.QuadPart = (ULONGLONG)BufferSize;
|
||||
BlockIndex = 0;
|
||||
while (TRUE)
|
||||
while (BlockIndex < RegistryHive->BlockListSize)
|
||||
{
|
||||
LastIndex = BlockIndex;
|
||||
BlockIndex = RtlFindSetBits(&RegistryHive->DirtyBitMap,
|
||||
1,
|
||||
BlockIndex);
|
||||
if ((BlockIndex == (ULONG)-1) ||
|
||||
(BlockIndex >= RegistryHive->BlockListSize))
|
||||
if (BlockIndex == (ULONG)-1 || BlockIndex < LastIndex)
|
||||
{
|
||||
DPRINT("No more set bits\n");
|
||||
Status = STATUS_SUCCESS;
|
||||
|
@ -1771,6 +1772,7 @@ CmiStartHiveUpdate(PREGISTRY_HIVE RegistryHive)
|
|||
HANDLE FileHandle;
|
||||
LARGE_INTEGER FileOffset;
|
||||
ULONG BlockIndex;
|
||||
ULONG LastIndex;
|
||||
PVOID BlockPtr;
|
||||
NTSTATUS Status;
|
||||
|
||||
|
@ -1823,13 +1825,13 @@ CmiStartHiveUpdate(PREGISTRY_HIVE RegistryHive)
|
|||
}
|
||||
|
||||
BlockIndex = 0;
|
||||
while (TRUE)
|
||||
while (BlockIndex < RegistryHive->BlockListSize)
|
||||
{
|
||||
LastIndex = BlockIndex;
|
||||
BlockIndex = RtlFindSetBits(&RegistryHive->DirtyBitMap,
|
||||
1,
|
||||
BlockIndex);
|
||||
if ((BlockIndex == (ULONG)-1) ||
|
||||
(BlockIndex >= RegistryHive->BlockListSize))
|
||||
if (BlockIndex == (ULONG)-1 || BlockIndex < LastIndex)
|
||||
{
|
||||
DPRINT("No more set bits\n");
|
||||
Status = STATUS_SUCCESS;
|
||||
|
|
Loading…
Reference in a new issue