Add enough Windows functionality to run WASI tutorial (#22)

* Add partial impl of determine_type_rights fn

* Add draft of fd_fdstat_get hostcall

* Add writev wrapper for writing IoVec in RawHandle

* Move IoVec and writev to separate helper crate

* Add Win error handling

Clean up closing and duplicating RawHandle

* Wrap Win file type result

* Add draft impl of fd_close and fd_read

* Refactor getting file access rights

* Remove winapi from the main Cargo.toml

* Add very rough draft of open_path (very incomplete)

* Clean up WinError with macro

* Ignore dir handle in openat if path absolute

* Decode oflags and advance open_path hostcall

* Clean up AccessRight and FlagsAndAttributes flags

* Implement path_get (without symlink expansion yet!)

* Add ShareMode and fix path_get for nested paths

* Add some error mappings between Win and WASI

* Clean up fdflags conversions

* Fix sharing violation when calling openat at '.'

* Apply Alex's fix of using ManuallyDrop instead forget

* Clean up

* Explicitly specify workspace to avoid comp errors at tests
This commit is contained in:
Jakub Konka
2019-06-28 02:10:15 +02:00
committed by Dan Gohman
parent 22c69f46f9
commit 7287767a3f
12 changed files with 1178 additions and 125 deletions

9
winx/Cargo.toml Normal file
View File

@@ -0,0 +1,9 @@
[package]
name = "winx"
version = "0.1.0"
authors = ["Jakub Konka <kubkon@jakubkonka.com>"]
edition = "2018"
[dependencies]
winapi = { version = "0.3", features = ["std", "errhandlingapi", "handleapi", "processthreadsapi", "securitybaseapi", "winbase", "winerror", "ws2def", "fileapi", "aclapi" ] }
bitflags = "1.0"