clients::rdp connects over any caller-dialled TCP stream (direct, proxy or SSH tunnel), upgrades to TLS and logs on with NLA (CredSSP/NTLM), optionally falling back to TLS-only logon for servers without NLA such as xrdp (credentials are passed so they log straight in). The server certificate is pinned through a caller check on its SHA256 fingerprint before any credentials are sent. The desktop decodes into the VNC client's RGBA framebuffer; input (IronRDP's scancode/Unicode/mouse operations), Display Control resizes and the deactivation-reactivation sequence run on the session thread. IronRDP's releases need three vendored patches (vendor/README.md): picky and sspi with their RustCrypto release-candidate pins relaxed so they share russh's stable versions (their own suites, 402 tests, pass against them), and ironrdp-session with two unreleased upstream bitmap fixes (#1486 stride, #1524 RDP6 orientation) without which xrdp desktops render sheared. Verified live against xrdp (scottyhardy/docker-remote-desktop): logon, full desktop rendering, keyboard and mouse input.
58 lines
1.5 KiB
Rust
58 lines
1.5 KiB
Rust
/// Creates a `SessionError` with `General` kind
|
|
///
|
|
/// Shorthand for
|
|
/// ```ignore
|
|
/// <ironrdp_session::SessionError as ironrdp_session::SessionErrorExt>::general(context)
|
|
/// ```
|
|
#[macro_export]
|
|
macro_rules! general_err {
|
|
( $context:expr $(,)? ) => {{ <$crate::SessionError as $crate::SessionErrorExt>::general($context) }};
|
|
}
|
|
|
|
/// Creates a `SessionError` with `Reason` kind
|
|
///
|
|
/// Shorthand for
|
|
/// ```ignore
|
|
/// <ironrdp_session::SessionError as ironrdp_session::SessionErrorExt>::reason(context, reason)
|
|
/// ```
|
|
#[macro_export]
|
|
macro_rules! reason_err {
|
|
( $context:expr, $($arg:tt)* ) => {{
|
|
<$crate::SessionError as $crate::SessionErrorExt>::reason($context, format!($($arg)*))
|
|
}};
|
|
}
|
|
|
|
/// Creates a `SessionError` with `Custom` kind and a source error attached to it
|
|
///
|
|
/// Shorthand for
|
|
/// ```ignore
|
|
/// <ironrdp_session::SessionError as ironrdp_session::SessionErrorExt>::custom(context, source)
|
|
/// ```
|
|
#[macro_export]
|
|
macro_rules! custom_err {
|
|
( $context:expr, $source:expr $(,)? ) => {{ <$crate::SessionError as $crate::SessionErrorExt>::custom($context, $source) }};
|
|
}
|
|
|
|
#[macro_export]
|
|
macro_rules! eof_try {
|
|
($e:expr) => {
|
|
match $e {
|
|
Err(ref e) if e.kind() == io::ErrorKind::UnexpectedEof => {
|
|
return Ok(None);
|
|
}
|
|
result => result,
|
|
}
|
|
};
|
|
}
|
|
|
|
#[macro_export]
|
|
macro_rules! try_ready {
|
|
($e:expr) => {
|
|
match $e {
|
|
Ok(Some(v)) => Ok(v),
|
|
Ok(None) => return Ok(None),
|
|
Err(e) => Err(e),
|
|
}
|
|
};
|
|
}
|