uefi_raw/protocol/
loaded_image.rs

1use crate::protocol::device_path::DevicePathProtocol;
2use crate::table::boot::MemoryType;
3use crate::table::system::SystemTable;
4use crate::{guid, Guid, Handle, Status};
5use core::ffi::c_void;
6
7#[derive(Clone, Copy, Debug)]
8#[repr(C)]
9pub struct LoadedImageProtocol {
10    pub revision: u32,
11    pub parent_handle: Handle,
12    pub system_table: *const SystemTable,
13
14    // Source location of the image.
15    pub device_handle: Handle,
16    pub file_path: *const DevicePathProtocol,
17
18    pub reserved: *const c_void,
19
20    // Image load options.
21    pub load_options_size: u32,
22    pub load_options: *const c_void,
23
24    // Location where image was loaded.
25    pub image_base: *const c_void,
26    pub image_size: u64,
27    pub image_code_type: MemoryType,
28    pub image_data_type: MemoryType,
29    pub unload: Option<unsafe extern "efiapi" fn(image_handle: Handle) -> Status>,
30}
31
32impl LoadedImageProtocol {
33    pub const GUID: Guid = guid!("5b1b31a1-9562-11d2-8e3f-00a0c969723b");
34}