[PR #17566] Add helper functions for pipes #31270

Open
opened 2026-01-31 09:46:11 +00:00 by claunia · 0 comments
Owner

Original Pull Request: https://github.com/microsoft/terminal/pull/17566

State: closed
Merged: Yes


Split off from #17510:

  • HandleWantsOverlappedIo can be used to check if a handle requires
    overlapped IO. This is important, as ReadFile and WriteFile are
    documented to not work correctly if an overlapped handle is used
    without overlapped IO and vice versa.
    In my tests with pipes, this appears to be true.
  • CreatePipe creates a synchronous, unidirectional pipe.
  • CreateOverlappedPipe does what it says on the tin, while allowing
    you to specify the direction of the pipe (in, out, duplex).
  • GetOverlappedResultSameThread is largely the same as
    GetOverlappedResult, but adds back a neat optimization from
    the time before Windows 7. I thought it was neat.
**Original Pull Request:** https://github.com/microsoft/terminal/pull/17566 **State:** closed **Merged:** Yes --- Split off from #17510: * `HandleWantsOverlappedIo` can be used to check if a handle requires overlapped IO. This is important, as `ReadFile` and `WriteFile` are documented to not work correctly if an overlapped handle is used without overlapped IO and vice versa. In my tests with pipes, this appears to be true. * `CreatePipe` creates a synchronous, unidirectional pipe. * `CreateOverlappedPipe` does what it says on the tin, while allowing you to specify the direction of the pipe (in, out, duplex). * `GetOverlappedResultSameThread` is largely the same as `GetOverlappedResult`, but adds back a neat optimization from the time before Windows 7. I thought it was neat.
claunia added the pull-request label 2026-01-31 09:46:11 +00:00
Sign in to join this conversation.
No Label pull-request
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/terminal#31270