MCPcopy Create free account
hub / github.com/CloverHackyColor/CloverBootloader / GetBootOption

Function GetBootOption

rEFIt_UEFI/Platform/BootOptions.cpp:686–709  ·  view source on GitHub ↗

Reads BootXXXX (XXXX = BootNum) var, parses it and returns in BootOption. * Caller is responsible for releasing BootOption->Variable with FreePool(). */

Source from the content-addressed store, hash-verified

684 * Caller is responsible for releasing BootOption->Variable with FreePool().
685 */
686EFI_STATUS
687GetBootOption (
688 IN UINT16 BootNum,
689 OUT BO_BOOT_OPTION *BootOption
690 )
691{
692 CHAR16 VarName[16];
693
694 //
695 // Get BootXXXX var.
696 //
697 BootOption->BootNum = BootNum;
698 snwprintf(VarName, sizeof(VarName), "Boot%04hX", BootNum);
699
700 BootOption->Variable = (__typeof__(BootOption->Variable))GetNvramVariable(VarName, &gEfiGlobalVariableGuid, NULL, (UINTN *)(UINTN)(OFFSET_OF(BO_BOOT_OPTION, VariableSize) + (UINTN)BootOption));
701 if (BootOption->Variable == NULL) {
702 return EFI_NOT_FOUND;
703 }
704
705 //
706 // Parse it.
707 //
708 return ParseBootOption (BootOption);
709}
710
711
712/** Returns BootNum: XXXX of first unoccupied BootXXXX var slot. */

Callers 3

FindBootOptionForFileFunction · 0.85
PrintBootOptionsFunction · 0.85

Calls 2

GetNvramVariableFunction · 0.85
ParseBootOptionFunction · 0.85

Tested by

no test coverage detected