From 54914b780858d3ac8189013aae733f4c4acb05ff Mon Sep 17 00:00:00 2001 From: Geoff Kizer Date: Thu, 5 Jan 2017 18:54:41 -0800 Subject: [PATCH] revert handle change Commit migrated from https://github.com/dotnet/corefx/commit/dbcac6f4401e26b89c0cb7d12692447f4f3afbd9 --- .../src/System/Net/Sockets/DynamicWinsockMethods.cs | 2 +- .../src/System/Net/Sockets/Socket.Windows.cs | 2 +- .../src/System/Net/Sockets/SocketPal.Windows.cs | 6 +++--- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/src/libraries/System.Net.Sockets/src/System/Net/Sockets/DynamicWinsockMethods.cs b/src/libraries/System.Net.Sockets/src/System/Net/Sockets/DynamicWinsockMethods.cs index c810a85b685..6d18e46aaa4 100644 --- a/src/libraries/System.Net.Sockets/src/System/Net/Sockets/DynamicWinsockMethods.cs +++ b/src/libraries/System.Net.Sockets/src/System/Net/Sockets/DynamicWinsockMethods.cs @@ -312,7 +312,7 @@ private void EnsureTransmitPackets(SafeCloseSocket socketHandle) IntPtr completionRoutine); internal delegate SocketError WSARecvMsgDelegateBlocking( - SafeCloseSocket socketHandle, + IntPtr socketHandle, IntPtr msg, out int bytesTransferred, IntPtr overlapped, diff --git a/src/libraries/System.Net.Sockets/src/System/Net/Sockets/Socket.Windows.cs b/src/libraries/System.Net.Sockets/src/System/Net/Sockets/Socket.Windows.cs index 21bf76fe7a4..015c0b8b3a9 100644 --- a/src/libraries/System.Net.Sockets/src/System/Net/Sockets/Socket.Windows.cs +++ b/src/libraries/System.Net.Sockets/src/System/Net/Sockets/Socket.Windows.cs @@ -103,7 +103,7 @@ internal SocketError WSARecvMsg(SafeCloseSocket socketHandle, IntPtr msg, out in return recvMsg(socketHandle, msg, out bytesTransferred, overlapped, completionRoutine); } - internal SocketError WSARecvMsgBlocking(SafeCloseSocket socketHandle, IntPtr msg, out int bytesTransferred, IntPtr overlapped, IntPtr completionRoutine) + internal SocketError WSARecvMsgBlocking(IntPtr socketHandle, IntPtr msg, out int bytesTransferred, IntPtr overlapped, IntPtr completionRoutine) { EnsureDynamicWinsockMethods(); WSARecvMsgDelegateBlocking recvMsg_Blocking = _dynamicWinsockMethods.GetDelegate(_handle); diff --git a/src/libraries/System.Net.Sockets/src/System/Net/Sockets/SocketPal.Windows.cs b/src/libraries/System.Net.Sockets/src/System/Net/Sockets/SocketPal.Windows.cs index afadd140918..009a541edf4 100644 --- a/src/libraries/System.Net.Sockets/src/System/Net/Sockets/SocketPal.Windows.cs +++ b/src/libraries/System.Net.Sockets/src/System/Net/Sockets/SocketPal.Windows.cs @@ -379,7 +379,7 @@ public static unsafe SocketError ReceiveMessageFrom(Socket socket, SafeCloseSock wsaMsg.controlBuffer.Length = sizeof(Interop.Winsock.ControlData); if (socket.WSARecvMsgBlocking( - handle, + handle.DangerousGetHandle(), (IntPtr)(&wsaMsg), out bytesTransferred, IntPtr.Zero, @@ -397,7 +397,7 @@ public static unsafe SocketError ReceiveMessageFrom(Socket socket, SafeCloseSock wsaMsg.controlBuffer.Length = sizeof(Interop.Winsock.ControlDataIPv6); if (socket.WSARecvMsgBlocking( - handle, + handle.DangerousGetHandle(), (IntPtr)(&wsaMsg), out bytesTransferred, IntPtr.Zero, @@ -414,7 +414,7 @@ public static unsafe SocketError ReceiveMessageFrom(Socket socket, SafeCloseSock wsaMsg.controlBuffer.Length = 0; if (socket.WSARecvMsgBlocking( - handle, + handle.DangerousGetHandle(), (IntPtr)(&wsaMsg), out bytesTransferred, IntPtr.Zero, -- GitLab