PDA

View Full Version : I can not find the define HvInitializeHive()


yangzhengbao
03-30-2006, 08:26 AM
ntos\boot\bldr\regboot.c


BOOLEAN
BlInitializeHive(
IN PVOID HiveImage,
IN PCMHIVE Hive,
IN BOOLEAN IsAlternate
)

/*++

Routine Description:

Initializes the hive data structure based on the in-memory hive image.

Arguments:

HiveImage - Supplies a pointer to the in-memory hive image.

Hive - Supplies the CMHIVE structure to be filled in.

IsAlternate - Supplies whether or not the hive is the alternate hive,
which indicates that the primary hive is corrupt and should be
rewritten by the system.

Return Value:

TRUE - Hive successfully initialized.

FALSE - Hive is corrupt.

--*/
{
NTSTATUS status;
ULONG HiveCheckCode;

status = HvInitializeHive(
&Hive->Hive,
HINIT_MEMORY_INPLACE,
FALSE,
IsAlternate ? HFILE_TYPE_ALTERNATE : HFILE_TYPE_PRIMARY,
HiveImage,
(PALLOCATE_ROUTINE)BlpHiveAllocate, // allocate
NULL, // free
NULL, // setsize
NULL, // write
NULL, // read
NULL, // flush
1, // cluster
NULL
);

if (!NT_SUCCESS(status)) {
return FALSE;
}

HiveCheckCode = CmCheckRegistry(Hive,TRUE);
if (HiveCheckCode != 0) {
return(FALSE);
} else {
return TRUE;
}

}

rwid
04-01-2006, 04:28 AM
I don't think it's wise to post source code, even though it may be helpful...

this 'HvInitializeHive()' function appears to match the function from my disassembly at virtual address 0042F7CA in osloader.exe, and 'BlInitializeHive()' is at address 0042529C... is that what you want?