hle(host_posix): the process calls a title makes at startup (error mode, priority class, IsWow64Process2, its own image path) are stubs #626
Labels
No labels
accessibility
bug
claimed
documentation
duplicate
enhancement
good first issue
help wanted
invalid
question
tester report
urgent
wontfix
No milestone
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
github/LakshanSivakumar--Native-Victory-macOS#626
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?
@AnastasisKon on GitHub · 2026-11-28 15:48 UTC · original
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.@AnastasisKon on GitHub · 2026-11-28 15:48 UTC · original
/claim
@github-actions[bot] on GitHub · 2026-11-28 15:49 UTC · original
Claimed by @AnastasisKon. Open a draft pull request with
Refs #622in its description within 24 hours, or the claim expires.@AnastasisKon on GitHub · 2026-11-28 16:31 UTC · original
Merged with the PR that serves these calls; closing.