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: Implement hid_joystick_SendForceFeedbackCommand.
by Alexandre Julliard
01 Oct '21
01 Oct '21
Module: wine Branch: master Commit: a382646e38cdc8f7473cd14f9793450bcb701a0f URL:
https://source.winehq.org/git/wine.git/?a=commit;h=a382646e38cdc8f7473cd14f…
Author: Rémi Bernon <rbernon(a)codeweavers.com> Date: Fri Oct 1 09:31:02 2021 +0200 dinput: Implement hid_joystick_SendForceFeedbackCommand. Signed-off-by: Rémi Bernon <rbernon(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/dinput/joystick_hid.c | 51 ++++++++++++++++++++++++++++++++++++++-------- dlls/dinput8/tests/hid.c | 18 ++++++++-------- 2 files changed, 51 insertions(+), 18 deletions(-) diff --git a/dlls/dinput/joystick_hid.c b/dlls/dinput/joystick_hid.c index b10ce7fc03b..aee8118191f 100644 --- a/dlls/dinput/joystick_hid.c +++ b/dlls/dinput/joystick_hid.c @@ -104,6 +104,7 @@ struct hid_joystick struct extra_caps *input_extra_caps; char *input_report_buf; + char *output_report_buf; USAGE_AND_PAGE *usages_buf; ULONG usages_count; @@ -369,6 +370,7 @@ static ULONG WINAPI hid_joystick_Release( IDirectInputDevice8W *iface ) if (!(ref = IDirectInputDevice2WImpl_Release( iface ))) { HeapFree( GetProcessHeap(), 0, tmp.usages_buf ); + HeapFree( GetProcessHeap(), 0, tmp.output_report_buf ); HeapFree( GetProcessHeap(), 0, tmp.input_report_buf ); HeapFree( GetProcessHeap(), 0, tmp.input_extra_caps ); HidD_FreePreparsedData( tmp.preparsed ); @@ -833,20 +835,48 @@ static HRESULT WINAPI hid_joystick_GetForceFeedbackState( IDirectInputDevice8W * static HRESULT WINAPI hid_joystick_SendForceFeedbackCommand( IDirectInputDevice8W *iface, DWORD command ) { - FIXME( "iface %p, command %x stub!\n", iface, command ); + struct hid_joystick *impl = impl_from_IDirectInputDevice8W( iface ); + struct pid_control_report *report = &impl->pid_device_control; + ULONG report_len = impl->caps.OutputReportByteLength; + char *report_buf = impl->output_report_buf; + NTSTATUS status; + USAGE usage; + ULONG count; + HRESULT hr; + + TRACE( "iface %p, flags %x.\n", iface, command ); switch (command) { - case DISFFC_RESET: - case DISFFC_STOPALL: - case DISFFC_PAUSE: - case DISFFC_CONTINUE: - case DISFFC_SETACTUATORSON: - case DISFFC_SETACTUATORSOFF: - return DIERR_UNSUPPORTED; + case DISFFC_RESET: usage = PID_USAGE_DC_DEVICE_RESET; break; + case DISFFC_STOPALL: usage = PID_USAGE_DC_STOP_ALL_EFFECTS; break; + case DISFFC_PAUSE: usage = PID_USAGE_DC_DEVICE_PAUSE; break; + case DISFFC_CONTINUE: usage = PID_USAGE_DC_DEVICE_CONTINUE; break; + case DISFFC_SETACTUATORSON: usage = PID_USAGE_DC_ENABLE_ACTUATORS; break; + case DISFFC_SETACTUATORSOFF: usage = PID_USAGE_DC_DISABLE_ACTUATORS; break; + default: return DIERR_INVALIDPARAM; } - return DIERR_INVALIDPARAM; + if (!(impl->dev_caps.dwFlags & DIDC_FORCEFEEDBACK)) return DIERR_UNSUPPORTED; + + EnterCriticalSection( &impl->base.crit ); + if (!impl->base.acquired || !(impl->base.dwCoopLevel & DISCL_EXCLUSIVE)) + hr = DIERR_NOTEXCLUSIVEACQUIRED; + else + { + count = 1; + status = HidP_InitializeReportForID( HidP_Output, report->id, impl->preparsed, report_buf, report_len ); + if (status != HIDP_STATUS_SUCCESS) hr = status; + else status = HidP_SetUsages( HidP_Output, HID_USAGE_PAGE_PID, report->control_coll, &usage, + &count, impl->preparsed, report_buf, report_len ); + + if (status != HIDP_STATUS_SUCCESS) hr = status; + else if (WriteFile( impl->device, report_buf, report_len, NULL, NULL )) hr = DI_OK; + else hr = DIERR_GENERIC; + } + LeaveCriticalSection( &impl->base.crit ); + + return hr; } static HRESULT WINAPI hid_joystick_EnumCreatedEffectObjects( IDirectInputDevice8W *iface, @@ -1555,6 +1585,9 @@ static HRESULT hid_joystick_create_device( IDirectInputImpl *dinput, const GUID size = impl->caps.InputReportByteLength; if (!(buffer = HeapAlloc( GetProcessHeap(), 0, size ))) goto failed; impl->input_report_buf = buffer; + size = impl->caps.OutputReportByteLength; + if (!(buffer = HeapAlloc( GetProcessHeap(), 0, size ))) goto failed; + impl->output_report_buf = buffer; impl->usages_count = HidP_MaxUsageListLength( HidP_Input, 0, impl->preparsed ); size = impl->usages_count * sizeof(USAGE_AND_PAGE); if (!(usages = HeapAlloc( GetProcessHeap(), 0, size ))) goto failed; diff --git a/dlls/dinput8/tests/hid.c b/dlls/dinput8/tests/hid.c index 638d8f0aaeb..618fb4e4c7c 100644 --- a/dlls/dinput8/tests/hid.c +++ b/dlls/dinput8/tests/hid.c @@ -5253,6 +5253,13 @@ static void test_force_feedback_joystick( void ) .dwFFDriverVersion = 1, }; struct hid_expect expect_dc_reset = + { + .code = IOCTL_HID_WRITE_REPORT, + .report_id = 1, + .report_len = 2, + .report_buf = {1, 0x01}, + }; + struct hid_expect expect_dc_reset_todo = { .code = IOCTL_HID_WRITE_REPORT, .todo = TRUE, @@ -5751,7 +5758,6 @@ static void test_force_feedback_joystick( void ) todo_wine ok( hr == DIERR_NOTEXCLUSIVEACQUIRED, "IDirectInputDevice8_GetForceFeedbackState returned %#x\n", hr ); hr = IDirectInputDevice8_SendForceFeedbackCommand( device, DISFFC_RESET ); - todo_wine ok( hr == DIERR_NOTEXCLUSIVEACQUIRED, "IDirectInputDevice8_SendForceFeedbackCommand returned %#x\n", hr ); escape.dwSize = sizeof(DIEFFESCAPE); @@ -5769,7 +5775,7 @@ static void test_force_feedback_joystick( void ) hr = IDirectInputDevice8_SetCooperativeLevel( device, hwnd, DISCL_BACKGROUND | DISCL_EXCLUSIVE ); ok( hr == DI_OK, "IDirectInputDevice8_SetCooperativeLevel returned: %#x\n", hr ); - set_hid_expect( file, &expect_dc_reset, sizeof(expect_dc_reset) ); + set_hid_expect( file, &expect_dc_reset_todo, sizeof(expect_dc_reset_todo) ); hr = IDirectInputDevice8_Acquire( device ); ok( hr == DI_OK, "IDirectInputDevice8_Acquire returned: %#x\n", hr ); set_hid_expect( file, NULL, 0 ); @@ -5792,24 +5798,18 @@ static void test_force_feedback_joystick( void ) set_hid_expect( file, &expect_dc_reset, sizeof(expect_dc_reset) ); hr = IDirectInputDevice8_SendForceFeedbackCommand( device, DISFFC_RESET ); - todo_wine ok( hr == DI_OK, "IDirectInputDevice8_SendForceFeedbackCommand returned %#x\n", hr ); set_hid_expect( file, NULL, 0 ); hr = IDirectInputDevice8_SendForceFeedbackCommand( device, DISFFC_STOPALL ); - todo_wine ok( hr == HIDP_STATUS_USAGE_NOT_FOUND, "IDirectInputDevice8_SendForceFeedbackCommand returned %#x\n", hr ); hr = IDirectInputDevice8_SendForceFeedbackCommand( device, DISFFC_PAUSE ); - todo_wine ok( hr == HIDP_STATUS_USAGE_NOT_FOUND, "IDirectInputDevice8_SendForceFeedbackCommand returned %#x\n", hr ); hr = IDirectInputDevice8_SendForceFeedbackCommand( device, DISFFC_CONTINUE ); - todo_wine ok( hr == HIDP_STATUS_USAGE_NOT_FOUND, "IDirectInputDevice8_SendForceFeedbackCommand returned %#x\n", hr ); hr = IDirectInputDevice8_SendForceFeedbackCommand( device, DISFFC_SETACTUATORSON ); - todo_wine ok( hr == HIDP_STATUS_USAGE_NOT_FOUND, "IDirectInputDevice8_SendForceFeedbackCommand returned %#x\n", hr ); hr = IDirectInputDevice8_SendForceFeedbackCommand( device, DISFFC_SETACTUATORSOFF ); - todo_wine ok( hr == HIDP_STATUS_USAGE_NOT_FOUND, "IDirectInputDevice8_SendForceFeedbackCommand returned %#x\n", hr ); objdata.dwOfs = 0x1e; @@ -5821,7 +5821,7 @@ static void test_force_feedback_joystick( void ) test_periodic_effect( device, file ); - set_hid_expect( file, &expect_dc_reset, sizeof(expect_dc_reset) ); + set_hid_expect( file, &expect_dc_reset_todo, sizeof(expect_dc_reset_todo) ); hr = IDirectInputDevice8_Unacquire( device ); ok( hr == DI_OK, "IDirectInputDevice8_Unacquire returned: %#x\n", hr ); set_hid_expect( file, NULL, 0 );
1
0
0
0
Rémi Bernon : dinput: Look for the PID device control output report.
by Alexandre Julliard
01 Oct '21
01 Oct '21
Module: wine Branch: master Commit: ff7685dea4469dc099fe24a492ee73418c3aada4 URL:
https://source.winehq.org/git/wine.git/?a=commit;h=ff7685dea4469dc099fe24a4…
Author: Rémi Bernon <rbernon(a)codeweavers.com> Date: Fri Oct 1 09:31:01 2021 +0200 dinput: Look for the PID device control output report. Signed-off-by: Rémi Bernon <rbernon(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/dinput/joystick_hid.c | 90 ++++++++++++++++++++++++++++++++++++++++++++++ dlls/dinput8/tests/hid.c | 6 ---- 2 files changed, 90 insertions(+), 6 deletions(-) diff --git a/dlls/dinput/joystick_hid.c b/dlls/dinput/joystick_hid.c index a6c6de3a889..b10ce7fc03b 100644 --- a/dlls/dinput/joystick_hid.c +++ b/dlls/dinput/joystick_hid.c @@ -78,6 +78,13 @@ struct extra_caps LONG saturation; }; +struct pid_control_report +{ + BYTE id; + ULONG collection; + ULONG control_coll; +}; + #define DEVICE_STATE_MAX_SIZE 1024 struct hid_joystick @@ -102,6 +109,8 @@ struct hid_joystick BYTE device_state_report_id; BYTE device_state[DEVICE_STATE_MAX_SIZE]; + + struct pid_control_report pid_device_control; }; static inline struct hid_joystick *impl_from_IDirectInputDevice8W( IDirectInputDevice8W *iface ) @@ -1176,6 +1185,12 @@ static BOOL hid_joystick_device_try_open( UINT32 handle, const WCHAR *path, HAND instance->wUsagePage = caps->UsagePage; instance->wUsage = caps->Usage; + count = ARRAY_SIZE(buttons); + status = HidP_GetSpecificButtonCaps( HidP_Output, HID_USAGE_PAGE_PID, 0, + PID_USAGE_DC_DEVICE_RESET, buttons, &count, preparsed_data ); + if (status == HIDP_STATUS_SUCCESS && count > 0) + instance->guidFFDriver = IID_IDirectInputPIDDriver; + count = ARRAY_SIZE(buttons); status = HidP_GetSpecificButtonCaps( HidP_Input, HID_USAGE_PAGE_BUTTON, 0, 0, buttons, &count, preparsed_data ); if (status != HIDP_STATUS_SUCCESS) count = button_count = 0; @@ -1398,6 +1413,67 @@ static BOOL init_data_format( struct hid_joystick *impl, struct hid_value_caps * return DIENUM_CONTINUE; } +static BOOL init_pid_reports( struct hid_joystick *impl, struct hid_value_caps *caps, + DIDEVICEOBJECTINSTANCEW *instance, void *data ) +{ + struct pid_control_report *device_control = &impl->pid_device_control; + +#define SET_COLLECTION( rep ) \ + do \ + { \ + if (rep->collection) FIXME( "duplicate " #rep " report!\n" ); \ + else rep->collection = DIDFT_GETINSTANCE( instance->dwType ); \ + } while (0) + +#define SET_SUB_COLLECTION( rep, sub ) \ + do { \ + if (instance->wCollectionNumber != rep->collection) \ + FIXME( "unexpected " #rep "." #sub " parent!\n" ); \ + else if (rep->sub) \ + FIXME( "duplicate " #rep "." #sub " collection!\n" ); \ + else \ + rep->sub = DIDFT_GETINSTANCE( instance->dwType ); \ + } while (0) + + if (instance->wUsagePage == HID_USAGE_PAGE_PID) + { + switch (instance->wUsage) + { + case PID_USAGE_DEVICE_CONTROL_REPORT: SET_COLLECTION( device_control ); break; + case PID_USAGE_DEVICE_CONTROL: SET_SUB_COLLECTION( device_control, control_coll ); break; + } + } + +#undef SET_SUB_COLLECTION +#undef SET_COLLECTION + + return DIENUM_CONTINUE; +} + +static BOOL init_pid_caps( struct hid_joystick *impl, struct hid_value_caps *caps, + DIDEVICEOBJECTINSTANCEW *instance, void *data ) +{ + struct pid_control_report *device_control = &impl->pid_device_control; + + if (!(instance->dwType & DIDFT_OUTPUT)) return DIENUM_CONTINUE; + +#define SET_REPORT_ID( rep ) \ + do \ + { \ + if (!rep->id) \ + rep->id = instance->wReportId; \ + else if (rep->id != instance->wReportId) \ + FIXME( "multiple " #rep " report ids!\n" ); \ + } while (0) + + if (instance->wCollectionNumber == device_control->control_coll) + SET_REPORT_ID( device_control ); + +#undef SET_REPORT_ID + + return DIENUM_CONTINUE; +} + static HRESULT hid_joystick_create_device( IDirectInputImpl *dinput, const GUID *guid, IDirectInputDevice8W **out ) { static const DIPROPHEADER filter = @@ -1485,6 +1561,20 @@ static HRESULT hid_joystick_create_device( IDirectInputImpl *dinput, const GUID impl->usages_buf = usages; enum_objects( impl, &filter, DIDFT_ALL, init_objects, NULL ); + enum_objects( impl, &filter, DIDFT_COLLECTION, init_pid_reports, NULL ); + enum_objects( impl, &filter, DIDFT_NODATA, init_pid_caps, NULL ); + + TRACE( "device control id %u, coll %u, control coll %u\n", impl->pid_device_control.id, + impl->pid_device_control.collection, impl->pid_device_control.control_coll ); + + if (impl->pid_device_control.id) + { + impl->dev_caps.dwFlags |= DIDC_FORCEFEEDBACK; + impl->dev_caps.dwFFSamplePeriod = 1000000; + impl->dev_caps.dwFFMinTimeResolution = 1000000; + impl->dev_caps.dwHardwareRevision = 1; + impl->dev_caps.dwFFDriverVersion = 1; + } format = impl->base.data_format.wine_df; if (format->dwDataSize > DEVICE_STATE_MAX_SIZE) diff --git a/dlls/dinput8/tests/hid.c b/dlls/dinput8/tests/hid.c index e6439ed8fe5..638d8f0aaeb 100644 --- a/dlls/dinput8/tests/hid.c +++ b/dlls/dinput8/tests/hid.c @@ -5646,7 +5646,6 @@ static void test_force_feedback_joystick( void ) check_member_wstr( devinst, expect_devinst, tszInstanceName ); todo_wine check_member_wstr( devinst, expect_devinst, tszProductName ); - todo_wine check_member_guid( devinst, expect_devinst, guidFFDriver ); check_member( devinst, expect_devinst, "%04x", wUsagePage ); check_member( devinst, expect_devinst, "%04x", wUsage ); @@ -5655,20 +5654,15 @@ static void test_force_feedback_joystick( void ) hr = IDirectInputDevice8_GetCapabilities( device, &caps ); ok( hr == DI_OK, "IDirectInputDevice8_GetCapabilities returned %#x\n", hr ); check_member( caps, expect_caps, "%d", dwSize ); - todo_wine check_member( caps, expect_caps, "%#x", dwFlags ); check_member( caps, expect_caps, "%#x", dwDevType ); check_member( caps, expect_caps, "%d", dwAxes ); check_member( caps, expect_caps, "%d", dwButtons ); check_member( caps, expect_caps, "%d", dwPOVs ); - todo_wine check_member( caps, expect_caps, "%d", dwFFSamplePeriod ); - todo_wine check_member( caps, expect_caps, "%d", dwFFMinTimeResolution ); check_member( caps, expect_caps, "%d", dwFirmwareRevision ); - todo_wine check_member( caps, expect_caps, "%d", dwHardwareRevision ); - todo_wine check_member( caps, expect_caps, "%d", dwFFDriverVersion ); prop_dword.dwData = 0xdeadbeef;
1
0
0
0
Rémi Bernon : winebus.sys: Add a PID device control output report.
by Alexandre Julliard
01 Oct '21
01 Oct '21
Module: wine Branch: master Commit: 903c7ea75dee85311df55fdad0676d4215339c8c URL:
https://source.winehq.org/git/wine.git/?a=commit;h=903c7ea75dee85311df55fda…
Author: Rémi Bernon <rbernon(a)codeweavers.com> Date: Fri Oct 1 09:31:00 2021 +0200 winebus.sys: Add a PID device control output report. And include it in the HID report descriptor when SDL device has support for any haptic effect, or when UDEV lnxev device has any FF bit set. Signed-off-by: Rémi Bernon <rbernon(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/winebus.sys/bus_sdl.c | 21 ++++++++++-- dlls/winebus.sys/bus_udev.c | 15 +++++++++ dlls/winebus.sys/hid.c | 75 +++++++++++++++++++++++++++++++++++++++++ dlls/winebus.sys/unix_private.h | 8 +++++ dlls/winebus.sys/unixlib.c | 12 +++++++ 5 files changed, 128 insertions(+), 3 deletions(-) Diff:
https://source.winehq.org/git/wine.git/?a=commitdiff;h=903c7ea75dee85311df5…
1
0
0
0
Rémi Bernon : dinput: Stub hid_joystick force feedback methods.
by Alexandre Julliard
01 Oct '21
01 Oct '21
Module: wine Branch: master Commit: b33bece87e39b7a1762090f8ef7a4f789d56a104 URL:
https://source.winehq.org/git/wine.git/?a=commit;h=b33bece87e39b7a1762090f8…
Author: Rémi Bernon <rbernon(a)codeweavers.com> Date: Fri Oct 1 09:30:59 2021 +0200 dinput: Stub hid_joystick force feedback methods. Signed-off-by: Rémi Bernon <rbernon(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/dinput/joystick_hid.c | 83 ++++++++++++++++++++++++++++++++++++++++++---- dlls/dinput8/tests/hid.c | 11 +----- 2 files changed, 78 insertions(+), 16 deletions(-) diff --git a/dlls/dinput/joystick_hid.c b/dlls/dinput/joystick_hid.c index 834a5de0860..a6c6de3a889 100644 --- a/dlls/dinput/joystick_hid.c +++ b/dlls/dinput/joystick_hid.c @@ -780,6 +780,77 @@ static HRESULT WINAPI hid_joystick_GetDeviceInfo( IDirectInputDevice8W *iface, D return S_OK; } +static HRESULT WINAPI hid_joystick_CreateEffect( IDirectInputDevice8W *iface, const GUID *guid, + const DIEFFECT *params, IDirectInputEffect **out, + IUnknown *outer ) +{ + FIXME( "iface %p, guid %s, params %p, out %p, outer %p stub!\n", iface, debugstr_guid( guid ), + params, out, outer ); + + if (!out) return E_POINTER; + + return DIERR_UNSUPPORTED; +} + +static HRESULT WINAPI hid_joystick_EnumEffects( IDirectInputDevice8W *iface, LPDIENUMEFFECTSCALLBACKW callback, + void *context, DWORD type ) +{ + FIXME( "iface %p, callback %p, context %p, type %#x stub!\n", iface, callback, context, type ); + + if (!callback) return DIERR_INVALIDPARAM; + + return DI_OK; +} + +static HRESULT WINAPI hid_joystick_GetEffectInfo( IDirectInputDevice8W *iface, DIEFFECTINFOW *info, + const GUID *guid ) +{ + FIXME( "iface %p, info %p, guid %s stub!\n", iface, info, debugstr_guid( guid ) ); + + if (!info) return E_POINTER; + if (info->dwSize != sizeof(DIEFFECTINFOW)) return DIERR_INVALIDPARAM; + + return DIERR_DEVICENOTREG; +} + +static HRESULT WINAPI hid_joystick_GetForceFeedbackState( IDirectInputDevice8W *iface, DWORD *out ) +{ + FIXME( "iface %p, out %p stub!\n", iface, out ); + + if (!out) return E_POINTER; + + return DIERR_UNSUPPORTED; +} + +static HRESULT WINAPI hid_joystick_SendForceFeedbackCommand( IDirectInputDevice8W *iface, DWORD command ) +{ + FIXME( "iface %p, command %x stub!\n", iface, command ); + + switch (command) + { + case DISFFC_RESET: + case DISFFC_STOPALL: + case DISFFC_PAUSE: + case DISFFC_CONTINUE: + case DISFFC_SETACTUATORSON: + case DISFFC_SETACTUATORSOFF: + return DIERR_UNSUPPORTED; + } + + return DIERR_INVALIDPARAM; +} + +static HRESULT WINAPI hid_joystick_EnumCreatedEffectObjects( IDirectInputDevice8W *iface, + LPDIENUMCREATEDEFFECTOBJECTSCALLBACK callback, + void *context, DWORD flags ) +{ + FIXME( "iface %p, callback %p, context %p, flags %#x stub!\n", iface, callback, context, flags ); + + if (!callback) return DIERR_INVALIDPARAM; + + return DIERR_UNSUPPORTED; +} + static HRESULT WINAPI hid_joystick_Poll( IDirectInputDevice8W *iface ) { struct hid_joystick *impl = impl_from_IDirectInputDevice8W( iface ); @@ -837,12 +908,12 @@ static const IDirectInputDevice8WVtbl hid_joystick_vtbl = IDirectInputDevice2WImpl_RunControlPanel, IDirectInputDevice2WImpl_Initialize, /*** IDirectInputDevice2 methods ***/ - IDirectInputDevice2WImpl_CreateEffect, - IDirectInputDevice2WImpl_EnumEffects, - IDirectInputDevice2WImpl_GetEffectInfo, - IDirectInputDevice2WImpl_GetForceFeedbackState, - IDirectInputDevice2WImpl_SendForceFeedbackCommand, - IDirectInputDevice2WImpl_EnumCreatedEffectObjects, + hid_joystick_CreateEffect, + hid_joystick_EnumEffects, + hid_joystick_GetEffectInfo, + hid_joystick_GetForceFeedbackState, + hid_joystick_SendForceFeedbackCommand, + hid_joystick_EnumCreatedEffectObjects, IDirectInputDevice2WImpl_Escape, hid_joystick_Poll, IDirectInputDevice2WImpl_SendDeviceData, diff --git a/dlls/dinput8/tests/hid.c b/dlls/dinput8/tests/hid.c index 1ab6e645947..e6439ed8fe5 100644 --- a/dlls/dinput8/tests/hid.c +++ b/dlls/dinput8/tests/hid.c @@ -4038,7 +4038,6 @@ static void test_simple_joystick(void) check_member( objinst, expect_objects[5], "%u", wReportId ); hr = IDirectInputDevice8_EnumEffects( device, NULL, NULL, DIEFT_ALL ); - todo_wine ok( hr == DIERR_INVALIDPARAM, "IDirectInputDevice8_EnumEffects returned %#x\n", hr ); res = 0; hr = IDirectInputDevice8_EnumEffects( device, check_effect_count, &res, 0xfe ); @@ -4054,18 +4053,14 @@ static void test_simple_joystick(void) check_effects_params.expect_count - check_effects_params.index ); hr = IDirectInputDevice8_GetEffectInfo( device, NULL, &GUID_Sine ); - todo_wine ok( hr == E_POINTER, "IDirectInputDevice8_GetEffectInfo returned %#x\n", hr ); effectinfo.dwSize = sizeof(DIEFFECTINFOW) + 1; hr = IDirectInputDevice8_GetEffectInfo( device, &effectinfo, &GUID_Sine ); - todo_wine ok( hr == DIERR_INVALIDPARAM, "IDirectInputDevice8_GetEffectInfo returned %#x\n", hr ); effectinfo.dwSize = sizeof(DIEFFECTINFOW); hr = IDirectInputDevice8_GetEffectInfo( device, &effectinfo, &GUID_NULL ); - todo_wine ok( hr == DIERR_DEVICENOTREG, "IDirectInputDevice8_GetEffectInfo returned %#x\n", hr ); hr = IDirectInputDevice8_GetEffectInfo( device, &effectinfo, &GUID_Sine ); - todo_wine ok( hr == DIERR_DEVICENOTREG, "IDirectInputDevice8_GetEffectInfo returned %#x\n", hr ); hr = IDirectInputDevice8_SetDataFormat( device, NULL ); @@ -4645,18 +4640,14 @@ static void test_simple_joystick(void) winetest_pop_context(); hr = IDirectInputDevice8_GetForceFeedbackState( device, NULL ); - todo_wine ok( hr == E_POINTER, "IDirectInputDevice8_GetForceFeedbackState returned %#x\n", hr ); res = 0xdeadbeef; hr = IDirectInputDevice8_GetForceFeedbackState( device, &res ); - todo_wine ok( hr == DIERR_UNSUPPORTED, "IDirectInputDevice8_GetForceFeedbackState returned %#x\n", hr ); hr = IDirectInputDevice8_SendForceFeedbackCommand( device, 0xdeadbeef ); - todo_wine ok( hr == DIERR_INVALIDPARAM, "IDirectInputDevice8_SendForceFeedbackCommand returned %#x\n", hr ); hr = IDirectInputDevice8_SendForceFeedbackCommand( device, DISFFC_RESET ); - todo_wine ok( hr == DIERR_UNSUPPORTED, "IDirectInputDevice8_SendForceFeedbackCommand returned %#x\n", hr ); objdata[0].dwOfs = 0xd; @@ -5713,6 +5704,7 @@ static void test_force_feedback_joystick( void ) effectinfo.dwSize = sizeof(DIEFFECTINFOW); hr = IDirectInputDevice8_GetEffectInfo( device, &effectinfo, &GUID_Sine ); + todo_wine ok( hr == DI_OK, "IDirectInputDevice8_GetEffectInfo returned %#x\n", hr ); todo_wine check_member_guid( effectinfo, expect_effects[0], guid ); @@ -5802,7 +5794,6 @@ static void test_force_feedback_joystick( void ) ok( hr == 0x80040301, "IDirectInputDevice8_GetForceFeedbackState returned %#x\n", hr ); hr = IDirectInputDevice8_SendForceFeedbackCommand( device, 0xdeadbeef ); - todo_wine ok( hr == DIERR_INVALIDPARAM, "IDirectInputDevice8_SendForceFeedbackCommand returned %#x\n", hr ); set_hid_expect( file, &expect_dc_reset, sizeof(expect_dc_reset) );
1
0
0
0
Nikolay Sivov : ole32/tests: Remove unused variable.
by Alexandre Julliard
01 Oct '21
01 Oct '21
Module: wine Branch: master Commit: f264ba76616f2e5eb080ed96d7823a11c48eda0f URL:
https://source.winehq.org/git/wine.git/?a=commit;h=f264ba76616f2e5eb080ed96…
Author: Nikolay Sivov <nsivov(a)codeweavers.com> Date: Fri Oct 1 10:24:51 2021 +0300 ole32/tests: Remove unused variable. Signed-off-by: Nikolay Sivov <nsivov(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/ole32/tests/moniker.c | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/dlls/ole32/tests/moniker.c b/dlls/ole32/tests/moniker.c index abd17c9961f..8d3276651bc 100644 --- a/dlls/ole32/tests/moniker.c +++ b/dlls/ole32/tests/moniker.c @@ -1179,7 +1179,6 @@ static void test_MkParseDisplayName(void) IEnumMoniker *spEM3 = NULL; DWORD pdwReg1=0; - DWORD grflags=0; DWORD pdwReg2=0; IRunningObjectTable * pprot=NULL; @@ -1388,13 +1387,10 @@ todo_wine matchCnt = count_moniker_matches(pbc, spEM1); - grflags= grflags | ROTFLAGS_REGISTRATIONKEEPSALIVE; - hr = IRunningObjectTable_Register(pprot, grflags, lpEM1, pmk1, &pdwReg1); + hr = IRunningObjectTable_Register(pprot, ROTFLAGS_REGISTRATIONKEEPSALIVE, lpEM1, pmk1, &pdwReg1); ok(hr == S_OK, "Failed to register object, hr %#x.\n", hr); - grflags=0; - grflags= grflags | ROTFLAGS_REGISTRATIONKEEPSALIVE; - hr = IRunningObjectTable_Register(pprot, grflags, lpEM1, pmk2, &pdwReg2); + hr = IRunningObjectTable_Register(pprot, ROTFLAGS_REGISTRATIONKEEPSALIVE, lpEM1, pmk2, &pdwReg2); ok(hr == S_OK, "Failed to register object, hr %#x.\n", hr); hr = IRunningObjectTable_EnumRunning(pprot, &spEM2);
1
0
0
0
Zhiyi Zhang : comctl32/button: Do not restore command link font after themed painting.
by Alexandre Julliard
01 Oct '21
01 Oct '21
Module: wine Branch: master Commit: 887e1bcfc31d0fa722433c7652f70dabd05a3c63 URL:
https://source.winehq.org/git/wine.git/?a=commit;h=887e1bcfc31d0fa722433c76…
Author: Zhiyi Zhang <zzhang(a)codeweavers.com> Date: Fri Oct 1 11:29:55 2021 +0800 comctl32/button: Do not restore command link font after themed painting. Fix button test failures when theming is on. Signed-off-by: Zhiyi Zhang <zzhang(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/comctl32/button.c | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/dlls/comctl32/button.c b/dlls/comctl32/button.c index 1a5d2afa999..b576e6c6db6 100644 --- a/dlls/comctl32/button.c +++ b/dlls/comctl32/button.c @@ -2982,12 +2982,13 @@ static void SB_ThemedPaint(HTHEME theme, const BUTTON_INFO *infoPtr, HDC hDC, in static void CL_ThemedPaint(HTHEME theme, const BUTTON_INFO *infoPtr, HDC hDC, int state, UINT dtFlags, BOOL focused) { - HFONT old_font = infoPtr->font ? SelectObject(hDC, infoPtr->font) : NULL; NMCUSTOMDRAW nmcd; LRESULT cdrf; HWND parent; RECT rc; + if (infoPtr->font) SelectObject(hDC, infoPtr->font); + GetClientRect(infoPtr->hwnd, &rc); init_custom_draw(&nmcd, infoPtr, hDC, &rc); @@ -2996,7 +2997,7 @@ static void CL_ThemedPaint(HTHEME theme, const BUTTON_INFO *infoPtr, HDC hDC, in /* Send erase notifications */ cdrf = SendMessageW(parent, WM_NOTIFY, nmcd.hdr.idFrom, (LPARAM)&nmcd); - if (cdrf & CDRF_SKIPDEFAULT) goto cleanup; + if (cdrf & CDRF_SKIPDEFAULT) return; if (IsThemeBackgroundPartiallyTransparent(theme, BP_COMMANDLINK, state)) DrawThemeParentBackground(infoPtr->hwnd, hDC, NULL); @@ -3011,7 +3012,7 @@ static void CL_ThemedPaint(HTHEME theme, const BUTTON_INFO *infoPtr, HDC hDC, in /* Send paint notifications */ nmcd.dwDrawStage = CDDS_PREPAINT; cdrf = SendMessageW(parent, WM_NOTIFY, nmcd.hdr.idFrom, (LPARAM)&nmcd); - if (cdrf & CDRF_SKIPDEFAULT) goto cleanup; + if (cdrf & CDRF_SKIPDEFAULT) return; if (!(cdrf & CDRF_DOERASE)) { @@ -3083,7 +3084,7 @@ static void CL_ThemedPaint(HTHEME theme, const BUTTON_INFO *infoPtr, HDC hDC, in nmcd.dwDrawStage = CDDS_POSTPAINT; SendMessageW(parent, WM_NOTIFY, nmcd.hdr.idFrom, (LPARAM)&nmcd); } - if (cdrf & CDRF_SKIPPOSTPAINT) goto cleanup; + if (cdrf & CDRF_SKIPPOSTPAINT) return; if (focused) { @@ -3098,9 +3099,6 @@ static void CL_ThemedPaint(HTHEME theme, const BUTTON_INFO *infoPtr, HDC hDC, in rc.bottom -= margins.cyBottomHeight; DrawFocusRect(hDC, &rc); } - -cleanup: - if (old_font) SelectObject(hDC, old_font); } void BUTTON_Register(void)
1
0
0
0
Zhiyi Zhang : comctl32/button: Do not restore split button font after themed painting.
by Alexandre Julliard
01 Oct '21
01 Oct '21
Module: wine Branch: master Commit: 84e0eac1f90b72e89fb4fcc7f9f35dbe1e5e56e8 URL:
https://source.winehq.org/git/wine.git/?a=commit;h=84e0eac1f90b72e89fb4fcc7…
Author: Zhiyi Zhang <zzhang(a)codeweavers.com> Date: Fri Oct 1 11:29:47 2021 +0800 comctl32/button: Do not restore split button font after themed painting. Fix button test failures when theming is on. Signed-off-by: Zhiyi Zhang <zzhang(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/comctl32/button.c | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/dlls/comctl32/button.c b/dlls/comctl32/button.c index f0b2c56b5fe..1a5d2afa999 100644 --- a/dlls/comctl32/button.c +++ b/dlls/comctl32/button.c @@ -2876,12 +2876,13 @@ static void GB_ThemedPaint(HTHEME theme, const BUTTON_INFO *infoPtr, HDC hDC, in static void SB_ThemedPaint(HTHEME theme, const BUTTON_INFO *infoPtr, HDC hDC, int state, UINT dtFlags, BOOL focused) { - HFONT old_font = infoPtr->font ? SelectObject(hDC, infoPtr->font) : NULL; RECT rc, content_rect, push_rect, dropdown_rect; NMCUSTOMDRAW nmcd; LRESULT cdrf; HWND parent; + if (infoPtr->font) SelectObject(hDC, infoPtr->font); + GetClientRect(infoPtr->hwnd, &rc); init_custom_draw(&nmcd, infoPtr, hDC, &rc); @@ -2890,7 +2891,7 @@ static void SB_ThemedPaint(HTHEME theme, const BUTTON_INFO *infoPtr, HDC hDC, in /* Send erase notifications */ cdrf = SendMessageW(parent, WM_NOTIFY, nmcd.hdr.idFrom, (LPARAM)&nmcd); - if (cdrf & CDRF_SKIPDEFAULT) goto cleanup; + if (cdrf & CDRF_SKIPDEFAULT) return; if (IsThemeBackgroundPartiallyTransparent(theme, BP_PUSHBUTTON, state)) DrawThemeParentBackground(infoPtr->hwnd, hDC, NULL); @@ -2934,7 +2935,7 @@ static void SB_ThemedPaint(HTHEME theme, const BUTTON_INFO *infoPtr, HDC hDC, in /* Send paint notifications */ nmcd.dwDrawStage = CDDS_PREPAINT; cdrf = SendMessageW(parent, WM_NOTIFY, nmcd.hdr.idFrom, (LPARAM)&nmcd); - if (cdrf & CDRF_SKIPDEFAULT) goto cleanup; + if (cdrf & CDRF_SKIPDEFAULT) return; if (!(cdrf & CDRF_DOERASE)) { @@ -2963,7 +2964,7 @@ static void SB_ThemedPaint(HTHEME theme, const BUTTON_INFO *infoPtr, HDC hDC, in nmcd.dwDrawStage = CDDS_POSTPAINT; SendMessageW(parent, WM_NOTIFY, nmcd.hdr.idFrom, (LPARAM)&nmcd); } - if (cdrf & CDRF_SKIPPOSTPAINT) goto cleanup; + if (cdrf & CDRF_SKIPPOSTPAINT) return; if (focused) { @@ -2977,9 +2978,6 @@ static void SB_ThemedPaint(HTHEME theme, const BUTTON_INFO *infoPtr, HDC hDC, in push_rect.bottom -= margins.cyBottomHeight; DrawFocusRect(hDC, &push_rect); } - -cleanup: - if (old_font) SelectObject(hDC, old_font); } static void CL_ThemedPaint(HTHEME theme, const BUTTON_INFO *infoPtr, HDC hDC, int state, UINT dtFlags, BOOL focused)
1
0
0
0
Zhiyi Zhang : comctl32/button: Do not restore groupbox font after themed painting.
by Alexandre Julliard
01 Oct '21
01 Oct '21
Module: wine Branch: master Commit: 1e7e31cab9fd6fd5aea1d580fa3433e4eb662d5f URL:
https://source.winehq.org/git/wine.git/?a=commit;h=1e7e31cab9fd6fd5aea1d580…
Author: Zhiyi Zhang <zzhang(a)codeweavers.com> Date: Fri Oct 1 11:29:30 2021 +0800 comctl32/button: Do not restore groupbox font after themed painting. Fix button tests failures when theming is on. Signed-off-by: Zhiyi Zhang <zzhang(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/comctl32/button.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/dlls/comctl32/button.c b/dlls/comctl32/button.c index 894cc6a3df9..f0b2c56b5fe 100644 --- a/dlls/comctl32/button.c +++ b/dlls/comctl32/button.c @@ -2835,8 +2835,8 @@ static void GB_ThemedPaint(HTHEME theme, const BUTTON_INFO *infoPtr, HDC hDC, in created_font = TRUE; } } else { - font = (HFONT)SendMessageW(infoPtr->hwnd, WM_GETFONT, 0, 0); - hPrevFont = SelectObject(hDC, font); + if (infoPtr->font) + SelectObject(hDC, infoPtr->font); } GetClientRect(infoPtr->hwnd, &bgRect);
1
0
0
0
Zhiyi Zhang : comctl32/button: Do not restore checkbox font after themed painting.
by Alexandre Julliard
01 Oct '21
01 Oct '21
Module: wine Branch: master Commit: 687d9d0beefeb6b1b5c78b5a4554ab0315a8f64d URL:
https://source.winehq.org/git/wine.git/?a=commit;h=687d9d0beefeb6b1b5c78b5a…
Author: Zhiyi Zhang <zzhang(a)codeweavers.com> Date: Fri Oct 1 11:27:00 2021 +0800 comctl32/button: Do not restore checkbox font after themed painting. Fix button tests failures when theming is on. Signed-off-by: Zhiyi Zhang <zzhang(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/comctl32/button.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/dlls/comctl32/button.c b/dlls/comctl32/button.c index 7dfc1720508..894cc6a3df9 100644 --- a/dlls/comctl32/button.c +++ b/dlls/comctl32/button.c @@ -2744,8 +2744,7 @@ static void CB_ThemedPaint(HTHEME theme, const BUTTON_INFO *infoPtr, HDC hDC, in created_font = TRUE; } } else { - font = (HFONT)SendMessageW(infoPtr->hwnd, WM_GETFONT, 0, 0); - hPrevFont = SelectObject(hDC, font); + if (infoPtr->font) SelectObject(hDC, infoPtr->font); } if (FAILED(GetThemePartSize(theme, hDC, part, state, NULL, TS_DRAW, &sz)))
1
0
0
0
Zhiyi Zhang : comctl32/button: Do not restore push button font after themed painting.
by Alexandre Julliard
01 Oct '21
01 Oct '21
Module: wine Branch: master Commit: 8b30c00a7bf38f6b80779c2d1bceecb4fbbf8b23 URL:
https://source.winehq.org/git/wine.git/?a=commit;h=8b30c00a7bf38f6b80779c2d…
Author: Zhiyi Zhang <zzhang(a)codeweavers.com> Date: Fri Oct 1 11:26:53 2021 +0800 comctl32/button: Do not restore push button font after themed painting. Fix button tests failures when theming is on. Signed-off-by: Zhiyi Zhang <zzhang(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/comctl32/button.c | 13 +++++-------- 1 file changed, 5 insertions(+), 8 deletions(-) diff --git a/dlls/comctl32/button.c b/dlls/comctl32/button.c index d3dcc67b169..7dfc1720508 100644 --- a/dlls/comctl32/button.c +++ b/dlls/comctl32/button.c @@ -2656,13 +2656,13 @@ cleanup: static void PB_ThemedPaint(HTHEME theme, const BUTTON_INFO *infoPtr, HDC hDC, int state, UINT dtFlags, BOOL focused) { RECT bgRect, textRect; - HFONT font = infoPtr->font; - HFONT hPrevFont = font ? SelectObject(hDC, font) : NULL; NMCUSTOMDRAW nmcd; LRESULT cdrf; HWND parent; WCHAR *text; + if (infoPtr->font) SelectObject(hDC, infoPtr->font); + GetClientRect(infoPtr->hwnd, &bgRect); GetThemeBackgroundContentRect(theme, hDC, BP_PUSHBUTTON, state, &bgRect, &textRect); init_custom_draw(&nmcd, infoPtr, hDC, &bgRect); @@ -2672,7 +2672,7 @@ static void PB_ThemedPaint(HTHEME theme, const BUTTON_INFO *infoPtr, HDC hDC, in /* Send erase notifications */ cdrf = SendMessageW(parent, WM_NOTIFY, nmcd.hdr.idFrom, (LPARAM)&nmcd); - if (cdrf & CDRF_SKIPDEFAULT) goto cleanup; + if (cdrf & CDRF_SKIPDEFAULT) return; if (IsThemeBackgroundPartiallyTransparent(theme, BP_PUSHBUTTON, state)) DrawThemeParentBackground(infoPtr->hwnd, hDC, NULL); @@ -2687,7 +2687,7 @@ static void PB_ThemedPaint(HTHEME theme, const BUTTON_INFO *infoPtr, HDC hDC, in /* Send paint notifications */ nmcd.dwDrawStage = CDDS_PREPAINT; cdrf = SendMessageW(parent, WM_NOTIFY, nmcd.hdr.idFrom, (LPARAM)&nmcd); - if (cdrf & CDRF_SKIPDEFAULT) goto cleanup; + if (cdrf & CDRF_SKIPDEFAULT) return; if (!(cdrf & CDRF_DOERASE) && (text = get_button_text(infoPtr))) { @@ -2700,7 +2700,7 @@ static void PB_ThemedPaint(HTHEME theme, const BUTTON_INFO *infoPtr, HDC hDC, in nmcd.dwDrawStage = CDDS_POSTPAINT; SendMessageW(parent, WM_NOTIFY, nmcd.hdr.idFrom, (LPARAM)&nmcd); } - if (cdrf & CDRF_SKIPPOSTPAINT) goto cleanup; + if (cdrf & CDRF_SKIPPOSTPAINT) return; if (focused) { @@ -2716,9 +2716,6 @@ static void PB_ThemedPaint(HTHEME theme, const BUTTON_INFO *infoPtr, HDC hDC, in DrawFocusRect( hDC, &focusRect ); } - -cleanup: - if (hPrevFont) SelectObject(hDC, hPrevFont); } static void CB_ThemedPaint(HTHEME theme, const BUTTON_INFO *infoPtr, HDC hDC, int state, UINT dtFlags, BOOL focused)
1
0
0
0
← Newer
1
...
111
112
113
114
115
116
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