REFIT_ABSTRACT_MENU_ENTRY.Title to XStringW

This commit is contained in:
jief 2020-03-10 14:51:04 +03:00
parent a33bcb45d3
commit 7256a868e5
13 changed files with 86 additions and 76 deletions

View File

@ -1142,7 +1142,7 @@ FindStartupDiskVolume (
// case insensitive cmp
if (LoaderPath != NULL && StriCmp(gEfiBootLoaderPath, LoaderPath) == 0) {
// that's the one
DBG (" - found entry %d. '%s', Volume '%s', '%s'\n", Index, LoaderEntry.Title, Volume->VolName, LoaderPath);
DBG (" - found entry %d. '%s', Volume '%s', '%s'\n", Index, LoaderEntry.Title.s(), Volume->VolName, LoaderPath);
return Index;
}
}
@ -1165,7 +1165,7 @@ FindStartupDiskVolume (
// case insensitive cmp
if (LoaderPath != NULL && StriCmp(gEfiBootLoaderPath, LoaderPath) == 0) {
// that's the one
DBG (" - found entry %d. '%s', Volume '%s', '%s'\n", Index, LoaderEntry.Title, Volume->VolName, LoaderPath);
DBG (" - found entry %d. '%s', Volume '%s', '%s'\n", Index, LoaderEntry.Title.s(), Volume->VolName, LoaderPath);
return Index;
}
}
@ -1188,7 +1188,7 @@ FindStartupDiskVolume (
Volume = MainMenu->Entries[Index].getLOADER_ENTRY()->Volume;
}
if (Volume != NULL && BootVolumeDevicePathEqual (gEfiBootVolume, Volume->DevicePath)) {
DBG (" - found entry %d. '%s', Volume '%s'\n", Index, MainMenu->Entries[Index].Title, Volume->VolName);
DBG (" - found entry %d. '%s', Volume '%s'\n", Index, MainMenu->Entries[Index].Title.s(), Volume->VolName);
return Index;
}
}
@ -1205,7 +1205,7 @@ FindStartupDiskVolume (
Volume = MainMenu->Entries[Index].getLOADER_ENTRY()->Volume;
}
if (Volume != NULL && BootVolumeMediaDevicePathNodesEqual (gEfiBootVolume, Volume->DevicePath)) {
DBG (" - found entry %d. '%s', Volume '%s'\n", Index, MainMenu->Entries[Index].Title, Volume->VolName);
DBG (" - found entry %d. '%s', Volume '%s'\n", Index, MainMenu->Entries[Index].Title.s(), Volume->VolName);
return Index;
}
}
@ -1251,7 +1251,7 @@ FindStartupDiskVolume (
//DBG (" OSType = %d\n", Volume->OSType);
if (Volume->LegacyOS->Type == OSTYPE_WIN) {
// that's the one - legacy win partition
DBG (" - found legacy entry %d. '%s', Volume '%s'\n", Index, LegacyEntry.Title, Volume->VolName);
DBG (" - found legacy entry %d. '%s', Volume '%s'\n", Index, LegacyEntry.Title.s(), Volume->VolName);
return Index;
}
}
@ -1266,7 +1266,7 @@ FindStartupDiskVolume (
//DBG (" LoaderType = %d\n", LoaderEntry.LoaderType);
if (LoaderEntry.LoaderType == OSTYPE_WINEFI) {
// that's the one - win loader entry
DBG (" - found loader entry %d. '%s', Volume '%s', '%s'\n", Index, LoaderEntry.Title, Volume->VolName, LoaderEntry.LoaderPath);
DBG (" - found loader entry %d. '%s', Volume '%s', '%s'\n", Index, LoaderEntry.Title.s(), Volume->VolName, LoaderEntry.LoaderPath);
return Index;
}
}
@ -1286,7 +1286,7 @@ FindStartupDiskVolume (
Volume = LegacyEntry.Volume;
if (Volume != NULL && Volume->WholeDiskBlockIO == DiskVolume->BlockIO) {
// that's the one
DBG (" - found legacy entry %d. '%s', Volume '%s'\n", Index, LegacyEntry.Title, Volume->VolName);
DBG (" - found legacy entry %d. '%s', Volume '%s'\n", Index, LegacyEntry.Title.s(), Volume->VolName);
return Index;
}
@ -1295,7 +1295,7 @@ FindStartupDiskVolume (
Volume = LoaderEntry.Volume;
if (Volume != NULL && Volume->WholeDiskBlockIO == DiskVolume->BlockIO) {
// that's the one
DBG (" - found loader entry %d. '%s', Volume '%s', '%s'\n", Index, LoaderEntry.Title, Volume->VolName, LoaderEntry.LoaderPath);
DBG (" - found loader entry %d. '%s', Volume '%s', '%s'\n", Index, LoaderEntry.Title.s(), Volume->VolName, LoaderEntry.LoaderPath);
return Index;
}

View File

@ -97,7 +97,7 @@ class XArray
void RemoveAtIndex(int nIndex);
void setEmpty();
bool isEmpty() const { return size() == 0; }
bool isEmpty() const { return size() == 0; }
xsize IdxOf(TYPE& e) const;
bool ExistIn(TYPE& e) const { return IdxOf(e) != MAX_XSIZE; }

View File

@ -441,6 +441,10 @@ const XStringW &XStringW::operator =(const XStringW &aString)
const XStringW &XStringW::operator =(const wchar_t *S)
{
//TRACE("Operator =const wchar_t *\n");
if ( S == NULL ) {
DBG("operator =(const wchar_t *S) called with NULL\n");
panic();
}
StrCpy(S);
return *this;
}

View File

@ -48,10 +48,13 @@ public:
UINTN size() const { return m_len; }
UINTN allocatedSize() const { return m_allocatedSize; }
void SetLength(UINTN len);
const wchar_t* s() { return m_data; }
/* IsNull ? */
bool IsNull() const { return length() == 0 ; }
bool NotNull() const { return length() > 0 ; }
void setEmpty() { m_len = 0; }
bool isEmpty() const { return size() == 0; }
// bool IsNull() const { return size() == 0 ; }
// bool NotNull() const { return size() > 0 ; }
/* Cast */
operator const wchar_t *() const { return data(); }

View File

@ -37,7 +37,7 @@ class XStringWArray : public XStringWArraySuper
// Add
void AddStrings(const wchar_t *Val1, ...);
void AddNoNull(const XStringW &aString) { if ( aString.NotNull() ) AddCopy(aString); }
void AddNoNull(const XStringW &aString) { if ( !aString.isEmpty() ) AddCopy(aString); }
void AddEvenNull(const XStringW &aString) { AddCopy(aString); }
void Add(const XStringW &aString) { AddCopy(aString); }

View File

@ -24,7 +24,7 @@ int XStringW_tests()
if ( str != L"12" ) return 4;
XStringW str2;
if ( str2.NotNull() ) return 10;
if ( !str2.isEmpty() ) return 10;
str2.StrnCpy(str.data(), 2);
if ( str2 != L"12" ) return 11;
str2.StrnCat(L"345", 2);

View File

@ -124,9 +124,9 @@ BOOLEAN AddLegacyEntry(IN CONST CHAR16 *FullTitle, IN CONST CHAR16 *LoaderTitle,
Entry->Title = EfiStrDuplicate(FullTitle);
} else {
if (GlobalConfig.BootCampStyle) {
Entry->Title = PoolPrint(L"%s", LoaderTitle);
Entry->Title.SPrintf("%ls", LoaderTitle);
} else {
Entry->Title = PoolPrint(L"Boot %s from %s", LoaderTitle, VolDesc);
Entry->Title.SPrintf("Boot %ls from %ls", LoaderTitle, VolDesc);
}
}
// DBG("Title=%s\n", Entry->Title);

View File

@ -644,38 +644,37 @@ STATIC LOADER_ENTRY *CreateLoaderEntry(IN CONST CHAR16 *LoaderPath,
break;
}
Entry->Title = NULL;
if (FullTitle) {
Entry->Title = EfiStrDuplicate(FullTitle);
Entry->Title = FullTitle;
}
if ( Entry->Title == NULL && Volume->VolLabel != NULL ) {
if ( Entry->Title.isEmpty() && Volume->VolLabel != NULL ) {
if ( Volume->VolLabel[0] == L'#' ) {
Entry->Title = PoolPrint(L"Boot %s from %s", (LoaderTitle != NULL) ? LoaderTitle : Basename(LoaderPath), Volume->VolLabel+1);
Entry->Title.SPrintf("Boot %ls from %ls", (LoaderTitle != NULL) ? LoaderTitle : Basename(LoaderPath), Volume->VolLabel+1);
}else{
Entry->Title = PoolPrint(L"Boot %s from %s", (LoaderTitle != NULL) ? LoaderTitle : Basename(LoaderPath), Volume->VolLabel);
Entry->Title.SPrintf("Boot %ls from %ls", (LoaderTitle != NULL) ? LoaderTitle : Basename(LoaderPath), Volume->VolLabel);
}
}
if ( Entry->Title == NULL && ((Entry->VolName == NULL) || (StrLen(Entry->VolName) == 0)) ) {
if ( Entry->Title.isEmpty() && ((Entry->VolName == NULL) || (StrLen(Entry->VolName) == 0)) ) {
//DBG("encounter Entry->VolName ==%s and StrLen(Entry->VolName) ==%d\n",Entry->VolName, StrLen(Entry->VolName));
if (GlobalConfig.BootCampStyle) {
Entry->Title = PoolPrint(L"%s", ((LoaderTitle != NULL) ? LoaderTitle : Basename(Volume->DevicePathString)));
Entry->Title.SPrintf("%ls", ((LoaderTitle != NULL) ? LoaderTitle : Basename(Volume->DevicePathString)));
} else {
Entry->Title = PoolPrint(L"Boot %s from %s", (LoaderTitle != NULL) ? LoaderTitle : Basename(LoaderPath),
Entry->Title.SPrintf("Boot %ls from %ls", (LoaderTitle != NULL) ? LoaderTitle : Basename(LoaderPath),
Basename(Volume->DevicePathString));
}
}
if ( Entry->Title == NULL ) {
if ( Entry->Title.isEmpty() ) {
//DBG("encounter LoaderTitle ==%s and Entry->VolName ==%s\n", LoaderTitle, Entry->VolName);
if (GlobalConfig.BootCampStyle) {
if ((StriCmp(LoaderTitle, L"macOS") == 0) || (StriCmp(LoaderTitle, L"Recovery") == 0)) {
Entry->Title = PoolPrint(L"%s", Entry->VolName);
Entry->Title.SPrintf("%ls", Entry->VolName);
} else {
Entry->Title = PoolPrint(L"%s", (LoaderTitle != NULL) ? LoaderTitle : Basename(LoaderPath));
Entry->Title.SPrintf("%ls", (LoaderTitle != NULL) ? LoaderTitle : Basename(LoaderPath));
}
} else {
Entry->Title = PoolPrint(L"Boot %s from %s", (LoaderTitle != NULL) ? LoaderTitle : Basename(LoaderPath),
Entry->Title.SPrintf("Boot %ls from %ls", (LoaderTitle != NULL) ? LoaderTitle : Basename(LoaderPath),
Entry->VolName);
}
}
@ -683,7 +682,7 @@ STATIC LOADER_ENTRY *CreateLoaderEntry(IN CONST CHAR16 *LoaderPath,
// just an example that UI can show hibernated volume to the user
// should be better to show it on entry image
if (OSFLAG_ISSET(Entry->Flags, OSFLAG_HIBERNATED)) {
Entry->Title = PoolPrint(L"%s (hibernated)", Entry->Title);
Entry->Title.SPrintf("%ls (hibernated)", Entry->Title.s());
}
Entry->ShortcutLetter = (Hotkey == 0) ? ShortcutLetter : Hotkey;
@ -754,7 +753,7 @@ STATIC VOID AddDefaultMenu(IN LOADER_ENTRY *Entry)
// create the submenu
// SubScreen = (__typeof__(SubScreen))AllocateZeroPool(sizeof(REFIT_MENU_SCREEN));
SubScreen = new REFIT_MENU_SCREEN;
SubScreen->Title = PoolPrint(L"Options for %s", Entry->Title, Entry->VolName);
SubScreen->Title = PoolPrint(L"Options for %s", Entry->Title.s(), Entry->VolName);
SubScreen->TitleImage = Entry->Image;
SubScreen->ID = Entry->LoaderType + 20;
// DBG("get anime for os=%d\n", SubScreen->ID);
@ -885,10 +884,10 @@ STATIC VOID AddDefaultMenu(IN LOADER_ENTRY *Entry)
if (SubEntry) {
FreePool(SubEntry->LoadOptions);
if (Quiet) {
SubEntry->Title = PoolPrint(L"%s verbose", Entry->Title);
SubEntry->Title = PoolPrint(L"%s verbose", Entry->Title.s());
SubEntry->LoadOptions = RemoveLoadOption(Entry->LoadOptions, L"quiet");
} else {
SubEntry->Title = PoolPrint(L"%s quiet", Entry->Title);
SubEntry->Title = PoolPrint(L"%s quiet", Entry->Title.s());
SubEntry->LoadOptions = AddLoadOption(Entry->LoadOptions, L"quiet");
}
}
@ -897,10 +896,10 @@ STATIC VOID AddDefaultMenu(IN LOADER_ENTRY *Entry)
if (SubEntry) {
FreePool(SubEntry->LoadOptions);
if (WithSplash) {
SubEntry->Title = PoolPrint(L"%s without splash", Entry->Title);
SubEntry->Title = PoolPrint(L"%s without splash", Entry->Title.s());
SubEntry->LoadOptions = RemoveLoadOption(Entry->LoadOptions, L"splash");
} else {
SubEntry->Title = PoolPrint(L"%s with splash", Entry->Title);
SubEntry->Title = PoolPrint(L"%s with splash", Entry->Title.s());
SubEntry->LoadOptions = AddLoadOption(Entry->LoadOptions, L"splash");
}
}
@ -911,22 +910,22 @@ STATIC VOID AddDefaultMenu(IN LOADER_ENTRY *Entry)
if (WithSplash) {
if (Quiet) {
TempOptions = RemoveLoadOption(Entry->LoadOptions, L"splash");
SubEntry->Title = PoolPrint(L"%s verbose without splash", Entry->Title);
SubEntry->Title = PoolPrint(L"%s verbose without splash", Entry->Title.s());
SubEntry->LoadOptions = RemoveLoadOption(TempOptions, L"quiet");
FreePool(TempOptions);
} else {
TempOptions = RemoveLoadOption(Entry->LoadOptions, L"splash");
SubEntry->Title = PoolPrint(L"%s quiet without splash", Entry->Title);
SubEntry->Title = PoolPrint(L"%s quiet without splash", Entry->Title.s());
SubEntry->LoadOptions = AddLoadOption(TempOptions, L"quiet");
FreePool(TempOptions);
}
} else if (Quiet) {
TempOptions = RemoveLoadOption(Entry->LoadOptions, L"quiet");
SubEntry->Title = PoolPrint(L"%s verbose with splash", Entry->Title);
SubEntry->Title = PoolPrint(L"%s verbose with splash", Entry->Title.s());
SubEntry->LoadOptions = AddLoadOption(Entry->LoadOptions, L"splash");
FreePool(TempOptions);
} else {
SubEntry->Title = PoolPrint(L"%s quiet with splash", Entry->Title);
SubEntry->Title = PoolPrint(L"%s quiet with splash", Entry->Title.s());
SubEntry->LoadOptions = AddLoadOption(Entry->LoadOptions, L"quiet splash");
}
}

View File

@ -67,12 +67,12 @@ VOID AddSecureBootTool(VOID)
// Entry = (__typeof__(Entry))AllocateZeroPool(sizeof(LOADER_ENTRY));
if (gSettings.SecureBoot) {
Entry = new REFIT_MENU_ENTRY_SECURE_BOOT();
Entry->Title = PoolPrint(L"Clover Secure Boot Configuration");
Entry->Title.SPrintf("Clover Secure Boot Configuration");
// Entry->Tag = TAG_SECURE_BOOT_CONFIG;
Entry->Image = BuiltinIcon(BUILTIN_ICON_FUNC_SECURE_BOOT_CONFIG);
} else {
Entry = new REFIT_MENU_ENTRY_SECURE_BOOT_CONFIG();
Entry->Title = PoolPrint(L"Enable Clover Secure Boot");
Entry->Title.SPrintf("Enable Clover Secure Boot");
// Entry->Tag = TAG_SECURE_BOOT;
Entry->Image = BuiltinIcon(BUILTIN_ICON_FUNC_SECURE_BOOT);
}
@ -442,7 +442,7 @@ BOOLEAN ConfigureSecureBoot(VOID)
EFI_DEVICE_PATH *DevicePath = NULL;
// Add the entry for secure boot policy
SecureBootPolicyEntry.Title = PoolPrint(L"Secure boot policy: %s", SecureBootPolicyToStr(gSettings.SecureBootPolicy));
if (SecureBootPolicyEntry.Title == NULL) {
if (SecureBootPolicyEntry.Title.isEmpty()) {
break;
}
SecureBootPolicyMenu.Title = SecureBootPolicyEntry.Title;

View File

@ -92,7 +92,7 @@ STATIC BOOLEAN AddToolEntry(IN CONST CHAR16 *LoaderPath, IN CONST CHAR16 *FullTi
if (FullTitle) {
Entry->Title = EfiStrDuplicate(FullTitle);
} else {
Entry->Title = PoolPrint(L"Start %s", LoaderTitle);
Entry->Title.SPrintf("Start %ls", LoaderTitle);
}
// Entry->Tag = TAG_TOOL;
Entry->Row = 1;

View File

@ -96,7 +96,7 @@ class XPointer;
class REFIT_ABSTRACT_MENU_ENTRY
{
public:
CONST CHAR16 *Title;
XStringW Title;
UINTN Row;
CHAR16 ShortcutDigit;
CHAR16 ShortcutLetter;
@ -131,7 +131,7 @@ class REFIT_ABSTRACT_MENU_ENTRY
virtual REFIT_MENU_ENTRY_ITEM_ABSTRACT* getREFIT_MENU_ITEM_IEM_ABSTRACT() { return nullptr; };
virtual REFIT_MENU_ITEM_BOOTNUM* getREFIT_MENU_ITEM_BOOTNUM() { return nullptr; };
REFIT_ABSTRACT_MENU_ENTRY() : Title(NULL), Row(0), ShortcutDigit(0), ShortcutLetter(0), Image(NULL), AtClick(ActionNone), AtDoubleClick(ActionNone), AtRightClick(ActionNone), AtMouseOver(ActionNone), SubScreen(NULL)
REFIT_ABSTRACT_MENU_ENTRY() : Title(""), Row(0), ShortcutDigit(0), ShortcutLetter(0), Image(NULL), AtClick(ActionNone), AtDoubleClick(ActionNone), AtRightClick(ActionNone), AtMouseOver(ActionNone), SubScreen(NULL)
{};
REFIT_ABSTRACT_MENU_ENTRY(CONST CHAR16 *Title_) : Title(Title_), Row(0), ShortcutDigit(0), ShortcutLetter(0), Image(NULL), AtClick(ActionNone), AtDoubleClick(ActionNone), AtRightClick(ActionNone), AtMouseOver(ActionNone), SubScreen(NULL)
{};

View File

@ -1071,7 +1071,7 @@ static VOID StartTool(IN REFIT_MENU_ENTRY_LOADER_TOOL *Entry)
DBG("Start Tool: %s\n", Entry->LoaderPath);
egClearScreen(&DarkBackgroundPixel);
// assumes "Start <title>" as assigned below
BeginExternalScreen(OSFLAG_ISSET(Entry->Flags, OSFLAG_USEGRAPHICS), Entry->Title + 6);
BeginExternalScreen(OSFLAG_ISSET(Entry->Flags, OSFLAG_USEGRAPHICS), &Entry->Title[6]); // Shouldn't we check that length of Title is at least 6 ?
StartEFIImage(Entry->DevicePath, Entry->LoadOptions, Basename(Entry->LoaderPath), Basename(Entry->LoaderPath), NULL, NULL);
FinishExternalScreen();
//ReinitSelfLib();
@ -1581,7 +1581,7 @@ INTN FindDefaultEntry(VOID)
Index = FindStartupDiskVolume(&MainMenu);
if (Index >= 0) {
DBG("Boot redirected to Entry %d. '%s'\n", Index, MainMenu.Entries[Index].Title);
DBG("Boot redirected to Entry %d. '%s'\n", Index, MainMenu.Entries[Index].Title.s());
// we got boot-device-data, no need to keep emulating anymore
if (gEmuVariableControl != NULL) {
gEmuVariableControl->UninstallEmulation(gEmuVariableControl);
@ -1622,7 +1622,7 @@ INTN FindDefaultEntry(VOID)
continue;
}
DBG(" - found entry %d. '%s', Volume '%s', DevicePath '%s'\n", Index, Entry.Title, Volume->VolName, Entry.DevicePathString);
DBG(" - found entry %d. '%s', Volume '%s', DevicePath '%s'\n", Index, Entry.Title.s(), Volume->VolName, Entry.DevicePathString);
// if first method failed and second succeeded - uninstall emulation
if (gEmuVariableControl != NULL) {
gEmuVariableControl->UninstallEmulation(gEmuVariableControl);

View File

@ -1344,7 +1344,7 @@ VOID REFIT_MENU_SCREEN::AddMenuInfo(CONST CHAR16 *Line)
// InputBootArgs = (__typeof__(InputBootArgs))AllocateZeroPool(sizeof(REFIT_INPUT_DIALOG));
InputBootArgs = new REFIT_INFO_DIALOG;
InputBootArgs->Title = PoolPrint(L"%s", Line);
InputBootArgs->Title.SPrintf("%ls", Line);
// InputBootArgs->Tag = TAG_INFO;
// InputBootArgs->Item = NULL;
InputBootArgs->AtClick = ActionLight;
@ -1404,7 +1404,7 @@ VOID AboutRefit(VOID)
EntryCount instead of InfoLineCount. Lastline == return/back. Is necessary recheck screen res here?
*/
FreePool(AboutMenu.Entries[AboutMenu.Entries.size()-2].Title);
AboutMenu.Entries[AboutMenu.Entries.size()-2].Title = PoolPrint(L" Screen Output: %s", egScreenDescription());
AboutMenu.Entries[AboutMenu.Entries.size()-2].Title.SPrintf(" Screen Output: %ls", egScreenDescription());
}
AboutMenu.RunMenu(NULL);
@ -4353,11 +4353,11 @@ UINTN REFIT_MENU_SCREEN::RunMenu(OUT REFIT_ABSTRACT_MENU_ENTRY **ChosenEntry)
REFIT_ABSTRACT_MENU_ENTRY* NewEntry_(REFIT_ABSTRACT_MENU_ENTRY *Entry, REFIT_MENU_SCREEN **SubScreen, ACTION AtClick, UINTN ID, CONST CHAR8 *Title)
{
if (Title) {
Entry->Title = PoolPrint(L"%a", Title);
} else {
Entry->Title = (__typeof__(Entry->Title))AllocateZeroPool(128);
}
Entry->Title.SPrintf("%s", Title);
// if (Title) {
// } else {
// Entry->Title = (__typeof__(Entry->Title))AllocateZeroPool(128);
// }
Entry->Image = OptionMenu.TitleImage;
Entry->AtClick = AtClick;
@ -4395,7 +4395,7 @@ VOID REFIT_MENU_SCREEN::AddMenuCheck(CONST CHAR8 *Text, UINTN Bit, INTN ItemNum)
// InputBootArgs = (__typeof__(InputBootArgs))AllocateZeroPool(sizeof(REFIT_INPUT_DIALOG));
InputBootArgs = new REFIT_MENU_CHECKBIT;
InputBootArgs->Title = PoolPrint(L"%a", Text);
InputBootArgs->Title.SPrintf("%s", Text);
// InputBootArgs->Tag = TAG_CHECKBIT_OLD;
InputBootArgs->Row = Bit;
InputBootArgs->Item = &InputItems[ItemNum];
@ -4407,11 +4407,13 @@ VOID REFIT_MENU_SCREEN::AddMenuCheck(CONST CHAR8 *Text, UINTN Bit, INTN ItemNum)
VOID ModifyTitles(REFIT_ABSTRACT_MENU_ENTRY *ChosenEntry)
{
if (ChosenEntry->SubScreen->ID == SCREEN_DSDT) {
UnicodeSPrint((CHAR16*)ChosenEntry->Title, 128, L"DSDT fix mask [0x%08x]->", gSettings.FixDsdt); // TODO jief : cast to fix
// UnicodeSPrint((CHAR16*)ChosenEntry->Title, 128, L"DSDT fix mask [0x%08x]->", gSettings.FixDsdt); // TODO jief : cast to fix
ChosenEntry->Title.SPrintf("DSDT fix mask [0x%08x]->", gSettings.FixDsdt); // TODO jief : cast to fix
//MsgLog("@ESC: %s\n", (*ChosenEntry)->Title);
} else if (ChosenEntry->SubScreen->ID == SCREEN_CSR) {
// CSR
UnicodeSPrint((CHAR16*)ChosenEntry->Title, 128, L"System Integrity Protection [0x%04x]->", gSettings.CsrActiveConfig); // TODO jief : cast to fix
// UnicodeSPrint((CHAR16*)ChosenEntry->Title, 128, L"System Integrity Protection [0x%04x]->", gSettings.CsrActiveConfig); // TODO jief : cast to fix
ChosenEntry->Title.SPrintf("System Integrity Protection [0x%04x]->", gSettings.CsrActiveConfig); // TODO jief : cast to fix
// check for the right booter flag to allow the application
// of the new System Integrity Protection configuration.
if (gSettings.CsrActiveConfig != 0 && gSettings.BooterConfig == 0) {
@ -4419,15 +4421,17 @@ VOID ModifyTitles(REFIT_ABSTRACT_MENU_ENTRY *ChosenEntry)
}
} else if (ChosenEntry->SubScreen->ID == SCREEN_BLC) {
UnicodeSPrint((CHAR16*)ChosenEntry->Title, 128, L"boot_args->flags [0x%04x]->", gSettings.BooterConfig); // TODO jief : cast to fix
// UnicodeSPrint((CHAR16*)ChosenEntry->Title, 128, L"boot_args->flags [0x%04x]->", gSettings.BooterConfig); // TODO jief : cast to fix
ChosenEntry->Title.SPrintf("boot_args->flags [0x%04x]->", gSettings.BooterConfig); // TODO jief : cast to fix
} else if (ChosenEntry->SubScreen->ID == SCREEN_DSM) {
UnicodeSPrint((CHAR16*)ChosenEntry->Title, 128, L"Drop OEM _DSM [0x%04x]->", dropDSM); // TODO jief : cast to fix
// UnicodeSPrint((CHAR16*)ChosenEntry->Title, 128, L"Drop OEM _DSM [0x%04x]->", dropDSM); // TODO jief : cast to fix
ChosenEntry->Title.SPrintf("Drop OEM _DSM [0x%04x]->", dropDSM); // TODO jief : cast to fix
}
}
VOID REFIT_MENU_SCREEN::AddMenuItem_(REFIT_MENU_ENTRY_ITEM_ABSTRACT* InputBootArgs, INTN Inx, CONST CHAR8 *Line, BOOLEAN Cursor)
{
InputBootArgs->Title = PoolPrint(L"%a", Line);
InputBootArgs->Title.SPrintf("%s", Line);
if (Inx == 3 || Inx == 116) {
InputBootArgs->Row = 0;
} else {
@ -4641,7 +4645,7 @@ REFIT_ABSTRACT_MENU_ENTRY* SubMenuKextPatches()
for (Index = 0; Index < NrKexts; Index++) {
// InputBootArgs = (__typeof__(InputBootArgs))AllocateZeroPool(sizeof(REFIT_INPUT_DIALOG));
InputBootArgs = new REFIT_INPUT_DIALOG;
InputBootArgs->Title = PoolPrint(L"%30a", KextPatchesMenu[Index].Label);
InputBootArgs->Title.SPrintf("%30s", KextPatchesMenu[Index].Label);
// InputBootArgs->Tag = TAG_INPUT;
InputBootArgs->Row = 0xFFFF; //cursor
InputBootArgs->Item = &(KextPatchesMenu[Index].MenuItem);
@ -4682,7 +4686,7 @@ REFIT_ABSTRACT_MENU_ENTRY* SubMenuKextBlockInjection(CONST CHAR16* UniSysVer)
}
// InputBootArgs = (__typeof__(InputBootArgs))AllocateZeroPool(sizeof(REFIT_INPUT_DIALOG));
InputBootArgs = new REFIT_INPUT_DIALOG;
InputBootArgs->Title = PoolPrint(L"%s, v.%s", Kext->FileName, Kext->Version);
InputBootArgs->Title.SPrintf("%ls, v.%ls", Kext->FileName, Kext->Version);
// InputBootArgs->Tag = TAG_INPUT;
InputBootArgs->Row = 0xFFFF; //cursor
InputBootArgs->Item = &(Kext->MenuItem);
@ -4694,7 +4698,7 @@ REFIT_ABSTRACT_MENU_ENTRY* SubMenuKextBlockInjection(CONST CHAR16* UniSysVer)
while (plugInKext) {
// InputBootArgs = (__typeof__(InputBootArgs))AllocateZeroPool(sizeof(REFIT_INPUT_DIALOG));
InputBootArgs = new REFIT_INPUT_DIALOG;
InputBootArgs->Title = PoolPrint(L" |-- %s, v.%s", plugInKext->FileName, plugInKext->Version);
InputBootArgs->Title.SPrintf(" |-- %ls, v.%ls", plugInKext->FileName, plugInKext->Version);
// InputBootArgs->Tag = TAG_INPUT;
InputBootArgs->Row = 0xFFFF; //cursor
InputBootArgs->Item = &(plugInKext->MenuItem);
@ -4848,7 +4852,7 @@ REFIT_ABSTRACT_MENU_ENTRY* SubMenuKernelPatches()
for (Index = 0; Index < NrKernels; Index++) {
// InputBootArgs = (__typeof__(InputBootArgs))AllocateZeroPool(sizeof(REFIT_INPUT_DIALOG));
InputBootArgs = new REFIT_INPUT_DIALOG;
InputBootArgs->Title = PoolPrint(L"%30a", KernelPatchesMenu[Index].Label);
InputBootArgs->Title.SPrintf("%30s", KernelPatchesMenu[Index].Label);
// InputBootArgs->Tag = TAG_INPUT;
InputBootArgs->Row = 0xFFFF; //cursor
InputBootArgs->Item = &(KernelPatchesMenu[Index].MenuItem);
@ -4875,7 +4879,7 @@ REFIT_ABSTRACT_MENU_ENTRY* SubMenuBootPatches()
for (Index = 0; Index < NrBoots; Index++) {
// InputBootArgs = (__typeof__(InputBootArgs))AllocateZeroPool(sizeof(REFIT_INPUT_DIALOG));
InputBootArgs = new REFIT_INPUT_DIALOG;
InputBootArgs->Title = PoolPrint(L"%30a", BootPatchesMenu[Index].Label);
InputBootArgs->Title.SPrintf("%30s", BootPatchesMenu[Index].Label);
// InputBootArgs->Tag = TAG_INPUT;
InputBootArgs->Row = 0xFFFF; //cursor
InputBootArgs->Item = &(BootPatchesMenu[Index].MenuItem);
@ -4948,7 +4952,7 @@ REFIT_ABSTRACT_MENU_ENTRY* SubMenuDropTables()
// DropTable->Length, DropTable->Length);
// InputBootArgs = (__typeof__(InputBootArgs))AllocateZeroPool(sizeof(REFIT_INPUT_DIALOG));
InputBootArgs = new REFIT_INPUT_DIALOG;
InputBootArgs->Title = PoolPrint(L"Drop \"%4.4a\" \"%8.8a\" %d", sign, OTID, DropTable->Length);
InputBootArgs->Title.SPrintf("Drop \"%4.4s\" \"%8.8s\" %d", sign, OTID, DropTable->Length);
// InputBootArgs->Tag = TAG_INPUT;
InputBootArgs->Row = 0xFFFF; //cursor
InputBootArgs->Item = &(DropTable->MenuItem);
@ -4969,7 +4973,7 @@ REFIT_ABSTRACT_MENU_ENTRY* SubMenuDropTables()
while (ACPIPatchedAMLTmp) {
// InputBootArgs = (__typeof__(InputBootArgs))AllocateZeroPool(sizeof(REFIT_INPUT_DIALOG));
InputBootArgs = new REFIT_INPUT_DIALOG;
InputBootArgs->Title = PoolPrint(L"Drop \"%s\"", ACPIPatchedAMLTmp->FileName);
InputBootArgs->Title.SPrintf("Drop \"%ls\"", ACPIPatchedAMLTmp->FileName);
// InputBootArgs->Tag = TAG_INPUT;
InputBootArgs->Row = 0xFFFF; //cursor
InputBootArgs->Item = &(ACPIPatchedAMLTmp->MenuItem);
@ -5022,7 +5026,7 @@ REFIT_ABSTRACT_MENU_ENTRY* SubMenuDropDSM()
// create the entry in the main menu
Entry = newREFIT_MENU_ITEM_OPTIONS(&SubScreen, ActionEnter, SCREEN_DSM, NULL);
// Entry->Title = PoolPrint(L"Drop OEM _DSM [0x%04x]->", gSettings.DropOEM_DSM);
// Entry->Title.SPrintf("Drop OEM _DSM [0x%04x]->", gSettings.DropOEM_DSM);
// submenu description
SubScreen->AddMenuInfoLine(PoolPrint(L"Choose devices to drop OEM _DSM methods from DSDT"));
@ -5055,7 +5059,7 @@ REFIT_ABSTRACT_MENU_ENTRY* SubMenuDsdtFix()
// REFIT_INPUT_DIALOG *InputBootArgs;
Entry = newREFIT_MENU_ITEM_OPTIONS(&SubScreen, ActionEnter, SCREEN_DSDT, NULL);
// Entry->Title = PoolPrint(L"DSDT fix mask [0x%08x]->", gSettings.FixDsdt);
// Entry->Title.SPrintf("DSDT fix mask [0x%08x]->", gSettings.FixDsdt);
SubScreen->AddMenuCheck("Add DTGP", FIX_DTGP, 67);
SubScreen->AddMenuCheck("Fix Darwin as WinXP", FIX_WARNING, 67);
@ -5111,7 +5115,7 @@ REFIT_ABSTRACT_MENU_ENTRY* SubMenuDSDTPatches() //yyyy
for (Index = 0; Index < PatchDsdtNum; Index++) {
// InputBootArgs = (__typeof__(InputBootArgs))AllocateZeroPool(sizeof(REFIT_INPUT_DIALOG));
InputBootArgs = new REFIT_INPUT_DIALOG;
InputBootArgs->Title = PoolPrint(L"%a", gSettings.PatchDsdtLabel[Index]);
InputBootArgs->Title.SPrintf("%s", gSettings.PatchDsdtLabel[Index]);
// InputBootArgs->Tag = TAG_INPUT;
InputBootArgs->Row = 0xFFFF; //cursor
InputBootArgs->Item = &DSDTPatchesMenu[Index];
@ -5139,7 +5143,7 @@ REFIT_ABSTRACT_MENU_ENTRY* SubMenuDsdts()
for (i = 0; i < DsdtsNum; i++) {
// InputBootArgs = (__typeof__(InputBootArgs))AllocateZeroPool(sizeof(REFIT_INPUT_DIALOG));
InputBootArgs = new REFIT_MENU_SWITCH;
InputBootArgs->Title = PoolPrint(L"%s", DsdtsList[i]);
InputBootArgs->Title.SPrintf("%ls", DsdtsList[i]);
// InputBootArgs->Tag = TAG_SWITCH_OLD;
InputBootArgs->Row = i + 1;
InputBootArgs->Item = &InputItems[116];
@ -5192,7 +5196,7 @@ REFIT_ABSTRACT_MENU_ENTRY* SubMenuAudioPort()
for (i = 0; i < AudioNum; i++) {
// InputBootArgs = (__typeof__(InputBootArgs))AllocateZeroPool(sizeof(REFIT_INPUT_DIALOG));
InputBootArgs = new REFIT_MENU_SWITCH;
InputBootArgs->Title = PoolPrint(L"%s_%a", AudioList[i].Name, AudioOutputNames[AudioList[i].Device]);
InputBootArgs->Title.SPrintf("%ls_%s", AudioList[i].Name, AudioOutputNames[AudioList[i].Device]);
// InputBootArgs->Tag = TAG_SWITCH_OLD;
InputBootArgs->Row = i;
InputBootArgs->Item = &InputItems[119];
@ -5211,7 +5215,7 @@ VOID CreateMenuProps(REFIT_MENU_SCREEN *SubScreen, DEV_PROPERTY *Prop)
// InputBootArgs = (__typeof__(InputBootArgs))AllocateZeroPool(sizeof(REFIT_INPUT_DIALOG));
InputBootArgs = new REFIT_INPUT_DIALOG;
InputBootArgs->Title = PoolPrint(L" key: %a", Prop->Key);
InputBootArgs->Title.SPrintf(" key: %s", Prop->Key);
// InputBootArgs->Tag = TAG_INPUT;
InputBootArgs->Row = 0xFFFF; //cursor
// InputBootArgs->Item = ADDRESS_OF(DEV_PROPERTY, Prop, INPUT_ITEM, MenuItem);
@ -5324,7 +5328,7 @@ REFIT_ABSTRACT_MENU_ENTRY* SubMenuThemes()
for (i = 0; i < ThemesNum; i++) {
// InputBootArgs = (__typeof__(InputBootArgs))AllocateZeroPool(sizeof(REFIT_INPUT_DIALOG));
InputBootArgs = new REFIT_MENU_SWITCH;
InputBootArgs->Title = PoolPrint(L"%s", ThemesList[i]);
InputBootArgs->Title.SPrintf("%ls", ThemesList[i]);
// InputBootArgs->Tag = TAG_SWITCH_OLD;
InputBootArgs->Row = i + 1;
InputBootArgs->Item = &InputItems[3];
@ -5403,7 +5407,7 @@ REFIT_ABSTRACT_MENU_ENTRY* SubMenuBLC()
// create the entry in the main menu
Entry = newREFIT_MENU_ITEM_OPTIONS(&SubScreen, ActionEnter, SCREEN_BLC, NULL);
// Entry->Title = PoolPrint(L"boot_args->flags [0x%02x]->", gSettings.BooterConfig);
// Entry->Title.SPrintf("boot_args->flags [0x%02x]->", gSettings.BooterConfig);
// submenu description
SubScreen->AddMenuInfoLine(PoolPrint(L"Modify flags for boot.efi"));
@ -5460,7 +5464,7 @@ REFIT_ABSTRACT_MENU_ENTRY* SubMenuConfigs()
for (i = 0; i < ConfigsNum; i++) {
// InputBootArgs = (__typeof__(InputBootArgs))AllocateZeroPool(sizeof(REFIT_INPUT_DIALOG));
InputBootArgs = new REFIT_MENU_SWITCH;
InputBootArgs->Title = PoolPrint(L"%s", ConfigsList[i]);
InputBootArgs->Title.SPrintf("%ls", ConfigsList[i]);
// InputBootArgs->Tag = TAG_SWITCH_OLD;
InputBootArgs->Row = i;
InputBootArgs->Item = &InputItems[90];