File tree Expand file tree Collapse file tree 1 file changed +29
-0
lines changed Expand file tree Collapse file tree 1 file changed +29
-0
lines changed Original file line number Diff line number Diff line change @@ -333,6 +333,35 @@ pub unsafe fn install_protocol_interface(
333333 . to_result_with_val ( || Handle :: from_ptr ( handle) . unwrap ( ) )
334334}
335335
336+ /// Reinstalls a protocol interface on a device handle. `old_interface` is replaced with `new_interface`.
337+ /// These interfaces may be the same, in which case the registered protocol notifications occur for the handle
338+ /// without replacing the interface.
339+ ///
340+ /// As with `install_protocol_interface`, any process that has registered to wait for the installation of
341+ /// the interface is notified.
342+ ///
343+ /// # Safety
344+ ///
345+ /// The caller is responsible for ensuring that there are no references to the `old_interface` that is being
346+ /// removed.
347+ ///
348+ /// # Errors
349+ ///
350+ /// * [`Status::NOT_FOUND`]: the old interface was not found on the handle.
351+ /// * [`Status::ACCESS_DENIED`]: the old interface is still in use and cannot be uninstalled.
352+ pub unsafe fn reinstall_protocol_interface (
353+ handle : Handle ,
354+ protocol : & Guid ,
355+ old_interface : * const c_void ,
356+ new_interface : * const c_void ,
357+ ) -> Result < ( ) > {
358+ let bt = boot_services_raw_panicking ( ) ;
359+ let bt = unsafe { bt. as_ref ( ) } ;
360+
361+ ( bt. reinstall_protocol_interface ) ( handle. as_ptr ( ) , protocol, old_interface, new_interface)
362+ . to_result ( )
363+ }
364+
336365/// Returns an array of handles that support the requested protocol in a
337366/// pool-allocated buffer.
338367///
You can’t perform that action at this time.
0 commit comments