mirror of https://github.com/acidanthera/audk.git
MdePkg DxeServicesLib: Search further in GetFileBufferByFilePath
This function supports loading via these interfaces, in order: * gEfiFirmwareVolume2ProtocolGuid * gEfiSimpleFileSystemProtocolGuid * gEfiLoadFile2ProtocolGuid * gEfiLoadFileProtocolGuid Previously, if a device path supported any of these interfaces, it would only check that interface. (If it failed to load via that interface, it would not move on and check the others.) This change causes the other interfaces to still be checked if the previous ones fail. Signed-off-by: jljusten Reviewed-by: mdkinney git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@12761 6f19259b-4bc3-4df7-8a09-765794883524
This commit is contained in:
parent
7102b19961
commit
c119933d02
|
@ -704,8 +704,10 @@ GetFileBufferByFilePath (
|
|||
}
|
||||
}
|
||||
}
|
||||
if (!EFI_ERROR (Status)) {
|
||||
goto Finish;
|
||||
}
|
||||
}
|
||||
|
||||
//
|
||||
// Attempt to access the file via a file system interface
|
||||
|
@ -728,8 +730,11 @@ GetFileBufferByFilePath (
|
|||
TempDevicePathNode = DuplicateDevicePath (DevicePathNode);
|
||||
if (TempDevicePathNode == NULL) {
|
||||
FileHandle->Close (FileHandle);
|
||||
//
|
||||
// Setting Status to an EFI_ERROR value will cause the rest of
|
||||
// the file system support below to be skipped.
|
||||
//
|
||||
Status = EFI_OUT_OF_RESOURCES;
|
||||
goto Finish;
|
||||
}
|
||||
//
|
||||
// Parse each MEDIA_FILEPATH_DP node. There may be more than one, since the
|
||||
|
@ -737,7 +742,7 @@ GetFileBufferByFilePath (
|
|||
// our way down each device path node and close the previous node
|
||||
//
|
||||
DevicePathNode = TempDevicePathNode;
|
||||
while (!IsDevicePathEnd (DevicePathNode) && !EFI_ERROR (Status)) {
|
||||
while (!EFI_ERROR (Status) && !IsDevicePathEnd (DevicePathNode)) {
|
||||
if (DevicePathType (DevicePathNode) != MEDIA_DEVICE_PATH ||
|
||||
DevicePathSubType (DevicePathNode) != MEDIA_FILEPATH_DP) {
|
||||
Status = EFI_UNSUPPORTED;
|
||||
|
@ -816,11 +821,15 @@ GetFileBufferByFilePath (
|
|||
if (FileHandle != NULL) {
|
||||
FileHandle->Close (FileHandle);
|
||||
}
|
||||
if (TempDevicePathNode != NULL) {
|
||||
FreePool (TempDevicePathNode);
|
||||
}
|
||||
}
|
||||
}
|
||||
if (!EFI_ERROR (Status)) {
|
||||
goto Finish;
|
||||
}
|
||||
}
|
||||
|
||||
//
|
||||
// Attempt to access the file via LoadFile2 interface
|
||||
|
@ -858,9 +867,11 @@ GetFileBufferByFilePath (
|
|||
}
|
||||
}
|
||||
}
|
||||
if (!EFI_ERROR (Status)) {
|
||||
goto Finish;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
//
|
||||
// Attempt to access the file via LoadFile interface
|
||||
|
|
Loading…
Reference in New Issue