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
January 2023
----- 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
1 participants
467 discussions
Start a n
N
ew thread
Rémi Bernon : windows.gaming.input: Fix magnitude sign for constant and ramp effects.
by Alexandre Julliard
25 Jan '23
25 Jan '23
Module: wine Branch: master Commit: 4466e2c24c45ad483201562ebe37d1ffc0eb966d URL:
https://gitlab.winehq.org/wine/wine/-/commit/4466e2c24c45ad483201562ebe37d1…
Author: Rémi Bernon <rbernon(a)codeweavers.com> Date: Mon Jan 2 13:48:20 2023 +0100 windows.gaming.input: Fix magnitude sign for constant and ramp effects. The magnitude already carries the sign of X direction. Having a signed direction will inverse the effective direction. The Y and Z direction sign and magnitude seem to be ignored. --- dlls/dinput/tests/force_feedback.c | 18 ------------------ dlls/windows.gaming.input/force_feedback.c | 9 +++++++-- 2 files changed, 7 insertions(+), 20 deletions(-) diff --git a/dlls/dinput/tests/force_feedback.c b/dlls/dinput/tests/force_feedback.c index 6fdfa20c130..5ffc6a43471 100644 --- a/dlls/dinput/tests/force_feedback.c +++ b/dlls/dinput/tests/force_feedback.c @@ -5806,21 +5806,12 @@ static void test_windows_gaming_input(void) .report_len = 4, .report_buf = {9,0x01,0x18,0xfc}, }, - /* update effect (wine) */ - { - .code = IOCTL_HID_WRITE_REPORT, - .report_id = 3, - .report_len = 18, - .report_buf = {3,0x01,0x04,0x04,0x28,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0x7f,0x99,0x00,0x00,0x00}, - .wine_only = TRUE, .todo = TRUE, - }, /* update effect */ { .code = IOCTL_HID_WRITE_REPORT, .report_id = 3, .report_len = 18, .report_buf = {3,0x01,0x04,0x04,0x28,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0x7f,0x4e,0x01,0x00,0x00}, - .todo = TRUE, }, }; struct hid_expect expect_create_ramp[] = @@ -5915,21 +5906,12 @@ static void test_windows_gaming_input(void) .report_len = 6, .report_buf = {10,0x01,0x18,0xfc,0x60,0xf0}, }, - /* update effect (wine) */ - { - .code = IOCTL_HID_WRITE_REPORT, - .report_id = 3, - .report_len = 18, - .report_buf = {3,0x01,0x05,0x04,0x8f,0xe4,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0x99,0x00,0x00,0x00}, - .wine_only = TRUE, .todo = TRUE, - }, /* update effect */ { .code = IOCTL_HID_WRITE_REPORT, .report_id = 3, .report_len = 18, .report_buf = {3,0x01,0x05,0x04,0xff,0xff,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0x4e,0x01,0x00,0x00}, - .todo = TRUE, }, }; struct hid_expect expect_effect_start = diff --git a/dlls/windows.gaming.input/force_feedback.c b/dlls/windows.gaming.input/force_feedback.c index 20b022ff317..cff3c184bf9 100644 --- a/dlls/windows.gaming.input/force_feedback.c +++ b/dlls/windows.gaming.input/force_feedback.c @@ -117,10 +117,12 @@ static int effect_reorient_direction( const WineForceFeedbackEffectParameters *p { case WineForceFeedbackEffectType_Constant: *direction = params->constant.direction; + sign = params->constant.direction.X < 0 ? -1 : +1; break; case WineForceFeedbackEffectType_Ramp: *direction = params->ramp.start_vector; + sign = params->ramp.start_vector.X < 0 ? -1 : +1; break; case WineForceFeedbackEffectType_Periodic_SineWave: @@ -152,6 +154,7 @@ static HRESULT WINAPI effect_impl_put_Parameters( IWineForceFeedbackEffectImpl * { struct effect *impl = impl_from_IWineForceFeedbackEffectImpl( iface ); Vector3 direction = {0}; + double magnitude = 0; DWORD count = 0; HRESULT hr; int sign; @@ -161,19 +164,21 @@ static HRESULT WINAPI effect_impl_put_Parameters( IWineForceFeedbackEffectImpl * EnterCriticalSection( &impl->cs ); sign = effect_reorient_direction( ¶ms, &direction ); + /* Y and Z axes seems to be always ignored, is it really the case? */ + magnitude += direction.X * direction.X; switch (params.type) { case WineForceFeedbackEffectType_Constant: impl->repeat_count = params.constant.repeat_count; - impl->constant_force.lMagnitude = -sign * round( params.constant.gain * direction.X * 10000 ); + impl->constant_force.lMagnitude = sign * round( params.constant.gain * sqrt( magnitude ) * 10000 ); impl->params.dwDuration = min( max( params.constant.duration.Duration / 10, 0 ), INFINITE ); impl->params.dwStartDelay = min( max( params.constant.start_delay.Duration / 10, 0 ), INFINITE ); break; case WineForceFeedbackEffectType_Ramp: impl->repeat_count = params.ramp.repeat_count; - impl->ramp_force.lStart = -sign * round( params.ramp.gain * direction.X * 10000 ); + impl->ramp_force.lStart = sign * round( params.ramp.gain * sqrt( magnitude ) * 10000 ); impl->ramp_force.lEnd = round( params.ramp.gain * params.ramp.end_vector.X * 10000 ); impl->params.dwDuration = min( max( params.ramp.duration.Duration / 10, 0 ), INFINITE ); impl->params.dwStartDelay = min( max( params.ramp.start_delay.Duration / 10, 0 ), INFINITE );
1
0
0
0
Rémi Bernon : windows.gaming.input: Introduce new effect_reorient_direction helper.
by Alexandre Julliard
25 Jan '23
25 Jan '23
Module: wine Branch: master Commit: 9d06d700e85bde3e45001688b8299abc192cb1a7 URL:
https://gitlab.winehq.org/wine/wine/-/commit/9d06d700e85bde3e45001688b8299a…
Author: Rémi Bernon <rbernon(a)codeweavers.com> Date: Mon Jan 2 13:48:20 2023 +0100 windows.gaming.input: Introduce new effect_reorient_direction helper. --- dlls/windows.gaming.input/force_feedback.c | 63 +++++++++++++++++++++++------- 1 file changed, 49 insertions(+), 14 deletions(-) diff --git a/dlls/windows.gaming.input/force_feedback.c b/dlls/windows.gaming.input/force_feedback.c index d404934c3a7..20b022ff317 100644 --- a/dlls/windows.gaming.input/force_feedback.c +++ b/dlls/windows.gaming.input/force_feedback.c @@ -109,37 +109,74 @@ static ULONG WINAPI effect_impl_Release( IWineForceFeedbackEffectImpl *iface ) return ref; } +static int effect_reorient_direction( const WineForceFeedbackEffectParameters *params, Vector3 *direction ) +{ + int sign = +1; + + switch (params->type) + { + case WineForceFeedbackEffectType_Constant: + *direction = params->constant.direction; + break; + + case WineForceFeedbackEffectType_Ramp: + *direction = params->ramp.start_vector; + break; + + case WineForceFeedbackEffectType_Periodic_SineWave: + case WineForceFeedbackEffectType_Periodic_TriangleWave: + case WineForceFeedbackEffectType_Periodic_SquareWave: + case WineForceFeedbackEffectType_Periodic_SawtoothWaveDown: + case WineForceFeedbackEffectType_Periodic_SawtoothWaveUp: + *direction = params->periodic.direction; + break; + + case WineForceFeedbackEffectType_Condition_Spring: + case WineForceFeedbackEffectType_Condition_Damper: + case WineForceFeedbackEffectType_Condition_Inertia: + case WineForceFeedbackEffectType_Condition_Friction: + *direction = params->condition.direction; + sign = -1; + break; + } + + direction->X *= -sign; + direction->Y *= -sign; + direction->Z *= -sign; + + return sign; +} + static HRESULT WINAPI effect_impl_put_Parameters( IWineForceFeedbackEffectImpl *iface, WineForceFeedbackEffectParameters params, WineForceFeedbackEffectEnvelope *envelope ) { struct effect *impl = impl_from_IWineForceFeedbackEffectImpl( iface ); + Vector3 direction = {0}; DWORD count = 0; HRESULT hr; + int sign; TRACE( "iface %p, params %p, envelope %p.\n", iface, ¶ms, envelope ); EnterCriticalSection( &impl->cs ); + + sign = effect_reorient_direction( ¶ms, &direction ); + switch (params.type) { case WineForceFeedbackEffectType_Constant: impl->repeat_count = params.constant.repeat_count; - impl->constant_force.lMagnitude = round( params.constant.gain * params.constant.direction.X * 10000 ); + impl->constant_force.lMagnitude = -sign * round( params.constant.gain * direction.X * 10000 ); impl->params.dwDuration = min( max( params.constant.duration.Duration / 10, 0 ), INFINITE ); impl->params.dwStartDelay = min( max( params.constant.start_delay.Duration / 10, 0 ), INFINITE ); - if (impl->axes[count] == DIJOFS_X) impl->directions[count++] = round( -params.constant.direction.X * 10000 ); - if (impl->axes[count] == DIJOFS_Y) impl->directions[count++] = round( -params.constant.direction.Y * 10000 ); - if (impl->axes[count] == DIJOFS_Z) impl->directions[count++] = round( -params.constant.direction.Z * 10000 ); break; case WineForceFeedbackEffectType_Ramp: impl->repeat_count = params.ramp.repeat_count; - impl->ramp_force.lStart = round( params.ramp.gain * params.ramp.start_vector.X * 10000 ); + impl->ramp_force.lStart = -sign * round( params.ramp.gain * direction.X * 10000 ); impl->ramp_force.lEnd = round( params.ramp.gain * params.ramp.end_vector.X * 10000 ); impl->params.dwDuration = min( max( params.ramp.duration.Duration / 10, 0 ), INFINITE ); impl->params.dwStartDelay = min( max( params.ramp.start_delay.Duration / 10, 0 ), INFINITE ); - if (impl->axes[count] == DIJOFS_X) impl->directions[count++] = round( -params.ramp.start_vector.X * 10000 ); - if (impl->axes[count] == DIJOFS_Y) impl->directions[count++] = round( -params.ramp.start_vector.Y * 10000 ); - if (impl->axes[count] == DIJOFS_Z) impl->directions[count++] = round( -params.ramp.start_vector.Z * 10000 ); break; case WineForceFeedbackEffectType_Periodic_SineWave: @@ -154,9 +191,6 @@ static HRESULT WINAPI effect_impl_put_Parameters( IWineForceFeedbackEffectImpl * impl->periodic.lOffset = round( params.periodic.bias * 10000 ); impl->params.dwDuration = min( max( params.periodic.duration.Duration / 10, 0 ), INFINITE ); impl->params.dwStartDelay = min( max( params.periodic.start_delay.Duration / 10, 0 ), INFINITE ); - if (impl->axes[count] == DIJOFS_X) impl->directions[count++] = round( -params.periodic.direction.X * 10000 ); - if (impl->axes[count] == DIJOFS_Y) impl->directions[count++] = round( -params.periodic.direction.Y * 10000 ); - if (impl->axes[count] == DIJOFS_Z) impl->directions[count++] = round( -params.periodic.direction.Z * 10000 ); break; case WineForceFeedbackEffectType_Condition_Spring: @@ -172,12 +206,13 @@ static HRESULT WINAPI effect_impl_put_Parameters( IWineForceFeedbackEffectImpl * impl->condition.lOffset = round( params.condition.bias * 10000 ); impl->params.dwDuration = -1; impl->params.dwStartDelay = 0; - if (impl->axes[count] == DIJOFS_X) impl->directions[count++] = round( params.condition.direction.X * 10000 ); - if (impl->axes[count] == DIJOFS_Y) impl->directions[count++] = round( params.condition.direction.Y * 10000 ); - if (impl->axes[count] == DIJOFS_Z) impl->directions[count++] = round( params.condition.direction.Z * 10000 ); break; } + if (impl->axes[count] == DIJOFS_X) impl->directions[count++] = round( direction.X * 10000 ); + if (impl->axes[count] == DIJOFS_Y) impl->directions[count++] = round( direction.Y * 10000 ); + if (impl->axes[count] == DIJOFS_Z) impl->directions[count++] = round( direction.Z * 10000 ); + if (!envelope) impl->params.lpEnvelope = NULL; else {
1
0
0
0
Rémi Bernon : windows.gaming.input: Fix infinite effect duration scaling.
by Alexandre Julliard
25 Jan '23
25 Jan '23
Module: wine Branch: master Commit: d79075eb0702ad9e7812704071bb88044eb8a35b URL:
https://gitlab.winehq.org/wine/wine/-/commit/d79075eb0702ad9e7812704071bb88…
Author: Rémi Bernon <rbernon(a)codeweavers.com> Date: Wed Dec 21 12:32:07 2022 +0100 windows.gaming.input: Fix infinite effect duration scaling. --- dlls/dinput/tests/force_feedback.c | 9 --------- dlls/windows.gaming.input/force_feedback.c | 16 ++++++++-------- 2 files changed, 8 insertions(+), 17 deletions(-) diff --git a/dlls/dinput/tests/force_feedback.c b/dlls/dinput/tests/force_feedback.c index f6157a84df7..6fdfa20c130 100644 --- a/dlls/dinput/tests/force_feedback.c +++ b/dlls/dinput/tests/force_feedback.c @@ -5884,21 +5884,12 @@ static void test_windows_gaming_input(void) .report_len = 6, .report_buf = {10,0x01,0xe8,0x03,0xa0,0x0f}, }, - /* update effect (wine) */ - { - .code = IOCTL_HID_WRITE_REPORT, - .report_id = 3, - .report_len = 18, - .report_buf = {3,0x01,0x05,0x04,0x8f,0xe4,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0x4e,0x01,0x00,0x00}, - .todo = TRUE, .wine_only = TRUE, - }, /* update effect */ { .code = IOCTL_HID_WRITE_REPORT, .report_id = 3, .report_len = 18, .report_buf = {3,0x01,0x05,0x04,0xff,0xff,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0x4e,0x01,0x00,0x00}, - .todo = TRUE, }, }; struct hid_expect expect_create_ramp_neg[] = diff --git a/dlls/windows.gaming.input/force_feedback.c b/dlls/windows.gaming.input/force_feedback.c index f7a233b46d4..d404934c3a7 100644 --- a/dlls/windows.gaming.input/force_feedback.c +++ b/dlls/windows.gaming.input/force_feedback.c @@ -124,8 +124,8 @@ static HRESULT WINAPI effect_impl_put_Parameters( IWineForceFeedbackEffectImpl * case WineForceFeedbackEffectType_Constant: impl->repeat_count = params.constant.repeat_count; impl->constant_force.lMagnitude = round( params.constant.gain * params.constant.direction.X * 10000 ); - impl->params.dwDuration = params.constant.duration.Duration / 10; - impl->params.dwStartDelay = params.constant.start_delay.Duration / 10; + impl->params.dwDuration = min( max( params.constant.duration.Duration / 10, 0 ), INFINITE ); + impl->params.dwStartDelay = min( max( params.constant.start_delay.Duration / 10, 0 ), INFINITE ); if (impl->axes[count] == DIJOFS_X) impl->directions[count++] = round( -params.constant.direction.X * 10000 ); if (impl->axes[count] == DIJOFS_Y) impl->directions[count++] = round( -params.constant.direction.Y * 10000 ); if (impl->axes[count] == DIJOFS_Z) impl->directions[count++] = round( -params.constant.direction.Z * 10000 ); @@ -135,8 +135,8 @@ static HRESULT WINAPI effect_impl_put_Parameters( IWineForceFeedbackEffectImpl * 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->params.dwDuration = min( max( params.ramp.duration.Duration / 10, 0 ), INFINITE ); + impl->params.dwStartDelay = min( max( params.ramp.start_delay.Duration / 10, 0 ), INFINITE ); if (impl->axes[count] == DIJOFS_X) impl->directions[count++] = round( -params.ramp.start_vector.X * 10000 ); if (impl->axes[count] == DIJOFS_Y) impl->directions[count++] = round( -params.ramp.start_vector.Y * 10000 ); if (impl->axes[count] == DIJOFS_Z) impl->directions[count++] = round( -params.ramp.start_vector.Z * 10000 ); @@ -152,8 +152,8 @@ static HRESULT WINAPI effect_impl_put_Parameters( IWineForceFeedbackEffectImpl * 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->params.dwDuration = min( max( params.periodic.duration.Duration / 10, 0 ), INFINITE ); + impl->params.dwStartDelay = min( max( params.periodic.start_delay.Duration / 10, 0 ), INFINITE ); if (impl->axes[count] == DIJOFS_X) impl->directions[count++] = round( -params.periodic.direction.X * 10000 ); if (impl->axes[count] == DIJOFS_Y) impl->directions[count++] = round( -params.periodic.direction.Y * 10000 ); if (impl->axes[count] == DIJOFS_Z) impl->directions[count++] = round( -params.periodic.direction.Z * 10000 ); @@ -181,9 +181,9 @@ static HRESULT WINAPI effect_impl_put_Parameters( IWineForceFeedbackEffectImpl * if (!envelope) impl->params.lpEnvelope = NULL; else { - impl->envelope.dwAttackTime = envelope->attack_duration.Duration / 10; + impl->envelope.dwAttackTime = min( max( envelope->attack_duration.Duration / 10, 0 ), INFINITE ); impl->envelope.dwAttackLevel = round( envelope->attack_gain * 10000 ); - impl->envelope.dwFadeTime = impl->params.dwDuration - envelope->release_duration.Duration / 10; + impl->envelope.dwFadeTime = impl->params.dwDuration - min( max( envelope->release_duration.Duration / 10, 0 ), INFINITE ); impl->envelope.dwFadeLevel = round( envelope->release_gain * 10000 ); impl->params.lpEnvelope = &impl->envelope; }
1
0
0
0
Rémi Bernon : dinput: Avoid sending envelope report if it has been removed.
by Alexandre Julliard
25 Jan '23
25 Jan '23
Module: wine Branch: master Commit: 42082d4d3946a3911fe7b6f811b5001a5cb15f01 URL:
https://gitlab.winehq.org/wine/wine/-/commit/42082d4d3946a3911fe7b6f811b500…
Author: Rémi Bernon <rbernon(a)codeweavers.com> Date: Wed Dec 21 12:31:49 2022 +0100 dinput: Avoid sending envelope report if it has been removed. --- dlls/dinput/joystick_hid.c | 11 ++++++++++- dlls/dinput/tests/force_feedback.c | 40 -------------------------------------- 2 files changed, 10 insertions(+), 41 deletions(-) diff --git a/dlls/dinput/joystick_hid.c b/dlls/dinput/joystick_hid.c index 41fd0e24963..2ec218ffc09 100644 --- a/dlls/dinput/joystick_hid.c +++ b/dlls/dinput/joystick_hid.c @@ -2641,7 +2641,9 @@ static HRESULT WINAPI hid_joystick_effect_SetParameters( IDirectInputEffect *ifa impl->params.cbTypeSpecificParams = params->cbTypeSpecificParams; } - if ((flags & DIEP_ENVELOPE) && params->lpEnvelope) + if (!(flags & DIEP_ENVELOPE)) + TRACE( "Keeping previous effect envelope\n" ); + else if (params->lpEnvelope) { if (params->lpEnvelope->dwSize != sizeof(DIENVELOPE)) return DIERR_INVALIDPARAM; impl->params.lpEnvelope = &impl->envelope; @@ -2649,6 +2651,13 @@ static HRESULT WINAPI hid_joystick_effect_SetParameters( IDirectInputEffect *ifa impl->modified |= DIEP_ENVELOPE; memcpy( impl->params.lpEnvelope, params->lpEnvelope, sizeof(DIENVELOPE) ); } + else + { + flags &= ~DIEP_ENVELOPE; + impl->flags &= ~DIEP_ENVELOPE; + impl->modified &= ~DIEP_ENVELOPE; + impl->params.lpEnvelope = NULL; + } if (flags & DIEP_DURATION) { diff --git a/dlls/dinput/tests/force_feedback.c b/dlls/dinput/tests/force_feedback.c index 1e68748a07d..f6157a84df7 100644 --- a/dlls/dinput/tests/force_feedback.c +++ b/dlls/dinput/tests/force_feedback.c @@ -458,14 +458,6 @@ static void test_periodic_effect( IDirectInputDevice8W *device, HANDLE file, DWO .report_len = 2, .report_buf = {0x05,0x19}, }, - /* set envelope (wine) */ - { - .code = IOCTL_HID_WRITE_REPORT, - .report_id = 6, - .report_len = 7, - .report_buf = {0x06,0x19,0x4c,0x01,0x00,0x04,0x00}, - .todo = TRUE, .wine_only = TRUE, - }, /* update effect */ { .code = IOCTL_HID_WRITE_REPORT, @@ -5683,14 +5675,6 @@ static void test_windows_gaming_input(void) .report_len = 10, .report_buf = {7,0x01,0x10,0x27,0x00,0x00,0x70,0xff,0xe8,0x03}, }, - /* set envelope (wine) */ - { - .code = IOCTL_HID_WRITE_REPORT, - .report_id = 8, - .report_len = 8, - .report_buf = {8,0x01,0x00,0x00,0x00,0x00,0x00,0x00}, - .todo = TRUE, .wine_only = TRUE, - }, /* update effect */ { .code = IOCTL_HID_WRITE_REPORT, @@ -5822,14 +5806,6 @@ static void test_windows_gaming_input(void) .report_len = 4, .report_buf = {9,0x01,0x18,0xfc}, }, - /* set envelope (wine) */ - { - .code = IOCTL_HID_WRITE_REPORT, - .report_id = 8, - .report_len = 8, - .report_buf = {8,0x01,0x00,0x00,0x00,0x00,0x00,0x00}, - .todo = TRUE, .wine_only = TRUE, - }, /* update effect (wine) */ { .code = IOCTL_HID_WRITE_REPORT, @@ -5908,14 +5884,6 @@ static void test_windows_gaming_input(void) .report_len = 6, .report_buf = {10,0x01,0xe8,0x03,0xa0,0x0f}, }, - /* set envelope (wine) */ - { - .code = IOCTL_HID_WRITE_REPORT, - .report_id = 8, - .report_len = 8, - .report_buf = {8,0x01,0x00,0x00,0x00,0x00,0x00,0x00}, - .todo = TRUE, .wine_only = TRUE, - }, /* update effect (wine) */ { .code = IOCTL_HID_WRITE_REPORT, @@ -5956,14 +5924,6 @@ static void test_windows_gaming_input(void) .report_len = 6, .report_buf = {10,0x01,0x18,0xfc,0x60,0xf0}, }, - /* set envelope (wine) */ - { - .code = IOCTL_HID_WRITE_REPORT, - .report_id = 8, - .report_len = 8, - .report_buf = {8,0x01,0x00,0x00,0x00,0x00,0x00,0x00}, - .todo = TRUE, .wine_only = TRUE, - }, /* update effect (wine) */ { .code = IOCTL_HID_WRITE_REPORT,
1
0
0
0
Alistair Leslie-Hughes : include: Add _XHR enum values.
by Alexandre Julliard
25 Jan '23
25 Jan '23
Module: wine Branch: master Commit: d05ce2e72da6e576b509076224aed866ff7275cb URL:
https://gitlab.winehq.org/wine/wine/-/commit/d05ce2e72da6e576b509076224aed8…
Author: Alistair Leslie-Hughes <leslie_alistair(a)hotmail.com> Date: Tue Jan 10 16:22:14 2023 +1100 include: Add _XHR enum values. --- include/msxml6.idl | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/include/msxml6.idl b/include/msxml6.idl index 458c43e389d..d4a5c490243 100644 --- a/include/msxml6.idl +++ b/include/msxml6.idl @@ -256,6 +256,20 @@ typedef enum _SCHEMATYPEVARIETY } SCHEMATYPEVARIETY; cpp_quote("#endif /* __msxml_som_enums__ */") +typedef [v1_enum] enum _XHR_CRED_PROMPT +{ + XHR_CRED_PROMPT_ALL, + XHR_CRED_PROMPT_NONE, + XHR_CRED_PROMPT_PROXY +} XHR_CRED_PROMPT; + +typedef [v1_enum] enum _XHR_AUTH +{ + XHR_AUTH_ALL, + XHR_AUTH_NONE, + XHR_AUTH_PROXY +} XHR_AUTH; + typedef [v1_enum] enum _XHR_PROPERTY { XHR_PROP_NO_CRED_PROMPT,
1
0
0
0
Paul Gofman : ntdll: Use MemAvailable field for free RAM estimation if available.
by Alexandre Julliard
25 Jan '23
25 Jan '23
Module: wine Branch: master Commit: e41135a4a532524684a6c85141ac2c08d7fe17a5 URL:
https://gitlab.winehq.org/wine/wine/-/commit/e41135a4a532524684a6c85141ac2c…
Author: Paul Gofman <pgofman(a)codeweavers.com> Date: Sun Jan 22 17:36:44 2023 -0600 ntdll: Use MemAvailable field for free RAM estimation if available. --- dlls/ntdll/unix/system.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/dlls/ntdll/unix/system.c b/dlls/ntdll/unix/system.c index b9762fd278f..33e93bbdf32 100644 --- a/dlls/ntdll/unix/system.c +++ b/dlls/ntdll/unix/system.c @@ -1885,7 +1885,7 @@ static void get_performance_info( SYSTEM_PERFORMANCE_INFORMATION *info ) if ((fp = fopen("/proc/meminfo", "r"))) { - unsigned long long value; + unsigned long long value, mem_available = 0; char line[64]; while (fgets(line, sizeof(line), fp)) @@ -1902,8 +1902,11 @@ static void get_performance_info( SYSTEM_PERFORMANCE_INFORMATION *info ) freeram += value * 1024; else if (sscanf(line, "Cached: %llu", &value)) freeram += value * 1024; + else if (sscanf(line, "MemAvailable: %llu", &value)) + mem_available = value * 1024; } fclose(fp); + if (mem_available) freeram = mem_available; } } #elif defined(__FreeBSD__) || defined(__FreeBSD_kernel__) || defined(__NetBSD__) || \
1
0
0
0
Francois Gouget : user32: Fix a SetClipboardData() buffer overflow.
by Alexandre Julliard
25 Jan '23
25 Jan '23
Module: wine Branch: master Commit: 605ecafa67a4e034328b69396581e2f9b60d7af3 URL:
https://gitlab.winehq.org/wine/wine/-/commit/605ecafa67a4e034328b69396581e2…
Author: Francois Gouget <fgouget(a)codeweavers.com> Date: Wed Dec 21 18:48:29 2022 +0100 user32: Fix a SetClipboardData() buffer overflow. Wine would append a correctly aligned NUL Unicode character to terminate the string but overflow the buffer by one byte for odd-sized strings. Windows instead overwrites the last two buffer bytes with a NUL Unicode character which ends up being misaligned for odd-sized strings. The clipboard data has a size field anyway so match the Windows behavior. Tweak the tests to show that SetClipboardData() can overwrite half of the Unicode string's last character. --- dlls/user32/clipboard.c | 5 +++-- dlls/user32/tests/clipboard.c | 14 +++++++------- 2 files changed, 10 insertions(+), 9 deletions(-) diff --git a/dlls/user32/clipboard.c b/dlls/user32/clipboard.c index f006e205e05..72c7720dc17 100644 --- a/dlls/user32/clipboard.c +++ b/dlls/user32/clipboard.c @@ -157,12 +157,13 @@ static HANDLE marshal_data( UINT format, HANDLE handle, size_t *ret_size ) } case CF_UNICODETEXT: { - WCHAR *ptr; + char *ptr; if (!(size = GlobalSize( handle ))) return 0; if ((data_size_t)size != size) return 0; if (size < sizeof(WCHAR)) return 0; if (!(ptr = GlobalLock( handle ))) return 0; - ptr[(size + 1) / sizeof(WCHAR) - 1] = 0; /* enforce null-termination */ + /* enforce nul-termination the Windows way: ignoring alignment */ + *((WCHAR *)(ptr + size) - 1) = 0; GlobalUnlock( handle ); *ret_size = size; return handle; diff --git a/dlls/user32/tests/clipboard.c b/dlls/user32/tests/clipboard.c index 38249c24ea0..87df06b6621 100644 --- a/dlls/user32/tests/clipboard.c +++ b/dlls/user32/tests/clipboard.c @@ -2224,11 +2224,11 @@ static const struct { "", {}, 0 }, { "", {'f'}, 1 }, /* 5 */ { "", {'f'}, 2 }, - { "", {'f','o','o'}, 5 }, - { "", {'f','o','o'}, 6 }, - { "", {'f','o','o',0}, 7 }, /* 10 */ - { "", {'f','o','o',0}, 8 }, - { "", {'f','o','o',0,'b'}, 9 }, + { "", {0x3b1,0x3b2,0x3b3}, 5 }, /* Alpha, beta, ... */ + { "", {0x3b1,0x3b2,0x3b3}, 6 }, + { "", {0x3b1,0x3b2,0x3b3,0}, 7 }, /* 10 */ + { "", {0x3b1,0x3b2,0x3b3,0}, 8 }, + { "", {0x3b1,0x3b2,0x3b3,0,0x3b4}, 9 }, { "", {'f','o','o',0,'b','a','r'}, 7 * sizeof(WCHAR) }, { "", {'f','o','o',0,'b','a','r',0}, 8 * sizeof(WCHAR) }, }; @@ -2274,7 +2274,7 @@ static void test_string_data(void) { ok( clip == data, "SetClipboardData() returned %p != %p\n", clip, data ); memcpy( bufferW, test_data[i].strW, test_data[i].len ); - bufferW[(test_data[i].len + 1) / sizeof(WCHAR) - 1] = 0; + *((WCHAR *)((char *)bufferW + test_data[i].len) - 1) = 0; ok( !memcmp( data, bufferW, test_data[i].len ), "wrong data %s\n", wine_dbgstr_an( data, test_data[i].len )); } @@ -2336,7 +2336,7 @@ static void test_string_data_process( int i ) len = GlobalSize( data ); ok( len == test_data[i].len, "wrong size %u / %u\n", len, test_data[i].len ); memcpy( bufferW, test_data[i].strW, test_data[i].len ); - bufferW[(test_data[i].len + 1) / sizeof(WCHAR) - 1] = 0; + *((WCHAR *)((char *)bufferW + test_data[i].len) - 1) = 0; ok( !memcmp( data, bufferW, len ), "wrong data %s\n", wine_dbgstr_an( data, len )); }
1
0
0
0
Francois Gouget : user32: Fix a SetClipboardData() underflow and improve the tests.
by Alexandre Julliard
25 Jan '23
25 Jan '23
Module: wine Branch: master Commit: ee4f8cbb2066bf7ff2721fb081c1ab091ed8840e URL:
https://gitlab.winehq.org/wine/wine/-/commit/ee4f8cbb2066bf7ff2721fb081c1ab…
Author: Francois Gouget <fgouget(a)codeweavers.com> Date: Wed Dec 21 18:31:41 2022 +0100 user32: Fix a SetClipboardData() underflow and improve the tests. A 0 or 1 byte Unicode string cannot be NUL terminated. That does stop Windows 10 and older from doing so which is why the 1 byte test must be skipped to avoid a crash in the 64-bit case. But in such cases SetClipboardData() fails on Windows 11 and so should Wine (instead of underflowing the buffer like Windows). Reorganize the test data by increasing size. Wine-Bug:
https://bugs.winehq.org/show_bug.cgi?id=54192
--- dlls/user32/clipboard.c | 1 + dlls/user32/tests/clipboard.c | 73 +++++++++++++++++++++++++++++-------------- 2 files changed, 51 insertions(+), 23 deletions(-) diff --git a/dlls/user32/clipboard.c b/dlls/user32/clipboard.c index dd33bd7df82..f006e205e05 100644 --- a/dlls/user32/clipboard.c +++ b/dlls/user32/clipboard.c @@ -160,6 +160,7 @@ static HANDLE marshal_data( UINT format, HANDLE handle, size_t *ret_size ) WCHAR *ptr; if (!(size = GlobalSize( handle ))) return 0; if ((data_size_t)size != size) return 0; + if (size < sizeof(WCHAR)) return 0; if (!(ptr = GlobalLock( handle ))) return 0; ptr[(size + 1) / sizeof(WCHAR) - 1] = 0; /* enforce null-termination */ GlobalUnlock( handle ); diff --git a/dlls/user32/tests/clipboard.c b/dlls/user32/tests/clipboard.c index 09f01b7481a..38249c24ea0 100644 --- a/dlls/user32/tests/clipboard.c +++ b/dlls/user32/tests/clipboard.c @@ -2217,35 +2217,39 @@ static const struct UINT len; } test_data[] = { - { "foo", {}, 3 }, /* 0 */ + { "foo", {}, 3 }, /* 0 */ { "foo", {}, 4 }, { "foo\0bar", {}, 7 }, { "foo\0bar", {}, 8 }, - { "", {'f','o','o'}, 3 * sizeof(WCHAR) }, - { "", {'f','o','o',0}, 4 * sizeof(WCHAR) }, /* 5 */ + { "", {}, 0 }, + { "", {'f'}, 1 }, /* 5 */ + { "", {'f'}, 2 }, + { "", {'f','o','o'}, 5 }, + { "", {'f','o','o'}, 6 }, + { "", {'f','o','o',0}, 7 }, /* 10 */ + { "", {'f','o','o',0}, 8 }, + { "", {'f','o','o',0,'b'}, 9 }, { "", {'f','o','o',0,'b','a','r'}, 7 * sizeof(WCHAR) }, { "", {'f','o','o',0,'b','a','r',0}, 8 * sizeof(WCHAR) }, - { "", {'f','o','o'}, 1 }, - { "", {'f','o','o'}, 2 }, - { "", {'f','o','o'}, 5 }, /* 10 */ - { "", {'f','o','o',0}, 7 }, - { "", {'f','o','o',0}, 9 }, }; static void test_string_data(void) { UINT i; BOOL r; - HANDLE data; + HANDLE data, clip; char cmd[16]; char bufferA[12]; WCHAR bufferW[12]; for (i = 0; i < ARRAY_SIZE(test_data); i++) { - /* 1-byte Unicode strings crash on Win64 */ #ifdef _WIN64 - if (!test_data[i].strA[0] && test_data[i].len < sizeof(WCHAR)) continue; + /* Before Windows 11 1-byte Unicode strings crash on Win64 + * because it underflows when 'appending' a 2 bytes NUL character! + */ + if (!test_data[i].strA[0] && test_data[i].len < sizeof(WCHAR) && + strcmp(winetest_platform, "windows") == 0) continue; #endif winetest_push_context("%d", i); r = open_clipboard( 0 ); @@ -2265,11 +2269,17 @@ static void test_string_data(void) else { memcpy( data, test_data[i].strW, test_data[i].len ); - SetClipboardData( CF_UNICODETEXT, data ); - memcpy( bufferW, test_data[i].strW, test_data[i].len ); - bufferW[(test_data[i].len + 1) / sizeof(WCHAR) - 1] = 0; - ok( !memcmp( data, bufferW, test_data[i].len ), - "wrong data %s\n", wine_dbgstr_an( data, test_data[i].len )); + clip = SetClipboardData( CF_UNICODETEXT, data ); + if (test_data[i].len >= sizeof(WCHAR)) + { + ok( clip == data, "SetClipboardData() returned %p != %p\n", clip, data ); + memcpy( bufferW, test_data[i].strW, test_data[i].len ); + bufferW[(test_data[i].len + 1) / sizeof(WCHAR) - 1] = 0; + ok( !memcmp( data, bufferW, test_data[i].len ), + "wrong data %s\n", wine_dbgstr_an( data, test_data[i].len )); + } + else + ok( !clip || broken(clip != NULL), "expected SetClipboardData() to fail\n" ); } r = CloseClipboard(); ok( r, "gle %ld\n", GetLastError() ); @@ -2309,12 +2319,27 @@ static void test_string_data_process( int i ) else { data = GetClipboardData( CF_UNICODETEXT ); - ok( data != 0, "could not get data\n" ); - len = GlobalSize( data ); - ok( len == test_data[i].len, "wrong size %u / %u\n", len, test_data[i].len ); - memcpy( bufferW, test_data[i].strW, test_data[i].len ); - bufferW[(test_data[i].len + 1) / sizeof(WCHAR) - 1] = 0; - ok( !memcmp( data, bufferW, len ), "wrong data %s\n", wine_dbgstr_an( data, len )); + if (!data) + { + ok( test_data[i].len < sizeof(WCHAR), "got no data for len=%d\n", test_data[i].len ); + ok( !IsClipboardFormatAvailable( CF_UNICODETEXT ), "unicode available\n" ); + } + else if (test_data[i].len == 0) + { + /* 0-byte string handling is broken on Windows <= 10 */ + len = GlobalSize( data ); + ok( broken(len == 1), "wrong size %u / 0\n", len ); + ok( broken(*((char*)data) == 0), "wrong data %s\n", wine_dbgstr_an( data, len )); + } + else + { + len = GlobalSize( data ); + ok( len == test_data[i].len, "wrong size %u / %u\n", len, test_data[i].len ); + memcpy( bufferW, test_data[i].strW, test_data[i].len ); + bufferW[(test_data[i].len + 1) / sizeof(WCHAR) - 1] = 0; + ok( !memcmp( data, bufferW, len ), "wrong data %s\n", wine_dbgstr_an( data, len )); + } + data = GetClipboardData( CF_TEXT ); if (test_data[i].len >= sizeof(WCHAR)) { @@ -2329,8 +2354,10 @@ static void test_string_data_process( int i ) } else { + BOOL available = IsClipboardFormatAvailable( CF_TEXT ); + ok( !available || broken(available /* win10 */), + "available text %d\n", available ); ok( !data, "got data for empty string\n" ); - ok( IsClipboardFormatAvailable( CF_TEXT ), "text not available\n" ); } } r = CloseClipboard();
1
0
0
0
Francois Gouget : user32/tests: Use wine_dbgstr_an() to trace malformed Unicode strings.
by Alexandre Julliard
25 Jan '23
25 Jan '23
Module: wine Branch: master Commit: 47d492742477e5d0e94b2efda91ef7b405d34300 URL:
https://gitlab.winehq.org/wine/wine/-/commit/47d492742477e5d0e94b2efda91ef7…
Author: Francois Gouget <fgouget(a)codeweavers.com> Date: Wed Dec 21 16:11:31 2022 +0100 user32/tests: Use wine_dbgstr_an() to trace malformed Unicode strings. Using wine_dbgstr_wn() causes out-of-bounds memory accesses when given Unicode strings with odd sizes, most obviously 1 byte strings. Also trace the expected Ansi string for round-trip tests. --- dlls/user32/tests/clipboard.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/dlls/user32/tests/clipboard.c b/dlls/user32/tests/clipboard.c index 7414af996fb..09f01b7481a 100644 --- a/dlls/user32/tests/clipboard.c +++ b/dlls/user32/tests/clipboard.c @@ -2269,7 +2269,7 @@ static void test_string_data(void) memcpy( bufferW, test_data[i].strW, test_data[i].len ); bufferW[(test_data[i].len + 1) / sizeof(WCHAR) - 1] = 0; ok( !memcmp( data, bufferW, test_data[i].len ), - "wrong data %s\n", wine_dbgstr_wn( data, (test_data[i].len + 1) / sizeof(WCHAR) )); + "wrong data %s\n", wine_dbgstr_an( data, test_data[i].len )); } r = CloseClipboard(); ok( r, "gle %ld\n", GetLastError() ); @@ -2314,8 +2314,7 @@ static void test_string_data_process( int i ) ok( len == test_data[i].len, "wrong size %u / %u\n", len, test_data[i].len ); memcpy( bufferW, test_data[i].strW, test_data[i].len ); bufferW[(test_data[i].len + 1) / sizeof(WCHAR) - 1] = 0; - ok( !memcmp( data, bufferW, len ), - "wrong data %s\n", wine_dbgstr_wn( data, (len + 1) / sizeof(WCHAR) )); + ok( !memcmp( data, bufferW, len ), "wrong data %s\n", wine_dbgstr_an( data, len )); data = GetClipboardData( CF_TEXT ); if (test_data[i].len >= sizeof(WCHAR)) { @@ -2325,7 +2324,8 @@ static void test_string_data_process( int i ) bufferA, ARRAY_SIZE(bufferA), NULL, NULL ); bufferA[len2 - 1] = 0; ok( len == len2, "wrong size %u / %u\n", len, len2 ); - ok( !memcmp( data, bufferA, len ), "wrong data %.*s\n", len, (char *)data ); + ok( !memcmp( data, bufferA, len ), "wrong data %s, expected %s\n", + wine_dbgstr_an( data, len ), wine_dbgstr_an( bufferA, len2 )); } else {
1
0
0
0
Francois Gouget : user32: GetClipboardData() should set last error when the format is not found.
by Alexandre Julliard
25 Jan '23
25 Jan '23
Module: wine Branch: master Commit: 25d6c1a3b497c1530b4ed2c769ec5728b7c006bc URL:
https://gitlab.winehq.org/wine/wine/-/commit/25d6c1a3b497c1530b4ed2c769ec57…
Author: Francois Gouget <fgouget(a)codeweavers.com> Date: Tue Dec 20 15:33:56 2022 +0100 user32: GetClipboardData() should set last error when the format is not found. This has the benefit of indicating why GetClipboardData() failed and of matching the Windows 11 behavior. Wine-Bug:
https://bugs.winehq.org/show_bug.cgi?id=54190
--- dlls/user32/tests/clipboard.c | 8 ++++++-- dlls/win32u/clipboard.c | 6 +++++- 2 files changed, 11 insertions(+), 3 deletions(-) diff --git a/dlls/user32/tests/clipboard.c b/dlls/user32/tests/clipboard.c index 3131c2e0e8c..7414af996fb 100644 --- a/dlls/user32/tests/clipboard.c +++ b/dlls/user32/tests/clipboard.c @@ -986,7 +986,9 @@ static void test_synthesized(void) SetLastError(0xdeadbeef); data = GetClipboardData( CF_TEXT ); - ok(GetLastError() == 0xdeadbeef, "bad last error %ld\n", GetLastError()); + ok(GetLastError() == ERROR_NOT_FOUND /* win11 */ || + broken(GetLastError() == 0xdeadbeef), + "bad last error %ld\n", GetLastError()); ok(!data, "GetClipboardData() should have returned NULL\n"); r = CloseClipboard(); @@ -1587,7 +1589,9 @@ static void test_handles( HWND hwnd ) SetLastError( 0xdeadbeef ); data = GetClipboardData( CF_RIFF ); - ok( GetLastError() == 0xdeadbeef, "unexpected last error %ld\n", GetLastError() ); + ok( GetLastError() == ERROR_NOT_FOUND /* win11 */ || + broken(GetLastError() == 0xdeadbeef), + "unexpected last error %ld\n", GetLastError() ); ok( !data, "wrong data %p\n", data ); h = SetClipboardData( CF_PRIVATEFIRST + 7, htext4 ); diff --git a/dlls/win32u/clipboard.c b/dlls/win32u/clipboard.c index d53cd966d36..6cf484a56ca 100644 --- a/dlls/win32u/clipboard.c +++ b/dlls/win32u/clipboard.c @@ -720,7 +720,11 @@ HANDLE WINAPI NtUserGetClipboardData( UINT format, struct get_clipboard_params * params->data_size = size; return 0; } - if (status == STATUS_OBJECT_NAME_NOT_FOUND) return 0; /* no such format */ + if (status == STATUS_OBJECT_NAME_NOT_FOUND) + { + RtlSetLastWin32Error( ERROR_NOT_FOUND ); /* no such format */ + return 0; + } if (status) { RtlSetLastWin32Error( RtlNtStatusToDosError( status ));
1
0
0
0
← Newer
1
...
17
18
19
20
21
22
23
...
47
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
Results per page:
10
25
50
100
200