Skip to content

Commit

Permalink
add new hotfix: battlenet for fix Battle.Net segfaults (#1256)
Browse files Browse the repository at this point in the history
* New hotfix patch: battlenet for Battle.Net launcher

Signed-off-by: Kirill Artemev <artewar6767@gmail.com>

* customization.cfg: Add option for battlenet_fix hotfix

Signed-off-by: Kirill Artemev <artewar6767@gmail.com>

* hotfixes: fix some moments

Signed-off-by: Kirill Artemev <artewar6767@gmail.com>

---------

Signed-off-by: Kirill Artemev <artewar6767@gmail.com>
  • Loading branch information
Artewar67 committed Sep 10, 2024
1 parent d6eb59c commit 1ad2068
Show file tree
Hide file tree
Showing 4 changed files with 35 additions and 0 deletions.
2 changes: 2 additions & 0 deletions wine-tkg-git/customization.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -129,6 +129,8 @@ _kof98_2002_BGM_fix="false"
# This patchset breaks Genshin Impact
_quake_champions_fix="false"

# Fix for Battle.Net Launcher - https://bugs.winehq.org/show_bug.cgi?id=29384
_battlenet_fix="true"

#### OTHER PATCHES ####

Expand Down
25 changes: 25 additions & 0 deletions wine-tkg-git/wine-tkg-patches/hotfixes/battlenet/battlenet.mypatch
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
From 321e3228c6c28256bfb209efdc372b61f9c8535f Mon Sep 17 00:00:00 2001
From: Fabian Maurer <dark.shadow4@web.de>
Date: Thu, 21 Dec 2023 20:09:23 +0100
Subject: [PATCH] kernelbase: Correct return value in VirtualProtect for
PAGE_WRITECOPY

---
dlls/kernelbase/memory.c | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/dlls/kernelbase/memory.c b/dlls/kernelbase/memory.c
index 4f4bba9a13b..de42395b33b 100644
--- a/dlls/kernelbase/memory.c
+++ b/dlls/kernelbase/memory.c
@@ -481,7 +481,9 @@ BOOL WINAPI DECLSPEC_HOTPATCH VirtualLock( void *addr, SIZE_T size )
*/
BOOL WINAPI DECLSPEC_HOTPATCH VirtualProtect( void *addr, SIZE_T size, DWORD new_prot, DWORD *old_prot )
{
- return VirtualProtectEx( GetCurrentProcess(), addr, size, new_prot, old_prot );
+ BOOL ret = VirtualProtectEx( GetCurrentProcess(), addr, size, new_prot, old_prot );
+ if (old_prot && *old_prot == PAGE_WRITECOPY) *old_prot = PAGE_READWRITE;
+ return ret;
}


7 changes: 7 additions & 0 deletions wine-tkg-git/wine-tkg-patches/hotfixes/battlenet/hotfixes
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
#!/bin/bash

# Fix for battle.net launcher
if [ "$_battlenet_fix" = "true" ] && ( cd "${srcdir}"/"${_winesrcdir}" && git merge-base --is-ancestor 65124f15acc5705eb159d5d920877f0ac4835d27 HEAD ); then
_hotfixes+=("$_where"/wine-tkg-patches/hotfixes/battlenet/battlenet)
warning "Hotfix: Fix for Battle.Net launcher"
fi
1 change: 1 addition & 0 deletions wine-tkg-git/wine-tkg-patches/hotfixes/hotfixer
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@ if [ "$_unfrog" != "true" ]; then
_hotfix="ow2" _hotfix_boundary="" _hotfix_import
_hotfix="autoconf-opencl-hotfix" _hotfix_boundary="" _hotfix_import
_hotfix="NosTale" _hotfix_boundary="" _hotfix_import
_hotfix="battlenet" _hotfix_boundary="" _hotfix_import

# Custom hotfix patches with a commit boundary
_hotfix="fd799297" _hotfix_boundary="1f6423f778f7036a3875613e10b9c8c3b84584f0" _hotfix_import
Expand Down

0 comments on commit 1ad2068

Please sign in to comment.