[BOOT] Huge refactor

This commit is contained in:
2024-10-05 15:39:04 -04:00
parent 6a678794d3
commit 7c3dafc051
18 changed files with 982 additions and 399 deletions

View File

@@ -43,7 +43,7 @@ Return Value:
--*/
{
PBOOT_INPUT_PARAMETERS InputParameters;
PBOOT_APPLICATION_PARAMETERS InputParameters;
//
// Create firmware-independent input structure from EFI parameters.

View File

@@ -13,11 +13,11 @@ Abstract:
--*/
#include "bootlib.h"
#include "bootmgr.h"
NTSTATUS
BmOpenDataStore (
IN OUT PHANDLE DataStore
IN OUT PHANDLE Handle
)
/*++
@@ -28,7 +28,7 @@ Routine Description:
Arguments:
DataStore - Pointer to a HANDLE that recieves the data store handle.
Handle - Pointer to a HANDLE that recieves the data store handle.
Return Value:
@@ -37,7 +37,7 @@ Return Value:
--*/
{
*DataStore = INVALID_HANDLE_VALUE;
*Handle = INVALID_HANDLE_VALUE;
/*
NTSTATUS Status;
@@ -51,5 +51,6 @@ Return Value:
return BmGetDataStorePath(&Device, &FilePath, &FilePathSet);
*/
return STATUS_SUCCESS;
}

View File

@@ -9,16 +9,15 @@ Module Name:
Abstract:
Main functions of the boot manager.
Boot manager main routine.
--*/
#include "bootmgr.h"
#include "bootlib.h"
NTSTATUS
BmMain (
IN PBOOT_INPUT_PARAMETERS InputParameters
IN PBOOT_APPLICATION_PARAMETERS ApplicationParameters
)
/*++
@@ -29,7 +28,7 @@ Routine Description:
Arguments:
InputParameters - Input parameters for the boot manager.
ApplicationParameters - Input parameters for the boot manager.
Return Value:
@@ -41,15 +40,16 @@ Return Value:
{
NTSTATUS Status;
BOOT_LIBRARY_PARAMETERS LibraryParameters;
HANDLE DataStore;
HANDLE DataStoreHandle;
LibraryParameters.Flags = 0;
LibraryParameters.TranslationType = TRANSLATION_TYPE_NONE;
LibraryParameters.MinimumPageAllocation = 16;
//
// Initialize the boot library.
//
Status = BlInitializeLibrary(InputParameters, &LibraryParameters);
Status = BlInitializeLibrary(ApplicationParameters, &LibraryParameters);
if (!NT_SUCCESS(Status)) {
ConsolePrintf(L"BlInitializeLibrary() failed: 0x%x\r\n", Status);
goto Exit;
@@ -58,9 +58,7 @@ Return Value:
//
// Open the boot data store.
//
(VOID)BmOpenDataStore(&DataStore);
while (TRUE);
(VOID)BmOpenDataStore(&DataStoreHandle);
Exit:
BlDestroyLibrary();