File tree Expand file tree Collapse file tree 1 file changed +20
-0
lines changed Expand file tree Collapse file tree 1 file changed +20
-0
lines changed Original file line number Diff line number Diff line change @@ -1007,6 +1007,26 @@ impl BootServices {
10071007 } )
10081008 }
10091009
1010+ /// Open a protocol interface for a handle in exclusive mode.
1011+ ///
1012+ /// If successful, a [`ScopedProtocol`] is returned that will
1013+ /// automatically close the protocol interface when dropped.
1014+ ///
1015+ /// [`handle_protocol`]: BootServices::handle_protocol
1016+ pub fn open_protocol_exclusive < P : ProtocolPointer + ?Sized > (
1017+ & self ,
1018+ handle : Handle ,
1019+ ) -> Result < ScopedProtocol < P > > {
1020+ self . open_protocol :: < P > (
1021+ OpenProtocolParams {
1022+ handle,
1023+ agent : self . image_handle ( ) ,
1024+ controller : None ,
1025+ } ,
1026+ OpenProtocolAttributes :: Exclusive ,
1027+ )
1028+ }
1029+
10101030 /// Test whether a handle supports a protocol.
10111031 pub fn test_protocol < P : Protocol > ( & self , params : OpenProtocolParams ) -> Result < ( ) > {
10121032 const TEST_PROTOCOL : u32 = 0x04 ;
You can’t perform that action at this time.
0 commit comments