HLE: allow rpcrt4.dll in default host policy #510

Closed
github-bot wants to merge 1 commit from gh-pr/510/head into gh-pr/510/base
Owner

@⁠pushkarreddyy on GitHub · 2026-11-24 04:20 UTC · original
pushkarreddyy:fix/host-policy-rpcrt4 → main · +13 −0 · 1 files · 1 commits · closed without merging

Problem

During startup and runtime, titles importing RPC and UUID functionality (such as UuidCreate) cause the loader to log:

WARN victory_hle::modules::kernel: a host DLL outside the host policy: refused dll="rpcrt4.dll"

as reported in #417. On Windows PC and console, standard RPC runtime functions live in rpcrt4.dll.

Fix

Add "rpcrt4.dll" to HostPolicy::default().allow, allowing standard host RPC/UUID functions to resolve. Added unit test host_policy_allows_rpcrt4.

No game files used.

**@⁠pushkarreddyy** on GitHub · 2026-11-24 04:20 UTC · [original](https://github.com/Marvisak/VIctory/pull/510) `pushkarreddyy:fix/host-policy-rpcrt4` → `main` · +13 −0 · 1 files · 1 commits · closed without merging ## Problem During startup and runtime, titles importing RPC and UUID functionality (such as `UuidCreate`) cause the loader to log: ``` WARN victory_hle::modules::kernel: a host DLL outside the host policy: refused dll="rpcrt4.dll" ``` as reported in #417. On Windows PC and console, standard RPC runtime functions live in `rpcrt4.dll`. ## Fix Add `"rpcrt4.dll"` to `HostPolicy::default().allow`, allowing standard host RPC/UUID functions to resolve. Added unit test `host_policy_allows_rpcrt4`. No game files used.
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-26 04:06:36 +00:00
github-bot closed this pull request 2026-11-26 04:06:36 +00:00
Author
Owner

@⁠pushkarreddyy on GitHub · 2026-11-24 04:50 UTC · original

### Technical Verification & Implementation Details

Context & Root Cause

In crates/victory-hle/src/host.rs, DEFAULT_HOST_DLLS lists system DLLs safe for host passthrough when running in the default host policy. Previously, only ws2_32.dll and bcrypt.dll were included. Windows RPC runtime (rpcrt4.dll) is standard on Windows and required by system services and game titles for COM/RPC operations, UUID generation (UuidCreate), and object marshalling. Without it, symbol resolution fails when games call RPC functions.

Changes & Diff

  • Added "rpcrt4.dll" to DEFAULT_HOST_DLLS.
  • Added unit test default_policy_allows_rpcrt4 testing case-insensitive matching ("RPCRT4.DLL").

Git Log Line & Verification

ext 756a1f0 HLE: allow rpcrt4.dll in default host policy crates/victory-hle/src/host.rs | 13 +++++++++++++ 1 file changed, 13 insertions(+)

  • Passes cargo xtask policy (Rule #1 compliance, zero game assets).
  • Formatted with rustfmt --edition 2024.
**@⁠pushkarreddyy** on GitHub · 2026-11-24 04:50 UTC · [original](https://github.com/Marvisak/VIctory/pull/510#issuecomment-7122392239) ### Technical Verification & Implementation Details #### Context & Root Cause In `crates/victory-hle/src/host.rs`, `DEFAULT_HOST_DLLS` lists system DLLs safe for host passthrough when running in the default host policy. Previously, only `ws2_32.dll` and `bcrypt.dll` were included. Windows RPC runtime (`rpcrt4.dll`) is standard on Windows and required by system services and game titles for COM/RPC operations, UUID generation (`UuidCreate`), and object marshalling. Without it, symbol resolution fails when games call RPC functions. #### Changes & Diff - Added `"rpcrt4.dll"` to `DEFAULT_HOST_DLLS`. - Added unit test `default_policy_allows_rpcrt4` testing case-insensitive matching (`"RPCRT4.DLL"`). #### Git Log Line & Verification ` ext 756a1f0 HLE: allow rpcrt4.dll in default host policy crates/victory-hle/src/host.rs | 13 +++++++++++++ 1 file changed, 13 insertions(+) ` - Passes `cargo xtask policy` (Rule #1 compliance, zero game assets). - Formatted with `rustfmt --edition 2024`.
Author
Owner

@⁠pushkarreddyy on GitHub · 2026-11-24 06:24 UTC · original

### Call for Testing & Maintainer Review
Community members testing game initialization or HLE modules on Windows 10/11: verification and feedback on this PR is warmly welcome!

  • Rule #1 asset policy compliant (cargo xtask policy passing).
  • Formatted with Rust 2024.

@⁠Marvisak: Ready for maintainer review and merge when convenient!

**@⁠pushkarreddyy** on GitHub · 2026-11-24 06:24 UTC · [original](https://github.com/Marvisak/VIctory/pull/510#issuecomment-7123893051) ### Call for Testing & Maintainer Review Community members testing game initialization or HLE modules on Windows 10/11: verification and feedback on this PR is warmly welcome! - Rule #1 asset policy compliant (`cargo xtask policy` passing). - Formatted with Rust 2024. @⁠Marvisak: Ready for maintainer review and merge when convenient!
Author
Owner

@⁠pushkarreddyy on GitHub · 2026-11-24 07:32 UTC · original

Thank you @⁠mercuryVM for the thorough security and network architecture review!

You make a crucial architectural point: allowing rpcrt4.dll wholesale bypasses modules::net's loopback-only intercept on ws2_32.dll, opening remote socket paths via ncacn_ip_tcp and ncacn_http.

I completely agree that the proper, sandboxed approach is implementing the specific imported UUID functions in HLE (UuidCreate via BCryptGenRandom with RFC 4122 v4 bits, UuidToStringA/W, and RpcStringFreeA/W) rather than opening up the entire host RPC runtime.

Closing this PR in favor of targeted HLE implementations. Thanks again!

**@⁠pushkarreddyy** on GitHub · 2026-11-24 07:32 UTC · [original](https://github.com/Marvisak/VIctory/pull/510#issuecomment-7125100099) Thank you @⁠mercuryVM for the thorough security and network architecture review! You make a crucial architectural point: allowing `rpcrt4.dll` wholesale bypasses `modules::net`'s loopback-only intercept on `ws2_32.dll`, opening remote socket paths via `ncacn_ip_tcp` and `ncacn_http`. I completely agree that the proper, sandboxed approach is implementing the specific imported UUID functions in HLE (`UuidCreate` via `BCryptGenRandom` with RFC 4122 v4 bits, `UuidToStringA`/`W`, and `RpcStringFreeA`/`W`) rather than opening up the entire host RPC runtime. Closing this PR in favor of targeted HLE implementations. Thanks again!

Pull request closed

This discussion has been locked. Commenting is limited to contributors.
No reviewers
No milestone
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
github/Marvisak--VIctory!510
No description provided.