Skip to content

Commit c80c232

Browse files
authored
Merge pull request #1228 from nicholasbishop/bishop-fix-lifetime
uefi: Fix return value lifetime for register_protocol_notify
2 parents d660bd0 + 4b564bf commit c80c232

File tree

2 files changed

+5
-3
lines changed

2 files changed

+5
-3
lines changed

uefi/CHANGELOG.md

+2
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@
22

33
## Changed
44
- **Breaking:** `uefi::helpers::init` no longer takes an argument.
5+
- The lifetime of the `SearchType` returned from
6+
`BootServices::register_protocol_notify` is now tied to the protocol GUID.
57

68

79
# uefi - 0.29.0 (2024-07-02)

uefi/src/table/boot.rs

+3-3
Original file line numberDiff line numberDiff line change
@@ -683,11 +683,11 @@ impl BootServices {
683683
///
684684
/// * [`uefi::Status::OUT_OF_RESOURCES`]
685685
/// * [`uefi::Status::INVALID_PARAMETER`]
686-
pub fn register_protocol_notify(
686+
pub fn register_protocol_notify<'guid>(
687687
&self,
688-
protocol: &Guid,
688+
protocol: &'guid Guid,
689689
event: Event,
690-
) -> Result<(Event, SearchType)> {
690+
) -> Result<(Event, SearchType<'guid>)> {
691691
let mut key = ptr::null();
692692
// Safety: we clone `event` a couple times, but there will be only one left once we return.
693693
unsafe { (self.0.register_protocol_notify)(protocol, event.as_ptr(), &mut key) }

0 commit comments

Comments
 (0)