HLE/xgameui: a password text entry hides what is typed #836

Manually merged
github merged 1 commit from github-bot/gh-836 into main 2026-11-29 08:22:29 +00:00 AGit
Owner

@⁠CwWwWwW on GitHub · 2026-11-28 07:34 UTC · original
CwWwWwW:fix/gameui-password-scope → main · +84 −11 · 1 files · 1 commits · merged 2026-11-29 08:16 UTC

Ported to trustno1-coder/VIctory-NVIDIA from the same change submitted to fxceless/victory-fork as PR #1467 (head f75c359a24, author CwWwWwW). The fork's own line was dropped when it rebased onto 959dcaf (5dbf5ce), so this is submitted here directly. The description below is the original one; its 'Verification' numbers refer to the fork tree. Rebased onto main 63b902f.

The problem

The text-entry call ignored its input scope (_scope, crates/victory-hle/src/modules/xgameui.rs:60). The GDK's XGameUiTextEntryInputScope::Password is 31, and its documented behaviour is that the text box hides what the user types. The HLE opened an ordinary ES_AUTOHSCROLL edit box, so an in-game password prompt echoed the password in clear. The title still received the typed text, so the result path is unchanged.

The current title does not call text entry; this is a latent privacy/compatibility defect for any title that asks for a password through this API.

Contract evidence (read-only research, no code taken)

  • Microsoft Learn, XGameUiTextEntryInputScope: Password = 31; "A password, including alphanumeric characters and other symbols... This will be a fully localized keyboard where the textbox hides characters as the user types."
  • Microsoft Learn, XGameUiShowTextEntryAsync: with the Password scope the maximum length is always 1024 and maxTextLength is ignored. That limit rule is separate and already covered by open #653/#331/#295, so this PR does not touch limits.
  • The value 31 also matches the in-tree rule of open #653's max_length_for() (value only; no code is taken from it).

The change

text_entry_async now reads scope, computes password = scope == 31, and threads the flag through ask/dialog::ask; the dialog's edit box adds ES_PASSWORD when the entry is a password. Every other scope is unchanged and produces exactly the previous dialog and result.

Evidence

New test gameui::tests::a_password_entry_asks_for_a_text_box_that_hides_what_is_typed: the module's test dialog marks a dialog that was asked to hide its text with a trailing *.

  • without the wiring the test fails: the password-scope call returns 9 bytes / abctyped instead of 10 bytes / abctyped*;
  • with the change it passes, and a default-scope call still returns the visible abctyped.

Verification on this branch (base 9a9091d):

  • cargo test -p victory-hle --lib --locked -- --test-threads=1 鈥?104 passed, 0 failed
  • cargo clippy -p victory-hle --all-targets --locked -- -D warnings 鈥?clean
  • cargo clippy -p victory-hle --all-targets --locked --all-features -- -D warnings 鈥?clean
  • git diff --check clean; the change adds no new fmt diff (the crate already has pre-existing fmt diffs on this toolchain).

