Author: akhaldi
Date: Sat Sep 16 20:44:43 2017
New Revision: 75855
URL:
http://svn.reactos.org/svn/reactos?rev=75855&view=rev
Log:
[DINPUT] Sync with Wine Staging 2.16. CORE-13762
5214b47 dinput: Do not wait for hook thread startup in IDirectInput8::Initialize.
83a3887 dinput: Avoid possible deadlock when CS are acquired in different order.
49fdde1 dinput: Use proper size for combobox controls.
b50d1fa dinput: Limit axes while remaping broken devices.
Modified:
trunk/reactos/dll/directx/wine/dinput/device.c
trunk/reactos/dll/directx/wine/dinput/dinput.rc
trunk/reactos/dll/directx/wine/dinput/dinput_main.c
trunk/reactos/dll/directx/wine/dinput/dinput_private.h
trunk/reactos/dll/directx/wine/dinput/joystick_linux.c
Modified: trunk/reactos/dll/directx/wine/dinput/device.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/directx/wine/dinput/de…
==============================================================================
--- trunk/reactos/dll/directx/wine/dinput/device.c [iso-8859-1] (original)
+++ trunk/reactos/dll/directx/wine/dinput/device.c [iso-8859-1] Sat Sep 16 20:44:43 2017
@@ -976,9 +976,9 @@
EnterCriticalSection(&This->crit);
res = This->acquired ? S_FALSE : DI_OK;
This->acquired = 1;
+ LeaveCriticalSection(&This->crit);
if (res == DI_OK)
- check_dinput_hooks(iface);
- LeaveCriticalSection(&This->crit);
+ check_dinput_hooks(iface, TRUE);
return res;
}
@@ -1004,9 +1004,9 @@
EnterCriticalSection(&This->crit);
res = !This->acquired ? DI_NOEFFECT : DI_OK;
This->acquired = 0;
+ LeaveCriticalSection(&This->crit);
if (res == DI_OK)
- check_dinput_hooks(iface);
- LeaveCriticalSection(&This->crit);
+ check_dinput_hooks(iface, FALSE);
return res;
}
Modified: trunk/reactos/dll/directx/wine/dinput/dinput.rc
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/directx/wine/dinput/di…
==============================================================================
--- trunk/reactos/dll/directx/wine/dinput/dinput.rc [iso-8859-1] (original)
+++ trunk/reactos/dll/directx/wine/dinput/dinput.rc [iso-8859-1] Sat Sep 16 20:44:43 2017
@@ -50,8 +50,8 @@
DEFPUSHBUTTON "OK", IDOK, 10, 236, 50, 14
PUSHBUTTON "Cancel", IDCANCEL, 65, 236, 50, 14
PUSHBUTTON "Reset", IDC_RESET, 210, 236, 50, 14
- COMBOBOX IDC_PLAYERCOMBO, 10, 50, 90, 30, CBS_DROPDOWNLIST | CBS_HASSTRINGS
- COMBOBOX IDC_CONTROLLERCOMBO, 10, 20, 90, 30, CBS_DROPDOWNLIST |
CBS_HASSTRINGS
+ COMBOBOX IDC_PLAYERCOMBO, 10, 50, 90, 60, CBS_DROPDOWNLIST | CBS_HASSTRINGS
+ COMBOBOX IDC_CONTROLLERCOMBO, 10, 20, 90, 60, CBS_DROPDOWNLIST |
CBS_HASSTRINGS
LTEXT "Player", IDC_PLAYERTEXT, 10, 40, 90, 8, SS_LEFT
LTEXT "Device", IDC_DEVICETEXT, 10, 10, 90, 8, SS_LEFT
LTEXT "Actions", IDC_ACTIONTEXT, 10, 70, 90, 8, SS_LEFT
Modified: trunk/reactos/dll/directx/wine/dinput/dinput_main.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/directx/wine/dinput/di…
==============================================================================
--- trunk/reactos/dll/directx/wine/dinput/dinput_main.c [iso-8859-1] (original)
+++ trunk/reactos/dll/directx/wine/dinput/dinput_main.c [iso-8859-1] Sat Sep 16 20:44:43
2017
@@ -1754,7 +1754,7 @@
return hook_thread_id != 0;
}
-void check_dinput_hooks(LPDIRECTINPUTDEVICE8W iface)
+void check_dinput_hooks(LPDIRECTINPUTDEVICE8W iface, BOOL acquired)
{
static HHOOK callwndproc_hook;
static ULONG foreground_cnt;
@@ -1764,7 +1764,7 @@
if (dev->dwCoopLevel & DISCL_FOREGROUND)
{
- if (dev->acquired)
+ if (acquired)
foreground_cnt++;
else
foreground_cnt--;
Modified: trunk/reactos/dll/directx/wine/dinput/dinput_private.h
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/directx/wine/dinput/di…
==============================================================================
--- trunk/reactos/dll/directx/wine/dinput/dinput_private.h [iso-8859-1] (original)
+++ trunk/reactos/dll/directx/wine/dinput/dinput_private.h [iso-8859-1] Sat Sep 16
20:44:43 2017
@@ -85,7 +85,7 @@
extern const struct dinput_device joystick_linuxinput_device DECLSPEC_HIDDEN;
extern const struct dinput_device joystick_osx_device DECLSPEC_HIDDEN;
-extern void check_dinput_hooks(LPDIRECTINPUTDEVICE8W) DECLSPEC_HIDDEN;
+extern void check_dinput_hooks(LPDIRECTINPUTDEVICE8W, BOOL) DECLSPEC_HIDDEN;
extern void check_dinput_events(void) DECLSPEC_HIDDEN;
typedef int (*DI_EVENT_PROC)(LPDIRECTINPUTDEVICE8A, WPARAM, LPARAM);
Modified: trunk/reactos/dll/directx/wine/dinput/joystick_linux.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/directx/wine/dinput/jo…
==============================================================================
--- trunk/reactos/dll/directx/wine/dinput/joystick_linux.c [iso-8859-1] (original)
+++ trunk/reactos/dll/directx/wine/dinput/joystick_linux.c [iso-8859-1] Sat Sep 16
20:44:43 2017
@@ -233,10 +233,14 @@
/* If no axes were configured but there are axes assume a 1-to-1 (wii
controller) */
if (joydev.axis_count && !found_axes)
{
+ int axes_limit = min(joydev.axis_count, 8); /* generic driver limit
*/
+
ERR("Incoherent joystick data, advertised %d axes, detected 0.
Assuming 1-to-1.\n",
- joydev.axis_count);
- for (j = 0; j < joydev.axis_count; j++)
+ joydev.axis_count);
+ for (j = 0; j < axes_limit; j++)
joydev.dev_axes_map[j] = j;
+
+ joydev.axis_count = axes_limit;
}
}