Edit

Share via


PinnedGCHandle<T>.GetAddressOfObjectData Method

Definition

Important

This API is not CLS-compliant.

Retrieves the address of object data in a PinnedGCHandle<T>.

public:
 void* GetAddressOfObjectData();
[System.CLSCompliant(false)]
public readonly void* GetAddressOfObjectData();
[<System.CLSCompliant(false)>]
member this.GetAddressOfObjectData : unit -> nativeptr<unit>

Returns

Void*

The address of first instance field of the pinned object, or null if the handle doesn't point to any object.

Attributes

Exceptions

The handle is not initialized or is already disposed.

Remarks

This method is intended to be used with types other than array or String.

For array or String, use GetAddressOfArrayData<T>(PinnedGCHandle<T[]>) or GetAddressOfStringData(PinnedGCHandle<String>) instead.

This method should only be used for blittable types.

Applies to