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: Move EnumCreatedEffectObjects checks to device.c.
by Alexandre Julliard
21 Oct '21
21 Oct '21
Module: wine Branch: master Commit: df08662f8486726d9c4770f553a03750f53040d7 URL:
https://source.winehq.org/git/wine.git/?a=commit;h=df08662f8486726d9c4770f5…
Author: Rémi Bernon <rbernon(a)codeweavers.com> Date: Thu Oct 21 09:53:47 2021 +0200 dinput: Move EnumCreatedEffectObjects checks to device.c. Signed-off-by: Rémi Bernon <rbernon(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/dinput/device.c | 18 +++++++++++++----- dlls/dinput/device_private.h | 2 ++ dlls/dinput/joystick_hid.c | 12 +++++------- dlls/dinput/keyboard.c | 1 + dlls/dinput/mouse.c | 1 + 5 files changed, 22 insertions(+), 12 deletions(-) diff --git a/dlls/dinput/device.c b/dlls/dinput/device.c index b8da627b1ea..d9b92e82271 100644 --- a/dlls/dinput/device.c +++ b/dlls/dinput/device.c @@ -1799,12 +1799,20 @@ HRESULT WINAPI IDirectInputDevice2WImpl_SendForceFeedbackCommand( IDirectInputDe return hr; } -HRESULT WINAPI IDirectInputDevice2WImpl_EnumCreatedEffectObjects(LPDIRECTINPUTDEVICE8W iface, - LPDIENUMCREATEDEFFECTOBJECTSCALLBACK lpCallback, LPVOID lpvRef, DWORD dwFlags) +HRESULT WINAPI IDirectInputDevice2WImpl_EnumCreatedEffectObjects( IDirectInputDevice8W *iface, + LPDIENUMCREATEDEFFECTOBJECTSCALLBACK callback, + void *context, DWORD flags ) { - IDirectInputDeviceImpl *This = impl_from_IDirectInputDevice8W(iface); - FIXME("(%p)0>(%p,%p,0x%08x): stub!\n", This, lpCallback, lpvRef, dwFlags); - return DI_OK; + IDirectInputDeviceImpl *impl = impl_from_IDirectInputDevice8W( iface ); + + TRACE( "iface %p, callback %p, context %p, flags %#x.\n", iface, callback, context, flags ); + + if (!callback) return DIERR_INVALIDPARAM; + if (flags) return DIERR_INVALIDPARAM; + if (!(impl->caps.dwFlags & DIDC_FORCEFEEDBACK)) return DI_OK; + if (!impl->vtbl->enum_created_effect_objects) return DIERR_UNSUPPORTED; + + return impl->vtbl->enum_created_effect_objects( iface, callback, context, flags ); } HRESULT WINAPI IDirectInputDevice2WImpl_Escape(LPDIRECTINPUTDEVICE8W iface, LPDIEFFESCAPE lpDIEEsc) diff --git a/dlls/dinput/device_private.h b/dlls/dinput/device_private.h index b90c6bf2dcd..16d28323281 100644 --- a/dlls/dinput/device_private.h +++ b/dlls/dinput/device_private.h @@ -71,6 +71,8 @@ struct dinput_device_vtbl HRESULT (*get_effect_info)( IDirectInputDevice8W *iface, DIEFFECTINFOW *info, const GUID *guid ); HRESULT (*create_effect)( IDirectInputDevice8W *iface, IDirectInputEffect **out ); HRESULT (*send_force_feedback_command)( IDirectInputDevice8W *iface, DWORD command ); + HRESULT (*enum_created_effect_objects)( IDirectInputDevice8W *iface, LPDIENUMCREATEDEFFECTOBJECTSCALLBACK callback, + void *context, DWORD flags ); }; #define DEVICE_STATE_MAX_SIZE 1024 diff --git a/dlls/dinput/joystick_hid.c b/dlls/dinput/joystick_hid.c index e9bbfa081e8..5fb4e9a2de9 100644 --- a/dlls/dinput/joystick_hid.c +++ b/dlls/dinput/joystick_hid.c @@ -982,18 +982,15 @@ static HRESULT hid_joystick_internal_send_force_feedback_command( IDirectInputDe return DI_OK; } -static HRESULT WINAPI hid_joystick_EnumCreatedEffectObjects( IDirectInputDevice8W *iface, - LPDIENUMCREATEDEFFECTOBJECTSCALLBACK callback, - void *context, DWORD flags ) +static HRESULT hid_joystick_internal_enum_created_effect_objects( IDirectInputDevice8W *iface, + LPDIENUMCREATEDEFFECTOBJECTSCALLBACK callback, + void *context, DWORD flags ) { struct hid_joystick *impl = impl_from_IDirectInputDevice8W( iface ); struct hid_joystick_effect *effect, *next; TRACE( "iface %p, callback %p, context %p, flags %#x.\n", iface, callback, context, flags ); - if (!callback) return DIERR_INVALIDPARAM; - if (flags) return DIERR_INVALIDPARAM; - LIST_FOR_EACH_ENTRY_SAFE(effect, next, &impl->effect_list, struct hid_joystick_effect, entry) if (callback( &effect->IDirectInputEffect_iface, context ) != DIENUM_CONTINUE) break; @@ -1028,7 +1025,7 @@ static const IDirectInputDevice8WVtbl hid_joystick_vtbl = IDirectInputDevice2WImpl_GetEffectInfo, IDirectInputDevice2WImpl_GetForceFeedbackState, IDirectInputDevice2WImpl_SendForceFeedbackCommand, - hid_joystick_EnumCreatedEffectObjects, + IDirectInputDevice2WImpl_EnumCreatedEffectObjects, IDirectInputDevice2WImpl_Escape, IDirectInputDevice2WImpl_Poll, IDirectInputDevice2WImpl_SendDeviceData, @@ -1269,6 +1266,7 @@ static const struct dinput_device_vtbl hid_joystick_internal_vtbl = hid_joystick_internal_get_effect_info, hid_joystick_internal_create_effect, hid_joystick_internal_send_force_feedback_command, + hid_joystick_internal_enum_created_effect_objects, }; static DWORD device_type_for_version( DWORD type, DWORD version ) diff --git a/dlls/dinput/keyboard.c b/dlls/dinput/keyboard.c index a04b59e9c0c..fb6cf33b911 100644 --- a/dlls/dinput/keyboard.c +++ b/dlls/dinput/keyboard.c @@ -341,6 +341,7 @@ static const struct dinput_device_vtbl keyboard_internal_vtbl = NULL, NULL, NULL, + NULL, }; static const IDirectInputDevice8WVtbl SysKeyboardWvt = diff --git a/dlls/dinput/mouse.c b/dlls/dinput/mouse.c index faf093489cf..1b91fa12189 100644 --- a/dlls/dinput/mouse.c +++ b/dlls/dinput/mouse.c @@ -654,6 +654,7 @@ static const struct dinput_device_vtbl mouse_internal_vtbl = NULL, NULL, NULL, + NULL, }; static const IDirectInputDevice8WVtbl SysMouseWvt =
1
0
0
0
Rémi Bernon : dinput: Move SendForceFeedbackCommand generic code to device.c.
by Alexandre Julliard
21 Oct '21
21 Oct '21
Module: wine Branch: master Commit: 45d4c253de159618217a09374bdb016150edd6e8 URL:
https://source.winehq.org/git/wine.git/?a=commit;h=45d4c253de159618217a0937…
Author: Rémi Bernon <rbernon(a)codeweavers.com> Date: Thu Oct 21 09:53:46 2021 +0200 dinput: Move SendForceFeedbackCommand generic code to device.c. Signed-off-by: Rémi Bernon <rbernon(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/dinput/device.c | 30 ++++++++++++++++++++++++++---- dlls/dinput/device_private.h | 1 + dlls/dinput/joystick_hid.c | 35 ++++++++++++----------------------- dlls/dinput/keyboard.c | 1 + dlls/dinput/mouse.c | 1 + 5 files changed, 41 insertions(+), 27 deletions(-) diff --git a/dlls/dinput/device.c b/dlls/dinput/device.c index e0aa5141067..b8da627b1ea 100644 --- a/dlls/dinput/device.c +++ b/dlls/dinput/device.c @@ -1770,11 +1770,33 @@ HRESULT WINAPI IDirectInputDevice2WImpl_GetForceFeedbackState( IDirectInputDevic return DIERR_UNSUPPORTED; } -HRESULT WINAPI IDirectInputDevice2WImpl_SendForceFeedbackCommand(LPDIRECTINPUTDEVICE8W iface, DWORD dwFlags) +HRESULT WINAPI IDirectInputDevice2WImpl_SendForceFeedbackCommand( IDirectInputDevice8W *iface, DWORD command ) { - IDirectInputDeviceImpl *This = impl_from_IDirectInputDevice8W(iface); - TRACE("(%p)->(0x%08x)\n", This, dwFlags); - return DI_NOEFFECT; + IDirectInputDeviceImpl *impl = impl_from_IDirectInputDevice8W( iface ); + HRESULT hr; + + TRACE( "iface %p, flags %x.\n", iface, command ); + + switch (command) + { + case DISFFC_RESET: break; + case DISFFC_STOPALL: break; + case DISFFC_PAUSE: break; + case DISFFC_CONTINUE: break; + case DISFFC_SETACTUATORSON: break; + case DISFFC_SETACTUATORSOFF: break; + default: return DIERR_INVALIDPARAM; + } + + if (!(impl->caps.dwFlags & DIDC_FORCEFEEDBACK)) return DIERR_UNSUPPORTED; + if (!impl->vtbl->send_force_feedback_command) return DIERR_UNSUPPORTED; + + EnterCriticalSection( &impl->crit ); + if (!impl->acquired || !(impl->dwCoopLevel & DISCL_EXCLUSIVE)) hr = DIERR_NOTEXCLUSIVEACQUIRED; + else hr = impl->vtbl->send_force_feedback_command( iface, command ); + LeaveCriticalSection( &impl->crit ); + + return hr; } HRESULT WINAPI IDirectInputDevice2WImpl_EnumCreatedEffectObjects(LPDIRECTINPUTDEVICE8W iface, diff --git a/dlls/dinput/device_private.h b/dlls/dinput/device_private.h index 66c51f1672a..b90c6bf2dcd 100644 --- a/dlls/dinput/device_private.h +++ b/dlls/dinput/device_private.h @@ -70,6 +70,7 @@ struct dinput_device_vtbl const DIDEVICEOBJECTINSTANCEW *instance ); HRESULT (*get_effect_info)( IDirectInputDevice8W *iface, DIEFFECTINFOW *info, const GUID *guid ); HRESULT (*create_effect)( IDirectInputDevice8W *iface, IDirectInputEffect **out ); + HRESULT (*send_force_feedback_command)( IDirectInputDevice8W *iface, DWORD command ); }; #define DEVICE_STATE_MAX_SIZE 1024 diff --git a/dlls/dinput/joystick_hid.c b/dlls/dinput/joystick_hid.c index c7e9700ed7c..e9bbfa081e8 100644 --- a/dlls/dinput/joystick_hid.c +++ b/dlls/dinput/joystick_hid.c @@ -946,7 +946,7 @@ static BOOL CALLBACK unload_effect_object( IDirectInputEffect *effect, void *con return DIENUM_CONTINUE; } -static HRESULT WINAPI hid_joystick_SendForceFeedbackCommand( IDirectInputDevice8W *iface, DWORD command ) +static HRESULT hid_joystick_internal_send_force_feedback_command( IDirectInputDevice8W *iface, DWORD command ) { struct hid_joystick *impl = impl_from_IDirectInputDevice8W( iface ); struct pid_control_report *report = &impl->pid_device_control; @@ -955,7 +955,6 @@ static HRESULT WINAPI hid_joystick_SendForceFeedbackCommand( IDirectInputDevice8 NTSTATUS status; USAGE usage; ULONG count; - HRESULT hr; TRACE( "iface %p, flags %x.\n", iface, command ); @@ -967,31 +966,20 @@ static HRESULT WINAPI hid_joystick_SendForceFeedbackCommand( IDirectInputDevice8 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; } - if (!(impl->base.caps.dwFlags & DIDC_FORCEFEEDBACK)) return DIERR_UNSUPPORTED; + if (command == DISFFC_RESET) IDirectInputDevice8_EnumCreatedEffectObjects( iface, unload_effect_object, NULL, 0 ); - EnterCriticalSection( &impl->base.crit ); - if (!impl->base.acquired || !(impl->base.dwCoopLevel & DISCL_EXCLUSIVE)) - hr = DIERR_NOTEXCLUSIVEACQUIRED; - else - { - if (command == DISFFC_RESET) IDirectInputDevice8_EnumCreatedEffectObjects( iface, unload_effect_object, NULL, 0 ); - - 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 ); + count = 1; + status = HidP_InitializeReportForID( HidP_Output, report->id, impl->preparsed, report_buf, report_len ); + if (status != HIDP_STATUS_SUCCESS) return status; - 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 ); + 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) return status; - return hr; + if (!WriteFile( impl->device, report_buf, report_len, NULL, NULL )) return DIERR_INPUTLOST; + return DI_OK; } static HRESULT WINAPI hid_joystick_EnumCreatedEffectObjects( IDirectInputDevice8W *iface, @@ -1039,7 +1027,7 @@ static const IDirectInputDevice8WVtbl hid_joystick_vtbl = IDirectInputDevice2WImpl_EnumEffects, IDirectInputDevice2WImpl_GetEffectInfo, IDirectInputDevice2WImpl_GetForceFeedbackState, - hid_joystick_SendForceFeedbackCommand, + IDirectInputDevice2WImpl_SendForceFeedbackCommand, hid_joystick_EnumCreatedEffectObjects, IDirectInputDevice2WImpl_Escape, IDirectInputDevice2WImpl_Poll, @@ -1280,6 +1268,7 @@ static const struct dinput_device_vtbl hid_joystick_internal_vtbl = hid_joystick_internal_set_property, hid_joystick_internal_get_effect_info, hid_joystick_internal_create_effect, + hid_joystick_internal_send_force_feedback_command, }; static DWORD device_type_for_version( DWORD type, DWORD version ) diff --git a/dlls/dinput/keyboard.c b/dlls/dinput/keyboard.c index 8e1b752f016..a04b59e9c0c 100644 --- a/dlls/dinput/keyboard.c +++ b/dlls/dinput/keyboard.c @@ -340,6 +340,7 @@ static const struct dinput_device_vtbl keyboard_internal_vtbl = keyboard_internal_set_property, NULL, NULL, + NULL, }; static const IDirectInputDevice8WVtbl SysKeyboardWvt = diff --git a/dlls/dinput/mouse.c b/dlls/dinput/mouse.c index ec3282b267f..faf093489cf 100644 --- a/dlls/dinput/mouse.c +++ b/dlls/dinput/mouse.c @@ -653,6 +653,7 @@ static const struct dinput_device_vtbl mouse_internal_vtbl = mouse_internal_set_property, NULL, NULL, + NULL, }; static const IDirectInputDevice8WVtbl SysMouseWvt =
1
0
0
0
Rémi Bernon : dinput: Move CreateEffect generic implementation to device.c.
by Alexandre Julliard
21 Oct '21
21 Oct '21
Module: wine Branch: master Commit: 7c4e91f63b4dbd006af17c3f9dd03bbf86f04498 URL:
https://source.winehq.org/git/wine.git/?a=commit;h=7c4e91f63b4dbd006af17c3f…
Author: Rémi Bernon <rbernon(a)codeweavers.com> Date: Thu Oct 21 09:53:45 2021 +0200 dinput: Move CreateEffect generic implementation to device.c. Signed-off-by: Rémi Bernon <rbernon(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/dinput/device.c | 41 +++++++++++++++++++++++++++++------------ dlls/dinput/device_private.h | 1 + dlls/dinput/joystick_hid.c | 41 +++++------------------------------------ dlls/dinput/keyboard.c | 1 + dlls/dinput/mouse.c | 1 + 5 files changed, 37 insertions(+), 48 deletions(-) diff --git a/dlls/dinput/device.c b/dlls/dinput/device.c index 2a9b9aa596e..e0aa5141067 100644 --- a/dlls/dinput/device.c +++ b/dlls/dinput/device.c @@ -1645,20 +1645,37 @@ HRESULT WINAPI IDirectInputDevice2WImpl_Initialize(LPDIRECTINPUTDEVICE8W iface, return DI_OK; } -/****************************************************************************** - * IDirectInputDevice2A - */ - -HRESULT WINAPI IDirectInputDevice2WImpl_CreateEffect(LPDIRECTINPUTDEVICE8W iface, REFGUID rguid, LPCDIEFFECT lpeff, - LPDIRECTINPUTEFFECT *ppdef, LPUNKNOWN pUnkOuter) +HRESULT WINAPI IDirectInputDevice2WImpl_CreateEffect( IDirectInputDevice8W *iface, const GUID *guid, + const DIEFFECT *params, IDirectInputEffect **out, + IUnknown *outer ) { - IDirectInputDeviceImpl *This = impl_from_IDirectInputDevice8W(iface); - FIXME("(%p)->(%s,%p,%p,%p): stub!\n", This, debugstr_guid(rguid), lpeff, ppdef, pUnkOuter); - if (!ppdef) return E_POINTER; + IDirectInputDeviceImpl *impl = impl_from_IDirectInputDevice8W( iface ); + DWORD flags = DIEP_ALLPARAMS; + HRESULT hr; - FIXME("not available in the generic implementation\n"); - *ppdef = NULL; - return DIERR_UNSUPPORTED; + TRACE( "iface %p, guid %s, params %p, out %p, outer %p\n", iface, debugstr_guid( guid ), + params, out, outer ); + + if (!out) return E_POINTER; + *out = NULL; + + if (!(impl->caps.dwFlags & DIDC_FORCEFEEDBACK)) return DIERR_UNSUPPORTED; + if (!impl->vtbl->create_effect) return DIERR_UNSUPPORTED; + if (FAILED(hr = impl->vtbl->create_effect( iface, out ))) return hr; + + hr = IDirectInputEffect_Initialize( *out, DINPUT_instance, impl->dinput->dwVersion, guid ); + if (FAILED(hr)) goto failed; + + if (!params) return DI_OK; + if (!impl->acquired || !(impl->dwCoopLevel & DISCL_EXCLUSIVE)) flags |= DIEP_NODOWNLOAD; + hr = IDirectInputEffect_SetParameters( *out, params, flags ); + if (FAILED(hr)) goto failed; + return hr; + +failed: + IDirectInputEffect_Release( *out ); + *out = NULL; + return hr; } HRESULT WINAPI IDirectInputDevice2WImpl_EnumEffects( IDirectInputDevice8W *iface, LPDIENUMEFFECTSCALLBACKW callback, diff --git a/dlls/dinput/device_private.h b/dlls/dinput/device_private.h index 0b5919c7ec6..66c51f1672a 100644 --- a/dlls/dinput/device_private.h +++ b/dlls/dinput/device_private.h @@ -69,6 +69,7 @@ struct dinput_device_vtbl HRESULT (*set_property)( IDirectInputDevice8W *iface, DWORD property, const DIPROPHEADER *header, const DIDEVICEOBJECTINSTANCEW *instance ); HRESULT (*get_effect_info)( IDirectInputDevice8W *iface, DIEFFECTINFOW *info, const GUID *guid ); + HRESULT (*create_effect)( IDirectInputDevice8W *iface, IDirectInputEffect **out ); }; #define DEVICE_STATE_MAX_SIZE 1024 diff --git a/dlls/dinput/joystick_hid.c b/dlls/dinput/joystick_hid.c index 2788f138216..c7e9700ed7c 100644 --- a/dlls/dinput/joystick_hid.c +++ b/dlls/dinput/joystick_hid.c @@ -803,40 +803,7 @@ static HRESULT hid_joystick_internal_unacquire( IDirectInputDevice8W *iface ) return DI_OK; } -static HRESULT hid_joystick_effect_create( struct hid_joystick *joystick, IDirectInputEffect **out ); - -static HRESULT WINAPI hid_joystick_CreateEffect( IDirectInputDevice8W *iface, const GUID *guid, - const DIEFFECT *params, IDirectInputEffect **out, - IUnknown *outer ) -{ - struct hid_joystick *impl = impl_from_IDirectInputDevice8W( iface ); - DWORD flags = DIEP_ALLPARAMS; - HRESULT hr; - - TRACE( "iface %p, guid %s, params %p, out %p, outer %p\n", iface, debugstr_guid( guid ), - params, out, outer ); - - if (!out) return E_POINTER; - *out = NULL; - - if (!(impl->base.caps.dwFlags & DIDC_FORCEFEEDBACK)) return DIERR_UNSUPPORTED; - if (FAILED(hr = hid_joystick_effect_create( impl, out ))) return hr; - - hr = IDirectInputEffect_Initialize( *out, DINPUT_instance, impl->base.dinput->dwVersion, guid ); - if (FAILED(hr)) goto failed; - - if (!params) return DI_OK; - if (!impl->base.acquired || !(impl->base.dwCoopLevel & DISCL_EXCLUSIVE)) - flags |= DIEP_NODOWNLOAD; - hr = IDirectInputEffect_SetParameters( *out, params, flags ); - if (FAILED(hr)) goto failed; - return hr; - -failed: - IDirectInputEffect_Release( *out ); - *out = NULL; - return hr; -} +static HRESULT hid_joystick_internal_create_effect( IDirectInputDevice8W *iface, IDirectInputEffect **out ); static HRESULT hid_joystick_internal_get_effect_info( IDirectInputDevice8W *iface, DIEFFECTINFOW *info, const GUID *guid ) @@ -1068,7 +1035,7 @@ static const IDirectInputDevice8WVtbl hid_joystick_vtbl = IDirectInputDevice2WImpl_RunControlPanel, IDirectInputDevice2WImpl_Initialize, /*** IDirectInputDevice2 methods ***/ - hid_joystick_CreateEffect, + IDirectInputDevice2WImpl_CreateEffect, IDirectInputDevice2WImpl_EnumEffects, IDirectInputDevice2WImpl_GetEffectInfo, IDirectInputDevice2WImpl_GetForceFeedbackState, @@ -1312,6 +1279,7 @@ static const struct dinput_device_vtbl hid_joystick_internal_vtbl = hid_joystick_internal_get_property, hid_joystick_internal_set_property, hid_joystick_internal_get_effect_info, + hid_joystick_internal_create_effect, }; static DWORD device_type_for_version( DWORD type, DWORD version ) @@ -2826,8 +2794,9 @@ static IDirectInputEffectVtbl hid_joystick_effect_vtbl = hid_joystick_effect_Escape, }; -static HRESULT hid_joystick_effect_create( struct hid_joystick *joystick, IDirectInputEffect **out ) +static HRESULT hid_joystick_internal_create_effect( IDirectInputDevice8W *iface, IDirectInputEffect **out ) { + struct hid_joystick *joystick = impl_from_IDirectInputDevice8W( iface ); struct hid_joystick_effect *impl; ULONG report_len; diff --git a/dlls/dinput/keyboard.c b/dlls/dinput/keyboard.c index 1127ec2aaea..8e1b752f016 100644 --- a/dlls/dinput/keyboard.c +++ b/dlls/dinput/keyboard.c @@ -339,6 +339,7 @@ static const struct dinput_device_vtbl keyboard_internal_vtbl = keyboard_internal_get_property, keyboard_internal_set_property, NULL, + NULL, }; static const IDirectInputDevice8WVtbl SysKeyboardWvt = diff --git a/dlls/dinput/mouse.c b/dlls/dinput/mouse.c index 69348ad2c7f..ec3282b267f 100644 --- a/dlls/dinput/mouse.c +++ b/dlls/dinput/mouse.c @@ -652,6 +652,7 @@ static const struct dinput_device_vtbl mouse_internal_vtbl = mouse_internal_get_property, mouse_internal_set_property, NULL, + NULL, }; static const IDirectInputDevice8WVtbl SysMouseWvt =
1
0
0
0
Rémi Bernon : dinput: Move GetForceFeedbackState stub to device.c.
by Alexandre Julliard
21 Oct '21
21 Oct '21
Module: wine Branch: master Commit: 4ddd257f06aeb42f51e34211cc9ee267f5e5c536 URL:
https://source.winehq.org/git/wine.git/?a=commit;h=4ddd257f06aeb42f51e34211…
Author: Rémi Bernon <rbernon(a)codeweavers.com> Date: Thu Oct 21 09:53:44 2021 +0200 dinput: Move GetForceFeedbackState stub to device.c. Signed-off-by: Rémi Bernon <rbernon(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/dinput/device.c | 8 ++++---- dlls/dinput/joystick_hid.c | 11 +---------- 2 files changed, 5 insertions(+), 14 deletions(-) diff --git a/dlls/dinput/device.c b/dlls/dinput/device.c index ce163660e6c..2a9b9aa596e 100644 --- a/dlls/dinput/device.c +++ b/dlls/dinput/device.c @@ -1746,11 +1746,11 @@ HRESULT WINAPI IDirectInputDevice2WImpl_GetEffectInfo( IDirectInputDevice8W *ifa return impl->vtbl->get_effect_info( iface, info, guid ); } -HRESULT WINAPI IDirectInputDevice2WImpl_GetForceFeedbackState(LPDIRECTINPUTDEVICE8W iface, LPDWORD pdwOut) +HRESULT WINAPI IDirectInputDevice2WImpl_GetForceFeedbackState( IDirectInputDevice8W *iface, DWORD *out ) { - IDirectInputDeviceImpl *This = impl_from_IDirectInputDevice8W(iface); - FIXME("(%p)->(%p): stub!\n", This, pdwOut); - return DI_OK; + FIXME( "iface %p, out %p stub!\n", iface, out ); + if (!out) return E_POINTER; + return DIERR_UNSUPPORTED; } HRESULT WINAPI IDirectInputDevice2WImpl_SendForceFeedbackCommand(LPDIRECTINPUTDEVICE8W iface, DWORD dwFlags) diff --git a/dlls/dinput/joystick_hid.c b/dlls/dinput/joystick_hid.c index 1e1f8c05e3f..2788f138216 100644 --- a/dlls/dinput/joystick_hid.c +++ b/dlls/dinput/joystick_hid.c @@ -973,15 +973,6 @@ static HRESULT hid_joystick_internal_get_effect_info( IDirectInputDevice8W *ifac return DI_OK; } -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 BOOL CALLBACK unload_effect_object( IDirectInputEffect *effect, void *context ) { IDirectInputEffect_Unload( effect ); @@ -1080,7 +1071,7 @@ static const IDirectInputDevice8WVtbl hid_joystick_vtbl = hid_joystick_CreateEffect, IDirectInputDevice2WImpl_EnumEffects, IDirectInputDevice2WImpl_GetEffectInfo, - hid_joystick_GetForceFeedbackState, + IDirectInputDevice2WImpl_GetForceFeedbackState, hid_joystick_SendForceFeedbackCommand, hid_joystick_EnumCreatedEffectObjects, IDirectInputDevice2WImpl_Escape,
1
0
0
0
Rémi Bernon : dinput: Use the internal vtable for GetEffectInfo.
by Alexandre Julliard
21 Oct '21
21 Oct '21
Module: wine Branch: master Commit: f54210590f968d4fc8f22785c071514bb99400d2 URL:
https://source.winehq.org/git/wine.git/?a=commit;h=f54210590f968d4fc8f22785…
Author: Rémi Bernon <rbernon(a)codeweavers.com> Date: Thu Oct 21 09:53:43 2021 +0200 dinput: Use the internal vtable for GetEffectInfo. Signed-off-by: Rémi Bernon <rbernon(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/dinput/device.c | 18 +++++++++++------- dlls/dinput/device_private.h | 1 + dlls/dinput/joystick_hid.c | 13 ++++--------- dlls/dinput/keyboard.c | 1 + dlls/dinput/mouse.c | 1 + 5 files changed, 18 insertions(+), 16 deletions(-) diff --git a/dlls/dinput/device.c b/dlls/dinput/device.c index e5713f4713d..ce163660e6c 100644 --- a/dlls/dinput/device.c +++ b/dlls/dinput/device.c @@ -1732,14 +1732,18 @@ HRESULT WINAPI IDirectInputDevice2WImpl_EnumEffects( IDirectInputDevice8W *iface return DI_OK; } -HRESULT WINAPI IDirectInputDevice2WImpl_GetEffectInfo( - LPDIRECTINPUTDEVICE8W iface, - LPDIEFFECTINFOW lpdei, - REFGUID rguid) +HRESULT WINAPI IDirectInputDevice2WImpl_GetEffectInfo( IDirectInputDevice8W *iface, DIEFFECTINFOW *info, + const GUID *guid ) { - IDirectInputDeviceImpl *This = impl_from_IDirectInputDevice8W(iface); - FIXME("(%p)->(%p,%s): stub!\n", This, lpdei, debugstr_guid(rguid)); - return DI_OK; + IDirectInputDeviceImpl *impl = impl_from_IDirectInputDevice8W( iface ); + + TRACE( "iface %p, info %p, guid %s.\n", iface, info, debugstr_guid( guid ) ); + + if (!info) return E_POINTER; + if (info->dwSize != sizeof(DIEFFECTINFOW)) return DIERR_INVALIDPARAM; + if (!(impl->caps.dwFlags & DIDC_FORCEFEEDBACK)) return DIERR_DEVICENOTREG; + if (!impl->vtbl->get_effect_info) return DIERR_UNSUPPORTED; + return impl->vtbl->get_effect_info( iface, info, guid ); } HRESULT WINAPI IDirectInputDevice2WImpl_GetForceFeedbackState(LPDIRECTINPUTDEVICE8W iface, LPDWORD pdwOut) diff --git a/dlls/dinput/device_private.h b/dlls/dinput/device_private.h index bdac5b4a378..0b5919c7ec6 100644 --- a/dlls/dinput/device_private.h +++ b/dlls/dinput/device_private.h @@ -68,6 +68,7 @@ struct dinput_device_vtbl DIDEVICEOBJECTINSTANCEW *instance ); HRESULT (*set_property)( IDirectInputDevice8W *iface, DWORD property, const DIPROPHEADER *header, const DIDEVICEOBJECTINSTANCEW *instance ); + HRESULT (*get_effect_info)( IDirectInputDevice8W *iface, DIEFFECTINFOW *info, const GUID *guid ); }; #define DEVICE_STATE_MAX_SIZE 1024 diff --git a/dlls/dinput/joystick_hid.c b/dlls/dinput/joystick_hid.c index 91b6020d1f1..1e1f8c05e3f 100644 --- a/dlls/dinput/joystick_hid.c +++ b/dlls/dinput/joystick_hid.c @@ -838,8 +838,8 @@ failed: return hr; } -static HRESULT WINAPI hid_joystick_GetEffectInfo( IDirectInputDevice8W *iface, DIEFFECTINFOW *info, - const GUID *guid ) +static HRESULT hid_joystick_internal_get_effect_info( IDirectInputDevice8W *iface, DIEFFECTINFOW *info, + const GUID *guid ) { struct hid_joystick *impl = impl_from_IDirectInputDevice8W( iface ); struct pid_effect_update *effect_update = &impl->pid_effect_update; @@ -853,12 +853,6 @@ static HRESULT WINAPI hid_joystick_GetEffectInfo( IDirectInputDevice8W *iface, D USAGE usage = 0; USHORT count; - TRACE( "iface %p, info %p, guid %s.\n", iface, info, debugstr_guid( guid ) ); - - if (!info) return E_POINTER; - if (info->dwSize != sizeof(DIEFFECTINFOW)) return DIERR_INVALIDPARAM; - if (!(impl->base.caps.dwFlags & DIDC_FORCEFEEDBACK)) return DIERR_DEVICENOTREG; - switch ((usage = effect_guid_to_usage( guid ))) { case PID_USAGE_ET_SQUARE: @@ -1085,7 +1079,7 @@ static const IDirectInputDevice8WVtbl hid_joystick_vtbl = /*** IDirectInputDevice2 methods ***/ hid_joystick_CreateEffect, IDirectInputDevice2WImpl_EnumEffects, - hid_joystick_GetEffectInfo, + IDirectInputDevice2WImpl_GetEffectInfo, hid_joystick_GetForceFeedbackState, hid_joystick_SendForceFeedbackCommand, hid_joystick_EnumCreatedEffectObjects, @@ -1326,6 +1320,7 @@ static const struct dinput_device_vtbl hid_joystick_internal_vtbl = hid_joystick_internal_enum_objects, hid_joystick_internal_get_property, hid_joystick_internal_set_property, + hid_joystick_internal_get_effect_info, }; static DWORD device_type_for_version( DWORD type, DWORD version ) diff --git a/dlls/dinput/keyboard.c b/dlls/dinput/keyboard.c index f17dc89ac16..1127ec2aaea 100644 --- a/dlls/dinput/keyboard.c +++ b/dlls/dinput/keyboard.c @@ -338,6 +338,7 @@ static const struct dinput_device_vtbl keyboard_internal_vtbl = keyboard_internal_enum_objects, keyboard_internal_get_property, keyboard_internal_set_property, + NULL, }; static const IDirectInputDevice8WVtbl SysKeyboardWvt = diff --git a/dlls/dinput/mouse.c b/dlls/dinput/mouse.c index 7fafa7696a7..69348ad2c7f 100644 --- a/dlls/dinput/mouse.c +++ b/dlls/dinput/mouse.c @@ -651,6 +651,7 @@ static const struct dinput_device_vtbl mouse_internal_vtbl = mouse_internal_enum_objects, mouse_internal_get_property, mouse_internal_set_property, + NULL, }; static const IDirectInputDevice8WVtbl SysMouseWvt =
1
0
0
0
Rémi Bernon : dinput: Replace stub EnumEffects with generic implementation.
by Alexandre Julliard
21 Oct '21
21 Oct '21
Module: wine Branch: master Commit: 713d71c187c142b3dd889def6f9287be60d682a1 URL:
https://source.winehq.org/git/wine.git/?a=commit;h=713d71c187c142b3dd889def…
Author: Rémi Bernon <rbernon(a)codeweavers.com> Date: Thu Oct 21 09:53:42 2021 +0200 dinput: Replace stub EnumEffects with generic implementation. Signed-off-by: Rémi Bernon <rbernon(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/dinput/device.c | 73 +++++++++++++++++++++++++++++++++++++++++----- dlls/dinput/joystick_hid.c | 73 +--------------------------------------------- 2 files changed, 67 insertions(+), 79 deletions(-) diff --git a/dlls/dinput/device.c b/dlls/dinput/device.c index 8858bfa26bb..e5713f4713d 100644 --- a/dlls/dinput/device.c +++ b/dlls/dinput/device.c @@ -1661,14 +1661,73 @@ HRESULT WINAPI IDirectInputDevice2WImpl_CreateEffect(LPDIRECTINPUTDEVICE8W iface return DIERR_UNSUPPORTED; } -HRESULT WINAPI IDirectInputDevice2WImpl_EnumEffects( - LPDIRECTINPUTDEVICE8W iface, - LPDIENUMEFFECTSCALLBACKW lpCallback, - LPVOID lpvRef, - DWORD dwFlags) +HRESULT WINAPI IDirectInputDevice2WImpl_EnumEffects( IDirectInputDevice8W *iface, LPDIENUMEFFECTSCALLBACKW callback, + void *context, DWORD type ) { - IDirectInputDeviceImpl *This = impl_from_IDirectInputDevice8W(iface); - FIXME("(%p)->(%p,%p,0x%08x): stub!\n", This, lpCallback, lpvRef, dwFlags); + DIEFFECTINFOW info = {.dwSize = sizeof(info)}; + HRESULT hr; + + TRACE( "iface %p, callback %p, context %p, type %#x.\n", iface, callback, context, type ); + + if (!callback) return DIERR_INVALIDPARAM; + + type = DIEFT_GETTYPE( type ); + + if (type == DIEFT_ALL || type == DIEFT_CONSTANTFORCE) + { + hr = IDirectInputDevice8_GetEffectInfo( iface, &info, &GUID_ConstantForce ); + if (FAILED(hr) && hr != DIERR_DEVICENOTREG) return hr; + if (hr == DI_OK && callback( &info, context ) == DIENUM_STOP) return DI_OK; + } + + if (type == DIEFT_ALL || type == DIEFT_RAMPFORCE) + { + hr = IDirectInputDevice8_GetEffectInfo( iface, &info, &GUID_RampForce ); + if (FAILED(hr) && hr != DIERR_DEVICENOTREG) return hr; + if (hr == DI_OK && callback( &info, context ) == DIENUM_STOP) return DI_OK; + } + + if (type == DIEFT_ALL || type == DIEFT_PERIODIC) + { + hr = IDirectInputDevice8_GetEffectInfo( iface, &info, &GUID_Square ); + if (FAILED(hr) && hr != DIERR_DEVICENOTREG) return hr; + if (hr == DI_OK && callback( &info, context ) == DIENUM_STOP) return DI_OK; + + hr = IDirectInputDevice8_GetEffectInfo( iface, &info, &GUID_Sine ); + if (FAILED(hr) && hr != DIERR_DEVICENOTREG) return hr; + if (hr == DI_OK && callback( &info, context ) == DIENUM_STOP) return DI_OK; + + hr = IDirectInputDevice8_GetEffectInfo( iface, &info, &GUID_Triangle ); + if (FAILED(hr) && hr != DIERR_DEVICENOTREG) return hr; + if (hr == DI_OK && callback( &info, context ) == DIENUM_STOP) return DI_OK; + + hr = IDirectInputDevice8_GetEffectInfo( iface, &info, &GUID_SawtoothUp ); + if (FAILED(hr) && hr != DIERR_DEVICENOTREG) return hr; + if (hr == DI_OK && callback( &info, context ) == DIENUM_STOP) return DI_OK; + + hr = IDirectInputDevice8_GetEffectInfo( iface, &info, &GUID_SawtoothDown ); + if (FAILED(hr) && hr != DIERR_DEVICENOTREG) return hr; + if (hr == DI_OK && callback( &info, context ) == DIENUM_STOP) return DI_OK; + } + + if (type == DIEFT_ALL || type == DIEFT_CONDITION) + { + hr = IDirectInputDevice8_GetEffectInfo( iface, &info, &GUID_Spring ); + if (FAILED(hr) && hr != DIERR_DEVICENOTREG) return hr; + if (hr == DI_OK && callback( &info, context ) == DIENUM_STOP) return DI_OK; + + hr = IDirectInputDevice8_GetEffectInfo( iface, &info, &GUID_Damper ); + if (FAILED(hr) && hr != DIERR_DEVICENOTREG) return hr; + if (hr == DI_OK && callback( &info, context ) == DIENUM_STOP) return DI_OK; + + hr = IDirectInputDevice8_GetEffectInfo( iface, &info, &GUID_Inertia ); + if (FAILED(hr) && hr != DIERR_DEVICENOTREG) return hr; + if (hr == DI_OK && callback( &info, context ) == DIENUM_STOP) return DI_OK; + + hr = IDirectInputDevice8_GetEffectInfo( iface, &info, &GUID_Friction ); + if (FAILED(hr) && hr != DIERR_DEVICENOTREG) return hr; + if (hr == DI_OK && callback( &info, context ) == DIENUM_STOP) return DI_OK; + } return DI_OK; } diff --git a/dlls/dinput/joystick_hid.c b/dlls/dinput/joystick_hid.c index 766e022ebe0..91b6020d1f1 100644 --- a/dlls/dinput/joystick_hid.c +++ b/dlls/dinput/joystick_hid.c @@ -838,77 +838,6 @@ failed: return hr; } -static HRESULT WINAPI hid_joystick_EnumEffects( IDirectInputDevice8W *iface, LPDIENUMEFFECTSCALLBACKW callback, - void *context, DWORD type ) -{ - DIEFFECTINFOW info = {.dwSize = sizeof(info)}; - HRESULT hr; - - TRACE( "iface %p, callback %p, context %p, type %#x.\n", iface, callback, context, type ); - - if (!callback) return DIERR_INVALIDPARAM; - - type = DIEFT_GETTYPE( type ); - - if (type == DIEFT_ALL || type == DIEFT_CONSTANTFORCE) - { - hr = IDirectInputDevice8_GetEffectInfo( iface, &info, &GUID_ConstantForce ); - if (FAILED(hr) && hr != DIERR_DEVICENOTREG) return hr; - if (hr == DI_OK && callback( &info, context ) == DIENUM_STOP) return DI_OK; - } - - if (type == DIEFT_ALL || type == DIEFT_RAMPFORCE) - { - hr = IDirectInputDevice8_GetEffectInfo( iface, &info, &GUID_RampForce ); - if (FAILED(hr) && hr != DIERR_DEVICENOTREG) return hr; - if (hr == DI_OK && callback( &info, context ) == DIENUM_STOP) return DI_OK; - } - - if (type == DIEFT_ALL || type == DIEFT_PERIODIC) - { - hr = IDirectInputDevice8_GetEffectInfo( iface, &info, &GUID_Square ); - if (FAILED(hr) && hr != DIERR_DEVICENOTREG) return hr; - if (hr == DI_OK && callback( &info, context ) == DIENUM_STOP) return DI_OK; - - hr = IDirectInputDevice8_GetEffectInfo( iface, &info, &GUID_Sine ); - if (FAILED(hr) && hr != DIERR_DEVICENOTREG) return hr; - if (hr == DI_OK && callback( &info, context ) == DIENUM_STOP) return DI_OK; - - hr = IDirectInputDevice8_GetEffectInfo( iface, &info, &GUID_Triangle ); - if (FAILED(hr) && hr != DIERR_DEVICENOTREG) return hr; - if (hr == DI_OK && callback( &info, context ) == DIENUM_STOP) return DI_OK; - - hr = IDirectInputDevice8_GetEffectInfo( iface, &info, &GUID_SawtoothUp ); - if (FAILED(hr) && hr != DIERR_DEVICENOTREG) return hr; - if (hr == DI_OK && callback( &info, context ) == DIENUM_STOP) return DI_OK; - - hr = IDirectInputDevice8_GetEffectInfo( iface, &info, &GUID_SawtoothDown ); - if (FAILED(hr) && hr != DIERR_DEVICENOTREG) return hr; - if (hr == DI_OK && callback( &info, context ) == DIENUM_STOP) return DI_OK; - } - - if (type == DIEFT_ALL || type == DIEFT_CONDITION) - { - hr = IDirectInputDevice8_GetEffectInfo( iface, &info, &GUID_Spring ); - if (FAILED(hr) && hr != DIERR_DEVICENOTREG) return hr; - if (hr == DI_OK && callback( &info, context ) == DIENUM_STOP) return DI_OK; - - hr = IDirectInputDevice8_GetEffectInfo( iface, &info, &GUID_Damper ); - if (FAILED(hr) && hr != DIERR_DEVICENOTREG) return hr; - if (hr == DI_OK && callback( &info, context ) == DIENUM_STOP) return DI_OK; - - hr = IDirectInputDevice8_GetEffectInfo( iface, &info, &GUID_Inertia ); - if (FAILED(hr) && hr != DIERR_DEVICENOTREG) return hr; - if (hr == DI_OK && callback( &info, context ) == DIENUM_STOP) return DI_OK; - - hr = IDirectInputDevice8_GetEffectInfo( iface, &info, &GUID_Friction ); - if (FAILED(hr) && hr != DIERR_DEVICENOTREG) return hr; - if (hr == DI_OK && callback( &info, context ) == DIENUM_STOP) return DI_OK; - } - - return DI_OK; -} - static HRESULT WINAPI hid_joystick_GetEffectInfo( IDirectInputDevice8W *iface, DIEFFECTINFOW *info, const GUID *guid ) { @@ -1155,7 +1084,7 @@ static const IDirectInputDevice8WVtbl hid_joystick_vtbl = IDirectInputDevice2WImpl_Initialize, /*** IDirectInputDevice2 methods ***/ hid_joystick_CreateEffect, - hid_joystick_EnumEffects, + IDirectInputDevice2WImpl_EnumEffects, hid_joystick_GetEffectInfo, hid_joystick_GetForceFeedbackState, hid_joystick_SendForceFeedbackCommand,
1
0
0
0
Zebediah Figura : winegstreamer: Move the IWMReaderTimecode implementation to the wm_reader object.
by Alexandre Julliard
21 Oct '21
21 Oct '21
Module: wine Branch: master Commit: 37e9f0eadae9f62ccae8919a92686695927e9274 URL:
https://source.winehq.org/git/wine.git/?a=commit;h=37e9f0eadae9f62ccae8919a…
Author: Zebediah Figura <zfigura(a)codeweavers.com> Date: Wed Oct 20 22:48:41 2021 -0500 winegstreamer: Move the IWMReaderTimecode implementation to the wm_reader object. Signed-off-by: Zebediah Figura <zfigura(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/winegstreamer/gst_private.h | 1 + dlls/winegstreamer/wm_asyncreader.c | 52 ----------------------------------- dlls/winegstreamer/wm_reader.c | 55 +++++++++++++++++++++++++++++++++++++ dlls/wmvcore/tests/wmvcore.c | 2 +- 4 files changed, 57 insertions(+), 53 deletions(-) diff --git a/dlls/winegstreamer/gst_private.h b/dlls/winegstreamer/gst_private.h index be72f6694c7..c757dfbefd8 100644 --- a/dlls/winegstreamer/gst_private.h +++ b/dlls/winegstreamer/gst_private.h @@ -120,6 +120,7 @@ struct wm_reader IWMPacketSize2 IWMPacketSize2_iface; IWMProfile3 IWMProfile3_iface; IWMReaderPlaylistBurn IWMReaderPlaylistBurn_iface; + IWMReaderTimecode IWMReaderTimecode_iface; LONG refcount; const struct wm_reader_ops *ops; diff --git a/dlls/winegstreamer/wm_asyncreader.c b/dlls/winegstreamer/wm_asyncreader.c index 0a240ff55c5..12b96245707 100644 --- a/dlls/winegstreamer/wm_asyncreader.c +++ b/dlls/winegstreamer/wm_asyncreader.c @@ -30,7 +30,6 @@ struct async_reader IWMReaderNetworkConfig2 IWMReaderNetworkConfig2_iface; IWMReaderStreamClock IWMReaderStreamClock_iface; IWMReaderTypeNegotiation IWMReaderTypeNegotiation_iface; - IWMReaderTimecode IWMReaderTimecode_iface; IReferenceClock IReferenceClock_iface; }; @@ -1143,53 +1142,6 @@ static const IWMReaderTypeNegotiationVtbl WMReaderTypeNegotiationVtbl = negotiation_TryOutputProps }; -static struct async_reader *impl_from_IWMReaderTimecode(IWMReaderTimecode *iface) -{ - return CONTAINING_RECORD(iface, struct async_reader, IWMReaderTimecode_iface); -} - -static HRESULT WINAPI timecode_QueryInterface(IWMReaderTimecode *iface, REFIID riid, void **ppv) -{ - struct async_reader *This = impl_from_IWMReaderTimecode(iface); - return IWMReader_QueryInterface(&This->IWMReader_iface, riid, ppv); -} - -static ULONG WINAPI timecode_AddRef(IWMReaderTimecode *iface) -{ - struct async_reader *This = impl_from_IWMReaderTimecode(iface); - return IWMReader_AddRef(&This->IWMReader_iface); -} - -static ULONG WINAPI timecode_Release(IWMReaderTimecode *iface) -{ - struct async_reader *This = impl_from_IWMReaderTimecode(iface); - return IWMReader_Release(&This->IWMReader_iface); -} - -static HRESULT WINAPI timecode_GetTimecodeRangeCount(IWMReaderTimecode *iface, WORD num, WORD *count) -{ - struct async_reader *This = impl_from_IWMReaderTimecode(iface); - FIXME("%p, %d, %p\n", This, num, count); - return E_NOTIMPL; -} - -static HRESULT WINAPI timecode_GetTimecodeRangeBounds(IWMReaderTimecode *iface, WORD stream, WORD range, - DWORD *start_timecode, DWORD *end_timecode) -{ - struct async_reader *This = impl_from_IWMReaderTimecode(iface); - FIXME("%p, %d, %d, %p, %p\n", This, stream, range, start_timecode, end_timecode); - return E_NOTIMPL; -} - -static const IWMReaderTimecodeVtbl WMReaderTimecodeVtbl = -{ - timecode_QueryInterface, - timecode_AddRef, - timecode_Release, - timecode_GetTimecodeRangeCount, - timecode_GetTimecodeRangeBounds -}; - static struct async_reader *impl_from_IReferenceClock(IReferenceClock *iface) { return CONTAINING_RECORD(iface, struct async_reader, IReferenceClock_iface); @@ -1291,9 +1243,6 @@ static void *async_reader_query_interface(struct wm_reader *iface, REFIID iid) if (IsEqualIID(iid, &IID_IWMReaderStreamClock)) return &reader->IWMReaderStreamClock_iface; - if (IsEqualIID(iid, &IID_IWMReaderTimecode)) - return &reader->IWMReaderTimecode_iface; - if (IsEqualIID(iid, &IID_IWMReaderTypeNegotiation)) return &reader->IWMReaderTypeNegotiation_iface; @@ -1332,7 +1281,6 @@ HRESULT WINAPI winegstreamer_create_wm_async_reader(IWMReader **reader) object->IWMReaderAccelerator_iface.lpVtbl = &WMReaderAcceleratorVtbl; object->IWMReaderNetworkConfig2_iface.lpVtbl = &WMReaderNetworkConfig2Vtbl; object->IWMReaderStreamClock_iface.lpVtbl = &WMReaderStreamClockVtbl; - object->IWMReaderTimecode_iface.lpVtbl = &WMReaderTimecodeVtbl; object->IWMReaderTypeNegotiation_iface.lpVtbl = &WMReaderTypeNegotiationVtbl; TRACE("Created async reader %p.\n", object); diff --git a/dlls/winegstreamer/wm_reader.c b/dlls/winegstreamer/wm_reader.c index 1627dead3d6..963d33afe0f 100644 --- a/dlls/winegstreamer/wm_reader.c +++ b/dlls/winegstreamer/wm_reader.c @@ -57,6 +57,10 @@ static HRESULT WINAPI profile_QueryInterface(IWMProfile3 *iface, REFIID iid, voi { *out = &reader->IWMReaderPlaylistBurn_iface; } + else if (IsEqualIID(iid, &IID_IWMReaderTimecode)) + { + *out = &reader->IWMReaderTimecode_iface; + } else if (!(*out = reader->ops->query_interface(reader, iid))) { WARN("%s not implemented, returning E_NOINTERFACE.\n", debugstr_guid(iid)); @@ -705,6 +709,56 @@ static const IWMReaderPlaylistBurnVtbl playlist_vtbl = playlist_EndPlaylistBurn, }; +static struct wm_reader *impl_from_IWMReaderTimecode(IWMReaderTimecode *iface) +{ + return CONTAINING_RECORD(iface, struct wm_reader, IWMReaderTimecode_iface); +} + +static HRESULT WINAPI timecode_QueryInterface(IWMReaderTimecode *iface, REFIID iid, void **out) +{ + struct wm_reader *reader = impl_from_IWMReaderTimecode(iface); + + return IWMProfile3_QueryInterface(&reader->IWMProfile3_iface, iid, out); +} + +static ULONG WINAPI timecode_AddRef(IWMReaderTimecode *iface) +{ + struct wm_reader *reader = impl_from_IWMReaderTimecode(iface); + + return IWMProfile3_AddRef(&reader->IWMProfile3_iface); +} + +static ULONG WINAPI timecode_Release(IWMReaderTimecode *iface) +{ + struct wm_reader *reader = impl_from_IWMReaderTimecode(iface); + + return IWMProfile3_Release(&reader->IWMProfile3_iface); +} + +static HRESULT WINAPI timecode_GetTimecodeRangeCount(IWMReaderTimecode *iface, + WORD stream_number, WORD *count) +{ + FIXME("iface %p, stream_number %u, count %p, stub!\n", iface, stream_number, count); + return E_NOTIMPL; +} + +static HRESULT WINAPI timecode_GetTimecodeRangeBounds(IWMReaderTimecode *iface, + WORD stream_number, WORD index, DWORD *start, DWORD *end) +{ + FIXME("iface %p, stream_number %u, index %u, start %p, end %p, stub!\n", + iface, stream_number, index, start, end); + return E_NOTIMPL; +} + +static const IWMReaderTimecodeVtbl timecode_vtbl = +{ + timecode_QueryInterface, + timecode_AddRef, + timecode_Release, + timecode_GetTimecodeRangeCount, + timecode_GetTimecodeRangeBounds, +}; + void wm_reader_init(struct wm_reader *reader, const struct wm_reader_ops *ops) { reader->IWMHeaderInfo3_iface.lpVtbl = &header_info_vtbl; @@ -712,6 +766,7 @@ void wm_reader_init(struct wm_reader *reader, const struct wm_reader_ops *ops) reader->IWMPacketSize2_iface.lpVtbl = &packet_size_vtbl; reader->IWMProfile3_iface.lpVtbl = &profile_vtbl; reader->IWMReaderPlaylistBurn_iface.lpVtbl = &playlist_vtbl; + reader->IWMReaderTimecode_iface.lpVtbl = &timecode_vtbl; reader->refcount = 1; reader->ops = ops; } diff --git a/dlls/wmvcore/tests/wmvcore.c b/dlls/wmvcore/tests/wmvcore.c index 5c9e9551495..79bcfef0d52 100644 --- a/dlls/wmvcore/tests/wmvcore.c +++ b/dlls/wmvcore/tests/wmvcore.c @@ -154,7 +154,7 @@ static void test_wmsyncreader_interfaces(void) check_interface(reader, &IID_IWMProfile2, TRUE); check_interface(reader, &IID_IWMProfile3, TRUE); check_interface(reader, &IID_IWMReaderPlaylistBurn, TRUE); - todo_wine check_interface(reader, &IID_IWMReaderTimecode, TRUE); + check_interface(reader, &IID_IWMReaderTimecode, TRUE); check_interface(reader, &IID_IWMSyncReader, TRUE); check_interface(reader, &IID_IWMSyncReader2, TRUE);
1
0
0
0
Zebediah Figura : winegstreamer: Move the IWMReaderPlaylistBurn implementation to the wm_reader object.
by Alexandre Julliard
21 Oct '21
21 Oct '21
Module: wine Branch: master Commit: dd182a924f89b948010ecc0d79f43aec83adfe65 URL:
https://source.winehq.org/git/wine.git/?a=commit;h=dd182a924f89b948010ecc0d…
Author: Zebediah Figura <zfigura(a)codeweavers.com> Date: Wed Oct 20 22:48:40 2021 -0500 winegstreamer: Move the IWMReaderPlaylistBurn implementation to the wm_reader object. Signed-off-by: Zebediah Figura <zfigura(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/winegstreamer/gst_private.h | 1 + dlls/winegstreamer/wm_asyncreader.c | 69 ------------------------------------- dlls/winegstreamer/wm_reader.c | 68 ++++++++++++++++++++++++++++++++++++ dlls/wmvcore/tests/wmvcore.c | 2 +- 4 files changed, 70 insertions(+), 70 deletions(-) diff --git a/dlls/winegstreamer/gst_private.h b/dlls/winegstreamer/gst_private.h index 519be33dadd..be72f6694c7 100644 --- a/dlls/winegstreamer/gst_private.h +++ b/dlls/winegstreamer/gst_private.h @@ -119,6 +119,7 @@ struct wm_reader IWMLanguageList IWMLanguageList_iface; IWMPacketSize2 IWMPacketSize2_iface; IWMProfile3 IWMProfile3_iface; + IWMReaderPlaylistBurn IWMReaderPlaylistBurn_iface; LONG refcount; const struct wm_reader_ops *ops; diff --git a/dlls/winegstreamer/wm_asyncreader.c b/dlls/winegstreamer/wm_asyncreader.c index d2891730bfb..0a240ff55c5 100644 --- a/dlls/winegstreamer/wm_asyncreader.c +++ b/dlls/winegstreamer/wm_asyncreader.c @@ -31,7 +31,6 @@ struct async_reader IWMReaderStreamClock IWMReaderStreamClock_iface; IWMReaderTypeNegotiation IWMReaderTypeNegotiation_iface; IWMReaderTimecode IWMReaderTimecode_iface; - IWMReaderPlaylistBurn IWMReaderPlaylistBurn_iface; IReferenceClock IReferenceClock_iface; }; @@ -1191,70 +1190,6 @@ static const IWMReaderTimecodeVtbl WMReaderTimecodeVtbl = timecode_GetTimecodeRangeBounds }; - -static struct async_reader *impl_from_IWMReaderPlaylistBurn(IWMReaderPlaylistBurn *iface) -{ - return CONTAINING_RECORD(iface, struct async_reader, IWMReaderPlaylistBurn_iface); -} - -static HRESULT WINAPI playlist_QueryInterface(IWMReaderPlaylistBurn *iface, REFIID riid, void **ppv) -{ - struct async_reader *This = impl_from_IWMReaderPlaylistBurn(iface); - return IWMReader_QueryInterface(&This->IWMReader_iface, riid, ppv); -} - -static ULONG WINAPI playlist_AddRef(IWMReaderPlaylistBurn *iface) -{ - struct async_reader *This = impl_from_IWMReaderPlaylistBurn(iface); - return IWMReader_AddRef(&This->IWMReader_iface); -} - -static ULONG WINAPI playlist_Release(IWMReaderPlaylistBurn *iface) -{ - struct async_reader *This = impl_from_IWMReaderPlaylistBurn(iface); - return IWMReader_Release(&This->IWMReader_iface); -} - -static HRESULT WINAPI playlist_InitPlaylistBurn(IWMReaderPlaylistBurn *iface, DWORD count, - LPCWSTR_WMSDK_TYPE_SAFE *filenames, IWMStatusCallback *callback, void *context) -{ - struct async_reader *This = impl_from_IWMReaderPlaylistBurn(iface); - FIXME("%p, %d, %p, %p, %p\n", This, count, filenames, callback, context); - return E_NOTIMPL; -} - -static HRESULT WINAPI playlist_GetInitResults(IWMReaderPlaylistBurn *iface, DWORD count, HRESULT *stat) -{ - struct async_reader *This = impl_from_IWMReaderPlaylistBurn(iface); - FIXME("%p, %d, %p\n", This, count, stat); - return E_NOTIMPL; -} - -static HRESULT WINAPI playlist_Cancel(IWMReaderPlaylistBurn *iface) -{ - struct async_reader *This = impl_from_IWMReaderPlaylistBurn(iface); - FIXME("%p\n", This); - return E_NOTIMPL; -} - -static HRESULT WINAPI playlist_EndPlaylistBurn(IWMReaderPlaylistBurn *iface, HRESULT result) -{ - struct async_reader *This = impl_from_IWMReaderPlaylistBurn(iface); - FIXME("%p, 0x%08x\n", This, result); - return E_NOTIMPL; -} - -static const IWMReaderPlaylistBurnVtbl WMReaderPlaylistBurnVtbl = -{ - playlist_QueryInterface, - playlist_AddRef, - playlist_Release, - playlist_InitPlaylistBurn, - playlist_GetInitResults, - playlist_Cancel, - playlist_EndPlaylistBurn -}; - static struct async_reader *impl_from_IReferenceClock(IReferenceClock *iface) { return CONTAINING_RECORD(iface, struct async_reader, IReferenceClock_iface); @@ -1353,9 +1288,6 @@ static void *async_reader_query_interface(struct wm_reader *iface, REFIID iid) || IsEqualIID(iid, &IID_IWMReaderNetworkConfig2)) return &reader->IWMReaderNetworkConfig2_iface; - if (IsEqualIID(iid, &IID_IWMReaderPlaylistBurn)) - return &reader->IWMReaderPlaylistBurn_iface; - if (IsEqualIID(iid, &IID_IWMReaderStreamClock)) return &reader->IWMReaderStreamClock_iface; @@ -1399,7 +1331,6 @@ HRESULT WINAPI winegstreamer_create_wm_async_reader(IWMReader **reader) object->IWMReaderAdvanced6_iface.lpVtbl = &WMReaderAdvanced6Vtbl; object->IWMReaderAccelerator_iface.lpVtbl = &WMReaderAcceleratorVtbl; object->IWMReaderNetworkConfig2_iface.lpVtbl = &WMReaderNetworkConfig2Vtbl; - object->IWMReaderPlaylistBurn_iface.lpVtbl = &WMReaderPlaylistBurnVtbl; object->IWMReaderStreamClock_iface.lpVtbl = &WMReaderStreamClockVtbl; object->IWMReaderTimecode_iface.lpVtbl = &WMReaderTimecodeVtbl; object->IWMReaderTypeNegotiation_iface.lpVtbl = &WMReaderTypeNegotiationVtbl; diff --git a/dlls/winegstreamer/wm_reader.c b/dlls/winegstreamer/wm_reader.c index edf8f227308..1627dead3d6 100644 --- a/dlls/winegstreamer/wm_reader.c +++ b/dlls/winegstreamer/wm_reader.c @@ -53,6 +53,10 @@ static HRESULT WINAPI profile_QueryInterface(IWMProfile3 *iface, REFIID iid, voi { *out = &reader->IWMProfile3_iface; } + else if (IsEqualIID(iid, &IID_IWMReaderPlaylistBurn)) + { + *out = &reader->IWMReaderPlaylistBurn_iface; + } else if (!(*out = reader->ops->query_interface(reader, iid))) { WARN("%s not implemented, returning E_NOINTERFACE.\n", debugstr_guid(iid)); @@ -638,12 +642,76 @@ static const IWMPacketSize2Vtbl packet_size_vtbl = packet_size_SetMinPacketSize, }; +static struct wm_reader *impl_from_IWMReaderPlaylistBurn(IWMReaderPlaylistBurn *iface) +{ + return CONTAINING_RECORD(iface, struct wm_reader, IWMReaderPlaylistBurn_iface); +} + +static HRESULT WINAPI playlist_QueryInterface(IWMReaderPlaylistBurn *iface, REFIID iid, void **out) +{ + struct wm_reader *reader = impl_from_IWMReaderPlaylistBurn(iface); + + return IWMProfile3_QueryInterface(&reader->IWMProfile3_iface, iid, out); +} + +static ULONG WINAPI playlist_AddRef(IWMReaderPlaylistBurn *iface) +{ + struct wm_reader *reader = impl_from_IWMReaderPlaylistBurn(iface); + + return IWMProfile3_AddRef(&reader->IWMProfile3_iface); +} + +static ULONG WINAPI playlist_Release(IWMReaderPlaylistBurn *iface) +{ + struct wm_reader *reader = impl_from_IWMReaderPlaylistBurn(iface); + + return IWMProfile3_Release(&reader->IWMProfile3_iface); +} + +static HRESULT WINAPI playlist_InitPlaylistBurn(IWMReaderPlaylistBurn *iface, DWORD count, + const WCHAR **filenames, IWMStatusCallback *callback, void *context) +{ + FIXME("iface %p, count %u, filenames %p, callback %p, context %p, stub!\n", + iface, count, filenames, callback, context); + return E_NOTIMPL; +} + +static HRESULT WINAPI playlist_GetInitResults(IWMReaderPlaylistBurn *iface, DWORD count, HRESULT *hrs) +{ + FIXME("iface %p, count %u, hrs %p, stub!\n", iface, count, hrs); + return E_NOTIMPL; +} + +static HRESULT WINAPI playlist_Cancel(IWMReaderPlaylistBurn *iface) +{ + FIXME("iface %p, stub!\n", iface); + return E_NOTIMPL; +} + +static HRESULT WINAPI playlist_EndPlaylistBurn(IWMReaderPlaylistBurn *iface, HRESULT hr) +{ + FIXME("iface %p, hr %#x, stub!\n", iface, hr); + return E_NOTIMPL; +} + +static const IWMReaderPlaylistBurnVtbl playlist_vtbl = +{ + playlist_QueryInterface, + playlist_AddRef, + playlist_Release, + playlist_InitPlaylistBurn, + playlist_GetInitResults, + playlist_Cancel, + playlist_EndPlaylistBurn, +}; + void wm_reader_init(struct wm_reader *reader, const struct wm_reader_ops *ops) { reader->IWMHeaderInfo3_iface.lpVtbl = &header_info_vtbl; reader->IWMLanguageList_iface.lpVtbl = &language_list_vtbl; reader->IWMPacketSize2_iface.lpVtbl = &packet_size_vtbl; reader->IWMProfile3_iface.lpVtbl = &profile_vtbl; + reader->IWMReaderPlaylistBurn_iface.lpVtbl = &playlist_vtbl; reader->refcount = 1; reader->ops = ops; } diff --git a/dlls/wmvcore/tests/wmvcore.c b/dlls/wmvcore/tests/wmvcore.c index 0662c035617..5c9e9551495 100644 --- a/dlls/wmvcore/tests/wmvcore.c +++ b/dlls/wmvcore/tests/wmvcore.c @@ -153,7 +153,7 @@ static void test_wmsyncreader_interfaces(void) check_interface(reader, &IID_IWMProfile, TRUE); check_interface(reader, &IID_IWMProfile2, TRUE); check_interface(reader, &IID_IWMProfile3, TRUE); - todo_wine check_interface(reader, &IID_IWMReaderPlaylistBurn, TRUE); + check_interface(reader, &IID_IWMReaderPlaylistBurn, TRUE); todo_wine check_interface(reader, &IID_IWMReaderTimecode, TRUE); check_interface(reader, &IID_IWMSyncReader, TRUE); check_interface(reader, &IID_IWMSyncReader2, TRUE);
1
0
0
0
Zebediah Figura : winegstreamer: Move the IWMPacketSize2 implementation to the wm_reader object.
by Alexandre Julliard
21 Oct '21
21 Oct '21
Module: wine Branch: master Commit: 4f10b95c8355c94e4c6f506322b80be7ae7aa174 URL:
https://source.winehq.org/git/wine.git/?a=commit;h=4f10b95c8355c94e4c6f5063…
Author: Zebediah Figura <zfigura(a)codeweavers.com> Date: Wed Oct 20 22:48:39 2021 -0500 winegstreamer: Move the IWMPacketSize2 implementation to the wm_reader object. Signed-off-by: Zebediah Figura <zfigura(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/winegstreamer/gst_private.h | 1 + dlls/winegstreamer/wm_asyncreader.c | 68 ------------------------------------- dlls/winegstreamer/wm_reader.c | 67 ++++++++++++++++++++++++++++++++++++ dlls/wmvcore/tests/wmvcore.c | 4 +-- 4 files changed, 70 insertions(+), 70 deletions(-) diff --git a/dlls/winegstreamer/gst_private.h b/dlls/winegstreamer/gst_private.h index 6dc0ad3e291..519be33dadd 100644 --- a/dlls/winegstreamer/gst_private.h +++ b/dlls/winegstreamer/gst_private.h @@ -117,6 +117,7 @@ struct wm_reader { IWMHeaderInfo3 IWMHeaderInfo3_iface; IWMLanguageList IWMLanguageList_iface; + IWMPacketSize2 IWMPacketSize2_iface; IWMProfile3 IWMProfile3_iface; LONG refcount; diff --git a/dlls/winegstreamer/wm_asyncreader.c b/dlls/winegstreamer/wm_asyncreader.c index a36718ef453..d2891730bfb 100644 --- a/dlls/winegstreamer/wm_asyncreader.c +++ b/dlls/winegstreamer/wm_asyncreader.c @@ -33,7 +33,6 @@ struct async_reader IWMReaderTimecode IWMReaderTimecode_iface; IWMReaderPlaylistBurn IWMReaderPlaylistBurn_iface; IReferenceClock IReferenceClock_iface; - IWMPacketSize2 IWMPacketSize2_iface; }; static struct async_reader *impl_from_IWMReader(IWMReader *iface) @@ -1322,68 +1321,6 @@ static const IReferenceClockVtbl ReferenceClockVtbl = refclock_Unadvise }; -static struct async_reader *impl_from_IWMPacketSize2(IWMPacketSize2 *iface) -{ - return CONTAINING_RECORD(iface, struct async_reader, IWMPacketSize2_iface); -} - -static HRESULT WINAPI packetsize_QueryInterface(IWMPacketSize2 *iface, REFIID riid, void **ppv) -{ - struct async_reader *This = impl_from_IWMPacketSize2(iface); - return IWMReader_QueryInterface(&This->IWMReader_iface, riid, ppv); -} - -static ULONG WINAPI packetsize_AddRef(IWMPacketSize2 *iface) -{ - struct async_reader *This = impl_from_IWMPacketSize2(iface); - return IWMReader_AddRef(&This->IWMReader_iface); -} - -static ULONG WINAPI packetsize_Release(IWMPacketSize2 *iface) -{ - struct async_reader *This = impl_from_IWMPacketSize2(iface); - return IWMReader_Release(&This->IWMReader_iface); -} - -static HRESULT WINAPI packetsize_GetMaxPacketSize(IWMPacketSize2 *iface, DWORD *size) -{ - struct async_reader *This = impl_from_IWMPacketSize2(iface); - FIXME("%p, %p\n", This, size); - return E_NOTIMPL; -} - -static HRESULT WINAPI packetsize_SetMaxPacketSize(IWMPacketSize2 *iface, DWORD size) -{ - struct async_reader *This = impl_from_IWMPacketSize2(iface); - FIXME("%p, %d\n", This, size); - return E_NOTIMPL; -} - -static HRESULT WINAPI packetsize_GetMinPacketSize(IWMPacketSize2 *iface, DWORD *size) -{ - struct async_reader *This = impl_from_IWMPacketSize2(iface); - FIXME("%p, %p\n", This, size); - return E_NOTIMPL; -} - -static HRESULT WINAPI packetsize_SetMinPacketSize(IWMPacketSize2 *iface, DWORD size) -{ - struct async_reader *This = impl_from_IWMPacketSize2(iface); - FIXME("%p, %d\n", This, size); - return E_NOTIMPL; -} - -static const IWMPacketSize2Vtbl WMPacketSize2Vtbl = -{ - packetsize_QueryInterface, - packetsize_AddRef, - packetsize_Release, - packetsize_GetMaxPacketSize, - packetsize_SetMaxPacketSize, - packetsize_GetMinPacketSize, - packetsize_SetMinPacketSize -}; - static struct async_reader *impl_from_wm_reader(struct wm_reader *iface) { return CONTAINING_RECORD(iface, struct async_reader, reader); @@ -1398,10 +1335,6 @@ static void *async_reader_query_interface(struct wm_reader *iface, REFIID iid) if (IsEqualIID(iid, &IID_IReferenceClock)) return &reader->IReferenceClock_iface; - if (IsEqualIID(iid, &IID_IWMPacketSize) - || IsEqualIID(iid, &IID_IWMPacketSize2)) - return &reader->IWMPacketSize2_iface; - if (IsEqualIID(iid, &IID_IWMReader)) return &reader->IWMReader_iface; @@ -1462,7 +1395,6 @@ HRESULT WINAPI winegstreamer_create_wm_async_reader(IWMReader **reader) wm_reader_init(&object->reader, &async_reader_ops); object->IReferenceClock_iface.lpVtbl = &ReferenceClockVtbl; - object->IWMPacketSize2_iface.lpVtbl = &WMPacketSize2Vtbl; object->IWMReader_iface.lpVtbl = &WMReaderVtbl; object->IWMReaderAdvanced6_iface.lpVtbl = &WMReaderAdvanced6Vtbl; object->IWMReaderAccelerator_iface.lpVtbl = &WMReaderAcceleratorVtbl; diff --git a/dlls/winegstreamer/wm_reader.c b/dlls/winegstreamer/wm_reader.c index b72ff98cd18..edf8f227308 100644 --- a/dlls/winegstreamer/wm_reader.c +++ b/dlls/winegstreamer/wm_reader.c @@ -41,6 +41,11 @@ static HRESULT WINAPI profile_QueryInterface(IWMProfile3 *iface, REFIID iid, voi { *out = &reader->IWMLanguageList_iface; } + else if (IsEqualIID(iid, &IID_IWMPacketSize) + || IsEqualIID(iid, &IID_IWMPacketSize2)) + { + *out = &reader->IWMPacketSize2_iface; + } else if (IsEqualIID(iid, &IID_IUnknown) || IsEqualIID(iid, &IID_IWMProfile) || IsEqualIID(iid, &IID_IWMProfile2) @@ -572,10 +577,72 @@ static const IWMLanguageListVtbl language_list_vtbl = language_list_AddLanguageByRFC1766String, }; +static struct wm_reader *impl_from_IWMPacketSize2(IWMPacketSize2 *iface) +{ + return CONTAINING_RECORD(iface, struct wm_reader, IWMPacketSize2_iface); +} + +static HRESULT WINAPI packet_size_QueryInterface(IWMPacketSize2 *iface, REFIID iid, void **out) +{ + struct wm_reader *reader = impl_from_IWMPacketSize2(iface); + + return IWMProfile3_QueryInterface(&reader->IWMProfile3_iface, iid, out); +} + +static ULONG WINAPI packet_size_AddRef(IWMPacketSize2 *iface) +{ + struct wm_reader *reader = impl_from_IWMPacketSize2(iface); + + return IWMProfile3_AddRef(&reader->IWMProfile3_iface); +} + +static ULONG WINAPI packet_size_Release(IWMPacketSize2 *iface) +{ + struct wm_reader *reader = impl_from_IWMPacketSize2(iface); + + return IWMProfile3_Release(&reader->IWMProfile3_iface); +} + +static HRESULT WINAPI packet_size_GetMaxPacketSize(IWMPacketSize2 *iface, DWORD *size) +{ + FIXME("iface %p, size %p, stub!\n", iface, size); + return E_NOTIMPL; +} + +static HRESULT WINAPI packet_size_SetMaxPacketSize(IWMPacketSize2 *iface, DWORD size) +{ + FIXME("iface %p, size %u, stub!\n", iface, size); + return E_NOTIMPL; +} + +static HRESULT WINAPI packet_size_GetMinPacketSize(IWMPacketSize2 *iface, DWORD *size) +{ + FIXME("iface %p, size %p, stub!\n", iface, size); + return E_NOTIMPL; +} + +static HRESULT WINAPI packet_size_SetMinPacketSize(IWMPacketSize2 *iface, DWORD size) +{ + FIXME("iface %p, size %u, stub!\n", iface, size); + return E_NOTIMPL; +} + +static const IWMPacketSize2Vtbl packet_size_vtbl = +{ + packet_size_QueryInterface, + packet_size_AddRef, + packet_size_Release, + packet_size_GetMaxPacketSize, + packet_size_SetMaxPacketSize, + packet_size_GetMinPacketSize, + packet_size_SetMinPacketSize, +}; + void wm_reader_init(struct wm_reader *reader, const struct wm_reader_ops *ops) { reader->IWMHeaderInfo3_iface.lpVtbl = &header_info_vtbl; reader->IWMLanguageList_iface.lpVtbl = &language_list_vtbl; + reader->IWMPacketSize2_iface.lpVtbl = &packet_size_vtbl; reader->IWMProfile3_iface.lpVtbl = &profile_vtbl; reader->refcount = 1; reader->ops = ops; diff --git a/dlls/wmvcore/tests/wmvcore.c b/dlls/wmvcore/tests/wmvcore.c index 9f9c5ed393f..0662c035617 100644 --- a/dlls/wmvcore/tests/wmvcore.c +++ b/dlls/wmvcore/tests/wmvcore.c @@ -148,8 +148,8 @@ static void test_wmsyncreader_interfaces(void) check_interface(reader, &IID_IWMHeaderInfo2, TRUE); check_interface(reader, &IID_IWMHeaderInfo3, TRUE); check_interface(reader, &IID_IWMLanguageList, TRUE); - todo_wine check_interface(reader, &IID_IWMPacketSize, TRUE); - todo_wine check_interface(reader, &IID_IWMPacketSize2, TRUE); + check_interface(reader, &IID_IWMPacketSize, TRUE); + check_interface(reader, &IID_IWMPacketSize2, TRUE); check_interface(reader, &IID_IWMProfile, TRUE); check_interface(reader, &IID_IWMProfile2, TRUE); check_interface(reader, &IID_IWMProfile3, TRUE);
1
0
0
0
Zhiyi Zhang : uxtheme: Check LoadedBefore registry key before loading theme.
by Alexandre Julliard
21 Oct '21
21 Oct '21
Module: wine Branch: master Commit: d290362c8ca82fe09a0908a64f26f39ae6fc3eb3 URL:
https://source.winehq.org/git/wine.git/?a=commit;h=d290362c8ca82fe09a0908a6…
Author: Zhiyi Zhang <zzhang(a)codeweavers.com> Date: Thu Oct 21 10:06:26 2021 +0800 uxtheme: Check LoadedBefore registry key before loading theme. Only save unthemed system metrics to the registry when the LoadedBefore registry key value is '0'. This avoids saving themed system metrics when two processes are trying to activate theming at the same time. Signed-off-by: Zhiyi Zhang <zzhang(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/uxtheme/system.c | 37 +++++++++++++++++++++++++------------ dlls/uxtheme/uxthemedll.h | 4 ++++ 2 files changed, 29 insertions(+), 12 deletions(-) diff --git a/dlls/uxtheme/system.c b/dlls/uxtheme/system.c index d9eedf6543b..0298fe61d4a 100644 --- a/dlls/uxtheme/system.c +++ b/dlls/uxtheme/system.c @@ -185,7 +185,7 @@ static void UXTHEME_LoadTheme(void) lstrcpynW(szCurrentColor, pt->pszSelectedColor, ARRAY_SIZE(szCurrentColor)); lstrcpynW(szCurrentSize, pt->pszSelectedSize, ARRAY_SIZE(szCurrentSize)); - MSSTYLES_SetActiveTheme(pt, FALSE); + UXTHEME_SetActiveTheme(pt); TRACE("Theme active: %s %s %s\n", debugstr_w(szCurrentTheme), debugstr_w(szCurrentColor), debugstr_w(szCurrentSize)); MSSTYLES_CloseThemeFile(pt); @@ -419,27 +419,38 @@ static void UXTHEME_SaveSystemMetrics(struct system_metrics *metrics, BOOL send_ * * Change the current active theme */ -static HRESULT UXTHEME_SetActiveTheme(PTHEME_FILE tf) +HRESULT UXTHEME_SetActiveTheme(PTHEME_FILE tf) { + BOOL ret, loaded_before = FALSE; struct system_metrics metrics; + DWORD size; HKEY hKey; WCHAR tmp[2]; HRESULT hr; - if (tf && !bThemeActive) - { - if (UXTHEME_GetSystemMetrics(&metrics)) - UXTHEME_SaveUnthemedSystemMetrics(&metrics); - } - - hr = MSSTYLES_SetActiveTheme(tf, TRUE); - if(FAILED(hr)) - return hr; if(tf) { bThemeActive = TRUE; lstrcpynW(szCurrentTheme, tf->szThemeFile, ARRAY_SIZE(szCurrentTheme)); lstrcpynW(szCurrentColor, tf->pszSelectedColor, ARRAY_SIZE(szCurrentColor)); lstrcpynW(szCurrentSize, tf->pszSelectedSize, ARRAY_SIZE(szCurrentSize)); + + ret = UXTHEME_GetSystemMetrics(&metrics); + + /* Check if theming is already active */ + if (!RegOpenKeyW(HKEY_CURRENT_USER, szThemeManager, &hKey)) + { + size = sizeof(tmp); + if (!RegQueryValueExW(hKey, L"LoadedBefore", NULL, NULL, (BYTE *)tmp, &size)) + loaded_before = (tmp[0] != '0'); + else + WARN("Failed to get LoadedBefore: %d\n", GetLastError()); + RegCloseKey(hKey); + } + if (loaded_before) + return MSSTYLES_SetActiveTheme(tf, FALSE); + + if (ret) + UXTHEME_SaveUnthemedSystemMetrics(&metrics); } else { bThemeActive = FALSE; @@ -460,18 +471,20 @@ static HRESULT UXTHEME_SetActiveTheme(PTHEME_FILE tf) (lstrlenW(szCurrentSize)+1)*sizeof(WCHAR)); RegSetValueExW(hKey, L"DllName", 0, REG_SZ, (const BYTE*)szCurrentTheme, (lstrlenW(szCurrentTheme)+1)*sizeof(WCHAR)); + RegSetValueExW(hKey, L"LoadedBefore", 0, REG_SZ, (const BYTE *)tmp, sizeof(WCHAR) * 2); } else { RegDeleteValueW(hKey, L"ColorName"); RegDeleteValueW(hKey, L"SizeName"); RegDeleteValueW(hKey, L"DllName"); - + RegDeleteValueW(hKey, L"LoadedBefore"); } RegCloseKey(hKey); } else TRACE("Failed to open theme registry key\n"); + hr = MSSTYLES_SetActiveTheme(tf, TRUE); if (bThemeActive) { if (UXTHEME_GetSystemMetrics(&metrics)) diff --git a/dlls/uxtheme/uxthemedll.h b/dlls/uxtheme/uxthemedll.h index 4b8f95764d6..67130774392 100644 --- a/dlls/uxtheme/uxthemedll.h +++ b/dlls/uxtheme/uxthemedll.h @@ -21,7 +21,10 @@ #ifndef __WINE_UXTHEMEDLL_H #define __WINE_UXTHEMEDLL_H +#include <wingdi.h> #include <winuser.h> +#include <uxtheme.h> +#include <msstyles.h> typedef HANDLE HTHEMEFILE; @@ -99,6 +102,7 @@ BOOL WINAPI ThemeHooksInstall(void) DECLSPEC_HIDDEN; BOOL WINAPI ThemeHooksRemove(void) DECLSPEC_HIDDEN; extern void UXTHEME_InitSystem(HINSTANCE hInst) DECLSPEC_HIDDEN; +extern HRESULT UXTHEME_SetActiveTheme(PTHEME_FILE tf) DECLSPEC_HIDDEN; extern void UXTHEME_UninitSystem(void) DECLSPEC_HIDDEN; extern struct user_api_hook user_api DECLSPEC_HIDDEN;
1
0
0
0
← Newer
1
...
39
40
41
42
43
44
45
...
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