NativeWrapper

Namespace: SharpPluginLoader.Core

A wrapper around a native pointer.

public class NativeWrapper

Inheritance ObjectNativeWrapper

Properties

Instance

The native pointer.

public nint Instance { get; set; }

Property Value

IntPtr

Constructors

NativeWrapper(IntPtr)

public NativeWrapper(nint instance)

Parameters

instance IntPtr

NativeWrapper()

public NativeWrapper()

Methods

Get<T>(IntPtr)

Gets a value at the specified offset.

public T Get<T>(nint offset)

Type Parameters

T
The type of the value, must be an unmanaged type

Parameters

offset IntPtr
The offset at which to retrieve the value

Returns

T
The value at the offset

Set<T>(IntPtr, T)

Sets a value at the specified offset.

public void Set<T>(nint offset, T value)

Type Parameters

T
The type of the value, must be an unmanaged type

Parameters

offset IntPtr
The offset at which to set the value

value T
The value to set

GetPtr<T>(IntPtr)

public T* GetPtr<T>(nint offset)

Type Parameters

T

Parameters

offset IntPtr

Returns

T*

GetPtr(IntPtr)

public Void* GetPtr(nint offset)

Parameters

offset IntPtr

Returns

Void*

SetPtr<T>(IntPtr, T)*

public void SetPtr<T>(nint offset, T* value)

Type Parameters

T

Parameters

offset IntPtr

value T*

GetRef<T>(IntPtr)

public T& GetRef<T>(nint offset)

Type Parameters

T

Parameters

offset IntPtr

Returns

T&

GetObject<T>(IntPtr)

Gets an object at the specified offset.

public T GetObject<T>(nint offset)

Type Parameters

T
The type of the object, must inherit from NativeWrapper

Parameters

offset IntPtr
The offset at which to retrieve the object

Returns

T
The object at the offset

GetInlineObject<T>(IntPtr)

Retrieves an inlined object at the specified offset.

public T GetInlineObject<T>(nint offset)

Type Parameters

T
The type of the object, must inherit from NativeWrapper

Parameters

offset IntPtr
The offset at which to retrieve the object

Returns

T
The object at the offset

SetObject<T>(IntPtr, T)

Sets an object at the specified offset.

public void SetObject<T>(nint offset, T value)

Type Parameters

T
The type of the object, must inherit from NativeWrapper

Parameters

offset IntPtr
The offset at which to set the object

value T
The object to set

GetRefInline<T>(IntPtr)

Gets a reference to a value in the object at the specified offset.

public T& GetRefInline<T>(nint offset)

Type Parameters

T
The type of the value

Parameters

offset IntPtr
The offset of the value

Returns

T&
A reference to the value at the offset

GetPtrInline<T>(IntPtr)

Gets a pointer to a value in the object at the specified offset.

public T* GetPtrInline<T>(nint offset)

Type Parameters

T
The type of the value

Parameters

offset IntPtr
The offset of the value

Returns

T*
A pointer to the value at the offset

GetPtrInline(IntPtr)

public Void* GetPtrInline(nint offset)

Parameters

offset IntPtr

Returns

Void*

Equals(Object)

public bool Equals(object obj)

Parameters

obj Object

Returns

Boolean

GetHashCode()

public int GetHashCode()

Returns

Int32