aboutsummaryrefslogtreecommitdiffstats
path: root/UefiLessonsPkg/HIIStringsUNI/HIIStringsUNI.c
diff options
context:
space:
mode:
authorKonstantin Aladyshev <aladyshev22@gmail.com>2021-10-24 13:21:30 +0300
committerKonstantin Aladyshev <aladyshev22@gmail.com>2021-10-24 13:21:30 +0300
commitd28167b2a3a55b2afc5a5dfdcb329b585f223225 (patch)
tree3e7d7adbb4d8235738f0777da852dfe185a32158 /UefiLessonsPkg/HIIStringsUNI/HIIStringsUNI.c
parent9fb84757c9a457d7193b7e863f2e90b22ff09cb4 (diff)
downloadUEFI-Lessons-d28167b2a3a55b2afc5a5dfdcb329b585f223225.tar.gz
UEFI-Lessons-d28167b2a3a55b2afc5a5dfdcb329b585f223225.tar.bz2
UEFI-Lessons-d28167b2a3a55b2afc5a5dfdcb329b585f223225.zip
Add lesson 48
Signed-off-by: Konstantin Aladyshev <aladyshev22@gmail.com>
Diffstat (limited to 'UefiLessonsPkg/HIIStringsUNI/HIIStringsUNI.c')
-rw-r--r--UefiLessonsPkg/HIIStringsUNI/HIIStringsUNI.c32
1 files changed, 32 insertions, 0 deletions
diff --git a/UefiLessonsPkg/HIIStringsUNI/HIIStringsUNI.c b/UefiLessonsPkg/HIIStringsUNI/HIIStringsUNI.c
new file mode 100644
index 0000000..160108b
--- /dev/null
+++ b/UefiLessonsPkg/HIIStringsUNI/HIIStringsUNI.c
@@ -0,0 +1,32 @@
+#include <Library/UefiBootServicesTableLib.h>
+#include <Library/UefiLib.h>
+
+#include <Library/HiiLib.h>
+
+EFI_STATUS
+EFIAPI
+UefiMain (
+ IN EFI_HANDLE ImageHandle,
+ IN EFI_SYSTEM_TABLE *SystemTable
+ )
+{
+ EFI_HII_HANDLE Handle = HiiAddPackages(&gHIIStringsUNIGuid,
+ NULL,
+ HIIStringsUNIStrings,
+ NULL);
+
+ if (Handle == NULL)
+ {
+ Print(L"Error! Can't perform HiiAddPackages\n");
+ return EFI_INVALID_PARAMETER;
+ }
+
+ 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"));
+
+ return EFI_SUCCESS;
+}