Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ internal static unsafe SocketError WSARecvFrom(

internal static unsafe SocketError WSARecvFrom(
SafeHandle socketHandle,
WSABuffer[] buffers,
ReadOnlySpan<WSABuffer> buffers,
int bufferCount,
out int bytesTransferred,
ref SocketFlags socketFlags,
Expand All @@ -53,7 +53,7 @@ internal static unsafe SocketError WSARecvFrom(
IntPtr completionRoutine)
{
Debug.Assert(buffers != null && buffers.Length > 0);
fixed (WSABuffer* buffersPtr = &buffers[0])
fixed (WSABuffer* buffersPtr = &MemoryMarshal.GetReference(buffers))
{
return WSARecvFrom(socketHandle, buffersPtr, bufferCount, out bytesTransferred, ref socketFlags, socketAddressPointer, socketAddressSizePointer, overlapped, completionRoutine);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ internal static unsafe SocketError WSASendTo(

internal static unsafe SocketError WSASendTo(
SafeHandle socketHandle,
WSABuffer[] buffers,
ReadOnlySpan<WSABuffer> buffers,
int bufferCount,
[Out] out int bytesTransferred,
SocketFlags socketFlags,
Expand All @@ -53,7 +53,7 @@ internal static unsafe SocketError WSASendTo(
IntPtr completionRoutine)
{
Debug.Assert(buffers != null && buffers.Length > 0);
fixed (WSABuffer* buffersPtr = &buffers[0])
fixed (WSABuffer* buffersPtr = &MemoryMarshal.GetReference(buffers))
{
return WSASendTo(socketHandle, buffersPtr, bufferCount, out bytesTransferred, socketFlags, socketAddress, socketAddressSize, overlapped, completionRoutine);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -303,8 +303,8 @@ public async Task NetworkInterface_LoopbackInterfaceIndex_MatchesReceivedPackets
}

Assert.Equal(
(await receivedTask).PacketInformation.Interface,
ipv6 ? NetworkInterface.IPv6LoopbackInterfaceIndex : NetworkInterface.LoopbackInterfaceIndex);
ipv6 ? NetworkInterface.IPv6LoopbackInterfaceIndex : NetworkInterface.LoopbackInterfaceIndex,
(await receivedTask).PacketInformation.Interface);
}
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -287,9 +287,9 @@
<Reference Include="System.Threading" />
<Reference Include="System.Threading.Overlapped" />
<Reference Include="System.Threading.ThreadPool" />
<Reference Include="System.Runtime.CompilerServices.Unsafe" />
</ItemGroup>
<ItemGroup Condition="'$(TargetsUnix)' == 'true'">
<Reference Include="System.Threading.Thread" />
<Reference Include="System.Runtime.CompilerServices.Unsafe" />
</ItemGroup>
</Project>
Original file line number Diff line number Diff line change
Expand Up @@ -146,7 +146,7 @@ internal unsafe delegate bool DisconnectExDelegate(
[UnmanagedFunctionPointer(CallingConvention.StdCall, SetLastError = true)]
internal unsafe delegate SocketError WSARecvMsgDelegate(
SafeSocketHandle socketHandle,
IntPtr msg,
Interop.Winsock.WSAMsg* msg,
out int bytesTransferred,
NativeOverlapped* overlapped,
IntPtr completionRoutine);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -251,14 +251,14 @@ internal unsafe bool ConnectEx(SafeSocketHandle socketHandle,
return connectEx(socketHandle, socketAddress, socketAddressSize, buffer, dataLength, out bytesSent, overlapped);
}

internal unsafe SocketError WSARecvMsg(SafeSocketHandle socketHandle, IntPtr msg, out int bytesTransferred, NativeOverlapped* overlapped, IntPtr completionRoutine)
internal unsafe SocketError WSARecvMsg(SafeSocketHandle socketHandle, Interop.Winsock.WSAMsg* msg, out int bytesTransferred, NativeOverlapped* overlapped, IntPtr completionRoutine)
{
WSARecvMsgDelegate recvMsg = GetDynamicWinsockMethods().GetWSARecvMsgDelegate(socketHandle);

return recvMsg(socketHandle, msg, out bytesTransferred, overlapped, completionRoutine);
}

internal unsafe SocketError WSARecvMsgBlocking(SafeSocketHandle socketHandle, IntPtr msg, out int bytesTransferred)
internal unsafe SocketError WSARecvMsgBlocking(SafeSocketHandle socketHandle, Interop.Winsock.WSAMsg* msg, out int bytesTransferred)
{
WSARecvMsgDelegate recvMsg = GetDynamicWinsockMethods().GetWSARecvMsgDelegate(_handle);

Expand Down
Loading