Files

304 lines
9.0 KiB
C#

// <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 ClientConnectorState: IDisposable
{
private unsafe Raw.ClientConnectorState* _inner;
public SecurityProtocol BasicSettingsExchangeSendInitialSelectedProtocol
{
get
{
return GetBasicSettingsExchangeSendInitialSelectedProtocol();
}
}
public ConnectInitial BasicSettingsExchangeWaitResponseConnectInitial
{
get
{
return GetBasicSettingsExchangeWaitResponseConnectInitial();
}
}
public ConnectionResult ConnectedResult
{
get
{
return GetConnectedResult();
}
}
public ConnectionActivationSequence ConnectionFinalizationResult
{
get
{
return GetConnectionFinalizationResult();
}
}
public SecurityProtocol ConnectionInitiationWaitConfirmRequestedProtocol
{
get
{
return GetConnectionInitiationWaitConfirmRequestedProtocol();
}
}
public SecurityProtocol CredsspSelectedProtocol
{
get
{
return GetCredsspSelectedProtocol();
}
}
public SecurityProtocol EnhancedSecurityUpgradeSelectedProtocol
{
get
{
return GetEnhancedSecurityUpgradeSelectedProtocol();
}
}
public ClientConnectorStateType EnumType
{
get
{
return GetEnumType();
}
}
/// <summary>
/// Creates a managed <c>ClientConnectorState</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 ClientConnectorState(Raw.ClientConnectorState* handle)
{
_inner = handle;
}
/// <exception cref="IronRdpException"></exception>
/// <returns>
/// A <c>ClientConnectorStateType</c> allocated on C# side.
/// </returns>
public ClientConnectorStateType GetEnumType()
{
unsafe
{
if (_inner == null)
{
throw new ObjectDisposedException("ClientConnectorState");
}
Raw.ConnectorStateFfiResultClientConnectorStateTypeBoxIronRdpError result = Raw.ClientConnectorState.GetEnumType(_inner);
if (!result.isOk)
{
throw new IronRdpException(new IronRdpError(result.Err));
}
Raw.ClientConnectorStateType retVal = result.Ok;
return (ClientConnectorStateType)retVal;
}
}
/// <exception cref="IronRdpException"></exception>
/// <returns>
/// A <c>SecurityProtocol</c> allocated on Rust side.
/// </returns>
public SecurityProtocol GetConnectionInitiationWaitConfirmRequestedProtocol()
{
unsafe
{
if (_inner == null)
{
throw new ObjectDisposedException("ClientConnectorState");
}
Raw.ConnectorStateFfiResultBoxSecurityProtocolBoxIronRdpError result = Raw.ClientConnectorState.GetConnectionInitiationWaitConfirmRequestedProtocol(_inner);
if (!result.isOk)
{
throw new IronRdpException(new IronRdpError(result.Err));
}
Raw.SecurityProtocol* retVal = result.Ok;
return new SecurityProtocol(retVal);
}
}
/// <exception cref="IronRdpException"></exception>
/// <returns>
/// A <c>SecurityProtocol</c> allocated on Rust side.
/// </returns>
public SecurityProtocol GetEnhancedSecurityUpgradeSelectedProtocol()
{
unsafe
{
if (_inner == null)
{
throw new ObjectDisposedException("ClientConnectorState");
}
Raw.ConnectorStateFfiResultBoxSecurityProtocolBoxIronRdpError result = Raw.ClientConnectorState.GetEnhancedSecurityUpgradeSelectedProtocol(_inner);
if (!result.isOk)
{
throw new IronRdpException(new IronRdpError(result.Err));
}
Raw.SecurityProtocol* retVal = result.Ok;
return new SecurityProtocol(retVal);
}
}
/// <exception cref="IronRdpException"></exception>
/// <returns>
/// A <c>SecurityProtocol</c> allocated on Rust side.
/// </returns>
public SecurityProtocol GetCredsspSelectedProtocol()
{
unsafe
{
if (_inner == null)
{
throw new ObjectDisposedException("ClientConnectorState");
}
Raw.ConnectorStateFfiResultBoxSecurityProtocolBoxIronRdpError result = Raw.ClientConnectorState.GetCredsspSelectedProtocol(_inner);
if (!result.isOk)
{
throw new IronRdpException(new IronRdpError(result.Err));
}
Raw.SecurityProtocol* retVal = result.Ok;
return new SecurityProtocol(retVal);
}
}
/// <exception cref="IronRdpException"></exception>
/// <returns>
/// A <c>SecurityProtocol</c> allocated on Rust side.
/// </returns>
public SecurityProtocol GetBasicSettingsExchangeSendInitialSelectedProtocol()
{
unsafe
{
if (_inner == null)
{
throw new ObjectDisposedException("ClientConnectorState");
}
Raw.ConnectorStateFfiResultBoxSecurityProtocolBoxIronRdpError result = Raw.ClientConnectorState.GetBasicSettingsExchangeSendInitialSelectedProtocol(_inner);
if (!result.isOk)
{
throw new IronRdpException(new IronRdpError(result.Err));
}
Raw.SecurityProtocol* retVal = result.Ok;
return new SecurityProtocol(retVal);
}
}
/// <exception cref="IronRdpException"></exception>
/// <returns>
/// A <c>ConnectInitial</c> allocated on Rust side.
/// </returns>
public ConnectInitial GetBasicSettingsExchangeWaitResponseConnectInitial()
{
unsafe
{
if (_inner == null)
{
throw new ObjectDisposedException("ClientConnectorState");
}
Raw.ConnectorStateFfiResultBoxConnectInitialBoxIronRdpError result = Raw.ClientConnectorState.GetBasicSettingsExchangeWaitResponseConnectInitial(_inner);
if (!result.isOk)
{
throw new IronRdpException(new IronRdpError(result.Err));
}
Raw.ConnectInitial* retVal = result.Ok;
return new ConnectInitial(retVal);
}
}
/// <exception cref="IronRdpException"></exception>
/// <returns>
/// A <c>ConnectionResult</c> allocated on Rust side.
/// </returns>
public ConnectionResult GetConnectedResult()
{
unsafe
{
if (_inner == null)
{
throw new ObjectDisposedException("ClientConnectorState");
}
Raw.ConnectorStateFfiResultBoxConnectionResultBoxIronRdpError result = Raw.ClientConnectorState.GetConnectedResult(_inner);
if (!result.isOk)
{
throw new IronRdpException(new IronRdpError(result.Err));
}
Raw.ConnectionResult* retVal = result.Ok;
return new ConnectionResult(retVal);
}
}
/// <exception cref="IronRdpException"></exception>
/// <returns>
/// A <c>ConnectionActivationSequence</c> allocated on Rust side.
/// </returns>
public ConnectionActivationSequence GetConnectionFinalizationResult()
{
unsafe
{
if (_inner == null)
{
throw new ObjectDisposedException("ClientConnectorState");
}
Raw.ConnectorStateFfiResultBoxConnectionActivationSequenceBoxIronRdpError result = Raw.ClientConnectorState.GetConnectionFinalizationResult(_inner);
if (!result.isOk)
{
throw new IronRdpException(new IronRdpError(result.Err));
}
Raw.ConnectionActivationSequence* retVal = result.Ok;
return new ConnectionActivationSequence(retVal);
}
}
/// <summary>
/// Returns the underlying raw handle.
/// </summary>
public unsafe Raw.ClientConnectorState* AsFFI()
{
return _inner;
}
/// <summary>
/// Destroys the underlying object immediately.
/// </summary>
public void Dispose()
{
unsafe
{
if (_inner == null)
{
return;
}
Raw.ClientConnectorState.Destroy(_inner);
_inner = null;
GC.SuppressFinalize(this);
}
}
~ClientConnectorState()
{
Dispose();
}
}