gdi32: Make the PS_NULL test pass under Wine.

This commit is contained in:
Dmitry Timoshkov 2008-10-01 03:09:02 +09:00 committed by Alexandre Julliard
parent 8c90767c3d
commit 40e1e39785
2 changed files with 6 additions and 2 deletions

View File

@ -80,6 +80,12 @@ HPEN WINAPI CreatePenIndirect( const LOGPEN * pen )
PENOBJ * penPtr; PENOBJ * penPtr;
HPEN hpen; HPEN hpen;
if (pen->lopnStyle == PS_NULL)
{
hpen = GetStockObject(NULL_PEN);
if (hpen) return hpen;
}
if (!(penPtr = GDI_AllocObject( sizeof(PENOBJ), PEN_MAGIC, (HGDIOBJ *)&hpen, if (!(penPtr = GDI_AllocObject( sizeof(PENOBJ), PEN_MAGIC, (HGDIOBJ *)&hpen,
&pen_funcs ))) return 0; &pen_funcs ))) return 0;
if (pen->lopnStyle == PS_USERSTYLE || pen->lopnStyle == PS_ALTERNATE) if (pen->lopnStyle == PS_USERSTYLE || pen->lopnStyle == PS_ALTERNATE)

View File

@ -144,7 +144,6 @@ static void test_logpen(void)
/* for some reason XP differentiates PS_NULL here */ /* for some reason XP differentiates PS_NULL here */
if (pen[i].style == PS_NULL) if (pen[i].style == PS_NULL)
{ {
todo_wine
ok(hpen == GetStockObject(NULL_PEN), "hpen should be a stock NULL_PEN\n"); ok(hpen == GetStockObject(NULL_PEN), "hpen should be a stock NULL_PEN\n");
ok(size == sizeof(EXTLOGPEN), "GetObject returned %d, error %d\n", size, GetLastError()); ok(size == sizeof(EXTLOGPEN), "GetObject returned %d, error %d\n", size, GetLastError());
ok(elp.elpPenStyle == pen[i].ret_style, "expected %u, got %u\n", pen[i].ret_style, elp.elpPenStyle); ok(elp.elpPenStyle == pen[i].ret_style, "expected %u, got %u\n", pen[i].ret_style, elp.elpPenStyle);
@ -210,7 +209,6 @@ static void test_logpen(void)
if (pen[i].style == PS_NULL) if (pen[i].style == PS_NULL)
{ {
ok(obj_type == OBJ_PEN, "wrong object type %u\n", obj_type); ok(obj_type == OBJ_PEN, "wrong object type %u\n", obj_type);
todo_wine
ok(hpen == GetStockObject(NULL_PEN), "hpen should be a stock NULL_PEN\n"); ok(hpen == GetStockObject(NULL_PEN), "hpen should be a stock NULL_PEN\n");
} }
else else