Edit

Share via


PinnedGCHandle<T>.FromIntPtr(IntPtr) Method

Definition

Returns a new PinnedGCHandle<T> object created from a handle to a managed object.

public:
 static System::Runtime::InteropServices::PinnedGCHandle<T> FromIntPtr(IntPtr value);
public static System.Runtime.InteropServices.PinnedGCHandle<T> FromIntPtr(IntPtr value);
static member FromIntPtr : nativeint -> System.Runtime.InteropServices.PinnedGCHandle<'T (requires 'T : null)>
Public Shared Function FromIntPtr (value As IntPtr) As PinnedGCHandle(Of T)

Parameters

value
IntPtr

nativeint

An IntPtr handle to a managed object to create a PinnedGCHandle<T> object from.

Returns

A new PinnedGCHandle<T> object that corresponds to the value parameter.

Remarks

This method doesn't validate the provided handle value. The caller must ensure the validity of the handle.

The IntPtr representation of PinnedGCHandle<T> is not interchangable with GCHandle.

Applies to