Edytuj

Udostępnij za pośrednictwem


ObjectMarshal.DangerousGetObjectDataByteOffset<T>(Object, T) Method

Definition

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

obj
Object

The input Object hosting the target field.

data
T

A reference to a target field of type T within obj.

Returns

IntPtr

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.

Applies to