winehq.org
Sign In
Sign Up
Sign In
Sign Up
Manage this list
×
Keyboard Shortcuts
Thread View
j
: Next unread message
k
: Previous unread message
j a
: Jump to all threads
j l
: Jump to MailingList overview
2025
February
January
2024
December
November
October
September
August
July
June
May
April
March
February
January
2023
December
November
October
September
August
July
June
May
April
March
February
January
2022
December
November
October
September
August
July
June
May
April
March
February
January
2021
December
November
October
September
August
July
June
May
April
March
February
January
2020
December
November
October
September
August
July
June
May
April
March
February
January
2019
December
November
October
September
August
July
June
May
April
March
February
January
2018
December
November
October
September
August
July
June
May
April
March
February
January
2017
December
November
October
September
August
July
June
May
April
March
February
January
2016
December
November
October
September
August
July
June
May
April
March
February
January
2015
December
November
October
September
August
July
June
May
April
March
February
January
2014
December
November
October
September
August
July
June
May
April
March
February
January
2013
December
November
October
September
August
July
June
May
April
March
February
January
2012
December
November
October
September
August
July
June
May
April
March
February
January
2011
December
November
October
September
August
July
June
May
April
March
February
January
2010
December
November
October
September
August
July
June
May
April
March
February
January
2009
December
November
October
September
August
July
June
May
April
March
February
January
2008
December
November
October
September
August
July
June
May
April
March
February
January
2007
December
November
October
September
August
July
June
May
April
March
February
January
2006
December
November
October
September
August
July
June
May
April
March
February
January
2005
December
November
October
September
August
July
June
May
April
March
February
January
2004
December
November
October
September
August
July
June
May
April
March
February
January
2003
December
November
October
September
August
July
June
May
April
March
February
January
2002
December
November
October
September
August
July
June
May
April
March
February
January
2001
December
November
October
September
August
July
June
May
April
March
February
List overview
wine-commits
January 2011
----- 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
879 discussions
Start a n
N
ew thread
Vitaliy Margolen : dinput: COM cleanup - use helper function instead of direct typecast in OS/ X joystick.
by Alexandre Julliard
10 Jan '11
10 Jan '11
Module: wine Branch: master Commit: 399be3455aefb714864f3f519642df4049f287ac URL:
http://source.winehq.org/git/wine.git/?a=commit;h=399be3455aefb714864f3f519…
Author: Vitaliy Margolen <wine-patches(a)kievinfo.com> Date: Sun Jan 9 15:43:48 2011 -0700 dinput: COM cleanup - use helper function instead of direct typecast in OS/X joystick. --- dlls/dinput/joystick_osx.c | 11 ++++++++++- 1 files changed, 10 insertions(+), 1 deletions(-) diff --git a/dlls/dinput/joystick_osx.c b/dlls/dinput/joystick_osx.c index 7daccd4..dc15db8 100644 --- a/dlls/dinput/joystick_osx.c +++ b/dlls/dinput/joystick_osx.c @@ -135,6 +135,15 @@ struct JoystickImpl ObjProps **propmap; }; +static inline JoystickImpl *impl_from_IDirectInputDevice8A(IDirectInputDevice8A *iface) +{ + return (JoystickImpl *) iface; +} +static inline JoystickImpl *impl_from_IDirectInputDevice8W(IDirectInputDevice8W *iface) +{ + return (JoystickImpl *) iface; +} + static const GUID DInput_Wine_OsX_Joystick_GUID = { /* 59CAD8F6-E617-41E2-8EB7-47B23EEEDC5A */ 0x59CAD8F6, 0xE617, 0x41E2, {0x8E, 0xB7, 0x47, 0xB2, 0x3E, 0xEE, 0xDC, 0x5A} }; @@ -519,7 +528,7 @@ static void get_osx_device_elements_props(JoystickImpl *device) static void poll_osx_device_state(LPDIRECTINPUTDEVICE8A iface) { - JoystickImpl *device = (JoystickImpl*)iface; + JoystickImpl *device = impl_from_IDirectInputDevice8A(iface); IOHIDElementRef tIOHIDTopElementRef; IOHIDDeviceRef tIOHIDDeviceRef; CFArrayRef gElementCFArrayRef = device->elementCFArrayRef;
1
0
0
0
Vitaliy Margolen : dinput: COM cleanup - use helper function instead of direct typecast in linuxinput joystick .
by Alexandre Julliard
10 Jan '11
10 Jan '11
Module: wine Branch: master Commit: f09ace0d8357d9a6d4541dd0c5a04b2b24525182 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=f09ace0d8357d9a6d4541dd0c…
Author: Vitaliy Margolen <wine-patches(a)kievinfo.com> Date: Sun Jan 9 15:43:45 2011 -0700 dinput: COM cleanup - use helper function instead of direct typecast in linuxinput joystick. --- dlls/dinput/joystick_linuxinput.c | 43 ++++++++++++++++++++++-------------- 1 files changed, 26 insertions(+), 17 deletions(-) diff --git a/dlls/dinput/joystick_linuxinput.c b/dlls/dinput/joystick_linuxinput.c index e571a65..e036cf2 100644 --- a/dlls/dinput/joystick_linuxinput.c +++ b/dlls/dinput/joystick_linuxinput.c @@ -133,6 +133,15 @@ struct JoystickImpl int ff_gain; }; +static inline JoystickImpl *impl_from_IDirectInputDevice8A(IDirectInputDevice8A *iface) +{ + return (JoystickImpl *) iface; +} +static inline JoystickImpl *impl_from_IDirectInputDevice8W(IDirectInputDevice8W *iface) +{ + return (JoystickImpl *) iface; +} + static void fake_current_js_state(JoystickImpl *ji); static void find_joydevs(void); static void joy_polldev(LPDIRECTINPUTDEVICE8A iface); @@ -615,7 +624,7 @@ const struct dinput_device joystick_linuxinput_device = { */ static HRESULT WINAPI JoystickAImpl_Acquire(LPDIRECTINPUTDEVICE8A iface) { - JoystickImpl *This = (JoystickImpl *)iface; + JoystickImpl *This = impl_from_IDirectInputDevice8A(iface); HRESULT res; TRACE("(this=%p)\n",This); @@ -668,7 +677,7 @@ static HRESULT WINAPI JoystickAImpl_Acquire(LPDIRECTINPUTDEVICE8A iface) */ static HRESULT WINAPI JoystickAImpl_Unacquire(LPDIRECTINPUTDEVICE8A iface) { - JoystickImpl *This = (JoystickImpl *)iface; + JoystickImpl *This = impl_from_IDirectInputDevice8A(iface); HRESULT res; TRACE("(this=%p)\n",This); @@ -735,7 +744,7 @@ static void joy_polldev(LPDIRECTINPUTDEVICE8A iface) { struct pollfd plfd; struct input_event ie; - JoystickImpl *This = (JoystickImpl*) iface; + JoystickImpl *This = impl_from_IDirectInputDevice8A(iface); if (This->joyfd==-1) return; @@ -836,7 +845,7 @@ static HRESULT WINAPI JoystickAImpl_SetProperty(LPDIRECTINPUTDEVICE8A iface, REFGUID rguid, LPCDIPROPHEADER ph) { - JoystickImpl *This = (JoystickImpl *)iface; + JoystickImpl *This = impl_from_IDirectInputDevice8A(iface); if (!ph) { WARN("invalid argument\n"); @@ -893,7 +902,7 @@ static HRESULT WINAPI JoystickAImpl_GetProperty(LPDIRECTINPUTDEVICE8A iface, REFGUID rguid, LPDIPROPHEADER pdiph) { - JoystickImpl *This = (JoystickImpl *)iface; + JoystickImpl *This = impl_from_IDirectInputDevice8A(iface); TRACE("(this=%p,%s,%p)\n", iface, debugstr_guid(rguid), pdiph); _dump_DIPROPHEADER(pdiph); @@ -939,7 +948,7 @@ static HRESULT WINAPI JoystickAImpl_CreateEffect(LPDIRECTINPUTDEVICE8A iface, HRESULT retval = DI_OK; #endif - JoystickImpl* This = (JoystickImpl*)iface; + JoystickImpl* This = impl_from_IDirectInputDevice8A(iface); TRACE("(this=%p,%p,%p,%p,%p)\n", This, rguid, lpeff, ppdef, pUnkOuter); #ifndef HAVE_STRUCT_FF_EFFECT_DIRECTION @@ -991,7 +1000,7 @@ static HRESULT WINAPI JoystickAImpl_EnumEffects(LPDIRECTINPUTDEVICE8A iface, #ifdef HAVE_STRUCT_FF_EFFECT_DIRECTION DIEFFECTINFOA dei; /* feif */ DWORD type = DIEFT_GETTYPE(dwEffType); - JoystickImpl* This = (JoystickImpl*)iface; + JoystickImpl* This = impl_from_IDirectInputDevice8A(iface); TRACE("(this=%p,%p,%d) type=%d\n", This, pvRef, dwEffType, type); @@ -1067,7 +1076,7 @@ static HRESULT WINAPI JoystickWImpl_EnumEffects(LPDIRECTINPUTDEVICE8W iface, * are actually different (A/W) */ DIEFFECTINFOW dei; /* feif */ DWORD type = DIEFT_GETTYPE(dwEffType); - JoystickImpl* This = (JoystickImpl*)iface; + JoystickImpl* This = impl_from_IDirectInputDevice8W(iface); int xfd = This->joyfd; TRACE("(this=%p,%p,%d) type=%d fd=%d\n", This, pvRef, dwEffType, type, xfd); @@ -1144,7 +1153,7 @@ static HRESULT WINAPI JoystickAImpl_GetEffectInfo(LPDIRECTINPUTDEVICE8A iface, LPDIEFFECTINFOA pdei, REFGUID guid) { - JoystickImpl* This = (JoystickImpl*)iface; + JoystickImpl* This = impl_from_IDirectInputDevice8A(iface); TRACE("(this=%p,%p,%s)\n", This, pdei, _dump_dinput_GUID(guid)); @@ -1159,10 +1168,10 @@ static HRESULT WINAPI JoystickWImpl_GetEffectInfo(LPDIRECTINPUTDEVICE8W iface, LPDIEFFECTINFOW pdei, REFGUID guid) { - JoystickImpl* This = (JoystickImpl*)iface; - + JoystickImpl* This = impl_from_IDirectInputDevice8W(iface); + TRACE("(this=%p,%p,%s)\n", This, pdei, _dump_dinput_GUID(guid)); - + #ifdef HAVE_STRUCT_FF_EFFECT_DIRECTION return linuxinput_get_info_W(This->joyfd, guid, pdei); #else @@ -1177,7 +1186,7 @@ static HRESULT WINAPI JoystickAImpl_GetForceFeedbackState( LPDIRECTINPUTDEVICE8A iface, LPDWORD pdwOut) { - JoystickImpl* This = (JoystickImpl*)iface; + JoystickImpl* This = impl_from_IDirectInputDevice8A(iface); TRACE("(this=%p,%p)\n", This, pdwOut); @@ -1199,7 +1208,7 @@ static HRESULT WINAPI JoystickAImpl_SendForceFeedbackCommand( LPDIRECTINPUTDEVICE8A iface, DWORD dwFlags) { - JoystickImpl* This = (JoystickImpl*)iface; + JoystickImpl* This = impl_from_IDirectInputDevice8A(iface); TRACE("(this=%p,%d)\n", This, dwFlags); #ifdef HAVE_STRUCT_FF_EFFECT_DIRECTION @@ -1256,7 +1265,7 @@ static HRESULT WINAPI JoystickAImpl_EnumCreatedEffectObjects( DWORD dwFlags) { /* this function is safe to call on non-ff-enabled builds */ - JoystickImpl* This = (JoystickImpl*)iface; + JoystickImpl* This = impl_from_IDirectInputDevice8A(iface); effect_list_item *itr, *ptr; TRACE("(this=%p,%p,%p,%d)\n", This, lpCallback, pvRef, dwFlags); @@ -1279,7 +1288,7 @@ static HRESULT WINAPI JoystickAImpl_EnumCreatedEffectObjects( static HRESULT WINAPI JoystickAImpl_GetDeviceInfo(LPDIRECTINPUTDEVICE8A iface, LPDIDEVICEINSTANCEA pdidi) { - JoystickImpl *This = (JoystickImpl *)iface; + JoystickImpl *This = impl_from_IDirectInputDevice8A(iface); TRACE("(%p) %p\n", This, pdidi); @@ -1296,7 +1305,7 @@ static HRESULT WINAPI JoystickAImpl_GetDeviceInfo(LPDIRECTINPUTDEVICE8A iface, static HRESULT WINAPI JoystickWImpl_GetDeviceInfo(LPDIRECTINPUTDEVICE8W iface, LPDIDEVICEINSTANCEW pdidi) { - JoystickImpl *This = (JoystickImpl *)iface; + JoystickImpl *This = impl_from_IDirectInputDevice8W(iface); TRACE("(%p) %p\n", This, pdidi);
1
0
0
0
Vitaliy Margolen : dinput: COM cleanup - use helper function instead of direct typecast in Linux joystick .
by Alexandre Julliard
10 Jan '11
10 Jan '11
Module: wine Branch: master Commit: a1b08e5d049aeeeb440cff0915827227bb6f4c45 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=a1b08e5d049aeeeb440cff091…
Author: Vitaliy Margolen <wine-patches(a)kievinfo.com> Date: Sun Jan 9 15:43:41 2011 -0700 dinput: COM cleanup - use helper function instead of direct typecast in Linux joystick. --- dlls/dinput/joystick_linux.c | 15 ++++++++++++--- 1 files changed, 12 insertions(+), 3 deletions(-) diff --git a/dlls/dinput/joystick_linux.c b/dlls/dinput/joystick_linux.c index 1eb71ff..fb13722 100644 --- a/dlls/dinput/joystick_linux.c +++ b/dlls/dinput/joystick_linux.c @@ -99,6 +99,15 @@ struct JoystickImpl POINTL povs[4]; }; +static inline JoystickImpl *impl_from_IDirectInputDevice8A(IDirectInputDevice8A *iface) +{ + return (JoystickImpl *) iface; +} +static inline JoystickImpl *impl_from_IDirectInputDevice8W(IDirectInputDevice8W *iface) +{ + return (JoystickImpl *) iface; +} + static const GUID DInput_Wine_Joystick_GUID = { /* 9e573ed9-7734-11d2-8d4a-23903fb6bdf7 */ 0x9e573ed9, 0x7734, @@ -495,7 +504,7 @@ const struct dinput_device joystick_linux_device = { */ static HRESULT WINAPI JoystickLinuxAImpl_Acquire(LPDIRECTINPUTDEVICE8A iface) { - JoystickImpl *This = (JoystickImpl *)iface; + JoystickImpl *This = impl_from_IDirectInputDevice8A(iface); HRESULT res; TRACE("(%p)\n",This); @@ -524,7 +533,7 @@ static HRESULT WINAPI JoystickLinuxAImpl_Acquire(LPDIRECTINPUTDEVICE8A iface) */ static HRESULT WINAPI JoystickLinuxAImpl_Unacquire(LPDIRECTINPUTDEVICE8A iface) { - JoystickImpl *This = (JoystickImpl *)iface; + JoystickImpl *This = impl_from_IDirectInputDevice8A(iface); HRESULT res; TRACE("(%p)\n",This); @@ -548,7 +557,7 @@ static void joy_polldev(LPDIRECTINPUTDEVICE8A iface) { struct pollfd plfd; struct js_event jse; - JoystickImpl *This = (JoystickImpl*) iface; + JoystickImpl *This = impl_from_IDirectInputDevice8A(iface); TRACE("(%p)\n", This);
1
0
0
0
Vitaliy Margolen : dinput: COM cleanup - use helper function instead of direct typecast in base joystick class .
by Alexandre Julliard
10 Jan '11
10 Jan '11
Module: wine Branch: master Commit: de4a9bb3195794f50e7b0a8e3809b36c72401e8b URL:
http://source.winehq.org/git/wine.git/?a=commit;h=de4a9bb3195794f50e7b0a8e3…
Author: Vitaliy Margolen <wine-patches(a)kievinfo.com> Date: Sun Jan 9 15:43:37 2011 -0700 dinput: COM cleanup - use helper function instead of direct typecast in base joystick class. --- dlls/dinput/joystick.c | 23 ++++++++++++++++------- 1 files changed, 16 insertions(+), 7 deletions(-) diff --git a/dlls/dinput/joystick.c b/dlls/dinput/joystick.c index e894dc6..520eb4d 100644 --- a/dlls/dinput/joystick.c +++ b/dlls/dinput/joystick.c @@ -32,6 +32,15 @@ WINE_DEFAULT_DEBUG_CHANNEL(dinput); +static inline JoystickGenericImpl *impl_from_IDirectInputDevice8A(IDirectInputDevice8A *iface) +{ + return (JoystickGenericImpl *) iface; +} +static inline JoystickGenericImpl *impl_from_IDirectInputDevice8W(IDirectInputDevice8W *iface) +{ + return (JoystickGenericImpl *) iface; +} + /****************************************************************************** * SetProperty : change input device properties */ @@ -40,7 +49,7 @@ HRESULT WINAPI JoystickAGenericImpl_SetProperty( REFGUID rguid, LPCDIPROPHEADER ph) { - JoystickGenericImpl *This = (JoystickGenericImpl *)iface; + JoystickGenericImpl *This = impl_from_IDirectInputDevice8A(iface); DWORD i; TRACE("(%p,%s,%p)\n",This,debugstr_guid(rguid),ph); @@ -144,7 +153,7 @@ HRESULT WINAPI JoystickAGenericImpl_GetCapabilities( LPDIRECTINPUTDEVICE8A iface, LPDIDEVCAPS lpDIDevCaps) { - JoystickGenericImpl *This = (JoystickGenericImpl *)iface; + JoystickGenericImpl *This = impl_from_IDirectInputDevice8A(iface); int size; TRACE("%p->(%p)\n",iface,lpDIDevCaps); @@ -223,7 +232,7 @@ HRESULT WINAPI JoystickAGenericImpl_GetProperty( REFGUID rguid, LPDIPROPHEADER pdiph) { - JoystickGenericImpl *This = (JoystickGenericImpl *)iface; + JoystickGenericImpl *This = impl_from_IDirectInputDevice8A(iface); TRACE("(%p,%s,%p)\n", iface, debugstr_guid(rguid), pdiph); @@ -283,7 +292,7 @@ HRESULT WINAPI JoystickAGenericImpl_GetDeviceInfo( LPDIRECTINPUTDEVICE8A iface, LPDIDEVICEINSTANCEA pdidi) { - JoystickGenericImpl *This = (JoystickGenericImpl *)iface; + JoystickGenericImpl *This = impl_from_IDirectInputDevice8A(iface); TRACE("(%p,%p)\n", iface, pdidi); @@ -321,7 +330,7 @@ HRESULT WINAPI JoystickWGenericImpl_GetDeviceInfo( LPDIRECTINPUTDEVICE8W iface, LPDIDEVICEINSTANCEW pdidi) { - JoystickGenericImpl *This = (JoystickGenericImpl *)iface; + JoystickGenericImpl *This = impl_from_IDirectInputDevice8W(iface); TRACE("(%p,%p)\n", iface, pdidi); @@ -349,7 +358,7 @@ HRESULT WINAPI JoystickWGenericImpl_GetDeviceInfo( HRESULT WINAPI JoystickAGenericImpl_Poll(LPDIRECTINPUTDEVICE8A iface) { - JoystickGenericImpl *This = (JoystickGenericImpl *)iface; + JoystickGenericImpl *This = impl_from_IDirectInputDevice8A(iface); TRACE("(%p)\n",This); @@ -371,7 +380,7 @@ HRESULT WINAPI JoystickAGenericImpl_GetDeviceState( DWORD len, LPVOID ptr) { - JoystickGenericImpl *This = (JoystickGenericImpl *)iface; + JoystickGenericImpl *This = impl_from_IDirectInputDevice8A(iface); TRACE("(%p,0x%08x,%p)\n", This, len, ptr);
1
0
0
0
Vitaliy Margolen : dinput: COM cleanup - use helper function instead of direct typecast in keyboard.
by Alexandre Julliard
10 Jan '11
10 Jan '11
Module: wine Branch: master Commit: 31c828ea273a6d76acfb78a860d567f8d9e322bb URL:
http://source.winehq.org/git/wine.git/?a=commit;h=31c828ea273a6d76acfb78a86…
Author: Vitaliy Margolen <wine-patches(a)kievinfo.com> Date: Sun Jan 9 15:43:32 2011 -0700 dinput: COM cleanup - use helper function instead of direct typecast in keyboard. --- dlls/dinput/keyboard.c | 21 +++++++++++++++------ 1 files changed, 15 insertions(+), 6 deletions(-) diff --git a/dlls/dinput/keyboard.c b/dlls/dinput/keyboard.c index 7bd68a1..76563db 100644 --- a/dlls/dinput/keyboard.c +++ b/dlls/dinput/keyboard.c @@ -50,6 +50,15 @@ struct SysKeyboardImpl BYTE DInputKeyState[WINE_DINPUT_KEYBOARD_MAX_KEYS]; }; +static inline SysKeyboardImpl *impl_from_IDirectInputDevice8A(IDirectInputDevice8A *iface) +{ + return (SysKeyboardImpl *) iface; +} +static inline SysKeyboardImpl *impl_from_IDirectInputDevice8W(IDirectInputDevice8W *iface) +{ + return (SysKeyboardImpl *) iface; +} + static BYTE map_dik_code(DWORD scanCode, DWORD vkCode) { static const BYTE asciiCodes[] = @@ -76,7 +85,7 @@ static BYTE map_dik_code(DWORD scanCode, DWORD vkCode) static int KeyboardCallback( LPDIRECTINPUTDEVICE8A iface, WPARAM wparam, LPARAM lparam ) { - SysKeyboardImpl *This = (SysKeyboardImpl *)iface; + SysKeyboardImpl *This = impl_from_IDirectInputDevice8A(iface); int dik_code, ret = This->base.dwCoopLevel & DISCL_EXCLUSIVE; KBDLLHOOKSTRUCT *hook = (KBDLLHOOKSTRUCT *)lparam; BYTE new_diks; @@ -297,7 +306,7 @@ static HRESULT WINAPI SysKeyboardAImpl_GetDeviceState( LPDIRECTINPUTDEVICE8A iface,DWORD len,LPVOID ptr ) { - SysKeyboardImpl *This = (SysKeyboardImpl *)iface; + SysKeyboardImpl *This = impl_from_IDirectInputDevice8A(iface); TRACE("(%p)->(%d,%p)\n", This, len, ptr); if (!This->base.acquired) return DIERR_NOTACQUIRED; @@ -328,7 +337,7 @@ static HRESULT WINAPI SysKeyboardAImpl_GetCapabilities( LPDIRECTINPUTDEVICE8A iface, LPDIDEVCAPS lpDIDevCaps) { - SysKeyboardImpl *This = (SysKeyboardImpl *)iface; + SysKeyboardImpl *This = impl_from_IDirectInputDevice8A(iface); DIDEVCAPS devcaps; TRACE("(this=%p,%p)\n",This,lpDIDevCaps); @@ -410,7 +419,7 @@ static HRESULT WINAPI SysKeyboardAImpl_GetDeviceInfo( LPDIRECTINPUTDEVICE8A iface, LPDIDEVICEINSTANCEA pdidi) { - SysKeyboardImpl *This = (SysKeyboardImpl *)iface; + SysKeyboardImpl *This = impl_from_IDirectInputDevice8A(iface); TRACE("(this=%p,%p)\n", This, pdidi); if (pdidi->dwSize != sizeof(DIDEVICEINSTANCEA)) { @@ -423,9 +432,9 @@ static HRESULT WINAPI SysKeyboardAImpl_GetDeviceInfo( return DI_OK; } -static HRESULT WINAPI SysKeyboardWImpl_GetDeviceInfo(LPDIRECTINPUTDEVICE8W iface, LPDIDEVICEINSTANCEW pdidi) +static HRESULT WINAPI SysKeyboardWImpl_GetDeviceInfo(LPDIRECTINPUTDEVICE8W iface, LPDIDEVICEINSTANCEW pdidi) { - SysKeyboardImpl *This = (SysKeyboardImpl *)iface; + SysKeyboardImpl *This = impl_from_IDirectInputDevice8W(iface); TRACE("(this=%p,%p)\n", This, pdidi); if (pdidi->dwSize != sizeof(DIDEVICEINSTANCEW)) {
1
0
0
0
Vitaliy Margolen : dinput: COM cleanup - use helper function instead of direct typecast in mouse.
by Alexandre Julliard
10 Jan '11
10 Jan '11
Module: wine Branch: master Commit: 625fefca61e1dc79b7b6f656ffe3d59f9175cff9 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=625fefca61e1dc79b7b6f656f…
Author: Vitaliy Margolen <wine-patches(a)kievinfo.com> Date: Sun Jan 9 15:43:26 2011 -0700 dinput: COM cleanup - use helper function instead of direct typecast in mouse. --- dlls/dinput/mouse.c | 33 +++++++++++++++++++++------------ 1 files changed, 21 insertions(+), 12 deletions(-) diff --git a/dlls/dinput/mouse.c b/dlls/dinput/mouse.c index f32abec..683534f 100644 --- a/dlls/dinput/mouse.c +++ b/dlls/dinput/mouse.c @@ -78,6 +78,15 @@ struct SysMouseImpl WARP_MOUSE warp_override; }; +static inline SysMouseImpl *impl_from_IDirectInputDevice8A(IDirectInputDevice8A *iface) +{ + return (SysMouseImpl *) iface; +} +static inline SysMouseImpl *impl_from_IDirectInputDevice8W(IDirectInputDevice8W *iface) +{ + return (SysMouseImpl *) iface; +} + static int dinput_mouse_hook( LPDIRECTINPUTDEVICE8A iface, WPARAM wparam, LPARAM lparam ); const GUID DInput_Wine_Mouse_GUID = { /* 9e573ed8-7734-11d2-8d4a-23903fb6bdf7 */ @@ -289,7 +298,7 @@ const struct dinput_device mouse_device = { static int dinput_mouse_hook( LPDIRECTINPUTDEVICE8A iface, WPARAM wparam, LPARAM lparam ) { MSLLHOOKSTRUCT *hook = (MSLLHOOKSTRUCT *)lparam; - SysMouseImpl* This = (SysMouseImpl*) iface; + SysMouseImpl* This = impl_from_IDirectInputDevice8A(iface); DWORD dwCoop; int wdata = 0, inst_id = -1, ret; @@ -412,7 +421,7 @@ static BOOL dinput_window_check(SysMouseImpl* This) { */ static HRESULT WINAPI SysMouseAImpl_Acquire(LPDIRECTINPUTDEVICE8A iface) { - SysMouseImpl *This = (SysMouseImpl *)iface; + SysMouseImpl *This = impl_from_IDirectInputDevice8A(iface); RECT rect; POINT point; HRESULT res; @@ -482,9 +491,9 @@ static HRESULT WINAPI SysMouseAImpl_Acquire(LPDIRECTINPUTDEVICE8A iface) */ static HRESULT WINAPI SysMouseAImpl_Unacquire(LPDIRECTINPUTDEVICE8A iface) { - SysMouseImpl *This = (SysMouseImpl *)iface; + SysMouseImpl *This = impl_from_IDirectInputDevice8A(iface); HRESULT res; - + TRACE("(this=%p)\n",This); if ((res = IDirectInputDevice2AImpl_Unacquire(iface)) != DI_OK) return res; @@ -514,7 +523,7 @@ static HRESULT WINAPI SysMouseAImpl_Unacquire(LPDIRECTINPUTDEVICE8A iface) static HRESULT WINAPI SysMouseAImpl_GetDeviceState( LPDIRECTINPUTDEVICE8A iface,DWORD len,LPVOID ptr ) { - SysMouseImpl *This = (SysMouseImpl *)iface; + SysMouseImpl *This = impl_from_IDirectInputDevice8A(iface); if(This->base.acquired == 0) return DIERR_NOTACQUIRED; @@ -555,7 +564,7 @@ static HRESULT WINAPI SysMouseAImpl_GetDeviceState( static HRESULT WINAPI SysMouseAImpl_GetDeviceData(LPDIRECTINPUTDEVICE8A iface, DWORD dodsize, LPDIDEVICEOBJECTDATA dod, LPDWORD entries, DWORD flags) { - SysMouseImpl *This = (SysMouseImpl *)iface; + SysMouseImpl *This = impl_from_IDirectInputDevice8A(iface); HRESULT res; res = IDirectInputDevice2AImpl_GetDeviceData(iface, dodsize, dod, entries, flags); @@ -582,11 +591,11 @@ static HRESULT WINAPI SysMouseAImpl_GetProperty(LPDIRECTINPUTDEVICE8A iface, REFGUID rguid, LPDIPROPHEADER pdiph) { - SysMouseImpl *This = (SysMouseImpl *)iface; - + SysMouseImpl *This = impl_from_IDirectInputDevice8A(iface); + TRACE("(%p) %s,%p\n", This, debugstr_guid(rguid), pdiph); _dump_DIPROPHEADER(pdiph); - + if (IS_DIPROP(rguid)) { switch (LOWORD(rguid)) { case (DWORD_PTR) DIPROP_GRANULARITY: { @@ -629,7 +638,7 @@ static HRESULT WINAPI SysMouseAImpl_GetCapabilities( LPDIRECTINPUTDEVICE8A iface, LPDIDEVCAPS lpDIDevCaps) { - SysMouseImpl *This = (SysMouseImpl *)iface; + SysMouseImpl *This = impl_from_IDirectInputDevice8A(iface); DIDEVCAPS devcaps; TRACE("(this=%p,%p)\n",This,lpDIDevCaps); @@ -712,7 +721,7 @@ static HRESULT WINAPI SysMouseAImpl_GetDeviceInfo( LPDIRECTINPUTDEVICE8A iface, LPDIDEVICEINSTANCEA pdidi) { - SysMouseImpl *This = (SysMouseImpl *)iface; + SysMouseImpl *This = impl_from_IDirectInputDevice8A(iface); TRACE("(this=%p,%p)\n", This, pdidi); if (pdidi->dwSize != sizeof(DIDEVICEINSTANCEA)) { @@ -727,7 +736,7 @@ static HRESULT WINAPI SysMouseAImpl_GetDeviceInfo( static HRESULT WINAPI SysMouseWImpl_GetDeviceInfo(LPDIRECTINPUTDEVICE8W iface, LPDIDEVICEINSTANCEW pdidi) { - SysMouseImpl *This = (SysMouseImpl *)iface; + SysMouseImpl *This = impl_from_IDirectInputDevice8W(iface); TRACE("(this=%p,%p)\n", This, pdidi); if (pdidi->dwSize != sizeof(DIDEVICEINSTANCEW)) {
1
0
0
0
Vitaliy Margolen : dinput: COM cleanup - use helper function instead of direct typecast in base device class .
by Alexandre Julliard
10 Jan '11
10 Jan '11
Module: wine Branch: master Commit: fc023b96d22837607b4909a618f1ea419252fdfe URL:
http://source.winehq.org/git/wine.git/?a=commit;h=fc023b96d22837607b4909a61…
Author: Vitaliy Margolen <wine-patches(a)kievinfo.com> Date: Sun Jan 9 15:43:21 2011 -0700 dinput: COM cleanup - use helper function instead of direct typecast in base device class. --- dlls/dinput/device.c | 45 +++++++++++++++++++++++++++------------------ 1 files changed, 27 insertions(+), 18 deletions(-) diff --git a/dlls/dinput/device.c b/dlls/dinput/device.c index 5969698..12846bf 100644 --- a/dlls/dinput/device.c +++ b/dlls/dinput/device.c @@ -41,6 +41,15 @@ WINE_DEFAULT_DEBUG_CHANNEL(dinput); +static inline IDirectInputDeviceImpl *impl_from_IDirectInputDevice8A(IDirectInputDevice8A *iface) +{ + return (IDirectInputDeviceImpl *) iface; +} +static inline IDirectInputDeviceImpl *impl_from_IDirectInputDevice8W(IDirectInputDevice8W *iface) +{ + return (IDirectInputDeviceImpl *) iface; +} + /****************************************************************************** * Various debugging tools */ @@ -535,7 +544,7 @@ int find_property(const DataFormat *df, LPCDIPROPHEADER ph) void queue_event(LPDIRECTINPUTDEVICE8A iface, int inst_id, DWORD data, DWORD time, DWORD seq) { - IDirectInputDeviceImpl *This = (IDirectInputDeviceImpl *)iface; + IDirectInputDeviceImpl *This = impl_from_IDirectInputDevice8A(iface); int next_pos, ofs = id_to_offset(&This->data_format, inst_id); /* Event is being set regardless of the queue state */ @@ -568,7 +577,7 @@ void queue_event(LPDIRECTINPUTDEVICE8A iface, int inst_id, DWORD data, DWORD tim HRESULT WINAPI IDirectInputDevice2AImpl_Acquire(LPDIRECTINPUTDEVICE8A iface) { - IDirectInputDeviceImpl *This = (IDirectInputDeviceImpl *)iface; + IDirectInputDeviceImpl *This = impl_from_IDirectInputDevice8A(iface); HRESULT res; if (!This->data_format.user_df) return DIERR_INVALIDPARAM; @@ -594,7 +603,7 @@ HRESULT WINAPI IDirectInputDevice2AImpl_Acquire(LPDIRECTINPUTDEVICE8A iface) HRESULT WINAPI IDirectInputDevice2AImpl_Unacquire(LPDIRECTINPUTDEVICE8A iface) { - IDirectInputDeviceImpl *This = (IDirectInputDeviceImpl *)iface; + IDirectInputDeviceImpl *This = impl_from_IDirectInputDevice8A(iface); HRESULT res; EnterCriticalSection(&This->crit); @@ -614,7 +623,7 @@ HRESULT WINAPI IDirectInputDevice2AImpl_Unacquire(LPDIRECTINPUTDEVICE8A iface) HRESULT WINAPI IDirectInputDevice2AImpl_SetDataFormat( LPDIRECTINPUTDEVICE8A iface, LPCDIDATAFORMAT df) { - IDirectInputDeviceImpl *This = (IDirectInputDeviceImpl *)iface; + IDirectInputDeviceImpl *This = impl_from_IDirectInputDevice8A(iface); HRESULT res = DI_OK; if (!df) return E_POINTER; @@ -641,7 +650,7 @@ HRESULT WINAPI IDirectInputDevice2AImpl_SetDataFormat( HRESULT WINAPI IDirectInputDevice2AImpl_SetCooperativeLevel( LPDIRECTINPUTDEVICE8A iface, HWND hwnd, DWORD dwflags) { - IDirectInputDeviceImpl *This = (IDirectInputDeviceImpl *)iface; + IDirectInputDeviceImpl *This = impl_from_IDirectInputDevice8A(iface); TRACE("(%p) %p,0x%08x\n", This, hwnd, dwflags); _dump_cooperativelevel_DI(dwflags); @@ -679,7 +688,7 @@ HRESULT WINAPI IDirectInputDevice2AImpl_SetCooperativeLevel( HRESULT WINAPI IDirectInputDevice2AImpl_SetEventNotification( LPDIRECTINPUTDEVICE8A iface, HANDLE event) { - IDirectInputDeviceImpl *This = (IDirectInputDeviceImpl *)iface; + IDirectInputDeviceImpl *This = impl_from_IDirectInputDevice8A(iface); TRACE("(%p) %p\n", This, event); @@ -691,7 +700,7 @@ HRESULT WINAPI IDirectInputDevice2AImpl_SetEventNotification( ULONG WINAPI IDirectInputDevice2AImpl_Release(LPDIRECTINPUTDEVICE8A iface) { - IDirectInputDeviceImpl *This = (IDirectInputDeviceImpl *)iface; + IDirectInputDeviceImpl *This = impl_from_IDirectInputDevice8A(iface); ULONG ref; ref = InterlockedDecrement(&(This->ref)); @@ -725,7 +734,7 @@ HRESULT WINAPI IDirectInputDevice2AImpl_QueryInterface( LPDIRECTINPUTDEVICE8A iface,REFIID riid,LPVOID *ppobj ) { - IDirectInputDeviceImpl *This = (IDirectInputDeviceImpl *)iface; + IDirectInputDeviceImpl *This = impl_from_IDirectInputDevice8A(iface); TRACE("(this=%p,%s,%p)\n",This,debugstr_guid(riid),ppobj); if (IsEqualGUID(&IID_IUnknown,riid)) { @@ -761,8 +770,8 @@ HRESULT WINAPI IDirectInputDevice2WImpl_QueryInterface( LPDIRECTINPUTDEVICE8W iface,REFIID riid,LPVOID *ppobj ) { - IDirectInputDeviceImpl *This = (IDirectInputDeviceImpl *)iface; - + IDirectInputDeviceImpl *This = impl_from_IDirectInputDevice8W(iface); + TRACE("(this=%p,%s,%p)\n",This,debugstr_guid(riid),ppobj); if (IsEqualGUID(&IID_IUnknown,riid)) { IDirectInputDevice2_AddRef(iface); @@ -796,14 +805,14 @@ HRESULT WINAPI IDirectInputDevice2WImpl_QueryInterface( ULONG WINAPI IDirectInputDevice2AImpl_AddRef( LPDIRECTINPUTDEVICE8A iface) { - IDirectInputDeviceImpl *This = (IDirectInputDeviceImpl *)iface; + IDirectInputDeviceImpl *This = impl_from_IDirectInputDevice8A(iface); return InterlockedIncrement(&(This->ref)); } HRESULT WINAPI IDirectInputDevice2AImpl_EnumObjects(LPDIRECTINPUTDEVICE8A iface, LPDIENUMDEVICEOBJECTSCALLBACKA lpCallback, LPVOID lpvRef, DWORD dwFlags) { - IDirectInputDeviceImpl *This = (IDirectInputDeviceImpl *)iface; + IDirectInputDeviceImpl *This = impl_from_IDirectInputDevice8A(iface); DIDEVICEOBJECTINSTANCEA ddoi; int i; @@ -833,7 +842,7 @@ HRESULT WINAPI IDirectInputDevice2AImpl_EnumObjects(LPDIRECTINPUTDEVICE8A iface, HRESULT WINAPI IDirectInputDevice2WImpl_EnumObjects(LPDIRECTINPUTDEVICE8W iface, LPDIENUMDEVICEOBJECTSCALLBACKW lpCallback, LPVOID lpvRef, DWORD dwFlags) { - IDirectInputDeviceImpl *This = (IDirectInputDeviceImpl *)iface; + IDirectInputDeviceImpl *This = impl_from_IDirectInputDevice8W(iface); DIDEVICEOBJECTINSTANCEW ddoi; int i; @@ -867,7 +876,7 @@ HRESULT WINAPI IDirectInputDevice2WImpl_EnumObjects(LPDIRECTINPUTDEVICE8W iface, HRESULT WINAPI IDirectInputDevice2AImpl_GetProperty( LPDIRECTINPUTDEVICE8A iface, REFGUID rguid, LPDIPROPHEADER pdiph) { - IDirectInputDeviceImpl *This = (IDirectInputDeviceImpl *)iface; + IDirectInputDeviceImpl *This = impl_from_IDirectInputDevice8A(iface); TRACE("(%p) %s,%p\n", iface, debugstr_guid(rguid), pdiph); _dump_DIPROPHEADER(pdiph); @@ -901,7 +910,7 @@ HRESULT WINAPI IDirectInputDevice2AImpl_GetProperty( HRESULT WINAPI IDirectInputDevice2AImpl_SetProperty( LPDIRECTINPUTDEVICE8A iface, REFGUID rguid, LPCDIPROPHEADER pdiph) { - IDirectInputDeviceImpl *This = (IDirectInputDeviceImpl *)iface; + IDirectInputDeviceImpl *This = impl_from_IDirectInputDevice8A(iface); TRACE("(%p) %s,%p\n", iface, debugstr_guid(rguid), pdiph); _dump_DIPROPHEADER(pdiph); @@ -995,7 +1004,7 @@ HRESULT WINAPI IDirectInputDevice2WImpl_GetObjectInfo( DWORD dwObj, DWORD dwHow) { - IDirectInputDeviceImpl *This = (IDirectInputDeviceImpl *)iface; + IDirectInputDeviceImpl *This = impl_from_IDirectInputDevice8W(iface); DWORD dwSize; LPDIOBJECTDATAFORMAT odf; int idx = -1; @@ -1046,7 +1055,7 @@ HRESULT WINAPI IDirectInputDevice2AImpl_GetDeviceData( LPDIRECTINPUTDEVICE8A iface, DWORD dodsize, LPDIDEVICEOBJECTDATA dod, LPDWORD entries, DWORD flags) { - IDirectInputDeviceImpl *This = (IDirectInputDeviceImpl *)iface; + IDirectInputDeviceImpl *This = impl_from_IDirectInputDevice8A(iface); HRESULT ret = DI_OK; int len; @@ -1217,7 +1226,7 @@ HRESULT WINAPI IDirectInputDevice2AImpl_Escape( HRESULT WINAPI IDirectInputDevice2AImpl_Poll( LPDIRECTINPUTDEVICE8A iface) { - IDirectInputDeviceImpl *This = (IDirectInputDeviceImpl *)iface; + IDirectInputDeviceImpl *This = impl_from_IDirectInputDevice8A(iface); if (!This->acquired) return DIERR_NOTACQUIRED; /* Because wine devices do not need to be polled, just return DI_NOEFFECT */
1
0
0
0
Vitaliy Margolen : dinput: COM cleanup - use proper interface instead of typecasting This when calling queue_event .
by Alexandre Julliard
10 Jan '11
10 Jan '11
Module: wine Branch: master Commit: 0b99bf3edbe38bd19dc8e448d9f1ed01451343b1 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=0b99bf3edbe38bd19dc8e448d…
Author: Vitaliy Margolen <wine-patches(a)kievinfo.com> Date: Sun Jan 9 15:43:17 2011 -0700 dinput: COM cleanup - use proper interface instead of typecasting This when calling queue_event. --- dlls/dinput/joystick_linux.c | 2 +- dlls/dinput/joystick_linuxinput.c | 2 +- dlls/dinput/keyboard.c | 2 +- dlls/dinput/mouse.c | 4 ++-- 4 files changed, 5 insertions(+), 5 deletions(-) diff --git a/dlls/dinput/joystick_linux.c b/dlls/dinput/joystick_linux.c index 588a54b..1eb71ff 100644 --- a/dlls/dinput/joystick_linux.c +++ b/dlls/dinput/joystick_linux.c @@ -615,7 +615,7 @@ static void joy_polldev(LPDIRECTINPUTDEVICE8A iface) } } if (inst_id >= 0) - queue_event((LPDIRECTINPUTDEVICE8A)This, inst_id, + queue_event(iface, inst_id, value, jse.time, This->generic.base.dinput->evsequence++); } } diff --git a/dlls/dinput/joystick_linuxinput.c b/dlls/dinput/joystick_linuxinput.c index 75a44ca..e571a65 100644 --- a/dlls/dinput/joystick_linuxinput.c +++ b/dlls/dinput/joystick_linuxinput.c @@ -824,7 +824,7 @@ static void joy_polldev(LPDIRECTINPUTDEVICE8A iface) break; } if (inst_id >= 0) - queue_event((LPDIRECTINPUTDEVICE8A)This, inst_id, + queue_event(iface, inst_id, value, ie.time.tv_usec, This->generic.base.dinput->evsequence++); } } diff --git a/dlls/dinput/keyboard.c b/dlls/dinput/keyboard.c index dda15c1..7bd68a1 100644 --- a/dlls/dinput/keyboard.c +++ b/dlls/dinput/keyboard.c @@ -108,7 +108,7 @@ static int KeyboardCallback( LPDIRECTINPUTDEVICE8A iface, WPARAM wparam, LPARAM TRACE(" setting %02X to %02X\n", dik_code, This->DInputKeyState[dik_code]); EnterCriticalSection(&This->base.crit); - queue_event((LPDIRECTINPUTDEVICE8A)This, DIDFT_MAKEINSTANCE(dik_code) | DIDFT_PSHBUTTON, + queue_event(iface, DIDFT_MAKEINSTANCE(dik_code) | DIDFT_PSHBUTTON, new_diks, hook->time, This->base.dinput->evsequence++); LeaveCriticalSection(&This->base.crit); diff --git a/dlls/dinput/mouse.c b/dlls/dinput/mouse.c index 5e0e042..f32abec 100644 --- a/dlls/dinput/mouse.c +++ b/dlls/dinput/mouse.c @@ -324,7 +324,7 @@ static int dinput_mouse_hook( LPDIRECTINPUTDEVICE8A iface, WPARAM wparam, LPARAM { /* Already have X, need to queue it */ if (inst_id != -1) - queue_event((LPDIRECTINPUTDEVICE8A)This, inst_id, + queue_event(iface, inst_id, wdata, GetCurrentTime(), This->base.dinput->evsequence); inst_id = DIDFT_MAKEINSTANCE(WINE_MOUSE_Y_AXIS_INSTANCE) | DIDFT_RELAXIS; wdata = pt1.y; @@ -379,7 +379,7 @@ static int dinput_mouse_hook( LPDIRECTINPUTDEVICE8A iface, WPARAM wparam, LPARAM if (inst_id != -1) { _dump_mouse_state(&This->m_state); - queue_event((LPDIRECTINPUTDEVICE8A)This, inst_id, + queue_event(iface, inst_id, wdata, GetCurrentTime(), This->base.dinput->evsequence++); }
1
0
0
0
Vitaliy Margolen : dinput: COM cleanup - return interface instead of typecasting This.
by Alexandre Julliard
10 Jan '11
10 Jan '11
Module: wine Branch: master Commit: b66e00cb09b4cadb7a64ae5b0140c128d87c6335 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=b66e00cb09b4cadb7a64ae5b0…
Author: Vitaliy Margolen <wine-patches(a)kievinfo.com> Date: Sun Jan 9 15:43:12 2011 -0700 dinput: COM cleanup - return interface instead of typecasting This. --- dlls/dinput/effect_linuxinput.c | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/dlls/dinput/effect_linuxinput.c b/dlls/dinput/effect_linuxinput.c index e35a96f..b7c27cd 100644 --- a/dlls/dinput/effect_linuxinput.c +++ b/dlls/dinput/effect_linuxinput.c @@ -844,7 +844,7 @@ HRESULT linuxinput_create_effect( newEffect->entry = parent_list_entry; - *peff = (LPDIRECTINPUTEFFECT)newEffect; + *peff = &newEffect->IDirectInputEffect_iface; TRACE("Creating linux input system effect (%p) with guid %s\n", *peff, _dump_dinput_GUID(rguid));
1
0
0
0
Vitaliy Margolen : dinput: COM cleanup - use proper DirectInput interface with IUknown calls.
by Alexandre Julliard
10 Jan '11
10 Jan '11
Module: wine Branch: master Commit: 15216098e0b934c1a342e82edf4ac7d833b9a37f URL:
http://source.winehq.org/git/wine.git/?a=commit;h=15216098e0b934c1a342e82ed…
Author: Vitaliy Margolen <wine-patches(a)kievinfo.com> Date: Sun Jan 9 15:43:09 2011 -0700 dinput: COM cleanup - use proper DirectInput interface with IUknown calls. --- dlls/dinput/device.c | 2 +- dlls/dinput/dinput_main.c | 2 +- dlls/dinput/joystick_linux.c | 2 +- dlls/dinput/joystick_linuxinput.c | 2 +- dlls/dinput/joystick_osx.c | 2 +- dlls/dinput/keyboard.c | 2 +- dlls/dinput/mouse.c | 2 +- 7 files changed, 7 insertions(+), 7 deletions(-) diff --git a/dlls/dinput/device.c b/dlls/dinput/device.c index 807a374..5969698 100644 --- a/dlls/dinput/device.c +++ b/dlls/dinput/device.c @@ -712,7 +712,7 @@ ULONG WINAPI IDirectInputDevice2AImpl_Release(LPDIRECTINPUTDEVICE8A iface) list_remove( &This->entry ); LeaveCriticalSection( &This->dinput->crit ); - IDirectInput_Release((LPDIRECTINPUTDEVICE8A)This->dinput); + IDirectInput_Release(&This->dinput->IDirectInput7A_iface); This->crit.DebugInfo->Spare[0] = 0; DeleteCriticalSection(&This->crit); diff --git a/dlls/dinput/dinput_main.c b/dlls/dinput/dinput_main.c index e46f83e..646a4f8 100644 --- a/dlls/dinput/dinput_main.c +++ b/dlls/dinput/dinput_main.c @@ -153,7 +153,7 @@ HRESULT WINAPI DirectInputCreateEx( if (!check_hook_thread()) { - IUnknown_Release( (LPDIRECTINPUT7A)This ); + IUnknown_Release( &This->IDirectInput7A_iface ); return DIERR_GENERIC; } diff --git a/dlls/dinput/joystick_linux.c b/dlls/dinput/joystick_linux.c index d489ef3..588a54b 100644 --- a/dlls/dinput/joystick_linux.c +++ b/dlls/dinput/joystick_linux.c @@ -368,7 +368,7 @@ static HRESULT alloc_device(REFGUID rguid, const void *jvt, IDirectInputImpl *di newDevice->generic.props[i].lSaturation = 0; } - IDirectInput_AddRef((LPDIRECTINPUTDEVICE8A)newDevice->generic.base.dinput); + IDirectInput_AddRef(&newDevice->generic.base.dinput->IDirectInput7A_iface); newDevice->generic.devcaps.dwSize = sizeof(newDevice->generic.devcaps); newDevice->generic.devcaps.dwFlags = DIDC_ATTACHED; diff --git a/dlls/dinput/joystick_linuxinput.c b/dlls/dinput/joystick_linuxinput.c index 1bb3398..75a44ca 100644 --- a/dlls/dinput/joystick_linuxinput.c +++ b/dlls/dinput/joystick_linuxinput.c @@ -504,7 +504,7 @@ static JoystickImpl *alloc_device(REFGUID rguid, const void *jvt, IDirectInputIm if (newDevice->joydev->has_ff) newDevice->generic.devcaps.dwFlags |= DIDC_FORCEFEEDBACK; - IDirectInput_AddRef((LPDIRECTINPUTDEVICE8A)newDevice->generic.base.dinput); + IDirectInput_AddRef(&newDevice->generic.base.dinput->IDirectInput7A_iface); return newDevice; failed: diff --git a/dlls/dinput/joystick_osx.c b/dlls/dinput/joystick_osx.c index 2b4ea12..7daccd4 100644 --- a/dlls/dinput/joystick_osx.c +++ b/dlls/dinput/joystick_osx.c @@ -807,7 +807,7 @@ static HRESULT alloc_device(REFGUID rguid, const void *jvt, IDirectInputImpl *di /* initialize default properties */ get_osx_device_elements_props(newDevice); - IDirectInput_AddRef((LPDIRECTINPUTDEVICE8A)newDevice->generic.base.dinput); + IDirectInput_AddRef(&newDevice->generic.base.dinput->IDirectInput7A_iface); newDevice->generic.devcaps.dwSize = sizeof(newDevice->generic.devcaps); newDevice->generic.devcaps.dwFlags = DIDC_ATTACHED; diff --git a/dlls/dinput/keyboard.c b/dlls/dinput/keyboard.c index 245559f..dda15c1 100644 --- a/dlls/dinput/keyboard.c +++ b/dlls/dinput/keyboard.c @@ -236,7 +236,7 @@ static SysKeyboardImpl *alloc_device(REFGUID rguid, const void *kvt, IDirectInpu df->dwNumObjs = idx; newDevice->base.data_format.wine_df = df; - IDirectInput_AddRef((LPDIRECTINPUTDEVICE8A)newDevice->base.dinput); + IDirectInput_AddRef(&newDevice->base.dinput->IDirectInput7A_iface); return newDevice; failed: diff --git a/dlls/dinput/mouse.c b/dlls/dinput/mouse.c index c780187..5e0e042 100644 --- a/dlls/dinput/mouse.c +++ b/dlls/dinput/mouse.c @@ -223,7 +223,7 @@ static SysMouseImpl *alloc_device(REFGUID rguid, const void *mvt, IDirectInputIm df->rgodf[i].dwType = DIDFT_MAKEINSTANCE(i) | DIDFT_PSHBUTTON; newDevice->base.data_format.wine_df = df; - IDirectInput_AddRef((LPDIRECTINPUTDEVICE8A)newDevice->base.dinput); + IDirectInput_AddRef(&newDevice->base.dinput->IDirectInput7A_iface); return newDevice; failed:
1
0
0
0
← Newer
1
...
61
62
63
64
65
66
67
...
88
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
Results per page:
10
25
50
100
200