DirectStorage: implement IDStorageFileX::GetFileInformation #1270

Open
Ivankiosan wants to merge 1 commit from upstream-pr/1280 into main
Ivankiosan commented 2026-11-24 14:11:19 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by Ivankiosan on 2026-11-24T14:11:19Z.


Implements IDStorageFileX::GetFileInformation (vtable slot 5) in crates/xcl/src/hle/dstorage.rs so games and DirectStorage loaders querying file metadata, timestamps, or file sizes via BY_HANDLE_FILE_INFORMATION receive real values from the underlying file rather than an unmodelled E_NOTIMPL stub.

What is in it

  • Implements file_get_file_information at slot 5 of IDStorageFileX's vtable in crates/xcl/src/hle/dstorage.rs.
  • Validates the destination pointer (returns E_POINTER if null).
  • Validates file state (returns E_FILE_HANDLE if the file has been closed).
  • Queries the underlying OS file handle with GetFileInformationByHandle to populate dwFileAttributes, ftCreationTime, ftLastAccessTime, ftLastWriteTime, dwVolumeSerialNumber, nFileSizeHigh, nFileSizeLow, etc.
  • Adds comprehensive unit test hle::dstorage::tests::file_get_file_information_returns_size_and_validates_args covering argument validation, successful metadata query, and rejection after file closure.

Tested

  • Hardware/OS: AMD Radeon RX 7600 (driver 32.0.12028.1005), Windows 11, rustc 1.99.1 (58cf8f9c3 2026-10-13) / MSVC 14.51.
  • Unit tests: cargo test -p xcl --lib hle::dstorage: all 15 passed, 0 failed.
  • Workspace test suite: cargo test --workspace -- --test-threads=4: all 729 unit tests and all integration tests passed with 0 failures.
  • Built release binary target/release/xcl.exe (cargo build --release -p xcl).

Regression run

main:

xcl-smoke v1
commit: 47efa2ecea0a12934719ae69b81930cf02a4b1c3
gpu: AMD Radeon RX 7600
title: 419239bf
seconds: 10
exit: 0x0
frames shown: 26 (PresentX 26)
presents per 2 s (last 3): 0 0 23
device removals: 0
crashes: 0
peak commit: 8172 MB

PR head:

xcl-smoke v1
commit: f8b0c198eb334f3dd50aa1b9804b73308f533162
gpu: AMD Radeon RX 7600
title: 419239bf
seconds: 10
exit: 0x0
frames shown: 65 (PresentX 65)
presents per 2 s (last 3): 0 11 53
device removals: 0
crashes: 0
peak commit: 8889 MB

Not tested

  • Network share files opened via DirectStorage.
  • Linux / Wine / Proton environment (tests and smoke run executed natively on Windows 11).

AI use

  • Google Antigravity (Gemini): audited IDStorageFileX vtable layout in crates/xcl/src/hle/dstorage.rs against DirectStorage GDK specifications, implemented file_get_file_information at slot 5 with GetFileInformationByHandle, authored unit tests, and verified workspace tests and GPU smoke regression.
