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
October 2021
----- 2025 -----
February 2025
January 2025
----- 2024 -----
December 2024
November 2024
October 2024
September 2024
August 2024
July 2024
June 2024
May 2024
April 2024
March 2024
February 2024
January 2024
----- 2023 -----
December 2023
November 2023
October 2023
September 2023
August 2023
July 2023
June 2023
May 2023
April 2023
March 2023
February 2023
January 2023
----- 2022 -----
December 2022
November 2022
October 2022
September 2022
August 2022
July 2022
June 2022
May 2022
April 2022
March 2022
February 2022
January 2022
----- 2021 -----
December 2021
November 2021
October 2021
September 2021
August 2021
July 2021
June 2021
May 2021
April 2021
March 2021
February 2021
January 2021
----- 2020 -----
December 2020
November 2020
October 2020
September 2020
August 2020
July 2020
June 2020
May 2020
April 2020
March 2020
February 2020
January 2020
----- 2019 -----
December 2019
November 2019
October 2019
September 2019
August 2019
July 2019
June 2019
May 2019
April 2019
March 2019
February 2019
January 2019
----- 2018 -----
December 2018
November 2018
October 2018
September 2018
August 2018
July 2018
June 2018
May 2018
April 2018
March 2018
February 2018
January 2018
----- 2017 -----
December 2017
November 2017
October 2017
September 2017
August 2017
July 2017
June 2017
May 2017
April 2017
March 2017
February 2017
January 2017
----- 2016 -----
December 2016
November 2016
October 2016
September 2016
August 2016
July 2016
June 2016
May 2016
April 2016
March 2016
February 2016
January 2016
----- 2015 -----
December 2015
November 2015
October 2015
September 2015
August 2015
July 2015
June 2015
May 2015
April 2015
March 2015
February 2015
January 2015
----- 2014 -----
December 2014
November 2014
October 2014
September 2014
August 2014
July 2014
June 2014
May 2014
April 2014
March 2014
February 2014
January 2014
----- 2013 -----
December 2013
November 2013
October 2013
September 2013
August 2013
July 2013
June 2013
May 2013
April 2013
March 2013
February 2013
January 2013
----- 2012 -----
December 2012
November 2012
October 2012
September 2012
August 2012
July 2012
June 2012
May 2012
April 2012
March 2012
February 2012
January 2012
----- 2011 -----
December 2011
November 2011
October 2011
September 2011
August 2011
July 2011
June 2011
May 2011
April 2011
March 2011
February 2011
January 2011
----- 2010 -----
December 2010
November 2010
October 2010
September 2010
August 2010
July 2010
June 2010
May 2010
April 2010
March 2010
February 2010
January 2010
----- 2009 -----
December 2009
November 2009
October 2009
September 2009
August 2009
July 2009
June 2009
May 2009
April 2009
March 2009
February 2009
January 2009
----- 2008 -----
December 2008
November 2008
October 2008
September 2008
August 2008
July 2008
June 2008
May 2008
April 2008
March 2008
February 2008
January 2008
----- 2007 -----
December 2007
November 2007
October 2007
September 2007
August 2007
July 2007
June 2007
May 2007
April 2007
March 2007
February 2007
January 2007
----- 2006 -----
December 2006
November 2006
October 2006
September 2006
August 2006
July 2006
June 2006
May 2006
April 2006
March 2006
February 2006
January 2006
----- 2005 -----
December 2005
November 2005
October 2005
September 2005
August 2005
July 2005
June 2005
May 2005
April 2005
March 2005
February 2005
January 2005
----- 2004 -----
December 2004
November 2004
October 2004
September 2004
August 2004
July 2004
June 2004
May 2004
April 2004
March 2004
February 2004
January 2004
----- 2003 -----
December 2003
November 2003
October 2003
September 2003
August 2003
July 2003
June 2003
May 2003
April 2003
March 2003
February 2003
January 2003
----- 2002 -----
December 2002
November 2002
October 2002
September 2002
August 2002
July 2002
June 2002
May 2002
April 2002
March 2002
February 2002
January 2002
----- 2001 -----
December 2001
November 2001
October 2001
September 2001
August 2001
July 2001
June 2001
May 2001
April 2001
March 2001
February 2001
wine-commits@winehq.org
2 participants
1165 discussions
Start a n
N
ew thread
Rémi Bernon : dinput: Partially implement HID joystick IDirectInputEffect_GetParameters.
by Alexandre Julliard
07 Oct '21
07 Oct '21
Module: wine Branch: master Commit: 35ea577409347b90920fedd11a5402686a3653ae URL:
https://source.winehq.org/git/wine.git/?a=commit;h=35ea577409347b90920fedd1…
Author: Rémi Bernon <rbernon(a)codeweavers.com> Date: Thu Oct 7 10:40:05 2021 +0200 dinput: Partially implement HID joystick IDirectInputEffect_GetParameters. Signed-off-by: Rémi Bernon <rbernon(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/dinput/joystick_hid.c | 162 ++++++++++++++++++++++++++++++++++++++++++++- dlls/dinput8/tests/hid.c | 48 -------------- 2 files changed, 160 insertions(+), 50 deletions(-) Diff:
https://source.winehq.org/git/wine.git/?a=commitdiff;h=35ea577409347b90920f…
1
0
0
0
Rémi Bernon : dinput: Implement HID joystick IDirectInputEffect_(Start|Stop).
by Alexandre Julliard
07 Oct '21
07 Oct '21
Module: wine Branch: master Commit: 33dc3db01e5a972cbc58f795869b44d9c61ed89e URL:
https://source.winehq.org/git/wine.git/?a=commit;h=33dc3db01e5a972cbc58f795…
Author: Rémi Bernon <rbernon(a)codeweavers.com> Date: Thu Oct 7 10:40:04 2021 +0200 dinput: Implement HID joystick IDirectInputEffect_(Start|Stop). Signed-off-by: Rémi Bernon <rbernon(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/dinput/joystick_hid.c | 92 ++++++++++++++++++++++++++++++++++++++++++++-- dlls/dinput8/tests/hid.c | 5 --- 2 files changed, 88 insertions(+), 9 deletions(-) diff --git a/dlls/dinput/joystick_hid.c b/dlls/dinput/joystick_hid.c index 624cea4d77a..002b16fe84b 100644 --- a/dlls/dinput/joystick_hid.c +++ b/dlls/dinput/joystick_hid.c @@ -145,6 +145,7 @@ struct hid_joystick_effect IDirectInputEffect IDirectInputEffect_iface; LONG ref; USAGE type; + ULONG index; struct list entry; struct hid_joystick *joystick; @@ -2134,14 +2135,97 @@ static HRESULT WINAPI hid_joystick_effect_SetParameters( IDirectInputEffect *ifa static HRESULT WINAPI hid_joystick_effect_Start( IDirectInputEffect *iface, DWORD iterations, DWORD flags ) { - FIXME( "iface %p, iterations %u, flags %#x stub!\n", iface, iterations, flags ); - return DIERR_UNSUPPORTED; + struct hid_joystick_effect *impl = impl_from_IDirectInputEffect( iface ); + struct pid_control_report *effect_control = &impl->joystick->pid_effect_control; + ULONG count, report_len = impl->joystick->caps.OutputReportByteLength; + PHIDP_PREPARSED_DATA preparsed = impl->joystick->preparsed; + HANDLE device = impl->joystick->device; + NTSTATUS status; + USAGE control; + HRESULT hr; + + TRACE( "iface %p, iterations %u, flags %#x.\n", iface, iterations, flags ); + + if ((flags & ~(DIES_NODOWNLOAD|DIES_SOLO))) return DIERR_INVALIDPARAM; + if (flags & DIES_SOLO) control = PID_USAGE_OP_EFFECT_START_SOLO; + else control = PID_USAGE_OP_EFFECT_START; + + EnterCriticalSection( &impl->joystick->base.crit ); + if (!impl->joystick->base.acquired || !(impl->joystick->base.dwCoopLevel & DISCL_EXCLUSIVE)) + hr = DIERR_NOTEXCLUSIVEACQUIRED; + else if ((flags & DIES_NODOWNLOAD) && !impl->index) + hr = DIERR_NOTDOWNLOADED; + else if ((flags & DIES_NODOWNLOAD) || !FAILED(hr = IDirectInputEffect_Download( iface ))) + { + count = 1; + status = HidP_InitializeReportForID( HidP_Output, effect_control->id, preparsed, + impl->effect_control_buf, report_len ); + + if (status != HIDP_STATUS_SUCCESS) hr = status; + else status = HidP_SetUsageValue( HidP_Output, HID_USAGE_PAGE_PID, 0, PID_USAGE_EFFECT_BLOCK_INDEX, + impl->index, preparsed, impl->effect_control_buf, report_len ); + + if (status != HIDP_STATUS_SUCCESS) hr = status; + else status = HidP_SetUsages( HidP_Output, HID_USAGE_PAGE_PID, effect_control->control_coll, + &control, &count, preparsed, impl->effect_control_buf, report_len ); + + if (status != HIDP_STATUS_SUCCESS) hr = status; + else status = HidP_SetUsageValue( HidP_Output, HID_USAGE_PAGE_PID, 0, PID_USAGE_LOOP_COUNT, + iterations, preparsed, impl->effect_control_buf, report_len ); + + if (status != HIDP_STATUS_SUCCESS) hr = status; + else if (WriteFile( device, impl->effect_control_buf, report_len, NULL, NULL )) hr = DI_OK; + else hr = DIERR_INPUTLOST; + } + LeaveCriticalSection( &impl->joystick->base.crit ); + + return hr; } static HRESULT WINAPI hid_joystick_effect_Stop( IDirectInputEffect *iface ) { - FIXME( "iface %p stub!\n", iface ); - return DIERR_UNSUPPORTED; + struct hid_joystick_effect *impl = impl_from_IDirectInputEffect( iface ); + struct pid_control_report *effect_control = &impl->joystick->pid_effect_control; + ULONG count, report_len = impl->joystick->caps.OutputReportByteLength; + PHIDP_PREPARSED_DATA preparsed = impl->joystick->preparsed; + HANDLE device = impl->joystick->device; + NTSTATUS status; + USAGE control; + HRESULT hr; + + TRACE( "iface %p.\n", iface ); + + EnterCriticalSection( &impl->joystick->base.crit ); + if (!impl->joystick->base.acquired || !(impl->joystick->base.dwCoopLevel & DISCL_EXCLUSIVE)) + hr = DIERR_NOTEXCLUSIVEACQUIRED; + else if (!impl->index) + hr = DIERR_NOTDOWNLOADED; + else + { + count = 1; + control = PID_USAGE_OP_EFFECT_STOP; + status = HidP_InitializeReportForID( HidP_Output, effect_control->id, preparsed, + impl->effect_control_buf, report_len ); + + if (status != HIDP_STATUS_SUCCESS) hr = status; + else status = HidP_SetUsageValue( HidP_Output, HID_USAGE_PAGE_PID, 0, PID_USAGE_EFFECT_BLOCK_INDEX, + impl->index, preparsed, impl->effect_control_buf, report_len ); + + if (status != HIDP_STATUS_SUCCESS) hr = status; + else status = HidP_SetUsages( HidP_Output, HID_USAGE_PAGE_PID, effect_control->control_coll, + &control, &count, preparsed, impl->effect_control_buf, report_len ); + + if (status != HIDP_STATUS_SUCCESS) hr = status; + else status = HidP_SetUsageValue( HidP_Output, HID_USAGE_PAGE_PID, 0, PID_USAGE_LOOP_COUNT, + 0, preparsed, impl->effect_control_buf, report_len ); + + if (status != HIDP_STATUS_SUCCESS) hr = status; + else if (WriteFile( device, impl->effect_control_buf, report_len, NULL, NULL )) hr = DI_OK; + else hr = DIERR_INPUTLOST; + } + LeaveCriticalSection( &impl->joystick->base.crit ); + + return hr; } static HRESULT WINAPI hid_joystick_effect_GetEffectStatus( IDirectInputEffect *iface, DWORD *status ) diff --git a/dlls/dinput8/tests/hid.c b/dlls/dinput8/tests/hid.c index eb774dd5fe3..a53502ca8d4 100644 --- a/dlls/dinput8/tests/hid.c +++ b/dlls/dinput8/tests/hid.c @@ -5765,10 +5765,8 @@ static void test_periodic_effect( IDirectInputDevice8W *device, HANDLE file ) check_member( periodic, expect_periodic, "%u", dwPeriod ); hr = IDirectInputEffect_Start( effect, 1, DIES_NODOWNLOAD ); - todo_wine ok( hr == DIERR_NOTDOWNLOADED, "Start returned %#x\n", hr ); hr = IDirectInputEffect_Stop( effect ); - todo_wine ok( hr == DIERR_NOTDOWNLOADED, "Stop returned %#x\n", hr ); set_hid_expect( file, expect_download, 3 * sizeof(struct hid_expect) ); @@ -5782,7 +5780,6 @@ static void test_periodic_effect( IDirectInputDevice8W *device, HANDLE file ) ok( hr == DI_NOEFFECT, "Download returned %#x\n", hr ); hr = IDirectInputEffect_Start( effect, 1, 0xdeadbeef ); - todo_wine ok( hr == DIERR_INVALIDPARAM, "Start returned %#x\n", hr ); set_hid_expect( file, &expect_start_solo, sizeof(expect_start_solo) ); @@ -5845,10 +5842,8 @@ static void test_periodic_effect( IDirectInputDevice8W *device, HANDLE file ) set_hid_expect( file, NULL, 0 ); hr = IDirectInputEffect_Start( effect, 1, DIES_NODOWNLOAD ); - todo_wine ok( hr == DIERR_NOTEXCLUSIVEACQUIRED, "Start returned %#x\n", hr ); hr = IDirectInputEffect_Stop( effect ); - todo_wine ok( hr == DIERR_NOTEXCLUSIVEACQUIRED, "Stop returned %#x\n", hr ); set_hid_expect( file, &expect_dc_reset, sizeof(expect_dc_reset) );
1
0
0
0
Rémi Bernon : dinput8/tests: Add some HID joystick IDirectInputEffect_(Start|Stop) tests.
by Alexandre Julliard
07 Oct '21
07 Oct '21
Module: wine Branch: master Commit: 4315d27992f68a4037182e5147a4c790be5665ee URL:
https://source.winehq.org/git/wine.git/?a=commit;h=4315d27992f68a4037182e51…
Author: Rémi Bernon <rbernon(a)codeweavers.com> Date: Thu Oct 7 10:40:03 2021 +0200 dinput8/tests: Add some HID joystick IDirectInputEffect_(Start|Stop) tests. Signed-off-by: Rémi Bernon <rbernon(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/dinput8/tests/hid.c | 89 ++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 89 insertions(+) diff --git a/dlls/dinput8/tests/hid.c b/dlls/dinput8/tests/hid.c index 7388a7499c4..eb774dd5fe3 100644 --- a/dlls/dinput8/tests/hid.c +++ b/dlls/dinput8/tests/hid.c @@ -5122,6 +5122,46 @@ static void test_periodic_effect( IDirectInputDevice8W *device, HANDLE file ) .report_buf = {0x02,0x01,0x01,0x01}, }, }; + struct hid_expect expect_start = + { + .code = IOCTL_HID_WRITE_REPORT, + .todo = TRUE, + .report_id = 2, + .report_len = 4, + .report_buf = {0x02, 0x01, 0x01, 0x01}, + }; + struct hid_expect expect_start_solo = + { + .code = IOCTL_HID_WRITE_REPORT, + .todo = TRUE, + .report_id = 2, + .report_len = 4, + .report_buf = {0x02, 0x01, 0x02, 0x01}, + }; + struct hid_expect expect_start_0 = + { + .code = IOCTL_HID_WRITE_REPORT, + .todo = TRUE, + .report_id = 2, + .report_len = 4, + .report_buf = {0x02, 0x01, 0x01, 0x00}, + }; + struct hid_expect expect_start_4 = + { + .code = IOCTL_HID_WRITE_REPORT, + .todo = TRUE, + .report_id = 2, + .report_len = 4, + .report_buf = {0x02, 0x01, 0x01, 0x04}, + }; + struct hid_expect expect_stop = + { + .code = IOCTL_HID_WRITE_REPORT, + .todo = TRUE, + .report_id = 2, + .report_len = 4, + .report_buf = {0x02, 0x01, 0x03, 0x00}, + }; struct hid_expect expect_unload[] = { { @@ -5131,6 +5171,7 @@ static void test_periodic_effect( IDirectInputDevice8W *device, HANDLE file ) .report_len = 4, .report_buf = {0x02,0x01,0x03,0x00}, }, + /* device reset, when unloaded from Unacquire */ { .code = IOCTL_HID_WRITE_REPORT, .report_id = 1, @@ -5723,6 +5764,13 @@ static void test_periodic_effect( IDirectInputDevice8W *device, HANDLE file ) todo_wine check_member( periodic, expect_periodic, "%u", dwPeriod ); + hr = IDirectInputEffect_Start( effect, 1, DIES_NODOWNLOAD ); + todo_wine + ok( hr == DIERR_NOTDOWNLOADED, "Start returned %#x\n", hr ); + hr = IDirectInputEffect_Stop( effect ); + todo_wine + ok( hr == DIERR_NOTDOWNLOADED, "Stop returned %#x\n", hr ); + set_hid_expect( file, expect_download, 3 * sizeof(struct hid_expect) ); hr = IDirectInputEffect_Download( effect ); todo_wine @@ -5733,6 +5781,40 @@ static void test_periodic_effect( IDirectInputDevice8W *device, HANDLE file ) todo_wine ok( hr == DI_NOEFFECT, "Download returned %#x\n", hr ); + hr = IDirectInputEffect_Start( effect, 1, 0xdeadbeef ); + todo_wine + ok( hr == DIERR_INVALIDPARAM, "Start returned %#x\n", hr ); + + set_hid_expect( file, &expect_start_solo, sizeof(expect_start_solo) ); + hr = IDirectInputEffect_Start( effect, 1, DIES_SOLO ); + todo_wine + ok( hr == DI_OK, "Start returned %#x\n", hr ); + set_hid_expect( file, NULL, 0 ); + + set_hid_expect( file, &expect_stop, sizeof(expect_stop) ); + hr = IDirectInputEffect_Stop( effect ); + todo_wine + ok( hr == DI_OK, "Stop returned %#x\n", hr ); + set_hid_expect( file, NULL, 0 ); + + set_hid_expect( file, &expect_start, sizeof(expect_start) ); + hr = IDirectInputEffect_Start( effect, 1, 0 ); + todo_wine + ok( hr == DI_OK, "Start returned %#x\n", hr ); + set_hid_expect( file, NULL, 0 ); + + set_hid_expect( file, &expect_start_4, sizeof(expect_start_4) ); + hr = IDirectInputEffect_Start( effect, 4, 0 ); + todo_wine + ok( hr == DI_OK, "Start returned %#x\n", hr ); + set_hid_expect( file, NULL, 0 ); + + set_hid_expect( file, &expect_start_0, sizeof(expect_start_4) ); + hr = IDirectInputEffect_Start( effect, 0, 0 ); + todo_wine + ok( hr == DI_OK, "Start returned %#x\n", hr ); + set_hid_expect( file, NULL, 0 ); + set_hid_expect( file, expect_unload, sizeof(struct hid_expect) ); hr = IDirectInputEffect_Unload( effect ); todo_wine @@ -5762,6 +5844,13 @@ static void test_periodic_effect( IDirectInputDevice8W *device, HANDLE file ) ok( hr == DI_OK, "Unacquire returned: %#x\n", hr ); set_hid_expect( file, NULL, 0 ); + hr = IDirectInputEffect_Start( effect, 1, DIES_NODOWNLOAD ); + todo_wine + ok( hr == DIERR_NOTEXCLUSIVEACQUIRED, "Start returned %#x\n", hr ); + hr = IDirectInputEffect_Stop( effect ); + todo_wine + ok( hr == DIERR_NOTEXCLUSIVEACQUIRED, "Stop returned %#x\n", hr ); + set_hid_expect( file, &expect_dc_reset, sizeof(expect_dc_reset) ); hr = IDirectInputDevice8_Acquire( device ); ok( hr == DI_OK, "Acquire returned: %#x\n", hr );
1
0
0
0
Rémi Bernon : dinput8/tests: Add some HID joystick IDirectInputEffect_(Download|Unload) tests.
by Alexandre Julliard
07 Oct '21
07 Oct '21
Module: wine Branch: master Commit: 93677c124ace56a0645ccceef391ba3139df593b URL:
https://source.winehq.org/git/wine.git/?a=commit;h=93677c124ace56a0645cccee…
Author: Rémi Bernon <rbernon(a)codeweavers.com> Date: Thu Oct 7 10:40:02 2021 +0200 dinput8/tests: Add some HID joystick IDirectInputEffect_(Download|Unload) tests. Signed-off-by: Rémi Bernon <rbernon(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/dinput8/tests/hid.c | 153 +++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 153 insertions(+) diff --git a/dlls/dinput8/tests/hid.c b/dlls/dinput8/tests/hid.c index 3ec837abee4..7388a7499c4 100644 --- a/dlls/dinput8/tests/hid.c +++ b/dlls/dinput8/tests/hid.c @@ -5087,6 +5087,57 @@ static BOOL test_device_types(void) static void test_periodic_effect( IDirectInputDevice8W *device, HANDLE file ) { + struct hid_expect expect_download[] = + { + /* set periodic */ + { + .code = IOCTL_HID_WRITE_REPORT, + .todo = TRUE, + .report_id = 5, + .report_len = 2, + .report_buf = {0x05,0x19}, + }, + /* set envelope */ + { + .code = IOCTL_HID_WRITE_REPORT, + .todo = TRUE, + .report_id = 6, + .report_len = 7, + .report_buf = {0x06,0x19,0x4c,0x02,0x00,0x04,0x00}, + }, + /* update effect */ + { + .code = IOCTL_HID_WRITE_REPORT, + .todo = TRUE, + .report_id = 3, + .report_len = 9, + .report_buf = {0x03,0x01,0x01,0x08,0x01,0x00,0x06,0x00,0x01}, + }, + /* start command when DIEP_START is set */ + { + .code = IOCTL_HID_WRITE_REPORT, + .todo = TRUE, + .report_id = 2, + .report_len = 4, + .report_buf = {0x02,0x01,0x01,0x01}, + }, + }; + struct hid_expect expect_unload[] = + { + { + .code = IOCTL_HID_WRITE_REPORT, + .todo = TRUE, + .report_id = 2, + .report_len = 4, + .report_buf = {0x02,0x01,0x03,0x00}, + }, + { + .code = IOCTL_HID_WRITE_REPORT, + .report_id = 1, + .report_len = 2, + .report_buf = {1,0x01}, + }, + }; struct hid_expect expect_dc_reset = { .code = IOCTL_HID_WRITE_REPORT, @@ -5368,6 +5419,25 @@ static void test_periodic_effect( IDirectInputDevice8W *device, HANDLE file ) todo_wine check_member( desc, expect_desc_init, "%u", dwStartDelay ); + set_hid_expect( file, &expect_dc_reset, sizeof(expect_dc_reset) ); + hr = IDirectInputDevice8_Unacquire( device ); + ok( hr == DI_OK, "Unacquire returned: %#x\n", hr ); + set_hid_expect( file, NULL, 0 ); + hr = IDirectInputEffect_Download( effect ); + todo_wine + ok( hr == DIERR_NOTEXCLUSIVEACQUIRED, "Download returned %#x\n", hr ); + set_hid_expect( file, &expect_dc_reset, sizeof(expect_dc_reset) ); + hr = IDirectInputDevice8_Acquire( device ); + ok( hr == DI_OK, "Acquire returned: %#x\n", hr ); + set_hid_expect( file, NULL, 0 ); + + hr = IDirectInputEffect_Download( effect ); + todo_wine + ok( hr == DIERR_INCOMPLETEEFFECT, "Download returned %#x\n", hr ); + hr = IDirectInputEffect_Unload( effect ); + todo_wine + ok( hr == DI_NOEFFECT, "Unload returned %#x\n", hr ); + hr = IDirectInputEffect_SetParameters( effect, NULL, DIEP_NODOWNLOAD ); todo_wine ok( hr == E_POINTER, "SetParameters returned %#x\n", hr ); @@ -5412,6 +5482,13 @@ static void test_periodic_effect( IDirectInputDevice8W *device, HANDLE file ) check_member( desc, expect_desc_init, "%u", cbTypeSpecificParams ); check_member( desc, expect_desc_init, "%u", dwStartDelay ); + hr = IDirectInputEffect_Download( effect ); + todo_wine + ok( hr == DIERR_INCOMPLETEEFFECT, "Download returned %#x\n", hr ); + hr = IDirectInputEffect_Unload( effect ); + todo_wine + ok( hr == DI_NOEFFECT, "Unload returned %#x\n", hr ); + hr = IDirectInputEffect_SetParameters( effect, &expect_desc, DIEP_GAIN | DIEP_SAMPLEPERIOD | DIEP_STARTDELAY | DIEP_TRIGGERREPEATINTERVAL | DIEP_NODOWNLOAD ); @@ -5438,6 +5515,13 @@ static void test_periodic_effect( IDirectInputDevice8W *device, HANDLE file ) todo_wine check_member( desc, expect_desc, "%u", dwStartDelay ); + hr = IDirectInputEffect_Download( effect ); + todo_wine + ok( hr == DIERR_INCOMPLETEEFFECT, "Download returned %#x\n", hr ); + hr = IDirectInputEffect_Unload( effect ); + todo_wine + ok( hr == DI_NOEFFECT, "Unload returned %#x\n", hr ); + desc.lpEnvelope = NULL; hr = IDirectInputEffect_SetParameters( effect, &desc, DIEP_ENVELOPE | DIEP_NODOWNLOAD ); todo_wine @@ -5466,6 +5550,13 @@ static void test_periodic_effect( IDirectInputDevice8W *device, HANDLE file ) todo_wine check_member( envelope, expect_envelope, "%u", dwFadeTime ); + hr = IDirectInputEffect_Download( effect ); + todo_wine + ok( hr == DIERR_INCOMPLETEEFFECT, "Download returned %#x\n", hr ); + hr = IDirectInputEffect_Unload( effect ); + todo_wine + ok( hr == DI_NOEFFECT, "Unload returned %#x\n", hr ); + desc.dwFlags = 0; desc.cAxes = 0; desc.rgdwAxes = NULL; @@ -5532,6 +5623,13 @@ static void test_periodic_effect( IDirectInputDevice8W *device, HANDLE file ) todo_wine ok( desc.rgdwAxes[2] == 4, "got %#x expected %#x\n", desc.rgdwAxes[2], 4 ); + hr = IDirectInputEffect_Download( effect ); + todo_wine + ok( hr == DIERR_INCOMPLETEEFFECT, "Download returned %#x\n", hr ); + hr = IDirectInputEffect_Unload( effect ); + todo_wine + ok( hr == DI_NOEFFECT, "Unload returned %#x\n", hr ); + desc.dwFlags = DIEFF_CARTESIAN; desc.cAxes = 0; desc.rglDirection = directions; @@ -5593,6 +5691,13 @@ static void test_periodic_effect( IDirectInputDevice8W *device, HANDLE file ) todo_wine ok( hr == DIERR_INVALIDPARAM, "GetParameters returned %#x\n", hr ); + hr = IDirectInputEffect_Download( effect ); + todo_wine + ok( hr == DIERR_INCOMPLETEEFFECT, "Download returned %#x\n", hr ); + hr = IDirectInputEffect_Unload( effect ); + todo_wine + ok( hr == DI_NOEFFECT, "Unload returned %#x\n", hr ); + desc.cbTypeSpecificParams = 0; desc.lpvTypeSpecificParams = &periodic; hr = IDirectInputEffect_SetParameters( effect, &desc, DIEP_TYPESPECIFICPARAMS | DIEP_NODOWNLOAD ); @@ -5618,6 +5723,54 @@ static void test_periodic_effect( IDirectInputDevice8W *device, HANDLE file ) todo_wine check_member( periodic, expect_periodic, "%u", dwPeriod ); + set_hid_expect( file, expect_download, 3 * sizeof(struct hid_expect) ); + hr = IDirectInputEffect_Download( effect ); + todo_wine + ok( hr == DI_OK, "Download returned %#x\n", hr ); + set_hid_expect( file, NULL, 0 ); + + hr = IDirectInputEffect_Download( effect ); + todo_wine + ok( hr == DI_NOEFFECT, "Download returned %#x\n", hr ); + + set_hid_expect( file, expect_unload, sizeof(struct hid_expect) ); + hr = IDirectInputEffect_Unload( effect ); + todo_wine + ok( hr == DI_OK, "Unload returned %#x\n", hr ); + set_hid_expect( file, NULL, 0 ); + + set_hid_expect( file, expect_download, 4 * sizeof(struct hid_expect) ); + hr = IDirectInputEffect_SetParameters( effect, &expect_desc, DIEP_START ); + todo_wine + ok( hr == DI_OK, "SetParameters returned %#x\n", hr ); + set_hid_expect( file, NULL, 0 ); + + set_hid_expect( file, expect_unload, sizeof(struct hid_expect) ); + hr = IDirectInputEffect_Unload( effect ); + todo_wine + ok( hr == DI_OK, "Unload returned %#x\n", hr ); + set_hid_expect( file, NULL, 0 ); + + set_hid_expect( file, expect_download, 3 * sizeof(struct hid_expect) ); + hr = IDirectInputEffect_Download( effect ); + todo_wine + ok( hr == DI_OK, "Download returned %#x\n", hr ); + set_hid_expect( file, NULL, 0 ); + + set_hid_expect( file, expect_unload, 2 * sizeof(struct hid_expect) ); + hr = IDirectInputDevice8_Unacquire( device ); + ok( hr == DI_OK, "Unacquire returned: %#x\n", hr ); + set_hid_expect( file, NULL, 0 ); + + set_hid_expect( file, &expect_dc_reset, sizeof(expect_dc_reset) ); + hr = IDirectInputDevice8_Acquire( device ); + ok( hr == DI_OK, "Acquire returned: %#x\n", hr ); + set_hid_expect( file, NULL, 0 ); + + hr = IDirectInputEffect_Unload( effect ); + todo_wine + ok( hr == DI_NOEFFECT, "Unload returned %#x\n", hr ); + ref = IDirectInputEffect_Release( effect ); ok( ref == 0, "Release returned %d\n", ref );
1
0
0
0
Rémi Bernon : dinput: Implement HID joystick IDirectInputEffect_GetEffectGuid.
by Alexandre Julliard
07 Oct '21
07 Oct '21
Module: wine Branch: master Commit: 40e909243790885583deb470a25398f5cb500506 URL:
https://source.winehq.org/git/wine.git/?a=commit;h=40e909243790885583deb470…
Author: Rémi Bernon <rbernon(a)codeweavers.com> Date: Thu Oct 7 10:40:01 2021 +0200 dinput: Implement HID joystick IDirectInputEffect_GetEffectGuid. Signed-off-by: Rémi Bernon <rbernon(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/dinput/joystick_hid.c | 33 +++++++++++++++++++++++++++++---- dlls/dinput8/tests/hid.c | 3 --- 2 files changed, 29 insertions(+), 7 deletions(-) diff --git a/dlls/dinput/joystick_hid.c b/dlls/dinput/joystick_hid.c index 1ecb24260bf..624cea4d77a 100644 --- a/dlls/dinput/joystick_hid.c +++ b/dlls/dinput/joystick_hid.c @@ -199,6 +199,26 @@ static inline USAGE effect_guid_to_usage( const GUID *guid ) return 0; } +static inline const GUID *effect_usage_to_guid( USAGE usage ) +{ + switch (usage) + { + case PID_USAGE_ET_CUSTOM_FORCE_DATA: return &GUID_CustomForce; + case PID_USAGE_ET_CONSTANT_FORCE: return &GUID_ConstantForce; + case PID_USAGE_ET_RAMP: return &GUID_RampForce; + case PID_USAGE_ET_SQUARE: return &GUID_Square; + case PID_USAGE_ET_SINE: return &GUID_Sine; + case PID_USAGE_ET_TRIANGLE: return &GUID_Triangle; + case PID_USAGE_ET_SAWTOOTH_UP: return &GUID_SawtoothUp; + case PID_USAGE_ET_SAWTOOTH_DOWN: return &GUID_SawtoothDown; + case PID_USAGE_ET_SPRING: return &GUID_Spring; + case PID_USAGE_ET_DAMPER: return &GUID_Damper; + case PID_USAGE_ET_INERTIA: return &GUID_Inertia; + case PID_USAGE_ET_FRICTION: return &GUID_Friction; + } + return &GUID_Unknown; +} + static const WCHAR *effect_guid_to_string( const GUID *guid ) { static const WCHAR guid_customforce_w[] = {'G','U','I','D','_','C','u','s','t','o','m','F','o','r','c','e',0}; @@ -2064,9 +2084,8 @@ static HRESULT WINAPI hid_joystick_effect_Initialize( IDirectInputEffect *iface, { struct hid_joystick_effect *impl = impl_from_IDirectInputEffect( iface ); struct hid_joystick *joystick = impl->joystick; - ULONG report_len = joystick->caps.OutputReportByteLength; + ULONG count, report_len = joystick->caps.OutputReportByteLength; NTSTATUS status; - ULONG count; USAGE type; TRACE( "iface %p, inst %p, version %u, guid %s\n", iface, inst, version, debugstr_guid( guid ) ); @@ -2090,8 +2109,14 @@ static HRESULT WINAPI hid_joystick_effect_Initialize( IDirectInputEffect *iface, static HRESULT WINAPI hid_joystick_effect_GetEffectGuid( IDirectInputEffect *iface, GUID *guid ) { - FIXME( "iface %p, guid %p stub!\n", iface, guid ); - return DIERR_UNSUPPORTED; + struct hid_joystick_effect *impl = impl_from_IDirectInputEffect( iface ); + + TRACE( "iface %p, guid %p.\n", iface, guid ); + + if (!guid) return E_POINTER; + *guid = *effect_usage_to_guid( impl->type ); + + return DI_OK; } static HRESULT WINAPI hid_joystick_effect_GetParameters( IDirectInputEffect *iface, DIEFFECT *params, DWORD flags ) diff --git a/dlls/dinput8/tests/hid.c b/dlls/dinput8/tests/hid.c index 35a7d4b3bb7..3ec837abee4 100644 --- a/dlls/dinput8/tests/hid.c +++ b/dlls/dinput8/tests/hid.c @@ -5190,12 +5190,9 @@ static void test_periodic_effect( IDirectInputDevice8W *device, HANDLE file ) ok( hr == DI_OK, "Initialize returned %#x\n", hr ); hr = IDirectInputEffect_GetEffectGuid( effect, NULL ); - todo_wine ok( hr == E_POINTER, "GetEffectGuid returned %#x\n", hr ); hr = IDirectInputEffect_GetEffectGuid( effect, &guid ); - todo_wine ok( hr == DI_OK, "GetEffectGuid returned %#x\n", hr ); - todo_wine ok( IsEqualGUID( &guid, &GUID_Square ), "got guid %s, expected %s\n", debugstr_guid( &guid ), debugstr_guid( &GUID_Square ) );
1
0
0
0
Rémi Bernon : dinput: Implement HID joystick IDirectInputEffect_Initialize.
by Alexandre Julliard
07 Oct '21
07 Oct '21
Module: wine Branch: master Commit: cbd9fe2586d7449c0aba5271683b1290ed78f16f URL:
https://source.winehq.org/git/wine.git/?a=commit;h=cbd9fe2586d7449c0aba5271…
Author: Rémi Bernon <rbernon(a)codeweavers.com> Date: Thu Oct 7 10:40:00 2021 +0200 dinput: Implement HID joystick IDirectInputEffect_Initialize. Signed-off-by: Rémi Bernon <rbernon(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/dinput/joystick_hid.c | 25 ++++++++++++++++++++++++- dlls/dinput8/tests/hid.c | 7 ------- 2 files changed, 24 insertions(+), 8 deletions(-) diff --git a/dlls/dinput/joystick_hid.c b/dlls/dinput/joystick_hid.c index c3d202bd9bd..1ecb24260bf 100644 --- a/dlls/dinput/joystick_hid.c +++ b/dlls/dinput/joystick_hid.c @@ -144,6 +144,7 @@ struct hid_joystick_effect { IDirectInputEffect IDirectInputEffect_iface; LONG ref; + USAGE type; struct list entry; struct hid_joystick *joystick; @@ -2061,7 +2062,29 @@ static ULONG WINAPI hid_joystick_effect_Release( IDirectInputEffect *iface ) static HRESULT WINAPI hid_joystick_effect_Initialize( IDirectInputEffect *iface, HINSTANCE inst, DWORD version, REFGUID guid ) { - FIXME( "iface %p, inst %p, version %u, guid %s stub!\n", iface, inst, version, debugstr_guid( guid ) ); + struct hid_joystick_effect *impl = impl_from_IDirectInputEffect( iface ); + struct hid_joystick *joystick = impl->joystick; + ULONG report_len = joystick->caps.OutputReportByteLength; + NTSTATUS status; + ULONG count; + USAGE type; + + TRACE( "iface %p, inst %p, version %u, guid %s\n", iface, inst, version, debugstr_guid( guid ) ); + + if (!inst) return DIERR_INVALIDPARAM; + if (!guid) return E_POINTER; + if (!(type = effect_guid_to_usage( guid ))) return DIERR_DEVICENOTREG; + + status = HidP_InitializeReportForID( HidP_Output, joystick->pid_effect_update.id, + joystick->preparsed, impl->effect_update_buf, report_len ); + if (status != HIDP_STATUS_SUCCESS) return DIERR_DEVICENOTREG; + + count = 1; + status = HidP_SetUsages( HidP_Output, HID_USAGE_PAGE_PID, joystick->pid_effect_update.type_coll, + &type, &count, joystick->preparsed, impl->effect_update_buf, report_len ); + if (status != HIDP_STATUS_SUCCESS) return DIERR_DEVICENOTREG; + + impl->type = type; return DI_OK; } diff --git a/dlls/dinput8/tests/hid.c b/dlls/dinput8/tests/hid.c index e55adb0aa56..35a7d4b3bb7 100644 --- a/dlls/dinput8/tests/hid.c +++ b/dlls/dinput8/tests/hid.c @@ -5159,13 +5159,9 @@ static void test_periodic_effect( IDirectInputDevice8W *device, HANDLE file ) hr = IDirectInputDevice8_CreateEffect( device, &GUID_Sine, NULL, NULL, NULL ); ok( hr == E_POINTER, "CreateEffect returned %#x\n", hr ); hr = IDirectInputDevice8_CreateEffect( device, NULL, NULL, &effect, NULL ); - todo_wine ok( hr == E_POINTER, "CreateEffect returned %#x\n", hr ); - if (hr == DI_OK) IDirectInputEffect_Release( effect ); hr = IDirectInputDevice8_CreateEffect( device, &GUID_NULL, NULL, &effect, NULL ); - todo_wine ok( hr == DIERR_DEVICENOTREG, "CreateEffect returned %#x\n", hr ); - if (hr == DI_OK) IDirectInputEffect_Release( effect ); hr = IDirectInputDevice8_CreateEffect( device, &GUID_Sine, NULL, &effect, NULL ); ok( hr == DI_OK, "CreateEffect returned %#x\n", hr ); @@ -5179,17 +5175,14 @@ static void test_periodic_effect( IDirectInputDevice8W *device, HANDLE file ) ok( check_params.count == 1, "got count %u, expected 1\n", check_params.count ); hr = IDirectInputEffect_Initialize( effect, NULL, DIRECTINPUT_VERSION, &GUID_Sine ); - todo_wine ok( hr == DIERR_INVALIDPARAM, "Initialize returned %#x\n", hr ); hr = IDirectInputEffect_Initialize( effect, instance, 0, &GUID_Sine ); todo_wine ok( hr == DIERR_NOTINITIALIZED, "Initialize returned %#x\n", hr ); hr = IDirectInputEffect_Initialize( effect, instance, DIRECTINPUT_VERSION, NULL ); - todo_wine ok( hr == E_POINTER, "Initialize returned %#x\n", hr ); hr = IDirectInputEffect_Initialize( effect, instance, DIRECTINPUT_VERSION, &GUID_NULL ); - todo_wine ok( hr == DIERR_DEVICENOTREG, "Initialize returned %#x\n", hr ); hr = IDirectInputEffect_Initialize( effect, instance, DIRECTINPUT_VERSION, &GUID_Sine ); ok( hr == DI_OK, "Initialize returned %#x\n", hr );
1
0
0
0
Rémi Bernon : dinput: Allocate buffers for the effect control and update reports.
by Alexandre Julliard
07 Oct '21
07 Oct '21
Module: wine Branch: master Commit: 20b55e8748ac5b3b5b7cde12827a5a6a849c1934 URL:
https://source.winehq.org/git/wine.git/?a=commit;h=20b55e8748ac5b3b5b7cde12…
Author: Rémi Bernon <rbernon(a)codeweavers.com> Date: Thu Oct 7 10:50:07 2021 +0200 dinput: Allocate buffers for the effect control and update reports. Signed-off-by: Rémi Bernon <rbernon(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/dinput/joystick_hid.c | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/dlls/dinput/joystick_hid.c b/dlls/dinput/joystick_hid.c index d2aa352b6e2..c3d202bd9bd 100644 --- a/dlls/dinput/joystick_hid.c +++ b/dlls/dinput/joystick_hid.c @@ -147,6 +147,9 @@ struct hid_joystick_effect struct list entry; struct hid_joystick *joystick; + + char *effect_control_buf; + char *effect_update_buf; }; static inline struct hid_joystick_effect *impl_from_IDirectInputEffect( IDirectInputEffect *iface ) @@ -2048,6 +2051,8 @@ static ULONG WINAPI hid_joystick_effect_Release( IDirectInputEffect *iface ) list_remove( &impl->entry ); LeaveCriticalSection( &impl->joystick->base.crit ); hid_joystick_private_decref( impl->joystick ); + HeapFree( GetProcessHeap(), 0, impl->effect_update_buf ); + HeapFree( GetProcessHeap(), 0, impl->effect_control_buf ); HeapFree( GetProcessHeap(), 0, impl ); } return ref; @@ -2140,6 +2145,7 @@ static IDirectInputEffectVtbl hid_joystick_effect_vtbl = static HRESULT hid_joystick_effect_create( struct hid_joystick *joystick, IDirectInputEffect **out ) { struct hid_joystick_effect *impl; + ULONG report_len; if (!(impl = HeapAlloc( GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(*impl) ))) return DIERR_OUTOFMEMORY; @@ -2152,6 +2158,14 @@ static HRESULT hid_joystick_effect_create( struct hid_joystick *joystick, IDirec list_add_tail( &joystick->effect_list, &impl->entry ); LeaveCriticalSection( &joystick->base.crit ); + report_len = joystick->caps.OutputReportByteLength; + if (!(impl->effect_control_buf = HeapAlloc( GetProcessHeap(), 0, report_len ))) goto failed; + if (!(impl->effect_update_buf = HeapAlloc( GetProcessHeap(), 0, report_len ))) goto failed; + *out = &impl->IDirectInputEffect_iface; return DI_OK; + +failed: + IDirectInputEffect_Release( &impl->IDirectInputEffect_iface ); + return DIERR_OUTOFMEMORY; }
1
0
0
0
Rémi Bernon : dinput: Remove "stub!" from HID joystick IDirectInputDevice8_EnumCreatedEffectObjects.
by Alexandre Julliard
07 Oct '21
07 Oct '21
Module: wine Branch: master Commit: 099d64943412ae97941e9e7be463265e8a14d2e4 URL:
https://source.winehq.org/git/wine.git/?a=commit;h=099d64943412ae97941e9e7b…
Author: Rémi Bernon <rbernon(a)codeweavers.com> Date: Thu Oct 7 10:50:06 2021 +0200 dinput: Remove "stub!" from HID joystick IDirectInputDevice8_EnumCreatedEffectObjects. Signed-off-by: Rémi Bernon <rbernon(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/dinput/joystick_hid.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dlls/dinput/joystick_hid.c b/dlls/dinput/joystick_hid.c index 2ef01ac6ace..d2aa352b6e2 100644 --- a/dlls/dinput/joystick_hid.c +++ b/dlls/dinput/joystick_hid.c @@ -1195,7 +1195,7 @@ static HRESULT WINAPI hid_joystick_EnumCreatedEffectObjects( IDirectInputDevice8 struct hid_joystick *impl = impl_from_IDirectInputDevice8W( iface ); struct hid_joystick_effect *effect, *next; - FIXME( "iface %p, callback %p, context %p, flags %#x stub!\n", iface, callback, context, flags ); + TRACE( "iface %p, callback %p, context %p, flags %#x.\n", iface, callback, context, flags ); if (!callback) return DIERR_INVALIDPARAM; if (flags) return DIERR_INVALIDPARAM;
1
0
0
0
Huw Davies : configure: No longer disable iphlpapi in a Windows build.
by Alexandre Julliard
07 Oct '21
07 Oct '21
Module: wine Branch: master Commit: 2acb6bc6fd64eff88d34d9244bfc8683e5d983c6 URL:
https://source.winehq.org/git/wine.git/?a=commit;h=2acb6bc6fd64eff88d34d924…
Author: Huw Davies <huw(a)codeweavers.com> Date: Thu Oct 7 08:57:40 2021 +0100 configure: No longer disable iphlpapi in a Windows build. Signed-off-by: Huw Davies <huw(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- configure | 3 +-- configure.ac | 1 - 2 files changed, 1 insertion(+), 3 deletions(-) diff --git a/configure b/configure index d9ba80332bd..8a7e8fece1e 100755 --- a/configure +++ b/configure @@ -8339,8 +8339,7 @@ if test "x$ac_cv_cflags__Wl___disable_stdcall_fixup" = xyes; then : LDDLLFLAGS="-Wl,--disable-stdcall-fixup" fi ;; esac - enable_iphlpapi=${enable_iphlpapi:-no} - enable_mountmgr_sys=${enable_mountmgr_sys:-no} + enable_mountmgr_sys=${enable_mountmgr_sys:-no} enable_loader=${enable_loader:-no} enable_server=${enable_server:-no} with_x=${with_x:-no} diff --git a/configure.ac b/configure.ac index 4497e98e7bb..39fb1eabc4b 100644 --- a/configure.ac +++ b/configure.ac @@ -723,7 +723,6 @@ case $host_os in [LDDLLFLAGS="-Wl,--disable-stdcall-fixup"]) ;; esac dnl Disable modules that can't be used on Windows - enable_iphlpapi=${enable_iphlpapi:-no} enable_mountmgr_sys=${enable_mountmgr_sys:-no} enable_loader=${enable_loader:-no} enable_server=${enable_server:-no}
1
0
0
0
Matteo Bruni : d3dx9/tests: Clean up GetMatrixPointerArray() tests.
by Alexandre Julliard
06 Oct '21
06 Oct '21
Module: wine Branch: master Commit: 3660176e09bc02e71586b4cf42f58c9498481af6 URL:
https://source.winehq.org/git/wine.git/?a=commit;h=3660176e09bc02e71586b4cf…
Author: Matteo Bruni <mbruni(a)codeweavers.com> Date: Sat Oct 2 18:39:42 2021 +0200 d3dx9/tests: Clean up GetMatrixPointerArray() tests. Inspired by a patch from Eric Pouech. Signed-off-by: Matteo Bruni <mbruni(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/d3dx9_36/tests/effect.c | 36 +++++++++++++++++++++++++++--------- 1 file changed, 27 insertions(+), 9 deletions(-) diff --git a/dlls/d3dx9_36/tests/effect.c b/dlls/d3dx9_36/tests/effect.c index d6998284271..a13dc708726 100644 --- a/dlls/d3dx9_36/tests/effect.c +++ b/dlls/d3dx9_36/tests/effect.c @@ -1470,20 +1470,28 @@ static void test_effect_parameter_value_GetMatrixArray(const struct test_effect_ static void test_effect_parameter_value_GetMatrixPointerArray(const struct test_effect_parameter_value_result *res, ID3DXEffect *effect, const DWORD *res_value, D3DXHANDLE parameter, UINT i) { + union + { + float f[sizeof(D3DXMATRIX) / sizeof(float)]; + D3DXMATRIX m; + } fvalue[EFFECT_PARAMETER_VALUE_ARRAY_SIZE * sizeof(float) / sizeof(D3DXMATRIX)]; const D3DXPARAMETER_DESC *res_desc = &res->desc; const char *res_full_name = res->full_name; HRESULT hr; - DWORD cmp = 0xabababab; - FLOAT fvalue[EFFECT_PARAMETER_VALUE_ARRAY_SIZE]; - D3DXMATRIX *matrix_pointer_array[sizeof(fvalue)/sizeof(D3DXMATRIX)]; + D3DXMATRIX *matrix_pointer_array[ARRAY_SIZE(fvalue)]; UINT l, k, m, element, err = 0; + union + { + DWORD d; + float f; + } cmp = {0xabababab}; for (element = 0; element <= res_desc->Elements + 1; ++element) { memset(fvalue, 0xab, sizeof(fvalue)); for (l = 0; l < element; ++l) { - matrix_pointer_array[l] = (D3DXMATRIX *)&fvalue[l * sizeof(**matrix_pointer_array) / sizeof(FLOAT)]; + matrix_pointer_array[l] = &fvalue[l].m; } hr = effect->lpVtbl->GetMatrixPointerArray(effect, parameter, matrix_pointer_array, element); if (!element) @@ -1491,7 +1499,10 @@ static void test_effect_parameter_value_GetMatrixPointerArray(const struct test_ ok(hr == D3D_OK, "%u - %s[%u]: GetMatrixPointerArray failed, got %#x, expected %#x\n", i, res_full_name, element, hr, D3D_OK); - for (l = 0; l < EFFECT_PARAMETER_VALUE_ARRAY_SIZE; ++l) if (fvalue[l] != *(FLOAT *)&cmp) ++err; + for (m = 0; m < ARRAY_SIZE(fvalue); ++m) + for (l = 0; l < ARRAY_SIZE(fvalue[l].f); ++l) + if (fvalue[m].f[l] != cmp.f) + ++err; } else if (element <= res_desc->Elements && res_desc->Class == D3DXPC_MATRIX_ROWS) { @@ -1506,20 +1517,27 @@ static void test_effect_parameter_value_GetMatrixPointerArray(const struct test_ { if (k < res_desc->Columns && l < res_desc->Rows) { - if (!compare_float(fvalue[m * 16 + l * 4 + k], get_float(res_desc->Type, + if (!compare_float(fvalue[m].m.m[l][k], get_float(res_desc->Type, &res_value[m * res_desc->Columns * res_desc->Rows + l * res_desc->Columns + k]), 512)) ++err; } - else if (fvalue[m * 16 + l * 4 + k] != 0.0f) ++err; + else if (fvalue[m].m.m[l][k] != 0.0f) + ++err; } } } - for (l = element * 16; l < EFFECT_PARAMETER_VALUE_ARRAY_SIZE; ++l) if (fvalue[l] != *(FLOAT *)&cmp) ++err; + for (m = element; m < ARRAY_SIZE(fvalue); ++m) + for (l = 0; l < ARRAY_SIZE(fvalue[m].f); ++l) + if (fvalue[m].f[l] != cmp.f) + ++err; } else { - for (l = 0; l < EFFECT_PARAMETER_VALUE_ARRAY_SIZE; ++l) if (fvalue[l] != *(FLOAT *)&cmp) ++err; + for (m = 0; m < ARRAY_SIZE(fvalue); ++m) + for (l = 0; l < ARRAY_SIZE(fvalue[m].f); ++l) + if (fvalue[m].f[l] != cmp.f) + ++err; ok(hr == D3DERR_INVALIDCALL, "%u - %s[%u]: GetMatrixPointerArray failed, got %#x, expected %#x\n", i, res_full_name, element, hr, D3DERR_INVALIDCALL);
1
0
0
0
← Newer
1
...
88
89
90
91
92
93
94
...
117
Older →
Jump to page:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
Results per page:
10
25
50
100
200