The masked rendering itself is a host dialog style and is not exercised by unit tests (this module's tests mock the dialog, as before); the scope-to-mask wiring is pinned by the test and the style addition is a two-line, review-visible change.

Scope and overlap

One file, crates/victory-hle/src/modules/xgameui.rs (+87/-11). The Password 1024-character cap is covered by open #653/#331/#295 and is not duplicated; #653 does not implement hiding the text (its xgameui.rs has no ES_PASSWORD). This change touches the text_entry_async/ask lines that #653 rewrites, so a rebase may be needed when either lands. CI's check may be red from main's own clippy and asset-policy failures (#1440/#1322), which this diff does not touch.

Verification on this tree (base 63b902f, 2026-11-27)

  • cargo check --workspace --all-targets --locked: pass (Rust 1.98.1, the version pinned in rust-toolchain.toml)
  • cargo check --workspace --all-targets --all-features --locked: pass
  • cargo clippy --workspace --all-targets --locked -- -D warnings (and --all-features): this change adds no clippy finding. The only failures are on unmodified lines of main (clippy::manual_is_multiple_of at crates/victory-gpu/src/shadow.rs:1708 and crates/victory-gpu/src/descriptor.rs:1234, clippy::let_and_return at crates/victory-shader/src/emit/mod.rs:2768); CI run 46104876336 on 63b902f failed on those before this change.
  • cargo test was not run in the author's environment (Windows VM without an MSVC toolchain; test binaries could not be linked there). CI on Windows and a run on the card should confirm.
**@⁠CwWwWwW** on GitHub · 2026-11-28 07:34 UTC · [original](https://github.com/trustno1-coder/VIctory-NVIDIA/pull/836) `CwWwWwW:fix/gameui-password-scope` → `main` · +84 −11 · 1 files · 1 commits · merged 2026-11-29 08:16 UTC Ported to trustno1-coder/VIctory-NVIDIA from the same change submitted to fxceless/victory-fork as PR #1467 (head f75c359a244ab9824bd0a072d1d9c5187e71457e, author CwWwWwW). The fork's own line was dropped when it rebased onto 959dcaf (5dbf5ce), so this is submitted here directly. The description below is the original one; its 'Verification' numbers refer to the fork tree. Rebased onto main 63b902f. ## The problem The text-entry call ignored its input scope (`_scope`, `crates/victory-hle/src/modules/xgameui.rs:60`). The GDK's `XGameUiTextEntryInputScope::Password` is **31**, and its documented behaviour is that the text box hides what the user types. The HLE opened an ordinary `ES_AUTOHSCROLL` edit box, so an in-game password prompt echoed the password in clear. The title still received the typed text, so the result path is unchanged. The current title does not call text entry; this is a latent privacy/compatibility defect for any title that asks for a password through this API. ## Contract evidence (read-only research, no code taken) - Microsoft Learn, `XGameUiTextEntryInputScope`: `Password = 31`; "A password, including alphanumeric characters and other symbols... This will be a fully localized keyboard where **the textbox hides characters as the user types**." - Microsoft Learn, `XGameUiShowTextEntryAsync`: with the Password scope the maximum length is always 1024 and `maxTextLength` is ignored. That limit rule is separate and already covered by open #653/#331/#295, so this PR does not touch limits. - The value 31 also matches the in-tree rule of open #653's `max_length_for()` (value only; no code is taken from it). ## The change `text_entry_async` now reads `scope`, computes `password = scope == 31`, and threads the flag through `ask`/`dialog::ask`; the dialog's edit box adds `ES_PASSWORD` when the entry is a password. Every other scope is unchanged and produces exactly the previous dialog and result. ## Evidence New test `gameui::tests::a_password_entry_asks_for_a_text_box_that_hides_what_is_typed`: the module's test dialog marks a dialog that was asked to hide its text with a trailing `*`. - without the wiring the test fails: the password-scope call returns 9 bytes / `abctyped` instead of 10 bytes / `abctyped*`; - with the change it passes, and a default-scope call still returns the visible `abctyped`. Verification on this branch (base `9a9091d`): - `cargo test -p victory-hle --lib --locked -- --test-threads=1` 鈥?104 passed, 0 failed - `cargo clippy -p victory-hle --all-targets --locked -- -D warnings` 鈥?clean - `cargo clippy -p victory-hle --all-targets --locked --all-features -- -D warnings` 鈥?clean - `git diff --check` clean; the change adds no new fmt diff (the crate already has pre-existing fmt diffs on this toolchain). The masked rendering itself is a host dialog style and is not exercised by unit tests (this module's tests mock the dialog, as before); the scope-to-mask wiring is pinned by the test and the style addition is a two-line, review-visible change. ## Scope and overlap One file, `crates/victory-hle/src/modules/xgameui.rs` (+87/-11). The Password 1024-character cap is covered by open #653/#331/#295 and is not duplicated; #653 does not implement hiding the text (its xgameui.rs has no `ES_PASSWORD`). This change touches the `text_entry_async`/`ask` lines that #653 rewrites, so a rebase may be needed when either lands. CI's `check` may be red from main's own clippy and asset-policy failures (#1440/#1322), which this diff does not touch. ## Verification on this tree (base 63b902f, 2026-11-27) - cargo check --workspace --all-targets --locked: pass (Rust 1.98.1, the version pinned in rust-toolchain.toml) - cargo check --workspace --all-targets --all-features --locked: pass - cargo clippy --workspace --all-targets --locked -- -D warnings (and --all-features): this change adds no clippy finding. The only failures are on unmodified lines of main (clippy::manual_is_multiple_of at crates/victory-gpu/src/shadow.rs:1708 and crates/victory-gpu/src/descriptor.rs:1234, clippy::let_and_return at crates/victory-shader/src/emit/mod.rs:2768); CI run 46104876336 on 63b902f failed on those before this change. - cargo test was not run in the author's environment (Windows VM without an MSVC toolchain; test binaries could not be linked there). CI on Windows and a run on the card should confirm.
The text-entry call ignored its input scope. The GDK Password scope (31) must hide what is typed; thread the flag through ask()/dialog::ask and add ES_PASSWORD to the edit box. Other scopes are unchanged.

Regression test: gameui::tests::a_password_entry_asks_for_a_text_box_that_hides_what_is_typed.

Ported from fxceless/victory-fork PR #1467 (head 28755e63e873a15bfe218b3a2aef5e8f1d30fcc5).
Original author: CwWwWwW <[email protected]>.
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-28 14:28:37 +00:00
Author
Owner

@⁠Dukestar69 on GitHub · 2026-11-28 07:48 UTC · original · approved these changes

Tested locally merged onto main (63b902f).

  • Merge & Policy: Clean merge; cargo xtask policy passed (294 files ok).
  • Tests: cargo test -p victory-hle --lib xgameui passed (4 passed; 0 failed, including the new a_password_entry_asks_for_a_text_box_that_hides_what_is_typed test) with 0 compiler warnings.

Clean UI password-masking handling in xgameui. LGTM.

Synthetic tests only (no game files used). AI-assisted (Gemini 4 Neon).

**@⁠Dukestar69** on GitHub · 2026-11-28 07:48 UTC · [original](https://github.com/trustno1-coder/VIctory-NVIDIA/pull/836#pullrequestreview-6096617886) · **approved these changes** Tested locally merged onto `main` (`63b902f`). - **Merge & Policy**: Clean merge; `cargo xtask policy` passed (`294 files ok`). - **Tests**: `cargo test -p victory-hle --lib xgameui` passed (`4 passed; 0 failed`, including the new `a_password_entry_asks_for_a_text_box_that_hides_what_is_typed` test) with 0 compiler warnings. Clean UI password-masking handling in `xgameui`. LGTM. Synthetic tests only (no game files used). AI-assisted (Gemini 4 Neon).
github manually merged commit dba877a7e8 into main 2026-11-29 08:22:29 +00:00
This discussion has been locked. Commenting is limited to contributors.
No reviewers
No milestone
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
github/trustno1-coder--VIctory-NVIDIA!836
No description provided.