This commit implements `fd_fdstat_set_flags` for Windows. Additionally, it fixes a problem where `O_APPEND` was not working correctly because `GENERIC_WRITE` was always being set; as a result, `FILE_WRITE_DATA` could not be removed from the permission set to properly enable append-only mode. It also treats `O_TRUNC` with `O_APPEND` as an invalid argument error. This is because Windows cannot support these two flags together. To support `O_TRUNC`, the `GENERIC_WRITE` bit must be set for the file access flags. Setting this bit will cause `FILE_WRITE_DATA` to be set, which will not properly treat the file as append-only (it requires `FILE_APPEND_DATA` without `FILE_WRITE_DATA`).
This is the test-programs crate, which builds and runs whole programs
compiled to wasm32-wasi.