OcDevicePathLib: Add support for short-form expansion

This commit is contained in:
Download-Fritz 2019-06-09 22:04:30 +02:00
parent d195572f74
commit 85a0833e53
3 changed files with 27 additions and 1 deletions

View File

@ -151,4 +151,23 @@ OcFixAppleBootDevicePath (
IN OUT EFI_DEVICE_PATH_PROTOCOL **DevicePath
);
/**
Get the next possible full path pointing to the load option.
The routine doesn't guarantee the returned full path points to an existing
file, and it also doesn't guarantee the existing file is a valid load option.
@param FilePath The device path pointing to a load option.
It could be a short-form device path.
@param FullPath The full path returned by the routine in last call.
Set to NULL in first call.
@return The next possible full path pointing to the load option.
Caller is responsible to free the memory.
**/
EFI_DEVICE_PATH_PROTOCOL *
OcGetNextLoadOptionDevicePath (
IN EFI_DEVICE_PATH_PROTOCOL *FilePath,
IN EFI_DEVICE_PATH_PROTOCOL *FullPath
);
#endif // OC_DEVICE_PATH_LIB_H

View File

@ -267,7 +267,10 @@ OcFixAppleBootDevicePath (
ASSERT (DevicePath != NULL);
ASSERT (*DevicePath != NULL);
ASSERT (IsDevicePathValid (*DevicePath, 0));
//
// CAUTION: When adding new fixes, ensure short-form device paths are not
// modified and success is returned.
//
OriginalDevPath = *DevicePath;
while (TRUE) {

View File

@ -32,6 +32,7 @@
[Sources]
OcDevicePathLib.c
ExpandDevicePath.c
[Packages]
OcSupportPkg/OcSupportPkg.dec
@ -42,3 +43,6 @@
[Protocols]
gEfiDevicePathToTextProtocolGuid
gEfiSimpleFileSystemProtocolGuid
gEfiBlockIoProtocolGuid
gEfiUsbIoProtocolGuid
gEfiLoadFileProtocolGuid