aboutsummaryrefslogtreecommitdiffstats
path: root/Lessons/Lesson_48/UefiLessonsPkg/HIIStringsUNI/HIIStringsUNI.c
diff options
context:
space:
mode:
Diffstat (limited to 'Lessons/Lesson_48/UefiLessonsPkg/HIIStringsUNI/HIIStringsUNI.c')
-rw-r--r--Lessons/Lesson_48/UefiLessonsPkg/HIIStringsUNI/HIIStringsUNI.c32
1 files changed, 32 insertions, 0 deletions
diff --git a/Lessons/Lesson_48/UefiLessonsPkg/HIIStringsUNI/HIIStringsUNI.c b/Lessons/Lesson_48/UefiLessonsPkg/HIIStringsUNI/HIIStringsUNI.c
new file mode 100644
index 0000000..160108b
--- /dev/null
+++ b/Lessons/Lesson_48/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;
+}