Svx$&4Z2MHWm=rO4>c4yzY{R8~!a@Ap5s;N0(BjQIFsY&7iwATYjH6
z;L@4yb^EIPv;(g7ht*fVyX{|%)E(wqJM=bmI*Gnu2-tuGq
z!U*Mrtc7mtU%vfvf9@as;D%rKRsL-MmwU;+dV~7;7YhFmulbbw*HhVR}9qSY^dU3~P>uiEU>0UDQV$j~rvKP2zNUKBl>4(QH&jGFS*N+3
zzxtTUaxa#~;?iUt(|wCKaMxKr?(5V3vF$|iEx+CV`_}LIy>j6@gKrnN#O^-NnYFLr
z+`9XBEPm7&Ju99pQ`j@PN%i$-|6hLVx{BSo7e+j}_maKq_`%<^oGv%7n(TMOmTUSS
zrJ&kiqu0Gp-*@EVcSI?@;hrYk_5yW7n-nL+|hP`
zvse4cL951NA#7afN%v}38h!D4a_Y?6oi=@&S=0A3}Lsm9J+kW3&`kCkm;(U}>u
zrMbMU`tbFK>PE-zOzJ-}DLwqm=KEVVBqh0tY+S68$D6tPU!Bk#p*q_ikKXb6Z5Q%y
zkGOs>EX23$#u3#@@wFd{zc$MzUKHCu;nUOk$6Nn=iTD{e(|gvhhgP50oUhAHy7cNv
z{&|mczfXV7SbX~O67P>oOAm!UeSBD^dryk}y6@`mRxi_ETQTLv4|lJ=4f}Zw4j5jz
z^1tX$yDs0Wdf|jC^RF!uxz-+dq4%TwN}itoGh4#`Di<^z3|z$jXo2+GdI`3F=A7$a
z`MV{Fw5~SXbzN!U>tCl64F2Uy#VxNty`lfX({~Be=U;UE@2@jaLH~9C0VB&7|7W(8
znS?oI=}hTmYxL?ClG16q!g1&WM~|-S7umC>-a71cVoXVF{Z1#YSM`%GSpKaxlf4o6_y4Is@=Yg>76tsD
z&1CT3e8bB*|3jD9wH-3O_0DpE@_+BtOJ@JXwT~D*s1G)npSxds;Wf+tN{hsfHl}$;
z8AV!NdP=2xXtljRKWkQ^y~NU*xD{VjOk&q2OFx{zzN^d7CHT!pv&qVTSkJEgB<}mo
zY-Y>;0DohVwpT3YDf1x>2wzkJiX
zMdHXab-Vl1-*#QNuw>qyMfX5P3r~Ml@-e2}_y43Od
zhX23ip7UNi8$EC4^J9AyTOTbH>s{S_=aXBy|HncJqp*|V$Mn{h`OmYgnihU({=98s
z;ae|#c`~VGW#@CT+w1Ep^79L?29+Pn?>liVE^tHbw!a}Pm1KgAH@&g0ij8lRuy?D8t
z^i3?BOmiw+B0Yk%%gwxtJd29`Q(O!pol1fW^n=1Iij2Y|!YUI@qRLG?L-bP%TynF+
zES<|UEJ7-Bohl7@xdQVtEb}uAy+ShliX*}dyvr?23te2YGJPtNwexb4{QbQHTyota
zyuyN9j9txqLJ~tQ4b4-+iW0+1DvJw)LwLDL%ACR@gUuq-BZ5tGlD(Y*i^DSwTwH^V
z^9w363ab3HO9Nd(^c~HM!%Xwi-NTJTvi-xn3=0d)&5N8;Ov)U2xx&kX{Y)zS{mcy9
zO}&Z@47Gg>eM2L%9FqeL{0pTL;OvP0t`x>4fV5wO|xBt94n*DGrZkgj7$m(
zN_n}0l5&Eb%Bx&_3ezkCjnXR;Ez3+Z$|_7k%)@d+%1ph&@(hdovIAUQa!bsT3e&wk
kw1ZNNLqn6abNoWw{X=bexoizm+%tK(z|rRF=Ylmd0Uw8(e*gdg
literal 0
HcmV?d00001
diff --git a/ffi/dotnet/Devolutions.IronRdp/Generated/ActiveStage.cs b/ffi/dotnet/Devolutions.IronRdp/Generated/ActiveStage.cs
index 105e06c1..dc9fdf32 100644
--- a/ffi/dotnet/Devolutions.IronRdp/Generated/ActiveStage.cs
+++ b/ffi/dotnet/Devolutions.IronRdp/Generated/ActiveStage.cs
@@ -125,6 +125,90 @@ public partial class ActiveStage: IDisposable
}
}
+ ///
+ ///
+ /// A VecU8 allocated on Rust side.
+ ///
+ public VecU8 InitiateClipboardCopy(ClipboardFormatIterator formats)
+ {
+ unsafe
+ {
+ if (_inner == null)
+ {
+ throw new ObjectDisposedException("ActiveStage");
+ }
+ Raw.ClipboardFormatIterator* formatsRaw;
+ formatsRaw = formats.AsFFI();
+ if (formatsRaw == null)
+ {
+ throw new ObjectDisposedException("ClipboardFormatIterator");
+ }
+ Raw.SessionFfiResultBoxVecU8BoxIronRdpError result = Raw.ActiveStage.InitiateClipboardCopy(_inner, formatsRaw);
+ if (!result.isOk)
+ {
+ throw new IronRdpException(new IronRdpError(result.Err));
+ }
+ Raw.VecU8* retVal = result.Ok;
+ return new VecU8(retVal);
+ }
+ }
+
+ ///
+ ///
+ /// A VecU8 allocated on Rust side.
+ ///
+ public VecU8 InitiateClipboardPaste(ClipboardFormatId formatId)
+ {
+ unsafe
+ {
+ if (_inner == null)
+ {
+ throw new ObjectDisposedException("ActiveStage");
+ }
+ Raw.ClipboardFormatId* formatIdRaw;
+ formatIdRaw = formatId.AsFFI();
+ if (formatIdRaw == null)
+ {
+ throw new ObjectDisposedException("ClipboardFormatId");
+ }
+ Raw.SessionFfiResultBoxVecU8BoxIronRdpError result = Raw.ActiveStage.InitiateClipboardPaste(_inner, formatIdRaw);
+ if (!result.isOk)
+ {
+ throw new IronRdpException(new IronRdpError(result.Err));
+ }
+ Raw.VecU8* retVal = result.Ok;
+ return new VecU8(retVal);
+ }
+ }
+
+ ///
+ ///
+ /// A VecU8 allocated on Rust side.
+ ///
+ public VecU8 SubmitClipboardFormatData(FormatDataResponse formatDataResponse)
+ {
+ unsafe
+ {
+ if (_inner == null)
+ {
+ throw new ObjectDisposedException("ActiveStage");
+ }
+ Raw.FormatDataResponse* formatDataResponseRaw;
+ formatDataResponseRaw = formatDataResponse.AsFFI();
+ if (formatDataResponseRaw == null)
+ {
+ throw new ObjectDisposedException("FormatDataResponse");
+ }
+ Raw.SessionFfiResultBoxVecU8BoxIronRdpError result = Raw.ActiveStage.SubmitClipboardFormatData(_inner, formatDataResponseRaw);
+ if (!result.isOk)
+ {
+ throw new IronRdpException(new IronRdpError(result.Err));
+ }
+ Raw.VecU8* retVal = result.Ok;
+ return new VecU8(retVal);
+ }
+ }
+
///
/// Returns the underlying raw handle.
///
diff --git a/ffi/dotnet/Devolutions.IronRdp/Generated/ClientConnector.cs b/ffi/dotnet/Devolutions.IronRdp/Generated/ClientConnector.cs
index bcb08f4c..23345d24 100644
--- a/ffi/dotnet/Devolutions.IronRdp/Generated/ClientConnector.cs
+++ b/ffi/dotnet/Devolutions.IronRdp/Generated/ClientConnector.cs
@@ -257,6 +257,29 @@ public partial class ClientConnector: IDisposable
}
}
+ ///
+ public void AttachStaticCliprdr(Cliprdr cliprdr)
+ {
+ unsafe
+ {
+ if (_inner == null)
+ {
+ throw new ObjectDisposedException("ClientConnector");
+ }
+ Raw.Cliprdr* cliprdrRaw;
+ cliprdrRaw = cliprdr.AsFFI();
+ if (cliprdrRaw == null)
+ {
+ throw new ObjectDisposedException("Cliprdr");
+ }
+ Raw.ConnectorFfiResultVoidBoxIronRdpError result = Raw.ClientConnector.AttachStaticCliprdr(_inner, cliprdrRaw);
+ if (!result.isOk)
+ {
+ throw new IronRdpException(new IronRdpError(result.Err));
+ }
+ }
+ }
+
///
///
/// A PduHint allocated on Rust side.
diff --git a/ffi/dotnet/Devolutions.IronRdp/Generated/ClipboardFormatId.cs b/ffi/dotnet/Devolutions.IronRdp/Generated/ClipboardFormatId.cs
new file mode 100644
index 00000000..29fdadac
--- /dev/null
+++ b/ffi/dotnet/Devolutions.IronRdp/Generated/ClipboardFormatId.cs
@@ -0,0 +1,63 @@
+// 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 ClipboardFormatId: IDisposable
+{
+ private unsafe Raw.ClipboardFormatId* _inner;
+
+ ///
+ /// Creates a managed ClipboardFormatId from a raw handle.
+ ///
+ ///
+ /// Safety: you should not build two managed objects using the same raw handle (may causes use-after-free and double-free).
+ ///
+ /// This constructor assumes the raw struct is allocated on Rust side.
+ /// If implemented, the custom Drop implementation on Rust side WILL run on destruction.
+ ///
+ public unsafe ClipboardFormatId(Raw.ClipboardFormatId* handle)
+ {
+ _inner = handle;
+ }
+
+ ///
+ /// Returns the underlying raw handle.
+ ///
+ public unsafe Raw.ClipboardFormatId* AsFFI()
+ {
+ return _inner;
+ }
+
+ ///
+ /// Destroys the underlying object immediately.
+ ///
+ public void Dispose()
+ {
+ unsafe
+ {
+ if (_inner == null)
+ {
+ return;
+ }
+
+ Raw.ClipboardFormatId.Destroy(_inner);
+ _inner = null;
+
+ GC.SuppressFinalize(this);
+ }
+ }
+
+ ~ClipboardFormatId()
+ {
+ Dispose();
+ }
+}
diff --git a/ffi/dotnet/Devolutions.IronRdp/Generated/ClipboardFormatIterator.cs b/ffi/dotnet/Devolutions.IronRdp/Generated/ClipboardFormatIterator.cs
new file mode 100644
index 00000000..1c44bb9d
--- /dev/null
+++ b/ffi/dotnet/Devolutions.IronRdp/Generated/ClipboardFormatIterator.cs
@@ -0,0 +1,63 @@
+// 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 ClipboardFormatIterator: IDisposable
+{
+ private unsafe Raw.ClipboardFormatIterator* _inner;
+
+ ///
+ /// Creates a managed ClipboardFormatIterator from a raw handle.
+ ///
+ ///
+ /// Safety: you should not build two managed objects using the same raw handle (may causes use-after-free and double-free).
+ ///
+ /// This constructor assumes the raw struct is allocated on Rust side.
+ /// If implemented, the custom Drop implementation on Rust side WILL run on destruction.
+ ///
+ public unsafe ClipboardFormatIterator(Raw.ClipboardFormatIterator* handle)
+ {
+ _inner = handle;
+ }
+
+ ///
+ /// Returns the underlying raw handle.
+ ///
+ public unsafe Raw.ClipboardFormatIterator* AsFFI()
+ {
+ return _inner;
+ }
+
+ ///
+ /// Destroys the underlying object immediately.
+ ///
+ public void Dispose()
+ {
+ unsafe
+ {
+ if (_inner == null)
+ {
+ return;
+ }
+
+ Raw.ClipboardFormatIterator.Destroy(_inner);
+ _inner = null;
+
+ GC.SuppressFinalize(this);
+ }
+ }
+
+ ~ClipboardFormatIterator()
+ {
+ Dispose();
+ }
+}
diff --git a/ffi/dotnet/Devolutions.IronRdp/Generated/ClipboardMessage.cs b/ffi/dotnet/Devolutions.IronRdp/Generated/ClipboardMessage.cs
new file mode 100644
index 00000000..5d0441ce
--- /dev/null
+++ b/ffi/dotnet/Devolutions.IronRdp/Generated/ClipboardMessage.cs
@@ -0,0 +1,171 @@
+// 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 ClipboardMessage: IDisposable
+{
+ private unsafe Raw.ClipboardMessage* _inner;
+
+ public ClipboardMessageType MessageType
+ {
+ get
+ {
+ return GetMessageType();
+ }
+ }
+
+ public FormatDataResponse? SendFormatData
+ {
+ get
+ {
+ return GetSendFormatData();
+ }
+ }
+
+ public ClipboardFormatIterator? SendInitiateCopy
+ {
+ get
+ {
+ return GetSendInitiateCopy();
+ }
+ }
+
+ public ClipboardFormatId? SendInitiatePaste
+ {
+ get
+ {
+ return GetSendInitiatePaste();
+ }
+ }
+
+ ///
+ /// Creates a managed ClipboardMessage from a raw handle.
+ ///
+ ///
+ /// Safety: you should not build two managed objects using the same raw handle (may causes use-after-free and double-free).
+ ///
+ /// This constructor assumes the raw struct is allocated on Rust side.
+ /// If implemented, the custom Drop implementation on Rust side WILL run on destruction.
+ ///
+ public unsafe ClipboardMessage(Raw.ClipboardMessage* handle)
+ {
+ _inner = handle;
+ }
+
+ ///
+ /// A ClipboardMessageType allocated on C# side.
+ ///
+ public ClipboardMessageType GetMessageType()
+ {
+ unsafe
+ {
+ if (_inner == null)
+ {
+ throw new ObjectDisposedException("ClipboardMessage");
+ }
+ Raw.ClipboardMessageType retVal = Raw.ClipboardMessage.GetMessageType(_inner);
+ return (ClipboardMessageType)retVal;
+ }
+ }
+
+ ///
+ /// A ClipboardFormatIterator allocated on Rust side.
+ ///
+ public ClipboardFormatIterator? GetSendInitiateCopy()
+ {
+ unsafe
+ {
+ if (_inner == null)
+ {
+ throw new ObjectDisposedException("ClipboardMessage");
+ }
+ Raw.ClipboardFormatIterator* retVal = Raw.ClipboardMessage.GetSendInitiateCopy(_inner);
+ if (retVal == null)
+ {
+ return null;
+ }
+ return new ClipboardFormatIterator(retVal);
+ }
+ }
+
+ ///
+ /// A FormatDataResponse allocated on Rust side.
+ ///
+ public FormatDataResponse? GetSendFormatData()
+ {
+ unsafe
+ {
+ if (_inner == null)
+ {
+ throw new ObjectDisposedException("ClipboardMessage");
+ }
+ Raw.FormatDataResponse* retVal = Raw.ClipboardMessage.GetSendFormatData(_inner);
+ if (retVal == null)
+ {
+ return null;
+ }
+ return new FormatDataResponse(retVal);
+ }
+ }
+
+ ///
+ /// A ClipboardFormatId allocated on Rust side.
+ ///
+ public ClipboardFormatId? GetSendInitiatePaste()
+ {
+ unsafe
+ {
+ if (_inner == null)
+ {
+ throw new ObjectDisposedException("ClipboardMessage");
+ }
+ Raw.ClipboardFormatId* retVal = Raw.ClipboardMessage.GetSendInitiatePaste(_inner);
+ if (retVal == null)
+ {
+ return null;
+ }
+ return new ClipboardFormatId(retVal);
+ }
+ }
+
+ ///
+ /// Returns the underlying raw handle.
+ ///
+ public unsafe Raw.ClipboardMessage* AsFFI()
+ {
+ return _inner;
+ }
+
+ ///
+ /// Destroys the underlying object immediately.
+ ///
+ public void Dispose()
+ {
+ unsafe
+ {
+ if (_inner == null)
+ {
+ return;
+ }
+
+ Raw.ClipboardMessage.Destroy(_inner);
+ _inner = null;
+
+ GC.SuppressFinalize(this);
+ }
+ }
+
+ ~ClipboardMessage()
+ {
+ Dispose();
+ }
+}
diff --git a/ffi/dotnet/Devolutions.IronRdp/Generated/ClipboardMessageType.cs b/ffi/dotnet/Devolutions.IronRdp/Generated/ClipboardMessageType.cs
new file mode 100644
index 00000000..8c2b901e
--- /dev/null
+++ b/ffi/dotnet/Devolutions.IronRdp/Generated/ClipboardMessageType.cs
@@ -0,0 +1,20 @@
+// 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 enum ClipboardMessageType
+{
+ SendInitiateCopy = 0,
+ SendFormatData = 1,
+ SendInitiatePaste = 2,
+ Error = 3,
+}
diff --git a/ffi/dotnet/Devolutions.IronRdp/Generated/ClipboardSvgMessage.cs b/ffi/dotnet/Devolutions.IronRdp/Generated/ClipboardSvgMessage.cs
new file mode 100644
index 00000000..676f4ac0
--- /dev/null
+++ b/ffi/dotnet/Devolutions.IronRdp/Generated/ClipboardSvgMessage.cs
@@ -0,0 +1,63 @@
+// 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 ClipboardSvgMessage: IDisposable
+{
+ private unsafe Raw.ClipboardSvgMessage* _inner;
+
+ ///
+ /// Creates a managed ClipboardSvgMessage from a raw handle.
+ ///
+ ///
+ /// Safety: you should not build two managed objects using the same raw handle (may causes use-after-free and double-free).
+ ///
+ /// This constructor assumes the raw struct is allocated on Rust side.
+ /// If implemented, the custom Drop implementation on Rust side WILL run on destruction.
+ ///
+ public unsafe ClipboardSvgMessage(Raw.ClipboardSvgMessage* handle)
+ {
+ _inner = handle;
+ }
+
+ ///
+ /// Returns the underlying raw handle.
+ ///
+ public unsafe Raw.ClipboardSvgMessage* AsFFI()
+ {
+ return _inner;
+ }
+
+ ///
+ /// Destroys the underlying object immediately.
+ ///
+ public void Dispose()
+ {
+ unsafe
+ {
+ if (_inner == null)
+ {
+ return;
+ }
+
+ Raw.ClipboardSvgMessage.Destroy(_inner);
+ _inner = null;
+
+ GC.SuppressFinalize(this);
+ }
+ }
+
+ ~ClipboardSvgMessage()
+ {
+ Dispose();
+ }
+}
diff --git a/ffi/dotnet/Devolutions.IronRdp/Generated/Cliprdr.cs b/ffi/dotnet/Devolutions.IronRdp/Generated/Cliprdr.cs
new file mode 100644
index 00000000..c2bff3d1
--- /dev/null
+++ b/ffi/dotnet/Devolutions.IronRdp/Generated/Cliprdr.cs
@@ -0,0 +1,63 @@
+// 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 Cliprdr: IDisposable
+{
+ private unsafe Raw.Cliprdr* _inner;
+
+ ///
+ /// Creates a managed Cliprdr from a raw handle.
+ ///
+ ///
+ /// Safety: you should not build two managed objects using the same raw handle (may causes use-after-free and double-free).
+ ///
+ /// This constructor assumes the raw struct is allocated on Rust side.
+ /// If implemented, the custom Drop implementation on Rust side WILL run on destruction.
+ ///
+ public unsafe Cliprdr(Raw.Cliprdr* handle)
+ {
+ _inner = handle;
+ }
+
+ ///
+ /// Returns the underlying raw handle.
+ ///
+ public unsafe Raw.Cliprdr* AsFFI()
+ {
+ return _inner;
+ }
+
+ ///
+ /// Destroys the underlying object immediately.
+ ///
+ public void Dispose()
+ {
+ unsafe
+ {
+ if (_inner == null)
+ {
+ return;
+ }
+
+ Raw.Cliprdr.Destroy(_inner);
+ _inner = null;
+
+ GC.SuppressFinalize(this);
+ }
+ }
+
+ ~Cliprdr()
+ {
+ Dispose();
+ }
+}
diff --git a/ffi/dotnet/Devolutions.IronRdp/Generated/CliprdrBackendFactory.cs b/ffi/dotnet/Devolutions.IronRdp/Generated/CliprdrBackendFactory.cs
new file mode 100644
index 00000000..3ca080c2
--- /dev/null
+++ b/ffi/dotnet/Devolutions.IronRdp/Generated/CliprdrBackendFactory.cs
@@ -0,0 +1,79 @@
+// 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 CliprdrBackendFactory: IDisposable
+{
+ private unsafe Raw.CliprdrBackendFactory* _inner;
+
+ ///
+ /// Creates a managed CliprdrBackendFactory from a raw handle.
+ ///
+ ///
+ /// Safety: you should not build two managed objects using the same raw handle (may causes use-after-free and double-free).
+ ///
+ /// This constructor assumes the raw struct is allocated on Rust side.
+ /// If implemented, the custom Drop implementation on Rust side WILL run on destruction.
+ ///
+ public unsafe CliprdrBackendFactory(Raw.CliprdrBackendFactory* handle)
+ {
+ _inner = handle;
+ }
+
+ ///
+ /// A Cliprdr allocated on Rust side.
+ ///
+ public Cliprdr BuildCliprdr()
+ {
+ unsafe
+ {
+ if (_inner == null)
+ {
+ throw new ObjectDisposedException("CliprdrBackendFactory");
+ }
+ Raw.Cliprdr* retVal = Raw.CliprdrBackendFactory.BuildCliprdr(_inner);
+ return new Cliprdr(retVal);
+ }
+ }
+
+ ///
+ /// Returns the underlying raw handle.
+ ///
+ public unsafe Raw.CliprdrBackendFactory* AsFFI()
+ {
+ return _inner;
+ }
+
+ ///
+ /// Destroys the underlying object immediately.
+ ///
+ public void Dispose()
+ {
+ unsafe
+ {
+ if (_inner == null)
+ {
+ return;
+ }
+
+ Raw.CliprdrBackendFactory.Destroy(_inner);
+ _inner = null;
+
+ GC.SuppressFinalize(this);
+ }
+ }
+
+ ~CliprdrBackendFactory()
+ {
+ Dispose();
+ }
+}
diff --git a/ffi/dotnet/Devolutions.IronRdp/Generated/FormatDataResponse.cs b/ffi/dotnet/Devolutions.IronRdp/Generated/FormatDataResponse.cs
new file mode 100644
index 00000000..afeff1bc
--- /dev/null
+++ b/ffi/dotnet/Devolutions.IronRdp/Generated/FormatDataResponse.cs
@@ -0,0 +1,63 @@
+// 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 FormatDataResponse: IDisposable
+{
+ private unsafe Raw.FormatDataResponse* _inner;
+
+ ///
+ /// Creates a managed FormatDataResponse from a raw handle.
+ ///
+ ///
+ /// Safety: you should not build two managed objects using the same raw handle (may causes use-after-free and double-free).
+ ///
+ /// This constructor assumes the raw struct is allocated on Rust side.
+ /// If implemented, the custom Drop implementation on Rust side WILL run on destruction.
+ ///
+ public unsafe FormatDataResponse(Raw.FormatDataResponse* handle)
+ {
+ _inner = handle;
+ }
+
+ ///
+ /// Returns the underlying raw handle.
+ ///
+ public unsafe Raw.FormatDataResponse* AsFFI()
+ {
+ return _inner;
+ }
+
+ ///
+ /// Destroys the underlying object immediately.
+ ///
+ public void Dispose()
+ {
+ unsafe
+ {
+ if (_inner == null)
+ {
+ return;
+ }
+
+ Raw.FormatDataResponse.Destroy(_inner);
+ _inner = null;
+
+ GC.SuppressFinalize(this);
+ }
+ }
+
+ ~FormatDataResponse()
+ {
+ Dispose();
+ }
+}
diff --git a/ffi/dotnet/Devolutions.IronRdp/Generated/IronRdpErrorKind.cs b/ffi/dotnet/Devolutions.IronRdp/Generated/IronRdpErrorKind.cs
index 2b20bdac..bb2d219c 100644
--- a/ffi/dotnet/Devolutions.IronRdp/Generated/IronRdpErrorKind.cs
+++ b/ffi/dotnet/Devolutions.IronRdp/Generated/IronRdpErrorKind.cs
@@ -20,4 +20,6 @@ public enum IronRdpErrorKind
IO = 4,
AccessDenied = 5,
IncorrectEnumType = 6,
+ Clipboard = 7,
+ WrongOS = 8,
}
diff --git a/ffi/dotnet/Devolutions.IronRdp/Generated/RawActiveStage.cs b/ffi/dotnet/Devolutions.IronRdp/Generated/RawActiveStage.cs
index ddda9e5e..b41c328a 100644
--- a/ffi/dotnet/Devolutions.IronRdp/Generated/RawActiveStage.cs
+++ b/ffi/dotnet/Devolutions.IronRdp/Generated/RawActiveStage.cs
@@ -25,6 +25,15 @@ public partial struct ActiveStage
[DllImport(NativeLib, CallingConvention = CallingConvention.Cdecl, EntryPoint = "ActiveStage_process_fastpath_input", ExactSpelling = true)]
public static unsafe extern SessionFfiResultBoxActiveStageOutputIteratorBoxIronRdpError ProcessFastpathInput(ActiveStage* self, DecodedImage* image, FastPathInputEventIterator* fastpathInput);
+ [DllImport(NativeLib, CallingConvention = CallingConvention.Cdecl, EntryPoint = "ActiveStage_initiate_clipboard_copy", ExactSpelling = true)]
+ public static unsafe extern SessionFfiResultBoxVecU8BoxIronRdpError InitiateClipboardCopy(ActiveStage* self, ClipboardFormatIterator* formats);
+
+ [DllImport(NativeLib, CallingConvention = CallingConvention.Cdecl, EntryPoint = "ActiveStage_initiate_clipboard_paste", ExactSpelling = true)]
+ public static unsafe extern SessionFfiResultBoxVecU8BoxIronRdpError InitiateClipboardPaste(ActiveStage* self, ClipboardFormatId* formatId);
+
+ [DllImport(NativeLib, CallingConvention = CallingConvention.Cdecl, EntryPoint = "ActiveStage_submit_clipboard_format_data", ExactSpelling = true)]
+ public static unsafe extern SessionFfiResultBoxVecU8BoxIronRdpError SubmitClipboardFormatData(ActiveStage* self, FormatDataResponse* formatDataResponse);
+
[DllImport(NativeLib, CallingConvention = CallingConvention.Cdecl, EntryPoint = "ActiveStage_destroy", ExactSpelling = true)]
public static unsafe extern void Destroy(ActiveStage* self);
}
diff --git a/ffi/dotnet/Devolutions.IronRdp/Generated/RawClientConnector.cs b/ffi/dotnet/Devolutions.IronRdp/Generated/RawClientConnector.cs
index ee4a2445..b1cff30f 100644
--- a/ffi/dotnet/Devolutions.IronRdp/Generated/RawClientConnector.cs
+++ b/ffi/dotnet/Devolutions.IronRdp/Generated/RawClientConnector.cs
@@ -55,6 +55,9 @@ public partial struct ClientConnector
[DllImport(NativeLib, CallingConvention = CallingConvention.Cdecl, EntryPoint = "ClientConnector_step_no_input", ExactSpelling = true)]
public static unsafe extern ConnectorFfiResultBoxWrittenBoxIronRdpError StepNoInput(ClientConnector* self, WriteBuf* writeBuf);
+ [DllImport(NativeLib, CallingConvention = CallingConvention.Cdecl, EntryPoint = "ClientConnector_attach_static_cliprdr", ExactSpelling = true)]
+ public static unsafe extern ConnectorFfiResultVoidBoxIronRdpError AttachStaticCliprdr(ClientConnector* self, Cliprdr* cliprdr);
+
[DllImport(NativeLib, CallingConvention = CallingConvention.Cdecl, EntryPoint = "ClientConnector_next_pdu_hint", ExactSpelling = true)]
public static unsafe extern ConnectorFfiResultOptBoxPduHintBoxIronRdpError NextPduHint(ClientConnector* self);
diff --git a/ffi/dotnet/Devolutions.IronRdp/Generated/RawClipboardFormatId.cs b/ffi/dotnet/Devolutions.IronRdp/Generated/RawClipboardFormatId.cs
new file mode 100644
index 00000000..cd17daed
--- /dev/null
+++ b/ffi/dotnet/Devolutions.IronRdp/Generated/RawClipboardFormatId.cs
@@ -0,0 +1,21 @@
+// by Diplomat
+
+#pragma warning disable 0105
+using System;
+using System.Runtime.InteropServices;
+
+using Devolutions.IronRdp.Diplomat;
+#pragma warning restore 0105
+
+namespace Devolutions.IronRdp.Raw;
+
+#nullable enable
+
+[StructLayout(LayoutKind.Sequential)]
+public partial struct ClipboardFormatId
+{
+ private const string NativeLib = "DevolutionsIronRdp";
+
+ [DllImport(NativeLib, CallingConvention = CallingConvention.Cdecl, EntryPoint = "ClipboardFormatId_destroy", ExactSpelling = true)]
+ public static unsafe extern void Destroy(ClipboardFormatId* self);
+}
diff --git a/ffi/dotnet/Devolutions.IronRdp/Generated/RawClipboardFormatIterator.cs b/ffi/dotnet/Devolutions.IronRdp/Generated/RawClipboardFormatIterator.cs
new file mode 100644
index 00000000..f11d7e0a
--- /dev/null
+++ b/ffi/dotnet/Devolutions.IronRdp/Generated/RawClipboardFormatIterator.cs
@@ -0,0 +1,21 @@
+// by Diplomat
+
+#pragma warning disable 0105
+using System;
+using System.Runtime.InteropServices;
+
+using Devolutions.IronRdp.Diplomat;
+#pragma warning restore 0105
+
+namespace Devolutions.IronRdp.Raw;
+
+#nullable enable
+
+[StructLayout(LayoutKind.Sequential)]
+public partial struct ClipboardFormatIterator
+{
+ private const string NativeLib = "DevolutionsIronRdp";
+
+ [DllImport(NativeLib, CallingConvention = CallingConvention.Cdecl, EntryPoint = "ClipboardFormatIterator_destroy", ExactSpelling = true)]
+ public static unsafe extern void Destroy(ClipboardFormatIterator* self);
+}
diff --git a/ffi/dotnet/Devolutions.IronRdp/Generated/RawClipboardMessage.cs b/ffi/dotnet/Devolutions.IronRdp/Generated/RawClipboardMessage.cs
new file mode 100644
index 00000000..e674a18f
--- /dev/null
+++ b/ffi/dotnet/Devolutions.IronRdp/Generated/RawClipboardMessage.cs
@@ -0,0 +1,33 @@
+// by Diplomat
+
+#pragma warning disable 0105
+using System;
+using System.Runtime.InteropServices;
+
+using Devolutions.IronRdp.Diplomat;
+#pragma warning restore 0105
+
+namespace Devolutions.IronRdp.Raw;
+
+#nullable enable
+
+[StructLayout(LayoutKind.Sequential)]
+public partial struct ClipboardMessage
+{
+ private const string NativeLib = "DevolutionsIronRdp";
+
+ [DllImport(NativeLib, CallingConvention = CallingConvention.Cdecl, EntryPoint = "ClipboardMessage_get_message_type", ExactSpelling = true)]
+ public static unsafe extern ClipboardMessageType GetMessageType(ClipboardMessage* self);
+
+ [DllImport(NativeLib, CallingConvention = CallingConvention.Cdecl, EntryPoint = "ClipboardMessage_get_send_initiate_copy", ExactSpelling = true)]
+ public static unsafe extern ClipboardFormatIterator* GetSendInitiateCopy(ClipboardMessage* self);
+
+ [DllImport(NativeLib, CallingConvention = CallingConvention.Cdecl, EntryPoint = "ClipboardMessage_get_send_format_data", ExactSpelling = true)]
+ public static unsafe extern FormatDataResponse* GetSendFormatData(ClipboardMessage* self);
+
+ [DllImport(NativeLib, CallingConvention = CallingConvention.Cdecl, EntryPoint = "ClipboardMessage_get_send_initiate_paste", ExactSpelling = true)]
+ public static unsafe extern ClipboardFormatId* GetSendInitiatePaste(ClipboardMessage* self);
+
+ [DllImport(NativeLib, CallingConvention = CallingConvention.Cdecl, EntryPoint = "ClipboardMessage_destroy", ExactSpelling = true)]
+ public static unsafe extern void Destroy(ClipboardMessage* self);
+}
diff --git a/ffi/dotnet/Devolutions.IronRdp/Generated/RawClipboardMessageType.cs b/ffi/dotnet/Devolutions.IronRdp/Generated/RawClipboardMessageType.cs
new file mode 100644
index 00000000..17c6ac37
--- /dev/null
+++ b/ffi/dotnet/Devolutions.IronRdp/Generated/RawClipboardMessageType.cs
@@ -0,0 +1,20 @@
+// by Diplomat
+
+#pragma warning disable 0105
+using System;
+using System.Runtime.InteropServices;
+
+using Devolutions.IronRdp.Diplomat;
+#pragma warning restore 0105
+
+namespace Devolutions.IronRdp.Raw;
+
+#nullable enable
+
+public enum ClipboardMessageType
+{
+ SendInitiateCopy = 0,
+ SendFormatData = 1,
+ SendInitiatePaste = 2,
+ Error = 3,
+}
diff --git a/ffi/dotnet/Devolutions.IronRdp/Generated/RawClipboardSvgMessage.cs b/ffi/dotnet/Devolutions.IronRdp/Generated/RawClipboardSvgMessage.cs
new file mode 100644
index 00000000..77001bad
--- /dev/null
+++ b/ffi/dotnet/Devolutions.IronRdp/Generated/RawClipboardSvgMessage.cs
@@ -0,0 +1,21 @@
+// by Diplomat
+
+#pragma warning disable 0105
+using System;
+using System.Runtime.InteropServices;
+
+using Devolutions.IronRdp.Diplomat;
+#pragma warning restore 0105
+
+namespace Devolutions.IronRdp.Raw;
+
+#nullable enable
+
+[StructLayout(LayoutKind.Sequential)]
+public partial struct ClipboardSvgMessage
+{
+ private const string NativeLib = "DevolutionsIronRdp";
+
+ [DllImport(NativeLib, CallingConvention = CallingConvention.Cdecl, EntryPoint = "ClipboardSvgMessage_destroy", ExactSpelling = true)]
+ public static unsafe extern void Destroy(ClipboardSvgMessage* self);
+}
diff --git a/ffi/dotnet/Devolutions.IronRdp/Generated/RawClipboardWindowsFfiResultBoxClipboardMessageBoxIronRdpError.cs b/ffi/dotnet/Devolutions.IronRdp/Generated/RawClipboardWindowsFfiResultBoxClipboardMessageBoxIronRdpError.cs
new file mode 100644
index 00000000..52423479
--- /dev/null
+++ b/ffi/dotnet/Devolutions.IronRdp/Generated/RawClipboardWindowsFfiResultBoxClipboardMessageBoxIronRdpError.cs
@@ -0,0 +1,46 @@
+// by Diplomat
+
+#pragma warning disable 0105
+using System;
+using System.Runtime.InteropServices;
+
+using Devolutions.IronRdp.Diplomat;
+#pragma warning restore 0105
+
+namespace Devolutions.IronRdp.Raw;
+
+#nullable enable
+
+[StructLayout(LayoutKind.Sequential)]
+public partial struct ClipboardWindowsFfiResultBoxClipboardMessageBoxIronRdpError
+{
+ [StructLayout(LayoutKind.Explicit)]
+ private unsafe struct InnerUnion
+ {
+ [FieldOffset(0)]
+ internal ClipboardMessage* ok;
+ [FieldOffset(0)]
+ internal IronRdpError* err;
+ }
+
+ private InnerUnion _inner;
+
+ [MarshalAs(UnmanagedType.U1)]
+ public bool isOk;
+
+ public unsafe ClipboardMessage* Ok
+ {
+ get
+ {
+ return _inner.ok;
+ }
+ }
+
+ public unsafe IronRdpError* Err
+ {
+ get
+ {
+ return _inner.err;
+ }
+ }
+}
diff --git a/ffi/dotnet/Devolutions.IronRdp/Generated/RawClipboardWindowsFfiResultBoxCliprdrBackendFactoryBoxIronRdpError.cs b/ffi/dotnet/Devolutions.IronRdp/Generated/RawClipboardWindowsFfiResultBoxCliprdrBackendFactoryBoxIronRdpError.cs
new file mode 100644
index 00000000..6273f969
--- /dev/null
+++ b/ffi/dotnet/Devolutions.IronRdp/Generated/RawClipboardWindowsFfiResultBoxCliprdrBackendFactoryBoxIronRdpError.cs
@@ -0,0 +1,46 @@
+// by Diplomat
+
+#pragma warning disable 0105
+using System;
+using System.Runtime.InteropServices;
+
+using Devolutions.IronRdp.Diplomat;
+#pragma warning restore 0105
+
+namespace Devolutions.IronRdp.Raw;
+
+#nullable enable
+
+[StructLayout(LayoutKind.Sequential)]
+public partial struct ClipboardWindowsFfiResultBoxCliprdrBackendFactoryBoxIronRdpError
+{
+ [StructLayout(LayoutKind.Explicit)]
+ private unsafe struct InnerUnion
+ {
+ [FieldOffset(0)]
+ internal CliprdrBackendFactory* ok;
+ [FieldOffset(0)]
+ internal IronRdpError* err;
+ }
+
+ private InnerUnion _inner;
+
+ [MarshalAs(UnmanagedType.U1)]
+ public bool isOk;
+
+ public unsafe CliprdrBackendFactory* Ok
+ {
+ get
+ {
+ return _inner.ok;
+ }
+ }
+
+ public unsafe IronRdpError* Err
+ {
+ get
+ {
+ return _inner.err;
+ }
+ }
+}
diff --git a/ffi/dotnet/Devolutions.IronRdp/Generated/RawClipboardWindowsFfiResultBoxWinCliprdrBoxIronRdpError.cs b/ffi/dotnet/Devolutions.IronRdp/Generated/RawClipboardWindowsFfiResultBoxWinCliprdrBoxIronRdpError.cs
new file mode 100644
index 00000000..d6ee33da
--- /dev/null
+++ b/ffi/dotnet/Devolutions.IronRdp/Generated/RawClipboardWindowsFfiResultBoxWinCliprdrBoxIronRdpError.cs
@@ -0,0 +1,46 @@
+// by Diplomat
+
+#pragma warning disable 0105
+using System;
+using System.Runtime.InteropServices;
+
+using Devolutions.IronRdp.Diplomat;
+#pragma warning restore 0105
+
+namespace Devolutions.IronRdp.Raw;
+
+#nullable enable
+
+[StructLayout(LayoutKind.Sequential)]
+public partial struct ClipboardWindowsFfiResultBoxWinCliprdrBoxIronRdpError
+{
+ [StructLayout(LayoutKind.Explicit)]
+ private unsafe struct InnerUnion
+ {
+ [FieldOffset(0)]
+ internal WinCliprdr* ok;
+ [FieldOffset(0)]
+ internal IronRdpError* err;
+ }
+
+ private InnerUnion _inner;
+
+ [MarshalAs(UnmanagedType.U1)]
+ public bool isOk;
+
+ public unsafe WinCliprdr* Ok
+ {
+ get
+ {
+ return _inner.ok;
+ }
+ }
+
+ public unsafe IronRdpError* Err
+ {
+ get
+ {
+ return _inner.err;
+ }
+ }
+}
diff --git a/ffi/dotnet/Devolutions.IronRdp/Generated/RawClipboardWindowsFfiResultOptBoxClipboardMessageBoxIronRdpError.cs b/ffi/dotnet/Devolutions.IronRdp/Generated/RawClipboardWindowsFfiResultOptBoxClipboardMessageBoxIronRdpError.cs
new file mode 100644
index 00000000..d8f1c9b8
--- /dev/null
+++ b/ffi/dotnet/Devolutions.IronRdp/Generated/RawClipboardWindowsFfiResultOptBoxClipboardMessageBoxIronRdpError.cs
@@ -0,0 +1,46 @@
+// by Diplomat
+
+#pragma warning disable 0105
+using System;
+using System.Runtime.InteropServices;
+
+using Devolutions.IronRdp.Diplomat;
+#pragma warning restore 0105
+
+namespace Devolutions.IronRdp.Raw;
+
+#nullable enable
+
+[StructLayout(LayoutKind.Sequential)]
+public partial struct ClipboardWindowsFfiResultOptBoxClipboardMessageBoxIronRdpError
+{
+ [StructLayout(LayoutKind.Explicit)]
+ private unsafe struct InnerUnion
+ {
+ [FieldOffset(0)]
+ internal ClipboardMessage* ok;
+ [FieldOffset(0)]
+ internal IronRdpError* err;
+ }
+
+ private InnerUnion _inner;
+
+ [MarshalAs(UnmanagedType.U1)]
+ public bool isOk;
+
+ public unsafe ClipboardMessage* Ok
+ {
+ get
+ {
+ return _inner.ok;
+ }
+ }
+
+ public unsafe IronRdpError* Err
+ {
+ get
+ {
+ return _inner.err;
+ }
+ }
+}
diff --git a/ffi/dotnet/Devolutions.IronRdp/Generated/RawCliprdr.cs b/ffi/dotnet/Devolutions.IronRdp/Generated/RawCliprdr.cs
new file mode 100644
index 00000000..7db8d1f3
--- /dev/null
+++ b/ffi/dotnet/Devolutions.IronRdp/Generated/RawCliprdr.cs
@@ -0,0 +1,21 @@
+// by Diplomat
+
+#pragma warning disable 0105
+using System;
+using System.Runtime.InteropServices;
+
+using Devolutions.IronRdp.Diplomat;
+#pragma warning restore 0105
+
+namespace Devolutions.IronRdp.Raw;
+
+#nullable enable
+
+[StructLayout(LayoutKind.Sequential)]
+public partial struct Cliprdr
+{
+ private const string NativeLib = "DevolutionsIronRdp";
+
+ [DllImport(NativeLib, CallingConvention = CallingConvention.Cdecl, EntryPoint = "Cliprdr_destroy", ExactSpelling = true)]
+ public static unsafe extern void Destroy(Cliprdr* self);
+}
diff --git a/ffi/dotnet/Devolutions.IronRdp/Generated/RawCliprdrBackendFactory.cs b/ffi/dotnet/Devolutions.IronRdp/Generated/RawCliprdrBackendFactory.cs
new file mode 100644
index 00000000..4fa04c30
--- /dev/null
+++ b/ffi/dotnet/Devolutions.IronRdp/Generated/RawCliprdrBackendFactory.cs
@@ -0,0 +1,24 @@
+// by Diplomat
+
+#pragma warning disable 0105
+using System;
+using System.Runtime.InteropServices;
+
+using Devolutions.IronRdp.Diplomat;
+#pragma warning restore 0105
+
+namespace Devolutions.IronRdp.Raw;
+
+#nullable enable
+
+[StructLayout(LayoutKind.Sequential)]
+public partial struct CliprdrBackendFactory
+{
+ private const string NativeLib = "DevolutionsIronRdp";
+
+ [DllImport(NativeLib, CallingConvention = CallingConvention.Cdecl, EntryPoint = "CliprdrBackendFactory_build_cliprdr", ExactSpelling = true)]
+ public static unsafe extern Cliprdr* BuildCliprdr(CliprdrBackendFactory* self);
+
+ [DllImport(NativeLib, CallingConvention = CallingConvention.Cdecl, EntryPoint = "CliprdrBackendFactory_destroy", ExactSpelling = true)]
+ public static unsafe extern void Destroy(CliprdrBackendFactory* self);
+}
diff --git a/ffi/dotnet/Devolutions.IronRdp/Generated/RawFormatDataResponse.cs b/ffi/dotnet/Devolutions.IronRdp/Generated/RawFormatDataResponse.cs
new file mode 100644
index 00000000..3d85b3f3
--- /dev/null
+++ b/ffi/dotnet/Devolutions.IronRdp/Generated/RawFormatDataResponse.cs
@@ -0,0 +1,21 @@
+// by Diplomat
+
+#pragma warning disable 0105
+using System;
+using System.Runtime.InteropServices;
+
+using Devolutions.IronRdp.Diplomat;
+#pragma warning restore 0105
+
+namespace Devolutions.IronRdp.Raw;
+
+#nullable enable
+
+[StructLayout(LayoutKind.Sequential)]
+public partial struct FormatDataResponse
+{
+ private const string NativeLib = "DevolutionsIronRdp";
+
+ [DllImport(NativeLib, CallingConvention = CallingConvention.Cdecl, EntryPoint = "FormatDataResponse_destroy", ExactSpelling = true)]
+ public static unsafe extern void Destroy(FormatDataResponse* self);
+}
diff --git a/ffi/dotnet/Devolutions.IronRdp/Generated/RawIronRdpErrorKind.cs b/ffi/dotnet/Devolutions.IronRdp/Generated/RawIronRdpErrorKind.cs
index 045a9aed..d9056006 100644
--- a/ffi/dotnet/Devolutions.IronRdp/Generated/RawIronRdpErrorKind.cs
+++ b/ffi/dotnet/Devolutions.IronRdp/Generated/RawIronRdpErrorKind.cs
@@ -20,4 +20,6 @@ public enum IronRdpErrorKind
IO = 4,
AccessDenied = 5,
IncorrectEnumType = 6,
+ Clipboard = 7,
+ WrongOS = 8,
}
diff --git a/ffi/dotnet/Devolutions.IronRdp/Generated/RawSessionFfiResultBoxVecU8BoxIronRdpError.cs b/ffi/dotnet/Devolutions.IronRdp/Generated/RawSessionFfiResultBoxVecU8BoxIronRdpError.cs
new file mode 100644
index 00000000..a3b9a0e6
--- /dev/null
+++ b/ffi/dotnet/Devolutions.IronRdp/Generated/RawSessionFfiResultBoxVecU8BoxIronRdpError.cs
@@ -0,0 +1,46 @@
+// by Diplomat
+
+#pragma warning disable 0105
+using System;
+using System.Runtime.InteropServices;
+
+using Devolutions.IronRdp.Diplomat;
+#pragma warning restore 0105
+
+namespace Devolutions.IronRdp.Raw;
+
+#nullable enable
+
+[StructLayout(LayoutKind.Sequential)]
+public partial struct SessionFfiResultBoxVecU8BoxIronRdpError
+{
+ [StructLayout(LayoutKind.Explicit)]
+ private unsafe struct InnerUnion
+ {
+ [FieldOffset(0)]
+ internal VecU8* ok;
+ [FieldOffset(0)]
+ internal IronRdpError* err;
+ }
+
+ private InnerUnion _inner;
+
+ [MarshalAs(UnmanagedType.U1)]
+ public bool isOk;
+
+ public unsafe VecU8* Ok
+ {
+ get
+ {
+ return _inner.ok;
+ }
+ }
+
+ public unsafe IronRdpError* Err
+ {
+ get
+ {
+ return _inner.err;
+ }
+ }
+}
diff --git a/ffi/dotnet/Devolutions.IronRdp/Generated/RawWinCliprdr.cs b/ffi/dotnet/Devolutions.IronRdp/Generated/RawWinCliprdr.cs
new file mode 100644
index 00000000..28057334
--- /dev/null
+++ b/ffi/dotnet/Devolutions.IronRdp/Generated/RawWinCliprdr.cs
@@ -0,0 +1,36 @@
+// by Diplomat
+
+#pragma warning disable 0105
+using System;
+using System.Runtime.InteropServices;
+
+using Devolutions.IronRdp.Diplomat;
+#pragma warning restore 0105
+
+namespace Devolutions.IronRdp.Raw;
+
+#nullable enable
+
+[StructLayout(LayoutKind.Sequential)]
+public partial struct WinCliprdr
+{
+ private const string NativeLib = "DevolutionsIronRdp";
+
+ ///
+ /// SAFETY: `hwnd` must be a valid window handle
+ ///
+ [DllImport(NativeLib, CallingConvention = CallingConvention.Cdecl, EntryPoint = "WinCliprdr_new", ExactSpelling = true)]
+ public static unsafe extern ClipboardWindowsFfiResultBoxWinCliprdrBoxIronRdpError New(nint hwnd);
+
+ [DllImport(NativeLib, CallingConvention = CallingConvention.Cdecl, EntryPoint = "WinCliprdr_next_clipboard_message", ExactSpelling = true)]
+ public static unsafe extern ClipboardWindowsFfiResultOptBoxClipboardMessageBoxIronRdpError NextClipboardMessage(WinCliprdr* self);
+
+ [DllImport(NativeLib, CallingConvention = CallingConvention.Cdecl, EntryPoint = "WinCliprdr_next_clipboard_message_blocking", ExactSpelling = true)]
+ public static unsafe extern ClipboardWindowsFfiResultBoxClipboardMessageBoxIronRdpError NextClipboardMessageBlocking(WinCliprdr* self);
+
+ [DllImport(NativeLib, CallingConvention = CallingConvention.Cdecl, EntryPoint = "WinCliprdr_backend_factory", ExactSpelling = true)]
+ public static unsafe extern ClipboardWindowsFfiResultBoxCliprdrBackendFactoryBoxIronRdpError BackendFactory(WinCliprdr* self);
+
+ [DllImport(NativeLib, CallingConvention = CallingConvention.Cdecl, EntryPoint = "WinCliprdr_destroy", ExactSpelling = true)]
+ public static unsafe extern void Destroy(WinCliprdr* self);
+}
diff --git a/ffi/dotnet/Devolutions.IronRdp/Generated/WinCliprdr.cs b/ffi/dotnet/Devolutions.IronRdp/Generated/WinCliprdr.cs
new file mode 100644
index 00000000..a8ead2a8
--- /dev/null
+++ b/ffi/dotnet/Devolutions.IronRdp/Generated/WinCliprdr.cs
@@ -0,0 +1,154 @@
+// 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 WinCliprdr: IDisposable
+{
+ private unsafe Raw.WinCliprdr* _inner;
+
+ ///
+ /// Creates a managed WinCliprdr from a raw handle.
+ ///
+ ///
+ /// Safety: you should not build two managed objects using the same raw handle (may causes use-after-free and double-free).
+ ///
+ /// This constructor assumes the raw struct is allocated on Rust side.
+ /// If implemented, the custom Drop implementation on Rust side WILL run on destruction.
+ ///
+ public unsafe WinCliprdr(Raw.WinCliprdr* handle)
+ {
+ _inner = handle;
+ }
+
+ ///
+ /// SAFETY: `hwnd` must be a valid window handle
+ ///
+ ///
+ ///
+ /// A WinCliprdr allocated on Rust side.
+ ///
+ public static WinCliprdr New(nint hwnd)
+ {
+ unsafe
+ {
+ Raw.ClipboardWindowsFfiResultBoxWinCliprdrBoxIronRdpError result = Raw.WinCliprdr.New(hwnd);
+ if (!result.isOk)
+ {
+ throw new IronRdpException(new IronRdpError(result.Err));
+ }
+ Raw.WinCliprdr* retVal = result.Ok;
+ return new WinCliprdr(retVal);
+ }
+ }
+
+ ///
+ ///
+ /// A ClipboardMessage allocated on Rust side.
+ ///
+ public ClipboardMessage NextClipboardMessage()
+ {
+ unsafe
+ {
+ if (_inner == null)
+ {
+ throw new ObjectDisposedException("WinCliprdr");
+ }
+ Raw.ClipboardWindowsFfiResultOptBoxClipboardMessageBoxIronRdpError result = Raw.WinCliprdr.NextClipboardMessage(_inner);
+ if (!result.isOk)
+ {
+ throw new IronRdpException(new IronRdpError(result.Err));
+ }
+ Raw.ClipboardMessage* retVal = result.Ok;
+ if (retVal == null)
+ {
+ return null;
+ }
+ return new ClipboardMessage(retVal);
+ }
+ }
+
+ ///
+ ///
+ /// A ClipboardMessage allocated on Rust side.
+ ///
+ public ClipboardMessage NextClipboardMessageBlocking()
+ {
+ unsafe
+ {
+ if (_inner == null)
+ {
+ throw new ObjectDisposedException("WinCliprdr");
+ }
+ Raw.ClipboardWindowsFfiResultBoxClipboardMessageBoxIronRdpError result = Raw.WinCliprdr.NextClipboardMessageBlocking(_inner);
+ if (!result.isOk)
+ {
+ throw new IronRdpException(new IronRdpError(result.Err));
+ }
+ Raw.ClipboardMessage* retVal = result.Ok;
+ return new ClipboardMessage(retVal);
+ }
+ }
+
+ ///
+ ///
+ /// A CliprdrBackendFactory allocated on Rust side.
+ ///
+ public CliprdrBackendFactory BackendFactory()
+ {
+ unsafe
+ {
+ if (_inner == null)
+ {
+ throw new ObjectDisposedException("WinCliprdr");
+ }
+ Raw.ClipboardWindowsFfiResultBoxCliprdrBackendFactoryBoxIronRdpError result = Raw.WinCliprdr.BackendFactory(_inner);
+ if (!result.isOk)
+ {
+ throw new IronRdpException(new IronRdpError(result.Err));
+ }
+ Raw.CliprdrBackendFactory* retVal = result.Ok;
+ return new CliprdrBackendFactory(retVal);
+ }
+ }
+
+ ///
+ /// Returns the underlying raw handle.
+ ///
+ public unsafe Raw.WinCliprdr* AsFFI()
+ {
+ return _inner;
+ }
+
+ ///
+ /// Destroys the underlying object immediately.
+ ///
+ public void Dispose()
+ {
+ unsafe
+ {
+ if (_inner == null)
+ {
+ return;
+ }
+
+ Raw.WinCliprdr.Destroy(_inner);
+ _inner = null;
+
+ GC.SuppressFinalize(this);
+ }
+ }
+
+ ~WinCliprdr()
+ {
+ Dispose();
+ }
+}
diff --git a/ffi/dotnet/Devolutions.IronRdp/src/Connection.cs b/ffi/dotnet/Devolutions.IronRdp/src/Connection.cs
index 3581e84d..74df6571 100644
--- a/ffi/dotnet/Devolutions.IronRdp/src/Connection.cs
+++ b/ffi/dotnet/Devolutions.IronRdp/src/Connection.cs
@@ -2,12 +2,12 @@
using System.Net;
using System.Net.Security;
using System.Net.Sockets;
-using Devolutions.IronRdp;
-public class Connection
+namespace Devolutions.IronRdp;
+public static class Connection
{
- public static async Task<(ConnectionResult, Framed)> Connect(Config config, string servername)
+ public static async Task<(ConnectionResult, Framed)> Connect(Config config, string servername, CliprdrBackendFactory? factory)
{
var stream = await CreateTcpConnection(servername, 3389);
@@ -23,6 +23,12 @@ public class Connection
var socketAddrString = ip[0].ToString() + ":3389";
connector.WithServerAddr(socketAddrString);
+
+ if (factory != null)
+ {
+ var cliprdr = factory.BuildCliprdr();
+ connector.AttachStaticCliprdr(cliprdr);
+ }
await connectBegin(framed, connector);
var (serverPublicKey, framedSsl) = await securityUpgrade(servername, framed, connector);
@@ -104,7 +110,7 @@ public class Connection
await framedSsl.Write(response);
}
- var pduHint = credsspSequence.NextPduHint()!;
+ var pduHint = credsspSequence.NextPduHint();
if (pduHint == null)
{
break;
@@ -144,7 +150,7 @@ public class Connection
}
if (protocol == NetworkRequestProtocol.Tcp)
{
- stream.Write(Utils.Vecu8ToByte(data));
+ stream.Write(Utils.VecU8ToByte(data));
var readBuf = new byte[8096];
var readlen = await stream.ReadAsync(readBuf, 0, readBuf.Length);
var actuallyRead = new byte[readlen];
@@ -158,8 +164,8 @@ public class Connection
}
else
{
- var client_state = state.GetClientStateIfCompleted();
- return client_state;
+ var clientState = state.GetClientStateIfCompleted();
+ return clientState;
}
}
}
@@ -223,7 +229,7 @@ public class Connection
public static class Utils
{
- public static byte[] Vecu8ToByte(VecU8 vecU8)
+ public static byte[] VecU8ToByte(VecU8 vecU8)
{
var len = vecU8.GetSize();
byte[] buffer = new byte[len];
diff --git a/ffi/src/clipboard/message.rs b/ffi/src/clipboard/message.rs
new file mode 100644
index 00000000..1ab5d003
--- /dev/null
+++ b/ffi/src/clipboard/message.rs
@@ -0,0 +1,65 @@
+#[diplomat::bridge]
+pub mod ffi {
+
+ #[diplomat::opaque]
+ pub struct ClipboardMessage(pub ironrdp::cliprdr::backend::ClipboardMessage);
+
+ impl ClipboardMessage {
+ pub fn get_message_type(&self) -> ClipboardMessageType {
+ match &self.0 {
+ ironrdp::cliprdr::backend::ClipboardMessage::SendInitiateCopy(_) => {
+ ClipboardMessageType::SendInitiateCopy
+ }
+ ironrdp::cliprdr::backend::ClipboardMessage::SendFormatData(_) => ClipboardMessageType::SendFormatData,
+ ironrdp::cliprdr::backend::ClipboardMessage::SendInitiatePaste(_) => {
+ ClipboardMessageType::SendInitiatePaste
+ }
+ ironrdp::cliprdr::backend::ClipboardMessage::Error(_) => ClipboardMessageType::Error,
+ }
+ }
+
+ pub fn get_send_initiate_copy(&self) -> Option> {
+ match &self.0 {
+ ironrdp::cliprdr::backend::ClipboardMessage::SendInitiateCopy(val) => Some(val.clone()),
+ _ => None,
+ }
+ .map(ClipboardFormatIterator)
+ .map(Box::new)
+ }
+
+ pub fn get_send_format_data(&self) -> Option> {
+ match &self.0 {
+ ironrdp::cliprdr::backend::ClipboardMessage::SendFormatData(val) => Some(val.clone()),
+ _ => None,
+ }
+ .map(Some)
+ .map(FormatDataResponse)
+ .map(Box::new)
+ }
+
+ pub fn get_send_initiate_paste(&self) -> Option> {
+ match &self.0 {
+ ironrdp::cliprdr::backend::ClipboardMessage::SendInitiatePaste(val) => Some(*val),
+ _ => None,
+ }
+ .map(ClipboardFormatId)
+ .map(Box::new)
+ }
+ }
+
+ pub enum ClipboardMessageType {
+ SendInitiateCopy,
+ SendFormatData,
+ SendInitiatePaste,
+ Error,
+ }
+
+ #[diplomat::opaque]
+ pub struct ClipboardFormatIterator(pub Vec);
+
+ #[diplomat::opaque]
+ pub struct FormatDataResponse(pub Option);
+
+ #[diplomat::opaque]
+ pub struct ClipboardFormatId(pub ironrdp::cliprdr::pdu::ClipboardFormatId);
+}
diff --git a/ffi/src/clipboard/mod.rs b/ffi/src/clipboard/mod.rs
new file mode 100644
index 00000000..6eb8b767
--- /dev/null
+++ b/ffi/src/clipboard/mod.rs
@@ -0,0 +1,39 @@
+pub mod message;
+
+pub mod windows;
+
+#[diplomat::bridge]
+pub mod ffi {
+
+ use ironrdp::cliprdr::Client;
+
+ #[diplomat::opaque]
+ pub struct CliprdrBackendFactory(pub Box);
+
+ impl CliprdrBackendFactory {
+ pub fn build_cliprdr(&self) -> Box {
+ let backend = self.0.build_cliprdr_backend();
+ let cliprdr = ironrdp::cliprdr::Cliprdr::new(backend);
+ Box::new(Cliprdr(Some(cliprdr)))
+ }
+ }
+
+ #[diplomat::opaque]
+ pub struct Cliprdr(pub Option>);
+
+ #[diplomat::opaque]
+ pub struct ClipboardSvgMessage(pub Option>);
+}
+
+#[derive(Debug)]
+pub struct FfiClipbarodMessageProxy {
+ pub sender: std::sync::mpsc::Sender,
+}
+
+impl ironrdp::cliprdr::backend::ClipboardMessageProxy for FfiClipbarodMessageProxy {
+ fn send_clipboard_message(&self, message: ironrdp::cliprdr::backend::ClipboardMessage) {
+ if let Err(err) = self.sender.send(message) {
+ tracing::error!("Failed to send clipboard message: {:?}", err);
+ }
+ }
+}
diff --git a/ffi/src/clipboard/windows.rs b/ffi/src/clipboard/windows.rs
new file mode 100644
index 00000000..a9c5f530
--- /dev/null
+++ b/ffi/src/clipboard/windows.rs
@@ -0,0 +1,124 @@
+#![allow(clippy::unused_self)] // We want to keep the signature of the function stay the same between windows and non-windows
+
+use super::ffi::CliprdrBackendFactory;
+use crate::error::ffi::IronRdpError;
+#[cfg(not(windows))]
+use crate::error::WrongOSError;
+#[cfg(not(windows))]
+use ironrdp_cliprdr_native as _; // avoid linter error, stub clipboard will be used in later commit
+
+/*
+ Why are we creating a WinCliprdrInner struct and implement differently?
+
+ 1. We want to keep the FFI interface align with generated bindings.
+ 2. ironrdp_cliprdr_native::WinClipboard only compiles if the target is windows.
+ 3. We do not want to put any conditional compilation in the ffi module.
+
+ Hence we create a WinCliprdrInner struct and implement it differently based on the target platform.
+ and throw WrongOSError if the target platform is not windows.
+*/
+#[diplomat::bridge]
+pub mod ffi {
+
+ use crate::clipboard::ffi::CliprdrBackendFactory;
+ use crate::clipboard::message::ffi::ClipboardMessage;
+ use crate::error::ffi::IronRdpError;
+
+ use super::WinCliprdrInner;
+
+ #[diplomat::opaque]
+ pub struct WinCliprdr(WinCliprdrInner);
+
+ impl WinCliprdr {
+ /// SAFETY: `hwnd` must be a valid window handle
+ pub fn new(hwnd: isize) -> Result, Box> {
+ WinCliprdrInner::new(hwnd).map(WinCliprdr).map(Box::new)
+ }
+
+ pub fn next_clipboard_message(&self) -> Result