- FileOffset is 32bit long, not 64bit, so no reason in additional casting.

- Fix a ULONG -> BOOLEAN conversion warning.

svn path=/trunk/; revision=36367
This commit is contained in:
Aleksey Bragin 2008-09-21 11:34:04 +00:00
parent 463ffc2132
commit 0230d25b11
2 changed files with 8 additions and 2 deletions

View file

@ -124,6 +124,8 @@ BOOLEAN CMAPI
HvIsCellDirty(IN PHHIVE Hive, HvIsCellDirty(IN PHHIVE Hive,
IN HCELL_INDEX Cell) IN HCELL_INDEX Cell)
{ {
BOOLEAN IsDirty = FALSE;
/* Sanity checks */ /* Sanity checks */
ASSERT(Hive->ReadOnly == FALSE); ASSERT(Hive->ReadOnly == FALSE);
@ -132,7 +134,11 @@ HvIsCellDirty(IN PHHIVE Hive,
return TRUE; return TRUE;
/* Check if the dirty bit is set */ /* Check if the dirty bit is set */
return RtlCheckBit(&Hive->DirtyVector, Cell / HV_BLOCK_SIZE); if (RtlCheckBit(&Hive->DirtyVector, Cell / HV_BLOCK_SIZE))
IsDirty = TRUE;
/* Return result as boolean*/
return IsDirty;
} }
static ULONG __inline CMAPI static ULONG __inline CMAPI

View file

@ -189,7 +189,7 @@ HvpWriteHive(
} }
BlockPtr = (PVOID)RegistryHive->Storage[Stable].BlockList[BlockIndex].BlockAddress; BlockPtr = (PVOID)RegistryHive->Storage[Stable].BlockList[BlockIndex].BlockAddress;
FileOffset = (ULONGLONG)(BlockIndex + 1) * (ULONGLONG)HV_BLOCK_SIZE; FileOffset = (BlockIndex + 1) * HV_BLOCK_SIZE;
/* Write hive block */ /* Write hive block */
Success = RegistryHive->FileWrite(RegistryHive, HFILE_TYPE_PRIMARY, Success = RegistryHive->FileWrite(RegistryHive, HFILE_TYPE_PRIMARY,