https://git.reactos.org/?p=reactos.git;a=commitdiff;h=cce399e772d30f360f4b8…
commit cce399e772d30f360f4b8ed578939adc75eea243
Author: George Bișoc <george.bisoc(a)reactos.org>
AuthorDate: Wed Oct 26 21:32:46 2022 +0200
Commit: George Bișoc <george.bisoc(a)reactos.org>
CommitDate: Sun Nov 19 20:44:28 2023 +0100
[ROSLOAD] Use CmCheckRegistry to purge volatile data
---
boot/environ/lib/misc/bootreg.c | 8 +++++++-
1 file changed, 7 insertions(+), 1 deletion(-)
diff --git a/boot/environ/lib/misc/bootreg.c b/boot/environ/lib/misc/bootreg.c
index 0551e4c7884..0a32a73f955 100644
--- a/boot/environ/lib/misc/bootreg.c
+++ b/boot/environ/lib/misc/bootreg.c
@@ -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;
}