summaryrefslogtreecommitdiffstats
path: root/PerformancePkg
diff options
context:
space:
mode:
authorStar Zeng <star.zeng@intel.com>2016-06-15 13:38:35 +0800
committerStar Zeng <star.zeng@intel.com>2016-06-21 12:46:25 +0800
commit23cfa2b9f0d08d744ec66b05140129464bf12ef9 (patch)
treec21b164906c00445ee6960f1e546c0b440096fca /PerformancePkg
parentb9679cd7458110573dd4614148433312b61a1e26 (diff)
downloadedk2-23cfa2b9f0d08d744ec66b05140129464bf12ef9.tar.gz
edk2-23cfa2b9f0d08d744ec66b05140129464bf12ef9.tar.bz2
edk2-23cfa2b9f0d08d744ec66b05140129464bf12ef9.zip
PerformancePkg: Replace UnicodeStrToAsciiStr/AsciiStrToUnicodeStr
It is the follow up of 3ab41b7a325ca11a12b42f5ad1661c4b6791cb49 to replace UnicodeStrToAsciiStr/AsciiStrToUnicodeStr with UnicodeStrToAsciiStrS/AsciiStrToUnicodeStrS. Cc: Jiewen Yao <jiewen.yao@intel.com> Cc: Liming Gao <liming.gao@intel.com> Cc: Jaben Carsey <jaben.carsey@intel.com> Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Star Zeng <star.zeng@intel.com> Reviewed-by: Jaben Carsey <jaben.carsey@intel.com>
Diffstat (limited to 'PerformancePkg')
-rw-r--r--PerformancePkg/Dp_App/Dp.c6
-rw-r--r--PerformancePkg/Dp_App/DpTrace.c12
2 files changed, 10 insertions, 8 deletions
diff --git a/PerformancePkg/Dp_App/Dp.c b/PerformancePkg/Dp_App/Dp.c
index 6d980e5c55..6890a99c29 100644
--- a/PerformancePkg/Dp_App/Dp.c
+++ b/PerformancePkg/Dp_App/Dp.c
@@ -221,6 +221,7 @@ InitializeDp (
BOOLEAN CumulativeMode;
CONST CHAR16 *CustomCumulativeToken;
PERF_CUM_DATA *CustomCumulativeData;
+ UINTN NameSize;
EFI_HII_PACKAGE_LIST_HEADER *PackageList;
EFI_STRING StringDpOptionQh;
@@ -392,8 +393,9 @@ InitializeDp (
CustomCumulativeData->MaxDur = 0;
CustomCumulativeData->Count = 0;
CustomCumulativeData->Duration = 0;
- CustomCumulativeData->Name = AllocateZeroPool (StrLen (CustomCumulativeToken) + 1);
- UnicodeStrToAsciiStr (CustomCumulativeToken, CustomCumulativeData->Name);
+ NameSize = StrLen (CustomCumulativeToken) + 1;
+ CustomCumulativeData->Name = AllocateZeroPool (NameSize);
+ UnicodeStrToAsciiStrS (CustomCumulativeToken, CustomCumulativeData->Name, NameSize);
}
/****************************************************************************
diff --git a/PerformancePkg/Dp_App/DpTrace.c b/PerformancePkg/Dp_App/DpTrace.c
index fc21cdc707..256f746283 100644
--- a/PerformancePkg/Dp_App/DpTrace.c
+++ b/PerformancePkg/Dp_App/DpTrace.c
@@ -1,7 +1,7 @@
/** @file
Trace reporting for the Dp utility.
- Copyright (c) 2009 - 2012, Intel Corporation. All rights reserved.<BR>
+ Copyright (c) 2009 - 2016, Intel Corporation. All rights reserved.<BR>
(C) Copyright 2015-2016 Hewlett Packard Enterprise Development LP<BR>
This program and the accompanying materials
are licensed and made available under the terms and conditions of the BSD License
@@ -220,8 +220,8 @@ DumpAllTrace(
++Count; // Count the number of records printed
// If Handle is non-zero, see if we can determine a name for the driver
- AsciiStrToUnicodeStr (Measurement.Module, mGaugeString); // Use Module by default
- AsciiStrToUnicodeStr (Measurement.Token, mUnicodeToken);
+ AsciiStrToUnicodeStrS (Measurement.Module, mGaugeString, sizeof (mGaugeString) / sizeof (mGaugeString[0])); // Use Module by default
+ AsciiStrToUnicodeStrS (Measurement.Token, mUnicodeToken, sizeof (mUnicodeToken) / sizeof (mUnicodeToken[0]));
if (Measurement.Handle != NULL) {
// See if the Handle is in the HandleBuffer
for (TIndex = 0; TIndex < HandleCount; TIndex++) {
@@ -594,7 +594,7 @@ ProcessHandles(
continue;
}
mGaugeString[0] = 0; // Empty driver name by default
- AsciiStrToUnicodeStr (Measurement.Token, mUnicodeToken);
+ AsciiStrToUnicodeStrS (Measurement.Token, mUnicodeToken, sizeof (mUnicodeToken) / sizeof (mUnicodeToken[0]));
// See if the Handle is in the HandleBuffer
for (Index = 0; Index < HandleCount; Index++) {
if (Measurement.Handle == HandleBuffer[Index]) {
@@ -777,8 +777,8 @@ ProcessGlobal(
&Measurement.EndTimeStamp,
&Measurement.Identifier)) != 0)
{
- AsciiStrToUnicodeStr (Measurement.Module, mGaugeString);
- AsciiStrToUnicodeStr (Measurement.Token, mUnicodeToken);
+ AsciiStrToUnicodeStrS (Measurement.Module, mGaugeString, sizeof (mGaugeString) / sizeof (mGaugeString[0]));
+ AsciiStrToUnicodeStrS (Measurement.Token, mUnicodeToken, sizeof (mUnicodeToken) / sizeof (mUnicodeToken[0]));
mGaugeString[25] = 0;
mUnicodeToken[31] = 0;
if ( ! ( IsPhase( &Measurement) ||