Function openProtocolSt [src]

Opens a protocol with a structure as the loaded image for a UEFI application

Prototype

pub fn openProtocolSt(self: *BootServices, comptime protocol: type, handle: Handle) !*protocol

Parameters

self: *BootServicesprotocol: typehandle: Handle

Source

pub fn openProtocolSt(self: *BootServices, comptime protocol: type, handle: Handle) !*protocol { if (!@hasDecl(protocol, "guid")) @compileError("Protocol is missing guid!"); var ptr: ?*protocol = undefined; try self.openProtocol( handle, &protocol.guid, @as(*?*anyopaque, @ptrCast(&ptr)), // Invoking handle (loaded image) uefi.handle, // Control handle (null as not a driver) null, uefi.tables.OpenProtocolAttributes{ .by_handle_protocol = true }, ).err(); return ptr.?; }