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