| 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 |
no test coverage detected