HLE: match rpcrt4 UuidFromString nil-UUID and canonical string rules #1975
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!1975
Loading…
Reference in a new issue
No description provided.
Delete branch "github-bot/gh-1975"
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?
@mgunes1311-lab on GitHub · 2026-11-25 02:10 UTC · original
mgunes1311-lab:hle-rpcrt4-uuid-string→main· +147 −41 · 1 files · 1 commits · openSummary
UuidFromStringA/UuidFromStringWnull-string nil UUID: Inrpcrt4.dll, passingNULLasStringUuidis documented to write the nil UUID (00000000-0000-0000-0000-000000000000) and returnRPC_S_OK(0). Our HLE previously rejected a null string pointer withRPC_S_INVALID_STRING_UUID(1705).8-4-4-4-12grammar: Unlikeole32'sCLSIDFromString,rpcrt4'sUuidFromStringAandUuidFromStringWaccept only the exact 36-characterxxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxxtext form (lower or upper case).parsepreviously accepted{...}braces, unmatched{or}, arbitrary trailing characters after}, and missing or misplaced dashes, whileUuidFromStringWscanned the entire input into a heapVecbefore parsing.UuidToStringA/UuidToStringWallocation check: ReturnRPC_S_OUT_OF_MEMORY(14) ifallocatereturns null instead of writing a null pointer and returningRPC_S_OK.Verification
cargo test -p victory-hle --target x86_64-pc-windows-msvc --locked(including a Windows differential test comparingUuidFromStringAandUuidFromStringWdirectly againstSystem32\rpcrt4.dllacross null, valid, braced, malformed-dash, whitespace, and trailing-garbage inputs)cargo clippy --workspace --all-targets --all-features --target x86_64-pc-windows-msvc --locked -- -D warningscargo doc --workspace --no-deps --target x86_64-pc-windows-msvc --lockedcargo run -p xtask --target x86_64-pc-windows-msvc --locked -- policy --staged@DesertGamer on GitHub · 2026-11-25 02:17 UTC · original
VIctory V2: community PRs, merged and tested
Open PRs sitting in the queue? V2 pulls them into one build, screens each one (binaries, build scripts, hooks, new deps) and runs tests after every batch.
Where it stands today: launches, runs the menu at 30 fps, plays the intro video, reaches the start screen and loads the world (~50 s). Entering the world is the current blocker: rendering fails with a GPU "device removed" error (tracked in issue #1).
⚠️ Entering the world on a real GPU can hang it and make Windows reset the driver. Try it at your own risk.
Not playable yet, but every batch of merged fixes moves it closer. If you have a PR that's stuck, or a GPU to test on, I'd love your help:
https://DesertGamer/VIctory-V2
Unofficial community fork of Marvisak/VIctory, GPL-3.0.
@AgneyaK on GitHub · 2026-11-25 02:31 UTC · original
Tested
72a7ec1merged ontomain940d32f(clean), Windows 11 build 26300, hostrpcrt4.dll10.0.26100.1, Rust 1.98.1 MSVC.uuid_from_string_matches_the_host_runtimepasses here, as do the other 5rpcrt4tests.main's differences. With only this PR's test module onmain'srpcrt4.rs, 3 of 6 fail:uuid_from_string_matches_the_host_runtime:maingives(1705, <untouched>)where the host DLL gives(0, nil UUID), for the null string.garbage_is_refused:mainparses"{1234abcd-00ef-4a5b-8012-3456789abcde}", which the host refuses.uuid_from_string_writes_what_it_reads:1705instead of0.cargo test -p victory-hle --lib --locked5 runs,144 passedeach.cargo clippy -p victory-hle --all-targets --locked -- -D warnings: clean.One thing for whoever merges it: this makes the parser stricter, so a caller that passed braced text and relied on the old leniency now gets
RPC_S_INVALID_STRING_UUID, as it would from the real DLL. I didn't check whether the title callsUuidFromStringwith braces; it isn't among the calls I see in the boot and menu logs here.AI use: Claude Code (Claude Opus 5.5) ran these checks and wrote this; the results are from the runs described.
@Marvisak on GitHub · 2026-11-25 08:23 UTC · original
Automated triage for the maintainers.
Merge candidate.
This changes
UuidFromStringA/UuidFromStringWincrates/victory-hle/src/modules/rpcrt4.rsso a null string writes the nil UUID and returnsRPC_S_OK. That is the documented behaviour of the host function. It also narrowsparseto the exact 36-character8-4-4-4-12form with no braces and no trailing characters, and makesUuidToStringA/WreturnRPC_S_OUT_OF_MEMORYwhenallocatereturns null. Before this change they wrote a null pointer and returned OK.The evidence is a new Windows-only differential test against the host
rpcrt4.dll. A contributor reports it passing on build 26100, and also reports that the same tests fail onmain's parser. I checked the newparseloop: dashes at positions 8/13/18/23, 32 hex digits, nothing after. I also checked themap_whileNUL scanning, which no longer copies the wide string into aVec, and the null checks.One thing to note: braced input is now refused, as the host DLL refuses it. Any title path that depended on the old leniency would now get
RPC_S_INVALID_STRING_UUID.CI:
checkpassing.Generated by Claude Code
@fuzeofficlal on GitHub · 2026-11-26 01:37 UTC · original
Code review and Windows 11 native
rpcrt4.dllparity verification at head72a7ec1f1e62merged cleanly ontomain(63bcca43c6a0):crates/victory-hle/src/modules/rpcrt4.rs:84-137, 219-247, 469-528):UuidFromStringA/Wreject nulluuid(INVALID_STRING_UUID), write the nil UUID withOKwhentext.is_null(), preserve*uuidon parse failure, and enforce the exact 36-char canonicalxxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxxgrammar (rejecting braces, spaces, missing/misplaced hyphens, and trailing characters), verified directly against hostrpcrt4.dllinuuid_from_string_matches_the_host_runtime. Also cleanly addsOUT_OF_MEMORYchecks on nullallocateinUuidToStringA/W.cargo xtask policy:191 files ok;cargo clippy --locked -p victory-hle --tests -- -D warnings: 0 warningscargo test --locked -p victory-hle -- --test-threads=1: 155/155 passed (153 lib +fidelityfx+no_dll_planting).LGTM.
View command line instructions
Checkout
From your project repository, check out a new branch and test the changes.Merge
Merge the changes and update on Forgejo.