mirror of
https://github.com/reactos/reactos.git
synced 2024-10-31 20:02:55 +00:00
[FREELDR][HACK] Temporarily disable registry recovery code for AMD64
The newly implemented code for registry recovery makes the FreeLdr binary to grow in size, to the point that it would BSOD because the PE image is too big. For now we have to temporarily disable any of the newly added code, until either FreeLdr is split into a basic PE bootloader image itself and a "FreeLdrlib" that is used by the PE image to access various bootloader APIs or another proper solution is found.
This commit is contained in:
parent
7983b65e10
commit
fa80176a62
|
@ -99,7 +99,14 @@ RegInitializeHive(
|
||||||
_In_ BOOLEAN LoadAlternate)
|
_In_ BOOLEAN LoadAlternate)
|
||||||
{
|
{
|
||||||
NTSTATUS Status;
|
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;
|
CM_CHECK_REGISTRY_STATUS CmStatusCode;
|
||||||
|
#endif
|
||||||
|
|
||||||
/* Initialize the hive */
|
/* Initialize the hive */
|
||||||
Status = HvInitialize(GET_HHIVE(CmHive),
|
Status = HvInitialize(GET_HHIVE(CmHive),
|
||||||
|
@ -121,6 +128,8 @@ RegInitializeHive(
|
||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* FIXME: See the comment above */
|
||||||
|
#if !defined(_M_AMD64)
|
||||||
/* Now check the hive and purge volatile data */
|
/* Now check the hive and purge volatile data */
|
||||||
CmStatusCode = CmCheckRegistry(CmHive, CM_CHECK_REGISTRY_BOOTLOADER_PURGE_VOLATILES | CM_CHECK_REGISTRY_VALIDATE_HIVE);
|
CmStatusCode = CmCheckRegistry(CmHive, CM_CHECK_REGISTRY_BOOTLOADER_PURGE_VOLATILES | CM_CHECK_REGISTRY_VALIDATE_HIVE);
|
||||||
if (!CM_CHECK_REGISTRY_SUCCESS(CmStatusCode))
|
if (!CM_CHECK_REGISTRY_SUCCESS(CmStatusCode))
|
||||||
|
@ -128,10 +137,13 @@ RegInitializeHive(
|
||||||
ERR("CmCheckRegistry detected problems with the loaded flat hive (check code %lu)\n", CmStatusCode);
|
ERR("CmCheckRegistry detected problems with the loaded flat hive (check code %lu)\n", CmStatusCode);
|
||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
return TRUE;
|
return TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* FIXME: See the comment above */
|
||||||
|
#if !defined(_M_AMD64)
|
||||||
/**
|
/**
|
||||||
* @brief
|
* @brief
|
||||||
* Loads and reads a hive log at specified
|
* Loads and reads a hive log at specified
|
||||||
|
@ -406,6 +418,7 @@ RegRecoverDataHive(
|
||||||
HiveBaseBlock->CheckSum = HvpHiveHeaderChecksum(HiveBaseBlock);
|
HiveBaseBlock->CheckSum = HvpHiveHeaderChecksum(HiveBaseBlock);
|
||||||
return TRUE;
|
return TRUE;
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief
|
* @brief
|
||||||
|
@ -451,6 +464,14 @@ RegImportBinaryHive(
|
||||||
CmSystemHive = FrLdrTempAlloc(sizeof(CMHIVE), 'eviH');
|
CmSystemHive = FrLdrTempAlloc(sizeof(CMHIVE), 'eviH');
|
||||||
Success = RegInitializeHive(CmSystemHive, ChunkBase, LoadAlternate);
|
Success = RegInitializeHive(CmSystemHive, ChunkBase, LoadAlternate);
|
||||||
if (!Success)
|
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 */
|
/* Free the buffer and retry again */
|
||||||
FrLdrTempFree(CmSystemHive, 'eviH');
|
FrLdrTempFree(CmSystemHive, 'eviH');
|
||||||
|
@ -484,6 +505,7 @@ RegImportBinaryHive(
|
||||||
*/
|
*/
|
||||||
((PHBASE_BLOCK)ChunkBase)->BootRecover = HBOOT_BOOT_RECOVERED_BY_HIVE_LOG;
|
((PHBASE_BLOCK)ChunkBase)->BootRecover = HBOOT_BOOT_RECOVERED_BY_HIVE_LOG;
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
/* Save the root key node */
|
/* Save the root key node */
|
||||||
SystemHive = GET_HHIVE(CmSystemHive);
|
SystemHive = GET_HHIVE(CmSystemHive);
|
||||||
|
|
|
@ -619,6 +619,11 @@ HvpGetHiveHeader(
|
||||||
return HiveSuccess;
|
return HiveSuccess;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
* FIXME: Disable compilation for AMD64 for now since it makes
|
||||||
|
* the FreeLdr binary size so large it makes booting impossible.
|
||||||
|
*/
|
||||||
|
#if !defined(_M_AMD64)
|
||||||
/**
|
/**
|
||||||
* @brief
|
* @brief
|
||||||
* Computes the hive space size by querying
|
* Computes the hive space size by querying
|
||||||
|
@ -960,6 +965,7 @@ HvpRecoverDataFromLog(
|
||||||
|
|
||||||
return HiveSuccess;
|
return HiveSuccess;
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief
|
* @brief
|
||||||
|
@ -998,7 +1004,12 @@ HvLoadHive(
|
||||||
NTSTATUS Status;
|
NTSTATUS Status;
|
||||||
BOOLEAN Success;
|
BOOLEAN Success;
|
||||||
PHBASE_BLOCK BaseBlock = NULL;
|
PHBASE_BLOCK BaseBlock = NULL;
|
||||||
|
/* FIXME: See the comment above (near HvpQueryHiveSize) */
|
||||||
|
#if defined(_M_AMD64)
|
||||||
|
ULONG Result;
|
||||||
|
#else
|
||||||
ULONG Result, Result2;
|
ULONG Result, Result2;
|
||||||
|
#endif
|
||||||
LARGE_INTEGER TimeStamp;
|
LARGE_INTEGER TimeStamp;
|
||||||
ULONG Offset = 0;
|
ULONG Offset = 0;
|
||||||
PVOID HiveData;
|
PVOID HiveData;
|
||||||
|
@ -1044,6 +1055,12 @@ HvLoadHive(
|
||||||
|
|
||||||
/* Hive header needs a repair */
|
/* Hive header needs a repair */
|
||||||
case RecoverHeader:
|
case RecoverHeader:
|
||||||
|
/* FIXME: See the comment above (near HvpQueryHiveSize) */
|
||||||
|
#if defined(_M_AMD64)
|
||||||
|
{
|
||||||
|
return STATUS_REGISTRY_CORRUPT;
|
||||||
|
}
|
||||||
|
#else
|
||||||
{
|
{
|
||||||
/* Check if this hive has a log at hand to begin with */
|
/* Check if this hive has a log at hand to begin with */
|
||||||
#if (NTDDI_VERSION < NTDDI_VISTA)
|
#if (NTDDI_VERSION < NTDDI_VISTA)
|
||||||
|
@ -1092,6 +1109,7 @@ HvLoadHive(
|
||||||
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Set the boot type */
|
/* Set the boot type */
|
||||||
|
@ -1384,6 +1402,8 @@ HvInitialize(
|
||||||
return Status;
|
return Status;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* FIXME: See the comment above (near HvpQueryHiveSize) */
|
||||||
|
#if !defined(_M_AMD64)
|
||||||
/*
|
/*
|
||||||
* Check if we have recovered this hive. We are responsible to
|
* Check if we have recovered this hive. We are responsible to
|
||||||
* flush the primary hive back to backing storage afterwards.
|
* flush the primary hive back to backing storage afterwards.
|
||||||
|
@ -1418,7 +1438,7 @@ HvInitialize(
|
||||||
*/
|
*/
|
||||||
Status = STATUS_SUCCESS;
|
Status = STATUS_SUCCESS;
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue