Use ref for stream event in System.Net.Quic (#32086)
authorJustin Kotalik <jkotalik12@gmail.com>
Tue, 11 Feb 2020 05:36:25 +0000 (21:36 -0800)
committerGitHub <noreply@github.com>
Tue, 11 Feb 2020 05:36:25 +0000 (21:36 -0800)
src/libraries/System.Net.Quic/src/Interop/MsQuicNativeMethods.cs
src/libraries/System.Net.Quic/src/System/Net/Quic/Implementations/MsQuic/MsQuicStream.cs

index 67f0cd92b6527d915cd269feb43b3baaa1958e1b..16c3f69e529765a23ee98cb84f00958f27b95146 100644 (file)
@@ -435,7 +435,7 @@ namespace System.Net.Quic.Implementations.MsQuic.Internal
         internal delegate uint StreamCallbackDelegate(
             IntPtr stream,
             IntPtr context,
-            StreamEvent streamEvent);
+            ref StreamEvent streamEvent);
 
         internal delegate uint StreamOpenDelegate(
             IntPtr connection,
index 4920bbd324eb622dfbc14b9a98550719ec38015f..520b5b0b5233a541af05ab06c9a30363e226ea4c 100644 (file)
@@ -487,14 +487,14 @@ namespace System.Net.Quic.Implementations.MsQuic
         }
 
         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)