winehq.org
Sign In
Sign Up
Sign In
Sign Up
Manage this list
×
Keyboard Shortcuts
Thread View
j
: Next unread message
k
: Previous unread message
j a
: Jump to all threads
j l
: Jump to MailingList overview
2025
February
January
2024
December
November
October
September
August
July
June
May
April
March
February
January
2023
December
November
October
September
August
July
June
May
April
March
February
January
2022
December
November
October
September
August
July
June
May
April
March
February
January
2021
December
November
October
September
August
July
June
May
April
March
February
January
2020
December
November
October
September
August
July
June
May
April
March
February
January
2019
December
November
October
September
August
July
June
May
April
March
February
January
2018
December
November
October
September
August
July
June
May
April
March
February
January
2017
December
November
October
September
August
July
June
May
April
March
February
January
2016
December
November
October
September
August
July
June
May
April
March
February
January
2015
December
November
October
September
August
July
June
May
April
March
February
January
2014
December
November
October
September
August
July
June
May
April
March
February
January
2013
December
November
October
September
August
July
June
May
April
March
February
January
2012
December
November
October
September
August
July
June
May
April
March
February
January
2011
December
November
October
September
August
July
June
May
April
March
February
January
2010
December
November
October
September
August
July
June
May
April
March
February
January
2009
December
November
October
September
August
July
June
May
April
March
February
January
2008
December
November
October
September
August
July
June
May
April
March
February
January
2007
December
November
October
September
August
July
June
May
April
March
February
January
2006
December
November
October
September
August
July
June
May
April
March
February
January
2005
December
November
October
September
August
July
June
May
April
March
February
January
2004
December
November
October
September
August
July
June
May
April
March
February
January
2003
December
November
October
September
August
July
June
May
April
March
February
January
2002
December
November
October
September
August
July
June
May
April
March
February
January
2001
December
November
October
September
August
July
June
May
April
March
February
List overview
wine-commits
September 2021
----- 2025 -----
February 2025
January 2025
----- 2024 -----
December 2024
November 2024
October 2024
September 2024
August 2024
July 2024
June 2024
May 2024
April 2024
March 2024
February 2024
January 2024
----- 2023 -----
December 2023
November 2023
October 2023
September 2023
August 2023
July 2023
June 2023
May 2023
April 2023
March 2023
February 2023
January 2023
----- 2022 -----
December 2022
November 2022
October 2022
September 2022
August 2022
July 2022
June 2022
May 2022
April 2022
March 2022
February 2022
January 2022
----- 2021 -----
December 2021
November 2021
October 2021
September 2021
August 2021
July 2021
June 2021
May 2021
April 2021
March 2021
February 2021
January 2021
----- 2020 -----
December 2020
November 2020
October 2020
September 2020
August 2020
July 2020
June 2020
May 2020
April 2020
March 2020
February 2020
January 2020
----- 2019 -----
December 2019
November 2019
October 2019
September 2019
August 2019
July 2019
June 2019
May 2019
April 2019
March 2019
February 2019
January 2019
----- 2018 -----
December 2018
November 2018
October 2018
September 2018
August 2018
July 2018
June 2018
May 2018
April 2018
March 2018
February 2018
January 2018
----- 2017 -----
December 2017
November 2017
October 2017
September 2017
August 2017
July 2017
June 2017
May 2017
April 2017
March 2017
February 2017
January 2017
----- 2016 -----
December 2016
November 2016
October 2016
September 2016
August 2016
July 2016
June 2016
May 2016
April 2016
March 2016
February 2016
January 2016
----- 2015 -----
December 2015
November 2015
October 2015
September 2015
August 2015
July 2015
June 2015
May 2015
April 2015
March 2015
February 2015
January 2015
----- 2014 -----
December 2014
November 2014
October 2014
September 2014
August 2014
July 2014
June 2014
May 2014
April 2014
March 2014
February 2014
January 2014
----- 2013 -----
December 2013
November 2013
October 2013
September 2013
August 2013
July 2013
June 2013
May 2013
April 2013
March 2013
February 2013
January 2013
----- 2012 -----
December 2012
November 2012
October 2012
September 2012
August 2012
July 2012
June 2012
May 2012
April 2012
March 2012
February 2012
January 2012
----- 2011 -----
December 2011
November 2011
October 2011
September 2011
August 2011
July 2011
June 2011
May 2011
April 2011
March 2011
February 2011
January 2011
----- 2010 -----
December 2010
November 2010
October 2010
September 2010
August 2010
July 2010
June 2010
May 2010
April 2010
March 2010
February 2010
January 2010
----- 2009 -----
December 2009
November 2009
October 2009
September 2009
August 2009
July 2009
June 2009
May 2009
April 2009
March 2009
February 2009
January 2009
----- 2008 -----
December 2008
November 2008
October 2008
September 2008
August 2008
July 2008
June 2008
May 2008
April 2008
March 2008
February 2008
January 2008
----- 2007 -----
December 2007
November 2007
October 2007
September 2007
August 2007
July 2007
June 2007
May 2007
April 2007
March 2007
February 2007
January 2007
----- 2006 -----
December 2006
November 2006
October 2006
September 2006
August 2006
July 2006
June 2006
May 2006
April 2006
March 2006
February 2006
January 2006
----- 2005 -----
December 2005
November 2005
October 2005
September 2005
August 2005
July 2005
June 2005
May 2005
April 2005
March 2005
February 2005
January 2005
----- 2004 -----
December 2004
November 2004
October 2004
September 2004
August 2004
July 2004
June 2004
May 2004
April 2004
March 2004
February 2004
January 2004
----- 2003 -----
December 2003
November 2003
October 2003
September 2003
August 2003
July 2003
June 2003
May 2003
April 2003
March 2003
February 2003
January 2003
----- 2002 -----
December 2002
November 2002
October 2002
September 2002
August 2002
July 2002
June 2002
May 2002
April 2002
March 2002
February 2002
January 2002
----- 2001 -----
December 2001
November 2001
October 2001
September 2001
August 2001
July 2001
June 2001
May 2001
April 2001
March 2001
February 2001
wine-commits@winehq.org
2 participants
1030 discussions
Start a n
N
ew thread
Rémi Bernon : dinput: Scale HID joystick axis values according to their center point.
by Alexandre Julliard
28 Sep '21
28 Sep '21
Module: wine Branch: master Commit: 9646873d6302676079e123d49f2b54e51d609584 URL:
https://source.winehq.org/git/wine.git/?a=commit;h=9646873d6302676079e123d4…
Author: Rémi Bernon <rbernon(a)codeweavers.com> Date: Tue Sep 28 09:30:12 2021 +0200 dinput: Scale HID joystick axis values according to their center point. Signed-off-by: Rémi Bernon <rbernon(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/dinput/joystick_hid.c | 43 ++++++++++++++++++++++++++++++++++++++----- dlls/dinput8/tests/hid.c | 30 +++++++++--------------------- 2 files changed, 47 insertions(+), 26 deletions(-) diff --git a/dlls/dinput/joystick_hid.c b/dlls/dinput/joystick_hid.c index e20d02224fe..3dc0776a1ec 100644 --- a/dlls/dinput/joystick_hid.c +++ b/dlls/dinput/joystick_hid.c @@ -854,15 +854,47 @@ static LONG sign_extend( ULONG value, const HIDP_VALUE_CAPS *caps ) static LONG scale_value( ULONG value, const HIDP_VALUE_CAPS *caps, LONG min, LONG max ) { - ULONG bit_max = (1 << caps->BitSize) - 1; LONG tmp = sign_extend( value, caps ); - - /* xinput HID gamepad have bogus logical value range, let's use the bit range instead */ - if (caps->LogicalMin == 0 && caps->LogicalMax == -1) return min + MulDiv( tmp, max - min, bit_max ); if (caps->LogicalMin > tmp || caps->LogicalMax < tmp) return -1; /* invalid / null value */ return min + MulDiv( tmp - caps->LogicalMin, max - min, caps->LogicalMax - caps->LogicalMin ); } +static LONG scale_axis_value( ULONG value, const HIDP_VALUE_CAPS *caps ) +{ + LONG tmp = sign_extend( value, caps ), log_ctr, log_min, log_max, phy_ctr, phy_min, phy_max; + ULONG bit_max = (1 << caps->BitSize) - 1; + + log_min = caps->LogicalMin; + log_max = caps->LogicalMax; + phy_min = caps->PhysicalMin; + phy_max = caps->PhysicalMax; + /* xinput HID gamepad have bogus logical value range, let's use the bit range instead */ + if (log_min == 0 && log_max == -1) log_max = bit_max; + + if (phy_min == 0) phy_ctr = phy_max >> 1; + else phy_ctr = round( (phy_min + phy_max) / 2.0 ); + if (log_min == 0) log_ctr = log_max >> 1; + else log_ctr = round( (log_min + log_max) / 2.0 ); + + tmp -= log_ctr; + if (tmp <= 0) + { + log_max = 0; + log_min -= log_ctr; + phy_max = phy_ctr; + } + else + { + log_min = 0; + log_max -= log_ctr; + phy_min = phy_ctr; + } + + if (tmp <= log_min) return phy_min; + if (tmp >= log_max) return phy_max; + return phy_min + MulDiv( tmp - log_min, phy_max - phy_min, log_max - log_min ); +} + static BOOL read_device_state_value( struct hid_joystick *impl, struct hid_caps *caps, DIDEVICEOBJECTINSTANCEW *instance, void *data ) { @@ -878,7 +910,8 @@ static BOOL read_device_state_value( struct hid_joystick *impl, struct hid_caps &logical_value, impl->preparsed, report_buf, report_len ); if (status != HIDP_STATUS_SUCCESS) WARN( "HidP_GetUsageValue %04x:%04x returned %#x\n", instance->wUsagePage, instance->wUsage, status ); - value = scale_value( logical_value, value_caps, value_caps->PhysicalMin, value_caps->PhysicalMax ); + if (instance->dwType & DIDFT_AXIS) value = scale_axis_value( logical_value, value_caps ); + else value = scale_value( logical_value, value_caps, value_caps->PhysicalMin, value_caps->PhysicalMax ); old_value = *(LONG *)(params->old_state + instance->dwOfs); *(LONG *)(impl->device_state + instance->dwOfs) = value; diff --git a/dlls/dinput8/tests/hid.c b/dlls/dinput8/tests/hid.c index ae758837d36..ec5dffe70f5 100644 --- a/dlls/dinput8/tests/hid.c +++ b/dlls/dinput8/tests/hid.c @@ -4098,11 +4098,8 @@ static void test_simple_joystick(void) winetest_push_context( "state[%d]", i ); hr = IDirectInputDevice8_GetDeviceState( device, sizeof(DIJOYSTATE2), &state ); ok( hr == DI_OK, "IDirectInputDevice8_GetDeviceState returned: %#x\n", hr ); - todo_wine_if( i != 0 && i != 2 ) check_member( state, expect_state[i], "%d", lX ); - todo_wine_if( i != 0 && i != 2 ) check_member( state, expect_state[i], "%d", lY ); - todo_wine_if( i != 0 ) check_member( state, expect_state[i], "%d", lZ ); check_member( state, expect_state[i], "%d", lRx ); check_member( state, expect_state[i], "%#x", rgdwPOV[0] ); @@ -4114,20 +4111,17 @@ static void test_simple_joystick(void) send_hid_input( file, &injected_input[i], sizeof(*injected_input) ); res = WaitForSingleObject( event, 100 ); - if (i == 0 || i == 3) todo_wine_if( i == 0 ) - ok( res == WAIT_TIMEOUT, "WaitForSingleObject succeeded\n" ); - else ok( res == WAIT_OBJECT_0, "WaitForSingleObject failed\n" ); ResetEvent( event ); + if (i == 0 || i == 3) ok( res == WAIT_TIMEOUT, "WaitForSingleObject succeeded\n" ); + else ok( res == WAIT_OBJECT_0, "WaitForSingleObject failed\n" ); + ResetEvent( event ); winetest_pop_context(); } hr = IDirectInputDevice8_GetDeviceState( device, sizeof(DIJOYSTATE2), &state ); ok( hr == DI_OK, "IDirectInputDevice8_GetDeviceState returned: %#x\n", hr ); winetest_push_context( "state[%d]", i ); - todo_wine check_member( state, expect_state[i], "%d", lX ); - todo_wine check_member( state, expect_state[i], "%d", lY ); - todo_wine check_member( state, expect_state[i], "%d", lZ ); check_member( state, expect_state[i], "%d", lRx ); check_member( state, expect_state[i], "%#x", rgdwPOV[0] ); @@ -4237,7 +4231,7 @@ static void test_simple_joystick(void) winetest_push_context( "objdata[%d]", i ); todo_wine check_member( objdata[i], expect_objdata[6 + i], "%#x", dwOfs ); - todo_wine_if( i != 3 && i != 4 && i != 7 ) + todo_wine_if( i == 1 || i == 2 || i == 6 ) check_member( objdata[i], expect_objdata[6 + i], "%#x", dwData ); ok( objdata[i].uAppData == -1, "got %p, expected %p\n", (void *)objdata[i].uAppData, (void *)-1 ); winetest_pop_context(); @@ -4250,11 +4244,8 @@ static void test_simple_joystick(void) hr = IDirectInputDevice8_GetDeviceState( device, sizeof(DIJOYSTATE2), &state ); ok( hr == DI_OK, "IDirectInputDevice8_GetDeviceState returned: %#x\n", hr ); - todo_wine check_member( state, expect_state[3], "%d", lX ); - todo_wine check_member( state, expect_state[3], "%d", lY ); - todo_wine check_member( state, expect_state[3], "%d", lZ ); check_member( state, expect_state[3], "%d", lRx ); check_member( state, expect_state[3], "%d", rgdwPOV[0] ); @@ -4448,12 +4439,11 @@ static void test_simple_joystick(void) if (broken( state.lX == -10750 )) win_skip( "Ignoring 32-bit rounding\n" ); else { - todo_wine_if( i != 0 && i != 2 ) + todo_wine_if( i == 3 || i == 4 ) check_member( state, expect_state_abs[i], "%d", lX ); - todo_wine_if( i != 0 && i != 2 ) + todo_wine_if( i == 3 || i == 4 ) check_member( state, expect_state_abs[i], "%d", lY ); } - todo_wine_if( i != 0 ) check_member( state, expect_state_abs[i], "%d", lZ ); check_member( state, expect_state_abs[i], "%d", lRx ); check_member( state, expect_state_abs[i], "%d", rgdwPOV[0] ); @@ -4465,20 +4455,18 @@ static void test_simple_joystick(void) send_hid_input( file, &injected_input[i], sizeof(*injected_input) ); res = WaitForSingleObject( event, 100 ); - if (i == 0 || i == 3) todo_wine_if( i == 0 ) - ok( res == WAIT_TIMEOUT, "WaitForSingleObject succeeded\n" ); - else ok( res == WAIT_OBJECT_0, "WaitForSingleObject failed\n" ); ResetEvent( event ); + if (i == 0 || i == 3) ok( res == WAIT_TIMEOUT, "WaitForSingleObject succeeded\n" ); + else ok( res == WAIT_OBJECT_0, "WaitForSingleObject failed\n" ); + ResetEvent( event ); winetest_pop_context(); } hr = IDirectInputDevice8_GetDeviceState( device, sizeof(DIJOYSTATE2), &state ); ok( hr == DI_OK, "IDirectInputDevice8_GetDeviceState returned: %#x\n", hr ); winetest_push_context( "state[%d]", i ); - todo_wine check_member( state, expect_state_abs[i], "%d", lX ); todo_wine check_member( state, expect_state_abs[i], "%d", lY ); - todo_wine check_member( state, expect_state_abs[i], "%d", lZ ); check_member( state, expect_state_abs[i], "%d", lRx ); check_member( state, expect_state_abs[i], "%d", rgdwPOV[0] );
1
0
0
0
Rémi Bernon : dinput: Reset the HID joystick state values on DIPROP_RANGE changes.
by Alexandre Julliard
28 Sep '21
28 Sep '21
Module: wine Branch: master Commit: 3886634c82c03306ccc643f0296fee91891eedd7 URL:
https://source.winehq.org/git/wine.git/?a=commit;h=3886634c82c03306ccc643f0…
Author: Rémi Bernon <rbernon(a)codeweavers.com> Date: Tue Sep 28 09:30:11 2021 +0200 dinput: Reset the HID joystick state values on DIPROP_RANGE changes. Signed-off-by: Rémi Bernon <rbernon(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/dinput/joystick_hid.c | 19 ++++++++++++++++--- dlls/dinput8/tests/hid.c | 16 ++++++---------- 2 files changed, 22 insertions(+), 13 deletions(-) diff --git a/dlls/dinput/joystick_hid.c b/dlls/dinput/joystick_hid.c index 6d70e188dbe..e20d02224fe 100644 --- a/dlls/dinput/joystick_hid.c +++ b/dlls/dinput/joystick_hid.c @@ -20,6 +20,7 @@ #include <assert.h> #include <stdarg.h> #include <string.h> +#include <math.h> #include "windef.h" #include "winbase.h" @@ -585,11 +586,23 @@ static BOOL set_property_prop_range( struct hid_joystick *impl, struct hid_caps { HIDP_VALUE_CAPS *value_caps = caps->value; DIPROPRANGE *value = data; - LONG range = value_caps->LogicalMax - value_caps->LogicalMin; + LONG tmp; + value_caps->PhysicalMin = value->lMin; value_caps->PhysicalMax = value->lMax; - if (instance->dwType & DIDFT_POV && range > 0) - value_caps->PhysicalMax -= value->lMax / (range + 1); + + if (instance->dwType & DIDFT_AXIS) + { + if (!value_caps->PhysicalMin) tmp = value_caps->PhysicalMax / 2; + else tmp = round( (value_caps->PhysicalMin + value_caps->PhysicalMax) / 2.0 ); + *(LONG *)(impl->device_state + instance->dwOfs) = tmp; + } + else if (instance->dwType & DIDFT_POV) + { + tmp = value_caps->LogicalMax - value_caps->LogicalMin; + if (tmp > 0) value_caps->PhysicalMax -= value->lMax / (tmp + 1); + *(LONG *)(impl->device_state + instance->dwOfs) = -1; + } return DIENUM_CONTINUE; } diff --git a/dlls/dinput8/tests/hid.c b/dlls/dinput8/tests/hid.c index 0270467dea8..ae758837d36 100644 --- a/dlls/dinput8/tests/hid.c +++ b/dlls/dinput8/tests/hid.c @@ -4098,14 +4098,13 @@ static void test_simple_joystick(void) winetest_push_context( "state[%d]", i ); hr = IDirectInputDevice8_GetDeviceState( device, sizeof(DIJOYSTATE2), &state ); ok( hr == DI_OK, "IDirectInputDevice8_GetDeviceState returned: %#x\n", hr ); - todo_wine_if( i != 2 ) + todo_wine_if( i != 0 && i != 2 ) check_member( state, expect_state[i], "%d", lX ); - todo_wine_if( i != 2 ) + todo_wine_if( i != 0 && i != 2 ) check_member( state, expect_state[i], "%d", lY ); - todo_wine + todo_wine_if( i != 0 ) check_member( state, expect_state[i], "%d", lZ ); check_member( state, expect_state[i], "%d", lRx ); - todo_wine_if( i == 0 ) check_member( state, expect_state[i], "%#x", rgdwPOV[0] ); check_member( state, expect_state[i], "%#x", rgdwPOV[1] ); check_member( state, expect_state[i], "%#x", rgbButtons[0] ); @@ -4306,11 +4305,8 @@ static void test_simple_joystick(void) hr = IDirectInputDevice8_GetDeviceState( device, sizeof(DIJOYSTATE2), &state ); ok( hr == DI_OK, "IDirectInputDevice8_GetDeviceState returned: %#x\n", hr ); - todo_wine check_member( state, expect_state_abs[1], "%d", lX ); - todo_wine check_member( state, expect_state_abs[1], "%d", lY ); - todo_wine check_member( state, expect_state_abs[1], "%d", lZ ); check_member( state, expect_state_abs[1], "%d", lRx ); check_member( state, expect_state_abs[1], "%d", rgdwPOV[0] ); @@ -4452,12 +4448,12 @@ static void test_simple_joystick(void) if (broken( state.lX == -10750 )) win_skip( "Ignoring 32-bit rounding\n" ); else { - todo_wine_if( i != 2 ) + todo_wine_if( i != 0 && i != 2 ) check_member( state, expect_state_abs[i], "%d", lX ); - todo_wine_if( i != 2 ) + todo_wine_if( i != 0 && i != 2 ) check_member( state, expect_state_abs[i], "%d", lY ); } - todo_wine + todo_wine_if( i != 0 ) check_member( state, expect_state_abs[i], "%d", lZ ); check_member( state, expect_state_abs[i], "%d", lRx ); check_member( state, expect_state_abs[i], "%d", rgdwPOV[0] );
1
0
0
0
Rémi Bernon : dinput: Check that DIPROP_RANGE lMin and lMax are ordered.
by Alexandre Julliard
28 Sep '21
28 Sep '21
Module: wine Branch: master Commit: 844db6e53e86ccc5fdf55d44c791a5541ddf8cb8 URL:
https://source.winehq.org/git/wine.git/?a=commit;h=844db6e53e86ccc5fdf55d44…
Author: Rémi Bernon <rbernon(a)codeweavers.com> Date: Tue Sep 28 09:30:10 2021 +0200 dinput: Check that DIPROP_RANGE lMin and lMax are ordered. Signed-off-by: Rémi Bernon <rbernon(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/dinput/joystick_hid.c | 4 ++++ dlls/dinput8/tests/hid.c | 1 - 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/dlls/dinput/joystick_hid.c b/dlls/dinput/joystick_hid.c index b4ccbd9f509..6d70e188dbe 100644 --- a/dlls/dinput/joystick_hid.c +++ b/dlls/dinput/joystick_hid.c @@ -607,9 +607,13 @@ static HRESULT WINAPI hid_joystick_SetProperty( IDirectInputDevice8W *iface, con switch (LOWORD( guid )) { case (DWORD_PTR)DIPROP_RANGE: + { + DIPROPRANGE *value = (DIPROPRANGE *)header; if (header->dwSize != sizeof(DIPROPRANGE)) return DIERR_INVALIDPARAM; + if (value->lMin > value->lMax) return DIERR_INVALIDPARAM; enum_objects( impl, header, DIDFT_AXIS, set_property_prop_range, (void *)header ); return DI_OK; + } case (DWORD_PTR)DIPROP_FFLOAD: case (DWORD_PTR)DIPROP_GRANULARITY: case (DWORD_PTR)DIPROP_VIDPID: diff --git a/dlls/dinput8/tests/hid.c b/dlls/dinput8/tests/hid.c index 41f6d5316b5..0270467dea8 100644 --- a/dlls/dinput8/tests/hid.c +++ b/dlls/dinput8/tests/hid.c @@ -4275,7 +4275,6 @@ static void test_simple_joystick(void) prop_range.lMin = -4000; prop_range.lMax = -14000; hr = IDirectInputDevice8_SetProperty( device, DIPROP_RANGE, &prop_range.diph ); - todo_wine ok( hr == DIERR_INVALIDPARAM, "IDirectInputDevice8_SetProperty DIPROP_RANGE returned %#x\n", hr ); prop_range.lMin = -14000; prop_range.lMax = -4000;
1
0
0
0
Rémi Bernon : dinput: Return DIERR_UNSUPPORTED when reading DIPROP_RANGE with DIPH_DEVICE mode.
by Alexandre Julliard
28 Sep '21
28 Sep '21
Module: wine Branch: master Commit: 5d1f3baacd2aa78b77c26240f78406d192be4cf9 URL:
https://source.winehq.org/git/wine.git/?a=commit;h=5d1f3baacd2aa78b77c26240…
Author: Rémi Bernon <rbernon(a)codeweavers.com> Date: Tue Sep 28 09:30:09 2021 +0200 dinput: Return DIERR_UNSUPPORTED when reading DIPROP_RANGE with DIPH_DEVICE mode. Signed-off-by: Rémi Bernon <rbernon(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/dinput/joystick_hid.c | 1 + dlls/dinput8/tests/hid.c | 2 -- 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/dlls/dinput/joystick_hid.c b/dlls/dinput/joystick_hid.c index 73339564cd1..b4ccbd9f509 100644 --- a/dlls/dinput/joystick_hid.c +++ b/dlls/dinput/joystick_hid.c @@ -533,6 +533,7 @@ static HRESULT WINAPI hid_joystick_GetProperty( IDirectInputDevice8W *iface, con { case (DWORD_PTR)DIPROP_RANGE: if (header->dwSize != sizeof(DIPROPRANGE)) return DIERR_INVALIDPARAM; + if (header->dwHow == DIPH_DEVICE) return DIERR_UNSUPPORTED; if (enum_objects( impl, header, DIDFT_AXIS, get_property_prop_range, header ) == DIENUM_STOP) return DI_OK; return DIERR_NOTFOUND; diff --git a/dlls/dinput8/tests/hid.c b/dlls/dinput8/tests/hid.c index affdddd153f..41f6d5316b5 100644 --- a/dlls/dinput8/tests/hid.c +++ b/dlls/dinput8/tests/hid.c @@ -3879,7 +3879,6 @@ static void test_simple_joystick(void) todo_wine ok( hr == DIERR_UNSUPPORTED, "IDirectInputDevice8_GetProperty DIPROP_SATURATION returned %#x\n", hr ); hr = IDirectInputDevice8_GetProperty( device, DIPROP_RANGE, &prop_range.diph ); - todo_wine ok( hr == DIERR_UNSUPPORTED, "IDirectInputDevice8_GetProperty DIPROP_RANGE returned %#x\n", hr ); prop_dword.diph.dwHow = DIPH_BYUSAGE; @@ -4288,7 +4287,6 @@ static void test_simple_joystick(void) prop_range.lMin = 0xdeadbeef; prop_range.lMax = 0xdeadbeef; hr = IDirectInputDevice8_GetProperty( device, DIPROP_RANGE, &prop_range.diph ); - todo_wine ok( hr == DIERR_UNSUPPORTED, "IDirectInputDevice8_GetProperty DIPROP_RANGE returned %#x\n", hr ); prop_range.diph.dwHow = DIPH_BYUSAGE; prop_range.diph.dwObj = MAKELONG( HID_USAGE_GENERIC_X, HID_USAGE_PAGE_GENERIC );
1
0
0
0
Rémi Bernon : dinput: Return DIERR_NOTFOUND when DIPROP_RANGE object isn't found.
by Alexandre Julliard
28 Sep '21
28 Sep '21
Module: wine Branch: master Commit: 50c1f45441e7999513b9c851a97ed942816e3c79 URL:
https://source.winehq.org/git/wine.git/?a=commit;h=50c1f45441e7999513b9c851…
Author: Rémi Bernon <rbernon(a)codeweavers.com> Date: Tue Sep 28 09:30:08 2021 +0200 dinput: Return DIERR_NOTFOUND when DIPROP_RANGE object isn't found. Signed-off-by: Rémi Bernon <rbernon(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/dinput/joystick_hid.c | 7 ++++--- dlls/dinput8/tests/hid.c | 3 --- 2 files changed, 4 insertions(+), 6 deletions(-) diff --git a/dlls/dinput/joystick_hid.c b/dlls/dinput/joystick_hid.c index dfff379091e..73339564cd1 100644 --- a/dlls/dinput/joystick_hid.c +++ b/dlls/dinput/joystick_hid.c @@ -515,7 +515,7 @@ static BOOL get_property_prop_range( struct hid_joystick *impl, struct hid_caps DIPROPRANGE *value = data; value->lMin = value_caps->PhysicalMin; value->lMax = value_caps->PhysicalMax; - return DIENUM_CONTINUE; + return DIENUM_STOP; } static HRESULT WINAPI hid_joystick_GetProperty( IDirectInputDevice8W *iface, const GUID *guid, @@ -533,8 +533,9 @@ static HRESULT WINAPI hid_joystick_GetProperty( IDirectInputDevice8W *iface, con { case (DWORD_PTR)DIPROP_RANGE: if (header->dwSize != sizeof(DIPROPRANGE)) return DIERR_INVALIDPARAM; - enum_objects( impl, header, DIDFT_AXIS, get_property_prop_range, header ); - return DI_OK; + if (enum_objects( impl, header, DIDFT_AXIS, get_property_prop_range, header ) == DIENUM_STOP) + return DI_OK; + return DIERR_NOTFOUND; case (DWORD_PTR)DIPROP_PRODUCTNAME: { DIPROPSTRING *value = (DIPROPSTRING *)header; diff --git a/dlls/dinput8/tests/hid.c b/dlls/dinput8/tests/hid.c index 25e7511353f..affdddd153f 100644 --- a/dlls/dinput8/tests/hid.c +++ b/dlls/dinput8/tests/hid.c @@ -3908,15 +3908,12 @@ static void test_simple_joystick(void) prop_range.lMin = 0xdeadbeef; prop_range.lMax = 0xdeadbeef; hr = IDirectInputDevice8_GetProperty( device, DIPROP_RANGE, &prop_range.diph ); - todo_wine ok( hr == DIERR_NOTFOUND, "IDirectInputDevice8_GetProperty DIPROP_RANGE returned %#x\n", hr ); prop_range.diph.dwObj = MAKELONG( 0, HID_USAGE_PAGE_GENERIC ); hr = IDirectInputDevice8_GetProperty( device, DIPROP_RANGE, &prop_range.diph ); - todo_wine ok( hr == DIERR_NOTFOUND, "IDirectInputDevice8_GetProperty DIPROP_RANGE returned %#x\n", hr ); prop_range.diph.dwObj = MAKELONG( HID_USAGE_PAGE_GENERIC, HID_USAGE_GENERIC_X ); hr = IDirectInputDevice8_GetProperty( device, DIPROP_RANGE, &prop_range.diph ); - todo_wine ok( hr == DIERR_NOTFOUND, "IDirectInputDevice8_GetProperty DIPROP_RANGE returned %#x\n", hr ); prop_range.diph.dwObj = MAKELONG( HID_USAGE_GENERIC_X, HID_USAGE_PAGE_GENERIC ); prop_range.lMin = 0xdeadbeef;
1
0
0
0
Paul Gofman : kernelbase: Don't use loader lock for loading libraries as data files.
by Alexandre Julliard
28 Sep '21
28 Sep '21
Module: wine Branch: master Commit: 5f6edba5bb5dd36023ad5b0cbe75f6ad076ab7b3 URL:
https://source.winehq.org/git/wine.git/?a=commit;h=5f6edba5bb5dd36023ad5b0c…
Author: Paul Gofman <pgofman(a)codeweavers.com> Date: Tue Sep 28 02:58:45 2021 +0300 kernelbase: Don't use loader lock for loading libraries as data files. Signed-off-by: Paul Gofman <pgofman(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/kernelbase/loader.c | 23 +++++++++++++---------- 1 file changed, 13 insertions(+), 10 deletions(-) diff --git a/dlls/kernelbase/loader.c b/dlls/kernelbase/loader.c index da139e91176..53c6750e668 100644 --- a/dlls/kernelbase/loader.c +++ b/dlls/kernelbase/loader.c @@ -48,6 +48,14 @@ struct exclusive_datafile }; static struct list exclusive_datafile_list = LIST_INIT( exclusive_datafile_list ); +static CRITICAL_SECTION exclusive_datafile_list_section; +static CRITICAL_SECTION_DEBUG critsect_debug = +{ + 0, 0, &exclusive_datafile_list_section, + { &critsect_debug.ProcessLocksList, &critsect_debug.ProcessLocksList }, + 0, 0, { (DWORD_PTR)(__FILE__ ": exclusive_datafile_list_section") } +}; +static CRITICAL_SECTION exclusive_datafile_list_section = { &critsect_debug, -1, 0, 0, 0, 0 }; /*********************************************************************** * Modules @@ -120,7 +128,9 @@ static BOOL load_library_as_datafile( LPCWSTR load_path, DWORD flags, LPCWSTR na if (!datafile) goto failed; datafile->module = *mod_ret; datafile->file = file; + RtlEnterCriticalSection( &exclusive_datafile_list_section ); list_add_head( &exclusive_datafile_list, &datafile->entry ); + RtlLeaveCriticalSection( &exclusive_datafile_list_section ); TRACE( "delaying close %p for module %p\n", datafile->file, datafile->module ); return TRUE; } @@ -154,14 +164,8 @@ static HMODULE load_library( const UNICODE_STRING *libname, DWORD flags ) if (flags & (LOAD_LIBRARY_AS_DATAFILE | LOAD_LIBRARY_AS_DATAFILE_EXCLUSIVE | LOAD_LIBRARY_AS_IMAGE_RESOURCE)) { - ULONG_PTR magic; - - LdrLockLoaderLock( 0, NULL, &magic ); - if (!LdrGetDllHandle( load_path, flags, libname, &module )) - LdrAddRefDll( 0, module ); - else + if (LdrGetDllHandleEx( 0, load_path, NULL, libname, &module )) load_library_as_datafile( load_path, flags, libname->Buffer, &module ); - LdrUnlockLoaderLock( 0, magic ); } else { @@ -242,9 +246,8 @@ BOOL WINAPI DECLSPEC_HOTPATCH FreeLibrary( HINSTANCE module ) if ((ULONG_PTR)module & 1) { struct exclusive_datafile *file; - ULONG_PTR magic; - LdrLockLoaderLock( 0, NULL, &magic ); + RtlEnterCriticalSection( &exclusive_datafile_list_section ); LIST_FOR_EACH_ENTRY( file, &exclusive_datafile_list, struct exclusive_datafile, entry ) { if (file->module != module) continue; @@ -254,7 +257,7 @@ BOOL WINAPI DECLSPEC_HOTPATCH FreeLibrary( HINSTANCE module ) HeapFree( GetProcessHeap(), 0, file ); break; } - LdrUnlockLoaderLock( 0, magic ); + RtlLeaveCriticalSection( &exclusive_datafile_list_section ); } return UnmapViewOfFile( ptr ); }
1
0
0
0
Chip Davis : configure: Stop checking for SSLCopyPeerCertificates().
by Alexandre Julliard
28 Sep '21
28 Sep '21
Module: wine Branch: master Commit: 5c0fe4db7d580784ab6adc361bfed981be25753c URL:
https://source.winehq.org/git/wine.git/?a=commit;h=5c0fe4db7d580784ab6adc36…
Author: Chip Davis <cdavis(a)codeweavers.com> Date: Mon Sep 27 15:59:26 2021 -0500 configure: Stop checking for SSLCopyPeerCertificates(). This function was introduced in 10.5, and we now require 10.8. We can safely assume it is present. Signed-off-by: Chip Davis <cdavis(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- configure | 14 -------------- configure.ac | 5 ----- dlls/secur32/schannel_macosx.c | 16 ---------------- include/config.h.in | 3 --- 4 files changed, 38 deletions(-) diff --git a/configure b/configure index 7c2f53f5655..e32b363b3fc 100755 --- a/configure +++ b/configure @@ -8959,20 +8959,6 @@ fi then SECURITY_LIBS="-framework Security -framework CoreFoundation" - ac_save_LIBS="$LIBS" - LIBS="$LIBS $SECURITY_LIBS" - for ac_func in SSLCopyPeerCertificates -do : - ac_fn_c_check_func "$LINENO" "SSLCopyPeerCertificates" "ac_cv_func_SSLCopyPeerCertificates" -if test "x$ac_cv_func_SSLCopyPeerCertificates" = xyes; then : - cat >>confdefs.h <<_ACEOF -#define HAVE_SSLCOPYPEERCERTIFICATES 1 -_ACEOF - -fi -done - - LIBS="$ac_save_LIBS" fi if test "$ac_cv_header_CoreAudio_CoreAudio_h" = "yes" then diff --git a/configure.ac b/configure.ac index c0a126293c4..9fa8ff3e394 100644 --- a/configure.ac +++ b/configure.ac @@ -783,11 +783,6 @@ case $host_os in if test "$ac_cv_header_Security_Security_h" = "yes" then AC_SUBST(SECURITY_LIBS,"-framework Security -framework CoreFoundation") - dnl Check for the SSLCopyPeerCertificates function - ac_save_LIBS="$LIBS" - LIBS="$LIBS $SECURITY_LIBS" - AC_CHECK_FUNCS(SSLCopyPeerCertificates) - LIBS="$ac_save_LIBS" fi if test "$ac_cv_header_CoreAudio_CoreAudio_h" = "yes" then diff --git a/dlls/secur32/schannel_macosx.c b/dlls/secur32/schannel_macosx.c index 2f802f96686..523f8c63562 100644 --- a/dlls/secur32/schannel_macosx.c +++ b/dlls/secur32/schannel_macosx.c @@ -1047,13 +1047,6 @@ static SECURITY_STATUS CDECL schan_get_unique_channel_binding(schan_session sess return SEC_E_UNSUPPORTED_FUNCTION; } -#ifndef HAVE_SSLCOPYPEERCERTIFICATES -static void cf_release(const void *arg, void *ctx) -{ - CFRelease(arg); -} -#endif - static SECURITY_STATUS CDECL schan_get_session_peer_certificate(schan_session session, struct schan_cert_list *list) { struct mac_session *s = (struct mac_session *)session; @@ -1068,11 +1061,7 @@ static SECURITY_STATUS CDECL schan_get_session_peer_certificate(schan_session se TRACE("(%p/%p, %p)\n", s, s->context, list); -#ifdef HAVE_SSLCOPYPEERCERTIFICATES status = SSLCopyPeerCertificates(s->context, &cert_array); -#else - status = SSLGetPeerCertificates(s->context, &cert_array); -#endif if (status != noErr || !cert_array) { WARN("SSLCopyPeerCertificates failed: %d\n", status); @@ -1118,11 +1107,6 @@ static SECURITY_STATUS CDECL schan_get_session_peer_certificate(schan_session se CFRelease(data); } -done: -#ifndef HAVE_SSLCOPYPEERCERTIFICATES - /* This is why SSLGetPeerCertificates was deprecated */ - CFArrayApplyFunction(cert_array, CFRangeMake(0, CFArrayGetCount(cert_array)), cf_release, NULL); -#endif CFRelease(cert_array); return ret; } diff --git a/include/config.h.in b/include/config.h.in index f66444fd715..c0d326cee39 100644 --- a/include/config.h.in +++ b/include/config.h.in @@ -597,9 +597,6 @@ /* Define to 1 if the system has the type `sigset_t'. */ #undef HAVE_SIGSET_T -/* Define to 1 if you have the `SSLCopyPeerCertificates' function. */ -#undef HAVE_SSLCOPYPEERCERTIFICATES - /* Define to 1 if you have the <stdint.h> header file. */ #undef HAVE_STDINT_H
1
0
0
0
Chip Davis : secur32: Use the SecItemExport() function.
by Alexandre Julliard
28 Sep '21
28 Sep '21
Module: wine Branch: master Commit: 699fc68f2adb7df3fed021459955289b0dc34dd0 URL:
https://source.winehq.org/git/wine.git/?a=commit;h=699fc68f2adb7df3fed02145…
Author: Chip Davis <cdavis(a)codeweavers.com> Date: Mon Sep 27 15:59:25 2021 -0500 secur32: Use the SecItemExport() function. Signed-off-by: Chip Davis <cdavis(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/secur32/schannel_macosx.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dlls/secur32/schannel_macosx.c b/dlls/secur32/schannel_macosx.c index d7453a44816..2f802f96686 100644 --- a/dlls/secur32/schannel_macosx.c +++ b/dlls/secur32/schannel_macosx.c @@ -1085,7 +1085,7 @@ static SECURITY_STATUS CDECL schan_get_session_peer_certificate(schan_session se for (i = 0; i < list->count; i++) { if (!(cert = (SecCertificateRef)CFArrayGetValueAtIndex(cert_array, i)) || - (SecKeychainItemExport(cert, kSecFormatX509Cert, 0, NULL, &data) != noErr)) + (SecItemExport(cert, kSecFormatX509Cert, 0, NULL, &data) != noErr)) { WARN("Couldn't extract certificate data\n"); ret = SEC_E_INTERNAL_ERROR;
1
0
0
0
Charles Davis : crypt32: Use the SecItemExport() function.
by Alexandre Julliard
28 Sep '21
28 Sep '21
Module: wine Branch: master Commit: 6eab45621c4746c8c03698b3036489f5965c2ba3 URL:
https://source.winehq.org/git/wine.git/?a=commit;h=6eab45621c4746c8c03698b3…
Author: Charles Davis <cdavis5x(a)gmail.com> Date: Mon Sep 27 15:59:24 2021 -0500 crypt32: Use the SecItemExport() function. Signed-off-by: Chip Davis <cdavis(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/crypt32/unixlib.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dlls/crypt32/unixlib.c b/dlls/crypt32/unixlib.c index dcfca5b1966..702cccb5615 100644 --- a/dlls/crypt32/unixlib.c +++ b/dlls/crypt32/unixlib.c @@ -598,7 +598,7 @@ static void load_root_certs(void) { SecCertificateRef cert = (SecCertificateRef)CFArrayGetValueAtIndex(certs, i); CFDataRef certData; - if ((status = SecKeychainItemExport(cert, kSecFormatX509Cert, 0, NULL, &certData)) == noErr) + if ((status = SecItemExport(cert, kSecFormatX509Cert, 0, NULL, &certData)) == noErr) { BYTE *data = add_cert( CFDataGetLength(certData) ); if (data) memcpy( data, CFDataGetBytePtr(certData), CFDataGetLength(certData) );
1
0
0
0
Conor McCarthy : vkd3d-shader/sm4: Skip second-order extended operands.
by Alexandre Julliard
28 Sep '21
28 Sep '21
Module: vkd3d Branch: master Commit: 04bb6c395fa68d0f29891b2968a5003106f2271f URL:
https://source.winehq.org/git/vkd3d.git/?a=commit;h=04bb6c395fa68d0f29891b2…
Author: Conor McCarthy <cmccarthy(a)codeweavers.com> Date: Tue Sep 28 16:07:24 2021 +0200 vkd3d-shader/sm4: Skip second-order extended operands. Signed-off-by: Conor McCarthy <cmccarthy(a)codeweavers.com> Signed-off-by: Henri Verbeet <hverbeet(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- libs/vkd3d-shader/dxbc.c | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/libs/vkd3d-shader/dxbc.c b/libs/vkd3d-shader/dxbc.c index 6afb92c..23814a3 100644 --- a/libs/vkd3d-shader/dxbc.c +++ b/libs/vkd3d-shader/dxbc.c @@ -1213,6 +1213,12 @@ static bool shader_sm4_read_param(struct vkd3d_sm4_data *priv, const DWORD **ptr } extended = *(*ptr)++; + if (extended & VKD3D_SM4_EXTENDED_OPERAND) + { + FIXME("Skipping second-order extended operand.\n"); + *ptr += *ptr < end; + } + type = extended & VKD3D_SM4_EXTENDED_OPERAND_TYPE_MASK; if (type == VKD3D_SM4_EXTENDED_OPERAND_MODIFIER) { @@ -1254,7 +1260,8 @@ static bool shader_sm4_read_param(struct vkd3d_sm4_data *priv, const DWORD **ptr param->non_uniform = true; extended &= ~(VKD3D_SM4_EXTENDED_OPERAND_TYPE_MASK | VKD3D_SM4_REGISTER_MODIFIER_MASK - | VKD3D_SM4_REGISTER_PRECISION_MASK | VKD3D_SM4_REGISTER_NON_UNIFORM_MASK); + | VKD3D_SM4_REGISTER_PRECISION_MASK | VKD3D_SM4_REGISTER_NON_UNIFORM_MASK + | VKD3D_SM4_EXTENDED_OPERAND); if (extended) FIXME("Skipping unhandled extended operand bits 0x%08x.\n", extended); }
1
0
0
0
← Newer
1
...
9
10
11
12
13
14
15
...
103
Older →
Jump to page:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
Results per page:
10
25
50
100
200