Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 24e19c9

Browse files
authored
Rollup merge of rust-lang#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.
2 parents af22499 + 03fd823 commit 24e19c9

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

library/std/src/sys/pal/uefi/helpers.rs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -92,6 +92,9 @@ pub(crate) fn locate_handles(mut guid: Guid) -> io::Result<Vec<NonNull<crate::ff
9292
///
9393
/// Queries a handle to determine if it supports a specified protocol. If the protocol is
9494
/// supported by the handle, it opens the protocol on behalf of the calling agent.
95+
///
96+
/// The protocol is opened with the attribute GET_PROTOCOL, which means the caller is not required
97+
/// to close the protocol interface with `EFI_BOOT_SERVICES.CloseProtocol()`
9598
pub(crate) fn open_protocol<T>(
9699
handle: NonNull<crate::ffi::c_void>,
97100
mut protocol_guid: Guid,
@@ -473,6 +476,7 @@ impl<'a> crate::fmt::Debug for DevicePathNode<'a> {
473476
}
474477
}
475478

479+
/// Protocols installed by Rust side on a handle.
476480
pub(crate) struct OwnedProtocol<T> {
477481
guid: r_efi::efi::Guid,
478482
handle: NonNull<crate::ffi::c_void>,

0 commit comments

Comments
 (0)