@@ -100,11 +100,6 @@ pub const ChildProcess = struct {
100100 Close ,
101101 };
102102
103- pub const PipeDirection = enum {
104- parent_to_child ,
105- child_to_parent ,
106- };
107-
108103 /// First argument in argv is the executable.
109104 pub fn init (argv : []const []const u8 , allocator : mem.Allocator ) ChildProcess {
110105 return .{
@@ -934,9 +929,6 @@ pub const ChildProcess = struct {
934929 const cmd_line = try windowsCreateCommandLine (self .allocator , self .argv );
935930 defer self .allocator .free (cmd_line );
936931
937- // TODO use explicit list of file handles
938- // https://devblogs.microsoft.com/oldnewthing/20111216-00/?p=8873
939-
940932 var siStartInfo = windows.STARTUPINFOW {
941933 .cb = @sizeOf (windows .STARTUPINFOW ),
942934 .hStdError = g_hChildStd_ERR_Wr ,
@@ -1118,7 +1110,7 @@ pub const ChildProcess = struct {
11181110
11191111const PortPipeT = if (builtin .os .tag == .windows ) [2 ]windows .HANDLE else [2 ]os .fd_t ;
11201112
1121- /// Portable pipe creation without handle inheritance
1113+ /// Portable pipe creation with disabled inheritance
11221114pub inline fn portablePipe () ! PortPipeT {
11231115 // TODO think how to offer user an interface to lpSecurityDescriptor
11241116 var pipe_new : PortPipeT = undefined ;
@@ -1383,7 +1375,7 @@ fn windowsCreateProcess(app_name: [*:0]u16, cmd_line: [*:0]u16, envp_ptr: ?[*]u1
13831375 null ,
13841376 null ,
13851377 windows .TRUE ,
1386- windows .CREATE_UNICODE_ENVIRONMENT ,
1378+ windows .PROCESS_CREATION_FLAGS . CREATE_UNICODE_ENVIRONMENT ,
13871379 @ptrCast (? * anyopaque , envp_ptr ),
13881380 cwd_ptr ,
13891381 lpStartupInfo ,
@@ -1507,10 +1499,8 @@ fn windowsMakePipeIn(rd: *?windows.HANDLE, wr: *?windows.HANDLE, sattr: *const w
15071499
15081500var pipe_name_counter = std .atomic .Atomic (u32 ).init (1 );
15091501
1510- /// Create asynchronous pipe.
1511- /// To enable inheritance between parent and child process, set bInheritHandle = windows.TRUE
1512- /// in the security attributes.
1513- /// Direction defines which handle is updated (to enable inheritance by ChildProcess)
1502+ /// To enable/disable inheritance parent and child process, use
1503+ /// os.enableInheritance() and os.disableInheritance() on the handle.
15141504pub fn windowsMakeAsyncPipe (
15151505 rd : * windows.HANDLE ,
15161506 wr : * windows.HANDLE ,
0 commit comments