public unsafe PreAllocatedOverlapped(IOCompletionCallback callback, object state, object pinData) { if (callback == null) { throw new ArgumentNullException(nameof(callback)); } _overlapped = Win32ThreadPoolNativeOverlapped.Allocate(callback, state, pinData, this); }
private unsafe PreAllocatedOverlapped(IOCompletionCallback callback, object?state, object?pinData, bool flowExecutionContext) { if (callback == null) { throw new ArgumentNullException(nameof(callback)); } _overlapped = Win32ThreadPoolNativeOverlapped.Allocate(callback, state, pinData, this, flowExecutionContext); }
public unsafe NativeOverlapped *AllocateNativeOverlapped(IOCompletionCallback callback, object state, object pinData) { if (callback == null) { throw new ArgumentNullException(nameof(callback)); } AddRef(); try { Win32ThreadPoolNativeOverlapped *overlapped = Win32ThreadPoolNativeOverlapped.Allocate(callback, state, pinData, preAllocated: null); overlapped->Data._boundHandle = this; Interop.mincore.StartThreadpoolIo(_threadPoolHandle); return(Win32ThreadPoolNativeOverlapped.ToNativeOverlapped(overlapped)); } catch { Release(); throw; } }