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 : gphoto2.ds: Use the Unix call helpers.
by Alexandre Julliard
28 Nov '22
28 Nov '22
Module: wine Branch: master Commit: 0e10e6ab552c6d122e148c65a18d4081b0fbda3c URL:
https://gitlab.winehq.org/wine/wine/-/commit/0e10e6ab552c6d122e148c65a18d40…
Author: Alexandre Julliard <julliard(a)winehq.org> Date: Mon Nov 28 11:40:22 2022 +0100 gphoto2.ds: Use the Unix call helpers. --- dlls/gphoto2.ds/gphoto2_main.c | 4 +--- dlls/gphoto2.ds/unixlib.h | 4 +--- 2 files changed, 2 insertions(+), 6 deletions(-) diff --git a/dlls/gphoto2.ds/gphoto2_main.c b/dlls/gphoto2.ds/gphoto2_main.c index 68c628b4d89..a47fdcc67f4 100644 --- a/dlls/gphoto2.ds/gphoto2_main.c +++ b/dlls/gphoto2.ds/gphoto2_main.c @@ -477,7 +477,6 @@ static TW_UINT16 GPHOTO2_XferGroupSet (pTW_IDENTITY pOrigin, } HINSTANCE GPHOTO2_instance = 0; -unixlib_handle_t gphoto2_handle = 0; BOOL WINAPI DllMain (HINSTANCE hinstDLL, DWORD fdwReason, LPVOID lpvReserved) { @@ -488,8 +487,7 @@ BOOL WINAPI DllMain (HINSTANCE hinstDLL, DWORD fdwReason, LPVOID lpvReserved) case DLL_PROCESS_ATTACH: GPHOTO2_instance = hinstDLL; DisableThreadLibraryCalls(hinstDLL); - NtQueryVirtualMemory( GetCurrentProcess(), hinstDLL, MemoryWineUnixFuncs, - &gphoto2_handle, sizeof(gphoto2_handle), NULL ); + __wine_init_unix_call(); break; } diff --git a/dlls/gphoto2.ds/unixlib.h b/dlls/gphoto2.ds/unixlib.h index bc2f086694e..0e8ea87f93e 100644 --- a/dlls/gphoto2.ds/unixlib.h +++ b/dlls/gphoto2.ds/unixlib.h @@ -71,6 +71,4 @@ enum gphoto2_funcs unix_close_file, }; -extern unixlib_handle_t gphoto2_handle DECLSPEC_HIDDEN; - -#define GPHOTO2_CALL( func, params ) __wine_unix_call( gphoto2_handle, unix_ ## func, params ) +#define GPHOTO2_CALL( func, params ) WINE_UNIX_CALL( unix_ ## func, params )
1
0
0
0
Alexandre Julliard : dnsapi: Use the Unix call helpers.
by Alexandre Julliard
28 Nov '22
28 Nov '22
Module: wine Branch: master Commit: a62d3ab841c21561e0ab1f860b2c592934520cca URL:
https://gitlab.winehq.org/wine/wine/-/commit/a62d3ab841c21561e0ab1f860b2c59…
Author: Alexandre Julliard <julliard(a)winehq.org> Date: Mon Nov 28 11:40:07 2022 +0100 dnsapi: Use the Unix call helpers. --- dlls/dnsapi/dnsapi.h | 4 +--- dlls/dnsapi/main.c | 5 +---- 2 files changed, 2 insertions(+), 7 deletions(-) diff --git a/dlls/dnsapi/dnsapi.h b/dlls/dnsapi/dnsapi.h index 250b0a1b4c3..89324dd9c29 100644 --- a/dlls/dnsapi/dnsapi.h +++ b/dlls/dnsapi/dnsapi.h @@ -129,6 +129,4 @@ enum unix_funcs unix_query, }; -extern unixlib_handle_t resolv_handle; - -#define RESOLV_CALL( func, params ) __wine_unix_call( resolv_handle, unix_ ## func, params ) +#define RESOLV_CALL( func, params ) WINE_UNIX_CALL( unix_ ## func, params ) diff --git a/dlls/dnsapi/main.c b/dlls/dnsapi/main.c index 23738bf36fe..6324d46e173 100644 --- a/dlls/dnsapi/main.c +++ b/dlls/dnsapi/main.c @@ -32,8 +32,6 @@ WINE_DEFAULT_DEBUG_CHANNEL(dnsapi); -unixlib_handle_t resolv_handle = 0; - BOOL WINAPI DllMain( HINSTANCE hinst, DWORD reason, LPVOID reserved ) { TRACE( "(%p, %lu, %p)\n", hinst, reason, reserved ); @@ -42,8 +40,7 @@ BOOL WINAPI DllMain( HINSTANCE hinst, DWORD reason, LPVOID reserved ) { case DLL_PROCESS_ATTACH: DisableThreadLibraryCalls( hinst ); - if (NtQueryVirtualMemory( GetCurrentProcess(), hinst, MemoryWineUnixFuncs, - &resolv_handle, sizeof(resolv_handle), NULL )) + if (__wine_init_unix_call()) ERR( "No libresolv support, expect problems\n" ); break; case DLL_PROCESS_DETACH:
1
0
0
0
Alexandre Julliard : ctapi32: Use the Unix call helpers.
by Alexandre Julliard
28 Nov '22
28 Nov '22
Module: wine Branch: master Commit: 81493d0f8c5e1c38b96481e0af31f168d46f6e91 URL:
https://gitlab.winehq.org/wine/wine/-/commit/81493d0f8c5e1c38b96481e0af31f1…
Author: Alexandre Julliard <julliard(a)winehq.org> Date: Mon Nov 28 11:39:45 2022 +0100 ctapi32: Use the Unix call helpers. --- dlls/ctapi32/ctapi32.c | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/dlls/ctapi32/ctapi32.c b/dlls/ctapi32/ctapi32.c index 0f0ee399e1c..64ae904ff41 100644 --- a/dlls/ctapi32/ctapi32.c +++ b/dlls/ctapi32/ctapi32.c @@ -32,9 +32,7 @@ WINE_DEFAULT_DEBUG_CHANNEL(ctapi32); #define FALLBACK_LIBCTAPI "libctapi.so" -static unixlib_handle_t ctapi_handle; - -#define CTAPI_CALL( func, params ) __wine_unix_call( ctapi_handle, unix_ ## func, params ) +#define CTAPI_CALL( func, params ) WINE_UNIX_CALL( unix_ ## func, params ) static BOOL load_functions(void) { @@ -104,8 +102,7 @@ BOOL WINAPI DllMain (HINSTANCE hinstDLL, DWORD fdwReason, LPVOID lpvReserved) { case DLL_PROCESS_ATTACH: DisableThreadLibraryCalls(hinstDLL); - if (NtQueryVirtualMemory( GetCurrentProcess(), hinstDLL, MemoryWineUnixFuncs, - &ctapi_handle, sizeof(ctapi_handle), NULL )) + if (__wine_init_unix_call()) return FALSE; if (!load_functions()) return FALSE;
1
0
0
0
Alexandre Julliard : capi2032: Use the Unix call helpers.
by Alexandre Julliard
28 Nov '22
28 Nov '22
Module: wine Branch: master Commit: 6677255d665e83b4f8d67f019232ef5ecac8e15f URL:
https://gitlab.winehq.org/wine/wine/-/commit/6677255d665e83b4f8d67f019232ef…
Author: Alexandre Julliard <julliard(a)winehq.org> Date: Mon Nov 28 11:39:33 2022 +0100 capi2032: Use the Unix call helpers. --- dlls/capi2032/cap20wxx.c | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/dlls/capi2032/cap20wxx.c b/dlls/capi2032/cap20wxx.c index 96007f51e96..c8c008d7c5f 100644 --- a/dlls/capi2032/cap20wxx.c +++ b/dlls/capi2032/cap20wxx.c @@ -29,9 +29,7 @@ WINE_DEFAULT_DEBUG_CHANNEL(capi); -static unixlib_handle_t capi_handle; - -#define CAPI_CALL( func, params ) __wine_unix_call( capi_handle, unix_ ## func, params ) +#define CAPI_CALL( func, params ) WINE_UNIX_CALL( unix_ ## func, params ) BOOL WINAPI DllMain( HINSTANCE instance, DWORD reason, LPVOID reserved ) @@ -40,8 +38,7 @@ BOOL WINAPI DllMain( HINSTANCE instance, DWORD reason, LPVOID reserved ) { case DLL_PROCESS_ATTACH: DisableThreadLibraryCalls( instance ); - return !NtQueryVirtualMemory( GetCurrentProcess(), instance, MemoryWineUnixFuncs, - &capi_handle, sizeof(capi_handle), NULL ); + return !__wine_init_unix_call(); } return TRUE; }
1
0
0
0
Alexandre Julliard : avicap32: Use the Unix call helpers.
by Alexandre Julliard
28 Nov '22
28 Nov '22
Module: wine Branch: master Commit: 414304658e5183d1dcea89e3728908625bef40f8 URL:
https://gitlab.winehq.org/wine/wine/-/commit/414304658e5183d1dcea89e3728908…
Author: Alexandre Julliard <julliard(a)winehq.org> Date: Mon Nov 28 11:39:16 2022 +0100 avicap32: Use the Unix call helpers. --- dlls/avicap32/avicap32_main.c | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/dlls/avicap32/avicap32_main.c b/dlls/avicap32/avicap32_main.c index 1a1c514e931..641e3896027 100644 --- a/dlls/avicap32/avicap32_main.c +++ b/dlls/avicap32/avicap32_main.c @@ -31,7 +31,6 @@ WINE_DEFAULT_DEBUG_CHANNEL(avicap); static HINSTANCE avicap_instance; -static unixlib_handle_t unix_handle; static const WCHAR class_name[] = L"wine_avicap_class"; @@ -125,8 +124,7 @@ BOOL VFWAPI capGetDriverDescriptionW(WORD index, WCHAR *name, int name_len, WCHA struct get_device_desc_params params; params.index = index; - if (!unix_handle || __wine_unix_call(unix_handle, unix_get_device_desc, ¶ms)) - return FALSE; + if (WINE_UNIX_CALL(unix_get_device_desc, ¶ms)) return FALSE; TRACE("Found device name %s, version %s.\n", debugstr_w(params.name), debugstr_w(params.version)); lstrcpynW(name, params.name, name_len); @@ -139,9 +137,8 @@ BOOL WINAPI DllMain(HINSTANCE instance, DWORD reason, void *reserved) switch (reason) { case DLL_PROCESS_ATTACH: - NtQueryVirtualMemory(GetCurrentProcess(), instance, - MemoryWineUnixFuncs, &unix_handle, sizeof(unix_handle), NULL); DisableThreadLibraryCalls(instance); + __wine_init_unix_call(); register_class(); avicap_instance = instance; break;
1
0
0
0
Alex Henrie : wldap32: Use the strdup function instead of reimplementing it.
by Alexandre Julliard
28 Nov '22
28 Nov '22
Module: wine Branch: master Commit: b072bb494b31c5dbfde6039716bb1ce278f0da37 URL:
https://gitlab.winehq.org/wine/wine/-/commit/b072bb494b31c5dbfde6039716bb1c…
Author: Alex Henrie <alexhenrie24(a)gmail.com> Date: Sun Nov 27 17:02:03 2022 -0700 wldap32: Use the strdup function instead of reimplementing it. --- dlls/wldap32/ber.c | 2 +- dlls/wldap32/control.c | 2 +- dlls/wldap32/init.c | 6 +++--- dlls/wldap32/winldap_private.h | 10 +--------- 4 files changed, 6 insertions(+), 14 deletions(-) diff --git a/dlls/wldap32/ber.c b/dlls/wldap32/ber.c index 07013ad35ae..d3e8adc8433 100644 --- a/dlls/wldap32/ber.c +++ b/dlls/wldap32/ber.c @@ -266,7 +266,7 @@ ULONG WINAPIV WLDAP32_ber_scanf( WLDAP32_BerElement *ber, char *fmt, ... ) { char *str, **ptr = va_arg( list, char ** ); if ((ret = ber_scanf( BER(ber), new_fmt, &str )) == -1) break; - *ptr = strdupU( str ); + *ptr = strdup( str ); ldap_memfree( str ); break; } diff --git a/dlls/wldap32/control.c b/dlls/wldap32/control.c index ba1cefe9a45..131ea4dad64 100644 --- a/dlls/wldap32/control.c +++ b/dlls/wldap32/control.c @@ -197,7 +197,7 @@ ULONG CDECL ldap_encode_sort_controlA( LDAP *ld, LDAPSortKeyA **sortkeys, LDAPCo if ((result = ldap_create_sort_controlA( ld, sortkeys, critical, &control )) == WLDAP32_LDAP_SUCCESS) { - ret->ldctl_oid = strdupU(control->ldctl_oid); + ret->ldctl_oid = strdup( control->ldctl_oid ); bv_val_dup( &control->ldctl_value, &ret->ldctl_value ); ret->ldctl_iscritical = control->ldctl_iscritical; ldap_control_freeA( control ); diff --git a/dlls/wldap32/init.c b/dlls/wldap32/init.c index 512c558936d..b8010a2da12 100644 --- a/dlls/wldap32/init.c +++ b/dlls/wldap32/init.c @@ -36,7 +36,7 @@ static char **split_hostnames( const char *hostnames ) char **res, *str, *p, *q; unsigned int i = 0; - str = strdupU( hostnames ); + str = strdup( hostnames ); if (!str) return NULL; p = str; @@ -72,7 +72,7 @@ static char **split_hostnames( const char *hostnames ) if (isspace( *p )) { *p = '\0'; p++; - res[i] = strdupU( q ); + res[i] = strdup( q ); if (!res[i]) goto oom; i++; @@ -82,7 +82,7 @@ static char **split_hostnames( const char *hostnames ) } else { - res[i] = strdupU( q ); + res[i] = strdup( q ); if (!res[i]) goto oom; i++; } diff --git a/dlls/wldap32/winldap_private.h b/dlls/wldap32/winldap_private.h index 886c7933e9f..2902daea974 100644 --- a/dlls/wldap32/winldap_private.h +++ b/dlls/wldap32/winldap_private.h @@ -534,14 +534,6 @@ struct WLDAP32_berval ** CDECL ldap_get_values_lenW( LDAP *, LDAPMessage *, WCHA ULONG map_error( int ) DECLSPEC_HIDDEN; -static inline char *strdupU( const char *src ) -{ - char *dst; - if (!src) return NULL; - if ((dst = malloc( strlen( src ) + 1 ))) strcpy( dst, src ); - return dst; -} - static inline char *strWtoU( const WCHAR *str ) { char *ret = NULL; @@ -1314,7 +1306,7 @@ static inline char **strarrayUtoU( char **strarray ) { char **p = strarray, **q = ret; - while (*p) *q++ = strdupU( *p++ ); + while (*p) *q++ = strdup( *p++ ); *q = NULL; } }
1
0
0
0
Rémi Bernon : joy.cpl: Avoid race condition when accessing selected effect.
by Alexandre Julliard
28 Nov '22
28 Nov '22
Module: wine Branch: master Commit: c6cdea71cc7789790917f9f2977cb97878d17c95 URL:
https://gitlab.winehq.org/wine/wine/-/commit/c6cdea71cc7789790917f9f2977cb9…
Author: Rémi Bernon <rbernon(a)codeweavers.com> Date: Sat Nov 26 20:34:56 2022 +0100 joy.cpl: Avoid race condition when accessing selected effect. --- dlls/joy.cpl/main.c | 40 ++++++++++++++++++++++++++++++++++++++-- 1 file changed, 38 insertions(+), 2 deletions(-) diff --git a/dlls/joy.cpl/main.c b/dlls/joy.cpl/main.c index bee38fe3553..ec8299753f1 100644 --- a/dlls/joy.cpl/main.c +++ b/dlls/joy.cpl/main.c @@ -105,6 +105,15 @@ struct JoystickData static HMODULE hcpl; +static CRITICAL_SECTION joy_cs; +static CRITICAL_SECTION_DEBUG joy_cs_debug = +{ + 0, 0, &joy_cs, + { &joy_cs_debug.ProcessLocksList, &joy_cs_debug.ProcessLocksList }, + 0, 0, { (DWORD_PTR)(__FILE__ ": joy_cs") } +}; +static CRITICAL_SECTION joy_cs = { &joy_cs_debug, -1, 0, 0, 0, 0 }; + /********************************************************************* * DllMain */ @@ -213,6 +222,27 @@ static BOOL CALLBACK enum_effects( const DIEFFECTINFOW *info, void *context ) return DIENUM_CONTINUE; } +static void set_selected_effect( struct Joystick *joystick, IDirectInputEffect *effect ) +{ + IDirectInputEffect *previous; + + EnterCriticalSection( &joy_cs ); + if ((previous = joystick->effect_selected)) IDirectInputEffect_Release( previous ); + if ((joystick->effect_selected = effect)) IDirectInput_AddRef( effect ); + LeaveCriticalSection( &joy_cs ); +} + +static IDirectInputEffect *get_selected_effect( struct Joystick *joystick ) +{ + IDirectInputEffect *effect; + + EnterCriticalSection( &joy_cs ); + if ((effect = joystick->effect_selected)) IDirectInputEffect_AddRef( effect ); + LeaveCriticalSection( &joy_cs ); + + return effect; +} + static BOOL CALLBACK enum_callback(const DIDEVICEINSTANCEW *instance, void *context) { DIDEVCAPS caps = {.dwSize = sizeof(DIDEVCAPS)}; @@ -277,6 +307,8 @@ static void destroy_joysticks(struct JoystickData *data) { struct effect *effect, *next_effect; + set_selected_effect( &data->joysticks[i], NULL ); + LIST_FOR_EACH_ENTRY_SAFE( effect, next_effect, &data->joysticks[i].effects, struct effect, entry ) { list_remove( &effect->entry ); @@ -867,6 +899,8 @@ static void ff_handle_effectchange(HWND hwnd, struct Joystick *joy) struct list *entry; int sel; + set_selected_effect( joy, NULL ); + sel = SendDlgItemMessageW(hwnd, IDC_FFEFFECTLIST, LB_GETCURSEL, 0, 0); if (sel < 0) return; @@ -874,7 +908,7 @@ static void ff_handle_effectchange(HWND hwnd, struct Joystick *joy) while (sel-- && entry) entry = list_next( &joy->effects, entry ); if (!entry) return; - joy->effect_selected = LIST_ENTRY( entry, struct effect, entry )->effect; + set_selected_effect( joy, LIST_ENTRY( entry, struct effect, entry )->effect ); IDirectInputDevice8_Unacquire(joy->device); IDirectInputDevice8_SetCooperativeLevel(joy->device, GetAncestor(hwnd, GA_ROOT), DISCL_BACKGROUND|DISCL_EXCLUSIVE); @@ -908,7 +942,7 @@ static DWORD WINAPI ff_input_thread(void *param) Sleep(TEST_POLL_TIME); - if (!(effect = joy->effect_selected)) continue; + if (!(effect = get_selected_effect( joy ))) continue; poll_input(joy, &state); @@ -930,6 +964,8 @@ static DWORD WINAPI ff_input_thread(void *param) IDirectInputEffect_Start( effect, 1, 0 ); break; } + + IDirectInputEffect_Release( effect ); } return 0;
1
0
0
0
Rémi Bernon : joy.cpl: Remove unnecessary joystick forcefeedback member.
by Alexandre Julliard
28 Nov '22
28 Nov '22
Module: wine Branch: master Commit: b274278d0e118f537192c4d8597573fd68e7b2ff URL:
https://gitlab.winehq.org/wine/wine/-/commit/b274278d0e118f537192c4d8597573…
Author: Rémi Bernon <rbernon(a)codeweavers.com> Date: Sat Nov 26 20:49:03 2022 +0100 joy.cpl: Remove unnecessary joystick forcefeedback member. --- dlls/joy.cpl/main.c | 14 +++----------- 1 file changed, 3 insertions(+), 11 deletions(-) diff --git a/dlls/joy.cpl/main.c b/dlls/joy.cpl/main.c index 59e5facb76f..bee38fe3553 100644 --- a/dlls/joy.cpl/main.c +++ b/dlls/joy.cpl/main.c @@ -78,7 +78,6 @@ struct effect struct Joystick { IDirectInputDevice8W *device; - BOOL forcefeedback; struct list effects; IDirectInputEffect *effect_selected; @@ -216,10 +215,10 @@ static BOOL CALLBACK enum_effects( const DIEFFECTINFOW *info, void *context ) static BOOL CALLBACK enum_callback(const DIDEVICEINSTANCEW *instance, void *context) { + DIDEVCAPS caps = {.dwSize = sizeof(DIDEVCAPS)}; struct JoystickData *data = context; struct Joystick *joystick; DIPROPRANGE proprange; - DIDEVCAPS caps; if (data->joysticks == NULL) { @@ -233,15 +232,11 @@ static BOOL CALLBACK enum_callback(const DIDEVICEINSTANCEW *instance, void *cont IDirectInput8_CreateDevice(data->di, &instance->guidInstance, &joystick->device, NULL); IDirectInputDevice8_SetDataFormat(joystick->device, &c_dfDIJoystick); - caps.dwSize = sizeof(caps); - IDirectInputDevice8_GetCapabilities(joystick->device, &caps); - - joystick->forcefeedback = caps.dwFlags & DIDC_FORCEFEEDBACK; - list_init( &joystick->effects ); joystick->effect_selected = NULL; - if (joystick->forcefeedback) data->num_ff++; + IDirectInputDevice8_GetCapabilities(joystick->device, &caps); + if (caps.dwFlags & DIDC_FORCEFEEDBACK) data->num_ff++; /* Set axis range to ease the GUI visualization */ proprange.diph.dwSize = sizeof(DIPROPRANGE); @@ -252,9 +247,6 @@ static BOOL CALLBACK enum_callback(const DIDEVICEINSTANCEW *instance, void *cont proprange.lMax = TEST_AXIS_MAX; IDirectInputDevice_SetProperty(joystick->device, DIPROP_RANGE, &proprange.diph); - - if (!joystick->forcefeedback) return DIENUM_CONTINUE; - IDirectInputDevice8_EnumEffects( joystick->device, enum_effects, (void *)joystick, 0 ); return DIENUM_CONTINUE;
1
0
0
0
Rémi Bernon : joy.cpl: Read the device path property instead of storing it.
by Alexandre Julliard
28 Nov '22
28 Nov '22
Module: wine Branch: master Commit: 9b4cd908505655e7109f7b63b555f2c7a19938ed URL:
https://gitlab.winehq.org/wine/wine/-/commit/9b4cd908505655e7109f7b63b555f2…
Author: Rémi Bernon <rbernon(a)codeweavers.com> Date: Sat Nov 26 20:47:25 2022 +0100 joy.cpl: Read the device path property instead of storing it. --- dlls/joy.cpl/main.c | 28 +++++++++++++--------------- 1 file changed, 13 insertions(+), 15 deletions(-) diff --git a/dlls/joy.cpl/main.c b/dlls/joy.cpl/main.c index d258dee7d01..59e5facb76f 100644 --- a/dlls/joy.cpl/main.c +++ b/dlls/joy.cpl/main.c @@ -79,8 +79,6 @@ struct Joystick { IDirectInputDevice8W *device; BOOL forcefeedback; - BOOL is_xinput; - BOOL has_override; struct list effects; IDirectInputEffect *effect_selected; @@ -218,15 +216,6 @@ static BOOL CALLBACK enum_effects( const DIEFFECTINFOW *info, void *context ) static BOOL CALLBACK enum_callback(const DIDEVICEINSTANCEW *instance, void *context) { - DIPROPGUIDANDPATH prop_guid_path = - { - .diph = - { - .dwSize = sizeof(DIPROPGUIDANDPATH), - .dwHeaderSize = sizeof(DIPROPHEADER), - .dwHow = DIPH_DEVICE, - }, - }; struct JoystickData *data = context; struct Joystick *joystick; DIPROPRANGE proprange; @@ -249,9 +238,6 @@ static BOOL CALLBACK enum_callback(const DIDEVICEINSTANCEW *instance, void *cont joystick->forcefeedback = caps.dwFlags & DIDC_FORCEFEEDBACK; - IDirectInputDevice8_GetProperty(joystick->device, DIPROP_GUIDANDPATH, &prop_guid_path.diph); - joystick->is_xinput = wcsstr(prop_guid_path.wszPath, L"&ig_") != NULL; - list_init( &joystick->effects ); joystick->effect_selected = NULL; @@ -394,8 +380,20 @@ static void refresh_joystick_list(HWND hwnd, struct JoystickData *data) for (joy = data->joysticks, joy_end = joy + data->num_joysticks; joy != joy_end; ++joy) { DIDEVICEINSTANCEW info = {.dwSize = sizeof(DIDEVICEINSTANCEW)}; + DIPROPGUIDANDPATH prop = + { + .diph = + { + .dwSize = sizeof(DIPROPGUIDANDPATH), + .dwHeaderSize = sizeof(DIPROPHEADER), + .dwHow = DIPH_DEVICE, + }, + }; + if (FAILED(IDirectInputDevice8_GetDeviceInfo( joy->device, &info ))) continue; - if (joy->is_xinput) SendDlgItemMessageW( hwnd, IDC_XINPUTLIST, LB_ADDSTRING, 0, (LPARAM)info.tszInstanceName ); + if (FAILED(IDirectInputDevice8_GetProperty( joy->device, DIPROP_GUIDANDPATH, &prop.diph ))) continue; + + if (wcsstr( prop.wszPath, L"&ig_" )) SendDlgItemMessageW( hwnd, IDC_XINPUTLIST, LB_ADDSTRING, 0, (LPARAM)info.tszInstanceName ); else SendDlgItemMessageW( hwnd, IDC_JOYSTICKLIST, LB_ADDSTRING, 0, (LPARAM)info.tszInstanceName ); }
1
0
0
0
Rémi Bernon : joy.cpl: Read the number of buttons instead of storing it.
by Alexandre Julliard
28 Nov '22
28 Nov '22
Module: wine Branch: master Commit: 7e854933cdc8c4edd8222c2e08d313146afe839f URL:
https://gitlab.winehq.org/wine/wine/-/commit/7e854933cdc8c4edd8222c2e08d313…
Author: Rémi Bernon <rbernon(a)codeweavers.com> Date: Sat Nov 26 20:44:33 2022 +0100 joy.cpl: Read the number of buttons instead of storing it. --- dlls/joy.cpl/main.c | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/dlls/joy.cpl/main.c b/dlls/joy.cpl/main.c index 1a4286a6b92..d258dee7d01 100644 --- a/dlls/joy.cpl/main.c +++ b/dlls/joy.cpl/main.c @@ -78,8 +78,6 @@ struct effect struct Joystick { IDirectInputDevice8W *device; - int num_buttons; - int num_axes; BOOL forcefeedback; BOOL is_xinput; BOOL has_override; @@ -249,8 +247,6 @@ static BOOL CALLBACK enum_callback(const DIDEVICEINSTANCEW *instance, void *cont caps.dwSize = sizeof(caps); IDirectInputDevice8_GetCapabilities(joystick->device, &caps); - joystick->num_buttons = caps.dwButtons; - joystick->num_axes = caps.dwAxes; joystick->forcefeedback = caps.dwFlags & DIDC_FORCEFEEDBACK; IDirectInputDevice8_GetProperty(joystick->device, DIPROP_GUIDANDPATH, &prop_guid_path.diph); @@ -668,15 +664,15 @@ static DWORD WINAPI input_thread(void *param) static void test_handle_joychange(HWND hwnd, struct JoystickData *data) { + DIDEVCAPS caps = {.dwSize = sizeof(DIDEVCAPS)}; int i; if (data->num_joysticks == 0) return; data->chosen_joystick = SendDlgItemMessageW(hwnd, IDC_TESTSELECTCOMBO, CB_GETCURSEL, 0, 0); + if (FAILED(IDirectInputDevice8_GetCapabilities( data->joysticks[data->chosen_joystick].device, &caps ))) return; - /* Enable only buttons present in the device */ - for (i = 0; i < TEST_MAX_BUTTONS; i++) - ShowWindow(data->graphics.buttons[i], i < data->joysticks[data->chosen_joystick].num_buttons); + for (i = 0; i < TEST_MAX_BUTTONS; i++) ShowWindow( data->graphics.buttons[i], i < caps.dwButtons ); } /*********************************************************************
1
0
0
0
← Newer
1
...
13
14
15
16
17
18
19
...
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