miri icon indicating copy to clipboard operation
miri copied to clipboard

Implement Windows file read, write, and delete APIs.

Open CraftSpider opened this issue 1 year ago • 9 comments

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.

CraftSpider avatar Nov 21 '24 06:11 CraftSpider

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.

RalfJung avatar Nov 21 '24 06:11 RalfJung

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.

CraftSpider avatar Nov 21 '24 07:11 CraftSpider

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.

RalfJung avatar Nov 21 '24 07:11 RalfJung

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. :)

RalfJung avatar Nov 21 '24 07:11 RalfJung

@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

cgettys-microsoft avatar Nov 21 '24 21:11 cgettys-microsoft

:umbrella: The latest upstream changes (presumably #4046) made this pull request unmergeable. Please resolve the merge conflicts.

bors avatar Nov 21 '24 22:11 bors

Rebased on top of #4045

CraftSpider avatar Dec 01 '24 20:12 CraftSpider

:umbrella: The latest upstream changes (presumably #4045) made this pull request unmergeable. Please resolve the merge conflicts.

bors avatar Dec 01 '24 22:12 bors

:umbrella: The latest upstream changes (possibly 887b4984e2ec4690afb6aa2c3f31408b570033ca) made this pull request unmergeable. Please resolve the merge conflicts.

rustbot avatar Dec 29 '24 09:12 rustbot

All parts of this PR are either merged, in PR, or ready to PR soon. I'm going to close it.

CraftSpider avatar Apr 11 '25 04:04 CraftSpider