[BOOT] Create input parameters structures.

This commit is contained in:
2024-06-06 09:40:58 -04:00
parent 42369f91ee
commit be6f37b4dc
6 changed files with 433 additions and 7 deletions

View File

@@ -15,6 +15,16 @@ Abstract:
#include "bootlib.h"
//
// Total size of required structures.
//
#define MIN_INPUT_PARAMETERS_SIZE ( \
sizeof(BOOT_INPUT_PARAMETERS) + \
sizeof(BOOT_MEMORY_INFO) + \
sizeof(BOOT_FIRMWARE_DATA) + \
sizeof(BOOT_RETURN_DATA) \
)
NTSTATUS
InitializeLibrary (
IN PBOOT_INPUT_PARAMETERS InputParameters,
@@ -45,7 +55,9 @@ Return Value:
//
// Verify input parameters structure.
//
if (InputParameters == NULL || InputParameters->Signature != BOOT_INPUT_PARAMETERS_SIGNATURE) {
if (InputParameters == NULL ||
InputParameters->Signature != BOOT_INPUT_PARAMETERS_SIGNATURE ||
InputParameters->Size < MIN_INPUT_PARAMETERS_SIZE) {
return STATUS_INVALID_PARAMETER;
}