winehq.org
Sign In
Sign Up
Sign In
Sign Up
Manage this list
×
Keyboard Shortcuts
Thread View
j
: Next unread message
k
: Previous unread message
j a
: Jump to all threads
j l
: Jump to MailingList overview
2025
February
January
2024
December
November
October
September
August
July
June
May
April
March
February
January
2023
December
November
October
September
August
July
June
May
April
March
February
January
2022
December
November
October
September
August
July
June
May
April
March
February
January
2021
December
November
October
September
August
July
June
May
April
March
February
January
2020
December
November
October
September
August
July
June
May
April
March
February
January
2019
December
November
October
September
August
July
June
May
April
March
February
January
2018
December
November
October
September
August
July
June
May
April
March
February
January
2017
December
November
October
September
August
July
June
May
April
March
February
January
2016
December
November
October
September
August
July
June
May
April
March
February
January
2015
December
November
October
September
August
July
June
May
April
March
February
January
2014
December
November
October
September
August
July
June
May
April
March
February
January
2013
December
November
October
September
August
July
June
May
April
March
February
January
2012
December
November
October
September
August
July
June
May
April
March
February
January
2011
December
November
October
September
August
July
June
May
April
March
February
January
2010
December
November
October
September
August
July
June
May
April
March
February
January
2009
December
November
October
September
August
July
June
May
April
March
February
January
2008
December
November
October
September
August
July
June
May
April
March
February
January
2007
December
November
October
September
August
July
June
May
April
March
February
January
2006
December
November
October
September
August
July
June
May
April
March
February
January
2005
December
November
October
September
August
July
June
May
April
March
February
January
2004
December
November
October
September
August
July
June
May
April
March
February
January
2003
December
November
October
September
August
July
June
May
April
March
February
January
2002
December
November
October
September
August
July
June
May
April
March
February
January
2001
December
November
October
September
August
July
June
May
April
March
February
List overview
wine-commits
November 2022
----- 2025 -----
February 2025
January 2025
----- 2024 -----
December 2024
November 2024
October 2024
September 2024
August 2024
July 2024
June 2024
May 2024
April 2024
March 2024
February 2024
January 2024
----- 2023 -----
December 2023
November 2023
October 2023
September 2023
August 2023
July 2023
June 2023
May 2023
April 2023
March 2023
February 2023
January 2023
----- 2022 -----
December 2022
November 2022
October 2022
September 2022
August 2022
July 2022
June 2022
May 2022
April 2022
March 2022
February 2022
January 2022
----- 2021 -----
December 2021
November 2021
October 2021
September 2021
August 2021
July 2021
June 2021
May 2021
April 2021
March 2021
February 2021
January 2021
----- 2020 -----
December 2020
November 2020
October 2020
September 2020
August 2020
July 2020
June 2020
May 2020
April 2020
March 2020
February 2020
January 2020
----- 2019 -----
December 2019
November 2019
October 2019
September 2019
August 2019
July 2019
June 2019
May 2019
April 2019
March 2019
February 2019
January 2019
----- 2018 -----
December 2018
November 2018
October 2018
September 2018
August 2018
July 2018
June 2018
May 2018
April 2018
March 2018
February 2018
January 2018
----- 2017 -----
December 2017
November 2017
October 2017
September 2017
August 2017
July 2017
June 2017
May 2017
April 2017
March 2017
February 2017
January 2017
----- 2016 -----
December 2016
November 2016
October 2016
September 2016
August 2016
July 2016
June 2016
May 2016
April 2016
March 2016
February 2016
January 2016
----- 2015 -----
December 2015
November 2015
October 2015
September 2015
August 2015
July 2015
June 2015
May 2015
April 2015
March 2015
February 2015
January 2015
----- 2014 -----
December 2014
November 2014
October 2014
September 2014
August 2014
July 2014
June 2014
May 2014
April 2014
March 2014
February 2014
January 2014
----- 2013 -----
December 2013
November 2013
October 2013
September 2013
August 2013
July 2013
June 2013
May 2013
April 2013
March 2013
February 2013
January 2013
----- 2012 -----
December 2012
November 2012
October 2012
September 2012
August 2012
July 2012
June 2012
May 2012
April 2012
March 2012
February 2012
January 2012
----- 2011 -----
December 2011
November 2011
October 2011
September 2011
August 2011
July 2011
June 2011
May 2011
April 2011
March 2011
February 2011
January 2011
----- 2010 -----
December 2010
November 2010
October 2010
September 2010
August 2010
July 2010
June 2010
May 2010
April 2010
March 2010
February 2010
January 2010
----- 2009 -----
December 2009
November 2009
October 2009
September 2009
August 2009
July 2009
June 2009
May 2009
April 2009
March 2009
February 2009
January 2009
----- 2008 -----
December 2008
November 2008
October 2008
September 2008
August 2008
July 2008
June 2008
May 2008
April 2008
March 2008
February 2008
January 2008
----- 2007 -----
December 2007
November 2007
October 2007
September 2007
August 2007
July 2007
June 2007
May 2007
April 2007
March 2007
February 2007
January 2007
----- 2006 -----
December 2006
November 2006
October 2006
September 2006
August 2006
July 2006
June 2006
May 2006
April 2006
March 2006
February 2006
January 2006
----- 2005 -----
December 2005
November 2005
October 2005
September 2005
August 2005
July 2005
June 2005
May 2005
April 2005
March 2005
February 2005
January 2005
----- 2004 -----
December 2004
November 2004
October 2004
September 2004
August 2004
July 2004
June 2004
May 2004
April 2004
March 2004
February 2004
January 2004
----- 2003 -----
December 2003
November 2003
October 2003
September 2003
August 2003
July 2003
June 2003
May 2003
April 2003
March 2003
February 2003
January 2003
----- 2002 -----
December 2002
November 2002
October 2002
September 2002
August 2002
July 2002
June 2002
May 2002
April 2002
March 2002
February 2002
January 2002
----- 2001 -----
December 2001
November 2001
October 2001
September 2001
August 2001
July 2001
June 2001
May 2001
April 2001
March 2001
February 2001
wine-commits@winehq.org
1 participants
1171 discussions
Start a n
N
ew thread
Ivo Ivanov : dinput: Prevent a potential array overflow error during the conversion from spherical to Cartesian coordinates.
by Alexandre Julliard
22 Nov '22
22 Nov '22
Module: wine Branch: master Commit: 29894e1c9a15bd81ea84c4e3082e8e8ac8c01c85 URL:
https://gitlab.winehq.org/wine/wine/-/commit/29894e1c9a15bd81ea84c4e3082e8e…
Author: Ivo Ivanov <logos128(a)gmail.com> Date: Tue Aug 9 02:21:22 2022 +0300 dinput: Prevent a potential array overflow error during the conversion from spherical to Cartesian coordinates. Signed-off-by: Ivo Ivanov <logos128(a)gmail.com> --- dlls/dinput/joystick_hid.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/dlls/dinput/joystick_hid.c b/dlls/dinput/joystick_hid.c index ebebbee6eb2..3ea15009d8f 100644 --- a/dlls/dinput/joystick_hid.c +++ b/dlls/dinput/joystick_hid.c @@ -2350,7 +2350,8 @@ static void convert_directions_from_spherical( const DIEFFECT *in, DIEFFECT *out tmp = cos( in->rglDirection[i - 1] * M_PI / 18000 ) * 10000; for (j = 0; j < i; ++j) out->rglDirection[j] = round( out->rglDirection[j] * tmp / 10000.0 ); - out->rglDirection[i] = sin( in->rglDirection[i - 1] * M_PI / 18000 ) * 10000; + if (i < in->cAxes) + out->rglDirection[i] = sin( in->rglDirection[i - 1] * M_PI / 18000 ) * 10000; } out->cAxes = in->cAxes; break;
1
0
0
0
Piotr Caban : gdi32: Get printer output file name in StartDoc.
by Alexandre Julliard
22 Nov '22
22 Nov '22
Module: wine Branch: master Commit: 1cf1412a12c6ee6191d387162fecb456f0df2d89 URL:
https://gitlab.winehq.org/wine/wine/-/commit/1cf1412a12c6ee6191d387162fecb4…
Author: Piotr Caban <piotr(a)codeweavers.com> Date: Mon Nov 21 12:45:33 2022 +0100 gdi32: Get printer output file name in StartDoc. --- dlls/gdi32/Makefile.in | 2 +- dlls/gdi32/dc.c | 57 +++++++++++++++++++++++++++++++++++++++++++------- include/ntgdi.h | 2 ++ 3 files changed, 53 insertions(+), 8 deletions(-) diff --git a/dlls/gdi32/Makefile.in b/dlls/gdi32/Makefile.in index ce877995ee2..9e6d53dc219 100644 --- a/dlls/gdi32/Makefile.in +++ b/dlls/gdi32/Makefile.in @@ -2,7 +2,7 @@ EXTRADEFS = -D_GDI32_ MODULE = gdi32.dll IMPORTLIB = gdi32 IMPORTS = user32 advapi32 win32u -DELAYIMPORTS = setupapi +DELAYIMPORTS = setupapi winspool C_SRCS = \ dc.c \ diff --git a/dlls/gdi32/dc.c b/dlls/gdi32/dc.c index 0cdeff19e05..6ec11650d27 100644 --- a/dlls/gdi32/dc.c +++ b/dlls/gdi32/dc.c @@ -199,8 +199,11 @@ HDC WINAPI CreateDCW( LPCWSTR driver, LPCWSTR device, LPCWSTR output, UNICODE_STRING device_str, output_str; driver_entry_point entry_point = NULL; const WCHAR *display = NULL, *p; + WCHAR buf[300], *port = NULL; BOOL is_display = FALSE; - WCHAR buf[300]; + HANDLE hspool = NULL; + DC_ATTR *dc_attr; + HDC ret; if (!device || !get_driver_name( device, buf, 300 )) { @@ -212,6 +215,12 @@ HDC WINAPI CreateDCW( LPCWSTR driver, LPCWSTR device, LPCWSTR output, lstrcpyW(buf, driver); } + if (output) + { + output_str.Length = output_str.MaximumLength = lstrlenW(output) * sizeof(WCHAR); + output_str.Buffer = (WCHAR *)output; + } + if (is_display_device( driver )) { display = driver; @@ -231,6 +240,15 @@ HDC WINAPI CreateDCW( LPCWSTR driver, LPCWSTR device, LPCWSTR output, ERR( "no driver found for %s\n", debugstr_w(buf) ); return 0; } + else if (!OpenPrinterW( (WCHAR *)device, &hspool, NULL )) + { + return 0; + } + else if (output && !(port = HeapAlloc( GetProcessHeap(), 0, output_str.Length ))) + { + ClosePrinter( hspool ); + return 0; + } if (display) { @@ -247,14 +265,23 @@ HDC WINAPI CreateDCW( LPCWSTR driver, LPCWSTR device, LPCWSTR output, device_str.Buffer = (WCHAR *)device; } - if (output) + ret = NtGdiOpenDCW( device || display ? &device_str : NULL, devmode, output ? &output_str : NULL, + 0, is_display, entry_point, NULL, NULL ); + + if (ret && hspool && (dc_attr = get_dc_attr( ret ))) { - output_str.Length = output_str.MaximumLength = lstrlenW(output) * sizeof(WCHAR); - output_str.Buffer = (WCHAR *)output; + if (port) + memcpy( port, output, output_str.Length ); + dc_attr->hspool = HandleToULong( hspool ); + dc_attr->output = (ULONG_PTR)port; + } + else if (hspool) + { + ClosePrinter( hspool ); + HeapFree( GetProcessHeap(), 0, port ); } - return NtGdiOpenDCW( device || display ? &device_str : NULL, devmode, output ? &output_str : NULL, - 0, is_display, entry_point, NULL, NULL ); + return ret; } /*********************************************************************** @@ -371,6 +398,10 @@ BOOL WINAPI DeleteDC( HDC hdc ) if (is_meta_dc( hdc )) return METADC_DeleteDC( hdc ); if (!(dc_attr = get_dc_attr( hdc ))) return FALSE; + HeapFree( GetProcessHeap(), 0, (WCHAR *)(ULONG_PTR)dc_attr->output ); + dc_attr->output = 0; + if (dc_attr->hspool) ClosePrinter( ULongToHandle(dc_attr->hspool) ); + dc_attr->hspool = 0; if (dc_attr->emf) EMFDC_DeleteDC( dc_attr ); return NtGdiDeleteObjectApp( hdc ); } @@ -2153,9 +2184,11 @@ BOOL WINAPI CancelDC(HDC hdc) */ INT WINAPI StartDocW( HDC hdc, const DOCINFOW *doc ) { + WCHAR *output = NULL; DC_ATTR *dc_attr; ABORTPROC proc; DOCINFOW info; + INT ret; TRACE("%p %p\n", hdc, doc); @@ -2177,7 +2210,17 @@ INT WINAPI StartDocW( HDC hdc, const DOCINFOW *doc ) proc = (ABORTPROC)(UINT_PTR)dc_attr->abort_proc; if (proc && !proc( hdc, 0 )) return 0; - return NtGdiStartDoc( hdc, &info, NULL, 0 ); + + if (dc_attr->hspool) + { + if (!info.lpszOutput) info.lpszOutput = (const WCHAR *)(ULONG_PTR)dc_attr->output; + output = StartDocDlgW( ULongToHandle( dc_attr->hspool ), &info ); + if (output) info.lpszOutput = output; + } + + ret = NtGdiStartDoc( hdc, &info, NULL, 0 ); + HeapFree( GetProcessHeap(), 0, output ); + return ret; } /*********************************************************************** diff --git a/include/ntgdi.h b/include/ntgdi.h index 24db499c404..1aa5cad468f 100644 --- a/include/ntgdi.h +++ b/include/ntgdi.h @@ -198,6 +198,8 @@ typedef struct DC_ATTR RECTL emf_bounds; UINT64 emf; /* client EMF record pointer */ UINT64 abort_proc; /* AbortProc for printing */ + UINT64 hspool; + UINT64 output; } DC_ATTR; struct font_enum_entry
1
0
0
0
Piotr Caban : gdi32: Don't crash in StartDoc on NULL DOCINFO.
by Alexandre Julliard
22 Nov '22
22 Nov '22
Module: wine Branch: master Commit: 4e527045d59238ceb57110415470fb6213313043 URL:
https://gitlab.winehq.org/wine/wine/-/commit/4e527045d59238ceb57110415470fb…
Author: Piotr Caban <piotr(a)codeweavers.com> Date: Mon Nov 21 11:50:24 2022 +0100 gdi32: Don't crash in StartDoc on NULL DOCINFO. --- dlls/gdi32/dc.c | 21 ++++++++++++++++++--- 1 file changed, 18 insertions(+), 3 deletions(-) diff --git a/dlls/gdi32/dc.c b/dlls/gdi32/dc.c index cece9625739..0cdeff19e05 100644 --- a/dlls/gdi32/dc.c +++ b/dlls/gdi32/dc.c @@ -2155,16 +2155,29 @@ INT WINAPI StartDocW( HDC hdc, const DOCINFOW *doc ) { DC_ATTR *dc_attr; ABORTPROC proc; + DOCINFOW info; + + TRACE("%p %p\n", hdc, doc); + + if (doc) + { + info = *doc; + } + else + { + memset( &info, 0, sizeof(info) ); + info.cbSize = sizeof(info); + } TRACE("DocName %s, Output %s, Datatype %s, fwType %#lx\n", - debugstr_w(doc->lpszDocName), debugstr_w(doc->lpszOutput), - debugstr_w(doc->lpszDatatype), doc->fwType); + debugstr_w(info.lpszDocName), debugstr_w(info.lpszOutput), + debugstr_w(info.lpszDatatype), info.fwType); if (!(dc_attr = get_dc_attr( hdc ))) return SP_ERROR; proc = (ABORTPROC)(UINT_PTR)dc_attr->abort_proc; if (proc && !proc( hdc, 0 )) return 0; - return NtGdiStartDoc( hdc, doc, NULL, 0 ); + return NtGdiStartDoc( hdc, &info, NULL, 0 ); } /*********************************************************************** @@ -2176,6 +2189,8 @@ INT WINAPI StartDocA( HDC hdc, const DOCINFOA *doc ) DOCINFOW docW; INT ret, len; + if (!doc) return StartDocW(hdc, NULL); + docW.cbSize = doc->cbSize; if (doc->lpszDocName) {
1
0
0
0
Alexandre Julliard : makedep: Assume that all modules are built with msvcrt.
by Alexandre Julliard
22 Nov '22
22 Nov '22
Module: wine Branch: master Commit: a9183c7e3bd6ee25aeab2aed6c57a58d9558b614 URL:
https://gitlab.winehq.org/wine/wine/-/commit/a9183c7e3bd6ee25aeab2aed6c57a5…
Author: Alexandre Julliard <julliard(a)winehq.org> Date: Tue Nov 22 15:34:48 2022 +0100 makedep: Assume that all modules are built with msvcrt. --- tools/makedep.c | 56 ++++++++++++++++++++++++-------------------------------- 1 file changed, 24 insertions(+), 32 deletions(-) diff --git a/tools/makedep.c b/tools/makedep.c index cf916922390..484d2902817 100644 --- a/tools/makedep.c +++ b/tools/makedep.c @@ -198,7 +198,6 @@ struct makefile const char *staticlib; const char *importlib; const char *unixlib; - int use_msvcrt; int data_only; int is_win16; int is_exe; @@ -598,6 +597,17 @@ static int is_multiarch( unsigned int arch ) } +/******************************************************************* + * is_using_msvcrt + * + * Check if the files of a makefile use msvcrt by default. + */ +static int is_using_msvcrt( struct makefile *make ) +{ + return make->module || make->testdll; +} + + /******************************************************************* * arch_module_name */ @@ -856,7 +866,7 @@ static struct incl_file *add_generated_source( struct makefile *make, const char file->basename = xstrdup( filename ? filename : name ); file->filename = obj_dir_path( make, file->basename ); file->file->flags = FLAG_GENERATED; - file->use_msvcrt = make->use_msvcrt; + file->use_msvcrt = is_using_msvcrt( make ); list_add_tail( &make->sources, &file->entry ); if (make == include_makefile) { @@ -1605,7 +1615,7 @@ static struct incl_file *add_src_file( struct makefile *make, const char *name ) memset( file, 0, sizeof(*file) ); file->name = xstrdup(name); - file->use_msvcrt = make->use_msvcrt; + file->use_msvcrt = is_using_msvcrt( make ); file->is_external = !!make->extlib; list_add_tail( &make->sources, &file->entry ); if (make == include_makefile) @@ -1804,13 +1814,12 @@ static void add_generated_sources( struct makefile *make ) unsigned int i, arch; struct incl_file *source, *next, *file, *dlldata = NULL; struct strarray objs = get_expanded_make_var_array( make, "EXTRA_OBJS" ); - int multiarch = archs.count > 1 && make->use_msvcrt; LIST_FOR_EACH_ENTRY_SAFE( source, next, &make->sources, struct incl_file, entry ) { for (arch = 0; arch < archs.count; arch++) { - if (!arch != !multiarch) continue; + if (!is_multiarch( arch )) continue; if (source->file->flags & FLAG_IDL_CLIENT) { file = add_generated_source( make, replace_extension( source->name, ".idl", "_c.c" ), NULL, arch ); @@ -1914,7 +1923,7 @@ static void add_generated_sources( struct makefile *make ) { for (arch = 0; arch < archs.count; arch++) { - if (!arch != !multiarch) continue; + if (!is_multiarch( arch )) continue; file = add_generated_source( make, "testlist.o", "testlist.c", arch ); add_dependency( file->file, "wine/test.h", INCL_NORMAL ); add_all_includes( make, file, file->file ); @@ -2161,7 +2170,6 @@ static int is_crt_module( const char *file ) */ static const char *get_default_crt( const struct makefile *make ) { - if (!make->use_msvcrt) return NULL; if (make->module && is_crt_module( make->module )) return NULL; /* don't add crt import to crt dlls */ return !make->testdll && (!make->staticlib || make->extlib) ? "ucrtbase" : "msvcrt"; } @@ -2362,6 +2370,7 @@ static struct strarray get_source_defines( struct makefile *make, struct incl_fi strarray_add( &ret, strmake( "-I%s", root_src_dir_path( "include/msvcrt" ))); for (i = 0; i < make->include_paths.count; i++) strarray_add( &ret, strmake( "-I%s", make->include_paths.str[i] )); + strarray_add( &ret, get_crt_define( make )); } strarray_addall( &ret, make->define_args ); strarray_addall( &ret, get_expanded_file_local_var( make, obj, "EXTRADEFS" )); @@ -2422,7 +2431,9 @@ static void output_winegcc_command( struct makefile *make, unsigned int arch ) output_filename( tools_path( make, "winebuild" )); } output_filenames( target_flags[arch] ); - if (!arch) output_filenames( lddll_flags ); + if (arch) return; + output_filename( "-mno-cygwin" ); + output_filenames( lddll_flags ); } @@ -2815,7 +2826,6 @@ static void output_source_idl( struct makefile *make, struct incl_file *source, struct strarray multiarch_targets[MAX_ARCHS] = { empty_strarray }; const char *dest; unsigned int i, arch; - int multiarch; if (find_include_file( make, strmake( "%s.h", obj ))) source->file->flags |= FLAG_IDL_HEADER; if (!source->file->flags) return; @@ -2839,10 +2849,9 @@ static void output_source_idl( struct makefile *make, struct incl_file *source, for (i = 0; i < ARRAY_SIZE(idl_outputs); i++) { if (!(source->file->flags & idl_outputs[i].flag)) continue; - multiarch = (make->use_msvcrt && archs.count > 1); for (arch = 0; arch < archs.count; arch++) { - if (!arch != !multiarch) continue; + if (!is_multiarch( arch )) continue; dest = strmake( "%s%s%s", arch_dirs[arch], obj, idl_outputs[i].ext ); if (!find_src_file( make, dest )) strarray_add( &make->clean_files, dest ); strarray_add( &multiarch_targets[arch], dest ); @@ -3123,13 +3132,13 @@ static void output_source_one_arch( struct makefile *make, struct incl_file *sou if (arch) { if (source->file->flags & FLAG_C_UNIX) return; - if (!make->use_msvcrt && !make->staticlib && !(source->file->flags & FLAG_C_IMPLIB)) return; + if (!is_using_msvcrt( make ) && !make->staticlib && !(source->file->flags & FLAG_C_IMPLIB)) return; } else if (source->file->flags & FLAG_C_UNIX) { if (!*dll_ext) return; } - else if (archs.count > 1 && make->use_msvcrt && + else if (archs.count > 1 && is_using_msvcrt( make ) && !(source->file->flags & FLAG_C_IMPLIB) && (!make->staticlib || make->extlib)) return; @@ -3315,12 +3324,6 @@ static void output_module( struct makefile *make, unsigned int arch ) strarray_addall( &all_libs, add_import_libs( make, &dep_libs, make->delayimports, IMPORT_TYPE_DELAYED, arch )); strarray_addall( &all_libs, add_import_libs( make, &dep_libs, default_imports, IMPORT_TYPE_DEFAULT, arch ) ); - if (!make->use_msvcrt) - { - strarray_addall( &all_libs, get_expanded_make_var_array( make, "UNIX_LIBS" )); - strarray_addall( &all_libs, libs ); - } - if (delay_load_flags[arch]) { for (i = 0; i < make->delayimports.count; i++) @@ -3548,7 +3551,7 @@ static void output_test_module( struct makefile *make, unsigned int arch ) output( ": %s", obj_dir_path( make, testmodule )); if (parent) { - char *parent_module = arch_module_name( make->testdll, parent->use_msvcrt ? arch : 0 ); + char *parent_module = arch_module_name( make->testdll, arch ); output_filename( obj_dir_path( parent, parent_module )); if (parent->unixlib) output_filename( obj_dir_path( parent, parent->unixlib )); } @@ -3799,12 +3802,7 @@ static void output_sources( struct makefile *make ) } else if (make->module) { - if (!make->use_msvcrt) output_module( make, 0 ); - else - { - for (arch = 0; arch < archs.count; arch++) - if (is_multiarch( arch )) output_module( make, arch ); - } + for (arch = 0; arch < archs.count; arch++) if (is_multiarch( arch )) output_module( make, arch ); if (make->unixlib) output_unix_lib( make ); if (make->importlib) for (arch = 0; arch < archs.count; arch++) output_import_lib( make, arch ); if (make->is_exe && !make->is_win16 && *dll_ext && strendswith( make->module, ".exe" )) @@ -4246,13 +4244,9 @@ static void load_sources( struct makefile *make ) } make->is_win16 = strarray_exists( &make->extradllflags, "-m16" ); make->data_only = strarray_exists( &make->extradllflags, "-Wb,--data-only" ); - make->use_msvcrt = (make->module || make->testdll || make->is_win16) && - !strarray_exists( &make->extradllflags, "-mcygwin" ); make->is_exe = strarray_exists( &make->extradllflags, "-mconsole" ) || strarray_exists( &make->extradllflags, "-mwindows" ); - if (make->use_msvcrt) strarray_add_uniq( &make->extradllflags, "-mno-cygwin" ); - if (make->module) { /* add default install rules if nothing was specified */ @@ -4309,8 +4303,6 @@ static void load_sources( struct makefile *make ) add_generated_sources( make ); - if (make->use_msvcrt) strarray_add( &make->define_args, get_crt_define( make )); - LIST_FOR_EACH_ENTRY( file, &make->includes, struct incl_file, entry ) parse_file( make, file, 0 ); LIST_FOR_EACH_ENTRY( file, &make->sources, struct incl_file, entry ) get_dependencies( file, file );
1
0
0
0
Alexandre Julliard : configure: Don't rename the loader to wine64 for multi-arch builds.
by Alexandre Julliard
22 Nov '22
22 Nov '22
Module: wine Branch: master Commit: 5884e98fbec966b0ad9f3babcbec7d8fe25dbc1d URL:
https://gitlab.winehq.org/wine/wine/-/commit/5884e98fbec966b0ad9f3babcbec7d…
Author: Alexandre Julliard <julliard(a)winehq.org> Date: Tue Nov 22 14:28:05 2022 +0100 configure: Don't rename the loader to wine64 for multi-arch builds. --- configure | 25 +++++++++++++++++-------- configure.ac | 19 ++++++++++++++----- 2 files changed, 31 insertions(+), 13 deletions(-) diff --git a/configure b/configure index e17b71555f2..66519182d59 100755 --- a/configure +++ b/configure @@ -653,6 +653,7 @@ ac_subst_vars='LTLIBOBJS LIBOBJS TAGSFLAGS RT_LIBS +WINELOADER_PROGRAMS DELAYLOADFLAG MSVCRTFLAGS NETAPI_LIBS @@ -755,7 +756,6 @@ COREFOUNDATION_LIBS ac_ct_OBJC OBJCFLAGS OBJC -WINELOADER_PROGRAMS CONFIGURE_TARGETS DISABLED_SUBDIRS SUBDIRS @@ -9471,10 +9471,6 @@ $ac_links: for f in $ac_links; do as_fn_append CONFIGURE_TARGETS " $f"; done } -wine_binary="wine" -test "$HOST_ARCH" != x86_64 || wine_binary="wine64" -WINELOADER_PROGRAMS="$wine_binary" - libwine_soversion=`expr $libwine_version : '\([0-9]*\)\..*'` case $host_os in @@ -9946,8 +9942,6 @@ if test "x$ac_cv_cflags__Wl__no_pie" = xyes then : WINEPRELOADER_LDFLAGS="-Wl,-no_pie $WINEPRELOADER_LDFLAGS" fi - test "$wine_binary" = wine || as_fn_append CONFIGURE_TARGETS " loader/wine-preloader" - WINELOADER_PROGRAMS="$WINELOADER_PROGRAMS $wine_binary-preloader" WINELOADER_LDFLAGS="$WINELOADER_LDFLAGS -mmacosx-version-min=10.7" else as_fn_append wine_warnings "|can't build Wine preloader; many programs won't work" @@ -19600,6 +19594,14 @@ then fi +case "$HOST_ARCH,$PE_ARCHS" in + x86_64,*i386*) wine_binary="wine" ;; + x86_64,*) wine_binary="wine64" ;; + *) wine_binary="wine" ;; +esac +WINELOADER_PROGRAMS="$wine_binary" + + case $host_os in linux*) case $host_cpu in @@ -19609,6 +19611,13 @@ case $host_os in ;; esac ;; + darwin*|macosx*) + if test "$wine_can_build_preloader" = "yes" + then + test "$wine_binary" = wine || as_fn_append CONFIGURE_TARGETS " loader/wine-preloader" + WINELOADER_PROGRAMS="$WINELOADER_PROGRAMS $wine_binary-preloader" + fi + ;; esac @@ -23151,7 +23160,6 @@ READELF = $READELF SUBDIRS = $SUBDIRS DISABLED_SUBDIRS = $DISABLED_SUBDIRS CONFIGURE_TARGETS = $CONFIGURE_TARGETS -WINELOADER_PROGRAMS = $WINELOADER_PROGRAMS OBJC = $OBJC OBJCFLAGS = $OBJCFLAGS ac_ct_OBJC = $ac_ct_OBJC @@ -23254,6 +23262,7 @@ NETAPI_CFLAGS = $NETAPI_CFLAGS NETAPI_LIBS = $NETAPI_LIBS MSVCRTFLAGS = $MSVCRTFLAGS DELAYLOADFLAG = $DELAYLOADFLAG +WINELOADER_PROGRAMS = $WINELOADER_PROGRAMS RT_LIBS = $RT_LIBS TAGSFLAGS = $TAGSFLAGS LIBOBJS = $LIBOBJS diff --git a/configure.ac b/configure.ac index b7d443c1182..32eb88129eb 100644 --- a/configure.ac +++ b/configure.ac @@ -656,9 +656,6 @@ LIBEXT="so" WINE_PATH_SONAME_TOOLS WINE_CONFIG_HELPERS -wine_binary="wine" -test "$HOST_ARCH" != x86_64 || wine_binary="wine64" -AC_SUBST(WINELOADER_PROGRAMS,"$wine_binary") libwine_soversion=`expr $libwine_version : '\([[0-9]]*\)\..*'` case $host_os in @@ -709,8 +706,6 @@ case $host_os in then WINE_TRY_CFLAGS([-Wl,-no_pie], [WINEPRELOADER_LDFLAGS="-Wl,-no_pie $WINEPRELOADER_LDFLAGS"]) - test "$wine_binary" = wine || WINE_IGNORE_FILE(loader/wine-preloader) - WINELOADER_PROGRAMS="$WINELOADER_PROGRAMS $wine_binary-preloader" dnl If preloader is used, the loader needs to be an LC_UNIXTHREAD binary to avoid AppKit/Core Animation problems. WINELOADER_LDFLAGS="$WINELOADER_LDFLAGS -mmacosx-version-min=10.7" else @@ -2015,6 +2010,13 @@ fi dnl **** Platform-specific checks **** +case "$HOST_ARCH,$PE_ARCHS" in + x86_64,*i386*) wine_binary="wine" ;; + x86_64,*) wine_binary="wine64" ;; + *) wine_binary="wine" ;; +esac +AC_SUBST(WINELOADER_PROGRAMS,"$wine_binary") + case $host_os in linux*) case $host_cpu in @@ -2024,6 +2026,13 @@ case $host_os in ;; esac ;; + darwin*|macosx*) + if test "$wine_can_build_preloader" = "yes" + then + test "$wine_binary" = wine || WINE_IGNORE_FILE(loader/wine-preloader) + WINELOADER_PROGRAMS="$WINELOADER_PROGRAMS $wine_binary-preloader" + fi + ;; esac dnl **** Check for functions ****
1
0
0
0
Alexandre Julliard : ntdll: Fall back to the current loader if the corresponding 32/64-bit loader isn't found.
by Alexandre Julliard
22 Nov '22
22 Nov '22
Module: wine Branch: master Commit: 9e7a9270e2a7fd5eaf388c1b9277e52b5bbb48e2 URL:
https://gitlab.winehq.org/wine/wine/-/commit/9e7a9270e2a7fd5eaf388c1b9277e5…
Author: Alexandre Julliard <julliard(a)winehq.org> Date: Tue Nov 22 13:58:49 2022 +0100 ntdll: Fall back to the current loader if the corresponding 32/64-bit loader isn't found. --- dlls/ntdll/unix/env.c | 1 + dlls/ntdll/unix/loader.c | 7 +------ 2 files changed, 2 insertions(+), 6 deletions(-) diff --git a/dlls/ntdll/unix/env.c b/dlls/ntdll/unix/env.c index 46c3d97c852..328040bbda6 100644 --- a/dlls/ntdll/unix/env.c +++ b/dlls/ntdll/unix/env.c @@ -1863,6 +1863,7 @@ static void init_peb( RTL_USER_PROCESS_PARAMETERS *params, void *module ) NtCurrentTeb()->Tib.ExceptionList = (void *)((char *)NtCurrentTeb() + teb_offset); wow_peb = (PEB32 *)((char *)peb + page_size); set_thread_id( NtCurrentTeb(), GetCurrentProcessId(), GetCurrentThreadId() ); + ERR( "starting %s in experimental wow64 mode\n", debugstr_us(¶ms->ImagePathName) ); } #endif diff --git a/dlls/ntdll/unix/loader.c b/dlls/ntdll/unix/loader.c index db9e1d60162..f87e11f073c 100644 --- a/dlls/ntdll/unix/loader.c +++ b/dlls/ntdll/unix/loader.c @@ -706,14 +706,9 @@ static NTSTATUS loader_exec( char **argv, WORD machine ) strcpy( argv[1], wineloader ); strcat( argv[1], "64" ); preloader_exec( argv ); - return STATUS_INVALID_IMAGE_FORMAT; } } - else if ((argv[1] = remove_tail( wineloader, "64" ))) - { - preloader_exec( argv ); - return STATUS_INVALID_IMAGE_FORMAT; - } + else if ((argv[1] = remove_tail( wineloader, "64" ))) preloader_exec( argv ); } argv[1] = strdup( wineloader );
1
0
0
0
Alexandre Julliard : ntdll: Always use the name of the current loader to exec a new process.
by Alexandre Julliard
22 Nov '22
22 Nov '22
Module: wine Branch: master Commit: ae8562ed2277a5c051e131dc317e94aa3d5413c8 URL:
https://gitlab.winehq.org/wine/wine/-/commit/ae8562ed2277a5c051e131dc317e94…
Author: Alexandre Julliard <julliard(a)winehq.org> Date: Tue Nov 22 13:35:37 2022 +0100 ntdll: Always use the name of the current loader to exec a new process. --- dlls/ntdll/unix/loader.c | 59 ++++++++++++++++-------------------------------- 1 file changed, 20 insertions(+), 39 deletions(-) diff --git a/dlls/ntdll/unix/loader.c b/dlls/ntdll/unix/loader.c index fa0811ac468..db9e1d60162 100644 --- a/dlls/ntdll/unix/loader.c +++ b/dlls/ntdll/unix/loader.c @@ -691,35 +691,32 @@ static void preloader_exec( char **argv ) execv( argv[1], argv + 1 ); } -static NTSTATUS loader_exec( const char *loader, char **argv, WORD machine ) +/* exec the appropriate wine loader for the specified machine */ +static NTSTATUS loader_exec( char **argv, WORD machine ) { - char *p, *path; - - if (build_dir) + if (machine != current_machine) { - argv[1] = build_path( build_dir, (machine == IMAGE_FILE_MACHINE_AMD64) ? "loader/wine64" : "loader/wine" ); - preloader_exec( argv ); - return STATUS_INVALID_IMAGE_FORMAT; - } - - if ((p = strrchr( loader, '/' ))) loader = p + 1; - - argv[1] = build_path( bin_dir, loader ); - preloader_exec( argv ); - - argv[1] = getenv( "WINELOADER" ); - if (argv[1]) preloader_exec( argv ); + if (machine == IMAGE_FILE_MACHINE_AMD64) /* try the 64-bit loader */ + { + size_t len = strlen(wineloader); - if ((path = getenv( "PATH" ))) - { - for (p = strtok( strdup( path ), ":" ); p; p = strtok( NULL, ":" )) + if (len <= 2 || strcmp( wineloader + len - 2, "64" )) + { + argv[1] = malloc( len + 3 ); + strcpy( argv[1], wineloader ); + strcat( argv[1], "64" ); + preloader_exec( argv ); + return STATUS_INVALID_IMAGE_FORMAT; + } + } + else if ((argv[1] = remove_tail( wineloader, "64" ))) { - argv[1] = build_path( p, loader ); preloader_exec( argv ); + return STATUS_INVALID_IMAGE_FORMAT; } } - argv[1] = build_path( BINDIR, loader ); + argv[1] = strdup( wineloader ); preloader_exec( argv ); return STATUS_INVALID_IMAGE_FORMAT; } @@ -735,27 +732,11 @@ NTSTATUS exec_wineloader( char **argv, int socketfd, const pe_image_info_t *pe_i WORD machine = pe_info->machine; ULONGLONG res_start = pe_info->base; ULONGLONG res_end = pe_info->base + pe_info->map_size; - const char *loader = wineloader; char preloader_reserve[64], socket_env[64]; - BOOL is_child_64bit; if (pe_info->image_flags & IMAGE_FLAGS_WineFakeDll) res_start = res_end = 0; if (pe_info->image_flags & IMAGE_FLAGS_ComPlusNativeReady) machine = native_machine; - is_child_64bit = is_machine_64bit( machine ); - - if (!is_win64 ^ !is_child_64bit) - { - int len = strlen( loader ); - char *env = malloc( len + 2 ); - - if (!env) return STATUS_NO_MEMORY; - strcpy( env, loader ); - if (is_child_64bit) strcat( env, "64" ); - else if (!strcmp( env + len - 2, "64" )) env[len - 2] = 0; - loader = env; - } - signal( SIGPIPE, SIG_DFL ); sprintf( socket_env, "WINESERVERSOCKET=%u", socketfd ); @@ -765,7 +746,7 @@ NTSTATUS exec_wineloader( char **argv, int socketfd, const pe_image_info_t *pe_i putenv( preloader_reserve ); putenv( socket_env ); - return loader_exec( loader, argv, machine ); + return loader_exec( argv, machine ); } @@ -2504,7 +2485,7 @@ void __wine_main( int argc, char *argv[], char *envp[] ) memcpy( new_argv + 1, argv, (argc + 1) * sizeof(*argv) ); putenv( noexec ); - loader_exec( wineloader, new_argv, current_machine ); + loader_exec( new_argv, current_machine ); fatal_error( "could not exec the wine loader\n" ); } }
1
0
0
0
Alexandre Julliard : ntdll: Always set WINELOADER variable to the current loader name.
by Alexandre Julliard
22 Nov '22
22 Nov '22
Module: wine Branch: master Commit: d45de318748639cfd1e80a976b39f5e19213990f URL:
https://gitlab.winehq.org/wine/wine/-/commit/d45de318748639cfd1e80a976b39f5…
Author: Alexandre Julliard <julliard(a)winehq.org> Date: Tue Nov 22 12:08:19 2022 +0100 ntdll: Always set WINELOADER variable to the current loader name. --- dlls/ntdll/unix/env.c | 3 +++ dlls/ntdll/unix/loader.c | 48 +++++++++++++++++++++--------------------------- 2 files changed, 24 insertions(+), 27 deletions(-) diff --git a/dlls/ntdll/unix/env.c b/dlls/ntdll/unix/env.c index 5e36f2c2e0d..46c3d97c852 100644 --- a/dlls/ntdll/unix/env.c +++ b/dlls/ntdll/unix/env.c @@ -354,6 +354,7 @@ static BOOL is_dynamic_env_var( const char *var ) STARTS_WITH( var, "WINEHOMEDIR=" ) || STARTS_WITH( var, "WINEBUILDDIR=" ) || STARTS_WITH( var, "WINECONFIGDIR=" ) || + STARTS_WITH( var, "WINELOADER=" ) || STARTS_WITH( var, "WINEDLLDIR" ) || STARTS_WITH( var, "WINEUNIXCP=" ) || STARTS_WITH( var, "WINEUSERLOCALE=" ) || @@ -1068,6 +1069,7 @@ static void add_system_dll_path_var( WCHAR **env, SIZE_T *pos, SIZE_T *size ) static void add_dynamic_environment( WCHAR **env, SIZE_T *pos, SIZE_T *size ) { const char *overrides = getenv( "WINEDLLOVERRIDES" ); + const char *wineloader = getenv( "WINELOADER" ); unsigned int i; char str[22]; @@ -1083,6 +1085,7 @@ static void add_dynamic_environment( WCHAR **env, SIZE_T *pos, SIZE_T *size ) sprintf( str, "WINEDLLDIR%u", i ); append_envW( env, pos, size, str, NULL ); add_system_dll_path_var( env, pos, size ); + append_envA( env, pos, size, "WINELOADER", wineloader ); append_envA( env, pos, size, "WINEUSERNAME", user_name ); append_envA( env, pos, size, "WINEDLLOVERRIDES", overrides ); if (unix_cp.CodePage != CP_UTF8) diff --git a/dlls/ntdll/unix/loader.c b/dlls/ntdll/unix/loader.c index 3bb7f056b2a..fa0811ac468 100644 --- a/dlls/ntdll/unix/loader.c +++ b/dlls/ntdll/unix/loader.c @@ -378,10 +378,10 @@ static const BOOL use_preloader = TRUE; static const BOOL use_preloader = FALSE; #endif -static char *argv0; static const char *bin_dir; static const char *dll_dir; static const char *ntdll_dir; +static const char *wineloader; static SIZE_T dll_path_maxlen; static int *p___wine_main_argc; static char ***p___wine_main_argv; @@ -618,8 +618,10 @@ static void set_config_dir(void) static void init_paths( char *argv[] ) { Dl_info info; + char *basename, *env; - argv0 = strdup( argv[0] ); + if ((basename = strrchr( argv[0], '/' ))) basename++; + else basename = argv[0]; if (!dladdr( init_paths, &info ) || !(ntdll_dir = realpath_dirname( info.dli_fname ))) fatal_error( "cannot get path to ntdll.so\n" ); @@ -639,11 +641,18 @@ static void init_paths( char *argv[] ) free( path ); } #else - bin_dir = realpath_dirname( argv0 ); + bin_dir = realpath_dirname( argv[0] ); #endif if (!bin_dir) bin_dir = build_path( dll_dir, DLL_TO_BINDIR ); data_dir = build_path( bin_dir, BIN_TO_DATADIR ); + wineloader = build_path( bin_dir, basename ); } + else wineloader = build_path( build_path( build_dir, "loader" ), basename ); + + env = malloc( sizeof("WINELOADER=") + strlen(wineloader) ); + strcpy( env, "WINELOADER=" ); + strcat( env, wineloader ); + putenv( env ); set_dll_path(); set_system_dll_path(); @@ -726,8 +735,7 @@ NTSTATUS exec_wineloader( char **argv, int socketfd, const pe_image_info_t *pe_i WORD machine = pe_info->machine; ULONGLONG res_start = pe_info->base; ULONGLONG res_end = pe_info->base + pe_info->map_size; - const char *loader = argv0; - const char *loader_env = getenv( "WINELOADER" ); + const char *loader = wineloader; char preloader_reserve[64], socket_env[64]; BOOL is_child_64bit; @@ -738,28 +746,14 @@ NTSTATUS exec_wineloader( char **argv, int socketfd, const pe_image_info_t *pe_i if (!is_win64 ^ !is_child_64bit) { - /* remap WINELOADER to the alternate 32/64-bit version if necessary */ - if (loader_env) - { - int len = strlen( loader_env ); - char *env = malloc( sizeof("WINELOADER=") + len + 2 ); + int len = strlen( loader ); + char *env = malloc( len + 2 ); - if (!env) return STATUS_NO_MEMORY; - strcpy( env, "WINELOADER=" ); - strcat( env, loader_env ); - if (is_child_64bit) - { - strcat( env, "64" ); - } - else - { - len += sizeof("WINELOADER=") - 1; - if (!strcmp( env + len - 2, "64" )) env[len - 2] = 0; - } - loader = env; - putenv( env ); - } - else loader = is_child_64bit ? "wine64" : "wine"; + if (!env) return STATUS_NO_MEMORY; + strcpy( env, loader ); + if (is_child_64bit) strcat( env, "64" ); + else if (!strcmp( env + len - 2, "64" )) env[len - 2] = 0; + loader = env; } signal( SIGPIPE, SIG_DFL ); @@ -2510,7 +2504,7 @@ void __wine_main( int argc, char *argv[], char *envp[] ) memcpy( new_argv + 1, argv, (argc + 1) * sizeof(*argv) ); putenv( noexec ); - loader_exec( argv0, new_argv, current_machine ); + loader_exec( wineloader, new_argv, current_machine ); fatal_error( "could not exec the wine loader\n" ); } }
1
0
0
0
Santino Mazza : kernelbase: Implement GetGeoInfoEx.
by Alexandre Julliard
22 Nov '22
22 Nov '22
Module: wine Branch: master Commit: d5385c71779cf5b164582d68e26ca8e9834e8863 URL:
https://gitlab.winehq.org/wine/wine/-/commit/d5385c71779cf5b164582d68e26ca8…
Author: Santino Mazza <smazza(a)codeweavers.com> Date: Mon Nov 21 11:06:09 2022 -0300 kernelbase: Implement GetGeoInfoEx. --- dlls/kernel32/tests/locale.c | 12 ++++++------ dlls/kernelbase/locale.c | 19 ++++++++++++++++--- 2 files changed, 22 insertions(+), 9 deletions(-) diff --git a/dlls/kernel32/tests/locale.c b/dlls/kernel32/tests/locale.c index 8dd9e12c91b..723c24873c6 100644 --- a/dlls/kernel32/tests/locale.c +++ b/dlls/kernel32/tests/locale.c @@ -5977,26 +5977,26 @@ static void test_GetGeoInfo(void) /* Test with ISO 3166-1 */ ret = pGetGeoInfoEx(L"AR", GEO_ISO3, buffW, ARRAYSIZE(buffW)); - todo_wine ok(ret != 0, "GetGeoInfoEx failed %ld.\n", GetLastError()); - todo_wine ok(!wcscmp(buffW, L"ARG"), "expected string to be ARG, got %ls\n", buffW); + ok(ret != 0, "GetGeoInfoEx failed %ld.\n", GetLastError()); + ok(!wcscmp(buffW, L"ARG"), "expected string to be ARG, got %ls\n", buffW); /* Test with UN M.49 */ SetLastError(0xdeadbeef); ret = pGetGeoInfoEx(L"032", GEO_ISO3, buffW, ARRAYSIZE(buffW)); ok(ret == 0, "expected GetGeoInfoEx to fail.\n"); - todo_wine ok(GetLastError() == ERROR_INVALID_PARAMETER, + ok(GetLastError() == ERROR_INVALID_PARAMETER, "expected ERROR_INVALID_PARAMETER got %ld.\n", GetLastError()); /* Test GEO_ID */ ret = pGetGeoInfoEx(L"AR", GEO_ID, buffW, ARRAYSIZE(buffW)); - todo_wine ok(ret != 0, "GetGeoInfoEx failed %ld.\n", GetLastError()); - todo_wine ok(!wcscmp(buffW, L"11"), "expected string to be 11, got %ls\n", buffW); + ok(ret != 0, "GetGeoInfoEx failed %ld.\n", GetLastError()); + ok(!wcscmp(buffW, L"11"), "expected string to be 11, got %ls\n", buffW); /* Test with invalid geo type */ SetLastError(0xdeadbeef); ret = pGetGeoInfoEx(L"AR", GEO_LCID, buffW, ARRAYSIZE(buffW)); ok(ret == 0, "expected GetGeoInfoEx to fail.\n"); - todo_wine ok(GetLastError() == ERROR_INVALID_FLAGS, + ok(GetLastError() == ERROR_INVALID_FLAGS, "expected ERROR_INVALID_PARAMETER got %ld.\n", GetLastError()); } diff --git a/dlls/kernelbase/locale.c b/dlls/kernelbase/locale.c index b745726f7c1..5cc4152e491 100644 --- a/dlls/kernelbase/locale.c +++ b/dlls/kernelbase/locale.c @@ -5746,10 +5746,23 @@ INT WINAPI DECLSPEC_HOTPATCH GetGeoInfoW( GEOID id, GEOTYPE type, WCHAR *data, i INT WINAPI DECLSPEC_HOTPATCH GetGeoInfoEx( WCHAR *location, GEOTYPE type, WCHAR *data, int data_count ) { - FIXME( "stub: %s %lx %p %d\n", wine_dbgstr_w(location), type, data, data_count ); + const struct geo_id *ptr = find_geo_name_entry( location ); - SetLastError( ERROR_CALL_NOT_IMPLEMENTED ); - return 0; + TRACE( "%s %lx %p %d\n", wine_dbgstr_w(location), type, data, data_count ); + + if (!ptr) + { + SetLastError( ERROR_INVALID_PARAMETER ); + return 0; + } + + if (type == GEO_LCID || type == GEO_NATION || type == GEO_RFC1766) + { + SetLastError( ERROR_INVALID_FLAGS ); + return 0; + } + + return get_geo_info( ptr, type, data, data_count, 0 ); }
1
0
0
0
Santino Mazza : kernel32/tests: Test for GetGeoInfoEx.
by Alexandre Julliard
22 Nov '22
22 Nov '22
Module: wine Branch: master Commit: 52ffd338fa46fab12face2ffaeb7e21c25786697 URL:
https://gitlab.winehq.org/wine/wine/-/commit/52ffd338fa46fab12face2ffaeb7e2…
Author: Santino Mazza <smazza(a)codeweavers.com> Date: Mon Nov 21 11:05:49 2022 -0300 kernel32/tests: Test for GetGeoInfoEx. --- dlls/kernel32/tests/locale.c | 34 ++++++++++++++++++++++++++++++++++ 1 file changed, 34 insertions(+) diff --git a/dlls/kernel32/tests/locale.c b/dlls/kernel32/tests/locale.c index a1e8ba44974..8dd9e12c91b 100644 --- a/dlls/kernel32/tests/locale.c +++ b/dlls/kernel32/tests/locale.c @@ -78,6 +78,7 @@ static INT (WINAPI *pCompareStringEx)(LPCWSTR, DWORD, LPCWSTR, INT, LPCWSTR, INT LPNLSVERSIONINFO, LPVOID, LPARAM); static INT (WINAPI *pGetGeoInfoA)(GEOID, GEOTYPE, LPSTR, INT, LANGID); static INT (WINAPI *pGetGeoInfoW)(GEOID, GEOTYPE, LPWSTR, INT, LANGID); +static INT (WINAPI *pGetGeoInfoEx)(const WCHAR *, GEOTYPE, PWSTR, INT); static INT (WINAPI *pGetUserDefaultGeoName)(LPWSTR, int); static BOOL (WINAPI *pSetUserGeoName)(PWSTR); static BOOL (WINAPI *pEnumSystemGeoID)(GEOCLASS, GEOID, GEO_ENUMPROC); @@ -132,6 +133,7 @@ static void InitFunctionPointers(void) X(CompareStringEx); X(GetGeoInfoA); X(GetGeoInfoW); + X(GetGeoInfoEx); X(GetUserDefaultGeoName); X(SetUserGeoName); X(EnumSystemGeoID); @@ -5856,6 +5858,7 @@ static void test_CompareStringOrdinal(void) static void test_GetGeoInfo(void) { char buffA[20]; + WCHAR buffW[20]; INT ret; if (!pGetGeoInfoA) @@ -5964,6 +5967,37 @@ static void test_GetGeoInfo(void) ret = pGetGeoInfoA(203, GEO_ID + 1, NULL, 0, 0); ok(ret == 0, "got %d\n", ret); ok(GetLastError() == ERROR_INVALID_FLAGS, "got %ld\n", GetLastError()); + + /* Test for GetGeoInfoEx */ + if (!pGetGeoInfoEx) + { + win_skip("GetGeoInfoEx is not available\n"); + return; + } + + /* Test with ISO 3166-1 */ + ret = pGetGeoInfoEx(L"AR", GEO_ISO3, buffW, ARRAYSIZE(buffW)); + todo_wine ok(ret != 0, "GetGeoInfoEx failed %ld.\n", GetLastError()); + todo_wine ok(!wcscmp(buffW, L"ARG"), "expected string to be ARG, got %ls\n", buffW); + + /* Test with UN M.49 */ + SetLastError(0xdeadbeef); + ret = pGetGeoInfoEx(L"032", GEO_ISO3, buffW, ARRAYSIZE(buffW)); + ok(ret == 0, "expected GetGeoInfoEx to fail.\n"); + todo_wine ok(GetLastError() == ERROR_INVALID_PARAMETER, + "expected ERROR_INVALID_PARAMETER got %ld.\n", GetLastError()); + + /* Test GEO_ID */ + ret = pGetGeoInfoEx(L"AR", GEO_ID, buffW, ARRAYSIZE(buffW)); + todo_wine ok(ret != 0, "GetGeoInfoEx failed %ld.\n", GetLastError()); + todo_wine ok(!wcscmp(buffW, L"11"), "expected string to be 11, got %ls\n", buffW); + + /* Test with invalid geo type */ + SetLastError(0xdeadbeef); + ret = pGetGeoInfoEx(L"AR", GEO_LCID, buffW, ARRAYSIZE(buffW)); + ok(ret == 0, "expected GetGeoInfoEx to fail.\n"); + todo_wine ok(GetLastError() == ERROR_INVALID_FLAGS, + "expected ERROR_INVALID_PARAMETER got %ld.\n", GetLastError()); } static int geoidenum_count;
1
0
0
0
← Newer
1
...
35
36
37
38
39
40
41
...
118
Older →
Jump to page:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
Results per page:
10
25
50
100
200