diff --git a/dlls/gdiplus/brush.c b/dlls/gdiplus/brush.c index b39df22625e..21c92b59b2a 100644 --- a/dlls/gdiplus/brush.c +++ b/dlls/gdiplus/brush.c @@ -21,6 +21,21 @@ #include "gdiplus.h" #include "gdiplus_private.h" +GpStatus WINGDIPAPI GdipCloneBrush(GpBrush *brush, GpBrush **clone) +{ + if(!brush || !clone) + return InvalidParameter; + + *clone = GdipAlloc(sizeof(GpBrush)); + if (!*clone) return OutOfMemory; + + memcpy(*clone, brush, sizeof(GpBrush)); + + (*clone)->gdibrush = CreateBrushIndirect(&(*clone)->lb); + + return Ok; +} + GpStatus WINGDIPAPI GdipCreateSolidFill(ARGB color, GpSolidFill **sf) { COLORREF col = ARGB2COLORREF(color); diff --git a/dlls/gdiplus/gdiplus.spec b/dlls/gdiplus/gdiplus.spec index 755a70d3e50..a0f57af904d 100644 --- a/dlls/gdiplus/gdiplus.spec +++ b/dlls/gdiplus/gdiplus.spec @@ -43,7 +43,7 @@ @ stub GdipClearPathMarkers @ stub GdipCloneBitmapArea @ stub GdipCloneBitmapAreaI -@ stub GdipCloneBrush +@ stdcall GdipCloneBrush(ptr ptr) @ stdcall GdipCloneCustomLineCap(ptr ptr) @ stub GdipCloneFont @ stub GdipCloneFontFamily diff --git a/include/gdiplusflat.h b/include/gdiplusflat.h index 365e81a0661..d18182577b7 100644 --- a/include/gdiplusflat.h +++ b/include/gdiplusflat.h @@ -64,6 +64,7 @@ GpStatus WINGDIPAPI GdipSetInterpolationMode(GpGraphics*,InterpolationMode); GpStatus WINGDIPAPI GdipSetPixelOffsetMode(GpGraphics*,PixelOffsetMode); GpStatus WINGDIPAPI GdipSetSmoothingMode(GpGraphics*,SmoothingMode); +GpStatus WINGDIPAPI GdipCloneBrush(GpBrush*,GpBrush**); GpStatus WINGDIPAPI GdipCreateSolidFill(ARGB,GpSolidFill**); GpStatus WINGDIPAPI GdipGetBrushType(GpBrush*,GpBrushType*); GpStatus WINGDIPAPI GdipDeleteBrush(GpBrush*);