diff --git a/rEFIt_UEFI/entry_scan/common.cpp b/rEFIt_UEFI/entry_scan/common.cpp index 3ba78a64c..2de8924db 100644 --- a/rEFIt_UEFI/entry_scan/common.cpp +++ b/rEFIt_UEFI/entry_scan/common.cpp @@ -149,8 +149,8 @@ LOADER_ENTRY * DuplicateLoaderEntry(IN LOADER_ENTRY *Entry) return NULL; } -// DuplicateEntry = (__typeof__(DuplicateEntry))AllocateZeroPool(sizeof(LOADER_ENTRY)); - DuplicateEntry = new LOADER_ENTRY(); + DuplicateEntry = (__typeof__(DuplicateEntry))AllocateZeroPool(sizeof(LOADER_ENTRY)); +// DuplicateEntry = new LOADER_ENTRY(); if (DuplicateEntry) { // DuplicateEntry->Tag = Entry->Tag; DuplicateEntry->AtClick = ActionEnter; diff --git a/rEFIt_UEFI/entry_scan/legacy.cpp b/rEFIt_UEFI/entry_scan/legacy.cpp index d5d9c825d..c715a7aab 100644 --- a/rEFIt_UEFI/entry_scan/legacy.cpp +++ b/rEFIt_UEFI/entry_scan/legacy.cpp @@ -118,8 +118,8 @@ BOOLEAN AddLegacyEntry(IN CONST CHAR16 *FullTitle, IN CONST CHAR16 *LoaderTitle, VolDesc = (Volume->DiskKind == DISK_KIND_OPTICAL) ? L"CD" : L"HD"; //DBG("VolDesc=%s\n", VolDesc); // prepare the menu entry -// Entry = (__typeof__(Entry))AllocateZeroPool(sizeof(LEGACY_ENTRY)); - Entry = new LEGACY_ENTRY(); + Entry = (__typeof__(Entry))AllocateZeroPool(sizeof(LEGACY_ENTRY)); +// Entry = new LEGACY_ENTRY(); if (FullTitle) { Entry->Title = EfiStrDuplicate(FullTitle); } else { @@ -164,8 +164,8 @@ BOOLEAN AddLegacyEntry(IN CONST CHAR16 *FullTitle, IN CONST CHAR16 *LoaderTitle, SubScreen->TitleImage = Entry->Image; SubScreen->AnimeRun = SubScreen->GetAnime(); // default entry -// SubEntry = (__typeof__(SubEntry))AllocateZeroPool(sizeof(LEGACY_ENTRY)); - SubEntry = new LEGACY_ENTRY(); + SubEntry = (__typeof__(SubEntry))AllocateZeroPool(sizeof(LEGACY_ENTRY)); +// SubEntry = new LEGACY_ENTRY(); SubEntry->Title = PoolPrint(L"Boot %s", LoaderTitle); // SubEntry->Tag = TAG_LEGACY; SubEntry->Volume = Entry->Volume; diff --git a/rEFIt_UEFI/entry_scan/loader.cpp b/rEFIt_UEFI/entry_scan/loader.cpp index e2a4f7498..f0cfd30e8 100644 --- a/rEFIt_UEFI/entry_scan/loader.cpp +++ b/rEFIt_UEFI/entry_scan/loader.cpp @@ -556,7 +556,8 @@ STATIC LOADER_ENTRY *CreateLoaderEntry(IN CONST CHAR16 *LoaderPath, } // prepare the menu entry - Entry = new LOADER_ENTRY(); + Entry = (__typeof__(Entry))AllocateZeroPool(sizeof(LOADER_ENTRY)); + // Entry = new LOADER_ENTRY(); // Entry->Tag = TAG_LOADER; Entry->Row = 0; Entry->Volume = Volume; diff --git a/rEFIt_UEFI/entry_scan/tool.cpp b/rEFIt_UEFI/entry_scan/tool.cpp index 58e610b9c..b5bf3e81a 100644 --- a/rEFIt_UEFI/entry_scan/tool.cpp +++ b/rEFIt_UEFI/entry_scan/tool.cpp @@ -83,8 +83,8 @@ STATIC BOOLEAN AddToolEntry(IN CONST CHAR16 *LoaderPath, IN CONST CHAR16 *FullTi return FALSE; } // Allocate the entry -// Entry = (__typeof__(Entry))AllocateZeroPool(sizeof(LOADER_ENTRY)); - Entry = new REFIT_MENU_ENTRY_LOADER_TOOL(); + Entry = (__typeof__(Entry))AllocateZeroPool(sizeof(*Entry)); +// Entry = new REFIT_MENU_ENTRY_LOADER_TOOL(); if (Entry == NULL) { return FALSE; } @@ -121,8 +121,8 @@ STATIC VOID AddCloverEntry(IN CONST CHAR16 *LoaderPath, IN CONST CHAR16 *LoaderT // EFI_STATUS Status; // prepare the menu entry -// Entry = (__typeof__(Entry))AllocateZeroPool(sizeof(LOADER_ENTRY)); - Entry = new REFIT_MENU_ENTRY_CLOVER(); + Entry = (__typeof__(Entry))AllocateZeroPool(sizeof(*Entry)); +// Entry = new REFIT_MENU_ENTRY_CLOVER(); Entry->Title = LoaderTitle; // Entry->Tag = TAG_CLOVER; Entry->Row = 1; diff --git a/rEFIt_UEFI/gui/menu_items/menu_items.h b/rEFIt_UEFI/gui/menu_items/menu_items.h index 47da9f240..e16721ce5 100644 --- a/rEFIt_UEFI/gui/menu_items/menu_items.h +++ b/rEFIt_UEFI/gui/menu_items/menu_items.h @@ -399,7 +399,7 @@ public: UINTN mItemID; XPointer *mPointer; SCROLL_STATE ScrollState; - MENU_STYLE_FUNC StyleFunc; +// MENU_STYLE_FUNC StyleFunc; REFIT_MENU_SCREEN() @@ -407,7 +407,7 @@ public: TimeoutSeconds(0), TimeoutText(0), Theme(0), AnimeRun(0), Once(0), LastDraw(0), CurrentFrame(0), Frames(0), FrameTime(0), FilmPlace({0,0,0,0}), - Film(0), mAction(ActionNone), mItemID(0), StyleFunc(&REFIT_MENU_SCREEN::TextMenuStyle) + Film(0), mAction(ActionNone), mItemID(0) //, StyleFunc(&REFIT_MENU_SCREEN::TextMenuStyle) {}; REFIT_MENU_SCREEN( UINTN ID_, diff --git a/rEFIt_UEFI/refit/menu.cpp b/rEFIt_UEFI/refit/menu.cpp index 016c9ca0c..a45ba2f26 100644 --- a/rEFIt_UEFI/refit/menu.cpp +++ b/rEFIt_UEFI/refit/menu.cpp @@ -4371,8 +4371,8 @@ VOID NewEntry(REFIT_MENU_ENTRY_OTHER **Entry, REFIT_MENU_SCREEN **SubScreen, ACT VOID NewEntry(LOADER_ENTRY **Entry, REFIT_MENU_SCREEN **SubScreen, ACTION AtClick, UINTN ID, CONST CHAR8 *Title) { //create entry -// *Entry = (__typeof_am__(*Entry))AllocateZeroPool(sizeof(LOADER_ENTRY)); // carefull, **Entry is not a LOADER_ENTRY. Don't use sizeof. - *Entry = new LOADER_ENTRY(); + *Entry = (__typeof_am__(*Entry))AllocateZeroPool(sizeof(LOADER_ENTRY)); // carefull, **Entry is not a LOADER_ENTRY. Don't use sizeof. +// *Entry = new LOADER_ENTRY(); NewEntry_(*Entry, SubScreen, AtClick, ID, Title); // cast ok because super class } @@ -4412,9 +4412,9 @@ VOID ModifyTitles(REFIT_ABSTRACT_MENU_ENTRY *ChosenEntry) } } -VOID REFIT_MENU_SCREEN::AddMenuItem_(REFIT_MENU_ITEM_IEM_ABSTRACT* InputBootArgs, INTN Inx, CONST CHAR8 *Title, BOOLEAN Cursor) +VOID REFIT_MENU_SCREEN::AddMenuItem_(REFIT_MENU_ITEM_IEM_ABSTRACT* InputBootArgs, INTN Inx, CONST CHAR8 *Line, BOOLEAN Cursor) { - InputBootArgs->Title = PoolPrint(L"%a", Title); + InputBootArgs->Title = PoolPrint(L"%a", Line); if (Inx == 3 || Inx == 116) { InputBootArgs->Row = 0; } else { @@ -4435,17 +4435,17 @@ VOID REFIT_MENU_SCREEN::AddMenuItem_(REFIT_MENU_ITEM_IEM_ABSTRACT* InputBootArgs // AddMenuItem_(SubScreen, InputBootArgs, Inx, Title, Tag, Cursor); //} -VOID REFIT_MENU_SCREEN::AddMenuItemInput(INTN Inx, CONST CHAR8 *Title, BOOLEAN Cursor) +VOID REFIT_MENU_SCREEN::AddMenuItemInput(INTN Inx, CONST CHAR8 *Line, BOOLEAN Cursor) { // REFIT_INPUT_DIALOG *InputBootArgs = (__typeof__(InputBootArgs))AllocateZeroPool(sizeof(REFIT_INPUT_DIALOG)); REFIT_INPUT_DIALOG *InputBootArgs = new REFIT_INPUT_DIALOG; - AddMenuItem_(InputBootArgs, Inx, Title, Cursor); + AddMenuItem_(InputBootArgs, Inx, Line, Cursor); } -VOID REFIT_MENU_SCREEN::AddMenuItemSwitch(INTN Inx, CONST CHAR8 *Title, BOOLEAN Cursor) +VOID REFIT_MENU_SCREEN::AddMenuItemSwitch(INTN Inx, CONST CHAR8 *Line, BOOLEAN Cursor) { REFIT_MENU_SWITCH *InputBootArgs = new REFIT_MENU_SWITCH; - AddMenuItem_(InputBootArgs, Inx, Title, Cursor); + AddMenuItem_(InputBootArgs, Inx, Line, Cursor); } REFIT_MENU_ENTRY *SubMenuGraphics()