MdeModulePkg: Replace [Ascii|Unicode]ValueToString

It is the follow up of commits 51f0ceb..9e32e97 to replace
AsciiValueToString/UnicodeValueToString with
AsciiValueToStringS/UnicodeValueToStringS.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Hao Wu <hao.a.wu@intel.com>
Reviewed-by: Star Zeng <star.zeng@intel.com>
This commit is contained in:
Hao Wu
2017-01-18 10:31:02 +08:00
parent 0438f5e287
commit 9f4048f7f8
15 changed files with 256 additions and 58 deletions

View File

@@ -1,7 +1,7 @@
/** @file
Implementation of interfaces function for EFI_CONFIG_KEYWORD_HANDLER_PROTOCOL.
Copyright (c) 2015 - 2016, Intel Corporation. All rights reserved.<BR>
Copyright (c) 2015 - 2017, Intel Corporation. All rights reserved.<BR>
This program and the accompanying materials
are licensed and made available under the terms and conditions of the BSD License
which accompanies this distribution. The full text of the license may be found at
@@ -1763,7 +1763,14 @@ ConstructConfigHdr (
// Append Guid converted to <HexCh>32
//
for (Index = 0, Buffer = (UINT8 *)Guid; Index < sizeof (EFI_GUID); Index++) {
String += UnicodeValueToString (String, PREFIX_ZERO | RADIX_HEX, *(Buffer++), 2);
UnicodeValueToStringS (
String,
MaxLen * sizeof (CHAR16) - ((UINTN)String - (UINTN)ReturnString),
PREFIX_ZERO | RADIX_HEX,
*(Buffer++),
2
);
String += StrnLenS (String, MaxLen - ((UINTN)String - (UINTN)ReturnString) / sizeof (CHAR16));
}
}
@@ -1778,7 +1785,14 @@ ConstructConfigHdr (
// Append Name converted to <Char>NameLength
//
for (; *Name != L'\0'; Name++) {
String += UnicodeValueToString (String, PREFIX_ZERO | RADIX_HEX, *Name, 4);
UnicodeValueToStringS (
String,
MaxLen * sizeof (CHAR16) - ((UINTN)String - (UINTN)ReturnString),
PREFIX_ZERO | RADIX_HEX,
*Name,
4
);
String += StrnLenS (String, MaxLen - ((UINTN)String - (UINTN)ReturnString) / sizeof (CHAR16));
}
}
@@ -1792,7 +1806,14 @@ ConstructConfigHdr (
// Append the device path associated with DriverHandle converted to <HexChar>DevicePathSize
//
for (Index = 0, Buffer = (UINT8 *)DevicePath; Index < DevicePathSize; Index++) {
String += UnicodeValueToString (String, PREFIX_ZERO | RADIX_HEX, *(Buffer++), 2);
UnicodeValueToStringS (
String,
MaxLen * sizeof (CHAR16) - ((UINTN)String - (UINTN)ReturnString),
PREFIX_ZERO | RADIX_HEX,
*(Buffer++),
2
);
String += StrnLenS (String, MaxLen - ((UINTN)String - (UINTN)ReturnString) / sizeof (CHAR16));
}
//