SwiftlyS2

AllocableNativeHandle

Class AllocableNativeHandle

Namespace: SwiftlyS2.Shared.Natives

Assembly: SwiftlyS2.CS2.dll

public abstract class AllocableNativeHandle : SafeHandleZeroOrMinusOneIsInvalid, IDisposable, INativeHandle

Inheritance

Implements

Inherited Members

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

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
  • booltrue 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.

On this page