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
May 2024
----- 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
705 discussions
Start a n
N
ew thread
Esme Povirk : gdiplus: Bracket HDC use in draw_cap.
by Alexandre Julliard
08 May '24
08 May '24
Module: wine Branch: master Commit: 646729f3f2b3529f24d1bc88b54bb1ba4325c84a URL:
https://gitlab.winehq.org/wine/wine/-/commit/646729f3f2b3529f24d1bc88b54bb1…
Author: Esme Povirk <esme(a)codeweavers.com> Date: Thu May 2 14:47:00 2024 -0500 gdiplus: Bracket HDC use in draw_cap. --- dlls/gdiplus/graphics.c | 33 +++++++++++++++++++-------------- 1 file changed, 19 insertions(+), 14 deletions(-) diff --git a/dlls/gdiplus/graphics.c b/dlls/gdiplus/graphics.c index 48d425341f8..bd77758eb51 100644 --- a/dlls/gdiplus/graphics.c +++ b/dlls/gdiplus/graphics.c @@ -1667,6 +1667,7 @@ static GpStatus brush_fill_pixels(GpGraphics *graphics, GpBrush *brush, static void draw_cap(GpGraphics *graphics, COLORREF color, GpLineCap cap, REAL size, const GpCustomLineCap *custom, REAL x1, REAL y1, REAL x2, REAL y2) { + HDC hdc; HGDIOBJ oldbrush = NULL, oldpen = NULL; GpMatrix matrix; HBRUSH brush = NULL; @@ -1682,6 +1683,8 @@ static void draw_cap(GpGraphics *graphics, COLORREF color, GpLineCap cap, REAL s if((x1 == x2) && (y1 == y2)) return; + gdi_dc_acquire(graphics, &hdc); + theta = gdiplus_atan2(y2 - y1, x2 - x1); customstroke = (cap == LineCapCustom) && custom && (!custom->fill); @@ -1693,8 +1696,8 @@ static void draw_cap(GpGraphics *graphics, COLORREF color, GpLineCap cap, REAL s pen = ExtCreatePen(PS_GEOMETRIC | PS_SOLID | PS_ENDCAP_FLAT | PS_JOIN_MITER, 1, &lb, 0, NULL); - oldbrush = SelectObject(graphics->hdc, brush); - oldpen = SelectObject(graphics->hdc, pen); + oldbrush = SelectObject(hdc, brush); + oldpen = SelectObject(hdc, pen); } switch(cap){ @@ -1729,7 +1732,7 @@ static void draw_cap(GpGraphics *graphics, COLORREF color, GpLineCap cap, REAL s round_points(pt, ptf, 4); - Polygon(graphics->hdc, pt, 4); + Polygon(hdc, pt, 4); break; case LineCapArrowAnchor: @@ -1754,7 +1757,7 @@ static void draw_cap(GpGraphics *graphics, COLORREF color, GpLineCap cap, REAL s round_points(pt, ptf, 3); - Polygon(graphics->hdc, pt, 3); + Polygon(hdc, pt, 3); break; case LineCapRoundAnchor: @@ -1769,7 +1772,7 @@ static void draw_cap(GpGraphics *graphics, COLORREF color, GpLineCap cap, REAL s round_points(pt, ptf, 2); - Ellipse(graphics->hdc, pt[0].x, pt[0].y, pt[1].x, pt[1].y); + Ellipse(hdc, pt[0].x, pt[0].y, pt[1].x, pt[1].y); break; case LineCapTriangle: @@ -1792,7 +1795,7 @@ static void draw_cap(GpGraphics *graphics, COLORREF color, GpLineCap cap, REAL s round_points(pt, ptf, 3); - Polygon(graphics->hdc, pt, 3); + Polygon(hdc, pt, 3); break; case LineCapRound: @@ -1815,7 +1818,7 @@ static void draw_cap(GpGraphics *graphics, COLORREF color, GpLineCap cap, REAL s round_points(pt, ptf, 4); - Pie(graphics->hdc, pt[0].x, pt[0].y, pt[1].x, pt[1].y, pt[2].x, + Pie(hdc, pt[0].x, pt[0].y, pt[1].x, pt[1].y, pt[2].x, pt[2].y, pt[3].x, pt[3].y); break; @@ -1855,13 +1858,13 @@ static void draw_cap(GpGraphics *graphics, COLORREF color, GpLineCap cap, REAL s tp[i] = convert_path_point_type(custom->pathdata.Types[i]); if(custom->fill){ - BeginPath(graphics->hdc); - PolyDraw(graphics->hdc, custpt, tp, count); - EndPath(graphics->hdc); - StrokeAndFillPath(graphics->hdc); + BeginPath(hdc); + PolyDraw(hdc, custpt, tp, count); + EndPath(hdc); + StrokeAndFillPath(hdc); } else - PolyDraw(graphics->hdc, custpt, tp, count); + PolyDraw(hdc, custpt, tp, count); custend: free(custptf); @@ -1873,11 +1876,13 @@ custend: } if(!customstroke){ - SelectObject(graphics->hdc, oldbrush); - SelectObject(graphics->hdc, oldpen); + SelectObject(hdc, oldbrush); + SelectObject(hdc, oldpen); DeleteObject(brush); DeleteObject(pen); } + + gdi_dc_release(graphics, hdc); } /* Shortens the line by the given percent by changing x2, y2.
1
0
0
0
Esme Povirk : gdiplus: Bracket hdc use in brush_fill_path.
by Alexandre Julliard
08 May '24
08 May '24
Module: wine Branch: master Commit: a4ed61f39a3588bfa9a2c38e961f6a7b9690626c URL:
https://gitlab.winehq.org/wine/wine/-/commit/a4ed61f39a3588bfa9a2c38e961f6a…
Author: Esme Povirk <esme(a)codeweavers.com> Date: Thu May 2 14:39:47 2024 -0500 gdiplus: Bracket hdc use in brush_fill_path. --- dlls/gdiplus/graphics.c | 30 +++++++++++++++++++----------- 1 file changed, 19 insertions(+), 11 deletions(-) diff --git a/dlls/gdiplus/graphics.c b/dlls/gdiplus/graphics.c index 78e3b07222d..48d425341f8 100644 --- a/dlls/gdiplus/graphics.c +++ b/dlls/gdiplus/graphics.c @@ -1150,7 +1150,13 @@ static BOOL brush_can_fill_path(GpBrush *brush, BOOL is_fill) static GpStatus brush_fill_path(GpGraphics *graphics, GpBrush *brush) { - GpStatus status = Ok; + HDC hdc; + GpStatus status; + + status = gdi_dc_acquire(graphics, &hdc); + if (status != Ok) + return status; + switch (brush->bt) { case BrushTypeSolidColor: @@ -1163,27 +1169,27 @@ static GpStatus brush_fill_path(GpGraphics *graphics, GpBrush *brush) RECT rc; /* partially transparent fill */ - if (!SelectClipPath(graphics->hdc, RGN_AND)) + if (!SelectClipPath(hdc, RGN_AND)) { status = GenericError; DeleteObject(bmp); break; } - if (GetClipBox(graphics->hdc, &rc) != NULLREGION) + if (GetClipBox(hdc, &rc) != NULLREGION) { - HDC hdc = CreateCompatibleDC(NULL); + HDC src_hdc = CreateCompatibleDC(NULL); - if (!hdc) + if (!src_hdc) { status = OutOfMemory; DeleteObject(bmp); break; } - SelectObject(hdc, bmp); + SelectObject(src_hdc, bmp); gdi_alpha_blend(graphics, rc.left, rc.top, rc.right - rc.left, rc.bottom - rc.top, - hdc, 0, 0, 1, 1); - DeleteDC(hdc); + src_hdc, 0, 0, 1, 1); + DeleteDC(src_hdc); } DeleteObject(bmp); @@ -1202,14 +1208,16 @@ static GpStatus brush_fill_path(GpGraphics *graphics, GpBrush *brush) break; } - old_brush = SelectObject(graphics->hdc, gdibrush); - FillPath(graphics->hdc); - SelectObject(graphics->hdc, old_brush); + old_brush = SelectObject(hdc, gdibrush); + FillPath(hdc); + SelectObject(hdc, old_brush); DeleteObject(gdibrush); break; } } + gdi_dc_release(graphics, hdc); + return status; }
1
0
0
0
Esme Povirk : gdiplus: Bracket HDC use in alpha_blend_pixels_hrgn.
by Alexandre Julliard
08 May '24
08 May '24
Module: wine Branch: master Commit: ed3cd9b35f095c5258ad48b5283e1bbd84646046 URL:
https://gitlab.winehq.org/wine/wine/-/commit/ed3cd9b35f095c5258ad48b5283e1b…
Author: Esme Povirk <esme(a)codeweavers.com> Date: Thu May 2 14:25:33 2024 -0500 gdiplus: Bracket HDC use in alpha_blend_pixels_hrgn. --- dlls/gdiplus/graphics.c | 19 +++++++++++++++---- 1 file changed, 15 insertions(+), 4 deletions(-) diff --git a/dlls/gdiplus/graphics.c b/dlls/gdiplus/graphics.c index 3c00eddddf4..78e3b07222d 100644 --- a/dlls/gdiplus/graphics.c +++ b/dlls/gdiplus/graphics.c @@ -591,28 +591,39 @@ static GpStatus alpha_blend_pixels_hrgn(GpGraphics *graphics, INT dst_x, INT dst } else { + HDC hdc; HRGN hrgn; int save; + stat = gdi_dc_acquire(graphics, &hdc); + + if (stat != Ok) + return stat; + stat = get_clip_hrgn(graphics, &hrgn); if (stat != Ok) + { + gdi_dc_release(graphics, hdc); return stat; + } - save = SaveDC(graphics->hdc); + save = SaveDC(hdc); - ExtSelectClipRgn(graphics->hdc, hrgn, RGN_COPY); + ExtSelectClipRgn(hdc, hrgn, RGN_COPY); if (hregion) - ExtSelectClipRgn(graphics->hdc, hregion, RGN_AND); + ExtSelectClipRgn(hdc, hregion, RGN_AND); stat = alpha_blend_hdc_pixels(graphics, dst_x, dst_y, src, src_width, src_height, src_stride, fmt); - RestoreDC(graphics->hdc, save); + RestoreDC(hdc, save); DeleteObject(hrgn); + gdi_dc_release(graphics, hdc); + return stat; } }
1
0
0
0
Esme Povirk : gdiplus: Bracket HDC use in gdi_alpha_blend.
by Alexandre Julliard
08 May '24
08 May '24
Module: wine Branch: master Commit: af6aaf779d42780d45d7177b9c50dffb0b98a473 URL:
https://gitlab.winehq.org/wine/wine/-/commit/af6aaf779d42780d45d7177b9c50df…
Author: Esme Povirk <esme(a)codeweavers.com> Date: Thu May 2 14:10:09 2024 -0500 gdiplus: Bracket HDC use in gdi_alpha_blend. --- dlls/gdiplus/graphics.c | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/dlls/gdiplus/graphics.c b/dlls/gdiplus/graphics.c index cf54334ae2e..3c00eddddf4 100644 --- a/dlls/gdiplus/graphics.c +++ b/dlls/gdiplus/graphics.c @@ -362,9 +362,14 @@ static void round_points(POINT *pti, GpPointF *ptf, INT count) static void gdi_alpha_blend(GpGraphics *graphics, INT dst_x, INT dst_y, INT dst_width, INT dst_height, HDC hdc, INT src_x, INT src_y, INT src_width, INT src_height) { + HDC dst_hdc; CompositingMode comp_mode; - INT technology = GetDeviceCaps(graphics->hdc, TECHNOLOGY); - INT shadeblendcaps = GetDeviceCaps(graphics->hdc, SHADEBLENDCAPS); + INT technology, shadeblendcaps; + + gdi_dc_acquire(graphics, &dst_hdc); + + technology = GetDeviceCaps(dst_hdc, TECHNOLOGY); + shadeblendcaps = GetDeviceCaps(dst_hdc, SHADEBLENDCAPS); GdipGetCompositingMode(graphics, &comp_mode); @@ -373,7 +378,7 @@ static void gdi_alpha_blend(GpGraphics *graphics, INT dst_x, INT dst_y, INT dst_ { TRACE("alpha blending not supported by device, fallback to StretchBlt\n"); - StretchBlt(graphics->hdc, dst_x, dst_y, dst_width, dst_height, + StretchBlt(dst_hdc, dst_x, dst_y, dst_width, dst_height, hdc, src_x, src_y, src_width, src_height, SRCCOPY); } else @@ -385,9 +390,11 @@ static void gdi_alpha_blend(GpGraphics *graphics, INT dst_x, INT dst_y, INT dst_ bf.SourceConstantAlpha = 255; bf.AlphaFormat = AC_SRC_ALPHA; - GdiAlphaBlend(graphics->hdc, dst_x, dst_y, dst_width, dst_height, + GdiAlphaBlend(dst_hdc, dst_x, dst_y, dst_width, dst_height, hdc, src_x, src_y, src_width, src_height, bf); } + + gdi_dc_release(graphics, dst_hdc); } static GpStatus get_clip_hrgn(GpGraphics *graphics, HRGN *hrgn)
1
0
0
0
Esme Povirk : gdiplus: Add a function to bracket HDC use.
by Alexandre Julliard
08 May '24
08 May '24
Module: wine Branch: master Commit: e29623bbeb46c498c881d545e8a6c408544e2089 URL:
https://gitlab.winehq.org/wine/wine/-/commit/e29623bbeb46c498c881d545e8a6c4…
Author: Esme Povirk <esme(a)codeweavers.com> Date: Thu May 2 13:44:54 2024 -0500 gdiplus: Add a function to bracket HDC use. --- dlls/gdiplus/gdiplus_private.h | 8 +++++++ dlls/gdiplus/graphics.c | 48 +++++++++++++++++++++++++++++++++--------- 2 files changed, 46 insertions(+), 10 deletions(-) diff --git a/dlls/gdiplus/gdiplus_private.h b/dlls/gdiplus/gdiplus_private.h index 0b302a405ea..c3b516a9a2b 100644 --- a/dlls/gdiplus/gdiplus_private.h +++ b/dlls/gdiplus/gdiplus_private.h @@ -62,6 +62,8 @@ extern REAL units_scale(GpUnit from, GpUnit to, REAL dpi, BOOL printer_display); #define WineCoordinateSpaceGdiDevice ((GpCoordinateSpace)4) +extern GpStatus gdi_dc_acquire(GpGraphics *graphics, HDC *hdc); +extern void gdi_dc_release(GpGraphics *graphics, HDC hdc); extern GpStatus gdi_transform_acquire(GpGraphics *graphics); extern GpStatus gdi_transform_release(GpGraphics *graphics); extern GpStatus get_graphics_transform(GpGraphics *graphics, GpCoordinateSpace dst_space, @@ -248,6 +250,7 @@ struct GpPen{ struct GpGraphics{ HDC hdc; HWND hwnd; + INT hdc_refs; BOOL owndc; BOOL alpha_hdc; BOOL printer_display; @@ -658,6 +661,11 @@ static inline void image_unlock(GpImage *image) ReleaseSRWLockExclusive(&image->lock); } +static inline BOOL has_gdi_dc(GpGraphics *graphics) +{ + return graphics->hdc != NULL; +} + static inline void set_rect(GpRectF *rect, REAL x, REAL y, REAL width, REAL height) { rect->X = x; diff --git a/dlls/gdiplus/graphics.c b/dlls/gdiplus/graphics.c index 0727b63ed4f..cf54334ae2e 100644 --- a/dlls/gdiplus/graphics.c +++ b/dlls/gdiplus/graphics.c @@ -19,6 +19,7 @@ #include <stdarg.h> #include <math.h> #include <limits.h> +#include <assert.h> #include "windef.h" #include "winbase.h" @@ -46,6 +47,25 @@ WINE_DEFAULT_DEBUG_CHANNEL(gdiplus); #define ANCHOR_WIDTH (2.0) #define MAX_ITERS (50) +GpStatus gdi_dc_acquire(GpGraphics *graphics, HDC *hdc) +{ + if (graphics->hdc != NULL) + { + *hdc = graphics->hdc; + graphics->hdc_refs++; + return Ok; + } + + *hdc = NULL; + return InvalidParameter; +} + +void gdi_dc_release(GpGraphics *graphics, HDC hdc) +{ + assert(graphics->hdc_refs > 0); + graphics->hdc_refs--; +} + static GpStatus draw_driver_string(GpGraphics *graphics, GDIPCONST UINT16 *text, INT length, GDIPCONST GpFont *font, GDIPCONST GpStringFormat *format, GDIPCONST GpBrush *brush, GDIPCONST PointF *positions, @@ -252,7 +272,7 @@ static HBRUSH create_gdi_brush(const GpBrush *brush, INT origin_x, INT origin_y) return gdibrush; } -static INT prepare_dc(GpGraphics *graphics, GpPen *pen) +static INT prepare_dc(GpGraphics *graphics, HDC hdc, GpPen *pen) { LOGBRUSH lb; HPEN gdipen; @@ -261,9 +281,9 @@ static INT prepare_dc(GpGraphics *graphics, GpPen *pen) GpPointF pt[2]; DWORD dash_array[MAX_DASHLEN]; - save_state = SaveDC(graphics->hdc); + save_state = SaveDC(hdc); - EndPath(graphics->hdc); + EndPath(hdc); if(pen->unit == UnitPixel){ width = pen->width; @@ -311,15 +331,15 @@ static INT prepare_dc(GpGraphics *graphics, GpPen *pen) free_gdi_logbrush(&lb); } - SelectObject(graphics->hdc, gdipen); + SelectObject(hdc, gdipen); return save_state; } -static void restore_dc(GpGraphics *graphics, INT state) +static void restore_dc(GpGraphics *graphics, HDC hdc, INT state) { - DeleteObject(SelectObject(graphics->hdc, GetStockObject(NULL_PEN))); - RestoreDC(graphics->hdc, state); + DeleteObject(SelectObject(hdc, GetStockObject(NULL_PEN))); + RestoreDC(hdc, state); } static void round_points(POINT *pti, GpPointF *ptf, INT count) @@ -2533,6 +2553,8 @@ GpStatus WINGDIPAPI GdipDeleteGraphics(GpGraphics *graphics) if(!graphics) return InvalidParameter; if(graphics->busy) return ObjectBusy; + assert(graphics->hdc_refs == 0); + if (is_metafile_graphics(graphics)) { stat = METAFILE_GraphicsDeleted((GpMetafile*)graphics->image); @@ -3633,11 +3655,16 @@ GpStatus WINGDIPAPI GdipDrawLinesI(GpGraphics *graphics, GpPen *pen, GDIPCONST static GpStatus GDI32_GdipDrawPath(GpGraphics *graphics, GpPen *pen, GpPath *path) { + HDC hdc; INT save_state; GpStatus retval; HRGN hrgn=NULL; - save_state = prepare_dc(graphics, pen); + retval = gdi_dc_acquire(graphics, &hdc); + if (retval != Ok) + return retval; + + save_state = prepare_dc(graphics, hdc, pen); retval = get_clip_hrgn(graphics, &hrgn); @@ -3654,8 +3681,9 @@ static GpStatus GDI32_GdipDrawPath(GpGraphics *graphics, GpPen *pen, GpPath *pat gdi_transform_release(graphics); end: - restore_dc(graphics, save_state); + restore_dc(graphics, hdc, save_state); DeleteObject(hrgn); + gdi_dc_release(graphics, hdc); return retval; } @@ -4069,7 +4097,7 @@ GpStatus WINGDIPAPI GdipDrawPath(GpGraphics *graphics, GpPen *pen, GpPath *path) if (is_metafile_graphics(graphics)) retval = METAFILE_DrawPath((GpMetafile*)graphics->image, pen, path); - else if (!graphics->hdc || graphics->alpha_hdc || !brush_can_fill_path(pen->brush, FALSE)) + else if (!has_gdi_dc(graphics) || graphics->alpha_hdc || !brush_can_fill_path(pen->brush, FALSE)) retval = SOFTWARE_GdipDrawPath(graphics, pen, path); else retval = GDI32_GdipDrawPath(graphics, pen, path);
1
0
0
0
Alexandre Julliard : ntdll: Generate dummy SMBIOS data on non-supported platforms.
by Alexandre Julliard
08 May '24
08 May '24
Module: wine Branch: master Commit: 6ab9a50d480107aaacf134ba74bc950b6c7c4235 URL:
https://gitlab.winehq.org/wine/wine/-/commit/6ab9a50d480107aaacf134ba74bc95…
Author: Alexandre Julliard <julliard(a)winehq.org> Date: Wed May 8 15:17:32 2024 +0200 ntdll: Generate dummy SMBIOS data on non-supported platforms. --- dlls/ntdll/unix/system.c | 17 +++++++++++++++-- 1 file changed, 15 insertions(+), 2 deletions(-) diff --git a/dlls/ntdll/unix/system.c b/dlls/ntdll/unix/system.c index ead3c97d9f2..280d1b7323a 100644 --- a/dlls/ntdll/unix/system.c +++ b/dlls/ntdll/unix/system.c @@ -1818,8 +1818,21 @@ static struct smbios_prologue *create_smbios_data(void) static struct smbios_prologue *create_smbios_data(void) { - FIXME("info_class SYSTEM_FIRMWARE_TABLE_INFORMATION\n"); - return NULL; + static const char *vendor = "The Wine project"; + static const char *product = "Wine"; + static const char *version = PACKAGE_VERSION; + static const char *serial = "0"; + GUID uuid = { 0 }; + BYTE chassis; + struct smbios_buffer buf = { 0 }; + + append_smbios_bios( &buf, vendor, version, "01/01/2021" ); + append_smbios_system( &buf, vendor, product, version, serial, "", "", &uuid ); + chassis = append_smbios_chassis( &buf, 0, vendor, version, serial, "" ); + append_smbios_board( &buf, chassis, vendor, product, version, serial, "" ); + append_smbios_boot_info( &buf ); + append_smbios_end( &buf ); + return buf.prologue; } #endif
1
0
0
0
Alexandre Julliard : ntdll: Build the SMBIOS table incrementally.
by Alexandre Julliard
08 May '24
08 May '24
Module: wine Branch: master Commit: 8e5f84ea3c0886131a367354943561eda3246720 URL:
https://gitlab.winehq.org/wine/wine/-/commit/8e5f84ea3c0886131a367354943561…
Author: Alexandre Julliard <julliard(a)winehq.org> Date: Wed May 8 15:12:09 2024 +0200 ntdll: Build the SMBIOS table incrementally. With helpers to create the various sections. --- dlls/ntdll/unix/system.c | 478 ++++++++++++++++++++--------------------------- 1 file changed, 204 insertions(+), 274 deletions(-)
1
0
0
0
Alexandre Julliard : ntdll: Cache the generated SMBIOS data.
by Alexandre Julliard
08 May '24
08 May '24
Module: wine Branch: master Commit: 49bb8f10db62eeed2a34037e46e83941606b6936 URL:
https://gitlab.winehq.org/wine/wine/-/commit/49bb8f10db62eeed2a34037e46e839…
Author: Alexandre Julliard <julliard(a)winehq.org> Date: Wed May 8 14:42:30 2024 +0200 ntdll: Cache the generated SMBIOS data. --- dlls/ntdll/unix/system.c | 241 +++++++++++++++++++++-------------------------- 1 file changed, 110 insertions(+), 131 deletions(-)
1
0
0
0
Alexandre Julliard : ntdll: Use null-terminated strings instead of explicit lengths to build SMBIOS data.
by Alexandre Julliard
08 May '24
08 May '24
Module: wine Branch: master Commit: b70f01cc122c0edb5a6db58707c2bfa23f082319 URL:
https://gitlab.winehq.org/wine/wine/-/commit/b70f01cc122c0edb5a6db58707c2bf…
Author: Alexandre Julliard <julliard(a)winehq.org> Date: Wed May 8 13:40:14 2024 +0200 ntdll: Use null-terminated strings instead of explicit lengths to build SMBIOS data. --- dlls/ntdll/unix/system.c | 242 +++++++++++++++++++---------------------------- 1 file changed, 99 insertions(+), 143 deletions(-)
1
0
0
0
Paul Gofman : xaudio2: Use FAudioVoice_DestroyVoiceSafeEXT() in destroy_voice().
by Alexandre Julliard
08 May '24
08 May '24
Module: wine Branch: master Commit: b928f0eb08da9a10dae3cb7b33ec16b164a2fddd URL:
https://gitlab.winehq.org/wine/wine/-/commit/b928f0eb08da9a10dae3cb7b33ec16…
Author: Paul Gofman <pgofman(a)codeweavers.com> Date: Mon Feb 26 19:34:40 2024 -0600 xaudio2: Use FAudioVoice_DestroyVoiceSafeEXT() in destroy_voice(). --- dlls/xaudio2_7/tests/xaudio2.c | 29 ++++++++++++++++++++++++++++- dlls/xaudio2_7/xaudio_dll.c | 6 +++++- 2 files changed, 33 insertions(+), 2 deletions(-) diff --git a/dlls/xaudio2_7/tests/xaudio2.c b/dlls/xaudio2_7/tests/xaudio2.c index 2b3102d21fe..62f766a827a 100644 --- a/dlls/xaudio2_7/tests/xaudio2.c +++ b/dlls/xaudio2_7/tests/xaudio2.c @@ -837,7 +837,9 @@ static void test_submix(IXAudio2 *xa) HRESULT hr; IXAudio2MasteringVoice *master; XAUDIO2_VOICE_DETAILS details; - IXAudio2SubmixVoice *sub; + IXAudio2SubmixVoice *sub, *sub2; + XAUDIO2_SEND_DESCRIPTOR send_desc = { 0 }; + XAUDIO2_VOICE_SENDS sends = { 1, &send_desc }; IXAudio2_StopEngine(xa); @@ -855,6 +857,31 @@ static void test_submix(IXAudio2 *xa) ok(details.InputChannels == 2, "Got wrong channel count: 0x%x\n", details.InputChannels); ok(details.InputSampleRate == 44100, "Got wrong sample rate: 0x%x\n", details.InputSampleRate); + hr = IXAudio2_CreateSubmixVoice(xa, &sub2, 2, 44100, 0, 0, NULL, NULL); + ok(hr == S_OK, "CreateSubmixVoice failed: %08lx\n", hr); + + send_desc.pOutputVoice = (IXAudio2Voice *)sub2; + hr = IXAudio2SubmixVoice_SetOutputVoices(sub, &sends); + ok(hr == S_OK, "CreateSubmixVoice failed: %08lx\n", hr); + + IXAudio2SubmixVoice_DestroyVoice(sub2); + /* The voice is not destroyed. */ + memset(&details, 0xcc, sizeof(details)); + IXAudio2SubmixVoice_GetVoiceDetails(sub2, &details); + ok(details.InputChannels == 2, "Got wrong channel count: 0x%x\n", details.InputChannels); + ok(details.InputSampleRate == 44100, "Got wrong sample rate: 0x%x\n", details.InputSampleRate); + + sends.SendCount = 0; + hr = IXAudio2SubmixVoice_SetOutputVoices(sub, &sends); + ok(hr == S_OK, "CreateSubmixVoice failed: %08lx\n", hr); + + IXAudio2SubmixVoice_DestroyVoice(sub2); + if (0) + { + /* Crashes on Windows and thus suggests that now the voice is actually destroyed. */ + IXAudio2SubmixVoice_GetVoiceDetails(sub2, &details); + } + IXAudio2SubmixVoice_DestroyVoice(sub); IXAudio2MasteringVoice_DestroyVoice(master); } diff --git a/dlls/xaudio2_7/xaudio_dll.c b/dlls/xaudio2_7/xaudio_dll.c index cd1c62f3cd4..a51bb499793 100644 --- a/dlls/xaudio2_7/xaudio_dll.c +++ b/dlls/xaudio2_7/xaudio_dll.c @@ -499,7 +499,11 @@ static const FAudioEngineCallback FAudioEngineCallback_Vtbl = { static inline void destroy_voice(XA2VoiceImpl *This) { - FAudioVoice_DestroyVoice(This->faudio_voice); + if (FAILED(FAudioVoice_DestroyVoiceSafeEXT(This->faudio_voice))) + { + ERR("Destroying voice %p failed.\n", This); + return; + } free_effect_chain(This->effect_chain); This->effect_chain = NULL; This->in_use = FALSE;
1
0
0
0
← Newer
1
...
55
56
57
58
59
60
61
...
71
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
Results per page:
10
25
50
100
200