Compare commits
3 Commits
b8afb1aad4
...
7125a17aca
Author | SHA1 | Date | |
---|---|---|---|
7125a17aca | |||
de9501aee9 | |||
e61d0f5155 |
56
BOOT/ENVIRON/APP/BOOTMGR/bcd.c
Normal file
56
BOOT/ENVIRON/APP/BOOTMGR/bcd.c
Normal file
@ -0,0 +1,56 @@
|
||||
/*++
|
||||
|
||||
Copyright (c) 2024, Quinn Stephens.
|
||||
Provided under the BSD 3-Clause license.
|
||||
|
||||
Module Name:
|
||||
|
||||
bcd.c
|
||||
|
||||
Abstract:
|
||||
|
||||
BCD (Boot Configuration Data, aka Boot Data Store) routines.
|
||||
|
||||
--*/
|
||||
|
||||
#include "bootlib.h"
|
||||
|
||||
NTSTATUS
|
||||
BmOpenDataStore (
|
||||
IN OUT PHANDLE DataStore
|
||||
)
|
||||
|
||||
/*++
|
||||
|
||||
Routine Description:
|
||||
|
||||
Opens the boot configuration data store.
|
||||
|
||||
Arguments:
|
||||
|
||||
DataStore - pointer to memory to put the data store handle in.
|
||||
|
||||
Return Value:
|
||||
|
||||
STATUS_SUCCESS if successful,
|
||||
Other NTSTATUS value on failure.
|
||||
|
||||
--*/
|
||||
|
||||
{
|
||||
*DataStore = INVALID_HANDLE_VALUE;
|
||||
|
||||
/*
|
||||
NTSTATUS Status;
|
||||
PBOOT_DEVICE Device;
|
||||
PWSTR FilePath;
|
||||
BOOLEAN FilePathSet;
|
||||
|
||||
Device = NULL;
|
||||
FilePath = NULL;
|
||||
FilePathSet = FALSE;
|
||||
|
||||
return BmGetDataStorePath(&Device, &FilePath, &FilePathSet);
|
||||
*/
|
||||
return STATUS_SUCCESS;
|
||||
}
|
@ -41,6 +41,7 @@ Return Value:
|
||||
{
|
||||
NTSTATUS Status;
|
||||
BOOT_LIBRARY_PARAMETERS LibraryParameters;
|
||||
HANDLE DataStore;
|
||||
|
||||
LibraryParameters.Flags = 0;
|
||||
|
||||
@ -53,6 +54,11 @@ Return Value:
|
||||
goto Exit;
|
||||
}
|
||||
|
||||
//
|
||||
// Open the boot data store.
|
||||
//
|
||||
(VOID)BmOpenDataStore(&DataStore);
|
||||
|
||||
Exit:
|
||||
BlDestroyLibrary();
|
||||
return Status;
|
||||
|
@ -36,12 +36,12 @@ ConsolePrintf (
|
||||
|
||||
ULONG
|
||||
BlGetBootOptionSize (
|
||||
IN PBOOT_APPLICATION_ENTRY_OPTION Option
|
||||
IN PBOOT_APPLICATION_OPTION Option
|
||||
);
|
||||
|
||||
ULONG
|
||||
BlGetBootOptionListSize (
|
||||
IN PBOOT_APPLICATION_ENTRY_OPTION Options
|
||||
IN PBOOT_APPLICATION_OPTION Options
|
||||
);
|
||||
|
||||
NTSTATUS
|
||||
|
@ -78,18 +78,24 @@ typedef struct {
|
||||
ULONG NextOptionOffset;
|
||||
BOOLEAN IsInvalid;
|
||||
UCHAR Unknown[3];
|
||||
} BOOT_APPLICATION_ENTRY_OPTION, *PBOOT_APPLICATION_ENTRY_OPTION;
|
||||
} BOOT_APPLICATION_OPTION, *PBOOT_APPLICATION_OPTION;
|
||||
|
||||
#define BOOT_APPLICATION_ENTRY_SIGNATURE 0x544e4550415442 /* "BTAPENT" */
|
||||
#define BOOT_INPUT_APPLICATION_ENTRY_SIGNATURE 0x544e4550415442 /* "BTAPENT" */
|
||||
|
||||
#define BOOT_APPLICATION_ENTRY_NO_BCD_IDENTIFIER 0x01
|
||||
#define BOOT_INPUT_APPLICATION_ENTRY_NO_BCD_IDENTIFIER 0x01
|
||||
|
||||
typedef struct {
|
||||
ULONGLONG Signature;
|
||||
ULONG Attributes;
|
||||
GUID BcdIdentifier;
|
||||
UCHAR Unknown[16];
|
||||
BOOT_APPLICATION_ENTRY_OPTION Options;
|
||||
BOOT_APPLICATION_OPTION Options;
|
||||
} BOOT_INPUT_APPLICATION_ENTRY, *PBOOT_INPUT_APPLICATION_ENTRY;
|
||||
|
||||
typedef struct {
|
||||
ULONG Attributes;
|
||||
GUID BcdIdentifier;
|
||||
PBOOT_APPLICATION_OPTION Options;
|
||||
} BOOT_APPLICATION_ENTRY, *PBOOT_APPLICATION_ENTRY;
|
||||
|
||||
#define BOOT_MEMORY_INFO_VERSION 1
|
||||
@ -244,6 +250,11 @@ typedef struct {
|
||||
BOOT_DEVICE Device;
|
||||
} BCDE_DEVICE, *PBCDE_DEVICE;
|
||||
|
||||
NTSTATUS
|
||||
BmOpenDataStore (
|
||||
IN OUT PHANDLE DataStore
|
||||
);
|
||||
|
||||
NTSTATUS
|
||||
BmMain (
|
||||
IN PBOOT_INPUT_PARAMETERS InputParameters
|
||||
|
@ -293,7 +293,7 @@ NTSTATUS
|
||||
EfiInitpConvertEfiDevicePath (
|
||||
IN EFI_DEVICE_PATH *EfiDevicePath,
|
||||
IN BCDE_DATA_TYPE OptionType,
|
||||
IN OUT PBOOT_APPLICATION_ENTRY_OPTION Option,
|
||||
IN OUT PBOOT_APPLICATION_OPTION Option,
|
||||
IN ULONG BufferSize
|
||||
)
|
||||
|
||||
@ -327,19 +327,19 @@ Return Value:
|
||||
//
|
||||
// Check for available buffer space.
|
||||
//
|
||||
if (BufferSize < sizeof(BOOT_APPLICATION_ENTRY_OPTION) + FIELD_OFFSET(BCDE_DEVICE, Device)) {
|
||||
if (BufferSize < sizeof(BOOT_APPLICATION_OPTION) + FIELD_OFFSET(BCDE_DEVICE, Device)) {
|
||||
return STATUS_INVALID_PARAMETER;
|
||||
}
|
||||
|
||||
//
|
||||
// Translate device path.
|
||||
//
|
||||
RtlZeroMemory(Option, sizeof(BOOT_APPLICATION_ENTRY_OPTION));
|
||||
DeviceElement = (PBCDE_DEVICE)((PUCHAR)Option + sizeof(BOOT_APPLICATION_ENTRY_OPTION));
|
||||
RtlZeroMemory(Option, sizeof(BOOT_APPLICATION_OPTION));
|
||||
DeviceElement = (PBCDE_DEVICE)((PUCHAR)Option + sizeof(BOOT_APPLICATION_OPTION));
|
||||
Status = EfiInitTranslateDevicePath(
|
||||
EfiDevicePath,
|
||||
&DeviceElement->Device,
|
||||
BufferSize - (sizeof(BOOT_APPLICATION_ENTRY_OPTION) + FIELD_OFFSET(BCDE_DEVICE, Device))
|
||||
BufferSize - (sizeof(BOOT_APPLICATION_OPTION) + FIELD_OFFSET(BCDE_DEVICE, Device))
|
||||
);
|
||||
if (!NT_SUCCESS(Status)) {
|
||||
return Status;
|
||||
@ -349,7 +349,7 @@ Return Value:
|
||||
// Set up option structure.
|
||||
//
|
||||
Option->Type = OptionType;
|
||||
Option->DataOffset = sizeof(BOOT_APPLICATION_ENTRY_OPTION);
|
||||
Option->DataOffset = sizeof(BOOT_APPLICATION_OPTION);
|
||||
Option->DataSize = FIELD_OFFSET(BCDE_DEVICE, Device) + DeviceElement->Device.Size;
|
||||
|
||||
return STATUS_SUCCESS;
|
||||
@ -359,7 +359,7 @@ NTSTATUS
|
||||
EfiInitpConvertEfiFilePath (
|
||||
IN EFI_DEVICE_PATH *EfiFilePath,
|
||||
IN BCDE_DATA_TYPE OptionType,
|
||||
IN OUT PBOOT_APPLICATION_ENTRY_OPTION Option,
|
||||
IN OUT PBOOT_APPLICATION_OPTION Option,
|
||||
IN ULONG BufferSize
|
||||
)
|
||||
|
||||
@ -395,22 +395,22 @@ Return Value:
|
||||
//
|
||||
// Check for available buffer space.
|
||||
//
|
||||
if (BufferSize < sizeof(BOOT_APPLICATION_ENTRY_OPTION)) {
|
||||
if (BufferSize < sizeof(BOOT_APPLICATION_OPTION)) {
|
||||
return STATUS_INVALID_PARAMETER;
|
||||
}
|
||||
|
||||
//
|
||||
// Set up option structure.
|
||||
//
|
||||
RtlZeroMemory(Option, sizeof(BOOT_APPLICATION_ENTRY_OPTION));
|
||||
RtlZeroMemory(Option, sizeof(BOOT_APPLICATION_OPTION));
|
||||
Option->Type = OptionType;
|
||||
Option->DataOffset = sizeof(BOOT_APPLICATION_ENTRY_OPTION);
|
||||
Option->DataOffset = sizeof(BOOT_APPLICATION_OPTION);
|
||||
|
||||
//
|
||||
// Add to the path one file path node at a time.
|
||||
//
|
||||
Option->DataSize = 0;
|
||||
BufferRemaining = BufferSize - sizeof(BOOT_APPLICATION_ENTRY_OPTION);
|
||||
BufferRemaining = BufferSize - sizeof(BOOT_APPLICATION_OPTION);
|
||||
Node = EfiFilePath;
|
||||
PathStart = (PWCHAR)((PUCHAR)Option + Option->DataOffset);
|
||||
Position = PathStart;
|
||||
@ -458,7 +458,7 @@ Return Value:
|
||||
VOID
|
||||
EfiInitpCreateApplicationEntry (
|
||||
IN EFI_SYSTEM_TABLE *SystemTable,
|
||||
IN OUT PBOOT_APPLICATION_ENTRY Entry,
|
||||
IN OUT PBOOT_INPUT_APPLICATION_ENTRY Entry,
|
||||
IN ULONG BufferSize,
|
||||
IN EFI_DEVICE_PATH *EfiDevicePath,
|
||||
IN EFI_DEVICE_PATH *EfiFilePath,
|
||||
@ -509,7 +509,7 @@ Return Value:
|
||||
PWCHAR BcdOptionString;
|
||||
BOOLEAN BcdIdentifierSet;
|
||||
UNICODE_STRING UnicodeString;
|
||||
PBOOT_APPLICATION_ENTRY_OPTION Option, PrevOption;
|
||||
PBOOT_APPLICATION_OPTION Option, PrevOption;
|
||||
PBCDE_DEVICE BootDeviceElement;
|
||||
|
||||
(VOID)SystemTable;
|
||||
@ -526,16 +526,16 @@ Return Value:
|
||||
// Require enough space for the application entry.
|
||||
//
|
||||
BufferRemaining = BufferSize;
|
||||
if (BufferRemaining < sizeof(BOOT_APPLICATION_ENTRY)) {
|
||||
if (BufferRemaining < sizeof(BOOT_INPUT_APPLICATION_ENTRY)) {
|
||||
return;
|
||||
}
|
||||
|
||||
//
|
||||
// Set up application entry structure.
|
||||
//
|
||||
RtlZeroMemory(Entry, sizeof(BOOT_APPLICATION_ENTRY));
|
||||
Entry->Signature = BOOT_APPLICATION_ENTRY_SIGNATURE;
|
||||
BufferRemaining -= FIELD_OFFSET(BOOT_APPLICATION_ENTRY, Options);
|
||||
RtlZeroMemory(Entry, sizeof(BOOT_INPUT_APPLICATION_ENTRY));
|
||||
Entry->Signature = BOOT_INPUT_APPLICATION_ENTRY_SIGNATURE;
|
||||
BufferRemaining -= FIELD_OFFSET(BOOT_INPUT_APPLICATION_ENTRY, Options);
|
||||
|
||||
//
|
||||
// Terminate load options string.
|
||||
@ -556,7 +556,7 @@ Return Value:
|
||||
}
|
||||
|
||||
if (!BcdIdentifierSet) {
|
||||
Entry->Attributes |= BOOT_APPLICATION_ENTRY_NO_BCD_IDENTIFIER;
|
||||
Entry->Attributes |= BOOT_INPUT_APPLICATION_ENTRY_NO_BCD_IDENTIFIER;
|
||||
}
|
||||
|
||||
//
|
||||
@ -579,7 +579,7 @@ Return Value:
|
||||
// TODO: UDP/PXE boot is not supported.
|
||||
//
|
||||
PrevOption = Option;
|
||||
Option = (PBOOT_APPLICATION_ENTRY_OPTION)((PUCHAR)&Entry->Options + OptionsSize);
|
||||
Option = (PBOOT_APPLICATION_OPTION)((PUCHAR)&Entry->Options + OptionsSize);
|
||||
Status = EfiInitpConvertEfiFilePath(EfiFilePath, BCDE_DATA_TYPE_APPLICATION_PATH, Option, BufferRemaining);
|
||||
if (!NT_SUCCESS(Status)) {
|
||||
goto exit;
|
||||
@ -593,7 +593,7 @@ Return Value:
|
||||
// TODO: This section is incomplete.
|
||||
//
|
||||
PrevOption = Option;
|
||||
Option = (PBOOT_APPLICATION_ENTRY_OPTION)((PUCHAR)&Entry->Options + OptionsSize);
|
||||
Option = (PBOOT_APPLICATION_OPTION)((PUCHAR)&Entry->Options + OptionsSize);
|
||||
// Status = Unknown(LoadOptions, &Entry->Options, RemainingSize, &OptionsSize, &PrevOption, &Size);
|
||||
if (!NT_SUCCESS(Status)) {
|
||||
goto exit;
|
||||
@ -712,7 +712,7 @@ Return Value:
|
||||
InputParameters->ApplicationEntryOffset = ScratchUsed;
|
||||
EfiInitpCreateApplicationEntry(
|
||||
SystemTable,
|
||||
(PBOOT_APPLICATION_ENTRY)(&EfiInitScratch[ScratchUsed]),
|
||||
(PBOOT_INPUT_APPLICATION_ENTRY)(&EfiInitScratch[ScratchUsed]),
|
||||
sizeof(EfiInitScratch) - ScratchUsed,
|
||||
DevicePath,
|
||||
LoadedImage->FilePath,
|
||||
|
@ -13,6 +13,7 @@ Abstract:
|
||||
|
||||
--*/
|
||||
|
||||
#include <ntrtl.h>
|
||||
#include "bootlib.h"
|
||||
|
||||
//
|
||||
@ -25,83 +26,9 @@ Abstract:
|
||||
sizeof(BOOT_RETURN_DATA) \
|
||||
)
|
||||
|
||||
ULONG
|
||||
BlGetBootOptionListSize (
|
||||
IN PBOOT_APPLICATION_ENTRY_OPTION Options
|
||||
);
|
||||
|
||||
ULONG
|
||||
BlGetBootOptionSize (
|
||||
IN PBOOT_APPLICATION_ENTRY_OPTION Option
|
||||
)
|
||||
|
||||
/*++
|
||||
|
||||
Routine Description:
|
||||
|
||||
Gets the size of a boot option.
|
||||
|
||||
Arguments:
|
||||
|
||||
Option - the boot option to get the size of.
|
||||
|
||||
Return Value:
|
||||
|
||||
The size of the option.
|
||||
|
||||
--*/
|
||||
|
||||
{
|
||||
ULONG TotalSize;
|
||||
|
||||
if (Option->DataOffset != 0) {
|
||||
TotalSize = Option->DataOffset + Option->DataSize;
|
||||
} else {
|
||||
TotalSize = sizeof(BOOT_APPLICATION_ENTRY_OPTION);
|
||||
}
|
||||
|
||||
if (Option->OtherOptionsOffset != 0) {
|
||||
TotalSize += BlGetBootOptionListSize((PBOOT_APPLICATION_ENTRY_OPTION)((PUCHAR)Option + Option->OtherOptionsOffset));
|
||||
}
|
||||
|
||||
return TotalSize;
|
||||
}
|
||||
|
||||
ULONG
|
||||
BlGetBootOptionListSize (
|
||||
IN PBOOT_APPLICATION_ENTRY_OPTION Options
|
||||
)
|
||||
|
||||
/*++
|
||||
|
||||
Routine Description:
|
||||
|
||||
Gets the total size of a list boot options.
|
||||
|
||||
Arguments:
|
||||
|
||||
Options - the boot option list to get the size of.
|
||||
|
||||
Return Value:
|
||||
|
||||
The size of the options.
|
||||
|
||||
--*/
|
||||
|
||||
{
|
||||
ULONG TotalSize, NextOffset;
|
||||
PBOOT_APPLICATION_ENTRY_OPTION Option;
|
||||
|
||||
TotalSize = 0;
|
||||
NextOffset = 0;
|
||||
do {
|
||||
Option = (PBOOT_APPLICATION_ENTRY_OPTION)((PUCHAR)Options + NextOffset);
|
||||
NextOffset = Option->NextOptionOffset;
|
||||
TotalSize += BlGetBootOptionSize(Option);
|
||||
} while (NextOffset != 0);
|
||||
|
||||
return TotalSize;
|
||||
}
|
||||
PBOOT_INPUT_PARAMETERS BlpApplicationParameters;
|
||||
BOOT_APPLICATION_ENTRY BlpApplicationEntry;
|
||||
PBOOT_DEVICE BlpBootDevice;
|
||||
|
||||
NTSTATUS
|
||||
InitializeLibrary (
|
||||
@ -129,11 +56,10 @@ Return Value:
|
||||
|
||||
{
|
||||
NTSTATUS Status;
|
||||
PBOOT_APPLICATION_ENTRY ApplicationEntry;
|
||||
PBOOT_DEVICE BootDevice;
|
||||
PBOOT_INPUT_APPLICATION_ENTRY ApplicationEntry;
|
||||
PBOOT_FIRMWARE_DATA FirmwareData;
|
||||
PBOOT_BLOCK_IDENTIFIER BlockDevice;
|
||||
PBOOT_APPLICATION_ENTRY_OPTION Option;
|
||||
PBOOT_APPLICATION_OPTION Option;
|
||||
|
||||
(VOID)LibraryParameters;
|
||||
|
||||
@ -149,8 +75,8 @@ Return Value:
|
||||
//
|
||||
// Calculate structure addresses from offsets.
|
||||
//
|
||||
ApplicationEntry = (PBOOT_APPLICATION_ENTRY)((PUCHAR)InputParameters + InputParameters->ApplicationEntryOffset);
|
||||
BootDevice = (PBOOT_DEVICE)((PUCHAR)InputParameters + InputParameters->BootDeviceOffset);
|
||||
ApplicationEntry = (PBOOT_INPUT_APPLICATION_ENTRY)((PUCHAR)InputParameters + InputParameters->ApplicationEntryOffset);
|
||||
BlpBootDevice = (PBOOT_DEVICE)((PUCHAR)InputParameters + InputParameters->BootDeviceOffset);
|
||||
FirmwareData = (PBOOT_FIRMWARE_DATA)((PUCHAR)InputParameters + InputParameters->FirmwareDataOffset);
|
||||
|
||||
//
|
||||
@ -161,6 +87,21 @@ Return Value:
|
||||
return Status;
|
||||
}
|
||||
|
||||
//
|
||||
// Check application entry signature.
|
||||
//
|
||||
if (ApplicationEntry->Signature != BOOT_INPUT_APPLICATION_ENTRY_SIGNATURE) {
|
||||
return STATUS_INVALID_PARAMETER_9;
|
||||
}
|
||||
|
||||
//
|
||||
// Save input parameters and application entry data.
|
||||
//
|
||||
BlpApplicationParameters = InputParameters;
|
||||
BlpApplicationEntry.Attributes = ApplicationEntry->Attributes;
|
||||
RtlCopyMemory(&BlpApplicationEntry.BcdIdentifier, &ApplicationEntry->BcdIdentifier, sizeof(GUID));
|
||||
BlpApplicationEntry.Options = &ApplicationEntry->Options;
|
||||
|
||||
//
|
||||
// Print debug information.
|
||||
//
|
||||
@ -169,18 +110,18 @@ Return Value:
|
||||
ConsolePrintf(L"Image size: %x\r\n", InputParameters->ImageSize);
|
||||
|
||||
ConsolePrint(L"Boot device type: ");
|
||||
switch (BootDevice->Type) {
|
||||
switch (BlpBootDevice->Type) {
|
||||
case BOOT_DEVICE_TYPE_PARTITION:
|
||||
ConsolePrint(L"partition\r\n");
|
||||
BlockDevice = &BootDevice->Partition.Parent;
|
||||
BlockDevice = &BlpBootDevice->Partition.Parent;
|
||||
break;
|
||||
case BOOT_DEVICE_TYPE_PARTITION_EX:
|
||||
ConsolePrint(L"partition\r\n");
|
||||
BlockDevice = &BootDevice->PartitionEx.Parent;
|
||||
BlockDevice = &BlpBootDevice->PartitionEx.Parent;
|
||||
break;
|
||||
default:
|
||||
ConsolePrint(L"generic block device\r\n");
|
||||
BlockDevice = &BootDevice->Block;
|
||||
BlockDevice = &BlpBootDevice->Block;
|
||||
break;
|
||||
}
|
||||
|
||||
@ -216,7 +157,7 @@ Return Value:
|
||||
break;
|
||||
}
|
||||
|
||||
Option = (PBOOT_APPLICATION_ENTRY_OPTION)((PUCHAR)Option + Option->NextOptionOffset);
|
||||
Option = (PBOOT_APPLICATION_OPTION)((PUCHAR)Option + Option->NextOptionOffset);
|
||||
}
|
||||
|
||||
return STATUS_SUCCESS;
|
||||
|
89
BOOT/ENVIRON/LIB/bootopt.c
Normal file
89
BOOT/ENVIRON/LIB/bootopt.c
Normal file
@ -0,0 +1,89 @@
|
||||
/*++
|
||||
|
||||
Copyright (c) 2024, Quinn Stephens.
|
||||
Provided under the BSD 3-Clause license.
|
||||
|
||||
Module Name:
|
||||
|
||||
bootopt.c
|
||||
|
||||
Abstract:
|
||||
|
||||
Provides boot option utilities.
|
||||
|
||||
--*/
|
||||
|
||||
#include "bootlib.h"
|
||||
|
||||
ULONG
|
||||
BlGetBootOptionSize (
|
||||
IN PBOOT_APPLICATION_OPTION Option
|
||||
)
|
||||
|
||||
/*++
|
||||
|
||||
Routine Description:
|
||||
|
||||
Gets the size of a boot option.
|
||||
|
||||
Arguments:
|
||||
|
||||
Option - the boot option to get the size of.
|
||||
|
||||
Return Value:
|
||||
|
||||
The size of the option.
|
||||
|
||||
--*/
|
||||
|
||||
{
|
||||
ULONG TotalSize;
|
||||
|
||||
if (Option->DataOffset != 0) {
|
||||
TotalSize = Option->DataOffset + Option->DataSize;
|
||||
} else {
|
||||
TotalSize = sizeof(BOOT_APPLICATION_OPTION);
|
||||
}
|
||||
|
||||
if (Option->OtherOptionsOffset != 0) {
|
||||
TotalSize += BlGetBootOptionListSize((PBOOT_APPLICATION_OPTION)((PUCHAR)Option + Option->OtherOptionsOffset));
|
||||
}
|
||||
|
||||
return TotalSize;
|
||||
}
|
||||
|
||||
ULONG
|
||||
BlGetBootOptionListSize (
|
||||
IN PBOOT_APPLICATION_OPTION Options
|
||||
)
|
||||
|
||||
/*++
|
||||
|
||||
Routine Description:
|
||||
|
||||
Gets the total size of a list boot options.
|
||||
|
||||
Arguments:
|
||||
|
||||
Options - the boot option list to get the size of.
|
||||
|
||||
Return Value:
|
||||
|
||||
The size of the options.
|
||||
|
||||
--*/
|
||||
|
||||
{
|
||||
ULONG TotalSize, NextOffset;
|
||||
PBOOT_APPLICATION_OPTION Option;
|
||||
|
||||
TotalSize = 0;
|
||||
NextOffset = 0;
|
||||
do {
|
||||
Option = (PBOOT_APPLICATION_OPTION)((PUCHAR)Options + NextOffset);
|
||||
NextOffset = Option->NextOptionOffset;
|
||||
TotalSize += BlGetBootOptionSize(Option);
|
||||
} while (NextOffset != 0);
|
||||
|
||||
return TotalSize;
|
||||
}
|
Loading…
Reference in New Issue
Block a user