user: implement RegisterClassExW for Unicode window classes #1131

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

@⁠Ivankiosan on GitHub · 2026-11-24 12:13 UTC · original
Ivankiosan:user-register-class-ex-w → main · +57 −0 · 1 files · 1 commits · open

The console's minuserx.dll / ext-ms-win-rtcore-ntuser-window-* family implements window creation and class registration for console titles. XCL exports CreateWindowExA, RegisterClassExA and CreateWindowExW in crates/xcl/src/hle/user.rs (exports()).

While CreateWindowExW was exported to support titles creating Unicode windows directly, RegisterClassExW was previously missing from user.rs exports. Titles registering window classes via the Unicode API set would otherwise drop to fallback stubs or fail class lookup.

What is in it

  • crates/xcl/src/hle/user.rs:
    • Implements
      egister_class_ex_w: verifies cb_size against std::mem::size_of::<WndClassEx>(), sets ERROR_INVALID_PARAMETER on mismatch, and forwards directly to native RegisterClassExW without string conversion.
    • Adds RegisterClassExW to exports().
    • Adds unit test
      egister_class_ex_w_accepts_valid_class_and_rejects_invalid_size covering size rejection, parameter validation, and class registration/retrieval verification.

Tested

  • Windows 11 build 26100, AMD Radeon RX 7600 (8152 MiB VRAM), driver 32.0.12028.1005, rustc 1.100.0 MSVC, debug and release builds.
  • cargo test -p xcl --lib hle::user: 4 passed, 0 failed, 0 ignored.
  • cargo test --workspace -- --test-threads=4: 742 passed, 0 failed, 41 ignored (0 SKIPPED).

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 MB

PR head:
xcl-smoke v1 commit: e50170cd52f3287b821a666207ac1d88ce0bba2b 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: 7792 MB

Not tested

  • Games registering ANSI window classes with non-ASCII multi-byte class names (covered by existing RegisterClassExA tests).

AI use

  • Claude Code / Claude Opus 4.6 identified the API gap, implemented the validated entrypoint, added the unit test, and drafted the description; all tests and regression runs executed on local AMD hardware.
