Fall back to kernel copies when handler registration fails #990

Open
github-bot wants to merge 1 commit from github-bot/gh-990 into main AGit
Owner

@⁠ryotdev on GitHub · 2026-11-25 15:15 UTC · original
ryotdev:codex/plaincopy-handler-fallback → main · +32 −9 · 1 files · 1 commits · open

With VICTORY_COPY_PLAIN=1, the fast path relies on a Windows exception handler to recover when a source page disappears. Windows can return a null handle from registration. The previous code discarded that result and could start the copy anyway. Windows API return value

This change remembers whether registration succeeded. If it failed, the renderer logs the failure once and uses the existing kernel copy path. The regression injects a null registration result, checks that the destination stays untouched, and verifies that registration is attempted only once.

Verification

  • Built the Windows x64 diagnostics test target for victory-gpu and ran plaincopy::tests --test-threads=1 on Windows. All five tests passed.
  • As a negative control, ignoring registration failure in the guarded copy made the new test fail.
  • git diff --check passed.

AI-assisted. #946 touches the same handler for a separate change and may need a rebase.

**@⁠ryotdev** on GitHub · 2026-11-25 15:15 UTC · [original](https://github.com/fxceless/victory-fork/pull/990) `ryotdev:codex/plaincopy-handler-fallback` → `main` · +32 −9 · 1 files · 1 commits · open With `VICTORY_COPY_PLAIN=1`, the fast path relies on a Windows exception handler to recover when a source page disappears. Windows can return a null handle from registration. The previous code discarded that result and could start the copy anyway. [Windows API return value](https://learn.microsoft.com/en-us/windows/win32/api/errhandlingapi/nf-errhandlingapi-addvectoredexceptionhandler#return-value) This change remembers whether registration succeeded. If it failed, the renderer logs the failure once and uses the existing kernel copy path. The regression injects a null registration result, checks that the destination stays untouched, and verifies that registration is attempted only once. **Verification** - Built the Windows x64 diagnostics test target for `victory-gpu` and ran `plaincopy::tests --test-threads=1` on Windows. All five tests passed. - As a negative control, ignoring registration failure in the guarded copy made the new test fail. - `git diff --check` passed. AI-assisted. #946 touches the same handler for a separate change and may need a rebase.
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-26 03:55:17 +00:00
This pull request can be merged automatically.
This branch is out-of-date with the base branch
You are not authorized to merge this pull request.
View command line instructions

Checkout

From your project repository, check out a new branch and test the changes.
git fetch -u origin '+refs/pull/990/head:github-bot/gh-990'
git switch 'github-bot/gh-990'

Merge

Merge the changes and update on Forgejo.
git switch 'main'
git merge --no-ff 'github-bot/gh-990'
git switch 'github-bot/gh-990'
git rebase 'main'
git switch 'main'
git merge --ff-only 'github-bot/gh-990'
git switch 'github-bot/gh-990'
git rebase 'main'
git switch 'main'
git merge --no-ff 'github-bot/gh-990'
git switch 'main'
git merge --squash 'github-bot/gh-990'
git switch 'main'
git merge --ff-only 'github-bot/gh-990'
git switch 'main'
git merge 'github-bot/gh-990'
git push origin 'main'
This discussion has been locked. Commenting is limited to contributors.
No description provided.