13 #ifndef __STOUT_OS_WINDOWS_PIPE_HPP__ 14 #define __STOUT_OS_WINDOWS_PIPE_HPP__ 36 bool read_overlapped =
true,
bool write_overlapped =
true)
38 const DWORD read_flags = read_overlapped ? FILE_FLAG_OVERLAPPED : 0;
39 const DWORD write_flags = write_overlapped ? FILE_FLAG_OVERLAPPED : 0;
48 CHECK_LE(name.size(), 255);
57 const HANDLE read_handle = ::CreateNamedPipeW(
59 PIPE_ACCESS_INBOUND | FILE_FLAG_FIRST_PIPE_INSTANCE | read_flags,
60 PIPE_TYPE_BYTE | PIPE_WAIT | PIPE_REJECT_REMOTE_CLIENTS,
67 if (read_handle == INVALID_HANDLE_VALUE) {
78 const HANDLE write_handle = ::CreateFileW(
84 FILE_ATTRIBUTE_NORMAL | write_flags,
88 if (write_handle == INVALID_HANDLE_VALUE) {
89 ::CloseHandle(read_handle);
93 return std::array<int_fd, 2>{
int_fd(read_handle, read_overlapped),
94 int_fd(write_handle, write_overlapped)};
99 #endif // __STOUT_OS_WINDOWS_PIPE_HPP__ Try< std::array< int, 2 > > pipe()
Definition: pipe.hpp:33
Definition: error.hpp:108
Definition: posix_signalhandler.hpp:23
static UUID random()
Definition: uuid.hpp:38
constexpr Handle HANDLE
Definition: ingress.hpp:37
std::string error(const std::string &msg, uint32_t code)
int int_fd
Definition: int_fd.hpp:35
constexpr const char * name
Definition: shell.hpp:41