From 7b0dda6fca0eaef19bf47eed9daa5dd4b1473975 Mon Sep 17 00:00:00 2001 From: Konstantin Aladyshev Date: Thu, 24 Feb 2022 18:51:27 +0300 Subject: Add lesson 59 Signed-off-by: Konstantin Aladyshev --- .../HIIStaticFormDriver/HIIStaticFormDriver.c | 47 ++++++++++++++++++++++ 1 file changed, 47 insertions(+) create mode 100644 UefiLessonsPkg/HIIStaticFormDriver/HIIStaticFormDriver.c (limited to 'UefiLessonsPkg/HIIStaticFormDriver/HIIStaticFormDriver.c') diff --git a/UefiLessonsPkg/HIIStaticFormDriver/HIIStaticFormDriver.c b/UefiLessonsPkg/HIIStaticFormDriver/HIIStaticFormDriver.c new file mode 100644 index 0000000..b9922f4 --- /dev/null +++ b/UefiLessonsPkg/HIIStaticFormDriver/HIIStaticFormDriver.c @@ -0,0 +1,47 @@ +/* + * Copyright (c) 2021, Konstantin Aladyshev + * + * SPDX-License-Identifier: MIT + */ + +#include +#include +#include + + +extern UINT8 FormBin[]; + +EFI_HII_HANDLE Handle; + + +EFI_STATUS +EFIAPI +HIIStaticFormDriverUnload ( + EFI_HANDLE ImageHandle + ) +{ + if (Handle != NULL) + HiiRemovePackages(Handle); + + return EFI_SUCCESS; +} + +EFI_STATUS +EFIAPI +HIIStaticFormDriverEntryPoint ( + IN EFI_HANDLE ImageHandle, + IN EFI_SYSTEM_TABLE *SystemTable + ) +{ + Handle = HiiAddPackages( + &gEfiCallerIdGuid, + NULL, + HIIStaticFormDriverStrings, + FormBin, + NULL + ); + if (Handle == NULL) + return EFI_OUT_OF_RESOURCES; + + return EFI_SUCCESS; +} -- cgit v1.2.3-18-g5258