public inbox for devel@edk2.groups.io
 help / color / mirror / Atom feed
* [patch 1/3] MdeModulePkg/FileExplorer: Remove the codes of searching load file protocol
@ 2017-01-16  5:57 Dandan Bi
  2017-01-16  5:57 ` [patch 2/3] MdeModulePkg/FileExplorer: Update QuesrionId when Updating FileExplore form Dandan Bi
                   ` (2 more replies)
  0 siblings, 3 replies; 6+ messages in thread
From: Dandan Bi @ 2017-01-16  5:57 UTC (permalink / raw)
  To: edk2-devel; +Cc: Eric Dong, Liming Gao, Jiewen Yao

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



^ permalink raw reply related	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2017-01-18  2:50 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
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 ` [patch 1/3] MdeModulePkg/FileExplorer: Remove the codes of searching load file protocol Dong, Eric

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox