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 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
2 participants
1138 discussions
Start a n
N
ew thread
Nikolay Sivov : fusion: Use CRT memory allocation functions.
by Alexandre Julliard
30 Mar '22
30 Mar '22
Module: wine Branch: master Commit: d3fe9faff0ebe8e9ff53c513442f2e47b0ffd6b2 URL:
https://source.winehq.org/git/wine.git/?a=commit;h=d3fe9faff0ebe8e9ff53c513…
Author: Nikolay Sivov <nsivov(a)codeweavers.com> Date: Wed Mar 30 09:47:46 2022 +0300 fusion: Use CRT memory allocation functions. Signed-off-by: Nikolay Sivov <nsivov(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/fusion/asmcache.c | 44 ++++++++++++++++++++++---------------------- dlls/fusion/asmenum.c | 14 +++++++------- dlls/fusion/asmname.c | 46 ++++++++++++++++++++++------------------------ dlls/fusion/assembly.c | 26 +++++++++++++------------- dlls/fusion/fusionpriv.h | 14 -------------- 5 files changed, 64 insertions(+), 80 deletions(-) Diff:
https://source.winehq.org/git/wine.git/?a=commitdiff;h=d3fe9faff0ebe8e9ff53…
1
0
0
0
Nikolay Sivov : scrobj/tests: Use CRT memory allocation functions.
by Alexandre Julliard
30 Mar '22
30 Mar '22
Module: wine Branch: master Commit: a406123812b53af016e9e37f139830932bf46719 URL:
https://source.winehq.org/git/wine.git/?a=commit;h=a406123812b53af016e9e37f…
Author: Nikolay Sivov <nsivov(a)codeweavers.com> Date: Wed Mar 30 08:55:49 2022 +0300 scrobj/tests: Use CRT memory allocation functions. Signed-off-by: Nikolay Sivov <nsivov(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/scrobj/tests/scrobj.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/dlls/scrobj/tests/scrobj.c b/dlls/scrobj/tests/scrobj.c index 108b30e7bea..64b07832227 100644 --- a/dlls/scrobj/tests/scrobj.c +++ b/dlls/scrobj/tests/scrobj.c @@ -27,7 +27,6 @@ #include <mshtmhst.h> #include "wine/test.h" -#include "wine/heap.h" static HRESULT (WINAPI *pDllInstall)(BOOL, const WCHAR *); @@ -715,7 +714,7 @@ static WCHAR *get_test_file(const char *res_name) ok(res, "CloseHandle failed: %lu\n", GetLastError()); size = (wcslen(buffer) + 1) * sizeof(WCHAR); - ret = heap_alloc(size); + ret = malloc(size); memcpy(ret, buffer, size); return ret; } @@ -1078,7 +1077,7 @@ START_TEST(scrobj) register_script_object(FALSE, test_file); register_script_engine(FALSE); - heap_free(test_file); + free(test_file); } else skip("Could not register script engine\n");
1
0
0
0
Nikolay Sivov : scrobj: Fix wrong cleanup logic for factory object.
by Alexandre Julliard
30 Mar '22
30 Mar '22
Module: wine Branch: master Commit: 5aab379debfbdc11ebf5c5467c3edaa15de75f26 URL:
https://source.winehq.org/git/wine.git/?a=commit;h=5aab379debfbdc11ebf5c546…
Author: Nikolay Sivov <nsivov(a)codeweavers.com> Date: Wed Mar 30 08:55:48 2022 +0300 scrobj: Fix wrong cleanup logic for factory object. Signed-off-by: Nikolay Sivov <nsivov(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/scrobj/scrobj.c | 3 --- 1 file changed, 3 deletions(-) diff --git a/dlls/scrobj/scrobj.c b/dlls/scrobj/scrobj.c index b01fa60d6a4..90cf2024537 100644 --- a/dlls/scrobj/scrobj.c +++ b/dlls/scrobj/scrobj.c @@ -1883,10 +1883,7 @@ static HRESULT create_scriptlet_factory(const WCHAR *url, struct scriptlet_facto TRACE("%s\n", debugstr_w(url)); if (!(factory = calloc(1, sizeof(*factory)))) - { - IClassFactory_Release(&factory->IClassFactory_iface); return E_OUTOFMEMORY; - } factory->IClassFactory_iface.lpVtbl = &scriptlet_factory_vtbl; factory->ref = 1;
1
0
0
0
Nikolay Sivov : scrobj: Use CRT allocation functions.
by Alexandre Julliard
30 Mar '22
30 Mar '22
Module: wine Branch: master Commit: 1a9922734a2cd70af84ec39bc4c85fd1bbcff630 URL:
https://source.winehq.org/git/wine.git/?a=commit;h=1a9922734a2cd70af84ec39b…
Author: Nikolay Sivov <nsivov(a)codeweavers.com> Date: Wed Mar 30 08:55:47 2022 +0300 scrobj: Use CRT allocation functions. Signed-off-by: Nikolay Sivov <nsivov(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/scrobj/scrobj.c | 92 ++++++++++++++++++++++++---------------------------- 1 file changed, 42 insertions(+), 50 deletions(-) Diff:
https://source.winehq.org/git/wine.git/?a=commitdiff;h=1a9922734a2cd70af84e…
1
0
0
0
Alexandre Julliard : kernelbase: Remove the old GetLocaleInfoEx/W implementation.
by Alexandre Julliard
30 Mar '22
30 Mar '22
Module: wine Branch: master Commit: c0fda77fe2534de29b7659a4e67a701e6ef37981 URL:
https://source.winehq.org/git/wine.git/?a=commit;h=c0fda77fe2534de29b7659a4…
Author: Alexandre Julliard <julliard(a)winehq.org> Date: Tue Mar 29 22:12:30 2022 +0200 kernelbase: Remove the old GetLocaleInfoEx/W implementation. Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/kernelbase/locale.c | 90 ++++-------------------------------------------- 1 file changed, 7 insertions(+), 83 deletions(-) diff --git a/dlls/kernelbase/locale.c b/dlls/kernelbase/locale.c index 0f15afc4869..719a4133758 100644 --- a/dlls/kernelbase/locale.c +++ b/dlls/kernelbase/locale.c @@ -1559,7 +1559,7 @@ static int get_locale_info( const NLS_LOCALE_DATA *locale, LCID lcid, LCTYPE typ return locale_return_string( locale->srelativelongdate, type, buffer, len ); case 0x007d: /* undocumented */ - return -1; + return locale_return_number( 0, type, buffer, len ); case LOCALE_SSHORTESTAM: return locale_return_string( locale->sshortestam, type, buffer, len ); @@ -1918,12 +1918,6 @@ static UINT get_lcid_codepage( LCID lcid, ULONG flags ) } -static int get_value_base_by_lctype( LCTYPE lctype ) -{ - return lctype == LOCALE_ILANGUAGE || lctype == LOCALE_IDEFAULTLANGUAGE ? 16 : 10; -} - - static const CPTABLEINFO *get_codepage_table( UINT codepage ) { unsigned int i; @@ -5237,85 +5231,21 @@ INT WINAPI DECLSPEC_HOTPATCH GetLocaleInfoA( LCID lcid, LCTYPE lctype, char *buf INT WINAPI DECLSPEC_HOTPATCH GetLocaleInfoW( LCID lcid, LCTYPE lctype, WCHAR *buffer, INT len ) { const NLS_LOCALE_DATA *locale; - HRSRC hrsrc; - HGLOBAL hmem; - INT ret; - UINT lcflags = lctype; - const WCHAR *p; - unsigned int i; if (len < 0 || (len && !buffer)) { SetLastError( ERROR_INVALID_PARAMETER ); return 0; } - if (!(locale = get_locale_by_id( &lcid, 0 ))) - { - SetLastError( ERROR_INVALID_PARAMETER ); - return 0; - } - ret = get_locale_info( locale, lcid, lctype, buffer, len ); - if (ret != -1) return ret; - - if (!len) buffer = NULL; - - lcid = ConvertDefaultLocale( lcid ); - lctype = LOWORD(lctype); TRACE( "(lcid=0x%lx,lctype=0x%lx,%p,%d)\n", lcid, lctype, buffer, len ); - if (!(hrsrc = FindResourceExW( kernel32_handle, (LPWSTR)RT_STRING, - ULongToPtr((lctype >> 4) + 1), lcid ))) - { - SetLastError( ERROR_INVALID_FLAGS ); /* no such lctype */ - return 0; - } - if (!(hmem = LoadResource( kernel32_handle, hrsrc ))) return 0; - - p = LockResource( hmem ); - for (i = 0; i < (lctype & 0x0f); i++) p += *p + 1; - - if (lcflags & LOCALE_RETURN_NUMBER) ret = sizeof(UINT) / sizeof(WCHAR); - else - ret = (lctype == LOCALE_FONTSIGNATURE) ? *p : *p + 1; - - if (!len) return ret; - - if (ret > len) + if (!(locale = get_locale_by_id( &lcid, 0 ))) { - SetLastError( ERROR_INSUFFICIENT_BUFFER ); + SetLastError( ERROR_INVALID_PARAMETER ); return 0; } - - if (lcflags & LOCALE_RETURN_NUMBER) - { - UINT number; - WCHAR *end, *tmp = HeapAlloc( GetProcessHeap(), 0, (*p + 1) * sizeof(WCHAR) ); - if (!tmp) return 0; - memcpy( tmp, p + 1, *p * sizeof(WCHAR) ); - tmp[*p] = 0; - number = wcstol( tmp, &end, get_value_base_by_lctype( lctype ) ); - if (!*end) - memcpy( buffer, &number, sizeof(number) ); - else /* invalid number */ - { - SetLastError( ERROR_INVALID_FLAGS ); - ret = 0; - } - HeapFree( GetProcessHeap(), 0, tmp ); - - TRACE( "(lcid=0x%lx,lctype=0x%lx,%p,%d) returning number %d\n", - lcid, lctype, buffer, len, number ); - } - else - { - memcpy( buffer, p + 1, ret * sizeof(WCHAR) ); - if (lctype != LOCALE_FONTSIGNATURE) buffer[ret-1] = 0; - - TRACE( "(lcid=0x%lx,lctype=0x%lx,%p,%d) returning %d %s\n", - lcid, lctype, buffer, len, ret, debugstr_w(buffer) ); - } - return ret; + return get_locale_info( locale, lcid, lctype, buffer, len ); } @@ -5325,22 +5255,16 @@ INT WINAPI DECLSPEC_HOTPATCH GetLocaleInfoW( LCID lcid, LCTYPE lctype, WCHAR *bu INT WINAPI DECLSPEC_HOTPATCH GetLocaleInfoEx( const WCHAR *name, LCTYPE info, WCHAR *buffer, INT len ) { LCID lcid; - int ret; const NLS_LOCALE_DATA *locale = get_locale_by_name( name, &lcid ); + TRACE( "%s 0x%lx %p %d\n", debugstr_w(name), info, buffer, len ); + if (!locale) { SetLastError( ERROR_INVALID_PARAMETER ); return 0; } - ret = get_locale_info( locale, lcid, info, buffer, len ); - if (ret != -1) return ret; - - TRACE( "%s 0x%lx\n", debugstr_w(name), info ); - - lcid = LocaleNameToLCID( name, 0 ); - if (!lcid) return 0; - return GetLocaleInfoW( lcid, info, buffer, len ); + return get_locale_info( locale, lcid, info, buffer, len ); }
1
0
0
0
Alexandre Julliard : kernelbase: Reimplement SetLocaleInfoW().
by Alexandre Julliard
30 Mar '22
30 Mar '22
Module: wine Branch: master Commit: 78a33f968461fa3a01d3eec837b4c24f353bc00b URL:
https://source.winehq.org/git/wine.git/?a=commit;h=78a33f968461fa3a01d3eec8…
Author: Alexandre Julliard <julliard(a)winehq.org> Date: Tue Mar 29 22:12:25 2022 +0200 kernelbase: Reimplement SetLocaleInfoW(). Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/kernel32/tests/locale.c | 91 ++++++++++++++---- dlls/kernelbase/locale.c | 221 ++++++++++++++++++++++--------------------- 2 files changed, 185 insertions(+), 127 deletions(-) Diff:
https://source.winehq.org/git/wine.git/?a=commitdiff;h=78a33f968461fa3a01d3…
1
0
0
0
Alexandre Julliard : kernelbase: Reimplement updating the locale values in the registry on locale change.
by Alexandre Julliard
30 Mar '22
30 Mar '22
Module: wine Branch: master Commit: 5014a44e3ca71dbcc312316a2e7baf0602eba41f URL:
https://source.winehq.org/git/wine.git/?a=commit;h=5014a44e3ca71dbcc312316a…
Author: Alexandre Julliard <julliard(a)winehq.org> Date: Tue Mar 29 22:12:15 2022 +0200 kernelbase: Reimplement updating the locale values in the registry on locale change. Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/kernelbase/locale.c | 94 ++++++++++++++++++++++++++++++++---------------- 1 file changed, 64 insertions(+), 30 deletions(-) diff --git a/dlls/kernelbase/locale.c b/dlls/kernelbase/locale.c index 8b1d3b51afc..24ccc8abdfa 100644 --- a/dlls/kernelbase/locale.c +++ b/dlls/kernelbase/locale.c @@ -1654,6 +1654,68 @@ static int get_locale_info( const NLS_LOCALE_DATA *locale, LCID lcid, LCTYPE typ } +/* update a registry value based on the current user locale info */ +static void update_registry_value( UINT type, const WCHAR *value ) +{ + WCHAR buffer[80]; + UINT len = get_locale_info( user_locale, user_lcid, type, buffer, ARRAY_SIZE(buffer) ); + if (len) RegSetValueExW( intl_key, value, 0, REG_SZ, (BYTE *)buffer, len * sizeof(WCHAR) ); +} + + +/* update all registry values upon user locale change */ +static void update_locale_registry(void) +{ + WCHAR buffer[80]; + UINT len; + + len = swprintf( buffer, ARRAY_SIZE(buffer), L"%08x", GetUserDefaultLCID() ); + RegSetValueExW( intl_key, L"Locale", 0, REG_SZ, (BYTE *)buffer, (len + 1) * sizeof(WCHAR) ); + + update_registry_value( LOCALE_NOUSEROVERRIDE | LOCALE_ICALENDARTYPE, entry_icalendartype.value ); + update_registry_value( LOCALE_NOUSEROVERRIDE | LOCALE_ICOUNTRY, entry_icountry.value ); + update_registry_value( LOCALE_NOUSEROVERRIDE | LOCALE_ICURRDIGITS, entry_icurrdigits.value ); + update_registry_value( LOCALE_NOUSEROVERRIDE | LOCALE_ICURRENCY, entry_icurrency.value ); + update_registry_value( LOCALE_NOUSEROVERRIDE | LOCALE_IDIGITS, entry_idigits.value ); + update_registry_value( LOCALE_NOUSEROVERRIDE | LOCALE_IDIGITSUBSTITUTION, entry_idigitsubstitution.value ); + update_registry_value( LOCALE_NOUSEROVERRIDE | LOCALE_IFIRSTDAYOFWEEK, entry_ifirstdayofweek.value ); + update_registry_value( LOCALE_NOUSEROVERRIDE | LOCALE_IFIRSTWEEKOFYEAR, entry_ifirstweekofyear.value ); + update_registry_value( LOCALE_NOUSEROVERRIDE | LOCALE_ILZERO, entry_ilzero.value ); + update_registry_value( LOCALE_NOUSEROVERRIDE | LOCALE_IMEASURE, entry_imeasure.value ); + update_registry_value( LOCALE_NOUSEROVERRIDE | LOCALE_INEGCURR, entry_inegcurr.value ); + update_registry_value( LOCALE_NOUSEROVERRIDE | LOCALE_INEGNUMBER, entry_inegnumber.value ); + update_registry_value( LOCALE_NOUSEROVERRIDE | LOCALE_IPAPERSIZE, entry_ipapersize.value ); + update_registry_value( LOCALE_NOUSEROVERRIDE | LOCALE_S1159, entry_s1159.value ); + update_registry_value( LOCALE_NOUSEROVERRIDE | LOCALE_S2359, entry_s2359.value ); + update_registry_value( LOCALE_NOUSEROVERRIDE | LOCALE_SCURRENCY, entry_scurrency.value ); + update_registry_value( LOCALE_NOUSEROVERRIDE | LOCALE_SDECIMAL, entry_sdecimal.value ); + update_registry_value( LOCALE_NOUSEROVERRIDE | LOCALE_SGROUPING, entry_sgrouping.value ); + update_registry_value( LOCALE_NOUSEROVERRIDE | LOCALE_SLIST, entry_slist.value ); + update_registry_value( LOCALE_NOUSEROVERRIDE | LOCALE_SLONGDATE, entry_slongdate.value ); + update_registry_value( LOCALE_NOUSEROVERRIDE | LOCALE_SMONDECIMALSEP, entry_smondecimalsep.value ); + update_registry_value( LOCALE_NOUSEROVERRIDE | LOCALE_SMONGROUPING, entry_smongrouping.value ); + update_registry_value( LOCALE_NOUSEROVERRIDE | LOCALE_SMONTHOUSANDSEP, entry_smonthousandsep.value ); + update_registry_value( LOCALE_NOUSEROVERRIDE | LOCALE_SNATIVEDIGITS, entry_snativedigits.value ); + update_registry_value( LOCALE_NOUSEROVERRIDE | LOCALE_SNEGATIVESIGN, entry_snegativesign.value ); + update_registry_value( LOCALE_NOUSEROVERRIDE | LOCALE_SPOSITIVESIGN, entry_spositivesign.value ); + update_registry_value( LOCALE_NOUSEROVERRIDE | LOCALE_SSHORTDATE, entry_sshortdate.value ); + update_registry_value( LOCALE_NOUSEROVERRIDE | LOCALE_SSHORTTIME, entry_sshorttime.value ); + update_registry_value( LOCALE_NOUSEROVERRIDE | LOCALE_STHOUSAND, entry_sthousand.value ); + update_registry_value( LOCALE_NOUSEROVERRIDE | LOCALE_STIMEFORMAT, entry_stimeformat.value ); + update_registry_value( LOCALE_NOUSEROVERRIDE | LOCALE_SYEARMONTH, entry_syearmonth.value ); + update_registry_value( LOCALE_NOUSEROVERRIDE | LOCALE_IDATE, L"iDate" ); + update_registry_value( LOCALE_NOUSEROVERRIDE | LOCALE_ITIME, L"iTime" ); + update_registry_value( LOCALE_NOUSEROVERRIDE | LOCALE_ITIMEMARKPOSN, L"iTimePrefix" ); + update_registry_value( LOCALE_NOUSEROVERRIDE | LOCALE_ITLZERO, L"iTLZero" ); + update_registry_value( LOCALE_NOUSEROVERRIDE | LOCALE_SDATE, L"sDate" ); + update_registry_value( LOCALE_NOUSEROVERRIDE | LOCALE_STIME, L"sTime" ); + update_registry_value( LOCALE_NOUSEROVERRIDE | LOCALE_SABBREVLANGNAME, L"sLanguage" ); + update_registry_value( LOCALE_NOUSEROVERRIDE | LOCALE_SCOUNTRY, L"sCountry" ); + update_registry_value( LOCALE_NOUSEROVERRIDE | LOCALE_SNAME, L"LocaleName" ); + SetUserGeoID( user_locale->igeoid ); +} + + /*********************************************************************** * init_locale */ @@ -1664,8 +1726,7 @@ void init_locale(void) void *sort_ptr; WCHAR bufferW[LOCALE_NAME_MAX_LENGTH]; DYNAMIC_TIME_ZONE_INFORMATION timezone; - GEOID geoid = GEOID_NOT_AVAILABLE; - DWORD count, dispos, i; + DWORD count; SIZE_T size; HKEY hkey; @@ -1721,17 +1782,6 @@ void init_locale(void) RegCloseKey( hkey ); } - if (!RegCreateKeyExW( intl_key, L"Geo", 0, NULL, 0, KEY_ALL_ACCESS, NULL, &hkey, &dispos )) - { - if (dispos == REG_CREATED_NEW_KEY) - { - GetLocaleInfoW( LOCALE_USER_DEFAULT, LOCALE_IGEOID | LOCALE_RETURN_NUMBER, - (WCHAR *)&geoid, sizeof(geoid) / sizeof(WCHAR) ); - SetUserGeoID( geoid ); - } - RegCloseKey( hkey ); - } - /* Update registry contents if the user locale has changed. * This simulates the action of the Windows control panel. */ @@ -1742,24 +1792,8 @@ void init_locale(void) TRACE( "updating registry, locale changed %s -> %08lx\n", debugstr_w(bufferW), user_lcid ); } else TRACE( "updating registry, locale changed none -> %08lx\n", user_lcid ); - swprintf( bufferW, ARRAY_SIZE(bufferW), L"%08x", user_lcid ); - RegSetValueExW( intl_key, L"Locale", 0, REG_SZ, - (BYTE *)bufferW, (lstrlenW(bufferW) + 1) * sizeof(WCHAR) ); - for (i = 0; i < ARRAY_SIZE(registry_values); i++) - { - GetLocaleInfoW( LOCALE_USER_DEFAULT, registry_values[i].lctype | LOCALE_NOUSEROVERRIDE, - bufferW, ARRAY_SIZE( bufferW )); - RegSetValueExW( intl_key, registry_values[i].name, 0, REG_SZ, - (BYTE *)bufferW, (lstrlenW(bufferW) + 1) * sizeof(WCHAR) ); - } - - if (geoid == GEOID_NOT_AVAILABLE) - { - GetLocaleInfoW( LOCALE_USER_DEFAULT, LOCALE_IGEOID | LOCALE_RETURN_NUMBER, - (WCHAR *)&geoid, sizeof(geoid) / sizeof(WCHAR) ); - SetUserGeoID( geoid ); - } + update_locale_registry(); if (!RegCreateKeyExW( nls_key, L"Codepage", 0, NULL, REG_OPTION_NON_VOLATILE, KEY_ALL_ACCESS, NULL, &hkey, NULL ))
1
0
0
0
Alexandre Julliard : kernelbase: Reimplement fetching customized values from the registry in GetLocaleInfoW/Ex.
by Alexandre Julliard
30 Mar '22
30 Mar '22
Module: wine Branch: master Commit: 1398a0106491e044bc3d4d173a3317a919d3faee URL:
https://source.winehq.org/git/wine.git/?a=commit;h=1398a0106491e044bc3d4d17…
Author: Alexandre Julliard <julliard(a)winehq.org> Date: Tue Mar 29 22:12:09 2022 +0200 kernelbase: Reimplement fetching customized values from the registry in GetLocaleInfoW/Ex. Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/kernelbase/locale.c | 209 ++++++++++++++++++++++++++++------------------- 1 file changed, 124 insertions(+), 85 deletions(-) Diff:
https://source.winehq.org/git/wine.git/?a=commitdiff;h=1398a0106491e044bc3d…
1
0
0
0
Alexandre Julliard : kernelbase: Reimplement values computed from date/time formats in GetLocaleInfoW/Ex.
by Alexandre Julliard
30 Mar '22
30 Mar '22
Module: wine Branch: master Commit: 781086670dedf208a5357872f412741d284c6a9e URL:
https://source.winehq.org/git/wine.git/?a=commit;h=781086670dedf208a5357872…
Author: Alexandre Julliard <julliard(a)winehq.org> Date: Tue Mar 29 22:11:59 2022 +0200 kernelbase: Reimplement values computed from date/time formats in GetLocaleInfoW/Ex. Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/kernelbase/locale.c | 88 ++++++++++++++++++++++++++++++++++++++++++------ 1 file changed, 78 insertions(+), 10 deletions(-) diff --git a/dlls/kernelbase/locale.c b/dlls/kernelbase/locale.c index 3efadb51f6e..26308d722ef 100644 --- a/dlls/kernelbase/locale.c +++ b/dlls/kernelbase/locale.c @@ -961,6 +961,27 @@ static int locale_return_strarray_concat( DWORD pos, LCTYPE type, WCHAR *buffer, } +/* find the first format char in a format string */ +static WCHAR *find_format( WCHAR *str, const WCHAR *accept ) +{ + for ( ; *str; str++) + { + if (*str == '\'') + { + if (!(str = wcschr( str + 1, '\'' ))) return NULL; + } + else if (wcschr( accept, *str )) + { + /* ignore "ddd" and "dddd" */ + if (str[0] != 'd' || str[1] != 'd' || str[2] != 'd') return str; + str += 2; + while (str[1] == 'd') str++; + } + } + return NULL; +} + + /* FIXME: hardcoded, sortname is apparently not available in locale.nls */ static const WCHAR *get_locale_sortname( LCID lcid ) { @@ -1046,6 +1067,7 @@ static int get_locale_info( const NLS_LOCALE_DATA *locale, LCID lcid, LCTYPE typ static const BYTE inegsignposn[] = { 0, 3, 4, 2, 0, 1, 3, 4, 1, 3, 4, 2, 4, 3, 0, 0 }; static const BYTE inegsymprecedes[] = { 1, 1, 1, 1, 0, 0, 0, 0, 0, 1, 0, 1, 1, 0, 1, 0, }; const WCHAR *sort; + WCHAR *str, *end, tmp[80]; UINT val; if (locale != user_locale) type |= LOCALE_NOUSEROVERRIDE; @@ -1140,10 +1162,22 @@ static int get_locale_info( const NLS_LOCALE_DATA *locale, LCID lcid, LCTYPE typ return locale_return_number( locale->inegcurr, type, buffer, len ); case LOCALE_SDATE: - return -1; + if (!get_locale_info( locale, lcid, LOCALE_SSHORTDATE | (type & LOCALE_NOUSEROVERRIDE), + tmp, ARRAY_SIZE( tmp ))) break; + if (!(str = find_format( tmp, L"dMy" ))) break; + while (str[1] == str[0]) str++; /* skip repeated chars */ + if (!(end = find_format( ++str, L"dMy" ))) break; + *end++ = 0; + return locale_return_data( str, end - str, type, buffer, len ); case LOCALE_STIME: - return -1; + if (!get_locale_info( locale, lcid, LOCALE_STIMEFORMAT | (type & LOCALE_NOUSEROVERRIDE), + tmp, ARRAY_SIZE( tmp ))) break; + if (!(str = find_format( tmp, L"Hhms" ))) break; + while (str[1] == str[0]) str++; /* skip repeated chars */ + if (!(end = find_format( ++str, L"Hhms" ))) break; + *end++ = 0; + return locale_return_data( str, end - str, type, buffer, len ); case LOCALE_SSHORTDATE: return locale_return_strarray( locale->sshortdate, 0, type, buffer, len ); @@ -1152,25 +1186,56 @@ static int get_locale_info( const NLS_LOCALE_DATA *locale, LCID lcid, LCTYPE typ return locale_return_strarray( locale->slongdate, 0, type, buffer, len ); case LOCALE_IDATE: - return -1; + if (!get_locale_info( locale, lcid, LOCALE_SSHORTDATE | (type & LOCALE_NOUSEROVERRIDE), + tmp, ARRAY_SIZE( tmp ))) break; + /* if both year and day are found before month, the last one takes precedence */ + for (val = 0, str = find_format( tmp, L"dMy" ); str; str = find_format( str + 1, L"dMy" )) + { + if (*str == 'M') break; + val = (*str == 'y' ? 2 : 1); + } + return locale_return_number( val, type, buffer, len ); case LOCALE_ILDATE: - return -1; + if (!get_locale_info( locale, lcid, LOCALE_SLONGDATE | (type & LOCALE_NOUSEROVERRIDE), + tmp, ARRAY_SIZE( tmp ))) break; + /* if both year and day are found before month, the last one takes precedence */ + for (val = 0, str = find_format( tmp, L"dMy" ); str; str = find_format( str + 1, L"dMy" )) + { + if (*str == 'M') break; + val = (*str == 'y' ? 2 : 1); + } + return locale_return_number( val, type, buffer, len ); case LOCALE_ITIME: - return -1; + if (!get_locale_info( locale, lcid, LOCALE_STIMEFORMAT | (type & LOCALE_NOUSEROVERRIDE), + tmp, ARRAY_SIZE( tmp ))) break; + if (!(str = find_format( tmp, L"Hh" ))) break; + return locale_return_number( *str == 'H', type, buffer, len ); case LOCALE_ICENTURY: - return -1; + if (!get_locale_info( locale, lcid, LOCALE_SSHORTDATE | (type & LOCALE_NOUSEROVERRIDE), + tmp, ARRAY_SIZE( tmp ))) break; + if (!(str = find_format( tmp, L"y" ))) break; + return locale_return_number( !wcsncmp( str, L"yyyy", 4 ), type, buffer, len ); case LOCALE_ITLZERO: - return -1; + if (!get_locale_info( locale, lcid, LOCALE_STIMEFORMAT | (type & LOCALE_NOUSEROVERRIDE), + tmp, ARRAY_SIZE( tmp ))) break; + if (!(str = find_format( tmp, L"Hh" ))) break; + return locale_return_number( str[1] == str[0], type, buffer, len ); case LOCALE_IDAYLZERO: - return -1; + if (!get_locale_info( locale, lcid, LOCALE_SSHORTDATE | (type & LOCALE_NOUSEROVERRIDE), + tmp, ARRAY_SIZE( tmp ))) break; + if (!(str = find_format( tmp, L"d" ))) break; + return locale_return_number( str[1] == 'd', type, buffer, len ); case LOCALE_IMONLZERO: - return -1; + if (!get_locale_info( locale, lcid, LOCALE_SSHORTDATE | (type & LOCALE_NOUSEROVERRIDE), + tmp, ARRAY_SIZE( tmp ))) break; + if (!(str = find_format( tmp, L"M" ))) break; + return locale_return_number( str[1] == 'M', type, buffer, len ); case LOCALE_S1159: return locale_return_string( locale->s1159, type, buffer, len ); @@ -1404,7 +1469,10 @@ static int get_locale_info( const NLS_LOCALE_DATA *locale, LCID lcid, LCTYPE typ return locale_return_number( val, type, buffer, len ); case LOCALE_ITIMEMARKPOSN: - return -1; + if (!get_locale_info( locale, lcid, LOCALE_STIMEFORMAT | (type & LOCALE_NOUSEROVERRIDE), + tmp, ARRAY_SIZE( tmp ))) break; + if (!(str = find_format( tmp, L"Hhmst" ))) break; + return locale_return_number( *str == 't', type, buffer, len ); case LOCALE_SYEARMONTH: return locale_return_strarray( locale->syearmonth, 0, type, buffer, len );
1
0
0
0
Alexandre Julliard : kernelbase: Reimplement values computed from currency formats in GetLocaleInfoW/Ex.
by Alexandre Julliard
30 Mar '22
30 Mar '22
Module: wine Branch: master Commit: c957158730906cbbf5c2c27593914c6e3499d189 URL:
https://source.winehq.org/git/wine.git/?a=commit;h=c957158730906cbbf5c2c275…
Author: Alexandre Julliard <julliard(a)winehq.org> Date: Tue Mar 29 22:11:55 2022 +0200 kernelbase: Reimplement values computed from currency formats in GetLocaleInfoW/Ex. Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/kernelbase/locale.c | 33 +++++++++++++++++++++++++++------ 1 file changed, 27 insertions(+), 6 deletions(-) diff --git a/dlls/kernelbase/locale.c b/dlls/kernelbase/locale.c index 669e1b14290..3efadb51f6e 100644 --- a/dlls/kernelbase/locale.c +++ b/dlls/kernelbase/locale.c @@ -1042,6 +1042,9 @@ static int get_locale_info( const NLS_LOCALE_DATA *locale, LCID lcid, LCTYPE typ WCHAR *buffer, int len ) { static const WCHAR spermille[] = { 0x2030, 0 }; /* this one seems hardcoded */ + static const BYTE ipossignposn[] = { 3, 3, 4, 2, 1, 1, 3, 4, 1, 3, 4, 2, 4, 3, 3, 1 }; + static const BYTE inegsignposn[] = { 0, 3, 4, 2, 0, 1, 3, 4, 1, 3, 4, 2, 4, 3, 0, 0 }; + static const BYTE inegsymprecedes[] = { 1, 1, 1, 1, 0, 0, 0, 0, 0, 1, 0, 1, 1, 0, 1, 0, }; const WCHAR *sort; UINT val; @@ -1234,22 +1237,40 @@ static int get_locale_info( const NLS_LOCALE_DATA *locale, LCID lcid, LCTYPE typ return locale_return_string( locale->snegativesign, type, buffer, len ); case LOCALE_IPOSSIGNPOSN: - return -1; + if (!get_locale_info( locale, lcid, + LOCALE_INEGCURR | LOCALE_RETURN_NUMBER | (type & LOCALE_NOUSEROVERRIDE), + (WCHAR *)&val, sizeof(val)/sizeof(WCHAR) )) break; + return locale_return_number( ipossignposn[val], type, buffer, len ); case LOCALE_INEGSIGNPOSN: - return -1; + if (!get_locale_info( locale, lcid, + LOCALE_INEGCURR | LOCALE_RETURN_NUMBER | (type & LOCALE_NOUSEROVERRIDE), + (WCHAR *)&val, sizeof(val)/sizeof(WCHAR) )) break; + return locale_return_number( inegsignposn[val], type, buffer, len ); case LOCALE_IPOSSYMPRECEDES: - return -1; + if (!get_locale_info( locale, lcid, + LOCALE_ICURRENCY | LOCALE_RETURN_NUMBER | (type & LOCALE_NOUSEROVERRIDE), + (WCHAR *)&val, sizeof(val)/sizeof(WCHAR) )) break; + return locale_return_number( !(val & 1), type, buffer, len ); case LOCALE_IPOSSEPBYSPACE: - return -1; + if (!get_locale_info( locale, lcid, + LOCALE_ICURRENCY | LOCALE_RETURN_NUMBER | (type & LOCALE_NOUSEROVERRIDE), + (WCHAR *)&val, sizeof(val)/sizeof(WCHAR) )) break; + return locale_return_number( !!(val & 2), type, buffer, len ); case LOCALE_INEGSYMPRECEDES: - return -1; + if (!get_locale_info( locale, lcid, + LOCALE_INEGCURR | LOCALE_RETURN_NUMBER | (type & LOCALE_NOUSEROVERRIDE), + (WCHAR *)&val, sizeof(val)/sizeof(WCHAR) )) break; + return locale_return_number( inegsymprecedes[val], type, buffer, len ); case LOCALE_INEGSEPBYSPACE: - return -1; + if (!get_locale_info( locale, lcid, + LOCALE_INEGCURR | LOCALE_RETURN_NUMBER | (type & LOCALE_NOUSEROVERRIDE), + (WCHAR *)&val, sizeof(val)/sizeof(WCHAR) )) break; + return locale_return_number( (val >= 8), type, buffer, len ); case LOCALE_FONTSIGNATURE: return locale_return_data( locale_strings + locale->fontsignature + 1,
1
0
0
0
← Newer
1
...
4
5
6
7
8
9
10
...
114
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
Results per page:
10
25
50
100
200