PreAllocatedOverlapped(IOCompletionCallback, Object, Object) PreAllocatedOverlapped(IOCompletionCallback, Object, Object) PreAllocatedOverlapped(IOCompletionCallback, Object, Object) PreAllocatedOverlapped(IOCompletionCallback, Object, Object) Constructor

Definition

Important

This API is not CLS-compliant.

Initializes a new instance of the PreAllocatedOverlapped class and specifies a delegate to invoke when each asynchronous I/O operation is complete, a user-provided object that provides context, and managed objects that serve as buffers.

public:
 PreAllocatedOverlapped(System::Threading::IOCompletionCallback ^ callback, System::Object ^ state, System::Object ^ pinData);
[System.CLSCompliant(false)]
public PreAllocatedOverlapped (System.Threading.IOCompletionCallback callback, object state, object pinData);
new System.Threading.PreAllocatedOverlapped : System.Threading.IOCompletionCallback * obj * obj -> System.Threading.PreAllocatedOverlapped
Public Sub New (callback As IOCompletionCallback, state As Object, pinData As Object)

Parameters

callback
IOCompletionCallback IOCompletionCallback IOCompletionCallback IOCompletionCallback

A delegate that represents the callback method to invoke when each asynchronous I/O operation completes.

state
Object Object Object Object

A user-supplied object that distinguishes the NativeOverlapped instance produced from this object from other NativeOverlapped instances. Its value can be null.

pinData
Object Object Object Object

An object or array of objects that represent the input or output buffer for the operations. Each object represents a buffer, such as an array of bytes. Its value can be null.

Exceptions

Remarks

The new PreAllocatedOverlapped instance can be passed to the AllocateNativeOverlapped method to produce a NativeOverlapped instance that can be passed to the operating system in overlapped I/O operations. A single PreAllocatedOverlapped instance can only be used for a single native I/O operation at a time. However, the state stored in the PreAllocatedOverlapped instance can be reused for subsequent native operations.

Note

The buffers specified in pinData are pinned until the Dispose method is called.

Applies to