Skip to content

feat(agent): check the device redirector in diagnostics - #2208

Merged
Richard Markiewicz (thenextman) merged 6 commits into
masterfrom
thenextman-diagnose-device-redirector
Nov 19, 2026
Merged

Richard Markiewicz (thenextman) merged 6 commits into
masterfrom
thenextman-diagnose-device-redirector

Conversation

@thenextman

@thenextman Richard Markiewicz (thenextman) commented Nov 19, 2026 •

Copy link
Copy Markdown
Member

Programs on a Remote Desktop host get their virtual channel handle from the Remote Desktop service, which opens the \Device\DrDynVc device provided by the rdpdr driver.
Remote Desktop loads that driver by starting UmRdpService, which depends on it; when the service is Disabled the driver never starts, every channel open by a program fails with error 2, and nothing reports it.

The tray diagnostics now show whether the device exists, whether rdpdr is running, and whether rdpdr, RDBSS and UmRdpService are Disabled, alongside the channel checks, using the Windows display names.
The checks are skipped when Remote Desktop connections are disabled.
When the Agent's session feature is enabled and the device or driver is missing in an RDP session, the tray shows one notification per start, after a second check to ignore a slow driver start.

@thenextman

Copy link
Copy Markdown
Member Author

Lines changed

Category Added Removed
Production code (dotnet/DesktopAgent) 279 15
Tests 0 0
Other files 0 0

There is no test project for DesktopAgent, so none was added.
The project builds for net48 on macOS with a temporary resource workaround that is not committed; nothing was run on Windows.

UNTESTED: properties

  • The toast fires only when the device or driver check fails twice, 20 seconds apart, so a driver that is still starting at logon does not notify.
    The delays and the second check are the only guard; when changing them, check a healthy host does not notify right after an RDP logon.
  • rdpdr is a kernel driver, and its state is read with ServiceController.
    This is unverified for drivers; if the query fails the row is reported as skipped, and the device check still decides the notification.
  • The toast appears only when the session feature is enabled in agent.json and the user is in an RDP session.

Expected results on a healthy host: all checks pass, no toast.
With UmRdpService set to Disabled and a reboot: the device row reads "missing (error 2)", the rdpdr state row fails, and the toast appears after about 30 seconds.

Note

Human-tuned, LLM-assisted content.

@github-actions

Copy link
Copy Markdown

Let maintainers know that an action is required on their side

  • Add the label release-required Please cut a new release (Devolutions Gateway, Devolutions Agent, Jetsocat, PowerShell module) when you request a maintainer to cut a new release (Devolutions Gateway, Devolutions Agent, Jetsocat, PowerShell module)

  • Add the label release-blocker Follow-up is required before cutting a new release if a follow-up is required before cutting a new release

  • Add the label publish-required Please publish libraries (`Devolutions.Gateway.Utils`, OpenAPI clients, etc) when you request a maintainer to publish libraries (Devolutions.Gateway.Utils, OpenAPI clients, etc.)

  • Add the label publish-blocker Follow-up is required before publishing libraries if a follow-up is required before publishing libraries

@thenextman

Copy link
Copy Markdown
Member Author

Lines changed (refreshed)

Category Added Removed
Production code (dotnet/DesktopAgent, including 45 lines of designer code and 45 lines of resource strings) 417 15
Tests 0 0
Other files 0 0

Localization

The notification text is in Resources.resx with French and Swedish translations, like the tray's other messages.
Service names come from the Service Control Manager at runtime, so Windows supplies them in the user's language; the English names are used only when the query fails.
The diagnostics dialog stays English, like the rest of the Ctrl-only diagnostics.

The French and Swedish strings were written without a native review and need one before release.

The earlier UNTESTED: properties still apply; the build was checked for net48 on macOS only.

Note

Human-tuned, LLM-assisted content.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🔵 Needs a closer look

Windows validation is needed to confirm DrDynVc error-code classification across user privilege levels and ensure the startup probe does not disrupt existing RDP channels.

No open issues 🎉

1 file not reviewed
  • dotnet/DesktopAgent/Properties/Resources.Designer.cs: Generated file
What changed in this PR

Adds device redirector checks to Desktop Agent diagnostics to help identify why Remote Desktop virtual channels cannot open.

Changes:

  • Checks device availability, driver state, and disabled service startup settings, skipping these checks when Remote Desktop is disabled.
  • Adds a once-per-start notification for persistent failures in RDP sessions when the Agent session feature is enabled.
  • Adds English, French, and Swedish notification strings.
File Description
dotnet/​DesktopAgent/​Properties/​Resources.sv.resx Adds Swedish notification strings.
dotnet/​DesktopAgent/​Properties/​Resources.resx Adds default English notification strings.
dotnet/​DesktopAgent/​Properties/​Resources.fr.resx Adds French notification strings.
dotnet/​DesktopAgent/​Properties/​Resources.Designer.cs Exposes the new localized resource strings.
dotnet/​DesktopAgent/​Program.cs Adds delayed, repeated checks before showing a failure notification.
dotnet/​DesktopAgent/​Diagnostics/​DeviceRedirectorChecks.cs Implements device, driver, and service startup checks.
dotnet/​DesktopAgent/​Diagnostics/​ChannelProbe.cs Includes redirector results in diagnostics and supports warning details.

Review effort: Balanced

Copilot AI balanced review requested due to automatic review settings November 19, 2026 19:15
@thenextman

Copy link
Copy Markdown
Member Author

Lines changed (refreshed)

Category Added Removed
Production code (dotnet/DesktopAgent, including 30 lines of designer code and 15 lines of resource strings per language) 344 15
Tests 0 0
Other files 0 0

This replaces the localization note above.
The notification now shows a localized title and "Contact your administrator." only, in English, French and Swedish; the findings go to the tray log in English and are no longer localized.
The French and Swedish strings still need a native review before release.

Note

Human-tuned, LLM-assisted content.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🔵 Needs a closer look

Source-only review cannot establish whether the native Windows/RDP probe reliably detects device availability, particularly for CreateFile error 5, without runtime validation in healthy and broken standard-user sessions.

No open issues 🎉

1 file not reviewed
  • dotnet/DesktopAgent/Properties/Resources.Designer.cs: Generated file

Review effort: Balanced

Copilot AI balanced review requested due to automatic review settings November 19, 2026 19:23
@thenextman
Richard Markiewicz (thenextman) marked this pull request as ready for review November 19, 2026 19:25

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🔵 Needs a closer look

Windows RDP validation under standard-user permissions is needed to rule out false warnings from native DrDynVc and SCM behavior with healthy hosts, disabled redirectors, and delayed driver startup.

No open issues 🎉

1 file not reviewed
  • dotnet/DesktopAgent/Properties/Resources.Designer.cs: Generated file

Review effort: Balanced

@thenextman
Richard Markiewicz (thenextman) merged commit d6af2b7 into master Nov 19, 2026
56 checks passed
@thenextman
Richard Markiewicz (thenextman) deleted the thenextman-diagnose-device-redirector branch November 19, 2026 20:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

3 participants