You've already forked wine-staging
mirror of
https://gitlab.winehq.org/wine/wine-staging.git
synced 2025-04-13 14:42:51 -07:00
Compare commits
66 Commits
Author | SHA1 | Date | |
---|---|---|---|
|
82e4617d86 | ||
|
24753f8756 | ||
|
0ed3e9c774 | ||
|
61c3c024a2 | ||
|
7f17af3a42 | ||
|
4c51f4f5f6 | ||
|
3b7c98ebf1 | ||
|
2056903cdf | ||
|
65ca056d29 | ||
|
edb3417124 | ||
|
7655d14b6a | ||
|
61120ad0dd | ||
|
915b0a246f | ||
|
68918863dc | ||
|
a703038b94 | ||
|
643f96ec62 | ||
|
d3d93cfa0d | ||
|
7e42d0ac1a | ||
|
0ee2ac8499 | ||
|
a9aa06c58e | ||
|
97b65c93c2 | ||
|
310f4c498b | ||
|
ad41ee0c01 | ||
|
45230b51db | ||
|
b090c12d6d | ||
|
55c5bac511 | ||
|
c165d96d23 | ||
|
63c3baa9e5 | ||
|
980a476c49 | ||
|
120e2d362f | ||
|
df26057ddf | ||
|
fa3a80f5af | ||
|
00ab8180c0 | ||
|
fe634350d2 | ||
|
b10ac7d8ac | ||
|
56fd61a713 | ||
|
c9c7130f3c | ||
|
5f113860f5 | ||
|
9a5667dba1 | ||
|
1295604add | ||
|
3fb6eb99a7 | ||
|
2677a11f41 | ||
|
6fd31b354c | ||
|
4eaa5b69b8 | ||
|
feb91195ff | ||
|
164b361be6 | ||
|
6bc16f96f7 | ||
|
688eeca0be | ||
|
1af920f698 | ||
|
f3fd4a3903 | ||
|
56a387bf1d | ||
|
c7f16e15e7 | ||
|
5e9626af6c | ||
|
d1ea5ced2b | ||
|
8174243203 | ||
|
9e1a4bdb73 | ||
|
dbf2d00a9b | ||
|
c61d12592b | ||
|
7750a01cea | ||
|
e41287e81a | ||
|
4d66e1bf6b | ||
|
c4535e89f7 | ||
|
7f9b324dea | ||
|
d8c1599a49 | ||
|
47a1fa55d6 | ||
|
0ff86943ed |
@@ -1,4 +1,4 @@
|
||||
From 7784b62bd2b64aabd6bfef9ef39ac4f3e8c55c77 Mon Sep 17 00:00:00 2001
|
||||
From eb21fcc668da85977bc86b6105f3830cb26c93e6 Mon Sep 17 00:00:00 2001
|
||||
From: Alistair Leslie-Hughes <leslie_alistair@hotmail.com>
|
||||
Date: Tue, 8 Jun 2021 08:56:40 +1000
|
||||
Subject: [PATCH] bcrypt: Stop compile error when HAVE_GNUTLS_CIPHER_INIT not
|
||||
@@ -20,21 +20,21 @@ Signed-off-by: Alistair Leslie-Hughes <leslie_alistair@hotmail.com>
|
||||
1 file changed, 2 insertions(+), 1 deletion(-)
|
||||
|
||||
diff --git a/dlls/bcrypt/gnutls.c b/dlls/bcrypt/gnutls.c
|
||||
index 37a80bdc062..64825f5b99b 100644
|
||||
index d7b4499c692..11596d5f7ac 100644
|
||||
--- a/dlls/bcrypt/gnutls.c
|
||||
+++ b/dlls/bcrypt/gnutls.c
|
||||
@@ -25,9 +25,10 @@
|
||||
@@ -24,9 +24,10 @@
|
||||
|
||||
#include "config.h"
|
||||
#include "wine/port.h"
|
||||
|
||||
+#include <stdarg.h>
|
||||
+
|
||||
#ifdef HAVE_GNUTLS_CIPHER_INIT
|
||||
|
||||
-#include <stdarg.h>
|
||||
#include <stdlib.h>
|
||||
#include <assert.h>
|
||||
#include <gnutls/gnutls.h>
|
||||
#include <gnutls/crypto.h>
|
||||
#include <sys/types.h>
|
||||
--
|
||||
2.30.2
|
||||
2.33.0
|
||||
|
||||
|
@@ -1,17 +1,17 @@
|
||||
From 990050ed436283fb820d4fe64b08dda3ac7ea9e2 Mon Sep 17 00:00:00 2001
|
||||
From 34109c1adac6293a87db004d60d342faeb33fcfe Mon Sep 17 00:00:00 2001
|
||||
From: Alistair Leslie-Hughes <leslie_alistair@hotmail.com>
|
||||
Date: Tue, 8 Jun 2021 09:34:28 +1000
|
||||
Subject: [PATCH 2/2] d3d10: Avoid implicit cast of interface pointer.
|
||||
Subject: [PATCH] d3d10: Avoid implicit cast of interface pointer.
|
||||
|
||||
---
|
||||
dlls/d3d10/effect.c | 10 +++++-----
|
||||
1 file changed, 5 insertions(+), 5 deletions(-)
|
||||
|
||||
diff --git a/dlls/d3d10/effect.c b/dlls/d3d10/effect.c
|
||||
index 86ef50aac01..060fb69ce3e 100644
|
||||
index 3b4050460a0..b03ed2d6c89 100644
|
||||
--- a/dlls/d3d10/effect.c
|
||||
+++ b/dlls/d3d10/effect.c
|
||||
@@ -126,7 +126,7 @@ static inline struct d3d10_effect_variable *impl_from_ID3D10EffectVariable(ID3D1
|
||||
@@ -147,7 +147,7 @@ static inline struct d3d10_effect_variable *impl_from_ID3D10EffectVariable(ID3D1
|
||||
|
||||
static inline struct d3d10_effect_variable *impl_from_ID3D10EffectShaderVariable(ID3D10EffectShaderVariable *iface)
|
||||
{
|
||||
@@ -19,8 +19,8 @@ index 86ef50aac01..060fb69ce3e 100644
|
||||
+ return CONTAINING_RECORD((ID3D10EffectVariable*)iface, struct d3d10_effect_variable, ID3D10EffectVariable_iface);
|
||||
}
|
||||
|
||||
struct d3d10_effect_state_property_info
|
||||
@@ -4665,7 +4665,7 @@ static void read_variable_array_from_buffer(struct d3d10_effect_variable *variab
|
||||
static struct d3d10_effect_variable * d3d10_array_get_element(struct d3d10_effect_variable *v,
|
||||
@@ -4876,7 +4876,7 @@ static void read_variable_array_from_buffer(struct d3d10_effect_variable *variab
|
||||
|
||||
static inline struct d3d10_effect_variable *impl_from_ID3D10EffectScalarVariable(ID3D10EffectScalarVariable *iface)
|
||||
{
|
||||
@@ -29,7 +29,7 @@ index 86ef50aac01..060fb69ce3e 100644
|
||||
}
|
||||
|
||||
static BOOL STDMETHODCALLTYPE d3d10_effect_scalar_variable_IsValid(ID3D10EffectScalarVariable *iface)
|
||||
@@ -5001,7 +5001,7 @@ static const struct ID3D10EffectScalarVariableVtbl d3d10_effect_scalar_variable_
|
||||
@@ -5212,7 +5212,7 @@ static const struct ID3D10EffectScalarVariableVtbl d3d10_effect_scalar_variable_
|
||||
|
||||
static inline struct d3d10_effect_variable *impl_from_ID3D10EffectVectorVariable(ID3D10EffectVectorVariable *iface)
|
||||
{
|
||||
@@ -38,7 +38,7 @@ index 86ef50aac01..060fb69ce3e 100644
|
||||
}
|
||||
|
||||
static BOOL STDMETHODCALLTYPE d3d10_effect_vector_variable_IsValid(ID3D10EffectVectorVariable *iface)
|
||||
@@ -5488,7 +5488,7 @@ static void read_matrix_variable_array_from_buffer(struct d3d10_effect_variable
|
||||
@@ -5699,7 +5699,7 @@ static void read_matrix_variable_array_from_buffer(struct d3d10_effect_variable
|
||||
|
||||
static inline struct d3d10_effect_variable *impl_from_ID3D10EffectMatrixVariable(ID3D10EffectMatrixVariable *iface)
|
||||
{
|
||||
@@ -47,7 +47,7 @@ index 86ef50aac01..060fb69ce3e 100644
|
||||
}
|
||||
|
||||
static BOOL STDMETHODCALLTYPE d3d10_effect_matrix_variable_IsValid(ID3D10EffectMatrixVariable *iface)
|
||||
@@ -5995,7 +5995,7 @@ static void set_shader_resource_variable(ID3D10ShaderResourceView **src, ID3D10S
|
||||
@@ -6222,7 +6222,7 @@ static void set_shader_resource_variable(ID3D10ShaderResourceView **src, ID3D10S
|
||||
static inline struct d3d10_effect_variable *impl_from_ID3D10EffectShaderResourceVariable(
|
||||
ID3D10EffectShaderResourceVariable *iface)
|
||||
{
|
||||
@@ -57,5 +57,5 @@ index 86ef50aac01..060fb69ce3e 100644
|
||||
|
||||
static BOOL STDMETHODCALLTYPE d3d10_effect_shader_resource_variable_IsValid(ID3D10EffectShaderResourceVariable *iface)
|
||||
--
|
||||
2.30.2
|
||||
2.33.0
|
||||
|
||||
|
@@ -1,4 +1,4 @@
|
||||
From 916189d1cdf149f16867870121171e20f129da9f Mon Sep 17 00:00:00 2001
|
||||
From 36b4dbb687232d783cc3203da1dee4a797606ba7 Mon Sep 17 00:00:00 2001
|
||||
From: Sebastian Lackner <sebastian@fds-team.de>
|
||||
Date: Thu, 2 Oct 2014 19:44:31 +0200
|
||||
Subject: [PATCH] ntdll: Print a warning message specifying the wine-staging
|
||||
@@ -9,7 +9,7 @@ Subject: [PATCH] ntdll: Print a warning message specifying the wine-staging
|
||||
1 file changed, 15 insertions(+)
|
||||
|
||||
diff --git a/dlls/ntdll/loader.c b/dlls/ntdll/loader.c
|
||||
index 3339596944a..1d435f88755 100644
|
||||
index 255d5afef79..00add6728cc 100644
|
||||
--- a/dlls/ntdll/loader.c
|
||||
+++ b/dlls/ntdll/loader.c
|
||||
@@ -44,6 +44,7 @@ WINE_DECLARE_DEBUG_CHANNEL(relay);
|
||||
@@ -20,7 +20,7 @@ index 3339596944a..1d435f88755 100644
|
||||
|
||||
#ifdef _WIN64
|
||||
#define DEFAULT_SECURITY_COOKIE_64 (((ULONGLONG)0x00002b99 << 32) | 0x2ddfa232)
|
||||
@@ -3373,6 +3374,7 @@ void WINAPI LdrShutdownProcess(void)
|
||||
@@ -3536,6 +3537,7 @@ void WINAPI LdrShutdownProcess(void)
|
||||
process_detach();
|
||||
}
|
||||
|
||||
@@ -28,7 +28,7 @@ index 3339596944a..1d435f88755 100644
|
||||
|
||||
/******************************************************************
|
||||
* RtlExitUserProcess (NTDLL.@)
|
||||
@@ -3783,6 +3785,9 @@ static void init_wow64( CONTEXT *context )
|
||||
@@ -3955,6 +3957,9 @@ static void release_address_space(void)
|
||||
*/
|
||||
void WINAPI LdrInitializeThunk( CONTEXT *context, ULONG_PTR unknown2, ULONG_PTR unknown3, ULONG_PTR unknown4 )
|
||||
{
|
||||
@@ -36,9 +36,9 @@ index 3339596944a..1d435f88755 100644
|
||||
+ UNICODE_STRING staging_event_string;
|
||||
+ HANDLE staging_event;
|
||||
static int attach_done;
|
||||
int i;
|
||||
NTSTATUS status;
|
||||
@@ -3869,6 +3874,16 @@ void WINAPI LdrInitializeThunk( CONTEXT *context, ULONG_PTR unknown2, ULONG_PTR
|
||||
ULONG_PTR cookie;
|
||||
@@ -4041,6 +4046,16 @@ void WINAPI LdrInitializeThunk( CONTEXT *context, ULONG_PTR unknown2, ULONG_PTR
|
||||
if (NtCurrentTeb()->WowTebOffset) init_wow64( context );
|
||||
#endif
|
||||
|
||||
@@ -56,5 +56,5 @@ index 3339596944a..1d435f88755 100644
|
||||
InsertHeadList( &tls_links, &NtCurrentTeb()->TlsLinks );
|
||||
RtlReleasePebLock();
|
||||
--
|
||||
2.30.2
|
||||
2.33.0
|
||||
|
||||
|
@@ -1,25 +1,25 @@
|
||||
From cfcc687562d4fa68b507cbf2c29722ef523d26aa Mon Sep 17 00:00:00 2001
|
||||
From 8aa6fb73e3142d86ba354c204313b8a74a5fa43d Mon Sep 17 00:00:00 2001
|
||||
From: Sebastian Lackner <sebastian@fds-team.de>
|
||||
Date: Thu, 2 Oct 2014 19:53:46 +0200
|
||||
Subject: [PATCH] winelib: Append '(Staging)' at the end of the version string.
|
||||
|
||||
---
|
||||
Makefile.in | 2 +-
|
||||
configure.ac | 2 +-
|
||||
1 file changed, 1 insertion(+), 1 deletion(-)
|
||||
|
||||
diff --git a/Makefile.in b/Makefile.in
|
||||
index b52495f741f..d5a8cad20da 100644
|
||||
--- a/Makefile.in
|
||||
+++ b/Makefile.in
|
||||
@@ -116,7 +116,7 @@ install-manpages:: manpages
|
||||
# Rules for generated source files
|
||||
|
||||
dlls/ntdll/unix/version.c: dummy
|
||||
- @version=`(GIT_DIR=$(srcdir)/.git git describe HEAD 2>/dev/null || echo "wine-$(PACKAGE_VERSION)") | sed -n -e '$$s/\(.*\)/const char wine_build[] = "\1";/p'` && (echo $$version | cmp -s - $@) || echo $$version >$@ || ($(RM) $@ && exit 1)
|
||||
+ @version=`(GIT_DIR=$(srcdir)/.git git describe HEAD 2>/dev/null || echo "wine-$(PACKAGE_VERSION)") | sed -n -e '$$s/\(.*\)/const char wine_build[] = "\1 (Staging)";/p'` && (echo $$version | cmp -s - $@) || echo $$version >$@ || (rm -f $@ && exit 1)
|
||||
diff --git a/configure.ac b/configure.ac
|
||||
index f86a5decb07..3d7f9cc96e6 100644
|
||||
--- a/configure.ac
|
||||
+++ b/configure.ac
|
||||
@@ -3910,7 +3910,7 @@ dnl Rules for generated source files
|
||||
|
||||
WINE_APPEND_RULE(
|
||||
[dlls/ntdll/unix/version.c: dummy
|
||||
- @version=\`(GIT_DIR=${wine_srcdir}.git git describe HEAD 2>/dev/null || echo \"wine-\$(PACKAGE_VERSION)\") | sed -n -e '\$\$s/\(.*\)/const char wine_build[[]] = \"\\1\";/p'\` && (echo \$\$version | cmp -s - \$[@]) || echo \$\$version >\$[@] || (rm -f \$[@] && exit 1)
|
||||
+ @version=\`(GIT_DIR=${wine_srcdir}.git git describe HEAD 2>/dev/null || echo \"wine-\$(PACKAGE_VERSION)\") | sed -n -e '\$\$s/\(.*\)/const char wine_build[[]] = \"\\1 (Staging)\";/p'\` && (echo \$\$version | cmp -s - \$[@]) || echo \$\$version >\$[@] || (rm -f \$[@] && exit 1)
|
||||
programs/winetest/build.rc: dummy
|
||||
@build="STRINGTABLE { 1 \"`GIT_DIR=$(srcdir)/.git git rev-parse HEAD 2>/dev/null`\" }" && (echo $$build | cmp -s - $@) || echo $$build >$@ || (rm -f $@ && exit 1)
|
||||
@build=\"STRINGTABLE { 1 \\\"\`GIT_DIR=${wine_srcdir}.git git rev-parse HEAD 2>/dev/null\`\\\" }\" && (echo \$\$build | cmp -s - \$[@]) || echo \$\$build >\$[@] || (rm -f \$[@] && exit 1)
|
||||
programs/winetest/build.nfo:
|
||||
--
|
||||
2.20.1
|
||||
2.33.0
|
||||
|
||||
|
@@ -1,125 +0,0 @@
|
||||
From ffea83bdf88a4b7d35c2f9a7e1a773d3110b5771 Mon Sep 17 00:00:00 2001
|
||||
From: =?UTF-8?q?Michael=20M=C3=BCller?= <michael@fds-team.de>
|
||||
Date: Tue, 12 Apr 2016 01:02:34 +0200
|
||||
Subject: [PATCH] uiautomationcore: Add dll and stub some functions.
|
||||
|
||||
---
|
||||
dlls/uiautomationcore/Makefile.in | 1 +
|
||||
dlls/uiautomationcore/uia_main.c | 53 +++++++++++++++++++++++++++----
|
||||
2 files changed, 48 insertions(+), 6 deletions(-)
|
||||
|
||||
diff --git a/dlls/uiautomationcore/Makefile.in b/dlls/uiautomationcore/Makefile.in
|
||||
index 71ea7b99c94..3e6c2d7688a 100644
|
||||
--- a/dlls/uiautomationcore/Makefile.in
|
||||
+++ b/dlls/uiautomationcore/Makefile.in
|
||||
@@ -1,5 +1,6 @@
|
||||
MODULE = uiautomationcore.dll
|
||||
IMPORTLIB = uiautomationcore
|
||||
+IMPORTS = uuid
|
||||
|
||||
EXTRADLLFLAGS = -Wb,--prefer-native
|
||||
|
||||
diff --git a/dlls/uiautomationcore/uia_main.c b/dlls/uiautomationcore/uia_main.c
|
||||
index 2dada95af80..a32ef552f15 100644
|
||||
--- a/dlls/uiautomationcore/uia_main.c
|
||||
+++ b/dlls/uiautomationcore/uia_main.c
|
||||
@@ -1,4 +1,5 @@
|
||||
/*
|
||||
+ * Copyright 2016 Michael MĂĽller
|
||||
* Copyright 2017 Jacek Caban for CodeWeavers
|
||||
*
|
||||
* This library is free software; you can redistribute it and/or
|
||||
@@ -16,18 +17,58 @@
|
||||
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
|
||||
*/
|
||||
|
||||
+#define COBJMACROS
|
||||
#include "uiautomation.h"
|
||||
|
||||
#include "wine/debug.h"
|
||||
|
||||
WINE_DEFAULT_DEBUG_CHANNEL(uiautomation);
|
||||
|
||||
+static HRESULT WINAPI dummy_QueryInterface(IUnknown *iface, REFIID iid, void **ppv)
|
||||
+{
|
||||
+ TRACE("(%p, %s, %p)\n", iface, debugstr_guid(iid), ppv);
|
||||
+
|
||||
+ if (!ppv) return E_INVALIDARG;
|
||||
+
|
||||
+ if (!IsEqualIID(&IID_IUnknown, iid))
|
||||
+ {
|
||||
+ FIXME("Unknown interface: %s\n", debugstr_guid(iid));
|
||||
+ *ppv = NULL;
|
||||
+ return E_NOINTERFACE;
|
||||
+ }
|
||||
+
|
||||
+ *ppv = iface;
|
||||
+ IUnknown_AddRef((IUnknown *)*ppv);
|
||||
+ return S_OK;
|
||||
+}
|
||||
+
|
||||
+static ULONG WINAPI dummy_AddRef(IUnknown *iface)
|
||||
+{
|
||||
+ FIXME("(%p): stub\n", iface);
|
||||
+ return 1;
|
||||
+}
|
||||
+
|
||||
+static ULONG WINAPI dummy_Release(IUnknown *iface)
|
||||
+{
|
||||
+ FIXME("(%p): stub\n", iface);
|
||||
+ return 1;
|
||||
+}
|
||||
+
|
||||
+static const IUnknownVtbl dummy_Vtbl =
|
||||
+{
|
||||
+ dummy_QueryInterface,
|
||||
+ dummy_AddRef,
|
||||
+ dummy_Release,
|
||||
+};
|
||||
+
|
||||
+static IUnknown dummy = { &dummy_Vtbl };
|
||||
+
|
||||
/***********************************************************************
|
||||
* UiaClientsAreListening (uiautomationcore.@)
|
||||
*/
|
||||
BOOL WINAPI UiaClientsAreListening(void)
|
||||
{
|
||||
- FIXME("()\n");
|
||||
+ FIXME("(): stub\n");
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
@@ -36,8 +77,8 @@ BOOL WINAPI UiaClientsAreListening(void)
|
||||
*/
|
||||
HRESULT WINAPI UiaGetReservedMixedAttributeValue(IUnknown **value)
|
||||
{
|
||||
- FIXME("(%p) stub!\n", value);
|
||||
- *value = NULL;
|
||||
+ FIXME("(%p): stub!\n", value);
|
||||
+ *value = &dummy;
|
||||
return S_OK;
|
||||
}
|
||||
|
||||
@@ -46,8 +87,8 @@ HRESULT WINAPI UiaGetReservedMixedAttributeValue(IUnknown **value)
|
||||
*/
|
||||
HRESULT WINAPI UiaGetReservedNotSupportedValue(IUnknown **value)
|
||||
{
|
||||
- FIXME("(%p) stub!\n", value);
|
||||
- *value = NULL;
|
||||
+ FIXME("(%p): stub!\n", value);
|
||||
+ *value = &dummy;
|
||||
return S_OK;
|
||||
}
|
||||
|
||||
@@ -66,7 +107,7 @@ int WINAPI UiaLookupId(enum AutomationIdentifierType type, const GUID *guid)
|
||||
LRESULT WINAPI UiaReturnRawElementProvider(HWND hwnd, WPARAM wParam,
|
||||
LPARAM lParam, IRawElementProviderSimple *elprov)
|
||||
{
|
||||
- FIXME("(%p, %lx, %lx, %p) stub!\n", hwnd, wParam, lParam, elprov);
|
||||
+ FIXME("(%p, %lx, %lx, %p): stub!\n", hwnd, wParam, lParam, elprov);
|
||||
return 0;
|
||||
}
|
||||
|
||||
--
|
||||
2.33.0
|
||||
|
@@ -1,4 +1,4 @@
|
||||
From 89c22c9894fd170b0b3a99309540c88059c64824 Mon Sep 17 00:00:00 2001
|
||||
From 1768ecfc4a7181600df254069f02655fe4e5fa0b Mon Sep 17 00:00:00 2001
|
||||
From: Derek Lesho <dlesho@codeweavers.com>
|
||||
Date: Fri, 2 Oct 2020 11:29:24 -0500
|
||||
Subject: [PATCH] bcrypt: Allow multiple backends to coexist.
|
||||
@@ -7,18 +7,17 @@ Signed-off-by: Derek Lesho <dlesho@codeweavers.com>
|
||||
---
|
||||
dlls/bcrypt/Makefile.in | 3 +-
|
||||
dlls/bcrypt/bcrypt_internal.h | 3 +
|
||||
dlls/bcrypt/gnutls.c | 34 ++++--
|
||||
dlls/bcrypt/macos.c | 18 ++-
|
||||
dlls/bcrypt/unixlib.c | 211 ++++++++++++++++++++++++++++++++++
|
||||
5 files changed, 253 insertions(+), 16 deletions(-)
|
||||
dlls/bcrypt/gnutls.c | 32 ++++--
|
||||
dlls/bcrypt/unixlib.c | 208 ++++++++++++++++++++++++++++++++++
|
||||
4 files changed, 235 insertions(+), 11 deletions(-)
|
||||
create mode 100644 dlls/bcrypt/unixlib.c
|
||||
|
||||
diff --git a/dlls/bcrypt/Makefile.in b/dlls/bcrypt/Makefile.in
|
||||
index 24803fb2d7c..46a20d473dd 100644
|
||||
index 63a731fa9d9..6dd3066d4a5 100644
|
||||
--- a/dlls/bcrypt/Makefile.in
|
||||
+++ b/dlls/bcrypt/Makefile.in
|
||||
@@ -11,6 +11,7 @@ C_SRCS = \
|
||||
macos.c \
|
||||
@@ -8,6 +8,7 @@ C_SRCS = \
|
||||
gnutls.c \
|
||||
md2.c \
|
||||
sha256.c \
|
||||
- sha512.c
|
||||
@@ -39,10 +38,10 @@ index 61c367cae9d..d0697ed807e 100644
|
||||
+
|
||||
#endif /* __BCRYPT_INTERNAL_H */
|
||||
diff --git a/dlls/bcrypt/gnutls.c b/dlls/bcrypt/gnutls.c
|
||||
index 9c1e7b5ab06..9b716c6f536 100644
|
||||
index 7b1bceda889..66845ffc8cf 100644
|
||||
--- a/dlls/bcrypt/gnutls.c
|
||||
+++ b/dlls/bcrypt/gnutls.c
|
||||
@@ -372,9 +372,12 @@ fail:
|
||||
@@ -373,9 +373,12 @@ fail:
|
||||
|
||||
static void gnutls_uninitialize(void)
|
||||
{
|
||||
@@ -58,16 +57,7 @@ index 9c1e7b5ab06..9b716c6f536 100644
|
||||
}
|
||||
|
||||
struct buffer
|
||||
@@ -1869,7 +1872,7 @@ static NTSTATUS CDECL key_asymmetric_decrypt( struct key *key, UCHAR *input, ULO
|
||||
return status;
|
||||
}
|
||||
|
||||
-static const struct key_funcs key_funcs =
|
||||
+static struct key_funcs key_funcs =
|
||||
{
|
||||
key_set_property,
|
||||
key_symmetric_init,
|
||||
@@ -1893,19 +1896,28 @@ static const struct key_funcs key_funcs =
|
||||
@@ -1894,19 +1897,28 @@ static const struct key_funcs key_funcs =
|
||||
key_import_rsa
|
||||
};
|
||||
|
||||
@@ -103,42 +93,12 @@ index 9c1e7b5ab06..9b716c6f536 100644
|
||||
+ return NULL;
|
||||
+}
|
||||
+#endif
|
||||
diff --git a/dlls/bcrypt/macos.c b/dlls/bcrypt/macos.c
|
||||
index 20e1a61e3fb..1e364ac05a3 100644
|
||||
--- a/dlls/bcrypt/macos.c
|
||||
+++ b/dlls/bcrypt/macos.c
|
||||
@@ -302,11 +302,21 @@ static const struct key_funcs key_funcs =
|
||||
key_import_rsa
|
||||
};
|
||||
|
||||
-NTSTATUS CDECL __wine_init_unix_lib( HMODULE module, DWORD reason, const void *ptr_in, void *ptr_out )
|
||||
+struct key_funcs * macos_lib_init( DWORD reason )
|
||||
{
|
||||
- if (reason != DLL_PROCESS_ATTACH) return STATUS_SUCCESS;
|
||||
- *(const struct key_funcs **)ptr_out = &key_funcs;
|
||||
- return STATUS_SUCCESS;
|
||||
+ if (reason != DLL_PROCESS_ATTACH) return NULL;
|
||||
+ return &key_funcs;
|
||||
}
|
||||
|
||||
+#else
|
||||
+#include "ntstatus.h"
|
||||
+#define WIN32_NO_STATUS
|
||||
+#include "windef.h"
|
||||
+#include "winbase.h"
|
||||
+#include "winternl.h"
|
||||
+
|
||||
+struct key_funcs * macos_lib_init( DWORD reason )
|
||||
+{
|
||||
+ return NULL;
|
||||
+}
|
||||
#endif
|
||||
diff --git a/dlls/bcrypt/unixlib.c b/dlls/bcrypt/unixlib.c
|
||||
new file mode 100644
|
||||
index 00000000000..6c3aff80373
|
||||
index 00000000000..1937a8172a4
|
||||
--- /dev/null
|
||||
+++ b/dlls/bcrypt/unixlib.c
|
||||
@@ -0,0 +1,211 @@
|
||||
@@ -0,0 +1,208 @@
|
||||
+#if 0
|
||||
+#pragma makedep unix
|
||||
+#endif
|
||||
@@ -271,7 +231,7 @@ index 00000000000..6c3aff80373
|
||||
+}
|
||||
+
|
||||
+static NTSTATUS CDECL key_asymmetric_decrypt( struct key *key, UCHAR *input, ULONG input_len,
|
||||
+ UCHAR *output, ULONG *output_len, ULONG *ret_len )
|
||||
+ UCHAR *output, ULONG output_len, ULONG *ret)
|
||||
+{
|
||||
+ FIXME( "not implemented\n" );
|
||||
+ return STATUS_NOT_IMPLEMENTED;
|
||||
@@ -310,13 +270,10 @@ index 00000000000..6c3aff80373
|
||||
+NTSTATUS CDECL __wine_init_unix_lib( HMODULE module, DWORD reason, const void *ptr_in, void *ptr_out )
|
||||
+{
|
||||
+ struct key_funcs *gnutls_funcs = gnutls_lib_init(reason);
|
||||
+ struct key_funcs *macos_funcs = macos_lib_init(reason);
|
||||
+
|
||||
+ if (reason == DLL_PROCESS_ATTACH)
|
||||
+ {
|
||||
+#define RESOLVE_FUNC(name) \
|
||||
+ if (macos_funcs && macos_funcs->key_##name) \
|
||||
+ key_funcs.key_##name = macos_funcs->key_##name; \
|
||||
+ if (gnutls_funcs && gnutls_funcs->key_##name) \
|
||||
+ key_funcs.key_##name = gnutls_funcs->key_##name;
|
||||
+
|
||||
@@ -351,5 +308,5 @@ index 00000000000..6c3aff80373
|
||||
+
|
||||
+#endif
|
||||
--
|
||||
2.30.2
|
||||
2.33.0
|
||||
|
||||
|
@@ -1,4 +1,4 @@
|
||||
From e2442f39015a5982bfd15479ee06d7163d36771d Mon Sep 17 00:00:00 2001
|
||||
From 528d7188ba7d6e68622d1b4f95608e68f26e1852 Mon Sep 17 00:00:00 2001
|
||||
From: Derek Lesho <dlesho@codeweavers.com>
|
||||
Date: Fri, 2 Oct 2020 12:11:49 -0500
|
||||
Subject: [PATCH] bcrypt: Implement BCryptSecretAgreement with libgcrypt.
|
||||
@@ -11,17 +11,16 @@ Signed-off-by: Derek Lesho <dlesho@codeweavers.com>
|
||||
dlls/bcrypt/bcrypt_main.c | 55 ++++++-
|
||||
dlls/bcrypt/gcrypt.c | 292 ++++++++++++++++++++++++++++++++++
|
||||
dlls/bcrypt/gnutls.c | 3 +-
|
||||
dlls/bcrypt/macos.c | 3 +-
|
||||
dlls/bcrypt/tests/bcrypt.c | 2 +-
|
||||
dlls/bcrypt/unixlib.c | 13 +-
|
||||
9 files changed, 378 insertions(+), 9 deletions(-)
|
||||
8 files changed, 376 insertions(+), 8 deletions(-)
|
||||
create mode 100644 dlls/bcrypt/gcrypt.c
|
||||
|
||||
diff --git a/configure.ac b/configure.ac
|
||||
index b6b8d49342f3..7c1c8a7ddaf4 100644
|
||||
index f2401734035..b47f8d016e0 100644
|
||||
--- a/configure.ac
|
||||
+++ b/configure.ac
|
||||
@@ -46,6 +46,7 @@ AC_ARG_WITH(faudio, AS_HELP_STRING([--without-faudio],[do not use FAudio (XAu
|
||||
@@ -47,6 +47,7 @@ AC_ARG_WITH(faudio, AS_HELP_STRING([--without-faudio],[do not use FAudio (XAu
|
||||
AC_ARG_WITH(float-abi, AS_HELP_STRING([--with-float-abi=abi],[specify the ABI (soft|softfp|hard) for ARM platforms]))
|
||||
AC_ARG_WITH(fontconfig,AS_HELP_STRING([--without-fontconfig],[do not use fontconfig]))
|
||||
AC_ARG_WITH(freetype, AS_HELP_STRING([--without-freetype],[do not use the FreeType library]))
|
||||
@@ -29,7 +28,7 @@ index b6b8d49342f3..7c1c8a7ddaf4 100644
|
||||
AC_ARG_WITH(gettext, AS_HELP_STRING([--without-gettext],[do not use gettext]))
|
||||
AC_ARG_WITH(gettextpo, AS_HELP_STRING([--with-gettextpo],[use the GetTextPO library to rebuild po files]),
|
||||
[if test "x$withval" = "xno"; then ac_cv_header_gettext_po_h=no; fi])
|
||||
@@ -1989,6 +1990,19 @@ WINE_NOTICE_WITH(vkd3d,[test "x$ac_cv_lib_soname_vkd3d" = "x"],
|
||||
@@ -1954,6 +1955,19 @@ WINE_NOTICE_WITH(vkd3d,[test "x$ac_cv_lib_soname_vkd3d" = "x"],
|
||||
[vkd3d ${notice_platform}development files not found (or too old), Direct3D 12 won't be supported.])
|
||||
test "x$ac_cv_lib_soname_vkd3d" != "x" || enable_d3d12=${enable_d3d12:-no}
|
||||
|
||||
@@ -50,22 +49,22 @@ index b6b8d49342f3..7c1c8a7ddaf4 100644
|
||||
|
||||
AC_SUBST(EXTRACFLAGS,"")
|
||||
diff --git a/dlls/bcrypt/Makefile.in b/dlls/bcrypt/Makefile.in
|
||||
index 46a20d473dd7..4a3016784af3 100644
|
||||
index 6dd3066d4a5..5336c8fc66b 100644
|
||||
--- a/dlls/bcrypt/Makefile.in
|
||||
+++ b/dlls/bcrypt/Makefile.in
|
||||
@@ -7,6 +7,7 @@ EXTRADLLFLAGS = -mno-cygwin
|
||||
@@ -5,6 +5,7 @@ EXTRAINCL = $(GNUTLS_CFLAGS)
|
||||
|
||||
C_SRCS = \
|
||||
bcrypt_main.c \
|
||||
+ gcrypt.c \
|
||||
gnutls.c \
|
||||
macos.c \
|
||||
md2.c \
|
||||
sha256.c \
|
||||
diff --git a/dlls/bcrypt/bcrypt_internal.h b/dlls/bcrypt/bcrypt_internal.h
|
||||
index 3c7110d05f84..e7991eac077a 100644
|
||||
index d0697ed807e..66898c58cd2 100644
|
||||
--- a/dlls/bcrypt/bcrypt_internal.h
|
||||
+++ b/dlls/bcrypt/bcrypt_internal.h
|
||||
@@ -192,6 +192,8 @@ struct key
|
||||
@@ -193,6 +193,8 @@ struct key
|
||||
struct secret
|
||||
{
|
||||
struct object hdr;
|
||||
@@ -74,7 +73,7 @@ index 3c7110d05f84..e7991eac077a 100644
|
||||
};
|
||||
|
||||
struct key_funcs
|
||||
@@ -216,9 +218,11 @@ struct key_funcs
|
||||
@@ -217,9 +219,11 @@ struct key_funcs
|
||||
NTSTATUS (CDECL *key_import_dsa_capi)( struct key *, UCHAR *, ULONG );
|
||||
NTSTATUS (CDECL *key_import_ecc)( struct key *, UCHAR *, ULONG );
|
||||
NTSTATUS (CDECL *key_import_rsa)( struct key *, UCHAR *, ULONG );
|
||||
@@ -87,10 +86,10 @@ index 3c7110d05f84..e7991eac077a 100644
|
||||
|
||||
#endif /* __BCRYPT_INTERNAL_H */
|
||||
diff --git a/dlls/bcrypt/bcrypt_main.c b/dlls/bcrypt/bcrypt_main.c
|
||||
index a1423dcd8368..0655c5dcfe81 100644
|
||||
index 5eb50cd616b..570f452d78e 100644
|
||||
--- a/dlls/bcrypt/bcrypt_main.c
|
||||
+++ b/dlls/bcrypt/bcrypt_main.c
|
||||
@@ -1932,9 +1932,12 @@ NTSTATUS WINAPI BCryptSecretAgreement(BCRYPT_KEY_HANDLE privatekey, BCRYPT_KEY_H
|
||||
@@ -1925,9 +1925,12 @@ NTSTATUS WINAPI BCryptSecretAgreement(BCRYPT_KEY_HANDLE privatekey, BCRYPT_KEY_H
|
||||
{
|
||||
struct key *privkey = privatekey;
|
||||
struct key *pubkey = publickey;
|
||||
@@ -104,7 +103,7 @@ index a1423dcd8368..0655c5dcfe81 100644
|
||||
|
||||
if (!privkey || privkey->hdr.magic != MAGIC_KEY) return STATUS_INVALID_HANDLE;
|
||||
if (!pubkey || pubkey->hdr.magic != MAGIC_KEY) return STATUS_INVALID_HANDLE;
|
||||
@@ -1943,18 +1946,39 @@ NTSTATUS WINAPI BCryptSecretAgreement(BCRYPT_KEY_HANDLE privatekey, BCRYPT_KEY_H
|
||||
@@ -1936,18 +1939,39 @@ NTSTATUS WINAPI BCryptSecretAgreement(BCRYPT_KEY_HANDLE privatekey, BCRYPT_KEY_H
|
||||
if (!(secret = heap_alloc_zero( sizeof(*secret) ))) return STATUS_NO_MEMORY;
|
||||
secret->hdr.magic = MAGIC_SECRET;
|
||||
|
||||
@@ -146,7 +145,7 @@ index a1423dcd8368..0655c5dcfe81 100644
|
||||
heap_free( secret );
|
||||
return STATUS_SUCCESS;
|
||||
}
|
||||
@@ -1964,12 +1988,33 @@ NTSTATUS WINAPI BCryptDeriveKey(BCRYPT_SECRET_HANDLE handle, LPCWSTR kdf, BCrypt
|
||||
@@ -1957,12 +1981,33 @@ NTSTATUS WINAPI BCryptDeriveKey(BCRYPT_SECRET_HANDLE handle, LPCWSTR kdf, BCrypt
|
||||
{
|
||||
struct secret *secret = handle;
|
||||
|
||||
@@ -184,7 +183,7 @@ index a1423dcd8368..0655c5dcfe81 100644
|
||||
BOOL WINAPI DllMain( HINSTANCE hinst, DWORD reason, LPVOID reserved )
|
||||
diff --git a/dlls/bcrypt/gcrypt.c b/dlls/bcrypt/gcrypt.c
|
||||
new file mode 100644
|
||||
index 000000000000..e72c27feb519
|
||||
index 00000000000..e72c27feb51
|
||||
--- /dev/null
|
||||
+++ b/dlls/bcrypt/gcrypt.c
|
||||
@@ -0,0 +1,292 @@
|
||||
@@ -481,10 +480,10 @@ index 000000000000..e72c27feb519
|
||||
+}
|
||||
+#endif
|
||||
diff --git a/dlls/bcrypt/gnutls.c b/dlls/bcrypt/gnutls.c
|
||||
index 9490ea8612a8..78d0f2d95966 100644
|
||||
index 66845ffc8cf..64825f5b99b 100644
|
||||
--- a/dlls/bcrypt/gnutls.c
|
||||
+++ b/dlls/bcrypt/gnutls.c
|
||||
@@ -1949,7 +1949,8 @@ static const struct key_funcs key_funcs =
|
||||
@@ -1894,7 +1894,8 @@ static const struct key_funcs key_funcs =
|
||||
key_export_ecc,
|
||||
key_import_dsa_capi,
|
||||
key_import_ecc,
|
||||
@@ -494,25 +493,11 @@ index 9490ea8612a8..78d0f2d95966 100644
|
||||
};
|
||||
|
||||
struct key_funcs * gnutls_lib_init( DWORD reason )
|
||||
diff --git a/dlls/bcrypt/macos.c b/dlls/bcrypt/macos.c
|
||||
index 2a88aec8362c..3ee3515f9de2 100644
|
||||
--- a/dlls/bcrypt/macos.c
|
||||
+++ b/dlls/bcrypt/macos.c
|
||||
@@ -299,7 +299,8 @@ static const struct key_funcs key_funcs =
|
||||
key_export_ecc,
|
||||
key_import_dsa_capi,
|
||||
key_import_ecc,
|
||||
- key_import_rsa
|
||||
+ key_import_rsa,
|
||||
+ NULL
|
||||
};
|
||||
|
||||
struct key_funcs * macos_lib_init( DWORD reason )
|
||||
diff --git a/dlls/bcrypt/tests/bcrypt.c b/dlls/bcrypt/tests/bcrypt.c
|
||||
index 456727d04a96..6be406dee21f 100644
|
||||
index fb5ac03b039..894473d5346 100644
|
||||
--- a/dlls/bcrypt/tests/bcrypt.c
|
||||
+++ b/dlls/bcrypt/tests/bcrypt.c
|
||||
@@ -2163,7 +2163,7 @@ static void test_ECDH(void)
|
||||
@@ -2248,7 +2248,7 @@ static void test_ECDH(void)
|
||||
goto raw_secret_end;
|
||||
}
|
||||
|
||||
@@ -522,7 +507,7 @@ index 456727d04a96..6be406dee21f 100644
|
||||
if (status != STATUS_SUCCESS)
|
||||
{
|
||||
diff --git a/dlls/bcrypt/unixlib.c b/dlls/bcrypt/unixlib.c
|
||||
index 9cbb25f5740c..6f8ff7f97887 100644
|
||||
index 1937a8172a4..e684a608eb5 100644
|
||||
--- a/dlls/bcrypt/unixlib.c
|
||||
+++ b/dlls/bcrypt/unixlib.c
|
||||
@@ -142,6 +142,12 @@ static NTSTATUS CDECL key_import_rsa( struct key *key, UCHAR *input, ULONG input
|
||||
@@ -538,7 +523,7 @@ index 9cbb25f5740c..6f8ff7f97887 100644
|
||||
static struct key_funcs key_funcs =
|
||||
{
|
||||
key_set_property,
|
||||
@@ -164,12 +170,14 @@ static struct key_funcs key_funcs =
|
||||
@@ -164,17 +170,21 @@ static struct key_funcs key_funcs =
|
||||
key_import_dsa_capi,
|
||||
key_import_ecc,
|
||||
key_import_rsa,
|
||||
@@ -548,14 +533,11 @@ index 9cbb25f5740c..6f8ff7f97887 100644
|
||||
NTSTATUS CDECL __wine_init_unix_lib( HMODULE module, DWORD reason, const void *ptr_in, void *ptr_out )
|
||||
{
|
||||
struct key_funcs *gnutls_funcs = gnutls_lib_init(reason);
|
||||
struct key_funcs *macos_funcs = macos_lib_init(reason);
|
||||
+ struct key_funcs *gcrypt_funcs = gcrypt_lib_init(reason);
|
||||
|
||||
if (reason == DLL_PROCESS_ATTACH)
|
||||
{
|
||||
@@ -177,7 +185,9 @@ NTSTATUS CDECL __wine_init_unix_lib( HMODULE module, DWORD reason, const void *p
|
||||
if (macos_funcs && macos_funcs->key_##name) \
|
||||
key_funcs.key_##name = macos_funcs->key_##name; \
|
||||
#define RESOLVE_FUNC(name) \
|
||||
if (gnutls_funcs && gnutls_funcs->key_##name) \
|
||||
- key_funcs.key_##name = gnutls_funcs->key_##name;
|
||||
+ key_funcs.key_##name = gnutls_funcs->key_##name; \
|
||||
@@ -564,7 +546,7 @@ index 9cbb25f5740c..6f8ff7f97887 100644
|
||||
|
||||
RESOLVE_FUNC(set_property)
|
||||
RESOLVE_FUNC(symmetric_init)
|
||||
@@ -199,6 +209,7 @@ NTSTATUS CDECL __wine_init_unix_lib( HMODULE module, DWORD reason, const void *p
|
||||
@@ -196,6 +206,7 @@ NTSTATUS CDECL __wine_init_unix_lib( HMODULE module, DWORD reason, const void *p
|
||||
RESOLVE_FUNC(import_dsa_capi)
|
||||
RESOLVE_FUNC(import_ecc)
|
||||
RESOLVE_FUNC(import_rsa)
|
||||
@@ -573,5 +555,5 @@ index 9cbb25f5740c..6f8ff7f97887 100644
|
||||
#undef RESOLVE_FUNC
|
||||
|
||||
--
|
||||
2.29.2
|
||||
2.33.0
|
||||
|
||||
|
@@ -2,3 +2,5 @@ Fixes: [47699] Multiple games fail to connect to online services (missing BCrypt
|
||||
# Needs to be moved to the unix lib, but that's a nontrivial amount of work, and
|
||||
# using gcrypt is the wrong way forward (we should expose the missing APIs from
|
||||
# gnutls instead).
|
||||
# Temporarily disabled pending a rebase from author.
|
||||
Disabled: true
|
@@ -1,4 +1,4 @@
|
||||
From f73bf747238e157fc73f8b62941d3d8aa4b6bb33 Mon Sep 17 00:00:00 2001
|
||||
From b094a7cf3f804ea40e5bd05ad738c48b5464e0bb Mon Sep 17 00:00:00 2001
|
||||
From: Sebastian Lackner <sebastian@fds-team.de>
|
||||
Date: Mon, 6 Oct 2014 05:06:06 +0200
|
||||
Subject: [PATCH] dbghelp: Always check for debug symbols in BINDIR.
|
||||
@@ -9,12 +9,13 @@ Subject: [PATCH] dbghelp: Always check for debug symbols in BINDIR.
|
||||
2 files changed, 2 insertions(+), 1 deletion(-)
|
||||
|
||||
diff --git a/dlls/dbghelp/Makefile.in b/dlls/dbghelp/Makefile.in
|
||||
index b2a5e2037e9..7140cc9f181 100644
|
||||
index 22be2612eeb..f3f31eb3671 100644
|
||||
--- a/dlls/dbghelp/Makefile.in
|
||||
+++ b/dlls/dbghelp/Makefile.in
|
||||
@@ -1,6 +1,6 @@
|
||||
MODULE = dbghelp.dll
|
||||
@@ -2,7 +2,7 @@ MODULE = dbghelp.dll
|
||||
IMPORTLIB = dbghelp
|
||||
IMPORTS = $(ZLIB_PE_LIBS)
|
||||
EXTRAINCL = $(ZLIB_PE_CFLAGS)
|
||||
-EXTRADEFS = -D_IMAGEHLP_SOURCE_
|
||||
+EXTRADEFS = -D_IMAGEHLP_SOURCE_ -DBINDIR="L\"${bindir}\""
|
||||
DELAYIMPORTS = version
|
||||
|
@@ -1,2 +0,0 @@
|
||||
Fixes: [47326] dinput: Allow mapping of controls based of genre type.
|
||||
Depends: dinput-joy-mappings
|
@@ -1,214 +0,0 @@
|
||||
From 24829b2ba6d5efd950f178b8282dda826c4d1df0 Mon Sep 17 00:00:00 2001
|
||||
From: Bruno Jesus <bjesus@codeweavers.com>
|
||||
Date: Thu, 28 Feb 2019 15:56:18 +1100
|
||||
Subject: [PATCH] dinput: Recalculated Axis after deadzone change.
|
||||
|
||||
Wine-bugs: https://bugs.winehq.org/show_bug.cgi?id=41317
|
||||
---
|
||||
dlls/dinput/joystick.c | 149 ++++++++++++++++++++++-------------------
|
||||
1 file changed, 80 insertions(+), 69 deletions(-)
|
||||
|
||||
diff --git a/dlls/dinput/joystick.c b/dlls/dinput/joystick.c
|
||||
index 433348cd04..c150528e3d 100644
|
||||
--- a/dlls/dinput/joystick.c
|
||||
+++ b/dlls/dinput/joystick.c
|
||||
@@ -312,6 +312,76 @@ BOOL is_xinput_device(const DIDEVCAPS *devcaps, WORD vid, WORD pid)
|
||||
return (devcaps->dwAxes == 6 && devcaps->dwButtons >= 14);
|
||||
}
|
||||
|
||||
+static void remap_init(JoystickGenericImpl *This, int obj, ObjProps *remap_props)
|
||||
+{
|
||||
+ /* Configure as if nothing changed so the helper functions can only change
|
||||
+ * what they need, thus reducing code duplication. */
|
||||
+ remap_props->lDevMin = remap_props->lMin = This->props[obj].lMin;
|
||||
+ remap_props->lDevMax = remap_props->lMax = This->props[obj].lMax;
|
||||
+
|
||||
+ remap_props->lDeadZone = This->props[obj].lDeadZone;
|
||||
+ remap_props->lSaturation = This->props[obj].lSaturation;
|
||||
+}
|
||||
+
|
||||
+static void remap_apply(JoystickGenericImpl *This, int obj, ObjProps *remap_props)
|
||||
+{
|
||||
+ /* Many games poll the joystick immediately after setting the range
|
||||
+ * for calibration purposes, so the old values need to be remapped
|
||||
+ * to the new range before it does so */
|
||||
+ switch (This->base.data_format.wine_df->rgodf[obj].dwOfs){
|
||||
+ case DIJOFS_X : This->js.lX = joystick_map_axis(remap_props, This->js.lX); break;
|
||||
+ case DIJOFS_Y : This->js.lY = joystick_map_axis(remap_props, This->js.lY); break;
|
||||
+ case DIJOFS_Z : This->js.lZ = joystick_map_axis(remap_props, This->js.lZ); break;
|
||||
+ case DIJOFS_RX : This->js.lRx = joystick_map_axis(remap_props, This->js.lRx); break;
|
||||
+ case DIJOFS_RY : This->js.lRy = joystick_map_axis(remap_props, This->js.lRy); break;
|
||||
+ case DIJOFS_RZ : This->js.lRz = joystick_map_axis(remap_props, This->js.lRz); break;
|
||||
+ case DIJOFS_SLIDER(0): This->js.rglSlider[0] = joystick_map_axis(remap_props, This->js.rglSlider[0]); break;
|
||||
+ case DIJOFS_SLIDER(1): This->js.rglSlider[1] = joystick_map_axis(remap_props, This->js.rglSlider[1]); break;
|
||||
+ default: break;
|
||||
+ }
|
||||
+}
|
||||
+
|
||||
+static void remap_range(JoystickGenericImpl *This, int obj, LPCDIPROPRANGE pr)
|
||||
+{
|
||||
+ ObjProps remap_props;
|
||||
+ remap_init(This, obj, &remap_props);
|
||||
+
|
||||
+ remap_props.lMin = pr->lMin;
|
||||
+ remap_props.lMax = pr->lMax;
|
||||
+
|
||||
+ remap_apply(This, obj, &remap_props);
|
||||
+
|
||||
+ /* Store new values */
|
||||
+ This->props[obj].lMin = pr->lMin;
|
||||
+ This->props[obj].lMax = pr->lMax;
|
||||
+}
|
||||
+
|
||||
+static void remap_deadzone(JoystickGenericImpl *This, int obj, LPCDIPROPDWORD pd)
|
||||
+{
|
||||
+ ObjProps remap_props;
|
||||
+ remap_init(This, obj, &remap_props);
|
||||
+
|
||||
+ remap_props.lDeadZone = pd->dwData;
|
||||
+
|
||||
+ remap_apply(This, obj, &remap_props);
|
||||
+
|
||||
+ /* Store new value */
|
||||
+ This->props[obj].lDeadZone = pd->dwData;
|
||||
+}
|
||||
+
|
||||
+static void remap_saturation(JoystickGenericImpl *This, int obj, LPCDIPROPDWORD pd)
|
||||
+{
|
||||
+ ObjProps remap_props;
|
||||
+ remap_init(This, obj, &remap_props);
|
||||
+
|
||||
+ remap_props.lSaturation = pd->dwData;
|
||||
+
|
||||
+ remap_apply(This, obj, &remap_props);
|
||||
+
|
||||
+ /* Store new value */
|
||||
+ This->props[obj].lSaturation = pd->dwData;
|
||||
+}
|
||||
+
|
||||
/******************************************************************************
|
||||
* SetProperty : change input device properties
|
||||
*/
|
||||
@@ -319,7 +389,6 @@ HRESULT WINAPI JoystickWGenericImpl_SetProperty(LPDIRECTINPUTDEVICE8W iface, REF
|
||||
{
|
||||
JoystickGenericImpl *This = impl_from_IDirectInputDevice8W(iface);
|
||||
DWORD i;
|
||||
- ObjProps remap_props;
|
||||
|
||||
TRACE("(%p,%s,%p)\n",This,debugstr_guid(rguid),ph);
|
||||
|
||||
@@ -336,69 +405,15 @@ HRESULT WINAPI JoystickWGenericImpl_SetProperty(LPDIRECTINPUTDEVICE8W iface, REF
|
||||
case (DWORD_PTR)DIPROP_RANGE: {
|
||||
LPCDIPROPRANGE pr = (LPCDIPROPRANGE)ph;
|
||||
if (ph->dwHow == DIPH_DEVICE) {
|
||||
-
|
||||
- /* Many games poll the joystick immediately after setting the range
|
||||
- * for calibration purposes, so the old values need to be remapped
|
||||
- * to the new range before it does so */
|
||||
-
|
||||
TRACE("proprange(%d,%d) all\n", pr->lMin, pr->lMax);
|
||||
- for (i = 0; i < This->base.data_format.wine_df->dwNumObjs; i++) {
|
||||
-
|
||||
- remap_props.lDevMin = This->props[i].lMin;
|
||||
- remap_props.lDevMax = This->props[i].lMax;
|
||||
-
|
||||
- remap_props.lDeadZone = This->props[i].lDeadZone;
|
||||
- remap_props.lSaturation = This->props[i].lSaturation;
|
||||
-
|
||||
- remap_props.lMin = pr->lMin;
|
||||
- remap_props.lMax = pr->lMax;
|
||||
-
|
||||
- switch (This->base.data_format.wine_df->rgodf[i].dwOfs) {
|
||||
- case DIJOFS_X : This->js.lX = joystick_map_axis(&remap_props, This->js.lX); break;
|
||||
- case DIJOFS_Y : This->js.lY = joystick_map_axis(&remap_props, This->js.lY); break;
|
||||
- case DIJOFS_Z : This->js.lZ = joystick_map_axis(&remap_props, This->js.lZ); break;
|
||||
- case DIJOFS_RX : This->js.lRx = joystick_map_axis(&remap_props, This->js.lRx); break;
|
||||
- case DIJOFS_RY : This->js.lRy = joystick_map_axis(&remap_props, This->js.lRy); break;
|
||||
- case DIJOFS_RZ : This->js.lRz = joystick_map_axis(&remap_props, This->js.lRz); break;
|
||||
- case DIJOFS_SLIDER(0): This->js.rglSlider[0] = joystick_map_axis(&remap_props, This->js.rglSlider[0]); break;
|
||||
- case DIJOFS_SLIDER(1): This->js.rglSlider[1] = joystick_map_axis(&remap_props, This->js.rglSlider[1]); break;
|
||||
- default: break;
|
||||
- }
|
||||
-
|
||||
- This->props[i].lMin = pr->lMin;
|
||||
- This->props[i].lMax = pr->lMax;
|
||||
- }
|
||||
+ for (i = 0; i < This->base.data_format.wine_df->dwNumObjs; i++)
|
||||
+ remap_range(This, i, pr);
|
||||
} else {
|
||||
int obj = find_property(&This->base.data_format, ph);
|
||||
|
||||
TRACE("proprange(%d,%d) obj=%d\n", pr->lMin, pr->lMax, obj);
|
||||
- if (obj >= 0) {
|
||||
-
|
||||
- remap_props.lDevMin = This->props[obj].lMin;
|
||||
- remap_props.lDevMax = This->props[obj].lMax;
|
||||
-
|
||||
- remap_props.lDeadZone = This->props[obj].lDeadZone;
|
||||
- remap_props.lSaturation = This->props[obj].lSaturation;
|
||||
-
|
||||
- remap_props.lMin = pr->lMin;
|
||||
- remap_props.lMax = pr->lMax;
|
||||
-
|
||||
- switch (This->base.data_format.wine_df->rgodf[obj].dwOfs) {
|
||||
- case DIJOFS_X : This->js.lX = joystick_map_axis(&remap_props, This->js.lX); break;
|
||||
- case DIJOFS_Y : This->js.lY = joystick_map_axis(&remap_props, This->js.lY); break;
|
||||
- case DIJOFS_Z : This->js.lZ = joystick_map_axis(&remap_props, This->js.lZ); break;
|
||||
- case DIJOFS_RX : This->js.lRx = joystick_map_axis(&remap_props, This->js.lRx); break;
|
||||
- case DIJOFS_RY : This->js.lRy = joystick_map_axis(&remap_props, This->js.lRy); break;
|
||||
- case DIJOFS_RZ : This->js.lRz = joystick_map_axis(&remap_props, This->js.lRz); break;
|
||||
- case DIJOFS_SLIDER(0): This->js.rglSlider[0] = joystick_map_axis(&remap_props, This->js.rglSlider[0]); break;
|
||||
- case DIJOFS_SLIDER(1): This->js.rglSlider[1] = joystick_map_axis(&remap_props, This->js.rglSlider[1]); break;
|
||||
- default: break;
|
||||
- }
|
||||
-
|
||||
- This->props[obj].lMin = pr->lMin;
|
||||
- This->props[obj].lMax = pr->lMax;
|
||||
- return DI_OK;
|
||||
- }
|
||||
+ if (obj >= 0)
|
||||
+ remap_range(This, obj, pr);
|
||||
}
|
||||
break;
|
||||
}
|
||||
@@ -407,15 +422,13 @@ HRESULT WINAPI JoystickWGenericImpl_SetProperty(LPDIRECTINPUTDEVICE8W iface, REF
|
||||
if (ph->dwHow == DIPH_DEVICE) {
|
||||
TRACE("deadzone(%d) all\n", pd->dwData);
|
||||
for (i = 0; i < This->base.data_format.wine_df->dwNumObjs; i++)
|
||||
- This->props[i].lDeadZone = pd->dwData;
|
||||
+ remap_deadzone(This, i, pd);
|
||||
} else {
|
||||
int obj = find_property(&This->base.data_format, ph);
|
||||
|
||||
TRACE("deadzone(%d) obj=%d\n", pd->dwData, obj);
|
||||
- if (obj >= 0) {
|
||||
- This->props[obj].lDeadZone = pd->dwData;
|
||||
- return DI_OK;
|
||||
- }
|
||||
+ if (obj >= 0)
|
||||
+ remap_deadzone(This, obj, pd);
|
||||
}
|
||||
break;
|
||||
}
|
||||
@@ -424,15 +437,13 @@ HRESULT WINAPI JoystickWGenericImpl_SetProperty(LPDIRECTINPUTDEVICE8W iface, REF
|
||||
if (ph->dwHow == DIPH_DEVICE) {
|
||||
TRACE("saturation(%d) all\n", pd->dwData);
|
||||
for (i = 0; i < This->base.data_format.wine_df->dwNumObjs; i++)
|
||||
- This->props[i].lSaturation = pd->dwData;
|
||||
+ remap_saturation(This, i, pd);
|
||||
} else {
|
||||
int obj = find_property(&This->base.data_format, ph);
|
||||
|
||||
TRACE("saturation(%d) obj=%d\n", pd->dwData, obj);
|
||||
- if (obj >= 0) {
|
||||
- This->props[obj].lSaturation = pd->dwData;
|
||||
- return DI_OK;
|
||||
- }
|
||||
+ if (obj >= 0)
|
||||
+ remap_saturation(This, obj, pd);
|
||||
}
|
||||
break;
|
||||
}
|
||||
--
|
||||
2.17.1
|
||||
|
@@ -1 +0,0 @@
|
||||
Fixes: [41317] dinput: Recalculated Axis after deadzone change.
|
@@ -1,45 +1,33 @@
|
||||
From 2ff7da682aa87e09966fa0fb7c8846cd82bd1eea Mon Sep 17 00:00:00 2001
|
||||
From ef0da9342b0ced44da1ed8532941d53f48ead602 Mon Sep 17 00:00:00 2001
|
||||
From: Jetro Jormalainen <jje-wine@jv.jetro.fi>
|
||||
Date: Tue, 30 Apr 2019 09:20:54 +1000
|
||||
Subject: [PATCH] dinput: Allow empty Joystick mappings.
|
||||
|
||||
---
|
||||
dlls/dinput/device.c | 82 ++++++++++++++++++++++++++++++-------
|
||||
dlls/dinput/joystick.c | 2 +-
|
||||
dlls/dinput8/tests/device.c | 50 ++++++++++++++++++++++
|
||||
3 files changed, 119 insertions(+), 15 deletions(-)
|
||||
dlls/dinput/device.c | 77 ++++++++++++++++++++++++++++++-------
|
||||
dlls/dinput8/tests/device.c | 50 ++++++++++++++++++++++++
|
||||
2 files changed, 113 insertions(+), 14 deletions(-)
|
||||
|
||||
diff --git a/dlls/dinput/device.c b/dlls/dinput/device.c
|
||||
index e99d14b4cff..540034de1e9 100644
|
||||
index b423337c9ce..c9466655ce4 100644
|
||||
--- a/dlls/dinput/device.c
|
||||
+++ b/dlls/dinput/device.c
|
||||
@@ -30,6 +30,7 @@
|
||||
#include <string.h>
|
||||
#include "wine/debug.h"
|
||||
#include "wine/unicode.h"
|
||||
+#include "wine/heap.h"
|
||||
#include "windef.h"
|
||||
#include "winbase.h"
|
||||
#include "winreg.h"
|
||||
@@ -655,12 +656,29 @@ static DWORD semantic_to_obj_id(IDirectInputDeviceImpl* This, DWORD dwSemantic)
|
||||
return type | (0x0000ff00 & (obj_instance << 8));
|
||||
@@ -356,12 +356,26 @@ static DWORD semantic_to_obj_id( struct dinput_device *This, DWORD dwSemantic )
|
||||
return type | (0x0000ff00 & (instance << 8));
|
||||
}
|
||||
|
||||
+static void del_mapping_key(const WCHAR *device, const WCHAR *username, const WCHAR *guid) {
|
||||
+ static const WCHAR subkey[] = {
|
||||
+ 'S','o','f','t','w','a','r','e','\\',
|
||||
+ 'W','i','n','e','\\',
|
||||
+ 'D','i','r','e','c','t','I','n','p','u','t','\\',
|
||||
+ 'M','a','p','p','i','n','g','s','\\','%','s','\\','%','s','\\','%','s','\0'};
|
||||
+ static const WCHAR subkey[] = L"Software\\Wine\\DirectInput\\Mappings\\%s\\%s\\%s";
|
||||
+ DWORD len = wcslen(subkey) + wcslen(username) + wcslen(device) + wcslen(guid);
|
||||
+ WCHAR *keyname;
|
||||
+
|
||||
+ keyname = heap_alloc(sizeof(WCHAR) * (lstrlenW(subkey) + strlenW(username) + strlenW(device) + strlenW(guid)));
|
||||
+ sprintfW(keyname, subkey, username, device, guid);
|
||||
+ keyname = malloc(len * sizeof(WCHAR));
|
||||
+ swprintf(keyname, len, subkey, username, device, guid);
|
||||
+
|
||||
+ /* Remove old key mappings so there will be no overlapping mappings */
|
||||
+ RegDeleteKeyW(HKEY_CURRENT_USER, keyname);
|
||||
+
|
||||
+ heap_free(keyname);
|
||||
+ free(keyname);
|
||||
+}
|
||||
+
|
||||
/*
|
||||
@@ -50,10 +38,10 @@ index e99d14b4cff..540034de1e9 100644
|
||||
-static HKEY get_mapping_key(const WCHAR *device, const WCHAR *username, const WCHAR *guid)
|
||||
+static HKEY get_mapping_key(const WCHAR *device, const WCHAR *username, const WCHAR *guid, BOOL create)
|
||||
{
|
||||
static const WCHAR subkey[] = {
|
||||
'S','o','f','t','w','a','r','e','\\',
|
||||
@@ -675,8 +693,11 @@ static HKEY get_mapping_key(const WCHAR *device, const WCHAR *username, const WC
|
||||
sprintfW(keyname, subkey, username, device, guid);
|
||||
static const WCHAR *subkey = L"Software\\Wine\\DirectInput\\Mappings\\%s\\%s\\%s";
|
||||
HKEY hkey;
|
||||
@@ -372,8 +386,11 @@ static HKEY get_mapping_key(const WCHAR *device, const WCHAR *username, const WC
|
||||
swprintf( keyname, len, subkey, username, device, guid );
|
||||
|
||||
/* The key used is HKCU\Software\Wine\DirectInput\Mappings\[username]\[device]\[mapping_guid] */
|
||||
- if (RegCreateKeyW(HKEY_CURRENT_USER, keyname, &hkey))
|
||||
@@ -64,9 +52,9 @@ index e99d14b4cff..540034de1e9 100644
|
||||
+ } else if (RegOpenKeyW(HKEY_CURRENT_USER, keyname, &hkey))
|
||||
+ hkey = 0;
|
||||
|
||||
HeapFree(GetProcessHeap(), 0, keyname);
|
||||
free( keyname );
|
||||
|
||||
@@ -696,7 +717,9 @@ static HRESULT save_mapping_settings(IDirectInputDevice8W *iface, LPDIACTIONFORM
|
||||
@@ -393,7 +410,9 @@ static HRESULT save_mapping_settings(IDirectInputDevice8W *iface, LPDIACTIONFORM
|
||||
if (StringFromCLSID(&lpdiaf->guidActionMap, &guid_str) != S_OK)
|
||||
return DI_SETTINGSNOTSAVED;
|
||||
|
||||
@@ -77,7 +65,7 @@ index e99d14b4cff..540034de1e9 100644
|
||||
|
||||
if (!hkey)
|
||||
{
|
||||
@@ -731,7 +754,7 @@ BOOL load_mapping_settings(IDirectInputDeviceImpl *This, LPDIACTIONFORMATW lpdia
|
||||
@@ -428,7 +447,7 @@ static BOOL load_mapping_settings( struct dinput_device *This, LPDIACTIONFORMATW
|
||||
HKEY hkey;
|
||||
WCHAR *guid_str;
|
||||
DIDEVICEINSTANCEW didev;
|
||||
@@ -86,7 +74,7 @@ index e99d14b4cff..540034de1e9 100644
|
||||
|
||||
didev.dwSize = sizeof(didev);
|
||||
IDirectInputDevice8_GetDeviceInfo(&This->IDirectInputDevice8W_iface, &didev);
|
||||
@@ -739,7 +762,7 @@ BOOL load_mapping_settings(IDirectInputDeviceImpl *This, LPDIACTIONFORMATW lpdia
|
||||
@@ -436,7 +455,7 @@ static BOOL load_mapping_settings( struct dinput_device *This, LPDIACTIONFORMATW
|
||||
if (StringFromCLSID(&lpdiaf->guidActionMap, &guid_str) != S_OK)
|
||||
return FALSE;
|
||||
|
||||
@@ -95,20 +83,19 @@ index e99d14b4cff..540034de1e9 100644
|
||||
|
||||
if (!hkey)
|
||||
{
|
||||
@@ -760,15 +783,21 @@ BOOL load_mapping_settings(IDirectInputDeviceImpl *This, LPDIACTIONFORMATW lpdia
|
||||
@@ -456,15 +475,20 @@ static BOOL load_mapping_settings( struct dinput_device *This, LPDIACTIONFORMATW
|
||||
{
|
||||
lpdiaf->rgoAction[i].dwObjID = id;
|
||||
lpdiaf->rgoAction[i].guidInstance = didev.guidInstance;
|
||||
- lpdiaf->rgoAction[i].dwHow = DIAH_DEFAULT;
|
||||
- mapped += 1;
|
||||
+ lpdiaf->rgoAction[i].dwHow = DIAH_USERCONFIG;
|
||||
}
|
||||
+ }
|
||||
+ else
|
||||
+ {
|
||||
+ memset(&lpdiaf->rgoAction[i].guidInstance, 0, sizeof(GUID));
|
||||
+ lpdiaf->rgoAction[i].dwHow = DIAH_UNMAPPED;
|
||||
+ }
|
||||
+
|
||||
}
|
||||
}
|
||||
|
||||
RegCloseKey(hkey);
|
||||
@@ -119,96 +106,83 @@ index e99d14b4cff..540034de1e9 100644
|
||||
+ return TRUE;
|
||||
}
|
||||
|
||||
static BOOL set_app_data(IDirectInputDeviceImpl *dev, int offset, UINT_PTR app_data)
|
||||
@@ -831,13 +860,18 @@ HRESULT _build_action_map(LPDIRECTINPUTDEVICE8W iface, LPDIACTIONFORMATW lpdiaf,
|
||||
load_success = load_mapping_settings(This, lpdiaf, username);
|
||||
static BOOL set_app_data( struct dinput_device *dev, int offset, UINT_PTR app_data )
|
||||
@@ -1607,13 +1631,18 @@ static HRESULT WINAPI dinput_device_BuildActionMap( IDirectInputDevice8W *iface,
|
||||
load_success = load_mapping_settings( impl, format, username_buf );
|
||||
}
|
||||
|
||||
- if (load_success) return DI_OK;
|
||||
+ if (load_success) {
|
||||
+ /* Update dwCRC to track if action format has changed */
|
||||
+ for (i=0; i < lpdiaf->dwNumActions; i++)
|
||||
+ for (i=0; i < format->dwNumActions; i++)
|
||||
+ {
|
||||
+ lpdiaf->dwCRC ^= (lpdiaf->rgoAction[i].dwObjID << i * 2) | (lpdiaf->rgoAction[i].dwObjID >> (sizeof(lpdiaf->dwCRC) * 8 - i * 2));
|
||||
+ lpdiaf->dwCRC ^= (lpdiaf->rgoAction[i].dwSemantic << (i * 2 + 5)) | (lpdiaf->rgoAction[i].dwSemantic >> (sizeof(lpdiaf->dwCRC) * 8 - (i * 2 + 5)));
|
||||
+ format->dwCRC ^= (format->rgoAction[i].dwObjID << i * 2) | (format->rgoAction[i].dwObjID >> (sizeof(format->dwCRC) * 8 - i * 2));
|
||||
+ format->dwCRC ^= (format->rgoAction[i].dwSemantic << (i * 2 + 5)) | (format->rgoAction[i].dwSemantic >> (sizeof(format->dwCRC) * 8 - (i * 2 + 5)));
|
||||
+ }
|
||||
+ return DI_OK;
|
||||
+ }
|
||||
|
||||
for (i=0; i < lpdiaf->dwNumActions; i++)
|
||||
for (i = 0; i < format->dwNumActions; i++)
|
||||
{
|
||||
- /* Don't touch a user configured action */
|
||||
- if (lpdiaf->rgoAction[i].dwHow == DIAH_USERCONFIG) continue;
|
||||
- if (format->rgoAction[i].dwHow == DIAH_USERCONFIG) continue;
|
||||
-
|
||||
if ((lpdiaf->rgoAction[i].dwSemantic & devMask) == devMask)
|
||||
genre = format->rgoAction[i].dwSemantic & DIGENRE_ANY;
|
||||
if (devMask == genre || (devMask == DIGENRE_ANY && genre != DIMOUSE_MASK && genre != DIKEYBOARD_MASK))
|
||||
{
|
||||
DWORD obj_id = semantic_to_obj_id(This, lpdiaf->rgoAction[i].dwSemantic);
|
||||
@@ -868,6 +902,14 @@ HRESULT _build_action_map(LPDIRECTINPUTDEVICE8W iface, LPDIACTIONFORMATW lpdiaf,
|
||||
@@ -1645,6 +1674,14 @@ static HRESULT WINAPI dinput_device_BuildActionMap( IDirectInputDevice8W *iface,
|
||||
}
|
||||
}
|
||||
|
||||
+ /* Update dwCRC to track if action format has changed */
|
||||
+ lpdiaf->dwCRC = 0;
|
||||
+ for (i=0; i < lpdiaf->dwNumActions; i++)
|
||||
+ format->dwCRC = 0;
|
||||
+ for (i=0; i < format->dwNumActions; i++)
|
||||
+ {
|
||||
+ lpdiaf->dwCRC ^= (lpdiaf->rgoAction[i].dwObjID << i * 2) | (lpdiaf->rgoAction[i].dwObjID >> (sizeof(lpdiaf->dwCRC) * 8 - i * 2));
|
||||
+ lpdiaf->dwCRC ^= (lpdiaf->rgoAction[i].dwSemantic << (i * 2 + 5)) | (lpdiaf->rgoAction[i].dwSemantic >> (sizeof(lpdiaf->dwCRC) * 8 - (i * 2 + 5)));
|
||||
+ format->dwCRC ^= (format->rgoAction[i].dwObjID << i * 2) | (format->rgoAction[i].dwObjID >> (sizeof(format->dwCRC) * 8 - i * 2));
|
||||
+ format->dwCRC ^= (format->rgoAction[i].dwSemantic << (i * 2 + 5)) | (format->rgoAction[i].dwSemantic >> (sizeof(format->dwCRC) * 8 - (i * 2 + 5)));
|
||||
+ }
|
||||
+
|
||||
if (!has_actions) return DI_NOEFFECT;
|
||||
|
||||
return IDirectInputDevice8WImpl_BuildActionMap(iface, lpdiaf, lpszUserName, dwFlags);
|
||||
@@ -883,6 +925,7 @@ HRESULT _set_action_map(LPDIRECTINPUTDEVICE8W iface, LPDIACTIONFORMATW lpdiaf, L
|
||||
if (flags & (DIDBAM_DEFAULT|DIDBAM_PRESERVE|DIDBAM_INITIALIZE|DIDBAM_HWDEFAULTS))
|
||||
FIXME("Unimplemented flags %#x\n", flags);
|
||||
@@ -1662,6 +1699,7 @@ static HRESULT WINAPI dinput_device_SetActionMap( IDirectInputDevice8W *iface, D
|
||||
DIPROPSTRING dps;
|
||||
WCHAR username[MAX_PATH];
|
||||
DWORD username_size = MAX_PATH;
|
||||
WCHAR username_buf[MAX_PATH];
|
||||
DWORD username_len = MAX_PATH;
|
||||
+ DWORD new_crc = 0;
|
||||
int i, action = 0, num_actions = 0;
|
||||
unsigned int offset = 0;
|
||||
ActionMap *action_map;
|
||||
@@ -894,12 +937,23 @@ HRESULT _set_action_map(LPDIRECTINPUTDEVICE8W iface, LPDIACTIONFORMATW lpdiaf, L
|
||||
const DIDATAFORMAT *df;
|
||||
@@ -1694,12 +1732,23 @@ static HRESULT WINAPI dinput_device_SetActionMap( IDirectInputDevice8W *iface, D
|
||||
data_format.dwFlags = DIDF_RELAXIS;
|
||||
data_format.dwDataSize = lpdiaf->dwDataSize;
|
||||
data_format.dwDataSize = format->dwDataSize;
|
||||
|
||||
+ /* Calculate checksum for actionformat */
|
||||
+ for (i=0; i < lpdiaf->dwNumActions; i++)
|
||||
+ for (i=0; i < format->dwNumActions; i++)
|
||||
+ {
|
||||
+ new_crc ^= (lpdiaf->rgoAction[i].dwObjID << i * 2) | (lpdiaf->rgoAction[i].dwObjID >> (sizeof(lpdiaf->dwCRC) * 8 - i * 2));
|
||||
+ new_crc ^= (lpdiaf->rgoAction[i].dwSemantic << (i * 2 + 5)) | (lpdiaf->rgoAction[i].dwSemantic >> (sizeof(lpdiaf->dwCRC) * 8 - (i * 2 + 5)));
|
||||
+ new_crc ^= (format->rgoAction[i].dwObjID << i * 2) | (format->rgoAction[i].dwObjID >> (sizeof(format->dwCRC) * 8 - i * 2));
|
||||
+ new_crc ^= (format->rgoAction[i].dwSemantic << (i * 2 + 5)) | (format->rgoAction[i].dwSemantic >> (sizeof(format->dwCRC) * 8 - (i * 2 + 5)));
|
||||
+ }
|
||||
+
|
||||
/* Count the actions */
|
||||
for (i=0; i < lpdiaf->dwNumActions; i++)
|
||||
if (IsEqualGUID(&This->guid, &lpdiaf->rgoAction[i].guidInstance))
|
||||
for (i = 0; i < format->dwNumActions; i++)
|
||||
if (IsEqualGUID( &impl->guid, &format->rgoAction[i].guidInstance ))
|
||||
num_actions++;
|
||||
|
||||
- if (num_actions == 0) return DI_NOEFFECT;
|
||||
+ /* Should return DI_NOEFFECT if we dont have any actions and actionformat has not changed */
|
||||
+ if (num_actions == 0 && lpdiaf->dwCRC == new_crc && !(dwFlags & DIDSAM_FORCESAVE)) return DI_NOEFFECT;
|
||||
+ if (num_actions == 0 && format->dwCRC == new_crc && !(flags & DIDSAM_FORCESAVE)) return DI_NOEFFECT;
|
||||
+
|
||||
+ /* update dwCRC to track if action format has changed */
|
||||
+ lpdiaf->dwCRC = new_crc;
|
||||
+ format->dwCRC = new_crc;
|
||||
|
||||
/* Construct the dataformat and actionmap */
|
||||
obj_df = HeapAlloc(GetProcessHeap(), 0, sizeof(DIOBJECTDATAFORMAT)*num_actions);
|
||||
diff --git a/dlls/dinput/joystick.c b/dlls/dinput/joystick.c
|
||||
index 0cddfbc634b..93211ea13a6 100644
|
||||
--- a/dlls/dinput/joystick.c
|
||||
+++ b/dlls/dinput/joystick.c
|
||||
@@ -749,7 +749,7 @@ HRESULT WINAPI JoystickWGenericImpl_BuildActionMap(LPDIRECTINPUTDEVICE8W iface,
|
||||
else
|
||||
lstrcpynW(username, lpszUserName, size);
|
||||
|
||||
- load_success = load_mapping_settings((IDirectInputDeviceImpl *) This, lpdiaf, username);
|
||||
+ load_success = load_mapping_settings(&This->base, lpdiaf, username);
|
||||
heap_free(username);
|
||||
}
|
||||
|
||||
obj_df = malloc( sizeof(DIOBJECTDATAFORMAT) * num_actions );
|
||||
diff --git a/dlls/dinput8/tests/device.c b/dlls/dinput8/tests/device.c
|
||||
index 17deed193dd..3bfb34eb2ca 100644
|
||||
index 5ae9e225dc9..d3e86c68176 100644
|
||||
--- a/dlls/dinput8/tests/device.c
|
||||
+++ b/dlls/dinput8/tests/device.c
|
||||
@@ -38,6 +38,8 @@ struct enum_data {
|
||||
@@ -48,6 +48,8 @@ struct enum_data {
|
||||
/* Dummy GUID */
|
||||
static const GUID ACTION_MAPPING_GUID = { 0x1, 0x2, 0x3, { 0x4, 0x5, 0x6, 0x7, 0x8, 0x9, 0xa, 0xb } };
|
||||
|
||||
@@ -217,7 +191,7 @@ index 17deed193dd..3bfb34eb2ca 100644
|
||||
enum {
|
||||
DITEST_AXIS,
|
||||
DITEST_BUTTON,
|
||||
@@ -429,6 +431,17 @@ static void test_action_mapping(void)
|
||||
@@ -472,6 +474,17 @@ static void test_action_mapping(void)
|
||||
hr = IDirectInputDevice8_SetActionMap(data.keyboard, data.lpdiaf, NULL, 0);
|
||||
ok (hr == DI_NOEFFECT, "SetActionMap should have no effect with no actions to map hr=%08x\n", hr);
|
||||
|
||||
@@ -235,7 +209,7 @@ index 17deed193dd..3bfb34eb2ca 100644
|
||||
af.dwDataSize = 4 * ARRAY_SIZE(actionMapping);
|
||||
af.dwNumActions = ARRAY_SIZE(actionMapping);
|
||||
|
||||
@@ -620,6 +633,43 @@ static void test_save_settings(void)
|
||||
@@ -663,6 +676,43 @@ static void test_save_settings(void)
|
||||
"Mapped incorrectly expected: 0x%08x got: 0x%08x\n", other_results[1], af.rgoAction[1].dwObjID);
|
||||
ok (IsEqualGUID(&GUID_SysKeyboard, &af.rgoAction[1].guidInstance), "Action should be mapped to keyboard\n");
|
||||
|
||||
@@ -280,5 +254,5 @@ index 17deed193dd..3bfb34eb2ca 100644
|
||||
IDirectInput_Release(pDI);
|
||||
}
|
||||
--
|
||||
2.30.2
|
||||
2.33.0
|
||||
|
@@ -1,88 +0,0 @@
|
||||
From 290d6b2b773e9729c38495ec8c1291b40678bc31 Mon Sep 17 00:00:00 2001
|
||||
From: Jetro Jormalainen <jje-wine@jv.jetro.fi>
|
||||
Date: Tue, 30 Apr 2019 09:20:20 +1000
|
||||
Subject: [PATCH 1/3] dinput: Load users Joystick mappings.
|
||||
|
||||
---
|
||||
dlls/dinput/device.c | 2 +-
|
||||
dlls/dinput/device_private.h | 2 ++
|
||||
dlls/dinput/joystick.c | 25 +++++++++++++++++++++++++
|
||||
3 files changed, 28 insertions(+), 1 deletion(-)
|
||||
|
||||
diff --git a/dlls/dinput/device.c b/dlls/dinput/device.c
|
||||
index 28329d03b5..d1bf934a82 100644
|
||||
--- a/dlls/dinput/device.c
|
||||
+++ b/dlls/dinput/device.c
|
||||
@@ -714,7 +714,7 @@ static HRESULT save_mapping_settings(IDirectInputDevice8W *iface, LPDIACTIONFORM
|
||||
return DI_OK;
|
||||
}
|
||||
|
||||
-static BOOL load_mapping_settings(IDirectInputDeviceImpl *This, LPDIACTIONFORMATW lpdiaf, const WCHAR *username)
|
||||
+BOOL load_mapping_settings(IDirectInputDeviceImpl *This, LPDIACTIONFORMATW lpdiaf, const WCHAR *username)
|
||||
{
|
||||
HKEY hkey;
|
||||
WCHAR *guid_str;
|
||||
diff --git a/dlls/dinput/device_private.h b/dlls/dinput/device_private.h
|
||||
index 27e9c26286..ea794d7396 100644
|
||||
--- a/dlls/dinput/device_private.h
|
||||
+++ b/dlls/dinput/device_private.h
|
||||
@@ -125,6 +125,8 @@ extern const char *_dump_dinput_GUID(const GUID *guid) DECLSPEC_HIDDEN;
|
||||
|
||||
extern LPDIOBJECTDATAFORMAT dataformat_to_odf_by_type(LPCDIDATAFORMAT df, int n, DWORD type) DECLSPEC_HIDDEN;
|
||||
|
||||
+extern BOOL load_mapping_settings(IDirectInputDeviceImpl *This, LPDIACTIONFORMATW lpdiaf, const WCHAR *username) DECLSPEC_HIDDEN;
|
||||
+
|
||||
extern HRESULT _build_action_map(LPDIRECTINPUTDEVICE8W iface, LPDIACTIONFORMATW lpdiaf, LPCWSTR lpszUserName, DWORD dwFlags, DWORD devMask, LPCDIDATAFORMAT df) DECLSPEC_HIDDEN;
|
||||
extern HRESULT _set_action_map(LPDIRECTINPUTDEVICE8W iface, LPDIACTIONFORMATW lpdiaf, LPCWSTR lpszUserName, DWORD dwFlags, LPCDIDATAFORMAT df) DECLSPEC_HIDDEN;
|
||||
|
||||
diff --git a/dlls/dinput/joystick.c b/dlls/dinput/joystick.c
|
||||
index 2220b5d576..8341e0313a 100644
|
||||
--- a/dlls/dinput/joystick.c
|
||||
+++ b/dlls/dinput/joystick.c
|
||||
@@ -28,8 +28,10 @@
|
||||
|
||||
#include <stdio.h>
|
||||
|
||||
+#include "device_private.h"
|
||||
#include "joystick_private.h"
|
||||
#include "wine/debug.h"
|
||||
+#include "wine/heap.h"
|
||||
#include "winreg.h"
|
||||
|
||||
WINE_DEFAULT_DEBUG_CHANNEL(dinput);
|
||||
@@ -825,9 +827,32 @@ HRESULT WINAPI JoystickWGenericImpl_BuildActionMap(LPDIRECTINPUTDEVICE8W iface,
|
||||
JoystickGenericImpl *This = impl_from_IDirectInputDevice8W(iface);
|
||||
unsigned int i, j;
|
||||
BOOL has_actions = FALSE;
|
||||
+ WCHAR *username;
|
||||
+ DWORD size;
|
||||
+ BOOL load_success = FALSE;
|
||||
|
||||
FIXME("(%p)->(%p,%s,%08x): semi-stub !\n", This, lpdiaf, debugstr_w(lpszUserName), dwFlags);
|
||||
|
||||
+ /* Unless asked the contrary by these flags, try to load a previous mapping */
|
||||
+ if (!(dwFlags & DIDBAM_HWDEFAULTS))
|
||||
+ {
|
||||
+ if (!lpszUserName)
|
||||
+ GetUserNameW(NULL, &size);
|
||||
+ else
|
||||
+ size = lstrlenW(lpszUserName) + 1;
|
||||
+
|
||||
+ username = heap_alloc(size * sizeof(WCHAR));
|
||||
+ if (!lpszUserName)
|
||||
+ GetUserNameW(username, &size);
|
||||
+ else
|
||||
+ lstrcpynW(username, lpszUserName, size);
|
||||
+
|
||||
+ load_success = load_mapping_settings((IDirectInputDeviceImpl *) This, lpdiaf, username);
|
||||
+ heap_free(username);
|
||||
+ }
|
||||
+
|
||||
+ if (load_success) return DI_OK;
|
||||
+
|
||||
for (i=0; i < lpdiaf->dwNumActions; i++)
|
||||
{
|
||||
DWORD inst = (0x000000ff & (lpdiaf->rgoAction[i].dwSemantic)) - 1;
|
||||
--
|
||||
2.17.1
|
||||
|
@@ -1,77 +1,19 @@
|
||||
From c9ecf258a9186bb31a18f8a4728e20bb25b4e9cf Mon Sep 17 00:00:00 2001
|
||||
From 65e22e69bd660ff20cac0a83e3c1feb966a49646 Mon Sep 17 00:00:00 2001
|
||||
From: Jetro Jormalainen <jje-wine@jv.jetro.fi>
|
||||
Date: Tue, 30 Apr 2019 09:21:24 +1000
|
||||
Subject: [PATCH] dinput: Support username in Config dialog.
|
||||
|
||||
---
|
||||
dlls/dinput/ansi.c | 26 +++++
|
||||
dlls/dinput/config.c | 187 ++++++++++++++++++++++++-----------
|
||||
dlls/dinput/config.c | 184 ++++++++++++++++++++++++-----------
|
||||
dlls/dinput/device.c | 2 +-
|
||||
dlls/dinput/device_private.h | 1 +
|
||||
dlls/dinput/dinput_main.c | 1 +
|
||||
5 files changed, 160 insertions(+), 57 deletions(-)
|
||||
dlls/dinput/dinput_private.h | 1 +
|
||||
3 files changed, 130 insertions(+), 57 deletions(-)
|
||||
|
||||
diff --git a/dlls/dinput/ansi.c b/dlls/dinput/ansi.c
|
||||
index 431b812aeb2..270fe6f1498 100644
|
||||
--- a/dlls/dinput/ansi.c
|
||||
+++ b/dlls/dinput/ansi.c
|
||||
@@ -840,11 +840,37 @@ static HRESULT WINAPI dinput8_a_ConfigureDevices( IDirectInput8A *iface_a, LPDIC
|
||||
{
|
||||
hr = diactionformat_atow( format_a, &format_w, TRUE );
|
||||
params_w.lprgFormats = &format_w;
|
||||
+ params_w.dwcUsers = params_a->dwcUsers;
|
||||
+
|
||||
+ if (params_a->lptszUserNames) {
|
||||
+ char *start = params_a->lptszUserNames;
|
||||
+ WCHAR *to = NULL;
|
||||
+ int total_len = 0;
|
||||
+ for (i = 0; i < params_a->dwcUsers; i++)
|
||||
+ {
|
||||
+ char *end = start + 1;
|
||||
+ int len;
|
||||
+ while (*(end++));
|
||||
+ len = MultiByteToWideChar(CP_ACP, 0, start, end - start, NULL, 0);
|
||||
+ total_len += len + 2; /* length of string and two null char */
|
||||
+ if (to)
|
||||
+ to = HeapReAlloc(GetProcessHeap(), 0, to, sizeof(WCHAR) * total_len);
|
||||
+ else
|
||||
+ to = HeapAlloc(GetProcessHeap(), 0, sizeof(WCHAR) * total_len);
|
||||
+
|
||||
+ MultiByteToWideChar(CP_ACP, 0, start, end - start, to + (total_len - len - 2), len);
|
||||
+ to[total_len] = 0;
|
||||
+ to[total_len - 1] = 0;
|
||||
+ }
|
||||
+ params_w.lptszUserNames = to;
|
||||
+ }
|
||||
|
||||
if (SUCCEEDED(hr)) hr = IDirectInput8_ConfigureDevices( iface_w, callback, ¶ms_w, flags, ref );
|
||||
|
||||
if (!format_w.hInstString) for (i = 0; i < format_w.dwNumActions; ++i) HeapFree( GetProcessHeap(), 0, (void *)format_w.rgoAction[i].lptszActionName );
|
||||
HeapFree( GetProcessHeap(), 0, format_w.rgoAction );
|
||||
+ HeapFree( GetProcessHeap(), 0, params_w.lptszUserNames);
|
||||
+
|
||||
}
|
||||
|
||||
HeapFree( GetProcessHeap(), 0, params_w.lptszUserNames );
|
||||
diff --git a/dlls/dinput/config.c b/dlls/dinput/config.c
|
||||
index bf448985893..c7a33d2da02 100644
|
||||
index 8cc73c80242..bb0b2c03c47 100644
|
||||
--- a/dlls/dinput/config.c
|
||||
+++ b/dlls/dinput/config.c
|
||||
@@ -18,17 +18,23 @@
|
||||
|
||||
#define NONAMELESSUNION
|
||||
|
||||
+
|
||||
#include "wine/unicode.h"
|
||||
#include "objbase.h"
|
||||
#include "dinput_private.h"
|
||||
#include "device_private.h"
|
||||
#include "resource.h"
|
||||
|
||||
+#include "wine/heap.h"
|
||||
+
|
||||
typedef struct {
|
||||
int nobjects;
|
||||
@@ -29,6 +29,9 @@ typedef struct {
|
||||
IDirectInputDevice8W *lpdid;
|
||||
DIDEVICEINSTANCEW ddi;
|
||||
DIDEVICEOBJECTINSTANCEW ddo[256];
|
||||
@@ -81,7 +23,7 @@ index bf448985893..c7a33d2da02 100644
|
||||
} DeviceData;
|
||||
|
||||
typedef struct {
|
||||
@@ -38,10 +44,11 @@ typedef struct {
|
||||
@@ -38,10 +41,11 @@ typedef struct {
|
||||
|
||||
typedef struct {
|
||||
IDirectInput8W *lpDI;
|
||||
@@ -94,7 +36,7 @@ index bf448985893..c7a33d2da02 100644
|
||||
} ConfigureDevicesData;
|
||||
|
||||
/*
|
||||
@@ -57,27 +64,42 @@ static BOOL CALLBACK collect_objects(LPCDIDEVICEOBJECTINSTANCEW lpddo, LPVOID pv
|
||||
@@ -57,27 +61,42 @@ static BOOL CALLBACK collect_objects(LPCDIDEVICEOBJECTINSTANCEW lpddo, LPVOID pv
|
||||
return DIENUM_CONTINUE;
|
||||
}
|
||||
|
||||
@@ -117,7 +59,7 @@ index bf448985893..c7a33d2da02 100644
|
||||
- DeviceData *device = &data->devices[data->ndevices];
|
||||
+ /* alloc array for devices if this is our first device */
|
||||
+ if (!data->devices_data.ndevices)
|
||||
+ data->devices_data.devices = HeapAlloc(GetProcessHeap(), 0, sizeof(DeviceData) * (dwRemaining + 1));
|
||||
+ data->devices_data.devices = malloc(sizeof(DeviceData) * (dwRemaining + 1));
|
||||
+ device = &data->devices_data.devices[data->devices_data.ndevices];
|
||||
device->lpdid = lpdid;
|
||||
device->ddi = *lpddi;
|
||||
@@ -128,14 +70,14 @@ index bf448985893..c7a33d2da02 100644
|
||||
IDirectInputDevice_EnumObjects(lpdid, collect_objects, (LPVOID) device, DIDFT_ALL);
|
||||
|
||||
- data->ndevices++;
|
||||
+ device->user_afs = heap_alloc(sizeof(*device->user_afs) * data->nusernames);
|
||||
+ device->user_afs = malloc(sizeof(*device->user_afs) * data->nusernames);
|
||||
+ memset(device->user_afs, 0, sizeof(*device->user_afs) * data->nusernames);
|
||||
+ for (i = 0; i < data->nusernames; i++)
|
||||
+ {
|
||||
+ DIACTIONFORMATW *user_af = &device->user_afs[i];
|
||||
+ user_af->dwNumActions = data->original_lpdiaf->dwNumActions;
|
||||
+ user_af->guidActionMap = data->original_lpdiaf->guidActionMap;
|
||||
+ user_af->rgoAction = heap_alloc(sizeof(DIACTIONW) * data->original_lpdiaf->dwNumActions);
|
||||
+ user_af->rgoAction = malloc(sizeof(DIACTIONW) * data->original_lpdiaf->dwNumActions);
|
||||
+ memset(user_af->rgoAction, 0, sizeof(DIACTIONW) * data->original_lpdiaf->dwNumActions);
|
||||
+ for (j = 0; j < user_af->dwNumActions; j++)
|
||||
+ {
|
||||
@@ -149,7 +91,7 @@ index bf448985893..c7a33d2da02 100644
|
||||
return DIENUM_CONTINUE;
|
||||
}
|
||||
|
||||
@@ -170,10 +192,18 @@ static DeviceData* get_cur_device(HWND dialog)
|
||||
@@ -169,10 +188,18 @@ static DeviceData* get_cur_device(HWND dialog)
|
||||
return &data->devices_data.devices[sel];
|
||||
}
|
||||
|
||||
@@ -170,7 +112,7 @@ index bf448985893..c7a33d2da02 100644
|
||||
}
|
||||
|
||||
static int dialog_display_only(HWND dialog)
|
||||
@@ -182,40 +212,36 @@ static int dialog_display_only(HWND dialog)
|
||||
@@ -181,40 +208,36 @@ static int dialog_display_only(HWND dialog)
|
||||
return data->display_only;
|
||||
}
|
||||
|
||||
@@ -184,7 +126,7 @@ index bf448985893..c7a33d2da02 100644
|
||||
- IDirectInput8_EnumDevicesBySemantics(lpDI, NULL, lpdiaf, count_devices, (LPVOID) data, 0);
|
||||
-
|
||||
- /* Allocate devices */
|
||||
- data->devices = HeapAlloc(GetProcessHeap(), 0, sizeof(DeviceData) * data->ndevices);
|
||||
- data->devices = malloc( sizeof(DeviceData) * data->ndevices );
|
||||
-
|
||||
/* Collect and insert */
|
||||
- data->ndevices = 0;
|
||||
@@ -212,19 +154,19 @@ index bf448985893..c7a33d2da02 100644
|
||||
+ {
|
||||
IDirectInputDevice8_Release(devices_data->devices[i].lpdid);
|
||||
+ for (j=0; j < data->nusernames; j++)
|
||||
+ heap_free(devices_data->devices[i].user_afs[j].rgoAction);
|
||||
+ heap_free(devices_data->devices[i].user_afs);
|
||||
+ free(devices_data->devices[i].user_afs[j].rgoAction);
|
||||
+ free(devices_data->devices[i].user_afs);
|
||||
+ }
|
||||
|
||||
HeapFree(GetProcessHeap(), 0, devices_data->devices);
|
||||
free( devices_data->devices );
|
||||
-
|
||||
- /* Free the backup LPDIACTIONFORMATW */
|
||||
- HeapFree(GetProcessHeap(), 0, data->original_lpdiaf->rgoAction);
|
||||
- HeapFree(GetProcessHeap(), 0, data->original_lpdiaf);
|
||||
- free( data->original_lpdiaf->rgoAction );
|
||||
- free( data->original_lpdiaf );
|
||||
}
|
||||
|
||||
static void fill_device_object_list(HWND dialog)
|
||||
@@ -231,6 +257,7 @@ static void fill_device_object_list(HWND dialog)
|
||||
@@ -230,6 +253,7 @@ static void fill_device_object_list(HWND dialog)
|
||||
/* Add each object */
|
||||
for (i=0; i < device->nobjects; i++)
|
||||
{
|
||||
@@ -232,7 +174,7 @@ index bf448985893..c7a33d2da02 100644
|
||||
int action = -1;
|
||||
|
||||
item.mask = LVIF_TEXT | LVIF_PARAM;
|
||||
@@ -241,12 +268,20 @@ static void fill_device_object_list(HWND dialog)
|
||||
@@ -240,12 +264,20 @@ static void fill_device_object_list(HWND dialog)
|
||||
|
||||
/* Add the item */
|
||||
SendDlgItemMessageW(dialog, IDC_DEVICEOBJECTSLIST, LVM_INSERTITEMW, 0, (LPARAM) &item);
|
||||
@@ -255,7 +197,7 @@ index bf448985893..c7a33d2da02 100644
|
||||
{
|
||||
action = j;
|
||||
break;
|
||||
@@ -260,7 +295,7 @@ static void fill_device_object_list(HWND dialog)
|
||||
@@ -259,7 +291,7 @@ static void fill_device_object_list(HWND dialog)
|
||||
static void show_suitable_actions(HWND dialog)
|
||||
{
|
||||
DeviceData *device = get_cur_device(dialog);
|
||||
@@ -264,7 +206,7 @@ index bf448985893..c7a33d2da02 100644
|
||||
int i, added = 0;
|
||||
int obj = lv_get_cur_item(dialog);
|
||||
|
||||
@@ -329,24 +364,35 @@ static void assign_action(HWND dialog)
|
||||
@@ -328,24 +360,35 @@ static void assign_action(HWND dialog)
|
||||
lv_set_action(dialog, obj, action, lpdiaf);
|
||||
}
|
||||
|
||||
@@ -312,7 +254,7 @@ index bf448985893..c7a33d2da02 100644
|
||||
}
|
||||
|
||||
static INT_PTR CALLBACK ConfigureDevicesDlgProc(HWND dialog, UINT uMsg, WPARAM wParam, LPARAM lParam)
|
||||
@@ -358,21 +404,16 @@ static INT_PTR CALLBACK ConfigureDevicesDlgProc(HWND dialog, UINT uMsg, WPARAM w
|
||||
@@ -357,21 +400,16 @@ static INT_PTR CALLBACK ConfigureDevicesDlgProc(HWND dialog, UINT uMsg, WPARAM w
|
||||
ConfigureDevicesData *data = (ConfigureDevicesData*) lParam;
|
||||
|
||||
/* Initialize action format and enumerate devices */
|
||||
@@ -325,9 +267,9 @@ index bf448985893..c7a33d2da02 100644
|
||||
init_listview_columns(dialog);
|
||||
|
||||
- /* Create a backup action format for CANCEL and RESET operations */
|
||||
- data->original_lpdiaf = HeapAlloc(GetProcessHeap(), 0, sizeof(*data->original_lpdiaf));
|
||||
- data->original_lpdiaf = malloc( sizeof(*data->original_lpdiaf) );
|
||||
- data->original_lpdiaf->dwNumActions = data->lpdiaf->dwNumActions;
|
||||
- data->original_lpdiaf->rgoAction = HeapAlloc(GetProcessHeap(), 0, sizeof(DIACTIONW)*data->lpdiaf->dwNumActions);
|
||||
- data->original_lpdiaf->rgoAction = malloc( sizeof(DIACTIONW) * data->lpdiaf->dwNumActions );
|
||||
- copy_actions(data->original_lpdiaf, data->lpdiaf);
|
||||
-
|
||||
/* Select the first device and show its actions */
|
||||
@@ -336,7 +278,7 @@ index bf448985893..c7a33d2da02 100644
|
||||
fill_device_object_list(dialog);
|
||||
|
||||
ShowCursor(TRUE);
|
||||
@@ -414,6 +455,7 @@ static INT_PTR CALLBACK ConfigureDevicesDlgProc(HWND dialog, UINT uMsg, WPARAM w
|
||||
@@ -413,6 +451,7 @@ static INT_PTR CALLBACK ConfigureDevicesDlgProc(HWND dialog, UINT uMsg, WPARAM w
|
||||
break;
|
||||
|
||||
case IDC_CONTROLLERCOMBO:
|
||||
@@ -344,7 +286,7 @@ index bf448985893..c7a33d2da02 100644
|
||||
|
||||
switch (HIWORD(wParam))
|
||||
{
|
||||
@@ -424,12 +466,12 @@ static INT_PTR CALLBACK ConfigureDevicesDlgProc(HWND dialog, UINT uMsg, WPARAM w
|
||||
@@ -423,12 +462,12 @@ static INT_PTR CALLBACK ConfigureDevicesDlgProc(HWND dialog, UINT uMsg, WPARAM w
|
||||
break;
|
||||
|
||||
case IDOK:
|
||||
@@ -358,7 +300,7 @@ index bf448985893..c7a33d2da02 100644
|
||||
EndDialog(dialog, 0);
|
||||
destroy_data(dialog);
|
||||
break;
|
||||
@@ -452,15 +494,48 @@ HRESULT _configure_devices(IDirectInput8W *iface,
|
||||
@@ -451,15 +490,48 @@ HRESULT _configure_devices(IDirectInput8W *iface,
|
||||
LPVOID pvRefData
|
||||
)
|
||||
{
|
||||
@@ -375,16 +317,16 @@ index bf448985893..c7a33d2da02 100644
|
||||
+ {
|
||||
+ /* Get default user name */
|
||||
+ GetUserNameW(NULL, &size);
|
||||
+ username = heap_alloc(size * sizeof(WCHAR) );
|
||||
+ username = malloc(size * sizeof(WCHAR) );
|
||||
+ GetUserNameW(username, &size);
|
||||
+ data.nusernames = 1;
|
||||
+ data.usernames = heap_alloc(sizeof(WCHAR *));
|
||||
+ data.usernames = malloc(sizeof(WCHAR *));
|
||||
+ data.usernames[0] = username;
|
||||
+ }
|
||||
+ else
|
||||
+ {
|
||||
+ WCHAR *p = lpdiCDParams->lptszUserNames;
|
||||
+ data.usernames = heap_alloc(sizeof(WCHAR *) * data.nusernames);
|
||||
+ data.usernames = malloc(sizeof(WCHAR *) * data.nusernames);
|
||||
+ for (i = 0; i < data.nusernames; i++)
|
||||
+ {
|
||||
+ if (*p)
|
||||
@@ -403,16 +345,16 @@ index bf448985893..c7a33d2da02 100644
|
||||
DialogBoxParamW(DINPUT_instance, (const WCHAR *)MAKEINTRESOURCE(IDD_CONFIGUREDEVICES),
|
||||
lpdiCDParams->hwnd, ConfigureDevicesDlgProc, (LPARAM)&data);
|
||||
|
||||
+ heap_free(username);
|
||||
+ heap_free(data.usernames);
|
||||
+ free(username);
|
||||
+ free(data.usernames);
|
||||
+
|
||||
return DI_OK;
|
||||
}
|
||||
diff --git a/dlls/dinput/device.c b/dlls/dinput/device.c
|
||||
index 05a1dbbb2a1..daaaebdc0d0 100644
|
||||
index c9466655ce4..e826cc89c1e 100644
|
||||
--- a/dlls/dinput/device.c
|
||||
+++ b/dlls/dinput/device.c
|
||||
@@ -704,7 +704,7 @@ static HKEY get_mapping_key(const WCHAR *device, const WCHAR *username, const WC
|
||||
@@ -397,7 +397,7 @@ static HKEY get_mapping_key(const WCHAR *device, const WCHAR *username, const WC
|
||||
return hkey;
|
||||
}
|
||||
|
||||
@@ -421,30 +363,18 @@ index 05a1dbbb2a1..daaaebdc0d0 100644
|
||||
{
|
||||
WCHAR *guid_str = NULL;
|
||||
DIDEVICEINSTANCEW didev;
|
||||
diff --git a/dlls/dinput/device_private.h b/dlls/dinput/device_private.h
|
||||
index 8d3425483c2..a6f22b28bf3 100644
|
||||
--- a/dlls/dinput/device_private.h
|
||||
+++ b/dlls/dinput/device_private.h
|
||||
@@ -132,6 +132,7 @@ extern const char *_dump_dinput_GUID(const GUID *guid) DECLSPEC_HIDDEN;
|
||||
|
||||
extern LPDIOBJECTDATAFORMAT dataformat_to_odf_by_type(LPCDIDATAFORMAT df, int n, DWORD type) DECLSPEC_HIDDEN;
|
||||
diff --git a/dlls/dinput/dinput_private.h b/dlls/dinput/dinput_private.h
|
||||
index a9777dc8dbb..b90c0bc5200 100644
|
||||
--- a/dlls/dinput/dinput_private.h
|
||||
+++ b/dlls/dinput/dinput_private.h
|
||||
@@ -76,6 +76,7 @@ extern void check_dinput_hooks( IDirectInputDevice8W *iface, BOOL acquired ) DEC
|
||||
extern void check_dinput_events(void) DECLSPEC_HIDDEN;
|
||||
|
||||
extern HRESULT _configure_devices(IDirectInput8W *iface, LPDICONFIGUREDEVICESCALLBACK lpdiCallback, LPDICONFIGUREDEVICESPARAMSW lpdiCDParams, DWORD dwFlags, LPVOID pvRefData) DECLSPEC_HIDDEN;
|
||||
+extern HRESULT save_mapping_settings(IDirectInputDevice8W *iface, LPDIACTIONFORMATW lpdiaf, LPCWSTR lpszUsername) DECLSPEC_HIDDEN;
|
||||
extern BOOL load_mapping_settings(IDirectInputDeviceImpl *This, LPDIACTIONFORMATW lpdiaf, const WCHAR *username) DECLSPEC_HIDDEN;
|
||||
|
||||
extern HRESULT _build_action_map(LPDIRECTINPUTDEVICE8W iface, LPDIACTIONFORMATW lpdiaf, LPCWSTR lpszUserName, DWORD dwFlags, DWORD devMask, LPCDIDATAFORMAT df) DECLSPEC_HIDDEN;
|
||||
diff --git a/dlls/dinput/dinput_main.c b/dlls/dinput/dinput_main.c
|
||||
index 85de9f79b81..2f40bfbca96 100644
|
||||
--- a/dlls/dinput/dinput_main.c
|
||||
+++ b/dlls/dinput/dinput_main.c
|
||||
@@ -39,6 +39,7 @@
|
||||
#define NONAMELESSUNION
|
||||
|
||||
#include "wine/debug.h"
|
||||
+#include "wine/heap.h"
|
||||
#include "wine/unicode.h"
|
||||
#include "wine/asm.h"
|
||||
#include "windef.h"
|
||||
extern WCHAR* get_mapping_path(const WCHAR *device, const WCHAR *username) DECLSPEC_HIDDEN;
|
||||
extern DWORD get_device_type(DWORD version, BOOL is_joystick) DECLSPEC_HIDDEN;
|
||||
--
|
||||
2.30.2
|
||||
2.33.0
|
||||
|
@@ -1,4 +1,4 @@
|
||||
From 629a5f7eea3b17f56606d3b588a5fd96ded99fef Mon Sep 17 00:00:00 2001
|
||||
From 571d437192d553b7a8aac6908f10728cd4d1a257 Mon Sep 17 00:00:00 2001
|
||||
From: Alistair Leslie-Hughes <leslie_alistair@hotmail.com>
|
||||
Date: Fri, 4 Oct 2019 16:24:06 +1000
|
||||
Subject: [PATCH] dinput: Dont allow Fixed actions to be changed.
|
||||
@@ -8,7 +8,7 @@ Subject: [PATCH] dinput: Dont allow Fixed actions to be changed.
|
||||
1 file changed, 3 insertions(+)
|
||||
|
||||
diff --git a/dlls/dinput/config.c b/dlls/dinput/config.c
|
||||
index cd2c4b921e7..bfb535c9b2a 100644
|
||||
index bb0b2c03c47..4b6cba26843 100644
|
||||
--- a/dlls/dinput/config.c
|
||||
+++ b/dlls/dinput/config.c
|
||||
@@ -91,6 +91,7 @@ static BOOL CALLBACK collect_devices(LPCDIDEVICEINSTANCEW lpddi, IDirectInputDev
|
||||
@@ -19,7 +19,7 @@ index cd2c4b921e7..bfb535c9b2a 100644
|
||||
user_af->rgoAction[j].u.lptszActionName = data->original_lpdiaf->rgoAction[j].u.lptszActionName;
|
||||
}
|
||||
IDirectInputDevice8_BuildActionMap(lpdid, user_af, data->usernames[i], 0);
|
||||
@@ -334,6 +335,8 @@ static void assign_action(HWND dialog)
|
||||
@@ -333,6 +334,8 @@ static void assign_action(HWND dialog)
|
||||
|
||||
if (old_action == action) return;
|
||||
if (obj < 0) return;
|
||||
@@ -29,5 +29,5 @@ index cd2c4b921e7..bfb535c9b2a 100644
|
||||
|
||||
/* Clear old action */
|
||||
--
|
||||
2.23.0
|
||||
2.33.0
|
||||
|
@@ -1,42 +1,41 @@
|
||||
From 75add3c0c65775eb3fa825aafbe46373c0bd08f1 Mon Sep 17 00:00:00 2001
|
||||
From 98a9b8337d40c1f6df21227dff3d993f270aef46 Mon Sep 17 00:00:00 2001
|
||||
From: Alistair Leslie-Hughes <leslie_alistair@hotmail.com>
|
||||
Date: Fri, 24 May 2019 16:16:13 +1000
|
||||
Subject: [PATCH] dinput: Allow mapping of controls based of Genre
|
||||
type.
|
||||
Subject: [PATCH] dinput: Allow mapping of controls based of Genre type.
|
||||
|
||||
---
|
||||
dlls/dinput/device.c | 41 ++++++++++++++++++++++++++++++++++++++++-
|
||||
1 file changed, 40 insertions(+), 1 deletion(-)
|
||||
|
||||
diff --git a/dlls/dinput/device.c b/dlls/dinput/device.c
|
||||
index c7e585c50f4..84a41996700 100644
|
||||
index e826cc89c1e..a4815f24958 100644
|
||||
--- a/dlls/dinput/device.c
|
||||
+++ b/dlls/dinput/device.c
|
||||
@@ -893,8 +893,15 @@ HRESULT _set_action_map(LPDIRECTINPUTDEVICE8W iface, LPDIACTIONFORMATW lpdiaf, L
|
||||
@@ -1741,8 +1741,15 @@ static HRESULT WINAPI dinput_device_SetActionMap( IDirectInputDevice8W *iface, D
|
||||
|
||||
/* Count the actions */
|
||||
for (i=0; i < lpdiaf->dwNumActions; i++)
|
||||
- if (IsEqualGUID(&This->guid, &lpdiaf->rgoAction[i].guidInstance))
|
||||
for (i = 0; i < format->dwNumActions; i++)
|
||||
- if (IsEqualGUID( &impl->guid, &format->rgoAction[i].guidInstance ))
|
||||
+ {
|
||||
+ if (IsEqualGUID(&This->guid, &lpdiaf->rgoAction[i].guidInstance) ||
|
||||
+ (IsEqualGUID(&IID_NULL, &lpdiaf->rgoAction[i].guidInstance) &&
|
||||
+ ((lpdiaf->rgoAction[i].dwSemantic & lpdiaf->dwGenre) == lpdiaf->dwGenre ||
|
||||
+ (lpdiaf->rgoAction[i].dwSemantic & 0xff000000) == 0xff000000 /* Any Axis */) ))
|
||||
+ if (IsEqualGUID(&impl->guid, &format->rgoAction[i].guidInstance) ||
|
||||
+ (IsEqualGUID(&IID_NULL, &format->rgoAction[i].guidInstance) &&
|
||||
+ ((format->rgoAction[i].dwSemantic & format->dwGenre) == format->dwGenre ||
|
||||
+ (format->rgoAction[i].dwSemantic & 0xff000000) == 0xff000000 /* Any Axis */) ))
|
||||
+ {
|
||||
num_actions++;
|
||||
+ }
|
||||
+ }
|
||||
|
||||
/* Should return DI_NOEFFECT if we dont have any actions and actionformat has not changed */
|
||||
if (num_actions == 0 && lpdiaf->dwCRC == new_crc && !(dwFlags & DIDSAM_FORCESAVE)) return DI_NOEFFECT;
|
||||
@@ -934,7 +941,39 @@ HRESULT _set_action_map(LPDIRECTINPUTDEVICE8W iface, LPDIACTIONFORMATW lpdiaf, L
|
||||
if (num_actions == 0 && format->dwCRC == new_crc && !(flags & DIDSAM_FORCESAVE)) return DI_NOEFFECT;
|
||||
@@ -1779,7 +1786,39 @@ static HRESULT WINAPI dinput_device_SetActionMap( IDirectInputDevice8W *iface, D
|
||||
|
||||
action++;
|
||||
}
|
||||
+ else if ((lpdiaf->rgoAction[i].dwSemantic & lpdiaf->dwGenre) == lpdiaf->dwGenre ||
|
||||
+ (lpdiaf->rgoAction[i].dwSemantic & 0xff000000) == 0xff000000 /* Any Axis */)
|
||||
+ else if ((format->rgoAction[i].dwSemantic & format->dwGenre) == format->dwGenre ||
|
||||
+ (format->rgoAction[i].dwSemantic & 0xff000000) == 0xff000000 /* Any Axis */)
|
||||
+ {
|
||||
+ DWORD obj_id = semantic_to_obj_id(This, lpdiaf->rgoAction[i].dwSemantic);
|
||||
+ DWORD obj_id = semantic_to_obj_id(impl, format->rgoAction[i].dwSemantic);
|
||||
+ DWORD type = DIDFT_GETTYPE(obj_id);
|
||||
+ DWORD inst = DIDFT_GETINSTANCE(obj_id);
|
||||
+ LPDIOBJECTDATAFORMAT obj;
|
||||
@@ -50,8 +49,8 @@ index c7e585c50f4..84a41996700 100644
|
||||
+ {
|
||||
+ memcpy(&obj_df[action], obj, df->dwObjSize);
|
||||
+
|
||||
+ This->action_map[action].uAppData = lpdiaf->rgoAction[i].uAppData;
|
||||
+ This->action_map[action].offset = offset;
|
||||
+ impl->action_map[action].uAppData = format->rgoAction[i].uAppData;
|
||||
+ impl->action_map[action].offset = offset;
|
||||
+ obj_df[action].dwOfs = offset;
|
||||
+ offset += (type & DIDFT_BUTTON) ? 1 : 4;
|
||||
+
|
||||
@@ -62,13 +61,13 @@ index c7e585c50f4..84a41996700 100644
|
||||
+
|
||||
+ if (action == 0)
|
||||
+ {
|
||||
+ HeapFree(GetProcessHeap(), 0, obj_df);
|
||||
+ free( obj_df );
|
||||
+ return DI_NOEFFECT;
|
||||
}
|
||||
+ data_format.dwNumObjs = action;
|
||||
|
||||
IDirectInputDevice8_SetDataFormat(iface, &data_format);
|
||||
IDirectInputDevice8_SetDataFormat( iface, &data_format );
|
||||
|
||||
--
|
||||
2.24.1
|
||||
2.33.0
|
||||
|
@@ -1 +1,3 @@
|
||||
Fixes: [34108] dinput: Improve support for user Joystick configuration.
|
||||
Fixes: [47326] dinput: Allow mapping of controls based of genre type.
|
||||
Fixes: [35815] dinput: Allow remapping of joystick buttons.
|
||||
|
@@ -1,232 +0,0 @@
|
||||
From 5a3007325917b8818493fc2193019e829916b733 Mon Sep 17 00:00:00 2001
|
||||
From: Andrew Church <achurch@achurch.org>
|
||||
Date: Mon, 25 Feb 2019 11:23:12 +1100
|
||||
Subject: [PATCH] dinput: Allow reconnecting to disconnected joysticks
|
||||
|
||||
Wine-bug: https://bugs.winehq.org/show_bug.cgi?id=34297
|
||||
---
|
||||
dlls/dinput/joystick_linuxinput.c | 152 ++++++++++++++++++++++--------
|
||||
1 file changed, 115 insertions(+), 37 deletions(-)
|
||||
|
||||
diff --git a/dlls/dinput/joystick_linuxinput.c b/dlls/dinput/joystick_linuxinput.c
|
||||
index 2b970271ec3..8e292904f78 100644
|
||||
--- a/dlls/dinput/joystick_linuxinput.c
|
||||
+++ b/dlls/dinput/joystick_linuxinput.c
|
||||
@@ -84,6 +84,13 @@ struct wine_input_absinfo {
|
||||
LONG flat;
|
||||
};
|
||||
|
||||
+enum wine_joystick_linuxinput_fd_state {
|
||||
+ WINE_FD_STATE_CLOSED = 0, /* No device has been opened yet */
|
||||
+ WINE_FD_STATE_OK, /* File descriptor is open and ready for reading */
|
||||
+ WINE_FD_STATE_DISCONNECTED, /* Read error occurred; might be able to reopen later */
|
||||
+ WINE_FD_STATE_INVALID, /* Device is no longer available at original pathname */
|
||||
+};
|
||||
+
|
||||
/* implemented in effect_linuxinput.c */
|
||||
HRESULT linuxinput_create_effect(int* fd, REFGUID rguid, struct list *parent_list_entry, LPDIRECTINPUTEFFECT* peff);
|
||||
HRESULT linuxinput_get_info_A(int fd, REFGUID rguid, LPDIEFFECTINFOA info);
|
||||
@@ -122,6 +129,7 @@ struct JoystickImpl
|
||||
|
||||
/* joystick private */
|
||||
int joyfd;
|
||||
+ enum wine_joystick_linuxinput_fd_state joyfd_state;
|
||||
|
||||
int dev_axes_to_di[ABS_MAX];
|
||||
POINTL povs[4];
|
||||
@@ -411,6 +419,7 @@ static HRESULT alloc_device( REFGUID rguid, IDirectInputImpl *dinput, JoystickIm
|
||||
|
||||
newDevice->generic.joy_polldev = joy_polldev;
|
||||
newDevice->joyfd = -1;
|
||||
+ newDevice->joyfd_state = WINE_FD_STATE_CLOSED;
|
||||
newDevice->joydev = &joydevs[index];
|
||||
newDevice->generic.name = newDevice->joydev->name;
|
||||
list_init(&newDevice->ff_effects);
|
||||
@@ -589,6 +598,44 @@ static HRESULT joydev_create_device( IDirectInputImpl *dinput, REFGUID rguid, ID
|
||||
return DIERR_DEVICENOTREG;
|
||||
}
|
||||
|
||||
+static int joydev_open_evdev(JoystickImpl *This)
|
||||
+{
|
||||
+ int fd;
|
||||
+
|
||||
+ if ((fd = open(This->joydev->device, O_RDWR)) == -1)
|
||||
+ {
|
||||
+ if ((fd = open(This->joydev->device, O_RDONLY)) == -1)
|
||||
+ {
|
||||
+ /* Couldn't open the device at all */
|
||||
+ }
|
||||
+ else
|
||||
+ {
|
||||
+ /* Couldn't open in r/w but opened in read-only. */
|
||||
+ WARN("Could not open %s in read-write mode. Force feedback will be disabled.\n", This->joydev->device);
|
||||
+ }
|
||||
+ }
|
||||
+ else
|
||||
+ {
|
||||
+ struct input_event event;
|
||||
+
|
||||
+ event.type = EV_FF;
|
||||
+ event.code = FF_GAIN;
|
||||
+ event.value = This->ff_gain;
|
||||
+ if (write(fd, &event, sizeof(event)) == -1)
|
||||
+ ERR("Failed to set gain (%i): %d %s\n", This->ff_gain, errno, strerror(errno));
|
||||
+ if (!This->ff_autocenter)
|
||||
+ {
|
||||
+ /* Disable autocenter. */
|
||||
+ event.code = FF_AUTOCENTER;
|
||||
+ event.value = 0;
|
||||
+ if (write(fd, &event, sizeof(event)) == -1)
|
||||
+ ERR("Failed disabling autocenter: %d %s\n", errno, strerror(errno));
|
||||
+ }
|
||||
+ }
|
||||
+
|
||||
+ return fd;
|
||||
+}
|
||||
+
|
||||
|
||||
const struct dinput_device joystick_linuxinput_device = {
|
||||
"Wine Linux-input joystick driver",
|
||||
@@ -612,40 +659,14 @@ static HRESULT WINAPI JoystickWImpl_Acquire(LPDIRECTINPUTDEVICE8W iface)
|
||||
return res;
|
||||
}
|
||||
|
||||
- if ((This->joyfd = open(This->joydev->device, O_RDWR)) == -1)
|
||||
+ if ((This->joyfd = joydev_open_evdev(This)) == -1)
|
||||
{
|
||||
- if ((This->joyfd = open(This->joydev->device, O_RDONLY)) == -1)
|
||||
- {
|
||||
- /* Couldn't open the device at all */
|
||||
- ERR("Failed to open device %s: %d %s\n", This->joydev->device, errno, strerror(errno));
|
||||
- IDirectInputDevice2WImpl_Unacquire(iface);
|
||||
- return DIERR_NOTFOUND;
|
||||
- }
|
||||
- else
|
||||
- {
|
||||
- /* Couldn't open in r/w but opened in read-only. */
|
||||
- WARN("Could not open %s in read-write mode. Force feedback will be disabled.\n", This->joydev->device);
|
||||
- }
|
||||
- }
|
||||
- else
|
||||
- {
|
||||
- struct input_event event;
|
||||
-
|
||||
- event.type = EV_FF;
|
||||
- event.code = FF_GAIN;
|
||||
- event.value = This->ff_gain;
|
||||
- if (write(This->joyfd, &event, sizeof(event)) == -1)
|
||||
- ERR("Failed to set gain (%i): %d %s\n", This->ff_gain, errno, strerror(errno));
|
||||
- if (!This->ff_autocenter)
|
||||
- {
|
||||
- /* Disable autocenter. */
|
||||
- event.code = FF_AUTOCENTER;
|
||||
- event.value = 0;
|
||||
- if (write(This->joyfd, &event, sizeof(event)) == -1)
|
||||
- ERR("Failed disabling autocenter: %d %s\n", errno, strerror(errno));
|
||||
- }
|
||||
+ ERR("Failed to open device %s: %d %s\n", This->joydev->device, errno, strerror(errno));
|
||||
+ IDirectInputDevice2WImpl_Unacquire(iface);
|
||||
+ return DIERR_NOTFOUND;
|
||||
}
|
||||
|
||||
+ This->joyfd_state = WINE_FD_STATE_OK;
|
||||
return DI_OK;
|
||||
}
|
||||
|
||||
@@ -677,6 +698,7 @@ static HRESULT WINAPI JoystickWImpl_Unacquire(LPDIRECTINPUTDEVICE8W iface)
|
||||
|
||||
close(This->joyfd);
|
||||
This->joyfd = -1;
|
||||
+ This->joyfd_state = WINE_FD_STATE_CLOSED;
|
||||
}
|
||||
return res;
|
||||
}
|
||||
@@ -715,23 +737,79 @@ static void joy_polldev( IDirectInputDevice8W *iface )
|
||||
struct input_event ie;
|
||||
JoystickImpl *This = impl_from_IDirectInputDevice8W( iface );
|
||||
|
||||
- if (This->joyfd==-1)
|
||||
- return;
|
||||
+ if (This->joyfd == -1)
|
||||
+ {
|
||||
+ int fd;
|
||||
+ char namebuf[MAX_PATH + 8]; /* 8 == strlen(EVDEVDRIVER) */
|
||||
+
|
||||
+ if (This->joyfd_state != WINE_FD_STATE_DISCONNECTED)
|
||||
+ return;
|
||||
+ /* Try to reconnect to the device. */
|
||||
+ fd = joydev_open_evdev(This);
|
||||
+ if (fd == -1)
|
||||
+ return;
|
||||
+ namebuf[sizeof(namebuf) - strlen(EVDEVDRIVER) - 1] = 0;
|
||||
+ if (ioctl(fd, EVIOCGNAME(sizeof(namebuf) - strlen(EVDEVDRIVER) - 1), namebuf) == -1)
|
||||
+ {
|
||||
+ /* Couldn't get the name; assume it's a different device. */
|
||||
+ ERR("EVIOCGNAME(%s) failed: %d %s", This->joydev->device, errno, strerror(errno));
|
||||
+ This->joyfd_state = WINE_FD_STATE_INVALID;
|
||||
+ return;
|
||||
+ }
|
||||
+ strcat(namebuf, EVDEVDRIVER); /* Guaranteed to be safe. */
|
||||
+ if (strcmp(namebuf, This->joydev->name) != 0)
|
||||
+ {
|
||||
+ ERR("Device %s changed from \"%s\" to \"%s\"! Can't reconnect.\n", This->joydev->device, This->joydev->name, namebuf);
|
||||
+ This->joyfd_state = WINE_FD_STATE_INVALID;
|
||||
+ return;
|
||||
+ }
|
||||
+ if (InterlockedCompareExchange(&This->joyfd, fd, -1) == -1)
|
||||
+ {
|
||||
+ This->joyfd_state = WINE_FD_STATE_OK;
|
||||
+ TRACE("Reconnected to \"%s\" on %s", This->joydev->name, This->joydev->device);
|
||||
+ }
|
||||
+ else
|
||||
+ {
|
||||
+ /* Somebody beat us to it! Throw away our fd and use theirs. */
|
||||
+ close(fd);
|
||||
+ }
|
||||
+ }
|
||||
|
||||
while (1)
|
||||
{
|
||||
LONG value = 0;
|
||||
int inst_id = -1;
|
||||
+ int result;
|
||||
|
||||
plfd.fd = This->joyfd;
|
||||
plfd.events = POLLIN;
|
||||
|
||||
- if (poll(&plfd,1,0) != 1)
|
||||
- return;
|
||||
+ result = poll(&plfd,1,0);
|
||||
+ if (result != 1)
|
||||
+ {
|
||||
+ if (result == -1)
|
||||
+ {
|
||||
+ ERR("poll failed: %d %s\n", errno, strerror(errno));
|
||||
+ close(This->joyfd);
|
||||
+ This->joyfd = -1;
|
||||
+ This->joyfd_state = WINE_FD_STATE_DISCONNECTED;
|
||||
+ }
|
||||
+ return;
|
||||
+ }
|
||||
|
||||
/* we have one event, so we can read */
|
||||
- if (sizeof(ie)!=read(This->joyfd,&ie,sizeof(ie)))
|
||||
- return;
|
||||
+ result = read(This->joyfd,&ie,sizeof(ie));
|
||||
+ if (result != sizeof(ie))
|
||||
+ {
|
||||
+ if (result == -1)
|
||||
+ {
|
||||
+ ERR("read failed: %d %s\n", errno, strerror(errno));
|
||||
+ close(This->joyfd);
|
||||
+ This->joyfd = -1;
|
||||
+ This->joyfd_state = WINE_FD_STATE_DISCONNECTED;
|
||||
+ }
|
||||
+ return;
|
||||
+ }
|
||||
|
||||
TRACE("input_event: type %d, code %d, value %d\n",ie.type,ie.code,ie.value);
|
||||
switch (ie.type) {
|
||||
--
|
||||
2.30.2
|
||||
|
@@ -1 +0,0 @@
|
||||
Fixes: [34297] dinput: Allow reconnecting to disconnected joysticks
|
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user