From 7d5052896df794ec6c15bedcf7fe54144b5e301c Mon Sep 17 00:00:00 2001 From: iwubcode Date: Thu, 4 Mar 2021 13:53:42 -0600 Subject: [PATCH] IOS: update network/ip/top to use the RAII winsock context --- Source/Core/Core/IOS/Network/IP/Top.cpp | 11 ----------- Source/Core/Core/IOS/Network/IP/Top.h | 6 ++---- 2 files changed, 2 insertions(+), 15 deletions(-) diff --git a/Source/Core/Core/IOS/Network/IP/Top.cpp b/Source/Core/Core/IOS/Network/IP/Top.cpp index 88a91d7a02..c34e938e27 100644 --- a/Source/Core/Core/IOS/Network/IP/Top.cpp +++ b/Source/Core/Core/IOS/Network/IP/Top.cpp @@ -65,17 +65,6 @@ enum SOResultCode : s32 NetIPTopDevice::NetIPTopDevice(Kernel& ios, const std::string& device_name) : Device(ios, device_name) { -#ifdef _WIN32 - const int ret = WSAStartup(MAKEWORD(2, 2), &InitData); - INFO_LOG_FMT(IOS_NET, "WSAStartup: {}", ret); -#endif -} - -NetIPTopDevice::~NetIPTopDevice() -{ -#ifdef _WIN32 - WSACleanup(); -#endif } void NetIPTopDevice::DoState(PointerWrap& p) diff --git a/Source/Core/Core/IOS/Network/IP/Top.h b/Source/Core/Core/IOS/Network/IP/Top.h index d87885d165..3e78ea2b06 100644 --- a/Source/Core/Core/IOS/Network/IP/Top.h +++ b/Source/Core/Core/IOS/Network/IP/Top.h @@ -7,6 +7,7 @@ #include #include "Common/CommonTypes.h" +#include "Common/SocketContext.h" #include "Core/IOS/Device.h" #ifdef _WIN32 @@ -65,7 +66,6 @@ class NetIPTopDevice : public Device { public: NetIPTopDevice(Kernel& ios, const std::string& device_name); - virtual ~NetIPTopDevice(); void DoState(PointerWrap& p) override; std::optional IOCtl(const IOCtlRequest& request) override; @@ -99,8 +99,6 @@ private: IPCReply HandleGetAddressInfoRequest(const IOCtlVRequest& request); IPCReply HandleICMPPingRequest(const IOCtlVRequest& request); -#ifdef _WIN32 - WSADATA InitData; -#endif + Common::SocketContext m_socket_context; }; } // namespace IOS::HLE