@@ -19,7 +19,6 @@ public static partial class WinUsb
1919 /// </summary>
2020 private class WinUsbOverlapped : Overlapped
2121 {
22- private readonly Memory < byte > buffer ;
2322 private readonly SafeUsbHandle handle ;
2423 private readonly byte pipeID ;
2524 private readonly CancellationToken cancellationToken ;
@@ -41,18 +40,18 @@ private class WinUsbOverlapped : Overlapped
4140 /// <param name="pipeID">
4241 /// The ID of the pipe on which the I/O is being performed.
4342 /// </param>
44- /// <param name="buffer ">
45- /// The buffer which is used by the I/O operation. This buffer will be pinned for the duration of
43+ /// <param name="bufferHandle ">
44+ /// A handle to the buffer which is used by the I/O operation. This buffer will be pinned for the duration of
4645 /// the operation.
4746 /// </param>
4847 /// <param name="cancellationToken">
4948 /// A <see cref="CancellationToken"/> which can be used to cancel the overlapped I/O.
5049 /// </param>
51- public WinUsbOverlapped ( SafeUsbHandle handle , byte pipeID , Memory < byte > buffer , CancellationToken cancellationToken )
50+ public WinUsbOverlapped ( SafeUsbHandle handle , byte pipeID , MemoryHandle bufferHandle , CancellationToken cancellationToken )
5251 {
5352 this . handle = handle ?? throw new ArgumentNullException ( nameof ( handle ) ) ;
5453 this . pipeID = pipeID ;
55- this . buffer = buffer ;
54+ this . BufferHandle = bufferHandle ;
5655 this . cancellationToken = cancellationToken ;
5756 }
5857
@@ -84,8 +83,6 @@ public WinUsbOverlapped(SafeUsbHandle handle, byte pipeID, Memory<byte> buffer,
8483 /// </returns>
8584 internal unsafe NativeOverlapped * Pack ( )
8685 {
87- this . BufferHandle = this . buffer . Pin ( ) ;
88-
8986 this . native = this . Pack (
9087 this . DeviceIOControlCompletionCallback ,
9188 null ) ;
0 commit comments