ObjectMarshal.DangerousGetObjectDataByteOffset<T>(Object, T) Method
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
Calculates the byte offset to a specific field within a given Object.
public static IntPtr DangerousGetObjectDataByteOffset<T> (object obj, ref T data);
static member DangerousGetObjectDataByteOffset : obj * 'T -> nativeint
Public Function DangerousGetObjectDataByteOffset(Of T) (obj As Object, ByRef data As T) As IntPtr
Type Parameters
- T
The type of field being referenced.
Parameters
- data
- T
A reference to a target field of type T
within obj
.
Returns
nativeint
The IntPtr value representing the offset to the target field from the start of the object data
for the parameter obj
. The offset is in relation to the first usable byte after the method table.
Remarks
The input parameters are not validated, and it's responsibility of the caller to ensure that the data
reference is actually pointing to a memory location within obj
.