diff --git a/Libraries/LibCore/SocketpairWindows.cpp b/Libraries/LibCore/SocketpairWindows.cpp index 89e47dca2a..ee15529c16 100644 --- a/Libraries/LibCore/SocketpairWindows.cpp +++ b/Libraries/LibCore/SocketpairWindows.cpp @@ -76,7 +76,7 @@ int windows_socketpair(SOCKET socks[2], int make_overlapped) if (::listen(listener, 1) == SOCKET_ERROR) break; - socks[0] = WSASocket(AF_INET, SOCK_STREAM, 0, NULL, 0, flags); + socks[0] = WSASocketW(AF_INET, SOCK_STREAM, 0, NULL, 0, flags); if (socks[0] == INVALID_SOCKET) break; if (connect(socks[0], &a.addr, sizeof(a.inaddr)) == SOCKET_ERROR) diff --git a/Libraries/LibCore/SystemWindows.cpp b/Libraries/LibCore/SystemWindows.cpp index 30b242e5a9..519b6d63a9 100644 --- a/Libraries/LibCore/SystemWindows.cpp +++ b/Libraries/LibCore/SystemWindows.cpp @@ -213,10 +213,10 @@ ErrorOr dup(int handle) return Error::from_windows_error(ERROR_INVALID_HANDLE); } if (is_socket(handle)) { - WSAPROTOCOL_INFO pi = {}; - if (WSADuplicateSocket(handle, GetCurrentProcessId(), &pi)) + WSAPROTOCOL_INFOW pi = {}; + if (WSADuplicateSocketW(handle, GetCurrentProcessId(), &pi)) return Error::from_windows_error(); - SOCKET socket = WSASocket(AF_INET, SOCK_STREAM, IPPROTO_TCP, &pi, 0, WSA_FLAG_OVERLAPPED | WSA_FLAG_NO_HANDLE_INHERIT); + SOCKET socket = WSASocketW(AF_INET, SOCK_STREAM, IPPROTO_TCP, &pi, 0, WSA_FLAG_OVERLAPPED | WSA_FLAG_NO_HANDLE_INHERIT); if (socket == INVALID_SOCKET) return Error::from_windows_error(); return socket; diff --git a/Libraries/LibIPC/FileWindows.cpp b/Libraries/LibIPC/FileWindows.cpp index bbeba2a44d..c6ad278e42 100644 --- a/Libraries/LibIPC/FileWindows.cpp +++ b/Libraries/LibIPC/FileWindows.cpp @@ -69,9 +69,9 @@ ErrorOr decode(Decoder& decoder) if (handle_type == HandleType::Generic) { TRY(decoder.decode_into(handle)); } else if (handle_type == HandleType::Socket) { - WSAPROTOCOL_INFO pi = {}; + WSAPROTOCOL_INFOW pi = {}; TRY(decoder.decode_into({ reinterpret_cast(&pi), sizeof(pi) })); - handle = WSASocket(AF_INET, SOCK_STREAM, IPPROTO_TCP, &pi, 0, WSA_FLAG_OVERLAPPED | WSA_FLAG_NO_HANDLE_INHERIT); + handle = WSASocketW(AF_INET, SOCK_STREAM, IPPROTO_TCP, &pi, 0, WSA_FLAG_OVERLAPPED | WSA_FLAG_NO_HANDLE_INHERIT); if (handle == -1) return Error::from_windows_error(); } else { diff --git a/Libraries/LibIPC/MessageWindows.cpp b/Libraries/LibIPC/MessageWindows.cpp index 4d8487bb2c..3e79ae2f19 100644 --- a/Libraries/LibIPC/MessageWindows.cpp +++ b/Libraries/LibIPC/MessageWindows.cpp @@ -43,7 +43,7 @@ ErrorOr MessageBuffer::append_file_descriptor(int handle) // The handle will be duplicated and WSAPROTOCOL_INFO will be filled later in TransportSocketWindows::transfer. // It can't be duplicated here because it requires peer process pid, which only TransportSocketWindows knows about. - WSAPROTOCOL_INFO pi = {}; + WSAPROTOCOL_INFOW pi = {}; static_assert(sizeof(pi) >= sizeof(int)); ByteReader::store(reinterpret_cast(&pi), handle); TRY(m_data.try_append(reinterpret_cast(&pi), sizeof(pi))); diff --git a/Libraries/LibIPC/TransportSocketWindows.cpp b/Libraries/LibIPC/TransportSocketWindows.cpp index 73387d6f4a..9f95dfa58d 100644 --- a/Libraries/LibIPC/TransportSocketWindows.cpp +++ b/Libraries/LibIPC/TransportSocketWindows.cpp @@ -80,15 +80,15 @@ ErrorOr TransportSocketWindows::duplicate_handles(Bytes bytes, Vector(span.data()); - if (WSADuplicateSocket(handle, m_peer_pid, pi)) + auto* pi = reinterpret_cast(span.data()); + if (WSADuplicateSocketW(handle, m_peer_pid, pi)) return Error::from_windows_error(); } else { if (span.size() < sizeof(int)) diff --git a/Meta/CMake/common_compile_options.cmake b/Meta/CMake/common_compile_options.cmake index be0b19efd1..52d1300fc2 100644 --- a/Meta/CMake/common_compile_options.cmake +++ b/Meta/CMake/common_compile_options.cmake @@ -151,8 +151,6 @@ elseif (MSVC) add_cxx_compile_options(-Wno-unqualified-std-cast-call) add_cxx_compile_options(-Wno-c23-extensions) add_cxx_compile_options(-Wno-microsoft-unqualified-friend) # MSVC doesn't support unqualified friends - # FIXME: Stop using deprecated winsock functions - add_cxx_compile_definitions(_WINSOCK_DEPRECATED_NO_WARNINGS) add_cxx_compile_definitions(_CRT_SECURE_NO_WARNINGS) # _s replacements not desired (or implemented on any other platform other than VxWorks) add_cxx_compile_definitions(_CRT_NONSTDC_NO_WARNINGS) # POSIX names are just fine, thanks