diff --git a/Cargo.lock b/Cargo.lock
index 42676ca6..f7eebf6a 100644
--- a/Cargo.lock
+++ b/Cargo.lock
@@ -1134,10 +1134,12 @@ dependencies = [
"diplomat-runtime",
"embed-resource",
"ironrdp",
+ "ironrdp-cliprdr-native",
"sspi",
"thiserror",
"tracing",
"tracing-subscriber",
+ "windows 0.48.0",
]
[[package]]
diff --git a/ffi/Cargo.toml b/ffi/Cargo.toml
index 5277dd46..7a42f284 100644
--- a/ffi/Cargo.toml
+++ b/ffi/Cargo.toml
@@ -19,7 +19,8 @@ doctest = false
[dependencies]
diplomat = "0.7.0"
diplomat-runtime = "0.7.0"
-ironrdp = { workspace = true, features = ["connector", "dvc", "svc","rdpdr","rdpsnd","graphics","input"] }
+ironrdp = { workspace = true, features = ["connector", "dvc", "svc","rdpdr","rdpsnd","graphics","input","cliprdr"] }
+ironrdp-cliprdr-native = { workspace = true }
sspi = { workspace = true, features = ["network_client"] }
thiserror.workspace = true
tracing.workspace = true
@@ -27,3 +28,8 @@ tracing-subscriber = { version = "0.3.18", features = ["env-filter"] }
[target.'cfg(windows)'.build-dependencies]
embed-resource = "2.2.0"
+
+[target.'cfg(windows)'.dependencies]
+windows = { version = "0.48", features = [
+ "Win32_Foundation",
+] }
\ No newline at end of file
diff --git a/ffi/dotnet/Devolutions.IronRdp.AvaloniaExample/Devolutions.IronRdp.AvaloniaExample.csproj b/ffi/dotnet/Devolutions.IronRdp.AvaloniaExample/Devolutions.IronRdp.AvaloniaExample.csproj
index d358f1e4..5d0e34f1 100644
--- a/ffi/dotnet/Devolutions.IronRdp.AvaloniaExample/Devolutions.IronRdp.AvaloniaExample.csproj
+++ b/ffi/dotnet/Devolutions.IronRdp.AvaloniaExample/Devolutions.IronRdp.AvaloniaExample.csproj
@@ -9,13 +9,22 @@
true
+
-
+
-
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/ffi/dotnet/Devolutions.IronRdp.AvaloniaExample/MainWindow.axaml.cs b/ffi/dotnet/Devolutions.IronRdp.AvaloniaExample/MainWindow.axaml.cs
index cc0f207a..0a25d07b 100644
--- a/ffi/dotnet/Devolutions.IronRdp.AvaloniaExample/MainWindow.axaml.cs
+++ b/ffi/dotnet/Devolutions.IronRdp.AvaloniaExample/MainWindow.axaml.cs
@@ -7,25 +7,32 @@ using Avalonia.Threading;
using System;
using System.Diagnostics;
using System.Net.Security;
+using System.Runtime.InteropServices;
using System.Threading.Tasks;
+using Avalonia.Markup.Xaml;
namespace Devolutions.IronRdp.AvaloniaExample;
public partial class MainWindow : Window
{
+ WriteableBitmap? _bitmap;
+ Canvas? _canvas;
+ Image? _image;
+ readonly InputDatabase? _inputDatabase = InputDatabase.New();
+ ActiveStage? _activeStage;
+ DecodedImage? _decodedImage;
+ Framed? _framed;
+ WinCliprdr? _cliprdr;
- WriteableBitmap? bitmap;
- Canvas? canvas;
- Image? image;
- InputDatabase? inputDatabase = InputDatabase.New();
- ActiveStage? activeStage;
- DecodedImage? decodedImage;
- Framed? framed;
public MainWindow()
{
InitializeComponent();
this.Opened += OnOpened;
+ }
+ private void InitializeComponent()
+ {
+ AvaloniaXamlLoader.Load(this);
}
private void OnOpened(object? sender, EventArgs e)
@@ -41,54 +48,84 @@ public partial class MainWindow : Window
if (username == null || password == null || domain == null || server == null)
{
- Trace.TraceError("Please set the IRONRDP_USERNAME, IRONRDP_PASSWORD, IRONRDP_DOMAIN, and IRONRDP_SERVER environment variables");
+ Trace.TraceError(
+ "Please set the IRONRDP_USERNAME, IRONRDP_PASSWORD, IRONRDP_DOMAIN, and IRONRDP_SERVER environment variables");
Close();
return;
}
- var width = 1280;
- var height = 800;
+ const int width = 1280;
+ const int height = 800;
- var config = buildConfig(username, password, domain, width, height);
+ var config = BuildConfig(username, password, domain, width, height);
- var task = Connection.Connect(config, server);
- bitmap = new WriteableBitmap(new PixelSize(width, height), new Vector(96, 96), Avalonia.Platform.PixelFormat.Rgba8888, AlphaFormat.Opaque);
- canvas = this.FindControl