Skip to content

Commit

Permalink
subprocess-win: update to mp_subprocess2
Browse files Browse the repository at this point in the history
This fixes the "run" and "subprocess" commands on Windows, including
youtube-dl support.

Unix-like FD inheritance is emulated on Windows by using an undocumented
data structure[1] that gets passed to the newly created process in
STARTUPINFO.lpReserved2. It consists of two sparse arrays listing the
HANDLE and internal CRT flags corresponding to each FD. This structure
is used and understood primarily by MSVCRT, but there are other runtimes
and frameworks that can write it, like libuv.

The code for creating asynchronous "anonymous" pipes in Windows has been
enhanced and moved into windows_utils.c. This is mainly an artifact of
an unfinished future change to support anonymous IPC clients in Windows.
Right now, it's still only used in subprocess-win.c

[1]: https://www.catch22.net/tuts/undocumented-createprocess
  • Loading branch information
rossy authored and wm4 committed Jul 20, 2020
1 parent 4476911 commit 83fec9b
Show file tree
Hide file tree
Showing 5 changed files with 399 additions and 141 deletions.
Loading

0 comments on commit 83fec9b

Please sign in to comment.