Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
92 changes: 92 additions & 0 deletions crates/ironrdp-cfg/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -10,14 +10,44 @@ pub trait PropertySetExt {

fn alternate_full_address(&self) -> Option<&str>;

fn domain(&self) -> Option<&str>;

fn enable_credssp_support(&self) -> Option<bool>;

fn compression(&self) -> Option<bool>;

fn gateway_hostname(&self) -> Option<&str>;

fn gateway_usage_method(&self) -> Option<i64>;

fn gateway_credentials_source(&self) -> Option<i64>;

fn gateway_username(&self) -> Option<&str>;

fn gateway_password(&self) -> Option<&str>;

fn desktop_width(&self) -> Option<i64>;

fn desktop_height(&self) -> Option<i64>;

fn desktop_scale_factor(&self) -> Option<i64>;

fn alternate_shell(&self) -> Option<&str>;

fn shell_working_directory(&self) -> Option<&str>;

fn redirect_clipboard(&self) -> Option<bool>;

fn audio_mode(&self) -> Option<i64>;

fn remote_application_name(&self) -> Option<&str>;

fn remote_application_program(&self) -> Option<&str>;

fn kdc_proxy_url(&self) -> Option<&str>;

fn kdc_proxy_name(&self) -> Option<&str>;

fn username(&self) -> Option<&str>;

/// Target RDP server password - use for testing only
Expand All @@ -37,10 +67,67 @@ impl PropertySetExt for PropertySet {
self.get::<&str>("alternate full address")
}

fn domain(&self) -> Option<&str> {
self.get::<&str>("domain")
}

fn enable_credssp_support(&self) -> Option<bool> {
self.get::<bool>("enablecredsspsupport")
}

fn compression(&self) -> Option<bool> {
self.get::<bool>("compression")
}

fn gateway_hostname(&self) -> Option<&str> {
self.get::<&str>("gatewayhostname")
}

fn gateway_usage_method(&self) -> Option<i64> {
self.get::<i64>("gatewayusagemethod")
}

fn gateway_credentials_source(&self) -> Option<i64> {
self.get::<i64>("gatewaycredentialssource")
}

fn gateway_username(&self) -> Option<&str> {
self.get::<&str>("gatewayusername")
}

fn gateway_password(&self) -> Option<&str> {
self.get::<&str>("GatewayPassword")
.or_else(|| self.get::<&str>("gatewaypassword"))
}

fn desktop_width(&self) -> Option<i64> {
self.get::<i64>("desktopwidth")
}

fn desktop_height(&self) -> Option<i64> {
self.get::<i64>("desktopheight")
}

fn desktop_scale_factor(&self) -> Option<i64> {
self.get::<i64>("desktopscalefactor")
}

fn alternate_shell(&self) -> Option<&str> {
self.get::<&str>("alternate shell")
}

fn shell_working_directory(&self) -> Option<&str> {
self.get::<&str>("shell working directory")
}

fn redirect_clipboard(&self) -> Option<bool> {
self.get::<bool>("redirectclipboard")
}

fn audio_mode(&self) -> Option<i64> {
self.get::<i64>("audiomode")
}

fn remote_application_name(&self) -> Option<&str> {
self.get::<&str>("remoteapplicationname")
}
Expand All @@ -51,6 +138,11 @@ impl PropertySetExt for PropertySet {

fn kdc_proxy_url(&self) -> Option<&str> {
self.get::<&str>("kdcproxyurl")
.or_else(|| self.get::<&str>("KDCProxyURL"))
}

fn kdc_proxy_name(&self) -> Option<&str> {
self.get::<&str>("kdcproxyname")
}

fn username(&self) -> Option<&str> {
Expand Down
37 changes: 37 additions & 0 deletions crates/ironrdp-client/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,43 @@ and winit for windowing.
ironrdp-client <HOSTNAME> --username <USERNAME> --password <PASSWORD>
```

## `.rdp` file support

You can load a `.rdp` file with `--rdp-file <PATH>`.

Currently supported properties:

- `full address:s:<value>`
- `alternate full address:s:<value>`
- `server port:i:<value>`
- `username:s:<value>`
- `domain:s:<value>`
- `enablecredsspsupport:i:<0|1>`
- `gatewayhostname:s:<value>`
- `gatewayusagemethod:i:<value>`
- `gatewaycredentialssource:i:<value>`
- `gatewayusername:s:<value>`
- `GatewayPassword:s:<value>`
- `kdcproxyname:s:<value>`
- `KDCProxyURL:s:<value>`
- `alternate shell:s:<value>`
- `shell working directory:s:<value>`
- `redirectclipboard:i:<0|1>`
- `audiomode:i:<0|1|2>`
- `desktopwidth:i:<value>`
- `desktopheight:i:<value>`
- `desktopscalefactor:i:<value>`
- `compression:i:<0|1>`
- `ClearTextPassword:s:<value>`

Property precedence is:

1. CLI options
2. `.rdp` file values
3. Defaults and interactive prompts

Unknown or unsupported `.rdp` properties are ignored and do not fail parsing. Parse issues and skipped properties are logged at debug level.

## Configuring log filter directives

The `IRONRDP_LOG` environment variable is used to set the log filter directives.
Expand Down
7 changes: 6 additions & 1 deletion crates/ironrdp-client/src/app.rs
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ type WindowSurface = (Arc<Window>, softbuffer::Surface<DisplayHandle<'static>, A
pub struct App {
input_event_sender: mpsc::UnboundedSender<RdpInputEvent>,
context: softbuffer::Context<DisplayHandle<'static>>,
initial_window_size: PhysicalSize<u32>,
window: Option<WindowSurface>,
buffer: Vec<u32>,
buffer_size: (u16, u16),
Expand All @@ -35,6 +36,7 @@ impl App {
pub fn new(
event_loop: &EventLoop<RdpOutputEvent>,
input_event_sender: &mpsc::UnboundedSender<RdpInputEvent>,
initial_window_size: PhysicalSize<u32>,
) -> anyhow::Result<Self> {
// SAFETY: We drop the softbuffer context right before the event loop is stopped, thus making this safe.
// FIXME: This is not a sufficient proof and the API is actually unsound as-is.
Expand All @@ -50,6 +52,7 @@ impl App {
Ok(Self {
input_event_sender: input_event_sender.clone(),
context,
initial_window_size,
window: None,
buffer: Vec::new(),
buffer_size: (0, 0),
Expand Down Expand Up @@ -111,7 +114,9 @@ impl ApplicationHandler<RdpOutputEvent> for App {
}

fn resumed(&mut self, event_loop: &ActiveEventLoop) {
let window_attributes = WindowAttributes::default().with_title("IronRDP");
let window_attributes = WindowAttributes::default()
.with_title("IronRDP")
.with_inner_size(self.initial_window_size);
match event_loop.create_window(window_attributes) {
Ok(window) => {
let window = Arc::new(window);
Expand Down
Loading
Loading