Function locateDevicePath [src]
Locates all devices on device_path that support Protocol. Once the closest
match to device_path is found, it returns the unmatched device path and handle.
Prototype
pub fn locateDevicePath( self: *const BootServices, device_path: *const DevicePathProtocol, Protocol: type, ) LocateHandleError!?struct { *const DevicePathProtocol, Handle } Parameters
self: *const BootServicesdevice_path: *const DevicePathProtocolProtocol: type Possible Errors
Source
pub fn locateDevicePath(
self: *const BootServices,
device_path: *const DevicePathProtocol,
Protocol: type,
) LocateHandleError!?struct { *const DevicePathProtocol, Handle } {
if (!@hasDecl(Protocol, "guid"))
@compileError("Protocol is missing guid");
var dev_path = device_path;
var device: ?Handle = undefined;
switch (self._locateDevicePath(
&Protocol.guid,
&dev_path,
&device,
)) {
.success => return .{ dev_path, device.? },
.not_found => return null,
.invalid_parameter => return error.InvalidParameter,
else => |status| return uefi.unexpectedStatus(status),
}
}