From: lgao4 Date: Mon, 13 Apr 2009 08:15:51 +0000 (+0000) Subject: Fix Bug to convert low Hex string to handle L'A' - L'F' X-Git-Tag: edk2-stable201903~18190 X-Git-Url: https://git.proxmox.com/?p=mirror_edk2.git;a=commitdiff_plain;h=3e3f86e0b8ce62f6f41f0b81c4876bcc23cc49f9 Fix Bug to convert low Hex string to handle L'A' - L'F' Fix Bug in HiiConstructConfigHdr API to support NULL DriverHandle. git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@8074 6f19259b-4bc3-4df7-8a09-765794883524 --- diff --git a/MdeModulePkg/Library/UefiHiiLib/HiiLib.c b/MdeModulePkg/Library/UefiHiiLib/HiiLib.c index 997e36aeb1..384bab4ed6 100644 --- a/MdeModulePkg/Library/UefiHiiLib/HiiLib.c +++ b/MdeModulePkg/Library/UefiHiiLib/HiiLib.c @@ -699,7 +699,7 @@ InternalHiiLowerConfigString ( Lower = TRUE; } else if (*String == L'&') { Lower = FALSE; - } else if (Lower && *String > L'A' && *String <= L'F') { + } else if (Lower && *String >= L'A' && *String <= L'F') { *String = (CHAR16) (*String - L'A' + L'a'); } } @@ -927,7 +927,6 @@ InternalHiiBrowserCallback ( the Device Path associated with DriverHandle is converted to a 2 Unicode character hexidecimal string. - @retval NULL DriverHandle does not support the Device Path Protocol. @retval NULL DriverHandle does not support the Device Path Protocol. @retval Other A pointer to the Null-terminate Unicode string @@ -957,19 +956,22 @@ HiiConstructConfigHdr ( NameLength = StrLen (Name); } + DevicePath = NULL; + DevicePathSize = 0; // // Retrieve DevicePath Protocol associated with DriverHandle // - DevicePath = DevicePathFromHandle (DriverHandle); - if (DevicePath == NULL) { - return NULL; + if (DriverHandle != NULL) { + DevicePath = DevicePathFromHandle (DriverHandle); + if (DevicePath == NULL) { + return NULL; + } + // + // Compute the size of the device path in bytes + // + DevicePathSize = GetDevicePathSize (DevicePath); } - // - // Compute the size of the device path in bytes - // - DevicePathSize = GetDevicePathSize (DevicePath); - // // GUID=32&NAME=NameLength&PATH=DevicePathSize // | 5 | sizeof (EFI_GUID) * 2 | 6 | NameStrLen*4 | 6 | DevicePathSize * 2 | 1 |