eden/fs/win/utils/Pipe.cpp
// Pipe constructor will either use security attr or the inherit flag.
// If the security attribute is nullptr it will create one and will use the
// inherit flag for it.
Pipe constructor will either use security attr or the inherit flag.
If the security attribute is nullptr it will create one and will use the
inherit flag for it.
Pipe constructor will either use security attr or the inherit flag . If the security attribute is nullptr it will create one and will use the inherit flag for it .
Pipe::Pipe(PSECURITY_ATTRIBUTES securityAttr, bool inherit) {
  auto sec = SECURITY_ATTRIBUTES();
  if (securityAttr == nullptr) {
    sec.nLength = sizeof(sec);
    sec.bInheritHandle = inherit;
    sec.lpSecurityDescriptor = nullptr;
    securityAttr = &sec;
  }
  if (!CreatePipe(&readHandle, &writeHandle, securityAttr, NULL)) {
    throw makeWin32ErrorExplicit(GetLastError(), "Failed to create a pipe");
  }
  XLOG(DBG5) << "Handle Created: Read: " << readHandle
             << " Write: " << writeHandle << std::endl;
}
Pipe :: Pipe ( PSECURITY_ATTRIBUTES securityAttr , bool inherit ) { auto sec = SECURITY_ATTRIBUTES ( ) ; if ( securityAttr == nullptr ) { sec . nLength = sizeof ( sec ) ; sec . bInheritHandle = inherit ; sec . lpSecurityDescriptor = nullptr ; securityAttr = & sec ; } if ( ! CreatePipe ( & readHandle , & writeHandle , securityAttr , NULL ) ) { throw makeWin32ErrorExplicit ( GetLastError ( ) , " " ) ; } XLOG ( DBG5 ) << " " << readHandle << " " << writeHandle << std :: endl ; }
Pipe constructor will either use security attr or the inherit flag.
Pipe constructor will either use security attr or the inherit flag .