PerformanceFlagsType::EnableFontSmoothing was mapped to ENABLE_DESKTOP_COMPOSITION (0x100), so a client asking for font smoothing through the bindings got desktop composition instead, and the server drew text without smoothing. Only PerformanceFlags::new_default() set font smoothing (0x80). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> --------- Co-authored-by: Claude Opus 5.5 <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
Dynamic resize
ClientConnector.WithDynamicChannelDisplayControl() requests the Display Control channel (MS-RDPEDISP).
The server opens it and sends its capabilities some time after the connection is established, so ActiveStage.EncodedResize returns null until then.
Read ActiveStage.DisplayControlState after each Process call: it moves from Pending to Ready when the capabilities arrive, which is when to send the first resize.
Unavailable means the channel was not requested.
ActiveStage.DisplayControlCapabilities exposes the server's monitor count and area limits once Ready.
Touch and pen input (MS-RDPEI)
- Attach the channel before connecting:
connector.WithDynamicChannelRdpei(maxTouchContacts, showTouchVisuals). - Feed toolkit touch events to a
TouchFrameBuilder.New(maxTouchContacts)withPush(touchId, TouchPhase, x, y)orPushWithPressure, in desktop coordinates. - Feed pen samples to a
PenFrameBuilder.New()withPush(penId, PenPhase, x, y)orPushWithAttributesfor buttons, pressure, rotation and tilt; one pen is tracked at a time. - Once
activeStage.RdpeiInputState.Touch(or.Pen) is true,activeStage.EncodeRdpeiTouch(builder)orEncodeRdpeiPen(builder)returns the frame to write to the transport, ornullwhen nothing is pending. It throws while the channel is not ready or the server suspended input, and the frames stay pending. One frame carries at most 32767 touch or pen frames, so call again whileHasPendingFramesis true. activeStage.EncodeRdpeiDismissHovering(contactId)tells the server to stop tracking a hovering touch contact.- Call
CancelAll()when the window loses focus,Reset()when the session ends, and dispose the builders with it: a long suspension can leave tens of thousands of frames pending in native memory.
Migrating from 2026.10.19
- Properties replace the
GetX()andSetX()methods they duplicated. - Only these types are
IDisposable:ActiveStage,ActiveStageOutput,ActiveStageOutputIterator,ClipboardMessage,ClipboardSvcMessage,CredsspProcessGenerator,DecodedImage,DecodedPointer,FfiFileContentsResponse,FormatDataResponse,PenFrameBuilder,TouchFrameBuilder,VecU8,WinCliprdrandWriteBuf. Every other type is released by its finalizer, so dropusingandDispose()on it. - Dispose
WinCliprdron the thread that created it, because only that thread can remove its window subclass. - Dispose a
CredsspProcessGeneratorbefore the next call on itsCredsspSequence. DecodedImage.Datais gone: size a buffer withDataSizeand copy into it withFillData.ResponseFrame,WindowingOrdersandDecodedPointer.Datareturn aVecU8instead of aBytesSlice.WindowingOrdersreports an encoding failure asIronRdpErrorKind.EncodeErrorinstead ofGeneric.- A native object rejects overlapping calls with
InvalidOperationException. Serialize access toActiveStageandDecodedImageacross the PDU loop, input handlers and clipboard, as the Avalonia example does with one lock. FastPathInputEventIterator.Encode()returns the Fast-Path Input PDUs for the events of oneInputDatabase.Applyas aVecU8, ready forFramed.Write. It reads noActiveStageorDecodedImage, so call it outside that lock and input no longer waits on frame decoding.ActiveStage.ProcessFastpathInputsends the same bytes; keep it, under the lock, only whenPointerSoftwareRenderingis on, because it also redraws the pointer in the image.InputDatabasetracks pressed keys and buttons, so keep callingApplyfrom one thread.