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

Function GetBootOrder

rEFIt_UEFI/Platform/BootOptions.cpp:337–369  ·  view source on GitHub ↗

Returns gEfiGlobalVariableGuid:BootOrder as UINT16 array and it's length (num of elements). * Caller is responsible for releasing BootOrder mem (FreePool()). */

Source from the content-addressed store, hash-verified

335 * Caller is responsible for releasing BootOrder mem (FreePool()).
336 */
337EFI_STATUS
338GetBootOrder (
339 OUT UINT16 *BootOrder[],
340 OUT UINTN *BootOrderLen
341 )
342{
343 UINTN BootOrderSize;
344
345
346 DBG("BootOrder:");
347 //
348 // Basic checks
349 //
350 if (BootOrder == NULL || BootOrderLen == NULL) {
351 DBG(" EFI_INVALID_PARAMETER\n");
352 return EFI_INVALID_PARAMETER;
353 }
354
355 //
356 // Get gEfiGlobalVariableGuid:BootOrder and it's length
357 //
358 *BootOrder = (__typeof_am__(*BootOrder))GetNvramVariable(BOOT_ORDER_VAR, &gEfiGlobalVariableGuid, NULL, &BootOrderSize);
359 if (*BootOrder == NULL) {
360 DBG(" EFI_NOT_FOUND\n");
361 return EFI_NOT_FOUND;
362 }
363
364 *BootOrderLen = BootOrderSize / sizeof(UINT16);
365
366 PrintBootOrder(*BootOrder, *BootOrderLen);
367
368 return EFI_SUCCESS;
369}
370
371
372/** Updates BootOrder by adding new boot option BootNumNew at index BootIndexNew. */

Callers 5

AddToBootOrderFunction · 0.70
DeleteFromBootOrderFunction · 0.70
FindBootOptionForFileFunction · 0.70
PrintBootOptionsFunction · 0.70

Calls 2

GetNvramVariableFunction · 0.85
PrintBootOrderFunction · 0.85

Tested by

no test coverage detected