Merge pull request #315 from maharmstone/master (works around Wine Staging bug 199)

Various Windows apps (like Max Payne 2) seem to contain a broken eax.dll library,
which is affected by various use-after-free bugs. To work around such issues EAX
support can be globally disabled in winecfg. Moreover a winediag message is added
to inform the user about possible issues related to EAX.
This commit is contained in:
Sebastian Lackner
2015-04-05 20:11:34 +02:00
4 changed files with 256 additions and 1 deletions

View File

@@ -0,0 +1,81 @@
From b31377088e643b14e75df6bd302299d35587998e Mon Sep 17 00:00:00 2001
From: Mark Harmstone <mark@harmstone.com>
Date: Sun, 5 Apr 2015 14:16:11 +0100
Subject: winecfg: Add checkbox to enable/disable EAX support.
---
programs/winecfg/resource.h | 1 +
programs/winecfg/staging.c | 21 +++++++++++++++++++++
programs/winecfg/winecfg.rc | 1 +
3 files changed, 23 insertions(+)
diff --git a/programs/winecfg/resource.h b/programs/winecfg/resource.h
index 4b21d16..a78d9af 100644
--- a/programs/winecfg/resource.h
+++ b/programs/winecfg/resource.h
@@ -213,6 +213,7 @@
/* Staging tab */
#define IDC_ENABLE_CSMT 9001
#define IDC_ENABLE_VAAPI 9002
+#define IDC_ENABLE_EAX 9003
/* About tab */
#define IDC_ABT_OWNER 8432
diff --git a/programs/winecfg/staging.c b/programs/winecfg/staging.c
index 40b6642..ee09855 100644
--- a/programs/winecfg/staging.c
+++ b/programs/winecfg/staging.c
@@ -71,10 +71,27 @@ static void vaapi_set(BOOL status)
#endif
}
+/*
+ * EAX
+ */
+static BOOL eax_get(void)
+{
+ BOOL ret;
+ char *value = get_reg_key(config_key, keypath("DirectSound"), "EAXEnabled", "Y");
+ ret = IS_OPTION_TRUE(*value);
+ HeapFree(GetProcessHeap(), 0, value);
+ return ret;
+}
+static void eax_set(BOOL status)
+{
+ set_reg_key(config_key, keypath("DirectSound"), "EAXEnabled", status ? "Y" : "N");
+}
+
static void load_staging_settings(HWND dialog)
{
CheckDlgButton(dialog, IDC_ENABLE_CSMT, csmt_get() ? BST_CHECKED : BST_UNCHECKED);
CheckDlgButton(dialog, IDC_ENABLE_VAAPI, vaapi_get() ? BST_CHECKED : BST_UNCHECKED);
+ CheckDlgButton(dialog, IDC_ENABLE_EAX, eax_get() ? BST_CHECKED : BST_UNCHECKED);
#ifndef HAVE_VAAPI
disable(IDC_ENABLE_VAAPI);
@@ -112,6 +129,10 @@ INT_PTR CALLBACK StagingDlgProc(HWND hDlg, UINT uMsg, WPARAM wParam, LPARAM lPar
vaapi_set(IsDlgButtonChecked(hDlg, IDC_ENABLE_VAAPI) == BST_CHECKED);
SendMessageW(GetParent(hDlg), PSM_CHANGED, 0, 0);
return TRUE;
+ case IDC_ENABLE_EAX:
+ eax_set(IsDlgButtonChecked(hDlg, IDC_ENABLE_EAX) == BST_CHECKED);
+ SendMessageW(GetParent(hDlg), PSM_CHANGED, 0, 0);
+ return TRUE;
}
break;
}
diff --git a/programs/winecfg/winecfg.rc b/programs/winecfg/winecfg.rc
index 171672d..0f1af19 100644
--- a/programs/winecfg/winecfg.rc
+++ b/programs/winecfg/winecfg.rc
@@ -315,6 +315,7 @@ BEGIN
LTEXT "The following settings are experimental and may break stuff!\nMake sure to reset them again in case of a problem.",IDC_STATIC,16,16,230,16
CONTROL "Enable &CSMT for better graphic performance",IDC_ENABLE_CSMT,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,16,40,230,8
CONTROL "Enable &VAAPI as backend for DXVA2 GPU decoding",IDC_ENABLE_VAAPI,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,16,55,230,8
+ CONTROL "Enable Environmental Audio E&xtensions (EAX)",IDC_ENABLE_EAX,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,16,70,230,8
END
LANGUAGE LANG_NEUTRAL, SUBLANG_NEUTRAL
--
2.3.5