summaryrefslogtreecommitdiff
path: root/MdeModulePkg/Universal/SetupBrowserDxe/Ui.c
diff options
context:
space:
mode:
authorlgao4 <lgao4@6f19259b-4bc3-4df7-8a09-765794883524>2009-04-08 00:56:51 +0000
committerlgao4 <lgao4@6f19259b-4bc3-4df7-8a09-765794883524>2009-04-08 00:56:51 +0000
commit63d55bb98a5fa3018378d06c50784e463c6e999a (patch)
tree5801acea7e847c06209cc16cdd305b857e9fbdc6 /MdeModulePkg/Universal/SetupBrowserDxe/Ui.c
parentdfbe9de95f5eef4622e6005910e757a31be15ece (diff)
downloadedk2-platforms-63d55bb98a5fa3018378d06c50784e463c6e999a.tar.xz
Replace BufToHexString by UnicodeValueToString
Replace HexStringToBuf by StrHexToUint64 git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@8034 6f19259b-4bc3-4df7-8a09-765794883524
Diffstat (limited to 'MdeModulePkg/Universal/SetupBrowserDxe/Ui.c')
-rw-r--r--MdeModulePkg/Universal/SetupBrowserDxe/Ui.c24
1 files changed, 23 insertions, 1 deletions
diff --git a/MdeModulePkg/Universal/SetupBrowserDxe/Ui.c b/MdeModulePkg/Universal/SetupBrowserDxe/Ui.c
index ae8d9a62d7..42074ca32b 100644
--- a/MdeModulePkg/Universal/SetupBrowserDxe/Ui.c
+++ b/MdeModulePkg/Universal/SetupBrowserDxe/Ui.c
@@ -1506,6 +1506,9 @@ UiDisplayMenu (
UINT16 DefaultId;
EFI_DEVICE_PATH_PROTOCOL *DevicePath;
FORM_BROWSER_STATEMENT *Statement;
+ CHAR16 TemStr[2];
+ UINT8 *DevicePathBuffer;
+ UINT8 DigitUint8;
CopyMem (&LocalScreen, &gScreenDimensions, sizeof (EFI_SCREEN_DESCRIPTOR));
@@ -2358,8 +2361,27 @@ UiDisplayMenu (
}
BufferSize = StrLen (StringPtr) / 2;
DevicePath = AllocatePool (BufferSize);
+
+ //
+ // Convert from Device Path String to DevicePath Buffer in the reverse order.
+ //
+ DevicePathBuffer = (UINT8 *) DevicePath;
+ for (Index = 0; StringPtr[Index] != L'\0'; Index ++) {
+ TemStr[0] = StringPtr[Index];
+ DigitUint8 = (UINT8) StrHexToUint64 (TemStr);
+ if (DigitUint8 == 0 && TemStr[0] != L'0') {
+ //
+ // Invalid Hex Char as the tail.
+ //
+ break;
+ }
+ if ((Index & 1) == 0) {
+ DevicePathBuffer [Index/2] = DigitUint8;
+ } else {
+ DevicePathBuffer [Index/2] = (UINT8) ((DevicePathBuffer [Index/2] << 4) + DigitUint8);
+ }
+ }
- HexStringToBufInReverseOrder ((UINT8 *) DevicePath, &BufferSize, StringPtr);
Selection->Handle = HiiLibDevicePathToHiiHandle (DevicePath);
if (Selection->Handle == NULL) {
//