From 4817afa8f3b58bb61cabec0a538d6bfe02372787 Mon Sep 17 00:00:00 2001 From: Konstantin Aladyshev Date: Tue, 26 Oct 2021 16:56:43 +0300 Subject: Move app files in Lesson 50 to the correct folder Signed-off-by: Konstantin Aladyshev --- Lessons/Lesson_50/UefiLessonsPkg/HIIStringsUNIRC.c | 54 ---------------------- .../Lesson_50/UefiLessonsPkg/HIIStringsUNIRC.inf | 30 ------------ .../HIIStringsUNIRC/HIIStringsUNIRC.c | 54 ++++++++++++++++++++++ .../HIIStringsUNIRC/HIIStringsUNIRC.inf | 30 ++++++++++++ .../UefiLessonsPkg/HIIStringsUNIRC/Strings.uni | 8 ++++ Lessons/Lesson_50/UefiLessonsPkg/Strings.uni | 8 ---- 6 files changed, 92 insertions(+), 92 deletions(-) delete mode 100644 Lessons/Lesson_50/UefiLessonsPkg/HIIStringsUNIRC.c delete mode 100644 Lessons/Lesson_50/UefiLessonsPkg/HIIStringsUNIRC.inf create mode 100644 Lessons/Lesson_50/UefiLessonsPkg/HIIStringsUNIRC/HIIStringsUNIRC.c create mode 100644 Lessons/Lesson_50/UefiLessonsPkg/HIIStringsUNIRC/HIIStringsUNIRC.inf create mode 100644 Lessons/Lesson_50/UefiLessonsPkg/HIIStringsUNIRC/Strings.uni delete mode 100644 Lessons/Lesson_50/UefiLessonsPkg/Strings.uni (limited to 'Lessons') diff --git a/Lessons/Lesson_50/UefiLessonsPkg/HIIStringsUNIRC.c b/Lessons/Lesson_50/UefiLessonsPkg/HIIStringsUNIRC.c deleted file mode 100644 index 39efbc5..0000000 --- a/Lessons/Lesson_50/UefiLessonsPkg/HIIStringsUNIRC.c +++ /dev/null @@ -1,54 +0,0 @@ -#include -#include - -#include -#include - -EFI_STATUS -EFIAPI -UefiMain ( - IN EFI_HANDLE ImageHandle, - IN EFI_SYSTEM_TABLE *SystemTable - ) -{ - EFI_STATUS Status; - EFI_HII_PACKAGE_LIST_HEADER *PackageList; - // - // Retrieve HII package list from ImageHandle. - // - Status = gBS->OpenProtocol ( - ImageHandle, - &gEfiHiiPackageListProtocolGuid, - (VOID **)&PackageList, - ImageHandle, - NULL, - EFI_OPEN_PROTOCOL_GET_PROTOCOL - ); - if (EFI_ERROR (Status)) { - Print(L"Error! Can't open EFI_HII_PACKAGE_LIST_PROTOCOL\n"); - return Status; - } - - EFI_HII_HANDLE Handle; - Status = gHiiDatabase->NewPackageList(gHiiDatabase, PackageList, NULL, &Handle); - if (EFI_ERROR(Status)) - { - Print(L"Can't register HII Package list %g, status = %r\n", gHIIStringsUNIRCGuid, Status); - return Status; - } - - Print(L"en-US ID=1: %s\n", HiiGetString(Handle, 1, "en-US")); - Print(L"en-US ID=2: %s\n", HiiGetString(Handle, STRING_TOKEN(STR_HELLO), "en-US")); - Print(L"en-US ID=3: %s\n", HiiGetString(Handle, STRING_TOKEN(STR_BYE), "en-US")); - Print(L"fr-FR ID=1: %s\n", HiiGetString(Handle, 1, "fr-FR")); - Print(L"fr-FR ID=2: %s\n", HiiGetString(Handle, STRING_TOKEN(STR_HELLO), "fr-FR")); - Print(L"fr-FR ID=3: %s\n", HiiGetString(Handle, STRING_TOKEN(STR_BYE), "fr-FR")); - - Print(L"Best language ID=1: %s\n", HiiGetString(Handle, 1, NULL)); - Print(L"Best language ID=2: %s\n", HiiGetString(Handle, STRING_TOKEN(STR_HELLO), NULL)); - Print(L"Best language ID=3: %s\n", HiiGetString(Handle, STRING_TOKEN(STR_BYE), NULL)); - - Print(L"fr ID=3: %s\n", HiiGetString(Handle, STRING_TOKEN(STR_BYE), "fr")); - - return EFI_SUCCESS; -} diff --git a/Lessons/Lesson_50/UefiLessonsPkg/HIIStringsUNIRC.inf b/Lessons/Lesson_50/UefiLessonsPkg/HIIStringsUNIRC.inf deleted file mode 100644 index c31e19d..0000000 --- a/Lessons/Lesson_50/UefiLessonsPkg/HIIStringsUNIRC.inf +++ /dev/null @@ -1,30 +0,0 @@ -[Defines] - INF_VERSION = 1.25 - BASE_NAME = HIIStringsUNIRC - FILE_GUID = f8dc4b7a-8c6d-4a16-b2a1-03682db32bfd - MODULE_TYPE = UEFI_APPLICATION - VERSION_STRING = 1.0 - ENTRY_POINT = UefiMain - UEFI_HII_RESOURCE_SECTION = TRUE - -[Sources] - HIIStringsUNIRC.c - Strings.uni - -[Packages] - MdePkg/MdePkg.dec - MdeModulePkg/MdeModulePkg.dec - UefiLessonsPkg/UefiLessonsPkg.dec - -[LibraryClasses] - UefiApplicationEntryPoint - UefiLib - HiiLib - UefiHiiServicesLib - -[Protocols] - gEfiHiiPackageListProtocolGuid - -[Guids] - gHIIStringsUNIRCGuid - diff --git a/Lessons/Lesson_50/UefiLessonsPkg/HIIStringsUNIRC/HIIStringsUNIRC.c b/Lessons/Lesson_50/UefiLessonsPkg/HIIStringsUNIRC/HIIStringsUNIRC.c new file mode 100644 index 0000000..39efbc5 --- /dev/null +++ b/Lessons/Lesson_50/UefiLessonsPkg/HIIStringsUNIRC/HIIStringsUNIRC.c @@ -0,0 +1,54 @@ +#include +#include + +#include +#include + +EFI_STATUS +EFIAPI +UefiMain ( + IN EFI_HANDLE ImageHandle, + IN EFI_SYSTEM_TABLE *SystemTable + ) +{ + EFI_STATUS Status; + EFI_HII_PACKAGE_LIST_HEADER *PackageList; + // + // Retrieve HII package list from ImageHandle. + // + Status = gBS->OpenProtocol ( + ImageHandle, + &gEfiHiiPackageListProtocolGuid, + (VOID **)&PackageList, + ImageHandle, + NULL, + EFI_OPEN_PROTOCOL_GET_PROTOCOL + ); + if (EFI_ERROR (Status)) { + Print(L"Error! Can't open EFI_HII_PACKAGE_LIST_PROTOCOL\n"); + return Status; + } + + EFI_HII_HANDLE Handle; + Status = gHiiDatabase->NewPackageList(gHiiDatabase, PackageList, NULL, &Handle); + if (EFI_ERROR(Status)) + { + Print(L"Can't register HII Package list %g, status = %r\n", gHIIStringsUNIRCGuid, Status); + return Status; + } + + Print(L"en-US ID=1: %s\n", HiiGetString(Handle, 1, "en-US")); + Print(L"en-US ID=2: %s\n", HiiGetString(Handle, STRING_TOKEN(STR_HELLO), "en-US")); + Print(L"en-US ID=3: %s\n", HiiGetString(Handle, STRING_TOKEN(STR_BYE), "en-US")); + Print(L"fr-FR ID=1: %s\n", HiiGetString(Handle, 1, "fr-FR")); + Print(L"fr-FR ID=2: %s\n", HiiGetString(Handle, STRING_TOKEN(STR_HELLO), "fr-FR")); + Print(L"fr-FR ID=3: %s\n", HiiGetString(Handle, STRING_TOKEN(STR_BYE), "fr-FR")); + + Print(L"Best language ID=1: %s\n", HiiGetString(Handle, 1, NULL)); + Print(L"Best language ID=2: %s\n", HiiGetString(Handle, STRING_TOKEN(STR_HELLO), NULL)); + Print(L"Best language ID=3: %s\n", HiiGetString(Handle, STRING_TOKEN(STR_BYE), NULL)); + + Print(L"fr ID=3: %s\n", HiiGetString(Handle, STRING_TOKEN(STR_BYE), "fr")); + + return EFI_SUCCESS; +} diff --git a/Lessons/Lesson_50/UefiLessonsPkg/HIIStringsUNIRC/HIIStringsUNIRC.inf b/Lessons/Lesson_50/UefiLessonsPkg/HIIStringsUNIRC/HIIStringsUNIRC.inf new file mode 100644 index 0000000..c31e19d --- /dev/null +++ b/Lessons/Lesson_50/UefiLessonsPkg/HIIStringsUNIRC/HIIStringsUNIRC.inf @@ -0,0 +1,30 @@ +[Defines] + INF_VERSION = 1.25 + BASE_NAME = HIIStringsUNIRC + FILE_GUID = f8dc4b7a-8c6d-4a16-b2a1-03682db32bfd + MODULE_TYPE = UEFI_APPLICATION + VERSION_STRING = 1.0 + ENTRY_POINT = UefiMain + UEFI_HII_RESOURCE_SECTION = TRUE + +[Sources] + HIIStringsUNIRC.c + Strings.uni + +[Packages] + MdePkg/MdePkg.dec + MdeModulePkg/MdeModulePkg.dec + UefiLessonsPkg/UefiLessonsPkg.dec + +[LibraryClasses] + UefiApplicationEntryPoint + UefiLib + HiiLib + UefiHiiServicesLib + +[Protocols] + gEfiHiiPackageListProtocolGuid + +[Guids] + gHIIStringsUNIRCGuid + diff --git a/Lessons/Lesson_50/UefiLessonsPkg/HIIStringsUNIRC/Strings.uni b/Lessons/Lesson_50/UefiLessonsPkg/HIIStringsUNIRC/Strings.uni new file mode 100644 index 0000000..2bce7e3 --- /dev/null +++ b/Lessons/Lesson_50/UefiLessonsPkg/HIIStringsUNIRC/Strings.uni @@ -0,0 +1,8 @@ +#langdef en-US "English" +#langdef fr-FR "Francais" + +#string STR_HELLO #language en-US "Hello!" + #language fr-FR "Bonjour!" + +#string STR_BYE #language en-US "Bye!" + #language fr-FR "Au revoir!" diff --git a/Lessons/Lesson_50/UefiLessonsPkg/Strings.uni b/Lessons/Lesson_50/UefiLessonsPkg/Strings.uni deleted file mode 100644 index 2bce7e3..0000000 --- a/Lessons/Lesson_50/UefiLessonsPkg/Strings.uni +++ /dev/null @@ -1,8 +0,0 @@ -#langdef en-US "English" -#langdef fr-FR "Francais" - -#string STR_HELLO #language en-US "Hello!" - #language fr-FR "Bonjour!" - -#string STR_BYE #language en-US "Bye!" - #language fr-FR "Au revoir!" -- cgit v1.2.3-18-g5258