| ... | ... | @@ -5,16 +5,16 @@ const Status = uefi.Status; |
| 5 | 5 | |
| 6 | 6 | pub const FileProtocol = extern struct { |
| 7 | 7 | revision: u64, |
| 8 | | _open: extern fn (*const FileProtocol, **const FileProtocol, *u16, u64, u64) Status, |
| 8 | _open: extern fn (*const FileProtocol, **const FileProtocol, [*:0]const u16, u64, u64) Status, |
| 9 | 9 | _close: extern fn (*const FileProtocol) Status, |
| 10 | 10 | _delete: extern fn (*const FileProtocol) Status, |
| 11 | | _read: extern fn (*const FileProtocol, *usize, *c_void) Status, |
| 12 | | _write: extern fn (*const FileProtocol, *usize, *c_void) Status, |
| 11 | _read: extern fn (*const FileProtocol, *usize, [*]u8) Status, |
| 12 | _write: extern fn (*const FileProtocol, *usize, [*]const u8) Status, |
| 13 | 13 | _get_info: extern fn (*const FileProtocol, *Guid, *usize, *c_void) Status, |
| 14 | | _set_info: extern fn (*const FileProtocol, *Guid, usize, *c_void) Status, |
| 14 | _set_info: extern fn (*const FileProtocol, *Guid, usize, *const c_void) Status, |
| 15 | 15 | _flush: extern fn (*const FileProtocol) Status, |
| 16 | 16 | |
| 17 | | pub fn open(self: *const FileProtocol, new_handle: **const FileProtocol, file_name: *u16, open_mode: u64, attributes: u64) Status { |
| 17 | pub fn open(self: *const FileProtocol, new_handle: **const FileProtocol, file_name: [*:0]const u16, open_mode: u64, attributes: u64) Status { |
| 18 | 18 | return self._open(self, new_handle, file_name, open_mode, attributes); |
| 19 | 19 | } |
| 20 | 20 | |
| ... | ... | @@ -26,11 +26,11 @@ pub const FileProtocol = extern struct { |
| 26 | 26 | return self._delete(self); |
| 27 | 27 | } |
| 28 | 28 | |
| 29 | | pub fn read(self: *const FileProtocol, buffer_size: *usize, buffer: *c_void) Status { |
| 29 | pub fn read(self: *const FileProtocol, buffer_size: *usize, buffer: [*]u8) Status { |
| 30 | 30 | return self._read(self, buffer_size, buffer); |
| 31 | 31 | } |
| 32 | 32 | |
| 33 | | pub fn write(self: *const FileProtocol, buffer_size: *usize, buffer: *c_void) Status { |
| 33 | pub fn write(self: *const FileProtocol, buffer_size: *usize, buffer: [*]const u8) Status { |
| 34 | 34 | return self._write(self, buffer_size, buffer); |
| 35 | 35 | } |
| 36 | 36 | |
| ... | ... | @@ -38,7 +38,7 @@ pub const FileProtocol = extern struct { |
| 38 | 38 | return self._get_info(self, information_type, buffer_size, buffer); |
| 39 | 39 | } |
| 40 | 40 | |
| 41 | | pub fn set_info(self: *const FileProtocol, information_type: *Guid, buffer_size: usize, buffer: *c_void) Status { |
| 41 | pub fn set_info(self: *const FileProtocol, information_type: *Guid, buffer_size: usize, buffer: *const c_void) Status { |
| 42 | 42 | return self._set_info(self, information_type, buffer_size, buffer); |
| 43 | 43 | } |
| 44 | 44 | |
| ... | ... | @@ -76,7 +76,10 @@ pub const FileInfo = extern struct { |
| 76 | 76 | last_access_time: Time, |
| 77 | 77 | modification_time: Time, |
| 78 | 78 | attribute: u64, |
| 79 | | file_name: [100:0]u16, |
| 79 | |
| 80 | pub fn getFileName(self: *const FileInfo) [*:0]const u16 { |
| 81 | return @ptrCast([*:0]const u16, @ptrCast([*]const u8, self) + @sizeOf(FileInfo)); |
| 82 | } |
| 80 | 83 | |
| 81 | 84 | pub const efi_file_read_only: u64 = 0x0000000000000001; |
| 82 | 85 | pub const efi_file_hidden: u64 = 0x0000000000000002; |