hle(host_posix): FindResourceW, SizeofResource, LockResource and version.dll's three calls are unimplemented #629
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#629
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 16:00 UTC · original
Summary
The resource calls were half there:
FindResourceExWandLoadResourcewalked the mapped image's tree, butFindResourceW,SizeofResourceandLockResourcewere unimplemented, and so was all ofversion.dll—GetFileVersionInfoSizeW,GetFileVersionInfoW,VerQueryValueW. A title reading its own version info (a build check, a crash log, an "about" string) got nothing, and one loading its own art got no size to allocate.What the change does
SizeofResource: the data entry's size, which is at offset 4 of the entryFindResourceExWhands out.LockResource: the bytes, which are already in the mapped image;LoadResourcehands out the same address, so the two agree.FindResourceW: the same walk asFindResourceExWwith any language, which is how a title asks for its own version resource.GetFileVersionInfoSizeW/GetFileVersionInfoW:RT_VERSION/1 out of the image the path names, and its bytes copied into the title's block.version.dll's calls address a file, so they answer for an image this host has mapped (by file name) and refuse a path it has not mapped — the tree is read from the mapped image, not off disk.VerQueryValueW: parses theVS_VERSIONINFOblock —\(the fixed file info),\VarFileInfo\Translation, and\StringFileInfo\<table>\<key>— withwValueLengthread as characters for a string and bytes for a binary value, as Windows reports them.version.dllis now served by the same table askernel32.dll, since those three names live there.Tests
Two new ones in
system.rs: a version resource built block by block (the way a linker writes it) is queried for its fixed file info, itsFileVersionstring and its translation, and a missing key, table or path is not found; and the calls that cannot be answered (a null resource, an unmapped path) fail with their reasons. The builder caught a real mistake in my own test —VS_FIXEDFILEINFOis thirteen words, not twelve, and one word short put every child block four bytes off.Why it matters
A title can read its own build number, and the version resource is parsed once, from the image the host already has mapped, with no PE re-reading.
@AnastasisKon on GitHub · 2026-11-28 16:00 UTC · original
/claim
@github-actions[bot] on GitHub · 2026-11-28 16:01 UTC · original
Claimed by @AnastasisKon. Open a draft pull request with
Refs #625in 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.