ThreadPoolBoundHandle.AllocateNativeOverlapped ThreadPoolBoundHandle.AllocateNativeOverlapped ThreadPoolBoundHandle.AllocateNativeOverlapped Method

Definition

Returns an unmanaged pointer to a NativeOverlapped structure.

Overloads

AllocateNativeOverlapped(PreAllocatedOverlapped) AllocateNativeOverlapped(PreAllocatedOverlapped) AllocateNativeOverlapped(PreAllocatedOverlapped)

Returns an unmanaged pointer to a NativeOverlapped structure using the callback state and buffers associated with the specified PreAllocatedOverlapped object.

AllocateNativeOverlapped(IOCompletionCallback, Object, Object) AllocateNativeOverlapped(IOCompletionCallback, Object, Object) AllocateNativeOverlapped(IOCompletionCallback, Object, Object)

Returns an unmanaged pointer to a NativeOverlapped structure, specifying a delegate that is invoked when the asynchronous I/O operation is complete, a user-provided object that supplies context, and managed objects that serve as buffers.

AllocateNativeOverlapped(PreAllocatedOverlapped) AllocateNativeOverlapped(PreAllocatedOverlapped) AllocateNativeOverlapped(PreAllocatedOverlapped)

Important

This API is not CLS-compliant.

Returns an unmanaged pointer to a NativeOverlapped structure using the callback state and buffers associated with the specified PreAllocatedOverlapped object.

public:
 System::Threading::NativeOverlapped* AllocateNativeOverlapped(System::Threading::PreAllocatedOverlapped ^ preAllocated);
[System.CLSCompliant(false)]
[System.Security.SecurityCritical]
public System.Threading.NativeOverlapped* AllocateNativeOverlapped (System.Threading.PreAllocatedOverlapped preAllocated);
member this.AllocateNativeOverlapped : System.Threading.PreAllocatedOverlapped -> nativeptr<System.Threading.NativeOverlapped>

Parameters

preAllocated
PreAllocatedOverlapped PreAllocatedOverlapped PreAllocatedOverlapped

An object from which to create the NativeOverlapped pointer.

Returns

An unmanaged pointer to a NativeOverlapped structure.

Exceptions

preAllocated is currently in use for another I/O operation.

This method was called after the ThreadPoolBoundHandle was disposed.

-or-

This method was called after preAllocated was disposed.

Remarks

The unmanaged pointer returned by this method can be passed to the operating system in overlapped I/O operations. The NativeOverlapped structure is fixed in physical memory until the FreeNativeOverlapped method is called.

See also

AllocateNativeOverlapped(IOCompletionCallback, Object, Object) AllocateNativeOverlapped(IOCompletionCallback, Object, Object) AllocateNativeOverlapped(IOCompletionCallback, Object, Object)

Important

This API is not CLS-compliant.

Returns an unmanaged pointer to a NativeOverlapped structure, specifying a delegate that is invoked when the asynchronous I/O operation is complete, a user-provided object that supplies context, and managed objects that serve as buffers.

public:
 System::Threading::NativeOverlapped* AllocateNativeOverlapped(System::Threading::IOCompletionCallback ^ callback, System::Object ^ state, System::Object ^ pinData);
[System.CLSCompliant(false)]
[System.Security.SecurityCritical]
public System.Threading.NativeOverlapped* AllocateNativeOverlapped (System.Threading.IOCompletionCallback callback, object state, object pinData);
member this.AllocateNativeOverlapped : System.Threading.IOCompletionCallback * obj * obj -> nativeptr<System.Threading.NativeOverlapped>

Parameters

callback
IOCompletionCallback IOCompletionCallback IOCompletionCallback

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

state
Object Object Object

A user-provided object that distinguishes this NativeOverlapped instance from other NativeOverlapped instances.

pinData
Object Object Object

An object or array of objects that represent the input or output buffer for the operation, or null. Each object represents a buffer, such an array of bytes.

Returns

An unmanaged pointer to a NativeOverlapped structure.

Exceptions

Remarks

The unmanaged pointer returned by this method can be passed to the operating system in overlapped I/O operations. The NativeOverlapped structure is fixed in physical memory until ThreadPoolBoundHandle.FreeNativeOverlapped is called.

Note

The buffers specified in are pinned for the duration of the I/O operation.

The buffer or buffers specified in must be the same as those passed to the unmanaged operating system function that performs the asynchronous I/O.

Applies to