user: implement UnregisterClassA and UnregisterClassW #1129
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/1138"
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?
Imported from ivall/xcl. Originally posted by Ivankiosan on 2026-11-24T12:24:47Z.
The console's minuserx.dll / ext-ms-win-rtcore-ntuser-window-* family implements window creation, window procedures, and class lifecycle for console titles. While RegisterClassExA was implemented in crates/xcl/src/hle/user.rs, the corresponding unregistration entrypoints (UnregisterClassA and UnregisterClassW) were not implemented. Titles or engine sub-frameworks unregistering window classes during teardown or re-initialization would drop to fallback stubs or fail unexpectedly.
What is in it
ame(), and forwards to UnregisterClassW.
Tested
Regression run
main:
xcl-smoke v1 commit: 64b3f35599bb7102f55d640e1a791e7d6dd3b175 gpu: AMD Radeon RX 7600 title: 419239bf seconds: 10 exit: 0x0 frames shown: 1 (PresentX 1) presents per 2 s (last 3): 0 0 0 device removals: 0 crashes: 0 peak commit: 7754 MBPR head:
xcl-smoke v1 commit: e640169179815062df69db38f997336a18c26851 gpu: AMD Radeon RX 7600 title: 419239bf seconds: 10 exit: 0x0 frames shown: 1 (PresentX 1) presents per 2 s (last 3): 0 0 0 device removals: 0 crashes: 0 peak commit: 8172 MBNot tested
AI use
Imported from ivall/xcl. Originally posted by DavidM1911 on 2026-11-24T12:57:39Z.
Independent verification on current
main384f7f7(branch already contains it — clean).Machine: Windows 11, Ryzen 9 7900X; Rust stable MSVC, debug.
cargo test -p xcl --lib user::: 4 passed, 0 failed — includes the newunregister_class_unregisters_registered_classes_and_rejects_nullplus the existing register-class validation tests.AI use: test runs by Devin (Cognition, SWE-2); no code changes.
Imported from ivall/xcl. Originally posted by JoaoPauluu on 2026-11-24T14:34:56Z.
A run on Linux under Wine.
Tested
x86_64-pc-windows-gnu.e640169as it is (based on47efa2e), no uncommitted changes. The lib test binary runs under Wine, one test per process (--exact).RegisterClass*/UnregisterClass*are Wine's user32 here.hle::user::tests::unregister_class_unregisters_registered_classes_and_rejects_null: ok, no SKIPPED.Not tested
AI use
Imported from ivall/xcl. Originally posted by gut0to on 2026-11-26T16:16:45Z.
Review: COMMENTED
AI-assisted review: I inspected this diff and its tests; I did not run the test suite. I found an ANSI class-atom case that is not covered.
Imported from ivall/xcl. Originally posted by gut0to on 2026-11-26T16:16:45Z.
Code review location:
crates/xcl/src/hle/user.rs; line 105Could this preserve integer atoms before calling
name?UnregisterClassAaccepts either a string or a class atom (the atom is a pointer-sized value with only its low word set). Passing the atom returned byRegisterClassExAhere makesnametreat it as an ANSI string and dereference it, instead of forwarding the atom toUnregisterClassW. Please add a regression that unregisters a class usingMAKEINTATOM(atom_a)(or the equivalent pointer cast). AI-assisted review; I inspected the diff and tests but did not run them.Imported from ivall/xcl. Originally posted by github-actions[bot] on 2026-12-01T02:35:07Z.
Nothing has happened on this PR for 3 days, so it is marked
staleand will be closed in 4 days. A push or a comment takes the mark off: rebase it ontomainif it conflicts, and say in one line what it still fixes. If it only waits for a maintainer, a comment saying so is enough.Imported from ivall/xcl. Originally posted by Foniass on 2026-12-01T04:53:48Z.
Triage (#1607) – head
e640169No open or merged PR adds UnregisterClassA/W. #1131, #1436 and #794 only call UnregisterClassW from their tests.
The description says these entry points dropped to stubs, but they did not: user32 imports that
hle::user::exports()does not list already resolve to Windows' user32.dll (seeresolver.rs,console_user32_and_legacy_dlls_reach_the_pc_functions). In practice the PR adds a null-pointer check, and UnregisterClassA now converts the name the same way RegisterClassExA does. Please correct the description.Recommendation: keep open.
AI review: Claude Code (Claude Opus 5.5), diffs read only, not built or run; not checked by a human.
View command line instructions
Checkout
From your project repository, check out a new branch and test the changes.Merge
Merge the changes and update on Forgejo.Warning: The "Autodetect manual merge" setting is not enabled for this repository, you will have to mark this pull request as manually merged afterwards.