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
February 2020
----- 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
874 discussions
Start a n
N
ew thread
Alistair Leslie-Hughes : include: Add more x3daudio defines.
by Alexandre Julliard
10 Feb '20
10 Feb '20
Module: wine Branch: master Commit: ec86f3eb00de14f17759b53a0e65b4db7b09ea25 URL:
https://source.winehq.org/git/wine.git/?a=commit;h=ec86f3eb00de14f17759b53a…
Author: Alistair Leslie-Hughes <leslie_alistair(a)hotmail.com> Date: Fri Feb 7 00:41:03 2020 +0000 include: Add more x3daudio defines. Signed-off-by: Alistair Leslie-Hughes <leslie_alistair(a)hotmail.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- include/x3daudio.h | 45 +++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 45 insertions(+) diff --git a/include/x3daudio.h b/include/x3daudio.h index 0fd9a30092..26e2d1df72 100644 --- a/include/x3daudio.h +++ b/include/x3daudio.h @@ -97,6 +97,51 @@ typedef struct X3DAUDIO_DSP_SETTINGS { #define X3DAUDIO_CALCULATE_ZEROCENTER 0x00010000 #define X3DAUDIO_CALCULATE_REDIRECT_TO_LFE 0x00020000 +#ifndef _SPEAKER_POSITIONS_ +#define _SPEAKER_POSITIONS_ +#define SPEAKER_FRONT_LEFT 0x00000001 +#define SPEAKER_FRONT_RIGHT 0x00000002 +#define SPEAKER_FRONT_CENTER 0x00000004 +#define SPEAKER_LOW_FREQUENCY 0x00000008 +#define SPEAKER_BACK_LEFT 0x00000010 +#define SPEAKER_BACK_RIGHT 0x00000020 +#define SPEAKER_FRONT_LEFT_OF_CENTER 0x00000040 +#define SPEAKER_FRONT_RIGHT_OF_CENTER 0x00000080 +#define SPEAKER_BACK_CENTER 0x00000100 +#define SPEAKER_SIDE_LEFT 0x00000200 +#define SPEAKER_SIDE_RIGHT 0x00000400 +#define SPEAKER_TOP_CENTER 0x00000800 +#define SPEAKER_TOP_FRONT_LEFT 0x00001000 +#define SPEAKER_TOP_FRONT_CENTER 0x00002000 +#define SPEAKER_TOP_FRONT_RIGHT 0x00004000 +#define SPEAKER_TOP_BACK_LEFT 0x00008000 +#define SPEAKER_TOP_BACK_CENTER 0x00010000 +#define SPEAKER_TOP_BACK_RIGHT 0x00020000 +#define SPEAKER_RESERVED 0x7ffc0000 +#define SPEAKER_ALL 0x80000000 +#endif + +#ifndef SPEAKER_MONO +#define SPEAKER_MONO SPEAKER_FRONT_CENTER +#define SPEAKER_STEREO (SPEAKER_FRONT_LEFT | SPEAKER_FRONT_RIGHT) +#define SPEAKER_2POINT1 (SPEAKER_FRONT_LEFT | SPEAKER_FRONT_RIGHT | SPEAKER_LOW_FREQUENCY) +#define SPEAKER_SURROUND (SPEAKER_FRONT_LEFT | SPEAKER_FRONT_RIGHT | SPEAKER_FRONT_CENTER | SPEAKER_BACK_CENTER) +#define SPEAKER_QUAD (SPEAKER_FRONT_LEFT | SPEAKER_FRONT_RIGHT | SPEAKER_BACK_LEFT | SPEAKER_BACK_RIGHT) +#define SPEAKER_4POINT1 (SPEAKER_FRONT_LEFT | SPEAKER_FRONT_RIGHT | SPEAKER_LOW_FREQUENCY | SPEAKER_BACK_LEFT | \ + SPEAKER_BACK_RIGHT) +#define SPEAKER_5POINT1 (SPEAKER_FRONT_LEFT | SPEAKER_FRONT_RIGHT | SPEAKER_FRONT_CENTER | SPEAKER_LOW_FREQUENCY | \ + SPEAKER_BACK_LEFT | SPEAKER_BACK_RIGHT) +#define SPEAKER_7POINT1 (SPEAKER_FRONT_LEFT | SPEAKER_FRONT_RIGHT | SPEAKER_FRONT_CENTER | SPEAKER_LOW_FREQUENCY | \ + SPEAKER_BACK_LEFT | SPEAKER_BACK_RIGHT | SPEAKER_FRONT_LEFT_OF_CENTER | \ + SPEAKER_FRONT_RIGHT_OF_CENTER) +#define SPEAKER_5POINT1_SURROUND (SPEAKER_FRONT_LEFT | SPEAKER_FRONT_RIGHT | SPEAKER_FRONT_CENTER | SPEAKER_LOW_FREQUENCY | \ + SPEAKER_SIDE_LEFT | SPEAKER_SIDE_RIGHT) +#define SPEAKER_7POINT1_SURROUND (SPEAKER_FRONT_LEFT | SPEAKER_FRONT_RIGHT | SPEAKER_FRONT_CENTER | SPEAKER_LOW_FREQUENCY | \ + SPEAKER_BACK_LEFT | SPEAKER_BACK_RIGHT | SPEAKER_SIDE_LEFT | SPEAKER_SIDE_RIGHT) +#endif + +#define X3DAUDIO_SPEED_OF_SOUND 343.5f + #define X3DAUDIO_HANDLE_BYTESIZE 20 typedef BYTE X3DAUDIO_HANDLE[X3DAUDIO_HANDLE_BYTESIZE];
1
0
0
0
Daniel Lehman : crypt32: Implement CryptBinaryToStringW(HEXRAW).
by Alexandre Julliard
10 Feb '20
10 Feb '20
Module: wine Branch: master Commit: f92581ee82117220bdacaeebba5e8f1eae93274f URL:
https://source.winehq.org/git/wine.git/?a=commit;h=f92581ee82117220bdacaeeb…
Author: Daniel Lehman <dlehman(a)esri.com> Date: Fri Jan 24 07:05:08 2020 -0800 crypt32: Implement CryptBinaryToStringW(HEXRAW). Signed-off-by: Daniel Lehman <dlehman(a)esri.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/crypt32/base64.c | 46 +++++++++++++++++++++++++ dlls/crypt32/tests/base64.c | 82 ++++++++++++++++++++++++++++++++++++++++++++- 2 files changed, 127 insertions(+), 1 deletion(-) diff --git a/dlls/crypt32/base64.c b/dlls/crypt32/base64.c index ac60c6efbd..221b452d7e 100644 --- a/dlls/crypt32/base64.c +++ b/dlls/crypt32/base64.c @@ -477,6 +477,49 @@ static BOOL BinaryToBase64W(const BYTE *pbBinary, return ret; } +static BOOL BinaryToHexW(const BYTE *bin, DWORD nbin, DWORD flags, LPWSTR str, DWORD *nstr) +{ + static const WCHAR hex[] = {'0','1','2','3','4','5','6','7','8','9','a','b','c','d','e','f'}; + DWORD needed; + + if (flags & CRYPT_STRING_NOCRLF) + needed = 0; + else if (flags & CRYPT_STRING_NOCR) + needed = 1; + else + needed = 2; + + needed += nbin * 2 + 1; + if (needed > *nstr) + { + SetLastError(ERROR_MORE_DATA); + return FALSE; + } + + *nstr = needed; + if (!str) + return TRUE; + + while (nbin--) + { + *str++ = hex[(*bin >> 4) & 0xf]; + *str++ = hex[*bin & 0xf]; + bin++; + } + + if (flags & CRYPT_STRING_NOCR) + *str++ = '\n'; + else if (!(flags & CRYPT_STRING_NOCRLF)) + { + *str++ = '\r'; + *str++ = '\n'; + } + + *str = 0; + *nstr = needed - 1; + return TRUE; +} + BOOL WINAPI CryptBinaryToStringW(const BYTE *pbBinary, DWORD cbBinary, DWORD dwFlags, LPWSTR pszString, DWORD *pcchString) { @@ -507,6 +550,9 @@ BOOL WINAPI CryptBinaryToStringW(const BYTE *pbBinary, case CRYPT_STRING_BASE64X509CRLHEADER: encoder = BinaryToBase64W; break; + case CRYPT_STRING_HEXRAW: + encoder = BinaryToHexW; + break; case CRYPT_STRING_HEX: case CRYPT_STRING_HEXASCII: case CRYPT_STRING_HEXADDR: diff --git a/dlls/crypt32/tests/base64.c b/dlls/crypt32/tests/base64.c index 31605fe6b9..ac41d5c86d 100644 --- a/dlls/crypt32/tests/base64.c +++ b/dlls/crypt32/tests/base64.c @@ -238,7 +238,12 @@ static void encode_compare_base64_W(const BYTE *toEncode, DWORD toEncodeLen, DWO static void test_CryptBinaryToString(void) { - DWORD strLen, strLen2, i; + static const DWORD flags[] = { 0, CRYPT_STRING_NOCR, CRYPT_STRING_NOCRLF }; + static const WCHAR hexdig[] = L"0123456789abcdef"; + OSVERSIONINFOA ver = { sizeof(ver) }; + BYTE input[256 * sizeof(WCHAR)]; + DWORD strLen, strLen2, i, j; + WCHAR *hex, *cmp, *ptr; BOOL ret; ret = CryptBinaryToStringA(NULL, 0, 0, NULL, NULL); @@ -357,6 +362,81 @@ static void test_CryptBinaryToString(void) heap_free(encodedW); } + + /* winxp and win2k3 are documented as not handling HEXRAW but do not return failure */ + GetVersionExA(&ver); + if (ver.dwMajorVersion <= 5) + { + win_skip("CryptBinaryToString(HEX) not supported\n"); + return; + } + + for (i = 0; i < sizeof(input) / sizeof(WCHAR); i++) + ((WCHAR *)input)[i] = i; + + for (i = 0; i < ARRAY_SIZE(flags); i++) + { + strLen = ~0; + ret = CryptBinaryToStringW(input, sizeof(input), CRYPT_STRING_HEXRAW|flags[i], + NULL, &strLen); + ok(ret, "CryptBinaryToStringW failed: %d\n", GetLastError()); + if (flags[i] & CRYPT_STRING_NOCRLF) + strLen2 = 0; + else if (flags[i] & CRYPT_STRING_NOCR) + strLen2 = 1; + else + strLen2 = 2; + strLen2 += sizeof(input) * 2 + 1; + ok(strLen == strLen2, "Expected length %d, got %d\n", strLen2, strLen); + + hex = heap_alloc(strLen * sizeof(WCHAR)); + memset(hex, 0xcc, strLen * sizeof(WCHAR)); + ptr = cmp = heap_alloc(strLen * sizeof(WCHAR)); + for (j = 0; j < ARRAY_SIZE(input); j++) + { + *ptr++ = hexdig[(input[j] >> 4) & 0xf]; + *ptr++ = hexdig[input[j] & 0xf]; + } + if (flags[i] & CRYPT_STRING_NOCR) + { + *ptr++ = '\n'; + } + else if (!(flags[i] & CRYPT_STRING_NOCRLF)) + { + *ptr++ = '\r'; + *ptr++ = '\n'; + } + *ptr++ = 0; + ret = CryptBinaryToStringW(input, sizeof(input), CRYPT_STRING_HEXRAW|flags[i], + hex, &strLen); + ok(ret, "CryptBinaryToStringW failed: %d\n", GetLastError()); + strLen2--; + ok(strLen == strLen2, "Expected length %d, got %d\n", strLen, strLen2); + ok(!memcmp(hex, cmp, strLen * sizeof(WCHAR)), "Unexpected value\n"); + + /* adjusts size if buffer too big */ + strLen *= 2; + ret = CryptBinaryToStringW(input, sizeof(input), CRYPT_STRING_HEXRAW|flags[i], + hex, &strLen); + ok(ret, "CryptBinaryToStringW failed: %d\n", GetLastError()); + ok(strLen == strLen2, "Expected length %d, got %d\n", strLen, strLen2); + + /* no writes if buffer too small */ + strLen /= 2; + strLen2 /= 2; + memset(hex, 0xcc, strLen * sizeof(WCHAR)); + memset(cmp, 0xcc, strLen * sizeof(WCHAR)); + SetLastError(0xdeadbeef); + ret = CryptBinaryToStringW(input, sizeof(input), CRYPT_STRING_HEXRAW|flags[i], + hex, &strLen); + ok(!ret && GetLastError() == ERROR_MORE_DATA,"Expected ERROR_MORE_DATA, got ret=%d le=%u\n", + ret, GetLastError()); + ok(strLen == strLen2, "Expected length %d, got %d\n", strLen, strLen2); + ok(!memcmp(hex, cmp, strLen * sizeof(WCHAR)), "Unexpected value\n"); + + heap_free(hex); + heap_free(cmp); + } } static void decodeAndCompareBase64_A(LPCSTR toDecode, LPCSTR header,
1
0
0
0
Akihiro Sagawa : shlwapi: Fix wnsprintfW/wvnsprintfW %S conversion.
by Alexandre Julliard
10 Feb '20
10 Feb '20
Module: wine Branch: master Commit: 6f8ae18cd78f4779dc459664fe53777e63391363 URL:
https://source.winehq.org/git/wine.git/?a=commit;h=6f8ae18cd78f4779dc459664…
Author: Akihiro Sagawa <sagawa.aki(a)gmail.com> Date: Sun Feb 9 20:51:38 2020 +0900 shlwapi: Fix wnsprintfW/wvnsprintfW %S conversion. Signed-off-by: Akihiro Sagawa <sagawa.aki(a)gmail.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/shlwapi/wsprintf.c | 27 ++++++++++++++++++++++++--- 1 file changed, 24 insertions(+), 3 deletions(-) diff --git a/dlls/shlwapi/wsprintf.c b/dlls/shlwapi/wsprintf.c index 9d4088cc25..f2e5f0ace1 100644 --- a/dlls/shlwapi/wsprintf.c +++ b/dlls/shlwapi/wsprintf.c @@ -258,8 +258,22 @@ static UINT WPRINTF_GetLen( WPRINTF_FORMAT *format, WPRINTF_DATA *arg, return (format->precision = 1); case WPR_STRING: if (!arg->lpcstr_view) arg->lpcstr_view = null_stringA; - for (len = 0; !format->precision || (len < format->precision); len++) - if (!*(arg->lpcstr_view + len)) break; + if (dst_is_wide) + { + LPCSTR p = arg->lpcstr_view; + for (len = 0; (!format->precision || len < format->precision) && *p; p++) + { + /* This isn't applicable for UTF-8 and UTF-7 */ + if (IsDBCSLeadByte( *p )) p++; + len++; + if (!*p) break; + } + } + else + { + for (len = 0; !format->precision || (len < format->precision); len++) + if (!*(arg->lpcstr_view + len)) break; + } if (len > maxlen) len = maxlen; return (format->precision = len); case WPR_WSTRING: @@ -506,7 +520,14 @@ INT WINAPI wvnsprintfW( LPWSTR buffer, INT maxlen, LPCWSTR spec, __ms_va_list ar case WPR_STRING: { LPCSTR ptr = argData.lpcstr_view; - for (i = 0; i < len; i++) *p++ = (BYTE)*ptr++; + for (i = 0; i < len; i++) + { + WCHAR buf[2]; /* for LeadByte + NUL case, we need 2 WCHARs. */ + int ret, mb_len = IsDBCSLeadByte( *ptr ) ? 2 : 1; + ret = MultiByteToWideChar( CP_ACP, 0, ptr, mb_len, buf, ARRAY_SIZE( buf )); + *p++ = buf[ret - 1]; + ptr += mb_len; + } } break; case WPR_WSTRING:
1
0
0
0
Akihiro Sagawa : user32: Fix wsprintfW %S conversion.
by Alexandre Julliard
10 Feb '20
10 Feb '20
Module: wine Branch: master Commit: fa8a9a81e6a42a249f48c8b1073ebf9d5d79e9fd URL:
https://source.winehq.org/git/wine.git/?a=commit;h=fa8a9a81e6a42a249f48c8b1…
Author: Akihiro Sagawa <sagawa.aki(a)gmail.com> Date: Sun Feb 9 20:51:37 2020 +0900 user32: Fix wsprintfW %S conversion. Signed-off-by: Akihiro Sagawa <sagawa.aki(a)gmail.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/user32/tests/wsprintf.c | 3 +-- dlls/user32/wsprintf.c | 27 ++++++++++++++++++++++++--- 2 files changed, 25 insertions(+), 5 deletions(-) diff --git a/dlls/user32/tests/wsprintf.c b/dlls/user32/tests/wsprintf.c index e5317bdef0..c7be43a08f 100644 --- a/dlls/user32/tests/wsprintf.c +++ b/dlls/user32/tests/wsprintf.c @@ -188,12 +188,11 @@ static void wsprintfWTest(void) memset(buf, 0x11, sizeof(buf)); rc = wsprintfW(buf, testcase[i].fmt, testcase[i].input); - todo_wine_if (i == 2) ok(rc == testcase[i].rc, "%u: expected %d, got %d\n", i, testcase[i].rc, rc); - todo_wine ok(!memcmp(buf, testcase[i].str, (testcase[i].rc + 1) * sizeof(WCHAR)), + ok(!memcmp(buf, testcase[i].str, (testcase[i].rc + 1) * sizeof(WCHAR)), "%u: expected %s, got %s\n", i, wine_dbgstr_wn(testcase[i].str, testcase[i].rc + 1), wine_dbgstr_wn(buf, rc + 1)); diff --git a/dlls/user32/wsprintf.c b/dlls/user32/wsprintf.c index 478583d926..e5e6c10dbb 100644 --- a/dlls/user32/wsprintf.c +++ b/dlls/user32/wsprintf.c @@ -259,8 +259,22 @@ static UINT WPRINTF_GetLen( WPRINTF_FORMAT *format, WPRINTF_DATA *arg, return (format->precision = 1); case WPR_STRING: if (!arg->lpcstr_view) arg->lpcstr_view = null_stringA; - for (len = 0; !format->precision || (len < format->precision); len++) - if (!*(arg->lpcstr_view + len)) break; + if (dst_is_wide) + { + LPCSTR p = arg->lpcstr_view; + for (len = 0; (!format->precision || len < format->precision) && *p; p++) + { + /* This isn't applicable for UTF-8 and UTF-7 */ + if (IsDBCSLeadByte( *p )) p++; + len++; + if (!*p) break; + } + } + else + { + for (len = 0; !format->precision || (len < format->precision); len++) + if (!*(arg->lpcstr_view + len)) break; + } if (len > maxlen) len = maxlen; return (format->precision = len); case WPR_WSTRING: @@ -494,7 +508,14 @@ static INT wvsnprintfW( LPWSTR buffer, UINT maxlen, LPCWSTR spec, __ms_va_list a case WPR_STRING: { LPCSTR ptr = argData.lpcstr_view; - for (i = 0; i < len; i++) *p++ = (BYTE)*ptr++; + for (i = 0; i < len; i++) + { + WCHAR buf[2]; /* for LeadByte + NUL case, we need 2 WCHARs. */ + int ret, mb_len = IsDBCSLeadByte( *ptr ) ? 2 : 1; + ret = MultiByteToWideChar( CP_ACP, 0, ptr, mb_len, buf, ARRAY_SIZE( buf )); + *p++ = buf[ret - 1]; + ptr += mb_len; + } } break; case WPR_WSTRING:
1
0
0
0
Akihiro Sagawa : user32/tests: Add wsprintfW %S conversion tests.
by Alexandre Julliard
10 Feb '20
10 Feb '20
Module: wine Branch: master Commit: c8f46313e4e2eae91d55654b3c972ea76aabf7e4 URL:
https://source.winehq.org/git/wine.git/?a=commit;h=c8f46313e4e2eae91d55654b…
Author: Akihiro Sagawa <sagawa.aki(a)gmail.com> Date: Sun Feb 9 20:51:35 2020 +0900 user32/tests: Add wsprintfW %S conversion tests. Signed-off-by: Akihiro Sagawa <sagawa.aki(a)gmail.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/user32/tests/wsprintf.c | 48 ++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 48 insertions(+) diff --git a/dlls/user32/tests/wsprintf.c b/dlls/user32/tests/wsprintf.c index ab4f4dae04..e5317bdef0 100644 --- a/dlls/user32/tests/wsprintf.c +++ b/dlls/user32/tests/wsprintf.c @@ -123,7 +123,25 @@ static void wsprintfWTest(void) static const WCHAR fmt_010ld[] = {'%','0','1','0','l','d','\0'}; static const WCHAR res_010ld[] = {'-','0','0','0','0','0','0','0','0','1', '\0'}; static const WCHAR fmt_I64x[] = {'%','I','6','4','x',0}; + static const WCHAR fmt_dot3S[] = {'%','.','3','S',0}; + static const WCHAR fmt__4S[] = {'%','-','4','S',0}; + static const WCHAR stars[] = {'*', 0x2606, 0x2605, 0}; + static const WCHAR nul_spc[] = {'*', 0, ' ', ' ', 0}; + WCHAR def_spc[] = {'*','?', 0x2605, ' ', 0}; WCHAR buf[25], fmt[25], res[25]; + char stars_mb[8], partial00[8], partialFF[8]; + const struct { + const char *input; + const WCHAR *fmt; + const WCHAR *str; + int rc; + } + testcase[] = { + { stars_mb, fmt_dot3S, stars, 3 }, + { partial00, fmt__4S, nul_spc, 4 }, + { partialFF, fmt__4S, def_spc, 4 }, + }; + CPINFOEXW cpinfoex; unsigned int i; int rc; @@ -150,6 +168,36 @@ static void wsprintfWTest(void) ok(rc == lstrlenW(res), "%u: wsprintfW length failure: rc=%d\n", i, rc); ok(!lstrcmpW(buf, res), "%u: wrong result [%s]\n", i, wine_dbgstr_w(buf)); } + + if (!GetCPInfoExW(CP_ACP, 0, &cpinfoex) || cpinfoex.MaxCharSize <= 1) + { + skip("Multi-byte wsprintfW test isn't available for the current codepage\n"); + return; + } + def_spc[1] = cpinfoex.UnicodeDefaultChar; + + rc = WideCharToMultiByte(CP_ACP, 0, stars, -1, stars_mb, sizeof(stars_mb), NULL, NULL); + ok(rc == 6, "expected 6, got %d\n", rc); + strcpy(partial00, stars_mb); + partial00[2] = '\0'; + strcpy(partialFF, stars_mb); + partialFF[2] = 0xff; + + for (i = 0; i < ARRAY_SIZE(testcase); i++) + { + memset(buf, 0x11, sizeof(buf)); + rc = wsprintfW(buf, testcase[i].fmt, testcase[i].input); + + todo_wine_if (i == 2) + ok(rc == testcase[i].rc, + "%u: expected %d, got %d\n", + i, testcase[i].rc, rc); + + todo_wine ok(!memcmp(buf, testcase[i].str, (testcase[i].rc + 1) * sizeof(WCHAR)), + "%u: expected %s, got %s\n", i, + wine_dbgstr_wn(testcase[i].str, testcase[i].rc + 1), + wine_dbgstr_wn(buf, rc + 1)); + } } /* Test if the CharUpper / CharLower functions return true 16 bit results,
1
0
0
0
Akihiro Sagawa : shlwapi: Fix wnsprintfA/wvnsprintfA %S conversion.
by Alexandre Julliard
10 Feb '20
10 Feb '20
Module: wine Branch: master Commit: 6c692dc1af1f3402079db2ced1bc4984dc2084d0 URL:
https://source.winehq.org/git/wine.git/?a=commit;h=6c692dc1af1f3402079db2ce…
Author: Akihiro Sagawa <sagawa.aki(a)gmail.com> Date: Sun Feb 9 20:51:33 2020 +0900 shlwapi: Fix wnsprintfA/wvnsprintfA %S conversion. Signed-off-by: Akihiro Sagawa <sagawa.aki(a)gmail.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/shlwapi/wsprintf.c | 30 ++++++++++++++++++++++++------ 1 file changed, 24 insertions(+), 6 deletions(-) diff --git a/dlls/shlwapi/wsprintf.c b/dlls/shlwapi/wsprintf.c index 6a36b6a28e..9d4088cc25 100644 --- a/dlls/shlwapi/wsprintf.c +++ b/dlls/shlwapi/wsprintf.c @@ -245,7 +245,7 @@ static INT WPRINTF_ParseFormatW( LPCWSTR format, WPRINTF_FORMAT *res ) * WPRINTF_GetLen */ static UINT WPRINTF_GetLen( WPRINTF_FORMAT *format, WPRINTF_DATA *arg, - LPSTR number, UINT maxlen ) + LPSTR number, UINT maxlen, BOOL dst_is_wide ) { UINT len; @@ -264,8 +264,18 @@ static UINT WPRINTF_GetLen( WPRINTF_FORMAT *format, WPRINTF_DATA *arg, return (format->precision = len); case WPR_WSTRING: if (!arg->lpcwstr_view) arg->lpcwstr_view = null_stringW; - for (len = 0; !format->precision || (len < format->precision); len++) - if (!*(arg->lpcwstr_view + len)) break; + if (dst_is_wide) + { + for (len = 0; !format->precision || (len < format->precision); len++) + if (!*(arg->lpcwstr_view + len)) break; + } + else + { + LPCWSTR p = arg->lpcwstr_view; + for (len = 0; (!format->precision || len < format->precision) && *p; p++) + len += WideCharToMultiByte( CP_ACP, 0, p, 1, NULL, 0, NULL, NULL ); + if (format->precision && len > format->precision) len = format->precision; + } if (len > maxlen) len = maxlen; return (format->precision = len); case WPR_SIGNED: @@ -365,7 +375,7 @@ INT WINAPI wvnsprintfA( LPSTR buffer, INT maxlen, LPCSTR spec, __ms_va_list args break; } - len = WPRINTF_GetLen( &format, &argData, number, maxlen - 1 ); + len = WPRINTF_GetLen( &format, &argData, number, maxlen - 1, FALSE ); sign = 0; if (!(format.flags & WPRINTF_LEFTALIGN)) for (i = format.precision; i < format.width; i++, maxlen--) @@ -385,7 +395,15 @@ INT WINAPI wvnsprintfA( LPSTR buffer, INT maxlen, LPCSTR spec, __ms_va_list args case WPR_WSTRING: { LPCWSTR ptr = argData.lpcwstr_view; - for (i = 0; i < len; i++) *p++ = (CHAR)*ptr++; + for (i = 0; i < len; ptr++) + { + CHAR mb[5]; /* 5 is MB_LEN_MAX */ + int ret = WideCharToMultiByte( CP_ACP, 0, ptr, 1, mb, sizeof(mb), NULL, NULL ); + i += ret; + if (i > len) ret = len - (p - buffer); + memcpy( p, mb, ret ); + p += ret; + } } break; case WPR_HEXA: @@ -472,7 +490,7 @@ INT WINAPI wvnsprintfW( LPWSTR buffer, INT maxlen, LPCWSTR spec, __ms_va_list ar break; } - len = WPRINTF_GetLen( &format, &argData, number, maxlen - 1 ); + len = WPRINTF_GetLen( &format, &argData, number, maxlen - 1, TRUE ); sign = 0; if (!(format.flags & WPRINTF_LEFTALIGN)) for (i = format.precision; i < format.width; i++, maxlen--)
1
0
0
0
Akihiro Sagawa : user32: Fix wsprintfA %S conversion.
by Alexandre Julliard
10 Feb '20
10 Feb '20
Module: wine Branch: master Commit: 08bf605acb4d319e016a7eafe0c675509445bd4a URL:
https://source.winehq.org/git/wine.git/?a=commit;h=08bf605acb4d319e016a7eaf…
Author: Akihiro Sagawa <sagawa.aki(a)gmail.com> Date: Sun Feb 9 20:51:31 2020 +0900 user32: Fix wsprintfA %S conversion. Signed-off-by: Akihiro Sagawa <sagawa.aki(a)gmail.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/user32/tests/wsprintf.c | 16 ++++++---------- dlls/user32/wsprintf.c | 31 +++++++++++++++++++++++++------ 2 files changed, 31 insertions(+), 16 deletions(-) diff --git a/dlls/user32/tests/wsprintf.c b/dlls/user32/tests/wsprintf.c index ca0c4802f9..ab4f4dae04 100644 --- a/dlls/user32/tests/wsprintf.c +++ b/dlls/user32/tests/wsprintf.c @@ -61,16 +61,14 @@ static void wsprintfATest(void) const char *fmt; const char *str; int rc; - BOOL todo_rc; - BOOL todo_str; } testcase[] = { - { starW, "%.1S", partial, 1, TRUE, TRUE }, - { starW, "%.2S", star, 2, FALSE, TRUE }, - { starW, "%.3S", star, 2, FALSE, TRUE }, - { fffeW, "%.1S", "?", 1, FALSE, TRUE }, - { fffeW, "%.2S", "?", 1, FALSE, TRUE }, - { wineW, "%.2S", "??", 2, FALSE, TRUE }, + { starW, "%.1S", partial, 1 }, + { starW, "%.2S", star, 2 }, + { starW, "%.3S", star, 2 }, + { fffeW, "%.1S", "?", 1 }, + { fffeW, "%.2S", "?", 1 }, + { wineW, "%.2S", "??", 2 }, { star, "%.1s", partial, 1 }, }; CPINFO cpinfo; @@ -110,12 +108,10 @@ static void wsprintfATest(void) memset(buf, 0x11, sizeof(buf)); rc = wsprintfA(buf, testcase[i].fmt, testcase[i].input); - todo_wine_if(testcase[i].todo_rc) ok(rc == testcase[i].rc, "%u: expected %d, got %d\n", i, testcase[i].rc, rc); - todo_wine_if(testcase[i].todo_str) ok(!strcmp(buf, testcase[i].str), "%u: expected %s, got %s\n", i, wine_dbgstr_a(testcase[i].str), wine_dbgstr_an(buf, rc)); diff --git a/dlls/user32/wsprintf.c b/dlls/user32/wsprintf.c index 17d39a4d17..478583d926 100644 --- a/dlls/user32/wsprintf.c +++ b/dlls/user32/wsprintf.c @@ -30,6 +30,7 @@ #include "winbase.h" #include "wingdi.h" #include "winuser.h" +#include "winnls.h" #include "wine/debug.h" @@ -245,7 +246,7 @@ static INT WPRINTF_ParseFormatW( LPCWSTR format, WPRINTF_FORMAT *res ) * WPRINTF_GetLen */ static UINT WPRINTF_GetLen( WPRINTF_FORMAT *format, WPRINTF_DATA *arg, - LPSTR number, UINT maxlen ) + LPSTR number, UINT maxlen, BOOL dst_is_wide ) { UINT len; @@ -264,8 +265,18 @@ static UINT WPRINTF_GetLen( WPRINTF_FORMAT *format, WPRINTF_DATA *arg, return (format->precision = len); case WPR_WSTRING: if (!arg->lpcwstr_view) arg->lpcwstr_view = null_stringW; - for (len = 0; !format->precision || (len < format->precision); len++) - if (!*(arg->lpcwstr_view + len)) break; + if (dst_is_wide) + { + for (len = 0; !format->precision || (len < format->precision); len++) + if (!*(arg->lpcwstr_view + len)) break; + } + else + { + LPCWSTR p = arg->lpcwstr_view; + for (len = 0; (!format->precision || len < format->precision) && *p; p++) + len += WideCharToMultiByte( CP_ACP, 0, p, 1, NULL, 0, NULL, NULL ); + if (format->precision && len > format->precision) len = format->precision; + } if (len > maxlen) len = maxlen; return (format->precision = len); case WPR_SIGNED: @@ -354,7 +365,7 @@ static INT wvsnprintfA( LPSTR buffer, UINT maxlen, LPCSTR spec, __ms_va_list arg break; } - len = WPRINTF_GetLen( &format, &argData, number, maxlen - 1 ); + len = WPRINTF_GetLen( &format, &argData, number, maxlen - 1, FALSE ); sign = 0; if (!(format.flags & WPRINTF_LEFTALIGN)) for (i = format.precision; i < format.width; i++, maxlen--) @@ -374,7 +385,15 @@ static INT wvsnprintfA( LPSTR buffer, UINT maxlen, LPCSTR spec, __ms_va_list arg case WPR_WSTRING: { LPCWSTR ptr = argData.lpcwstr_view; - for (i = 0; i < len; i++) *p++ = (CHAR)*ptr++; + for (i = 0; i < len; ptr++) + { + CHAR mb[5]; /* 5 is MB_LEN_MAX */ + int ret = WideCharToMultiByte( CP_ACP, 0, ptr, 1, mb, sizeof(mb), NULL, NULL ); + i += ret; + if (i > len) ret = len - (p - buffer); + memcpy( p, mb, ret ); + p += ret; + } } break; case WPR_HEXA: @@ -459,7 +478,7 @@ static INT wvsnprintfW( LPWSTR buffer, UINT maxlen, LPCWSTR spec, __ms_va_list a break; } - len = WPRINTF_GetLen( &format, &argData, number, maxlen - 1 ); + len = WPRINTF_GetLen( &format, &argData, number, maxlen - 1, TRUE ); sign = 0; if (!(format.flags & WPRINTF_LEFTALIGN)) for (i = format.precision; i < format.width; i++, maxlen--)
1
0
0
0
Akihiro Sagawa : user32/tests: Add wsprintfA %S conversion tests.
by Alexandre Julliard
10 Feb '20
10 Feb '20
Module: wine Branch: master Commit: e375f0d45784a880ddc9568d211bbe1c2ca847c9 URL:
https://source.winehq.org/git/wine.git/?a=commit;h=e375f0d45784a880ddc9568d…
Author: Akihiro Sagawa <sagawa.aki(a)gmail.com> Date: Sun Feb 9 20:51:29 2020 +0900 user32/tests: Add wsprintfA %S conversion tests. Signed-off-by: Akihiro Sagawa <sagawa.aki(a)gmail.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/user32/tests/wsprintf.c | 50 +++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 49 insertions(+), 1 deletion(-) diff --git a/dlls/user32/tests/wsprintf.c b/dlls/user32/tests/wsprintf.c index f79b6306a7..ca0c4802f9 100644 --- a/dlls/user32/tests/wsprintf.c +++ b/dlls/user32/tests/wsprintf.c @@ -52,7 +52,28 @@ static const struct static void wsprintfATest(void) { - char buf[25]; + char buf[25], star[4], partial[4]; + static const WCHAR starW[] = {0x2606, 0}; + static const WCHAR fffeW[] = {0xfffe, 0}; + static const WCHAR wineW[] = {0xd83c, 0xdf77, 0}; /* U+1F377: wine glass */ + const struct { + const void *input; + const char *fmt; + const char *str; + int rc; + BOOL todo_rc; + BOOL todo_str; + } + testcase[] = { + { starW, "%.1S", partial, 1, TRUE, TRUE }, + { starW, "%.2S", star, 2, FALSE, TRUE }, + { starW, "%.3S", star, 2, FALSE, TRUE }, + { fffeW, "%.1S", "?", 1, FALSE, TRUE }, + { fffeW, "%.2S", "?", 1, FALSE, TRUE }, + { wineW, "%.2S", "??", 2, FALSE, TRUE }, + { star, "%.1s", partial, 1 }, + }; + CPINFO cpinfo; unsigned int i; int rc; @@ -72,6 +93,33 @@ static void wsprintfATest(void) ok(rc == strlen(i64_formats[i].res), "%u: wsprintfA length failure: rc=%d\n", i, rc); ok(!strcmp(buf, i64_formats[i].res), "%u: wrong result [%s]\n", i, buf); } + + if (!GetCPInfo(CP_ACP, &cpinfo) || cpinfo.MaxCharSize <= 1) + { + skip("Multi-byte wsprintfA test isn't available for the current codepage\n"); + return; + } + + rc = WideCharToMultiByte(CP_ACP, 0, starW, -1, star, sizeof(star), NULL, NULL); + ok(rc == 3, "unexpected rc, got %d\n", rc); + partial[0] = star[0]; + partial[1] = '\0'; + + for (i = 0; i < ARRAY_SIZE(testcase); i++) + { + memset(buf, 0x11, sizeof(buf)); + rc = wsprintfA(buf, testcase[i].fmt, testcase[i].input); + + todo_wine_if(testcase[i].todo_rc) + ok(rc == testcase[i].rc, + "%u: expected %d, got %d\n", + i, testcase[i].rc, rc); + + todo_wine_if(testcase[i].todo_str) + ok(!strcmp(buf, testcase[i].str), + "%u: expected %s, got %s\n", + i, wine_dbgstr_a(testcase[i].str), wine_dbgstr_an(buf, rc)); + } } static void wsprintfWTest(void)
1
0
0
0
Francois Gouget : tests: Limit spam from todos, skips and traces when winetest_debug==1.
by Alexandre Julliard
10 Feb '20
10 Feb '20
Module: wine Branch: master Commit: e4dbd5670539698243e10fffc64fbdf5a44a7da6 URL:
https://source.winehq.org/git/wine.git/?a=commit;h=e4dbd5670539698243e10fff…
Author: Francois Gouget <fgouget(a)codeweavers.com> Date: Sun Feb 9 20:48:38 2020 +0100 tests: Limit spam from todos, skips and traces when winetest_debug==1. Some tests loop on system resources like fonts and issue todos, skips or even traces on every iteration. Depending on the machine configuration this can result in a lot of traces and push WineTest reports above the 1.5 MB limit. So on low debugging levels automatically silence test lines that issue more than 50 such messages. A count of the silenced messages is given at the end. Signed-off-by: Francois Gouget <fgouget(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- include/wine/test.h | 77 +++++++++++++++++++++++++++++++++++++++++++---------- 1 file changed, 63 insertions(+), 14 deletions(-) diff --git a/include/wine/test.h b/include/wine/test.h index 5c3b432a9a..edaf89bcca 100644 --- a/include/wine/test.h +++ b/include/wine/test.h @@ -62,6 +62,9 @@ extern int winetest_interactive; /* report successful tests (BOOL) */ extern int winetest_report_success; +/* silence todos and skips above this threshold */ +extern int winetest_mute_threshold; + /* current platform */ extern const char *winetest_platform; @@ -211,6 +214,9 @@ const char *winetest_platform = "windows"; /* report successful tests (BOOL) */ int winetest_report_success = 0; +/* silence todos and skips above this threshold */ +int winetest_mute_threshold = 42; + /* passing arguments around */ static int winetest_argc; static char** winetest_argv; @@ -222,6 +228,12 @@ static LONG failures; /* number of failures */ static LONG skipped; /* number of skipped test chunks */ static LONG todo_successes; /* number of successful tests inside todo block */ static LONG todo_failures; /* number of failures inside todo block */ +static LONG muted_traces; /* number of silenced traces */ +static LONG muted_skipped; /* same as skipped but silent */ +static LONG muted_todo_successes; /* same as todo_successes but silent */ + +/* counts how many times a given line printed a message */ +static LONG line_counters[16384]; /* The following data must be kept track of on a per-thread basis */ struct tls_data @@ -284,6 +296,25 @@ int broken( int condition ) return (strcmp(winetest_platform, "windows") == 0) && condition; } +static LONG winetest_add_line( void ) +{ + struct tls_data *data; + int index, count; + + if (winetest_debug > 1) + return 0; + + data = get_tls_data(); + index = data->current_line % ARRAY_SIZE(line_counters); + count = InterlockedIncrement(line_counters + index) - 1; + if (count == winetest_mute_threshold) + printf( "%s:%d Line has been silenced after %d occurrences\n", + data->current_file, data->current_line, + winetest_mute_threshold); + + return count; +} + /* * Checks condition. * Parameters: @@ -310,13 +341,19 @@ int winetest_vok( int condition, const char *msg, __winetest_va_list args ) } else { - if (winetest_debug > 0) + if (!winetest_debug || + winetest_add_line() < winetest_mute_threshold) { - printf( "%s:%d: Test marked todo: ", - data->current_file, data->current_line ); - vprintf(msg, args); + if (winetest_debug > 0) + { + printf( "%s:%d Test marked todo: ", + data->current_file, data->current_line ); + vprintf(msg, args); + } + InterlockedIncrement(&todo_successes); } - InterlockedIncrement(&todo_successes); + else + InterlockedIncrement(&muted_todo_successes); return 1; } } @@ -353,24 +390,32 @@ void __winetest_cdecl winetest_ok( int condition, const char *msg, ... ) void __winetest_cdecl winetest_trace( const char *msg, ... ) { __winetest_va_list valist; - struct tls_data *data = get_tls_data(); - if (winetest_debug > 0) + if (!winetest_debug) + return; + if (winetest_add_line() < winetest_mute_threshold) { - printf( "%s:%d: ", data->current_file, data->current_line ); + struct tls_data *data = get_tls_data(); + printf( "%s:%d ", data->current_file, data->current_line ); __winetest_va_start(valist, msg); vprintf(msg, valist); __winetest_va_end(valist); } + else + InterlockedIncrement(&muted_traces); } void winetest_vskip( const char *msg, __winetest_va_list args ) { - struct tls_data *data = get_tls_data(); - - printf( "%s:%d: Tests skipped: ", data->current_file, data->current_line ); - vprintf(msg, args); - skipped++; + if (winetest_add_line() < winetest_mute_threshold) + { + struct tls_data *data = get_tls_data(); + printf( "%s:%d Tests skipped: ", data->current_file, data->current_line ); + vprintf(msg, args); + InterlockedIncrement(&skipped); + } + else + InterlockedIncrement(&muted_skipped); } void __winetest_cdecl winetest_skip( const char *msg, ... ) @@ -504,7 +549,11 @@ static int run_test( const char *name ) if (winetest_debug) { - printf( "%04x:%s: %d tests executed (%d marked as todo, %d %s), %d skipped.\n", + if (muted_todo_successes || muted_skipped || muted_traces) + printf( "%04x:%s Silenced %d todos, %d skips and %d traces.\n", + GetCurrentProcessId(), test->name, + muted_todo_successes, muted_skipped, muted_traces); + printf( "%04x:%s %d tests executed (%d marked as todo, %d %s), %d skipped.\n", GetCurrentProcessId(), test->name, successes + failures + todo_successes + todo_failures, todo_successes, failures + todo_failures,
1
0
0
0
Jacek Caban : oleaut32: Use ITypeInfoImpl_GetInternalFuncDesc in a few more places.
by Alexandre Julliard
10 Feb '20
10 Feb '20
Module: wine Branch: master Commit: db498b3bf2a17e4e66845bd0988a7aaac780cfd9 URL:
https://source.winehq.org/git/wine.git/?a=commit;h=db498b3bf2a17e4e66845bd0…
Author: Jacek Caban <jacek(a)codeweavers.com> Date: Mon Feb 10 14:57:04 2020 +0100 oleaut32: Use ITypeInfoImpl_GetInternalFuncDesc in a few more places. Signed-off-by: Jacek Caban <jacek(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/oleaut32/typelib.c | 29 +++++++++++++++++++---------- 1 file changed, 19 insertions(+), 10 deletions(-) diff --git a/dlls/oleaut32/typelib.c b/dlls/oleaut32/typelib.c index 7020f68ba7..68c31e1d88 100644 --- a/dlls/oleaut32/typelib.c +++ b/dlls/oleaut32/typelib.c @@ -5264,7 +5264,7 @@ static HRESULT WINAPI ITypeLib2_fnGetDocumentation2( return result; } -static HRESULT TLB_copy_all_custdata(struct list *custdata_list, CUSTDATA *pCustData) +static HRESULT TLB_copy_all_custdata(const struct list *custdata_list, CUSTDATA *pCustData) { TLBCustData *pCData; unsigned int ct; @@ -8418,14 +8418,17 @@ static HRESULT WINAPI ITypeInfo2_fnGetParamCustData( VARIANT *pVarVal) { ITypeInfoImpl *This = impl_from_ITypeInfo2(iface); + const TLBFuncDesc *pFDesc; TLBCustData *pCData; - TLBFuncDesc *pFDesc = &This->funcdescs[indexFunc]; + UINT hrefoffset; + HRESULT hr; TRACE("%p %u %u %s %p\n", This, indexFunc, indexParam, debugstr_guid(guid), pVarVal); - if(indexFunc >= This->typeattr.cFuncs) - return TYPE_E_ELEMENTNOTFOUND; + hr = ITypeInfoImpl_GetInternalFuncDesc((ITypeInfo *)iface, indexFunc, &pFDesc, &hrefoffset); + if (FAILED(hr)) + return hr; if(indexParam >= pFDesc->funcdesc.cParams) return TYPE_E_ELEMENTNOTFOUND; @@ -8587,12 +8590,15 @@ static HRESULT WINAPI ITypeInfo2_fnGetAllFuncCustData( CUSTDATA *pCustData) { ITypeInfoImpl *This = impl_from_ITypeInfo2(iface); - TLBFuncDesc *pFDesc = &This->funcdescs[index]; + const TLBFuncDesc *pFDesc; + UINT hrefoffset; + HRESULT hr; TRACE("%p %u %p\n", This, index, pCustData); - if(index >= This->typeattr.cFuncs) - return TYPE_E_ELEMENTNOTFOUND; + hr = ITypeInfoImpl_GetInternalFuncDesc((ITypeInfo *)iface, index, &pFDesc, &hrefoffset); + if (FAILED(hr)) + return hr; return TLB_copy_all_custdata(&pFDesc->custdata_list, pCustData); } @@ -8606,12 +8612,15 @@ static HRESULT WINAPI ITypeInfo2_fnGetAllParamCustData( ITypeInfo2 * iface, UINT indexFunc, UINT indexParam, CUSTDATA *pCustData) { ITypeInfoImpl *This = impl_from_ITypeInfo2(iface); - TLBFuncDesc *pFDesc = &This->funcdescs[indexFunc]; + const TLBFuncDesc *pFDesc; + UINT hrefoffset; + HRESULT hr; TRACE("%p %u %u %p\n", This, indexFunc, indexParam, pCustData); - if(indexFunc >= This->typeattr.cFuncs) - return TYPE_E_ELEMENTNOTFOUND; + hr = ITypeInfoImpl_GetInternalFuncDesc((ITypeInfo *)iface, indexFunc, &pFDesc, &hrefoffset); + if (FAILED(hr)) + return hr; if(indexParam >= pFDesc->funcdesc.cParams) return TYPE_E_ELEMENTNOTFOUND;
1
0
0
0
← Newer
1
...
56
57
58
59
60
61
62
...
88
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
Results per page:
10
25
50
100
200