diff --git a/uefi/CHANGELOG.md b/uefi/CHANGELOG.md index e746ab9c9..7d57ab742 100644 --- a/uefi/CHANGELOG.md +++ b/uefi/CHANGELOG.md @@ -2,6 +2,8 @@ ## Changed - **Breaking:** `uefi::helpers::init` no longer takes an argument. +- The lifetime of the `SearchType` returned from + `BootServices::register_protocol_notify` is now tied to the protocol GUID. # uefi - 0.29.0 (2024-07-02) diff --git a/uefi/src/table/boot.rs b/uefi/src/table/boot.rs index 1a27de37c..f492f495e 100644 --- a/uefi/src/table/boot.rs +++ b/uefi/src/table/boot.rs @@ -683,11 +683,11 @@ impl BootServices { /// /// * [`uefi::Status::OUT_OF_RESOURCES`] /// * [`uefi::Status::INVALID_PARAMETER`] - pub fn register_protocol_notify( + pub fn register_protocol_notify<'guid>( &self, - protocol: &Guid, + protocol: &'guid Guid, event: Event, - ) -> Result<(Event, SearchType)> { + ) -> Result<(Event, SearchType<'guid>)> { let mut key = ptr::null(); // Safety: we clone `event` a couple times, but there will be only one left once we return. unsafe { (self.0.register_protocol_notify)(protocol, event.as_ptr(), &mut key) }