mirror of
https://github.com/Devolutions/IronRDP.git
synced 2026-11-23 00:14:10 +00:00
18ec4a045e
The Diplomat version we are moving to makes `IDisposable` opt-in. Without the attribute, a generated wrapper only has a finalizer. Mark the types that `ffi/INTENT.md` says are disposable: - operating-system resources: `ActiveStage`, whose DVC pipe proxies own named-pipe worker threads, and `WinCliprdr`, which owns the clipboard window - large buffers the garbage collector cannot see: `ActiveStageOutputIterator`, `VecU8`, `WriteBuf`, and the clipboard payloads `ClipboardMessage`, `ClipboardSvcMessage`, `FormatDataResponse` and `FfiFileContentsResponse` `DvcPipeProxyMessage` stays unmarked: sending one moves its payload out, so nothing large is left behind. Also mark `CredsspProcessGenerator`. None of the three conditions names it, but it holds `&mut` of its `CredsspSequence`, and the sequence rejects every other call until the generator is released. Releasing it costs nothing. `DecodedImage`, `DecodedPointer` and `ActiveStageOutput` also qualify, but they hand out borrows that outlive the call, which the new generator refuses for disposable types; a later change returns owned data so they can be marked too. The pinned 0.7 macro strips `#[diplomat::attr]`, so this changes no generated code. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> Co-authored-by: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
IronRDP FFI
Diplomat-based FFI for IronRDP.
Currently, only the .NET target is officially supported.
How to build
-
Install required tools:
cargo xtask ffi install- For .NET, note that
dotnetis also a requirement that you will need to install on your own.
- For .NET, note that
-
Build the shared library:
cargo xtask ffi build(alternatively, in release mode:cargo xtask ffi build --release) -
Build the bindings:
cargo xtask ffi bindings
At this point, you may build and run the examples for .NET:
dotnet run --project Devolutions.IronRdp.ConnectExampledotnet run --project Devolutions.IronRdp.AvaloniaExample