audk/MdePkg/Include
Laszlo Ersek 5dbc768f1c MdePkg/UefiLib: don't special-case EFI_FILE_MODE_CREATE in OpenMode
While reviewing the patch that would land as 768b611136
("MdePkg/UefiLib: introduce EfiOpenFileByDevicePath()", 2018-08-16), Ray
pointed out that distinguishing EFI_FILE_MODE_CREATE was wasteful. Per
spec, if the file to create exists, then EFI_FILE_MODE_CREATE is ignored
by EFI_FILE_PROTOCOL.Open(), and the existent file is opened.

Therefore we don't need an attempt to "open-but-not-create" first, and a
fallback to "open-and-create-too" second -- that behavior is internal to
EFI_FILE_PROTOCOL.Open(). Remove the special-casing of
EFI_FILE_MODE_CREATE.

Cc: Liming Gao <liming.gao@intel.com>
Cc: Michael D Kinney <michael.d.kinney@intel.com>
Cc: Ruiyu Ni <ruiyu.ni@intel.com>
Suggested-by: Ruiyu Ni <ruiyu.ni@intel.com>
Ref: https://bugzilla.tianocore.org/show_bug.cgi?id=1074
Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Laszlo Ersek <lersek@redhat.com>
Reviewed-by: Liming Gao <liming.gao@intel.com>
2018-08-22 10:31:47 +02:00
..
AArch64 MdePkg: Disable some Level 4 warnings for VS2017/ARM64 2018-03-19 17:05:34 +08:00
Arm MdePkg: Disable some Level 4 warnings for VS2017/ARM 2018-02-07 09:49:20 +08:00
Ebc MdePkg: Clean up source files 2018-06-28 11:19:47 +08:00
Guid MdePkg Cper.h: Add generic error macros for ARM platform 2018-08-15 09:34:48 -07:00
Ia32 MdePkg: Clean up source files 2018-06-28 11:19:47 +08:00
IndustryStandard MdePkg: IORT Specification Rev D updates 2018-06-28 21:05:14 +08:00
Ipf MdePkg: Clean up source files 2018-06-28 11:19:47 +08:00
Library MdePkg/UefiLib: don't special-case EFI_FILE_MODE_CREATE in OpenMode 2018-08-22 10:31:47 +02:00
Pi MdePkg: Clean up source files 2018-06-28 11:19:47 +08:00
Ppi MdePkg: Clean up source files 2018-06-28 11:19:47 +08:00
Protocol MdePkg FirmwareManagement.h: Fix code style issue 2018-08-01 10:15:45 +08:00
Uefi MdePkg: Clean up source files 2018-06-28 11:19:47 +08:00
X64 MdePkg: Clean up source files 2018-06-28 11:19:47 +08:00
Base.h MdePkg: Clean up source files 2018-06-28 11:19:47 +08:00
PiDxe.h MdePkg: Clean up source files 2018-06-28 11:19:47 +08:00
PiMm.h MdePkg: Add new definitions for Management Mode. 2017-08-29 09:37:36 +08:00
PiPei.h MdePkg: Clean up source files 2018-06-28 11:19:47 +08:00
PiSmm.h MdePkg: Clean up source files 2018-06-28 11:19:47 +08:00
Uefi.h MdePkg: Clean up source files 2018-06-28 11:19:47 +08:00