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
April 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
1024 discussions
Start a n
N
ew thread
Alexandre Julliard : kernelbase: Reimplement Internal_EnumDateFormats() using the locale.nls data.
by Alexandre Julliard
07 Apr '22
07 Apr '22
Module: wine Branch: master Commit: 4d68497fac6e86592580b0e8661fde296e564f63 URL:
https://source.winehq.org/git/wine.git/?a=commit;h=4d68497fac6e86592580b0e8…
Author: Alexandre Julliard <julliard(a)winehq.org> Date: Thu Apr 7 11:23:45 2022 +0200 kernelbase: Reimplement Internal_EnumDateFormats() using the locale.nls data. Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/kernel32/locale.c | 10 +++-- dlls/kernelbase/locale.c | 114 +++++++++++++++++++++++++++++++++-------------- 2 files changed, 87 insertions(+), 37 deletions(-) Diff:
https://source.winehq.org/git/wine.git/?a=commitdiff;h=4d68497fac6e86592580…
1
0
0
0
Alexandre Julliard : kernelbase: Reimplement Internal_EnumTimeFormats() using the locale.nls data.
by Alexandre Julliard
07 Apr '22
07 Apr '22
Module: wine Branch: master Commit: 25595a0abe2f182882e1dac39d9c1a38bc412d41 URL:
https://source.winehq.org/git/wine.git/?a=commit;h=25595a0abe2f182882e1dac3…
Author: Alexandre Julliard <julliard(a)winehq.org> Date: Thu Apr 7 11:23:20 2022 +0200 kernelbase: Reimplement Internal_EnumTimeFormats() using the locale.nls data. Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/kernel32/locale.c | 7 ++++--- dlls/kernelbase/locale.c | 46 ++++++++++++++++++++++++++++------------------ 2 files changed, 32 insertions(+), 21 deletions(-) diff --git a/dlls/kernel32/locale.c b/dlls/kernel32/locale.c index 6af66375def..ad84ae58858 100644 --- a/dlls/kernel32/locale.c +++ b/dlls/kernel32/locale.c @@ -55,8 +55,8 @@ extern BOOL WINAPI Internal_EnumLanguageGroupLocales( LANGGROUPLOCALE_ENUMPROCW extern BOOL WINAPI Internal_EnumSystemCodePages( CODEPAGE_ENUMPROCW proc, DWORD flags, BOOL unicode ); extern BOOL WINAPI Internal_EnumSystemLanguageGroups( LANGUAGEGROUP_ENUMPROCW proc, DWORD flags, LONG_PTR param, BOOL unicode ); -extern BOOL WINAPI Internal_EnumTimeFormats( TIMEFMT_ENUMPROCW proc, LCID lcid, DWORD flags, - BOOL unicode, BOOL ex, LPARAM lparam ); +extern BOOL WINAPI Internal_EnumTimeFormats( TIMEFMT_ENUMPROCW proc, const NLS_LOCALE_DATA *locale, + DWORD flags, BOOL unicode, BOOL ex, LPARAM lparam ); extern BOOL WINAPI Internal_EnumUILanguages( UILANGUAGE_ENUMPROCW proc, DWORD flags, LONG_PTR param, BOOL unicode ); @@ -350,7 +350,8 @@ BOOL WINAPI EnumTimeFormatsA( TIMEFMT_ENUMPROCA proc, LCID lcid, DWORD flags ) SetLastError(ERROR_INVALID_FLAGS); return FALSE; } - return Internal_EnumTimeFormats( (TIMEFMT_ENUMPROCW)proc, lcid, flags, FALSE, FALSE, 0 ); + return Internal_EnumTimeFormats( (TIMEFMT_ENUMPROCW)proc, NlsValidateLocale( &lcid, 0 ), + flags, FALSE, FALSE, 0 ); } /****************************************************************************** diff --git a/dlls/kernelbase/locale.c b/dlls/kernelbase/locale.c index 4742bed25a1..c20117264b7 100644 --- a/dlls/kernelbase/locale.c +++ b/dlls/kernelbase/locale.c @@ -3888,14 +3888,16 @@ BOOL WINAPI DECLSPEC_HOTPATCH Internal_EnumSystemLanguageGroups( LANGUAGEGROUP_E /************************************************************************** * Internal_EnumTimeFormats (kernelbase.@) */ -BOOL WINAPI DECLSPEC_HOTPATCH Internal_EnumTimeFormats( TIMEFMT_ENUMPROCW proc, LCID lcid, DWORD flags, +BOOL WINAPI DECLSPEC_HOTPATCH Internal_EnumTimeFormats( TIMEFMT_ENUMPROCW proc, + const NLS_LOCALE_DATA *locale, DWORD flags, BOOL unicode, BOOL ex, LPARAM lparam ) { WCHAR buffer[256]; - LCTYPE lctype; - INT ret; + INT ret = TRUE; + const DWORD *array; + DWORD pos, i; - if (!proc) + if (!proc || !locale) { SetLastError( ERROR_INVALID_PARAMETER ); return FALSE; @@ -3903,10 +3905,12 @@ BOOL WINAPI DECLSPEC_HOTPATCH Internal_EnumTimeFormats( TIMEFMT_ENUMPROCW proc, switch (flags & ~LOCALE_USE_CP_ACP) { case 0: - lctype = LOCALE_STIMEFORMAT; + if (!get_locale_info( locale, 0, LOCALE_STIMEFORMAT, buffer, ARRAY_SIZE(buffer) )) return FALSE; + pos = locale->stimeformat; break; case TIME_NOSECONDS: - lctype = LOCALE_SSHORTTIME; + if (!get_locale_info( locale, 0, LOCALE_SSHORTTIME, buffer, ARRAY_SIZE(buffer) )) return FALSE; + pos = locale->sshorttime; break; default: FIXME( "Unknown time format %lx\n", flags ); @@ -3914,16 +3918,21 @@ BOOL WINAPI DECLSPEC_HOTPATCH Internal_EnumTimeFormats( TIMEFMT_ENUMPROCW proc, return FALSE; } - lctype |= flags & LOCALE_USE_CP_ACP; - if (unicode) - ret = GetLocaleInfoW( lcid, lctype, buffer, ARRAY_SIZE(buffer) ); - else - ret = GetLocaleInfoA( lcid, lctype, (char *)buffer, sizeof(buffer) ); - - if (ret) + array = (const DWORD *)(locale_strings + pos + 1); + for (i = 0; ret && i < locale_strings[pos]; i++) { - if (ex) ((TIMEFMT_ENUMPROCEX)proc)( buffer, lparam ); - else proc( buffer ); + if (i) memcpy( buffer, locale_strings + array[i] + 1, + (locale_strings[array[i]] + 1) * sizeof(WCHAR) ); + + if (ex) ret = ((TIMEFMT_ENUMPROCEX)proc)( buffer, lparam ); + else if (unicode) ret = proc( buffer ); + else + { + char buffA[256]; + WideCharToMultiByte( get_locale_codepage( locale, flags ), 0, buffer, -1, + buffA, ARRAY_SIZE(buffA), NULL, NULL ); + ret = proc( (WCHAR *)buffA ); + } } return TRUE; } @@ -4408,7 +4417,7 @@ BOOL WINAPI DECLSPEC_HOTPATCH EnumSystemLocalesEx( LOCALE_ENUMPROCEX proc, DWORD */ BOOL WINAPI DECLSPEC_HOTPATCH EnumTimeFormatsW( TIMEFMT_ENUMPROCW proc, LCID lcid, DWORD flags ) { - return Internal_EnumTimeFormats( proc, lcid, flags, TRUE, FALSE, 0 ); + return Internal_EnumTimeFormats( proc, NlsValidateLocale( &lcid, 0 ), flags, TRUE, FALSE, 0 ); } @@ -4418,8 +4427,9 @@ BOOL WINAPI DECLSPEC_HOTPATCH EnumTimeFormatsW( TIMEFMT_ENUMPROCW proc, LCID lci BOOL WINAPI DECLSPEC_HOTPATCH EnumTimeFormatsEx( TIMEFMT_ENUMPROCEX proc, const WCHAR *locale, DWORD flags, LPARAM lparam ) { - LCID lcid = LocaleNameToLCID( locale, 0 ); - return Internal_EnumTimeFormats( (TIMEFMT_ENUMPROCW)proc, lcid, flags, TRUE, TRUE, lparam ); + LCID lcid; + return Internal_EnumTimeFormats( (TIMEFMT_ENUMPROCW)proc, get_locale_by_name( locale, &lcid ), + flags, TRUE, TRUE, lparam ); }
1
0
0
0
Alexandre Julliard : kernelbase: Reimplement Internal_EnumCalendarInfo() using the locale.nls data.
by Alexandre Julliard
07 Apr '22
07 Apr '22
Module: wine Branch: master Commit: 8576c3e1312faa6e8e6bcdd60f620161b82fd3c7 URL:
https://source.winehq.org/git/wine.git/?a=commit;h=8576c3e1312faa6e8e6bcdd6…
Author: Alexandre Julliard <julliard(a)winehq.org> Date: Thu Apr 7 11:22:45 2022 +0200 kernelbase: Reimplement Internal_EnumCalendarInfo() using the locale.nls data. Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/kernel32/locale.c | 12 +++++++---- dlls/kernelbase/locale.c | 56 +++++++++++++++++++++++++++++++++--------------- 2 files changed, 47 insertions(+), 21 deletions(-) diff --git a/dlls/kernel32/locale.c b/dlls/kernel32/locale.c index d46a2aa1580..6af66375def 100644 --- a/dlls/kernel32/locale.c +++ b/dlls/kernel32/locale.c @@ -38,12 +38,14 @@ #include "winerror.h" #include "winver.h" #include "kernel_private.h" -#include "wine/heap.h" #include "wine/debug.h" WINE_DEFAULT_DEBUG_CHANNEL(nls); -extern BOOL WINAPI Internal_EnumCalendarInfo( CALINFO_ENUMPROCW proc, LCID lcid, CALID id, +extern const NLS_LOCALE_DATA * WINAPI NlsValidateLocale( LCID *lcid, ULONG flags ); + +extern BOOL WINAPI Internal_EnumCalendarInfo( CALINFO_ENUMPROCW proc, + const NLS_LOCALE_DATA *locale, CALID id, CALTYPE type, BOOL unicode, BOOL ex, BOOL exex, LPARAM lparam ); extern BOOL WINAPI Internal_EnumDateFormats( DATEFMT_ENUMPROCW proc, LCID lcid, DWORD flags, BOOL unicode, @@ -299,7 +301,8 @@ BOOL WINAPI EnumLanguageGroupLocalesA( LANGGROUPLOCALE_ENUMPROCA proc, LGRPID id */ BOOL WINAPI EnumCalendarInfoA( CALINFO_ENUMPROCA proc, LCID lcid, CALID id, CALTYPE type ) { - return Internal_EnumCalendarInfo( (CALINFO_ENUMPROCW)proc, lcid, id, type, FALSE, FALSE, FALSE, 0 ); + return Internal_EnumCalendarInfo( (CALINFO_ENUMPROCW)proc, NlsValidateLocale( &lcid, 0 ), + id, type, FALSE, FALSE, FALSE, 0 ); } /****************************************************************************** @@ -307,7 +310,8 @@ BOOL WINAPI EnumCalendarInfoA( CALINFO_ENUMPROCA proc, LCID lcid, CALID id, CALT */ BOOL WINAPI EnumCalendarInfoExA( CALINFO_ENUMPROCEXA proc, LCID lcid, CALID id, CALTYPE type ) { - return Internal_EnumCalendarInfo( (CALINFO_ENUMPROCW)proc, lcid, id, type, FALSE, TRUE, FALSE, 0 ); + return Internal_EnumCalendarInfo( (CALINFO_ENUMPROCW)proc, NlsValidateLocale( &lcid, 0 ), + id, type, FALSE, TRUE, FALSE, 0 ); } /************************************************************************** diff --git a/dlls/kernelbase/locale.c b/dlls/kernelbase/locale.c index 2c2a47a08b8..4742bed25a1 100644 --- a/dlls/kernelbase/locale.c +++ b/dlls/kernelbase/locale.c @@ -1956,6 +1956,14 @@ static WCHAR compose_chars( WCHAR ch1, WCHAR ch2 ) } +static UINT get_locale_codepage( const NLS_LOCALE_DATA *locale, ULONG flags ) +{ + UINT ret = locale->idefaultansicodepage; + if ((flags & LOCALE_USE_CP_ACP) || ret == CP_UTF8) ret = system_locale->idefaultansicodepage; + return ret; +} + + static UINT get_lcid_codepage( LCID lcid, ULONG flags ) { UINT ret = GetACP(); @@ -3627,15 +3635,17 @@ static DWORD get_timezone_id( const TIME_ZONE_INFORMATION *info, LARGE_INTEGER t /****************************************************************************** * Internal_EnumCalendarInfo (kernelbase.@) */ -BOOL WINAPI DECLSPEC_HOTPATCH Internal_EnumCalendarInfo( CALINFO_ENUMPROCW proc, LCID lcid, CALID id, +BOOL WINAPI DECLSPEC_HOTPATCH Internal_EnumCalendarInfo( CALINFO_ENUMPROCW proc, + const NLS_LOCALE_DATA *locale, CALID id, CALTYPE type, BOOL unicode, BOOL ex, BOOL exex, LPARAM lparam ) { + const USHORT *calendars; + USHORT cal = id; WCHAR buffer[256]; - CALID calendars[2] = { id }; - INT ret, i; + INT ret, i, count = 1; - if (!proc) + if (!proc || !locale) { SetLastError( ERROR_INVALID_PARAMETER ); return FALSE; @@ -3643,24 +3653,33 @@ BOOL WINAPI DECLSPEC_HOTPATCH Internal_EnumCalendarInfo( CALINFO_ENUMPROCW proc, if (id == ENUM_ALL_CALENDARS) { - if (!GetLocaleInfoW( lcid, LOCALE_ICALENDARTYPE | LOCALE_RETURN_NUMBER, - (WCHAR *)&calendars[0], sizeof(calendars[0]) / sizeof(WCHAR) )) return FALSE; - if (!GetLocaleInfoW( lcid, LOCALE_IOPTIONALCALENDAR | LOCALE_RETURN_NUMBER, - (WCHAR *)&calendars[1], sizeof(calendars[1]) / sizeof(WCHAR) )) calendars[1] = 0; + count = locale_strings[locale->scalendartype]; + calendars = locale_strings + locale->scalendartype + 1; + } + else if (id <= CAL_UMALQURA) + { + calendars = &cal; + count = 1; + } + else + { + SetLastError( ERROR_INVALID_PARAMETER ); + return FALSE; } - for (i = 0; i < ARRAY_SIZE(calendars) && calendars[i]; i++) + for (i = 0; i < count; i++) { id = calendars[i]; if (type & CAL_RETURN_NUMBER) - ret = GetCalendarInfoW( lcid, id, type, NULL, 0, (LPDWORD)buffer ); + ret = get_calendar_info( locale, id, type, NULL, 0, (LPDWORD)buffer ); else if (unicode) - ret = GetCalendarInfoW( lcid, id, type, buffer, ARRAY_SIZE(buffer), NULL ); + ret = get_calendar_info( locale, id, type, buffer, ARRAY_SIZE(buffer), NULL ); else { WCHAR bufW[256]; - ret = GetCalendarInfoW( lcid, id, type, bufW, ARRAY_SIZE(bufW), NULL ); - if (ret) WideCharToMultiByte( CP_ACP, 0, bufW, -1, (char *)buffer, sizeof(buffer), NULL, NULL ); + ret = get_calendar_info( locale, id, type, bufW, ARRAY_SIZE(bufW), NULL ); + if (ret) WideCharToMultiByte( get_locale_codepage( locale, type ), 0, + bufW, -1, (char *)buffer, sizeof(buffer), NULL, NULL ); } if (ret) @@ -4155,7 +4174,8 @@ LCID WINAPI DECLSPEC_HOTPATCH ConvertDefaultLocale( LCID lcid ) BOOL WINAPI DECLSPEC_HOTPATCH EnumCalendarInfoW( CALINFO_ENUMPROCW proc, LCID lcid, CALID id, CALTYPE type ) { - return Internal_EnumCalendarInfo( proc, lcid, id, type, TRUE, FALSE, FALSE, 0 ); + return Internal_EnumCalendarInfo( proc, NlsValidateLocale( &lcid, 0 ), + id, type, TRUE, FALSE, FALSE, 0 ); } @@ -4165,7 +4185,8 @@ BOOL WINAPI DECLSPEC_HOTPATCH EnumCalendarInfoW( CALINFO_ENUMPROCW proc, LCID lc BOOL WINAPI DECLSPEC_HOTPATCH EnumCalendarInfoExW( CALINFO_ENUMPROCEXW proc, LCID lcid, CALID id, CALTYPE type ) { - return Internal_EnumCalendarInfo( (CALINFO_ENUMPROCW)proc, lcid, id, type, TRUE, TRUE, FALSE, 0 ); + return Internal_EnumCalendarInfo( (CALINFO_ENUMPROCW)proc, NlsValidateLocale( &lcid, 0 ), + id, type, TRUE, TRUE, FALSE, 0 ); } /****************************************************************************** @@ -4174,8 +4195,9 @@ BOOL WINAPI DECLSPEC_HOTPATCH EnumCalendarInfoExW( CALINFO_ENUMPROCEXW proc, LCI BOOL WINAPI DECLSPEC_HOTPATCH EnumCalendarInfoExEx( CALINFO_ENUMPROCEXEX proc, LPCWSTR locale, CALID id, LPCWSTR reserved, CALTYPE type, LPARAM lparam ) { - LCID lcid = LocaleNameToLCID( locale, 0 ); - return Internal_EnumCalendarInfo( (CALINFO_ENUMPROCW)proc, lcid, id, type, TRUE, TRUE, TRUE, lparam ); + LCID lcid; + return Internal_EnumCalendarInfo( (CALINFO_ENUMPROCW)proc, get_locale_by_name( locale, &lcid ), + id, type, TRUE, TRUE, TRUE, lparam ); }
1
0
0
0
Alexandre Julliard : kernelbase: Implement NlsValidateLocale().
by Alexandre Julliard
07 Apr '22
07 Apr '22
Module: wine Branch: master Commit: 6517f6c239e9f6b7909daefa3680365bbbdbbe1f URL:
https://source.winehq.org/git/wine.git/?a=commit;h=6517f6c239e9f6b7909daefa…
Author: Alexandre Julliard <julliard(a)winehq.org> Date: Thu Apr 7 11:21:21 2022 +0200 kernelbase: Implement NlsValidateLocale(). Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/kernel32/tests/locale.c | 82 +++++++++++++++++++++++++++++++++++++++++ dlls/kernelbase/kernelbase.spec | 2 +- dlls/kernelbase/locale.c | 46 ++++++++++++----------- 3 files changed, 108 insertions(+), 22 deletions(-) Diff:
https://source.winehq.org/git/wine.git/?a=commitdiff;h=6517f6c239e9f6b7909d…
1
0
0
0
Alexandre Julliard : kernelbase: Fix IsValidLocale() and GetLocaleInfo() with special LOCALE_* identifiers.
by Alexandre Julliard
07 Apr '22
07 Apr '22
Module: wine Branch: master Commit: 812ebc67a4bf2830ee96eeb5c40e26eefb457500 URL:
https://source.winehq.org/git/wine.git/?a=commit;h=812ebc67a4bf2830ee96eeb5…
Author: Alexandre Julliard <julliard(a)winehq.org> Date: Thu Apr 7 11:13:06 2022 +0200 kernelbase: Fix IsValidLocale() and GetLocaleInfo() with special LOCALE_* identifiers. Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/kernel32/lcformat.c | 2 ++ dlls/kernel32/tests/locale.c | 45 ++++++++++++++++++++++++++++++++++++++++++++ dlls/kernelbase/locale.c | 16 ++++++++++++---- dlls/msvcrt/locale.c | 2 ++ 4 files changed, 61 insertions(+), 4 deletions(-) diff --git a/dlls/kernel32/lcformat.c b/dlls/kernel32/lcformat.c index e029f328544..7f112767880 100644 --- a/dlls/kernel32/lcformat.c +++ b/dlls/kernel32/lcformat.c @@ -1108,6 +1108,7 @@ INT WINAPI GetNumberFormatW(LCID lcid, DWORD dwFlags, TRACE("(0x%04lx,0x%08lx,%s,%p,%p,%d)\n", lcid, dwFlags, debugstr_w(lpszValue), lpFormat, lpNumberStr, cchOut); + lcid = ConvertDefaultLocale(lcid); if (!lpszValue || cchOut < 0 || (cchOut > 0 && !lpNumberStr) || !IsValidLocale(lcid, 0) || (lpFormat && (dwFlags || !lpFormat->lpDecimalSep || !lpFormat->lpThousandSep))) @@ -1498,6 +1499,7 @@ INT WINAPI GetCurrencyFormatW(LCID lcid, DWORD dwFlags, TRACE("(0x%04lx,0x%08lx,%s,%p,%p,%d)\n", lcid, dwFlags, debugstr_w(lpszValue), lpFormat, lpCurrencyStr, cchOut); + lcid = ConvertDefaultLocale(lcid); if (!lpszValue || cchOut < 0 || (cchOut > 0 && !lpCurrencyStr) || !IsValidLocale(lcid, 0) || (lpFormat && (dwFlags || !lpFormat->lpDecimalSep || !lpFormat->lpThousandSep || diff --git a/dlls/kernel32/tests/locale.c b/dlls/kernel32/tests/locale.c index 3b43dea2a2b..31cfb465798 100644 --- a/dlls/kernel32/tests/locale.c +++ b/dlls/kernel32/tests/locale.c @@ -266,6 +266,20 @@ static void test_GetLocaleInfoA(void) "got %d with '%s' (expected %d with '%s')\n", ret, buffer, len, expected); + len = GetLocaleInfoA(GetUserDefaultLCID(), LOCALE_SLANGUAGE, expected, ARRAY_SIZE(expected)); + ret = GetLocaleInfoA(LOCALE_NEUTRAL, LOCALE_SLANGUAGE, buffer, ARRAY_SIZE(buffer)); + ok( (ret == len) && !lstrcmpA(buffer, expected), "got %d with '%s' (expected %d with '%s')\n", + ret, buffer, len, expected); + ret = GetLocaleInfoA(LOCALE_CUSTOM_DEFAULT, LOCALE_SLANGUAGE, buffer, ARRAY_SIZE(buffer)); + ok( (ret == len) && !lstrcmpA(buffer, expected), "got %d with '%s' (expected %d with '%s')\n", + ret, buffer, len, expected); + ret = GetLocaleInfoA(LOCALE_CUSTOM_UNSPECIFIED, LOCALE_SLANGUAGE, buffer, ARRAY_SIZE(buffer)); + ok( (ret == len && !lstrcmpA(buffer, expected)) || broken(!ret), /* <= win8 */ + "got %d with '%s' (expected %d with '%s')\n", ret, buffer, len, expected); + len = GetLocaleInfoA(GetUserDefaultUILanguage(), LOCALE_SLANGUAGE, expected, ARRAY_SIZE(expected)); + ret = GetLocaleInfoA(LOCALE_CUSTOM_UI_DEFAULT, LOCALE_SLANGUAGE, buffer, ARRAY_SIZE(buffer)); + if (ret) ok( (ret == len && !lstrcmpA(buffer, expected)), + "got %d with '%s' (expected %d with '%s')\n", ret, buffer, len, expected); /* HTMLKit and "Font xplorer lite" expect GetLocaleInfoA to * partially fill the buffer even if it is too short. See bug 637. @@ -2675,6 +2689,7 @@ static void test_LocaleNameToLCID(void) NTSTATUS status; INT ret; WCHAR buffer[LOCALE_NAME_MAX_LENGTH]; + WCHAR expbuff[LOCALE_NAME_MAX_LENGTH]; const struct neutralsublang_name_t *ptr; if (!pLocaleNameToLCID) @@ -2710,6 +2725,25 @@ static void test_LocaleNameToLCID(void) ok(ret > 0, "Expected ret > 0, got %d, error %ld\n", ret, GetLastError()); trace("%08lx, %s\n", lcid, wine_dbgstr_w(buffer)); + pLCIDToLocaleName(GetUserDefaultLCID(), expbuff, LOCALE_NAME_MAX_LENGTH, 0); + ret = pLCIDToLocaleName(LOCALE_NEUTRAL, buffer, LOCALE_NAME_MAX_LENGTH, 0); + ok(ret > 0, "Expected ret > 0, got %d, error %ld\n", ret, GetLastError()); + ok( !wcscmp( buffer, expbuff ), "got %s / %s\n", debugstr_w(buffer), debugstr_w(expbuff)); + + ret = pLCIDToLocaleName(LOCALE_CUSTOM_DEFAULT, buffer, LOCALE_NAME_MAX_LENGTH, 0); + ok(ret > 0, "Expected ret > 0, got %d, error %ld\n", ret, GetLastError()); + ok( !wcscmp( buffer, expbuff ), "got %s / %s\n", debugstr_w(buffer), debugstr_w(expbuff)); + + SetLastError( 0xdeadbeef ); + ret = pLCIDToLocaleName(LOCALE_CUSTOM_UNSPECIFIED, buffer, LOCALE_NAME_MAX_LENGTH, 0); + ok(ret > 0 || broken(!ret), /* <= win8 */ "Expected ret > 0, got %d, error %ld\n", ret, GetLastError()); + if (ret) ok( !wcscmp( buffer, expbuff ), "got %s / %s\n", debugstr_w(buffer), debugstr_w(expbuff)); + + SetLastError( 0xdeadbeef ); + ret = pLCIDToLocaleName(LOCALE_CUSTOM_UI_DEFAULT, buffer, LOCALE_NAME_MAX_LENGTH, 0); + if (ret) trace("%08x, %s\n", GetUserDefaultUILanguage(), wine_dbgstr_w(buffer)); + else ok( GetLastError() == ERROR_INVALID_PARAMETER, "wrong error %lu\n", GetLastError()); + /* bad name */ SetLastError(0xdeadbeef); lcid = pLocaleNameToLCID(invalidW, 0); @@ -2886,6 +2920,7 @@ static void test_LocaleNameToLCID(void) str.MaximumLength = sizeof( buffer ); memset( buffer, 0xcc, sizeof(buffer) ); + ok( !IsValidLocale( LOCALE_NEUTRAL, 0 ), "expected invalid\n" ); status = pRtlLcidToLocaleName( LOCALE_NEUTRAL, &str, 0, 0 ); ok( status == STATUS_INVALID_PARAMETER_1, "wrong error %lx\n", status ); status = pRtlLcidToLocaleName( LOCALE_NEUTRAL, &str, 2, 0 ); @@ -2909,12 +2944,14 @@ static void test_LocaleNameToLCID(void) ok( str.Length == wcslen(buffer) * sizeof(WCHAR), "wrong len %u\n", str.Length ); ok( !wcscmp( buffer, L"en" ), "wrong name %s\n", debugstr_w(buffer) ); + ok( IsValidLocale( 0x00010407, 0 ), "expected valid\n" ); memset( buffer, 0xcc, sizeof(buffer) ); status = pRtlLcidToLocaleName( 0x00010407, &str, 0, 0 ); ok( status == STATUS_SUCCESS, "wrong error %lx\n", status ); ok( str.Length == wcslen(buffer) * sizeof(WCHAR), "wrong len %u\n", str.Length ); ok( !wcscmp( buffer, L"de-DE_phoneb" ), "wrong name %s\n", debugstr_w(buffer) ); + ok( !IsValidLocale( LOCALE_SYSTEM_DEFAULT, 0 ), "expected invalid\n" ); memset( buffer, 0xcc, sizeof(buffer) ); status = pRtlLcidToLocaleName( LOCALE_SYSTEM_DEFAULT, &str, 0, 0 ); ok( status == STATUS_SUCCESS, "wrong error %lx\n", status ); @@ -2922,6 +2959,7 @@ static void test_LocaleNameToLCID(void) LCIDToLocaleName( GetSystemDefaultLCID(), expect, ARRAY_SIZE(expect), 0 ); ok( !wcscmp( buffer, expect ), "wrong name %s / %s\n", debugstr_w(buffer), debugstr_w(expect) ); + ok( !IsValidLocale( LOCALE_USER_DEFAULT, 0 ), "expected invalid\n" ); memset( buffer, 0xcc, sizeof(buffer) ); status = pRtlLcidToLocaleName( LOCALE_USER_DEFAULT, &str, 0, 0 ); ok( status == STATUS_SUCCESS, "wrong error %lx\n", status ); @@ -2929,6 +2967,7 @@ static void test_LocaleNameToLCID(void) LCIDToLocaleName( GetUserDefaultLCID(), expect, ARRAY_SIZE(expect), 0 ); ok( !wcscmp( buffer, expect ), "wrong name %s / %s\n", debugstr_w(buffer), debugstr_w(expect) ); + ok( IsValidLocale( LOCALE_INVARIANT, 0 ), "expected valid\n" ); memset( buffer, 0xcc, sizeof(buffer) ); status = pRtlLcidToLocaleName( LOCALE_INVARIANT, &str, 0, 0 ); ok( status == STATUS_SUCCESS, "wrong error %lx\n", status ); @@ -3655,6 +3694,12 @@ static void test_ConvertDefaultLocale(void) LCID_RES(LOCALE_SYSTEM_DEFAULT, GetSystemDefaultLCID()); LCID_RES(LOCALE_USER_DEFAULT, GetUserDefaultLCID()); LCID_RES(LOCALE_NEUTRAL, GetUserDefaultLCID()); + LCID_RES(LOCALE_CUSTOM_DEFAULT, GetUserDefaultLCID()); + lcid = ConvertDefaultLocale( LOCALE_CUSTOM_UNSPECIFIED ); + ok( lcid == GetUserDefaultLCID() || broken(lcid == LOCALE_CUSTOM_UNSPECIFIED), /* <= win8 */ + "wrong lcid %04lx\n", lcid ); + lcid = ConvertDefaultLocale( LOCALE_CUSTOM_UI_DEFAULT ); + ok( lcid == GetUserDefaultUILanguage() || lcid == LOCALE_CUSTOM_UI_DEFAULT, "wrong lcid %04lx\n", lcid ); lcid = ConvertDefaultLocale(LOCALE_INVARIANT); ok(lcid == LOCALE_INVARIANT || broken(lcid == 0x47f) /* win2k[3]/winxp */, "Expected lcid = %08lx, got %08lx\n", LOCALE_INVARIANT, lcid); diff --git a/dlls/kernelbase/locale.c b/dlls/kernelbase/locale.c index 66c9a67cf28..8121efb8651 100644 --- a/dlls/kernelbase/locale.c +++ b/dlls/kernelbase/locale.c @@ -574,6 +574,8 @@ static const NLS_LOCALE_DATA *get_locale_by_id( LCID *lcid, DWORD flags ) case LOCALE_NEUTRAL: case LOCALE_USER_DEFAULT: case LOCALE_CUSTOM_DEFAULT: + case LOCALE_CUSTOM_UNSPECIFIED: + case LOCALE_CUSTOM_UI_DEFAULT: *lcid = user_lcid; return user_locale; default: @@ -5406,9 +5408,7 @@ INT WINAPI DECLSPEC_HOTPATCH GetUserDefaultLocaleName( LPWSTR name, INT len ) */ LANGID WINAPI DECLSPEC_HOTPATCH GetUserDefaultUILanguage(void) { - LANGID lang; - NtQueryDefaultUILanguage( &lang ); - return lang; + return LANGIDFROMLCID( GetUserDefaultLCID() ); } @@ -5708,7 +5708,15 @@ BOOL WINAPI DECLSPEC_HOTPATCH IsValidLanguageGroup( LGRPID id, DWORD flags ) */ BOOL WINAPI DECLSPEC_HOTPATCH IsValidLocale( LCID lcid, DWORD flags ) { - return !!get_locale_by_id( &lcid, LOCALE_ALLOW_NEUTRAL_NAMES ); + switch (lcid) + { + case LOCALE_NEUTRAL: + case LOCALE_USER_DEFAULT: + case LOCALE_SYSTEM_DEFAULT: + return FALSE; + default: + return !!get_locale_by_id( &lcid, LOCALE_ALLOW_NEUTRAL_NAMES ); + } } diff --git a/dlls/msvcrt/locale.c b/dlls/msvcrt/locale.c index 2421830e7b5..0fd99a40c86 100644 --- a/dlls/msvcrt/locale.c +++ b/dlls/msvcrt/locale.c @@ -262,6 +262,8 @@ find_best_locale_proc( WCHAR *name, DWORD locale_flags, LPARAM lParam ) char buff[MAX_ELEM_LEN]; unsigned int flags = 0; + if (lcid == LOCALE_CUSTOM_UNSPECIFIED) return CONTINUE_LOOKING; + #if _MSVCR_VER >= 110 if (res->allow_sname && compare_info(lcid,LOCALE_SNAME,buff,res->search_language, TRUE)) {
1
0
0
0
Mohamad Al-Jaf : ncrypt/tests: Add NCryptIsAlgSupported tests.
by Alexandre Julliard
07 Apr '22
07 Apr '22
Module: wine Branch: master Commit: ff99c11b3b074ea64d874829a9d1d10a05f31b90 URL:
https://source.winehq.org/git/wine.git/?a=commit;h=ff99c11b3b074ea64d874829…
Author: Mohamad Al-Jaf <mohamadaljaf(a)gmail.com> Date: Thu Apr 7 11:46:28 2022 +0200 ncrypt/tests: Add NCryptIsAlgSupported tests. Signed-off-by: Mohamad Al-Jaf <mohamadaljaf(a)gmail.com> Signed-off-by: Hans Leidekker <hans(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/ncrypt/tests/ncrypt.c | 75 ++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 75 insertions(+) diff --git a/dlls/ncrypt/tests/ncrypt.c b/dlls/ncrypt/tests/ncrypt.c index 7fb8b2cb4c5..5808a3bb30a 100644 --- a/dlls/ncrypt/tests/ncrypt.c +++ b/dlls/ncrypt/tests/ncrypt.c @@ -465,6 +465,80 @@ static void test_verify_signature(void) NCryptFreeObject(prov); } +static void test_NCryptIsAlgSupported(void) +{ + NCRYPT_PROV_HANDLE prov; + SECURITY_STATUS ret; + + NCryptOpenStorageProvider(&prov, NULL, 0); + ret = NCryptIsAlgSupported(0, BCRYPT_RSA_ALGORITHM, 0); + ok(ret == NTE_INVALID_HANDLE, "expected NTE_INVALID_HANDLE, got %#lx\n", ret); + + ret = NCryptIsAlgSupported(prov, NULL, 0); + ok(ret == HRESULT_FROM_WIN32(RPC_X_NULL_REF_POINTER) || broken(ret == NTE_FAIL) /* win7 */, "got %#lx\n", ret); + + ret = NCryptIsAlgSupported(prov, BCRYPT_RSA_ALGORITHM, 20); + ok(ret == NTE_BAD_FLAGS, "expected NTE_BAD_FLAGS, got %#lx\n", ret); + + ret = NCryptIsAlgSupported(prov, BCRYPT_RSA_ALGORITHM, 0); + ok(ret == ERROR_SUCCESS, "expected BCRYPT_RSA_ALGORITHM to be supported, got %#lx\n", ret); + + ret = NCryptIsAlgSupported(prov, BCRYPT_RSA_ALGORITHM, NCRYPT_SILENT_FLAG); + ok(ret == ERROR_SUCCESS, "expected BCRYPT_RSA_ALGORITHM to be supported, got %#lx\n", ret); + + ret = NCryptIsAlgSupported(prov, BCRYPT_3DES_ALGORITHM, 0); + ok(ret == ERROR_SUCCESS || broken(ret == NTE_NOT_SUPPORTED) /* win7 */, + "expected BCRYPT_3DES_ALGORITHM to be supported, got %#lx\n", ret); + + ret = NCryptIsAlgSupported(prov, BCRYPT_AES_ALGORITHM, 0); + ok(ret == ERROR_SUCCESS || broken(ret == NTE_NOT_SUPPORTED) /* win7 */, + "expected BCRYPT_AES_ALGORITHM to be supported, got %#lx\n", ret); + + ret = NCryptIsAlgSupported(prov, BCRYPT_ECDH_P256_ALGORITHM, 0); + ok(ret == ERROR_SUCCESS, "expected BCRYPT_ECDH_P256_ALGORITHM to be supported, got %#lx\n", ret); + + ret = NCryptIsAlgSupported(prov, BCRYPT_ECDSA_P256_ALGORITHM, 0); + ok(ret == ERROR_SUCCESS, "expected BCRYPT_ECDSA_P256_ALGORITHM to be supported, got %#lx\n", ret); + + ret = NCryptIsAlgSupported(prov, BCRYPT_ECDSA_P384_ALGORITHM, 0); + ok(ret == ERROR_SUCCESS, "expected BCRYPT_ECDSA_P384_ALGORITHM to be supported, got %#lx\n", ret); + + ret = NCryptIsAlgSupported(prov, BCRYPT_DSA_ALGORITHM, 0); + ok(ret == ERROR_SUCCESS, "expected BCRYPT_DSA_ALGORITHM to be supported, got %#lx\n", ret); + + /* Not supported */ + ret = NCryptIsAlgSupported(prov, BCRYPT_SHA256_ALGORITHM, 0); + ok(ret == NTE_NOT_SUPPORTED, "expected BCRYPT_SHA256_ALGORITHM to not be supported, got %#lx\n", ret); + + ret = NCryptIsAlgSupported(prov, BCRYPT_SHA384_ALGORITHM, 0); + ok(ret == NTE_NOT_SUPPORTED, "expected BCRYPT_SHA384_ALGORITHM to not be supported, got %#lx\n", ret); + + ret = NCryptIsAlgSupported(prov, BCRYPT_SHA512_ALGORITHM, 0); + ok(ret == NTE_NOT_SUPPORTED, "expected BCRYPT_SHA512_ALGORITHM to not be supported, got %#lx\n", ret); + + ret = NCryptIsAlgSupported(prov, BCRYPT_SHA1_ALGORITHM, 0); + ok(ret == NTE_NOT_SUPPORTED, "expected BCRYPT_SHA1_ALGORITHM to not be supported, got %#lx\n", ret); + + ret = NCryptIsAlgSupported(prov, BCRYPT_MD5_ALGORITHM, 0); + ok(ret == NTE_NOT_SUPPORTED, "expected BCRYPT_MD5_ALGORITHM to not be supported, got %#lx\n", ret); + + ret = NCryptIsAlgSupported(prov, BCRYPT_MD4_ALGORITHM, 0); + ok(ret == NTE_NOT_SUPPORTED, "expected BCRYPT_MD4_ALGORITHM to not be supported, got %#lx\n", ret); + + ret = NCryptIsAlgSupported(prov, BCRYPT_MD2_ALGORITHM, 0); + ok(ret == NTE_NOT_SUPPORTED, "expected BCRYPT_MD2_ALGORITHM to not be supported, got %#lx\n", ret); + + ret = NCryptIsAlgSupported(prov, BCRYPT_RSA_SIGN_ALGORITHM, 0); + ok(ret == NTE_NOT_SUPPORTED, "expected BCRYPT_RSA_SIGN_ALGORITHM to not be supported, got %#lx\n", ret); + + ret = NCryptIsAlgSupported(prov, BCRYPT_RSA_SIGN_ALGORITHM, 20); + ok(ret == NTE_BAD_FLAGS, "expected NTE_BAD_FLAGS, got %#lx\n", ret); + + ret = NCryptIsAlgSupported(prov, BCRYPT_RNG_ALGORITHM, 0); + ok(ret == NTE_NOT_SUPPORTED, "expected BCRYPT_RNG_ALGORITHM to not be supported, got %#lx\n", ret); + NCryptFreeObject(prov); +} + START_TEST(ncrypt) { test_key_import_rsa(); @@ -474,4 +548,5 @@ START_TEST(ncrypt) test_create_persisted_key(); test_finalize_key(); test_verify_signature(); + test_NCryptIsAlgSupported(); }
1
0
0
0
Mohamad Al-Jaf : ncrypt: Implement NCryptIsAlgSupported.
by Alexandre Julliard
07 Apr '22
07 Apr '22
Module: wine Branch: master Commit: db10be73182a1c130b8fa37004894c2a30c2f732 URL:
https://source.winehq.org/git/wine.git/?a=commit;h=db10be73182a1c130b8fa370…
Author: Mohamad Al-Jaf <mohamadaljaf(a)gmail.com> Date: Thu Apr 7 11:46:27 2022 +0200 ncrypt: Implement NCryptIsAlgSupported. Microsoft Edge calls this function. Signed-off-by: Mohamad Al-Jaf <mohamadaljaf(a)gmail.com> Signed-off-by: Hans Leidekker <hans(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/ncrypt/main.c | 44 ++++++++++++++++++++++++++++++++++++++++++-- dlls/ncrypt/ncrypt.spec | 2 +- include/ncrypt.h | 1 + 3 files changed, 44 insertions(+), 3 deletions(-) diff --git a/dlls/ncrypt/main.c b/dlls/ncrypt/main.c index e12284e0867..10cec633269 100644 --- a/dlls/ncrypt/main.c +++ b/dlls/ncrypt/main.c @@ -416,8 +416,48 @@ SECURITY_STATUS WINAPI NCryptImportKey(NCRYPT_PROV_HANDLE provider, NCRYPT_KEY_H SECURITY_STATUS WINAPI NCryptIsAlgSupported(NCRYPT_PROV_HANDLE provider, const WCHAR *algid, DWORD flags) { - FIXME("(%#Ix, %s, %#lx): stub\n", provider, wine_dbgstr_w(algid), flags); - return NTE_NOT_SUPPORTED; + static const ULONG supported = BCRYPT_CIPHER_OPERATION |\ + BCRYPT_ASYMMETRIC_ENCRYPTION_OPERATION |\ + BCRYPT_SIGNATURE_OPERATION |\ + BCRYPT_SECRET_AGREEMENT_OPERATION; + BCRYPT_ALGORITHM_IDENTIFIER *list; + ULONG i, count; + NTSTATUS status; + + TRACE("(%#Ix, %s, %#lx)\n", provider, wine_dbgstr_w(algid), flags); + + if (!provider) return NTE_INVALID_HANDLE; + if (!algid) return HRESULT_FROM_WIN32(RPC_X_NULL_REF_POINTER); + if (flags == NCRYPT_SILENT_FLAG) + { + FIXME("Silent flag not implemented\n"); + } + else if (flags) + { + WARN("Invalid flags %#lx\n", flags); + return NTE_BAD_FLAGS; + } + if (!lstrcmpiW(BCRYPT_RSA_SIGN_ALGORITHM, algid)) return NTE_NOT_SUPPORTED; + + status = BCryptEnumAlgorithms(supported, &count, &list, 0); + if (status != STATUS_SUCCESS) + { + ERR("Error retrieving algorithm list %#lx\n", status); + return map_ntstatus(status); + } + + status = STATUS_NOT_SUPPORTED; + for (i = 0; i < count; i++) + { + if (!lstrcmpiW(list[i].pszName, algid)) + { + status = STATUS_SUCCESS; + break; + } + } + + BCryptFreeBuffer(list); + return map_ntstatus(status); } BOOL WINAPI NCryptIsKeyHandle(NCRYPT_KEY_HANDLE hKey) diff --git a/dlls/ncrypt/ncrypt.spec b/dlls/ncrypt/ncrypt.spec index bb914616373..60b367260d5 100644 --- a/dlls/ncrypt/ncrypt.spec +++ b/dlls/ncrypt/ncrypt.spec @@ -77,7 +77,7 @@ @ stdcall NCryptGetProperty(ptr wstr ptr long ptr long) @ stub NCryptGetProtectionDescriptorInfo @ stdcall NCryptImportKey(long long wstr ptr ptr ptr long long) -@ stub NCryptIsAlgSupported(long wstr long) +@ stdcall NCryptIsAlgSupported(long wstr long) @ stdcall NCryptIsKeyHandle(long) @ stub NCryptKeyDerivation @ stub NCryptNotifyChangeKey diff --git a/include/ncrypt.h b/include/ncrypt.h index c09a1ec8676..18198fdc5bb 100644 --- a/include/ncrypt.h +++ b/include/ncrypt.h @@ -118,6 +118,7 @@ SECURITY_STATUS WINAPI NCryptFreeObject(NCRYPT_HANDLE); SECURITY_STATUS WINAPI NCryptGetProperty(NCRYPT_HANDLE, const WCHAR *, BYTE *, DWORD, DWORD *, DWORD); SECURITY_STATUS WINAPI NCryptImportKey(NCRYPT_PROV_HANDLE, NCRYPT_KEY_HANDLE, const WCHAR *, NCryptBufferDesc *, NCRYPT_KEY_HANDLE *, BYTE *, DWORD, DWORD); +SECURITY_STATUS WINAPI NCryptIsAlgSupported(NCRYPT_PROV_HANDLE, const WCHAR *, DWORD); SECURITY_STATUS WINAPI NCryptOpenKey(NCRYPT_PROV_HANDLE, NCRYPT_KEY_HANDLE *, const WCHAR *, DWORD, DWORD); SECURITY_STATUS WINAPI NCryptOpenStorageProvider(NCRYPT_PROV_HANDLE *, const WCHAR *, DWORD); SECURITY_STATUS WINAPI NCryptSetProperty(NCRYPT_HANDLE, const WCHAR *, BYTE *, DWORD, DWORD);
1
0
0
0
Rémi Bernon : combase/tests: Add some RoGetActivationFactory tests with manifest.
by Alexandre Julliard
07 Apr '22
07 Apr '22
Module: wine Branch: master Commit: ee7eaca87790d7ed2f72c5a6bddaed8e39ee6680 URL:
https://source.winehq.org/git/wine.git/?a=commit;h=ee7eaca87790d7ed2f72c5a6…
Author: Rémi Bernon <rbernon(a)codeweavers.com> Date: Tue Apr 5 20:25:08 2022 +0200 combase/tests: Add some RoGetActivationFactory tests with manifest. Signed-off-by: Rémi Bernon <rbernon(a)codeweavers.com> Signed-off-by: Huw Davies <huw(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/combase/tests/Makefile.in | 7 +- dlls/combase/tests/combase.manifest | 15 +++ dlls/combase/tests/combase.rc | 22 +++++ dlls/combase/tests/roapi.c | 59 +++++++++++ dlls/combase/tests/wine.combase.test.c | 159 ++++++++++++++++++++++++++++++ dlls/combase/tests/wine.combase.test.spec | 3 + 6 files changed, 263 insertions(+), 2 deletions(-) Diff:
https://source.winehq.org/git/wine.git/?a=commitdiff;h=ee7eaca87790d7ed2f72…
1
0
0
0
Nikolay Sivov : wmp/tests: Remove unused include.
by Alexandre Julliard
07 Apr '22
07 Apr '22
Module: wine Branch: master Commit: 6556c8d2eef6dda3fce917f756f0e33e54b2084b URL:
https://source.winehq.org/git/wine.git/?a=commit;h=6556c8d2eef6dda3fce917f7…
Author: Nikolay Sivov <nsivov(a)codeweavers.com> Date: Thu Apr 7 10:53:07 2022 +0300 wmp/tests: Remove unused include. Signed-off-by: Nikolay Sivov <nsivov(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/wmp/tests/oleobj.c | 1 - 1 file changed, 1 deletion(-) diff --git a/dlls/wmp/tests/oleobj.c b/dlls/wmp/tests/oleobj.c index f36e07dabfc..fa593eb3c3f 100644 --- a/dlls/wmp/tests/oleobj.c +++ b/dlls/wmp/tests/oleobj.c @@ -27,7 +27,6 @@ #include <olectl.h> #include "wine/test.h" -#include "wine/heap.h" #define DEFINE_EXPECT(func) \ static BOOL expect_ ## func = FALSE, called_ ## func = FALSE
1
0
0
0
Nikolay Sivov : wmic: Use CRT allocation functions.
by Alexandre Julliard
07 Apr '22
07 Apr '22
Module: wine Branch: master Commit: 89f10a0f4bc2de6235cc1f9058d87a7a6d429d6a URL:
https://source.winehq.org/git/wine.git/?a=commit;h=89f10a0f4bc2de6235cc1f90…
Author: Nikolay Sivov <nsivov(a)codeweavers.com> Date: Thu Apr 7 12:27:53 2022 +0300 wmic: Use CRT allocation functions. Signed-off-by: Nikolay Sivov <nsivov(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- programs/wmic/main.c | 13 ++----------- 1 file changed, 2 insertions(+), 11 deletions(-) diff --git a/programs/wmic/main.c b/programs/wmic/main.c index 50c28ebec5d..15b590098e7 100644 --- a/programs/wmic/main.c +++ b/programs/wmic/main.c @@ -61,15 +61,6 @@ static const WCHAR *find_class( const WCHAR *alias ) return NULL; } -static inline WCHAR *strdupW( const WCHAR *src ) -{ - WCHAR *dst; - if (!src) return NULL; - if (!(dst = HeapAlloc( GetProcessHeap(), 0, (lstrlenW( src ) + 1) * sizeof(WCHAR) ))) return NULL; - lstrcpyW( dst, src ); - return dst; -} - static WCHAR *find_prop( IWbemClassObject *class, const WCHAR *prop ) { SAFEARRAY *sa; @@ -85,7 +76,7 @@ static WCHAR *find_prop( IWbemClassObject *class, const WCHAR *prop ) SafeArrayGetElement( sa, &i, &str ); if (!wcsicmp( str, prop )) { - ret = strdupW( str ); + ret = wcsdup( str ); break; } } @@ -228,7 +219,7 @@ done: SysFreeString( path ); SysFreeString( query ); SysFreeString( wql ); - HeapFree( GetProcessHeap(), 0, prop ); + free( prop ); CoUninitialize(); return ret; }
1
0
0
0
← Newer
1
...
80
81
82
83
84
85
86
...
103
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
Results per page:
10
25
50
100
200