[pr-tests][linux-proton] Tests: the late DLL tests load a copy of version.dll that Wine does not take for its builtin #363

Open
ntsthay wants to merge 1 commit from ntsthay/wine-late-dll into main AGit
First-time contributor

Tests only. Nothing here runs in the game.

Contributor role (optional)

  • Fluxer ID:

What it changes

The four run::tests::late_dll_* tests build their title DLLs from a copy of System32\version.dll with a tag appended. Under Wine (Proton on Linux), that file is Wine's own builtin and carries the mark Wine builtin DLL right after the DOS header. Wine's loader answers any file with that mark with the builtin it already has loaded. So every copy became the same VERSION.dll module, at the same base, and FreeLibrary never unmapped it.

Measured on f3840d7: after the bind failure, both the "dep" and the "top" image had base 0x6ffffeff0000, and GetModuleHandleExW from that address named C:\windows\system32\VERSION.dll. The test then failed with "dep remained mapped after bind failure".

write_unique_dll now clears that mark in the copy, so each copy loads as a DLL of its own, as it does on Windows. Windows' version.dll has no such mark, so on Windows the bytes and the tests are the same as before.

How it was tested

  • Tested revision: 3e9bf0e, this branch on f3840d7.
  • Commands and results: cargo nextest run -p darner -E 'test(late_dll_)' under Proton (proton-cachyos, RTX 4080): 4 passed; on f3840d7 all 4 fail. The whole darner crate: 158 passed. The 2 that fail are windows_is_not_wine and a_copy_of_windows_own_direct3d_12_is_set_aside_for_system32s, which fail on f3840d7 too and are fixed in #354.
  • Gates: cargo clippy -p darner --all-targets --locked -- -D warnings is clean. Gate 3 ran under Wine, not on Windows.
  • Coverage gaps: not run on Windows.

Checklist

  • This PR contains one change based on main.
  • The diff follows docs/asset-policy.md.
  • I recorded this PR's dependencies below.
    • Depends on: none

Checked for overlap

  • I searched the open pull requests for the same issue and for the files this touches.
  • Related PRs: #349 and #354 also make tests pass under Wine, in other files.
  • Replaces or overlaps: none found
Tests only. Nothing here runs in the game. ## Contributor role (optional) - Fluxer ID: ## What it changes The four `run::tests::late_dll_*` tests build their title DLLs from a copy of `System32\version.dll` with a tag appended. Under Wine (Proton on Linux), that file is Wine's own builtin and carries the mark `Wine builtin DLL` right after the DOS header. Wine's loader answers any file with that mark with the builtin it already has loaded. So every copy became the same `VERSION.dll` module, at the same base, and `FreeLibrary` never unmapped it. Measured on `f3840d7`: after the bind failure, both the "dep" and the "top" image had base `0x6ffffeff0000`, and `GetModuleHandleExW` from that address named `C:\windows\system32\VERSION.dll`. The test then failed with "dep remained mapped after bind failure". `write_unique_dll` now clears that mark in the copy, so each copy loads as a DLL of its own, as it does on Windows. Windows' `version.dll` has no such mark, so on Windows the bytes and the tests are the same as before. ## How it was tested - Tested revision: `3e9bf0e`, this branch on `f3840d7`. - Commands and results: `cargo nextest run -p darner -E 'test(late_dll_)'` under Proton (proton-cachyos, RTX 4080): 4 passed; on `f3840d7` all 4 fail. The whole `darner` crate: 158 passed. The 2 that fail are `windows_is_not_wine` and `a_copy_of_windows_own_direct3d_12_is_set_aside_for_system32s`, which fail on `f3840d7` too and are fixed in #354. - Gates: `cargo clippy -p darner --all-targets --locked -- -D warnings` is clean. Gate 3 ran under Wine, not on Windows. - Coverage gaps: not run on Windows. ## Checklist - [x] This PR contains one change based on `main`. - [x] The diff follows `docs/asset-policy.md`. - [x] I recorded this PR's dependencies below. - Depends on: none ## Checked for overlap - [x] I searched the open pull requests for the same issue and for the files this touches. - Related PRs: #349 and #354 also make tests pass under Wine, in other files. - Replaces or overlaps: none found
This pull request can be merged automatically.
This branch is out-of-date with the base branch
You are not authorized to merge this pull request.
View command line instructions

Checkout

From your project repository, check out a new branch and test the changes.
git fetch -u origin '+refs/pull/363/head:ntsthay/wine-late-dll'
git switch 'ntsthay/wine-late-dll'

Merge

Merge the changes and update on Forgejo.

Warning: The "Autodetect manual merge" setting is not enabled for this repository, you will have to mark this pull request as manually merged afterwards.

git switch 'main'
git merge --no-ff 'ntsthay/wine-late-dll'
git switch 'ntsthay/wine-late-dll'
git rebase 'main'
git switch 'main'
git merge --ff-only 'ntsthay/wine-late-dll'
git switch 'ntsthay/wine-late-dll'
git rebase 'main'
git switch 'main'
git merge --no-ff 'ntsthay/wine-late-dll'
git switch 'main'
git merge --squash 'ntsthay/wine-late-dll'
git switch 'main'
git merge --ff-only 'ntsthay/wine-late-dll'
git switch 'main'
git merge 'ntsthay/wine-late-dll'
git push origin 'main'
Sign in to join this conversation.
No reviewers
No labels
No milestone
No project
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
TrustNo1/Darner!363
No description provided.