2024-04-09 10:13:12 -04:00
|
|
|
// <auto-generated/> by Diplomat
|
|
|
|
|
|
|
|
|
|
#pragma warning disable 0105
|
|
|
|
|
using System;
|
|
|
|
|
using System.Runtime.InteropServices;
|
|
|
|
|
|
|
|
|
|
using Devolutions.IronRdp.Diplomat;
|
|
|
|
|
#pragma warning restore 0105
|
|
|
|
|
|
|
|
|
|
namespace Devolutions.IronRdp;
|
|
|
|
|
|
|
|
|
|
#nullable enable
|
|
|
|
|
|
|
|
|
|
public partial class InputDatabase: IDisposable
|
|
|
|
|
{
|
|
|
|
|
private unsafe Raw.InputDatabase* _inner;
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// Creates a managed <c>InputDatabase</c> from a raw handle.
|
|
|
|
|
/// </summary>
|
|
|
|
|
/// <remarks>
|
|
|
|
|
/// Safety: you should not build two managed objects using the same raw handle (may causes use-after-free and double-free).
|
|
|
|
|
/// <br/>
|
|
|
|
|
/// This constructor assumes the raw struct is allocated on Rust side.
|
|
|
|
|
/// If implemented, the custom Drop implementation on Rust side WILL run on destruction.
|
|
|
|
|
/// </remarks>
|
|
|
|
|
public unsafe InputDatabase(Raw.InputDatabase* handle)
|
|
|
|
|
{
|
|
|
|
|
_inner = handle;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/// <returns>
|
|
|
|
|
/// A <c>InputDatabase</c> allocated on Rust side.
|
|
|
|
|
/// </returns>
|
|
|
|
|
public static InputDatabase New()
|
|
|
|
|
{
|
|
|
|
|
unsafe
|
|
|
|
|
{
|
|
|
|
|
Raw.InputDatabase* retVal = Raw.InputDatabase.New();
|
|
|
|
|
return new InputDatabase(retVal);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
2024-04-24 10:09:34 -04:00
|
|
|
/// <returns>
|
|
|
|
|
/// A <c>FastPathInputEventIterator</c> allocated on Rust side.
|
|
|
|
|
/// </returns>
|
|
|
|
|
public FastPathInputEventIterator Apply(Operation operation)
|
|
|
|
|
{
|
|
|
|
|
unsafe
|
|
|
|
|
{
|
|
|
|
|
if (_inner == null)
|
|
|
|
|
{
|
|
|
|
|
throw new ObjectDisposedException("InputDatabase");
|
|
|
|
|
}
|
|
|
|
|
Raw.Operation* operationRaw;
|
|
|
|
|
operationRaw = operation.AsFFI();
|
|
|
|
|
if (operationRaw == null)
|
|
|
|
|
{
|
|
|
|
|
throw new ObjectDisposedException("Operation");
|
|
|
|
|
}
|
|
|
|
|
Raw.FastPathInputEventIterator* retVal = Raw.InputDatabase.Apply(_inner, operationRaw);
|
|
|
|
|
return new FastPathInputEventIterator(retVal);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
2024-04-09 10:13:12 -04:00
|
|
|
/// <summary>
|
|
|
|
|
/// Returns the underlying raw handle.
|
|
|
|
|
/// </summary>
|
|
|
|
|
public unsafe Raw.InputDatabase* AsFFI()
|
|
|
|
|
{
|
|
|
|
|
return _inner;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// Destroys the underlying object immediately.
|
|
|
|
|
/// </summary>
|
|
|
|
|
public void Dispose()
|
|
|
|
|
{
|
|
|
|
|
unsafe
|
|
|
|
|
{
|
|
|
|
|
if (_inner == null)
|
|
|
|
|
{
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
Raw.InputDatabase.Destroy(_inner);
|
|
|
|
|
_inner = null;
|
|
|
|
|
|
|
|
|
|
GC.SuppressFinalize(this);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
~InputDatabase()
|
|
|
|
|
{
|
|
|
|
|
Dispose();
|
|
|
|
|
}
|
|
|
|
|
}
|