@@ -10,6 +10,7 @@ use uefi::proto::media::fs::SimpleFileSystem;
10
10
use uefi:: table:: boot:: { EventType , MemoryType , OpenProtocolAttributes , OpenProtocolParams , Tpl } ;
11
11
use uefi:: table:: runtime:: { Daylight , Time , TimeParams } ;
12
12
use uefi:: Event ;
13
+ use uefi_services:: system_table;
13
14
14
15
/// Test directory entry iteration.
15
16
fn test_existing_dir ( directory : & mut Directory ) {
@@ -181,12 +182,14 @@ fn test_raw_disk_io(handle: Handle, image: Handle, bt: &BootServices) {
181
182
}
182
183
183
184
/// Asynchronous disk I/O 2 transaction callback
184
- unsafe extern "efiapi" fn disk_io2_callback ( _event : Event , ctx : Option < NonNull < c_void > > ) {
185
+ unsafe extern "efiapi" fn disk_io2_callback ( event : Event , ctx : Option < NonNull < c_void > > ) {
185
186
let ptr = ctx. unwrap ( ) . as_ptr ( ) as * const u8 ;
186
187
187
188
// Verify that the disk's MBR signature is correct
188
189
assert_eq ! ( * ptr. offset( 510 ) , 0x55 ) ;
189
190
assert_eq ! ( * ptr. offset( 511 ) , 0xaa ) ;
191
+
192
+ system_table ( ) . as_ref ( ) . boot_services ( ) . close_event ( event) . unwrap ( ) ;
190
193
}
191
194
192
195
/// Tests raw disk I/O through the DiskIo2 protocol.
@@ -233,9 +236,8 @@ fn test_raw_disk_io2(handle: Handle, image: Handle, bt: &BootServices) {
233
236
. read_disk_raw ( 0 , 0 , & mut token, SIZE , buf)
234
237
. expect ( "Failed to read from disk" ) ;
235
238
}
236
-
239
+
237
240
info ! ( "Raw disk I/O 2 succeeded" ) ;
238
- bt. close_event ( event) . unwrap ( ) ;
239
241
bt. free_pool ( buf) . unwrap ( ) ;
240
242
}
241
243
0 commit comments