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

Function DeleteBootOption

rEFIt_UEFI/Platform/BootOptions.cpp:1062–1099  ·  view source on GitHub ↗

Deletes boot option specified with BootNum (XXXX in BootXXXX var name). */

Source from the content-addressed store, hash-verified

1060
1061/** Deletes boot option specified with BootNum (XXXX in BootXXXX var name). */
1062EFI_STATUS
1063DeleteBootOption (
1064 IN UINT16 BootNum
1065 )
1066{
1067 EFI_STATUS Status;
1068 CHAR16 VarName[16];
1069
1070
1071 DBG("DeleteBootOption: Boot%04hX\n", BootNum);
1072
1073 snwprintf(VarName, sizeof(VarName), "Boot%04hX", BootNum);
1074
1075 //
1076 // Delete BootXXXX var
1077 //
1078 Status = gRT->SetVariable (VarName,
1079 &gEfiGlobalVariableGuid,
1080 0,
1081 0,
1082 NULL
1083 );
1084 if (EFI_ERROR(Status)) {
1085 DBG(" Error del. variable: %ls = %s\n", VarName, efiStrError(Status));
1086 return Status;
1087 }
1088 DBG(" %ls deleted\n", VarName);
1089
1090 //
1091 // Update BootOrder - delete our boot option from the list
1092 //
1093 Status = DeleteFromBootOrder (BootNum);
1094 //if (EFI_ERROR(Status)) {
1095 // return Status;
1096 //}
1097
1098 return Status;
1099}
1100
1101//
1102// Delete all boot options for file specified with FileDeviceHandle and FileName.

Callers 3

DeleteBootOptionForFileFunction · 0.85
PrepareHibernationFunction · 0.85

Calls 2

DeleteFromBootOrderFunction · 0.85
efiStrErrorFunction · 0.50

Tested by

no test coverage detected