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
June 2021
----- 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
811 discussions
Start a n
N
ew thread
Kalen Alwardt : ntdll: Export ZwFilterToken().
by Alexandre Julliard
14 Jun '21
14 Jun '21
Module: wine Branch: master Commit: 29e1494c72041f3d2ee89e89eff17877df7cabd2 URL:
https://source.winehq.org/git/wine.git/?a=commit;h=29e1494c72041f3d2ee89e89…
Author: Kalen Alwardt <kalenalwardt(a)gmail.com> Date: Fri Jun 11 15:56:02 2021 -0500 ntdll: Export ZwFilterToken(). Wine-Bug:
https://bugs.winehq.org/show_bug.cgi?id=39142
Signed-off-by: Kalen Alwardt <kalenalwardt(a)gmail.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/ntdll/ntdll.spec | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dlls/ntdll/ntdll.spec b/dlls/ntdll/ntdll.spec index 6bd6579d432..8cba4fa164a 100644 --- a/dlls/ntdll/ntdll.spec +++ b/dlls/ntdll/ntdll.spec @@ -1224,7 +1224,7 @@ # @ stub ZwEnumerateSystemEnvironmentValuesEx @ stdcall -private -syscall ZwEnumerateValueKey(long long long ptr long ptr) NtEnumerateValueKey @ stub ZwExtendSection -# @ stub ZwFilterToken +@ stdcall -private -syscall ZwFilterToken(long long ptr ptr ptr ptr) NtFilterToken @ stdcall -private -syscall ZwFindAtom(ptr long ptr) NtFindAtom @ stdcall -private -syscall ZwFlushBuffersFile(long ptr) NtFlushBuffersFile @ stdcall -private -syscall ZwFlushInstructionCache(long ptr long) NtFlushInstructionCache
1
0
0
0
Esme Povirk : sechost: SID strings are case-insensitive.
by Alexandre Julliard
14 Jun '21
14 Jun '21
Module: wine Branch: master Commit: f3b4e1695ffc1f3d05cee434ff045ee49efffebd URL:
https://source.winehq.org/git/wine.git/?a=commit;h=f3b4e1695ffc1f3d05cee434…
Author: Esme Povirk <esme(a)codeweavers.com> Date: Fri Jun 11 15:10:49 2021 -0500 sechost: SID strings are case-insensitive. Signed-off-by: Esme Povirk <esme(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/advapi32/tests/security.c | 2 ++ dlls/sechost/security.c | 12 ++++++------ 2 files changed, 8 insertions(+), 6 deletions(-) diff --git a/dlls/advapi32/tests/security.c b/dlls/advapi32/tests/security.c index 9231c0243bf..6037ddb2165 100644 --- a/dlls/advapi32/tests/security.c +++ b/dlls/advapi32/tests/security.c @@ -265,6 +265,7 @@ static void test_ConvertStringSidToSid(void) str_to_sid_tests[] = { { "WD", "S-1-1-0" }, + { "wD", "S-1-1-0" }, { "CO", "S-1-3-0" }, { "CG", "S-1-3-1" }, { "OW", "S-1-3-4", 1 }, /* Vista+ */ @@ -304,6 +305,7 @@ static void test_ConvertStringSidToSid(void) { "PA", "", 1 }, { "RS", "", 1 }, { "SA", "", 1 }, + { "s-1-12-1", "S-1-12-1" }, }; const char noSubAuthStr[] = "S-1-5"; diff --git a/dlls/sechost/security.c b/dlls/sechost/security.c index 940561cce79..b4f00f5bdf5 100644 --- a/dlls/sechost/security.c +++ b/dlls/sechost/security.c @@ -596,7 +596,7 @@ static BOOL get_computer_sid( PSID sid ) static DWORD get_sid_size( const WCHAR *string, const WCHAR **end ) { - if (string[0] == 'S' && string[1] == '-') /* S-R-I(-S)+ */ + if ((string[0] == 'S' || string[0] == 's') && string[1] == '-') /* S-R-I(-S)+ */ { int token_count = 0; string++; @@ -622,13 +622,13 @@ static DWORD get_sid_size( const WCHAR *string, const WCHAR **end ) for (i = 0; i < ARRAY_SIZE(well_known_sids); i++) { - if (!wcsncmp( well_known_sids[i].str, string, 2 )) + if (!wcsnicmp( well_known_sids[i].str, string, 2 )) return GetSidLengthRequired( well_known_sids[i].sid.SubAuthorityCount ); } for (i = 0; i < ARRAY_SIZE(well_known_rids); i++) { - if (!wcsncmp( well_known_rids[i].str, string, 2 )) + if (!wcsnicmp( well_known_rids[i].str, string, 2 )) { struct max_sid local; get_computer_sid(&local); @@ -649,7 +649,7 @@ static BOOL parse_sid( const WCHAR *string, const WCHAR **end, SID *pisid, DWORD if (!pisid) /* Simply compute the size */ return TRUE; - if (string[0] == 'S' && string[1] == '-') /* S-R-I-S-S */ + if ((string[0] == 'S' || string[0] == 's') && string[1] == '-') /* S-R-I-S-S */ { DWORD i = 0, identAuth; DWORD csubauth = ((*size - GetSidLengthRequired(0)) / sizeof(DWORD)); @@ -717,7 +717,7 @@ static BOOL parse_sid( const WCHAR *string, const WCHAR **end, SID *pisid, DWORD for (i = 0; i < ARRAY_SIZE(well_known_sids); i++) { - if (!wcsncmp(well_known_sids[i].str, string, 2)) + if (!wcsnicmp(well_known_sids[i].str, string, 2)) { DWORD j; pisid->SubAuthorityCount = well_known_sids[i].sid.SubAuthorityCount; @@ -730,7 +730,7 @@ static BOOL parse_sid( const WCHAR *string, const WCHAR **end, SID *pisid, DWORD for (i = 0; i < ARRAY_SIZE(well_known_rids); i++) { - if (!wcsncmp(well_known_rids[i].str, string, 2)) + if (!wcsnicmp(well_known_rids[i].str, string, 2)) { get_computer_sid(pisid); pisid->SubAuthority[pisid->SubAuthorityCount] = well_known_rids[i].rid;
1
0
0
0
Esme Povirk : sechost: Reject string SIDs with too many characters.
by Alexandre Julliard
14 Jun '21
14 Jun '21
Module: wine Branch: master Commit: 9032eeecbeb48550bc4c3693c9db0f5359b569a9 URL:
https://source.winehq.org/git/wine.git/?a=commit;h=9032eeecbeb48550bc4c3693…
Author: Esme Povirk <esme(a)codeweavers.com> Date: Fri Jun 11 15:10:48 2021 -0500 sechost: Reject string SIDs with too many characters. Signed-off-by: Esme Povirk <esme(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/advapi32/tests/security.c | 17 ++++++++++++- dlls/sechost/security.c | 58 +++++++++++++++++++++++++----------------- 2 files changed, 51 insertions(+), 24 deletions(-) diff --git a/dlls/advapi32/tests/security.c b/dlls/advapi32/tests/security.c index 3f1fffda273..9231c0243bf 100644 --- a/dlls/advapi32/tests/security.c +++ b/dlls/advapi32/tests/security.c @@ -338,6 +338,20 @@ static void test_ConvertStringSidToSid(void) "expected GetLastError() is ERROR_INVALID_SID, got %d\n", GetLastError() ); + r = ConvertStringSidToSidA( "WDandmorecharacters", &psid ); + ok( !r, + "expected failure with too many characters\n" ); + ok( GetLastError() == ERROR_INVALID_SID, + "expected GetLastError() is ERROR_INVALID_SID, got %d\n", + GetLastError() ); + + r = ConvertStringSidToSidA( "WD)", &psid ); + ok( !r, + "expected failure with too many characters\n" ); + ok( GetLastError() == ERROR_INVALID_SID, + "expected GetLastError() is ERROR_INVALID_SID, got %d\n", + GetLastError() ); + ok(ConvertStringSidToSidA("S-1-5-21-93476-23408-4576", &psid), "ConvertStringSidToSidA failed\n"); pisid = psid; ok(pisid->SubAuthorityCount == 4, "Invalid sub authority count - expected 4, got %d\n", pisid->SubAuthorityCount); @@ -4237,7 +4251,8 @@ static void test_ConvertStringSecurityDescriptor(void) { "", SDDL_REVISION_1, TRUE }, /* test ACE string SID */ { "D:(D;;GA;;;S-1-0-0)", SDDL_REVISION_1, TRUE }, - { "D:(D;;GA;;;Nonexistent account)", SDDL_REVISION_1, FALSE, ERROR_INVALID_ACL, ERROR_INVALID_SID } /* W2K */ + { "D:(D;;GA;;;WDANDSUCH)", SDDL_REVISION_1, FALSE, ERROR_INVALID_ACL }, + { "D:(D;;GA;;;Nonexistent account)", SDDL_REVISION_1, FALSE, ERROR_INVALID_ACL, ERROR_INVALID_SID }, /* W2K */ }; for (i = 0; i < ARRAY_SIZE(cssd); i++) diff --git a/dlls/sechost/security.c b/dlls/sechost/security.c index b6731b1fe1c..940561cce79 100644 --- a/dlls/sechost/security.c +++ b/dlls/sechost/security.c @@ -18,6 +18,7 @@ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA */ +#include <assert.h> #include <stdarg.h> #include "windef.h" #include "winbase.h" @@ -593,18 +594,22 @@ static BOOL get_computer_sid( PSID sid ) return TRUE; } -static DWORD get_sid_size( const WCHAR *string ) +static DWORD get_sid_size( const WCHAR *string, const WCHAR **end ) { if (string[0] == 'S' && string[1] == '-') /* S-R-I(-S)+ */ { int token_count = 0; - while (*string) + string++; + while (*string == '-' || iswdigit(*string)) { if (*string == '-') token_count++; string++; } + if (end) + *end = string; + if (token_count >= 3) return GetSidLengthRequired( token_count - 2 ); } @@ -612,6 +617,9 @@ static DWORD get_sid_size( const WCHAR *string ) { unsigned int i; + if (end) + *end = string + 2; + for (i = 0; i < ARRAY_SIZE(well_known_sids); i++) { if (!wcsncmp( well_known_sids[i].str, string, 2 )) @@ -632,12 +640,12 @@ static DWORD get_sid_size( const WCHAR *string ) return GetSidLengthRequired( 0 ); } -static BOOL parse_sid( const WCHAR *string, SID *pisid, DWORD *size ) +static BOOL parse_sid( const WCHAR *string, const WCHAR **end, SID *pisid, DWORD *size ) { while (*string == ' ') string++; - *size = get_sid_size( string ); + *size = get_sid_size( string, end ); if (!pisid) /* Simply compute the size */ return TRUE; @@ -647,7 +655,7 @@ static BOOL parse_sid( const WCHAR *string, SID *pisid, DWORD *size ) DWORD csubauth = ((*size - GetSidLengthRequired(0)) / sizeof(DWORD)); string += 2; /* Advance to Revision */ - pisid->Revision = wcstoul( string, NULL, 10 ); + pisid->Revision = wcstoul( string, (WCHAR**)&string, 10 ); if (pisid->Revision != SDDL_REVISION) { @@ -665,8 +673,6 @@ static BOOL parse_sid( const WCHAR *string, SID *pisid, DWORD *size ) pisid->SubAuthorityCount = csubauth; /* Advance to identifier authority */ - while (*string && *string != '-') - string++; if (*string == '-') string++; @@ -675,24 +681,20 @@ static BOOL parse_sid( const WCHAR *string, SID *pisid, DWORD *size ) */ pisid->IdentifierAuthority.Value[0] = 0; pisid->IdentifierAuthority.Value[1] = 0; - identAuth = wcstoul( string, NULL, 10 ); + identAuth = wcstoul( string, (WCHAR**)&string, 10 ); pisid->IdentifierAuthority.Value[5] = identAuth & 0xff; pisid->IdentifierAuthority.Value[4] = (identAuth & 0xff00) >> 8; pisid->IdentifierAuthority.Value[3] = (identAuth & 0xff0000) >> 16; pisid->IdentifierAuthority.Value[2] = (identAuth & 0xff000000) >> 24; /* Advance to first sub authority */ - while (*string && *string != '-') - string++; if (*string == '-') string++; - while (*string) + while (iswdigit(*string) || *string == '-') { - pisid->SubAuthority[i++] = wcstoul( string, NULL, 10 ); + pisid->SubAuthority[i++] = wcstoul( string, (WCHAR**)&string, 10 ); - while (*string && *string != '-') - string++; if (*string == '-') string++; } @@ -703,6 +705,9 @@ static BOOL parse_sid( const WCHAR *string, SID *pisid, DWORD *size ) return FALSE; } + if (end) + assert(*end == string); + return TRUE; } else /* String constant format - Only available in winxp and above */ @@ -746,6 +751,7 @@ static BOOL parse_sid( const WCHAR *string, SID *pisid, DWORD *size ) BOOL WINAPI DECLSPEC_HOTPATCH ConvertStringSidToSidW( const WCHAR *string, PSID *sid ) { DWORD size; + const WCHAR *string_end; TRACE("%s, %p\n", debugstr_w(string), sid); @@ -761,12 +767,18 @@ BOOL WINAPI DECLSPEC_HOTPATCH ConvertStringSidToSidW( const WCHAR *string, PSID return FALSE; } - if (!parse_sid( string, NULL, &size )) + if (!parse_sid( string, &string_end, NULL, &size )) return FALSE; + if (*string_end) + { + SetLastError(ERROR_INVALID_SID); + return FALSE; + } + *sid = LocalAlloc( 0, size ); - if (!parse_sid( string, *sid, &size )) + if (!parse_sid( string, NULL, *sid, &size )) { LocalFree( *sid ); return FALSE; @@ -996,11 +1008,11 @@ static BOOL parse_acl( const WCHAR *string, DWORD *flags, ACL *acl, DWORD *ret_s string++; /* Parse ACE account sid */ - if (parse_sid( string, ace ? (SID *)&ace->SidStart : NULL, &sidlen )) - { - while (*string && *string != ')') - string++; - } + if (!parse_sid( string, &string, ace ? (SID *)&ace->SidStart : NULL, &sidlen )) + goto err; + + while (*string == ' ') + string++; if (*string != ')') goto err; @@ -1095,7 +1107,7 @@ static BOOL parse_sd( const WCHAR *string, SECURITY_DESCRIPTOR_RELATIVE *sd, DWO { DWORD bytes; - if (!parse_sid( tok, (SID *)next, &bytes )) + if (!parse_sid( tok, NULL, (SID *)next, &bytes )) goto out; if (sd) @@ -1113,7 +1125,7 @@ static BOOL parse_sd( const WCHAR *string, SECURITY_DESCRIPTOR_RELATIVE *sd, DWO { DWORD bytes; - if (!parse_sid( tok, (SID *)next, &bytes )) + if (!parse_sid( tok, NULL, (SID *)next, &bytes )) goto out; if (sd)
1
0
0
0
Jacek Caban : gdi32: Fix SetPixel error return value.
by Alexandre Julliard
14 Jun '21
14 Jun '21
Module: wine Branch: master Commit: ce94c78b2e42a3335e2ed897628dfabac6be88f8 URL:
https://source.winehq.org/git/wine.git/?a=commit;h=ce94c78b2e42a3335e2ed897…
Author: Jacek Caban <jacek(a)codeweavers.com> Date: Fri Jun 11 19:55:29 2021 +0200 gdi32: Fix SetPixel error return value. Signed-off-by: Jacek Caban <jacek(a)codeweavers.com> Signed-off-by: Huw Davies <huw(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/gdi32/painting.c | 2 +- dlls/gdi32/tests/dc.c | 10 ++++++++++ 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/dlls/gdi32/painting.c b/dlls/gdi32/painting.c index 96f4a1ede64..877c8400445 100644 --- a/dlls/gdi32/painting.c +++ b/dlls/gdi32/painting.c @@ -453,7 +453,7 @@ COLORREF WINAPI SetPixel( HDC hdc, INT x, INT y, COLORREF color ) COLORREF ret; DC * dc = get_dc_ptr( hdc ); - if (!dc) return 0; + if (!dc) return ~0; update_dc( dc ); physdev = GET_DC_PHYSDEV( dc, pSetPixel ); ret = physdev->funcs->pSetPixel( physdev, x, y, color ); diff --git a/dlls/gdi32/tests/dc.c b/dlls/gdi32/tests/dc.c index 04703288302..8aa3b201b8b 100644 --- a/dlls/gdi32/tests/dc.c +++ b/dlls/gdi32/tests/dc.c @@ -1672,6 +1672,15 @@ static void test_clip_box(void) DeleteObject(bitmap); } +static void test_SetPixel(void) +{ + COLORREF c; + + c = SetPixel((HDC)0xdeadbeef, 0, 0, 0); + ok(c == ~0, "SetPixel returned: %x\n", c); +} + + START_TEST(dc) { test_dc_values(); @@ -1688,4 +1697,5 @@ START_TEST(dc) test_printer_dc(); test_pscript_printer_dc(); test_clip_box(); + test_SetPixel(); }
1
0
0
0
Francois Gouget : testbot/WineTest: Don't run the tests for test=build missions.
by Alexandre Julliard
14 Jun '21
14 Jun '21
Module: tools Branch: master Commit: 1571def6c445bf48074097cc316286637c6eac18 URL:
https://source.winehq.org/git/tools.git/?a=commit;h=1571def6c445bf48074097c…
Author: Francois Gouget <fgouget(a)codeweavers.com> Date: Sun Jun 13 13:50:22 2021 +0200 testbot/WineTest: Don't run the tests for test=build missions. Signed-off-by: Francois Gouget <fgouget(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- testbot/bin/build/WineTest.pl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/testbot/bin/build/WineTest.pl b/testbot/bin/build/WineTest.pl index ffd665f..73cd660 100755 --- a/testbot/bin/build/WineTest.pl +++ b/testbot/bin/build/WineTest.pl @@ -116,7 +116,7 @@ sub TestPatch($$) { push @TestList, "-m", "do.not.submit"; } - else + elsif ($Mission->{test} ne "build") { foreach my $ModuleName (sort keys %{$Impacts->{Modules}}) {
1
0
0
0
Piotr Caban : msvcrt: Import exp implementation from musl.
by Alexandre Julliard
11 Jun '21
11 Jun '21
Module: wine Branch: master Commit: f5bd0be6a44c1c7d69afb8b8eb6311923e7762a1 URL:
https://source.winehq.org/git/wine.git/?a=commit;h=f5bd0be6a44c1c7d69afb8b8…
Author: Piotr Caban <piotr(a)codeweavers.com> Date: Fri Jun 11 20:15:43 2021 +0200 msvcrt: Import exp implementation from musl. Signed-off-by: Piotr Caban <piotr(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/msvcrt/math.c | 156 +++++++++++++++++++++++++++++++++++++++++--------- dlls/msvcrt/unixlib.c | 9 --- dlls/msvcrt/unixlib.h | 1 - 3 files changed, 128 insertions(+), 38 deletions(-) diff --git a/dlls/msvcrt/math.c b/dlls/msvcrt/math.c index cb1969fcb3e..3d4ce3b3108 100644 --- a/dlls/msvcrt/math.c +++ b/dlls/msvcrt/math.c @@ -549,6 +549,27 @@ recompute: return n & 7; } +/* Based on musl implementation: src/math/round.c */ +static double __round(double x) +{ + ULONGLONG llx = *(ULONGLONG*)&x, tmp; + int e = (llx >> 52 & 0x7ff) - 0x3ff; + + if (e >= 52) + return x; + if (e < -1) + return 0 * x; + else if (e == -1) + return signbit(x) ? -1 : 1; + + tmp = 0x000fffffffffffffULL >> e; + if (!(llx & tmp)) + return x; + llx += 0x0008000000000000ULL >> e; + llx &= ~tmp; + return *(double*)&llx; +} + #if !defined(__i386__) || _MSVCR_VER >= 120 /* Copied from musl: src/math/expm1f.c */ static float __expm1f(float x) @@ -669,27 +690,6 @@ static float __cosdf(double x) return ((1.0 + z * C0) + w * C1) + (w * z) * r; } -/* Based on musl implementation: src/math/round.c */ -static double __round(double x) -{ - ULONGLONG llx = *(ULONGLONG*)&x, tmp; - int e = (llx >> 52 & 0x7ff) - 0x3ff; - - if (e >= 52) - return x; - if (e < -1) - return 0 * x; - else if (e == -1) - return signbit(x) ? -1 : 1; - - tmp = 0x000fffffffffffffULL >> e; - if (!(llx & tmp)) - return x; - llx += 0x0008000000000000ULL >> e; - llx &= ~tmp; - return *(double*)&llx; -} - static const UINT64 exp2f_T[] = { 0x3ff0000000000000ULL, 0x3fefd9b0d3158574ULL, 0x3fefb5586cf9890fULL, 0x3fef9301d0125b51ULL, 0x3fef72b83c7d517bULL, 0x3fef54873168b9aaULL, 0x3fef387a6e756238ULL, 0x3fef1e9df51fdee1ULL, @@ -2794,7 +2794,6 @@ double CDECL cosh( double x ) return t; } -#if _MSVCR_VER >= 120 /* Copied from musl: src/math/exp_data.c */ static const UINT64 exp_T[] = { 0x0ULL, 0x3ff0000000000000ULL, @@ -2926,18 +2925,119 @@ static const UINT64 exp_T[] = { 0x3c77893b4d91cd9dULL, 0x3fefe7c1819e90d8ULL, 0x3c5305c14160cc89ULL, 0x3feff3c22b8f71f1ULL }; -#endif /********************************************************************* * exp (MSVCRT.@) + * + * Copied from musl: src/math/exp.c */ double CDECL exp( double x ) { - double ret = unix_funcs->exp( x ); - if (isnan(x)) return math_error(_DOMAIN, "exp", x, 0, ret); - if (isfinite(x) && !ret) return math_error(_UNDERFLOW, "exp", x, 0, ret); - if (isfinite(x) && !isfinite(ret)) return math_error(_OVERFLOW, "exp", x, 0, ret); - return ret; + static const double C[] = { + 0x1.ffffffffffdbdp-2, + 0x1.555555555543cp-3, + 0x1.55555cf172b91p-5, + 0x1.1111167a4d017p-7 + }; + static const double invln2N = 0x1.71547652b82fep0 * (1 << 7), + negln2hiN = -0x1.62e42fefa0000p-8, + negln2loN = -0x1.cf79abc9e3b3ap-47; + + UINT32 abstop; + UINT64 ki, idx, top, sbits; + double kd, z, r, r2, scale, tail, tmp; + + abstop = (*(UINT64*)&x >> 52) & 0x7ff; + if (abstop - 0x3c9 >= 0x408 - 0x3c9) { + if (abstop - 0x3c9 >= 0x80000000) + /* Avoid spurious underflow for tiny x. */ + /* Note: 0 is common input. */ + return 1.0 + x; + if (abstop >= 0x409) { + if (*(UINT64*)&x == 0xfff0000000000000ULL) + return 0.0; +#if _MSVCR_VER == 0 + if (*(UINT64*)&x > 0x7ff0000000000000ULL) + return math_error(_DOMAIN, "exp", x, 0, 1.0 + x); +#endif + if (abstop >= 0x7ff) + return 1.0 + x; + if (*(UINT64*)&x >> 63) + return math_error(_UNDERFLOW, "exp", x, 0, fp_barrier(DBL_MIN) * DBL_MIN); + else + return math_error(_OVERFLOW, "exp", x, 0, fp_barrier(DBL_MAX) * DBL_MAX); + } + /* Large x is special cased below. */ + abstop = 0; + } + + /* exp(x) = 2^(k/N) * exp(r), with exp(r) in [2^(-1/2N),2^(1/2N)]. */ + /* x = ln2/N*k + r, with int k and r in [-ln2/2N, ln2/2N]. */ + z = invln2N * x; + kd = __round(z); + ki = (INT64)kd; + + r = x + kd * negln2hiN + kd * negln2loN; + /* 2^(k/N) ~= scale * (1 + tail). */ + idx = 2 * (ki % (1 << 7)); + top = ki << (52 - 7); + tail = *(double*)&exp_T[idx]; + /* This is only a valid scale when -1023*N < k < 1024*N. */ + sbits = exp_T[idx + 1] + top; + /* exp(x) = 2^(k/N) * exp(r) ~= scale + scale * (tail + exp(r) - 1). */ + /* Evaluation is optimized assuming superscalar pipelined execution. */ + r2 = r * r; + /* Without fma the worst case error is 0.25/N ulp larger. */ + /* Worst case error is less than 0.5+1.11/N+(abs poly error * 2^53) ulp. */ + tmp = tail + r + r2 * (C[0] + r * C[1]) + r2 * r2 * (C[2] + r * C[3]); + if (abstop == 0) { + /* Handle cases that may overflow or underflow when computing the result that + is scale*(1+TMP) without intermediate rounding. The bit representation of + scale is in SBITS, however it has a computed exponent that may have + overflown into the sign bit so that needs to be adjusted before using it as + a double. (int32_t)KI is the k used in the argument reduction and exponent + adjustment of scale, positive k here means the result may overflow and + negative k means the result may underflow. */ + double scale, y; + + if ((ki & 0x80000000) == 0) { + /* k > 0, the exponent of scale might have overflowed by <= 460. */ + sbits -= 1009ull << 52; + scale = *(double*)&sbits; + y = 0x1p1009 * (scale + scale * tmp); + if (isinf(y)) + return math_error(_OVERFLOW, "exp", x, 0, y); + return y; + } + /* k < 0, need special care in the subnormal range. */ + sbits += 1022ull << 52; + scale = *(double*)&sbits; + y = scale + scale * tmp; + if (y < 1.0) { + /* Round y to the right precision before scaling it into the subnormal + range to avoid double rounding that can cause 0.5+E/2 ulp error where + E is the worst-case ulp error outside the subnormal range. So this + is only useful if the goal is better than 1 ulp worst-case error. */ + double hi, lo; + lo = scale - y + scale * tmp; + hi = 1.0 + y; + lo = 1.0 - hi + y + lo; + y = hi + lo - 1.0; + /* Avoid -0.0 with downward rounding. */ + if (y == 0.0) + y = 0.0; + /* The underflow exception needs to be signaled explicitly. */ + fp_barrier(fp_barrier(0x1p-1022) * 0x1p-1022); + y = 0x1p-1022 * y; + return math_error(_UNDERFLOW, "exp", x, 0, y); + } + y = 0x1p-1022 * y; + return y; + } + scale = *(double*)&sbits; + /* Note: tmp == 0 or |tmp| > 2^-200 and scale > 2^-739, so there + is no spurious underflow here even without fma. */ + return scale + scale * tmp; } /********************************************************************* diff --git a/dlls/msvcrt/unixlib.c b/dlls/msvcrt/unixlib.c index 89cc155b4e4..adc290cd653 100644 --- a/dlls/msvcrt/unixlib.c +++ b/dlls/msvcrt/unixlib.c @@ -42,14 +42,6 @@ WINE_DEFAULT_DEBUG_CHANNEL(msvcrt); -/********************************************************************* - * exp - */ -static double CDECL unix_exp( double x ) -{ - return exp( x ); -} - /********************************************************************* * pow */ @@ -60,7 +52,6 @@ static double CDECL unix_pow( double x, double y ) static const struct unix_funcs funcs = { - unix_exp, unix_pow, }; diff --git a/dlls/msvcrt/unixlib.h b/dlls/msvcrt/unixlib.h index af44c0c9d89..0a6db6a8d54 100644 --- a/dlls/msvcrt/unixlib.h +++ b/dlls/msvcrt/unixlib.h @@ -23,7 +23,6 @@ struct unix_funcs { - double (CDECL *exp)(double x); double (CDECL *pow)(double x, double y); };
1
0
0
0
Piotr Caban : msvcrt: Import exp2 implementation from musl.
by Alexandre Julliard
11 Jun '21
11 Jun '21
Module: wine Branch: master Commit: b06dd5a13b11d24ea151d088c8bde72bd49ce7dd URL:
https://source.winehq.org/git/wine.git/?a=commit;h=b06dd5a13b11d24ea151d088…
Author: Piotr Caban <piotr(a)codeweavers.com> Date: Fri Jun 11 20:15:39 2021 +0200 msvcrt: Import exp2 implementation from musl. Signed-off-by: Piotr Caban <piotr(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- configure | 14 --- configure.ac | 3 - dlls/msvcrt/math.c | 245 +++++++++++++++++++++++++++++++++++++++++++++++++- dlls/msvcrt/unixlib.c | 13 --- dlls/msvcrt/unixlib.h | 1 - include/config.h.in | 3 - 6 files changed, 242 insertions(+), 37 deletions(-) Diff:
https://source.winehq.org/git/wine.git/?a=commitdiff;h=b06dd5a13b11d24ea151…
1
0
0
0
Jan Sikorski : wined3d: Fix typo in wined3d_texture_vk_prepare_texture().
by Alexandre Julliard
11 Jun '21
11 Jun '21
Module: wine Branch: master Commit: 2d44949360e08d3eb114fd8ee4f8baf3ea95988e URL:
https://source.winehq.org/git/wine.git/?a=commit;h=2d44949360e08d3eb114fd8e…
Author: Jan Sikorski <jsikorski(a)codeweavers.com> Date: Fri Jun 11 15:29:06 2021 +0200 wined3d: Fix typo in wined3d_texture_vk_prepare_texture(). Signed-off-by: Jan Sikorski <jsikorski(a)codeweavers.com> Signed-off-by: Henri Verbeet <hverbeet(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/wined3d/texture.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dlls/wined3d/texture.c b/dlls/wined3d/texture.c index c77de1796c4..165d83eb035 100644 --- a/dlls/wined3d/texture.c +++ b/dlls/wined3d/texture.c @@ -5139,7 +5139,7 @@ BOOL wined3d_texture_vk_prepare_texture(struct wined3d_texture_vk *texture_vk, vk_usage |= VK_IMAGE_USAGE_STORAGE_BIT; texture_vk->layout = VK_IMAGE_LAYOUT_GENERAL; - if (wined3d_popcount(resource->bind_flags == 1)) + if (wined3d_popcount(resource->bind_flags) == 1) { switch (resource->bind_flags) {
1
0
0
0
Nikolay Sivov : d2d1: Reuse VS constant buffer object.
by Alexandre Julliard
11 Jun '21
11 Jun '21
Module: wine Branch: master Commit: 9fd51e4d74302a3abf9554134524df48d1ad50fa URL:
https://source.winehq.org/git/wine.git/?a=commit;h=9fd51e4d74302a3abf955413…
Author: Nikolay Sivov <nsivov(a)codeweavers.com> Date: Fri Jun 11 11:35:49 2021 +0300 d2d1: Reuse VS constant buffer object. Signed-off-by: Nikolay Sivov <nsivov(a)codeweavers.com> Signed-off-by: Henri Verbeet <hverbeet(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/d2d1/d2d1_private.h | 22 +++- dlls/d2d1/device.c | 286 ++++++++++++++++++++--------------------------- 2 files changed, 141 insertions(+), 167 deletions(-) Diff:
https://source.winehq.org/git/wine.git/?a=commitdiff;h=9fd51e4d74302a3abf95…
1
0
0
0
Francois Gouget : user32/tests: Use the caller line number for open_clipboard() & co.
by Alexandre Julliard
11 Jun '21
11 Jun '21
Module: wine Branch: master Commit: a21d4fb8e3370e24cff222c132a9b383f3b2ed8c URL:
https://source.winehq.org/git/wine.git/?a=commit;h=a21d4fb8e3370e24cff222c1…
Author: Francois Gouget <fgouget(a)codeweavers.com> Date: Thu Jun 10 12:11:16 2021 +0200 user32/tests: Use the caller line number for open_clipboard() & co. In particular this stops the traces in open_clipboard() and has_no_open_wnd() from clobbering the line number when used in expressions such as ok(has_no_open_wnd(), ...). Signed-off-by: Francois Gouget <fgouget(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/user32/tests/clipboard.c | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/dlls/user32/tests/clipboard.c b/dlls/user32/tests/clipboard.c index 5951fc3247f..c8de860f8cc 100644 --- a/dlls/user32/tests/clipboard.c +++ b/dlls/user32/tests/clipboard.c @@ -33,7 +33,8 @@ static BOOL (WINAPI *pGetUpdatedClipboardFormats)( UINT *formats, UINT count, UI static int thread_from_line; static char *argv0; -static BOOL open_clipboard(HWND hwnd) +#define open_clipboard(hwnd) open_clipboard_(__LINE__, hwnd) +static BOOL open_clipboard_(int line, HWND hwnd) { DWORD start = GetTickCount(); while (1) @@ -54,7 +55,7 @@ static BOOL open_clipboard(HWND hwnd) * response to a native application. */ GetClassNameA(clipwnd, classname, ARRAY_SIZE(classname)); - trace("%p (%s) opened the clipboard\n", clipwnd, classname); + trace_(__FILE__, line)("%p (%s) opened the clipboard\n", clipwnd, classname); SetLastError(le); return ret; } @@ -62,7 +63,8 @@ static BOOL open_clipboard(HWND hwnd) } } -static BOOL has_no_open_wnd(void) +#define has_no_open_wnd() has_no_open_wnd_(__LINE__) +static BOOL has_no_open_wnd_(int line) { DWORD start = GetTickCount(); DWORD le = GetLastError(); @@ -76,7 +78,7 @@ static BOOL has_no_open_wnd(void) le = GetLastError(); /* See open_clipboard() */ GetClassNameA(clipwnd, classname, ARRAY_SIZE(classname)); - trace("%p (%s) opened the clipboard\n", clipwnd, classname); + trace_(__FILE__, line)("%p (%s) opened the clipboard\n", clipwnd, classname); SetLastError(le); return FALSE; }
1
0
0
0
← Newer
1
...
40
41
42
43
44
45
46
...
82
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
Results per page:
10
25
50
100
200