1
1
//! `LoadedImage` protocol.
2
2
3
3
use crate :: {
4
- data_types:: FromSliceWithNulError , proto:: Protocol , table:: boot:: MemoryType , unsafe_guid,
5
- CStr16 , Handle , Status ,
4
+ data_types:: FromSliceWithNulError ,
5
+ proto:: { device_path:: DevicePath , Protocol } ,
6
+ table:: boot:: MemoryType ,
7
+ unsafe_guid, CStr16 , Handle , Status ,
6
8
} ;
7
9
use core:: { ffi:: c_void, mem, slice} ;
8
10
@@ -17,7 +19,7 @@ pub struct LoadedImage {
17
19
18
20
// Source location of the image
19
21
device_handle : Handle ,
20
- _file_path : * const c_void , // TODO: not supported yet
22
+ file_path : * const DevicePath ,
21
23
_reserved : * const c_void ,
22
24
23
25
// Image load options
@@ -53,6 +55,14 @@ impl LoadedImage {
53
55
self . device_handle
54
56
}
55
57
58
+ /// Get a reference to the `file_path`.
59
+ ///
60
+ /// Return `None` if the pointer to the file path portion specific to
61
+ /// DeviceHandle that the EFI Image was loaded from is null.
62
+ pub fn file_path ( & self ) -> Option < & DevicePath > {
63
+ unsafe { self . file_path . as_ref ( ) }
64
+ }
65
+
56
66
/// Get the load options of the image as a [`&CStr16`].
57
67
///
58
68
/// Load options are typically used to pass command-line options as
0 commit comments