This function introduces functionality that is missing or complicated in some programming languages.
The attribute inValue is a reference to an array of references. The attribute outValue is a reference to the same array, however a number of elements earlier or further, i.e. number of elements being attribute elementSize. Be aware that as we are talking about references the offset is depending on 32 bit / 64 bit compilation.


public const string enginedll = @"engine.dll";

[DllImport(enginedll, EntryPoint = "PeelArray")]
public static extern void PeelArray(ref IntPtr inValue, out IntPtr outValue, Int64 elementSize);    

Property inValue

Size: 64 bit / 8 byte (reference)
The reference to the array of references (or as C++ does not really care an array of virtually any type).

Property outValue

Size: 64 bit / 8 byte (reference)
The reference to the reference containing the adjusted reference being an adjusted place in the given array of references.

Property elementSize

Size: 64 bit / 8 byte (value)
The size of an element, however better to be interpreted as a the count of references (size_t / int_t) as it is allowed to have a negative value.