IOS: update network/ip/top to use the RAII winsock context

This commit is contained in:
iwubcode 2021-03-04 13:53:42 -06:00
parent e4f74bea42
commit 7d5052896d
2 changed files with 2 additions and 15 deletions

View File

@ -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)

View File

@ -7,6 +7,7 @@
#include <string>
#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<IPCReply> 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