hle(host_posix): completion ports are unimplemented, so an overlapped read reports nowhere #620
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Imported from LakshanSivakumar/Native-Victory-macOS. Originally posted by AnastasisKon on 2026-11-28T15:40:32Z.
Summary
The three calls a title uses to stream files asynchronously were unimplemented in
host_posix/files.rs:CreateIoCompletionPort,GetQueuedCompletionStatusandPostQueuedCompletionStatusall landed in the loader's import stub. A title that reads its archives with overlapped I/O and waits on a port would get nothing back from the port, which is a stall rather than an error.The hazard in adding the port alone is the opposite one: a title whose port never receives a packet waits forever, so the packets have to come from the I/O the title already issues.
What the change does
CreateIoCompletionPort: a port, or a file handle associated with one and a key (the same port handle comes back, as Windows does).PostQueuedCompletionStatus: a packet of the caller's own making, which is how a title tells a worker to stop.GetQueuedCompletionStatus: waits up to its timeout, thenERROR_TIMEOUT; hands back the byte count, the key and the title'sOVERLAPPED.GetQueuedCompletionStatusEx: everything already finished in one call, fillingOVERLAPPED_ENTRYs.STATUS_END_OF_FILE, which the call reports as a failure withERROR_HANDLE_EOF, as Windows does.OVERLAPPED's event is set as before, which a title waiting on a port never notices. A file with no port posts nothing.Tests
Three new ones in
files.rs: a posted packet comes back with its key, count andOVERLAPPED, and an empty port times out; a file associated with a port reports an overlapped read there, and its end-of-file read posts a failure; a file with no port posts nothing, and the batch form drains two packets in one call.Why it matters
A streaming title gets its completions instead of waiting on a port that never has any, and the diagnostics take the same path as a real run.
Imported from LakshanSivakumar/Native-Victory-macOS. Originally posted by AnastasisKon on 2026-11-28T15:40:37Z.
/claim
Imported from LakshanSivakumar/Native-Victory-macOS. Originally posted by github-actions[bot] on 2026-11-28T15:40:47Z.
Claimed by @AnastasisKon. Open a draft pull request with
Refs #620in its description within 24 hours, or the claim expires.Imported from LakshanSivakumar/Native-Victory-macOS. Originally posted by AnastasisKon on 2026-11-28T16:31:43Z.
Merged with the PR that serves these calls; closing.