+ new_blendfac = GdipAlloc(count * sizeof(REAL));
+ new_blendpos = GdipAlloc(count * sizeof(REAL));
+
+ if (!new_blendfac || !new_blendpos)
+ {
+ GdipFree(new_blendfac);
+ GdipFree(new_blendpos);
+ return OutOfMemory;
+ }
+
+ memcpy(new_blendfac, factors, count * sizeof(REAL));
+ memcpy(new_blendpos, positions, count * sizeof(REAL));
+
+ GdipFree(brush->blendfac);
+ GdipFree(brush->blendpos);
+
+ brush->blendcount = count;
+ brush->blendfac = new_blendfac;
+ brush->blendpos = new_blendpos;
+
+ return Ok;
+}
+
+GpStatus WINGDIPAPI GdipGetLineBlend(GpLineGradient *brush, REAL *factors,
+ REAL *positions, INT count)
+{
+ TRACE("(%p, %p, %p, %i)\n", brush, factors, positions, count);
+
+ if (!brush || !factors || !positions || count <= 0)
+ return InvalidParameter;
+
+ if (count < brush->blendcount)
+ return InsufficientBuffer;
+
+ memcpy(factors, brush->blendfac, brush->blendcount * sizeof(REAL));
+ memcpy(positions, brush->blendpos, brush->blendcount * sizeof(REAL));
+
+ return Ok;
+}
+
+GpStatus WINGDIPAPI GdipGetLineBlendCount(GpLineGradient *brush, INT *count)
+{
+ TRACE("(%p, %p)\n", brush, count);
+
+ if (!brush || !count)
+ return InvalidParameter;
+
+ *count = brush->blendcount;