gdiplus: Add parameter checking to GdipGetRegionHRgn.
This commit is contained in:
parent
25f7ad44e5
commit
5c75277784
|
@ -775,6 +775,9 @@ GpStatus WINGDIPAPI GdipGetRegionHRgn(GpRegion *region, GpGraphics *graphics, HR
|
||||||
{
|
{
|
||||||
FIXME("(%p, %p, %p): stub\n", region, graphics, hrgn);
|
FIXME("(%p, %p, %p): stub\n", region, graphics, hrgn);
|
||||||
|
|
||||||
|
if (!region || !hrgn)
|
||||||
|
return InvalidParameter;
|
||||||
|
|
||||||
*hrgn = NULL;
|
*hrgn = NULL;
|
||||||
return NotImplemented;
|
return NotImplemented;
|
||||||
}
|
}
|
||||||
|
|
|
@ -743,6 +743,42 @@ todo_wine{
|
||||||
DeleteObject((HGDIOBJ)hrgn);
|
DeleteObject((HGDIOBJ)hrgn);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static void test_gethrgn(void)
|
||||||
|
{
|
||||||
|
GpStatus status;
|
||||||
|
GpRegion *region;
|
||||||
|
GpGraphics *graphics;
|
||||||
|
HRGN hrgn;
|
||||||
|
HDC hdc=GetDC(0);
|
||||||
|
|
||||||
|
status = GdipCreateFromHDC(hdc, &graphics);
|
||||||
|
ok(status == Ok, "status %08x\n", status);
|
||||||
|
|
||||||
|
status = GdipCreateRegion(®ion);
|
||||||
|
ok(status == Ok, "status %08x\n", status);
|
||||||
|
|
||||||
|
status = GdipGetRegionHRgn(NULL, graphics, &hrgn);
|
||||||
|
ok(status == InvalidParameter, "status %08x\n", status);
|
||||||
|
status = GdipGetRegionHRgn(region, graphics, NULL);
|
||||||
|
ok(status == InvalidParameter, "status %08x\n", status);
|
||||||
|
|
||||||
|
hrgn = NULL;
|
||||||
|
status = GdipGetRegionHRgn(region, NULL, &hrgn);
|
||||||
|
todo_wine ok(status == Ok, "status %08x\n", status);
|
||||||
|
DeleteObject(hrgn);
|
||||||
|
|
||||||
|
hrgn = NULL;
|
||||||
|
status = GdipGetRegionHRgn(region, graphics, &hrgn);
|
||||||
|
todo_wine ok(status == Ok, "status %08x\n", status);
|
||||||
|
DeleteObject(hrgn);
|
||||||
|
|
||||||
|
status = GdipDeleteRegion(region);
|
||||||
|
ok(status == Ok, "status %08x\n", status);
|
||||||
|
status = GdipDeleteGraphics(graphics);
|
||||||
|
ok(status == Ok, "status %08x\n", status);
|
||||||
|
ReleaseDC(0, hdc);
|
||||||
|
}
|
||||||
|
|
||||||
START_TEST(region)
|
START_TEST(region)
|
||||||
{
|
{
|
||||||
struct GdiplusStartupInput gdiplusStartupInput;
|
struct GdiplusStartupInput gdiplusStartupInput;
|
||||||
|
@ -760,7 +796,7 @@ START_TEST(region)
|
||||||
test_isempty();
|
test_isempty();
|
||||||
test_combinereplace();
|
test_combinereplace();
|
||||||
test_fromhrgn();
|
test_fromhrgn();
|
||||||
|
test_gethrgn();
|
||||||
|
|
||||||
GdiplusShutdown(gdiplusToken);
|
GdiplusShutdown(gdiplusToken);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue