Skip to content

Commit

Permalink
[ROSLOAD] Enable registry healing code for x64
Browse files Browse the repository at this point in the history
  • Loading branch information
tkreuzer committed Nov 3, 2024
1 parent 13452f8 commit 9b5c887
Showing 1 changed file with 0 additions and 22 deletions.
22 changes: 0 additions & 22 deletions boot/freeldr/freeldr/ntldr/registry.c
Original file line number Diff line number Diff line change
Expand Up @@ -99,14 +99,7 @@ RegInitializeHive(
_In_ BOOLEAN LoadAlternate)
{
NTSTATUS Status;
/*
* FIXME: Disable compilation of some parts of code for AMD64 for now,
* since it makes the FreeLdr binary size so large that it prevents
* x64 ROS from booting.
*/
#if !defined(_M_AMD64)
CM_CHECK_REGISTRY_STATUS CmStatusCode;
#endif

/* Initialize the hive */
Status = HvInitialize(GET_HHIVE(CmHive),
Expand All @@ -128,22 +121,17 @@ RegInitializeHive(
return FALSE;
}

/* FIXME: See the comment above */
#if !defined(_M_AMD64)
/* Now check the hive and purge volatile data */
CmStatusCode = CmCheckRegistry(CmHive, CM_CHECK_REGISTRY_BOOTLOADER_PURGE_VOLATILES | CM_CHECK_REGISTRY_VALIDATE_HIVE);
if (!CM_CHECK_REGISTRY_SUCCESS(CmStatusCode))
{
ERR("CmCheckRegistry detected problems with the loaded flat hive (check code %lu)\n", CmStatusCode);
return FALSE;
}
#endif

return TRUE;
}

/* FIXME: See the comment above */
#if !defined(_M_AMD64)
/**
* @brief
* Loads and reads a hive log at specified
Expand Down Expand Up @@ -418,7 +406,6 @@ RegRecoverDataHive(
HiveBaseBlock->CheckSum = HvpHiveHeaderChecksum(HiveBaseBlock);
return TRUE;
}
#endif

/**
* @brief
Expand Down Expand Up @@ -464,14 +451,6 @@ RegImportBinaryHive(
CmSystemHive = FrLdrTempAlloc(sizeof(CMHIVE), 'eviH');
Success = RegInitializeHive(CmSystemHive, ChunkBase, LoadAlternate);
if (!Success)
/* FIXME: See the comment above */
#if defined(_M_AMD64)
{
ERR("Corrupted hive %p!\n", ChunkBase);
FrLdrTempFree(CmSystemHive, 'eviH');
return FALSE;
}
#else
{
/* Free the buffer and retry again */
FrLdrTempFree(CmSystemHive, 'eviH');
Expand Down Expand Up @@ -505,7 +484,6 @@ RegImportBinaryHive(
*/
((PHBASE_BLOCK)ChunkBase)->BootRecover = HBOOT_BOOT_RECOVERED_BY_HIVE_LOG;
}
#endif

/* Save the root key node */
SystemHive = GET_HHIVE(CmSystemHive);
Expand Down

0 comments on commit 9b5c887

Please sign in to comment.