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 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
537 discussions
Start a n
N
ew thread
Alexandre Julliard : makedep: Make the object files architecture-generic.
by Alexandre Julliard
25 Oct '22
25 Oct '22
Module: wine Branch: master Commit: cb5268c729204c62c0c48c06047e7673cd9cdf15 URL:
https://gitlab.winehq.org/wine/wine/-/commit/cb5268c729204c62c0c48c06047e76…
Author: Alexandre Julliard <julliard(a)winehq.org> Date: Tue Oct 25 11:04:30 2022 +0200 makedep: Make the object files architecture-generic. --- tools/makedep.c | 34 ++++++++++++++++++---------------- 1 file changed, 18 insertions(+), 16 deletions(-) diff --git a/tools/makedep.c b/tools/makedep.c index 83edd3f926e..1968a4020e6 100644 --- a/tools/makedep.c +++ b/tools/makedep.c @@ -216,8 +216,6 @@ struct makefile struct strarray distclean_files; struct strarray maintainerclean_files; struct strarray uninstall_files; - struct strarray object_files; - struct strarray crossobj_files; struct strarray unixobj_files; struct strarray res_files; struct strarray font_files; @@ -228,6 +226,7 @@ struct makefile struct strarray all_targets; struct strarray phony_targets; struct strarray dependencies; + struct strarray object_files[MAX_ARCHS]; struct strarray install_rules[NB_INSTALL_RULES]; }; @@ -3054,7 +3053,7 @@ static void output_source_default( struct makefile *make, struct incl_file *sour else if (source->file->flags & FLAG_C_IMPLIB) strarray_add( &make->implib_files, strmake( "%s.o", obj )); else if (!is_dll_src) - strarray_add( &make->object_files, strmake( "%s.o", obj )); + strarray_add( &make->object_files[0], strmake( "%s.o", obj )); else strarray_add( &make->clean_files, strmake( "%s.o", obj )); output( "%s.o: %s\n", obj_dir_path( make, obj ), source->filename ); @@ -3082,7 +3081,7 @@ static void output_source_default( struct makefile *make, struct incl_file *sour if (source->file->flags & FLAG_C_IMPLIB) strarray_add( &make->crossimplib_files, strmake( "%s.cross.o", obj )); else if (!is_dll_src) - strarray_add( &make->crossobj_files, strmake( "%s.cross.o", obj )); + strarray_add( &make->object_files[arch], strmake( "%s.cross.o", obj )); else strarray_add( &make->clean_files, strmake( "%s.cross.o", obj )); output( "%s.cross.o: %s\n", obj_dir_path( make, obj ), source->filename ); @@ -3219,7 +3218,7 @@ static void output_module( struct makefile *make, unsigned int arch ) output( "%s:", obj_dir_path( make, module_name )); if (spec_file) output_filename( spec_file ); - output_filenames_obj_dir( make, arch ? make->crossobj_files : make->object_files ); + output_filenames_obj_dir( make, make->object_files[arch] ); output_filenames_obj_dir( make, make->res_files ); output_filenames( dep_libs ); output_filename( tools_path( make, "winebuild" )); @@ -3233,7 +3232,7 @@ static void output_module( struct makefile *make, unsigned int arch ) output_filename( spec_file ); } output_filenames( make->extradllflags ); - output_filenames_obj_dir( make, arch ? make->crossobj_files : make->object_files ); + output_filenames_obj_dir( make, make->object_files[arch] ); output_filenames_obj_dir( make, make->res_files ); debug_file = get_debug_file( make, make->module, arch ); if (debug_file) output_filename( strmake( "-Wl,--debug-file,%s", obj_dir_path( make, debug_file ))); @@ -3384,12 +3383,12 @@ static void output_static_lib( struct makefile *make, unsigned int arch ) strarray_add( &make->clean_files, name ); output( "%s: %s", obj_dir_path( make, name ), tools_path( make, "winebuild" )); - output_filenames_obj_dir( make, arch ? make->crossobj_files : make->object_files ); + output_filenames_obj_dir( make, make->object_files[arch] ); if (!arch) output_filenames_obj_dir( make, make->unixobj_files ); output( "\n" ); output( "\t%s%s -w --staticlib -o $@", cmd_prefix( "BUILD" ), tools_path( make, "winebuild" )); output_filenames( target_flags[arch] ); - output_filenames_obj_dir( make, arch ? make->crossobj_files : make->object_files ); + output_filenames_obj_dir( make, make->object_files[arch] ); if (!arch) output_filenames_obj_dir( make, make->unixobj_files ); output( "\n" ); if (!make->extlib) @@ -3419,11 +3418,11 @@ static void output_shared_lib( struct makefile *make ) strarray_addall( &all_libs, libs ); output( "%s:", obj_dir_path( make, make->sharedlib )); - output_filenames_obj_dir( make, make->object_files ); + output_filenames_obj_dir( make, make->object_files[arch] ); output_filenames( dep_libs ); output( "\n" ); output( "\t%s$(CC) -o $@", cmd_prefix( "CCLD" )); - output_filenames_obj_dir( make, make->object_files ); + output_filenames_obj_dir( make, make->object_files[arch] ); output_filenames( all_libs ); output_filename( "$(LDFLAGS)" ); output( "\n" ); @@ -3464,7 +3463,7 @@ static void output_test_module( struct makefile *make, unsigned int arch ) output( "%s:\n", output_file ); output_winegcc_command( make, arch ); output_filenames( make->extradllflags ); - output_filenames_obj_dir( make, arch ? make->crossobj_files : make->object_files ); + output_filenames_obj_dir( make, make->object_files[arch] ); output_filenames_obj_dir( make, make->res_files ); if ((debug_file = get_debug_file( make, testmodule, arch ))) output_filename( strmake( "-Wl,--debug-file,%s", obj_dir_path( make, debug_file ))); @@ -3476,13 +3475,13 @@ static void output_test_module( struct makefile *make, unsigned int arch ) output_filename( "-s" ); output_filename( strmake( "-Wb,-F,%s", testmodule )); output_filenames( make->extradllflags ); - output_filenames_obj_dir( make, arch ? make->crossobj_files : make->object_files ); + output_filenames_obj_dir( make, make->object_files[arch] ); output_filenames_obj_dir( make, make->res_files ); output_filenames( all_libs ); output_filename( arch ? "$(CROSSLDFLAGS)" : "$(LDFLAGS)" ); output( "\n" ); output( "%s%s %s%s:", obj_dir_path( make, testmodule ), ext, obj_dir_path( make, stripped ), ext ); - output_filenames_obj_dir( make, arch ? make->crossobj_files : make->object_files ); + output_filenames_obj_dir( make, make->object_files[arch] ); output_filenames_obj_dir( make, make->res_files ); output_filenames( dep_libs ); output_filename( tools_path( make, "winebuild" )); @@ -3522,6 +3521,7 @@ static void output_test_module( struct makefile *make, unsigned int arch ) static void output_programs( struct makefile *make ) { unsigned int i, j; + unsigned int arch = 0; /* programs are always native */ for (i = 0; i < make->programs.count; i++) { @@ -3532,7 +3532,7 @@ static void output_programs( struct makefile *make ) struct strarray objs = get_expanded_file_local_var( make, make->programs.str[i], "OBJS" ); struct strarray symlinks = get_expanded_file_local_var( make, make->programs.str[i], "SYMLINKS" ); - if (!objs.count) objs = make->object_files; + if (!objs.count) objs = make->object_files[arch]; if (!strarray_exists( &all_libs, "-nodefaultlibs" )) { strarray_addall( &all_libs, get_expanded_make_var_array( make, "UNIX_LIBS" )); @@ -3763,10 +3763,12 @@ static void output_sources( struct makefile *make ) else if (!strcmp( make->obj_dir, "po" )) strarray_add( &make->distclean_files, "LINGUAS" ); - strarray_addall( &make->clean_files, make->object_files ); - strarray_addall( &make->clean_files, make->crossobj_files ); strarray_addall( &make->clean_files, make->implib_files ); strarray_addall( &make->clean_files, make->crossimplib_files ); + for (arch = 0; arch < archs.count; arch++) + { + strarray_addall_uniq( &make->clean_files, make->object_files[arch] ); + } strarray_addall( &make->clean_files, make->unixobj_files ); strarray_addall( &make->clean_files, make->res_files ); strarray_addall( &make->clean_files, make->pot_files );
1
0
0
0
Alexandre Julliard : makedep: Make the installation directories architecture-generic.
by Alexandre Julliard
25 Oct '22
25 Oct '22
Module: wine Branch: master Commit: 9795a01918185435f7d9a34806327ef9bf109e6a URL:
https://gitlab.winehq.org/wine/wine/-/commit/9795a01918185435f7d9a34806327e…
Author: Alexandre Julliard <julliard(a)winehq.org> Date: Tue Oct 25 11:03:54 2022 +0200 makedep: Make the installation directories architecture-generic. --- tools/makedep.c | 62 +++++++++++++++++++++++++++++++-------------------------- 1 file changed, 34 insertions(+), 28 deletions(-) diff --git a/tools/makedep.c b/tools/makedep.c index 2395835ff72..83edd3f926e 100644 --- a/tools/makedep.c +++ b/tools/makedep.c @@ -149,8 +149,6 @@ static const char *tools_ext; static const char *exe_ext; static const char *dll_ext; static const char *host_cpu; -static const char *pe_dir; -static const char *so_dir; static const char *fontforge; static const char *convert; static const char *flex; @@ -164,6 +162,7 @@ static const char *msgfmt; static const char *ln_s; static const char *sed_cmd; /* per-architecture global variables */ +static const char *arch_install_dirs[MAX_ARCHS]; static const char *strip_progs[MAX_ARCHS]; static const char *debug_flags[MAX_ARCHS]; static const char *delay_load_flags[MAX_ARCHS]; @@ -2456,19 +2455,22 @@ static void output_srcdir_symlink( struct makefile *make, const char *obj ) */ static void output_install_commands( struct makefile *make, struct strarray files ) { - unsigned int i; + unsigned int i, arch; char *install_sh = root_src_dir_path( "tools/install-sh" ); for (i = 0; i < files.count; i += 2) { const char *file = files.str[i]; const char *dest = strmake( "$(DESTDIR)%s", files.str[i + 1] + 1 ); + char type = *files.str[i + 1]; - switch (*files.str[i + 1]) + switch (type) { - case 'c': /* cross-compiled program */ + case '1': case '2': case '3': case '4': case '5': + case '6': case '7': case '8': case '9': /* arch-dependent program */ + arch = type - '0'; output( "\tSTRIPPROG=%s %s -m 644 $(INSTALL_PROGRAM_FLAGS) %s %s\n", - strip_progs[1], install_sh, obj_dir_path( make, file ), dest ); + strip_progs[arch], install_sh, obj_dir_path( make, file ), dest ); output( "\t%s --builtin %s\n", tools_path( make, "winebuild" ), dest ); break; case 'd': /* data file */ @@ -2479,6 +2481,7 @@ static void output_install_commands( struct makefile *make, struct strarray file output( "\t%s -m 644 $(INSTALL_DATA_FLAGS) %s %s\n", install_sh, src_dir_path( make, file ), dest ); break; + case '0': /* native arch program file */ case 'p': /* program file */ output( "\tSTRIPPROG=\"$(STRIP)\" %s $(INSTALL_PROGRAM_FLAGS) %s %s\n", install_sh, obj_dir_path( make, file ), dest ); @@ -2525,7 +2528,8 @@ static void output_install_rules( struct makefile *make, enum install_rules rule const char *file = files.str[i]; switch (*files.str[i + 1]) { - case 'c': /* cross-compiled program */ + case '0': case '1': case '2': case '3': case '4': + case '5': case '6': case '7': case '8': case '9': /* arch-dependent program */ case 'd': /* data file */ case 'p': /* program file */ case 's': /* script */ @@ -3205,11 +3209,10 @@ static void output_module( struct makefile *make, unsigned int arch ) if (make->data_only) add_install_rule( make, make->module, module_name, - strmake( "d%s/%s", *dll_ext ? pe_dir : "$(dlldir)", module_name )); - else if (arch) - add_install_rule( make, make->module, module_name, strmake( "c%s/%s", pe_dir, module_name )); - else if (*dll_ext) - add_install_rule( make, make->module, module_name, strmake( "p%s/%s", so_dir, module_name )); + strmake( "d%s%s", arch_install_dirs[arch], make->module )); + else if (arch || *dll_ext) + add_install_rule( make, make->module, module_name, + strmake( "%c%s%s", '0' + arch, arch_install_dirs[arch], module_name )); else add_install_rule( make, make->module, module_name, strmake( "p$(%s)/%s", spec_file ? "dlldir" : "bindir", module_name )); @@ -3256,7 +3259,8 @@ static void output_fake_module( struct makefile *make, unsigned int arch ) if (!make->is_exe) spec_file = src_dir_path( make, replace_extension( make->module, ".dll", ".spec" )); strarray_add( &make->all_targets, make->module ); - add_install_rule( make, make->module, make->module, strmake( "d%s/%s", pe_dir, make->module )); + add_install_rule( make, make->module, make->module, + strmake( "d%s%s", arch_install_dirs[arch], make->module )); output( "%s:", obj_dir_path( make, make->module )); if (spec_file) output_filename( spec_file ); @@ -3312,7 +3316,7 @@ static void output_import_lib( struct makefile *make, unsigned int arch ) output( "\n" ); add_install_rule( make, make->importlib, arch ? strmake( "lib%s.cross.a", make->importlib ) : strmake( "lib%s.a", make->importlib ), - strmake( "d%s/lib%s.a", arch ? pe_dir : so_dir, make->importlib )); + strmake( "d%slib%s.a", arch_install_dirs[arch], make->importlib )); } @@ -3324,6 +3328,7 @@ static void output_unix_lib( struct makefile *make ) struct strarray unix_libs = empty_strarray; struct strarray unix_deps = empty_strarray; char *spec_file = src_dir_path( make, replace_extension( make->module, ".dll", ".spec" )); + unsigned int arch = 0; /* unix libs are always native */ if (!make->native_unix_lib) { @@ -3341,7 +3346,8 @@ static void output_unix_lib( struct makefile *make ) else unix_libs = add_unix_libraries( make, &unix_deps ); strarray_add( &make->all_targets, make->unixlib ); - add_install_rule( make, make->module, make->unixlib, strmake( "p%s/%s", so_dir, make->unixlib )); + add_install_rule( make, make->module, make->unixlib, + strmake( "p%s%s", arch_install_dirs[arch], make->unixlib )); output( "%s:", obj_dir_path( make, make->unixlib )); output_filenames_obj_dir( make, make->unixobj_files ); output_filenames( unix_deps ); @@ -3388,7 +3394,7 @@ static void output_static_lib( struct makefile *make, unsigned int arch ) output( "\n" ); if (!make->extlib) add_install_rule( make, make->staticlib, name, - strmake( "d%s/%s", arch ? pe_dir : so_dir, make->staticlib )); + strmake( "d%s%s", arch_install_dirs[arch], make->staticlib )); } @@ -3402,6 +3408,7 @@ static void output_shared_lib( struct makefile *make ) struct strarray names = get_shared_lib_names( make->sharedlib ); struct strarray all_libs = empty_strarray; struct strarray dep_libs = empty_strarray; + unsigned int arch = 0; /* shared libs are always native */ basename = xstrdup( make->sharedlib ); if ((p = strchr( basename, '.' ))) *p = 0; @@ -3420,12 +3427,14 @@ static void output_shared_lib( struct makefile *make ) output_filenames( all_libs ); output_filename( "$(LDFLAGS)" ); output( "\n" ); - add_install_rule( make, make->sharedlib, make->sharedlib, strmake( "p%s/%s", so_dir, make->sharedlib )); + add_install_rule( make, make->sharedlib, make->sharedlib, + strmake( "p%s%s", arch_install_dirs[arch], make->sharedlib )); for (i = 1; i < names.count; i++) { output( "%s: %s\n", obj_dir_path( make, names.str[i] ), obj_dir_path( make, names.str[i-1] )); output_symlink_rule( names.str[i-1], obj_dir_path( make, names.str[i] ), 0 ); - add_install_rule( make, names.str[i], names.str[i-1], strmake( "y%s/%s", so_dir, names.str[i] )); + add_install_rule( make, names.str[i], names.str[i-1], + strmake( "y%s%s", arch_install_dirs[arch], names.str[i] )); } strarray_addall( &make->all_targets, names ); } @@ -4377,18 +4386,10 @@ int main( int argc, char *argv[] ) if (tools_dir && !strcmp( tools_dir, "." )) tools_dir = NULL; if (!exe_ext) exe_ext = ""; if (!tools_ext) tools_ext = ""; - if (host_cpu && (host_cpu = normalize_arch( host_cpu ))) - { - so_dir = strmake( "$(dlldir)/%s-unix", host_cpu ); - pe_dir = strmake( "$(dlldir)/%s-windows", host_cpu ); - } - else - { - host_cpu = "unknown"; - so_dir = pe_dir = "$(dlldir)"; - } + if (!host_cpu || !(host_cpu = normalize_arch( host_cpu ))) host_cpu = "unknown"; strarray_add( &archs, host_cpu ); + arch_install_dirs[0] = *dll_ext ? strmake( "$(dlldir)/%s-unix/", archs.str[0] ) : "$(dlldir)/"; strip_progs[0] = "\"$(STRIP)\""; if (crosstarget) @@ -4400,6 +4401,11 @@ int main( int argc, char *argv[] ) debug_flags[1] = debug_flag; } + for (arch = 1; arch < archs.count; arch++) + { + arch_install_dirs[arch] = strmake( "$(dlldir)/%s-windows/", archs.str[arch] ); + } + for (arch = 0; arch < archs.count; arch++) { extra_cflags_extlib[arch] = remove_warning_flags( extra_cflags[arch] );
1
0
0
0
Nikolay Sivov : kernelbase: Forward some of the security descriptor functions to ntdll.
by Alexandre Julliard
25 Oct '22
25 Oct '22
Module: wine Branch: master Commit: 3b8508a539db9b42ca3fa5b2404ec3f3e9cf97fe URL:
https://gitlab.winehq.org/wine/wine/-/commit/3b8508a539db9b42ca3fa5b2404ec3…
Author: Nikolay Sivov <nsivov(a)codeweavers.com> Date: Mon Oct 24 19:06:44 2022 +0300 kernelbase: Forward some of the security descriptor functions to ntdll. Signed-off-by: Nikolay Sivov <nsivov(a)codeweavers.com> --- dlls/kernelbase/security.c | 72 ++++------------------------------------------ 1 file changed, 5 insertions(+), 67 deletions(-) diff --git a/dlls/kernelbase/security.c b/dlls/kernelbase/security.c index 26878982b6f..04898f81b06 100644 --- a/dlls/kernelbase/security.c +++ b/dlls/kernelbase/security.c @@ -139,26 +139,6 @@ static const WELLKNOWNRID WellKnownRids[] = { WinAccountRasAndIasServersSid, DOMAIN_ALIAS_RID_RAS_SERVERS }, }; -static const SID world_sid = { SID_REVISION, 1, { SECURITY_WORLD_SID_AUTHORITY} , { SECURITY_WORLD_RID } }; -static const DWORD world_access_acl_size = sizeof(ACL) + sizeof(ACCESS_ALLOWED_ACE) + sizeof(world_sid) - sizeof(DWORD); - -static void get_world_access_acl( PACL acl ) -{ - PACCESS_ALLOWED_ACE ace = (PACCESS_ALLOWED_ACE)(acl + 1); - - acl->AclRevision = ACL_REVISION; - acl->Sbz1 = 0; - acl->AclSize = world_access_acl_size; - acl->AceCount = 1; - acl->Sbz2 = 0; - ace->Header.AceType = ACCESS_ALLOWED_ACE_TYPE; - ace->Header.AceFlags = CONTAINER_INHERIT_ACE; - ace->Header.AceSize = sizeof(ACCESS_ALLOWED_ACE) + sizeof(world_sid) - sizeof(DWORD); - ace->Mask = 0xf3ffffff; /* Everything except reserved bits */ - memcpy( &ace->SidStart, &world_sid, sizeof(world_sid) ); -} - - static NTSTATUS open_file( LPCWSTR name, DWORD access, HANDLE *file ) { UNICODE_STRING file_nameW; @@ -938,7 +918,7 @@ BOOL WINAPI CreatePrivateObjectSecurity( PSECURITY_DESCRIPTOR parent, PSECURITY_ PSECURITY_DESCRIPTOR *descr, BOOL is_container, HANDLE token, PGENERIC_MAPPING mapping ) { - return CreatePrivateObjectSecurityEx( parent, creator, descr, NULL, is_container, 0, token, mapping ); + return set_ntstatus( RtlNewSecurityObject( parent, creator, descr, is_container, token, mapping )); } /****************************************************************************** @@ -948,46 +928,7 @@ BOOL WINAPI CreatePrivateObjectSecurityEx( PSECURITY_DESCRIPTOR parent, PSECURIT PSECURITY_DESCRIPTOR *descr, GUID *type, BOOL is_container, ULONG flags, HANDLE token, PGENERIC_MAPPING mapping ) { - SECURITY_DESCRIPTOR_RELATIVE *relative; - DWORD needed, offset; - BYTE *buffer; - - FIXME( "%p %p %p %p %d %lu %p %p - returns fake SECURITY_DESCRIPTOR\n", - parent, creator, descr, type, is_container, flags, token, mapping ); - - needed = sizeof(SECURITY_DESCRIPTOR_RELATIVE); - needed += sizeof(world_sid); - needed += sizeof(world_sid); - needed += world_access_acl_size; - needed += world_access_acl_size; - - if (!(buffer = heap_alloc( needed ))) return FALSE; - relative = (SECURITY_DESCRIPTOR_RELATIVE *)buffer; - if (!InitializeSecurityDescriptor( relative, SECURITY_DESCRIPTOR_REVISION )) - { - heap_free( buffer ); - return FALSE; - } - relative->Control |= SE_SELF_RELATIVE; - offset = sizeof(SECURITY_DESCRIPTOR_RELATIVE); - - memcpy( buffer + offset, &world_sid, sizeof(world_sid) ); - relative->Owner = offset; - offset += sizeof(world_sid); - - memcpy( buffer + offset, &world_sid, sizeof(world_sid) ); - relative->Group = offset; - offset += sizeof(world_sid); - - get_world_access_acl( (ACL *)(buffer + offset) ); - relative->Dacl = offset; - offset += world_access_acl_size; - - get_world_access_acl( (ACL *)(buffer + offset) ); - relative->Sacl = offset; - - *descr = relative; - return TRUE; + return set_ntstatus( RtlNewSecurityObjectEx( parent, creator, descr, type, is_container, flags, token, mapping )); } /****************************************************************************** @@ -1000,9 +941,8 @@ BOOL WINAPI CreatePrivateObjectSecurityWithMultipleInheritance( PSECURITY_DESCRI BOOL is_container, ULONG flags, HANDLE token, PGENERIC_MAPPING mapping ) { - FIXME(": semi-stub\n"); - return CreatePrivateObjectSecurityEx( parent, creator, descr, NULL, is_container, - flags, token, mapping ); + return set_ntstatus( RtlNewSecurityObjectWithMultipleInheritance( parent, creator, descr, types, count, + is_container, flags, token, mapping )); } /****************************************************************************** @@ -1010,9 +950,7 @@ BOOL WINAPI CreatePrivateObjectSecurityWithMultipleInheritance( PSECURITY_DESCRI */ BOOL WINAPI DestroyPrivateObjectSecurity( PSECURITY_DESCRIPTOR *descr ) { - FIXME("%p - stub\n", descr); - heap_free( *descr ); - return TRUE; + return set_ntstatus( RtlDeleteSecurityObject( descr )); } /******************************************************************************
1
0
0
0
Nikolay Sivov : ntdll: Add some already implemented security descriptor exports.
by Alexandre Julliard
25 Oct '22
25 Oct '22
Module: wine Branch: master Commit: 853d9024b71b91208d69bedbeecbc474dc881bf2 URL:
https://gitlab.winehq.org/wine/wine/-/commit/853d9024b71b91208d69bedbeecbc4…
Author: Nikolay Sivov <nsivov(a)codeweavers.com> Date: Mon Oct 24 19:01:24 2022 +0300 ntdll: Add some already implemented security descriptor exports. Signed-off-by: Nikolay Sivov <nsivov(a)codeweavers.com> --- dlls/ntdll/ntdll.spec | 4 +-- dlls/ntdll/rtl.c | 26 -------------- dlls/ntdll/sec.c | 96 +++++++++++++++++++++++++++++++++++++++++++++++++++ include/winternl.h | 3 ++ 4 files changed, 101 insertions(+), 28 deletions(-) diff --git a/dlls/ntdll/ntdll.spec b/dlls/ntdll/ntdll.spec index 2432307e686..d9071bb826e 100644 --- a/dlls/ntdll/ntdll.spec +++ b/dlls/ntdll/ntdll.spec @@ -878,8 +878,8 @@ @ stub RtlNewInstanceSecurityObject @ stub RtlNewSecurityGrantedAccess @ stdcall RtlNewSecurityObject(ptr ptr ptr long ptr ptr) -# @ stub RtlNewSecurityObjectEx -# @ stub RtlNewSecurityObjectWithMultipleInheritance +@ stdcall RtlNewSecurityObjectEx(ptr ptr ptr ptr long long long ptr) +@ stdcall RtlNewSecurityObjectWithMultipleInheritance(ptr ptr ptr ptr long long long long ptr) @ stdcall RtlNormalizeProcessParams(ptr) @ stdcall RtlNormalizeString(long wstr long ptr ptr) # @ stub RtlNtPathNameToDosPathName diff --git a/dlls/ntdll/rtl.c b/dlls/ntdll/rtl.c index 11067f44941..58fe5242aa4 100644 --- a/dlls/ntdll/rtl.c +++ b/dlls/ntdll/rtl.c @@ -396,32 +396,6 @@ VOID WINAPI RtlReleasePebLock(void) RtlLeaveCriticalSection( NtCurrentTeb()->Peb->FastPebLock ); } -/****************************************************************************** - * RtlNewSecurityObject [NTDLL.@] - */ -NTSTATUS WINAPI -RtlNewSecurityObject( PSECURITY_DESCRIPTOR ParentDescriptor, - PSECURITY_DESCRIPTOR CreatorDescriptor, - PSECURITY_DESCRIPTOR *NewDescriptor, - BOOLEAN IsDirectoryObject, - HANDLE Token, - PGENERIC_MAPPING GenericMapping ) -{ - FIXME("(%p %p %p %d %p %p) stub!\n", ParentDescriptor, CreatorDescriptor, - NewDescriptor, IsDirectoryObject, Token, GenericMapping); - return STATUS_NOT_IMPLEMENTED; -} - -/****************************************************************************** - * RtlDeleteSecurityObject [NTDLL.@] - */ -NTSTATUS WINAPI -RtlDeleteSecurityObject( PSECURITY_DESCRIPTOR *ObjectDescriptor ) -{ - FIXME("(%p) stub!\n", ObjectDescriptor); - return STATUS_NOT_IMPLEMENTED; -} - /****************************************************************************** * RtlInitializeGenericTable [NTDLL.@] */ diff --git a/dlls/ntdll/sec.c b/dlls/ntdll/sec.c index 20adc044158..ecc3ed8ba95 100644 --- a/dlls/ntdll/sec.c +++ b/dlls/ntdll/sec.c @@ -37,6 +37,25 @@ WINE_DEFAULT_DEBUG_CHANNEL(ntdll); #define SELF_RELATIVE_FIELD(sd,field) ((BYTE *)(sd) + ((SECURITY_DESCRIPTOR_RELATIVE *)(sd))->field) +static const SID world_sid = { SID_REVISION, 1, { SECURITY_WORLD_SID_AUTHORITY} , { SECURITY_WORLD_RID } }; +static const DWORD world_access_acl_size = sizeof(ACL) + sizeof(ACCESS_ALLOWED_ACE) + sizeof(world_sid) - sizeof(DWORD); + +static void get_world_access_acl( PACL acl ) +{ + PACCESS_ALLOWED_ACE ace = (PACCESS_ALLOWED_ACE)(acl + 1); + + acl->AclRevision = ACL_REVISION; + acl->Sbz1 = 0; + acl->AclSize = world_access_acl_size; + acl->AceCount = 1; + acl->Sbz2 = 0; + ace->Header.AceType = ACCESS_ALLOWED_ACE_TYPE; + ace->Header.AceFlags = CONTAINER_INHERIT_ACE; + ace->Header.AceSize = sizeof(ACCESS_ALLOWED_ACE) + sizeof(world_sid) - sizeof(DWORD); + ace->Mask = 0xf3ffffff; /* Everything except reserved bits */ + memcpy( &ace->SidStart, &world_sid, sizeof(world_sid) ); +} + /* helper function to retrieve active length of an ACL */ static size_t acl_bytesInUse(PACL pAcl) { @@ -1101,6 +1120,83 @@ NTSTATUS WINAPI RtlAbsoluteToSelfRelativeSD( SelfRelativeSecurityDescriptor, BufferLength); } +/****************************************************************************** + * RtlNewSecurityObject [NTDLL.@] + */ +NTSTATUS WINAPI RtlNewSecurityObject(PSECURITY_DESCRIPTOR parent, PSECURITY_DESCRIPTOR creator, + PSECURITY_DESCRIPTOR *descr, BOOLEAN is_container, HANDLE token, PGENERIC_MAPPING mapping) +{ + return RtlNewSecurityObjectEx(parent, creator, descr, NULL, is_container, 0, token, mapping); +} + +/****************************************************************************** + * RtlNewSecurityObjectEx [NTDLL.@] + */ +NTSTATUS WINAPI RtlNewSecurityObjectEx(PSECURITY_DESCRIPTOR parent, PSECURITY_DESCRIPTOR creator, + PSECURITY_DESCRIPTOR *descr, GUID *type, BOOLEAN is_container, ULONG flags, HANDLE token, PGENERIC_MAPPING mapping ) +{ + SECURITY_DESCRIPTOR_RELATIVE *relative; + DWORD needed, offset; + NTSTATUS status; + BYTE *buffer; + + FIXME("%p, %p, %p, %p, %d, %#x, %p %p - semi-stub\n", parent, creator, descr, type, is_container, flags, token, mapping); + + needed = sizeof(SECURITY_DESCRIPTOR_RELATIVE); + needed += sizeof(world_sid); + needed += sizeof(world_sid); + needed += world_access_acl_size; + needed += world_access_acl_size; + + if (!(buffer = RtlAllocateHeap( GetProcessHeap(), 0, needed ))) return STATUS_NO_MEMORY; + relative = (SECURITY_DESCRIPTOR_RELATIVE *)buffer; + if ((status = RtlCreateSecurityDescriptor( relative, SECURITY_DESCRIPTOR_REVISION ))) + { + RtlFreeHeap( GetProcessHeap(), 0, buffer ); + return status; + } + relative->Control |= SE_SELF_RELATIVE; + offset = sizeof(SECURITY_DESCRIPTOR_RELATIVE); + + memcpy( buffer + offset, &world_sid, sizeof(world_sid) ); + relative->Owner = offset; + offset += sizeof(world_sid); + + memcpy( buffer + offset, &world_sid, sizeof(world_sid) ); + relative->Group = offset; + offset += sizeof(world_sid); + + get_world_access_acl( (ACL *)(buffer + offset) ); + relative->Dacl = offset; + offset += world_access_acl_size; + + get_world_access_acl( (ACL *)(buffer + offset) ); + relative->Sacl = offset; + + *descr = relative; + return STATUS_SUCCESS; +} + +/****************************************************************************** + * RtlNewSecurityObjectWithMultipleInheritance [NTDLL.@] + */ +NTSTATUS WINAPI RtlNewSecurityObjectWithMultipleInheritance(PSECURITY_DESCRIPTOR parent, PSECURITY_DESCRIPTOR creator, + PSECURITY_DESCRIPTOR *descr, GUID **types, ULONG count, BOOLEAN is_container, ULONG flags, + HANDLE token, PGENERIC_MAPPING mapping ) +{ + FIXME("semi-stub\n"); + return RtlNewSecurityObjectEx(parent, creator, descr, NULL, is_container, flags, token, mapping); +} + +/****************************************************************************** + * RtlDeleteSecurityObject [NTDLL.@] + */ +NTSTATUS WINAPI RtlDeleteSecurityObject( PSECURITY_DESCRIPTOR *descr ) +{ + FIXME("%p stub.\n", descr); + RtlFreeHeap( GetProcessHeap(), 0, *descr ); + return STATUS_SUCCESS; +} /* * access control list's diff --git a/include/winternl.h b/include/winternl.h index fea26bf26c6..5c564373fed 100644 --- a/include/winternl.h +++ b/include/winternl.h @@ -4447,6 +4447,9 @@ NTSYSAPI void WINAPI RtlMapGenericMask(PACCESS_MASK,const GENERIC_MAPPING*) NTSYSAPI NTSTATUS WINAPI RtlMultiByteToUnicodeN(LPWSTR,DWORD,LPDWORD,LPCSTR,DWORD); NTSYSAPI NTSTATUS WINAPI RtlMultiByteToUnicodeSize(DWORD*,LPCSTR,ULONG); NTSYSAPI NTSTATUS WINAPI RtlNewSecurityObject(PSECURITY_DESCRIPTOR,PSECURITY_DESCRIPTOR,PSECURITY_DESCRIPTOR*,BOOLEAN,HANDLE,PGENERIC_MAPPING); +NTSYSAPI NTSTATUS WINAPI RtlNewSecurityObjectEx(PSECURITY_DESCRIPTOR,PSECURITY_DESCRIPTOR,PSECURITY_DESCRIPTOR*,GUID*,BOOLEAN,ULONG,HANDLE,PGENERIC_MAPPING); +NTSYSAPI NTSTATUS WINAPI RtlNewSecurityObjectWithMultipleInheritance(PSECURITY_DESCRIPTOR,PSECURITY_DESCRIPTOR,PSECURITY_DESCRIPTOR*, + GUID **,ULONG,BOOLEAN,ULONG,HANDLE,PGENERIC_MAPPING); NTSYSAPI PRTL_USER_PROCESS_PARAMETERS WINAPI RtlNormalizeProcessParams(RTL_USER_PROCESS_PARAMETERS*); NTSYSAPI NTSTATUS WINAPI RtlNormalizeString(ULONG,const WCHAR*,INT,WCHAR*,INT*); NTSYSAPI ULONG WINAPI RtlNtStatusToDosError(NTSTATUS);
1
0
0
0
Michael Stefaniuc : makedep: Use ARRAY_SIZE instead of open coding it.
by Alexandre Julliard
25 Oct '22
25 Oct '22
Module: wine Branch: master Commit: 43eccadceb6dbdd2a7c31734e963effa3c678646 URL:
https://gitlab.winehq.org/wine/wine/-/commit/43eccadceb6dbdd2a7c31734e963ef…
Author: Michael Stefaniuc <mstefani(a)winehq.org> Date: Sun Oct 16 21:51:57 2022 +0200 makedep: Use ARRAY_SIZE instead of open coding it. --- tools/makedep.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/tools/makedep.c b/tools/makedep.c index 7100cacaf86..2395835ff72 100644 --- a/tools/makedep.c +++ b/tools/makedep.c @@ -402,7 +402,7 @@ static const char *normalize_arch( const char *arch ) { "arm" }, }; - for (i = 0; i < sizeof(map) / sizeof(map[0]); i++) + for (i = 0; i < ARRAY_SIZE(map); i++) for (j = 0; map[i][j]; j++) if (!strncmp( arch, map[i][j], strlen(map[i][j]) )) return map[i][0]; @@ -1201,7 +1201,7 @@ static struct file *load_file( const char *name ) input_file_name = file->name; input_line = 0; - for (i = 0; i < sizeof(parse_functions) / sizeof(parse_functions[0]); i++) + for (i = 0; i < ARRAY_SIZE(parse_functions); i++) { if (!strendswith( name, parse_functions[i].ext )) continue; parse_functions[i].parse( file, f ); @@ -2585,7 +2585,7 @@ static void output_uninstall_rules( struct makefile *make ) } strarray_qsort( &uninstall_dirs, cmp_string_length ); output( "\t-rmdir" ); - for (i = 0; i < sizeof(dirs_order)/sizeof(dirs_order[0]); i++) + for (i = 0; i < ARRAY_SIZE(dirs_order); i++) { for (j = 0; j < uninstall_dirs.count; j++) { @@ -2767,7 +2767,7 @@ static void output_source_idl( struct makefile *make, struct incl_file *source, if (find_include_file( make, strmake( "%s.h", obj ))) source->file->flags |= FLAG_IDL_HEADER; if (!source->file->flags) return; - for (i = 0; i < sizeof(idl_outputs) / sizeof(idl_outputs[0]); i++) + for (i = 0; i < ARRAY_SIZE(idl_outputs); i++) { if (!(source->file->flags & idl_outputs[i].flag)) continue; dest = strmake( "%s%s", obj, idl_outputs[i].ext ); @@ -4026,7 +4026,7 @@ static void output_silent_rules(void) unsigned int i; output( "V = 0\n" ); - for (i = 0; i < sizeof(cmds) / sizeof(cmds[0]); i++) + for (i = 0; i < ARRAY_SIZE(cmds); i++) { output( "quiet_%s = $(quiet_%s_$(V))\n", cmds[i], cmds[i] ); output( "quiet_%s_0 = @echo \" %-5s \" $@;\n", cmds[i], cmds[i] );
1
0
0
0
Michael Stefaniuc : wrc: Use ARRAY_SIZE instead of open coding it.
by Alexandre Julliard
25 Oct '22
25 Oct '22
Module: wine Branch: master Commit: 191bc277a1584c283a9e4a3c9059e6c4ce26482e URL:
https://gitlab.winehq.org/wine/wine/-/commit/191bc277a1584c283a9e4a3c9059e6…
Author: Michael Stefaniuc <mstefani(a)winehq.org> Date: Fri Jul 1 20:04:19 2022 +0200 wrc: Use ARRAY_SIZE instead of open coding it. --- tools/wrc/wrc.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/wrc/wrc.c b/tools/wrc/wrc.c index c3dfa418571..2448fff11eb 100644 --- a/tools/wrc/wrc.c +++ b/tools/wrc/wrc.c @@ -302,7 +302,7 @@ static void init_argv0_dir( const char *argv0 ) 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, sizeof(pathname)/sizeof(pathname[0]), path, &path_size, NULL, 0 )) + if (!sysctl( pathname, ARRAY_SIZE(pathname), path, &path_size, NULL, 0 )) dir = realpath( path, NULL ); free( path ); #else
1
0
0
0
Michael Stefaniuc : wmc: Use ARRAY_SIZE instead of open coding it.
by Alexandre Julliard
25 Oct '22
25 Oct '22
Module: wine Branch: master Commit: 534a3082ef139b58828d9e41946093469ed50d06 URL:
https://gitlab.winehq.org/wine/wine/-/commit/534a3082ef139b58828d9e41946093…
Author: Michael Stefaniuc <mstefani(a)winehq.org> Date: Fri Jul 1 20:03:51 2022 +0200 wmc: Use ARRAY_SIZE instead of open coding it. --- tools/wmc/wmc.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/wmc/wmc.c b/tools/wmc/wmc.c index 7ca339fbeef..f5ff7abcdf9 100644 --- a/tools/wmc/wmc.c +++ b/tools/wmc/wmc.c @@ -158,7 +158,7 @@ static void init_argv0_dir( const char *argv0 ) 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, sizeof(pathname)/sizeof(pathname[0]), path, &path_size, NULL, 0 )) + if (!sysctl( pathname, ARRAY_SIZE(pathname), path, &path_size, NULL, 0 )) dir = realpath( path, NULL ); free( path ); #else
1
0
0
0
Michael Stefaniuc : winegcc: Use ARRAY_SIZE instead of open coding it.
by Alexandre Julliard
25 Oct '22
25 Oct '22
Module: wine Branch: master Commit: b46eef7e2a12da77854700fb4e494b170fe10dae URL:
https://gitlab.winehq.org/wine/wine/-/commit/b46eef7e2a12da77854700fb4e494b…
Author: Michael Stefaniuc <mstefani(a)winehq.org> Date: Fri Jul 1 20:03:05 2022 +0200 winegcc: Use ARRAY_SIZE instead of open coding it. --- tools/winegcc/winegcc.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/winegcc/winegcc.c b/tools/winegcc/winegcc.c index ab26adb07e8..e40aa9270ec 100644 --- a/tools/winegcc/winegcc.c +++ b/tools/winegcc/winegcc.c @@ -660,7 +660,7 @@ static void init_argv0_dir( const char *argv0 ) 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, sizeof(pathname)/sizeof(pathname[0]), path, &path_size, NULL, 0 )) + if (!sysctl( pathname, ARRAY_SIZE(pathname), path, &path_size, NULL, 0 )) dir = realpath( path, NULL ); free( path ); #else
1
0
0
0
Michael Stefaniuc : widl: Use ARRAY_SIZE instead of open coding it.
by Alexandre Julliard
25 Oct '22
25 Oct '22
Module: wine Branch: master Commit: 7029bba31a9df08a7e188bbbd5e820b115a0a2fa URL:
https://gitlab.winehq.org/wine/wine/-/commit/7029bba31a9df08a7e188bbbd5e820…
Author: Michael Stefaniuc <mstefani(a)winehq.org> Date: Fri Jul 1 20:01:30 2022 +0200 widl: Use ARRAY_SIZE instead of open coding it. --- tools/widl/widl.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/widl/widl.c b/tools/widl/widl.c index 7b2276b0a41..1a0b57f8f88 100644 --- a/tools/widl/widl.c +++ b/tools/widl/widl.c @@ -490,7 +490,7 @@ static void init_argv0_dir( const char *argv0 ) 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, sizeof(pathname)/sizeof(pathname[0]), path, &path_size, NULL, 0 )) + if (!sysctl( pathname, ARRAY_SIZE(pathname), path, &path_size, NULL, 0 )) dir = realpath( path, NULL ); free( path ); #else
1
0
0
0
Michael Stefaniuc : libs/wine: Use ARRAY_SIZE instead of open coding it.
by Alexandre Julliard
25 Oct '22
25 Oct '22
Module: wine Branch: master Commit: 24a7497bab1a8c0ab3b0575f21e42726603e1b17 URL:
https://gitlab.winehq.org/wine/wine/-/commit/24a7497bab1a8c0ab3b0575f21e427…
Author: Michael Stefaniuc <mstefani(a)winehq.org> Date: Tue Oct 18 19:04:49 2022 +0200 libs/wine: Use ARRAY_SIZE instead of open coding it. --- libs/wine/config.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libs/wine/config.c b/libs/wine/config.c index 23c76fda128..4eb446258cc 100644 --- a/libs/wine/config.c +++ b/libs/wine/config.c @@ -147,7 +147,7 @@ static char *get_runtime_exedir(void) static int pathname[] = { CTL_KERN, KERN_PROC, KERN_PROC_PATHNAME, -1 }; size_t dir_size = PATH_MAX; char *dir = malloc( dir_size ); - if (dir && !sysctl( pathname, sizeof(pathname)/sizeof(pathname[0]), dir, &dir_size, NULL, 0 )) + if (dir && !sysctl( pathname, ARRAY_SIZE( pathname ), dir, &dir_size, NULL, 0 )) return dir; free( dir ); return NULL;
1
0
0
0
← Newer
1
...
10
11
12
13
14
15
16
...
54
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
Results per page:
10
25
50
100
200