Author: tfaber Date: Sat Nov 7 08:49:15 2015 New Revision: 69824
URL: http://svn.reactos.org/svn/reactos?rev=69824&view=rev Log: [WS2_32_NEW] - Treat SO_OPENTYPE's value as a DWORD. Based on a patch by Peter Hater. CORE-10440
Modified: trunk/reactos/dll/win32/ws2_32_new/src/sockctrl.c
Modified: trunk/reactos/dll/win32/ws2_32_new/src/sockctrl.c URL: http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/ws2_32_new/src/so... ============================================================================== --- trunk/reactos/dll/win32/ws2_32_new/src/sockctrl.c [iso-8859-1] (original) +++ trunk/reactos/dll/win32/ws2_32_new/src/sockctrl.c [iso-8859-1] Sat Nov 7 08:49:15 2015 @@ -275,7 +275,7 @@ Status = ERROR_SUCCESS; _SEH2_TRY { - if (!(optlen) || (*optlen < sizeof(INT))) + if (!(optlen) || (*optlen < sizeof(DWORD))) { /* Fail */ Status = SOCKET_ERROR; @@ -284,8 +284,8 @@ }
/* 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 @@ if (level == SOL_SOCKET && optname == SO_OPENTYPE) { /* Validate size */ - if (optlen < sizeof(INT)) + if (optlen < sizeof(DWORD)) { /* Fail */ SetLastError(WSAEFAULT); @@ -430,7 +430,7 @@ Status = ERROR_SUCCESS; _SEH2_TRY { - Thread->OpenType = *optval; + Thread->OpenType = *(DWORD*)optval; } _SEH2_EXCEPT(EXCEPTION_EXECUTE_HANDLER) {