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
November 2022
----- 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
1171 discussions
Start a n
N
ew thread
Alexandre Julliard : kerberos: Use the Unix call helpers.
by Alexandre Julliard
25 Nov '22
25 Nov '22
Module: wine Branch: master Commit: f7b55ffafaac0a32545d948f62363ec2f5b64ba4 URL:
https://gitlab.winehq.org/wine/wine/-/commit/f7b55ffafaac0a32545d948f62363e…
Author: Alexandre Julliard <julliard(a)winehq.org> Date: Fri Nov 25 10:12:17 2022 +0100 kerberos: Use the Unix call helpers. --- dlls/kerberos/krb5_ap.c | 30 ++++-------------------------- dlls/kerberos/unixlib.h | 4 +--- 2 files changed, 5 insertions(+), 29 deletions(-) diff --git a/dlls/kerberos/krb5_ap.c b/dlls/kerberos/krb5_ap.c index 84d742079e6..42d3358a20d 100644 --- a/dlls/kerberos/krb5_ap.c +++ b/dlls/kerberos/krb5_ap.c @@ -39,10 +39,6 @@ WINE_DEFAULT_DEBUG_CHANNEL(kerberos); -static HINSTANCE instance; - -unixlib_handle_t krb5_handle = 0; - #define KERBEROS_CAPS \ ( SECPKG_FLAG_INTEGRITY \ | SECPKG_FLAG_PRIVACY \ @@ -134,11 +130,9 @@ static NTSTATUS NTAPI kerberos_LsaApInitializePackage(ULONG package_id, PLSA_DIS { char *kerberos_name; - if (!krb5_handle) + if (!__wine_unixlib_handle) { - if (NtQueryVirtualMemory( GetCurrentProcess(), instance, MemoryWineUnixFuncs, - &krb5_handle, sizeof(krb5_handle), NULL ) || - KRB5_CALL( process_attach, NULL )) + if (__wine_init_unix_call() || KRB5_CALL( process_attach, NULL )) ERR( "no Kerberos support, expect problems\n" ); } @@ -569,11 +563,9 @@ static NTSTATUS NTAPI kerberos_SpInitialize(ULONG_PTR package_id, SECPKG_PARAMET { TRACE("%Iu, %p, %p\n", package_id, params, lsa_function_table); - if (!krb5_handle) + if (!__wine_unixlib_handle) { - if (NtQueryVirtualMemory( GetCurrentProcess(), instance, MemoryWineUnixFuncs, - &krb5_handle, sizeof(krb5_handle), NULL ) || - KRB5_CALL( process_attach, NULL )) + if (__wine_init_unix_call() || KRB5_CALL( process_attach, NULL )) WARN( "no Kerberos support\n" ); return STATUS_UNSUCCESSFUL; } @@ -781,17 +773,3 @@ NTSTATUS NTAPI SpUserModeInitialize(ULONG lsa_version, PULONG package_version, *table_count = 1; return STATUS_SUCCESS; } - -BOOL WINAPI DllMain( HINSTANCE hinst, DWORD reason, void *reserved ) -{ - switch (reason) - { - case DLL_PROCESS_ATTACH: - instance = hinst; - DisableThreadLibraryCalls( hinst ); - break; - case DLL_PROCESS_DETACH: - break; - } - return TRUE; -} diff --git a/dlls/kerberos/unixlib.h b/dlls/kerberos/unixlib.h index f811f583bb2..1725f813a16 100644 --- a/dlls/kerberos/unixlib.h +++ b/dlls/kerberos/unixlib.h @@ -139,6 +139,4 @@ enum unix_funcs unix_verify_signature, }; -extern unixlib_handle_t krb5_handle DECLSPEC_HIDDEN; - -#define KRB5_CALL( func, params ) __wine_unix_call( krb5_handle, unix_ ## func, params ) +#define KRB5_CALL( func, params ) WINE_UNIX_CALL( unix_ ## func, params )
1
0
0
0
Alexandre Julliard : dwrite: Use the Unix call helpers.
by Alexandre Julliard
25 Nov '22
25 Nov '22
Module: wine Branch: master Commit: 5392bd303efc0073b49f53d54a637a919527d542 URL:
https://gitlab.winehq.org/wine/wine/-/commit/5392bd303efc0073b49f53d54a637a…
Author: Alexandre Julliard <julliard(a)winehq.org> Date: Fri Nov 25 10:11:36 2022 +0100 dwrite: Use the Unix call helpers. --- dlls/dwrite/main.c | 6 ++---- dlls/dwrite/unixlib.h | 4 +--- 2 files changed, 3 insertions(+), 7 deletions(-) diff --git a/dlls/dwrite/main.c b/dlls/dwrite/main.c index 8cc5d4dccf7..6776b1ce974 100644 --- a/dlls/dwrite/main.c +++ b/dlls/dwrite/main.c @@ -36,7 +36,6 @@ WINE_DEFAULT_DEBUG_CHANNEL(dwrite); HMODULE dwrite_module = 0; -unixlib_handle_t unixlib_handle = 0; static IDWriteFactory7 *shared_factory; static void release_shared_factory(IDWriteFactory7 *factory); @@ -47,8 +46,7 @@ BOOL WINAPI DllMain(HINSTANCE hinstDLL, DWORD reason, LPVOID reserved) case DLL_PROCESS_ATTACH: dwrite_module = hinstDLL; DisableThreadLibraryCalls( hinstDLL ); - if (!NtQueryVirtualMemory(GetCurrentProcess(), hinstDLL, MemoryWineUnixFuncs, - &unixlib_handle, sizeof(unixlib_handle), NULL)) + if (!__wine_init_unix_call()) UNIX_CALL(process_attach, NULL); init_local_fontfile_loader(); break; @@ -56,7 +54,7 @@ BOOL WINAPI DllMain(HINSTANCE hinstDLL, DWORD reason, LPVOID reserved) if (reserved) break; release_shared_factory(shared_factory); release_system_fallback_data(); - if (unixlib_handle) UNIX_CALL(process_detach, NULL); + UNIX_CALL(process_detach, NULL); } return TRUE; } diff --git a/dlls/dwrite/unixlib.h b/dlls/dwrite/unixlib.h index 533c3168b99..c63d5bea722 100644 --- a/dlls/dwrite/unixlib.h +++ b/dlls/dwrite/unixlib.h @@ -108,6 +108,4 @@ enum font_backend_funcs unix_get_design_glyph_metrics, }; -extern unixlib_handle_t unixlib_handle DECLSPEC_HIDDEN; - -#define UNIX_CALL( func, params ) __wine_unix_call( unixlib_handle, unix_ ## func, params ) +#define UNIX_CALL( func, params ) WINE_UNIX_CALL( unix_ ## func, params )
1
0
0
0
Alexandre Julliard : crypt32: Use the Unix call helpers.
by Alexandre Julliard
25 Nov '22
25 Nov '22
Module: wine Branch: master Commit: f340406417954fdc421d7102365235d71a01ae9a URL:
https://gitlab.winehq.org/wine/wine/-/commit/f340406417954fdc421d7102365235…
Author: Alexandre Julliard <julliard(a)winehq.org> Date: Fri Nov 25 10:10:59 2022 +0100 crypt32: Use the Unix call helpers. --- dlls/crypt32/crypt32_private.h | 4 +--- dlls/crypt32/main.c | 4 +--- 2 files changed, 2 insertions(+), 6 deletions(-) diff --git a/dlls/crypt32/crypt32_private.h b/dlls/crypt32/crypt32_private.h index f4131bf2694..41c5ec523be 100644 --- a/dlls/crypt32/crypt32_private.h +++ b/dlls/crypt32/crypt32_private.h @@ -508,8 +508,6 @@ enum unix_funcs unix_enum_root_certs, }; -extern unixlib_handle_t crypt32_handle; - -#define CRYPT32_CALL( func, params ) __wine_unix_call( crypt32_handle, unix_ ## func, params ) +#define CRYPT32_CALL( func, params ) WINE_UNIX_CALL( unix_ ## func, params ) #endif diff --git a/dlls/crypt32/main.c b/dlls/crypt32/main.c index 4a94bed9b6b..b320c895e15 100644 --- a/dlls/crypt32/main.c +++ b/dlls/crypt32/main.c @@ -35,7 +35,6 @@ WINE_DEFAULT_DEBUG_CHANNEL(crypt); static HCRYPTPROV hDefProv; HINSTANCE hInstance; -unixlib_handle_t crypt32_handle = 0; static CRITICAL_SECTION prov_param_cs; static CRITICAL_SECTION_DEBUG prov_param_cs_debug = @@ -56,8 +55,7 @@ BOOL WINAPI DllMain(HINSTANCE hInst, DWORD reason, PVOID pvReserved) DisableThreadLibraryCalls(hInst); init_empty_store(); crypt_oid_init(); - if (NtQueryVirtualMemory( GetCurrentProcess(), hInst, MemoryWineUnixFuncs, - &crypt32_handle, sizeof(crypt32_handle), NULL )) + if (__wine_init_unix_call()) return FALSE; CRYPT32_CALL( process_attach, NULL ); break;
1
0
0
0
Alexandre Julliard : bcrypt: Use the Unix call helpers.
by Alexandre Julliard
25 Nov '22
25 Nov '22
Module: wine Branch: master Commit: a4f8d28de77148f7e8a5ad0fe9376afaabb44d49 URL:
https://gitlab.winehq.org/wine/wine/-/commit/a4f8d28de77148f7e8a5ad0fe9376a…
Author: Alexandre Julliard <julliard(a)winehq.org> Date: Fri Nov 25 10:10:34 2022 +0100 bcrypt: Use the Unix call helpers. --- dlls/bcrypt/bcrypt_main.c | 15 ++++++--------- 1 file changed, 6 insertions(+), 9 deletions(-) diff --git a/dlls/bcrypt/bcrypt_main.c b/dlls/bcrypt/bcrypt_main.c index 266c30fa426..6f6d713c6ac 100644 --- a/dlls/bcrypt/bcrypt_main.c +++ b/dlls/bcrypt/bcrypt_main.c @@ -34,9 +34,7 @@ WINE_DEFAULT_DEBUG_CHANNEL(bcrypt); -static unixlib_handle_t bcrypt_handle; - -#define UNIX_CALL( func, params ) __wine_unix_call( bcrypt_handle, unix_ ## func, params ) +#define UNIX_CALL( func, params ) WINE_UNIX_CALL( unix_ ## func, params ) NTSTATUS WINAPI BCryptAddContextFunction( ULONG table, const WCHAR *ctx, ULONG iface, const WCHAR *func, ULONG pos ) @@ -1107,7 +1105,7 @@ static NTSTATUS key_asymmetric_create( enum alg_id alg_id, ULONG bitlen, struct { struct key *key; - if (!bcrypt_handle) + if (!__wine_unixlib_handle) { ERR( "no encryption support\n" ); return STATUS_NOT_IMPLEMENTED; @@ -1786,7 +1784,7 @@ NTSTATUS WINAPI BCryptGenerateSymmetricKey( BCRYPT_ALG_HANDLE handle, BCRYPT_KEY TRACE( "%p, %p, %p, %lu, %p, %lu, %#lx\n", handle, ret_handle, object, object_len, secret, secret_len, flags ); if (object) FIXME( "ignoring object buffer\n" ); - if (!bcrypt_handle) + if (!__wine_unixlib_handle) { ERR( "no encryption support\n" ); return STATUS_NOT_IMPLEMENTED; @@ -2342,15 +2340,14 @@ BOOL WINAPI DllMain( HINSTANCE hinst, DWORD reason, LPVOID reserved ) { case DLL_PROCESS_ATTACH: DisableThreadLibraryCalls( hinst ); - if (!NtQueryVirtualMemory( GetCurrentProcess(), hinst, MemoryWineUnixFuncs, - &bcrypt_handle, sizeof(bcrypt_handle), NULL )) + if (!__wine_init_unix_call()) { - if (UNIX_CALL( process_attach, NULL)) bcrypt_handle = 0; + if (UNIX_CALL( process_attach, NULL)) __wine_unixlib_handle = 0; } break; case DLL_PROCESS_DETACH: if (reserved) break; - if (bcrypt_handle) UNIX_CALL( process_detach, NULL ); + if (__wine_unixlib_handle) UNIX_CALL( process_detach, NULL ); break; } return TRUE;
1
0
0
0
Ivo Ivanov : windows.gaming.input: Assume that joysticks with single FFB axis are racing wheels.
by Alexandre Julliard
25 Nov '22
25 Nov '22
Module: wine Branch: master Commit: 496f7c61348825d735e10878d04c190cc92b8729 URL:
https://gitlab.winehq.org/wine/wine/-/commit/496f7c61348825d735e10878d04c19…
Author: Ivo Ivanov <logos128(a)gmail.com> Date: Sun Jul 17 18:02:41 2022 +0300 windows.gaming.input: Assume that joysticks with single FFB axis are racing wheels. The HID PID steering wheels always declare one force feedback axis, while the joysticks always have two or more. So it is safe to assume that joysticks with single FFB axis are racing wheels. Fixes FH5 not having force feedback with a Simucube 2 steering wheel, when using the hidraw backend. --- dlls/windows.gaming.input/provider.c | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/dlls/windows.gaming.input/provider.c b/dlls/windows.gaming.input/provider.c index 39229a35c7d..6908d733a53 100644 --- a/dlls/windows.gaming.input/provider.c +++ b/dlls/windows.gaming.input/provider.c @@ -141,6 +141,13 @@ static HRESULT WINAPI wine_provider_GetTrustLevel( IWineGameControllerProvider * return E_NOTIMPL; } +static BOOL CALLBACK count_ffb_axes( const DIDEVICEOBJECTINSTANCEW *obj, void *args ) +{ + DWORD *count = args; + if (obj->dwType & DIDFT_FFACTUATOR) (*count)++; + return DIENUM_CONTINUE; +} + static HRESULT WINAPI wine_provider_get_Type( IWineGameControllerProvider *iface, WineGameControllerType *value ) { struct provider *impl = impl_from_IWineGameControllerProvider( iface ); @@ -155,7 +162,14 @@ static HRESULT WINAPI wine_provider_get_Type( IWineGameControllerProvider *iface { case DI8DEVTYPE_DRIVING: *value = WineGameControllerType_RacingWheel; break; case DI8DEVTYPE_GAMEPAD: *value = WineGameControllerType_Gamepad; break; - default: *value = WineGameControllerType_Joystick; break; + default: + { + DWORD count = 0; + hr = IDirectInputDevice8_EnumObjects( impl->dinput_device, count_ffb_axes, &count, DIDFT_AXIS ); + if (SUCCEEDED(hr) && count == 1) *value = WineGameControllerType_RacingWheel; + else *value = WineGameControllerType_Joystick; + break; + } } return S_OK;
1
0
0
0
Ivo Ivanov : windows.gaming.input: Implement the number of FFB axes according to the SupportedAxes property.
by Alexandre Julliard
25 Nov '22
25 Nov '22
Module: wine Branch: master Commit: a1ce348c9512a5be108dfc9596a160e991b65c61 URL:
https://gitlab.winehq.org/wine/wine/-/commit/a1ce348c9512a5be108dfc9596a160…
Author: Ivo Ivanov <logos128(a)gmail.com> Date: Sat Jul 23 16:54:13 2022 +0300 windows.gaming.input: Implement the number of FFB axes according to the SupportedAxes property. --- dlls/windows.gaming.input/force_feedback.c | 62 +++++++++++++++++++++++------- 1 file changed, 48 insertions(+), 14 deletions(-) diff --git a/dlls/windows.gaming.input/force_feedback.c b/dlls/windows.gaming.input/force_feedback.c index f24f0627d6f..f7a233b46d4 100644 --- a/dlls/windows.gaming.input/force_feedback.c +++ b/dlls/windows.gaming.input/force_feedback.c @@ -113,6 +113,7 @@ static HRESULT WINAPI effect_impl_put_Parameters( IWineForceFeedbackEffectImpl * WineForceFeedbackEffectEnvelope *envelope ) { struct effect *impl = impl_from_IWineForceFeedbackEffectImpl( iface ); + DWORD count = 0; HRESULT hr; TRACE( "iface %p, params %p, envelope %p.\n", iface, ¶ms, envelope ); @@ -125,9 +126,9 @@ static HRESULT WINAPI effect_impl_put_Parameters( IWineForceFeedbackEffectImpl * impl->constant_force.lMagnitude = round( params.constant.gain * params.constant.direction.X * 10000 ); impl->params.dwDuration = params.constant.duration.Duration / 10; impl->params.dwStartDelay = params.constant.start_delay.Duration / 10; - impl->directions[0] = round( -params.constant.direction.X * 10000 ); - impl->directions[1] = round( -params.constant.direction.Y * 10000 ); - impl->directions[2] = round( -params.constant.direction.Z * 10000 ); + if (impl->axes[count] == DIJOFS_X) impl->directions[count++] = round( -params.constant.direction.X * 10000 ); + if (impl->axes[count] == DIJOFS_Y) impl->directions[count++] = round( -params.constant.direction.Y * 10000 ); + if (impl->axes[count] == DIJOFS_Z) impl->directions[count++] = round( -params.constant.direction.Z * 10000 ); break; case WineForceFeedbackEffectType_Ramp: @@ -136,9 +137,9 @@ static HRESULT WINAPI effect_impl_put_Parameters( IWineForceFeedbackEffectImpl * impl->ramp_force.lEnd = round( params.ramp.gain * params.ramp.end_vector.X * 10000 ); impl->params.dwDuration = params.ramp.duration.Duration / 10; impl->params.dwStartDelay = params.ramp.start_delay.Duration / 10; - impl->directions[0] = round( -params.ramp.start_vector.X * 10000 ); - impl->directions[1] = round( -params.ramp.start_vector.Y * 10000 ); - impl->directions[2] = round( -params.ramp.start_vector.Z * 10000 ); + if (impl->axes[count] == DIJOFS_X) impl->directions[count++] = round( -params.ramp.start_vector.X * 10000 ); + if (impl->axes[count] == DIJOFS_Y) impl->directions[count++] = round( -params.ramp.start_vector.Y * 10000 ); + if (impl->axes[count] == DIJOFS_Z) impl->directions[count++] = round( -params.ramp.start_vector.Z * 10000 ); break; case WineForceFeedbackEffectType_Periodic_SineWave: @@ -153,9 +154,9 @@ static HRESULT WINAPI effect_impl_put_Parameters( IWineForceFeedbackEffectImpl * impl->periodic.lOffset = round( params.periodic.bias * 10000 ); impl->params.dwDuration = params.periodic.duration.Duration / 10; impl->params.dwStartDelay = params.periodic.start_delay.Duration / 10; - impl->directions[0] = round( -params.periodic.direction.X * 10000 ); - impl->directions[1] = round( -params.periodic.direction.Y * 10000 ); - impl->directions[2] = round( -params.periodic.direction.Z * 10000 ); + if (impl->axes[count] == DIJOFS_X) impl->directions[count++] = round( -params.periodic.direction.X * 10000 ); + if (impl->axes[count] == DIJOFS_Y) impl->directions[count++] = round( -params.periodic.direction.Y * 10000 ); + if (impl->axes[count] == DIJOFS_Z) impl->directions[count++] = round( -params.periodic.direction.Z * 10000 ); break; case WineForceFeedbackEffectType_Condition_Spring: @@ -171,9 +172,9 @@ static HRESULT WINAPI effect_impl_put_Parameters( IWineForceFeedbackEffectImpl * impl->condition.lOffset = round( params.condition.bias * 10000 ); impl->params.dwDuration = -1; impl->params.dwStartDelay = 0; - impl->directions[0] = round( params.condition.direction.X * 10000 ); - impl->directions[1] = round( params.condition.direction.Y * 10000 ); - impl->directions[2] = round( params.condition.direction.Z * 10000 ); + if (impl->axes[count] == DIJOFS_X) impl->directions[count++] = round( params.condition.direction.X * 10000 ); + if (impl->axes[count] == DIJOFS_Y) impl->directions[count++] = round( params.condition.direction.Y * 10000 ); + if (impl->axes[count] == DIJOFS_Z) impl->directions[count++] = round( params.condition.direction.Z * 10000 ); break; } @@ -374,7 +375,7 @@ HRESULT force_feedback_effect_create( enum WineForceFeedbackEffectType type, IIn impl->params.dwTriggerButton = -1; impl->params.dwGain = 10000; impl->params.dwFlags = DIEFF_CARTESIAN|DIEFF_OBJECTOFFSETS; - impl->params.cAxes = 2; + impl->params.cAxes = -1; impl->axes[0] = DIJOFS_X; impl->axes[1] = DIJOFS_Y; impl->axes[2] = DIJOFS_Z; @@ -563,11 +564,43 @@ static HRESULT WINAPI motor_get_SupportedAxes( IForceFeedbackMotor *iface, enum static HRESULT WINAPI motor_load_effect_async( IUnknown *invoker, IUnknown *param, PROPVARIANT *result ) { struct effect *effect = impl_from_IForceFeedbackEffect( (IForceFeedbackEffect *)param ); - struct motor *impl = impl_from_IForceFeedbackMotor( (IForceFeedbackMotor *)invoker ); + IForceFeedbackMotor *motor = (IForceFeedbackMotor *)invoker; + struct motor *impl = impl_from_IForceFeedbackMotor( motor ); + ForceFeedbackEffectAxes supported_axes = 0; IDirectInputEffect *dinput_effect; HRESULT hr; EnterCriticalSection( &effect->cs ); + + if (FAILED(hr = IForceFeedbackMotor_get_SupportedAxes( motor, &supported_axes ))) + { + WARN( "get_SupportedAxes for motor %p returned %#lx\n", motor, hr ); + effect->params.cAxes = 0; + } + else if (effect->params.cAxes == -1) + { + DWORD count = 0; + + /* initialize axis mapping and re-map directions that were set with the initial mapping */ + if (supported_axes & ForceFeedbackEffectAxes_X) + { + effect->directions[count] = effect->directions[0]; + effect->axes[count++] = DIJOFS_X; + } + if (supported_axes & ForceFeedbackEffectAxes_Y) + { + effect->directions[count] = effect->directions[1]; + effect->axes[count++] = DIJOFS_Y; + } + if (supported_axes & ForceFeedbackEffectAxes_Z) + { + effect->directions[count] = effect->directions[2]; + effect->axes[count++] = DIJOFS_Z; + } + + effect->params.cAxes = count; + } + if (SUCCEEDED(hr = IDirectInputDevice8_CreateEffect( impl->device, &effect->type, &effect->params, &dinput_effect, NULL ))) { @@ -575,6 +608,7 @@ static HRESULT WINAPI motor_load_effect_async( IUnknown *invoker, IUnknown *para effect->effect = dinput_effect; IDirectInputEffect_AddRef( effect->effect ); } + LeaveCriticalSection( &effect->cs ); result->vt = VT_UI4;
1
0
0
0
Ivo Ivanov : dinput/tests: Reduce the available FFB axes to X and Y in test_windows_gaming_input.
by Alexandre Julliard
25 Nov '22
25 Nov '22
Module: wine Branch: master Commit: c8217873383a7f9b09efd84b6d448f4132953e47 URL:
https://gitlab.winehq.org/wine/wine/-/commit/c8217873383a7f9b09efd84b6d448f…
Author: Ivo Ivanov <logos128(a)gmail.com> Date: Tue Aug 9 14:49:07 2022 +0300 dinput/tests: Reduce the available FFB axes to X and Y in test_windows_gaming_input. Windows.Gaming.Input on Windows always uses the X and Y axes for FFB, ignoring what is declared in the HID report descriptor, and the Axes Enable collection. Since we have the correct behavior on Wine, this allows the test to complete on both platforms without issues. --- dlls/dinput/tests/force_feedback.c | 22 ++++++++++++++-------- 1 file changed, 14 insertions(+), 8 deletions(-) diff --git a/dlls/dinput/tests/force_feedback.c b/dlls/dinput/tests/force_feedback.c index d743f959f55..b841e4bb8c7 100644 --- a/dlls/dinput/tests/force_feedback.c +++ b/dlls/dinput/tests/force_feedback.c @@ -4967,19 +4967,18 @@ static void test_windows_gaming_input(void) COLLECTION(1, Logical), USAGE(4, (HID_USAGE_PAGE_GENERIC << 16)|HID_USAGE_GENERIC_X), USAGE(4, (HID_USAGE_PAGE_GENERIC << 16)|HID_USAGE_GENERIC_Y), - USAGE(4, (HID_USAGE_PAGE_GENERIC << 16)|HID_USAGE_GENERIC_Z), LOGICAL_MINIMUM(1, 0), LOGICAL_MAXIMUM(1, 1), PHYSICAL_MINIMUM(1, 0), PHYSICAL_MAXIMUM(1, 1), REPORT_SIZE(1, 1), - REPORT_COUNT(1, 3), + REPORT_COUNT(1, 2), OUTPUT(1, Data|Var|Abs), END_COLLECTION, USAGE(1, PID_USAGE_DIRECTION_ENABLE), REPORT_COUNT(1, 1), OUTPUT(1, Data|Var|Abs), - REPORT_COUNT(1, 4), + REPORT_COUNT(1, 5), OUTPUT(1, Cnst|Var|Abs), USAGE(1, PID_USAGE_DURATION), @@ -5566,7 +5565,7 @@ static void test_windows_gaming_input(void) .code = IOCTL_HID_WRITE_REPORT, .report_id = 3, .report_len = 18, - .report_buf = {3,0x01,0x02,0x08,0x78,0x00,0x00,0x00,0x00,0x00,0x0a,0x00,0xff,0xff,0x4e,0x01,0x00,0x00}, + .report_buf = {3,0x01,0x02,0x04,0x78,0x00,0x00,0x00,0x00,0x00,0x0a,0x00,0xff,0xff,0x4e,0x01,0x00,0x00}, }, }; struct hid_expect expect_create_condition[] = @@ -5597,7 +5596,7 @@ static void test_windows_gaming_input(void) .code = IOCTL_HID_WRITE_REPORT, .report_id = 3, .report_len = 18, - .report_buf = {3,0x01,0x03,0x08,0xff,0xff,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0x99,0x00,0x00,0x00}, + .report_buf = {3,0x01,0x03,0x04,0xff,0xff,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0x99,0x00,0x00,0x00}, }, }; struct hid_expect expect_create_constant[] = @@ -5635,7 +5634,7 @@ static void test_windows_gaming_input(void) .code = IOCTL_HID_WRITE_REPORT, .report_id = 3, .report_len = 18, - .report_buf = {3,0x01,0x04,0x08,0x5a,0x00,0x00,0x00,0x00,0x00,0x0a,0x00,0xff,0x7f,0x4e,0x01,0x00,0x00}, + .report_buf = {3,0x01,0x04,0x04,0x5a,0x00,0x00,0x00,0x00,0x00,0x0a,0x00,0xff,0x7f,0x4e,0x01,0x00,0x00}, }, }; struct hid_expect expect_create_ramp[] = @@ -5673,7 +5672,7 @@ static void test_windows_gaming_input(void) .code = IOCTL_HID_WRITE_REPORT, .report_id = 3, .report_len = 18, - .report_buf = {3,0x01,0x05,0x08,0x5a,0x00,0x00,0x00,0x00,0x00,0x0a,0x00,0xff,0xff,0x4e,0x01,0x00,0x00}, + .report_buf = {3,0x01,0x05,0x04,0x5a,0x00,0x00,0x00,0x00,0x00,0x0a,0x00,0xff,0xff,0x4e,0x01,0x00,0x00}, }, }; struct hid_expect expect_effect_start = @@ -5864,7 +5863,7 @@ static void test_windows_gaming_input(void) supported_axes = 0xdeadbeef; hr = IForceFeedbackMotor_get_SupportedAxes( motor, &supported_axes ); ok( hr == S_OK, "get_SupportedAxes returned %#lx\n", hr ); - axes = ForceFeedbackEffectAxes_X | ForceFeedbackEffectAxes_Y | ForceFeedbackEffectAxes_Z; + axes = ForceFeedbackEffectAxes_X | ForceFeedbackEffectAxes_Y; ok( supported_axes == axes || broken( supported_axes == ForceFeedbackEffectAxes_X ), "got axes %#x\n", supported_axes ); @@ -6170,6 +6169,13 @@ static void test_windows_gaming_input(void) ok( hr == S_OK, "SetParametersWithEnvelope returned %#lx\n", hr ); IPeriodicForceEffect_Release( periodic_effect ); + /* Windows.Gaming.Input always uses the X and Y directions on Windows, + * ignoring what is declared in the Axes Enable collection at the + * Set Effects report, or even the existence of the axes in the HID + * report. It ignores the Z direction, at least on HID PID devices. + * DirectInput works properly in such cases on Windows. + */ + set_hid_expect( file, expect_create_periodic, sizeof(expect_create_periodic) ); hr = IForceFeedbackMotor_LoadEffectAsync( motor, effect, &result_async ); ok( hr == S_OK, "LoadEffectAsync returned %#lx\n", hr );
1
0
0
0
Rémi Bernon : windows.gaming.input: Set initial effect parameters within the CS.
by Alexandre Julliard
25 Nov '22
25 Nov '22
Module: wine Branch: master Commit: 9f48f4d580f5c7b7ffb8cf41dcab7198fc557bf8 URL:
https://gitlab.winehq.org/wine/wine/-/commit/9f48f4d580f5c7b7ffb8cf41dcab71…
Author: Rémi Bernon <rbernon(a)codeweavers.com> Date: Thu Nov 24 12:29:14 2022 +0100 windows.gaming.input: Set initial effect parameters within the CS. --- dlls/windows.gaming.input/force_feedback.c | 16 +++++++--------- 1 file changed, 7 insertions(+), 9 deletions(-) diff --git a/dlls/windows.gaming.input/force_feedback.c b/dlls/windows.gaming.input/force_feedback.c index e32e6fea9b4..f24f0627d6f 100644 --- a/dlls/windows.gaming.input/force_feedback.c +++ b/dlls/windows.gaming.input/force_feedback.c @@ -567,17 +567,15 @@ static HRESULT WINAPI motor_load_effect_async( IUnknown *invoker, IUnknown *para IDirectInputEffect *dinput_effect; HRESULT hr; - if (SUCCEEDED(hr = IDirectInputDevice8_CreateEffect( impl->device, &effect->type, &effect->params, &dinput_effect, NULL ))) + EnterCriticalSection( &effect->cs ); + if (SUCCEEDED(hr = IDirectInputDevice8_CreateEffect( impl->device, &effect->type, &effect->params, + &dinput_effect, NULL ))) { - EnterCriticalSection( &effect->cs ); - if (!effect->effect) - { - effect->effect = dinput_effect; - IDirectInputEffect_AddRef( effect->effect ); - } - LeaveCriticalSection( &effect->cs ); - IDirectInputEffect_Release( dinput_effect ); + if (effect->effect) IDirectInputEffect_Release( effect->effect ); + effect->effect = dinput_effect; + IDirectInputEffect_AddRef( effect->effect ); } + LeaveCriticalSection( &effect->cs ); result->vt = VT_UI4; if (SUCCEEDED(hr)) result->ulVal = ForceFeedbackLoadEffectResult_Succeeded;
1
0
0
0
Ivo Ivanov : windows.gaming.input: Implement IForceFeedbackMotor_get_SupportedAxes.
by Alexandre Julliard
25 Nov '22
25 Nov '22
Module: wine Branch: master Commit: 5f8f6c34526a406a72516b1c3e3bd53623f2260b URL:
https://gitlab.winehq.org/wine/wine/-/commit/5f8f6c34526a406a72516b1c3e3bd5…
Author: Ivo Ivanov <logos128(a)gmail.com> Date: Sat Jul 23 16:48:37 2022 +0300 windows.gaming.input: Implement IForceFeedbackMotor_get_SupportedAxes. --- dlls/dinput/tests/force_feedback.c | 13 +++++++++---- dlls/windows.gaming.input/force_feedback.c | 26 ++++++++++++++++++++++++-- 2 files changed, 33 insertions(+), 6 deletions(-) diff --git a/dlls/dinput/tests/force_feedback.c b/dlls/dinput/tests/force_feedback.c index de7d5990f34..d743f959f55 100644 --- a/dlls/dinput/tests/force_feedback.c +++ b/dlls/dinput/tests/force_feedback.c @@ -5735,10 +5735,10 @@ static void test_windows_gaming_input(void) EventRegistrationToken controller_added_token; IPeriodicForceEffectFactory *periodic_factory; struct bool_async_handler bool_async_handler; + ForceFeedbackEffectAxes supported_axes, axes; IVectorView_ForceFeedbackMotor *motors_view; IConditionForceEffect *condition_effect; ConditionForceEffectKind condition_kind; - ForceFeedbackEffectAxes supported_axes; IActivationFactory *activation_factory; IPeriodicForceEffect *periodic_effect; IConstantForceEffect *constant_effect; @@ -5856,12 +5856,17 @@ static void test_windows_gaming_input(void) ok( hr == S_OK, "get_IsEnabled returned %#lx\n", hr ); ok( enabled == TRUE, "got enabled %u\n", enabled ); + /* SupportedAxes always returns ForceFeedbackEffectAxes_X on Windows, + * no matter which axis is available for FFB in the Set Effects report, + * or whether a X axis is declared at all. + */ + supported_axes = 0xdeadbeef; hr = IForceFeedbackMotor_get_SupportedAxes( motor, &supported_axes ); - todo_wine ok( hr == S_OK, "get_SupportedAxes returned %#lx\n", hr ); - todo_wine - ok( supported_axes == ForceFeedbackEffectAxes_X, "got axes %#x\n", supported_axes ); + axes = ForceFeedbackEffectAxes_X | ForceFeedbackEffectAxes_Y | ForceFeedbackEffectAxes_Z; + ok( supported_axes == axes || broken( supported_axes == ForceFeedbackEffectAxes_X ), + "got axes %#x\n", supported_axes ); set_hid_expect( file, &expect_pause, sizeof(expect_pause) ); hr = IForceFeedbackMotor_PauseAllEffects( motor ); diff --git a/dlls/windows.gaming.input/force_feedback.c b/dlls/windows.gaming.input/force_feedback.c index 198268eac24..e32e6fea9b4 100644 --- a/dlls/windows.gaming.input/force_feedback.c +++ b/dlls/windows.gaming.input/force_feedback.c @@ -532,10 +532,32 @@ static HRESULT WINAPI motor_get_IsEnabled( IForceFeedbackMotor *iface, BOOLEAN * return hr; } +static BOOL CALLBACK check_ffb_axes( const DIDEVICEOBJECTINSTANCEW *obj, void *args ) +{ + ForceFeedbackEffectAxes *value = args; + + if (obj->dwType & DIDFT_FFACTUATOR) + { + if (IsEqualIID( &obj->guidType, &GUID_XAxis )) *value |= ForceFeedbackEffectAxes_X; + else if (IsEqualIID( &obj->guidType, &GUID_YAxis )) *value |= ForceFeedbackEffectAxes_Y; + else if (IsEqualIID( &obj->guidType, &GUID_ZAxis )) *value |= ForceFeedbackEffectAxes_Z; + } + + return DIENUM_CONTINUE; +} + static HRESULT WINAPI motor_get_SupportedAxes( IForceFeedbackMotor *iface, enum ForceFeedbackEffectAxes *value ) { - FIXME( "iface %p, value %p stub!\n", iface, value ); - return E_NOTIMPL; + struct motor *impl = impl_from_IForceFeedbackMotor( iface ); + HRESULT hr; + + TRACE( "iface %p, value %p.\n", iface, value ); + + *value = ForceFeedbackEffectAxes_None; + if (FAILED(hr = IDirectInputDevice8_EnumObjects( impl->device, check_ffb_axes, value, DIDFT_AXIS ))) + *value = ForceFeedbackEffectAxes_None; + + return hr; } static HRESULT WINAPI motor_load_effect_async( IUnknown *invoker, IUnknown *param, PROPVARIANT *result )
1
0
0
0
Ivo Ivanov : dinput: Always send both "Type Specific" and "Set Effect" reports on initial Download.
by Alexandre Julliard
25 Nov '22
25 Nov '22
Module: wine Branch: master Commit: cd75ed18007d8545cc2cb01463e38e2ef7da7c4b URL:
https://gitlab.winehq.org/wine/wine/-/commit/cd75ed18007d8545cc2cb01463e38e…
Author: Ivo Ivanov <logos128(a)gmail.com> Date: Tue Jul 26 13:22:17 2022 +0300 dinput: Always send both "Type Specific" and "Set Effect" reports on initial Download. Fixes the Download method not sending an initial type specific HID PID report in the rare cases where all type specific params are set to 0 through the initial SetParameters call, so they aren't considered as modified. FH5 is affected by this issue, since it initially sets the direction of its constant effect to 0, which translates to 0 magnitude in dinput. --- dlls/dinput/joystick_hid.c | 4 +++- dlls/dinput/tests/force_feedback.c | 3 --- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/dlls/dinput/joystick_hid.c b/dlls/dinput/joystick_hid.c index 2065fe429eb..311e5903878 100644 --- a/dlls/dinput/joystick_hid.c +++ b/dlls/dinput/joystick_hid.c @@ -2993,6 +2993,7 @@ static HRESULT WINAPI hid_joystick_effect_Download( IDirectInputEffect *iface ) case PID_USAGE_ET_SAWTOOTH_DOWN: case PID_USAGE_ET_CONSTANT_FORCE: case PID_USAGE_ET_RAMP: + if (!(impl->flags & DIEP_ENVELOPE)) break; if (!(impl->modified & DIEP_ENVELOPE)) break; set_parameter_value( impl, impl->set_envelope_buf, set_envelope->attack_level_caps, @@ -3100,7 +3101,7 @@ static HRESULT WINAPI hid_joystick_effect_Unload( IDirectInputEffect *iface ) else hr = DIERR_INPUTLOST; } - impl->modified = impl->flags; + impl->modified = ~0; impl->index = 0; check_empty_force_feedback_state( joystick ); } @@ -3161,6 +3162,7 @@ static HRESULT hid_joystick_create_effect( IDirectInputDevice8W *iface, IDirectI impl->params.rgdwAxes = impl->axes; impl->params.rglDirection = impl->directions; impl->params.dwTriggerButton = -1; + impl->modified = ~0; impl->status = 0; *out = &impl->IDirectInputEffect_iface; diff --git a/dlls/dinput/tests/force_feedback.c b/dlls/dinput/tests/force_feedback.c index d9ae039f681..de7d5990f34 100644 --- a/dlls/dinput/tests/force_feedback.c +++ b/dlls/dinput/tests/force_feedback.c @@ -367,7 +367,6 @@ static void test_periodic_effect( IDirectInputDevice8W *device, HANDLE file, DWO .report_id = 5, .report_len = 2, .report_buf = {0x05,0x00}, - .todo = TRUE, }, /* set envelope */ { @@ -375,7 +374,6 @@ static void test_periodic_effect( IDirectInputDevice8W *device, HANDLE file, DWO .report_id = 6, .report_len = 7, .report_buf = {0x06,0x00,0x00,0x00,0x00,0x00,0x00}, - .todo = TRUE, }, /* update effect */ { @@ -393,7 +391,6 @@ static void test_periodic_effect( IDirectInputDevice8W *device, HANDLE file, DWO .report_id = 5, .report_len = 2, .report_buf = {0x05,0x00}, - .todo = TRUE, }, /* update effect */ {
1
0
0
0
← Newer
1
...
18
19
20
21
22
23
24
...
118
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
118
Results per page:
10
25
50
100
200