From: Bartosz Kosiorek gang65@poczta.onet.pl
--- dlls/gdiplus/customlinecap.c | 3 ++- dlls/gdiplus/tests/customlinecap.c | 15 +++++++++++++++ 2 files changed, 17 insertions(+), 1 deletion(-)
diff --git a/dlls/gdiplus/customlinecap.c b/dlls/gdiplus/customlinecap.c index f35fea90eba..bf423cfb739 100644 --- a/dlls/gdiplus/customlinecap.c +++ b/dlls/gdiplus/customlinecap.c @@ -115,7 +115,8 @@ GpStatus WINGDIPAPI GdipCreateCustomLineCap(GpPath* fillPath, GpPath* strokePath
TRACE("%p %p %d %f %p\n", fillPath, strokePath, baseCap, baseInset, customCap);
- if(!customCap || !(fillPath || strokePath)) + /* The fillPath and strokePath parameters cannot be used at the same time */ + if (!customCap || !(fillPath || strokePath) || (fillPath && strokePath)) return InvalidParameter;
*customCap = heap_alloc_zero(sizeof(GpCustomLineCap)); diff --git a/dlls/gdiplus/tests/customlinecap.c b/dlls/gdiplus/tests/customlinecap.c index a8bb5cf371b..9585720d2a5 100644 --- a/dlls/gdiplus/tests/customlinecap.c +++ b/dlls/gdiplus/tests/customlinecap.c @@ -74,12 +74,27 @@ static void test_constructor_destructor(void) stat = GdipDeleteCustomLineCap(NULL); expect(InvalidParameter, stat);
+ /* The fillPath and strokePath parameters cannot be used at the same time */ + custom = NULL; + stat = GdipCreateCustomLineCap(path, path2, LineCapFlat, 0.0, &custom); + expect(InvalidParameter, stat); + ok(custom == NULL, "Expected a failure on creation\n"); + /* valid args */ + custom = NULL; stat = GdipCreateCustomLineCap(NULL, path2, LineCapFlat, 0.0, &custom); expect(Ok, stat); + ok(custom != NULL, "Custom line cap was not created\n"); stat = GdipDeleteCustomLineCap(custom); expect(Ok, stat); + /* it's strange but native returns NotImplemented on stroke == NULL */ + custom = NULL; + stat = GdipCreateCustomLineCap(path, NULL, LineCapTriangle, 0.0, &custom); + todo_wine expect(NotImplemented, stat); + todo_wine ok(custom == NULL, "Expected a failure on creation\n"); + if(stat == Ok) GdipDeleteCustomLineCap(custom); + custom = NULL; stat = GdipCreateCustomLineCap(path, NULL, LineCapFlat, 10.0, &custom); todo_wine expect(NotImplemented, stat);