X-Git-Url: https://git.proxmox.com/?p=mirror_edk2.git;a=blobdiff_plain;f=MdeModulePkg%2FApplication%2FMemoryProfileInfo%2FMemoryProfileInfo.c;h=072ae72dcd7614295e602e83c2bf0821145c8ceb;hp=48d8f4657ba607fc9cdca11e7c3f7fc4321cb35c;hb=a0284a9a5820e470bae2557a7e25c426e62c8a4e;hpb=c5155f298cb4cb36d8b67e7a63eded60b4321b40 diff --git a/MdeModulePkg/Application/MemoryProfileInfo/MemoryProfileInfo.c b/MdeModulePkg/Application/MemoryProfileInfo/MemoryProfileInfo.c index 48d8f4657b..072ae72dcd 100644 --- a/MdeModulePkg/Application/MemoryProfileInfo/MemoryProfileInfo.c +++ b/MdeModulePkg/Application/MemoryProfileInfo/MemoryProfileInfo.c @@ -1,6 +1,6 @@ /** @file - Copyright (c) 2014 - 2016, Intel Corporation. All rights reserved.
+ Copyright (c) 2014 - 2017, Intel Corporation. All rights reserved.
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 @@ -27,7 +27,6 @@ #include #include -#include #include #include @@ -205,7 +204,7 @@ GetShortPdbFileName ( StartIndex = 0; for (EndIndex = 0; PdbFileName[EndIndex] != 0; EndIndex++); for (IndexPdb = 0; PdbFileName[IndexPdb] != 0; IndexPdb++) { - if (PdbFileName[IndexPdb] == '\\') { + if ((PdbFileName[IndexPdb] == '\\') || (PdbFileName[IndexPdb] == '/')) { StartIndex = IndexPdb + 1; } @@ -250,12 +249,12 @@ GetDriverNameString ( // // Method 1: Get the name string from image PDB // - if (DriverInfo->Header.Length > sizeof (MEMORY_PROFILE_DRIVER_INFO)) { - GetShortPdbFileName ((CHAR8 *) (DriverInfo + 1), mNameString); + if (DriverInfo->PdbStringOffset != 0) { + GetShortPdbFileName ((CHAR8 *) ((UINTN) DriverInfo + DriverInfo->PdbStringOffset), mNameString); return mNameString; } - if (!CompareGuid (&DriverInfo->FileName, &gZeroGuid)) { + if (!IsZeroGuid (&DriverInfo->FileName)) { // // Try to get the image's FFS UI section by image GUID // @@ -344,16 +343,16 @@ ProfileActionToStr ( if (IsForSmm) { ActionString = mSmmActionString; - ActionStringCount = sizeof (mSmmActionString) / sizeof (mSmmActionString[0]); + ActionStringCount = ARRAY_SIZE (mSmmActionString); } else { ActionString = mActionString; - ActionStringCount = sizeof (mActionString) / sizeof (mActionString[0]); + ActionStringCount = ARRAY_SIZE (mActionString); } if ((UINTN) (UINT32) Action < ActionStringCount) { return ActionString[Action]; } - for (Index = 0; Index < sizeof (mExtActionString) / sizeof (mExtActionString[0]); Index++) { + for (Index = 0; Index < ARRAY_SIZE (mExtActionString); Index++) { if (mExtActionString[Index].Action == Action) { return mExtActionString[Index].String; }