hle(host_posix): the calls that tell a title what it is running on (version, VerifyVersionInfo, interrupt time, system times, RAM) are stubs #628

Closed
opened 2026-11-28 15:57:50 +00:00 by github-bot · 3 comments
Owner

@⁠AnastasisKon on GitHub · 2026-11-28 15:56 UTC · original

Summary

Six calls that tell a title what it is running on were unimplemented in host_posix/system.rs, so they answered through the loader's import stub:

Call What the stub did
RtlGetVersion, GetVersionExW nothing: the version structure keeps the caller's zeros
VerifyVersionInfoW nothing: every comparison reads as "no"
QueryUnbiasedInterruptTime nothing: a frame-timing loop reading it sees a clock stuck at 0
GetSystemTimes nothing: the process's CPU time never moves
GetPhysicallyInstalledSystemMemory nothing: the machine has no RAM

A version check that fails is the risky one: a title without a manifest asks "am I on Windows 10 or later", gets no, and takes the Windows 7 path it still carries for its launcher — a path this host does not serve.

What the change does

  • RtlGetVersion and GetVersionExW fill either OSVERSIONINFOW or OSVERSIONINFOEXW, by the size the caller wrote, as Windows 10 build 19041 with no service pack. GetVersionExW refuses a size that is neither, as Windows does; RtlGetVersion always succeeds. Shortcut, written down: the console reports its own build, and this is the build the GDK's own headers target.
  • VerifyVersionInfoW reads the CONDITION_VECTOR and answers the operator in the high byte of type_mask (EQUAL, GREATER, GREATER_EQUAL, LESS, LESS_EQUAL, AND, OR) for every field the low byte selects, ERROR_OLD_WIN_VERSION when one does not hold.
  • QueryUnbiasedInterruptTime is 100 ns units from the host's own counter.
  • GetSystemTimes gives the process's own kernel and user time from getrusage and no idle time, which is the honest answer here: this host does not account for another process's idling and a title only subtracts two readings.
  • GetPhysicallyInstalledSystemMemory is hw.memsize in KiB.
  • ntdll.dll is now served by the same table as kernel32, because the Rtl* names live there and a title imports them from there.

Tests

Three new ones in system.rs: the version is filled in both forms and a wrong size is refused; the comparison answers with the operator it was given, including two fields at once; and the interrupt time moves, the process has used CPU time with no idle time, and the RAM is a Mac's.

**@⁠AnastasisKon** on GitHub · 2026-11-28 15:56 UTC · [original](https://github.com/LakshanSivakumar/Native-Victory-macOS/issues/624) ## Summary Six calls that tell a title what it is running on were unimplemented in `host_posix/system.rs`, so they answered through the loader's import stub: | Call | What the stub did | |---|---| | `RtlGetVersion`, `GetVersionExW` | nothing: the version structure keeps the caller's zeros | | `VerifyVersionInfoW` | nothing: every comparison reads as "no" | | `QueryUnbiasedInterruptTime` | nothing: a frame-timing loop reading it sees a clock stuck at 0 | | `GetSystemTimes` | nothing: the process's CPU time never moves | | `GetPhysicallyInstalledSystemMemory` | nothing: the machine has no RAM | A version check that fails is the risky one: a title without a manifest asks "am I on Windows 10 or later", gets no, and takes the Windows 7 path it still carries for its launcher — a path this host does not serve. ## What the change does - `RtlGetVersion` and `GetVersionExW` fill either `OSVERSIONINFOW` or `OSVERSIONINFOEXW`, by the size the caller wrote, as Windows 10 build 19041 with no service pack. `GetVersionExW` refuses a size that is neither, as Windows does; `RtlGetVersion` always succeeds. Shortcut, written down: the console reports its own build, and this is the build the GDK's own headers target. - `VerifyVersionInfoW` reads the `CONDITION_VECTOR` and answers the operator in the high byte of `type_mask` (`EQUAL`, `GREATER`, `GREATER_EQUAL`, `LESS`, `LESS_EQUAL`, `AND`, `OR`) for every field the low byte selects, `ERROR_OLD_WIN_VERSION` when one does not hold. - `QueryUnbiasedInterruptTime` is 100 ns units from the host's own counter. - `GetSystemTimes` gives the process's own kernel and user time from `getrusage` and no idle time, which is the honest answer here: this host does not account for another process's idling and a title only subtracts two readings. - `GetPhysicallyInstalledSystemMemory` is `hw.memsize` in KiB. - `ntdll.dll` is now served by the same table as `kernel32`, because the `Rtl*` names live there and a title imports them from there. ## Tests Three new ones in `system.rs`: the version is filled in both forms and a wrong size is refused; the comparison answers with the operator it was given, including two fields at once; and the interrupt time moves, the process has used CPU time with no idle time, and the RAM is a Mac's.
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-28 15:57:50 +00:00
Author
Owner

@⁠AnastasisKon on GitHub · 2026-11-28 15:57 UTC · original

/claim

**@⁠AnastasisKon** on GitHub · 2026-11-28 15:57 UTC · [original](https://github.com/LakshanSivakumar/Native-Victory-macOS/issues/624#issuecomment-7241860466) /claim
Author
Owner

@⁠github-actions[bot] on GitHub · 2026-11-28 15:57 UTC · original

Claimed by @⁠AnastasisKon. Open a draft pull request with Refs #624 in its description within 24 hours, or the claim expires.

**@⁠github-actions[bot]** on GitHub · 2026-11-28 15:57 UTC · [original](https://github.com/LakshanSivakumar/Native-Victory-macOS/issues/624#issuecomment-7241862402) Claimed by @⁠AnastasisKon. Open a draft pull request with `Refs #624` in its description within 24 hours, or the claim expires.
Author
Owner

@⁠AnastasisKon on GitHub · 2026-11-28 16:31 UTC · original

Merged with the PR that serves these calls; closing.

**@⁠AnastasisKon** on GitHub · 2026-11-28 16:31 UTC · [original](https://github.com/LakshanSivakumar/Native-Victory-macOS/issues/624#issuecomment-7242313534) Merged with the PR that serves these calls; closing.
This discussion has been locked. Commenting is limited to contributors.
No description provided.