winehq.org
Sign In
Sign Up
Sign In
Sign Up
Manage this list
×
Keyboard Shortcuts
Thread View
j
: Next unread message
k
: Previous unread message
j a
: Jump to all threads
j l
: Jump to MailingList overview
2025
February
January
2024
December
November
October
September
August
July
June
May
April
March
February
January
2023
December
November
October
September
August
July
June
May
April
March
February
January
2022
December
November
October
September
August
July
June
May
April
March
February
January
2021
December
November
October
September
August
July
June
May
April
March
February
January
2020
December
November
October
September
August
July
June
May
April
March
February
January
2019
December
November
October
September
August
July
June
May
April
March
February
January
2018
December
November
October
September
August
July
June
May
April
March
February
January
2017
December
November
October
September
August
July
June
May
April
March
February
January
2016
December
November
October
September
August
July
June
May
April
March
February
January
2015
December
November
October
September
August
July
June
May
April
March
February
January
2014
December
November
October
September
August
July
June
May
April
March
February
January
2013
December
November
October
September
August
July
June
May
April
March
February
January
2012
December
November
October
September
August
July
June
May
April
March
February
January
2011
December
November
October
September
August
July
June
May
April
March
February
January
2010
December
November
October
September
August
July
June
May
April
March
February
January
2009
December
November
October
September
August
July
June
May
April
March
February
January
2008
December
November
October
September
August
July
June
May
April
March
February
January
2007
December
November
October
September
August
July
June
May
April
March
February
January
2006
December
November
October
September
August
July
June
May
April
March
February
January
2005
December
November
October
September
August
July
June
May
April
March
February
January
2004
December
November
October
September
August
July
June
May
April
March
February
January
2003
December
November
October
September
August
July
June
May
April
March
February
January
2002
December
November
October
September
August
July
June
May
April
March
February
January
2001
December
November
October
September
August
July
June
May
April
March
February
List overview
wine-commits
October 2021
----- 2025 -----
February 2025
January 2025
----- 2024 -----
December 2024
November 2024
October 2024
September 2024
August 2024
July 2024
June 2024
May 2024
April 2024
March 2024
February 2024
January 2024
----- 2023 -----
December 2023
November 2023
October 2023
September 2023
August 2023
July 2023
June 2023
May 2023
April 2023
March 2023
February 2023
January 2023
----- 2022 -----
December 2022
November 2022
October 2022
September 2022
August 2022
July 2022
June 2022
May 2022
April 2022
March 2022
February 2022
January 2022
----- 2021 -----
December 2021
November 2021
October 2021
September 2021
August 2021
July 2021
June 2021
May 2021
April 2021
March 2021
February 2021
January 2021
----- 2020 -----
December 2020
November 2020
October 2020
September 2020
August 2020
July 2020
June 2020
May 2020
April 2020
March 2020
February 2020
January 2020
----- 2019 -----
December 2019
November 2019
October 2019
September 2019
August 2019
July 2019
June 2019
May 2019
April 2019
March 2019
February 2019
January 2019
----- 2018 -----
December 2018
November 2018
October 2018
September 2018
August 2018
July 2018
June 2018
May 2018
April 2018
March 2018
February 2018
January 2018
----- 2017 -----
December 2017
November 2017
October 2017
September 2017
August 2017
July 2017
June 2017
May 2017
April 2017
March 2017
February 2017
January 2017
----- 2016 -----
December 2016
November 2016
October 2016
September 2016
August 2016
July 2016
June 2016
May 2016
April 2016
March 2016
February 2016
January 2016
----- 2015 -----
December 2015
November 2015
October 2015
September 2015
August 2015
July 2015
June 2015
May 2015
April 2015
March 2015
February 2015
January 2015
----- 2014 -----
December 2014
November 2014
October 2014
September 2014
August 2014
July 2014
June 2014
May 2014
April 2014
March 2014
February 2014
January 2014
----- 2013 -----
December 2013
November 2013
October 2013
September 2013
August 2013
July 2013
June 2013
May 2013
April 2013
March 2013
February 2013
January 2013
----- 2012 -----
December 2012
November 2012
October 2012
September 2012
August 2012
July 2012
June 2012
May 2012
April 2012
March 2012
February 2012
January 2012
----- 2011 -----
December 2011
November 2011
October 2011
September 2011
August 2011
July 2011
June 2011
May 2011
April 2011
March 2011
February 2011
January 2011
----- 2010 -----
December 2010
November 2010
October 2010
September 2010
August 2010
July 2010
June 2010
May 2010
April 2010
March 2010
February 2010
January 2010
----- 2009 -----
December 2009
November 2009
October 2009
September 2009
August 2009
July 2009
June 2009
May 2009
April 2009
March 2009
February 2009
January 2009
----- 2008 -----
December 2008
November 2008
October 2008
September 2008
August 2008
July 2008
June 2008
May 2008
April 2008
March 2008
February 2008
January 2008
----- 2007 -----
December 2007
November 2007
October 2007
September 2007
August 2007
July 2007
June 2007
May 2007
April 2007
March 2007
February 2007
January 2007
----- 2006 -----
December 2006
November 2006
October 2006
September 2006
August 2006
July 2006
June 2006
May 2006
April 2006
March 2006
February 2006
January 2006
----- 2005 -----
December 2005
November 2005
October 2005
September 2005
August 2005
July 2005
June 2005
May 2005
April 2005
March 2005
February 2005
January 2005
----- 2004 -----
December 2004
November 2004
October 2004
September 2004
August 2004
July 2004
June 2004
May 2004
April 2004
March 2004
February 2004
January 2004
----- 2003 -----
December 2003
November 2003
October 2003
September 2003
August 2003
July 2003
June 2003
May 2003
April 2003
March 2003
February 2003
January 2003
----- 2002 -----
December 2002
November 2002
October 2002
September 2002
August 2002
July 2002
June 2002
May 2002
April 2002
March 2002
February 2002
January 2002
----- 2001 -----
December 2001
November 2001
October 2001
September 2001
August 2001
July 2001
June 2001
May 2001
April 2001
March 2001
February 2001
wine-commits@winehq.org
2 participants
1165 discussions
Start a n
N
ew thread
Alexandre Julliard : include: Add a define to enable fastcall wrappers, similar to the thiscall one.
by Alexandre Julliard
13 Oct '21
13 Oct '21
Module: wine Branch: master Commit: d5a7d08f636c9c499771203ad2d368f4379ca6b2 URL:
https://source.winehq.org/git/wine.git/?a=commit;h=d5a7d08f636c9c499771203a…
Author: Alexandre Julliard <julliard(a)winehq.org> Date: Wed Oct 13 21:13:27 2021 +0200 include: Add a define to enable fastcall wrappers, similar to the thiscall one. Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/hal/hal.c | 6 +++--- dlls/hidclass.sys/pnp.c | 2 +- dlls/winebus.sys/main.c | 2 +- dlls/wineusb.sys/wineusb.c | 2 +- dlls/winexinput.sys/main.c | 2 +- include/wine/asm.h | 3 ++- 6 files changed, 9 insertions(+), 8 deletions(-) diff --git a/dlls/hal/hal.c b/dlls/hal/hal.c index 21ce6e12c99..55a8891b6fa 100644 --- a/dlls/hal/hal.c +++ b/dlls/hal/hal.c @@ -34,7 +34,7 @@ WINE_DEFAULT_DEBUG_CHANNEL(ntoskrnl); #ifdef __i386__ -#ifndef _WIN32 +#ifdef __ASM_USE_FASTCALL_WRAPPER extern void * WINAPI wrap_fastcall_func1( void *func, const void *a ); __ASM_STDCALL_FUNC( wrap_fastcall_func1, 8, @@ -53,12 +53,12 @@ __ASM_STDCALL_FUNC( wrap_fastcall_func2, 12, #define call_fastcall_func1(func,a) wrap_fastcall_func1(func,a) #define call_fastcall_func2(func,a,b) wrap_fastcall_func2(func,a,b) -#else /* _WIN32 */ +#else /* __ASM_USE_FASTCALL_WRAPPER */ #define call_fastcall_func1(func,a) func(a) #define call_fastcall_func2(func,a,b) func(a,b) -#endif /* _WIN32 */ +#endif /* __ASM_USE_FASTCALL_WRAPPER */ DEFINE_FASTCALL1_WRAPPER( ExAcquireFastMutex ) void FASTCALL ExAcquireFastMutex( FAST_MUTEX *mutex ) diff --git a/dlls/hidclass.sys/pnp.c b/dlls/hidclass.sys/pnp.c index dbf04c0a403..6dafa1b95af 100644 --- a/dlls/hidclass.sys/pnp.c +++ b/dlls/hidclass.sys/pnp.c @@ -40,7 +40,7 @@ WINE_DEFAULT_DEBUG_CHANNEL(hid); DEFINE_DEVPROPKEY(DEVPROPKEY_HID_HANDLE, 0xbc62e415, 0xf4fe, 0x405c, 0x8e, 0xda, 0x63, 0x6f, 0xb5, 0x9f, 0x08, 0x98, 2); DEFINE_GUID(GUID_DEVINTERFACE_WINEXINPUT, 0x6c53d5fd, 0x6480, 0x440f, 0xb6, 0x18, 0x47, 0x67, 0x50, 0xc5, 0xe1, 0xa6); -#if defined(__i386__) && !defined(_WIN32) +#ifdef __ASM_USE_FASTCALL_WRAPPER extern void * WINAPI wrap_fastcall_func1( void *func, const void *a ); __ASM_STDCALL_FUNC( wrap_fastcall_func1, 8, diff --git a/dlls/winebus.sys/main.c b/dlls/winebus.sys/main.c index 16192977bef..6f44f4c9722 100644 --- a/dlls/winebus.sys/main.c +++ b/dlls/winebus.sys/main.c @@ -343,7 +343,7 @@ static void bus_unlink_hid_device(DEVICE_OBJECT *device) RtlLeaveCriticalSection(&device_list_cs); } -#if defined(__i386__) && !defined(_WIN32) +#ifdef __ASM_USE_FASTCALL_WRAPPER extern void * WINAPI wrap_fastcall_func1(void *func, const void *a); __ASM_STDCALL_FUNC(wrap_fastcall_func1, 8, "popl %ecx\n\t" diff --git a/dlls/wineusb.sys/wineusb.c b/dlls/wineusb.sys/wineusb.c index 085acf77e6f..cca0257bb02 100644 --- a/dlls/wineusb.sys/wineusb.c +++ b/dlls/wineusb.sys/wineusb.c @@ -38,7 +38,7 @@ WINE_DEFAULT_DEBUG_CHANNEL(wineusb); -#if defined(__i386__) && !defined(_WIN32) +#ifdef __ASM_USE_FASTCALL_WRAPPER extern void * WINAPI wrap_fastcall_func1( void *func, const void *a ); __ASM_STDCALL_FUNC( wrap_fastcall_func1, 8, diff --git a/dlls/winexinput.sys/main.c b/dlls/winexinput.sys/main.c index 05d64b05d4f..abc61e8754f 100644 --- a/dlls/winexinput.sys/main.c +++ b/dlls/winexinput.sys/main.c @@ -39,7 +39,7 @@ WINE_DEFAULT_DEBUG_CHANNEL(winexinput); -#if defined(__i386__) && !defined(_WIN32) +#ifdef __ASM_USE_FASTCALL_WRAPPER extern void *WINAPI wrap_fastcall_func1(void *func, const void *a); __ASM_STDCALL_FUNC(wrap_fastcall_func1, 8, "popl %ecx\n\t" diff --git a/include/wine/asm.h b/include/wine/asm.h index 51f04548731..da1d0d803cd 100644 --- a/include/wine/asm.h +++ b/include/wine/asm.h @@ -119,6 +119,7 @@ #if defined(__i386__) && !defined(_WIN32) +# define __ASM_USE_FASTCALL_WRAPPER # define DEFINE_FASTCALL1_WRAPPER(func) \ __ASM_FASTCALL_FUNC( func, 4, \ "popl %eax\n\t" \ @@ -144,7 +145,7 @@ #if defined(__i386__) && !defined(__MINGW32__) && (!defined(_MSC_VER) || !defined(__clang__)) -#define __ASM_USE_THISCALL_WRAPPER +# define __ASM_USE_THISCALL_WRAPPER # ifdef _MSC_VER # define DEFINE_THISCALL_WRAPPER(func,args) \ __declspec(naked) void __thiscall_##func(void) \
1
0
0
0
Alexandre Julliard : include: Add prototypes for the byteswap functions.
by Alexandre Julliard
13 Oct '21
13 Oct '21
Module: wine Branch: master Commit: 84bfdccf6d4f4e6d9538ec4123c65244937714e4 URL:
https://source.winehq.org/git/wine.git/?a=commit;h=84bfdccf6d4f4e6d9538ec41…
Author: Alexandre Julliard <julliard(a)winehq.org> Date: Wed Oct 13 13:19:43 2021 +0200 include: Add prototypes for the byteswap functions. Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/msvcrt/misc.c | 2 +- include/msvcrt/stdlib.h | 3 +++ 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/dlls/msvcrt/misc.c b/dlls/msvcrt/misc.c index bee269ed5f8..17b83069f94 100644 --- a/dlls/msvcrt/misc.c +++ b/dlls/msvcrt/misc.c @@ -490,7 +490,7 @@ unsigned short CDECL _byteswap_ushort(unsigned short s) /********************************************************************* * _byteswap_ulong (MSVCR80.@) */ -ULONG CDECL _byteswap_ulong(ULONG l) +__msvcrt_ulong CDECL _byteswap_ulong(__msvcrt_ulong l) { return (l<<24) + ((l<<8)&0xFF0000) + ((l>>8)&0xFF00) + (l>>24); } diff --git a/include/msvcrt/stdlib.h b/include/msvcrt/stdlib.h index 287e4030669..7a2a774dfb5 100644 --- a/include/msvcrt/stdlib.h +++ b/include/msvcrt/stdlib.h @@ -153,6 +153,9 @@ _ACRTIMP __int64 __cdecl _atoi64(const char*); _ACRTIMP long double __cdecl _atold(const char*); _ACRTIMP int __cdecl _atoldbl(_LDOUBLE*,char*); _ACRTIMP void __cdecl _beep(unsigned int,unsigned int); +_ACRTIMP unsigned short __cdecl _byteswap_ushort(unsigned short); +_ACRTIMP __msvcrt_ulong __cdecl _byteswap_ulong(__msvcrt_ulong); +_ACRTIMP unsigned __int64 __cdecl _byteswap_uint64(unsigned __int64); _ACRTIMP char* __cdecl _ecvt(double,int,int*,int*); _ACRTIMP char* __cdecl _fcvt(double,int,int*,int*); _ACRTIMP char* __cdecl _fullpath(char*,const char*,size_t);
1
0
0
0
Alexandre Julliard : include: Use compatible header guard in basetsd.h.
by Alexandre Julliard
13 Oct '21
13 Oct '21
Module: wine Branch: master Commit: 6b416a771d7c0c4c59c0e4980707dd18fe5955aa URL:
https://source.winehq.org/git/wine.git/?a=commit;h=6b416a771d7c0c4c59c0e498…
Author: Alexandre Julliard <julliard(a)winehq.org> Date: Wed Oct 13 13:10:00 2021 +0200 include: Use compatible header guard in basetsd.h. libjpeg depends on this. Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- include/basetsd.h | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/include/basetsd.h b/include/basetsd.h index 761af4d5214..a4774a2fea5 100644 --- a/include/basetsd.h +++ b/include/basetsd.h @@ -19,8 +19,8 @@ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA */ -#ifndef __WINE_BASETSD_H -#define __WINE_BASETSD_H +#ifndef _BASETSD_H_ +#define _BASETSD_H_ #ifdef __cplusplus extern "C" { @@ -303,4 +303,4 @@ typedef ULONG_PTR KAFFINITY, *PKAFFINITY; } /* extern "C" */ #endif /* defined(__cplusplus) */ -#endif /* !defined(__WINE_BASETSD_H) */ +#endif /* !defined(_BASETSD_H_) */
1
0
0
0
Alexandre Julliard : include: Import specstrings.h and related headers from Mingw.
by Alexandre Julliard
13 Oct '21
13 Oct '21
Module: wine Branch: master Commit: d4259ac8e9326a8173d6f83f0d525c97b90a1da0 URL:
https://source.winehq.org/git/wine.git/?a=commit;h=d4259ac8e9326a8173d6f83f…
Author: Alexandre Julliard <julliard(a)winehq.org> Date: Wed Oct 13 11:57:38 2021 +0200 include: Import specstrings.h and related headers from Mingw. Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/wmphoto/unix_lib.c | 2 + include/Makefile.in | 3 + include/concurrencysal.h | 48 +++++++ include/driverspecs.h | 55 ++++++++ include/msvcrt/corecrt.h | 2 + include/ntdef.h | 1 + include/rpcdce.h | 2 + include/specstrings.h | 340 +++++++++++++++++++++++++++++++++++++++++++++++ include/winerror.h | 2 + include/winnt.h | 1 + 10 files changed, 456 insertions(+) Diff:
https://source.winehq.org/git/wine.git/?a=commitdiff;h=d4259ac8e9326a8173d6…
1
0
0
0
Alexandre Julliard : include: Add more sal.h macros.
by Alexandre Julliard
13 Oct '21
13 Oct '21
Module: wine Branch: master Commit: dfdf56fbe47f8ff50ebe533e6d73f2de6546f008 URL:
https://source.winehq.org/git/wine.git/?a=commit;h=dfdf56fbe47f8ff50ebe533e…
Author: Alexandre Julliard <julliard(a)winehq.org> Date: Wed Oct 13 11:56:55 2021 +0200 include: Add more sal.h macros. Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- include/dbghelp.h | 60 --------------- include/imagehlp.h | 60 --------------- include/sal.h | 212 ++++++++++++++++++++++++++++++++++++++++++++++++----- 3 files changed, 195 insertions(+), 137 deletions(-) Diff:
https://source.winehq.org/git/wine.git/?a=commitdiff;h=dfdf56fbe47f8ff50ebe…
1
0
0
0
Alexandre Julliard : include: Define DECLSPEC_HIDDEN in guiddef.h if necessary.
by Alexandre Julliard
13 Oct '21
13 Oct '21
Module: wine Branch: master Commit: 5d18d4df846a43177e4a6d975f6a6fc4789ab801 URL:
https://source.winehq.org/git/wine.git/?a=commit;h=5d18d4df846a43177e4a6d97…
Author: Alexandre Julliard <julliard(a)winehq.org> Date: Wed Oct 13 10:58:44 2021 +0200 include: Define DECLSPEC_HIDDEN in guiddef.h if necessary. Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- include/guiddef.h | 8 ++++++++ include/winnt.h | 14 ++++++++------ 2 files changed, 16 insertions(+), 6 deletions(-) diff --git a/include/guiddef.h b/include/guiddef.h index a25b3a71077..d09ea98e468 100644 --- a/include/guiddef.h +++ b/include/guiddef.h @@ -86,6 +86,14 @@ extern "C++" { #undef DEFINE_GUID +#ifndef DECLSPEC_HIDDEN +# if defined(__GNUC__) && !defined(__MINGW32__) && !defined(__CYGWIN__) +# define DECLSPEC_HIDDEN __attribute__((visibility ("hidden"))) +# else +# define DECLSPEC_HIDDEN +# endif +#endif + #ifdef INITGUID #ifdef __cplusplus #define DEFINE_GUID(name, l, w1, w2, b1, b2, b3, b4, b5, b6, b7, b8) \ diff --git a/include/winnt.h b/include/winnt.h index 87051289445..53d9af8bf96 100644 --- a/include/winnt.h +++ b/include/winnt.h @@ -177,12 +177,14 @@ extern "C" { # define DECLSPEC_EXPORT #endif -#if defined(_MSC_VER) || defined(__MINGW32__) || defined(__CYGWIN__) || defined(__sun) -# define DECLSPEC_HIDDEN -#elif defined(__GNUC__) && ((__GNUC__ > 3) || ((__GNUC__ == 3) && (__GNUC_MINOR__ >= 3))) -# define DECLSPEC_HIDDEN __attribute__((visibility ("hidden"))) -#else -# define DECLSPEC_HIDDEN +#ifndef DECLSPEC_HIDDEN +# if defined(_MSC_VER) || defined(__MINGW32__) || defined(__CYGWIN__) || defined(__sun) +# define DECLSPEC_HIDDEN +# elif defined(__GNUC__) && ((__GNUC__ > 3) || ((__GNUC__ == 3) && (__GNUC_MINOR__ >= 3))) +# define DECLSPEC_HIDDEN __attribute__((visibility ("hidden"))) +# else +# define DECLSPEC_HIDDEN +# endif #endif #ifndef __has_attribute
1
0
0
0
Rémi Bernon : dinput: Correctly parse instance numbers for joystick semantics.
by Alexandre Julliard
13 Oct '21
13 Oct '21
Module: wine Branch: master Commit: 1d4fdb5aca786222f2c4200716af2f82452ab93a URL:
https://source.winehq.org/git/wine.git/?a=commit;h=1d4fdb5aca786222f2c42007…
Author: Rémi Bernon <rbernon(a)codeweavers.com> Date: Wed Oct 13 09:21:20 2021 +0200 dinput: Correctly parse instance numbers for joystick semantics. This should fix the last BuildActionMap / EnumDevicesBySemantics test failures when a joystick is plugged in. Signed-off-by: Rémi Bernon <rbernon(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/dinput/device.c | 19 +++++++++---------- 1 file changed, 9 insertions(+), 10 deletions(-) diff --git a/dlls/dinput/device.c b/dlls/dinput/device.c index 8f57d32dee2..e2d2e551d02 100644 --- a/dlls/dinput/device.c +++ b/dlls/dinput/device.c @@ -651,21 +651,20 @@ static int id_to_offset(const DataFormat *df, int id) static DWORD semantic_to_obj_id(IDirectInputDeviceImpl* This, DWORD dwSemantic) { DWORD type = (0x0000ff00 & dwSemantic) >> 8; - DWORD offset = 0x000000ff & dwSemantic; - DWORD obj_instance = 0; + BOOL byofs = (dwSemantic & 0x80000000) != 0; + DWORD value = (dwSemantic & 0x000000ff); BOOL found = FALSE; + DWORD instance; int i; - for (i = 0; i < This->data_format.wine_df->dwNumObjs; i++) + for (i = 0; i < This->data_format.wine_df->dwNumObjs && !found; i++) { LPDIOBJECTDATAFORMAT odf = dataformat_to_odf(This->data_format.wine_df, i); - if (odf->dwOfs == offset) - { - obj_instance = DIDFT_GETINSTANCE(odf->dwType); - found = TRUE; - break; - } + if (byofs && value != odf->dwOfs) continue; + if (!byofs && value != DIDFT_GETINSTANCE(odf->dwType)) continue; + instance = DIDFT_GETINSTANCE(odf->dwType); + found = TRUE; } if (!found) return 0; @@ -673,7 +672,7 @@ static DWORD semantic_to_obj_id(IDirectInputDeviceImpl* This, DWORD dwSemantic) if (type & DIDFT_AXIS) type = DIDFT_RELAXIS; if (type & DIDFT_BUTTON) type = DIDFT_PSHBUTTON; - return type | (0x0000ff00 & (obj_instance << 8)); + return type | (0x0000ff00 & (instance << 8)); } /*
1
0
0
0
Rémi Bernon : dinput: Wait for the internal thread to complete unacquiring.
by Alexandre Julliard
13 Oct '21
13 Oct '21
Module: wine Branch: master Commit: 947e6ee5b43cda0f8b610567886286a26caf375c URL:
https://source.winehq.org/git/wine.git/?a=commit;h=947e6ee5b43cda0f8b610567…
Author: Rémi Bernon <rbernon(a)codeweavers.com> Date: Wed Oct 13 09:21:19 2021 +0200 dinput: Wait for the internal thread to complete unacquiring. Otherwise we may close HID read event before it has finished removing it from the wait handles, causing MsgWaitForMultipleObjectsEx to return an error and terminate. Signed-off-by: Rémi Bernon <rbernon(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/dinput/dinput_main.c | 13 ++++--------- dlls/dinput8/tests/hid.c | 6 ------ 2 files changed, 4 insertions(+), 15 deletions(-) diff --git a/dlls/dinput/dinput_main.c b/dlls/dinput/dinput_main.c index 46c18ed55dd..985dae1ab36 100644 --- a/dlls/dinput/dinput_main.c +++ b/dlls/dinput/dinput_main.c @@ -1381,8 +1381,7 @@ static DWORD WINAPI hook_thread_proc(void *param) mouse_hook = NULL; } - if (finished_event) - SetEvent(finished_event); + SetEvent(finished_event); } } @@ -1504,17 +1503,13 @@ void check_dinput_hooks(LPDIRECTINPUTDEVICE8W iface, BOOL acquired) WARN( "Unable to (un)register raw device %x:%x\n", dev->raw_device.usUsagePage, dev->raw_device.usUsage ); } - if (acquired) - hook_change_finished_event = CreateEventW( NULL, FALSE, FALSE, NULL ); + hook_change_finished_event = CreateEventW( NULL, FALSE, FALSE, NULL ); PostThreadMessageW( hook_thread_id, WM_USER+0x10, 1, (LPARAM)hook_change_finished_event ); LeaveCriticalSection(&dinput_hook_crit); - if (acquired) - { - WaitForSingleObject(hook_change_finished_event, INFINITE); - CloseHandle(hook_change_finished_event); - } + WaitForSingleObject(hook_change_finished_event, INFINITE); + CloseHandle(hook_change_finished_event); } void check_dinput_events(void) diff --git a/dlls/dinput8/tests/hid.c b/dlls/dinput8/tests/hid.c index cf50dd32fb9..87a2a9a7a3c 100644 --- a/dlls/dinput8/tests/hid.c +++ b/dlls/dinput8/tests/hid.c @@ -4758,9 +4758,6 @@ static void test_simple_joystick(void) todo_wine ok( hr == DIERR_UNSUPPORTED, "Escape returned: %#x\n", hr ); - /* FIXME: we have to wait a bit because Wine DInput internal thread keeps a reference */ - Sleep( 100 ); - ref = IDirectInputDevice8_Release( device ); ok( ref == 0, "Release returned %d\n", ref ); @@ -7227,9 +7224,6 @@ static void test_force_feedback_joystick( void ) ok( hr == DI_OK, "Unacquire returned: %#x\n", hr ); set_hid_expect( file, NULL, 0 ); - /* FIXME: we have to wait a bit because Wine DInput internal thread keeps a reference */ - Sleep( 100 ); - ref = IDirectInputDevice8_Release( device ); ok( ref == 0, "Release returned %d\n", ref );
1
0
0
0
Rémi Bernon : dinput: Introduce new dinput_device_internal_unacquire helper.
by Alexandre Julliard
13 Oct '21
13 Oct '21
Module: wine Branch: master Commit: 29fae9a7761f73bc2417901194c738bf7985e315 URL:
https://source.winehq.org/git/wine.git/?a=commit;h=29fae9a7761f73bc24179011…
Author: Rémi Bernon <rbernon(a)codeweavers.com> Date: Wed Oct 13 09:21:18 2021 +0200 dinput: Introduce new dinput_device_internal_unacquire helper. And use it from within the internal hook critical section, to unacquire the device and remove it from the acquired device list directly. Signed-off-by: Rémi Bernon <rbernon(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/dinput/dinput_main.c | 26 +++++++++++++++++++++----- dlls/dinput/joystick_hid.c | 1 - 2 files changed, 21 insertions(+), 6 deletions(-) diff --git a/dlls/dinput/dinput_main.c b/dlls/dinput/dinput_main.c index 329cb738469..46c18ed55dd 100644 --- a/dlls/dinput/dinput_main.c +++ b/dlls/dinput/dinput_main.c @@ -119,6 +119,22 @@ void dinput_hooks_unacquire_device(LPDIRECTINPUTDEVICE8W iface) LeaveCriticalSection( &dinput_hook_crit ); } +static void dinput_device_internal_unacquire( IDirectInputDevice8W *iface ) +{ + IDirectInputDeviceImpl *impl = impl_from_IDirectInputDevice8W( iface ); + + TRACE( "iface %p.\n", iface ); + + EnterCriticalSection( &impl->crit ); + if (impl->acquired) + { + impl->vtbl->unacquire( iface ); + impl->acquired = FALSE; + list_remove( &impl->entry ); + } + LeaveCriticalSection( &impl->crit ); +} + static HRESULT create_directinput_instance(REFIID riid, LPVOID *ppDI, IDirectInputImpl **out) { IDirectInputImpl *This = calloc( 1, sizeof(IDirectInputImpl) ); @@ -1248,7 +1264,7 @@ static LRESULT CALLBACK callwndproc_proc( int code, WPARAM wparam, LPARAM lparam if (msg->hwnd == dev->win && msg->hwnd != foreground) { TRACE( "%p window is not foreground - unacquiring %p\n", dev->win, dev ); - IDirectInputDevice_Unacquire( &dev->IDirectInputDevice8W_iface ); + dinput_device_internal_unacquire( &dev->IDirectInputDevice8W_iface ); } } LIST_FOR_EACH_ENTRY_SAFE( dev, next, &acquired_mouse_list, IDirectInputDeviceImpl, entry ) @@ -1256,7 +1272,7 @@ static LRESULT CALLBACK callwndproc_proc( int code, WPARAM wparam, LPARAM lparam if (msg->hwnd == dev->win && msg->hwnd != foreground) { TRACE( "%p window is not foreground - unacquiring %p\n", dev->win, dev ); - IDirectInputDevice_Unacquire( &dev->IDirectInputDevice8W_iface ); + dinput_device_internal_unacquire( &dev->IDirectInputDevice8W_iface ); } } LIST_FOR_EACH_ENTRY_SAFE( dev, next, &acquired_rawmouse_list, IDirectInputDeviceImpl, entry ) @@ -1264,7 +1280,7 @@ static LRESULT CALLBACK callwndproc_proc( int code, WPARAM wparam, LPARAM lparam if (msg->hwnd == dev->win && msg->hwnd != foreground) { TRACE( "%p window is not foreground - unacquiring %p\n", dev->win, dev ); - IDirectInputDevice_Unacquire( &dev->IDirectInputDevice8W_iface ); + dinput_device_internal_unacquire( &dev->IDirectInputDevice8W_iface ); } } LIST_FOR_EACH_ENTRY_SAFE( dev, next, &acquired_keyboard_list, IDirectInputDeviceImpl, entry ) @@ -1272,7 +1288,7 @@ static LRESULT CALLBACK callwndproc_proc( int code, WPARAM wparam, LPARAM lparam if (msg->hwnd == dev->win && msg->hwnd != foreground) { TRACE( "%p window is not foreground - unacquiring %p\n", dev->win, dev ); - IDirectInputDevice_Unacquire( &dev->IDirectInputDevice8W_iface ); + dinput_device_internal_unacquire( &dev->IDirectInputDevice8W_iface ); } } LeaveCriticalSection( &dinput_hook_crit ); @@ -1309,7 +1325,7 @@ static DWORD WINAPI hook_thread_proc(void *param) if (impl->read_event == events[ret]) { hr = impl->vtbl->read( &impl->IDirectInputDevice8W_iface ); - if (FAILED(hr)) list_remove( &impl->entry ); + if (FAILED( hr )) dinput_device_internal_unacquire( &impl->IDirectInputDevice8W_iface ); break; } } diff --git a/dlls/dinput/joystick_hid.c b/dlls/dinput/joystick_hid.c index 6454a4b7fd1..710e63185fb 100644 --- a/dlls/dinput/joystick_hid.c +++ b/dlls/dinput/joystick_hid.c @@ -1573,7 +1573,6 @@ static HRESULT hid_joystick_internal_read( IDirectInputDevice8W *iface ) WARN( "GetOverlappedResult/ReadFile failed, error %u\n", GetLastError() ); CloseHandle(impl->device); impl->device = INVALID_HANDLE_VALUE; - impl->base.acquired = FALSE; hr = DIERR_INPUTLOST; } LeaveCriticalSection( &impl->base.crit );
1
0
0
0
Rémi Bernon : dinput: Factor all (Un)Acquire implementations together.
by Alexandre Julliard
13 Oct '21
13 Oct '21
Module: wine Branch: master Commit: 77f5edda30d9e9b1e9abbc251eab72a37fd061f1 URL:
https://source.winehq.org/git/wine.git/?a=commit;h=77f5edda30d9e9b1e9abbc25…
Author: Rémi Bernon <rbernon(a)codeweavers.com> Date: Wed Oct 13 09:21:17 2021 +0200 dinput: Factor all (Un)Acquire implementations together. And introduce new internal acquire / unacquire callbacks. Signed-off-by: Rémi Bernon <rbernon(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/dinput/device.c | 65 +++++++++++++++++-------------- dlls/dinput/device_private.h | 17 +++++--- dlls/dinput/dinput_main.c | 4 +- dlls/dinput/joystick_hid.c | 93 +++++++++++++++----------------------------- dlls/dinput/keyboard.c | 34 +++++++++------- dlls/dinput/mouse.c | 30 +++++++------- 6 files changed, 114 insertions(+), 129 deletions(-) Diff:
https://source.winehq.org/git/wine.git/?a=commitdiff;h=77f5edda30d9e9b1e9ab…
1
0
0
0
← Newer
1
...
67
68
69
70
71
72
73
...
117
Older →
Jump to page:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
Results per page:
10
25
50
100
200