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
This commit is contained in:
lgao4 2009-04-13 08:15:51 +00:00
parent 81dac93063
commit 3e3f86e0b8
1 changed files with 12 additions and 10 deletions

View File

@ -699,7 +699,7 @@ InternalHiiLowerConfigString (
Lower = TRUE; Lower = TRUE;
} else if (*String == L'&') { } else if (*String == L'&') {
Lower = FALSE; 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'); *String = (CHAR16) (*String - L'A' + L'a');
} }
} }
@ -927,7 +927,6 @@ InternalHiiBrowserCallback (
the Device Path associated with DriverHandle is converted the Device Path associated with DriverHandle is converted
to a 2 Unicode character hexidecimal string. 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 NULL DriverHandle does not support the Device Path Protocol.
@retval Other A pointer to the Null-terminate Unicode <ConfigHdr> string @retval Other A pointer to the Null-terminate Unicode <ConfigHdr> string
@ -957,18 +956,21 @@ HiiConstructConfigHdr (
NameLength = StrLen (Name); NameLength = StrLen (Name);
} }
DevicePath = NULL;
DevicePathSize = 0;
// //
// Retrieve DevicePath Protocol associated with DriverHandle // Retrieve DevicePath Protocol associated with DriverHandle
// //
if (DriverHandle != NULL) {
DevicePath = DevicePathFromHandle (DriverHandle); DevicePath = DevicePathFromHandle (DriverHandle);
if (DevicePath == NULL) { if (DevicePath == NULL) {
return NULL; return NULL;
} }
// //
// Compute the size of the device path in bytes // Compute the size of the device path in bytes
// //
DevicePathSize = GetDevicePathSize (DevicePath); DevicePathSize = GetDevicePathSize (DevicePath);
}
// //
// GUID=<HexCh>32&NAME=<Char>NameLength&PATH=<HexChar>DevicePathSize <Null> // GUID=<HexCh>32&NAME=<Char>NameLength&PATH=<HexChar>DevicePathSize <Null>