hle(host_posix): the process calls a title makes at startup (error mode, priority class, IsWow64Process2, its own image path) are stubs #622
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
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?
Imported from LakshanSivakumar/Native-Victory-macOS. Originally posted by AnastasisKon on 2026-11-28T15:48:08Z.
Summary
The calls a title makes about its own process at startup had no implementation in
host_posix/system.rs, so each landed in the loader's import stub:SetErrorMode/SetThreadErrorMode/GetErrorModeSetPriorityClass/GetPriorityClassIsWow64Process2QueryFullProcessImageNameWNone of them can fail a title outright, which is why they went unnoticed, but each is a silent wrong answer in the one place a crash log is written from.
What the change does
SetErrorModeandSetThreadErrorModeboth write it and report the value they replaced,GetErrorModereads it). Shortcut, written down: Windows keeps a per-thread mode beside the process one.ERROR_INVALID_HANDLE.IsWow64Process2reports no emulated 32-bit process andIMAGE_FILE_MACHINE_AMD64as the native machine, because that is the machine whose code runs here; a title told ARM64 takes paths (arm64 binaries, different threading) this host does not serve.QueryFullProcessImageNameWreturns the main image's path fromGetModuleFileNameW, with its NUL and its length without it back insize; a buffer that is too small isERROR_INSUFFICIENT_BUFFERand is left untouched.Tests
Three new ones in
system.rs: the error mode round-trips and reports what it replaced; the priority class is remembered, an unknown class isERROR_INVALID_PARAMETER, and a foreign handle is not answered; the process is AMD64, bothIsWow64Process2outputs are optional, and the image path comes back NUL-terminated with its length, while a two-unit buffer is refused.Imported from LakshanSivakumar/Native-Victory-macOS. Originally posted by AnastasisKon on 2026-11-28T15:48:53Z.
/claim
Imported from LakshanSivakumar/Native-Victory-macOS. Originally posted by github-actions[bot] on 2026-11-28T15:49:02Z.
Claimed by @AnastasisKon. Open a draft pull request with
Refs #622in its description within 24 hours, or the claim expires.Imported from LakshanSivakumar/Native-Victory-macOS. Originally posted by AnastasisKon on 2026-11-28T16:31:46Z.
Merged with the PR that serves these calls; closing.