gdi32: Fix SetPixel error return value.

Signed-off-by: Jacek Caban <jacek@codeweavers.com>
Signed-off-by: Huw Davies <huw@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
Jacek Caban 2021-06-11 19:55:29 +02:00 committed by Alexandre Julliard
parent f5bd0be6a4
commit ce94c78b2e
2 changed files with 11 additions and 1 deletions

View File

@ -453,7 +453,7 @@ COLORREF WINAPI SetPixel( HDC hdc, INT x, INT y, COLORREF color )
COLORREF ret;
DC * dc = get_dc_ptr( hdc );
if (!dc) return 0;
if (!dc) return ~0;
update_dc( dc );
physdev = GET_DC_PHYSDEV( dc, pSetPixel );
ret = physdev->funcs->pSetPixel( physdev, x, y, color );

View File

@ -1672,6 +1672,15 @@ static void test_clip_box(void)
DeleteObject(bitmap);
}
static void test_SetPixel(void)
{
COLORREF c;
c = SetPixel((HDC)0xdeadbeef, 0, 0, 0);
ok(c == ~0, "SetPixel returned: %x\n", c);
}
START_TEST(dc)
{
test_dc_values();
@ -1688,4 +1697,5 @@ START_TEST(dc)
test_printer_dc();
test_pscript_printer_dc();
test_clip_box();
test_SetPixel();
}