UINT16 DefaultId;\r
EFI_DEVICE_PATH_PROTOCOL *DevicePath;\r
FORM_BROWSER_STATEMENT *Statement;\r
+ CHAR16 TemStr[2];\r
+ UINT8 *DevicePathBuffer;\r
+ UINT8 DigitUint8;\r
\r
CopyMem (&LocalScreen, &gScreenDimensions, sizeof (EFI_SCREEN_DESCRIPTOR));\r
\r
}\r
BufferSize = StrLen (StringPtr) / 2;\r
DevicePath = AllocatePool (BufferSize);\r
+ \r
+ //\r
+ // Convert from Device Path String to DevicePath Buffer in the reverse order.\r
+ //\r
+ DevicePathBuffer = (UINT8 *) DevicePath;\r
+ for (Index = 0; StringPtr[Index] != L'\0'; Index ++) {\r
+ TemStr[0] = StringPtr[Index];\r
+ DigitUint8 = (UINT8) StrHexToUint64 (TemStr);\r
+ if (DigitUint8 == 0 && TemStr[0] != L'0') {\r
+ //\r
+ // Invalid Hex Char as the tail.\r
+ //\r
+ break;\r
+ }\r
+ if ((Index & 1) == 0) {\r
+ DevicePathBuffer [Index/2] = DigitUint8;\r
+ } else {\r
+ DevicePathBuffer [Index/2] = (UINT8) ((DevicePathBuffer [Index/2] << 4) + DigitUint8);\r
+ }\r
+ }\r
\r
- HexStringToBufInReverseOrder ((UINT8 *) DevicePath, &BufferSize, StringPtr);\r
Selection->Handle = HiiLibDevicePathToHiiHandle (DevicePath);\r
if (Selection->Handle == NULL) {\r
//\r