public inbox for devel@edk2.groups.io
 help / color / mirror / Atom feed
From: "Dong, Eric" <eric.dong@intel.com>
To: "Bi, Dandan" <dandan.bi@intel.com>,
	"edk2-devel@lists.01.org" <edk2-devel@lists.01.org>
Cc: "Gao, Liming" <liming.gao@intel.com>,
	"Yao, Jiewen" <jiewen.yao@intel.com>
Subject: Re: [patch 1/3] MdeModulePkg/FileExplorer: Remove the codes of searching load file protocol
Date: Wed, 18 Jan 2017 02:50:38 +0000	[thread overview]
Message-ID: <ED077930C258884BBCB450DB737E66224A8ECDF7@shsmsx102.ccr.corp.intel.com> (raw)
In-Reply-To: <1484546246-54936-1-git-send-email-dandan.bi@intel.com>

Reviewed-by: Eric Dong <eric.dong@intel.com>

-----Original Message-----
From: Bi, Dandan 
Sent: Monday, January 16, 2017 1:57 PM
To: edk2-devel@lists.01.org
Cc: Dong, Eric <eric.dong@intel.com>; Gao, Liming <liming.gao@intel.com>; Yao, Jiewen <jiewen.yao@intel.com>
Subject: [patch 1/3] 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 <eric.dong@intel.com>
Cc: Liming Gao <liming.gao@intel.com>
Cc: Jiewen Yao <jiewen.yao@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Dandan Bi <dandan.bi@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



      parent reply	other threads:[~2017-01-18  2:50 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-01-16  5:57 [patch 1/3] MdeModulePkg/FileExplorer: Remove the codes of searching load file protocol Dandan Bi
2017-01-16  5:57 ` [patch 2/3] MdeModulePkg/FileExplorer: Update QuesrionId when Updating FileExplore form Dandan Bi
2017-01-18  2:50   ` Dong, Eric
2017-01-16  5:57 ` [patch 3/3] MdeModulePkg/FileExplorer: Enable functionality of creating new file/folder Dandan Bi
2017-01-18  2:50   ` Dong, Eric
2017-01-18  2:50 ` Dong, Eric [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-list from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=ED077930C258884BBCB450DB737E66224A8ECDF7@shsmsx102.ccr.corp.intel.com \
    --to=devel@edk2.groups.io \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox