From 1bf1b11b3e2f08b3b178b1924ed445a0494585af Mon Sep 17 00:00:00 2001 From: Marc-Aurel Zent Date: Tue, 20 Feb 2024 20:30:12 +0100 Subject: [PATCH] add required lsteamclient hacks --- .../lsteamclient_pid_hack.mypatch | 38 +++++++++++ .../lsteamclient_reg_hack.mypatch | 65 +++++++++++++++++++ 2 files changed, 103 insertions(+) create mode 100644 wine-tkg-git/wine-tkg-userpatches/lsteamclient_pid_hack.mypatch create mode 100644 wine-tkg-git/wine-tkg-userpatches/lsteamclient_reg_hack.mypatch diff --git a/wine-tkg-git/wine-tkg-userpatches/lsteamclient_pid_hack.mypatch b/wine-tkg-git/wine-tkg-userpatches/lsteamclient_pid_hack.mypatch new file mode 100644 index 000000000..e9f5701cc --- /dev/null +++ b/wine-tkg-git/wine-tkg-userpatches/lsteamclient_pid_hack.mypatch @@ -0,0 +1,38 @@ +From 890c356dda291442ce73c71976e66f75a75e072d Mon Sep 17 00:00:00 2001 +From: Andrew Eikum +Date: Thu, 27 Apr 2017 13:25:04 -0500 +Subject: [PATCH] HACK: steam: kernelbase: Substitute the current pid for the + Steam client pid. + +--- + dlls/kernelbase/process.c | 15 +++++++++++++++ + 1 file changed, 15 insertions(+) + +diff --git a/dlls/kernelbase/process.c b/dlls/kernelbase/process.c +index 39de15066d4..6ea1d3f53c2 100644 +--- a/dlls/kernelbase/process.c ++++ b/dlls/kernelbase/process.c +@@ -1041,6 +1041,21 @@ HANDLE WINAPI DECLSPEC_HOTPATCH OpenProcess( DWORD access, BOOL inherit, DWORD i + attr.SecurityDescriptor = NULL; + attr.SecurityQualityOfService = NULL; + ++ /* PROTON HACK: ++ * On Windows, the Steam client puts its process ID into the registry ++ * at: ++ * ++ * [HKCU\Software\Valve\Steam\ActiveProcess] ++ * PID=dword:00000008 ++ * ++ * Games get that pid from the registry and then query it with ++ * OpenProcess to ensure Steam is running. Since we aren't running the ++ * Windows Steam in Wine, instead we hack this magic number into the ++ * registry and then substitute the game's process itself in its place ++ * so it can query a valid process. ++ */ ++ if (id == 0xfffe) id = GetCurrentProcessId(); ++ + cid.UniqueProcess = ULongToHandle(id); + cid.UniqueThread = 0; + +-- +GitLab \ No newline at end of file diff --git a/wine-tkg-git/wine-tkg-userpatches/lsteamclient_reg_hack.mypatch b/wine-tkg-git/wine-tkg-userpatches/lsteamclient_reg_hack.mypatch new file mode 100644 index 000000000..3d3965396 --- /dev/null +++ b/wine-tkg-git/wine-tkg-userpatches/lsteamclient_reg_hack.mypatch @@ -0,0 +1,65 @@ +From 92cccd853a8f66c59de9e9eeb2bb76105c147ad6 Mon Sep 17 00:00:00 2001 +From: Andrew Eikum +Date: Wed, 27 Dec 2017 13:31:59 -0600 +Subject: [PATCH] HACK: steam: wine.inf: Add required Steam registry entries. + +--- + loader/wine.inf.in | 25 ++++++++++++++++++++++--- + 1 file changed, 22 insertions(+), 3 deletions(-) + +diff --git a/loader/wine.inf.in b/loader/wine.inf.in +index f1525c4f6dd..fdb0161f75d 100644 +--- a/loader/wine.inf.in ++++ b/loader/wine.inf.in +@@ -95,7 +95,8 @@ AddReg=\ + Tapi,\ + ThemeManager,\ + VersionInfo,\ +- LicenseInformation ++ LicenseInformation, \ ++ SteamClient + + [DefaultInstall.ntamd64] + RegisterDlls=RegisterDllsSection +@@ -120,7 +121,8 @@ AddReg=\ + Tapi,\ + ThemeManager,\ + VersionInfo.ntamd64,\ +- LicenseInformation ++ LicenseInformation, \ ++ SteamClient.ntamd64 + + [DefaultInstall.ntarm64] + RegisterDlls=RegisterDllsSection +@@ -160,7 +162,8 @@ AddReg=\ + Misc,\ + Tapi,\ + VersionInfo.ntamd64,\ +- LicenseInformation ++ LicenseInformation, \ ++ SteamClient.ntamd64 + + [Wow64Install.ntarm64] + WineFakeDlls=FakeDllsWin32 +@@ -2672,3 +2675,19 @@ EtcFiles = 12,etc + InfFiles = 17 + NlsFiles = 11 + SortFiles = 10,globalization\sorting ++ ++[SteamClient] ++HKCU,Software\Valve\Steam,"SteamPath",,"%16422%\Steam" ++HKCU,Software\Valve\Steam,"SteamExe",,"%16422%\Steam\Steam.exe" ++HKCU,Software\Valve\Steam\ActiveProcess,"PID",0x10001,0x0000fffe ++HKCU,Software\Valve\Steam\ActiveProcess,"SteamClientDll",,"%16422%\Steam\steamclient.dll" ++HKCU,Software\Valve\Steam\ActiveProcess,"SteamPath",,"%16422%\Steam" ++ ++[SteamClient.ntamd64] ++HKCU,Software\Valve\Steam,"SteamPath",,"%16422%\Steam" ++HKCU,Software\Valve\Steam,"SteamExe",,"%16422%\Steam\Steam.exe" ++HKCU,Software\Valve\Steam\ActiveProcess,"PID",0x10001,0x0000fffe ++HKCU,Software\Valve\Steam\ActiveProcess,"SteamClientDll",,"%16426%\Steam\steamclient.dll" ++HKCU,Software\Valve\Steam\ActiveProcess,"SteamClientDll64",,"C:\windows\system32\lsteamclient.dll" ++HKCU,Software\Valve\Steam\ActiveProcess,"SteamPath",,"%16426%\Steam" ++HKLM,Software\Wow6432Node\Valve\Steam,"InstallPath",,"%16422%\Steam" +-- +GitLab \ No newline at end of file