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
March 2016
----- 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
722 discussions
Start a n
N
ew thread
Alexandre Julliard : winebuild: Add a separate structure to store the data of imported functions.
by Alexandre Julliard
22 Mar '16
22 Mar '16
Module: wine Branch: master Commit: 77a13f69b41e98ac6321745b57f0a8250ee92914 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=77a13f69b41e98ac6321745b5…
Author: Alexandre Julliard <julliard(a)winehq.org> Date: Tue Mar 22 16:34:35 2016 +0900 winebuild: Add a separate structure to store the data of imported functions. We only need the name and ordinal. Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- tools/winebuild/import.c | 101 +++++++++++++++++++++++++++-------------------- 1 file changed, 58 insertions(+), 43 deletions(-) diff --git a/tools/winebuild/import.c b/tools/winebuild/import.c index f6c70de..b549db8 100644 --- a/tools/winebuild/import.c +++ b/tools/winebuild/import.c @@ -38,18 +38,26 @@ #include "wine/list.h" #include "build.h" +struct import_func +{ + const char *name; + const char *export_name; + int ordinal; +}; + struct import { - struct list entry; /* entry in global dll list */ - char *dll_name; /* exported file name of the dll */ - char *c_name; /* dll name as a C-compatible identifier */ - char *full_name; /* full name of the input file */ - dev_t dev; /* device/inode of the input file */ - ino_t ino; - ORDDEF **exports; /* functions exported from this dll */ - int nb_exports; /* number of exported functions */ - ORDDEF **imports; /* functions we want to import from this dll */ - int nb_imports; /* number of imported functions */ + struct list entry; /* entry in global dll list */ + char *dll_name; /* exported file name of the dll */ + char *c_name; /* dll name as a C-compatible identifier */ + char *full_name; /* full name of the input file */ + dev_t dev; /* device/inode of the input file */ + ino_t ino; + ORDDEF **exports; /* functions exported from this dll */ + int nb_exports; /* number of exported functions */ + struct import_func *imports; /* functions we want to import from this dll */ + int nb_imports; /* number of imported functions */ + int max_imports; /* size of imports array */ }; static struct strarray undef_symbols; /* list of undefined symbols */ @@ -298,10 +306,18 @@ void add_extra_ld_symbol( const char *name ) } /* add a function to the list of imports from a given dll */ -static void add_import_func( struct import *imp, ORDDEF *func ) +static void add_import_func( struct import *imp, const char *name, const char *export_name, int ordinal ) { - imp->imports = xrealloc( imp->imports, (imp->nb_imports+1) * sizeof(*imp->imports) ); - imp->imports[imp->nb_imports++] = func; + if (imp->nb_imports == imp->max_imports) + { + imp->max_imports *= 2; + if (imp->max_imports < 32) imp->max_imports = 32; + imp->imports = xrealloc( imp->imports, imp->max_imports * sizeof(*imp->imports) ); + } + imp->imports[imp->nb_imports].name = name; + imp->imports[imp->nb_imports].export_name = export_name; + imp->imports[imp->nb_imports].ordinal = ordinal; + imp->nb_imports++; } /* get the default entry point for a given spec file */ @@ -534,7 +550,8 @@ void resolve_dll_imports( DLLSPEC *spec, struct list *list ) odp->link_name, imp->dll_name ); else { - add_import_func( imp, odp ); + add_import_func( imp, (odp->flags & FLAG_NONAME) ? NULL : odp->name, + odp->export_name, odp->ordinal ); remove_name( &undef_symbols, j-- ); removed++; } @@ -693,16 +710,16 @@ static void output_immediate_imports(void) { for (j = 0; j < import->nb_imports; j++) { - ORDDEF *odp = import->imports[j]; - if (!(odp->flags & FLAG_NONAME)) + struct import_func *func = &import->imports[j]; + if (func->name) output( "\t%s .L__wine_spec_import_data_%s_%s-.L__wine_spec_rva_base\n", - get_asm_ptr_keyword(), import->c_name, odp->name ); + get_asm_ptr_keyword(), import->c_name, func->name ); else { if (get_ptr_size() == 8) - output( "\t.quad 0x800000000000%04x\n", odp->ordinal ); + output( "\t.quad 0x800000000000%04x\n", func->ordinal ); else - output( "\t.long 0x8000%04x\n", odp->ordinal ); + output( "\t.long 0x8000%04x\n", func->ordinal ); } } output( "\t%s 0\n", get_asm_ptr_keyword() ); @@ -719,14 +736,12 @@ static void output_immediate_imports(void) { for (j = 0; j < import->nb_imports; j++) { - ORDDEF *odp = import->imports[j]; - if (!(odp->flags & FLAG_NONAME)) - { - output( "\t.align %d\n", get_alignment(2) ); - output( ".L__wine_spec_import_data_%s_%s:\n", import->c_name, odp->name ); - output( "\t.short %d\n", odp->ordinal ); - output( "\t%s \"%s\"\n", get_asm_string_keyword(), odp->name ); - } + struct import_func *func = &import->imports[j]; + if (!func->name) continue; + output( "\t.align %d\n", get_alignment(2) ); + output( ".L__wine_spec_import_data_%s_%s:\n", import->c_name, func->name ); + output( "\t.short %d\n", func->ordinal ); + output( "\t%s \"%s\"\n", get_asm_string_keyword(), func->name ); } } @@ -756,8 +771,8 @@ static void output_immediate_import_thunks(void) { for (j = 0; j < import->nb_imports; j++, pos += get_ptr_size()) { - ORDDEF *odp = import->imports[j]; - output_import_thunk( odp->name ? odp->name : odp->export_name, + struct import_func *func = &import->imports[j]; + output_import_thunk( func->name ? func->name : func->export_name, ".L__wine_spec_import_data_ptrs", pos ); } pos += get_ptr_size(); @@ -812,8 +827,8 @@ static void output_delayed_imports( const DLLSPEC *spec ) { for (j = 0; j < import->nb_imports; j++) { - ORDDEF *odp = import->imports[j]; - const char *name = odp->name ? odp->name : odp->export_name; + struct import_func *func = &import->imports[j]; + const char *name = func->name ? func->name : func->export_name; output( "\t%s .L__wine_delay_imp_%s_%s\n", get_asm_ptr_keyword(), import->c_name, name ); } @@ -824,12 +839,12 @@ static void output_delayed_imports( const DLLSPEC *spec ) { for (j = 0; j < import->nb_imports; j++) { - ORDDEF *odp = import->imports[j]; - if (!odp->name) - output( "\t%s %d\n", get_asm_ptr_keyword(), odp->ordinal ); + struct import_func *func = &import->imports[j]; + if (!func->name) + output( "\t%s %d\n", get_asm_ptr_keyword(), func->ordinal ); else output( "\t%s .L__wine_delay_data_%s_%s\n", - get_asm_ptr_keyword(), import->c_name, odp->name ); + get_asm_ptr_keyword(), import->c_name, func->name ); } } @@ -849,10 +864,10 @@ static void output_delayed_imports( const DLLSPEC *spec ) { for (j = 0; j < import->nb_imports; j++) { - ORDDEF *odp = import->imports[j]; - if (!odp->name) continue; - output( ".L__wine_delay_data_%s_%s:\n", import->c_name, odp->name ); - output( "\t%s \"%s\"\n", get_asm_string_keyword(), odp->name ); + struct import_func *func = &import->imports[j]; + if (!func->name) continue; + output( ".L__wine_delay_data_%s_%s:\n", import->c_name, func->name ); + output( "\t%s \"%s\"\n", get_asm_string_keyword(), func->name ); } } output_function_size( "__wine_spec_delay_imports" ); @@ -998,8 +1013,8 @@ static void output_delayed_import_thunks( const DLLSPEC *spec ) { for (j = 0; j < import->nb_imports; j++) { - ORDDEF *odp = import->imports[j]; - const char *name = odp->name ? odp->name : odp->export_name; + struct import_func *func = &import->imports[j]; + const char *name = func->name ? func->name : func->export_name; output( ".L__wine_delay_imp_%s_%s:\n", import->c_name, name ); output_cfi( ".cfi_startproc" ); @@ -1082,8 +1097,8 @@ static void output_delayed_import_thunks( const DLLSPEC *spec ) { for (j = 0; j < import->nb_imports; j++, pos += get_ptr_size()) { - ORDDEF *odp = import->imports[j]; - output_import_thunk( odp->name ? odp->name : odp->export_name, + struct import_func *func = &import->imports[j]; + output_import_thunk( func->name ? func->name : func->export_name, ".L__wine_delay_IAT", pos ); } }
1
0
0
0
Alexandre Julliard : winebuild: Store delayed imports in a separate list.
by Alexandre Julliard
22 Mar '16
22 Mar '16
Module: wine Branch: master Commit: 68614d5db27b3b09859a439a550d4d0b9d1a2337 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=68614d5db27b3b09859a439a5…
Author: Alexandre Julliard <julliard(a)winehq.org> Date: Tue Mar 22 16:05:14 2016 +0900 winebuild: Store delayed imports in a separate list. Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- tools/winebuild/import.c | 115 ++++++++++++++++++++++------------------------- 1 file changed, 54 insertions(+), 61 deletions(-) Diff:
http://source.winehq.org/git/wine.git/?a=commitdiff;h=68614d5db27b3b09859a4…
1
0
0
0
Alexandre Julliard : winebuild: Store dll imports in a list instead of an array.
by Alexandre Julliard
22 Mar '16
22 Mar '16
Module: wine Branch: master Commit: 9b70b6bd13247afde1771cef0a92b2b7a7cdeb6d URL:
http://source.winehq.org/git/wine.git/?a=commit;h=9b70b6bd13247afde1771cef0…
Author: Alexandre Julliard <julliard(a)winehq.org> Date: Tue Mar 22 14:56:49 2016 +0900 winebuild: Store dll imports in a list instead of an array. Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- tools/winebuild/import.c | 186 +++++++++++++++++++++++------------------------ 1 file changed, 92 insertions(+), 94 deletions(-) Diff:
http://source.winehq.org/git/wine.git/?a=commitdiff;h=9b70b6bd13247afde1771…
1
0
0
0
Alexandre Julliard : winebuild: Store a C-compatible version of the dll name.
by Alexandre Julliard
22 Mar '16
22 Mar '16
Module: wine Branch: master Commit: 05399ad711bdbf5038ded66e42f29f00b85e76b4 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=05399ad711bdbf5038ded66e4…
Author: Alexandre Julliard <julliard(a)winehq.org> Date: Tue Mar 22 15:06:27 2016 +0900 winebuild: Store a C-compatible version of the dll name. Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- tools/winebuild/build.h | 3 ++- tools/winebuild/import.c | 16 +++++++--------- tools/winebuild/main.c | 1 + tools/winebuild/spec16.c | 13 +++++-------- tools/winebuild/utils.c | 30 ++++++++---------------------- 5 files changed, 23 insertions(+), 40 deletions(-) Diff:
http://source.winehq.org/git/wine.git/?a=commitdiff;h=05399ad711bdbf5038ded…
1
0
0
0
Alexandre Julliard : winebuild: Don' t store the full spec for an imported dll.
by Alexandre Julliard
22 Mar '16
22 Mar '16
Module: wine Branch: master Commit: 8e10ae6705bd3033ce29c229ebb34b0a227b455e URL:
http://source.winehq.org/git/wine.git/?a=commit;h=8e10ae6705bd3033ce29c229e…
Author: Alexandre Julliard <julliard(a)winehq.org> Date: Tue Mar 22 14:33:17 2016 +0900 winebuild: Don't store the full spec for an imported dll. We only need the dll name. Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- tools/winebuild/import.c | 76 ++++++++++++++++++++++-------------------------- 1 file changed, 35 insertions(+), 41 deletions(-) diff --git a/tools/winebuild/import.c b/tools/winebuild/import.c index 4446dff..b0373f7 100644 --- a/tools/winebuild/import.c +++ b/tools/winebuild/import.c @@ -39,7 +39,7 @@ struct import { - DLLSPEC *spec; /* description of the imported dll */ + char *dll_name; /* exported file name of the dll */ char *full_name; /* full name of the input file */ dev_t dev; /* device/inode of the input file */ ino_t ino; @@ -129,7 +129,7 @@ static void free_imports( struct import *imp ) { free( imp->exports ); free( imp->imports ); - free_dll_spec( imp->spec ); + free( imp->dll_name ); free( imp->full_name ); free( imp ); } @@ -153,7 +153,7 @@ static struct import *is_already_imported( const char *name ) for (i = 0; i < nb_imports; i++) { - if (!strcmp( dll_imports[i]->spec->file_name, name )) return dll_imports[i]; + if (!strcmp( dll_imports[i]->dll_name, name )) return dll_imports[i]; } return NULL; } @@ -191,22 +191,20 @@ static char *find_library( const char *name ) } /* read in the list of exported symbols of an import library */ -static int read_import_lib( struct import *imp ) +static DLLSPEC *read_import_lib( struct import *imp ) { FILE *f; - int i, ret; + int i; struct stat stat; struct import *prev_imp; - DLLSPEC *spec = imp->spec; - int delayed = is_delayed_import( spec->file_name ); + DLLSPEC *spec = alloc_dll_spec(); f = open_input_file( NULL, imp->full_name ); fstat( fileno(f), &stat ); imp->dev = stat.st_dev; imp->ino = stat.st_ino; - ret = parse_def_file( f, spec ); + if (!parse_def_file( f, spec )) exit( 1 ); close_input_file( f ); - if (!ret) return 0; /* check if we already imported that library from a different file */ if ((prev_imp = is_already_imported( spec->file_name ))) @@ -214,13 +212,8 @@ static int read_import_lib( struct import *imp ) if (prev_imp->dev != imp->dev || prev_imp->ino != imp->ino) fatal_error( "%s and %s have the same export name '%s'\n", prev_imp->full_name, imp->full_name, spec->file_name ); - return 0; /* the same file was already loaded, ignore this one */ - } - - if (delayed) - { - imp->delay = 1; - nb_delayed++; + free_dll_spec( spec ); + return NULL; /* the same file was already loaded, ignore this one */ } if (spec->nb_entry_points) @@ -230,7 +223,7 @@ static int read_import_lib( struct import *imp ) imp->exports[imp->nb_exports++] = &spec->entry_points[i]; qsort( imp->exports, imp->nb_exports, sizeof(*imp->exports), func_cmp ); } - return 1; + return spec; } /* build the dll exported name from the import lib name or path */ @@ -260,29 +253,30 @@ static char *get_dll_name( const char *name, const char *filename ) /* add a dll to the list of imports */ void add_import_dll( const char *name, const char *filename ) { + DLLSPEC *spec; + char *dll_name = get_dll_name( name, filename ); struct import *imp = xmalloc( sizeof(*imp) ); - imp->spec = alloc_dll_spec(); - imp->spec->file_name = get_dll_name( name, filename ); - imp->delay = 0; - imp->imports = NULL; - imp->nb_imports = 0; - imp->exports = NULL; - imp->nb_exports = 0; + memset( imp, 0, sizeof(*imp) ); if (filename) imp->full_name = xstrdup( filename ); else imp->full_name = find_library( name ); - if (read_import_lib( imp )) + if (!(spec = read_import_lib( imp ))) { - dll_imports = xrealloc( dll_imports, (nb_imports+1) * sizeof(*dll_imports) ); - dll_imports[nb_imports++] = imp; + free_imports( imp ); + return; } - else + + imp->dll_name = spec->file_name ? spec->file_name : dll_name; + + if (is_delayed_import( dll_name )) { - free_imports( imp ); - if (nb_errors) exit(1); + imp->delay = 1; + nb_delayed++; } + dll_imports = xrealloc( dll_imports, (nb_imports+1) * sizeof(*dll_imports) ); + dll_imports[nb_imports++] = imp; } /* add a library to the list of delayed imports */ @@ -359,7 +353,7 @@ static void add_extra_undef_symbols( DLLSPEC *spec ) static int check_unused( const struct import* imp, const DLLSPEC *spec ) { int i; - const char *file_name = imp->spec->file_name; + const char *file_name = imp->dll_name; size_t len = strlen( file_name ); const char *p = strchr( file_name, '.' ); if (p && !strcasecmp( p, ".dll" )) len = p - file_name; @@ -397,10 +391,10 @@ static void check_undefined_forwards( DLLSPEC *spec ) { struct import *imp = dll_imports[j]; - if (strcasecmp( imp->spec->file_name, dll_name )) continue; + if (strcasecmp( imp->dll_name, dll_name )) continue; if (!find_export( api_name, imp->exports, imp->nb_exports )) warning( "%s:%d: forward '%s' not found in %s\n", - spec->src_name, odp->lineno, odp->link_name, imp->spec->file_name ); + spec->src_name, odp->lineno, odp->link_name, imp->dll_name ); break; } if (j == nb_imports) @@ -550,7 +544,7 @@ void resolve_imports( DLLSPEC *spec ) if (odp->flags & FLAG_PRIVATE) continue; if (odp->type != TYPE_STDCALL && odp->type != TYPE_CDECL) warning( "winebuild: Data export '%s' cannot be imported from %s\n", - odp->link_name, imp->spec->file_name ); + odp->link_name, imp->dll_name ); else { add_import_func( imp, odp ); @@ -563,7 +557,7 @@ void resolve_imports( DLLSPEC *spec ) { /* the dll is not used, get rid of it */ if (check_unused( imp, spec )) - warning( "winebuild: %s imported but no symbols used\n", imp->spec->file_name ); + warning( "winebuild: %s imported but no symbols used\n", imp->dll_name ); remove_import_dll( i ); i--; } @@ -683,7 +677,7 @@ static void output_immediate_imports(void) for (i = j = 0; i < nb_imports; i++) { if (dll_imports[i]->delay) continue; - dll_name = make_c_identifier( dll_imports[i]->spec->file_name ); + dll_name = make_c_identifier( dll_imports[i]->dll_name ); output( "\t.long .L__wine_spec_import_data_names+%d-.L__wine_spec_rva_base\n", /* OriginalFirstThunk */ j * get_ptr_size() ); output( "\t.long 0\n" ); /* TimeDateStamp */ @@ -705,7 +699,7 @@ static void output_immediate_imports(void) for (i = 0; i < nb_imports; i++) { if (dll_imports[i]->delay) continue; - dll_name = make_c_identifier( dll_imports[i]->spec->file_name ); + dll_name = make_c_identifier( dll_imports[i]->dll_name ); for (j = 0; j < dll_imports[i]->nb_imports; j++) { ORDDEF *odp = dll_imports[i]->imports[j]; @@ -734,7 +728,7 @@ static void output_immediate_imports(void) for (i = 0; i < nb_imports; i++) { if (dll_imports[i]->delay) continue; - dll_name = make_c_identifier( dll_imports[i]->spec->file_name ); + dll_name = make_c_identifier( dll_imports[i]->dll_name ); for (j = 0; j < dll_imports[i]->nb_imports; j++) { ORDDEF *odp = dll_imports[i]->imports[j]; @@ -751,9 +745,9 @@ static void output_immediate_imports(void) for (i = 0; i < nb_imports; i++) { if (dll_imports[i]->delay) continue; - dll_name = make_c_identifier( dll_imports[i]->spec->file_name ); + dll_name = make_c_identifier( dll_imports[i]->dll_name ); output( ".L__wine_spec_import_name_%s:\n\t%s \"%s\"\n", - dll_name, get_asm_string_keyword(), dll_imports[i]->spec->file_name ); + dll_name, get_asm_string_keyword(), dll_imports[i]->dll_name ); } } @@ -865,7 +859,7 @@ static void output_delayed_imports( const DLLSPEC *spec ) if (!dll_imports[i]->delay) continue; output( ".L__wine_delay_name_%d:\n", i ); output( "\t%s \"%s\"\n", - get_asm_string_keyword(), dll_imports[i]->spec->file_name ); + get_asm_string_keyword(), dll_imports[i]->dll_name ); } for (i = 0; i < nb_imports; i++)
1
0
0
0
Austin English : include: Fix GetCurrentConsoleFontEx/ SetCurrentConsoleFontEx definition.
by Alexandre Julliard
22 Mar '16
22 Mar '16
Module: wine Branch: master Commit: 96ab323cf94db458343553f180dd8cbb8440e3cf URL:
http://source.winehq.org/git/wine.git/?a=commit;h=96ab323cf94db458343553f18…
Author: Austin English <austinenglish(a)gmail.com> Date: Mon Mar 21 23:20:12 2016 -0500 include: Fix GetCurrentConsoleFontEx/SetCurrentConsoleFontEx definition. Signed-off-by: Austin English <austinenglish(a)gmail.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- include/wincon.h | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/include/wincon.h b/include/wincon.h index 94fb0f8..8f4d54c 100644 --- a/include/wincon.h +++ b/include/wincon.h @@ -125,6 +125,9 @@ typedef struct _CONSOLE_FONT_INFOEX UINT FontWeight; WCHAR FaceName[LF_FACESIZE]; } CONSOLE_FONT_INFOEX,*LPCONSOLE_FONT_INFOEX; + +WINBASEAPI BOOL WINAPI GetCurrentConsoleFontEx(HANDLE,BOOL,LPCONSOLE_FONT_INFOEX); +WINBASEAPI BOOL WINAPI SetCurrentConsoleFontEx(HANDLE,BOOL,LPCONSOLE_FONT_INFOEX); #endif typedef struct tagCONSOLE_HISTORY_INFO @@ -347,7 +350,6 @@ WINBASEAPI DWORD WINAPI GetConsoleTitleW(LPWSTR,DWORD); #define GetConsoleTitle WINELIB_NAME_AW(GetConsoleTitle) WINBASEAPI HWND WINAPI GetConsoleWindow(void); WINBASEAPI BOOL WINAPI GetCurrentConsoleFont(HANDLE,BOOL,LPCONSOLE_FONT_INFO); -WINBASEAPI BOOL WINAPI GetCurrentConsoleFontEx(HANDLE,BOOL,LPCONSOLE_FONT_INFOEX); WINBASEAPI BOOL WINAPI GetNumberOfConsoleInputEvents( HANDLE,LPDWORD); WINBASEAPI BOOL WINAPI GetNumberOfConsoleMouseButtons(LPDWORD); WINBASEAPI BOOL WINAPI PeekConsoleInputA( HANDLE,PINPUT_RECORD,DWORD,LPDWORD); @@ -385,7 +387,6 @@ WINBASEAPI BOOL WINAPI SetConsoleTitleA(LPCSTR); WINBASEAPI BOOL WINAPI SetConsoleTitleW(LPCWSTR); #define SetConsoleTitle WINELIB_NAME_AW(SetConsoleTitle) WINBASEAPI BOOL WINAPI SetConsoleWindowInfo( HANDLE,BOOL,LPSMALL_RECT); -WINBASEAPI BOOL WINAPI SetCurrentConsoleFontEx(HANDLE,BOOL,LPCONSOLE_FONT_INFOEX); WINBASEAPI BOOL WINAPI WriteConsoleA(HANDLE,const void *,DWORD,LPDWORD,void *); WINBASEAPI BOOL WINAPI WriteConsoleW(HANDLE,const void *,DWORD,LPDWORD,void *); #define WriteConsole WINELIB_NAME_AW(WriteConsole)
1
0
0
0
Thomas Faber : dbghelp: Use documented member name in SYMBOL_INFO structure.
by Alexandre Julliard
22 Mar '16
22 Mar '16
Module: wine Branch: master Commit: e91c06b068a7e93d1b1802e530aa89cc876ddcc0 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=e91c06b068a7e93d1b1802e53…
Author: Thomas Faber <thomas.faber(a)reactos.org> Date: Mon Mar 21 18:30:14 2016 +0100 dbghelp: Use documented member name in SYMBOL_INFO structure. Signed-off-by: Thomas Faber <thomas.faber(a)reactos.org> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/dbghelp/symbol.c | 6 +++--- dlls/dbghelp/type.c | 2 +- include/dbghelp.h | 2 +- programs/winedbg/symbol.c | 6 +++--- 4 files changed, 8 insertions(+), 8 deletions(-) diff --git a/dlls/dbghelp/symbol.c b/dlls/dbghelp/symbol.c index efcf7b6..08ea834 100644 --- a/dlls/dbghelp/symbol.c +++ b/dlls/dbghelp/symbol.c @@ -564,7 +564,7 @@ static void symt_fill_sym_info(struct module_pair* pair, if (!symt_get_info(pair->effective, sym, TI_GET_TYPE, &sym_info->TypeIndex)) sym_info->TypeIndex = 0; - sym_info->info = symt_ptr2index(pair->effective, sym); + sym_info->Index = symt_ptr2index(pair->effective, sym); sym_info->Reserved[0] = sym_info->Reserved[1] = 0; if (!symt_get_info(pair->effective, sym, TI_GET_LENGTH, &size) && (!sym_info->TypeIndex || @@ -723,7 +723,7 @@ static BOOL send_symbol(const struct sym_enum* se, struct module_pair* pair, const struct symt_function* func, const struct symt* sym) { symt_fill_sym_info(pair, func, sym, se->sym_info); - if (se->index && se->sym_info->info != se->index) return FALSE; + if (se->index && se->sym_info->Index != se->index) return FALSE; if (se->tag && se->sym_info->Tag != se->tag) return FALSE; if (se->addr && !(se->addr >= se->sym_info->Address && se->addr < se->sym_info->Address + se->sym_info->Size)) return FALSE; return !se->cb(se->sym_info, se->sym_info->Size, se->user); @@ -987,7 +987,7 @@ void copy_symbolW(SYMBOL_INFOW* siw, const SYMBOL_INFO* si) siw->TypeIndex = si->TypeIndex; siw->Reserved[0] = si->Reserved[0]; siw->Reserved[1] = si->Reserved[1]; - siw->Index = si->info; /* FIXME: see dbghelp.h */ + siw->Index = si->Index; siw->Size = si->Size; siw->ModBase = si->ModBase; siw->Flags = si->Flags; diff --git a/dlls/dbghelp/type.c b/dlls/dbghelp/type.c index 6ccbc9a..5991366 100644 --- a/dlls/dbghelp/type.c +++ b/dlls/dbghelp/type.c @@ -471,7 +471,7 @@ BOOL WINAPI SymEnumTypes(HANDLE hProcess, ULONG64 BaseOfDll, { type = *(struct symt**)vector_at(&pair.effective->vtypes, i); sym_info->TypeIndex = symt_ptr2index(pair.effective, type); - sym_info->info = 0; /* FIXME */ + sym_info->Index = 0; /* FIXME */ symt_get_info(pair.effective, type, TI_GET_LENGTH, &size); sym_info->Size = size; sym_info->ModBase = pair.requested->module.BaseOfImage; diff --git a/include/dbghelp.h b/include/dbghelp.h index 483ef29..2fd9ef0 100644 --- a/include/dbghelp.h +++ b/include/dbghelp.h @@ -957,7 +957,7 @@ typedef struct _SYMBOL_INFO ULONG SizeOfStruct; ULONG TypeIndex; ULONG64 Reserved[2]; - ULONG info; /* sdk states info, while MSDN says it's Index... */ + ULONG Index; ULONG Size; ULONG64 ModBase; ULONG Flags; diff --git a/programs/winedbg/symbol.c b/programs/winedbg/symbol.c index c43cba9..1040187 100644 --- a/programs/winedbg/symbol.c +++ b/programs/winedbg/symbol.c @@ -99,7 +99,7 @@ static BOOL fill_sym_lvalue(const SYMBOL_INFO* sym, ULONG_PTR base, VARIANT v; type.module = sym->ModBase; - type.id = sym->info; + type.id = sym->Index; if (!types_get_info(&type, TI_GET_VALUE, &v)) { @@ -252,7 +252,7 @@ static BOOL CALLBACK sgv_cb(PSYMBOL_INFO sym, ULONG size, PVOID ctx) return TRUE; } sgv->syms[insp].flags = sym->Flags; - sgv->syms[insp].sym_info = sym->info; + sgv->syms[insp].sym_info = sym->Index; sgv->num++; return TRUE; @@ -614,7 +614,7 @@ enum dbg_line_status symbol_get_function_line_status(const ADDRESS64* addr) return dbg_no_line_info; func.module = sym->ModBase; - func.id = sym->info; + func.id = sym->Index; if (symbol_get_debug_start(&func, &start) && lin < start) return dbg_not_on_a_line_number;
1
0
0
0
Piotr Caban : msvcrt: Register exception object before unwinding.
by Alexandre Julliard
22 Mar '16
22 Mar '16
Module: wine Branch: master Commit: 3a0b3c5bc89178d332dd1117348d8785975afc18 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=3a0b3c5bc89178d332dd11173…
Author: Piotr Caban <piotr(a)codeweavers.com> Date: Mon Mar 21 19:16:06 2016 +0100 msvcrt: Register exception object before unwinding. Thrown object was incorrectly freed in following situation: try { try { throw obj; } catch(...) { throw; } } catch(...) { //use object here } Signed-off-by: Piotr Caban <piotr(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/msvcrt/except_i386.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/dlls/msvcrt/except_i386.c b/dlls/msvcrt/except_i386.c index 9adda79..3debece 100644 --- a/dlls/msvcrt/except_i386.c +++ b/dlls/msvcrt/except_i386.c @@ -446,6 +446,8 @@ static inline void call_catch_block( PEXCEPTION_RECORD rec, cxx_exception_frame TRACE("found catch(...) block\n"); } + __CxxRegisterExceptionObject(&rec, &nested_frame.frame_info); + /* unwind the stack */ RtlUnwind( catch_frame ? catch_frame : &frame->frame, 0, rec, 0 ); cxx_local_unwind( frame, descr, tryblock->start_level ); @@ -457,12 +459,10 @@ static inline void call_catch_block( PEXCEPTION_RECORD rec, cxx_exception_frame catchblock, catchblock->handler, &frame->ebp ); /* setup an exception block for nested exceptions */ - nested_frame.frame.Handler = catch_function_nested_handler; nested_frame.cxx_frame = frame; nested_frame.descr = descr; nested_frame.trylevel = nested_trylevel + 1; - __CxxRegisterExceptionObject(&rec, &nested_frame.frame_info); __wine_push_frame( &nested_frame.frame ); addr = call_ebp_func( catchblock->handler, &frame->ebp );
1
0
0
0
Piotr Caban : msvcrt: Restore exception object stored in thread storage after frames unwinding.
by Alexandre Julliard
22 Mar '16
22 Mar '16
Module: wine Branch: master Commit: fdcdbf306a7339c486c69346bcff0e6d5e0e58a9 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=fdcdbf306a7339c486c69346b…
Author: Piotr Caban <piotr(a)codeweavers.com> Date: Mon Mar 21 19:16:02 2016 +0100 msvcrt: Restore exception object stored in thread storage after frames unwinding. Signed-off-by: Piotr Caban <piotr(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/msvcrt/except_i386.c | 1 + 1 file changed, 1 insertion(+) diff --git a/dlls/msvcrt/except_i386.c b/dlls/msvcrt/except_i386.c index 418c68b..9adda79 100644 --- a/dlls/msvcrt/except_i386.c +++ b/dlls/msvcrt/except_i386.c @@ -450,6 +450,7 @@ static inline void call_catch_block( PEXCEPTION_RECORD rec, cxx_exception_frame RtlUnwind( catch_frame ? catch_frame : &frame->frame, 0, rec, 0 ); cxx_local_unwind( frame, descr, tryblock->start_level ); frame->trylevel = tryblock->end_level + 1; + msvcrt_get_thread_data()->exc_record = rec; /* call the catch block */ TRACE( "calling catch block %p addr %p ebp %p\n",
1
0
0
0
Piotr Caban : msvcrt: Dump exception information in x86_64 __CxxFrameHandler.
by Alexandre Julliard
22 Mar '16
22 Mar '16
Module: wine Branch: master Commit: 3350364d8b7f44e328c9e8f564a836ad23b4104f URL:
http://source.winehq.org/git/wine.git/?a=commit;h=3350364d8b7f44e328c9e8f56…
Author: Piotr Caban <piotr(a)codeweavers.com> Date: Mon Mar 21 18:23:34 2016 +0100 msvcrt: Dump exception information in x86_64 __CxxFrameHandler. Signed-off-by: Piotr Caban <piotr(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/msvcrt/except_x86_64.c | 157 +++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 156 insertions(+), 1 deletion(-) diff --git a/dlls/msvcrt/except_x86_64.c b/dlls/msvcrt/except_x86_64.c index 119680e..d31bc69 100644 --- a/dlls/msvcrt/except_x86_64.c +++ b/dlls/msvcrt/except_x86_64.c @@ -61,6 +61,160 @@ typedef struct _DISPATCHER_CONTEXT ULONG ScopeIndex; } DISPATCHER_CONTEXT; +typedef struct +{ + int prev; + UINT handler; +} unwind_info; + +typedef struct +{ + UINT flags; + UINT type_info; + int offset; + UINT handler; +} catchblock_info; + +typedef struct +{ + int start_level; + int end_level; + int catch_level; + int catchblock_count; + UINT catchblock; +} tryblock_info; + +typedef struct __cxx_function_descr +{ + UINT magic; + UINT unwind_count; + UINT unwind_table; + UINT tryblock_count; + UINT tryblock; + UINT ipmap_count; + UINT ipmap; + UINT unwind_help; + UINT expect_list; + UINT flags; +} cxx_function_descr; + +static inline void* rva_to_ptr(UINT rva, ULONG64 base) +{ + return rva ? (void*)(base+rva) : NULL; +} + +static inline void dump_type(UINT type_rva, ULONG64 base) +{ + const cxx_type_info *type = rva_to_ptr(type_rva, base); + + TRACE("flags %x type %x %s offsets %d,%d,%d size %d copy ctor %x(%p)\n", + type->flags, type->type_info, dbgstr_type_info(rva_to_ptr(type->type_info, base)), + type->offsets.this_offset, type->offsets.vbase_descr, type->offsets.vbase_offset, + type->size, type->copy_ctor, rva_to_ptr(type->copy_ctor, base)); +} + +static void dump_exception_type(const cxx_exception_type *type, ULONG64 base) +{ + const cxx_type_info_table *type_info_table = rva_to_ptr(type->type_info_table, base); + UINT i; + + TRACE("flags %x destr %x(%p) handler %x(%p) type info %x(%p)\n", + type->flags, type->destructor, rva_to_ptr(type->destructor, base), + type->custom_handler, rva_to_ptr(type->custom_handler, base), + type->type_info_table, type_info_table); + for (i = 0; i < type_info_table->count; i++) + { + TRACE(" %d: ", i); + dump_type(type_info_table->info[i], base); + } +} + +static void dump_function_descr(const cxx_function_descr *descr, ULONG64 image_base) +{ + unwind_info *unwind_table = rva_to_ptr(descr->unwind_table, image_base); + tryblock_info *tryblock = rva_to_ptr(descr->tryblock, image_base); + UINT i, j; + + TRACE("magic %x\n", descr->magic); + TRACE("unwind table: %x(%p) %d\n", descr->unwind_table, unwind_table, descr->unwind_count); + for (i=0; i<descr->unwind_count; i++) + { + TRACE(" %d: prev %d func %x(%p)\n", i, unwind_table[i].prev, + unwind_table[i].handler, rva_to_ptr(unwind_table[i].handler, image_base)); + } + TRACE("try table: %x(%p) %d\n", descr->tryblock, tryblock, descr->tryblock_count); + for (i=0; i<descr->tryblock_count; i++) + { + catchblock_info *catchblock = rva_to_ptr(tryblock[i].catchblock, image_base); + + TRACE(" %d: start %d end %d catchlevel %d catch%x(%p) %d\n", i, + tryblock[i].start_level, tryblock[i].end_level, + tryblock[i].catch_level, tryblock[i].catchblock, + catchblock, tryblock[i].catchblock_count); + for (j=0; j<tryblock[i].catchblock_count; j++) + { + TRACE(" %d: flags %x offset %d handler %x(%p) type %x %s\n", + j, catchblock->flags, catchblock->offset, catchblock->handler, + rva_to_ptr(catchblock->handler, image_base), catchblock->type_info, + dbgstr_type_info(rva_to_ptr(catchblock->type_info, image_base))); + } + } + TRACE("unwind_help %d\n", descr->unwind_help); + TRACE("expect list: %x\n", descr->expect_list); + TRACE("flags: %08x\n", descr->flags); +} + +static DWORD cxx_frame_handler(EXCEPTION_RECORD *rec, ULONG64 frame, + CONTEXT *context, DISPATCHER_CONTEXT *dispatch, + const cxx_function_descr *descr) +{ + cxx_exception_type *exc_type; + + if (descr->magic != CXX_FRAME_MAGIC_VC8) + { + FIXME("unhandled frame magic %x\n", descr->magic); + return ExceptionContinueSearch; + } + + if (rec->ExceptionFlags & (EH_UNWINDING|EH_EXIT_UNWIND)) + return ExceptionContinueSearch; + if (!descr->tryblock_count) return ExceptionContinueSearch; + + if (rec->ExceptionCode == CXX_EXCEPTION && + rec->ExceptionInformation[1] == 0 && rec->ExceptionInformation[2] == 0) + { + *rec = *msvcrt_get_thread_data()->exc_record; + rec->ExceptionFlags &= ~EH_UNWINDING; + if (TRACE_ON(seh)) { + TRACE("detect rethrow: exception code: %x\n", rec->ExceptionCode); + if (rec->ExceptionCode == CXX_EXCEPTION) + TRACE("re-propage: obj: %lx, type: %lx\n", + rec->ExceptionInformation[1], rec->ExceptionInformation[2]); + } + } + + if (rec->ExceptionCode == CXX_EXCEPTION) + { + exc_type = (cxx_exception_type *)rec->ExceptionInformation[2]; + + if (TRACE_ON(seh)) + { + TRACE("handling C++ exception rec %p frame %lx unwind_help %d descr %p\n", + rec, frame, *((INT*)(frame+descr->unwind_help)), descr); + dump_exception_type(exc_type, rec->ExceptionInformation[3]); + dump_function_descr(descr, dispatch->ImageBase); + } + } + else + { + exc_type = NULL; + TRACE("handling C exception code %x rec %p frame %lx unwind_help %d descr %p\n", + rec->ExceptionCode, rec, frame, *((INT*)(frame+descr->unwind_help)), descr); + } + + return ExceptionContinueSearch; +} + /********************************************************************* * __CxxExceptionFilter (MSVCRT.@) */ @@ -78,7 +232,8 @@ EXCEPTION_DISPOSITION CDECL __CxxFrameHandler( EXCEPTION_RECORD *rec, ULONG64 fr CONTEXT *context, DISPATCHER_CONTEXT *dispatch ) { FIXME( "%p %lx %p %p: not implemented\n", rec, frame, context, dispatch ); - return ExceptionContinueSearch; + return cxx_frame_handler( rec, frame, context, dispatch, + rva_to_ptr(*(UINT*)dispatch->HandlerData, dispatch->ImageBase) ); }
1
0
0
0
← Newer
1
...
25
26
27
28
29
30
31
...
73
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
Results per page:
10
25
50
100
200