)
{
ULONG_PTR NextOption = 0, ListOption;
- PBL_BCD_OPTION Option;
+ PBL_BCD_OPTION Option, FoundOption;
/* No options, bail out */
if (!List)
}
/* Loop while we find an option */
- while (TRUE)
+ FoundOption = NULL;
+ do
{
/* Get the next option and see if it matches the type */
Option = (PBL_BCD_OPTION)((ULONG_PTR)List + NextOption);
if ((Option->Type == Type) && !(Option->Empty))
{
+ FoundOption = Option;
break;
}
Option = MiscGetBootOption((PBL_BCD_OPTION)((ULONG_PTR)Option +
ListOption),
Type);
-
- /* Found one, return it */
if (Option)
{
- return Option;
+ /* Return it */
+ FoundOption = Option;
+ break;
}
}
- }
+ } while (NextOption);
- /* We found the option, return it */
- return Option;
+ /* Return the option that was found, if any */
+ return FoundOption;
}
-
-
/*++
* @name BlGetBootOptionListSize
*
/* Update the offset */
NextOffset = NextOption->NextEntryOffset;
- } while (NextOffset != 0);
+ } while (NextOffset);
/* Return final computed size */
return Size;
ULONG Size, Offset;
/* Check if there's any data */
- if (BcdOption->DataOffset != 0)
+ if (BcdOption->DataOffset)
{
/* Add the size of the data */
Size = BcdOption->DataOffset + BcdOption->DataSize;
/* Any associated options? */
Offset = BcdOption->ListOffset;
- if (Offset != 0)
+ if (Offset)
{
/* Go get those too */
Size += BlGetBootOptionListSize((PVOID)((ULONG_PTR)BcdOption + Offset));
{
/* Extract the string */
String = (PWCHAR)((ULONG_PTR)Option + Option->DataOffset);
+ Status = STATUS_SUCCESS;
}
else
{
/* No string is present */
String = NULL;
+ Status = STATUS_NOT_FOUND;
}
/* Compute the data size */
AppIdentifier = BlGetApplicationIdentifier();
Status = BlpBootOptionCallbackString(AppIdentifier, Type, String, StringLength, &String, &StringLength);
#else
- Status = STATUS_SUCCESS;
#endif
-
/* Check if we have space for one more character */
CopyLength = StringLength + 1;
if (CopyLength < StringLength)
CopyLength = -1;
Status = STATUS_INTEGER_OVERFLOW;
}
- else
- {
- /* Go ahead */
- Status = STATUS_SUCCESS;
- }
/* No overflow? */
if (NT_SUCCESS(Status))
}
#else
/* No secure boot, so the secure descriptors are the standard ones */
- Status = STATUS_SUCCESS;
SecureDescriptor = DeviceDescriptor;
SecureListData = ListCopy;
#endif
/* Assume failure */
LocalHandle = NULL;
+ EfiPrintf(L"Opening BCD store: %wZ\n", FileName);
/* Allocate a path descriptor */
Length = FileName->Length + sizeof(*FilePath);