HLE: oleaut32 is not in the host pass-through list, so the title's BSTR ordinals do not resolve #2904

Open
Jackster wants to merge 1 commit from upstream-pr/2906 into main
Jackster commented 2026-11-25 23:35:39 +00:00 (Migrated from github.com)

Imported from Marvisak/VIctory. Originally posted by Jackster on 2026-11-25T23:35:39Z.


HostPolicy::default() allows ole32.dll but not oleaut32.dll, and the host lookup is gated on that list, so every oleaut32.dll import fell through to the unimplemented-import stub. A title imports two of them by ordinal, which victory census <dump> --missing reported as unresolved:

oleaut32.dll        2 funcs   0 hle   0 host   2 missing      (oleaut32.dll!#4, oleaut32.dll!#6)

They are SysAllocStringLen (#4) and SysFreeString (#6). dumpbin /exports on the host's own oleaut32.dll confirms the ordinals:

    2   6F 00010CF0 SysAllocString
    4   71 00010C10 SysAllocStringLen
    6   72 00017450 SysFreeString
    7   77 00003990 SysStringLen

Allocating and freeing a BSTR does not differ between the console and the host, exactly like the ole32.dll calls already allowed next to it — the omission looked like an oversight rather than a policy decision.

Change

  • crates/victory-hle/src/host.rs: oleaut32.dll added to the default allow list, with a comment.
  • crates/victory-hle/src/lib.rs: oleaut32_bstr_ordinals_pass_through_to_host, which classifies ordinals 4 and 6 as Provenance::Host and checks that an ordinal the DLL does not export still resolves to nothing.

No HLE implementations are added: the host's exports answer these, by ordinal, through the existing pass-through.

Verified

On the retail dump used for the report:

before:  oleaut32.dll   2 funcs   0 hle   0 host   2 missing     (74 missing overall)
after:   oleaut32.dll   2 funcs   0 hle   2 host   0 missing     (72 missing overall)

cargo test -p victory-hle: 153 passed, 0 failed. Full workspace suite (--exclude victory-core, absent from this checkout only): 0 failures.

Claimed in #1633: https://github.com/Marvisak/VIctory/issues/1633#issuecomment-7177495369

AI-assisted (drafted with an AI coding agent); the census runs, the dumpbin check and the test runs above are my own. No game data beyond the DLL name and ordinals the census prints.

<!-- greyfinch-sync:Marvisak/VIctory:issue:5501060653 --> Imported from [Marvisak/VIctory](https://github.com/Marvisak/VIctory/pull/2906). Originally posted by [Jackster](https://github.com/Jackster) on 2026-11-25T23:35:39Z. --- `HostPolicy::default()` allows `ole32.dll` but not `oleaut32.dll`, and the host lookup is gated on that list, so every `oleaut32.dll` import fell through to the unimplemented-import stub. A title imports two of them **by ordinal**, which `victory census <dump> --missing` reported as unresolved: ``` oleaut32.dll 2 funcs 0 hle 0 host 2 missing (oleaut32.dll!#4, oleaut32.dll!#6) ``` They are `SysAllocStringLen` (#4) and `SysFreeString` (#6). `dumpbin /exports` on the host's own `oleaut32.dll` confirms the ordinals: ``` 2 6F 00010CF0 SysAllocString 4 71 00010C10 SysAllocStringLen 6 72 00017450 SysFreeString 7 77 00003990 SysStringLen ``` Allocating and freeing a BSTR does not differ between the console and the host, exactly like the `ole32.dll` calls already allowed next to it — the omission looked like an oversight rather than a policy decision. ### Change * `crates/victory-hle/src/host.rs`: `oleaut32.dll` added to the default allow list, with a comment. * `crates/victory-hle/src/lib.rs`: `oleaut32_bstr_ordinals_pass_through_to_host`, which classifies ordinals 4 and 6 as `Provenance::Host` and checks that an ordinal the DLL does not export still resolves to nothing. No HLE implementations are added: the host's exports answer these, by ordinal, through the existing pass-through. ### Verified On the retail dump used for the report: ``` before: oleaut32.dll 2 funcs 0 hle 0 host 2 missing (74 missing overall) after: oleaut32.dll 2 funcs 0 hle 2 host 0 missing (72 missing overall) ``` `cargo test -p victory-hle`: 153 passed, 0 failed. Full workspace suite (`--exclude victory-core`, absent from this checkout only): 0 failures. Claimed in #1633: https://github.com/Marvisak/VIctory/issues/1633#issuecomment-7177495369 AI-assisted (drafted with an AI coding agent); the census runs, the `dumpbin` check and the test runs above are my own. No game data beyond the DLL name and ordinals the census prints.
kotekompotek commented 2026-11-25 23:38:14 +00:00 (Migrated from github.com)

Imported from Marvisak/VIctory. Originally posted by kotekompotek on 2026-11-25T23:38:14Z.

Review: COMMENTED


Verified: BSTR helpers are semantically identical host-side, and the test locks in both directions — ordinals 4/6 pass through while a non-existent ordinal resolves to nothing (so classify does real per-DLL ordinal validation, not blind pass-through). LGTM.

<!-- greyfinch-sync:Marvisak/VIctory:review:6066508884 --> Imported from [Marvisak/VIctory](https://github.com/Marvisak/VIctory/pull/2906#pullrequestreview-6066508884). Originally posted by [kotekompotek](https://github.com/kotekompotek) on 2026-11-25T23:38:14Z. **Review:** COMMENTED --- Verified: BSTR helpers are semantically identical host-side, and the test locks in both directions — ordinals 4/6 pass through while a non-existent ordinal resolves to nothing (so classify does real per-DLL ordinal validation, not blind pass-through). LGTM.
fuzeofficlal commented 2026-11-26 00:03:34 +00:00 (Migrated from github.com)

Imported from Marvisak/VIctory. Originally posted by fuzeofficlal on 2026-11-25T23:38:46Z.


Heads-up on overlap: #2065 (currently triage: merge candidate for #811) already adds "oleaut32.dll" to HostPolicy::default() in crates/victory-hle/src/host.rs alongside ole32.dll and tests ordinal #4 (SysAllocStringLen) and #6 (SysFreeString) resolution.

Nice addition here testing resolve_import through crates/victory-hle/src/lib.rs as well — leaving this cross-reference so maintainers can pick whichever they prefer.

<!-- greyfinch-sync:Marvisak/VIctory:comment:7177852758 --> Imported from [Marvisak/VIctory](https://github.com/Marvisak/VIctory/pull/2906#issuecomment-7177852758). Originally posted by [fuzeofficlal](https://github.com/fuzeofficlal) on 2026-11-25T23:38:46Z. --- Heads-up on overlap: `#2065` (currently `triage: merge candidate` for `#811`) already adds `"oleaut32.dll"` to `HostPolicy::default()` in `crates/victory-hle/src/host.rs` alongside `ole32.dll` and tests ordinal `#4` (`SysAllocStringLen`) and `#6` (`SysFreeString`) resolution. Nice addition here testing `resolve_import` through `crates/victory-hle/src/lib.rs` as well — leaving this cross-reference so maintainers can pick whichever they prefer.
Kajanos commented 2026-11-26 01:03:57 +00:00 (Migrated from github.com)

Imported from Marvisak/VIctory. Originally posted by Kajanos on 2026-11-26T00:07:23Z.


Windows 11 / NVIDIA test run, head c42ee14369 merged onto main 63bcca43c6.

Setup: Windows 11 Home build 26300, RTX 5080, NVIDIA 621.40, rustc 1.98.1 MSVC, VS 2022 Build Tools, Windows SDK 10.0.26100 (dxil.dll from the SDK).

  • cargo test --locked -p victory-hle: 152 passed, 1 failed.
  • The one failure is lifecycle::tests::showing_a_title_window_shows_its_stand_in, and it also fails on main in this run. The tests ran over SSH, i.e. in session 0 with no interactive desktop, so the window can't be shown. On the desktop session the same test passes on main (12/12 lifecycle). This PR doesn't touch lifecycle.

Not run: the retail title, clippy, and other crates.

AI-assisted (Claude Code)

<!-- greyfinch-sync:Marvisak/VIctory:comment:7178418428 --> Imported from [Marvisak/VIctory](https://github.com/Marvisak/VIctory/pull/2906#issuecomment-7178418428). Originally posted by [Kajanos](https://github.com/Kajanos) on 2026-11-26T00:07:23Z. --- **Windows 11 / NVIDIA test run**, head `c42ee14369` merged onto `main` `63bcca43c6`. Setup: Windows 11 Home build 26300, RTX 5080, NVIDIA 621.40, rustc 1.98.1 MSVC, VS 2022 Build Tools, Windows SDK 10.0.26100 (`dxil.dll` from the SDK). - `cargo test --locked -p victory-hle`: 152 passed, 1 failed. - The one failure is `lifecycle::tests::showing_a_title_window_shows_its_stand_in`, and it also fails on `main` in this run. The tests ran over SSH, i.e. in session 0 with no interactive desktop, so the window can't be shown. On the desktop session the same test passes on `main` (12/12 `lifecycle`). This PR doesn't touch lifecycle. Not run: the retail title, clippy, and other crates. AI-assisted (Claude Code)
Marvisak commented 2026-11-26 03:05:05 +00:00 (Migrated from github.com)

Imported from Marvisak/VIctory. Originally posted by Marvisak on 2026-11-26T02:18:44Z.


Automated triage for the maintainers.

Proposed close: duplicate of #2065. #2065 makes the same change, adding "oleaut32.dll" to HostPolicy::default() in crates/victory-hle/src/host.rs. It merges cleanly, is already marked as a merge candidate, and tests ordinals 4 and 6 resolving to the host. The extra classify test here could be offered on #2065 instead.

This PR will be closed in 48 hours unless the author pushes a change or a maintainer removes the triage: proposed close label.


Generated by Claude Code

<!-- greyfinch-sync:Marvisak/VIctory:comment:7180678293 --> Imported from [Marvisak/VIctory](https://github.com/Marvisak/VIctory/pull/2906#issuecomment-7180678293). Originally posted by [Marvisak](https://github.com/Marvisak) on 2026-11-26T02:18:44Z. --- <!-- victory-triage v1 head=c42ee14369f8562945ab2e682df5bbb086988a2c verdict=proposed-close at=2026-11-26T02:18:50Z --> Automated triage for the maintainers. **Proposed close: duplicate of #2065.** #2065 makes the same change, adding `"oleaut32.dll"` to `HostPolicy::default()` in `crates/victory-hle/src/host.rs`. It merges cleanly, is already marked as a merge candidate, and tests ordinals 4 and 6 resolving to the host. The extra `classify` test here could be offered on #2065 instead. This PR will be closed in 48 hours unless the author pushes a change or a maintainer removes the `triage: proposed close` label. --- _Generated by [Claude Code](https://claude.ai/code)_
cloph-dsp commented 2026-11-26 13:04:30 +00:00 (Migrated from github.com)

Imported from Marvisak/VIctory. Originally posted by cloph-dsp on 2026-11-26T12:29:35Z.


Independent local verification of head c42ee14 on Windows 11, Rust 1.100.0/MSVC:

  • cargo test --locked -p victory-hle --lib -- tests::oleaut32_bstr_ordinals_pass_through_to_host --exact — 1 passed, 0 failed.
  • git diff --check origin/main HEAD — clean.

Used a worktree-local CARGO_TARGET_DIR. Synthetic ordinal inputs only; no game assets or DRM material used. AI-assisted (Hy4 flash). GPU/driver: N/A (CPU-only).

<!-- greyfinch-sync:Marvisak/VIctory:comment:7192071017 --> Imported from [Marvisak/VIctory](https://github.com/Marvisak/VIctory/pull/2906#issuecomment-7192071017). Originally posted by [cloph-dsp](https://github.com/cloph-dsp) on 2026-11-26T12:29:35Z. --- Independent local verification of head `c42ee14` on Windows 11, Rust 1.100.0/MSVC: - `cargo test --locked -p victory-hle --lib -- tests::oleaut32_bstr_ordinals_pass_through_to_host --exact` — 1 passed, 0 failed. - `git diff --check origin/main HEAD` — clean. Used a worktree-local `CARGO_TARGET_DIR`. Synthetic ordinal inputs only; no game assets or DRM material used. AI-assisted (Hy4 flash). GPU/driver: N/A (CPU-only).
Dukestar69 commented 2026-11-27 02:07:55 +00:00 (Migrated from github.com)

Imported from Marvisak/VIctory. Originally posted by Dukestar69 on 2026-11-27T02:07:55Z.

Review: APPROVED


LGTM — verified on Windows:

  • Adding oleaut32.dll to HostPolicy cleanly allows BSTR ordinals (#4 SysAllocStringLen, #6 SysFreeString) to pass through to the host
  • cargo test -p victory-hle --lib oleaut32_bstr_ordinals_pass_through_to_host passed
  • cargo clippy -p victory-hle --all-targets -- -D warnings passed with 0 warnings
  • cargo xtask policy passed (191 files ok)

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

<!-- greyfinch-sync:Marvisak/VIctory:review:6082573622 --> Imported from [Marvisak/VIctory](https://github.com/Marvisak/VIctory/pull/2906#pullrequestreview-6082573622). Originally posted by [Dukestar69](https://github.com/Dukestar69) on 2026-11-27T02:07:55Z. **Review:** APPROVED --- LGTM — verified on Windows: - Adding `oleaut32.dll` to `HostPolicy` cleanly allows BSTR ordinals (`#4` `SysAllocStringLen`, `#6` `SysFreeString`) to pass through to the host - `cargo test -p victory-hle --lib oleaut32_bstr_ordinals_pass_through_to_host` passed - `cargo clippy -p victory-hle --all-targets -- -D warnings` passed with 0 warnings - `cargo xtask policy` passed (`191 files ok`) Synthetic tests only (no game files used). AI-assisted (Gemini 4 Neon).
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/2906:upstream-pr/2906'
git switch 'upstream-pr/2906'

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/2906'
git switch 'upstream-pr/2906'
git rebase 'main'
git switch 'main'
git merge --ff-only 'upstream-pr/2906'
git switch 'upstream-pr/2906'
git rebase 'main'
git switch 'main'
git merge --no-ff 'upstream-pr/2906'
git switch 'main'
git merge --squash 'upstream-pr/2906'
git switch 'main'
git merge --ff-only 'upstream-pr/2906'
git switch 'main'
git merge 'upstream-pr/2906'
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
Marvisak/VIctory!2904
No description provided.