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
August 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
1 participants
1051 discussions
Start a n
N
ew thread
Piotr Caban : msvcrt: Fix _CxxThrowException prototype.
by Alexandre Julliard
27 Aug '21
27 Aug '21
Module: wine Branch: master Commit: c306c527e708df33a67d31667be75adcbcbc7d7e URL:
https://source.winehq.org/git/wine.git/?a=commit;h=c306c527e708df33a67d3166…
Author: Piotr Caban <piotr(a)codeweavers.com> Date: Fri Aug 27 13:48:09 2021 +0200 msvcrt: Fix _CxxThrowException prototype. Signed-off-by: Piotr Caban <piotr(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/msvcp60/msvcp.h | 2 +- dlls/msvcp90/exception.c | 14 +++++++------- dlls/msvcp90/msvcp90.h | 2 +- dlls/msvcrt/concurrency.c | 2 +- dlls/msvcrt/cpp.c | 11 ++--------- dlls/msvcrt/cppexcept.h | 2 +- 6 files changed, 13 insertions(+), 20 deletions(-) diff --git a/dlls/msvcp60/msvcp.h b/dlls/msvcp60/msvcp.h index 1f53a31ad97..53b98f4c449 100644 --- a/dlls/msvcp60/msvcp.h +++ b/dlls/msvcp60/msvcp.h @@ -484,5 +484,5 @@ typedef struct { double imag; } complex_double; -void WINAPI DECLSPEC_NORETURN _CxxThrowException(exception*,const cxx_exception_type*); +void WINAPI DECLSPEC_NORETURN _CxxThrowException(void*,const cxx_exception_type*); void __cdecl DECLSPEC_NORETURN _Xmem(void); diff --git a/dlls/msvcp90/exception.c b/dlls/msvcp90/exception.c index 115e0374f7f..748e0ccce3b 100644 --- a/dlls/msvcp90/exception.c +++ b/dlls/msvcp90/exception.c @@ -1064,37 +1064,37 @@ void throw_exception(exception_type et, const char *str) case EXCEPTION_LOGIC_ERROR: { logic_error e; MSVCP_logic_error_ctor(&e, name); - _CxxThrowException((exception*)&e, &logic_error_cxx_type); + _CxxThrowException(&e, &logic_error_cxx_type); } case EXCEPTION_LENGTH_ERROR: { length_error e; MSVCP_length_error_ctor(&e, name); - _CxxThrowException((exception*)&e, &length_error_cxx_type); + _CxxThrowException(&e, &length_error_cxx_type); } case EXCEPTION_OUT_OF_RANGE: { out_of_range e; MSVCP_out_of_range_ctor(&e, name); - _CxxThrowException((exception*)&e, &out_of_range_cxx_type); + _CxxThrowException(&e, &out_of_range_cxx_type); } case EXCEPTION_INVALID_ARGUMENT: { invalid_argument e; MSVCP_invalid_argument_ctor(&e, name); - _CxxThrowException((exception*)&e, &invalid_argument_cxx_type); + _CxxThrowException(&e, &invalid_argument_cxx_type); } case EXCEPTION_RUNTIME_ERROR: { runtime_error e; MSVCP_runtime_error_ctor(&e, name); - _CxxThrowException((exception*)&e, &runtime_error_cxx_type); + _CxxThrowException(&e, &runtime_error_cxx_type); } case EXCEPTION_FAILURE: { failure e; MSVCP_failure_ctor(&e, name); - _CxxThrowException((exception*)&e, &failure_cxx_type); + _CxxThrowException(&e, &failure_cxx_type); } case EXCEPTION_RANGE_ERROR: { range_error e; MSVCP_range_error_ctor(&e, name); - _CxxThrowException((exception*)&e, &range_error_cxx_type); + _CxxThrowException(&e, &range_error_cxx_type); } } } diff --git a/dlls/msvcp90/msvcp90.h b/dlls/msvcp90/msvcp90.h index 0ef02b96ea8..9954eb9c777 100644 --- a/dlls/msvcp90/msvcp90.h +++ b/dlls/msvcp90/msvcp90.h @@ -663,5 +663,5 @@ static inline int mbstowcs_wrapper( size_t *ret, wchar_t *wcs, size_t size, cons #define hypotf( x, y ) ((float)hypot( (double)(x), (double)(y) )) #endif -void WINAPI DECLSPEC_NORETURN _CxxThrowException(exception*,const cxx_exception_type*); +void WINAPI DECLSPEC_NORETURN _CxxThrowException(void*,const cxx_exception_type*); void __cdecl DECLSPEC_NORETURN _Xmem(void); diff --git a/dlls/msvcrt/concurrency.c b/dlls/msvcrt/concurrency.c index 5910e4d6c03..932ed52eb93 100644 --- a/dlls/msvcrt/concurrency.c +++ b/dlls/msvcrt/concurrency.c @@ -620,7 +620,7 @@ static Context* get_current_context(void) scheduler_resource_allocation_error e; scheduler_resource_allocation_error_ctor_name(&e, NULL, HRESULT_FROM_WIN32(GetLastError())); - _CxxThrowException(&e.e, &scheduler_resource_allocation_error_exception_type); + _CxxThrowException(&e, &scheduler_resource_allocation_error_exception_type); } if(InterlockedCompareExchange(&context_tls_index, tls_index, TLS_OUT_OF_INDEXES) != TLS_OUT_OF_INDEXES) diff --git a/dlls/msvcrt/cpp.c b/dlls/msvcrt/cpp.c index 72abcfe055f..6617237b055 100644 --- a/dlls/msvcrt/cpp.c +++ b/dlls/msvcrt/cpp.c @@ -755,7 +755,6 @@ const type_info* CDECL __RTtypeid(void *cppobj) bad_typeid e; bad_typeid_ctor( &e, "Attempted a typeid of NULL pointer!" ); _CxxThrowException( &e, &bad_typeid_exception_type ); - return NULL; } __TRY @@ -768,7 +767,6 @@ const type_info* CDECL __RTtypeid(void *cppobj) __non_rtti_object e; __non_rtti_object_ctor( &e, "Bad read pointer - no RTTI data!" ); _CxxThrowException( &e, &__non_rtti_object_exception_type ); - return NULL; } __ENDTRY return ret; @@ -785,7 +783,6 @@ const type_info* CDECL __RTtypeid(void *cppobj) bad_typeid e; bad_typeid_ctor( &e, "Attempted a typeid of NULL pointer!" ); _CxxThrowException( &e, &bad_typeid_exception_type ); - return NULL; } __TRY @@ -805,7 +802,6 @@ const type_info* CDECL __RTtypeid(void *cppobj) __non_rtti_object e; __non_rtti_object_ctor( &e, "Bad read pointer - no RTTI data!" ); _CxxThrowException( &e, &__non_rtti_object_exception_type ); - return NULL; } __ENDTRY return ret; @@ -892,7 +888,6 @@ void* CDECL __RTDynamicCast(void *cppobj, int unknown, __non_rtti_object e; __non_rtti_object_ctor( &e, "Access violation - no RTTI data!" ); _CxxThrowException( &e, &__non_rtti_object_exception_type ); - return NULL; } __ENDTRY return ret; @@ -955,7 +950,6 @@ void* CDECL __RTDynamicCast(void *cppobj, int unknown, __non_rtti_object e; __non_rtti_object_ctor( &e, "Access violation - no RTTI data!" ); _CxxThrowException( &e, &__non_rtti_object_exception_type ); - return NULL; } __ENDTRY return ret; @@ -995,7 +989,6 @@ void* CDECL __RTCastToVoid(void *cppobj) __non_rtti_object e; __non_rtti_object_ctor( &e, "Access violation - no RTTI data!" ); _CxxThrowException( &e, &__non_rtti_object_exception_type ); - return NULL; } __ENDTRY return ret; @@ -1006,7 +999,7 @@ void* CDECL __RTCastToVoid(void *cppobj) * _CxxThrowException (MSVCRT.@) */ #ifndef __x86_64__ -void WINAPI _CxxThrowException( exception *object, const cxx_exception_type *type ) +void WINAPI _CxxThrowException( void *object, const cxx_exception_type *type ) { ULONG_PTR args[3]; @@ -1016,7 +1009,7 @@ void WINAPI _CxxThrowException( exception *object, const cxx_exception_type *typ RaiseException( CXX_EXCEPTION, EH_NONCONTINUABLE, 3, args ); } #else -void WINAPI _CxxThrowException( exception *object, const cxx_exception_type *type ) +void WINAPI _CxxThrowException( void *object, const cxx_exception_type *type ) { ULONG_PTR args[4]; diff --git a/dlls/msvcrt/cppexcept.h b/dlls/msvcrt/cppexcept.h index f6593d87607..e192eafaafd 100644 --- a/dlls/msvcrt/cppexcept.h +++ b/dlls/msvcrt/cppexcept.h @@ -125,7 +125,7 @@ typedef struct } cxx_exception_type; #endif -void WINAPI _CxxThrowException(exception*,const cxx_exception_type*); +void WINAPI _CxxThrowException(void*,const cxx_exception_type*); int CDECL _XcptFilter(NTSTATUS, PEXCEPTION_POINTERS); static inline const char *dbgstr_type_info( const type_info *info )
1
0
0
0
Francois Gouget : mshtml: Remove WINAPI on static functions where not needed.
by Alexandre Julliard
27 Aug '21
27 Aug '21
Module: wine Branch: master Commit: 3884a6808281bf57ef0cc7a78d3d8e8e45da21b1 URL:
https://source.winehq.org/git/wine.git/?a=commit;h=3884a6808281bf57ef0cc7a7…
Author: Francois Gouget <fgouget(a)free.fr> Date: Fri Aug 27 12:47:50 2021 +0200 mshtml: Remove WINAPI on static functions where not needed. Signed-off-by: Francois Gouget <fgouget(a)free.fr> Signed-off-by: Jacek Caban <jacek(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/mshtml/htmlelem.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dlls/mshtml/htmlelem.c b/dlls/mshtml/htmlelem.c index 9ad538d2b00..d9554f4668d 100644 --- a/dlls/mshtml/htmlelem.c +++ b/dlls/mshtml/htmlelem.c @@ -6515,7 +6515,7 @@ static const WCHAR *find_token(const WCHAR *list, const WCHAR *token, unsigned i return NULL; } -static HRESULT WINAPI token_list_add_remove(IWineDOMTokenList *iface, BSTR token, BOOL remove) +static HRESULT token_list_add_remove(IWineDOMTokenList *iface, BSTR token, BOOL remove) { struct token_list *token_list = impl_from_IWineDOMTokenList(iface); unsigned int i, len, old_len, new_len;
1
0
0
0
Rémi Bernon : dinput: Read HID reports from the internal thread.
by Alexandre Julliard
27 Aug '21
27 Aug '21
Module: wine Branch: master Commit: d1e0c5a732236f99c334f50a5d694543a58ba05d URL:
https://source.winehq.org/git/wine.git/?a=commit;h=d1e0c5a732236f99c334f50a…
Author: Rémi Bernon <rbernon(a)codeweavers.com> Date: Fri Aug 27 12:45:29 2021 +0200 dinput: Read HID reports from the internal thread. Signed-off-by: Rémi Bernon <rbernon(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/dinput/joystick_hid.c | 245 ++++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 242 insertions(+), 3 deletions(-) Diff:
https://source.winehq.org/git/wine.git/?a=commitdiff;h=d1e0c5a732236f99c334…
1
0
0
0
Rémi Bernon : dinput: Implement HID joystick IDirectInputDevice8_EnumObjects.
by Alexandre Julliard
27 Aug '21
27 Aug '21
Module: wine Branch: master Commit: 1117f9f072020b5a95410301244703f4d94ff484 URL:
https://source.winehq.org/git/wine.git/?a=commit;h=1117f9f072020b5a95410301…
Author: Rémi Bernon <rbernon(a)codeweavers.com> Date: Fri Aug 27 12:45:28 2021 +0200 dinput: Implement HID joystick IDirectInputDevice8_EnumObjects. Signed-off-by: Rémi Bernon <rbernon(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/dinput/joystick_hid.c | 45 ++++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 44 insertions(+), 1 deletion(-) diff --git a/dlls/dinput/joystick_hid.c b/dlls/dinput/joystick_hid.c index 4a05afe30c7..3e706dea0b1 100644 --- a/dlls/dinput/joystick_hid.c +++ b/dlls/dinput/joystick_hid.c @@ -427,6 +427,49 @@ static HRESULT WINAPI hid_joystick_GetCapabilities( IDirectInputDevice8W *iface, return DI_OK; } +struct enum_objects_params +{ + LPDIENUMDEVICEOBJECTSCALLBACKW callback; + void *context; +}; + +static BOOL enum_objects_callback( struct hid_joystick *impl, struct hid_caps *caps, + DIDEVICEOBJECTINSTANCEW *instance, void *data ) +{ + struct enum_objects_params *params = data; + return params->callback( instance, params->context ); +} + +static HRESULT WINAPI hid_joystick_EnumObjects( IDirectInputDevice8W *iface, LPDIENUMDEVICEOBJECTSCALLBACKW callback, + void *context, DWORD flags ) +{ + static const DIPROPHEADER filter = + { + .dwSize = sizeof(filter), + .dwHeaderSize = sizeof(filter), + .dwHow = DIPH_DEVICE, + }; + struct hid_joystick *impl = impl_from_IDirectInputDevice8W( iface ); + struct enum_objects_params params = + { + .callback = callback, + .context = context, + }; + BOOL ret; + + TRACE( "iface %p, callback %p, context %p, flags %#x.\n", iface, callback, context, flags ); + + if (!callback) return DIERR_INVALIDPARAM; + + ret = enum_value_objects( impl, &filter, flags, enum_objects_callback, ¶ms ); + if (ret != DIENUM_CONTINUE) return S_OK; + ret = enum_button_objects( impl, &filter, flags, enum_objects_callback, ¶ms ); + if (ret != DIENUM_CONTINUE) return S_OK; + enum_collections_objects( impl, &filter, flags, enum_objects_callback, ¶ms ); + + return S_OK; +} + static BOOL get_property_prop_range( struct hid_joystick *impl, struct hid_caps *caps, DIDEVICEOBJECTINSTANCEW *instance, void *data ) { @@ -619,7 +662,7 @@ static const IDirectInputDevice8WVtbl hid_joystick_vtbl = hid_joystick_Release, /*** IDirectInputDevice methods ***/ hid_joystick_GetCapabilities, - IDirectInputDevice2WImpl_EnumObjects, + hid_joystick_EnumObjects, hid_joystick_GetProperty, hid_joystick_SetProperty, IDirectInputDevice2WImpl_Acquire,
1
0
0
0
Rémi Bernon : dinput: Implement HID joystick IDirectInputDevice8_GetObjectInfo.
by Alexandre Julliard
27 Aug '21
27 Aug '21
Module: wine Branch: master Commit: ef7432d86e3d7ee1edf3c814efd4ef36dbed1020 URL:
https://source.winehq.org/git/wine.git/?a=commit;h=ef7432d86e3d7ee1edf3c814…
Author: Rémi Bernon <rbernon(a)codeweavers.com> Date: Fri Aug 27 12:45:27 2021 +0200 dinput: Implement HID joystick IDirectInputDevice8_GetObjectInfo. Signed-off-by: Rémi Bernon <rbernon(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/dinput/joystick_hid.c | 39 ++++++++++++++++++++++++++++++++++++++- 1 file changed, 38 insertions(+), 1 deletion(-) diff --git a/dlls/dinput/joystick_hid.c b/dlls/dinput/joystick_hid.c index d58a8f5d919..4a05afe30c7 100644 --- a/dlls/dinput/joystick_hid.c +++ b/dlls/dinput/joystick_hid.c @@ -536,6 +536,43 @@ static HRESULT WINAPI hid_joystick_GetDeviceState( IDirectInputDevice8W *iface, return DI_OK; } +static BOOL get_object_info( struct hid_joystick *impl, struct hid_caps *caps, + DIDEVICEOBJECTINSTANCEW *instance, void *data ) +{ + DIDEVICEOBJECTINSTANCEW *dest = data; + memcpy( dest, instance, dest->dwSize ); + return DIENUM_STOP; +} + +static HRESULT WINAPI hid_joystick_GetObjectInfo( IDirectInputDevice8W *iface, DIDEVICEOBJECTINSTANCEW *instance, + DWORD obj, DWORD how ) +{ + struct hid_joystick *impl = impl_from_IDirectInputDevice8W( iface ); + const DIPROPHEADER filter = + { + .dwSize = sizeof(filter), + .dwHeaderSize = sizeof(filter), + .dwHow = how, + .dwObj = obj + }; + BOOL ret; + + TRACE( "iface %p, instance %p, obj %#x, how %#x.\n", iface, instance, obj, how ); + + if (!instance) return E_POINTER; + if (instance->dwSize != sizeof(DIDEVICEOBJECTINSTANCE_DX3W) && + instance->dwSize != sizeof(DIDEVICEOBJECTINSTANCEW)) + return DIERR_INVALIDPARAM; + + ret = enum_value_objects( impl, &filter, DIDFT_ALL, get_object_info, NULL ); + if (ret != DIENUM_CONTINUE) return S_OK; + ret = enum_button_objects( impl, &filter, DIDFT_ALL, get_object_info, NULL ); + if (ret != DIENUM_CONTINUE) return S_OK; + enum_collections_objects( impl, &filter, DIDFT_ALL, get_object_info, NULL ); + + return S_OK; +} + static HRESULT WINAPI hid_joystick_GetDeviceInfo( IDirectInputDevice8W *iface, DIDEVICEINSTANCEW *instance ) { struct hid_joystick *impl = impl_from_IDirectInputDevice8W( iface ); @@ -592,7 +629,7 @@ static const IDirectInputDevice8WVtbl hid_joystick_vtbl = IDirectInputDevice2WImpl_SetDataFormat, IDirectInputDevice2WImpl_SetEventNotification, IDirectInputDevice2WImpl_SetCooperativeLevel, - IDirectInputDevice2WImpl_GetObjectInfo, + hid_joystick_GetObjectInfo, hid_joystick_GetDeviceInfo, IDirectInputDevice2WImpl_RunControlPanel, IDirectInputDevice2WImpl_Initialize,
1
0
0
0
Rémi Bernon : dinput: Implement HID joystick IDirectInputDevice8_SetProperty.
by Alexandre Julliard
27 Aug '21
27 Aug '21
Module: wine Branch: master Commit: 2681caa3f8cdcf5555b90947bc2a70efe5cb306f URL:
https://source.winehq.org/git/wine.git/?a=commit;h=2681caa3f8cdcf5555b90947…
Author: Rémi Bernon <rbernon(a)codeweavers.com> Date: Fri Aug 27 12:45:26 2021 +0200 dinput: Implement HID joystick IDirectInputDevice8_SetProperty. For DIPROP_RANGE property on POVs and Axes, and initialize it on creation. This uses the value caps physical range, as it's exactly the purpose and we don't use it for anything else otherwise. We'll scale values from their logical range directly anyway to save a conversion. Signed-off-by: Rémi Bernon <rbernon(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/dinput/joystick_hid.c | 64 +++++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 63 insertions(+), 1 deletion(-) diff --git a/dlls/dinput/joystick_hid.c b/dlls/dinput/joystick_hid.c index e3654a38a6a..d58a8f5d919 100644 --- a/dlls/dinput/joystick_hid.c +++ b/dlls/dinput/joystick_hid.c @@ -427,6 +427,16 @@ static HRESULT WINAPI hid_joystick_GetCapabilities( IDirectInputDevice8W *iface, return DI_OK; } +static BOOL get_property_prop_range( struct hid_joystick *impl, struct hid_caps *caps, + DIDEVICEOBJECTINSTANCEW *instance, void *data ) +{ + HIDP_VALUE_CAPS *value_caps = caps->value; + DIPROPRANGE *value = data; + value->lMin = value_caps->PhysicalMin; + value->lMax = value_caps->PhysicalMax; + return DIENUM_CONTINUE; +} + static HRESULT WINAPI hid_joystick_GetProperty( IDirectInputDevice8W *iface, const GUID *guid, DIPROPHEADER *header ) { @@ -439,6 +449,9 @@ static HRESULT WINAPI hid_joystick_GetProperty( IDirectInputDevice8W *iface, con switch (LOWORD( guid )) { + case (DWORD_PTR)DIPROP_RANGE: + enum_value_objects( impl, header, DIDFT_AXIS, get_property_prop_range, header ); + return DI_OK; case (DWORD_PTR)DIPROP_PRODUCTNAME: { DIPROPSTRING *value = (DIPROPSTRING *)header; @@ -477,6 +490,41 @@ static HRESULT WINAPI hid_joystick_GetProperty( IDirectInputDevice8W *iface, con return DI_OK; } +static BOOL set_property_prop_range( struct hid_joystick *impl, struct hid_caps *caps, + DIDEVICEOBJECTINSTANCEW *instance, void *data ) +{ + HIDP_VALUE_CAPS *value_caps = caps->value; + DIPROPRANGE *value = data; + LONG range = value_caps->LogicalMax - value_caps->LogicalMin; + value_caps->PhysicalMin = value->lMin; + value_caps->PhysicalMax = value->lMax; + if (instance->dwType & DIDFT_POV && range > 0) + value_caps->PhysicalMax -= value->lMax / (range + 1); + return DIENUM_CONTINUE; +} + +static HRESULT WINAPI hid_joystick_SetProperty( IDirectInputDevice8W *iface, const GUID *guid, + const DIPROPHEADER *header ) +{ + struct hid_joystick *impl = impl_from_IDirectInputDevice8W( iface ); + + TRACE( "iface %p, guid %s, header %p\n", iface, debugstr_guid( guid ), header ); + + if (!header) return DIERR_INVALIDPARAM; + if (!IS_DIPROP( guid )) return DI_OK; + + switch (LOWORD( guid )) + { + case (DWORD_PTR)DIPROP_RANGE: + enum_value_objects( impl, header, DIDFT_AXIS, set_property_prop_range, (void *)header ); + return DI_OK; + default: + return IDirectInputDevice2WImpl_SetProperty( iface, guid, header ); + } + + return DI_OK; +} + static HRESULT WINAPI hid_joystick_GetDeviceState( IDirectInputDevice8W *iface, DWORD len, void *ptr ) { struct hid_joystick *impl = impl_from_IDirectInputDevice8W( iface ); @@ -536,7 +584,7 @@ static const IDirectInputDevice8WVtbl hid_joystick_vtbl = hid_joystick_GetCapabilities, IDirectInputDevice2WImpl_EnumObjects, hid_joystick_GetProperty, - IDirectInputDevice2WImpl_SetProperty, + hid_joystick_SetProperty, IDirectInputDevice2WImpl_Acquire, IDirectInputDevice2WImpl_Unacquire, hid_joystick_GetDeviceState, @@ -747,6 +795,15 @@ static HRESULT hid_joystick_create_device( IDirectInputImpl *dinput, const GUID .guidProduct = *guid, .guidInstance = *guid }; + DIPROPRANGE range = + { + .diph = + { + .dwSize = sizeof(range), + .dwHeaderSize = sizeof(DIPROPHEADER), + .dwHow = DIPH_DEVICE, + }, + }; HIDD_ATTRIBUTES attrs = {.Size = sizeof(attrs)}; HIDP_LINK_COLLECTION_NODE *nodes; struct hid_joystick *impl = NULL; @@ -826,6 +883,11 @@ static HRESULT hid_joystick_create_device( IDirectInputImpl *dinput, const GUID _dump_DIDATAFORMAT( impl->base.data_format.wine_df ); + range.lMax = 65535; + enum_value_objects( impl, &range.diph, DIDFT_AXIS, set_property_prop_range, &range ); + range.lMax = 36000; + enum_value_objects( impl, &range.diph, DIDFT_POV, set_property_prop_range, &range ); + *out = &impl->base.IDirectInputDevice8W_iface; return DI_OK;
1
0
0
0
Rémi Bernon : dinput: Enumerate HID collections, input buttons and values.
by Alexandre Julliard
27 Aug '21
27 Aug '21
Module: wine Branch: master Commit: 81c15d2d81951de8938613662861b5a2b875b443 URL:
https://source.winehq.org/git/wine.git/?a=commit;h=81c15d2d81951de893861366…
Author: Rémi Bernon <rbernon(a)codeweavers.com> Date: Fri Aug 27 12:45:25 2021 +0200 dinput: Enumerate HID collections, input buttons and values. And initialize data format from them. Signed-off-by: Rémi Bernon <rbernon(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/dinput/joystick_hid.c | 417 ++++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 415 insertions(+), 2 deletions(-) Diff:
https://source.winehq.org/git/wine.git/?a=commitdiff;h=81c15d2d81951de89386…
1
0
0
0
Rémi Bernon : dinput: Implement HID joystick IDirectInputDevice8_GetCapabilities.
by Alexandre Julliard
27 Aug '21
27 Aug '21
Module: wine Branch: master Commit: 10a812fb7dfe2d24632821fc33a571de62391e47 URL:
https://source.winehq.org/git/wine.git/?a=commit;h=10a812fb7dfe2d24632821fc…
Author: Rémi Bernon <rbernon(a)codeweavers.com> Date: Fri Aug 27 12:45:24 2021 +0200 dinput: Implement HID joystick IDirectInputDevice8_GetCapabilities. Signed-off-by: Rémi Bernon <rbernon(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/dinput/joystick_hid.c | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/dlls/dinput/joystick_hid.c b/dlls/dinput/joystick_hid.c index 53dc97177a1..601de3b00b0 100644 --- a/dlls/dinput/joystick_hid.c +++ b/dlls/dinput/joystick_hid.c @@ -59,6 +59,7 @@ struct hid_joystick DIDEVICEINSTANCEW instance; WCHAR device_path[MAX_PATH]; HIDD_ATTRIBUTES attrs; + DIDEVCAPS dev_caps; }; static inline struct hid_joystick *impl_from_IDirectInputDevice8W( IDirectInputDevice8W *iface ) @@ -84,11 +85,15 @@ static ULONG WINAPI hid_joystick_Release( IDirectInputDevice8W *iface ) static HRESULT WINAPI hid_joystick_GetCapabilities( IDirectInputDevice8W *iface, DIDEVCAPS *caps ) { - FIXME( "iface %p, caps %p stub!\n", iface, caps ); + struct hid_joystick *impl = impl_from_IDirectInputDevice8W( iface ); + + TRACE( "iface %p, caps %p.\n", iface, caps ); if (!caps) return E_POINTER; - return DIERR_UNSUPPORTED; + *caps = impl->dev_caps; + + return DI_OK; } static HRESULT WINAPI hid_joystick_GetProperty( IDirectInputDevice8W *iface, const GUID *guid, @@ -404,6 +409,9 @@ static HRESULT hid_joystick_create_device( IDirectInputImpl *dinput, const GUID impl->instance = instance; impl->attrs = attrs; + impl->dev_caps.dwSize = sizeof(impl->dev_caps); + impl->dev_caps.dwFlags = DIDC_ATTACHED | DIDC_EMULATED; + impl->dev_caps.dwDevType = instance.dwDevType; *out = &impl->base.IDirectInputDevice8W_iface; return DI_OK;
1
0
0
0
Rémi Bernon : dinput: Implement HID joystick IDirectInputDevice8_GetDeviceState.
by Alexandre Julliard
27 Aug '21
27 Aug '21
Module: wine Branch: master Commit: 91f4af3418230305c9407711abe34d89156a47cf URL:
https://source.winehq.org/git/wine.git/?a=commit;h=91f4af3418230305c9407711…
Author: Rémi Bernon <rbernon(a)codeweavers.com> Date: Fri Aug 27 12:45:23 2021 +0200 dinput: Implement HID joystick IDirectInputDevice8_GetDeviceState. Removing the trace as it can get pretty verbose otherwise. Signed-off-by: Rémi Bernon <rbernon(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/dinput/joystick_hid.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/dlls/dinput/joystick_hid.c b/dlls/dinput/joystick_hid.c index 01864bb91e5..53dc97177a1 100644 --- a/dlls/dinput/joystick_hid.c +++ b/dlls/dinput/joystick_hid.c @@ -51,6 +51,7 @@ DEFINE_DEVPROPKEY( DEVPROPKEY_HID_HANDLE, 0xbc62e415, 0xf4fe, 0x405c, 0x8e, 0xda struct hid_joystick { IDirectInputDeviceImpl base; + DIJOYSTATE2 state; HANDLE device; PHIDP_PREPARSED_DATA preparsed; @@ -142,11 +143,13 @@ static HRESULT WINAPI hid_joystick_GetProperty( IDirectInputDevice8W *iface, con static HRESULT WINAPI hid_joystick_GetDeviceState( IDirectInputDevice8W *iface, DWORD len, void *ptr ) { - FIXME( "iface %p, len %u, ptr %p stub!\n", iface, len, ptr ); + struct hid_joystick *impl = impl_from_IDirectInputDevice8W( iface ); if (!ptr) return DIERR_INVALIDPARAM; - return DIERR_UNSUPPORTED; + fill_DataFormat( ptr, len, &impl->state, &impl->base.data_format ); + + return DI_OK; } static HRESULT WINAPI hid_joystick_GetDeviceInfo( IDirectInputDevice8W *iface, DIDEVICEINSTANCEW *instance )
1
0
0
0
Rémi Bernon : dinput: Implement HID joystick IDirectInputDevice8_GetProperty.
by Alexandre Julliard
27 Aug '21
27 Aug '21
Module: wine Branch: master Commit: 6ba3a548427f3edee7117fdca72aa6bd44a404cd URL:
https://source.winehq.org/git/wine.git/?a=commit;h=6ba3a548427f3edee7117fdc…
Author: Rémi Bernon <rbernon(a)codeweavers.com> Date: Fri Aug 27 12:45:22 2021 +0200 dinput: Implement HID joystick IDirectInputDevice8_GetProperty. Signed-off-by: Rémi Bernon <rbernon(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/dinput/joystick_hid.c | 58 +++++++++++++++++++++++++++++++++++++++++++--- 1 file changed, 55 insertions(+), 3 deletions(-) diff --git a/dlls/dinput/joystick_hid.c b/dlls/dinput/joystick_hid.c index d7efc44e806..01864bb91e5 100644 --- a/dlls/dinput/joystick_hid.c +++ b/dlls/dinput/joystick_hid.c @@ -56,6 +56,8 @@ struct hid_joystick PHIDP_PREPARSED_DATA preparsed; DIDEVICEINSTANCEW instance; + WCHAR device_path[MAX_PATH]; + HIDD_ATTRIBUTES attrs; }; static inline struct hid_joystick *impl_from_IDirectInputDevice8W( IDirectInputDevice8W *iface ) @@ -88,6 +90,56 @@ static HRESULT WINAPI hid_joystick_GetCapabilities( IDirectInputDevice8W *iface, return DIERR_UNSUPPORTED; } +static HRESULT WINAPI hid_joystick_GetProperty( IDirectInputDevice8W *iface, const GUID *guid, + DIPROPHEADER *header ) +{ + struct hid_joystick *impl = impl_from_IDirectInputDevice8W( iface ); + + TRACE( "iface %p, guid %s, header %p\n", iface, debugstr_guid( guid ), header ); + + if (!header) return DIERR_INVALIDPARAM; + if (!IS_DIPROP( guid )) return DI_OK; + + switch (LOWORD( guid )) + { + case (DWORD_PTR)DIPROP_PRODUCTNAME: + { + DIPROPSTRING *value = (DIPROPSTRING *)header; + lstrcpynW( value->wsz, impl->instance.tszProductName, MAX_PATH ); + return DI_OK; + } + case (DWORD_PTR)DIPROP_INSTANCENAME: + { + DIPROPSTRING *value = (DIPROPSTRING *)header; + lstrcpynW( value->wsz, impl->instance.tszInstanceName, MAX_PATH ); + return DI_OK; + } + case (DWORD_PTR)DIPROP_VIDPID: + { + DIPROPDWORD *value = (DIPROPDWORD *)header; + if (!impl->attrs.VendorID || !impl->attrs.ProductID) return DIERR_UNSUPPORTED; + value->dwData = MAKELONG( impl->attrs.VendorID, impl->attrs.ProductID ); + return DI_OK; + } + case (DWORD_PTR)DIPROP_JOYSTICKID: + { + DIPROPDWORD *value = (DIPROPDWORD *)header; + value->dwData = impl->instance.guidInstance.Data3; + return DI_OK; + } + case (DWORD_PTR)DIPROP_GUIDANDPATH: + { + DIPROPGUIDANDPATH *value = (DIPROPGUIDANDPATH *)header; + lstrcpynW( value->wszPath, impl->device_path, MAX_PATH ); + return DI_OK; + } + default: + return IDirectInputDevice2WImpl_GetProperty( iface, guid, header ); + } + + return DI_OK; +} + static HRESULT WINAPI hid_joystick_GetDeviceState( IDirectInputDevice8W *iface, DWORD len, void *ptr ) { FIXME( "iface %p, len %u, ptr %p stub!\n", iface, len, ptr ); @@ -144,7 +196,7 @@ static const IDirectInputDevice8WVtbl hid_joystick_vtbl = /*** IDirectInputDevice methods ***/ hid_joystick_GetCapabilities, IDirectInputDevice2WImpl_EnumObjects, - IDirectInputDevice2WImpl_GetProperty, + hid_joystick_GetProperty, IDirectInputDevice2WImpl_SetProperty, IDirectInputDevice2WImpl_Acquire, IDirectInputDevice2WImpl_Unacquire, @@ -322,7 +374,6 @@ static HRESULT hid_joystick_create_device( IDirectInputImpl *dinput, const GUID }; HIDD_ATTRIBUTES attrs = {.Size = sizeof(attrs)}; struct hid_joystick *impl = NULL; - WCHAR device_path[MAX_PATH]; HIDP_CAPS caps; HRESULT hr; @@ -344,11 +395,12 @@ static HRESULT hid_joystick_create_device( IDirectInputImpl *dinput, const GUID impl->base.crit.DebugInfo->Spare[0] = (DWORD_PTR)(__FILE__ ": hid_joystick.base.crit"); impl->base.dwCoopLevel = DISCL_NONEXCLUSIVE | DISCL_BACKGROUND; - hr = hid_joystick_device_open( -1, &instance, device_path, &impl->device, &impl->preparsed, + hr = hid_joystick_device_open( -1, &instance, impl->device_path, &impl->device, &impl->preparsed, &attrs, &caps, dinput->dwVersion ); if (hr != DI_OK) goto failed; impl->instance = instance; + impl->attrs = attrs; *out = &impl->base.IDirectInputDevice8W_iface; return DI_OK;
1
0
0
0
← Newer
1
...
12
13
14
15
16
17
18
...
106
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
Results per page:
10
25
50
100
200