[BOOT:LIB] More initialization and cleanup
Started BlpMmDestroy(), MmMdDestroy(), MmPaDestroy(), EfiSetWatchdogTimer(), EfiOpenProtocol(), EfiConInExSetState(), and BlDestroyLibrary(). Completed BlpFwInitialize(). Improved InitializeLibrary().
This commit is contained in:
@@ -78,7 +78,7 @@ Return Value:
|
||||
//
|
||||
Status = BlpFwInitialize(0, FirmwareData);
|
||||
if (!NT_SUCCESS(Status)) {
|
||||
return Status;
|
||||
goto Stage0Failed;
|
||||
}
|
||||
|
||||
ConsolePrint(L"> Alcyone EFI Boot Manager\r\n");
|
||||
@@ -86,7 +86,8 @@ Return Value:
|
||||
|
||||
if (ApplicationEntry->Signature != BOOT_INIT_APPLICATION_ENTRY_SIGNATURE) {
|
||||
DebugPrint(L"InitializeLibrary(): ApplicationEntry Signature is invalid\r\n");
|
||||
return STATUS_INVALID_PARAMETER_9;
|
||||
Status = STATUS_INVALID_PARAMETER_9;
|
||||
goto Stage0Failed;
|
||||
}
|
||||
|
||||
//
|
||||
@@ -104,14 +105,27 @@ Return Value:
|
||||
|
||||
Status = BlpArchInitialize(0);
|
||||
if (!NT_SUCCESS(Status)) {
|
||||
return Status;
|
||||
goto Stage0Failed;
|
||||
}
|
||||
|
||||
Status = BlpMmInitialize(MemoryInfo, ApplicationParameters->TranslationType, LibraryParameters);
|
||||
if (!NT_SUCCESS(Status)) {
|
||||
return Status;
|
||||
goto Stage0Failed;
|
||||
}
|
||||
|
||||
Status = BlpFwInitialize(1, FirmwareData);
|
||||
if (!NT_SUCCESS(Status)) {
|
||||
goto Stage1Failed;
|
||||
}
|
||||
|
||||
Status = BlpArchInitialize(1);
|
||||
if (!NT_SUCCESS(Status)) {
|
||||
goto Stage1Failed;
|
||||
}
|
||||
|
||||
Stage1Failed:
|
||||
BlpMmDestroy(1);
|
||||
Stage0Failed:
|
||||
return STATUS_SUCCESS;
|
||||
}
|
||||
|
||||
@@ -160,10 +174,25 @@ Arguments:
|
||||
|
||||
Return Value:
|
||||
|
||||
STATUS_SUCCESS.
|
||||
STATUS_SUCCESS if successful.
|
||||
Error code on failure.
|
||||
|
||||
--*/
|
||||
|
||||
{
|
||||
return STATUS_SUCCESS;
|
||||
NTSTATUS Status, ExitStatus;
|
||||
|
||||
ExitStatus = STATUS_SUCCESS;
|
||||
|
||||
Status = BlpMmDestroy(0);
|
||||
if (!NT_SUCCESS(Status)) {
|
||||
ExitStatus = Status;
|
||||
}
|
||||
|
||||
Status = BlpMmDestroy(1);
|
||||
if (!NT_SUCCESS(Status)) {
|
||||
ExitStatus = Status;
|
||||
}
|
||||
|
||||
return ExitStatus;
|
||||
}
|
||||
|
Reference in New Issue
Block a user