fix(agent): spawn helper on winsta0\\Winlogon when console session is… #9
No reviewers
Labels
No labels
bug
documentation
duplicate
enhancement
good first issue
help wanted
invalid
question
wontfix
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
hex/zeno-rmm!9
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "fix/winlogon-input-desktop-attach"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
… locked
Symptom (reported by user 2026-06-22): "after I remote in while on the desktop and then press the lock button, I cant see the password screen".
Root cause was a two-layer bug in the desktop attach path:
The spawner hardcoded STARTUPINFOW.lpDesktop to "winsta0\default" regardless of session state. When the workstation is locked the helper is born on the user's Default desktop (which shows the lock-screen wallpaper only — NOT the Winlogon password UI).
attach_to_interactive_desktop() called OpenInputDesktop(0, 0, ...) without DF_ALLOWOTHERACCOUNTHOOK. With no flag, OpenInputDesktop returns the calling thread's own desktop (Default), not the live input desktop of the console session (Winlogon). So SetThreadDesktop was effectively a no-op.
Helper log showed: thread_desk="Winlogon" input_desk="Default" desk_match=NO — capture frame comes from Winlogon but SendInput clicks land on the wallpaper behind it. Operator sees the lock wallpaper but cannot interact with the password field.
Fix:
Regression coverage (compile-time assertions, run on WIN-GAME-SRV CI):
Reference doc: docs/remote-desktop-locked-state.md captures the full pipeline, the bug history (5 prior fixes on the same subsystem), the manual verification procedure on a live locked workstation, and the symptom-to-cause table for future debugging.
Verified against helper log from WIN11--LAB-VM session b68158f4-... (15:41:37 on 2026-06-22) — pre-fix showed desk_match=NO with thread_desk="Winlogon" input_desk="Default", exactly the symptom described.