Fix os.read / os.read_entire_file

- DWORDs are NOT i32
- os.read didn't correctly read as much as it could
This commit is contained in:
Tetralux
2020-03-12 22:31:00 +00:00
parent e0a370f8f1
commit 1181d7cf90
3 changed files with 24 additions and 26 deletions
+2 -2
View File
@@ -58,8 +58,8 @@ foreign kernel32 {
creation, flags_and_attribs: u32, template_file: Handle) -> Handle ---;
@(link_name="ReadFile") read_file :: proc(h: Handle, buf: rawptr, to_read: u32, bytes_read: ^i32, overlapped: rawptr) -> Bool ---;
@(link_name="WriteFile") write_file :: proc(h: Handle, buf: rawptr, len: i32, written_result: ^i32, overlapped: rawptr) -> Bool ---;
@(link_name="ReadFile") read_file :: proc(h: Handle, buf: rawptr, to_read: u32, bytes_read: ^u32, overlapped: rawptr) -> Bool ---;
@(link_name="WriteFile") write_file :: proc(h: Handle, buf: rawptr, len: u32, written_result: ^u32, overlapped: rawptr) -> Bool ---;
@(link_name="GetFileSizeEx") get_file_size_ex :: proc(file_handle: Handle, file_size: ^i64) -> Bool ---;
@(link_name="GetFileInformationByHandle") get_file_information_by_handle :: proc(file_handle: Handle, file_info: ^By_Handle_File_Information) -> Bool ---;