Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

18 changes: 18 additions & 0 deletions crates/ironrdp-connector/src/connection.rs
Original file line number Diff line number Diff line change
Expand Up @@ -154,6 +154,24 @@ impl ClientConnector {
self.static_channels.insert(channel);
}

pub fn get_static_channel_processor<T>(&mut self) -> Option<&T>
where
T: SvcClientProcessor + 'static,
{
self.static_channels
.get_by_type::<T>()
.and_then(|channel| channel.channel_processor_downcast_ref())
}

pub fn get_static_channel_processor_mut<T>(&mut self) -> Option<&mut T>
where
T: SvcClientProcessor + 'static,
{
self.static_channels
.get_by_type_mut::<T>()
.and_then(|channel| channel.channel_processor_downcast_mut())
}

pub fn should_perform_security_upgrade(&self) -> bool {
matches!(self.state, ClientConnectorState::EnhancedSecurityUpgrade { .. })
}
Expand Down
7 changes: 7 additions & 0 deletions crates/ironrdp-dvc/src/client.rs
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,13 @@ impl DrdynvcClient {
self
}

pub fn attach_dynamic_channel<T>(&mut self, channel: T)
where
T: DvcProcessor + 'static,
{
self.dynamic_channels.insert(channel);
}

pub fn get_dvc_by_type_id<T>(&self) -> Option<&DynamicVirtualChannel>
where
T: DvcProcessor,
Expand Down
1 change: 1 addition & 0 deletions ffi/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ diplomat = "0.7"
diplomat-runtime = "0.7"
ironrdp = { path = "../crates/ironrdp", features = ["session", "connector", "dvc", "svc", "rdpdr", "rdpsnd", "graphics", "input", "cliprdr", "displaycontrol"] }
ironrdp-cliprdr-native.path = "../crates/ironrdp-cliprdr-native"
ironrdp-dvc-pipe-proxy.path = "../crates/ironrdp-dvc-pipe-proxy"
ironrdp-core = { path = "../crates/ironrdp-core", features = ["alloc"] }
sspi = { version = "0.16", features = ["network_client"] }
thiserror = "2"
Expand Down
28 changes: 28 additions & 0 deletions ffi/dotnet/Devolutions.IronRdp/Generated/ActiveStage.cs
Original file line number Diff line number Diff line change
Expand Up @@ -217,6 +217,34 @@ public VecU8 SubmitClipboardFormatData(FormatDataResponse formatDataResponse)
}
}

/// <exception cref="IronRdpException"></exception>
/// <returns>
/// A <c>VecU8</c> allocated on Rust side.
/// </returns>
public VecU8 SendDvcPipeProxyMessage(DvcPipeProxyMessage message)
{
unsafe
{
if (_inner == null)
{
throw new ObjectDisposedException("ActiveStage");
}
Raw.DvcPipeProxyMessage* messageRaw;
messageRaw = message.AsFFI();
if (messageRaw == null)
{
throw new ObjectDisposedException("DvcPipeProxyMessage");
}
Raw.SessionFfiResultBoxVecU8BoxIronRdpError result = Raw.ActiveStage.SendDvcPipeProxyMessage(_inner, messageRaw);
if (!result.isOk)
{
throw new IronRdpException(new IronRdpError(result.Err));
}
Raw.VecU8* retVal = result.Ok;
return new VecU8(retVal);
}
}

/// <exception cref="IronRdpException"></exception>
/// <returns>
/// A <c>ActiveStageOutputIterator</c> allocated on Rust side.
Expand Down
23 changes: 23 additions & 0 deletions ffi/dotnet/Devolutions.IronRdp/Generated/ClientConnector.cs
Original file line number Diff line number Diff line change
Expand Up @@ -128,6 +128,29 @@ public void WithDynamicChannelDisplayControl()
}
}

/// <exception cref="IronRdpException"></exception>
public void WithDynamicChannelPipeProxy(DvcPipeProxyConfig config)
{
unsafe
{
if (_inner == null)
{
throw new ObjectDisposedException("ClientConnector");
}
Raw.DvcPipeProxyConfig* configRaw;
configRaw = config.AsFFI();
if (configRaw == null)
{
throw new ObjectDisposedException("DvcPipeProxyConfig");
}
Raw.ConnectorFfiResultVoidBoxIronRdpError result = Raw.ClientConnector.WithDynamicChannelPipeProxy(_inner, configRaw);
if (!result.isOk)
{
throw new IronRdpException(new IronRdpError(result.Err));
}
}
}

/// <exception cref="IronRdpException"></exception>
public bool ShouldPerformSecurityUpgrade()
{
Expand Down
28 changes: 28 additions & 0 deletions ffi/dotnet/Devolutions.IronRdp/Generated/Config.cs
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,14 @@ public partial class Config: IDisposable
{
private unsafe Raw.Config* _inner;

public DvcPipeProxyConfig? DvcPipeProxy
{
get
{
return GetDvcPipeProxy();
}
}

/// <summary>
/// Creates a managed <c>Config</c> from a raw handle.
/// </summary>
Expand All @@ -41,6 +49,26 @@ public static ConfigBuilder GetBuilder()
}
}

