Rollup merge of #146964 - Ayush1325:close-protocol, r=joboet

library: std: sys: pal: uefi: Add some comments

I seemed to have forgotten that since I am using GET_PROTOCOL attribute for the std usecases, I did not need to close the protocols explicitly. So adding these comments as a note to future self not to waste time on the same thing again.
This commit is contained in:
Matthias Krüger 2025-09-24 20:34:31 +02:00 committed by GitHub
commit 24e19c9088
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -92,6 +92,9 @@ pub(crate) fn locate_handles(mut guid: Guid) -> io::Result<Vec<NonNull<crate::ff
///
/// Queries a handle to determine if it supports a specified protocol. If the protocol is
/// supported by the handle, it opens the protocol on behalf of the calling agent.
///
/// The protocol is opened with the attribute GET_PROTOCOL, which means the caller is not required
/// to close the protocol interface with `EFI_BOOT_SERVICES.CloseProtocol()`
pub(crate) fn open_protocol<T>(
handle: NonNull<crate::ffi::c_void>,
mut protocol_guid: Guid,
@ -473,6 +476,7 @@ impl<'a> crate::fmt::Debug for DevicePathNode<'a> {
}
}
/// Protocols installed by Rust side on a handle.
pub(crate) struct OwnedProtocol<T> {
guid: r_efi::efi::Guid,
handle: NonNull<crate::ffi::c_void>,