You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Capture driver forwards null RefusalSnapshot to [ref] parameter, failing live capture #862
Live capture C2 on main b70c3bf5 failed in the worker with:
ParameterBindingArgumentTransformationException on parameter 'RefusalSnapshot': Reference type is expected in argument.
#850 (206a7dbc) added an optional [ref]$RefusalSnapshot parameter to Find-CapAutomationElement (Tools/windows/UiCaptureDriver.psm1). It forwards that parameter unconditionally to Resolve-CapAutomationCandidate -RefusalSnapshot $RefusalSnapshot.
Two callers do not pass it:
UiCaptureDriver.psm1:1390, the Graph root lookup;
UiCaptureDriver.psm1:1461, the spec element lookup.
So $null is bound to a [ref] parameter, and PowerShell throws before the resolver runs. Only the worker's polling caller (Invoke-UiCaptureWorker.ps1:505) supplies a [ref].
The unit suite did not catch this because UiCaptureDriver.Tests.ps1 substitutes Find-CapAutomationElement at these call sites, so the real forwarding path never runs without a [ref].
Ask
Forward RefusalSnapshot (and RefusalContext, if it has the same shape) only when the caller bound it.
Add a test that calls the real Find-CapAutomationElement with no RefusalSnapshot argument through the forwarding path. It must fail on main with this exception.
Fixed by #864 (squash 6677a8e): Find-CapAutomationElement now forwards the optional RefusalSnapshot [ref] only when the caller bound it. A real hidden-UIA regression case covers all 8 Window/Element x bound/unbound x sink variants. Live capture re-verification follows in a separate run.
Activity
Forward selector refusal references only when bound (#864)
coneilen commentedon Oct 17, 2026
Fixed by #864 (squash 6677a8e): Find-CapAutomationElement now forwards the optional RefusalSnapshot [ref] only when the caller bound it. A real hidden-UIA regression case covers all 8 Window/Element x bound/unbound x sink variants. Live capture re-verification follows in a separate run.