VeraCrypt
aboutsummaryrefslogtreecommitdiff
path: root/Library/CommonLib
diff options
context:
space:
mode:
Diffstat (limited to 'Library/CommonLib')
-rw-r--r--Library/CommonLib/EfiVar.c9
1 files changed, 5 insertions, 4 deletions
diff --git a/Library/CommonLib/EfiVar.c b/Library/CommonLib/EfiVar.c
index e9c1082..e03544f 100644
--- a/Library/CommonLib/EfiVar.c
+++ b/Library/CommonLib/EfiVar.c
@@ -148,7 +148,8 @@ BootOrderRemove(
EFI_STATUS
BootOrderPresent(
IN CHAR16 *OrderVarName,
- UINT16 value)
+ UINT16 value,
+ UINTN *index)
{
EFI_STATUS res = EFI_NOT_READY;
UINT16* varBootOrder;
@@ -156,19 +157,19 @@ BootOrderPresent(
UINT32 varBootOrderAttr;
UINTN BootOrderCount;
UINTN i;
- UINTN j;
res = EfiGetVar(OrderVarName, &gEfiGlobalVariableGuid, &varBootOrder, &varBootOrderSize, &varBootOrderAttr);
if (EFI_ERROR(res)) return res;
BootOrderCount = varBootOrderSize / sizeof(UINT16);
res = EFI_NOT_FOUND;
- for (j = 0, i = 0; i < BootOrderCount; ++i) {
+ for (i = 0; i < BootOrderCount; ++i) {
if (varBootOrder[i] == value) {
- MEM_FREE(varBootOrder);
res = EFI_SUCCESS;
break;
}
}
+ if (index != NULL) *index = i;
+ MEM_FREE(varBootOrder);
return res;
}