File tree 1 file changed +14
-1
lines changed
1 file changed +14
-1
lines changed Original file line number Diff line number Diff line change @@ -264,7 +264,7 @@ pub fn open_protocol_exclusive<P: ProtocolPointer + ?Sized>(
264
264
/// If the image is successfully loaded, a [`Handle`] supporting the
265
265
/// [`LoadedImage`] and [`LoadedImageDevicePath`] protocols is returned. The
266
266
/// image can be started with `start_image` and unloaded with
267
- /// `unload_image`.
267
+ /// [ `unload_image`] .
268
268
///
269
269
/// # Errors
270
270
///
@@ -321,6 +321,19 @@ pub fn load_image(parent_image_handle: Handle, source: LoadImageSource) -> Resul
321
321
}
322
322
}
323
323
324
+ /// Unloads a UEFI image.
325
+ ///
326
+ /// # Errors
327
+ ///
328
+ /// * [`Status::UNSUPPORTED`]: the image has been started, and does not support unload.
329
+ /// * [`Status::INVALID_PARAMETER`]: `image_handle` is not valid.
330
+ pub fn unload_image ( image_handle : Handle ) -> Result {
331
+ let bt = boot_services_raw_panicking ( ) ;
332
+ let bt = unsafe { bt. as_ref ( ) } ;
333
+
334
+ unsafe { ( bt. unload_image ) ( image_handle. as_ptr ( ) ) } . to_result ( )
335
+ }
336
+
324
337
/// A buffer returned by [`locate_handle_buffer`] that contains an array of
325
338
/// [`Handle`]s that support the requested protocol.
326
339
#[ derive( Debug , Eq , PartialEq ) ]
You can’t perform that action at this time.
0 commit comments