Fix XTLDR configuration
This commit is contained in:
parent
32042ef643
commit
113a46ef10
@ -30,26 +30,22 @@ BlGetConfigValue(IN CONST PWCHAR ConfigName)
|
|||||||
/* Get config entry name length */
|
/* Get config entry name length */
|
||||||
Length = RtlWideStringLength(ConfigName, 0);
|
Length = RtlWideStringLength(ConfigName, 0);
|
||||||
|
|
||||||
/* Make sure config list is not empty */
|
/* Iterate through config entries */
|
||||||
if(BlpConfig != NULL)
|
ConfigListEntry = BlpConfig.Flink;
|
||||||
|
while(ConfigListEntry != &BlpConfig)
|
||||||
{
|
{
|
||||||
/* Iterate through config entries */
|
/* Get config entry */
|
||||||
ConfigListEntry = BlpConfig->Flink;
|
ConfigEntry = CONTAIN_RECORD(ConfigListEntry, XTBL_CONFIG_ENTRY, Flink);
|
||||||
while(ConfigListEntry != BlpConfig)
|
|
||||||
|
/* Check if requested configuration found */
|
||||||
|
if(RtlCompareWideStringInsensitive(ConfigEntry->Name, ConfigName, Length) == 0)
|
||||||
{
|
{
|
||||||
/* Get config entry */
|
/* Return config value */
|
||||||
ConfigEntry = CONTAIN_RECORD(ConfigListEntry, XTBL_CONFIG_ENTRY, Flink);
|
return ConfigEntry->Value;
|
||||||
|
|
||||||
/* Check if requested configuration found */
|
|
||||||
if(RtlCompareWideStringInsensitive(ConfigEntry->Name, ConfigName, Length) == 0)
|
|
||||||
{
|
|
||||||
/* Return config value */
|
|
||||||
return ConfigEntry->Value;
|
|
||||||
}
|
|
||||||
|
|
||||||
/* Move to the next config entry */
|
|
||||||
ConfigListEntry = ConfigListEntry->Flink;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* Move to the next config entry */
|
||||||
|
ConfigListEntry = ConfigListEntry->Flink;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Config entry not found, return NULL */
|
/* Config entry not found, return NULL */
|
||||||
@ -82,8 +78,8 @@ BlSetConfigValue(IN CONST PWCHAR ConfigName,
|
|||||||
Length = RtlWideStringLength(ConfigName, 0);
|
Length = RtlWideStringLength(ConfigName, 0);
|
||||||
|
|
||||||
/* Iterate through config entries */
|
/* Iterate through config entries */
|
||||||
ConfigListEntry = BlpConfig->Flink;
|
ConfigListEntry = BlpConfig.Flink;
|
||||||
while(ConfigListEntry != BlpConfig)
|
while(ConfigListEntry != &BlpConfig)
|
||||||
{
|
{
|
||||||
/* Get config entry */
|
/* Get config entry */
|
||||||
ConfigEntry = CONTAIN_RECORD(ConfigListEntry, XTBL_CONFIG_ENTRY, Flink);
|
ConfigEntry = CONTAIN_RECORD(ConfigListEntry, XTBL_CONFIG_ENTRY, Flink);
|
||||||
@ -564,8 +560,9 @@ BlpUpdateConfiguration(IN PLIST_ENTRY NewConfig)
|
|||||||
/* Make sure config entry does not exist yet */
|
/* Make sure config entry does not exist yet */
|
||||||
if(BlGetConfigValue(ConfigEntry->Name) == NULL)
|
if(BlGetConfigValue(ConfigEntry->Name) == NULL)
|
||||||
{
|
{
|
||||||
/* Put new config entry into global config list */
|
/* Remove new config entry from input list and put it into global config list */
|
||||||
RtlInsertTailList(BlpConfig, &ConfigEntry->Flink);
|
RtlRemoveEntryList(&ConfigEntry->Flink);
|
||||||
|
RtlInsertTailList(&BlpConfig, &ConfigEntry->Flink);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Move to the next new config entry */
|
/* Move to the next new config entry */
|
||||||
|
@ -144,7 +144,7 @@ BlpInitializeEfiBootLoader()
|
|||||||
BlConsolePrint(L"XTLDR boot loader v%s\n", XTOS_VERSION);
|
BlConsolePrint(L"XTLDR boot loader v%s\n", XTOS_VERSION);
|
||||||
|
|
||||||
/* Initialize XTLDR configuration list */
|
/* Initialize XTLDR configuration list */
|
||||||
RtlInitializeListHead(BlpConfig);
|
RtlInitializeListHead(&BlpConfig);
|
||||||
|
|
||||||
/* Check if debug is enabled */
|
/* Check if debug is enabled */
|
||||||
if(DEBUG)
|
if(DEBUG)
|
||||||
|
@ -10,7 +10,7 @@
|
|||||||
|
|
||||||
|
|
||||||
/* XT Boot Loader configuration list */
|
/* XT Boot Loader configuration list */
|
||||||
PLIST_ENTRY BlpConfig;
|
LIST_ENTRY BlpConfig;
|
||||||
|
|
||||||
/* XT Boot Loader loaded configuration */
|
/* XT Boot Loader loaded configuration */
|
||||||
LIST_ENTRY BlpConfigSections;
|
LIST_ENTRY BlpConfigSections;
|
||||||
|
@ -13,7 +13,7 @@
|
|||||||
|
|
||||||
|
|
||||||
/* XT Boot Loader configuration list */
|
/* XT Boot Loader configuration list */
|
||||||
EXTERN PLIST_ENTRY BlpConfig;
|
EXTERN LIST_ENTRY BlpConfig;
|
||||||
|
|
||||||
/* XT Boot Loader loaded configuration */
|
/* XT Boot Loader loaded configuration */
|
||||||
EXTERN LIST_ENTRY BlpConfigSections;
|
EXTERN LIST_ENTRY BlpConfigSections;
|
||||||
|
Loading…
Reference in New Issue
Block a user