summaryrefslogtreecommitdiff
path: root/ArmPlatformPkg/Bds/BootMenu.c
diff options
context:
space:
mode:
authoroliviermartin <oliviermartin@6f19259b-4bc3-4df7-8a09-765794883524>2011-09-09 10:49:54 +0000
committeroliviermartin <oliviermartin@6f19259b-4bc3-4df7-8a09-765794883524>2011-09-09 10:49:54 +0000
commit74b961324c1cc3ae3f97523e085fb169ec63b608 (patch)
tree80aeaf152679289f0fa3cc5ceabfdc164c1e11cb /ArmPlatformPkg/Bds/BootMenu.c
parentc3cd46d421cef32077ae6caf860b50d00ba2aa7f (diff)
downloadedk2-platforms-74b961324c1cc3ae3f97523e085fb169ec63b608.tar.xz
ArmPlatformPkg/Bds: Get User inputs in Unicode
The user input was getting in Ascii and converted later to Unicode when required. In this change, the user inputs are caught in Unicode and converted to Ascii only when needed. git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@12310 6f19259b-4bc3-4df7-8a09-765794883524
Diffstat (limited to 'ArmPlatformPkg/Bds/BootMenu.c')
-rw-r--r--ArmPlatformPkg/Bds/BootMenu.c23
1 files changed, 4 insertions, 19 deletions
diff --git a/ArmPlatformPkg/Bds/BootMenu.c b/ArmPlatformPkg/Bds/BootMenu.c
index b18a58bd8c..591e7e683b 100644
--- a/ArmPlatformPkg/Bds/BootMenu.c
+++ b/ArmPlatformPkg/Bds/BootMenu.c
@@ -116,8 +116,7 @@ BootMenuAddBootOption (
EFI_STATUS Status;
BDS_SUPPORTED_DEVICE* SupportedBootDevice;
BDS_LOADER_ARGUMENTS BootArguments;
- CHAR8 AsciiBootDescription[BOOT_DEVICE_DESCRIPTION_MAX];
- CHAR16 *BootDescription;
+ CHAR16 BootDescription[BOOT_DEVICE_DESCRIPTION_MAX];
UINT32 Attributes;
BDS_LOADER_TYPE BootType;
BDS_LOAD_OPTION *BdsLoadOption;
@@ -171,24 +170,18 @@ BootMenuAddBootOption (
}
Print(L"Description for this new Entry: ");
- Status = GetHIInputAscii (AsciiBootDescription,BOOT_DEVICE_DESCRIPTION_MAX);
+ Status = GetHIInputStr (BootDescription, BOOT_DEVICE_DESCRIPTION_MAX);
if (EFI_ERROR(Status)) {
Status = EFI_ABORTED;
goto FREE_DEVICE_PATH;
}
- // Convert Ascii into Unicode
- BootDescription = (CHAR16*)AllocatePool(AsciiStrSize(AsciiBootDescription) * sizeof(CHAR16));
- AsciiStrToUnicodeStr (AsciiBootDescription, BootDescription);
-
// Create new entry
Status = BootOptionCreate (Attributes, BootDescription, DevicePath, BootType, &BootArguments, &BdsLoadOption);
if (!EFI_ERROR(Status)) {
InsertTailList (BootOptionsList,&BdsLoadOption->Link);
}
- FreePool (BootDescription);
-
FREE_DEVICE_PATH:
FreePool (DevicePath);
@@ -303,8 +296,7 @@ BootMenuUpdateBootOption (
BDS_LOAD_OPTION *BootOption;
BDS_LOAD_OPTION_SUPPORT *DeviceSupport;
BDS_LOADER_ARGUMENTS BootArguments;
- CHAR8 AsciiBootDescription[BOOT_DEVICE_DESCRIPTION_MAX];
- CHAR16 *BootDescription;
+ CHAR16 BootDescription[BOOT_DEVICE_DESCRIPTION_MAX];
EFI_DEVICE_PATH* DevicePath;
BDS_LOADER_TYPE BootType;
@@ -365,22 +357,15 @@ BootMenuUpdateBootOption (
}
Print(L"Description for this new Entry: ");
- UnicodeStrToAsciiStr (BootOption->Description, AsciiBootDescription);
- Status = EditHIInputAscii (AsciiBootDescription, BOOT_DEVICE_DESCRIPTION_MAX);
+ Status = EditHIInputStr (BootDescription, BOOT_DEVICE_DESCRIPTION_MAX);
if (EFI_ERROR(Status)) {
Status = EFI_ABORTED;
goto FREE_DEVICE_PATH;
}
- // Convert Ascii into Unicode
- BootDescription = (CHAR16*)AllocatePool(AsciiStrSize(AsciiBootDescription) * sizeof(CHAR16));
- AsciiStrToUnicodeStr (AsciiBootDescription, BootDescription);
-
// Update the entry
Status = BootOptionUpdate (BootOption, BootOption->Attributes, BootDescription, DevicePath, BootType, &BootArguments);
- FreePool (BootDescription);
-
FREE_DEVICE_PATH:
FreePool (DevicePath);