Implement BlGetConfigBooleanValue() routine

This commit is contained in:
2024-03-18 20:02:43 +01:00
parent bd02da30ef
commit 12e8704ffb
3 changed files with 39 additions and 2 deletions

View File

@@ -9,6 +9,39 @@
#include <xtldr.h>
/**
* Returns a boolean value of the specified configuration key.
*
* @param ConfigName
* Specifies the configuration key to return its boolean representation.
*
* @return This routine returns a boolean representation of the configuration value.
*
* @since XT 1.0
*/
XTCDECL
BOOLEAN
BlGetConfigBooleanValue(IN CONST PWCHAR ConfigName)
{
PWCHAR Value;
/* Get config value */
Value = BlGetConfigValue(ConfigName);
/* Check if option is enabled */
if(RtlCompareWideStringInsensitive(Value, L"ENABLED", 0) == 0 ||
RtlCompareWideStringInsensitive(Value, L"ON", 0) == 0 ||
RtlCompareWideStringInsensitive(Value, L"TRUE", 0) == 0 ||
RtlCompareWideStringInsensitive(Value, L"YES", 0) == 0)
{
/* This option is enabled */
return TRUE;
}
/* Return FALSE by default */
return FALSE;
}
/**
* Returns a value of the specified configuration key.
*