<!-- greyfinch-sync:ivall/xcl:issue:5473779137 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/1280). Originally posted by [Ivankiosan](https://github.com/Ivankiosan) on 2026-11-24T14:11:19Z. --- Implements `IDStorageFileX::GetFileInformation` (vtable slot 5) in `crates/xcl/src/hle/dstorage.rs` so games and DirectStorage loaders querying file metadata, timestamps, or file sizes via `BY_HANDLE_FILE_INFORMATION` receive real values from the underlying file rather than an unmodelled `E_NOTIMPL` stub. **What is in it** - Implements `file_get_file_information` at slot 5 of `IDStorageFileX`'s vtable in `crates/xcl/src/hle/dstorage.rs`. - Validates the destination pointer (returns `E_POINTER` if null). - Validates file state (returns `E_FILE_HANDLE` if the file has been closed). - Queries the underlying OS file handle with `GetFileInformationByHandle` to populate `dwFileAttributes`, `ftCreationTime`, `ftLastAccessTime`, `ftLastWriteTime`, `dwVolumeSerialNumber`, `nFileSizeHigh`, `nFileSizeLow`, etc. - Adds comprehensive unit test `hle::dstorage::tests::file_get_file_information_returns_size_and_validates_args` covering argument validation, successful metadata query, and rejection after file closure. **Tested** - Hardware/OS: AMD Radeon RX 7600 (driver 32.0.12028.1005), Windows 11, `rustc 1.99.1 (58cf8f9c3 2026-10-13)` / MSVC 14.51. - Unit tests: `cargo test -p xcl --lib hle::dstorage`: all 15 passed, 0 failed. - Workspace test suite: `cargo test --workspace -- --test-threads=4`: all 729 unit tests and all integration tests passed with 0 failures. - Built release binary `target/release/xcl.exe` (`cargo build --release -p xcl`). **Regression run** main: ``` xcl-smoke v1 commit: 47efa2ecea0a12934719ae69b81930cf02a4b1c3 gpu: AMD Radeon RX 7600 title: 419239bf seconds: 10 exit: 0x0 frames shown: 26 (PresentX 26) presents per 2 s (last 3): 0 0 23 device removals: 0 crashes: 0 peak commit: 8172 MB ``` PR head: ``` xcl-smoke v1 commit: f8b0c198eb334f3dd50aa1b9804b73308f533162 gpu: AMD Radeon RX 7600 title: 419239bf seconds: 10 exit: 0x0 frames shown: 65 (PresentX 65) presents per 2 s (last 3): 0 11 53 device removals: 0 crashes: 0 peak commit: 8889 MB ``` **Not tested** - Network share files opened via DirectStorage. - Linux / Wine / Proton environment (tests and smoke run executed natively on Windows 11). **AI use** - Google Antigravity (Gemini): audited `IDStorageFileX` vtable layout in `crates/xcl/src/hle/dstorage.rs` against DirectStorage GDK specifications, implemented `file_get_file_information` at slot 5 with `GetFileInformationByHandle`, authored unit tests, and verified workspace tests and GPU smoke regression.
DavidM1911 commented 2026-11-24 15:05:45 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by DavidM1911 on 2026-11-24T14:12:20Z.


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

  • cargo test -p xcl --lib dstorage: 15 passed; the new file_get_file_information_returns_size_and_validates_args passes.

Thanks!

<!-- greyfinch-sync:ivall/xcl:comment:7134002755 --> Imported from [ivall/xcl](https://github.com/ivall/xcl/pull/1280#issuecomment-7134002755). Originally posted by [DavidM1911](https://github.com/DavidM1911) on 2026-11-24T14:12:20Z. --- Verification on RTX 3060 Ti (Windows 11), branch merged with current `main`: - `cargo test -p xcl --lib dstorage`: 15 passed; the new `file_get_file_information_returns_size_and_validates_args` passes. Thanks!
dcastell1 commented 2026-11-24 15:05:45 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by dcastell1 on 2026-11-24T14:14:03Z.


Verified on Windows 11 10.0.26300, NVIDIA GeForce RTX 5090 (driver 621.24), Rust 1.100.0 MSVC 14.44.35207, debug build, on main@930e8b4 (baseline 751 passed, 0 failed, 41 ignored on this box):

patch -p1 < this PR            # clean, no fuzz
cargo test --workspace -- --test-threads=4
752 passed; 0 failed; 41 ignored   (exit 0)

One more passing test than the baseline; IDStorageFileX::GetFileInformation ships its coverage and it runs green.

Tree restored afterwards (full diff against a clean checkout), hardware adapter, no Wine, no game data. AI-assisted (opencode): applied the patch to a built tree, ran the suite, reverted it.

<!-- greyfinch-sync:ivall/xcl:comment:7134046802 --> Imported from [ivall/xcl](https://github.com/ivall/xcl/pull/1280#issuecomment-7134046802). Originally posted by [dcastell1](https://github.com/dcastell1) on 2026-11-24T14:14:03Z. --- Verified on Windows 11 10.0.26300, NVIDIA GeForce RTX 5090 (driver 621.24), Rust 1.100.0 MSVC 14.44.35207, debug build, on `main@930e8b4` (baseline **751 passed, 0 failed, 41 ignored** on this box): ``` patch -p1 < this PR # clean, no fuzz cargo test --workspace -- --test-threads=4 752 passed; 0 failed; 41 ignored (exit 0) ``` One more passing test than the baseline; `IDStorageFileX::GetFileInformation` ships its coverage and it runs green. Tree restored afterwards (full diff against a clean checkout), hardware adapter, no Wine, no game data. AI-assisted (opencode): applied the patch to a built tree, ran the suite, reverted it.
github-actions[bot] commented 2026-11-27 21:26:32 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by github-actions[bot] on 2026-11-27T21:26:32Z.


Nothing has happened on this PR for 3 days, so it is marked stale and will be closed in 4 days. A push or a comment takes the mark off: rebase it onto main if it conflicts, and say in one line what it still fixes. If it only waits for a maintainer, a comment saying so is enough.

<!-- greyfinch-sync:ivall/xcl:comment:7228447051 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/1280#issuecomment-7228447051). Originally posted by [github-actions[bot]](https://github.com/apps/github-actions) on 2026-11-27T21:26:32Z. --- Nothing has happened on this PR for 3 days, so it is marked `stale` and will be closed in 4 days. A push or a comment takes the mark off: rebase it onto `main` if it conflicts, and say in one line what it still fixes. If it only waits for a maintainer, a comment saying so is enough.
Foniass commented 2026-12-01 05:19:24 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by Foniass on 2026-12-01T05:19:24Z.


Triage (#1607) – head f8b0c19

No open or merged PR makes the same change.
Neither the diff nor the description shows evidence that console slot #5 of IDStorageFileX is GetFileInformation. On PC, IDStorageFile::GetFileInformation follows Close at slot 4, and the console table has GetHandle there. Please say what showed that a title calls #5 with a BY_HANDLE_FILE_INFORMATION*, for example a log line from a title or a disassembled call. If a title passes something else there, GetFileInformationByHandle writes 52 bytes into it.
The branch conflicts with main and needs a rebase.
Recommendation: keep open.

AI review: Claude Code (Claude Opus 5.5), diffs read only, not built or run; not checked by a human.

<!-- greyfinch-sync:ivall/xcl:comment:7301649574 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/1280#issuecomment-7301649574). Originally posted by [Foniass](https://github.com/Foniass) on 2026-12-01T05:19:24Z. --- **Triage (#1607)** – head f8b0c19 No open or merged PR makes the same change. Neither the diff nor the description shows evidence that console slot #5 of IDStorageFileX is GetFileInformation. On PC, `IDStorageFile::GetFileInformation` follows Close at slot 4, and the console table has GetHandle there. Please say what showed that a title calls #5 with a `BY_HANDLE_FILE_INFORMATION*`, for example a log line from a title or a disassembled call. If a title passes something else there, `GetFileInformationByHandle` writes 52 bytes into it. The branch conflicts with main and needs a rebase. Recommendation: keep open. AI review: Claude Code (Claude Opus 5.5), diffs read only, not built or run; not checked by a human.
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/1280:upstream-pr/1280'
git switch 'upstream-pr/1280'

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/1280'
git switch 'upstream-pr/1280'
git rebase 'main'
git switch 'main'
git merge --ff-only 'upstream-pr/1280'
git switch 'upstream-pr/1280'
git rebase 'main'
git switch 'main'
git merge --no-ff 'upstream-pr/1280'
git switch 'main'
git merge --squash 'upstream-pr/1280'
git switch 'main'
git merge --ff-only 'upstream-pr/1280'
git switch 'main'
git merge 'upstream-pr/1280'
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
xcl-dev/xcl!1270
No description provided.