Fix Overlapped I/O by boxing OVERLAPPED struct and accept overlapped arg positionally by youknowone · Pull Request #7198 · RustPython/RustPython
…arg positionally Two fixes in _winapi: 1. Box the OVERLAPPED struct in OverlappedInner to ensure it stays at a stable heap address. Previously, into_pyobject() moved the struct after ReadFile/WriteFile had given the OS a pointer to it, causing GetOverlappedResult to read stale data (returning err=0 instead of ERROR_MORE_DATA for zero-byte reads on message pipes). 2. Change ReadFile, WriteFile, ConnectNamedPipe overlapped parameter from #[pyarg(named)] to #[pyarg(any)] so it can be passed both positionally and as keyword argument.
marked this pull request as ready for review
youknowone added a commit to youknowone/RustPython that referenced this pull request
…arg positionally (RustPython#7198) Two fixes in _winapi: 1. Box the OVERLAPPED struct in OverlappedInner to ensure it stays at a stable heap address. Previously, into_pyobject() moved the struct after ReadFile/WriteFile had given the OS a pointer to it, causing GetOverlappedResult to read stale data (returning err=0 instead of ERROR_MORE_DATA for zero-byte reads on message pipes). 2. Change ReadFile, WriteFile, ConnectNamedPipe overlapped parameter from #[pyarg(named)] to #[pyarg(any)] so it can be passed both positionally and as keyword argument.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters