System.Runtime.InteropServices.Marshal.UnsafeAddrOfPinnedArrayElement Method

Gets the address of the element at the specified index inside the specified array.

Syntax

public static IntPtr UnsafeAddrOfPinnedArrayElement (Array arr, int index)

Parameters

arr
The array that contains the desired element.
index
The index in the arr parameter of the desired element.

Returns

The address of index inside arr.

Remarks

The array must be pinned using a System.Runtime.InteropServices.GCHandle before it is passed to this method. For maximum performance, this method does not validate the array passed to it; this can result in unexpected behavior.

Requirements

Namespace: System.Runtime.InteropServices
Assembly: mscorlib (in mscorlib.dll)
Assembly Versions: 1.0.5000.0, 2.0.0.0, 4.0.0.0