Respect the persistent local storage quota in GetDiskFreeSpaceEx #231
No reviewers
Labels
No labels
accessibility
bug
documentation
duplicate
enhancement
goal:world-load
good first issue
help wanted
invalid
keep-open
off-goal
question
stale
test-only
wontfix
No milestone
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
github/xcl-dev--xcl!231
Loading…
Reference in a new issue
No description provided.
Delete branch "gh-pr/231/head"
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?
@ZekkJJ on GitHub · 2026-11-23 21:25 UTC · original
ZekkJJ:codex/pls-disk-space-quota→main· +365 −29 · 6 files · 2 commits · merged 2026-11-23 21:29 UTCRefs #106 (persistent local storage reporting).
XPersistentLocalStorageGetPathexposes the title’s PLS folder throughS:\by default. TheGetDiskFreeSpaceExW/Ahooks resolve that mount to the host directory, where Windows reports capacity for the entire volume. A title can therefore see the host’s capacity even when its PLS quota is nearly full.For a translated PLS path, cap the reported total at the smaller of the configured quota and the Windows caller-visible total. Subtract the logical sizes of existing PLS files from the configured quota, then cap caller-available and volume-free bytes independently using their native values. Count files from the PLS root even when the query names a child directory. The hooks use the same quota conversion and usage traversal as
XPersistentLocalStorageGetSpaceInfo.The translated directory still goes through the native Win32 query. The hooks preserve native failure codes and optional outputs. The ANSI hook uses Windows’ active file code page. Ordinary host paths keep their native capacity figures. Queries that omit both free-space outputs skip the usage walk.
Regression evidence
The synthetic fixture resolves a 1 MiB
MicrosoftGame.Configquota and writes 579 bytes of files across two directories.956a476The final regression exercises both detours, including a Unicode child directory and an OEM-encoded ANSI path on code page 437. It also checks an alias mount, an exhausted quota, ordinary host paths, null arguments, and a missing directory. A separate unit test checks the zero-config fallback, saturating conversion of oversized quotas, and independent host limits for caller-available and volume-free bytes.
Verification on Windows with Rust 1.95.0
Validated against
mainateaa36b6.cargo +1.95.0 build --locked --workspacepassed.cargo +1.95.0 test --locked -p xcl --test pls_quota -- --nocapturepassed.cargo +1.95.0 test --locked --workspace -- --test-threads=4 --nocapturereported 586 passed, 0 failed, and 39 ignored. Two wave64 cases reported runtime skips. The opt-in retail sample variables were unset.cargo +1.95.0 clippy --locked --workspace --all-targetspassed with the same diagnostics as cleanmain.cargo +1.95.0 fmt --all --checkreported existing formatting differences on both cleanmainand the patch. Rustfmt was applied to the changed lines.git diff --checkpassed.After merging
mainataf20b4b, all 10 VFS hook unit tests and the native PLS regression passed again. The contribution diff is identical to the reviewed commit.@ivall on GitHub · 2026-11-23 21:29 UTC · original
Merged (main
0f34407). Checked on an RX 9070 (RDNA4) with 6 PRs merged together on maind4f17ca:cargo build --workspace && cargo test --workspace -- --test-threads=4- 611 unit tests passed, 0 failed (20 ignored), the integration and e2e tests passed; and the retail game still reaches its first menu at 30 fps.