launcher(pagefile): support REG_SZ and REG_EXPAND_SZ PagingFiles values #46

Open
Geekmemz wants to merge 1 commit from upstream-pr/46 into main
Geekmemz commented 2026-12-04 15:56:36 +00:00 (Migrated from github.com)

Imported from ReTerryDavis/ReVIctory. Originally posted by Geekmemz on 2026-12-04T15:56:36Z.


Summary

Windows can store HKLM\SYSTEM\CurrentControlSet\Control\Session Manager\Memory Management\PagingFiles as REG_SZ (or REG_EXPAND_SZ) instead of REG_MULTI_SZ. Previously read_paging_files_registry() rejected non-REG_MULTI_SZ values and returned an empty list, causing configured_text() to report "Disabled / custom" for system-managed pagefiles and preventing PendingReboot detection for configured single-string pagefiles.

Changes

  • Added decode_paging_files_value(kind, raw) in apps/victory/src/launcher/pagefile.rs to decode UTF-16LE bytes for REG_MULTI_SZ, REG_SZ, and REG_EXPAND_SZ (stopping at the first NUL for single-string types, handling missing trailing NULs and odd byte lengths cleanly, and returning empty for non-string types).
  • Updated read_paging_files_registry() to accept REG_MULTI_SZ, REG_SZ, and REG_EXPAND_SZ and read raw bytes before decoding.
  • Added unit tests in launcher::pagefile::tests covering REG_MULTI_SZ, REG_SZ (with/without trailing NUL, trailing data after first NUL), REG_EXPAND_SZ, odd byte length, and non-string REG_DWORD.
  • Kept UI strings untouched to avoid conflicts with other launcher PRs.

Verification

Ran locally on Windows 11 (x86_64-pc-windows-msvc, Rust 1.98.1):

  • cargo clippy -p victory --all-targets --locked -- -D warnings — passed (0 warnings)
  • cargo clippy -p victory --all-targets --all-features --locked -- -D warnings — passed (0 warnings)
  • cargo test -p victory --locked launcher::pagefile — 6 passed, 0 failed
  • cargo test -p xtask --locked — 9 passed, 0 failed (asset policy: 407 files ok)
<!-- greyfinch-sync:ReTerryDavis/ReVIctory:issue:5649746182 --> Imported from [ReTerryDavis/ReVIctory](https://github.com/ReTerryDavis/ReVIctory/pull/46). Originally posted by [Geekmemz](https://github.com/Geekmemz) on 2026-12-04T15:56:36Z. --- ## Summary Windows can store `HKLM\SYSTEM\CurrentControlSet\Control\Session Manager\Memory Management\PagingFiles` as `REG_SZ` (or `REG_EXPAND_SZ`) instead of `REG_MULTI_SZ`. Previously `read_paging_files_registry()` rejected non-`REG_MULTI_SZ` values and returned an empty list, causing `configured_text()` to report `"Disabled / custom"` for system-managed pagefiles and preventing `PendingReboot` detection for configured single-string pagefiles. ## Changes - Added `decode_paging_files_value(kind, raw)` in `apps/victory/src/launcher/pagefile.rs` to decode UTF-16LE bytes for `REG_MULTI_SZ`, `REG_SZ`, and `REG_EXPAND_SZ` (stopping at the first NUL for single-string types, handling missing trailing NULs and odd byte lengths cleanly, and returning empty for non-string types). - Updated `read_paging_files_registry()` to accept `REG_MULTI_SZ`, `REG_SZ`, and `REG_EXPAND_SZ` and read raw bytes before decoding. - Added unit tests in `launcher::pagefile::tests` covering `REG_MULTI_SZ`, `REG_SZ` (with/without trailing NUL, trailing data after first NUL), `REG_EXPAND_SZ`, odd byte length, and non-string `REG_DWORD`. - Kept UI strings untouched to avoid conflicts with other launcher PRs. ## Verification Ran locally on Windows 11 (`x86_64-pc-windows-msvc`, Rust `1.98.1`): - `cargo clippy -p victory --all-targets --locked -- -D warnings` — passed (0 warnings) - `cargo clippy -p victory --all-targets --all-features --locked -- -D warnings` — passed (0 warnings) - `cargo test -p victory --locked launcher::pagefile` — 6 passed, 0 failed - `cargo test -p xtask --locked` — 9 passed, 0 failed (asset policy: 407 files ok)
This pull request cannot be merged automatically due to conflicts.
Merge manually to resolve the conflicts.
View command line instructions

Checkout

From your project repository, check out a new branch and test the changes.
git fetch -u origin 'upstream-pr/46:upstream-pr/46'
git switch 'upstream-pr/46'

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.

git switch 'main'
git merge --no-ff 'upstream-pr/46'
git switch 'upstream-pr/46'
git rebase 'main'
git switch 'main'
git merge --ff-only 'upstream-pr/46'
git switch 'upstream-pr/46'
git rebase 'main'
git switch 'main'
git merge --no-ff 'upstream-pr/46'
git switch 'main'
git merge --squash 'upstream-pr/46'
git switch 'main'
git merge --ff-only 'upstream-pr/46'
git switch 'main'
git merge 'upstream-pr/46'
git push origin 'main'
Sign in to join this conversation.
No reviewers
No labels
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.

Reference
ReTerryDavis/ReVIctory!46
No description provided.