using System; using System.Runtime.InteropServices; namespace System.Threading { /// Provides a managed representation of a Win32 OVERLAPPED structure, including methods to transfer information from an instance to a structure. /// 2 // Token: 0x02000619 RID: 1561 [ComVisible(true)] public class Overlapped { /// Initializes a new, empty instance of the class. // Token: 0x060038F6 RID: 14582 RVA: 0x000C4814 File Offset: 0x000C2A14 public Overlapped() { } /// Initializes a new instance of the class with the specified file position, the 32-bit integer handle to an event that is signaled when the I/O operation is complete, and an interface through which to return the results of the operation. /// The low word of the file position at which to start the transfer. /// The high word of the file position at which to start the transfer. /// The handle to an event that is signaled when the I/O operation is complete. /// An object that implements the interface and provides status information on the I/O operation. // Token: 0x060038F7 RID: 14583 RVA: 0x000C481C File Offset: 0x000C2A1C [Obsolete("Not 64bit compatible. Please use the constructor that takes IntPtr for the event handle", false)] public Overlapped(int offsetLo, int offsetHi, int hEvent, IAsyncResult ar) { this.offsetL = offsetLo; this.offsetH = offsetHi; this.evt = hEvent; this.ares = ar; } /// Initializes a new instance of the class with the specified file position, the handle to an event that is signaled when the I/O operation is complete, and an interface through which to return the results of the operation. /// The low word of the file position at which to start the transfer. /// The high word of the file position at which to start the transfer. /// The handle to an event that is signaled when the I/O operation is complete. /// An object that implements the interface and provides status information on the I/O operation. // Token: 0x060038F8 RID: 14584 RVA: 0x000C4844 File Offset: 0x000C2A44 public Overlapped(int offsetLo, int offsetHi, IntPtr hEvent, IAsyncResult ar) { this.offsetL = offsetLo; this.offsetH = offsetHi; this.evt_ptr = hEvent; this.ares = ar; } /// Frees the unmanaged memory associated with a native overlapped structure allocated by the method. /// A pointer to the structure to be freed. /// /// is null. /// 1 // Token: 0x060038F9 RID: 14585 RVA: 0x000C486C File Offset: 0x000C2A6C [CLSCompliant(false)] public unsafe static void Free(NativeOverlapped* nativeOverlappedPtr) { if ((IntPtr)((void*)nativeOverlappedPtr) == IntPtr.Zero) { throw new ArgumentNullException("nativeOverlappedPtr"); } Marshal.FreeHGlobal((IntPtr)((void*)nativeOverlappedPtr)); } /// Unpacks the specified unmanaged structure into a managed object. /// An object containing the information unpacked from the native structure. /// An unmanaged pointer to a structure. /// /// is null. /// 1 // Token: 0x060038FA RID: 14586 RVA: 0x000C489C File Offset: 0x000C2A9C [CLSCompliant(false)] public unsafe static Overlapped Unpack(NativeOverlapped* nativeOverlappedPtr) { if ((IntPtr)((void*)nativeOverlappedPtr) == IntPtr.Zero) { throw new ArgumentNullException("nativeOverlappedPtr"); } return new Overlapped { offsetL = nativeOverlappedPtr->OffsetLow, offsetH = nativeOverlappedPtr->OffsetHigh, evt = (int)nativeOverlappedPtr->EventHandle }; } /// Packs the current instance into a structure, specifying the delegate to be invoked when the asynchronous I/O operation is complete. /// An unmanaged pointer to a structure. /// An delegate that represents the callback method invoked when the asynchronous I/O operation completes. /// The current has already been packed. /// 2 // Token: 0x060038FB RID: 14587 RVA: 0x000C48FC File Offset: 0x000C2AFC [MonoTODO("Security - we need to propagate the call stack")] [Obsolete("Use Pack(iocb, userData) instead", false)] [CLSCompliant(false)] public unsafe NativeOverlapped* Pack(IOCompletionCallback iocb) { NativeOverlapped* ptr = (NativeOverlapped*)(void*)Marshal.AllocHGlobal(Marshal.SizeOf(typeof(NativeOverlapped))); ptr->OffsetLow = this.offsetL; ptr->OffsetHigh = this.offsetH; ptr->EventHandle = (IntPtr)this.evt; return ptr; } /// Packs the current instance into a structure, specifying a delegate that is invoked when the asynchronous I/O operation is complete and a managed object that serves as a buffer. /// An unmanaged pointer to a structure. /// An delegate that represents the callback method invoked when the asynchronous I/O operation completes. /// An object or array of objects representing the input or output buffer for the operation. Each object represents a buffer, for example an array of bytes. /// The current has already been packed. /// 2 // Token: 0x060038FC RID: 14588 RVA: 0x000C4950 File Offset: 0x000C2B50 [MonoTODO("handle userData")] [CLSCompliant(false)] [ComVisible(false)] public unsafe NativeOverlapped* Pack(IOCompletionCallback iocb, object userData) { NativeOverlapped* ptr = (NativeOverlapped*)(void*)Marshal.AllocHGlobal(Marshal.SizeOf(typeof(NativeOverlapped))); ptr->OffsetLow = this.offsetL; ptr->OffsetHigh = this.offsetH; ptr->EventHandle = this.evt_ptr; return ptr; } /// Packs the current instance into a structure specifying the delegate to invoke when the asynchronous I/O operation is complete. Does not propagate the calling stack. /// An unmanaged pointer to a structure. /// An delegate that represents the callback method invoked when the asynchronous I/O operation completes. /// The current has already been packed. /// 2 /// /// /// // Token: 0x060038FD RID: 14589 RVA: 0x000C499C File Offset: 0x000C2B9C [Obsolete("Use UnsafePack(iocb, userData) instead", false)] [CLSCompliant(false)] public unsafe NativeOverlapped* UnsafePack(IOCompletionCallback iocb) { return this.Pack(iocb); } /// Packs the current instance into a structure, specifying the delegate to invoke when the asynchronous I/O operation is complete and the managed object that serves as a buffer. Does not propagate the calling stack. /// An unmanaged pointer to a structure. /// An delegate that represents the callback method invoked when the asynchronous I/O operation completes. /// An object or array of objects representing the input or output buffer for the operation. Each object represents a buffer, for example an array of bytes. /// The caller does not have the required permission. /// The current is already packed. /// 2 /// /// /// // Token: 0x060038FE RID: 14590 RVA: 0x000C49A8 File Offset: 0x000C2BA8 [ComVisible(false)] [CLSCompliant(false)] public unsafe NativeOverlapped* UnsafePack(IOCompletionCallback iocb, object userData) { return this.Pack(iocb, userData); } /// Gets or sets the object that provides status information on the I/O operation. /// An object that implements the interface. /// 2 // Token: 0x17000B03 RID: 2819 // (get) Token: 0x060038FF RID: 14591 RVA: 0x000C49B4 File Offset: 0x000C2BB4 // (set) Token: 0x06003900 RID: 14592 RVA: 0x000C49BC File Offset: 0x000C2BBC public IAsyncResult AsyncResult { get { return this.ares; } set { this.ares = value; } } /// Gets or sets the 32-bit integer handle to a synchronization event that is signaled when the I/O operation is complete. /// An value representing the handle of the synchronization event. /// 2 // Token: 0x17000B04 RID: 2820 // (get) Token: 0x06003901 RID: 14593 RVA: 0x000C49C8 File Offset: 0x000C2BC8 // (set) Token: 0x06003902 RID: 14594 RVA: 0x000C49D0 File Offset: 0x000C2BD0 [Obsolete("Not 64bit compatible. Use EventHandleIntPtr instead.", false)] public int EventHandle { get { return this.evt; } set { this.evt = value; } } /// Gets or sets the handle to the synchronization event that is signaled when the I/O operation is complete. /// An representing the handle of the event. /// 2 // Token: 0x17000B05 RID: 2821 // (get) Token: 0x06003903 RID: 14595 RVA: 0x000C49DC File Offset: 0x000C2BDC // (set) Token: 0x06003904 RID: 14596 RVA: 0x000C49E4 File Offset: 0x000C2BE4 [ComVisible(false)] public IntPtr EventHandleIntPtr { get { return this.evt_ptr; } set { this.evt_ptr = value; } } /// Gets or sets the high-order word of the file position at which to start the transfer. The file position is a byte offset from the start of the file. /// An value representing the high word of the file position. /// 2 // Token: 0x17000B06 RID: 2822 // (get) Token: 0x06003905 RID: 14597 RVA: 0x000C49F0 File Offset: 0x000C2BF0 // (set) Token: 0x06003906 RID: 14598 RVA: 0x000C49F8 File Offset: 0x000C2BF8 public int OffsetHigh { get { return this.offsetH; } set { this.offsetH = value; } } /// Gets or sets the low-order word of the file position at which to start the transfer. The file position is a byte offset from the start of the file. /// An value representing the low word of the file position. /// 2 // Token: 0x17000B07 RID: 2823 // (get) Token: 0x06003907 RID: 14599 RVA: 0x000C4A04 File Offset: 0x000C2C04 // (set) Token: 0x06003908 RID: 14600 RVA: 0x000C4A0C File Offset: 0x000C2C0C public int OffsetLow { get { return this.offsetL; } set { this.offsetL = value; } } // Token: 0x040016F8 RID: 5880 private IAsyncResult ares; // Token: 0x040016F9 RID: 5881 private int offsetL; // Token: 0x040016FA RID: 5882 private int offsetH; // Token: 0x040016FB RID: 5883 private int evt; // Token: 0x040016FC RID: 5884 private IntPtr evt_ptr; } }