summaryrefslogtreecommitdiff
path: root/ShellPkg
diff options
context:
space:
mode:
authorJaben Carsey <Jaben.carsey@intel.com>2014-03-20 17:12:30 +0000
committerjcarsey <jcarsey@6f19259b-4bc3-4df7-8a09-765794883524>2014-03-20 17:12:30 +0000
commit774ccb4bcc9e4866ae9ab8422b99429c995c6039 (patch)
tree0c8e9400a6382462455e413c828a2ef4bdc0a1ec /ShellPkg
parent93b7308337a145632abdd2f1684e9bba60ffb448 (diff)
downloadedk2-platforms-774ccb4bcc9e4866ae9ab8422b99429c995c6039.tar.xz
ShellPkg: remove redudant code. call existing API.
Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Jaben Carsey <Jaben.carsey@intel.com> Reviewed-by: Erik Bjorge <erik.c.bjorge@intel.com> git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@15354 6f19259b-4bc3-4df7-8a09-765794883524
Diffstat (limited to 'ShellPkg')
-rw-r--r--ShellPkg/Library/UefiShellDriver1CommandsLib/Unload.c42
1 files changed, 7 insertions, 35 deletions
diff --git a/ShellPkg/Library/UefiShellDriver1CommandsLib/Unload.c b/ShellPkg/Library/UefiShellDriver1CommandsLib/Unload.c
index 4f0ec1203f..cb2c07b69d 100644
--- a/ShellPkg/Library/UefiShellDriver1CommandsLib/Unload.c
+++ b/ShellPkg/Library/UefiShellDriver1CommandsLib/Unload.c
@@ -1,7 +1,7 @@
/** @file
Main file for Unload shell Driver1 function.
- Copyright (c) 2010 - 2013, Intel Corporation. All rights reserved.<BR>
+ Copyright (c) 2010 - 2014, Intel Corporation. All rights reserved.<BR>
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
@@ -28,42 +28,14 @@ DumpLoadedImageProtocolInfo (
IN EFI_HANDLE TheHandle
)
{
- EFI_LOADED_IMAGE_PROTOCOL *Image;
- EFI_STATUS Status;
- CHAR16 *DevicePathText;
- CHAR16 *CodeTypeText;
- CHAR16 *DataTypeText;
- CHAR8 *PdbPointer;
+ CHAR16 *TheString;
- Image = NULL;
-
- Status = gBS->OpenProtocol(TheHandle, &gEfiLoadedImageProtocolGuid, (VOID**)&Image, gImageHandle, NULL, EFI_OPEN_PROTOCOL_GET_PROTOCOL);
- if (EFI_ERROR(Status)) {
- return (EFI_INVALID_PARAMETER);
- }
- DevicePathText = ConvertDevicePathToText(Image->FilePath, TRUE, TRUE);
- CodeTypeText = ConvertMemoryType(Image->ImageCodeType);
- DataTypeText = ConvertMemoryType(Image->ImageDataType);
- PdbPointer = (CHAR8*)PeCoffLoaderGetPdbPointer(Image->ImageBase);
- ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_UNLOAD_VERBOSE), gShellDriver1HiiHandle,
- ConvertHandleToHandleIndex(TheHandle),
- TheHandle,
- Image,
- Image->ParentHandle,
- Image->SystemTable,
- Image->DeviceHandle,
- DevicePathText,
- PdbPointer,
- Image->ImageBase,
- Image->ImageSize,
- CodeTypeText,
- DataTypeText
- );
-
- SHELL_FREE_NON_NULL(DevicePathText);
- SHELL_FREE_NON_NULL(CodeTypeText);
- SHELL_FREE_NON_NULL(DataTypeText);
+ TheString = GetProtocolInformationDump(TheHandle, &gEfiLoadedImageProtocolGuid, TRUE);
+
+ ShellPrintEx(-1, -1, L"%s", TheString);
+ SHELL_FREE_NON_NULL(TheString);
+
return (EFI_SUCCESS);
}