From e1e6d2ba2cc83d9ab1a325793ce6e65f68af9806 Mon Sep 17 00:00:00 2001 From: Sepalani Date: Sat, 5 Dec 2015 18:57:41 +0100 Subject: [PATCH] WSAPoll: Fixed - invalid argument was supplied --- Source/Core/Core/IPC_HLE/WII_IPC_HLE_Device_net.cpp | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/Source/Core/Core/IPC_HLE/WII_IPC_HLE_Device_net.cpp b/Source/Core/Core/IPC_HLE/WII_IPC_HLE_Device_net.cpp index 8c1ddbeb4d..fa0e7f330f 100644 --- a/Source/Core/Core/IPC_HLE/WII_IPC_HLE_Device_net.cpp +++ b/Source/Core/Core/IPC_HLE/WII_IPC_HLE_Device_net.cpp @@ -49,6 +49,13 @@ typedef struct pollfd pollfd_t; #include #endif +// WSAPoll doesn't support POLLPRI and POLLWRBAND flags +#ifdef _WIN32 +#define UNSUPPORTED_WSAPOLL POLLPRI | POLLWRBAND +#else +#define UNSUPPORTED_WSAPOLL 0 +#endif + // ********************************************************************************** // Handle /dev/net/kd/request requests CWII_IPC_HLE_Device_net_kd_request::CWII_IPC_HLE_Device_net_kd_request(u32 _DeviceID, const std::string& _rDeviceName) @@ -1029,7 +1036,7 @@ IPCCommandResult CWII_IPC_HLE_Device_net_ip_top::IOCtl(u32 _CommandAddress) ); // Do not pass return-only events to the native poll - ufds[i].events &= ~(POLLERR | POLLHUP | POLLNVAL); + ufds[i].events &= ~(POLLERR | POLLHUP | POLLNVAL | UNSUPPORTED_WSAPOLL); if (unhandled_events) ERROR_LOG(WII_IPC_NET, "SO_POLL: unhandled Wii event types: %04x", unhandled_events);