Skip to content

Run Windows games on Apple Silicon — free, open source, with an open compatibility database that tells you what actually works.

a DLL override added while Steam runs restarts the client, so the game gets it

Gauthier Piarrettead49059724f6
diff --git a/Sources/HighballKit/SteamRestart.swift b/Sources/HighballKit/SteamRestart.swift
index acf82ab..1aeb49b 100644
--- a/Sources/HighballKit/SteamRestart.swift
+++ b/Sources/HighballKit/SteamRestart.swift
@@ -81,7 +81,16 @@ public enum SteamRestart {
if liveFrameGen != wantedFrameGen {
reasons.append("it runs with frame generation \(frameGenerationName(of: live)) and the game wants \(frameGenerationName(of: wanted))")
}
- for key in custom.sorted() where !inherited.contains(where: { $0.0 == key }) && live[key] != wanted[key] {
+ // The game inherits the client's DLL overrides too, and two of their sources are not in
+ // `custom`: the environment's DLL overrides field and a recipe's dllOverride steps. So
+ // winhttp=n,b added while Steam ran never reached the game, and a mod loader sitting
+ // beside the exe was skipped (highball#172). A renderer change restarts the client above
+ // and changes this string with it, so it is only named when it differs on its own.
+ if live["WINEDLLPATH_PREPEND"] == wanted["WINEDLLPATH_PREPEND"],
+ live["WINEDLLOVERRIDES"] != wanted["WINEDLLOVERRIDES"] {
+ reasons.append("it runs with different DLL overrides than the game wants")
+ }
+ for key in custom.sorted() where key != "WINEDLLOVERRIDES" && !inherited.contains(where: { $0.0 == key }) && live[key] != wanted[key] {
switch (live[key], wanted[key]) {
case (nil, let want?): reasons.append("it runs without \(key)=\(want)")
case (let have?, nil): reasons.append("it runs with \(key)=\(have) and the game does not set it")
diff --git a/Tests/HighballKitTests/SteamRestartTests.swift b/Tests/HighballKitTests/SteamRestartTests.swift
index 2dfbf89..160b605 100644
--- a/Tests/HighballKitTests/SteamRestartTests.swift
+++ b/Tests/HighballKitTests/SteamRestartTests.swift
@@ -85,6 +85,31 @@ final class SteamRestartTests: XCTestCase {
XCTAssertNil(SteamRestart.reason(live: dxvk, wanted: wanted, wantedRenderer: "dxvk"))
}
+ // highball#172: winhttp=n,b put in the DLL overrides field while Steam ran. The field is not a
+ // custom variable, so nothing compared it, -applaunch went to the old client, and the game
+ // inherited overrides without it: the mod loader's winhttp.dll beside the exe never loaded.
+ func testDLLOverridesAddedWhileTheClientRunsRestartIt() {
+ var live = dxvk; live["WINEDLLOVERRIDES"] = "winemenubuilder.exe=d;dxgi,d3d9,d3d10core,d3d11=n,b"
+ var wanted = dxvk; wanted["WINEDLLOVERRIDES"] = "winemenubuilder.exe=d;winhttp=n,b;dxgi,d3d9,d3d10core,d3d11=n,b"
+ XCTAssertEqual(SteamRestart.reason(live: live, wanted: wanted, wantedRenderer: "dxvk"),
+ "it runs with different DLL overrides than the game wants")
+ XCTAssertNil(SteamRestart.reason(live: wanted, wanted: wanted, wantedRenderer: "dxvk"))
+ }
+
+ func testARendererChangeIsNotAlsoReportedAsAnOverridesChange() {
+ var live = dxvk; live["WINEDLLPATH_PREPEND"] = "/e/dxmt/wine"; live["WINEDLLOVERRIDES"] = "dxgi,d3d11,d3d10core=n,b"
+ var wanted = dxvk; wanted["WINEDLLOVERRIDES"] = "dxgi,d3d9,d3d10core,d3d11=n,b"
+ XCTAssertEqual(SteamRestart.reason(live: live, wanted: wanted, wantedRenderer: "dxvk"),
+ "it runs with a different renderer than dxvk")
+ }
+
+ func testOverridesTypedAsACustomVariableAreNamedOnce() {
+ var live = dxvk; live["WINEDLLOVERRIDES"] = "winemenubuilder.exe=d"
+ var wanted = dxvk; wanted["WINEDLLOVERRIDES"] = "winhttp=n,b;winemenubuilder.exe=d"
+ XCTAssertEqual(SteamRestart.reason(live: live, wanted: wanted, wantedRenderer: "dxvk", custom: ["WINEDLLOVERRIDES"]),
+ "it runs with different DLL overrides than the game wants")
+ }
+
func testOnlyTheClientsOwnProcessesCountAsTheClient() {
XCTAssertTrue(SteamRestart.isClientProcess(argv0: "C:\\Program Files (x86)\\Steam\\steam.exe"))
XCTAssertTrue(SteamRestart.isClientProcess(argv0: "C:\\Program Files (x86)\\Steam\\bin\\cef\\cef.win7x64\\steamwebhelper.exe"))