diff --git a/Include/Library/OcDevicePathLib.h b/Include/Library/OcDevicePathLib.h index 82a5fc98..13427959 100755 --- a/Include/Library/OcDevicePathLib.h +++ b/Include/Library/OcDevicePathLib.h @@ -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 diff --git a/Library/OcDevicePathLib/OcDevicePathLib.c b/Library/OcDevicePathLib/OcDevicePathLib.c index ee6fa23c..fe5f83c8 100755 --- a/Library/OcDevicePathLib/OcDevicePathLib.c +++ b/Library/OcDevicePathLib/OcDevicePathLib.c @@ -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) { diff --git a/Library/OcDevicePathLib/OcDevicePathLib.inf b/Library/OcDevicePathLib/OcDevicePathLib.inf index 1ec57dd8..86513192 100755 --- a/Library/OcDevicePathLib/OcDevicePathLib.inf +++ b/Library/OcDevicePathLib/OcDevicePathLib.inf @@ -32,6 +32,7 @@ [Sources] OcDevicePathLib.c + ExpandDevicePath.c [Packages] OcSupportPkg/OcSupportPkg.dec @@ -42,3 +43,6 @@ [Protocols] gEfiDevicePathToTextProtocolGuid gEfiSimpleFileSystemProtocolGuid + gEfiBlockIoProtocolGuid + gEfiUsbIoProtocolGuid + gEfiLoadFileProtocolGuid