winehq.org
Sign In
Sign Up
Sign In
Sign Up
Manage this list
×
Keyboard Shortcuts
Thread View
j
: Next unread message
k
: Previous unread message
j a
: Jump to all threads
j l
: Jump to MailingList overview
2025
February
January
2024
December
November
October
September
August
July
June
May
April
March
February
January
2023
December
November
October
September
August
July
June
May
April
March
February
January
2022
December
November
October
September
August
July
June
May
April
March
February
January
2021
December
November
October
September
August
July
June
May
April
March
February
January
2020
December
November
October
September
August
July
June
May
April
March
February
January
2019
December
November
October
September
August
July
June
May
April
March
February
January
2018
December
November
October
September
August
July
June
May
April
March
February
January
2017
December
November
October
September
August
July
June
May
April
March
February
January
2016
December
November
October
September
August
July
June
May
April
March
February
January
2015
December
November
October
September
August
July
June
May
April
March
February
January
2014
December
November
October
September
August
July
June
May
April
March
February
January
2013
December
November
October
September
August
July
June
May
April
March
February
January
2012
December
November
October
September
August
July
June
May
April
March
February
January
2011
December
November
October
September
August
July
June
May
April
March
February
January
2010
December
November
October
September
August
July
June
May
April
March
February
January
2009
December
November
October
September
August
July
June
May
April
March
February
January
2008
December
November
October
September
August
July
June
May
April
March
February
January
2007
December
November
October
September
August
July
June
May
April
March
February
January
2006
December
November
October
September
August
July
June
May
April
March
February
January
2005
December
November
October
September
August
July
June
May
April
March
February
January
2004
December
November
October
September
August
July
June
May
April
March
February
January
2003
December
November
October
September
August
July
June
May
April
March
February
January
2002
December
November
October
September
August
July
June
May
April
March
February
January
2001
December
November
October
September
August
July
June
May
April
March
February
List overview
wine-commits
January 2023
----- 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
467 discussions
Start a n
N
ew thread
Alexandre Julliard : tools: Add a common helper to setup signal handlers.
by Alexandre Julliard
25 Jan '23
25 Jan '23
Module: wine Branch: master Commit: ae8797c8e3e7a4f1c82a3881f9b9b8f48981d5d7 URL:
https://gitlab.winehq.org/wine/wine/-/commit/ae8797c8e3e7a4f1c82a3881f9b9b8…
Author: Alexandre Julliard <julliard(a)winehq.org> Date: Wed Jan 25 11:32:32 2023 +0100 tools: Add a common helper to setup signal handlers. --- tools/make_xftmpl.c | 7 +------ tools/makedep.c | 7 +------ tools/sfnt2fon/sfnt2fon.c | 7 +------ tools/tools.h | 10 ++++++++++ tools/widl/widl.c | 7 +------ tools/winebuild/main.c | 8 +------- tools/winegcc/winegcc.c | 7 +------ tools/wmc/wmc.c | 7 +------ tools/wrc/wrc.c | 7 +------ 9 files changed, 18 insertions(+), 49 deletions(-) diff --git a/tools/make_xftmpl.c b/tools/make_xftmpl.c index d707dc06cd2..087020cdb99 100644 --- a/tools/make_xftmpl.c +++ b/tools/make_xftmpl.c @@ -20,7 +20,6 @@ #include "config.h" -#include <signal.h> #include <stdarg.h> #include <stdio.h> #include <stdlib.h> @@ -478,11 +477,7 @@ int main(int argc, char **argv) } else { output_file = option_outfile_name; atexit(cleanup_files); - signal(SIGTERM, exit_on_signal); - signal(SIGINT, exit_on_signal); -#ifdef SIGHUP - signal(SIGHUP, exit_on_signal); -#endif + init_signals( exit_on_signal ); if (!(outfile = fopen(output_file, "wb"))) { perror(option_outfile_name); goto error; diff --git a/tools/makedep.c b/tools/makedep.c index 6379b5b69d9..e91f5a3afe2 100644 --- a/tools/makedep.c +++ b/tools/makedep.c @@ -27,7 +27,6 @@ #include <stdio.h> #include <stdlib.h> #include <stdarg.h> -#include <signal.h> #include <string.h> #include <sys/types.h> #include <sys/stat.h> @@ -4395,11 +4394,7 @@ int main( int argc, char *argv[] ) if (argc > 1) fatal_error( "Directory arguments not supported in this mode\n" ); atexit( cleanup_files ); - signal( SIGTERM, exit_on_signal ); - signal( SIGINT, exit_on_signal ); -#ifdef SIGHUP - signal( SIGHUP, exit_on_signal ); -#endif + init_signals( exit_on_signal ); for (i = 0; i < HASH_SIZE; i++) list_init( &files[i] ); for (i = 0; i < HASH_SIZE; i++) list_init( &global_includes[i] ); diff --git a/tools/sfnt2fon/sfnt2fon.c b/tools/sfnt2fon/sfnt2fon.c index b5a2086cac1..2c307dcce8a 100644 --- a/tools/sfnt2fon/sfnt2fon.c +++ b/tools/sfnt2fon/sfnt2fon.c @@ -23,7 +23,6 @@ #include <assert.h> #include <ctype.h> #include <errno.h> -#include <signal.h> #include <stdio.h> #include <stdlib.h> @@ -912,11 +911,7 @@ int main(int argc, char **argv) font_off = (fontdir_off + fontdir_len + 15) & ~0x0f; atexit( cleanup ); - signal( SIGTERM, exit_on_signal ); - signal( SIGINT, exit_on_signal ); -#ifdef SIGHUP - signal( SIGHUP, exit_on_signal ); -#endif + init_signals( exit_on_signal ); if (!output_name) /* build a default output name */ output_name = strmake( "%s%s", get_basename_noext( input_file ), diff --git a/tools/tools.h b/tools/tools.h index 3c25bcc41a9..70ef4bd2584 100644 --- a/tools/tools.h +++ b/tools/tools.h @@ -401,6 +401,16 @@ static inline void remove_temp_files(void) } +static inline void init_signals( void (*cleanup)(int) ) +{ + signal( SIGTERM, cleanup ); + signal( SIGINT, cleanup ); +#ifdef SIGHUP + signal( SIGHUP, cleanup ); +#endif +} + + static inline void *read_file( const char *name, size_t *size ) { struct stat st; diff --git a/tools/widl/widl.c b/tools/widl/widl.c index 1b0a88e3709..7d3fa26f8d0 100644 --- a/tools/widl/widl.c +++ b/tools/widl/widl.c @@ -28,7 +28,6 @@ #include <string.h> #include <assert.h> #include <ctype.h> -#include <signal.h> #include <limits.h> #include <sys/types.h> @@ -704,11 +703,7 @@ int main(int argc,char *argv[]) struct strarray files; char *input; - signal( SIGTERM, exit_on_signal ); - signal( SIGINT, exit_on_signal ); -#ifdef SIGHUP - signal( SIGHUP, exit_on_signal ); -#endif + init_signals( exit_on_signal ); init_argv0_dir( argv[0] ); target = init_argv0_target( argv[0] ); diff --git a/tools/winebuild/main.c b/tools/winebuild/main.c index f416d9dd586..f216e4bf35d 100644 --- a/tools/winebuild/main.c +++ b/tools/winebuild/main.c @@ -26,7 +26,6 @@ #include <assert.h> #include <stdio.h> -#include <signal.h> #include <errno.h> #include <string.h> #include <stdarg.h> @@ -619,12 +618,7 @@ int main(int argc, char **argv) struct strarray files; DLLSPEC *spec = main_spec = alloc_dll_spec(); -#ifdef SIGHUP - signal( SIGHUP, exit_on_signal ); -#endif - signal( SIGTERM, exit_on_signal ); - signal( SIGINT, exit_on_signal ); - + init_signals( exit_on_signal ); target = init_argv0_target( argv[0] ); if (target.platform == PLATFORM_CYGWIN) target.platform = PLATFORM_MINGW; if (is_pe()) unwind_tables = 1; diff --git a/tools/winegcc/winegcc.c b/tools/winegcc/winegcc.c index 2261eca6c1d..0770ccfbe2a 100644 --- a/tools/winegcc/winegcc.c +++ b/tools/winegcc/winegcc.c @@ -91,7 +91,6 @@ #include <assert.h> #include <stdio.h> #include <stdlib.h> -#include <signal.h> #include <stdarg.h> #include <string.h> #include <errno.h> @@ -1488,11 +1487,7 @@ int main(int argc, char **argv) char* lang = 0; char* str; -#ifdef SIGHUP - signal( SIGHUP, exit_on_signal ); -#endif - signal( SIGTERM, exit_on_signal ); - signal( SIGINT, exit_on_signal ); + init_signals( exit_on_signal ); init_argv0_dir( argv[0] ); /* setup tmp file removal at exit */ diff --git a/tools/wmc/wmc.c b/tools/wmc/wmc.c index c2cf754f590..e4f2377e772 100644 --- a/tools/wmc/wmc.c +++ b/tools/wmc/wmc.c @@ -23,7 +23,6 @@ #include <stdio.h> #include <stdlib.h> #include <string.h> -#include <signal.h> #include <limits.h> #include <sys/types.h> @@ -221,11 +220,7 @@ int main(int argc,char *argv[]) struct strarray files; atexit( cleanup_files ); - signal( SIGTERM, exit_on_signal ); - signal( SIGINT, exit_on_signal ); -#ifdef SIGHUP - signal( SIGHUP, exit_on_signal ); -#endif + init_signals( exit_on_signal ); init_argv0_dir( argv[0] ); /* First rebuild the commandline to put in destination */ diff --git a/tools/wrc/wrc.c b/tools/wrc/wrc.c index 0fe104e2ad3..48d5d2033d8 100644 --- a/tools/wrc/wrc.c +++ b/tools/wrc/wrc.c @@ -26,7 +26,6 @@ #include <string.h> #include <assert.h> #include <ctype.h> -#include <signal.h> #include <limits.h> #include <sys/types.h> @@ -396,11 +395,7 @@ int main(int argc,char *argv[]) { int i; - signal( SIGTERM, exit_on_signal ); - signal( SIGINT, exit_on_signal ); -#ifdef SIGHUP - signal( SIGHUP, exit_on_signal ); -#endif + init_signals( exit_on_signal ); init_argv0_dir( argv[0] ); /* Set the default defined stuff */
1
0
0
0
Alexandre Julliard : tools: Move signal masking to the common make_temp_file() helper.
by Alexandre Julliard
25 Jan '23
25 Jan '23
Module: wine Branch: master Commit: 9f0ae8c992f85f6b67ea484c83ad5c3b28f91a41 URL:
https://gitlab.winehq.org/wine/wine/-/commit/9f0ae8c992f85f6b67ea484c83ad5c…
Author: Alexandre Julliard <julliard(a)winehq.org> Date: Wed Jan 25 11:31:11 2023 +0100 tools: Move signal masking to the common make_temp_file() helper. --- configure | 47 ----------------------------------------------- configure.ac | 10 ---------- include/config.h.in | 6 ------ tools/tools.h | 13 +++++++++++++ tools/winegcc/winegcc.c | 41 ++++++++--------------------------------- 5 files changed, 21 insertions(+), 96 deletions(-) diff --git a/configure b/configure index 4c1b2f1da04..1e3ffabaebb 100755 --- a/configure +++ b/configure @@ -20077,17 +20077,6 @@ _ACEOF ;; esac -ac_fn_c_check_type "$LINENO" "sigset_t" "ac_cv_type_sigset_t" "#include <sys/types.h> -#include <signal.h> -" -if test "x$ac_cv_type_sigset_t" = xyes -then : - -printf "%s\n" "#define HAVE_SIGSET_T 1" >>confdefs.h - - -fi - ac_fn_c_check_type "$LINENO" "request_sense" "ac_cv_type_request_sense" "#include <linux/cdrom.h> " if test "x$ac_cv_type_request_sense" = xyes @@ -20129,42 +20118,6 @@ printf "%s\n" "#define HAVE_STRUCT_XINPGEN 1" >>confdefs.h fi -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for sigaddset" >&5 -printf %s "checking for sigaddset... " >&6; } -if test ${wine_cv_have_sigaddset+y} -then : - printf %s "(cached) " >&6 -else $as_nop - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -#include <signal.h> -int -main (void) -{ -sigset_t set; sigaddset(&set,SIGTERM); - ; - return 0; -} -_ACEOF -if ac_fn_c_try_link "$LINENO" -then : - wine_cv_have_sigaddset=yes -else $as_nop - wine_cv_have_sigaddset=no -fi -rm -f core conftest.err conftest.$ac_objext conftest.beam \ - conftest$ac_exeext conftest.$ac_ext -fi -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $wine_cv_have_sigaddset" >&5 -printf "%s\n" "$wine_cv_have_sigaddset" >&6; } -if test "$wine_cv_have_sigaddset" = "yes" -then - -printf "%s\n" "#define HAVE_SIGADDSET 1" >>confdefs.h - -fi - - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether we can use re-entrant gethostbyname_r Linux style" >&5 printf %s "checking whether we can use re-entrant gethostbyname_r Linux style... " >&6; } if test ${wine_cv_linux_gethostbyname_r_6+y} diff --git a/configure.ac b/configure.ac index 54f2b00fe76..c7217274b80 100644 --- a/configure.ac +++ b/configure.ac @@ -2058,8 +2058,6 @@ fi dnl **** Check for types **** AC_C_INLINE -AC_CHECK_TYPES([sigset_t],,,[#include <sys/types.h> -#include <signal.h>]) AC_CHECK_TYPES([request_sense],,,[#include <linux/cdrom.h>]) AC_CHECK_TYPES([struct xinpgen],,, @@ -2084,14 +2082,6 @@ AC_CHECK_TYPES([struct xinpgen],,, #include <netinet/in_pcb.h> #endif]) -AC_CACHE_CHECK([for sigaddset],wine_cv_have_sigaddset, - AC_LINK_IFELSE([AC_LANG_PROGRAM([[#include <signal.h>]], [[sigset_t set; sigaddset(&set,SIGTERM);]])],[wine_cv_have_sigaddset=yes],[wine_cv_have_sigaddset=no])) -if test "$wine_cv_have_sigaddset" = "yes" -then - AC_DEFINE(HAVE_SIGADDSET, 1, [Define if sigaddset is supported]) -fi - - AC_CACHE_CHECK([whether we can use re-entrant gethostbyname_r Linux style], wine_cv_linux_gethostbyname_r_6, AC_LINK_IFELSE([AC_LANG_PROGRAM([[#include <netdb.h>]],[[ diff --git a/include/config.h.in b/include/config.h.in index 0e43013a8ab..fe2fc36a914 100644 --- a/include/config.h.in +++ b/include/config.h.in @@ -375,18 +375,12 @@ /* Define to 1 if `interface_id' is a member of `sg_io_hdr_t'. */ #undef HAVE_SG_IO_HDR_T_INTERFACE_ID -/* Define if sigaddset is supported */ -#undef HAVE_SIGADDSET - /* Define to 1 if `si_fd' is a member of `siginfo_t'. */ #undef HAVE_SIGINFO_T_SI_FD /* Define to 1 if you have the `sigprocmask' function. */ #undef HAVE_SIGPROCMASK -/* Define to 1 if the system has the type `sigset_t'. */ -#undef HAVE_SIGSET_T - /* Define to 1 if you have the <stdint.h> header file. */ #undef HAVE_STDINT_H diff --git a/tools/tools.h b/tools/tools.h index 4cadccb25b8..3c25bcc41a9 100644 --- a/tools/tools.h +++ b/tools/tools.h @@ -27,6 +27,7 @@ #include <string.h> #include <sys/types.h> #include <sys/stat.h> +#include <signal.h> #include <fcntl.h> #include <time.h> #include <errno.h> @@ -369,7 +370,19 @@ static inline char *make_temp_file( const char *prefix, const char *suffix ) fd = open( name, O_RDWR | O_CREAT | O_EXCL, 0600 ); if (fd >= 0) { +#ifdef HAVE_SIGPROCMASK /* block signals while manipulating the temp files list */ + sigset_t mask_set, old_set; + + sigemptyset( &mask_set ); + sigaddset( &mask_set, SIGHUP ); + sigaddset( &mask_set, SIGTERM ); + sigaddset( &mask_set, SIGINT ); + sigprocmask( SIG_BLOCK, &mask_set, &old_set ); strarray_add( &temp_files, name ); + sigprocmask( SIG_SETMASK, &old_set, NULL ); +#else + strarray_add( &temp_files, name ); +#endif close( fd ); return name; } diff --git a/tools/winegcc/winegcc.c b/tools/winegcc/winegcc.c index beef9dba1cc..2261eca6c1d 100644 --- a/tools/winegcc/winegcc.c +++ b/tools/winegcc/winegcc.c @@ -146,9 +146,6 @@ static const char *output_implib; static int keep_generated = 0; const char *temp_dir = NULL; struct strarray temp_files = { 0 }; -#ifdef HAVE_SIGSET_T -static sigset_t signal_mask; -#endif static const char *bindir; static const char *libdir; @@ -223,22 +220,6 @@ static void exit_on_signal( int sig ) exit(1); /* this will call the atexit functions */ } -static char* get_temp_file(const char* prefix, const char* suffix) -{ - char *tmp; - -#ifdef HAVE_SIGPROCMASK - sigset_t old_set; - /* block signals while manipulating the temp files list */ - sigprocmask( SIG_BLOCK, &signal_mask, &old_set ); -#endif - tmp = make_temp_file( prefix, suffix ); -#ifdef HAVE_SIGPROCMASK - sigprocmask( SIG_SETMASK, &old_set, NULL ); -#endif - return tmp; -} - static int is_pe_target( const struct options *opts ) { switch (opts->target.platform) @@ -348,9 +329,9 @@ static struct strarray get_translator(struct options *opts) static int try_link( struct strarray prefix, struct strarray link_tool, const char *cflags ) { - const char *in = get_temp_file( "try_link", ".c" ); - const char *out = get_temp_file( "try_link", ".out" ); - const char *err = get_temp_file( "try_link", ".err" ); + const char *in = make_temp_file( "try_link", ".c" ); + const char *out = make_temp_file( "try_link", ".out" ); + const char *err = make_temp_file( "try_link", ".err" ); struct strarray link = empty_strarray; int sout = -1, serr = -1; int ret; @@ -407,7 +388,7 @@ static struct strarray get_link_args( struct options *opts, const char *output_n case PLATFORM_SOLARIS: { - char *mapfile = get_temp_file( output_name, ".map" ); + char *mapfile = make_temp_file( output_name, ".map" ); const char *align = opts->section_align ? opts->section_align : "0x1000"; create_file( mapfile, 0644, "text = A%s;\ndata = A%s;\n", align, align ); @@ -820,7 +801,7 @@ static const char* compile_to_object(struct options* opts, const char* file, con /* make a copy so we don't change any of the initial stuff */ /* a shallow copy is exactly what we want in this case */ copts = *opts; - copts.output_name = get_temp_file(get_basename_noext(file), ".o"); + copts.output_name = make_temp_file(get_basename_noext(file), ".o"); copts.compile_only = 1; copts.files = empty_strarray; strarray_add(&copts.files, file); @@ -894,8 +875,8 @@ static char *find_static_lib( const char *dll ) static const char *find_libgcc(struct strarray prefix, struct strarray link_tool) { - const char *out = get_temp_file( "find_libgcc", ".out" ); - const char *err = get_temp_file( "find_libgcc", ".err" ); + const char *out = make_temp_file( "find_libgcc", ".out" ); + const char *err = make_temp_file( "find_libgcc", ".err" ); struct strarray link = empty_strarray; int sout = -1, serr = -1; char *libgcc, *p; @@ -984,7 +965,7 @@ static const char *build_spec_obj( struct options *opts, const char *spec_file, strarray_add( &spec_args, strmake( "--ld-cmd=%s", strarray_tostring( tool, " " ))); } - spec_o_name = get_temp_file(output_name, ".spec.o"); + spec_o_name = make_temp_file(output_name, ".spec.o"); if (!is_pe) { if (opts->pic) strarray_add(&spec_args, "-fPIC"); @@ -1512,12 +1493,6 @@ int main(int argc, char **argv) #endif signal( SIGTERM, exit_on_signal ); signal( SIGINT, exit_on_signal ); -#ifdef HAVE_SIGADDSET - sigemptyset( &signal_mask ); - sigaddset( &signal_mask, SIGHUP ); - sigaddset( &signal_mask, SIGTERM ); - sigaddset( &signal_mask, SIGINT ); -#endif init_argv0_dir( argv[0] ); /* setup tmp file removal at exit */
1
0
0
0
Alexandre Julliard : tools: Add a common helper to cleanup temp files.
by Alexandre Julliard
25 Jan '23
25 Jan '23
Module: wine Branch: master Commit: ca398e2762ec7b5395e912127eb751a6eea120da URL:
https://gitlab.winehq.org/wine/wine/-/commit/ca398e2762ec7b5395e912127eb751…
Author: Alexandre Julliard <julliard(a)winehq.org> Date: Wed Jan 25 11:19:55 2023 +0100 tools: Add a common helper to cleanup temp files. --- tools/tools.h | 25 ++++++++++++++++++++----- tools/widl/parser.l | 28 ++++++++++------------------ tools/widl/widl.c | 30 +++++++++++------------------- tools/winebuild/build.h | 2 -- tools/winebuild/import.c | 6 +++--- tools/winebuild/main.c | 2 +- tools/winebuild/res32.c | 2 +- tools/winebuild/utils.c | 27 +++------------------------ tools/winegcc/winegcc.c | 16 +++------------- tools/wrc/wrc.c | 17 +++++------------ 10 files changed, 57 insertions(+), 98 deletions(-)
1
0
0
0
Alexandre Julliard : tools: Add a common helper to get the argv0 directory.
by Alexandre Julliard
25 Jan '23
25 Jan '23
Module: wine Branch: master Commit: ecb651c01fa7d6b495b82ed516d5e86042f65121 URL:
https://gitlab.winehq.org/wine/wine/-/commit/ecb651c01fa7d6b495b82ed516d5e8…
Author: Alexandre Julliard <julliard(a)winehq.org> Date: Wed Jan 25 11:14:36 2023 +0100 tools: Add a common helper to get the argv0 directory. --- tools/tools.h | 26 ++++++++++++++++++++++++++ tools/widl/widl.c | 25 +++++-------------------- tools/winegcc/winegcc.c | 20 +------------------- tools/wmc/wmc.c | 22 +++------------------- tools/wrc/wrc.c | 22 +++------------------- 5 files changed, 38 insertions(+), 77 deletions(-) diff --git a/tools/tools.h b/tools/tools.h index 456633e4277..4a886999e96 100644 --- a/tools/tools.h +++ b/tools/tools.h @@ -30,6 +30,9 @@ #include <fcntl.h> #include <time.h> #include <errno.h> +#ifdef HAVE_SYS_SYSCTL_H +# include <sys/sysctl.h> +#endif #ifdef _WIN32 # include <direct.h> @@ -603,6 +606,29 @@ static inline struct target init_argv0_target( const char *argv0 ) } +static inline char *get_argv0_dir( const char *argv0 ) +{ +#ifndef _WIN32 + char *dir = NULL; + +#if defined(__linux__) || defined(__FreeBSD_kernel__) || defined(__NetBSD__) + dir = realpath( "/proc/self/exe", NULL ); +#elif defined (__FreeBSD__) || defined(__DragonFly__) + static int pathname[] = { CTL_KERN, KERN_PROC, KERN_PROC_PATHNAME, -1 }; + size_t path_size = PATH_MAX; + char *path = xmalloc( path_size ); + if (!sysctl( pathname, ARRAY_SIZE(pathname), path, &path_size, NULL, 0 )) + dir = realpath( path, NULL ); + free( path ); +#endif + if (!dir && !(dir = realpath( argv0, NULL ))) return NULL; + return get_dirname( dir ); +#else + return get_dirname( argv0 ); +#endif +} + + /* output buffer management */ extern unsigned char *output_buffer; diff --git a/tools/widl/widl.c b/tools/widl/widl.c index 8d07bf61dba..58ad87b44f0 100644 --- a/tools/widl/widl.c +++ b/tools/widl/widl.c @@ -31,9 +31,6 @@ #include <signal.h> #include <limits.h> #include <sys/types.h> -#ifdef HAVE_SYS_SYSCTL_H -# include <sys/sysctl.h> -#endif #include "widl.h" #include "utils.h" @@ -482,23 +479,11 @@ void write_id_data(const statement_list_t *stmts) static void init_argv0_dir( const char *argv0 ) { -#ifndef _WIN32 - char *dir = NULL; - -#if defined(__linux__) || defined(__FreeBSD_kernel__) || defined(__NetBSD__) - dir = realpath( "/proc/self/exe", NULL ); -#elif defined (__FreeBSD__) || defined(__DragonFly__) - static int pathname[] = { CTL_KERN, KERN_PROC, KERN_PROC_PATHNAME, -1 }; - size_t path_size = PATH_MAX; - char *path = xmalloc( path_size ); - if (!sysctl( pathname, ARRAY_SIZE(pathname), path, &path_size, NULL, 0 )) - dir = realpath( path, NULL ); - free( path ); -#endif - if (!dir && !(dir = realpath( argv0, NULL ))) return; - includedir = strmake( "%s/%s", get_dirname( dir ), BIN_TO_INCLUDEDIR ); - dlldir = strmake( "%s/%s", get_dirname( dir ), BIN_TO_DLLDIR ); -#endif + char *dir = get_argv0_dir( argv0 ); + + if (!dir) return; + includedir = strmake( "%s/%s", dir, BIN_TO_INCLUDEDIR ); + dlldir = strmake( "%s/%s", dir, BIN_TO_DLLDIR ); } static void option_callback( int optc, char *optarg ) diff --git a/tools/winegcc/winegcc.c b/tools/winegcc/winegcc.c index 3891974c6c1..a0947a6fa7c 100644 --- a/tools/winegcc/winegcc.c +++ b/tools/winegcc/winegcc.c @@ -98,9 +98,6 @@ #include <ctype.h> #include <limits.h> #include <sys/types.h> -#ifdef HAVE_SYS_SYSCTL_H -# include <sys/sysctl.h> -#endif #include "utils.h" @@ -646,24 +643,9 @@ static char *get_lib_dir( struct options *opts ) static void init_argv0_dir( const char *argv0 ) { -#ifndef _WIN32 - char *dir = NULL; - -#if defined(__linux__) || defined(__FreeBSD_kernel__) || defined(__NetBSD__) - dir = realpath( "/proc/self/exe", NULL ); -#elif defined (__FreeBSD__) || defined(__DragonFly__) - static int pathname[] = { CTL_KERN, KERN_PROC, KERN_PROC_PATHNAME, -1 }; - size_t path_size = PATH_MAX; - char *path = xmalloc( path_size ); - if (!sysctl( pathname, ARRAY_SIZE(pathname), path, &path_size, NULL, 0 )) - dir = realpath( path, NULL ); - free( path ); -#endif - if (!dir && !(dir = realpath( argv0, NULL ))) return; - bindir = get_dirname( dir ); + if (!(bindir = get_argv0_dir( argv0 ))) return; includedir = strmake( "%s/%s", bindir, BIN_TO_INCLUDEDIR ); libdir = strmake( "%s/%s", bindir, BIN_TO_LIBDIR ); -#endif } static void compile(struct options* opts, const char* lang) diff --git a/tools/wmc/wmc.c b/tools/wmc/wmc.c index 76251637a4b..c2cf754f590 100644 --- a/tools/wmc/wmc.c +++ b/tools/wmc/wmc.c @@ -26,9 +26,6 @@ #include <signal.h> #include <limits.h> #include <sys/types.h> -#ifdef HAVE_SYS_SYSCTL_H -# include <sys/sysctl.h> -#endif #include "wmc.h" #include "utils.h" @@ -149,24 +146,11 @@ static void exit_on_signal( int sig ) static void init_argv0_dir( const char *argv0 ) { -#ifndef _WIN32 - char *dir = NULL; - -#if defined(__linux__) || defined(__FreeBSD_kernel__) || defined(__NetBSD__) - dir = realpath( "/proc/self/exe", NULL ); -#elif defined (__FreeBSD__) || defined(__DragonFly__) - static int pathname[] = { CTL_KERN, KERN_PROC, KERN_PROC_PATHNAME, -1 }; - size_t path_size = PATH_MAX; - char *path = xmalloc( path_size ); - if (!sysctl( pathname, ARRAY_SIZE(pathname), path, &path_size, NULL, 0 )) - dir = realpath( path, NULL ); - free( path ); -#endif - if (!dir && !(dir = realpath( argv0, NULL ))) return; - dir = get_dirname( dir ); + char *dir = get_argv0_dir( argv0 ); + + if (!dir) return; if (strendswith( dir, "/tools/wmc" )) nlsdirs[0] = strmake( "%s/../../nls", dir ); else nlsdirs[0] = strmake( "%s/%s", dir, BIN_TO_NLSDIR ); -#endif } static void option_callback( int optc, char *optarg ) diff --git a/tools/wrc/wrc.c b/tools/wrc/wrc.c index fc217afec6c..baf98c3c3bb 100644 --- a/tools/wrc/wrc.c +++ b/tools/wrc/wrc.c @@ -29,9 +29,6 @@ #include <signal.h> #include <limits.h> #include <sys/types.h> -#ifdef HAVE_SYS_SYSCTL_H -# include <sys/sysctl.h> -#endif #include "../tools.h" #include "wrc.h" @@ -294,25 +291,12 @@ static int load_file( const char *input_name, const char *output_name ) static void init_argv0_dir( const char *argv0 ) { -#ifndef _WIN32 - char *dir = NULL; - -#if defined(__linux__) || defined(__FreeBSD_kernel__) || defined(__NetBSD__) - dir = realpath( "/proc/self/exe", NULL ); -#elif defined (__FreeBSD__) || defined(__DragonFly__) - static int pathname[] = { CTL_KERN, KERN_PROC, KERN_PROC_PATHNAME, -1 }; - size_t path_size = PATH_MAX; - char *path = xmalloc( path_size ); - if (!sysctl( pathname, ARRAY_SIZE(pathname), path, &path_size, NULL, 0 )) - dir = realpath( path, NULL ); - free( path ); -#endif - if (!dir && !(dir = realpath( argv0, NULL ))) return; - dir = get_dirname( dir ); + char *dir = get_argv0_dir( argv0 ); + + if (!dir) return; includedir = strmake( "%s/%s", dir, BIN_TO_INCLUDEDIR ); if (strendswith( dir, "/tools/wrc" )) nlsdirs[0] = strmake( "%s/../../nls", dir ); else nlsdirs[0] = strmake( "%s/%s", dir, BIN_TO_NLSDIR ); -#endif } static void option_callback( int optc, char *optarg )
1
0
0
0
Zebediah Figura : win32u: Make draw_scroll_bar() static.
by Alexandre Julliard
25 Jan '23
25 Jan '23
Module: wine Branch: master Commit: a0a3c25e84a4a5adb689c0b4702d01c1d4ace098 URL:
https://gitlab.winehq.org/wine/wine/-/commit/a0a3c25e84a4a5adb689c0b4702d01…
Author: Zebediah Figura <zfigura(a)codeweavers.com> Date: Wed Jan 18 19:46:06 2023 -0600 win32u: Make draw_scroll_bar() static. --- dlls/win32u/scroll.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dlls/win32u/scroll.c b/dlls/win32u/scroll.c index ce3af5189d3..19a9a1379f4 100644 --- a/dlls/win32u/scroll.c +++ b/dlls/win32u/scroll.c @@ -282,7 +282,7 @@ static BOOL get_scroll_bar_rect( HWND hwnd, int bar, RECT *rect, int *arrow_size * * Redraw the whole scrollbar. */ -void draw_scroll_bar( HWND hwnd, HDC hdc, int bar, enum SCROLL_HITTEST hit_test, +static void draw_scroll_bar( HWND hwnd, HDC hdc, int bar, enum SCROLL_HITTEST hit_test, const struct SCROLL_TRACKING_INFO *tracking_info, BOOL draw_arrows, BOOL draw_interior ) {
1
0
0
0
Zebediah Figura : win32u: Make draw_frame_caption() static.
by Alexandre Julliard
25 Jan '23
25 Jan '23
Module: wine Branch: master Commit: e729c3bb70d4c733dd86a3cbd8176c1fd36e650b URL:
https://gitlab.winehq.org/wine/wine/-/commit/e729c3bb70d4c733dd86a3cbd8176c…
Author: Zebediah Figura <zfigura(a)codeweavers.com> Date: Wed Jan 18 19:45:08 2023 -0600 win32u: Make draw_frame_caption() static. --- dlls/win32u/defwnd.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dlls/win32u/defwnd.c b/dlls/win32u/defwnd.c index e58d4e5a793..182703e22be 100644 --- a/dlls/win32u/defwnd.c +++ b/dlls/win32u/defwnd.c @@ -1292,7 +1292,7 @@ static BOOL draw_push_button( HDC dc, RECT *r, UINT flags ) return TRUE; } -BOOL draw_frame_caption( HDC dc, RECT *r, UINT flags ) +static BOOL draw_frame_caption( HDC dc, RECT *r, UINT flags ) { RECT rect; int small_diam = make_square_rect( r, &rect ) - 2;
1
0
0
0
Zebediah Figura : win32u: Make create_brush() hidden.
by Alexandre Julliard
25 Jan '23
25 Jan '23
Module: wine Branch: master Commit: ffe262b29b4617d24d4562f7efb32ecc39fb9c4a URL:
https://gitlab.winehq.org/wine/wine/-/commit/ffe262b29b4617d24d4562f7efb32e…
Author: Zebediah Figura <zfigura(a)codeweavers.com> Date: Wed Jan 18 19:44:36 2023 -0600 win32u: Make create_brush() hidden. --- dlls/win32u/ntgdi_private.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dlls/win32u/ntgdi_private.h b/dlls/win32u/ntgdi_private.h index be3e4d8cd56..53674e0661a 100644 --- a/dlls/win32u/ntgdi_private.h +++ b/dlls/win32u/ntgdi_private.h @@ -152,7 +152,7 @@ extern DWORD stretch_bits( const BITMAPINFO *src_info, struct bitblt_coords *src extern void get_mono_dc_colors( DC *dc, int color_table_size, BITMAPINFO *info, int count ) DECLSPEC_HIDDEN; /* brush.c */ -extern HBRUSH create_brush( const LOGBRUSH *brush ); +extern HBRUSH create_brush( const LOGBRUSH *brush ) DECLSPEC_HIDDEN; extern BOOL store_brush_pattern( LOGBRUSH *brush, struct brush_pattern *pattern ) DECLSPEC_HIDDEN; extern void free_brush_pattern( struct brush_pattern *pattern ) DECLSPEC_HIDDEN;
1
0
0
0
Zebediah Figura : win32u: Make the global "caret" structure static.
by Alexandre Julliard
25 Jan '23
25 Jan '23
Module: wine Branch: master Commit: 035ac4df7af40282829d8a3be8faf59810328c95 URL:
https://gitlab.winehq.org/wine/wine/-/commit/035ac4df7af40282829d8a3be8faf5…
Author: Zebediah Figura <zfigura(a)codeweavers.com> Date: Wed Jan 18 19:43:45 2023 -0600 win32u: Make the global "caret" structure static. --- dlls/win32u/input.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dlls/win32u/input.c b/dlls/win32u/input.c index fd16d03f733..5656d5eb28f 100644 --- a/dlls/win32u/input.c +++ b/dlls/win32u/input.c @@ -1780,7 +1780,7 @@ BOOL set_foreground_window( HWND hwnd, BOOL mouse ) return ret; } -struct +static struct { HBITMAP bitmap; unsigned int timeout;
1
0
0
0
Zebediah Figura : win32u: Make call_messageAtoW() static.
by Alexandre Julliard
25 Jan '23
25 Jan '23
Module: wine Branch: master Commit: e634f2365946d5c685e1679078e590d94b5e1327 URL:
https://gitlab.winehq.org/wine/wine/-/commit/e634f2365946d5c685e1679078e590…
Author: Zebediah Figura <zfigura(a)codeweavers.com> Date: Wed Jan 18 19:43:08 2023 -0600 win32u: Make call_messageAtoW() static. --- dlls/win32u/message.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/dlls/win32u/message.c b/dlls/win32u/message.c index f439b7da23b..2c320377e34 100644 --- a/dlls/win32u/message.c +++ b/dlls/win32u/message.c @@ -2929,8 +2929,8 @@ static BOOL map_wparam_AtoW( UINT message, WPARAM *wparam, enum wm_char_mapping * * Call a window procedure, translating args from Ansi to Unicode. */ -LRESULT call_messageAtoW( winproc_callback_t callback, HWND hwnd, UINT msg, WPARAM wparam, - LPARAM lparam, LRESULT *result, void *arg, enum wm_char_mapping mapping ) +static LRESULT call_messageAtoW( winproc_callback_t callback, HWND hwnd, UINT msg, WPARAM wparam, + LPARAM lparam, LRESULT *result, void *arg, enum wm_char_mapping mapping ) { LRESULT ret = 0;
1
0
0
0
Rémi Bernon : hidp: Allow match all usages on specific functions only.
by Alexandre Julliard
25 Jan '23
25 Jan '23
Module: wine Branch: master Commit: 36b2f6be52466fce3d495e280f392522529d2745 URL:
https://gitlab.winehq.org/wine/wine/-/commit/36b2f6be52466fce3d495e280f3925…
Author: Rémi Bernon <rbernon(a)codeweavers.com> Date: Mon Jan 23 15:35:05 2023 +0100 hidp: Allow match all usages on specific functions only. --- dlls/dinput/tests/hid.c | 5 +++++ dlls/hid/hidp.c | 31 +++++++++++++++++-------------- 2 files changed, 22 insertions(+), 14 deletions(-) diff --git a/dlls/dinput/tests/hid.c b/dlls/dinput/tests/hid.c index 5200892e95b..a5ede6ee29b 100644 --- a/dlls/dinput/tests/hid.c +++ b/dlls/dinput/tests/hid.c @@ -1841,6 +1841,11 @@ static void test_hidp( HANDLE file, HANDLE async_file, int report_id, BOOL polle ok( buffer[0] == (char)0xcd, "got report value %#x\n", buffer[0] ); ok( buffer[1] == (char)0xcd, "got report value %#x\n", buffer[1] ); + status = HidP_GetUsageValue( HidP_Input, HID_USAGE_PAGE_GENERIC, 0, 0, &value, preparsed_data, report, caps.InputReportByteLength ); + ok( status == HIDP_STATUS_USAGE_NOT_FOUND, "HidP_GetUsageValue returned %#lx\n", status ); + status = HidP_GetUsageValue( HidP_Input, 0, 0, HID_USAGE_GENERIC_X, &value, preparsed_data, report, caps.InputReportByteLength ); + ok( status == HIDP_STATUS_USAGE_NOT_FOUND, "HidP_GetUsageValue returned %#lx\n", status ); + report[16] = 0xff; report[17] = 0xff; status = HidP_GetUsageValue( HidP_Input, HID_USAGE_PAGE_GENERIC, 0, HID_USAGE_GENERIC_HATSWITCH, diff --git a/dlls/hid/hidp.c b/dlls/hid/hidp.c index 83a4638b6ad..c24a98155b0 100644 --- a/dlls/hid/hidp.c +++ b/dlls/hid/hidp.c @@ -68,14 +68,17 @@ static NTSTATUS get_value_caps_range( struct hid_preparsed_data *preparsed, HIDP return HIDP_STATUS_SUCCESS; } +#define USAGE_MASK 0xffff +#define USAGE_ANY 0x10000 + struct caps_filter { BOOLEAN buttons; BOOLEAN values; BOOLEAN array; - USAGE usage_page; + DWORD usage_page; USHORT collection; - USAGE usage; + DWORD usage; UCHAR report_id; }; @@ -84,10 +87,10 @@ static BOOL match_value_caps( const struct hid_value_caps *caps, const struct ca if (!caps->usage_min && !caps->usage_max) return FALSE; if (filter->buttons && !(caps->flags & HID_VALUE_CAPS_IS_BUTTON)) return FALSE; if (filter->values && (caps->flags & HID_VALUE_CAPS_IS_BUTTON)) return FALSE; - if (filter->usage_page && filter->usage_page != caps->usage_page) return FALSE; + if (filter->usage_page != USAGE_ANY && (filter->usage_page & USAGE_MASK) != caps->usage_page) return FALSE; if (filter->collection && filter->collection != caps->link_collection) return FALSE; - if (!filter->usage) return TRUE; - return caps->usage_min <= filter->usage && caps->usage_max >= filter->usage; + if (filter->usage == USAGE_ANY) return TRUE; + return caps->usage_min <= (filter->usage & USAGE_MASK) && caps->usage_max >= (filter->usage & USAGE_MASK); } typedef NTSTATUS (*enum_value_caps_callback)( const struct hid_value_caps *caps, void *user ); @@ -384,7 +387,7 @@ NTSTATUS WINAPI HidP_GetUsages( HIDP_REPORT_TYPE report_type, USAGE usage_page, { struct hid_preparsed_data *preparsed = (struct hid_preparsed_data *)preparsed_data; struct get_usage_params params = {.usages = usages, .usages_end = usages + *usages_len, .report_buf = report_buf}; - struct caps_filter filter = {.buttons = TRUE, .usage_page = usage_page, .collection = collection}; + struct caps_filter filter = {.buttons = TRUE, .usage_page = usage_page, .collection = collection, .usage = USAGE_ANY}; NTSTATUS status; USHORT limit = -1; @@ -441,7 +444,7 @@ static NTSTATUS get_usage_list_length( const struct hid_value_caps *caps, void * ULONG WINAPI HidP_MaxUsageListLength( HIDP_REPORT_TYPE report_type, USAGE usage_page, PHIDP_PREPARSED_DATA preparsed_data ) { struct hid_preparsed_data *preparsed = (struct hid_preparsed_data *)preparsed_data; - struct caps_filter filter = {.buttons = TRUE, .usage_page = usage_page}; + struct caps_filter filter = {.buttons = TRUE, .usage_page = usage_page | USAGE_ANY, .usage = USAGE_ANY}; USHORT limit = -1; ULONG count = 0; @@ -590,7 +593,7 @@ NTSTATUS WINAPI HidP_SetUsages( HIDP_REPORT_TYPE report_type, USAGE usage_page, { struct hid_preparsed_data *preparsed = (struct hid_preparsed_data *)preparsed_data; struct set_usage_params params = {.report_buf = report_buf}; - struct caps_filter filter = {.buttons = TRUE, .usage_page = usage_page, .collection = collection}; + struct caps_filter filter = {.buttons = TRUE, .usage_page = usage_page, .collection = collection, .usage = USAGE_ANY}; NTSTATUS status; USHORT limit = 1; ULONG i, count = *usage_count; @@ -656,7 +659,7 @@ NTSTATUS WINAPI HidP_UnsetUsages( HIDP_REPORT_TYPE report_type, USAGE usage_page { struct hid_preparsed_data *preparsed = (struct hid_preparsed_data *)preparsed_data; struct unset_usage_params params = {.report_buf = report_buf, .found = FALSE}; - struct caps_filter filter = {.buttons = TRUE, .usage_page = usage_page, .collection = collection}; + struct caps_filter filter = {.buttons = TRUE, .usage_page = usage_page, .collection = collection, .usage = USAGE_ANY}; NTSTATUS status; USHORT limit = 1; ULONG i, count = *usage_count; @@ -739,7 +742,7 @@ NTSTATUS WINAPI HidP_GetSpecificButtonCaps( HIDP_REPORT_TYPE report_type, USAGE PHIDP_PREPARSED_DATA preparsed_data ) { struct hid_preparsed_data *preparsed = (struct hid_preparsed_data *)preparsed_data; - const struct caps_filter filter = {.buttons = TRUE, .usage_page = usage_page, .collection = collection, .usage = usage}; + const struct caps_filter filter = {.buttons = TRUE, .usage_page = usage_page | USAGE_ANY, .collection = collection, .usage = usage | USAGE_ANY}; TRACE( "report_type %d, usage_page %u, collection %u, usage %u, caps %p, caps_count %p, preparsed_data %p.\n", report_type, usage_page, collection, usage, caps, caps_count, preparsed_data ); @@ -806,7 +809,7 @@ NTSTATUS WINAPI HidP_GetSpecificValueCaps( HIDP_REPORT_TYPE report_type, USAGE u PHIDP_PREPARSED_DATA preparsed_data ) { struct hid_preparsed_data *preparsed = (struct hid_preparsed_data *)preparsed_data; - const struct caps_filter filter = {.values = TRUE, .usage_page = usage_page, .collection = collection, .usage = usage}; + const struct caps_filter filter = {.values = TRUE, .usage_page = usage_page | USAGE_ANY, .collection = collection, .usage = usage | USAGE_ANY}; TRACE( "report_type %d, usage_page %u, collection %u, usage %u, caps %p, caps_count %p, preparsed_data %p.\n", report_type, usage_page, collection, usage, caps, caps_count, preparsed_data ); @@ -869,7 +872,7 @@ NTSTATUS WINAPI HidP_GetUsagesEx( HIDP_REPORT_TYPE report_type, USHORT collectio { struct get_usage_and_page_params params = {.usages = usages, .usages_end = usages + *usages_len, .report_buf = report_buf}; struct hid_preparsed_data *preparsed = (struct hid_preparsed_data *)preparsed_data; - struct caps_filter filter = {.buttons = TRUE, .collection = collection}; + struct caps_filter filter = {.buttons = TRUE, .usage_page = USAGE_ANY, .collection = collection, .usage = USAGE_ANY}; NTSTATUS status; USHORT limit = -1; @@ -899,7 +902,7 @@ static NTSTATUS count_data( const struct hid_value_caps *caps, void *user ) ULONG WINAPI HidP_MaxDataListLength( HIDP_REPORT_TYPE report_type, PHIDP_PREPARSED_DATA preparsed_data ) { struct hid_preparsed_data *preparsed = (struct hid_preparsed_data *)preparsed_data; - struct caps_filter filter = {}; + struct caps_filter filter = {.usage_page = USAGE_ANY, .usage = USAGE_ANY}; USHORT limit = -1; ULONG count = 0; @@ -981,7 +984,7 @@ NTSTATUS WINAPI HidP_GetData( HIDP_REPORT_TYPE report_type, HIDP_DATA *data, ULO { struct find_all_data_params params = {.data = data, .data_end = data + *data_len, .report_buf = report_buf}; struct hid_preparsed_data *preparsed = (struct hid_preparsed_data *)preparsed_data; - struct caps_filter filter = {}; + struct caps_filter filter = {.usage_page = USAGE_ANY, .usage = USAGE_ANY}; NTSTATUS status; USHORT limit = -1;
1
0
0
0
← Newer
1
...
16
17
18
19
20
21
22
...
47
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
Results per page:
10
25
50
100
200