Bewerken

Share via


ThreadPoolBoundHandle.AllocateNativeOverlapped Method

Definition

Returns an unmanaged pointer to a NativeOverlapped structure.

Overloads

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)

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)

Source:
ThreadPoolBoundHandle.cs
Source:
ThreadPoolBoundHandle.Unix.cs
Source:
ThreadPoolBoundHandle.Unix.cs

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

Parameters

preAllocated
PreAllocatedOverlapped

An object from which to create the NativeOverlapped pointer.

Returns

An unmanaged pointer to a NativeOverlapped structure.

Attributes

Exceptions

preAllocated is null.

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

Applies to

AllocateNativeOverlapped(IOCompletionCallback, Object, Object)

Source:
ThreadPoolBoundHandle.cs
Source:
ThreadPoolBoundHandle.Unix.cs
Source:
ThreadPoolBoundHandle.Unix.cs

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)]
public System.Threading.NativeOverlapped* AllocateNativeOverlapped (System.Threading.IOCompletionCallback callback, object state, object pinData);
[System.CLSCompliant(false)]
public System.Threading.NativeOverlapped* AllocateNativeOverlapped (System.Threading.IOCompletionCallback callback, object? state, object? pinData);
[System.CLSCompliant(false)]
[System.Security.SecurityCritical]
public System.Threading.NativeOverlapped* AllocateNativeOverlapped (System.Threading.IOCompletionCallback callback, object state, object pinData);
[<System.CLSCompliant(false)>]
member this.AllocateNativeOverlapped : System.Threading.IOCompletionCallback * obj * obj -> nativeptr<System.Threading.NativeOverlapped>
[<System.CLSCompliant(false)>]
[<System.Security.SecurityCritical>]
member this.AllocateNativeOverlapped : System.Threading.IOCompletionCallback * obj * obj -> nativeptr<System.Threading.NativeOverlapped>

Parameters

callback
IOCompletionCallback

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

state
Object

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

pinData
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.

Attributes

Exceptions

callback is null.

This method was called after the ThreadPoolBoundHandle object 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 ThreadPoolBoundHandle.FreeNativeOverlapped is called.

Note

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

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

Applies to