Struct uefi::proto::loaded_image::LoadedImage[][src]

#[repr(C)]
pub struct LoadedImage { /* fields omitted */ }
Expand description

The LoadedImage protocol. This can be opened on any image handle using the HandleProtocol boot service.

Implementations

Returns a handle to the storage device on which the image is located.

Get the load options of the given image. If the image was executed from the EFI shell, or from a boot option, this is the command line that was used to execute it as a string. If no options were given, this returns Ok("").

Set the image data address and size.

This is useful in the following scenario:

  1. Secure boot is enabled, so images loaded with LoadImage must be signed with an appropriate key known to the firmware.
  2. The bootloader has its own key embedded, and uses that key to verify the next stage. This key is not known to the firmware, so the next stage’s image can’t be loaded with LoadImage.
  3. Since image handles are created by LoadImage, which we can’t call, we have to make use of an existing image handle – the one passed into the bootloader’s entry function. By modifying that image handle (after appropriately verifying the signature of the new data), we can repurpose the image handle for the next stage.

See shim for an example of this scenario.

Safety

This function takes data as a raw pointer because the data is not owned by LoadedImage. The caller must ensure that the memory lives long enough.

Set the load options for the image. This can be used prior to calling BootServices.start_image to control the command line passed to the image.

Safety

This function takes options as a raw pointer because the load options data is not owned by LoadedImage. The caller must ensure that the memory lives long enough.

Returns the base address and the size in bytes of the loaded image.

Trait Implementations

Unique protocol identifier.

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Performs the conversion.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.