@@ -10,30 +10,42 @@ use super::device_path::DevicePathProtocol;
10
10
use super :: file_system:: FileInfo ;
11
11
use super :: shell_params:: ShellFileHandle ;
12
12
13
+ use bitflags:: bitflags;
14
+
13
15
/// List Entry for File Lists
14
16
#[ derive( Debug ) ]
15
17
#[ repr( C ) ]
16
- pub struct ListEntry < ' a > {
17
- pub f_link : * mut ListEntry < ' a > ,
18
- pub b_link : * mut ListEntry < ' a > ,
18
+ pub struct ListEntry {
19
+ pub f_link : * mut ListEntry ,
20
+ pub b_link : * mut ListEntry ,
19
21
}
20
22
21
23
/// ShellFileInfo for File Lists
22
24
#[ derive( Debug ) ]
23
25
#[ repr( C ) ]
24
- pub struct ShellFileInfo < ' a > {
25
- pub link : ListEntry < ' a > ,
26
+ pub struct ShellFileInfo {
27
+ pub link : ListEntry ,
26
28
pub status : Status ,
27
29
pub full_name : * mut Char16 ,
28
30
pub file_name : * mut Char16 ,
29
- pub shell_file_handle : Handle ,
30
- pub file_info : FileInfo ,
31
+ pub handle : ShellFileHandle ,
32
+ pub info : FileInfo ,
31
33
}
32
34
33
35
/// Used to specify where component names should be taken from
34
36
pub type ShellDeviceNameFlags = u32 ;
35
- pub const DEVICE_NAME_USE_COMPONENT_NAME : u32 = 0x0000001 ;
36
- pub const DEVICE_NAME_USE_DEVICE_PATH : u32 = 0x0000002 ;
37
+
38
+ bitflags ! {
39
+ /// Specifies the source of the component name
40
+ #[ repr( transparent) ]
41
+ #[ derive( Clone , Copy , Debug , Default , PartialEq , Eq , PartialOrd , Ord ) ]
42
+ pub struct DeviceName : u32 {
43
+ /// Use Component Name
44
+ const DEVICE_NAME_USE_COMPONENT_NAME = 0x0000001 ;
45
+ /// Use Device Path
46
+ const DEVICE_NAME_USE_DEVICE_PATH = 0x0000002 ;
47
+ }
48
+ }
37
49
38
50
/// Shell Protocol
39
51
#[ derive( Debug ) ]
@@ -64,23 +76,23 @@ pub struct ShellProtocol {
64
76
help_text : * mut * mut Char16 ,
65
77
) -> Status ,
66
78
pub get_device_path_from_map :
67
- unsafe extern "efiapi" fn ( mapping : * const Char16 ) -> DevicePathProtocol ,
79
+ unsafe extern "efiapi" fn ( mapping : * const Char16 ) -> * const DevicePathProtocol ,
68
80
pub get_map_from_device_path :
69
81
unsafe extern "efiapi" fn ( device_path : * mut * mut DevicePathProtocol ) -> * const Char16 ,
70
82
pub get_device_path_from_file_path :
71
- unsafe extern "efiapi" fn ( path : * const Char16 ) -> DevicePathProtocol ,
83
+ unsafe extern "efiapi" fn ( path : * const Char16 ) -> * const DevicePathProtocol ,
72
84
pub get_file_path_from_device_path :
73
85
unsafe extern "efiapi" fn ( path : * const DevicePathProtocol ) -> * const Char16 ,
74
86
pub set_map : unsafe extern "efiapi" fn (
75
- device_path : DevicePathProtocol ,
87
+ device_path : * const DevicePathProtocol ,
76
88
mapping : * const Char16 ,
77
89
) -> Status ,
78
90
79
91
pub get_cur_dir : unsafe extern "efiapi" fn ( file_system_mapping : * const Char16 ) -> * const Char16 ,
80
92
pub set_cur_dir :
81
93
unsafe extern "efiapi" fn ( file_system : * const Char16 , dir : * const Char16 ) -> Status ,
82
94
pub open_file_list : unsafe extern "efiapi" fn (
83
- path : Char16 ,
95
+ path : * const Char16 ,
84
96
open_mode : u64 ,
85
97
file_list : * mut * mut ShellFileInfo ,
86
98
) -> Status ,
@@ -100,7 +112,7 @@ pub struct ShellProtocol {
100
112
best_device_name : * mut * mut Char16 ,
101
113
) -> Status ,
102
114
103
- pub get_file_info : unsafe extern "efiapi" fn ( file_handle : ShellFileHandle ) -> FileInfo ,
115
+ pub get_file_info : unsafe extern "efiapi" fn ( file_handle : ShellFileHandle ) -> * const FileInfo ,
104
116
pub set_file_info : unsafe extern "efiapi" fn (
105
117
file_handle : ShellFileHandle ,
106
118
file_info : * const FileInfo ,
@@ -126,7 +138,7 @@ pub struct ShellProtocol {
126
138
buffer_size : * mut usize ,
127
139
buffer : * mut c_void ,
128
140
) -> Status ,
129
- pub delete_file : unsafe extern "efiapi" fn ( file_name : * const Char16 ) -> Status ,
141
+ pub delete_file : unsafe extern "efiapi" fn ( file_handle : ShellFileHandle ) -> Status ,
130
142
pub delete_file_by_name : unsafe extern "efiapi" fn ( file_name : * const Char16 ) -> Status ,
131
143
pub get_file_position :
132
144
unsafe extern "efiapi" fn ( file_handle : ShellFileHandle , position : * mut u64 ) -> Status ,
0 commit comments