Store boot loader image information and close EFI_LOADED_IMAGE_PROTOCOL afterwards
This commit is contained in:
parent
8580557985
commit
22a7676b9b
@ -195,6 +195,8 @@ typedef struct _XTBL_STATUS
|
||||
PBL_XT_BOOT_MENU BootMenu;
|
||||
BOOLEAN BootServices;
|
||||
ULONG DebugPort;
|
||||
PVOID LoaderBase;
|
||||
ULONGLONG LoaderSize;
|
||||
INT_PTR SecureBoot;
|
||||
CPPORT SerialPort;
|
||||
} XTBL_STATUS, *PXTBL_STATUS;
|
||||
|
@ -42,12 +42,16 @@ BlInitializeBootLoader()
|
||||
/* Store SecureBoot status */
|
||||
BlpStatus.SecureBoot = BlGetSecureBootStatus();
|
||||
|
||||
/* Check if debug is enabled */
|
||||
if(DEBUG)
|
||||
{
|
||||
/* Attempt to open EFI LoadedImage protocol */
|
||||
Status = BlOpenProtocol(&Handle, (PVOID *)&LoadedImage, &LipGuid);
|
||||
if(Status == STATUS_EFI_SUCCESS)
|
||||
{
|
||||
/* Store boot loader image base and size */
|
||||
BlpStatus.LoaderBase = LoadedImage->ImageBase;
|
||||
BlpStatus.LoaderSize = LoadedImage->ImageSize;
|
||||
|
||||
/* Check if debug is enabled */
|
||||
if(DEBUG)
|
||||
{
|
||||
/* Protocol opened successfully, print useful debug information */
|
||||
BlConsolePrint(L"\n---------- BOOTLOADER DEBUG ----------\n"
|
||||
@ -62,6 +66,9 @@ BlInitializeBootLoader()
|
||||
LoadedImage->Revision);
|
||||
BlSleepExecution(3000);
|
||||
}
|
||||
|
||||
/* Close EFI LoadedImage protocol */
|
||||
BlCloseProtocol(&Handle, &LipGuid);
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user