diff --git a/dlls/gdiplus/customlinecap.c b/dlls/gdiplus/customlinecap.c index 2a0cfb25876..76e2c1d2c73 100644 --- a/dlls/gdiplus/customlinecap.c +++ b/dlls/gdiplus/customlinecap.c @@ -24,6 +24,34 @@ #include "gdiplus.h" #include "gdiplus_private.h" +GpStatus WINGDIPAPI GdipCloneCustomLineCap(GpCustomLineCap* from, + GpCustomLineCap** to) +{ + if(!from || !to) + return InvalidParameter; + + *to = GdipAlloc(sizeof(GpCustomLineCap)); + if(!*to) return OutOfMemory; + + memcpy(*to, from, sizeof(GpCustomLineCap)); + + (*to)->pathdata.Points = GdipAlloc(from->pathdata.Count * sizeof(PointF)); + (*to)->pathdata.Types = GdipAlloc(from->pathdata.Count); + + if((!(*to)->pathdata.Types || !(*to)->pathdata.Points) && (*to)->pathdata.Count){ + GdipFree((*to)->pathdata.Points); + GdipFree((*to)->pathdata.Types); + GdipFree(*to); + return OutOfMemory; + } + + memcpy((*to)->pathdata.Points, from->pathdata.Points, from->pathdata.Count + * sizeof(PointF)); + memcpy((*to)->pathdata.Types, from->pathdata.Types, from->pathdata.Count); + + return Ok; +} + GpStatus WINGDIPAPI GdipCreateCustomLineCap(GpPath* fillPath, GpPath* strokePath, GpLineCap baseCap, REAL baseInset, GpCustomLineCap **customCap) { diff --git a/dlls/gdiplus/gdiplus.spec b/dlls/gdiplus/gdiplus.spec index d80784eb731..1d8e4240133 100644 --- a/dlls/gdiplus/gdiplus.spec +++ b/dlls/gdiplus/gdiplus.spec @@ -44,7 +44,7 @@ @ stub GdipCloneBitmapArea @ stub GdipCloneBitmapAreaI @ stub GdipCloneBrush -@ stub GdipCloneCustomLineCap +@ stdcall GdipCloneCustomLineCap(ptr ptr) @ stub GdipCloneFont @ stub GdipCloneFontFamily @ stub GdipCloneImage diff --git a/include/gdiplusflat.h b/include/gdiplusflat.h index 136f4695f74..901e03bdb79 100644 --- a/include/gdiplusflat.h +++ b/include/gdiplusflat.h @@ -101,6 +101,7 @@ GpStatus WINGDIPAPI GdipPathIterCopyData(GpPathIterator*,INT*,GpPointF*,BYTE*, GpStatus WINGDIPAPI GdipPathIterNextSubpath(GpPathIterator*,INT*,INT*,INT*,BOOL*); GpStatus WINGDIPAPI GdipPathIterRewind(GpPathIterator*); +GpStatus WINGDIPAPI GdipCloneCustomLineCap(GpCustomLineCap*,GpCustomLineCap**); GpStatus WINGDIPAPI GdipCreateCustomLineCap(GpPath*,GpPath*,GpLineCap,REAL, GpCustomLineCap**); GpStatus WINGDIPAPI GdipDeleteCustomLineCap(GpCustomLineCap*);