Overlapped 类

定义

提供 Win32 OVERLAPPED 结构的托管表现形式,包括从 Overlapped 实例向 NativeOverlapped 结构传输信息的方法。Provides a managed representation of a Win32 OVERLAPPED structure, including methods to transfer information from an Overlapped instance to a NativeOverlapped structure.

public ref class Overlapped
public class Overlapped
[System.Runtime.InteropServices.ComVisible(true)]
public class Overlapped
type Overlapped = class
Public Class Overlapped
继承
Overlapped
属性

注解

PackUnsafePack 方法将信息从 Overlapped 对象传输到可为异步文件 i/o 传递到 Windows API 函数的 NativeOverlapped 结构。The Pack and UnsafePack methods transfer information from an Overlapped object to a NativeOverlapped structure that can be passed to Windows API functions for asynchronous file I/O. Unpack 方法将信息从 NativeOverlapped 结构传输到 Overlapped 类的实例。The Unpack method transfers information from a NativeOverlapped structure to an instance of the Overlapped class.

Overlapped 对象的属性的更改会影响其关联的 NativeOverlapped 结构,反之亦然。Changes to the properties of an Overlapped object affect its associated NativeOverlapped structure, and vice versa.

构造函数

Overlapped()

初始化 Overlapped 类的新的空实例。Initializes a new, empty instance of the Overlapped class.

Overlapped(Int32, Int32, Int32, IAsyncResult)

用指定的文件位置、当 I/O 操作完成时终止的事件的 32 位整型句柄、以及一个用来返回操作结果的接口初始化 Overlapped 类的新实例。Initializes a new instance of the Overlapped 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.

Overlapped(Int32, Int32, IntPtr, IAsyncResult)

用指定的文件位置、当 I/O 操作完成时终止的事件的句柄、以及一个用来返回操作结果的接口初始化 Overlapped 类的新实例。Initializes a new instance of the Overlapped 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.

属性

AsyncResult

获取或设置提供 I/O 操作的状态信息的对象。Gets or sets the object that provides status information on the I/O operation.

EventHandle

获取或设置当 I/O 操作完成时终止的同步事件的 32 位整型句柄。Gets or sets the 32-bit integer handle to a synchronization event that is signaled when the I/O operation is complete.

EventHandleIntPtr

获取或设置当 I/O 操作完成时终止的同步事件的句柄。Gets or sets the handle to the synchronization event that is signaled when the I/O operation is complete.

OffsetHigh

获取或设置启动传输的文件位置的高序位字。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.

OffsetLow

获取或设置启动传输的文件位置的低序位字。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.

方法

Equals(Object)

确定指定对象是否等于当前对象。Determines whether the specified object is equal to the current object.

(继承自 Object)
Free(NativeOverlapped*)

释放与 Pack 方法分配的本机重叠结构关联的非托管内存。Frees the unmanaged memory associated with a native overlapped structure allocated by the Pack method.

GetHashCode()

用作默认哈希函数。Serves as the default hash function.

(继承自 Object)
GetType()

获取当前实例的 TypeGets the Type of the current instance.

(继承自 Object)
MemberwiseClone()

创建当前 Object 的浅表副本。Creates a shallow copy of the current Object.

(继承自 Object)
Pack(IOCompletionCallback)

将当前实例打包为一个 NativeOverlapped 结构,并指定当异步 I/O 操作完成时调用的委托。Packs the current instance into a NativeOverlapped structure, specifying the delegate to be invoked when the asynchronous I/O operation is complete.

Pack(IOCompletionCallback, Object)

将当前实例打包为一个 NativeOverlapped 结构,并指定当异步 I/O 操作完成时调用的委托,以及作为缓冲区的托管对象。Packs the current instance into a NativeOverlapped structure, specifying a delegate that is invoked when the asynchronous I/O operation is complete and a managed object that serves as a buffer.

ToString()

返回表示当前对象的字符串。Returns a string that represents the current object.

(继承自 Object)
Unpack(NativeOverlapped*)

将指定的非托管 NativeOverlapped 结构解压缩为 Overlapped 对象。Unpacks the specified unmanaged NativeOverlapped structure into a managed Overlapped object.

UnsafePack(IOCompletionCallback)

将当前实例打包为一个 NativeOverlapped 结构,并指定当异步 I/O 操作完成时调用的委托。Packs the current instance into a NativeOverlapped structure specifying the delegate to invoke when the asynchronous I/O operation is complete. 不传播该调用堆栈。Does not propagate the calling stack.

UnsafePack(IOCompletionCallback, Object)

将当前实例打包为一个 NativeOverlapped 结构,并指定当异步 I/O 操作完成时调用的委托,以及作为缓冲区的托管对象。Packs the current instance into a NativeOverlapped 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.

适用于