From c0a61a79190e32879d0a233d0320759309fc82bb Mon Sep 17 00:00:00 2001 From: Justin Kotalik Date: Mon, 10 Feb 2020 21:36:25 -0800 Subject: [PATCH] Use ref for stream event in System.Net.Quic (#32086) --- .../System.Net.Quic/src/Interop/MsQuicNativeMethods.cs | 2 +- .../Net/Quic/Implementations/MsQuic/MsQuicStream.cs | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/src/libraries/System.Net.Quic/src/Interop/MsQuicNativeMethods.cs b/src/libraries/System.Net.Quic/src/Interop/MsQuicNativeMethods.cs index 67f0cd92b6527..16c3f69e52976 100644 --- a/src/libraries/System.Net.Quic/src/Interop/MsQuicNativeMethods.cs +++ b/src/libraries/System.Net.Quic/src/Interop/MsQuicNativeMethods.cs @@ -435,7 +435,7 @@ internal struct SOCKADDR_INET internal delegate uint StreamCallbackDelegate( IntPtr stream, IntPtr context, - StreamEvent streamEvent); + ref StreamEvent streamEvent); internal delegate uint StreamOpenDelegate( IntPtr connection, diff --git a/src/libraries/System.Net.Quic/src/System/Net/Quic/Implementations/MsQuic/MsQuicStream.cs b/src/libraries/System.Net.Quic/src/System/Net/Quic/Implementations/MsQuic/MsQuicStream.cs index 4920bbd324eb6..520b5b0b5233a 100644 --- a/src/libraries/System.Net.Quic/src/System/Net/Quic/Implementations/MsQuic/MsQuicStream.cs +++ b/src/libraries/System.Net.Quic/src/System/Net/Quic/Implementations/MsQuic/MsQuicStream.cs @@ -487,14 +487,14 @@ private void EnableReceive() } internal static uint NativeCallbackHandler( - IntPtr stream, - IntPtr context, - StreamEvent connectionEventStruct) + IntPtr stream, + IntPtr context, + ref StreamEvent streamEvent) { var handle = GCHandle.FromIntPtr(context); var quicStream = (MsQuicStream)handle.Target; - return quicStream.HandleEvent(ref connectionEventStruct); + return quicStream.HandleEvent(ref streamEvent); } private uint HandleEvent(ref StreamEvent evt)