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 <eric.d...@intel.com> Cc: Liming Gao <liming....@intel.com> Cc: Jiewen Yao <jiewen....@intel.com> Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Dandan Bi <dandan...@intel.com> --- .../Library/FileExplorerLib/FileExplorer.c | 56 +--------------------- .../Library/FileExplorerLib/FileExplorer.h | 3 +- .../Library/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 41a22aa..9cd366d 100644 --- a/MdeModulePkg/Library/FileExplorerLib/FileExplorer.c +++ b/MdeModulePkg/Library/FileExplorerLib/FileExplorer.c @@ -1,9 +1,9 @@ /** @file File explorer related functions. -Copyright (c) 2004 - 2016, Intel Corporation. All rights reserved.<BR> +Copyright (c) 2004 - 2017, 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 that accompanies this distribution. The full text of the license may be found at http://opensource.org/licenses/bsd-license.php. @@ -697,23 +697,20 @@ EFI_STATUS LibFindFileSystem ( VOID ) { UINTN NoSimpleFsHandles; - UINTN NoLoadFileHandles; EFI_HANDLE *SimpleFsHandle; - EFI_HANDLE *LoadFileHandle; UINT16 *VolumeLabel; UINTN Index; EFI_STATUS Status; MENU_ENTRY *MenuEntry; FILE_CONTEXT *FileContext; UINTN OptionNumber; EFI_FILE_SYSTEM_VOLUME_LABEL *Info; NoSimpleFsHandles = 0; - NoLoadFileHandles = 0; OptionNumber = 0; // // Locate Handles that support Simple File System protocol // @@ -794,61 +791,10 @@ LibFindFileSystem ( if (NoSimpleFsHandles != 0) { 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 fab2052..4b5f601 100644 --- a/MdeModulePkg/Library/FileExplorerLib/FileExplorer.h +++ b/MdeModulePkg/Library/FileExplorerLib/FileExplorer.h @@ -1,9 +1,9 @@ /** @file File explorer lib. -Copyright (c) 2015, Intel Corporation. All rights reserved.<BR> +Copyright (c) 2015 - 2017, 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 http://opensource.org/licenses/bsd-license.php @@ -21,11 +21,10 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. #include <Protocol/HiiConfigAccess.h> #include <Protocol/DevicePath.h> #include <Protocol/SimpleFileSystem.h> #include <Protocol/DevicePathToText.h> -#include <Protocol/LoadFile.h> #include <Protocol/FormBrowser2.h> #include <Library/DebugLib.h> #include <Library/BaseMemoryLib.h> #include <Library/UefiBootServicesTableLib.h> diff --git a/MdeModulePkg/Library/FileExplorerLib/FileExplorerLib.inf b/MdeModulePkg/Library/FileExplorerLib/FileExplorerLib.inf index 8b4383b..c292aa2 100644 --- a/MdeModulePkg/Library/FileExplorerLib/FileExplorerLib.inf +++ b/MdeModulePkg/Library/FileExplorerLib/FileExplorerLib.inf @@ -1,9 +1,9 @@ ## @file # library defines a set of interfaces for how to do file explorer. # -# Copyright (c) 2011 - 2016, Intel Corporation. All rights reserved.<BR> +# Copyright (c) 2011 - 2017, 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 that accompanies this distribution. # The full text of the license may be found at # http://opensource.org/licenses/bsd-license.php. # @@ -53,11 +53,10 @@ [Guids] gEfiFileSystemVolumeLabelInfoIdGuid ## CONSUMES ## GUID (Indicate the information type is volume) gEfiIfrTianoGuid ## CONSUMES ## GUID (Extended IFR Guid Opcode) [Protocols] gEfiSimpleFileSystemProtocolGuid ## CONSUMES - gEfiLoadFileProtocolGuid ## CONSUMES gEfiHiiConfigAccessProtocolGuid ## CONSUMES gEfiFormBrowser2ProtocolGuid ## CONSUMES gEfiDevicePathToTextProtocolGuid ## CONSUMES [Depex.common.DXE_DRIVER] -- 1.9.5.msysgit.1 _______________________________________________ edk2-devel mailing list edk2-devel@lists.01.org https://lists.01.org/mailman/listinfo/edk2-devel