MCPcopy Create free account
hub / github.com/arun11299/cpp-subprocess / configure_pipe

Function configure_pipe

cpp-subprocess/subprocess.hpp:418–434  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

416 }
417
418 inline void configure_pipe(HANDLE* read_handle, HANDLE* write_handle, HANDLE* child_handle)
419 {
420 SECURITY_ATTRIBUTES saAttr;
421
422 // Set the bInheritHandle flag so pipe handles are inherited.
423 saAttr.nLength = sizeof(SECURITY_ATTRIBUTES);
424 saAttr.bInheritHandle = TRUE;
425 saAttr.lpSecurityDescriptor = NULL;
426
427 // Create a pipe for the child process's STDIN.
428 if (!CreatePipe(read_handle, write_handle, &saAttr,0))
429 throw OSError("CreatePipe", 0);
430
431 // Ensure the write handle to the pipe for STDIN is not inherited.
432 if (!SetHandleInformation(*child_handle, HANDLE_FLAG_INHERIT, 0))
433 throw OSError("SetHandleInformation", 0);
434 }
435
436 // env_map_t MapFromWindowsEnvironment()
437 // * Imports current Environment in a C-string table

Callers 1

setup_comm_channelsMethod · 0.85

Calls 1

OSErrorClass · 0.85

Tested by

no test coverage detected