From 774ccb4bcc9e4866ae9ab8422b99429c995c6039 Mon Sep 17 00:00:00 2001 From: Jaben Carsey Date: Thu, 20 Mar 2014 17:12:30 +0000 Subject: [PATCH] ShellPkg: remove redudant code. call existing API. Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Jaben Carsey Reviewed-by: Erik Bjorge git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@15354 6f19259b-4bc3-4df7-8a09-765794883524 --- .../UefiShellDriver1CommandsLib/Unload.c | 42 ++++--------------- 1 file 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.
+ Copyright (c) 2010 - 2014, 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 @@ -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); } -- 2.39.2