From bfe091c0e683a01978b4beab77d4fccd0dd9fe1e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marvin=20H=C3=A4user?= <8659494+mhaeuser@users.noreply.github.com> Date: Thu, 18 Mar 2021 11:06:14 +0100 Subject: [PATCH] OpenCanopy: Fix ASSERT on timeout --- Platform/OpenCanopy/GuiApp.h | 3 ++- Platform/OpenCanopy/OcBootstrap.c | 5 ++++- Platform/OpenCanopy/Views/BootPicker.c | 6 +++++- 3 files changed, 11 insertions(+), 3 deletions(-) diff --git a/Platform/OpenCanopy/GuiApp.h b/Platform/OpenCanopy/GuiApp.h index ebc43731..872a42ec 100644 --- a/Platform/OpenCanopy/GuiApp.h +++ b/Platform/OpenCanopy/GuiApp.h @@ -113,7 +113,8 @@ BootPickerViewInitialize ( VOID BootPickerViewLateInitialize ( - IN UINT8 DefaultIndex + IN BOOT_PICKER_GUI_CONTEXT *GuiContext, + IN UINT8 DefaultIndex ); EFI_STATUS diff --git a/Platform/OpenCanopy/OcBootstrap.c b/Platform/OpenCanopy/OcBootstrap.c index 208d3f50..b597c6fc 100644 --- a/Platform/OpenCanopy/OcBootstrap.c +++ b/Platform/OpenCanopy/OcBootstrap.c @@ -130,7 +130,10 @@ OcShowMenuByOc ( } } - BootPickerViewLateInitialize ((UINT8) BootContext->DefaultEntry->EntryIndex - 1); + BootPickerViewLateInitialize ( + &mGuiContext, + (UINT8) BootContext->DefaultEntry->EntryIndex - 1 + ); GuiRedrawAndFlushScreen (&mDrawContext); diff --git a/Platform/OpenCanopy/Views/BootPicker.c b/Platform/OpenCanopy/Views/BootPicker.c index daff1594..f765ad5a 100644 --- a/Platform/OpenCanopy/Views/BootPicker.c +++ b/Platform/OpenCanopy/Views/BootPicker.c @@ -1906,13 +1906,16 @@ BootPickerViewInitialize ( VOID BootPickerViewLateInitialize ( - IN UINT8 DefaultIndex + IN BOOT_PICKER_GUI_CONTEXT *GuiContext, + IN UINT8 DefaultIndex ) { UINT32 Index; INT64 ScrollOffset; CONST GUI_VOLUME_ENTRY *BootEntry; + ASSERT (DefaultIndex < mBootPicker.Hdr.Obj.NumChildren); + ScrollOffset = InternelBootPickerScrollSelected (); // // If ScrollOffset is non-0, the selected entry will be aligned left- or @@ -1943,6 +1946,7 @@ BootPickerViewLateInitialize ( mBootPicker.Hdr.Obj.OffsetX += ScrollOffset; InternalBootPickerSelectEntry (&mBootPicker, NULL, DefaultIndex); + GuiContext->BootEntry = InternalGetVolumeEntry (DefaultIndex)->Context; } VOID