summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorStar Zeng <star.zeng@intel.com>2016-01-19 09:19:37 +0000
committerHao Wu <hao.a.wu@intel.com>2016-07-13 20:41:19 +0800
commit36ec2a0a53deb5ef7b140cc640e7ef0584e46cd3 (patch)
tree35d1418661e86591ec4b4cc4226eeb5a4ba7cdb2
parent0a7a04c64b5a5cdc32e5e82b947ca72a99ad3e20 (diff)
downloadedk2-platforms-36ec2a0a53deb5ef7b140cc640e7ef0584e46cd3.tar.xz
ShellPkg UefiDpLib: Use Image->FilePath to get name for SMM drivers
This enhancement is to use the FilePath field in the loaded image protocol to find the name of an image as a fallback for when the loaded image device path protocol is not installed on the image handle. This is necessary because the SMM core does not install the loaded image device path protocol, so DP was displaying "Unknown Driver Name" for every SMM driver. Cc: Liming Gao <liming.gao@intel.com> Cc: Jaben Carsey <jaben.carsey@intel.com> Cc: Shumin Qiu <shumin.qiu@intel.com> Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Star Zeng <star.zeng@intel.com> Reviewed-by: Liming Gao <liming.gao@intel.com> git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@19683 6f19259b-4bc3-4df7-8a09-765794883524 (cherry picked from commit 3b672240e6c77ccf3f5cc0f3e8dbf026fc9e2751)
-rw-r--r--ShellPkg/Library/UefiDpLib/DpUtilities.c14
1 files changed, 11 insertions, 3 deletions
diff --git a/ShellPkg/Library/UefiDpLib/DpUtilities.c b/ShellPkg/Library/UefiDpLib/DpUtilities.c
index e9d8fb3adf..032e7b4ce1 100644
--- a/ShellPkg/Library/UefiDpLib/DpUtilities.c
+++ b/ShellPkg/Library/UefiDpLib/DpUtilities.c
@@ -1,7 +1,7 @@
/** @file
Utility functions used by the Dp application.
- Copyright (c) 2009 - 2015, Intel Corporation. All rights reserved.
+ Copyright (c) 2009 - 2016, Intel Corporation. All rights reserved.
(C) Copyright 2015 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
@@ -206,6 +206,10 @@ DpGetNameFromHandle (
CHAR8 *PlatformLanguage;
EFI_COMPONENT_NAME2_PROTOCOL *ComponentName2;
+ Image = NULL;
+ LoadedImageDevicePath = NULL;
+ DevicePath = NULL;
+
//
// Method 1: Get the name string from image PDB
//
@@ -275,9 +279,13 @@ DpGetNameFromHandle (
);
if (!EFI_ERROR (Status) && (LoadedImageDevicePath != NULL)) {
DevicePath = LoadedImageDevicePath;
+ } else if (Image != NULL) {
+ DevicePath = Image->FilePath;
+ }
+ if (DevicePath != NULL) {
//
- // Try to get image GUID from LoadedImageDevicePath protocol
+ // Try to get image GUID from image DevicePath
//
NameGuid = NULL;
while (!IsDevicePathEndType (DevicePath)) {
@@ -320,7 +328,7 @@ DpGetNameFromHandle (
//
// Method 5: Get the name string from image DevicePath
//
- NameString = ConvertDevicePathToText (LoadedImageDevicePath, TRUE, FALSE);
+ NameString = ConvertDevicePathToText (DevicePath, TRUE, FALSE);
if (NameString != NULL) {
StrnCpyS (mGaugeString, DP_GAUGE_STRING_LENGTH + 1, NameString, DP_GAUGE_STRING_LENGTH);
mGaugeString[DP_GAUGE_STRING_LENGTH] = 0;