]> git.proxmox.com Git - mirror_edk2.git/commit
MdePkg/UefiFileHandleLib: Tolerate more Root handle FileNames
authorMarvin Haeuser <mhaeuser@outlook.de>
Sun, 20 Oct 2019 12:08:32 +0000 (20:08 +0800)
committerLiming Gao <liming.gao@intel.com>
Mon, 4 Nov 2019 00:52:57 +0000 (08:52 +0800)
commit6407186db9505f101ece4e1571eceed69b9fbdbe
treebf09665dad41852219a8194765c0d3ccf0a9eacf
parent1009b59b6525c16724fe2684c344a6359af28b55
MdePkg/UefiFileHandleLib: Tolerate more Root handle FileNames

REF: https://bugzilla.tianocore.org/show_bug.cgi?id=2295

The current implementation of the FileHandleGetFileName() function
assumes that the Root directory always has the FileName '\0'.
However, the only requirement the UEFI specification defines is that
a prepended '\\' must be supported to access files and folders
relative to the Root directory.
This patch removes this assumption and supports constructing valid
paths for any value of FileName for the Root Directory.

In practice, this fixes compatibility issues with File System drivers
that report '\\' as the FileName of the Root directory, which
currently is both generating an invalid path ("\\\\") and resulting
in an EFI_NOT_FOUND result from the CurrentHandle->Open() call.

Cc: Michael D Kinney <michael.d.kinney@intel.com>
Cc: Liming Gao <liming.gao@intel.com>
Signed-off-by: Marvin Haeuser <mhaeuser@outlook.de>
Reviewed-by: Liming Gao <liming.gao@intel.com>
Reviewed-by: Zhichao Gao <zhichao.gao@intel.com>
MdePkg/Library/UefiFileHandleLib/UefiFileHandleLib.c