From bad73efd4e199c617ff4a3f14629d49f6c0977cb Mon Sep 17 00:00:00 2001 From: Thomas Faber Date: Sat, 7 Nov 2015 08:49:15 +0000 Subject: [PATCH] [WS2_32_NEW] - Treat SO_OPENTYPE's value as a DWORD. Based on a patch by Peter Hater. CORE-10440 svn path=/trunk/; revision=69824 --- reactos/dll/win32/ws2_32_new/src/sockctrl.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/reactos/dll/win32/ws2_32_new/src/sockctrl.c b/reactos/dll/win32/ws2_32_new/src/sockctrl.c index a5c4581fc65..44e527cf6da 100644 --- a/reactos/dll/win32/ws2_32_new/src/sockctrl.c +++ b/reactos/dll/win32/ws2_32_new/src/sockctrl.c @@ -275,7 +275,7 @@ getsockopt(IN SOCKET s, Status = ERROR_SUCCESS; _SEH2_TRY { - if (!(optlen) || (*optlen < sizeof(INT))) + if (!(optlen) || (*optlen < sizeof(DWORD))) { /* Fail */ Status = SOCKET_ERROR; @@ -284,8 +284,8 @@ getsockopt(IN SOCKET s, } /* Set the open type */ - *optval = (CHAR)Thread->OpenType; - *optlen = sizeof(INT); + *(DWORD*)optval = Thread->OpenType; + *optlen = sizeof(DWORD); } _SEH2_EXCEPT(EXCEPTION_EXECUTE_HANDLER) { @@ -419,7 +419,7 @@ setsockopt(IN SOCKET s, if (level == SOL_SOCKET && optname == SO_OPENTYPE) { /* Validate size */ - if (optlen < sizeof(INT)) + if (optlen < sizeof(DWORD)) { /* Fail */ SetLastError(WSAEFAULT); @@ -430,7 +430,7 @@ setsockopt(IN SOCKET s, Status = ERROR_SUCCESS; _SEH2_TRY { - Thread->OpenType = *optval; + Thread->OpenType = *(DWORD*)optval; } _SEH2_EXCEPT(EXCEPTION_EXECUTE_HANDLER) {