**@⁠Ivankiosan** on GitHub · 2026-11-24 12:13 UTC · [original](https://github.com/xcl-dev/xcl/pull/1131) `Ivankiosan:user-register-class-ex-w` → `main` · +57 −0 · 1 files · 1 commits · open The console's minuserx.dll / ext-ms-win-rtcore-ntuser-window-* family implements window creation and class registration for console titles. XCL exports CreateWindowExA, RegisterClassExA and CreateWindowExW in crates/xcl/src/hle/user.rs (exports()). While CreateWindowExW was exported to support titles creating Unicode windows directly, RegisterClassExW was previously missing from user.rs exports. Titles registering window classes via the Unicode API set would otherwise drop to fallback stubs or fail class lookup. **What is in it** - crates/xcl/src/hle/user.rs: - Implements egister_class_ex_w: verifies cb_size against std::mem::size_of::<WndClassEx<u16>>(), sets ERROR_INVALID_PARAMETER on mismatch, and forwards directly to native RegisterClassExW without string conversion. - Adds RegisterClassExW to exports(). - Adds unit test egister_class_ex_w_accepts_valid_class_and_rejects_invalid_size covering size rejection, parameter validation, and class registration/retrieval verification. **Tested** - Windows 11 build 26100, AMD Radeon RX 7600 (8152 MiB VRAM), driver 32.0.12028.1005, rustc 1.100.0 MSVC, debug and release builds. - cargo test -p xcl --lib hle::user: **4 passed, 0 failed, 0 ignored**. - cargo test --workspace -- --test-threads=4: **742 passed, 0 failed, 41 ignored** (0 SKIPPED). **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 MB ` PR head: ` xcl-smoke v1 commit: e50170cd52f3287b821a666207ac1d88ce0bba2b 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: 7792 MB ` **Not tested** - Games registering ANSI window classes with non-ASCII multi-byte class names (covered by existing RegisterClassExA tests). **AI use** - Claude Code / Claude Opus 4.6 identified the API gap, implemented the validated entrypoint, added the unit test, and drafted the description; all tests and regression runs executed on local AMD hardware.
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-26 04:44:26 +00:00
Author
Owner

@⁠futurepro62 on GitHub · 2026-11-24 14:25 UTC · original

Full-suite run, since this PR has no test report yet. Tested exact head e50170c (on its base 47efa2e).

Tested

  • NVIDIA GeForce RTX 5070 Ti 16 GB (Blackwell, 32-lane waves only, mesh shaders), driver 616.64, Ryzen 7 9800X3D, Windows 11 Home 26300, Rust 1.100.0 MSVC, debug, D3D12 debug layer installed.
  • cargo build --workspace, then XCL_REQUIRE_GPU=mesh cargo test --workspace -- --test-threads=4: 742 passed, 0 failed, 41 ignored. SKIPPED (no wave64): gpu_geometry_wave32_prefix_count_over_a_mask, gpu_wave32_program_in_wave64_hardware.
  • The new tests ran and passed: register_class_ex_w_accepts_valid_class_and_rejects_invalid_size.

Not tested

  • AMD, a release build, a game (test run only).

AI use

  • Claude Code (Claude Opus 5.5) ran the tests and wrote this report. I checked it before posting.
**@⁠futurepro62** on GitHub · 2026-11-24 14:25 UTC · [original](https://github.com/xcl-dev/xcl/pull/1131#issuecomment-7134349465) Full-suite run, since this PR has no test report yet. Tested exact head `e50170c` (on its base `47efa2e`). **Tested** - NVIDIA GeForce RTX 5070 Ti 16 GB (Blackwell, 32-lane waves only, mesh shaders), driver 616.64, Ryzen 7 9800X3D, Windows 11 Home 26300, Rust 1.100.0 MSVC, debug, D3D12 debug layer installed. - `cargo build --workspace`, then `XCL_REQUIRE_GPU=mesh cargo test --workspace -- --test-threads=4`: **742 passed, 0 failed, 41 ignored**. SKIPPED (no wave64): `gpu_geometry_wave32_prefix_count_over_a_mask`, `gpu_wave32_program_in_wave64_hardware`. - The new tests ran and passed: `register_class_ex_w_accepts_valid_class_and_rejects_invalid_size`. **Not tested** - AMD, a release build, a game (test run only). **AI use** - Claude Code (Claude Opus 5.5) ran the tests and wrote this report. I checked it before posting.
Author
Owner

@⁠JoaoPauluu on GitHub · 2026-11-24 14:34 UTC · original

A run on Linux under Wine.

Tested

  • RTX 3060 12 GB (NVIDIA 620.70.06, 32-lane waves), i5-10400F, 16 GB, CachyOS (kernel 7.3.3), Proton Experimental 11.0-20261112 with the patched vkd3d-proton 3.1 from #257, DXC 1.9.2609.5. Release, cross-built for x86_64-pc-windows-gnu. e50170c as it is (based on 47efa2e), no uncommitted changes. The lib test binary runs under Wine, one test per process (--exact). RegisterClassExW is Wine's user32 here.
  • hle::user::tests::register_class_ex_w_accepts_valid_class_and_rejects_invalid_size: ok, no SKIPPED.

Not tested

  • whether the new tests fail without the change on this stack; the rest of the suite on this head; a retail title; native Windows.

AI use

  • Claude Code (Claude Opus 5.5) built the head, ran the tests and wrote this report. The account owner asked for test reports to be posted and has not reviewed this one.
**@⁠JoaoPauluu** on GitHub · 2026-11-24 14:34 UTC · [original](https://github.com/xcl-dev/xcl/pull/1131#issuecomment-7134610189) A run on Linux under Wine. **Tested** - RTX 3060 12 GB (NVIDIA 620.70.06, 32-lane waves), i5-10400F, 16 GB, CachyOS (kernel 7.3.3), Proton Experimental 11.0-20261112 with the patched vkd3d-proton 3.1 from #257, DXC 1.9.2609.5. Release, cross-built for `x86_64-pc-windows-gnu`. `e50170c` as it is (based on `47efa2e`), no uncommitted changes. The lib test binary runs under Wine, one test per process (`--exact`). `RegisterClassExW` is Wine's user32 here. - `hle::user::tests::register_class_ex_w_accepts_valid_class_and_rejects_invalid_size`: **ok**, no SKIPPED. **Not tested** - whether the new tests fail without the change on this stack; the rest of the suite on this head; a retail title; native Windows. **AI use** - Claude Code (Claude Opus 5.5) built the head, ran the tests and wrote this report. The account owner asked for test reports to be posted and has not reviewed this one.
Author
Owner

@⁠luckyteagirl on GitHub · 2026-11-25 03:32 UTC · original

Tested

  • Exact PR head e50170cd52f3287b821a666207ac1d88ce0bba2b on Windows 11 build 26200, Ryzen 9 5980HX, Rust 1.99.0 MSVC. This Win32 class registration suite did not exercise the RX 6800M GPU.
  • cargo test --locked -p xcl --lib -j 2 hle::user:: -- --test-threads=1 --show-output: 4 passed, 0 failed, 0 ignored, no explicit skips. The new Unicode class test passed its invalid-size check and native registration/retrieval path.
  • cargo build --locked --workspace -j 2: passed.

Not tested

  • A title registering a Unicode class, the full workspace suite, or Wine/Linux. The test invokes the exported wrapper and Win32 registration on this Windows host.

AI use

OpenAI Codex (GPT-6, exact variant not exposed in this session) reviewed the exact diff, ran the focused suite and workspace build, checked the logs, and drafted this report.

**@⁠luckyteagirl** on GitHub · 2026-11-25 03:32 UTC · [original](https://github.com/xcl-dev/xcl/pull/1131#issuecomment-7152014759) **Tested** - Exact PR head `e50170cd52f3287b821a666207ac1d88ce0bba2b` on Windows 11 build 26200, Ryzen 9 5980HX, Rust 1.99.0 MSVC. This Win32 class registration suite did not exercise the RX 6800M GPU. - `cargo test --locked -p xcl --lib -j 2 hle::user:: -- --test-threads=1 --show-output`: **4 passed, 0 failed, 0 ignored**, no explicit skips. The new Unicode class test passed its invalid-size check and native registration/retrieval path. - `cargo build --locked --workspace -j 2`: passed. **Not tested** - A title registering a Unicode class, the full workspace suite, or Wine/Linux. The test invokes the exported wrapper and Win32 registration on this Windows host. **AI use** OpenAI Codex (GPT-6, exact variant not exposed in this session) reviewed the exact diff, ran the focused suite and workspace build, checked the logs, and drafted this report.
Author
Owner

@⁠DavidM1911 on GitHub · 2026-11-25 08:02 UTC · original

Verification on RTX 3060 Ti (Windows 11), branch merged with current main:

  • cargo test -p xcl --lib: all passed, 0 failed, ~26 ignored. (Intermittent single-test flake / 0xc0000005 abort under parallel scheduling — tracked in #1978; clean on single-threaded rerun.)

Thanks!

**@⁠DavidM1911** on GitHub · 2026-11-25 08:02 UTC · [original](https://github.com/xcl-dev/xcl/pull/1131#issuecomment-7156534168) Verification on RTX 3060 Ti (Windows 11), branch merged with current `main`: - `cargo test -p xcl --lib`: all passed, 0 failed, ~26 ignored. (Intermittent single-test flake / 0xc0000005 abort under parallel scheduling — tracked in #1978; clean on single-threaded rerun.) Thanks!
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/1131/head:github-bot/gh-1131'
git switch 'github-bot/gh-1131'

Merge

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