From d9b64abbdf70e42f8e20bd372aaf9605cb20b725 Mon Sep 17 00:00:00 2001 From: Dandan Bi Date: Tue, 10 Jan 2017 13:17:28 +0800 Subject: [PATCH] MdeModulePkg/FileExplorer: Remove the codes of searching load file protocol https://bugzilla.tianocore.org/show_bug.cgi?id=323 FileExplorer no need to search load file protocol to show files. Now remove the codes. Cc: Eric Dong Cc: Liming Gao Cc: Jiewen Yao Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Dandan Bi Reviewed-by: Eric Dong --- .../Library/FileExplorerLib/FileExplorer.c | 56 +------------------ .../Library/FileExplorerLib/FileExplorer.h | 3 +- .../FileExplorerLib/FileExplorerLib.inf | 3 +- 3 files changed, 3 insertions(+), 59 deletions(-) diff --git a/MdeModulePkg/Library/FileExplorerLib/FileExplorer.c b/MdeModulePkg/Library/FileExplorerLib/FileExplorer.c index 41a22aa00c..9cd366ddf4 100644 --- a/MdeModulePkg/Library/FileExplorerLib/FileExplorer.c +++ b/MdeModulePkg/Library/FileExplorerLib/FileExplorer.c @@ -1,7 +1,7 @@ /** @file File explorer related functions. -Copyright (c) 2004 - 2016, Intel Corporation. All rights reserved.
+Copyright (c) 2004 - 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 that accompanies this distribution. The full text of the license may be found at @@ -699,9 +699,7 @@ LibFindFileSystem ( ) { UINTN NoSimpleFsHandles; - UINTN NoLoadFileHandles; EFI_HANDLE *SimpleFsHandle; - EFI_HANDLE *LoadFileHandle; UINT16 *VolumeLabel; UINTN Index; EFI_STATUS Status; @@ -711,7 +709,6 @@ LibFindFileSystem ( EFI_FILE_SYSTEM_VOLUME_LABEL *Info; NoSimpleFsHandles = 0; - NoLoadFileHandles = 0; OptionNumber = 0; // @@ -796,57 +793,6 @@ LibFindFileSystem ( FreePool (SimpleFsHandle); } - // - // Searching for handles that support Load File protocol - // - Status = gBS->LocateHandleBuffer ( - ByProtocol, - &gEfiLoadFileProtocolGuid, - NULL, - &NoLoadFileHandles, - &LoadFileHandle - ); - - if (!EFI_ERROR (Status)) { - for (Index = 0; Index < NoLoadFileHandles; Index++) { - MenuEntry = LibCreateMenuEntry (); - if (NULL == MenuEntry) { - FreePool (LoadFileHandle); - return EFI_OUT_OF_RESOURCES; - } - - FileContext = (FILE_CONTEXT *) MenuEntry->VariableContext; - FileContext->DeviceHandle = LoadFileHandle[Index]; - FileContext->IsRoot = TRUE; - - FileContext->DevicePath = DevicePathFromHandle (FileContext->DeviceHandle); - FileContext->FileName = LibDevicePathToStr (FileContext->DevicePath); - - MenuEntry->HelpString = LibDevicePathToStr (FileContext->DevicePath); - MenuEntry->DisplayString = AllocateZeroPool (MAX_CHAR); - ASSERT (MenuEntry->DisplayString != NULL); - UnicodeSPrint ( - MenuEntry->DisplayString, - MAX_CHAR, - L"Load File [%s]", - MenuEntry->HelpString - ); - MenuEntry->DisplayStringToken = HiiSetString ( - gFileExplorerPrivate.FeHiiHandle, - 0, - MenuEntry->DisplayString, - NULL - ); - - OptionNumber++; - InsertTailList (&gFileExplorerPrivate.FsOptionMenu->Head, &MenuEntry->Link); - } - } - - if (NoLoadFileHandles != 0) { - FreePool (LoadFileHandle); - } - gFileExplorerPrivate.FsOptionMenu->MenuNumber = OptionNumber; return EFI_SUCCESS; diff --git a/MdeModulePkg/Library/FileExplorerLib/FileExplorer.h b/MdeModulePkg/Library/FileExplorerLib/FileExplorer.h index fab20523ad..4b5f601b91 100644 --- a/MdeModulePkg/Library/FileExplorerLib/FileExplorer.h +++ b/MdeModulePkg/Library/FileExplorerLib/FileExplorer.h @@ -1,7 +1,7 @@ /** @file File explorer lib. -Copyright (c) 2015, Intel Corporation. All rights reserved.
+Copyright (c) 2015 - 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 @@ -23,7 +23,6 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. #include #include #include -#include #include #include diff --git a/MdeModulePkg/Library/FileExplorerLib/FileExplorerLib.inf b/MdeModulePkg/Library/FileExplorerLib/FileExplorerLib.inf index 8b4383b3b9..c292aa2e49 100644 --- a/MdeModulePkg/Library/FileExplorerLib/FileExplorerLib.inf +++ b/MdeModulePkg/Library/FileExplorerLib/FileExplorerLib.inf @@ -1,7 +1,7 @@ ## @file # library defines a set of interfaces for how to do file explorer. # -# Copyright (c) 2011 - 2016, Intel Corporation. All rights reserved.
+# Copyright (c) 2011 - 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 that accompanies this distribution. # The full text of the license may be found at @@ -55,7 +55,6 @@ [Protocols] gEfiSimpleFileSystemProtocolGuid ## CONSUMES - gEfiLoadFileProtocolGuid ## CONSUMES gEfiHiiConfigAccessProtocolGuid ## CONSUMES gEfiFormBrowser2ProtocolGuid ## CONSUMES gEfiDevicePathToTextProtocolGuid ## CONSUMES -- 2.39.2