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
May 2022
----- 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
907 discussions
Start a n
N
ew thread
Rémi Bernon : dinput: Make sure converted direction values are always positive.
by Alexandre Julliard
18 May '22
18 May '22
Module: wine Branch: master Commit: 11cb3bbf6908261458e8b6c0ad44f7daab8b9266 URL:
https://source.winehq.org/git/wine.git/?a=commit;h=11cb3bbf6908261458e8b6c0…
Author: Rémi Bernon <rbernon(a)codeweavers.com> Date: Fri Apr 29 15:58:40 2022 +0200 dinput: Make sure converted direction values are always positive. 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/dinput/tests/force_feedback.c | 27 --------------------------- 2 files changed, 1 insertion(+), 27 deletions(-) diff --git a/dlls/dinput/joystick_hid.c b/dlls/dinput/joystick_hid.c index 07cf2e6158d..1f4b300be74 100644 --- a/dlls/dinput/joystick_hid.c +++ b/dlls/dinput/joystick_hid.c @@ -2307,6 +2307,7 @@ static void convert_directions_to_spherical( const DIEFFECT *in, DIEFFECT *out ) for (j = 1; j < i; ++j) tmp = sqrt( tmp * tmp + in->rglDirection[j] * in->rglDirection[j] ); tmp = atan2( in->rglDirection[i], tmp ); out->rglDirection[i - 1] = tmp * 18000 / M_PI; + if (out->rglDirection[i - 1] < 0) out->rglDirection[i - 1] += 36000; } if (in->cAxes) out->rglDirection[in->cAxes - 1] = 0; out->cAxes = in->cAxes; diff --git a/dlls/dinput/tests/force_feedback.c b/dlls/dinput/tests/force_feedback.c index 05b0ad9c427..c471a80de00 100644 --- a/dlls/dinput/tests/force_feedback.c +++ b/dlls/dinput/tests/force_feedback.c @@ -5476,20 +5476,11 @@ static void test_windows_gaming_input(void) .report_buf = {8,0x01,0x4c,0x7f,0x28,0x00,0x50,0x00}, }, /* update effect */ - { - .code = IOCTL_HID_WRITE_REPORT, - .report_id = 3, - .report_len = 18, - .report_buf = {3,0x01,0x02,0x08,0x78,0x00,0x00,0x00,0x00,0x00,0x0a,0x00,0xff,0xff,0xce,0x00,0x00,0x00}, - .wine_only = TRUE, - .todo = TRUE, - }, { .code = IOCTL_HID_WRITE_REPORT, .report_id = 3, .report_len = 18, .report_buf = {3,0x01,0x02,0x08,0x78,0x00,0x00,0x00,0x00,0x00,0x0a,0x00,0xff,0xff,0x4e,0x01,0x00,0x00}, - .todo = TRUE, }, }; struct hid_expect expect_create_condition[] = @@ -5554,20 +5545,11 @@ static void test_windows_gaming_input(void) .report_buf = {8,0x01,0x19,0x4c,0x14,0x00,0x3c,0x00}, }, /* update effect */ - { - .code = IOCTL_HID_WRITE_REPORT, - .report_id = 3, - .report_len = 18, - .report_buf = {3,0x01,0x04,0x08,0x5a,0x00,0x00,0x00,0x00,0x00,0x0a,0x00,0xff,0x7f,0xce,0x00,0x00,0x00}, - .wine_only = TRUE, - .todo = TRUE, - }, { .code = IOCTL_HID_WRITE_REPORT, .report_id = 3, .report_len = 18, .report_buf = {3,0x01,0x04,0x08,0x5a,0x00,0x00,0x00,0x00,0x00,0x0a,0x00,0xff,0x7f,0x4e,0x01,0x00,0x00}, - .todo = TRUE, }, }; struct hid_expect expect_create_ramp[] = @@ -5601,20 +5583,11 @@ static void test_windows_gaming_input(void) .report_buf = {8,0x01,0x19,0x4c,0x14,0x00,0x3c,0x00}, }, /* update effect */ - { - .code = IOCTL_HID_WRITE_REPORT, - .report_id = 3, - .report_len = 18, - .report_buf = {3,0x01,0x05,0x08,0x5a,0x00,0x00,0x00,0x00,0x00,0x0a,0x00,0xff,0xff,0xce,0x00,0x00,0x00}, - .wine_only = TRUE, - .todo = TRUE, - }, { .code = IOCTL_HID_WRITE_REPORT, .report_id = 3, .report_len = 18, .report_buf = {3,0x01,0x05,0x08,0x5a,0x00,0x00,0x00,0x00,0x00,0x0a,0x00,0xff,0xff,0x4e,0x01,0x00,0x00}, - .todo = TRUE, }, }; struct hid_expect expect_effect_start =
1
0
0
0
Rémi Bernon : windows.gaming.input: Implement IConditionForceEffect_SetParameters.
by Alexandre Julliard
18 May '22
18 May '22
Module: wine Branch: master Commit: 37abfa73f264217cf3499fc04ca0f58d10a9746e URL:
https://source.winehq.org/git/wine.git/?a=commit;h=37abfa73f264217cf3499fc0…
Author: Rémi Bernon <rbernon(a)codeweavers.com> Date: Thu May 12 16:03:31 2022 +0200 windows.gaming.input: Implement IConditionForceEffect_SetParameters. Signed-off-by: Rémi Bernon <rbernon(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/dinput/tests/force_feedback.c | 11 ----------- dlls/windows.gaming.input/condition_effect.c | 20 ++++++++++++++++++-- dlls/windows.gaming.input/force_feedback.c | 13 ++++++++++++- dlls/windows.gaming.input/provider.idl | 14 ++++++++++++++ 4 files changed, 44 insertions(+), 14 deletions(-) diff --git a/dlls/dinput/tests/force_feedback.c b/dlls/dinput/tests/force_feedback.c index 6903e490193..05b0ad9c427 100644 --- a/dlls/dinput/tests/force_feedback.c +++ b/dlls/dinput/tests/force_feedback.c @@ -5514,23 +5514,13 @@ static void test_windows_gaming_input(void) .report_id = 4, .report_len = 12, .report_buf = {4,0x01,0x00,0x70,0x17,0x7b,0x02,0xe9,0x04,0x4c,0x66,0x7f}, - .todo = TRUE, }, /* update effect */ - { - .code = IOCTL_HID_WRITE_REPORT, - .report_id = 3, - .report_len = 18, - .report_buf = {3,0x01,0x03,0x08,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0x5a,0x00,0x00,0x00}, - .wine_only = TRUE, - .todo = TRUE, - }, { .code = IOCTL_HID_WRITE_REPORT, .report_id = 3, .report_len = 18, .report_buf = {3,0x01,0x03,0x08,0xff,0xff,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0x99,0x00,0x00,0x00}, - .todo = TRUE, }, }; struct hid_expect expect_create_constant[] = @@ -6216,7 +6206,6 @@ static void test_windows_gaming_input(void) ok( hr == S_OK, "get_Kind returned %#lx\n", hr ); ok( condition_kind == ConditionForceEffectKind_Spring, "got kind %u\n", condition_kind ); hr = IConditionForceEffect_SetParameters( condition_effect, direction, 0.1, 0.2, 0.3, 0.4, 0.5, 0.6 ); - todo_wine ok( hr == S_OK, "SetParameters returned %#lx\n", hr ); IConditionForceEffect_Release( condition_effect ); diff --git a/dlls/windows.gaming.input/condition_effect.c b/dlls/windows.gaming.input/condition_effect.c index dccc50bb48f..c3a5a1fcd8b 100644 --- a/dlls/windows.gaming.input/condition_effect.c +++ b/dlls/windows.gaming.input/condition_effect.c @@ -110,10 +110,26 @@ static HRESULT WINAPI effect_get_Kind( IConditionForceEffect *iface, ConditionFo static HRESULT WINAPI effect_SetParameters( IConditionForceEffect *iface, Vector3 direction, FLOAT positive_coeff, FLOAT negative_coeff, FLOAT max_positive_magnitude, FLOAT max_negative_magnitude, FLOAT deadzone, FLOAT bias ) { - FIXME( "iface %p, direction %s, positive_coeff %f, negative_coeff %f, max_positive_magnitude %f, max_negative_magnitude %f, deadzone %f, bias %f stub!\n", + struct condition_effect *impl = impl_from_IConditionForceEffect( iface ); + WineForceFeedbackEffectParameters params = + { + .condition = + { + .type = WineForceFeedbackEffectType_Condition + impl->kind, + .direction = direction, + .positive_coeff = positive_coeff, + .negative_coeff = negative_coeff, + .max_positive_magnitude = max_positive_magnitude, + .max_negative_magnitude = max_negative_magnitude, + .deadzone = deadzone, + .bias = bias, + }, + }; + + TRACE( "iface %p, direction %s, positive_coeff %f, negative_coeff %f, max_positive_magnitude %f, max_negative_magnitude %f, deadzone %f, bias %f.\n", iface, debugstr_vector3( &direction ), positive_coeff, negative_coeff, max_positive_magnitude, max_negative_magnitude, deadzone, bias ); - return E_NOTIMPL; + return IWineForceFeedbackEffectImpl_put_Parameters( impl->IWineForceFeedbackEffectImpl_inner, params, NULL ); } static const struct IConditionForceEffectVtbl effect_vtbl = diff --git a/dlls/windows.gaming.input/force_feedback.c b/dlls/windows.gaming.input/force_feedback.c index 3e6b49ee1aa..dd10f86bd3e 100644 --- a/dlls/windows.gaming.input/force_feedback.c +++ b/dlls/windows.gaming.input/force_feedback.c @@ -162,7 +162,18 @@ static HRESULT WINAPI effect_impl_put_Parameters( IWineForceFeedbackEffectImpl * case WineForceFeedbackEffectType_Condition_Damper: case WineForceFeedbackEffectType_Condition_Inertia: case WineForceFeedbackEffectType_Condition_Friction: - FIXME("stub!\n"); + impl->repeat_count = 1; + impl->condition.lPositiveCoefficient = round( atan( params.condition.positive_coeff ) / M_PI_2 * 10000 ); + impl->condition.lNegativeCoefficient = round( atan( params.condition.negative_coeff ) / M_PI_2 * 10000 ); + impl->condition.dwPositiveSaturation = round( params.condition.max_positive_magnitude * 10000 ); + impl->condition.dwNegativeSaturation = round( params.condition.max_negative_magnitude * 10000 ); + impl->condition.lDeadBand = round( params.condition.deadzone * 10000 ); + impl->condition.lOffset = round( params.condition.bias * 10000 ); + impl->params.dwDuration = -1; + impl->params.dwStartDelay = 0; + impl->directions[0] = round( params.condition.direction.X * 10000 ); + impl->directions[1] = round( params.condition.direction.Y * 10000 ); + impl->directions[2] = round( params.condition.direction.Z * 10000 ); break; } diff --git a/dlls/windows.gaming.input/provider.idl b/dlls/windows.gaming.input/provider.idl index 4aacc43d80e..e7b6e96b8aa 100644 --- a/dlls/windows.gaming.input/provider.idl +++ b/dlls/windows.gaming.input/provider.idl @@ -37,6 +37,7 @@ namespace Windows.Gaming.Input.Custom { typedef enum WineForceFeedbackEffectType WineForceFeedbackEffectType; typedef struct WineGameControllerState WineGameControllerState; typedef struct WineGameControllerVibration WineGameControllerVibration; + typedef struct WineConditionEffectParameters WineConditionEffectParameters; typedef struct WineConstantEffectParameters WineConstantEffectParameters; typedef struct WineRampEffectParameters WineRampEffectParameters; typedef struct WinePeriodicEffectParameters WinePeriodicEffectParameters; @@ -92,6 +93,18 @@ namespace Windows.Gaming.Input.Custom { UINT16 right; }; + struct WineConditionEffectParameters + { + WineForceFeedbackEffectType type; + Windows.Foundation.Numerics.Vector3 direction; + FLOAT positive_coeff; + FLOAT negative_coeff; + FLOAT max_positive_magnitude; + FLOAT max_negative_magnitude; + FLOAT deadzone; + FLOAT bias; + }; + struct WineConstantEffectParameters { WineForceFeedbackEffectType type; @@ -137,6 +150,7 @@ namespace Windows.Gaming.Input.Custom { union WineForceFeedbackEffectParameters { WineForceFeedbackEffectType type; + WineConditionEffectParameters condition; WineConstantEffectParameters constant; WineRampEffectParameters ramp; WinePeriodicEffectParameters periodic;
1
0
0
0
Rémi Bernon : windows.gaming.input: Implement IPeriodicForceEffect_SetParameters(WithEnvelope).
by Alexandre Julliard
18 May '22
18 May '22
Module: wine Branch: master Commit: 84fe8c224618e3b6f2509048eb908081f2d77dc1 URL:
https://source.winehq.org/git/wine.git/?a=commit;h=84fe8c224618e3b6f2509048…
Author: Rémi Bernon <rbernon(a)codeweavers.com> Date: Thu May 12 16:02:07 2022 +0200 windows.gaming.input: Implement IPeriodicForceEffect_SetParameters(WithEnvelope). Signed-off-by: Rémi Bernon <rbernon(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/dinput/tests/force_feedback.c | 8 +---- dlls/windows.gaming.input/force_feedback.c | 11 +++++- dlls/windows.gaming.input/periodic_effect.c | 52 ++++++++++++++++++++++++++--- dlls/windows.gaming.input/provider.idl | 15 +++++++++ 4 files changed, 73 insertions(+), 13 deletions(-) diff --git a/dlls/dinput/tests/force_feedback.c b/dlls/dinput/tests/force_feedback.c index acd12f22401..6903e490193 100644 --- a/dlls/dinput/tests/force_feedback.c +++ b/dlls/dinput/tests/force_feedback.c @@ -5467,7 +5467,6 @@ static void test_windows_gaming_input(void) .report_id = 7, .report_len = 10, .report_buf = {7,0x01,0xa0,0x0f,0xd0,0x07,0x70,0xff,0x0a,0x00}, - .todo = TRUE, }, /* set envelope */ { @@ -5475,14 +5474,13 @@ static void test_windows_gaming_input(void) .report_id = 8, .report_len = 8, .report_buf = {8,0x01,0x4c,0x7f,0x28,0x00,0x50,0x00}, - .todo = TRUE, }, /* update effect */ { .code = IOCTL_HID_WRITE_REPORT, .report_id = 3, .report_len = 18, - .report_buf = {3,0x01,0x02,0x08,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0x5a,0x00,0x00,0x00}, + .report_buf = {3,0x01,0x02,0x08,0x78,0x00,0x00,0x00,0x00,0x00,0x0a,0x00,0xff,0xff,0xce,0x00,0x00,0x00}, .wine_only = TRUE, .todo = TRUE, }, @@ -6047,11 +6045,9 @@ static void test_windows_gaming_input(void) ok( hr == S_OK, "get_Kind returned %#lx\n", hr ); ok( periodic_kind == PeriodicForceEffectKind_SawtoothWaveUp, "got kind %u\n", periodic_kind ); hr = IPeriodicForceEffect_SetParameters( periodic_effect, direction, 1.0, 0.1, 0.0, duration ); - todo_wine ok( hr == S_OK, "SetParameters returned %#lx\n", hr ); hr = IPeriodicForceEffect_SetParametersWithEnvelope( periodic_effect, direction, 100.0, 0.1, 0.2, 0.3, 0.4, 0.5, delay, attack_duration, duration, release_duration, 1 ); - todo_wine ok( hr == S_OK, "SetParametersWithEnvelope returned %#lx\n", hr ); IPeriodicForceEffect_Release( periodic_effect ); @@ -6120,11 +6116,9 @@ static void test_windows_gaming_input(void) ok( hr == S_OK, "get_Kind returned %#lx\n", hr ); ok( periodic_kind == PeriodicForceEffectKind_SineWave, "got kind %u\n", periodic_kind ); hr = IPeriodicForceEffect_SetParameters( periodic_effect, direction, 1.0, 0.1, 0.0, duration ); - todo_wine ok( hr == S_OK, "SetParameters returned %#lx\n", hr ); hr = IPeriodicForceEffect_SetParametersWithEnvelope( periodic_effect, direction, 100.0, 0.1, 0.2, 0.3, 0.4, 0.5, delay, duration, duration, duration, 1 ); - todo_wine ok( hr == S_OK, "SetParametersWithEnvelope returned %#lx\n", hr ); IPeriodicForceEffect_Release( periodic_effect ); diff --git a/dlls/windows.gaming.input/force_feedback.c b/dlls/windows.gaming.input/force_feedback.c index 2ed272916c9..3e6b49ee1aa 100644 --- a/dlls/windows.gaming.input/force_feedback.c +++ b/dlls/windows.gaming.input/force_feedback.c @@ -146,7 +146,16 @@ static HRESULT WINAPI effect_impl_put_Parameters( IWineForceFeedbackEffectImpl * case WineForceFeedbackEffectType_Periodic_SquareWave: case WineForceFeedbackEffectType_Periodic_SawtoothWaveDown: case WineForceFeedbackEffectType_Periodic_SawtoothWaveUp: - FIXME("stub!\n"); + impl->repeat_count = params.periodic.repeat_count; + impl->periodic.dwMagnitude = round( params.periodic.gain * 10000 ); + impl->periodic.dwPeriod = 1000000 / params.periodic.frequency; + impl->periodic.dwPhase = round( params.periodic.phase * 36000 ); + impl->periodic.lOffset = round( params.periodic.bias * 10000 ); + impl->params.dwDuration = params.periodic.duration.Duration / 10; + impl->params.dwStartDelay = params.periodic.start_delay.Duration / 10; + impl->directions[0] = round( -params.periodic.direction.X * 10000 ); + impl->directions[1] = round( -params.periodic.direction.Y * 10000 ); + impl->directions[2] = round( -params.periodic.direction.Z * 10000 ); break; case WineForceFeedbackEffectType_Condition_Spring: diff --git a/dlls/windows.gaming.input/periodic_effect.c b/dlls/windows.gaming.input/periodic_effect.c index 81ca60f28ef..8633a8fb9b9 100644 --- a/dlls/windows.gaming.input/periodic_effect.c +++ b/dlls/windows.gaming.input/periodic_effect.c @@ -110,9 +110,26 @@ static HRESULT WINAPI effect_get_Kind( IPeriodicForceEffect *iface, PeriodicForc static HRESULT WINAPI effect_SetParameters( IPeriodicForceEffect *iface, Vector3 direction, FLOAT frequency, FLOAT phase, FLOAT bias, TimeSpan duration ) { - FIXME( "iface %p, direction %s, frequency %f, phase %f, bias %f, duration %I64u stub!\n", iface, + struct periodic_effect *impl = impl_from_IPeriodicForceEffect( iface ); + WineForceFeedbackEffectParameters params = + { + .periodic = + { + .type = WineForceFeedbackEffectType_Periodic_SquareWave + impl->kind, + .direction = direction, + .frequency = frequency, + .phase = phase, + .bias = bias, + .duration = duration, + .repeat_count = 1, + .gain = 1., + }, + }; + + TRACE( "iface %p, direction %s, frequency %f, phase %f, bias %f, duration %I64u.\n", iface, debugstr_vector3( &direction ), frequency, phase, bias, duration.Duration ); - return E_NOTIMPL; + + return IWineForceFeedbackEffectImpl_put_Parameters( impl->IWineForceFeedbackEffectImpl_inner, params, NULL ); } static HRESULT WINAPI effect_SetParametersWithEnvelope( IPeriodicForceEffect *iface, Vector3 direction, FLOAT frequency, FLOAT phase, FLOAT bias, @@ -120,11 +137,36 @@ static HRESULT WINAPI effect_SetParametersWithEnvelope( IPeriodicForceEffect *if TimeSpan attack_duration, TimeSpan sustain_duration, TimeSpan release_duration, UINT32 repeat_count ) { - FIXME( "iface %p, direction %s, frequency %f, phase %f, bias %f, attack_gain %f, sustain_gain %f, release_gain %f, start_delay %I64u, " - "attack_duration %I64u, sustain_duration %I64u, release_duration %I64u, repeat_count %u stub!\n", iface, debugstr_vector3( &direction ), + struct periodic_effect *impl = impl_from_IPeriodicForceEffect( iface ); + WineForceFeedbackEffectParameters params = + { + .periodic = + { + .type = WineForceFeedbackEffectType_Periodic_SquareWave + impl->kind, + .direction = direction, + .frequency = frequency, + .phase = phase, + .bias = bias, + .duration = {attack_duration.Duration + sustain_duration.Duration + release_duration.Duration}, + .start_delay = start_delay, + .repeat_count = repeat_count, + .gain = sustain_gain, + }, + }; + WineForceFeedbackEffectEnvelope envelope = + { + .attack_gain = attack_gain, + .release_gain = release_gain, + .attack_duration = attack_duration, + .release_duration = release_duration, + }; + + TRACE( "iface %p, direction %s, frequency %f, phase %f, bias %f, attack_gain %f, sustain_gain %f, release_gain %f, start_delay %I64u, " + "attack_duration %I64u, sustain_duration %I64u, release_duration %I64u, repeat_count %u.\n", iface, debugstr_vector3( &direction ), frequency, phase, bias, attack_gain, sustain_gain, release_gain, start_delay.Duration, attack_duration.Duration, sustain_duration.Duration, release_duration.Duration, repeat_count ); - return E_NOTIMPL; + + return IWineForceFeedbackEffectImpl_put_Parameters( impl->IWineForceFeedbackEffectImpl_inner, params, &envelope ); } static const struct IPeriodicForceEffectVtbl effect_vtbl = diff --git a/dlls/windows.gaming.input/provider.idl b/dlls/windows.gaming.input/provider.idl index 3baac4fe77d..4aacc43d80e 100644 --- a/dlls/windows.gaming.input/provider.idl +++ b/dlls/windows.gaming.input/provider.idl @@ -39,6 +39,7 @@ namespace Windows.Gaming.Input.Custom { typedef struct WineGameControllerVibration WineGameControllerVibration; typedef struct WineConstantEffectParameters WineConstantEffectParameters; typedef struct WineRampEffectParameters WineRampEffectParameters; + typedef struct WinePeriodicEffectParameters WinePeriodicEffectParameters; typedef struct WineForceFeedbackEffectEnvelope WineForceFeedbackEffectEnvelope; typedef union WineForceFeedbackEffectParameters WineForceFeedbackEffectParameters; interface IWineGameControllerProvider; @@ -112,6 +113,19 @@ namespace Windows.Gaming.Input.Custom { FLOAT gain; }; + struct WinePeriodicEffectParameters + { + WineForceFeedbackEffectType type; + Windows.Foundation.Numerics.Vector3 direction; + Windows.Foundation.TimeSpan duration; + Windows.Foundation.TimeSpan start_delay; + UINT32 repeat_count; + FLOAT frequency; + FLOAT phase; + FLOAT bias; + FLOAT gain; + }; + struct WineForceFeedbackEffectEnvelope { FLOAT attack_gain; @@ -125,6 +139,7 @@ namespace Windows.Gaming.Input.Custom { WineForceFeedbackEffectType type; WineConstantEffectParameters constant; WineRampEffectParameters ramp; + WinePeriodicEffectParameters periodic; }; [
1
0
0
0
Rémi Bernon : windows.gaming.input: Implement IRampForceEffect_SetParameters(WithEnvelope).
by Alexandre Julliard
18 May '22
18 May '22
Module: wine Branch: master Commit: 081a2891267aa65b4e8e5eb50d8d6b663a701b46 URL:
https://source.winehq.org/git/wine.git/?a=commit;h=081a2891267aa65b4e8e5eb5…
Author: Rémi Bernon <rbernon(a)codeweavers.com> Date: Thu May 12 16:00:55 2022 +0200 windows.gaming.input: Implement IRampForceEffect_SetParameters(WithEnvelope). Signed-off-by: Rémi Bernon <rbernon(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/dinput/tests/force_feedback.c | 6 +--- dlls/windows.gaming.input/force_feedback.c | 9 +++++- dlls/windows.gaming.input/provider.idl | 13 +++++++++ dlls/windows.gaming.input/ramp_effect.c | 47 ++++++++++++++++++++++++++---- 4 files changed, 64 insertions(+), 11 deletions(-) diff --git a/dlls/dinput/tests/force_feedback.c b/dlls/dinput/tests/force_feedback.c index 8d06cdda3d8..acd12f22401 100644 --- a/dlls/dinput/tests/force_feedback.c +++ b/dlls/dinput/tests/force_feedback.c @@ -5604,7 +5604,6 @@ static void test_windows_gaming_input(void) .report_id = 10, .report_len = 6, .report_buf = {10,0x01,0xc8,0x00,0x20,0x03}, - .todo = TRUE, }, /* set envelope */ { @@ -5612,14 +5611,13 @@ static void test_windows_gaming_input(void) .report_id = 8, .report_len = 8, .report_buf = {8,0x01,0x19,0x4c,0x14,0x00,0x3c,0x00}, - .todo = TRUE, }, /* update effect */ { .code = IOCTL_HID_WRITE_REPORT, .report_id = 3, .report_len = 18, - .report_buf = {3,0x01,0x05,0x08,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0x5a,0x00,0x00,0x00}, + .report_buf = {3,0x01,0x05,0x08,0x5a,0x00,0x00,0x00,0x00,0x00,0x0a,0x00,0xff,0xff,0xce,0x00,0x00,0x00}, .wine_only = TRUE, .todo = TRUE, }, @@ -6399,11 +6397,9 @@ static void test_windows_gaming_input(void) ok( hr == S_OK, "QueryInterface returned %#lx\n", hr ); hr = IRampForceEffect_SetParameters( ramp_effect, direction, end_direction, duration ); - todo_wine ok( hr == S_OK, "SetParameters returned %#lx\n", hr ); hr = IRampForceEffect_SetParametersWithEnvelope( ramp_effect, direction, end_direction, 0.1, 0.2, 0.3, delay, attack_duration, duration, release_duration, 1 ); - todo_wine ok( hr == S_OK, "SetParametersWithEnvelope returned %#lx\n", hr ); IRampForceEffect_Release( ramp_effect ); diff --git a/dlls/windows.gaming.input/force_feedback.c b/dlls/windows.gaming.input/force_feedback.c index ce30db14cd9..2ed272916c9 100644 --- a/dlls/windows.gaming.input/force_feedback.c +++ b/dlls/windows.gaming.input/force_feedback.c @@ -131,7 +131,14 @@ static HRESULT WINAPI effect_impl_put_Parameters( IWineForceFeedbackEffectImpl * break; case WineForceFeedbackEffectType_Ramp: - FIXME("stub!\n"); + impl->repeat_count = params.ramp.repeat_count; + impl->ramp_force.lStart = round( params.ramp.gain * params.ramp.start_vector.X * 10000 ); + impl->ramp_force.lEnd = round( params.ramp.gain * params.ramp.end_vector.X * 10000 ); + impl->params.dwDuration = params.ramp.duration.Duration / 10; + impl->params.dwStartDelay = params.ramp.start_delay.Duration / 10; + impl->directions[0] = round( -params.ramp.start_vector.X * 10000 ); + impl->directions[1] = round( -params.ramp.start_vector.Y * 10000 ); + impl->directions[2] = round( -params.ramp.start_vector.Z * 10000 ); break; case WineForceFeedbackEffectType_Periodic_SineWave: diff --git a/dlls/windows.gaming.input/provider.idl b/dlls/windows.gaming.input/provider.idl index 16d394e7afa..3baac4fe77d 100644 --- a/dlls/windows.gaming.input/provider.idl +++ b/dlls/windows.gaming.input/provider.idl @@ -38,6 +38,7 @@ namespace Windows.Gaming.Input.Custom { typedef struct WineGameControllerState WineGameControllerState; typedef struct WineGameControllerVibration WineGameControllerVibration; typedef struct WineConstantEffectParameters WineConstantEffectParameters; + typedef struct WineRampEffectParameters WineRampEffectParameters; typedef struct WineForceFeedbackEffectEnvelope WineForceFeedbackEffectEnvelope; typedef union WineForceFeedbackEffectParameters WineForceFeedbackEffectParameters; interface IWineGameControllerProvider; @@ -100,6 +101,17 @@ namespace Windows.Gaming.Input.Custom { FLOAT gain; }; + struct WineRampEffectParameters + { + WineForceFeedbackEffectType type; + Windows.Foundation.Numerics.Vector3 start_vector; + Windows.Foundation.Numerics.Vector3 end_vector; + Windows.Foundation.TimeSpan duration; + Windows.Foundation.TimeSpan start_delay; + UINT32 repeat_count; + FLOAT gain; + }; + struct WineForceFeedbackEffectEnvelope { FLOAT attack_gain; @@ -112,6 +124,7 @@ namespace Windows.Gaming.Input.Custom { { WineForceFeedbackEffectType type; WineConstantEffectParameters constant; + WineRampEffectParameters ramp; }; [ diff --git a/dlls/windows.gaming.input/ramp_effect.c b/dlls/windows.gaming.input/ramp_effect.c index 0a719b3e2a6..a498942cabe 100644 --- a/dlls/windows.gaming.input/ramp_effect.c +++ b/dlls/windows.gaming.input/ramp_effect.c @@ -99,9 +99,23 @@ static HRESULT WINAPI effect_GetTrustLevel( IRampForceEffect *iface, TrustLevel static HRESULT WINAPI effect_SetParameters( IRampForceEffect *iface, Vector3 start_vector, Vector3 end_vector, TimeSpan duration ) { - FIXME( "iface %p, start_vector %s, end_vector %s, duration %I64u stub!\n", iface, + WineForceFeedbackEffectParameters params = + { + .ramp = + { + .type = WineForceFeedbackEffectType_Ramp, + .start_vector = start_vector, + .end_vector = end_vector, + .duration = duration, + .repeat_count = 1, + }, + }; + struct ramp_effect *impl = impl_from_IRampForceEffect( iface ); + + TRACE( "iface %p, start_vector %s, end_vector %s, duration %I64u.\n", iface, debugstr_vector3( &start_vector ), debugstr_vector3( &end_vector ), duration.Duration ); - return E_NOTIMPL; + + return IWineForceFeedbackEffectImpl_put_Parameters( impl->IWineForceFeedbackEffectImpl_inner, params, NULL ); } static HRESULT WINAPI effect_SetParametersWithEnvelope( IRampForceEffect *iface, Vector3 start_vector, Vector3 end_vector, FLOAT attack_gain, @@ -109,11 +123,34 @@ static HRESULT WINAPI effect_SetParametersWithEnvelope( IRampForceEffect *iface, TimeSpan attack_duration, TimeSpan sustain_duration, TimeSpan release_duration, UINT32 repeat_count ) { - FIXME( "iface %p, start_vector %s, end_vector %s, attack_gain %f, sustain_gain %f, release_gain %f, start_delay %I64u, attack_duration %I64u, " - "sustain_duration %I64u, release_duration %I64u, repeat_count %u stub!\n", iface, debugstr_vector3( &start_vector ), debugstr_vector3( &end_vector ), + WineForceFeedbackEffectParameters params = + { + .ramp = + { + .type = WineForceFeedbackEffectType_Ramp, + .start_vector = start_vector, + .end_vector = end_vector, + .duration = {attack_duration.Duration + sustain_duration.Duration + release_duration.Duration}, + .start_delay = start_delay, + .repeat_count = repeat_count, + .gain = sustain_gain, + }, + }; + WineForceFeedbackEffectEnvelope envelope = + { + .attack_gain = attack_gain, + .release_gain = release_gain, + .attack_duration = attack_duration, + .release_duration = release_duration, + }; + struct ramp_effect *impl = impl_from_IRampForceEffect( iface ); + + TRACE( "iface %p, start_vector %s, end_vector %s, attack_gain %f, sustain_gain %f, release_gain %f, start_delay %I64u, attack_duration %I64u, " + "sustain_duration %I64u, release_duration %I64u, repeat_count %u.\n", iface, debugstr_vector3( &start_vector ), debugstr_vector3( &end_vector ), attack_gain, sustain_gain, release_gain, start_delay.Duration, attack_duration.Duration, sustain_duration.Duration, release_duration.Duration, repeat_count ); - return E_NOTIMPL; + + return IWineForceFeedbackEffectImpl_put_Parameters( impl->IWineForceFeedbackEffectImpl_inner, params, &envelope ); } static const struct IRampForceEffectVtbl effect_vtbl =
1
0
0
0
Rémi Bernon : windows.gaming.input: Implement IConstantForceEffect_SetParameters(WithEnvelope).
by Alexandre Julliard
18 May '22
18 May '22
Module: wine Branch: master Commit: aba20b0624aa1092035894848381288401a3143a URL:
https://source.winehq.org/git/wine.git/?a=commit;h=aba20b0624aa109203589484…
Author: Rémi Bernon <rbernon(a)codeweavers.com> Date: Thu May 12 15:59:04 2022 +0200 windows.gaming.input: Implement IConstantForceEffect_SetParameters(WithEnvelope). Signed-off-by: Rémi Bernon <rbernon(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/dinput/tests/force_feedback.c | 6 +-- dlls/windows.gaming.input/constant_effect.c | 45 ++++++++++++++++++--- dlls/windows.gaming.input/force_feedback.c | 62 +++++++++++++++++++++++++++++ dlls/windows.gaming.input/provider.idl | 29 ++++++++++++++ 4 files changed, 132 insertions(+), 10 deletions(-) Diff:
https://source.winehq.org/git/wine.git/?a=commitdiff;h=aba20b0624aa10920358…
1
0
0
0
Rémi Bernon : windows.gaming.input: Implement IForceFeedbackEffect_(get|put)_Gain.
by Alexandre Julliard
18 May '22
18 May '22
Module: wine Branch: master Commit: bc6df7ca5707d8509efb8fae1629300b7f50bf17 URL:
https://source.winehq.org/git/wine.git/?a=commit;h=bc6df7ca5707d8509efb8fae…
Author: Rémi Bernon <rbernon(a)codeweavers.com> Date: Thu May 12 15:58:05 2022 +0200 windows.gaming.input: Implement IForceFeedbackEffect_(get|put)_Gain. Signed-off-by: Rémi Bernon <rbernon(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/dinput/tests/force_feedback.c | 8 +------- dlls/windows.gaming.input/force_feedback.c | 27 +++++++++++++++++++++++---- 2 files changed, 24 insertions(+), 11 deletions(-) diff --git a/dlls/dinput/tests/force_feedback.c b/dlls/dinput/tests/force_feedback.c index da01ce63a96..7755cca1927 100644 --- a/dlls/dinput/tests/force_feedback.c +++ b/dlls/dinput/tests/force_feedback.c @@ -5572,7 +5572,7 @@ static void test_windows_gaming_input(void) .code = IOCTL_HID_WRITE_REPORT, .report_id = 3, .report_len = 18, - .report_buf = {3,0x01,0x04,0x08,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0x5a,0x00,0x00,0x00}, + .report_buf = {3,0x01,0x04,0x08,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0x7f,0x5a,0x00,0x00,0x00}, .wine_only = TRUE, .todo = TRUE, }, @@ -6061,12 +6061,9 @@ static void test_windows_gaming_input(void) gain = 12345.6; hr = IForceFeedbackEffect_get_Gain( effect, &gain ); - todo_wine ok( hr == S_OK, "get_Gain returned %#lx\n", hr ); - todo_wine ok( gain == 1.0, "got gain %f\n", gain ); hr = IForceFeedbackEffect_put_Gain( effect, 0.5 ); - todo_wine ok( hr == S_FALSE, "put_Gain returned %#lx\n", hr ); state = 0xdeadbeef; hr = IForceFeedbackEffect_get_State( effect, &state ); @@ -6317,12 +6314,9 @@ static void test_windows_gaming_input(void) gain = 12345.6; hr = IForceFeedbackEffect_get_Gain( effect, &gain ); - todo_wine ok( hr == S_OK, "get_Gain returned %#lx\n", hr ); - todo_wine ok( gain == 1.0, "get_MasterGain returned %f\n", gain ); hr = IForceFeedbackEffect_put_Gain( effect, 0.5 ); - todo_wine ok( hr == S_FALSE, "put_Gain returned %#lx\n", hr ); state = 0xdeadbeef; hr = IForceFeedbackEffect_get_State( effect, &state ); diff --git a/dlls/windows.gaming.input/force_feedback.c b/dlls/windows.gaming.input/force_feedback.c index 9f24fa8a748..667174829f5 100644 --- a/dlls/windows.gaming.input/force_feedback.c +++ b/dlls/windows.gaming.input/force_feedback.c @@ -19,6 +19,8 @@ #include "private.h" +#include "math.h" + #include "ddk/hidsdi.h" #include "dinput.h" #include "hidusage.h" @@ -117,14 +119,31 @@ DEFINE_IINSPECTABLE_OUTER( effect, IForceFeedbackEffect, struct effect, IInspect static HRESULT WINAPI effect_get_Gain( IForceFeedbackEffect *iface, DOUBLE *value ) { - FIXME( "iface %p, value %p stub!\n", iface, value ); - return E_NOTIMPL; + struct effect *impl = impl_from_IForceFeedbackEffect( iface ); + + TRACE( "iface %p, value %p.\n", iface, value ); + + EnterCriticalSection( &impl->cs ); + *value = impl->params.dwGain / 10000.; + LeaveCriticalSection( &impl->cs ); + + return S_OK; } static HRESULT WINAPI effect_put_Gain( IForceFeedbackEffect *iface, DOUBLE value ) { - FIXME( "iface %p, value %f stub!\n", iface, value ); - return E_NOTIMPL; + struct effect *impl = impl_from_IForceFeedbackEffect( iface ); + HRESULT hr; + + TRACE( "iface %p, value %f.\n", iface, value ); + + EnterCriticalSection( &impl->cs ); + impl->params.dwGain = round( value * 10000 ); + if (!impl->effect) hr = S_FALSE; + else hr = IDirectInputEffect_SetParameters( impl->effect, &impl->params, DIEP_GAIN ); + LeaveCriticalSection( &impl->cs ); + + return hr; } static HRESULT WINAPI effect_get_State( IForceFeedbackEffect *iface, ForceFeedbackEffectState *value )
1
0
0
0
Rémi Bernon : windows.gaming.input: Always assume at least two force feedback axes.
by Alexandre Julliard
18 May '22
18 May '22
Module: wine Branch: master Commit: c578aa7cd3f671a39024c45c432cd57508c11974 URL:
https://source.winehq.org/git/wine.git/?a=commit;h=c578aa7cd3f671a39024c45c…
Author: Rémi Bernon <rbernon(a)codeweavers.com> Date: Thu May 12 15:56:25 2022 +0200 windows.gaming.input: Always assume at least two force feedback axes. Signed-off-by: Rémi Bernon <rbernon(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/dinput/tests/force_feedback.c | 8 ++++---- dlls/windows.gaming.input/force_feedback.c | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/dlls/dinput/tests/force_feedback.c b/dlls/dinput/tests/force_feedback.c index 9cf636880c0..da01ce63a96 100644 --- a/dlls/dinput/tests/force_feedback.c +++ b/dlls/dinput/tests/force_feedback.c @@ -5482,7 +5482,7 @@ static void test_windows_gaming_input(void) .code = IOCTL_HID_WRITE_REPORT, .report_id = 3, .report_len = 18, - .report_buf = {3,0x01,0x02,0x08,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0x00,0x00,0x00,0x00}, + .report_buf = {3,0x01,0x02,0x08,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0x5a,0x00,0x00,0x00}, .wine_only = TRUE, .todo = TRUE, }, @@ -5523,7 +5523,7 @@ static void test_windows_gaming_input(void) .code = IOCTL_HID_WRITE_REPORT, .report_id = 3, .report_len = 18, - .report_buf = {3,0x01,0x03,0x08,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0x00,0x00,0x00,0x00}, + .report_buf = {3,0x01,0x03,0x08,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0x5a,0x00,0x00,0x00}, .wine_only = TRUE, .todo = TRUE, }, @@ -5572,7 +5572,7 @@ static void test_windows_gaming_input(void) .code = IOCTL_HID_WRITE_REPORT, .report_id = 3, .report_len = 18, - .report_buf = {3,0x01,0x04,0x08,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0x00,0x00,0x00,0x00}, + .report_buf = {3,0x01,0x04,0x08,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0x5a,0x00,0x00,0x00}, .wine_only = TRUE, .todo = TRUE, }, @@ -5621,7 +5621,7 @@ static void test_windows_gaming_input(void) .code = IOCTL_HID_WRITE_REPORT, .report_id = 3, .report_len = 18, - .report_buf = {3,0x01,0x05,0x08,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0x00,0x00,0x00,0x00}, + .report_buf = {3,0x01,0x05,0x08,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0x5a,0x00,0x00,0x00}, .wine_only = TRUE, .todo = TRUE, }, diff --git a/dlls/windows.gaming.input/force_feedback.c b/dlls/windows.gaming.input/force_feedback.c index f3b5f16f8c0..9f24fa8a748 100644 --- a/dlls/windows.gaming.input/force_feedback.c +++ b/dlls/windows.gaming.input/force_feedback.c @@ -232,7 +232,7 @@ HRESULT force_feedback_effect_create( enum WineForceFeedbackEffectType type, IIn impl->params.dwTriggerButton = -1; impl->params.dwGain = 10000; impl->params.dwFlags = DIEFF_CARTESIAN|DIEFF_OBJECTOFFSETS; - impl->params.cAxes = 0; + impl->params.cAxes = 2; impl->axes[0] = DIJOFS_X; impl->axes[1] = DIJOFS_Y; impl->axes[2] = DIJOFS_Z;
1
0
0
0
Rémi Bernon : dinput/tests: Remove IAsyncOperation reference count checks.
by Alexandre Julliard
18 May '22
18 May '22
Module: wine Branch: master Commit: 0c6f463fe10aa554c67891e30ce338f73662bccb URL:
https://source.winehq.org/git/wine.git/?a=commit;h=0c6f463fe10aa554c67891e3…
Author: Rémi Bernon <rbernon(a)codeweavers.com> Date: Wed May 18 09:59:29 2022 +0200 dinput/tests: Remove IAsyncOperation reference count checks. They are unreliable as the worker thread is holding a reference on the async operation itself. Signed-off-by: Rémi Bernon <rbernon(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/dinput/tests/force_feedback.c | 27 +++++++++------------------ 1 file changed, 9 insertions(+), 18 deletions(-) diff --git a/dlls/dinput/tests/force_feedback.c b/dlls/dinput/tests/force_feedback.c index 696828df3fc..9cf636880c0 100644 --- a/dlls/dinput/tests/force_feedback.c +++ b/dlls/dinput/tests/force_feedback.c @@ -6093,8 +6093,7 @@ static void test_windows_gaming_input(void) ret = CloseHandle( result_async_handler.event ); ok( ret, "CloseHandle failed, error %lu\n", GetLastError() ); check_result_async( result_async, 1, Error, 0x86854008, ForceFeedbackLoadEffectResult_EffectNotSupported ); - ref = IAsyncOperation_ForceFeedbackLoadEffectResult_Release( result_async ); - ok( ref == 0, "Release returned %lu\n", ref ); + IAsyncOperation_ForceFeedbackLoadEffectResult_Release( result_async ); hr = IForceFeedbackEffect_Start( effect ); todo_wine @@ -6149,8 +6148,7 @@ static void test_windows_gaming_input(void) ret = CloseHandle( result_async_handler.event ); ok( ret, "CloseHandle failed, error %lu\n", GetLastError() ); check_result_async( result_async, 1, Completed, S_OK, ForceFeedbackLoadEffectResult_Succeeded ); - ref = IAsyncOperation_ForceFeedbackLoadEffectResult_Release( result_async ); - ok( ref == 0, "Release returned %lu\n", ref ); + IAsyncOperation_ForceFeedbackLoadEffectResult_Release( result_async ); set_hid_expect( file, NULL, 0 ); set_hid_expect( file, &expect_effect_start, sizeof(expect_effect_start) ); @@ -6184,8 +6182,7 @@ static void test_windows_gaming_input(void) ret = CloseHandle( bool_async_handler.event ); ok( ret, "CloseHandle failed, error %lu\n", GetLastError() ); check_bool_async( bool_async, 1, Completed, S_OK, TRUE ); - ref = IAsyncOperation_boolean_Release( bool_async ); - ok( ref == 0, "Release returned %lu\n", ref ); + IAsyncOperation_boolean_Release( bool_async ); set_hid_expect( file, NULL, 0 ); ref = IForceFeedbackEffect_Release( effect ); @@ -6249,8 +6246,7 @@ static void test_windows_gaming_input(void) ret = CloseHandle( result_async_handler.event ); ok( ret, "CloseHandle failed, error %lu\n", GetLastError() ); check_result_async( result_async, 1, Completed, S_OK, ForceFeedbackLoadEffectResult_Succeeded ); - ref = IAsyncOperation_ForceFeedbackLoadEffectResult_Release( result_async ); - ok( ref == 0, "Release returned %lu\n", ref ); + IAsyncOperation_ForceFeedbackLoadEffectResult_Release( result_async ); set_hid_expect( file, NULL, 0 ); set_hid_expect( file, &expect_effect_start, sizeof(expect_effect_start) ); @@ -6284,8 +6280,7 @@ static void test_windows_gaming_input(void) ret = CloseHandle( bool_async_handler.event ); ok( ret, "CloseHandle failed, error %lu\n", GetLastError() ); check_bool_async( bool_async, 1, Completed, S_OK, TRUE ); - ref = IAsyncOperation_boolean_Release( bool_async ); - ok( ref == 0, "Release returned %lu\n", ref ); + IAsyncOperation_boolean_Release( bool_async ); set_hid_expect( file, NULL, 0 ); ref = IForceFeedbackEffect_Release( effect ); @@ -6355,8 +6350,7 @@ static void test_windows_gaming_input(void) ret = CloseHandle( result_async_handler.event ); ok( ret, "CloseHandle failed, error %lu\n", GetLastError() ); check_result_async( result_async, 1, Completed, S_OK, ForceFeedbackLoadEffectResult_Succeeded ); - ref = IAsyncOperation_ForceFeedbackLoadEffectResult_Release( result_async ); - ok( ref == 0, "Release returned %lu\n", ref ); + IAsyncOperation_ForceFeedbackLoadEffectResult_Release( result_async ); set_hid_expect( file, NULL, 0 ); set_hid_expect( file, &expect_effect_start, sizeof(expect_effect_start) ); @@ -6390,8 +6384,7 @@ static void test_windows_gaming_input(void) ret = CloseHandle( bool_async_handler.event ); ok( ret, "CloseHandle failed, error %lu\n", GetLastError() ); check_bool_async( bool_async, 1, Completed, S_OK, TRUE ); - ref = IAsyncOperation_boolean_Release( bool_async ); - ok( ref == 0, "Release returned %lu\n", ref ); + IAsyncOperation_boolean_Release( bool_async ); set_hid_expect( file, NULL, 0 ); ref = IForceFeedbackEffect_Release( effect ); @@ -6437,8 +6430,7 @@ static void test_windows_gaming_input(void) ret = CloseHandle( result_async_handler.event ); ok( ret, "CloseHandle failed, error %lu\n", GetLastError() ); check_result_async( result_async, 1, Completed, S_OK, ForceFeedbackLoadEffectResult_Succeeded ); - ref = IAsyncOperation_ForceFeedbackLoadEffectResult_Release( result_async ); - ok( ref == 0, "Release returned %lu\n", ref ); + IAsyncOperation_ForceFeedbackLoadEffectResult_Release( result_async ); set_hid_expect( file, NULL, 0 ); set_hid_expect( file, &expect_effect_start, sizeof(expect_effect_start) ); @@ -6472,8 +6464,7 @@ static void test_windows_gaming_input(void) ret = CloseHandle( bool_async_handler.event ); ok( ret, "CloseHandle failed, error %lu\n", GetLastError() ); check_bool_async( bool_async, 1, Completed, S_OK, TRUE ); - ref = IAsyncOperation_boolean_Release( bool_async ); - ok( ref == 0, "Release returned %lu\n", ref ); + IAsyncOperation_boolean_Release( bool_async ); set_hid_expect( file, NULL, 0 ); ref = IForceFeedbackEffect_Release( effect );
1
0
0
0
Sven Baars : d3dx10/tests: Disable a PreloadGlyphs test for d3dx10_34.
by Alexandre Julliard
18 May '22
18 May '22
Module: wine Branch: master Commit: 07cb8ef5d02ba280c317b3ebb78ab9e7f28bd97f URL:
https://source.winehq.org/git/wine.git/?a=commit;h=07cb8ef5d02ba280c317b3eb…
Author: Sven Baars <sbaars(a)codeweavers.com> Date: Sat May 7 13:17:48 2022 +0200 d3dx10/tests: Disable a PreloadGlyphs test for d3dx10_34. Wine-Bug:
https://bugs.winehq.org/show_bug.cgi?id=51827
Signed-off-by: Sven Baars <sbaars(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/d3dx10_34/tests/Makefile.in | 2 +- dlls/d3dx10_35/tests/Makefile.in | 2 +- dlls/d3dx10_36/tests/Makefile.in | 2 +- dlls/d3dx10_37/tests/Makefile.in | 2 +- dlls/d3dx10_38/tests/Makefile.in | 2 +- dlls/d3dx10_39/tests/Makefile.in | 2 +- dlls/d3dx10_40/tests/Makefile.in | 2 +- dlls/d3dx10_41/tests/Makefile.in | 2 +- dlls/d3dx10_42/tests/Makefile.in | 2 +- dlls/d3dx10_43/tests/Makefile.in | 2 +- dlls/d3dx10_43/tests/d3dx10.c | 8 ++++++-- 11 files changed, 16 insertions(+), 12 deletions(-) diff --git a/dlls/d3dx10_34/tests/Makefile.in b/dlls/d3dx10_34/tests/Makefile.in index 77795f87885..b3cb20f944e 100644 --- a/dlls/d3dx10_34/tests/Makefile.in +++ b/dlls/d3dx10_34/tests/Makefile.in @@ -1,4 +1,4 @@ -EXTRADEFS = -DWINE_NO_LONG_TYPES +EXTRADEFS = -DD3DX10_SDK_VERSION=34 -DWINE_NO_LONG_TYPES TESTDLL = d3dx10_34.dll IMPORTS = d3dx10_34 ole32 gdi32 PARENTSRC = ../../d3dx10_43/tests diff --git a/dlls/d3dx10_35/tests/Makefile.in b/dlls/d3dx10_35/tests/Makefile.in index 95777543e56..5d15ac0f99a 100644 --- a/dlls/d3dx10_35/tests/Makefile.in +++ b/dlls/d3dx10_35/tests/Makefile.in @@ -1,4 +1,4 @@ -EXTRADEFS = -DWINE_NO_LONG_TYPES +EXTRADEFS = -DD3DX10_SDK_VERSION=35 -DWINE_NO_LONG_TYPES TESTDLL = d3dx10_35.dll IMPORTS = d3dx10_35 ole32 gdi32 PARENTSRC = ../../d3dx10_43/tests diff --git a/dlls/d3dx10_36/tests/Makefile.in b/dlls/d3dx10_36/tests/Makefile.in index d2cd9c02350..a9503459208 100644 --- a/dlls/d3dx10_36/tests/Makefile.in +++ b/dlls/d3dx10_36/tests/Makefile.in @@ -1,4 +1,4 @@ -EXTRADEFS = -DWINE_NO_LONG_TYPES +EXTRADEFS = -DD3DX10_SDK_VERSION=36 -DWINE_NO_LONG_TYPES TESTDLL = d3dx10_36.dll IMPORTS = d3dx10_36 ole32 gdi32 PARENTSRC = ../../d3dx10_43/tests diff --git a/dlls/d3dx10_37/tests/Makefile.in b/dlls/d3dx10_37/tests/Makefile.in index 505f85d0c4b..e5707117a73 100644 --- a/dlls/d3dx10_37/tests/Makefile.in +++ b/dlls/d3dx10_37/tests/Makefile.in @@ -1,4 +1,4 @@ -EXTRADEFS = -DWINE_NO_LONG_TYPES +EXTRADEFS = -DD3DX10_SDK_VERSION=37 -DWINE_NO_LONG_TYPES TESTDLL = d3dx10_37.dll IMPORTS = d3dx10_37 ole32 gdi32 PARENTSRC = ../../d3dx10_43/tests diff --git a/dlls/d3dx10_38/tests/Makefile.in b/dlls/d3dx10_38/tests/Makefile.in index b5da90a2f97..c1507422b4d 100644 --- a/dlls/d3dx10_38/tests/Makefile.in +++ b/dlls/d3dx10_38/tests/Makefile.in @@ -1,4 +1,4 @@ -EXTRADEFS = -DWINE_NO_LONG_TYPES +EXTRADEFS = -DD3DX10_SDK_VERSION=38 -DWINE_NO_LONG_TYPES TESTDLL = d3dx10_38.dll IMPORTS = d3dx10_38 ole32 gdi32 PARENTSRC = ../../d3dx10_43/tests diff --git a/dlls/d3dx10_39/tests/Makefile.in b/dlls/d3dx10_39/tests/Makefile.in index 63190f1e090..fadaf089165 100644 --- a/dlls/d3dx10_39/tests/Makefile.in +++ b/dlls/d3dx10_39/tests/Makefile.in @@ -1,4 +1,4 @@ -EXTRADEFS = -DWINE_NO_LONG_TYPES +EXTRADEFS = -DD3DX10_SDK_VERSION=39 -DWINE_NO_LONG_TYPES TESTDLL = d3dx10_39.dll IMPORTS = d3dx10_39 ole32 gdi32 PARENTSRC = ../../d3dx10_43/tests diff --git a/dlls/d3dx10_40/tests/Makefile.in b/dlls/d3dx10_40/tests/Makefile.in index 669ef97d4f7..f5ffaf385a8 100644 --- a/dlls/d3dx10_40/tests/Makefile.in +++ b/dlls/d3dx10_40/tests/Makefile.in @@ -1,4 +1,4 @@ -EXTRADEFS = -DWINE_NO_LONG_TYPES +EXTRADEFS = -DD3DX10_SDK_VERSION=40 -DWINE_NO_LONG_TYPES TESTDLL = d3dx10_40.dll IMPORTS = d3dx10_40 ole32 gdi32 PARENTSRC = ../../d3dx10_43/tests diff --git a/dlls/d3dx10_41/tests/Makefile.in b/dlls/d3dx10_41/tests/Makefile.in index 85204bc4f2a..afff1c75705 100644 --- a/dlls/d3dx10_41/tests/Makefile.in +++ b/dlls/d3dx10_41/tests/Makefile.in @@ -1,4 +1,4 @@ -EXTRADEFS = -DWINE_NO_LONG_TYPES +EXTRADEFS = -DD3DX10_SDK_VERSION=41 -DWINE_NO_LONG_TYPES TESTDLL = d3dx10_41.dll IMPORTS = d3dx10_41 ole32 gdi32 PARENTSRC = ../../d3dx10_43/tests diff --git a/dlls/d3dx10_42/tests/Makefile.in b/dlls/d3dx10_42/tests/Makefile.in index 8936c5859e7..f996b86b0e6 100644 --- a/dlls/d3dx10_42/tests/Makefile.in +++ b/dlls/d3dx10_42/tests/Makefile.in @@ -1,4 +1,4 @@ -EXTRADEFS = -DWINE_NO_LONG_TYPES +EXTRADEFS = -DD3DX10_SDK_VERSION=42 -DWINE_NO_LONG_TYPES TESTDLL = d3dx10_42.dll IMPORTS = d3dx10_42 ole32 gdi32 PARENTSRC = ../../d3dx10_43/tests diff --git a/dlls/d3dx10_43/tests/Makefile.in b/dlls/d3dx10_43/tests/Makefile.in index 5cef10c80ff..95078d0e12b 100644 --- a/dlls/d3dx10_43/tests/Makefile.in +++ b/dlls/d3dx10_43/tests/Makefile.in @@ -1,4 +1,4 @@ -EXTRADEFS = -DWINE_NO_LONG_TYPES +EXTRADEFS = -DD3DX10_SDK_VERSION=43 -DWINE_NO_LONG_TYPES TESTDLL = d3dx10_43.dll IMPORTS = d3dx10 ole32 gdi32 diff --git a/dlls/d3dx10_43/tests/d3dx10.c b/dlls/d3dx10_43/tests/d3dx10.c index 9b7a4d7cc9b..4a734fe0149 100644 --- a/dlls/d3dx10_43/tests/d3dx10.c +++ b/dlls/d3dx10_43/tests/d3dx10.c @@ -2466,11 +2466,15 @@ static void test_font(void) hr = ID3DX10Font_PreloadCharacters(font, 'a', 'z'); ok(hr == S_OK, "Unexpected hr %#x.\n", hr); - /* Test glyphs that are not rendered */ - hr = ID3DX10Font_PreloadGlyphs(font, 0, 5); +#if D3DX10_SDK_VERSION > 34 + /* Test multiple textures. + * Native d3dx10_34.dll shows signs of memory corruption in this call. */ + hr = ID3DX10Font_PreloadGlyphs(font, 0, 1000); todo_wine ok(hr == S_OK, "Unexpected hr %#x.\n", hr); +#endif + /* Test glyphs that are not rendered */ for (glyph = 1; glyph < 4; ++glyph) { srv = (void *)0xdeadbeef;
1
0
0
0
Fabian Maurer : kernel32: Prevent null pointer dereference in WritePrivateProfileStructW.
by Alexandre Julliard
18 May '22
18 May '22
Module: wine Branch: master Commit: f391e9cf1ed597dd2d427ebef240b6c4244e2201 URL:
https://source.winehq.org/git/wine.git/?a=commit;h=f391e9cf1ed597dd2d427ebe…
Author: Fabian Maurer <dark.shadow4(a)web.de> Date: Mon May 16 19:29:10 2022 +0200 kernel32: Prevent null pointer dereference in WritePrivateProfileStructW. Wine-Bug:
https://bugs.winehq.org/show_bug.cgi?id=49285
Signed-off-by: Fabian Maurer <dark.shadow4(a)web.de> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/kernel32/profile.c | 5 +++++ dlls/kernel32/tests/profile.c | 6 ++++++ 2 files changed, 11 insertions(+) diff --git a/dlls/kernel32/profile.c b/dlls/kernel32/profile.c index e70874fa36f..bf1a9170896 100644 --- a/dlls/kernel32/profile.c +++ b/dlls/kernel32/profile.c @@ -2044,9 +2044,14 @@ BOOL WINAPI WritePrivateProfileStructW (LPCWSTR section, LPCWSTR key, LPWSTR outstring, p; DWORD sum = 0; + TRACE("(%s %s %p %u %s)\n", debugstr_w(section), debugstr_w(key), buf, bufsize, debugstr_w(filename)); + if (!section && !key && !buf) /* flush the cache */ return WritePrivateProfileStringW( NULL, NULL, NULL, filename ); + if (!buf) + return WritePrivateProfileStringW(section, key, NULL, filename); + /* allocate string buffer for hex chars + checksum hex char + '\0' */ outstring = HeapAlloc( GetProcessHeap(), 0, (bufsize*2 + 2 + 1) * sizeof(WCHAR) ); p = outstring; diff --git a/dlls/kernel32/tests/profile.c b/dlls/kernel32/tests/profile.c index 71d945f81df..18e12690f18 100644 --- a/dlls/kernel32/tests/profile.c +++ b/dlls/kernel32/tests/profile.c @@ -1109,6 +1109,7 @@ static void test_WritePrivateProfileString(void) static void test_profile_struct(void) { static const char expect_data[] = "[s]\r\nkey=616261637573006F\r\n"; + static const char expect_data_empty[] = "[s]\r\n"; char buffer[20]; BOOL ret; @@ -1173,6 +1174,11 @@ static void test_profile_struct(void) ok(!ret, "expected failure\n"); todo_wine ok(GetLastError() == ERROR_BAD_LENGTH, "got error %lu\n", GetLastError()); + /* Test deleting struct */ + ret = WritePrivateProfileStructA("s", "key", NULL, sizeof("abacus"), "./winetest.ini"); + ok(ret, "got error %lu\n", GetLastError()); + ok(check_file_data("./winetest.ini", expect_data_empty), "file doesn't match\n"); + ret = DeleteFileA("./winetest.ini"); ok(ret, "got error %lu\n", GetLastError()); }
1
0
0
0
← Newer
1
...
36
37
38
39
40
41
42
...
91
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
Results per page:
10
25
50
100
200