/*++ Copyright (c) 2024, Quinn Stephens. Provided under the BSD 3-Clause license. Module Name: bootmgr.c Abstract: Main functions of the boot manager. --*/ #include "bootmgr.h" #include "bootlib.h" NTSTATUS BmMain ( IN PBOOT_INPUT_PARAMETERS InputParameters ) /*++ Routine Description: Firmware-independent boot manager entry point. Arguments: InputParameters - Input parameters for the boot manager. Return Value: Error code on failure. Does not return on success, as control is transferred to the OS loader. --*/ { NTSTATUS Status; BOOT_LIBRARY_PARAMETERS LibraryParameters; HANDLE DataStore; LibraryParameters.Flags = 0; LibraryParameters.MinimumPageAllocation = 16; // // Initialize the boot library. // Status = BlInitializeLibrary(InputParameters, &LibraryParameters); if (!NT_SUCCESS(Status)) { ConsolePrintf(L"BlInitializeLibrary() failed: 0x%x\r\n", Status); goto Exit; } // // Open the boot data store. // (VOID)BmOpenDataStore(&DataStore); while (TRUE); Exit: BlDestroyLibrary(); return Status; }