Implement Windows file read, write, and delete APIs.
This also improves how HANDLEs are, well, handled a bit. STDIN/ERR/OUT are now proper pseudo-handles. The invalid handle is added and encode/decodes to exactly 0xFFFFFFFF correctly.
Unix shims require changes to hoist FdTable up, so that Windows can share most of its implementation.
Thanks for the PR!
This is a huge PR. It will take a while until I have enough time to take a look at such a big change. If there is any way to stage this as a series of smaller changes, that would be much appreciated.
I could possibly further split this down by first PRing the FdMap move, and the handle changes, as their own PRs. In that format, both of those would basically be refactors with no/minimal functional changes, then this PR would just add the shims. It would still be a good bit of stuff, just because even a minimal test needs 4 or 5 shims, but it would be notably smaller hopefully.
That sounds like a good plan. You can keep this PR open (maybe mark it as draft); it can serve as good context for why you want to refactor things the way you suggest.
Also, I know very little about the Windows API... @ChrisDenton @beepster4096 if you have any chance at taking a look at the windows-specific parts here and check whether they look sensible, that would be great. :)
@sivadeilra - here's one of the PRs related to adding Miri support for Windows FS APIs, RE: https://github.com/rust-lang/miri/issues/3482
:umbrella: The latest upstream changes (presumably #4046) made this pull request unmergeable. Please resolve the merge conflicts.
Rebased on top of #4045
:umbrella: The latest upstream changes (presumably #4045) made this pull request unmergeable. Please resolve the merge conflicts.
:umbrella: The latest upstream changes (possibly 887b4984e2ec4690afb6aa2c3f31408b570033ca) made this pull request unmergeable. Please resolve the merge conflicts.
All parts of this PR are either merged, in PR, or ready to PR soon. I'm going to close it.