10 private OverlappedData m_overlappedData;
12 private static PinnableBufferCache s_overlappedDataCache =
new PinnableBufferCache(
"System.Threading.OverlappedData", () =>
new OverlappedData());
20 return m_overlappedData.m_asyncResult;
24 m_overlappedData.m_asyncResult = value;
34 return m_overlappedData.m_nativeOverlapped.OffsetLow;
38 m_overlappedData.m_nativeOverlapped.OffsetLow = value;
48 return m_overlappedData.m_nativeOverlapped.OffsetHigh;
52 m_overlappedData.m_nativeOverlapped.OffsetHigh = value;
58 [Obsolete(
"This property is not 64-bit compatible. Use EventHandleIntPtr instead. http://go.microsoft.com/fwlink/?linkid=14202")]
63 return m_overlappedData.UserHandle.ToInt32();
67 m_overlappedData.UserHandle =
new IntPtr(value);
78 return m_overlappedData.UserHandle;
82 m_overlappedData.UserHandle = value;
86 internal _IOCompletionCallback iocbHelper => m_overlappedData.m_iocbHelper;
93 return m_overlappedData.m_iocb;
100 m_overlappedData = (OverlappedData)s_overlappedDataCache.Allocate();
101 m_overlappedData.m_overlapped =
this;
111 m_overlappedData = (OverlappedData)s_overlappedDataCache.Allocate();
112 m_overlappedData.m_overlapped =
this;
113 m_overlappedData.m_nativeOverlapped.OffsetLow = offsetLo;
114 m_overlappedData.m_nativeOverlapped.OffsetHigh = offsetHi;
115 m_overlappedData.UserHandle = hEvent;
116 m_overlappedData.m_asyncResult = ar;
124 [Obsolete(
"This constructor is not 64-bit compatible. Use the constructor that takes an IntPtr for the event handle. http://go.microsoft.com/fwlink/?linkid=14202")]
126 : this(offsetLo, offsetHi, new
IntPtr(hEvent), ar)
135 [Obsolete(
"This method is not safe. Use Pack (iocb, userData) instead. http://go.microsoft.com/fwlink/?linkid=14202")]
136 [CLSCompliant(
false)]
139 return Pack(iocb,
null);
148 [CLSCompliant(
false)]
152 return m_overlappedData.Pack(iocb, userData);
160 [Obsolete(
"This method is not safe. Use UnsafePack (iocb, userData) instead. http://go.microsoft.com/fwlink/?linkid=14202")]
161 [CLSCompliant(
false)]
174 [CLSCompliant(
false)]
178 return m_overlappedData.UnsafePack(iocb, userData);
187 [CLSCompliant(
false)]
190 if (nativeOverlappedPtr ==
null)
194 return OverlappedData.GetOverlappedFromNative(nativeOverlappedPtr).m_overlapped;
202 [CLSCompliant(
false)]
205 if (nativeOverlappedPtr ==
null)
209 Overlapped overlapped = OverlappedData.GetOverlappedFromNative(nativeOverlappedPtr).m_overlapped;
210 OverlappedData.FreeNativeOverlapped(nativeOverlappedPtr);
211 OverlappedData overlappedData = overlapped.m_overlappedData;
212 overlapped.m_overlappedData =
null;
213 overlappedData.ReInitialize();
214 s_overlappedDataCache.Free(overlappedData);
The exception that is thrown when a null reference (Nothing in Visual Basic) is passed to a method th...
unsafe NativeOverlapped * Pack(IOCompletionCallback iocb)
Packs the current instance into a T:System.Threading.NativeOverlapped structure, specifying the deleg...
static unsafe Overlapped Unpack(NativeOverlapped *nativeOverlappedPtr)
Unpacks the specified unmanaged T:System.Threading.NativeOverlapped structure into a managed T:System...
unsafe NativeOverlapped * Pack(IOCompletionCallback iocb, object userData)
Packs the current instance into a T:System.Threading.NativeOverlapped structure, specifying a delegat...
Provides a managed representation of a Win32 OVERLAPPED structure, including methods to transfer info...
static unsafe void Free(NativeOverlapped *nativeOverlappedPtr)
Frees the unmanaged memory associated with a native overlapped structure allocated by the Overload:Sy...
unsafe NativeOverlapped * UnsafePack(IOCompletionCallback iocb)
Packs the current instance into a T:System.Threading.NativeOverlapped structure specifying the delega...
unsafe delegate void IOCompletionCallback(uint errorCode, uint numBytes, NativeOverlapped *pOVERLAP)
Receives the error code, number of bytes, and overlapped value type when an I/O operation completes o...
int OffsetHigh
Gets or sets the high-order word of the file position at which to start the transfer....
int EventHandle
Gets or sets the 32-bit integer handle to a synchronization event that is signaled when the I/O opera...
IntPtr EventHandleIntPtr
Gets or sets the handle to the synchronization event that is signaled when the I/O operation is compl...
Represents the status of an asynchronous operation.
A platform-specific type that is used to represent a pointer or a handle.
IAsyncResult AsyncResult
Gets or sets the object that provides status information on the I/O operation.
Overlapped(int offsetLo, int offsetHi, int hEvent, IAsyncResult ar)
Initializes a new instance of the T:System.Threading.Overlapped class with the specified file positio...
int OffsetLow
Gets or sets the low-order word of the file position at which to start the transfer....
unsafe NativeOverlapped * UnsafePack(IOCompletionCallback iocb, object userData)
Packs the current instance into a T:System.Threading.NativeOverlapped structure, specifying the deleg...
Overlapped()
Initializes a new, empty instance of the T:System.Threading.Overlapped class.
Provides an explicit layout that is visible from unmanaged code and that will have the same layout as...
Overlapped(int offsetLo, int offsetHi, IntPtr hEvent, IAsyncResult ar)
Initializes a new instance of the T:System.Threading.Overlapped class with the specified file positio...