swiftlys2/docs/api/releases/features/ai/
API Reference › Natives

AllocableNativeHandle

Class
Namespace: SwiftlyS2.Shared.Natives · Assembly: SwiftlyS2.CS2.dll
public abstract class AllocableNativeHandle : SafeHandleZeroOrMinusOneIsInvalid, IDisposable, INativeHandle
View source

Constructors

AllocableNativeHandle(nint, bool)

protected AllocableNativeHandle(nint handle, bool ownsHandle)
Parameters

Properties

Address

Dangerous method to get the memory address of the object.

public nint Address { get; }
Property Value

IsValid

Return whether a handle is valid. Still might be dangerous for some pointer that borrowed from game instead of allocated by ourselves.

public bool IsValid { get; }
Property Value

Methods

DangerouslySetAddress(nint)

Dangerous method to set the memory address of the object. Unsafe.

public void DangerouslySetAddress(nint address)
Parameters
  • addressnintThe raw address.

Free()

protected abstract bool Free()
Returns

ReleaseHandle()

When overridden in a derived class, executes the code required to free the handle.

protected override bool ReleaseHandle()
Returns
true if the handle is released successfully; otherwise, in the event of a catastrophic failure, false . In this case, it generates a releaseHandleFailed Managed Debugging Assistant.