PinnedGCHandle<T>.GetAddressOfObjectData 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.
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
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.