HLE: pass data-only LoadLibraryEx mappings outside HostPolicy to the host #1419
No reviewers
Labels
No labels
accessibility
area: build
area: formats
area: gpu
area: loader
area: runtime
area: shader
bug
documentation
duplicate
enhancement
good first issue
gpu: amd
gpu: intel
gpu: nvidia
help wanted
host: wine
invalid
out of scope
question
request
run report
triage: confirmed
triage: has patch
triage: merge candidate
triage: needs info
triage: needs rebase
triage: needs work
triage: proposed close
wontfix
No milestone
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
github/Marvisak--VIctory!1419
Loading…
Reference in a new issue
No description provided.
Delete branch "gh-pr/1419/head"
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?
@fuzeofficlal on GitHub · 2026-11-24 17:54 UTC · original
fuzeofficlal:fix/hle-load-library-datafile-805→main· +87 −12 · 1 files · 1 commits · closed without mergingFixes #805.
Summary
GetModuleHandlequeries (Lookup::Query), executable loads (Lookup::Code), uninitialised image loads (Lookup::NoInitforDONT_RESOLVE_DLL_REFERENCES), and passive data or resource mappings (Lookup::DatawhenLOAD_LIBRARY_AS_DATAFILE,LOAD_LIBRARY_AS_IMAGE_RESOURCE, orLOAD_LIBRARY_AS_DATAFILE_EXCLUSIVEis set without0x1) inkernel::find_module.NoneonLookup::Datafor modules outsideHostPolicythat are neither mapped title images nor pseudo modules so the host maps data/resource handles (whose exportsGetProcAddresscannot resolve), while keepingDONT_RESOLVE_DLL_REFERENCES(0x1), executableLoadLibrary*loads, andGetModuleHandle*gated byHostPolicy.Verification
modules::kernel::tests::datafile_loads_outside_host_policy_reach_the_host: verifies0x2,0x20,0x40, and0x22succeed on a DLL outsideHostPolicyand return null fromGetProcAddress, whereas0x1(DONT_RESOLVE_DLL_REFERENCES), executableLoadLibrary*, andGetModuleHandle*stay refused withERROR_MOD_NOT_FOUND.cargo test -p victory-hle --locked,cargo clippy -p victory-hle --tests --locked -- -D warnings, andcargo xtask policy: passed.@geiyiliyabumo on GitHub · 2026-11-24 18:03 UTC · original
Independent verification of \c8b7a3d\ on Windows 11 / Rust 1.98.1 MSVC:
Code audit looks clean and minimal: introducing \Lookup::{Query, Code, Data}\ keeps code loads and \GetModuleHandle*\ queries outside \HostPolicy\ refused while allowing passive data/resource mappings through to the host.
AI-assisted; synthetic tests only, no game files.
@Marvisak on GitHub · 2026-11-25 01:26 UTC · original · edited 2026-11-25 11:20 UTC
Automated triage for the maintainers.
Needs work.
07326307fixes the hole from the last triage. Incrates/victory-hle/src/modules/kernel.rs,load_lookupsendsDONT_RESOLVE_DLL_REFERENCES(0x1) to the newLookup::NoInit, whichfind_modulestill refuses outsideHostPolicyand which does not callruntime::load_title_dll. Only pure data/resource loads (0x2, 0x20, 0x40 without 0x1) becomeLookup::Dataand go to the host. The test asserts all of this, andGetModuleHandle*and code loads stay refused. CI: passing (check).What remains:
LoadLibraryEx. #805 shows the behaviour on a synthetic call only. Without a load seen in the title, the guard should stay as it is.HostPolicythat the host process has already loaded as an image. If the host hands back the existing image handle,GetProcAddresswould resolve real exports through it, which is the case the guard exists for. The test passes forcomctl32.dllonly because that DLL is not loaded as an image in the test process.On your reply: the 0x1 change is exactly what was asked, thanks. The verdict stays at needs work only because of the two points above.
Generated by Claude Code
@fuzeofficlal on GitHub · 2026-11-25 09:48 UTC · original
Updated in
07326307per triage feedback:DONT_RESOLVE_DLL_REFERENCES(0x1) on a separateLookup::NoInitpath so unmapped title DLLs still avoidload_title_dll(DllMain) as onmain, while DLLs outsideHostPolicyremain refused (ERROR_MOD_NOT_FOUND).Lookup::Datato pure data/resource mappings (0x2,0x20,0x40without0x1), dropped0x1from the allowed test list, and added explicit assertions that0x1outsideHostPolicyis refused andGetProcAddresson mapped data handles returns null.@fuzeofficlal on GitHub · 2026-11-25 17:20 UTC · original
Closing this PR: as noted in triage, loosening the
HostPolicygate requires a real title log showing the refused DLL call site, which I do not have locally.Pull request closed