diff options
author | Konstantin Aladyshev <aladyshev22@gmail.com> | 2022-03-14 12:14:12 +0300 |
---|---|---|
committer | Konstantin Aladyshev <aladyshev22@gmail.com> | 2022-03-14 12:14:12 +0300 |
commit | 0a8228bc8d94b0cd2af6cf8f13ffd42bcbf2c63e (patch) | |
tree | fc2a409438b6a9825895f4fe09011db0681e6081 /Lessons/Lesson_63/UefiLessonsPkg/HIIFormCheckbox | |
parent | e31d9c5bcd8f14160764e960e385bde763b9c811 (diff) | |
download | UEFI-Lessons-0a8228bc8d94b0cd2af6cf8f13ffd42bcbf2c63e.tar.gz UEFI-Lessons-0a8228bc8d94b0cd2af6cf8f13ffd42bcbf2c63e.tar.bz2 UEFI-Lessons-0a8228bc8d94b0cd2af6cf8f13ffd42bcbf2c63e.zip |
Drop obsolete sources from Lesson_63
Signed-off-by: Konstantin Aladyshev <aladyshev22@gmail.com>
Diffstat (limited to 'Lessons/Lesson_63/UefiLessonsPkg/HIIFormCheckbox')
4 files changed, 0 insertions, 201 deletions
diff --git a/Lessons/Lesson_63/UefiLessonsPkg/HIIFormCheckbox/Form.vfr b/Lessons/Lesson_63/UefiLessonsPkg/HIIFormCheckbox/Form.vfr deleted file mode 100644 index 780790e..0000000 --- a/Lessons/Lesson_63/UefiLessonsPkg/HIIFormCheckbox/Form.vfr +++ /dev/null @@ -1,25 +0,0 @@ -#include <Uefi/UefiMultiPhase.h> - -#define FORMSET_GUID {0xef2acc91, 0x7b50, 0x4ab9, {0xab, 0x67, 0x2b, 0x4, 0xf8, 0xbc, 0x13, 0x5e}} - -formset - guid = FORMSET_GUID, - title = STRING_TOKEN(FORMSET_TITLE), - help = STRING_TOKEN(FORMSET_HELP), - - efivarstore UINT8, - attribute = EFI_VARIABLE_BOOTSERVICE_ACCESS | EFI_VARIABLE_NON_VOLATILE, - name = HIIFormCheckboxEfiVarstore, - guid = FORMSET_GUID; - - form - formid = 1, - title = STRING_TOKEN(FORMID1_TITLE); - - checkbox - varid = HIIFormCheckboxEfiVarstore, - prompt = STRING_TOKEN(CHECKBOX_PROMPT), - help = STRING_TOKEN(CHECKBOX_HELP), - endcheckbox; - endform; -endformset; diff --git a/Lessons/Lesson_63/UefiLessonsPkg/HIIFormCheckbox/HIIFormCheckbox.c b/Lessons/Lesson_63/UefiLessonsPkg/HIIFormCheckbox/HIIFormCheckbox.c deleted file mode 100644 index 5bfcab5..0000000 --- a/Lessons/Lesson_63/UefiLessonsPkg/HIIFormCheckbox/HIIFormCheckbox.c +++ /dev/null @@ -1,133 +0,0 @@ -/* - * Copyright (c) 2021, Konstantin Aladyshev <aladyshev22@gmail.com> - * - * SPDX-License-Identifier: MIT - */ - -#include <Library/UefiBootServicesTableLib.h> -#include <Library/UefiRuntimeServicesTableLib.h> -#include <Library/UefiLib.h> - -#include <Library/HiiLib.h> -#include <Protocol/FormBrowser2.h> - -#include <Library/DevicePathLib.h> -#include <Library/BaseMemoryLib.h> - -extern UINT8 FormBin[]; - -#pragma pack(1) -/// -/// HII specific Vendor Device Path definition. -/// -typedef struct { - VENDOR_DEVICE_PATH VendorDevicePath; - EFI_DEVICE_PATH_PROTOCOL End; -} HII_VENDOR_DEVICE_PATH; -#pragma pack() - -#define FORMSET_GUID {0xef2acc91, 0x7b50, 0x4ab9, {0xab, 0x67, 0x2b, 0x4, 0xf8, 0xbc, 0x13, 0x5e}} - -EFI_HII_HANDLE mHiiHandle = NULL; -EFI_HANDLE mDriverHandle = NULL; - -HII_VENDOR_DEVICE_PATH mHiiVendorDevicePath = { - { - { - HARDWARE_DEVICE_PATH, - HW_VENDOR_DP, - { - (UINT8) (sizeof (VENDOR_DEVICE_PATH)), - (UINT8) ((sizeof (VENDOR_DEVICE_PATH)) >> 8) - } - }, - FORMSET_GUID - }, - { - END_DEVICE_PATH_TYPE, - END_ENTIRE_DEVICE_PATH_SUBTYPE, - { - (UINT8) (END_DEVICE_PATH_LENGTH), - (UINT8) ((END_DEVICE_PATH_LENGTH) >> 8) - } - } -}; - - -EFI_STATUS -EFIAPI -UefiMain ( - IN EFI_HANDLE ImageHandle, - IN EFI_SYSTEM_TABLE *SystemTable - ) -{ - EFI_STATUS Status; - // - // Publish sample Fromset - // - Status = gBS->InstallProtocolInterface ( - &mDriverHandle, - &gEfiDevicePathProtocolGuid, - EFI_NATIVE_INTERFACE, - &mHiiVendorDevicePath - ); - if (EFI_ERROR (Status)) { - return Status; - } - - - UINTN BufferSize; - UINT8 EfiVarstore; - BufferSize = sizeof(UINT8); - Status = gRT->GetVariable ( - L"HIIFormCheckboxEfiVarstore", - &mHiiVendorDevicePath.VendorDevicePath.Guid, - NULL, - &BufferSize, - &EfiVarstore); - if (EFI_ERROR(Status)) { - Print(L"Error! Can't find variable! %r\n", Status); - ZeroMem(&EfiVarstore, sizeof(EfiVarstore)); - Status = gRT->SetVariable( - L"HIIFormCheckboxEfiVarstore", - &mHiiVendorDevicePath.VendorDevicePath.Guid, - EFI_VARIABLE_NON_VOLATILE | EFI_VARIABLE_BOOTSERVICE_ACCESS, - sizeof(EfiVarstore), - &EfiVarstore); - if (EFI_ERROR(Status)) { - Print(L"Error! Can't create variable! %r\n", Status); - } - } - - - EFI_HII_HANDLE Handle = HiiAddPackages( - &gEfiCallerIdGuid, - mDriverHandle, - HIIFormCheckboxStrings, - FormBin, - NULL - ); - if (Handle == NULL) { - return EFI_OUT_OF_RESOURCES; - } - - EFI_FORM_BROWSER2_PROTOCOL* FormBrowser2; - Status = gBS->LocateProtocol(&gEfiFormBrowser2ProtocolGuid, NULL, (VOID**)&FormBrowser2); - if (EFI_ERROR(Status)) { - return Status; - } - - Status = FormBrowser2->SendForm ( - FormBrowser2, - &Handle, - 1, - NULL, - 0, - NULL, - NULL - ); - - HiiRemovePackages(Handle); - - return EFI_SUCCESS; -} diff --git a/Lessons/Lesson_63/UefiLessonsPkg/HIIFormCheckbox/HIIFormCheckbox.inf b/Lessons/Lesson_63/UefiLessonsPkg/HIIFormCheckbox/HIIFormCheckbox.inf deleted file mode 100644 index d0b9f91..0000000 --- a/Lessons/Lesson_63/UefiLessonsPkg/HIIFormCheckbox/HIIFormCheckbox.inf +++ /dev/null @@ -1,30 +0,0 @@ -## -# Copyright (c) 2021, Konstantin Aladyshev <aladyshev22@gmail.com> -# -# SPDX-License-Identifier: MIT -## - -[Defines] - INF_VERSION = 1.25 - BASE_NAME = HIIFormCheckbox - FILE_GUID = 771a4631-43ba-4852-9593-919d9de079f1 - MODULE_TYPE = UEFI_APPLICATION - VERSION_STRING = 1.0 - ENTRY_POINT = UefiMain - -[Sources] - HIIFormCheckbox.c - Strings.uni - Form.vfr - -[Packages] - MdePkg/MdePkg.dec - MdeModulePkg/MdeModulePkg.dec - -[LibraryClasses] - UefiApplicationEntryPoint - UefiLib - HiiLib - -[Protocols] - gEfiFormBrowser2ProtocolGuid
\ No newline at end of file diff --git a/Lessons/Lesson_63/UefiLessonsPkg/HIIFormCheckbox/Strings.uni b/Lessons/Lesson_63/UefiLessonsPkg/HIIFormCheckbox/Strings.uni deleted file mode 100644 index 7788773..0000000 --- a/Lessons/Lesson_63/UefiLessonsPkg/HIIFormCheckbox/Strings.uni +++ /dev/null @@ -1,13 +0,0 @@ -// -// Copyright (c) 2021, Konstantin Aladyshev <aladyshev22@gmail.com> -// -// SPDX-License-Identifier: MIT -// - -#langdef en-US "English" - -#string FORMSET_TITLE #language en-US "Simple Formset" -#string FORMSET_HELP #language en-US "This is a very simple formset" -#string FORMID1_TITLE #language en-US "Simple Form" -#string CHECKBOX_PROMPT #language en-US "Checkbox prompt" -#string CHECKBOX_HELP #language en-US "Checkbox help" |