[ROSLOAD] Use CmCheckRegistry to purge volatile data

This commit is contained in:
George Bișoc 2022-10-26 21:32:46 +02:00
parent 4db1b0fb62
commit cce399e772
No known key found for this signature in database
GPG Key ID: 688C4FBE25D7DEF6

View File

@ -318,6 +318,7 @@ BiInitializeAndValidateHive (
)
{
ULONG HiveSize;
CM_CHECK_REGISTRY_STATUS CmStatusCode;
NTSTATUS Status;
/* Make sure the hive is at least the size of a base block */
@ -351,7 +352,12 @@ BiInitializeAndValidateHive (
if (NT_SUCCESS(Status))
{
/* Cleanup volatile/old data */
CmPrepareHive(&Hive->Hive.Hive); // CmCheckRegistry
CmStatusCode = CmCheckRegistry(Hive->Hive, CM_CHECK_REGISTRY_BOOTLOADER_PURGE_VOLATILES | CM_CHECK_REGISTRY_VALIDATE_HIVE);
if (!CM_CHECK_REGISTRY_SUCCESS(CmStatusCode))
{
return STATUS_REGISTRY_CORRUPT;
}
Status = STATUS_SUCCESS;
}