IOS: update network/ip/top to use the RAII winsock context
This commit is contained in:
parent
e4f74bea42
commit
7d5052896d
|
@ -65,17 +65,6 @@ enum SOResultCode : s32
|
||||||
NetIPTopDevice::NetIPTopDevice(Kernel& ios, const std::string& device_name)
|
NetIPTopDevice::NetIPTopDevice(Kernel& ios, const std::string& device_name)
|
||||||
: Device(ios, 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)
|
void NetIPTopDevice::DoState(PointerWrap& p)
|
||||||
|
|
|
@ -7,6 +7,7 @@
|
||||||
#include <string>
|
#include <string>
|
||||||
|
|
||||||
#include "Common/CommonTypes.h"
|
#include "Common/CommonTypes.h"
|
||||||
|
#include "Common/SocketContext.h"
|
||||||
#include "Core/IOS/Device.h"
|
#include "Core/IOS/Device.h"
|
||||||
|
|
||||||
#ifdef _WIN32
|
#ifdef _WIN32
|
||||||
|
@ -65,7 +66,6 @@ class NetIPTopDevice : public Device
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
NetIPTopDevice(Kernel& ios, const std::string& device_name);
|
NetIPTopDevice(Kernel& ios, const std::string& device_name);
|
||||||
virtual ~NetIPTopDevice();
|
|
||||||
|
|
||||||
void DoState(PointerWrap& p) override;
|
void DoState(PointerWrap& p) override;
|
||||||
std::optional<IPCReply> IOCtl(const IOCtlRequest& request) override;
|
std::optional<IPCReply> IOCtl(const IOCtlRequest& request) override;
|
||||||
|
@ -99,8 +99,6 @@ private:
|
||||||
IPCReply HandleGetAddressInfoRequest(const IOCtlVRequest& request);
|
IPCReply HandleGetAddressInfoRequest(const IOCtlVRequest& request);
|
||||||
IPCReply HandleICMPPingRequest(const IOCtlVRequest& request);
|
IPCReply HandleICMPPingRequest(const IOCtlVRequest& request);
|
||||||
|
|
||||||
#ifdef _WIN32
|
Common::SocketContext m_socket_context;
|
||||||
WSADATA InitData;
|
|
||||||
#endif
|
|
||||||
};
|
};
|
||||||
} // namespace IOS::HLE
|
} // namespace IOS::HLE
|
||||||
|
|
Loading…
Reference in New Issue