ShellPkg/HandleParsingLib: Show LoadedImageProtocol file path as text
authorJeff Westfahl <jeff.westfahl@ni.com>
Thu, 4 May 2017 21:53:02 +0000 (05:53 +0800)
committerRuiyu Ni <ruiyu.ni@intel.com>
Thu, 11 May 2017 11:14:43 +0000 (19:14 +0800)
This patch adds support for displaying a text representation of the file
path associated with a LoadedImageProtocol. This is a behavior that was
present in the old shell but has been lost in the new shell.

For example, using 'dh -v' in the old shell:

    FilePath......: FvFile(F3331DE6-4A55-44E4-B767-7453F7A1A021)
    FilePath......: \EFI\BOOT\BOOTX64.EFI

vs. the new shell:

    FilePath......: 3A539018
    FilePath......: 3A728718

This seems like useful information for the shell to display.

Cc: Ruiyu Ni <ruiyu.ni@intel.com>
Cc: Jaben Carsey <jaben.carsey@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Jeff Westfahl <jeff.westfahl@ni.com>
Reviewed-by: Ruiyu Ni <ruiyu.ni@intel.com>
Reviewed-by: Jaben Carsey <jaben.carsey@intel.com>
ShellPkg/Library/UefiHandleParsingLib/UefiHandleParsingLib.c
ShellPkg/Library/UefiHandleParsingLib/UefiHandleParsingLib.uni

index da1d92fd1717b7101ae40dabf3920d1578918ad7..2db8a3a2cf180f820ab813ef18edd05760bc36bf 100644 (file)
@@ -169,6 +169,7 @@ LoadedImageProtocolDumpInformation(
   EFI_STATUS                        Status;\r
   CHAR16                            *RetVal;\r
   CHAR16                            *Temp;\r
+  CHAR16                            *FilePath;\r
   CHAR16                            *CodeType;\r
   CHAR16                            *DataType;\r
 \r
@@ -197,6 +198,8 @@ LoadedImageProtocolDumpInformation(
     return NULL;\r
   }\r
 \r
+  FilePath = ConvertDevicePathToText(LoadedImage->FilePath, TRUE, TRUE);\r
+\r
   DataType = ConvertMemoryType(LoadedImage->ImageDataType);\r
   CodeType = ConvertMemoryType(LoadedImage->ImageCodeType);\r
 \r
@@ -207,7 +210,7 @@ LoadedImageProtocolDumpInformation(
              LoadedImage->ParentHandle,\r
              LoadedImage->SystemTable,\r
              LoadedImage->DeviceHandle,\r
-             LoadedImage->FilePath,\r
+             FilePath,\r
              LoadedImage->LoadOptionsSize,\r
              LoadedImage->LoadOptions,\r
              LoadedImage->ImageBase,\r
@@ -219,6 +222,7 @@ LoadedImageProtocolDumpInformation(
 \r
 \r
   SHELL_FREE_NON_NULL(Temp);\r
+  SHELL_FREE_NON_NULL(FilePath);\r
   SHELL_FREE_NON_NULL(CodeType);\r
   SHELL_FREE_NON_NULL(DataType);\r
 \r
index 273a4201bcae911656e8d405540ed4aade81476b..7b3711d741ff596413e8a3f4dc32244c347b433d 100644 (file)
                                                   "     ParentHandle..: %%H%x%%N\r\n"\r
                                                   "     SystemTable...: %%H%x%%N\r\n"\r
                                                   "     DeviceHandle..: %%H%x%%N\r\n"\r
-                                                  "     FilePath......: %%H%x%%N\r\n"\r
+                                                  "     FilePath......: %%H%s%%N\r\n"\r
                                                   "     OptionsSize...: %%H%x%%N\r\n"\r
                                                   "     LoadOptions...: %%H%x%%N\r\n"\r
                                                   "     ImageBase.....: %%H%x%%N\r\n"\r