From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga01.intel.com (mga01.intel.com [192.55.52.88]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ml01.01.org (Postfix) with ESMTPS id 6433F81BC9 for ; Sun, 15 Jan 2017 21:58:27 -0800 (PST) Received: from fmsmga001.fm.intel.com ([10.253.24.23]) by fmsmga101.fm.intel.com with ESMTP; 15 Jan 2017 21:58:27 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.33,237,1477983600"; d="scan'208";a="1094589000" Received: from shwdeopenpsi114.ccr.corp.intel.com ([10.239.157.135]) by fmsmga001.fm.intel.com with ESMTP; 15 Jan 2017 21:58:26 -0800 From: Dandan Bi To: edk2-devel@lists.01.org Cc: Eric Dong , Liming Gao , Jiewen Yao Date: Mon, 16 Jan 2017 13:57:24 +0800 Message-Id: <1484546246-54936-1-git-send-email-dandan.bi@intel.com> X-Mailer: git-send-email 1.9.5.msysgit.1 Subject: [patch 1/3] MdeModulePkg/FileExplorer: Remove the codes of searching load file protocol X-BeenThere: edk2-devel@lists.01.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: EDK II Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 16 Jan 2017 05:58:27 -0000 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 --- .../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.
+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 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.
+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 http://opensource.org/licenses/bsd-license.php @@ -21,11 +21,10 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. #include #include #include #include -#include #include #include #include #include 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.
+# 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 # 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