mirror of https://github.com/acidanthera/audk.git
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> Reviewed-by: Eric Dong <eric.dong@intel.com>
This commit is contained in:
parent
a08cdd228a
commit
d9b64abbdf
|
@ -1,7 +1,7 @@
|
||||||
/** @file
|
/** @file
|
||||||
File explorer related functions.
|
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
|
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 terms and conditions of the BSD License that accompanies this distribution.
|
||||||
The full text of the license may be found at
|
The full text of the license may be found at
|
||||||
|
@ -699,9 +699,7 @@ LibFindFileSystem (
|
||||||
)
|
)
|
||||||
{
|
{
|
||||||
UINTN NoSimpleFsHandles;
|
UINTN NoSimpleFsHandles;
|
||||||
UINTN NoLoadFileHandles;
|
|
||||||
EFI_HANDLE *SimpleFsHandle;
|
EFI_HANDLE *SimpleFsHandle;
|
||||||
EFI_HANDLE *LoadFileHandle;
|
|
||||||
UINT16 *VolumeLabel;
|
UINT16 *VolumeLabel;
|
||||||
UINTN Index;
|
UINTN Index;
|
||||||
EFI_STATUS Status;
|
EFI_STATUS Status;
|
||||||
|
@ -711,7 +709,6 @@ LibFindFileSystem (
|
||||||
EFI_FILE_SYSTEM_VOLUME_LABEL *Info;
|
EFI_FILE_SYSTEM_VOLUME_LABEL *Info;
|
||||||
|
|
||||||
NoSimpleFsHandles = 0;
|
NoSimpleFsHandles = 0;
|
||||||
NoLoadFileHandles = 0;
|
|
||||||
OptionNumber = 0;
|
OptionNumber = 0;
|
||||||
|
|
||||||
//
|
//
|
||||||
|
@ -796,57 +793,6 @@ LibFindFileSystem (
|
||||||
FreePool (SimpleFsHandle);
|
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;
|
gFileExplorerPrivate.FsOptionMenu->MenuNumber = OptionNumber;
|
||||||
|
|
||||||
return EFI_SUCCESS;
|
return EFI_SUCCESS;
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
/** @file
|
/** @file
|
||||||
File explorer lib.
|
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
|
This program and the accompanying materials
|
||||||
are licensed and made available under the terms and conditions of the BSD License
|
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
|
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 <Protocol/DevicePath.h>
|
#include <Protocol/DevicePath.h>
|
||||||
#include <Protocol/SimpleFileSystem.h>
|
#include <Protocol/SimpleFileSystem.h>
|
||||||
#include <Protocol/DevicePathToText.h>
|
#include <Protocol/DevicePathToText.h>
|
||||||
#include <Protocol/LoadFile.h>
|
|
||||||
#include <Protocol/FormBrowser2.h>
|
#include <Protocol/FormBrowser2.h>
|
||||||
|
|
||||||
#include <Library/DebugLib.h>
|
#include <Library/DebugLib.h>
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
## @file
|
## @file
|
||||||
# library defines a set of interfaces for how to do file explorer.
|
# 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
|
# 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 terms and conditions of the BSD License that accompanies this distribution.
|
||||||
# The full text of the license may be found at
|
# The full text of the license may be found at
|
||||||
|
@ -55,7 +55,6 @@
|
||||||
|
|
||||||
[Protocols]
|
[Protocols]
|
||||||
gEfiSimpleFileSystemProtocolGuid ## CONSUMES
|
gEfiSimpleFileSystemProtocolGuid ## CONSUMES
|
||||||
gEfiLoadFileProtocolGuid ## CONSUMES
|
|
||||||
gEfiHiiConfigAccessProtocolGuid ## CONSUMES
|
gEfiHiiConfigAccessProtocolGuid ## CONSUMES
|
||||||
gEfiFormBrowser2ProtocolGuid ## CONSUMES
|
gEfiFormBrowser2ProtocolGuid ## CONSUMES
|
||||||
gEfiDevicePathToTextProtocolGuid ## CONSUMES
|
gEfiDevicePathToTextProtocolGuid ## CONSUMES
|
||||||
|
|
Loading…
Reference in New Issue