13 #ifndef __STOUT_OS_WINDOWS_DUP_HPP__ 14 #define __STOUT_OS_WINDOWS_DUP_HPP__ 29 HANDLE duplicate = INVALID_HANDLE_VALUE;
30 const BOOL result = ::DuplicateHandle(
31 ::GetCurrentProcess(),
33 ::GetCurrentProcess(),
37 DUPLICATE_SAME_ACCESS);
39 if (result == FALSE) {
48 WSAPROTOCOL_INFOW info;
50 ::WSADuplicateSocketW(fd, ::GetCurrentProcessId(), &info);
55 SOCKET duplicate = ::WSASocketW(0, 0, 0, &info, 0, 0);
56 if (duplicate == INVALID_SOCKET) {
71 #endif // __STOUT_OS_WINDOWS_DUP_HPP__ SOCKET socket_
Definition: fd.hpp:242
Definition: error.hpp:123
Definition: error.hpp:108
Definition: posix_signalhandler.hpp:23
ErrnoError SocketError
Definition: error.hpp:33
constexpr Handle HANDLE
Definition: ingress.hpp:37
#define UNREACHABLE()
Definition: unreachable.hpp:22
int int_fd
Definition: int_fd.hpp:35
Try< int > dup(int fd)
Definition: dup.hpp:23
HANDLE handle_
Definition: fd.hpp:241