Function locateHandle [src]

To determine the necessary size of buffer, call locateHandleLen first.

Prototype

pub fn locateHandle( self: *BootServices, search: LocateSearch, buffer: []Handle, ) LocateHandleError![]Handle

Parameters

self: *BootServicessearch: LocateSearchbuffer: []Handle

Possible Errors

BufferTooSmall
InvalidParameter
Unexpected UnexpectedError

Source

pub fn locateHandle( self: *BootServices, search: LocateSearch, buffer: []Handle, ) LocateHandleError![]Handle { var len: usize = @sizeOf(Handle) * buffer.len; switch (self._locateHandle( std.meta.activeTag(search), if (search == .by_protocol) search.by_protocol else null, if (search == .by_register_notify) search.by_register_notify else null, &len, buffer.ptr, )) { .success => return buffer[0..@divExact(len, @sizeOf(Handle))], .not_found => return buffer[0..0], .buffer_too_small => return error.BufferTooSmall, .invalid_parameter => return error.InvalidParameter, else => |status| return uefi.unexpectedStatus(status), } }