/// <returns>
/// A <c>DvcPipeProxyConfig</c> allocated on Rust side.
/// </returns>
public DvcPipeProxyConfig? GetDvcPipeProxy()
{
unsafe
{
if (_inner == null)
{
throw new ObjectDisposedException("Config");
}
Raw.DvcPipeProxyConfig* retVal = Raw.Config.GetDvcPipeProxy(_inner);
if (retVal == null)
{
return null;
}
return new DvcPipeProxyConfig(retVal);
}
}

/// <summary>
/// Returns the underlying raw handle.
/// </summary>
Expand Down
26 changes: 26 additions & 0 deletions ffi/dotnet/Devolutions.IronRdp/Generated/ConfigBuilder.cs
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,14 @@ public string Domain
}
}

public DvcPipeProxyConfig DvcPipeProxy
{
set
{
SetDvcPipeProxy(value);
}
}

public bool EnableCredssp
{
set
Expand Down Expand Up @@ -454,6 +462,24 @@ public void SetPointerSoftwareRendering(bool pointerSoftwareRendering)
}
}

public void SetDvcPipeProxy(DvcPipeProxyConfig dvcPipeProxy)
{
unsafe
{
if (_inner == null)
{
throw new ObjectDisposedException("ConfigBuilder");
}
Raw.DvcPipeProxyConfig* dvcPipeProxyRaw;
dvcPipeProxyRaw = dvcPipeProxy.AsFFI();
if (dvcPipeProxyRaw == null)
{
throw new ObjectDisposedException("DvcPipeProxyConfig");
}
Raw.ConfigBuilder.SetDvcPipeProxy(_inner, dvcPipeProxyRaw);
}
}

/// <exception cref="IronRdpException"></exception>
/// <returns>
/// A <c>Config</c> allocated on Rust side.
Expand Down
123 changes: 123 additions & 0 deletions ffi/dotnet/Devolutions.IronRdp/Generated/DvcPipeProxyConfig.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,123 @@
// <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 DvcPipeProxyConfig: IDisposable
{
private unsafe Raw.DvcPipeProxyConfig* _inner;

public DvcPipeProxyMessageSink MessageSink
{
get
{
return GetMessageSink();
}
}

/// <summary>
/// Creates a managed <c>DvcPipeProxyConfig</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 DvcPipeProxyConfig(Raw.DvcPipeProxyConfig* handle)
{
_inner = handle;
}

/// <returns>
/// A <c>DvcPipeProxyConfig</c> allocated on Rust side.
/// </returns>
public static DvcPipeProxyConfig New(DvcPipeProxyMessageSink messageSink)
{
unsafe
{
Raw.DvcPipeProxyMessageSink* messageSinkRaw;
messageSinkRaw = messageSink.AsFFI();
if (messageSinkRaw == null)
{
throw new ObjectDisposedException("DvcPipeProxyMessageSink");
}
Raw.DvcPipeProxyConfig* retVal = Raw.DvcPipeProxyConfig.New(messageSinkRaw);
return new DvcPipeProxyConfig(retVal);
}
}

public void AddPipeProxy(DvcPipeProxyDescriptor descriptor)
{
unsafe
{
if (_inner == null)
{
throw new ObjectDisposedException("DvcPipeProxyConfig");
}
Raw.DvcPipeProxyDescriptor* descriptorRaw;
descriptorRaw = descriptor.AsFFI();
if (descriptorRaw == null)
{
throw new ObjectDisposedException("DvcPipeProxyDescriptor");
}
Raw.DvcPipeProxyConfig.AddPipeProxy(_inner, descriptorRaw);
}
}

/// <returns>
/// A <c>DvcPipeProxyMessageSink</c> allocated on Rust side.
/// </returns>
public DvcPipeProxyMessageSink GetMessageSink()
{
unsafe
{
if (_inner == null)
{
throw new ObjectDisposedException("DvcPipeProxyConfig");
}
Raw.DvcPipeProxyMessageSink* retVal = Raw.DvcPipeProxyConfig.GetMessageSink(_inner);
return new DvcPipeProxyMessageSink(retVal);
}
}

/// <summary>
/// Returns the underlying raw handle.
/// </summary>
public unsafe Raw.DvcPipeProxyConfig* AsFFI()
{
return _inner;
}

/// <summary>
/// Destroys the underlying object immediately.
/// </summary>
public void Dispose()
{
unsafe
{
if (_inner == null)
{
return;
}

Raw.DvcPipeProxyConfig.Destroy(_inner);
_inner = null;

GC.SuppressFinalize(this);
}
}

~DvcPipeProxyConfig()
{
Dispose();
}
}
Loading
Loading