#include "util.h"
EFI_STATUS disk_get_part_uuid(EFI_HANDLE *handle, CHAR16 uuid[static 37]) {
+ EFI_STATUS err;
EFI_DEVICE_PATH *device_path;
_cleanup_freepool_ EFI_DEVICE_PATH *paths = NULL;
+ /* export the device path this image is started from */
+
if (!handle)
return EFI_NOT_FOUND;
- /* export the device path this image is started from */
- device_path = DevicePathFromHandle(handle);
- if (!device_path)
- return EFI_NOT_FOUND;
+ err = BS->HandleProtocol(handle, &DevicePathProtocol, (void **) &device_path);
+ if (err != EFI_SUCCESS)
+ return err;
paths = UnpackDevicePath(device_path);
for (EFI_DEVICE_PATH *path = paths; !IsDevicePathEnd(path); path = NextDevicePathNode(path)) {
assert(device);
assert(ret_device_path);
- EFI_DEVICE_PATH *partition_path = DevicePathFromHandle(device);
- if (!partition_path)
- return EFI_NOT_FOUND;
+ EFI_DEVICE_PATH *partition_path;
+ err = BS->HandleProtocol(device, &DevicePathProtocol, (void **) &partition_path);
+ if (err != EFI_SUCCESS)
+ return err;
/* Find the (last) partition node itself. */
EFI_DEVICE_PATH *part_node = NULL;