From 72c1b49bdfe8372675d310c5015bf14f2b3706e3 Mon Sep 17 00:00:00 2001 From: Star Zeng Date: Wed, 15 Jun 2016 13:38:35 +0800 Subject: PerformancePkg: Replace UnicodeStrToAsciiStr/AsciiStrToUnicodeStr It is the follow up of 3ab41b7a325ca11a12b42f5ad1661c4b6791cb49 to replace UnicodeStrToAsciiStr/AsciiStrToUnicodeStr with UnicodeStrToAsciiStrS/AsciiStrToUnicodeStrS. Cc: Jiewen Yao Cc: Liming Gao Cc: Jaben Carsey Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Star Zeng Reviewed-by: Jaben Carsey (cherry picked from commit 23cfa2b9f0d08d744ec66b05140129464bf12ef9) --- PerformancePkg/Dp_App/DpTrace.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/PerformancePkg/Dp_App/DpTrace.c b/PerformancePkg/Dp_App/DpTrace.c index 1ba2b72ba4..e3dd19d2c0 100644 --- a/PerformancePkg/Dp_App/DpTrace.c +++ b/PerformancePkg/Dp_App/DpTrace.c @@ -210,8 +210,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 < (Size / sizeof(HandleBuffer[0])); TIndex++) { @@ -578,7 +578,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 < (Size / sizeof(HandleBuffer[0])); Index++) { if (Measurement.Handle == HandleBuffer[Index]) { @@ -742,8 +742,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) || -- cgit v1.2.3