Skip to main content
IronRDP provides Foreign Function Interface (FFI) bindings using Diplomat, enabling usage from languages like C#, C++, and others. Currently, .NET is the officially supported target.

Overview

The FFI layer (ffi/ directory) exposes core IronRDP functionality:
  • Connection management
  • Session handling
  • Graphics processing
  • Input events
  • Clipboard operations
  • Virtual channels (DVC)
  • CredSSP authentication

Building FFI Bindings

Using .NET Bindings

Basic Connection Example

Here’s a complete .NET example:

Sending Input Events

Clipboard Operations

Graphics Rendering to Bitmap

Error Handling

Running .NET Examples

Console Example

Avalonia GUI Example

The FFI directory includes a full GUI example using Avalonia:
This demonstrates:
  • Window management
  • Graphics rendering
  • Input handling
  • Full RDP client UI

Advanced Usage

Custom TLS Configuration

Dynamic Virtual Channels

RDCleanPath Parsing

Building for Other Languages

While .NET is officially supported, Diplomat can generate bindings for:
  • C/C++ - Generate header files
  • JavaScript - Via WebAssembly (see WebAssembly guide)
  • Python - Community-contributed bindings

Generating C Headers

This generates C header files in target/diplomat/.

Memory Management

.NET Resource Disposal

Always dispose IronRDP objects:
Or use explicit disposal:

Troubleshooting

Library Not Found

Ensure the native library is in the correct location:

Version Mismatch

Regenerate bindings after updating IronRDP:

Debugging FFI Calls

Enable logging on both sides:

Production Deployment

Packaging Native Library

Include the native library with your .NET application:

Cross-Platform Distribution

Package all platform libraries:

Next Steps