Commit cda8656
committed
Fix Overlapped I/O by boxing OVERLAPPED struct and accept overlapped 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.1 parent 7b866f6 commit cda8656
1 file changed
+19
-15
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
800 | 800 | | |
801 | 801 | | |
802 | 802 | | |
803 | | - | |
| 803 | + | |
| 804 | + | |
| 805 | + | |
| 806 | + | |
| 807 | + | |
804 | 808 | | |
805 | 809 | | |
806 | 810 | | |
| |||
833 | 837 | | |
834 | 838 | | |
835 | 839 | | |
836 | | - | |
| 840 | + | |
837 | 841 | | |
838 | 842 | | |
839 | 843 | | |
| |||
858 | 862 | | |
859 | 863 | | |
860 | 864 | | |
861 | | - | |
| 865 | + | |
862 | 866 | | |
863 | 867 | | |
864 | 868 | | |
| |||
913 | 917 | | |
914 | 918 | | |
915 | 919 | | |
916 | | - | |
| 920 | + | |
917 | 921 | | |
918 | 922 | | |
919 | 923 | | |
| |||
958 | 962 | | |
959 | 963 | | |
960 | 964 | | |
961 | | - | |
| 965 | + | |
962 | 966 | | |
963 | | - | |
| 967 | + | |
964 | 968 | | |
965 | 969 | | |
966 | 970 | | |
| |||
982 | 986 | | |
983 | 987 | | |
984 | 988 | | |
985 | | - | |
| 989 | + | |
986 | 990 | | |
987 | 991 | | |
988 | 992 | | |
| |||
1200 | 1204 | | |
1201 | 1205 | | |
1202 | 1206 | | |
1203 | | - | |
| 1207 | + | |
1204 | 1208 | | |
1205 | | - | |
| 1209 | + | |
1206 | 1210 | | |
1207 | | - | |
| 1211 | + | |
1208 | 1212 | | |
1209 | 1213 | | |
1210 | 1214 | | |
| |||
1233 | 1237 | | |
1234 | 1238 | | |
1235 | 1239 | | |
1236 | | - | |
| 1240 | + | |
1237 | 1241 | | |
1238 | 1242 | | |
1239 | 1243 | | |
| |||
1287 | 1291 | | |
1288 | 1292 | | |
1289 | 1293 | | |
1290 | | - | |
| 1294 | + | |
1291 | 1295 | | |
1292 | | - | |
| 1296 | + | |
1293 | 1297 | | |
1294 | | - | |
| 1298 | + | |
1295 | 1299 | | |
1296 | 1300 | | |
1297 | 1301 | | |
| |||
1319 | 1323 | | |
1320 | 1324 | | |
1321 | 1325 | | |
1322 | | - | |
| 1326 | + | |
1323 | 1327 | | |
1324 | 1328 | | |
1325 | 1329 | | |
| |||
0 commit comments