From a0284a9a5820e470bae2557a7e25c426e62c8a4e Mon Sep 17 00:00:00 2001 From: Star Zeng Date: Sun, 9 Oct 2016 15:48:02 +0800 Subject: [PATCH] MdeModulePkg MemoryProfileInfo: Use PdbStringOffset to get PDB info REF: https://bugzilla.tianocore.org/show_bug.cgi?id=570 Use PdbStringOffset to get PDB info, it will have no functional impact, and will just make the code more generic. Cc: Jiewen Yao Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Star Zeng Reviewed-by: Jiewen Yao --- .../Application/MemoryProfileInfo/MemoryProfileInfo.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/MdeModulePkg/Application/MemoryProfileInfo/MemoryProfileInfo.c b/MdeModulePkg/Application/MemoryProfileInfo/MemoryProfileInfo.c index 338eb8191f..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 @@ -249,8 +249,8 @@ 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; } -- 2.39.2