mio
mio copied to clipboard
Follow up to switch to windows-sys
Based on https://github.com/tokio-rs/mio/pull/1556, in particular this comment: https://github.com/tokio-rs/mio/pull/1556#pullrequestreview-920136232.
- [ ] Move the
SIO_BSP_*
constants, https://github.com/microsoft/win32metadata/issues/844. - [ ] Replace
Handle
withstd::os::windows::io::OwnedHandle
(once stable). - [ ] Remove the feature for
AF_INET(6)
constants, see https://github.com/microsoft/win32metadata/issues/845.
These fixes have now been published as part of the 0.35.0 release:
https://github.com/microsoft/windows-rs/releases/tag/0.35.0
This https://github.com/microsoft/windows-rs/pull/1636 might be a bit of problem, as Mio supports older rustc versions. Does windows-sys give any MSRV guarantees?
It's currently set to 1.56:
https://github.com/microsoft/windows-rs/blob/d3c2f2ca9385a0f03162e33da40dcc350678161d/.github/workflows/build.yml#L52
Previously it was set to 1.46.0, which should still work in theory but cargo doesn't like it when the version is older than what Rust 2021 supports.
This issue is now blocked on https://github.com/tokio-rs/mio/issues/1562.
0.36.0 has been released and reverts the Rust 2021 adoption meaning that windows-sys
is once again supported on Rust 1.46.
@Thomasdezeeuw in that case I think we should put this back on the table
Updating to 0.36 in https://github.com/tokio-rs/mio/pull/1569.
I couldn't find the SIO_BSP_*
constants although the linked issue is closed, have those been added @kennykerr?
I couldn't find the
SIO_BSP_*
constants although the linked issue is closed, have those been added?
Which one in particular? I see a bunch have been added.
Adding @riverar who may have further insights.
I couldn't find the
SIO_BSP_*
constants although the linked issue is closed, have those been added?Which one in particular? I see a bunch have been added.
I just realised GitHub doesn't have partial search, window-sys actually has all the constants Mio need. Sorry about that
After https://github.com/tokio-rs/mio/pull/1688 all that is left are some AFD related types and constants (see updated issue description), so looking pretty good.
Closing this as done, we can switch to using AFD constants from windows-sys if/when those become available, no point in keeping this open.
Happy to add those now; just need a pointer to what's missing/needed. Is it just the POLL_xxx
constants linked above?
Ah, I see the others. Will be interesting to get these into metadata, given they're undocumented/"private" structures.
//
// Structures for IOCTL_AFD_POLL.
//
typedef struct _AFD_POLL_HANDLE_INFO {
HANDLE Handle;
ULONG PollEvents;
NTSTATUS Status;
} AFD_POLL_HANDLE_INFO, *PAFD_POLL_HANDLE_INFO;
typedef struct _AFD_POLL_INFO {
LARGE_INTEGER Timeout;
ULONG NumberOfHandles;
BOOLEAN Unique;
AFD_POLL_HANDLE_INFO Handles[1];
} AFD_POLL_INFO, *PAFD_POLL_INFO;
Ah, I see the others. Will be interesting to get these into metadata, given they're undocumented/"private" structures.
I suspected as much. I'm happy to keep the definitions in Mio as well.