|
| 1 | +use crate::protocol::device_path::DevicePathProtocol; |
| 2 | +use crate::table::boot::MemoryType; |
| 3 | +use crate::table::system::SystemTable; |
| 4 | +use crate::{guid, Guid, Handle, Status}; |
| 5 | +use core::ffi::c_void; |
| 6 | + |
| 7 | +#[derive(Clone, Copy)] |
| 8 | +#[repr(C)] |
| 9 | +pub 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 | + |
| 32 | +impl LoadedImageProtocol { |
| 33 | + pub const GUID: Guid = guid!("5b1b31a1-9562-11d2-8e3f-00a0c969723b"); |
| 34 | +} |
0 commit comments