ucrt: serve vcruntime140's memory and string imports #289

Manually merged
github merged 1 commit from github-bot/gh-289 into main 2026-11-27 10:48:37 +00:00 AGit
Owner

@⁠AnastasisKon on GitHub · 2026-11-27 08:56 UTC · original
AnastasisKon:vibe/vcruntime-ucrt-9e73da → main · +25 −3 · 2 files · 1 commits · merged 2026-11-27 10:46 UTC

A title with no vcruntime140.dll of its own got the ucrt's implementations only for ucrtbase and api-ms-win-crt-: its VCRUNTIME140 imports of memset and memcpy fell through to the host's kernel table, which has none of them, and came back as no-op stubs returning 0 -- the failed load of #104 called both. vcruntime140 is now served from the ucrt when the title ships no DLL of that name (the same gate the kernel table uses), and the names the ucrt does not have still fall through to the kernel table and the exception functions.

What this changes

How it was tested

  • cargo test --target x86_64-apple-darwin -p victory-hle -p victory-loader -p victory
  • cargo clippy --workspace --all-targets --locked --target x86_64-pc-windows-gnullvm -- -D warnings
  • Ran the game (say how far it got), or not needed

Checklist

  • No game files, game code, disassembly listings or SDK files are included
  • Guesses about undocumented console behaviour are marked in the code and in docs/native-host.md
  • New diagnostics are behind a VICTORY_* variable and documented
**@⁠AnastasisKon** on GitHub · 2026-11-27 08:56 UTC · [original](https://github.com/LakshanSivakumar/Native-Victory-macOS/pull/289) `AnastasisKon:vibe/vcruntime-ucrt-9e73da` → `main` · +25 −3 · 2 files · 1 commits · merged 2026-11-27 10:46 UTC A title with no vcruntime140.dll of its own got the ucrt's implementations only for ucrtbase and api-ms-win-crt-*: its VCRUNTIME140 imports of memset and memcpy fell through to the host's kernel table, which has none of them, and came back as no-op stubs returning 0 -- the failed load of #104 called both. vcruntime140* is now served from the ucrt when the title ships no DLL of that name (the same gate the kernel table uses), and the names the ucrt does not have still fall through to the kernel table and the exception functions. ## What this changes <!-- One change per pull request. Name the issue you claimed for it: Refs #123 (or Closes #123). --> ## How it was tested - [ ] `cargo test --target x86_64-apple-darwin -p victory-hle -p victory-loader -p victory` - [ ] `cargo clippy --workspace --all-targets --locked --target x86_64-pc-windows-gnullvm -- -D warnings` - [ ] Ran the game (say how far it got), or not needed ## Checklist - [ ] No game files, game code, disassembly listings or SDK files are included - [ ] Guesses about undocumented console behaviour are marked in the code and in docs/native-host.md - [ ] New diagnostics are behind a `VICTORY_*` variable and documented
A title with no vcruntime140.dll of its own got the ucrt's
implementations only for ucrtbase and api-ms-win-crt-*: its
VCRUNTIME140 imports of memset and memcpy fell through to the
host's kernel table, which has none of them, and came back as
no-op stubs returning 0 -- the failed load of #104 called both.
vcruntime140* is now served from the ucrt when the title ships
no DLL of that name (the same gate the kernel table uses), and
the names the ucrt does not have still fall through to the
kernel table and the exception functions.

Co-authored-by: AnastasisKon <[email protected]>
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-27 08:58:03 +00:00
github manually merged commit d57c9a6ea8 into main 2026-11-27 10:48:37 +00:00
Author
Owner

@⁠LakshanSivakumar on GitHub · 2026-11-27 10:46 UTC · original

Thank you. Merged.

I ran these five together on my Mac before merging (#101, #267, #288, #289, #291 on main, M5 Pro 48 GB, Series S, warm cache, three runs): two runs stayed in the world until the time limit (139 s and 202 s there, about 2 fps, no failed command buffer, no fault); one ended at the start of the world with a title fault I had not seen before (first chance at image+0x4fafef8, a read of 0x30000065c), with no GPU error before it. I could not tie that one to any of the five. If you see it, please say so.

**@⁠LakshanSivakumar** on GitHub · 2026-11-27 10:46 UTC · [original](https://github.com/LakshanSivakumar/Native-Victory-macOS/pull/289#issuecomment-7216285643) Thank you. Merged. I ran these five together on my Mac before merging (#101, #267, #288, #289, #291 on main, M5 Pro 48 GB, Series S, warm cache, three runs): two runs stayed in the world until the time limit (139 s and 202 s there, about 2 fps, no failed command buffer, no fault); one ended at the start of the world with a title fault I had not seen before (first chance at image+0x4fafef8, a read of 0x30000065c), with no GPU error before it. I could not tie that one to any of the five. If you see it, please say so.
This discussion has been locked. Commenting is limited to contributors.
No description provided.