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
August 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
1051 discussions
Start a n
N
ew thread
Jacek Caban : gdi32: Use NtGdiGetCharABCWidthsW for GetCharABCWidthsI.
by Alexandre Julliard
27 Aug '21
27 Aug '21
Module: wine Branch: master Commit: ce9b1ddc1a561e998a4540496af52c9654cb2edc URL:
https://source.winehq.org/git/wine.git/?a=commit;h=ce9b1ddc1a561e998a454049…
Author: Jacek Caban <jacek(a)codeweavers.com> Date: Fri Aug 27 13:51:50 2021 +0100 gdi32: Use NtGdiGetCharABCWidthsW for GetCharABCWidthsI. 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/font.c | 82 ++++++++++++++----------------------------------------- dlls/gdi32/text.c | 11 ++++++++ 2 files changed, 31 insertions(+), 62 deletions(-) diff --git a/dlls/gdi32/font.c b/dlls/gdi32/font.c index d67f5f66467..e9071a571e3 100644 --- a/dlls/gdi32/font.c +++ b/dlls/gdi32/font.c @@ -4886,7 +4886,9 @@ BOOL WINAPI NtGdiGetCharWidthW( HDC hdc, UINT first, UINT last, WCHAR *chars, if (!(abc = HeapAlloc(GetProcessHeap(), 0, count * sizeof(ABC)))) return FALSE; - if (!GetCharABCWidthsI( hdc, first, last, chars, abc )) + if (!NtGdiGetCharABCWidthsW( hdc, first, last, chars, + NTGDI_GETCHARABCWIDTHS_INT | NTGDI_GETCHARABCWIDTHS_INDICES, + abc )) { HeapFree( GetProcessHeap(), 0, abc ); return FALSE; @@ -5641,18 +5643,26 @@ BOOL WINAPI NtGdiGetCharABCWidthsW( HDC hdc, UINT first, UINT last, WCHAR *chars return FALSE; } - if (!chars) count = last - first + 1; - - /* unlike GetCharABCWidthsFloatW, this one is supposed to fail on non-scalable fonts */ - dev = GET_DC_PHYSDEV( dc, pGetTextMetrics ); - if (!dev->funcs->pGetTextMetrics( dev, &tm ) || !(tm.tmPitchAndFamily & TMPF_VECTOR)) + if (flags & NTGDI_GETCHARABCWIDTHS_INDICES) { - release_dc_ptr( dc ); - return FALSE; + dev = GET_DC_PHYSDEV( dc, pGetCharABCWidthsI ); + ret = dev->funcs->pGetCharABCWidthsI( dev, first, count, chars, buffer ); + } + else + { + /* unlike GetCharABCWidthsFloatW, this one is supposed to fail on non-scalable fonts */ + dev = GET_DC_PHYSDEV( dc, pGetTextMetrics ); + if (!dev->funcs->pGetTextMetrics( dev, &tm ) || !(tm.tmPitchAndFamily & TMPF_VECTOR)) + { + release_dc_ptr( dc ); + return FALSE; + } + + if (!chars) count = last - first + 1; + dev = GET_DC_PHYSDEV( dc, pGetCharABCWidths ); + ret = dev->funcs->pGetCharABCWidths( dev, first, count, chars, buffer ); } - dev = GET_DC_PHYSDEV( dc, pGetCharABCWidths ); - ret = dev->funcs->pGetCharABCWidths( dev, first, count, chars, buffer ); if (ret) { ABC *abc = buffer; @@ -5670,58 +5680,6 @@ BOOL WINAPI NtGdiGetCharABCWidthsW( HDC hdc, UINT first, UINT last, WCHAR *chars } -/****************************************************************************** - * GetCharABCWidthsI [GDI32.@] - * - * Retrieves widths of characters in range. - * - * PARAMS - * hdc [I] Handle of device context - * firstChar [I] First glyphs in range to query - * count [I] Last glyphs in range to query - * pgi [i] Array of glyphs to query - * abc [O] Address of character-width structure - * - * NOTES - * Only works with TrueType fonts - * - * RETURNS - * Success: TRUE - * Failure: FALSE - */ -BOOL WINAPI GetCharABCWidthsI( HDC hdc, UINT firstChar, UINT count, - LPWORD pgi, LPABC abc) -{ - DC *dc = get_dc_ptr(hdc); - PHYSDEV dev; - unsigned int i; - BOOL ret; - - if (!dc) return FALSE; - - if (!abc) - { - release_dc_ptr( dc ); - return FALSE; - } - - dev = GET_DC_PHYSDEV( dc, pGetCharABCWidthsI ); - ret = dev->funcs->pGetCharABCWidthsI( dev, firstChar, count, pgi, abc ); - if (ret) - { - /* convert device units to logical */ - for( i = 0; i < count; i++, abc++ ) { - abc->abcA = width_to_LP(dc, abc->abcA); - abc->abcB = width_to_LP(dc, abc->abcB); - abc->abcC = width_to_LP(dc, abc->abcC); - } - } - - release_dc_ptr( dc ); - return ret; -} - - /*********************************************************************** * GetGlyphOutlineA (GDI32.@) */ diff --git a/dlls/gdi32/text.c b/dlls/gdi32/text.c index 469a74cc808..1238a8f9f45 100644 --- a/dlls/gdi32/text.c +++ b/dlls/gdi32/text.c @@ -1707,3 +1707,14 @@ BOOL WINAPI GetCharABCWidthsA( HDC hdc, UINT first, UINT last, ABC *abc ) HeapFree( GetProcessHeap(), 0, chars ); return ret; } + +/*********************************************************************** + * GetCharABCWidthsI (GDI32.@) + */ +BOOL WINAPI GetCharABCWidthsI( HDC hdc, UINT first, UINT count, WORD *glyphs, ABC *buffer ) +{ + TRACE( "(%p, %d, %d, %p, %p)\n", hdc, first, count, glyphs, buffer ); + return NtGdiGetCharABCWidthsW( hdc, first, count, glyphs, + NTGDI_GETCHARABCWIDTHS_INDICES | NTGDI_GETCHARABCWIDTHS_INT, + buffer ); +}
1
0
0
0
Jacek Caban : gdi32: Use NtGdiGetCharABCWidthsW for GetCharABCWidthsA.
by Alexandre Julliard
27 Aug '21
27 Aug '21
Module: wine Branch: master Commit: 78a935138e9e3b17f12be9297de4a9f44f5b5139 URL:
https://source.winehq.org/git/wine.git/?a=commit;h=78a935138e9e3b17f12be929…
Author: Jacek Caban <jacek(a)codeweavers.com> Date: Fri Aug 27 13:51:49 2021 +0100 gdi32: Use NtGdiGetCharABCWidthsW for GetCharABCWidthsA. 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/driver.c | 3 +- dlls/gdi32/font.c | 76 +++++++++++++---------------------------------- dlls/gdi32/text.c | 17 +++++++++++ include/wine/gdi_driver.h | 4 +-- 4 files changed, 42 insertions(+), 58 deletions(-) diff --git a/dlls/gdi32/driver.c b/dlls/gdi32/driver.c index 3d64eedc638..a5ba3ad4ea7 100644 --- a/dlls/gdi32/driver.c +++ b/dlls/gdi32/driver.c @@ -370,7 +370,8 @@ static UINT CDECL nulldrv_GetBoundsRect( PHYSDEV dev, RECT *rect, UINT flags ) return DCB_RESET; } -static BOOL CDECL nulldrv_GetCharABCWidths( PHYSDEV dev, UINT first, UINT last, LPABC abc ) +static BOOL CDECL nulldrv_GetCharABCWidths( PHYSDEV dev, UINT first, UINT count, + WCHAR *chars, ABC *abc ) { return FALSE; } diff --git a/dlls/gdi32/font.c b/dlls/gdi32/font.c index 261f2389285..d67f5f66467 100644 --- a/dlls/gdi32/font.c +++ b/dlls/gdi32/font.c @@ -3040,22 +3040,26 @@ static BOOL CDECL font_FontIsLinked( PHYSDEV dev ) /************************************************************* * font_GetCharABCWidths */ -static BOOL CDECL font_GetCharABCWidths( PHYSDEV dev, UINT first, UINT last, ABC *buffer ) +static BOOL CDECL font_GetCharABCWidths( PHYSDEV dev, UINT first, UINT count, + WCHAR *chars, ABC *buffer ) { struct font_physdev *physdev = get_font_dev( dev ); - UINT c; + UINT c, i; if (!physdev->font) { dev = GET_NEXT_PHYSDEV( dev, pGetCharABCWidths ); - return dev->funcs->pGetCharABCWidths( dev, first, last, buffer ); + return dev->funcs->pGetCharABCWidths( dev, first, count, chars, buffer ); } - TRACE( "%p, %u, %u, %p\n", physdev->font, first, last, buffer ); + TRACE( "%p, %u, %u, %p\n", physdev->font, first, count, buffer ); EnterCriticalSection( &font_cs ); - for (c = first; c <= last; c++, buffer++) - get_glyph_outline( physdev->font, c, GGO_METRICS, NULL, buffer, 0, NULL, NULL ); + for (i = 0; i < count; i++) + { + c = chars ? chars[i] : first + i; + get_glyph_outline( physdev->font, c, GGO_METRICS, NULL, &buffer[i], 0, NULL, NULL ); + } LeaveCriticalSection( &font_cs ); return TRUE; } @@ -5606,47 +5610,6 @@ BOOL WINAPI GetAspectRatioFilterEx( HDC hdc, LPSIZE pAspectRatio ) } -/*********************************************************************** - * GetCharABCWidthsA (GDI32.@) - * - * See GetCharABCWidthsW. - */ -BOOL WINAPI GetCharABCWidthsA(HDC hdc, UINT firstChar, UINT lastChar, - LPABC abc ) -{ - INT i, wlen; - LPSTR str; - LPWSTR wstr; - BOOL ret = TRUE; - - str = FONT_GetCharsByRangeA(hdc, firstChar, lastChar, &i); - if (str == NULL) - return FALSE; - - wstr = FONT_mbtowc(hdc, str, i, &wlen, NULL); - if (wstr == NULL) - { - HeapFree(GetProcessHeap(), 0, str); - return FALSE; - } - - for(i = 0; i < wlen; i++) - { - if(!GetCharABCWidthsW(hdc, wstr[i], wstr[i], abc)) - { - ret = FALSE; - break; - } - abc++; - } - - HeapFree(GetProcessHeap(), 0, str); - HeapFree(GetProcessHeap(), 0, wstr); - - return ret; -} - - /****************************************************************************** * NtGdiGetCharABCWidthsW (win32u.@) * @@ -5661,12 +5624,12 @@ BOOL WINAPI GetCharABCWidthsA(HDC hdc, UINT firstChar, UINT lastChar, * NOTES * Only works with TrueType fonts */ -BOOL WINAPI NtGdiGetCharABCWidthsW( HDC hdc, UINT firstChar, UINT lastChar, WCHAR *chars, +BOOL WINAPI NtGdiGetCharABCWidthsW( HDC hdc, UINT first, UINT last, WCHAR *chars, ULONG flags, void *buffer ) { DC *dc = get_dc_ptr(hdc); PHYSDEV dev; - unsigned int i; + unsigned int i, count = last; BOOL ret; TEXTMETRICW tm; @@ -5678,6 +5641,8 @@ BOOL WINAPI NtGdiGetCharABCWidthsW( HDC hdc, UINT firstChar, UINT lastChar, WCHA return FALSE; } + if (!chars) count = last - first + 1; + /* unlike GetCharABCWidthsFloatW, this one is supposed to fail on non-scalable fonts */ dev = GET_DC_PHYSDEV( dc, pGetTextMetrics ); if (!dev->funcs->pGetTextMetrics( dev, &tm ) || !(tm.tmPitchAndFamily & TMPF_VECTOR)) @@ -5687,15 +5652,16 @@ BOOL WINAPI NtGdiGetCharABCWidthsW( HDC hdc, UINT firstChar, UINT lastChar, WCHA } dev = GET_DC_PHYSDEV( dc, pGetCharABCWidths ); - ret = dev->funcs->pGetCharABCWidths( dev, firstChar, lastChar, buffer ); + ret = dev->funcs->pGetCharABCWidths( dev, first, count, chars, buffer ); if (ret) { ABC *abc = buffer; /* convert device units to logical */ - for( i = firstChar; i <= lastChar; i++, abc++ ) { - abc->abcA = width_to_LP(dc, abc->abcA); - abc->abcB = width_to_LP(dc, abc->abcB); - abc->abcC = width_to_LP(dc, abc->abcC); + for (i = 0; i < count; i++) + { + abc[i].abcA = width_to_LP( dc, abc[i].abcA ); + abc[i].abcB = width_to_LP( dc, abc[i].abcB ); + abc[i].abcC = width_to_LP( dc, abc[i].abcC ); } } @@ -6442,7 +6408,7 @@ BOOL WINAPI GetCharABCWidthsFloatW( HDC hdc, UINT first, UINT last, LPABCFLOAT a if (!(abc = HeapAlloc( GetProcessHeap(), 0, (last - first + 1) * sizeof(*abc) ))) goto done; dev = GET_DC_PHYSDEV( dc, pGetCharABCWidths ); - ret = dev->funcs->pGetCharABCWidths( dev, first, last, abc ); + ret = dev->funcs->pGetCharABCWidths( dev, first, last - first + 1, NULL, abc ); if (ret) { /* convert device units to logical */ diff --git a/dlls/gdi32/text.c b/dlls/gdi32/text.c index 5f1930cf4a5..469a74cc808 100644 --- a/dlls/gdi32/text.c +++ b/dlls/gdi32/text.c @@ -1690,3 +1690,20 @@ BOOL WINAPI GetCharABCWidthsW( HDC hdc, UINT first, UINT last, ABC *abc ) { return NtGdiGetCharABCWidthsW( hdc, first, last, NULL, NTGDI_GETCHARABCWIDTHS_INT, abc ); } + +/*********************************************************************** + * GetCharABCWidthsA (GDI32.@) + * + * See GetCharABCWidthsW. + */ +BOOL WINAPI GetCharABCWidthsA( HDC hdc, UINT first, UINT last, ABC *abc ) +{ + WCHAR *chars; + INT count; + BOOL ret; + + if (!(chars = get_chars_by_range( hdc, first, last, &count ))) return FALSE; + ret = NtGdiGetCharABCWidthsW( hdc, 0, count, chars, NTGDI_GETCHARABCWIDTHS_INT, abc ); + HeapFree( GetProcessHeap(), 0, chars ); + return ret; +} diff --git a/include/wine/gdi_driver.h b/include/wine/gdi_driver.h index 6db6cf94b70..a5af0bd6eb7 100644 --- a/include/wine/gdi_driver.h +++ b/include/wine/gdi_driver.h @@ -97,7 +97,7 @@ struct gdi_dc_funcs BOOL (CDECL *pFontIsLinked)(PHYSDEV); BOOL (CDECL *pFrameRgn)(PHYSDEV,HRGN,HBRUSH,INT,INT); UINT (CDECL *pGetBoundsRect)(PHYSDEV,RECT*,UINT); - BOOL (CDECL *pGetCharABCWidths)(PHYSDEV,UINT,UINT,LPABC); + BOOL (CDECL *pGetCharABCWidths)(PHYSDEV,UINT,UINT,WCHAR*,LPABC); BOOL (CDECL *pGetCharABCWidthsI)(PHYSDEV,UINT,UINT,WORD*,LPABC); BOOL (CDECL *pGetCharWidth)(PHYSDEV,UINT,UINT,const WCHAR*,LPINT); BOOL (CDECL *pGetCharWidthInfo)(PHYSDEV,void*); @@ -169,7 +169,7 @@ struct gdi_dc_funcs }; /* increment this when you change the DC function table */ -#define WINE_GDI_DRIVER_VERSION 65 +#define WINE_GDI_DRIVER_VERSION 66 #define GDI_PRIORITY_NULL_DRV 0 /* null driver */ #define GDI_PRIORITY_FONT_DRV 100 /* any font driver */
1
0
0
0
Jacek Caban : gdi32: Use NtGdiGetCharABCWidthsW for GetCharABCWidthsW.
by Alexandre Julliard
27 Aug '21
27 Aug '21
Module: wine Branch: master Commit: b656ff5d75a83e7db0401ed231247331ee03c260 URL:
https://source.winehq.org/git/wine.git/?a=commit;h=b656ff5d75a83e7db0401ed2…
Author: Jacek Caban <jacek(a)codeweavers.com> Date: Fri Aug 27 13:51:48 2021 +0100 gdi32: Use NtGdiGetCharABCWidthsW for GetCharABCWidthsW. 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/font.c | 15 ++++++--------- dlls/gdi32/text.c | 8 ++++++++ include/ntgdi.h | 6 +++++- 3 files changed, 19 insertions(+), 10 deletions(-) diff --git a/dlls/gdi32/font.c b/dlls/gdi32/font.c index e80143066b5..261f2389285 100644 --- a/dlls/gdi32/font.c +++ b/dlls/gdi32/font.c @@ -5648,7 +5648,7 @@ BOOL WINAPI GetCharABCWidthsA(HDC hdc, UINT firstChar, UINT lastChar, /****************************************************************************** - * GetCharABCWidthsW [GDI32.@] + * NtGdiGetCharABCWidthsW (win32u.@) * * Retrieves widths of characters in range. * @@ -5660,13 +5660,9 @@ BOOL WINAPI GetCharABCWidthsA(HDC hdc, UINT firstChar, UINT lastChar, * * NOTES * Only works with TrueType fonts - * - * RETURNS - * Success: TRUE - * Failure: FALSE */ -BOOL WINAPI GetCharABCWidthsW( HDC hdc, UINT firstChar, UINT lastChar, - LPABC abc ) +BOOL WINAPI NtGdiGetCharABCWidthsW( HDC hdc, UINT firstChar, UINT lastChar, WCHAR *chars, + ULONG flags, void *buffer ) { DC *dc = get_dc_ptr(hdc); PHYSDEV dev; @@ -5676,7 +5672,7 @@ BOOL WINAPI GetCharABCWidthsW( HDC hdc, UINT firstChar, UINT lastChar, if (!dc) return FALSE; - if (!abc) + if (!buffer) { release_dc_ptr( dc ); return FALSE; @@ -5691,9 +5687,10 @@ BOOL WINAPI GetCharABCWidthsW( HDC hdc, UINT firstChar, UINT lastChar, } dev = GET_DC_PHYSDEV( dc, pGetCharABCWidths ); - ret = dev->funcs->pGetCharABCWidths( dev, firstChar, lastChar, abc ); + ret = dev->funcs->pGetCharABCWidths( dev, firstChar, lastChar, buffer ); if (ret) { + ABC *abc = buffer; /* convert device units to logical */ for( i = firstChar; i <= lastChar; i++, abc++ ) { abc->abcA = width_to_LP(dc, abc->abcA); diff --git a/dlls/gdi32/text.c b/dlls/gdi32/text.c index c3d72938eba..5f1930cf4a5 100644 --- a/dlls/gdi32/text.c +++ b/dlls/gdi32/text.c @@ -1682,3 +1682,11 @@ BOOL WINAPI GetCharWidthI( HDC hdc, UINT first, UINT count, WORD *glyphs, INT *b return NtGdiGetCharWidthW( hdc, first, count, glyphs, NTGDI_GETCHARWIDTH_INT | NTGDI_GETCHARWIDTH_INDICES, buffer ); } + +/*********************************************************************** + * GetCharABCWidthsW (GDI32.@) + */ +BOOL WINAPI GetCharABCWidthsW( HDC hdc, UINT first, UINT last, ABC *abc ) +{ + return NtGdiGetCharABCWidthsW( hdc, first, last, NULL, NTGDI_GETCHARABCWIDTHS_INT, abc ); +} diff --git a/include/ntgdi.h b/include/ntgdi.h index 7d95c186c8f..39f478bd418 100644 --- a/include/ntgdi.h +++ b/include/ntgdi.h @@ -126,6 +126,9 @@ enum #define NTGDI_GETCHARWIDTH_INT 0x02 #define NTGDI_GETCHARWIDTH_INDICES 0x08 +#define NTGDI_GETCHARABCWIDTHS_INT 0x01 +#define NTGDI_GETCHARABCWIDTHS_INDICES 0x02 + #define MWT_SET 4 /* structs not compatible with native Windows */ @@ -229,7 +232,8 @@ BOOL WINAPI NtGdiGetAndSetDCDword( HDC hdc, UINT method, DWORD value, DWORD INT WINAPI NtGdiGetAppClipBox( HDC hdc, RECT *rect ); BOOL WINAPI NtGdiGetBitmapDimension( HBITMAP bitmap, SIZE *size ); UINT WINAPI NtGdiGetBoundsRect( HDC hdc, RECT *rect, UINT flags ); -BOOL WINAPI NtGdiGetCharABCWidthsW( HDC hdc, UINT first_char, UINT last_char, ABC *abc ); +BOOL WINAPI NtGdiGetCharABCWidthsW( HDC hdc, UINT first, UINT last, WCHAR *chars, + ULONG flags, void *buffer ); BOOL WINAPI NtGdiGetCharWidthW( HDC hdc, UINT first_char, UINT last_char, WCHAR *chars, ULONG flags, void *buffer ); BOOL WINAPI NtGdiGetDCDword( HDC hdc, UINT method, DWORD *result );
1
0
0
0
Piotr Caban : msvcp90: Use throw_exception helper to throw exception object only.
by Alexandre Julliard
27 Aug '21
27 Aug '21
Module: wine Branch: master Commit: 731dca90c7fa0e09594e1505daca83b75a79815f URL:
https://source.winehq.org/git/wine.git/?a=commit;h=731dca90c7fa0e09594e1505…
Author: Piotr Caban <piotr(a)codeweavers.com> Date: Fri Aug 27 13:48:39 2021 +0200 msvcp90: Use throw_exception helper to throw exception object only. Signed-off-by: Piotr Caban <piotr(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/msvcp90/cxx.h | 8 -------- dlls/msvcp90/exception.c | 30 +++++++----------------------- dlls/msvcp90/misc.c | 2 +- dlls/msvcp90/msvcp90.h | 1 + 4 files changed, 9 insertions(+), 32 deletions(-) diff --git a/dlls/msvcp90/cxx.h b/dlls/msvcp90/cxx.h index 58f6fe43586..29854d16bab 100644 --- a/dlls/msvcp90/cxx.h +++ b/dlls/msvcp90/cxx.h @@ -314,14 +314,6 @@ typedef struct __exception int do_free; /* Whether to free 'name' in our dtor */ } exception; -/* Internal: throws selected exception */ -typedef enum __exception_type { - EXCEPTION, - EXCEPTION_BAD_CAST, - EXCEPTION_LOGIC_ERROR, -} exception_type; -void throw_exception(exception_type, const char *); - /* rtti */ typedef struct __type_info { diff --git a/dlls/msvcp90/exception.c b/dlls/msvcp90/exception.c index 977bdff9739..e5b6018fe31 100644 --- a/dlls/msvcp90/exception.c +++ b/dlls/msvcp90/exception.c @@ -399,7 +399,7 @@ DEFINE_RTTI_DATA1(logic_error, 0, &exception_rtti_base_descriptor, ".?AVlogic_er #else DEFINE_RTTI_DATA1(logic_error, 0, &exception_rtti_base_descriptor, ".?AVlogic_error@@") #endif -DEFINE_CXX_DATA1(logic_error, &exception_cxx_type_info, MSVCP_logic_error_dtor) +DEFINE_CXX_TYPE_INFO(logic_error) /* length_error class data */ typedef logic_error length_error; @@ -817,7 +817,6 @@ bad_cast* __thiscall MSVCP_bad_cast_opequals(bad_cast *this, const bad_cast *rhs } DEFINE_RTTI_DATA1(bad_cast, 0, &exception_rtti_base_descriptor, ".?AVbad_cast@std@@") -DEFINE_CXX_DATA1(bad_cast, &exception_cxx_type_info, MSVCP_bad_cast_dtor) /* range_error class data */ typedef runtime_error range_error; @@ -1065,28 +1064,14 @@ __ASM_BLOCK_BEGIN(exception_vtables) VTABLE_ADD_FUNC(MSVCP_runtime_error_what)); __ASM_BLOCK_END -/* Internal: throws selected exception */ -void throw_exception(exception_type et, const char *str) +/* Internal: throws exception */ +void DECLSPEC_NORETURN throw_exception(const char *str) { exception_name name = EXCEPTION_NAME(str); + exception e; - switch(et) { - case EXCEPTION: { - exception e; - MSVCP_exception_ctor(&e, name); - _CxxThrowException(&e, &exception_cxx_type); - } - case EXCEPTION_BAD_CAST: { - bad_cast e; - MSVCP_bad_cast_ctor(&e, str); - _CxxThrowException(&e, &bad_cast_cxx_type); - } - case EXCEPTION_LOGIC_ERROR: { - logic_error e; - MSVCP_logic_error_ctor(&e, name); - _CxxThrowException(&e, &logic_error_cxx_type); - } - } + MSVCP_exception_ctor(&e, name); + _CxxThrowException(&e, &exception_cxx_type); } /* Internal: throws range_error exception */ @@ -1132,7 +1117,7 @@ void init_exception(void *base) init_exception_cxx(base); init_bad_alloc_cxx(base); - init_logic_error_cxx(base); + init_logic_error_cxx_type_info(base); init_length_error_cxx(base); init_out_of_range_cxx(base); init_invalid_argument_cxx(base); @@ -1144,7 +1129,6 @@ void init_exception(void *base) init_system_error_cxx_type_info(base); #endif init_failure_cxx(base); - init_bad_cast_cxx(base); init_range_error_cxx(base); #endif } diff --git a/dlls/msvcp90/misc.c b/dlls/msvcp90/misc.c index 8eacccc1461..5c4f997411a 100644 --- a/dlls/msvcp90/misc.c +++ b/dlls/msvcp90/misc.c @@ -700,7 +700,7 @@ unsigned int __cdecl _Random_device(void) /* TODO: throw correct exception in case of failure */ if(rand_s(&ret)) - throw_exception(EXCEPTION, "random number generator failed\n"); + throw_exception("random number generator failed\n"); return ret; } #endif diff --git a/dlls/msvcp90/msvcp90.h b/dlls/msvcp90/msvcp90.h index e917fad4e28..4aa88e028d6 100644 --- a/dlls/msvcp90/msvcp90.h +++ b/dlls/msvcp90/msvcp90.h @@ -669,5 +669,6 @@ void __cdecl DECLSPEC_NORETURN _Xlength_error(const char*); void __cdecl DECLSPEC_NORETURN _Xmem(void); void __cdecl DECLSPEC_NORETURN _Xout_of_range(const char*); void __cdecl DECLSPEC_NORETURN _Xruntime_error(const char*); +void DECLSPEC_NORETURN throw_exception(const char*); void DECLSPEC_NORETURN throw_failure(const char*); void DECLSPEC_NORETURN throw_range_error(const char*);
1
0
0
0
Piotr Caban : msvcp90: Introduce throw_failure helper.
by Alexandre Julliard
27 Aug '21
27 Aug '21
Module: wine Branch: master Commit: d7e9190032310b7481b2802aaf92148a3b9153bb URL:
https://source.winehq.org/git/wine.git/?a=commit;h=d7e9190032310b7481b2802a…
Author: Piotr Caban <piotr(a)codeweavers.com> Date: Fri Aug 27 13:48:33 2021 +0200 msvcp90: Introduce throw_failure helper. Signed-off-by: Piotr Caban <piotr(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/msvcp60/ios.c | 8 ++++---- dlls/msvcp60/msvcp.h | 1 + dlls/msvcp90/cxx.h | 1 - dlls/msvcp90/exception.c | 15 ++++++++++----- dlls/msvcp90/ios.c | 8 ++++---- dlls/msvcp90/msvcp90.h | 1 + 6 files changed, 20 insertions(+), 14 deletions(-) diff --git a/dlls/msvcp60/ios.c b/dlls/msvcp60/ios.c index 8657fd9b3e5..495817a54db 100644 --- a/dlls/msvcp60/ios.c +++ b/dlls/msvcp60/ios.c @@ -4849,13 +4849,13 @@ void __thiscall ios_base_clear_reraise(ios_base *this, IOSB_iostate state, bool if(reraise) _CxxThrowException(NULL, NULL); else if(this->state & this->except & IOSTATE_eofbit) - throw_exception(EXCEPTION_FAILURE, "eofbit is set"); + throw_failure("eofbit is set"); else if(this->state & this->except & IOSTATE_failbit) - throw_exception(EXCEPTION_FAILURE, "failbit is set"); + throw_failure("failbit is set"); else if(this->state & this->except & IOSTATE_badbit) - throw_exception(EXCEPTION_FAILURE, "badbit is set"); + throw_failure("badbit is set"); else if(this->state & this->except & IOSTATE__Hardfail) - throw_exception(EXCEPTION_FAILURE, "_Hardfail is set"); + throw_failure("_Hardfail is set"); } /* ?clear@ios_base@std@@QAEXH@Z */ diff --git a/dlls/msvcp60/msvcp.h b/dlls/msvcp60/msvcp.h index bae75855c3a..19078a133e4 100644 --- a/dlls/msvcp60/msvcp.h +++ b/dlls/msvcp60/msvcp.h @@ -488,3 +488,4 @@ void WINAPI DECLSPEC_NORETURN _CxxThrowException(void*,const cxx_exception_type* void __cdecl DECLSPEC_NORETURN _Xlength_error(const char*); void __cdecl DECLSPEC_NORETURN _Xmem(void); void __cdecl DECLSPEC_NORETURN _Xout_of_range(const char*); +void DECLSPEC_NORETURN throw_failure(const char*); diff --git a/dlls/msvcp90/cxx.h b/dlls/msvcp90/cxx.h index b8c29921db1..58f6fe43586 100644 --- a/dlls/msvcp90/cxx.h +++ b/dlls/msvcp90/cxx.h @@ -319,7 +319,6 @@ typedef enum __exception_type { EXCEPTION, EXCEPTION_BAD_CAST, EXCEPTION_LOGIC_ERROR, - EXCEPTION_FAILURE, } exception_type; void throw_exception(exception_type, const char *); diff --git a/dlls/msvcp90/exception.c b/dlls/msvcp90/exception.c index f93d92b601d..977bdff9739 100644 --- a/dlls/msvcp90/exception.c +++ b/dlls/msvcp90/exception.c @@ -1086,11 +1086,6 @@ void throw_exception(exception_type et, const char *str) MSVCP_logic_error_ctor(&e, name); _CxxThrowException(&e, &logic_error_cxx_type); } - case EXCEPTION_FAILURE: { - failure e; - MSVCP_failure_ctor(&e, name); - _CxxThrowException(&e, &failure_cxx_type); - } } } @@ -1104,6 +1099,16 @@ void DECLSPEC_NORETURN throw_range_error(const char *str) _CxxThrowException(&e, &range_error_cxx_type); } +/* Internal: throws failure exception */ +void DECLSPEC_NORETURN throw_failure(const char *str) +{ + exception_name name = EXCEPTION_NAME(str); + failure e; + + MSVCP_failure_ctor(&e, name); + _CxxThrowException(&e, &failure_cxx_type); +} + void init_exception(void *base) { #ifdef __x86_64__ diff --git a/dlls/msvcp90/ios.c b/dlls/msvcp90/ios.c index 8275635096a..21cf33a505c 100644 --- a/dlls/msvcp90/ios.c +++ b/dlls/msvcp90/ios.c @@ -5266,13 +5266,13 @@ void __thiscall ios_base_clear_reraise(ios_base *this, IOSB_iostate state, bool if(reraise) _CxxThrowException(NULL, NULL); else if(this->state & this->except & IOSTATE_eofbit) - throw_exception(EXCEPTION_FAILURE, "eofbit is set"); + throw_failure("eofbit is set"); else if(this->state & this->except & IOSTATE_failbit) - throw_exception(EXCEPTION_FAILURE, "failbit is set"); + throw_failure("failbit is set"); else if(this->state & this->except & IOSTATE_badbit) - throw_exception(EXCEPTION_FAILURE, "badbit is set"); + throw_failure("badbit is set"); else if(this->state & this->except & IOSTATE__Hardfail) - throw_exception(EXCEPTION_FAILURE, "_Hardfail is set"); + throw_failure("_Hardfail is set"); } /* ?clear@ios_base@std@@QAEXH@Z */ diff --git a/dlls/msvcp90/msvcp90.h b/dlls/msvcp90/msvcp90.h index 63ba36f7b38..e917fad4e28 100644 --- a/dlls/msvcp90/msvcp90.h +++ b/dlls/msvcp90/msvcp90.h @@ -669,4 +669,5 @@ void __cdecl DECLSPEC_NORETURN _Xlength_error(const char*); void __cdecl DECLSPEC_NORETURN _Xmem(void); void __cdecl DECLSPEC_NORETURN _Xout_of_range(const char*); void __cdecl DECLSPEC_NORETURN _Xruntime_error(const char*); +void DECLSPEC_NORETURN throw_failure(const char*); void DECLSPEC_NORETURN throw_range_error(const char*);
1
0
0
0
Piotr Caban : msvcp90: Introduce throw_range_error helper.
by Alexandre Julliard
27 Aug '21
27 Aug '21
Module: wine Branch: master Commit: 93455491fc6be9e73a0aeb66aac0e26385bba231 URL:
https://source.winehq.org/git/wine.git/?a=commit;h=93455491fc6be9e73a0aeb66…
Author: Piotr Caban <piotr(a)codeweavers.com> Date: Fri Aug 27 13:48:29 2021 +0200 msvcp90: Introduce throw_range_error helper. Signed-off-by: Piotr Caban <piotr(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/msvcp90/cxx.h | 1 - dlls/msvcp90/details.c | 3 +-- dlls/msvcp90/exception.c | 15 ++++++++++----- dlls/msvcp90/msvcp90.h | 1 + 4 files changed, 12 insertions(+), 8 deletions(-) diff --git a/dlls/msvcp90/cxx.h b/dlls/msvcp90/cxx.h index 9d79ca80e21..b8c29921db1 100644 --- a/dlls/msvcp90/cxx.h +++ b/dlls/msvcp90/cxx.h @@ -320,7 +320,6 @@ typedef enum __exception_type { EXCEPTION_BAD_CAST, EXCEPTION_LOGIC_ERROR, EXCEPTION_FAILURE, - EXCEPTION_RANGE_ERROR, } exception_type; void throw_exception(exception_type, const char *); diff --git a/dlls/msvcp90/details.c b/dlls/msvcp90/details.c index b7de12e6e90..1515286b4dd 100644 --- a/dlls/msvcp90/details.c +++ b/dlls/msvcp90/details.c @@ -475,8 +475,7 @@ void __thiscall _vector_base_v4__Internal_throw_exception(void/*_vector_base_v4* switch(idx) { case 0: _Xout_of_range("Index out of range"); case 1: _Xout_of_range("Index out of segments table range"); - case 2: throw_exception(EXCEPTION_RANGE_ERROR, - "Index is inside segment which failed to be allocated"); + case 2: throw_range_error("Index is inside segment which failed to be allocated"); } } diff --git a/dlls/msvcp90/exception.c b/dlls/msvcp90/exception.c index f6a15ecc8d6..f93d92b601d 100644 --- a/dlls/msvcp90/exception.c +++ b/dlls/msvcp90/exception.c @@ -1091,14 +1091,19 @@ void throw_exception(exception_type et, const char *str) MSVCP_failure_ctor(&e, name); _CxxThrowException(&e, &failure_cxx_type); } - case EXCEPTION_RANGE_ERROR: { - range_error e; - MSVCP_range_error_ctor(&e, name); - _CxxThrowException(&e, &range_error_cxx_type); - } } } +/* Internal: throws range_error exception */ +void DECLSPEC_NORETURN throw_range_error(const char *str) +{ + exception_name name = EXCEPTION_NAME(str); + range_error e; + + MSVCP_range_error_ctor(&e, name); + _CxxThrowException(&e, &range_error_cxx_type); +} + void init_exception(void *base) { #ifdef __x86_64__ diff --git a/dlls/msvcp90/msvcp90.h b/dlls/msvcp90/msvcp90.h index 7452a7f6a99..63ba36f7b38 100644 --- a/dlls/msvcp90/msvcp90.h +++ b/dlls/msvcp90/msvcp90.h @@ -669,3 +669,4 @@ void __cdecl DECLSPEC_NORETURN _Xlength_error(const char*); void __cdecl DECLSPEC_NORETURN _Xmem(void); void __cdecl DECLSPEC_NORETURN _Xout_of_range(const char*); void __cdecl DECLSPEC_NORETURN _Xruntime_error(const char*); +void DECLSPEC_NORETURN throw_range_error(const char*);
1
0
0
0
Piotr Caban : msvcp90: Don't use throw_exception helper for out_of_range exception.
by Alexandre Julliard
27 Aug '21
27 Aug '21
Module: wine Branch: master Commit: 503f3462c64565488b0687fcaece989cb987bfca URL:
https://source.winehq.org/git/wine.git/?a=commit;h=503f3462c64565488b0687fc…
Author: Piotr Caban <piotr(a)codeweavers.com> Date: Fri Aug 27 13:48:24 2021 +0200 msvcp90: Don't use throw_exception helper for out_of_range exception. Signed-off-by: Piotr Caban <piotr(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/msvcp60/msvcp.h | 1 + dlls/msvcp60/string.c | 4 +--- dlls/msvcp90/cxx.h | 1 - dlls/msvcp90/details.c | 17 ++++++----------- dlls/msvcp90/exception.c | 14 +++++++------- dlls/msvcp90/locale.c | 2 +- dlls/msvcp90/msvcp90.h | 1 + dlls/msvcp90/string.c | 4 +--- 8 files changed, 18 insertions(+), 26 deletions(-) diff --git a/dlls/msvcp60/msvcp.h b/dlls/msvcp60/msvcp.h index 0c4f4f32280..bae75855c3a 100644 --- a/dlls/msvcp60/msvcp.h +++ b/dlls/msvcp60/msvcp.h @@ -487,3 +487,4 @@ typedef struct { void WINAPI DECLSPEC_NORETURN _CxxThrowException(void*,const cxx_exception_type*); void __cdecl DECLSPEC_NORETURN _Xlength_error(const char*); void __cdecl DECLSPEC_NORETURN _Xmem(void); +void __cdecl DECLSPEC_NORETURN _Xout_of_range(const char*); diff --git a/dlls/msvcp60/string.c b/dlls/msvcp60/string.c index 22cdcd49891..45b7a57f961 100644 --- a/dlls/msvcp60/string.c +++ b/dlls/msvcp60/string.c @@ -46,10 +46,8 @@ typedef struct { /* ?_Xran@std@@YAXXZ */ void __cdecl _Xran(void) { - static const char msg[] = "invalid string position"; - TRACE("\n"); - throw_exception(EXCEPTION_OUT_OF_RANGE, msg); + _Xout_of_range("invalid string position"); } /* ?_Xlen@std@@YAXXZ */ diff --git a/dlls/msvcp90/cxx.h b/dlls/msvcp90/cxx.h index 0b14806d95c..9d79ca80e21 100644 --- a/dlls/msvcp90/cxx.h +++ b/dlls/msvcp90/cxx.h @@ -319,7 +319,6 @@ typedef enum __exception_type { EXCEPTION, EXCEPTION_BAD_CAST, EXCEPTION_LOGIC_ERROR, - EXCEPTION_OUT_OF_RANGE, EXCEPTION_FAILURE, EXCEPTION_RANGE_ERROR, } exception_type; diff --git a/dlls/msvcp90/details.c b/dlls/msvcp90/details.c index d2c51b7ff0a..b7de12e6e90 100644 --- a/dlls/msvcp90/details.c +++ b/dlls/msvcp90/details.c @@ -470,19 +470,14 @@ size_t __cdecl _vector_base_v4__Segment_index_of(size_t x) DEFINE_THISCALL_WRAPPER(_vector_base_v4__Internal_throw_exception, 8) void __thiscall _vector_base_v4__Internal_throw_exception(void/*_vector_base_v4*/ *this, size_t idx) { - static const struct { - exception_type type; - const char *msg; - } exceptions[] = { - { EXCEPTION_OUT_OF_RANGE, "Index out of range" }, - { EXCEPTION_OUT_OF_RANGE, "Index out of segments table range" }, - { EXCEPTION_RANGE_ERROR, "Index is inside segment which failed to be allocated" }, - }; - TRACE("(%p %Iu)\n", this, idx); - if(idx < ARRAY_SIZE(exceptions)) - throw_exception(exceptions[idx].type, exceptions[idx].msg); + switch(idx) { + case 0: _Xout_of_range("Index out of range"); + case 1: _Xout_of_range("Index out of segments table range"); + case 2: throw_exception(EXCEPTION_RANGE_ERROR, + "Index is inside segment which failed to be allocated"); + } } #ifdef _WIN64 diff --git a/dlls/msvcp90/exception.c b/dlls/msvcp90/exception.c index 7b92b80d393..f6a15ecc8d6 100644 --- a/dlls/msvcp90/exception.c +++ b/dlls/msvcp90/exception.c @@ -916,10 +916,15 @@ void __cdecl DECLSPEC_NORETURN _Xlength_error(const char *str) /* ?_Xout_of_range@std@@YAXPBD@Z */ /* ?_Xout_of_range@std@@YAXPEBD@Z */ -void __cdecl _Xout_of_range(const char *str) +void __cdecl DECLSPEC_NORETURN _Xout_of_range(const char *str) { + exception_name name = EXCEPTION_NAME(str); + out_of_range e; + TRACE("(%s)\n", debugstr_a(str)); - throw_exception(EXCEPTION_OUT_OF_RANGE, str); + + MSVCP_out_of_range_ctor(&e, name); + _CxxThrowException(&e, &out_of_range_cxx_type); } /* ?_Xruntime_error@std@@YAXPBD@Z */ @@ -1081,11 +1086,6 @@ void throw_exception(exception_type et, const char *str) MSVCP_logic_error_ctor(&e, name); _CxxThrowException(&e, &logic_error_cxx_type); } - case EXCEPTION_OUT_OF_RANGE: { - out_of_range e; - MSVCP_out_of_range_ctor(&e, name); - _CxxThrowException(&e, &out_of_range_cxx_type); - } case EXCEPTION_FAILURE: { failure e; MSVCP_failure_ctor(&e, name); diff --git a/dlls/msvcp90/locale.c b/dlls/msvcp90/locale.c index 0afe394ad2d..116f3c75e5d 100644 --- a/dlls/msvcp90/locale.c +++ b/dlls/msvcp90/locale.c @@ -1613,7 +1613,7 @@ ctype_base* __thiscall ctype_base_vector_dtor(ctype_base *this, unsigned int fla /* ?_Xran@ctype_base@std@@KAXXZ */ void __cdecl ctype_base__Xran(void) { - throw_exception(EXCEPTION_OUT_OF_RANGE, "out of range in ctype<T>"); + _Xout_of_range("out of range in ctype<T>"); } /* ?id@?$ctype@D@std@@2V0locale@2@A */ diff --git a/dlls/msvcp90/msvcp90.h b/dlls/msvcp90/msvcp90.h index 3f862f1b2c1..7452a7f6a99 100644 --- a/dlls/msvcp90/msvcp90.h +++ b/dlls/msvcp90/msvcp90.h @@ -667,4 +667,5 @@ void WINAPI DECLSPEC_NORETURN _CxxThrowException(void*,const cxx_exception_type* void __cdecl DECLSPEC_NORETURN _Xinvalid_argument(const char*); void __cdecl DECLSPEC_NORETURN _Xlength_error(const char*); void __cdecl DECLSPEC_NORETURN _Xmem(void); +void __cdecl DECLSPEC_NORETURN _Xout_of_range(const char*); void __cdecl DECLSPEC_NORETURN _Xruntime_error(const char*); diff --git a/dlls/msvcp90/string.c b/dlls/msvcp90/string.c index 7609f913093..3384069bd03 100644 --- a/dlls/msvcp90/string.c +++ b/dlls/msvcp90/string.c @@ -468,10 +468,8 @@ void __thiscall _String_base__Xlen(const void/*_String_base*/ *this) /* ?_Xran@_String_base@std@@SAXXZ */ void CDECL MSVCP__String_base_Xran(void) { - static const char msg[] = "invalid string position"; - TRACE("\n"); - throw_exception(EXCEPTION_OUT_OF_RANGE, msg); + _Xout_of_range("invalid string position"); } /* ?_Xran@_String_base@std@@QBEXXZ */
1
0
0
0
Piotr Caban : msvcp90: Don't use throw_exception helper for runtime_error exception.
by Alexandre Julliard
27 Aug '21
27 Aug '21
Module: wine Branch: master Commit: 73c4ae66c2a4721f34978915c90c9ce7a32500f6 URL:
https://source.winehq.org/git/wine.git/?a=commit;h=73c4ae66c2a4721f34978915…
Author: Piotr Caban <piotr(a)codeweavers.com> Date: Fri Aug 27 13:48:21 2021 +0200 msvcp90: Don't use throw_exception helper for runtime_error exception. Signed-off-by: Piotr Caban <piotr(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/msvcp90/cxx.h | 1 - dlls/msvcp90/exception.c | 14 +++++++------- dlls/msvcp90/locale.c | 8 ++++---- dlls/msvcp90/msvcp90.h | 1 + 4 files changed, 12 insertions(+), 12 deletions(-) diff --git a/dlls/msvcp90/cxx.h b/dlls/msvcp90/cxx.h index 5bdebb605d6..0b14806d95c 100644 --- a/dlls/msvcp90/cxx.h +++ b/dlls/msvcp90/cxx.h @@ -320,7 +320,6 @@ typedef enum __exception_type { EXCEPTION_BAD_CAST, EXCEPTION_LOGIC_ERROR, EXCEPTION_OUT_OF_RANGE, - EXCEPTION_RUNTIME_ERROR, EXCEPTION_FAILURE, EXCEPTION_RANGE_ERROR, } exception_type; diff --git a/dlls/msvcp90/exception.c b/dlls/msvcp90/exception.c index f635a80a90c..7b92b80d393 100644 --- a/dlls/msvcp90/exception.c +++ b/dlls/msvcp90/exception.c @@ -924,10 +924,15 @@ void __cdecl _Xout_of_range(const char *str) /* ?_Xruntime_error@std@@YAXPBD@Z */ /* ?_Xruntime_error@std@@YAXPEBD@Z */ -void __cdecl _Xruntime_error(const char *str) +void __cdecl DECLSPEC_NORETURN _Xruntime_error(const char *str) { + exception_name name = EXCEPTION_NAME(str); + runtime_error e; + TRACE("(%s)\n", debugstr_a(str)); - throw_exception(EXCEPTION_RUNTIME_ERROR, str); + + MSVCP_runtime_error_ctor(&e, name); + _CxxThrowException(&e, &runtime_error_cxx_type); } /* ?uncaught_exception@std@@YA_NXZ */ @@ -1081,11 +1086,6 @@ void throw_exception(exception_type et, const char *str) MSVCP_out_of_range_ctor(&e, name); _CxxThrowException(&e, &out_of_range_cxx_type); } - case EXCEPTION_RUNTIME_ERROR: { - runtime_error e; - MSVCP_runtime_error_ctor(&e, name); - _CxxThrowException(&e, &runtime_error_cxx_type); - } case EXCEPTION_FAILURE: { failure e; MSVCP_failure_ctor(&e, name); diff --git a/dlls/msvcp90/locale.c b/dlls/msvcp90/locale.c index b0f1465fdce..0afe394ad2d 100644 --- a/dlls/msvcp90/locale.c +++ b/dlls/msvcp90/locale.c @@ -520,7 +520,7 @@ _Locinfo* __cdecl _Locinfo__Locinfo_ctor_cat_cstr(_Locinfo *locinfo, int categor FIXME("(%p %d %s) semi-stub\n", locinfo, category, locstr); if(!locstr) - throw_exception(EXCEPTION_RUNTIME_ERROR, "bad locale name"); + _Xruntime_error("bad locale name"); _Lockit_ctor_locktype(&locinfo->lock, _LOCK_LOCALE); locale_string_char_ctor(&locinfo->days); @@ -625,7 +625,7 @@ _Locinfo* __cdecl _Locinfo__Locinfo_Addcats(_Locinfo *locinfo, int category, con /* This function is probably modifying more global objects */ FIXME("(%p %d %s) semi-stub\n", locinfo, category, locstr); if(!locstr) - throw_exception(EXCEPTION_RUNTIME_ERROR, "bad locale name"); + _Xruntime_error("bad locale name"); locale_string_char_dtor(&locinfo->newlocname); @@ -11984,7 +11984,7 @@ locale* __thiscall locale_ctor_locale_cstr(locale *this, const locale *loc, cons if(!memcmp(locale_string_char_c_str(&locinfo.newlocname), "*", 2)) { _Locinfo_dtor(&locinfo); operator_delete(this->ptr); - throw_exception(EXCEPTION_RUNTIME_ERROR, "bad locale name"); + _Xruntime_error("bad locale name"); } this->ptr = operator_new(sizeof(locale__Locimp)); @@ -12013,7 +12013,7 @@ locale* __thiscall locale_ctor_cstr(locale *this, const char *locname, category if(!memcmp(locale_string_char_c_str(&locinfo.newlocname), "*", 2)) { _Locinfo_dtor(&locinfo); operator_delete(this->ptr); - throw_exception(EXCEPTION_RUNTIME_ERROR, "bad locale name"); + _Xruntime_error("bad locale name"); } locale__Locimp__Makeloc(&locinfo, cat, this->ptr, NULL); diff --git a/dlls/msvcp90/msvcp90.h b/dlls/msvcp90/msvcp90.h index 144bf4d3a9a..3f862f1b2c1 100644 --- a/dlls/msvcp90/msvcp90.h +++ b/dlls/msvcp90/msvcp90.h @@ -667,3 +667,4 @@ void WINAPI DECLSPEC_NORETURN _CxxThrowException(void*,const cxx_exception_type* void __cdecl DECLSPEC_NORETURN _Xinvalid_argument(const char*); void __cdecl DECLSPEC_NORETURN _Xlength_error(const char*); void __cdecl DECLSPEC_NORETURN _Xmem(void); +void __cdecl DECLSPEC_NORETURN _Xruntime_error(const char*);
1
0
0
0
Piotr Caban : msvcp90: Don't use throw_exception helper for invalid_argument exception.
by Alexandre Julliard
27 Aug '21
27 Aug '21
Module: wine Branch: master Commit: b561d0130529fbceabbcca3091945b3fbdd76705 URL:
https://source.winehq.org/git/wine.git/?a=commit;h=b561d0130529fbceabbcca30…
Author: Piotr Caban <piotr(a)codeweavers.com> Date: Fri Aug 27 13:48:18 2021 +0200 msvcp90: Don't use throw_exception helper for invalid_argument exception. Signed-off-by: Piotr Caban <piotr(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/msvcp90/cxx.h | 1 - dlls/msvcp90/exception.c | 14 +++++++------- dlls/msvcp90/msvcp90.h | 1 + dlls/msvcp90/string.c | 4 +--- 4 files changed, 9 insertions(+), 11 deletions(-) diff --git a/dlls/msvcp90/cxx.h b/dlls/msvcp90/cxx.h index 72e96133f8f..5bdebb605d6 100644 --- a/dlls/msvcp90/cxx.h +++ b/dlls/msvcp90/cxx.h @@ -320,7 +320,6 @@ typedef enum __exception_type { EXCEPTION_BAD_CAST, EXCEPTION_LOGIC_ERROR, EXCEPTION_OUT_OF_RANGE, - EXCEPTION_INVALID_ARGUMENT, EXCEPTION_RUNTIME_ERROR, EXCEPTION_FAILURE, EXCEPTION_RANGE_ERROR, diff --git a/dlls/msvcp90/exception.c b/dlls/msvcp90/exception.c index face3ea09b0..f635a80a90c 100644 --- a/dlls/msvcp90/exception.c +++ b/dlls/msvcp90/exception.c @@ -890,10 +890,15 @@ void __cdecl DECLSPEC_NORETURN _Xmem(void) /* ?_Xinvalid_argument@std@@YAXPBD@Z */ /* ?_Xinvalid_argument@std@@YAXPEBD@Z */ -void __cdecl _Xinvalid_argument(const char *str) +void __cdecl DECLSPEC_NORETURN _Xinvalid_argument(const char *str) { + exception_name name = EXCEPTION_NAME(str); + invalid_argument e; + TRACE("(%s)\n", debugstr_a(str)); - throw_exception(EXCEPTION_INVALID_ARGUMENT, str); + + MSVCP_invalid_argument_ctor(&e, name); + _CxxThrowException(&e, &invalid_argument_cxx_type); } /* ?_Xlength_error@std@@YAXPBD@Z */ @@ -1076,11 +1081,6 @@ void throw_exception(exception_type et, const char *str) MSVCP_out_of_range_ctor(&e, name); _CxxThrowException(&e, &out_of_range_cxx_type); } - case EXCEPTION_INVALID_ARGUMENT: { - invalid_argument e; - MSVCP_invalid_argument_ctor(&e, name); - _CxxThrowException(&e, &invalid_argument_cxx_type); - } case EXCEPTION_RUNTIME_ERROR: { runtime_error e; MSVCP_runtime_error_ctor(&e, name); diff --git a/dlls/msvcp90/msvcp90.h b/dlls/msvcp90/msvcp90.h index 410c406d86c..144bf4d3a9a 100644 --- a/dlls/msvcp90/msvcp90.h +++ b/dlls/msvcp90/msvcp90.h @@ -664,5 +664,6 @@ static inline int mbstowcs_wrapper( size_t *ret, wchar_t *wcs, size_t size, cons #endif void WINAPI DECLSPEC_NORETURN _CxxThrowException(void*,const cxx_exception_type*); +void __cdecl DECLSPEC_NORETURN _Xinvalid_argument(const char*); void __cdecl DECLSPEC_NORETURN _Xlength_error(const char*); void __cdecl DECLSPEC_NORETURN _Xmem(void); diff --git a/dlls/msvcp90/string.c b/dlls/msvcp90/string.c index 89aacdd7cb7..7609f913093 100644 --- a/dlls/msvcp90/string.c +++ b/dlls/msvcp90/string.c @@ -484,10 +484,8 @@ void __thiscall _String_base__Xran(const void/*_String_base*/ *this) /* ?_Xinvarg@_String_base@std@@SAXXZ */ void CDECL MSVCP__String_base_Xinvarg(void) { - static const char msg[] = "invalid string argument"; - TRACE("\n"); - throw_exception(EXCEPTION_INVALID_ARGUMENT, msg); + _Xinvalid_argument("invalid string argument"); }
1
0
0
0
Piotr Caban : msvcp90: Don't use throw_exception helper for length_error exception.
by Alexandre Julliard
27 Aug '21
27 Aug '21
Module: wine Branch: master Commit: 6b7b6f45e16530bbb76d8e0b5f548b81ce1a28fb URL:
https://source.winehq.org/git/wine.git/?a=commit;h=6b7b6f45e16530bbb76d8e0b…
Author: Piotr Caban <piotr(a)codeweavers.com> Date: Fri Aug 27 13:48:14 2021 +0200 msvcp90: Don't use throw_exception helper for length_error exception. Signed-off-by: Piotr Caban <piotr(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/msvcp60/msvcp.h | 1 + dlls/msvcp60/string.c | 4 +--- dlls/msvcp90/cxx.h | 1 - dlls/msvcp90/exception.c | 14 +++++++------- dlls/msvcp90/msvcp90.h | 1 + dlls/msvcp90/string.c | 4 +--- 6 files changed, 11 insertions(+), 14 deletions(-) diff --git a/dlls/msvcp60/msvcp.h b/dlls/msvcp60/msvcp.h index 53b98f4c449..0c4f4f32280 100644 --- a/dlls/msvcp60/msvcp.h +++ b/dlls/msvcp60/msvcp.h @@ -485,4 +485,5 @@ typedef struct { } complex_double; void WINAPI DECLSPEC_NORETURN _CxxThrowException(void*,const cxx_exception_type*); +void __cdecl DECLSPEC_NORETURN _Xlength_error(const char*); void __cdecl DECLSPEC_NORETURN _Xmem(void); diff --git a/dlls/msvcp60/string.c b/dlls/msvcp60/string.c index f162939bdc0..22cdcd49891 100644 --- a/dlls/msvcp60/string.c +++ b/dlls/msvcp60/string.c @@ -55,10 +55,8 @@ void __cdecl _Xran(void) /* ?_Xlen@std@@YAXXZ */ void __cdecl _Xlen(void) { - static const char msg[] = "string too long"; - TRACE("\n"); - throw_exception(EXCEPTION_LENGTH_ERROR, msg); + _Xlength_error("string too long"); } /* ?compare@?$char_traits@D@std@@SAHPBD0I@Z */ diff --git a/dlls/msvcp90/cxx.h b/dlls/msvcp90/cxx.h index c1000579443..72e96133f8f 100644 --- a/dlls/msvcp90/cxx.h +++ b/dlls/msvcp90/cxx.h @@ -319,7 +319,6 @@ typedef enum __exception_type { EXCEPTION, EXCEPTION_BAD_CAST, EXCEPTION_LOGIC_ERROR, - EXCEPTION_LENGTH_ERROR, EXCEPTION_OUT_OF_RANGE, EXCEPTION_INVALID_ARGUMENT, EXCEPTION_RUNTIME_ERROR, diff --git a/dlls/msvcp90/exception.c b/dlls/msvcp90/exception.c index 748e0ccce3b..face3ea09b0 100644 --- a/dlls/msvcp90/exception.c +++ b/dlls/msvcp90/exception.c @@ -898,10 +898,15 @@ void __cdecl _Xinvalid_argument(const char *str) /* ?_Xlength_error@std@@YAXPBD@Z */ /* ?_Xlength_error@std@@YAXPEBD@Z */ -void __cdecl _Xlength_error(const char *str) +void __cdecl DECLSPEC_NORETURN _Xlength_error(const char *str) { + exception_name name = EXCEPTION_NAME(str); + length_error e; + TRACE("(%s)\n", debugstr_a(str)); - throw_exception(EXCEPTION_LENGTH_ERROR, str); + + MSVCP_length_error_ctor(&e, name); + _CxxThrowException(&e, &length_error_cxx_type); } /* ?_Xout_of_range@std@@YAXPBD@Z */ @@ -1066,11 +1071,6 @@ void throw_exception(exception_type et, const char *str) MSVCP_logic_error_ctor(&e, name); _CxxThrowException(&e, &logic_error_cxx_type); } - case EXCEPTION_LENGTH_ERROR: { - length_error e; - MSVCP_length_error_ctor(&e, name); - _CxxThrowException(&e, &length_error_cxx_type); - } case EXCEPTION_OUT_OF_RANGE: { out_of_range e; MSVCP_out_of_range_ctor(&e, name); diff --git a/dlls/msvcp90/msvcp90.h b/dlls/msvcp90/msvcp90.h index 9954eb9c777..410c406d86c 100644 --- a/dlls/msvcp90/msvcp90.h +++ b/dlls/msvcp90/msvcp90.h @@ -664,4 +664,5 @@ static inline int mbstowcs_wrapper( size_t *ret, wchar_t *wcs, size_t size, cons #endif void WINAPI DECLSPEC_NORETURN _CxxThrowException(void*,const cxx_exception_type*); +void __cdecl DECLSPEC_NORETURN _Xlength_error(const char*); void __cdecl DECLSPEC_NORETURN _Xmem(void); diff --git a/dlls/msvcp90/string.c b/dlls/msvcp90/string.c index ce706e140a3..89aacdd7cb7 100644 --- a/dlls/msvcp90/string.c +++ b/dlls/msvcp90/string.c @@ -454,10 +454,8 @@ unsigned short CDECL MSVCP_char_traits_short_not_eof(const unsigned short *in) /* ?_Xlen@_String_base@std@@SAXXZ */ void CDECL MSVCP__String_base_Xlen(void) { - static const char msg[] = "string too long"; - TRACE("\n"); - throw_exception(EXCEPTION_LENGTH_ERROR, msg); + _Xlength_error("string too long"); } /* ?_Xlen@_String_base@std@@QBEXXZ */
1
0
0
0
← Newer
1
...
11
12
13
14
15
16
17
...
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