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
July
June
May
April
March
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
August 2021
----- 2025 -----
July 2025
June 2025
May 2025
April 2025
March 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
1051 discussions
Start a n
N
ew thread
Francois Gouget : oleaut32: Fix VarParseNumFromStr()'s handling of currency decimals.
by Alexandre Julliard
09 Aug '21
09 Aug '21
Module: wine Branch: master Commit: caf5ab5d65ed9df978006d819b1d800071af1117 URL:
https://source.winehq.org/git/wine.git/?a=commit;h=caf5ab5d65ed9df978006d81…
Author: Francois Gouget <fgouget(a)codeweavers.com> Date: Sun Aug 8 00:49:04 2021 +0200 oleaut32: Fix VarParseNumFromStr()'s handling of currency decimals. They have no default, flag the value as a monetary amount, are unaffected by the presence / absence of a currency symbol, and are incompatible with hexadecimal / octal numbers. Signed-off-by: Francois Gouget <fgouget(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/oleaut32/tests/vartest.c | 32 +++++++---------------- dlls/oleaut32/variant.c | 61 +++++++++++++++++++++++++++++-------------- 2 files changed, 51 insertions(+), 42 deletions(-) diff --git a/dlls/oleaut32/tests/vartest.c b/dlls/oleaut32/tests/vartest.c index 6dddc79e829..f6149005179 100644 --- a/dlls/oleaut32/tests/vartest.c +++ b/dlls/oleaut32/tests/vartest.c @@ -1548,11 +1548,8 @@ static void test_VarParseNumFromStrEn(void) /* Only integers are allowed when using an alternative radix */ CONVERT("&ha.2", NUMPRS_HEX_OCT|NUMPRS_DECIMAL); - if (broken(1)) /* FIXME Reenable once Wine is less broken */ EXPECT(1,NUMPRS_HEX_OCT|NUMPRS_DECIMAL,NUMPRS_HEX_OCT,3,4,0); - todo_wine ok(np.dwOutFlags == NUMPRS_HEX_OCT, "Got dwOutFlags=%08x\n", np.dwOutFlags); - EXPECTRGB(0,10); - todo_wine EXPECTRGB(1,FAILDIG); + EXPECT2(10,FAILDIG); /* Except if it looks like a plain decimal number */ CONVERT("01.2", NUMPRS_HEX_OCT|NUMPRS_DECIMAL); @@ -2318,9 +2315,8 @@ static void test_VarParseNumFromStrMisc(void) /* But not for their monetary equivalents */ hres = wconvert_str(L"~1", ARRAY_SIZE(rgb), NUMPRS_THOUSANDS|NUMPRS_DECIMAL|NUMPRS_CURRENCY, &np, rgb, LOCALE_USER_DEFAULT, 0); - todo_wine EXPECT(1,NUMPRS_THOUSANDS|NUMPRS_DECIMAL|NUMPRS_CURRENCY,NUMPRS_DECIMAL|NUMPRS_CURRENCY,2,0,-1); - todo_wine EXPECTRGB(0,1); - EXPECTRGB(1,FAILDIG); + EXPECT(1,NUMPRS_THOUSANDS|NUMPRS_DECIMAL|NUMPRS_CURRENCY,NUMPRS_DECIMAL|NUMPRS_CURRENCY,2,0,-1); + EXPECT2(1,FAILDIG); hres = wconvert_str(L"1~", ARRAY_SIZE(rgb), NUMPRS_THOUSANDS|NUMPRS_DECIMAL|NUMPRS_CURRENCY|NUMPRS_USE_ALL, &np, rgb, LOCALE_USER_DEFAULT, 0); EXPECT(1,NUMPRS_THOUSANDS|NUMPRS_DECIMAL|NUMPRS_CURRENCY|NUMPRS_USE_ALL,NUMPRS_THOUSANDS|NUMPRS_CURRENCY,2,0,0); @@ -2355,11 +2351,8 @@ static void test_VarParseNumFromStrMisc(void) EXPECTRGB(2,FAILDIG); hres = wconvert_str(L"1,2", ARRAY_SIZE(rgb), NUMPRS_DECIMAL, &np, rgb, LOCALE_USER_DEFAULT, 0); - if (broken(1)) /* FIXME Reenable once Wine is less broken */ EXPECT(2,NUMPRS_DECIMAL,NUMPRS_DECIMAL|NUMPRS_CURRENCY,3,0,-1); - todo_wine ok(np.dwOutFlags == (NUMPRS_DECIMAL|NUMPRS_CURRENCY), "Got dwOutFlags=%08x\n", np.dwOutFlags); - EXPECTRGB(0,1); - todo_wine EXPECTRGB(1,2); + EXPECT2(1,2); EXPECTRGB(2,FAILDIG); hres = wconvert_str(L"1.2", ARRAY_SIZE(rgb), NUMPRS_DECIMAL|NUMPRS_CURRENCY|NUMPRS_USE_ALL, &np, rgb, LOCALE_USER_DEFAULT, 0); @@ -2368,11 +2361,8 @@ static void test_VarParseNumFromStrMisc(void) EXPECTRGB(2,FAILDIG); hres = wconvert_str(L"1,2", ARRAY_SIZE(rgb), NUMPRS_DECIMAL|NUMPRS_CURRENCY|NUMPRS_USE_ALL, &np, rgb, LOCALE_USER_DEFAULT, 0); - if (broken(1)) /* FIXME Reenable once Wine is less broken */ EXPECT(2,NUMPRS_DECIMAL|NUMPRS_CURRENCY|NUMPRS_USE_ALL,NUMPRS_DECIMAL|NUMPRS_CURRENCY,3,0,-1); - todo_wine ok(np.dwOutFlags == (NUMPRS_DECIMAL|NUMPRS_CURRENCY), "Got dwOutFlags=%08x\n", np.dwOutFlags); - EXPECTRGB(0,1); - todo_wine EXPECTRGB(1,2); + EXPECT2(1,2); EXPECTRGB(2,FAILDIG); hres = wconvert_str(L"1.2,3", ARRAY_SIZE(rgb), NUMPRS_DECIMAL|NUMPRS_CURRENCY, &np, rgb, LOCALE_USER_DEFAULT, 0); @@ -2381,11 +2371,8 @@ static void test_VarParseNumFromStrMisc(void) EXPECTRGB(2,FAILDIG); hres = wconvert_str(L"1,2.3", ARRAY_SIZE(rgb), NUMPRS_DECIMAL, &np, rgb, LOCALE_USER_DEFAULT, 0); - if (broken(1)) /* FIXME Reenable once Wine is less broken */ EXPECT(2,NUMPRS_DECIMAL,NUMPRS_DECIMAL|NUMPRS_CURRENCY,3,0,-1); - todo_wine ok(np.dwOutFlags == (NUMPRS_DECIMAL|NUMPRS_CURRENCY), "Got dwOutFlags=%08x\n", np.dwOutFlags); - EXPECTRGB(0,1); - todo_wine EXPECTRGB(1,2); + EXPECT2(1,2); EXPECTRGB(2,FAILDIG); @@ -2394,10 +2381,9 @@ static void test_VarParseNumFromStrMisc(void) */ SetLocaleInfoW(LOCALE_USER_DEFAULT, LOCALE_SMONDECIMALSEP, L"$"); hres = wconvert_str(L"1$99", ARRAY_SIZE(rgb), NUMPRS_DECIMAL|NUMPRS_USE_ALL, &np, rgb, LOCALE_USER_DEFAULT, 0); - todo_wine EXPECT(3,NUMPRS_DECIMAL|NUMPRS_USE_ALL,NUMPRS_DECIMAL|NUMPRS_CURRENCY,4,0,-2); - EXPECTRGB(0,1); - todo_wine EXPECTRGB(1,9); - todo_wine EXPECTRGB(2,9); + EXPECT(3,NUMPRS_DECIMAL|NUMPRS_USE_ALL,NUMPRS_DECIMAL|NUMPRS_CURRENCY,4,0,-2); + EXPECT2(1,9); + EXPECTRGB(2,9); EXPECTRGB(3,FAILDIG); diff --git a/dlls/oleaut32/variant.c b/dlls/oleaut32/variant.c index fe4bdb41ed2..09c6f9dcad6 100644 --- a/dlls/oleaut32/variant.c +++ b/dlls/oleaut32/variant.c @@ -1523,7 +1523,7 @@ typedef struct tagVARIANT_NUMBER_CHARS /* Get the valid number characters for an lcid */ static void VARIANT_GetLocalisedNumberChars(VARIANT_NUMBER_CHARS *lpChars, LCID lcid, DWORD dwFlags) { - static const VARIANT_NUMBER_CHARS defaultChars = { '-','+','.',0,1,{'$',0},'.',',' }; + static const VARIANT_NUMBER_CHARS defaultChars = { '-','+','.',0,1,{'$',0},0,',' }; LCTYPE lctype = dwFlags & LOCALE_NOUSEROVERRIDE; WCHAR buff[4]; @@ -1630,7 +1630,31 @@ HRESULT WINAPI VarParseNumFromStr(const OLECHAR *lpszStr, LCID lcid, ULONG dwFla /* First consume all the leading symbols and space from the string */ while (1) { - if (pNumprs->dwInFlags & NUMPRS_LEADING_WHITE && iswspace(*lpszStr)) + if (pNumprs->dwInFlags & NUMPRS_DECIMAL && + (*lpszStr == chars.cDecimalPoint || + *lpszStr == chars.cCurrencyDecimalPoint)) + { + pNumprs->dwOutFlags |= NUMPRS_DECIMAL; + if (*lpszStr == chars.cCurrencyDecimalPoint && + chars.cDecimalPoint != chars.cCurrencyDecimalPoint) + pNumprs->dwOutFlags |= NUMPRS_CURRENCY; + cchUsed++; + lpszStr++; + + /* If we have no digits so far, skip leading zeros */ + if (!pNumprs->cDig) + { + while (lpszStr[1] == '0') + { + dwState |= B_LEADING_ZERO; + cchUsed++; + lpszStr++; + pNumprs->nPwr10--; + } + } + break; + } + else if (pNumprs->dwInFlags & NUMPRS_LEADING_WHITE && iswspace(*lpszStr)) { pNumprs->dwOutFlags |= NUMPRS_LEADING_WHITE; do @@ -1673,8 +1697,6 @@ HRESULT WINAPI VarParseNumFromStr(const OLECHAR *lpszStr, LCID lcid, ULONG dwFla pNumprs->dwOutFlags |= NUMPRS_CURRENCY; cchUsed += chars.sCurrencyLen; lpszStr += chars.sCurrencyLen; - /* Only accept currency characters */ - chars.cDecimalPoint = chars.cCurrencyDecimalPoint; } else if (pNumprs->dwInFlags & NUMPRS_PARENS && *lpszStr == '(' && !(pNumprs->dwOutFlags & NUMPRS_PARENS)) @@ -1687,27 +1709,24 @@ HRESULT WINAPI VarParseNumFromStr(const OLECHAR *lpszStr, LCID lcid, ULONG dwFla break; } - if (!(pNumprs->dwOutFlags & NUMPRS_CURRENCY)) - { - /* Only accept non-currency characters */ - chars.cCurrencyDecimalPoint = chars.cDecimalPoint; - } - - if ((*lpszStr == '&' && (*(lpszStr+1) == 'H' || *(lpszStr+1) == 'h')) && - pNumprs->dwInFlags & NUMPRS_HEX_OCT) + if (!(pNumprs->dwOutFlags & NUMPRS_DECIMAL)) { + if ((*lpszStr == '&' && (*(lpszStr+1) == 'H' || *(lpszStr+1) == 'h')) && + pNumprs->dwInFlags & NUMPRS_HEX_OCT) + { dwState |= B_PROCESSING_HEX; pNumprs->dwOutFlags |= NUMPRS_HEX_OCT; cchUsed=cchUsed+2; lpszStr=lpszStr+2; - } - else if ((*lpszStr == '&' && (*(lpszStr+1) == 'O' || *(lpszStr+1) == 'o')) && - pNumprs->dwInFlags & NUMPRS_HEX_OCT) - { + } + else if ((*lpszStr == '&' && (*(lpszStr+1) == 'O' || *(lpszStr+1) == 'o')) && + pNumprs->dwInFlags & NUMPRS_HEX_OCT) + { dwState |= B_PROCESSING_OCT; pNumprs->dwOutFlags |= NUMPRS_HEX_OCT; cchUsed=cchUsed+2; lpszStr=lpszStr+2; + } } /* Strip Leading zeros */ @@ -1796,11 +1815,15 @@ HRESULT WINAPI VarParseNumFromStr(const OLECHAR *lpszStr, LCID lcid, ULONG dwFla pNumprs->dwOutFlags |= NUMPRS_THOUSANDS|NUMPRS_CURRENCY; cchUsed++; } - else if (*lpszStr == chars.cDecimalPoint && - pNumprs->dwInFlags & NUMPRS_DECIMAL && - !(pNumprs->dwOutFlags & (NUMPRS_DECIMAL|NUMPRS_EXPONENT))) + else if (pNumprs->dwInFlags & NUMPRS_DECIMAL && + (*lpszStr == chars.cDecimalPoint || + *lpszStr == chars.cCurrencyDecimalPoint) && + !(pNumprs->dwOutFlags & (NUMPRS_HEX_OCT|NUMPRS_DECIMAL|NUMPRS_EXPONENT))) { pNumprs->dwOutFlags |= NUMPRS_DECIMAL; + if (*lpszStr == chars.cCurrencyDecimalPoint && + chars.cDecimalPoint != chars.cCurrencyDecimalPoint) + pNumprs->dwOutFlags |= NUMPRS_CURRENCY; cchUsed++; /* If we have no digits so far, skip leading zeros */
1
0
0
0
Francois Gouget : oleaut32: Add support for longer currency symbols.
by Alexandre Julliard
09 Aug '21
09 Aug '21
Module: wine Branch: master Commit: fc5e603cd3e8ff68e52044e24a12e3f19a116afa URL:
https://source.winehq.org/git/wine.git/?a=commit;h=fc5e603cd3e8ff68e52044e2…
Author: Francois Gouget <fgouget(a)codeweavers.com> Date: Sun Aug 8 00:49:01 2021 +0200 oleaut32: Add support for longer currency symbols. Signed-off-by: Francois Gouget <fgouget(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/oleaut32/tests/vartest.c | 4 ++-- dlls/oleaut32/variant.c | 46 ++++++++++++++++++++++++++----------------- dlls/oleaut32/variant.h | 13 ------------ 3 files changed, 30 insertions(+), 33 deletions(-) diff --git a/dlls/oleaut32/tests/vartest.c b/dlls/oleaut32/tests/vartest.c index fbcfba32c80..6dddc79e829 100644 --- a/dlls/oleaut32/tests/vartest.c +++ b/dlls/oleaut32/tests/vartest.c @@ -2439,10 +2439,10 @@ static void test_VarParseNumFromStrMisc(void) /* Windows 8.1 incorrectly doubles the right-to-left mark: * "\x62f.\x645.\x200f\x200f 5" */ - todo_wine ok(hres == S_OK || broken(hres == DISP_E_TYPEMISMATCH), "returned %08x\n", hres); + ok(hres == S_OK || broken(hres == DISP_E_TYPEMISMATCH), "returned %08x\n", hres); if (hres == S_OK) { - todo_wine EXPECT(1,NUMPRS_CURRENCY|NUMPRS_USE_ALL,NUMPRS_CURRENCY,6,0,0); + EXPECT(1,NUMPRS_CURRENCY|NUMPRS_USE_ALL,NUMPRS_CURRENCY,6,0,0); EXPECT2(5,FAILDIG); } diff --git a/dlls/oleaut32/variant.c b/dlls/oleaut32/variant.c index 2ec07817460..fe4bdb41ed2 100644 --- a/dlls/oleaut32/variant.c +++ b/dlls/oleaut32/variant.c @@ -1499,6 +1499,19 @@ HRESULT WINAPI VarUdateFromDate(DATE dateIn, ULONG dwFlags, UDATE *lpUdate) return S_OK; } +/* The localised characters that make up a valid number */ +typedef struct tagVARIANT_NUMBER_CHARS +{ + WCHAR cNegativeSymbol; + WCHAR cPositiveSymbol; + WCHAR cDecimalPoint; + WCHAR cDigitSeparator; + DWORD sCurrencyLen; + WCHAR sCurrency[8]; + WCHAR cCurrencyDecimalPoint; + WCHAR cCurrencyDigitSeparator; +} VARIANT_NUMBER_CHARS; + #define GET_NUMBER_TEXT(fld,name) \ buff[0] = 0; \ if (!GetLocaleInfoW(lcid, lctype|fld, buff, 2)) \ @@ -1510,7 +1523,7 @@ HRESULT WINAPI VarUdateFromDate(DATE dateIn, ULONG dwFlags, UDATE *lpUdate) /* Get the valid number characters for an lcid */ static void VARIANT_GetLocalisedNumberChars(VARIANT_NUMBER_CHARS *lpChars, LCID lcid, DWORD dwFlags) { - static const VARIANT_NUMBER_CHARS defaultChars = { '-','+','.',0,'$',0,'.',',' }; + static const VARIANT_NUMBER_CHARS defaultChars = { '-','+','.',0,1,{'$',0},'.',',' }; LCTYPE lctype = dwFlags & LOCALE_NOUSEROVERRIDE; WCHAR buff[4]; @@ -1522,17 +1535,16 @@ static void VARIANT_GetLocalisedNumberChars(VARIANT_NUMBER_CHARS *lpChars, LCID GET_NUMBER_TEXT(LOCALE_SMONDECIMALSEP, cCurrencyDecimalPoint); GET_NUMBER_TEXT(LOCALE_SMONTHOUSANDSEP, cCurrencyDigitSeparator); - /* Local currency symbols are often 2 characters */ - lpChars->cCurrencyLocal2 = '\0'; - switch(GetLocaleInfoW(lcid, lctype|LOCALE_SCURRENCY, buff, ARRAY_SIZE(buff))) + if (!GetLocaleInfoW(lcid, lctype|LOCALE_SCURRENCY, lpChars->sCurrency, ARRAY_SIZE(lpChars->sCurrency))) { - case 3: lpChars->cCurrencyLocal2 = buff[1]; /* Fall through */ - case 2: lpChars->cCurrencyLocal = buff[0]; - break; - default: WARN("buffer too small for LOCALE_SCURRENCY\n"); + if (GetLastError() == ERROR_INSUFFICIENT_BUFFER) + WARN("buffer too small for LOCALE_SCURRENCY\n"); + *lpChars->sCurrency = 0; } - TRACE("lcid 0x%x, cCurrencyLocal=%d,%d %s\n", lcid, lpChars->cCurrencyLocal, - lpChars->cCurrencyLocal2, wine_dbgstr_w(buff)); + if (!*lpChars->sCurrency) + wcscpy(lpChars->sCurrency, L"$"); + lpChars->sCurrencyLen = wcslen(lpChars->sCurrency); + TRACE("lcid 0x%x, sCurrency=%u %s\n", lcid, lpChars->sCurrencyLen, wine_dbgstr_w(lpChars->sCurrency)); } /* Number Parsing States */ @@ -1656,12 +1668,11 @@ HRESULT WINAPI VarParseNumFromStr(const OLECHAR *lpszStr, LCID lcid, ULONG dwFla } else if (pNumprs->dwInFlags & NUMPRS_CURRENCY && !(pNumprs->dwOutFlags & NUMPRS_CURRENCY) && - *lpszStr == chars.cCurrencyLocal && - (!chars.cCurrencyLocal2 || lpszStr[1] == chars.cCurrencyLocal2)) + wcsncmp(lpszStr, chars.sCurrency, chars.sCurrencyLen) == 0) { pNumprs->dwOutFlags |= NUMPRS_CURRENCY; - cchUsed += chars.cCurrencyLocal2 ? 2 : 1; - lpszStr += chars.cCurrencyLocal2 ? 2 : 1; + cchUsed += chars.sCurrencyLen; + lpszStr += chars.sCurrencyLen; /* Only accept currency characters */ chars.cDecimalPoint = chars.cCurrencyDecimalPoint; } @@ -1972,12 +1983,11 @@ HRESULT WINAPI VarParseNumFromStr(const OLECHAR *lpszStr, LCID lcid, ULONG dwFla pNumprs->dwOutFlags |= NUMPRS_NEG; } else if (pNumprs->dwInFlags & NUMPRS_CURRENCY && - *lpszStr == chars.cCurrencyLocal && - (!chars.cCurrencyLocal2 || lpszStr[1] == chars.cCurrencyLocal2)) + wcsncmp(lpszStr, chars.sCurrency, chars.sCurrencyLen) == 0) { pNumprs->dwOutFlags |= NUMPRS_CURRENCY; - cchUsed += chars.cCurrencyLocal2 ? 2 : 1; - lpszStr += chars.cCurrencyLocal2 ? 2 : 1; + cchUsed += chars.sCurrencyLen; + lpszStr += chars.sCurrencyLen; } else break; diff --git a/dlls/oleaut32/variant.h b/dlls/oleaut32/variant.h index 76444cf0514..1be8f8cdc79 100644 --- a/dlls/oleaut32/variant.h +++ b/dlls/oleaut32/variant.h @@ -101,19 +101,6 @@ #define VAR_BOOLYESNO 0x0800 /* Convert bool to "Yes"/"No" */ #define VAR_NEGATIVE 0x1000 /* Number is negative */ -/* The localised characters that make up a valid number */ -typedef struct tagVARIANT_NUMBER_CHARS -{ - WCHAR cNegativeSymbol; - WCHAR cPositiveSymbol; - WCHAR cDecimalPoint; - WCHAR cDigitSeparator; - WCHAR cCurrencyLocal; - WCHAR cCurrencyLocal2; - WCHAR cCurrencyDecimalPoint; - WCHAR cCurrencyDigitSeparator; -} VARIANT_NUMBER_CHARS; - unsigned int get_type_size(ULONG*, VARTYPE) DECLSPEC_HIDDEN; HRESULT VARIANT_ClearInd(VARIANTARG *) DECLSPEC_HIDDEN; BOOL get_date_format(LCID, DWORD, const SYSTEMTIME *,
1
0
0
0
Francois Gouget : user32/tests: GetClipboardData() returns no error for missing formats.
by Alexandre Julliard
09 Aug '21
09 Aug '21
Module: wine Branch: master Commit: 9bd3e3fbe9c4fdee5e542b7f64f94af4038d4218 URL:
https://source.winehq.org/git/wine.git/?a=commit;h=9bd3e3fbe9c4fdee5e542b7f…
Author: Francois Gouget <fgouget(a)codeweavers.com> Date: Sun Aug 8 00:48:28 2021 +0200 user32/tests: GetClipboardData() returns no error for missing formats. Despite the documentation that says if GetClipboardData() returns NULL one can check GetLastError() to know why! Signed-off-by: Francois Gouget <fgouget(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/user32/clipboard.c | 1 + dlls/user32/tests/clipboard.c | 5 +++++ 2 files changed, 6 insertions(+) diff --git a/dlls/user32/clipboard.c b/dlls/user32/clipboard.c index e8de7d9bdf6..a13085719a9 100644 --- a/dlls/user32/clipboard.c +++ b/dlls/user32/clipboard.c @@ -1070,6 +1070,7 @@ HANDLE WINAPI GetClipboardData( UINT format ) GlobalFree( data ); if (status == STATUS_BUFFER_OVERFLOW) continue; /* retry with the new size */ + if (status == STATUS_OBJECT_NAME_NOT_FOUND) return 0; /* no such format */ if (status) { SetLastError( RtlNtStatusToDosError( status )); diff --git a/dlls/user32/tests/clipboard.c b/dlls/user32/tests/clipboard.c index b10ffaf4c8f..f351a6a29a8 100644 --- a/dlls/user32/tests/clipboard.c +++ b/dlls/user32/tests/clipboard.c @@ -1543,6 +1543,11 @@ static void test_handles( HWND hwnd ) data = GetClipboardData( 0xdeadfade ); ok( data == ptr, "wrong data %p\n", data ); + SetLastError( 0xdeadbeef ); + data = GetClipboardData( CF_RIFF ); + ok( GetLastError() == 0xdeadbeef, "unexpected last error %d\n", GetLastError() ); + ok( !data, "wrong data %p\n", data ); + h = SetClipboardData( CF_PRIVATEFIRST + 7, htext4 ); ok( h == htext4, "got %p\n", h ); ok( is_moveable( h ), "expected moveable mem %p\n", h );
1
0
0
0
Francois Gouget : user32/tests: Use wine_dbgstr_a() instead of %.8s.
by Alexandre Julliard
09 Aug '21
09 Aug '21
Module: wine Branch: master Commit: 1b36c218216cf7cd7793be7973efa882bac8cadd URL:
https://source.winehq.org/git/wine.git/?a=commit;h=1b36c218216cf7cd7793be79…
Author: Francois Gouget <fgouget(a)codeweavers.com> Date: Sun Aug 8 00:46:38 2021 +0200 user32/tests: Use wine_dbgstr_a() instead of %.8s. This should better handle NULL pointers and bad strings. Signed-off-by: Francois Gouget <fgouget(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/user32/tests/clipboard.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dlls/user32/tests/clipboard.c b/dlls/user32/tests/clipboard.c index c8de860f8cc..b10ffaf4c8f 100644 --- a/dlls/user32/tests/clipboard.c +++ b/dlls/user32/tests/clipboard.c @@ -1927,7 +1927,7 @@ static void test_data_handles(void) ok( is_fixed( h ), "expected fixed mem %p\n", h ); ok( is_moveable( text ), "expected moveable mem %p\n", text ); ptr = GlobalLock( h ); - ok( !strcmp( ptr, "foobar" ), "wrong data '%.8s'\n", ptr ); + ok( ptr && !strcmp( ptr, "foobar" ), "wrong data %s\n", wine_dbgstr_a(ptr) ); GlobalUnlock( h ); r = EmptyClipboard();
1
0
0
0
Paul Gofman : jscript: Also add function name to its detached scope in ES5 mode.
by Alexandre Julliard
09 Aug '21
09 Aug '21
Module: wine Branch: master Commit: c6a75d49369f7ae262ffbb054c9b27525f5bc406 URL:
https://source.winehq.org/git/wine.git/?a=commit;h=c6a75d49369f7ae262ffbb05…
Author: Paul Gofman <pgofman(a)codeweavers.com> Date: Mon Aug 9 16:55:41 2021 +0300 jscript: Also add function name to its detached scope in ES5 mode. Signed-off-by: Paul Gofman <pgofman(a)codeweavers.com> Signed-off-by: Jacek Caban <jacek(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/jscript/engine.c | 4 ++++ dlls/mshtml/tests/es5.js | 29 +++++++++++++++++++++++++++++ 2 files changed, 33 insertions(+) diff --git a/dlls/jscript/engine.c b/dlls/jscript/engine.c index cb9ea5cd9ac..47b4e56e8e4 100644 --- a/dlls/jscript/engine.c +++ b/dlls/jscript/engine.c @@ -573,6 +573,7 @@ HRESULT jsval_strict_equal(jsval_t lval, jsval_t rval, BOOL *ret) static HRESULT detach_scope(script_ctx_t *ctx, call_frame_t *frame, scope_chain_t *scope) { + function_code_t *func = frame->function; unsigned int i, index; HRESULT hres; @@ -591,6 +592,9 @@ static HRESULT detach_scope(script_ctx_t *ctx, call_frame_t *frame, scope_chain_ scope->obj = to_disp(scope->jsobj); } + if (scope == frame->base_scope && func->name && ctx->version >= SCRIPTLANGUAGEVERSION_ES5) + jsdisp_propput_name(scope->jsobj, func->name, jsval_obj(jsdisp_addref(frame->function_instance))); + index = scope->scope_index; for(i = 0; i < frame->function->local_scopes[index].locals_cnt; i++) { diff --git a/dlls/mshtml/tests/es5.js b/dlls/mshtml/tests/es5.js index e57aed5ca35..81c06a4145e 100644 --- a/dlls/mshtml/tests/es5.js +++ b/dlls/mshtml/tests/es5.js @@ -1447,6 +1447,35 @@ sync_test("functions scope", function() { val = with_function(); ok(val == 8, "val != 8"); ok(w == 9, "w != 9"); + + var func, func_outer, ret; + var o = new Object(); + + func_outer = function e() + { + function func_inner() + { + ok(typeof e == "function", "typeof e == " + typeof e); + ret = e + } + func = func_inner + } + func_outer(); + func(); + ok(ret === func_outer, "ret != func_outer"); + + func_outer = function f(f) + { + function func_inner() + { + ok(typeof f == "object", "typeof f == " + typeof f); + ret = f + } + func = func_inner + } + func_outer(o); + func(); + ok(ret === o, "ret != o"); }); sync_test("console", function() {
1
0
0
0
Alex Henrie : tapi32: Add lineGetTranslateCapsW stub.
by Alexandre Julliard
09 Aug '21
09 Aug '21
Module: wine Branch: master Commit: cdee7c9cd5ebf56bf153ad64597ee1c96aeec794 URL:
https://source.winehq.org/git/wine.git/?a=commit;h=cdee7c9cd5ebf56bf153ad64…
Author: Alex Henrie <alexhenrie24(a)gmail.com> Date: Sun Aug 8 22:31:55 2021 -0600 tapi32: Add lineGetTranslateCapsW stub. Wine-Bug:
https://bugs.winehq.org/show_bug.cgi?id=38585
Signed-off-by: Alex Henrie <alexhenrie24(a)gmail.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/tapi32/line.c | 9 +++++++++ dlls/tapi32/tapi32.spec | 1 + 2 files changed, 10 insertions(+) diff --git a/dlls/tapi32/line.c b/dlls/tapi32/line.c index a44ac1a1a72..0df9746084b 100644 --- a/dlls/tapi32/line.c +++ b/dlls/tapi32/line.c @@ -751,6 +751,15 @@ DWORD WINAPI lineGetStatusMessages(HLINE hLine, LPDWORD lpdwLineStatus, LPDWORD return 0; } +/*********************************************************************** + * lineGetTranslateCapsW (TAPI32.@) + */ +DWORD WINAPI lineGetTranslateCapsW(HLINEAPP line_app, DWORD api_version, LINETRANSLATECAPS *caps) +{ + FIXME("(%p, %08x, %p): stub.\n", line_app, api_version, caps); + return LINEERR_OPERATIONFAILED; +} + /*********************************************************************** * lineGetTranslateCaps (TAPI32.@) * diff --git a/dlls/tapi32/tapi32.spec b/dlls/tapi32/tapi32.spec index 62631efe236..6c01a870479 100644 --- a/dlls/tapi32/tapi32.spec +++ b/dlls/tapi32/tapi32.spec @@ -67,6 +67,7 @@ @ stdcall lineGetStatusMessages(long ptr ptr) @ stdcall lineGetTranslateCaps(long long ptr) lineGetTranslateCapsA @ stdcall lineGetTranslateCapsA(long long ptr) +@ stdcall lineGetTranslateCapsW(ptr long ptr) @ stdcall lineHandoff(long str long) lineHandoffA @ stdcall lineHandoffA(long str long) @ stdcall lineHold(long)
1
0
0
0
Alex Henrie : include: Add IPV6_HOPOPTS and IPV6_GET_IFLIST.
by Alexandre Julliard
09 Aug '21
09 Aug '21
Module: wine Branch: master Commit: cf74090cbdcf29928e5681e1cc0bb5151eb4205d URL:
https://source.winehq.org/git/wine.git/?a=commit;h=cf74090cbdcf29928e5681e1…
Author: Alex Henrie <alexhenrie24(a)gmail.com> Date: Sun Aug 8 21:44:04 2021 -0600 include: Add IPV6_HOPOPTS and IPV6_GET_IFLIST. Signed-off-by: Alex Henrie <alexhenrie24(a)gmail.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- include/ws2ipdef.h | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/include/ws2ipdef.h b/include/ws2ipdef.h index 3025a9c6fe9..0344a193dc1 100644 --- a/include/ws2ipdef.h +++ b/include/ws2ipdef.h @@ -214,6 +214,7 @@ typedef struct WS(in6_pktinfo) { #ifndef USE_WS_PREFIX #define IPV6_OPTIONS 1 +#define IPV6_HOPOPTS 1 #define IPV6_HDRINCL 2 #define IPV6_UNICAST_HOPS 4 #define IPV6_MULTICAST_IF 9 @@ -236,6 +237,7 @@ typedef struct WS(in6_pktinfo) { #define IPV6_DEL_IFLIST 30 #define IPV6_UNICAST_IF 31 #define IPV6_RTHDR 32 +#define IPV6_GET_IFLIST 33 #define IPV6_RECVRTHDR 38 #define IPV6_TCLASS 39 #define IPV6_RECVTCLASS 40 @@ -250,6 +252,7 @@ typedef struct WS(in6_pktinfo) { #define IPV6_USER_MTU 76 #else #define WS_IPV6_OPTIONS 1 +#define WS_IPV6_HOPOPTS 1 #define WS_IPV6_HDRINCL 2 #define WS_IPV6_UNICAST_HOPS 4 #define WS_IPV6_MULTICAST_IF 9 @@ -271,6 +274,7 @@ typedef struct WS(in6_pktinfo) { #define WS_IPV6_DEL_IFLIST 30 #define WS_IPV6_UNICAST_IF 31 #define WS_IPV6_RTHDR 32 +#define WS_IPV6_GET_IFLIST 33 #define WS_IPV6_RECVRTHDR 38 #define WS_IPV6_TCLASS 39 #define WS_IPV6_RECVTCLASS 40
1
0
0
0
Alex Henrie : include: Add remaining IPv4 socket options.
by Alexandre Julliard
09 Aug '21
09 Aug '21
Module: wine Branch: master Commit: efb050284ae7a94b2b4f95399b6360151811c660 URL:
https://source.winehq.org/git/wine.git/?a=commit;h=efb050284ae7a94b2b4f9539…
Author: Alex Henrie <alexhenrie24(a)gmail.com> Date: Sun Aug 8 21:44:03 2021 -0600 include: Add remaining IPv4 socket options. Signed-off-by: Alex Henrie <alexhenrie24(a)gmail.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- include/ws2ipdef.h | 30 ++++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) diff --git a/include/ws2ipdef.h b/include/ws2ipdef.h index d5a4dab6ce0..3025a9c6fe9 100644 --- a/include/ws2ipdef.h +++ b/include/ws2ipdef.h @@ -83,6 +83,7 @@ typedef struct _INTERFACE_INFO #define IP_UNBLOCK_SOURCE 18 #define IP_PKTINFO 19 #define IP_HOPLIMIT 21 +#define IP_RECVTTL 21 #define IP_RECEIVE_BROADCAST 22 #define IP_RECVIF 24 #define IP_RECVDSTADDR 25 @@ -91,7 +92,21 @@ typedef struct _INTERFACE_INFO #define IP_DEL_IFLIST 30 #define IP_UNICAST_IF 31 #define IP_RTHDR 32 +#define IP_GET_IFLIST 33 #define IP_RECVRTHDR 38 +#define IP_TCLASS 39 +#define IP_RECVTCLASS 40 +#define IP_RECVTOS 40 +#define IP_ORIGINAL_ARRIVAL_IF 47 +#define IP_ECN 50 +#define IP_PKTINFO_EX 51 +#define IP_WFP_REDIRECT_RECORDS 60 +#define IP_WFP_REDIRECT_CONTEXT 70 +#define IP_MTU_DISCOVER 71 +#define IP_MTU 73 +#define IP_NRT_INTERFACE 74 +#define IP_RECVERR 75 +#define IP_USER_MTU 76 #else #define WS_IP_OPTIONS 1 #define WS_IP_HDRINCL 2 @@ -109,6 +124,7 @@ typedef struct _INTERFACE_INFO #define WS_IP_UNBLOCK_SOURCE 18 #define WS_IP_PKTINFO 19 #define WS_IP_HOPLIMIT 21 +#define WS_IP_RECVTTL 21 #define WS_IP_RECEIVE_BROADCAST 22 #define WS_IP_RECVIF 24 #define WS_IP_RECVDSTADDR 25 @@ -117,7 +133,21 @@ typedef struct _INTERFACE_INFO #define WS_IP_DEL_IFLIST 30 #define WS_IP_UNICAST_IF 31 #define WS_IP_RTHDR 32 +#define WS_IP_GET_IFLIST 33 #define WS_IP_RECVRTHDR 38 +#define WS_IP_TCLASS 39 +#define WS_IP_RECVTCLASS 40 +#define WS_IP_RECVTOS 40 +#define WS_IP_ORIGINAL_ARRIVAL_IF 47 +#define WS_IP_ECN 50 +#define WS_IP_PKTINFO_EX 51 +#define WS_IP_WFP_REDIRECT_RECORDS 60 +#define WS_IP_WFP_REDIRECT_CONTEXT 70 +#define WS_IP_MTU_DISCOVER 71 +#define WS_IP_MTU 73 +#define WS_IP_NRT_INTERFACE 74 +#define WS_IP_RECVERR 75 +#define WS_IP_USER_MTU 76 #endif /* USE_WS_PREFIX */ typedef struct WS(sockaddr_in6)
1
0
0
0
Hugh McMaster : kernel32/tests: Fix rounding error when calculating console font size.
by Alexandre Julliard
09 Aug '21
09 Aug '21
Module: wine Branch: master Commit: 9ce8aafdae85be6e79c152f7118d8204becae10b URL:
https://source.winehq.org/git/wine.git/?a=commit;h=9ce8aafdae85be6e79c152f7…
Author: Hugh McMaster <hugh.mcmaster(a)outlook.com> Date: Mon Aug 9 23:27:45 2021 +1000 kernel32/tests: Fix rounding error when calculating console font size. Signed-off-by: Hugh McMaster <hugh.mcmaster(a)outlook.com> Signed-off-by: Jacek Caban <jacek(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/kernel32/tests/console.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/dlls/kernel32/tests/console.c b/dlls/kernel32/tests/console.c index 6ee00aa49a6..bd5cad428bc 100644 --- a/dlls/kernel32/tests/console.c +++ b/dlls/kernel32/tests/console.c @@ -3579,8 +3579,8 @@ static void test_GetConsoleFontSize(HANDLE std_output) ok(GetLastError() == 0xdeadbeef, "got %u, expected 0xdeadbeef\n", GetLastError()); GetClientRect(GetConsoleWindow(), &r); GetConsoleScreenBufferInfo(std_output, &csbi); - font_width = (r.right - r.left + 1) / csbi.srWindow.Right; - font_height = (r.bottom - r.top + 1) / csbi.srWindow.Bottom; + font_width = (r.right - r.left) / (csbi.srWindow.Right - csbi.srWindow.Left + 1); + font_height = (r.bottom - r.top) / (csbi.srWindow.Bottom - csbi.srWindow.Top + 1); ok(c.X == font_width, "got %d, expected %d\n", c.X, font_width); ok(c.Y == font_height, "got %d, expected %d\n", c.Y, font_height);
1
0
0
0
Hugh McMaster : conhost: Use correct size when storing font FaceName in the registry.
by Alexandre Julliard
09 Aug '21
09 Aug '21
Module: wine Branch: master Commit: bd9db4b6de30bbbb8c357f7401ae609c3a688c2e URL:
https://source.winehq.org/git/wine.git/?a=commit;h=bd9db4b6de30bbbb8c357f74…
Author: Hugh McMaster <hugh.mcmaster(a)outlook.com> Date: Mon Aug 9 21:52:29 2021 +1000 conhost: Use correct size when storing font FaceName in the registry. Signed-off-by: Hugh McMaster <hugh.mcmaster(a)outlook.com> Signed-off-by: Jacek Caban <jacek(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- programs/conhost/window.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/programs/conhost/window.c b/programs/conhost/window.c index 4033eefa313..5881ad9c3ad 100644 --- a/programs/conhost/window.c +++ b/programs/conhost/window.c @@ -303,7 +303,8 @@ static void save_registry_key( HKEY key, const struct console_config *config ) val = config->edition_mode; RegSetValueExW( key, L"EditionMode", 0, REG_DWORD, (BYTE *)&val, sizeof(val) ); - RegSetValueExW( key, L"FaceName", 0, REG_SZ, (BYTE *)&config->face_name, sizeof(config->face_name) ); + RegSetValueExW( key, L"FaceName", 0, REG_SZ, (BYTE *)&config->face_name, + (lstrlenW(config->face_name) + 1) * sizeof(WCHAR) ); val = config->font_pitch_family; RegSetValueExW( key, L"FontPitchFamily", 0, REG_DWORD, (BYTE *)&val, sizeof(val) );
1
0
0
0
← Newer
1
...
75
76
77
78
79
80
81
...
106
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
Results per page:
10
25
50
100
200