Commit 5c637c22 authored by Eric Pouech's avatar Eric Pouech Committed by Alexandre Julliard

gdi32/tests: Enable compilation with long types.

parent 842452d4
EXTRADEFS = -DWINE_NO_LONG_TYPES
TESTDLL = gdi32.dll
IMPORTS = setupapi user32 gdi32 advapi32
......
This source diff could not be displayed because it is too large. You can view the blob instead.
......@@ -61,15 +61,15 @@ static void test_solidbrush(void)
stockBrush = NULL;
memset(&br, 0, sizeof(br));
ret = GetObjectW(solidBrush, sizeof(br), &br);
ok( ret !=0, "GetObject on solid %s brush failed, error=%d\n", stock[i].name, GetLastError());
ok( ret !=0, "GetObject on solid %s brush failed, error=%ld\n", stock[i].name, GetLastError());
ok(br.lbStyle==BS_SOLID, "%s brush has wrong style, got %d expected %d\n", stock[i].name, br.lbStyle, BS_SOLID);
ok(br.lbColor==stock[i].color, "%s brush has wrong color, got 0x%08x expected 0x%08x\n", stock[i].name, br.lbColor, stock[i].color);
ok(br.lbColor==stock[i].color, "%s brush has wrong color, got 0x%08lx expected 0x%08lx\n", stock[i].name, br.lbColor, stock[i].color);
if(stockBrush) {
/* Sanity check, make sure the colors being compared do in fact have a stock brush */
ret = GetObjectW(stockBrush, sizeof(br), &br);
ok( ret !=0, "GetObject on stock %s brush failed, error=%d\n", stock[i].name, GetLastError());
ok(br.lbColor==stock[i].color, "stock %s brush unexpected color, got 0x%08x expected 0x%08x\n", stock[i].name, br.lbColor, stock[i].color);
ok( ret !=0, "GetObject on stock %s brush failed, error=%ld\n", stock[i].name, GetLastError());
ok(br.lbColor==stock[i].color, "stock %s brush unexpected color, got 0x%08lx expected 0x%08lx\n", stock[i].name, br.lbColor, stock[i].color);
}
DeleteObject(solidBrush);
......@@ -92,26 +92,26 @@ static void test_hatch_brush(void)
brush = CreateHatchBrush( i, RGB(12,34,56) );
if (i < HS_API_MAX)
{
ok( brush != 0, "%u: CreateHatchBrush failed err %u\n", i, GetLastError() );
ok( brush != 0, "%u: CreateHatchBrush failed err %lu\n", i, GetLastError() );
size = GetObjectW( brush, sizeof(lb), &lb );
ok( size == sizeof(lb), "wrong size %u\n", size );
ok( lb.lbColor == RGB(12,34,56), "wrong color %08x\n", lb.lbColor );
ok( lb.lbColor == RGB(12,34,56), "wrong color %08lx\n", lb.lbColor );
if (i <= HS_DIAGCROSS)
{
ok( lb.lbStyle == BS_HATCHED, "wrong style %u\n", lb.lbStyle );
ok( lb.lbHatch == i, "wrong hatch %lu/%u\n", lb.lbHatch, i );
ok( lb.lbHatch == i, "wrong hatch %Iu/%u\n", lb.lbHatch, i );
}
else
{
ok( lb.lbStyle == BS_SOLID, "wrong style %u\n", lb.lbStyle );
ok( lb.lbHatch == 0, "wrong hatch %lu\n", lb.lbHatch );
ok( lb.lbHatch == 0, "wrong hatch %Iu\n", lb.lbHatch );
}
DeleteObject( brush );
}
else
{
ok( !brush, "%u: CreateHatchBrush succeeded\n", i );
ok( GetLastError() == 0xdeadbeef, "wrong error %u\n", GetLastError() );
ok( GetLastError() == 0xdeadbeef, "wrong error %lu\n", GetLastError() );
}
}
}
......@@ -141,7 +141,7 @@ static void test_pattern_brush(void)
ret = GetObjectW( brush, sizeof(br), &br );
ok( ret == sizeof(br), "wrong size %u\n", ret );
ok( br.lbStyle == BS_PATTERN, "wrong style %u\n", br.lbStyle );
ok( br.lbColor == 0, "wrong color %u\n", br.lbColor );
ok( br.lbColor == 0, "wrong color %lu\n", br.lbColor );
ok( (HBITMAP)br.lbHatch == bitmap, "wrong handle %p/%p\n", (HBITMAP)br.lbHatch, bitmap );
DeleteObject( brush );
......@@ -154,7 +154,7 @@ static void test_pattern_brush(void)
ret = GetObjectW( brush, sizeof(br), &br );
ok( ret == sizeof(br), "wrong size %u\n", ret );
ok( br.lbStyle == BS_PATTERN, "wrong style %u\n", br.lbStyle );
ok( br.lbColor == 0, "wrong color %u\n", br.lbColor );
ok( br.lbColor == 0, "wrong color %lu\n", br.lbColor );
ok( (HBITMAP)br.lbHatch == bitmap, "wrong handle %p/%p\n", (HBITMAP)br.lbHatch, bitmap );
ret = GetObjectW( bitmap, sizeof(dib), &dib );
ok( ret == sizeof(dib.dsBm), "wrong size %u\n", ret );
......@@ -180,7 +180,7 @@ static void test_pattern_brush(void)
ret = GetObjectW( brush, sizeof(br), &br );
ok( ret == sizeof(br), "wrong size %u\n", ret );
ok( br.lbStyle == BS_PATTERN, "wrong style %u\n", br.lbStyle );
ok( br.lbColor == 0, "wrong color %u\n", br.lbColor );
ok( br.lbColor == 0, "wrong color %lu\n", br.lbColor );
ok( (HBITMAP)br.lbHatch == bitmap, "wrong handle %p/%p\n", (HBITMAP)br.lbHatch, bitmap );
ret = GetObjectW( bitmap, sizeof(dib), &dib );
ok( ret == sizeof(dib), "wrong size %u\n", ret );
......@@ -193,7 +193,7 @@ static void test_pattern_brush(void)
ret = GetObjectW( brush, sizeof(br), &br );
ok( ret == sizeof(br), "wrong size %u\n", ret );
ok( br.lbStyle == BS_DIBPATTERN, "wrong style %u\n", br.lbStyle );
ok( br.lbColor == 0, "wrong color %u\n", br.lbColor );
ok( br.lbColor == 0, "wrong color %lu\n", br.lbColor );
ok( (BITMAPINFO *)br.lbHatch == info || broken(!br.lbHatch), /* nt4 */
"wrong handle %p/%p\n", (BITMAPINFO *)br.lbHatch, info );
DeleteObject( brush );
......@@ -207,7 +207,7 @@ static void test_pattern_brush(void)
ret = GetObjectW( brush, sizeof(br), &br );
ok( ret == sizeof(br), "wrong size %u\n", ret );
ok( br.lbStyle == BS_DIBPATTERN, "wrong style %u\n", br.lbStyle );
ok( br.lbColor == 0, "wrong color %u\n", br.lbColor );
ok( br.lbColor == 0, "wrong color %lu\n", br.lbColor );
ok( (BITMAPINFO *)br.lbHatch == info || broken(!br.lbHatch), /* nt4 */
"wrong handle %p/%p\n", (BITMAPINFO *)br.lbHatch, info );
......@@ -223,7 +223,7 @@ static void test_pattern_brush(void)
ret = GetObjectW( brush, sizeof(br), &br );
ok( ret == sizeof(br), "wrong size %u\n", ret );
ok( br.lbStyle == BS_DIBPATTERN, "wrong style %u\n", br.lbStyle );
ok( br.lbColor == 0, "wrong color %u\n", br.lbColor );
ok( br.lbColor == 0, "wrong color %lu\n", br.lbColor );
ok( (HGLOBAL)br.lbHatch != mem, "wrong handle %p/%p\n", (HGLOBAL)br.lbHatch, mem );
bits = GlobalLock( mem );
ok( (HGLOBAL)br.lbHatch == bits || broken(!br.lbHatch), /* nt4 */
......@@ -287,14 +287,14 @@ static void test_pattern_brush(void)
SetRect( &rect, 0, 0, 16, 16 );
brush = CreateSolidBrush( 0xff5511 );
result = FillRect( hdc, &rect, brush );
ok( result, "FillRect failed, error %d.\n", GetLastError() );
ok( result, "FillRect failed, error %ld.\n", GetLastError() );
DeleteObject( brush );
color = GetPixel( hdc, 10, 10 );
ok( color == 0xff5511, "Expected color %#x, got %#x.\n", 0xff5511, color );
ok( color == 0xff5511, "Expected color %#x, got %#lx.\n", 0xff5511, color );
/* Create a pattern brush with the first bitmap filled with 0xff5511 */
brush = CreatePatternBrush( bitmap );
ok( brush != NULL, "CreatePatternBrush failed, error %u.\n", GetLastError() );
ok( brush != NULL, "CreatePatternBrush failed, error %lu.\n", GetLastError() );
/* Delete the first bitmap used for pattern brush creation */
SelectObject( hdc, bitmap2 );
......@@ -303,7 +303,7 @@ static void test_pattern_brush(void)
memset( &br, 0, sizeof(br) );
ret = GetObjectW( brush, sizeof(br), &br );
ok( ret == sizeof(br), "wrong size %u\n", ret );
ok( br.lbColor == 0, "wrong color %u\n", br.lbColor );
ok( br.lbColor == 0, "wrong color %lu\n", br.lbColor );
ok( br.lbStyle == BS_PATTERN, "wrong style %u\n", br.lbStyle );
ok( (HBITMAP)br.lbHatch == bitmap, "wrong handle %p/%p\n", (HBITMAP)br.lbHatch, bitmap );
......@@ -315,17 +315,17 @@ static void test_pattern_brush(void)
/* Fill hdc with 0xabcdef */
brush2 = CreateSolidBrush( 0xabcdef );
result = FillRect( hdc, &rect, brush2 );
ok( result, "FillRect failed, error %d.\n", GetLastError() );
ok( result, "FillRect failed, error %ld.\n", GetLastError() );
color = GetPixel( hdc, 10, 10 );
ok( color == 0xabcdef, "Expected color %#x, got %#x.\n", 0xabcdef, color );
ok( color == 0xabcdef, "Expected color %#x, got %#lx.\n", 0xabcdef, color );
DeleteObject( brush2 );
/* Fill hdc with the brush created with the deleted bitmap */
/* FillRect() succeeds and hdc is filled with the deleted bitmap content */
result = FillRect( hdc, &rect, brush );
ok( result, "FillRect failed, error %d.\n", GetLastError() );
ok( result, "FillRect failed, error %ld.\n", GetLastError() );
color = GetPixel( hdc, 10, 10 );
ok( color == 0xff5511, "Expected color %#x, got %#x.\n", 0xff5511, color );
ok( color == 0xff5511, "Expected color %#x, got %#lx.\n", 0xff5511, color );
DeleteObject( brush );
SelectObject( hdc, old_bitmap );
......@@ -385,7 +385,7 @@ static void test_palette_brush(void)
DWORD expect = (pal->palPalEntry[255 - i].peRed << 16 |
pal->palPalEntry[255 - i].peGreen << 8 |
pal->palPalEntry[255 - i].peBlue);
ok( dib_bits[i] == expect, "wrong bits %x/%x at %u,%u\n", dib_bits[i], expect, i % 16, i / 16 );
ok( dib_bits[i] == expect, "wrong bits %lx/%lx at %u,%u\n", dib_bits[i], expect, i % 16, i / 16 );
}
for (i = 0; i < 256; i++) pal->palPalEntry[i].peRed = i * 3;
......@@ -398,7 +398,7 @@ static void test_palette_brush(void)
DWORD expect = (pal->palPalEntry[255 - i].peRed << 16 |
pal->palPalEntry[255 - i].peGreen << 8 |
pal->palPalEntry[255 - i].peBlue);
ok( dib_bits[i] == expect, "wrong bits %x/%x at %u,%u\n", dib_bits[i], expect, i % 16, i / 16 );
ok( dib_bits[i] == expect, "wrong bits %lx/%lx at %u,%u\n", dib_bits[i], expect, i % 16, i / 16 );
}
DeleteDC( hdc );
DeleteObject( dib );
......@@ -415,11 +415,11 @@ static void test_brush_org( void )
SetBrushOrgEx( hdc, 0, 0, &old );
SetBrushOrgEx( hdc, 1, 1, &pt );
ok( pt.x == 0 && pt.y == 0, "got %d,%d\n", pt.x, pt.y );
ok( pt.x == 0 && pt.y == 0, "got %ld,%ld\n", pt.x, pt.y );
SetBrushOrgEx( hdc, 0x10000, -1, &pt );
ok( pt.x == 1 && pt.y == 1, "got %d,%d\n", pt.x, pt.y );
ok( pt.x == 1 && pt.y == 1, "got %ld,%ld\n", pt.x, pt.y );
SetBrushOrgEx( hdc, old.x, old.y, &pt );
ok( pt.x == 0x10000 && pt.y == -1, "got %d,%d\n", pt.x, pt.y );
ok( pt.x == 0x10000 && pt.y == -1, "got %ld,%ld\n", pt.x, pt.y );
ReleaseDC( 0, hdc );
}
......
......@@ -132,19 +132,19 @@ static void verify_region(HRGN hrgn, const RECT *rc)
ret = GetRegionData(hrgn, 0, NULL);
if (IsRectEmpty(rc))
ok(ret == sizeof(rgn.data.rdh), "expected sizeof(rdh), got %u\n", ret);
ok(ret == sizeof(rgn.data.rdh), "expected sizeof(rdh), got %lu\n", ret);
else
ok(ret == sizeof(rgn.data.rdh) + sizeof(RECT), "expected sizeof(rgn), got %u\n", ret);
ok(ret == sizeof(rgn.data.rdh) + sizeof(RECT), "expected sizeof(rgn), got %lu\n", ret);
if (!ret) return;
ret = GetRegionData(hrgn, sizeof(rgn), &rgn.data);
if (IsRectEmpty(rc))
ok(ret == sizeof(rgn.data.rdh), "expected sizeof(rdh), got %u\n", ret);
ok(ret == sizeof(rgn.data.rdh), "expected sizeof(rdh), got %lu\n", ret);
else
ok(ret == sizeof(rgn.data.rdh) + sizeof(RECT), "expected sizeof(rgn), got %u\n", ret);
ok(ret == sizeof(rgn.data.rdh) + sizeof(RECT), "expected sizeof(rgn), got %lu\n", ret);
trace("size %u, type %u, count %u, rgn size %u, bound %s\n",
trace("size %lu, type %lu, count %lu, rgn size %lu, bound %s\n",
rgn.data.rdh.dwSize, rgn.data.rdh.iType, rgn.data.rdh.nCount, rgn.data.rdh.nRgnSize,
wine_dbgstr_rect(&rgn.data.rdh.rcBound));
if (rgn.data.rdh.nCount != 0)
......@@ -154,21 +154,21 @@ static void verify_region(HRGN hrgn, const RECT *rc)
ok(EqualRect(rect, rc), "rects don't match\n");
}
ok(rgn.data.rdh.dwSize == sizeof(rgn.data.rdh), "expected sizeof(rdh), got %u\n", rgn.data.rdh.dwSize);
ok(rgn.data.rdh.iType == RDH_RECTANGLES, "expected RDH_RECTANGLES, got %u\n", rgn.data.rdh.iType);
ok(rgn.data.rdh.dwSize == sizeof(rgn.data.rdh), "expected sizeof(rdh), got %lu\n", rgn.data.rdh.dwSize);
ok(rgn.data.rdh.iType == RDH_RECTANGLES, "expected RDH_RECTANGLES, got %lu\n", rgn.data.rdh.iType);
if (IsRectEmpty(rc))
{
ok(rgn.data.rdh.nCount == 0, "expected 0, got %u\n", rgn.data.rdh.nCount);
ok(rgn.data.rdh.nCount == 0, "expected 0, got %lu\n", rgn.data.rdh.nCount);
ok(rgn.data.rdh.nRgnSize == 0 ||
broken(rgn.data.rdh.nRgnSize == 168), /* NT4 */
"expected 0, got %u\n", rgn.data.rdh.nRgnSize);
"expected 0, got %lu\n", rgn.data.rdh.nRgnSize);
}
else
{
ok(rgn.data.rdh.nCount == 1, "expected 1, got %u\n", rgn.data.rdh.nCount);
ok(rgn.data.rdh.nCount == 1, "expected 1, got %lu\n", rgn.data.rdh.nCount);
ok(rgn.data.rdh.nRgnSize == sizeof(RECT) ||
broken(rgn.data.rdh.nRgnSize == 168), /* NT4 */
"expected sizeof(RECT), got %u\n", rgn.data.rdh.nRgnSize);
"expected sizeof(RECT), got %lu\n", rgn.data.rdh.nRgnSize);
}
ok(EqualRect(&rgn.data.rdh.rcBound, rc), "rects don't match\n");
}
......@@ -190,7 +190,7 @@ static void test_ExtCreateRegion(void)
SetLastError(0xdeadbeef);
hrgn = ExtCreateRegion(NULL, 0, NULL);
ok(!hrgn, "ExtCreateRegion should fail\n");
ok(GetLastError() == ERROR_INVALID_PARAMETER, "ERROR_INVALID_PARAMETER, got %u\n", GetLastError());
ok(GetLastError() == ERROR_INVALID_PARAMETER, "ERROR_INVALID_PARAMETER, got %lu\n", GetLastError());
rgn.data.rdh.dwSize = 0;
rgn.data.rdh.iType = 0;
......@@ -202,14 +202,14 @@ static void test_ExtCreateRegion(void)
SetLastError(0xdeadbeef);
hrgn = ExtCreateRegion(NULL, sizeof(rgn), &rgn.data);
ok(!hrgn, "ExtCreateRegion should fail\n");
ok(GetLastError() == 0xdeadbeef, "0xdeadbeef, got %u\n", GetLastError());
ok(GetLastError() == 0xdeadbeef, "0xdeadbeef, got %lu\n", GetLastError());
rgn.data.rdh.dwSize = sizeof(rgn.data.rdh) - 1;
SetLastError(0xdeadbeef);
hrgn = ExtCreateRegion(NULL, sizeof(rgn), &rgn.data);
ok(!hrgn, "ExtCreateRegion should fail\n");
ok(GetLastError() == 0xdeadbeef, "0xdeadbeef, got %u\n", GetLastError());
ok(GetLastError() == 0xdeadbeef, "0xdeadbeef, got %lu\n", GetLastError());
/* although XP doesn't care about the type Win9x does */
rgn.data.rdh.iType = RDH_RECTANGLES;
......@@ -218,7 +218,7 @@ static void test_ExtCreateRegion(void)
/* sizeof(RGNDATAHEADER) is large enough */
SetLastError(0xdeadbeef);
hrgn = ExtCreateRegion(NULL, sizeof(RGNDATAHEADER), &rgn.data);
ok(hrgn != 0, "ExtCreateRegion error %u\n", GetLastError());
ok(hrgn != 0, "ExtCreateRegion error %lu\n", GetLastError());
verify_region(hrgn, &empty_rect);
DeleteObject(hrgn);
......@@ -229,11 +229,11 @@ static void test_ExtCreateRegion(void)
ok(!hrgn, "ExtCreateRegion should fail\n");
todo_wine
ok(GetLastError() == ERROR_INVALID_PARAMETER ||
broken(GetLastError() == 0xdeadbeef), "0xdeadbeef, got %u\n", GetLastError());
broken(GetLastError() == 0xdeadbeef), "0xdeadbeef, got %lu\n", GetLastError());
SetLastError(0xdeadbeef);
hrgn = ExtCreateRegion(NULL, sizeof(rgn), &rgn.data);
ok(hrgn != 0, "ExtCreateRegion error %u\n", GetLastError());
ok(hrgn != 0, "ExtCreateRegion error %lu\n", GetLastError());
verify_region(hrgn, &empty_rect);
DeleteObject(hrgn);
......@@ -243,7 +243,7 @@ static void test_ExtCreateRegion(void)
SetLastError(0xdeadbeef);
hrgn = ExtCreateRegion(NULL, sizeof(rgn), &rgn.data);
ok(hrgn != 0, "ExtCreateRegion error %u\n", GetLastError());
ok(hrgn != 0, "ExtCreateRegion error %lu\n", GetLastError());
verify_region(hrgn, &rc);
DeleteObject(hrgn);
......@@ -256,7 +256,7 @@ static void test_ExtCreateRegion(void)
SetLastError(0xdeadbeef);
hrgn = ExtCreateRegion(&xform, sizeof(rgn), &rgn.data);
ok(hrgn != 0, "ExtCreateRegion error %u/%x\n", GetLastError(), GetLastError());
ok(hrgn != 0, "ExtCreateRegion error %lu/%lx\n", GetLastError(), GetLastError());
verify_region(hrgn, &rc_xformed);
DeleteObject(hrgn);
......@@ -269,7 +269,7 @@ static void test_ExtCreateRegion(void)
hrgn = ExtCreateRegion(NULL, sizeof(RGNDATAHEADER) + 2 * sizeof(RECT) - 1, &rgn.data);
todo_wine
ok(!hrgn, "ExtCreateRegion should fail\n");
ok(GetLastError() == 0xdeadbeef, "0xdeadbeef, got %u\n", GetLastError());
ok(GetLastError() == 0xdeadbeef, "0xdeadbeef, got %lu\n", GetLastError());
}
......
......@@ -44,30 +44,30 @@ static void test_dc_values(void)
ok( hdc != NULL, "CreateDC failed\n" );
color = SetBkColor( hdc, 0x12345678 );
ok( color == 0xffffff, "initial color %08x\n", color );
ok( color == 0xffffff, "initial color %08lx\n", color );
color = GetBkColor( hdc );
ok( color == 0x12345678, "wrong color %08x\n", color );
ok( color == 0x12345678, "wrong color %08lx\n", color );
color = SetBkColor( hdc, 0xffffffff );
ok( color == 0x12345678, "wrong color %08x\n", color );
ok( color == 0x12345678, "wrong color %08lx\n", color );
color = GetBkColor( hdc );
ok( color == 0xffffffff, "wrong color %08x\n", color );
ok( color == 0xffffffff, "wrong color %08lx\n", color );
color = SetBkColor( hdc, 0 );
ok( color == 0xffffffff, "wrong color %08x\n", color );
ok( color == 0xffffffff, "wrong color %08lx\n", color );
color = GetBkColor( hdc );
ok( color == 0, "wrong color %08x\n", color );
ok( color == 0, "wrong color %08lx\n", color );
color = SetTextColor( hdc, 0xffeeddcc );
ok( color == 0, "initial color %08x\n", color );
ok( color == 0, "initial color %08lx\n", color );
color = GetTextColor( hdc );
ok( color == 0xffeeddcc, "wrong color %08x\n", color );
ok( color == 0xffeeddcc, "wrong color %08lx\n", color );
color = SetTextColor( hdc, 0xffffffff );
ok( color == 0xffeeddcc, "wrong color %08x\n", color );
ok( color == 0xffeeddcc, "wrong color %08lx\n", color );
color = GetTextColor( hdc );
ok( color == 0xffffffff, "wrong color %08x\n", color );
ok( color == 0xffffffff, "wrong color %08lx\n", color );
color = SetTextColor( hdc, 0 );
ok( color == 0xffffffff, "wrong color %08x\n", color );
ok( color == 0xffffffff, "wrong color %08lx\n", color );
color = GetTextColor( hdc );
ok( color == 0, "wrong color %08x\n", color );
ok( color == 0, "wrong color %08lx\n", color );
extra = GetTextCharacterExtra( hdc );
ok( extra == 0, "initial extra %d\n", extra );
......@@ -84,7 +84,7 @@ static void test_dc_values(void)
SetLastError(0xdeadbeef);
attr = SetBkMode(ULongToHandle(0xdeadbeef), OPAQUE);
ok(!attr, "attr = %x\n", attr);
ok(GetLastError() == ERROR_INVALID_HANDLE, "GetLastError() = %u\n", GetLastError());
ok(GetLastError() == ERROR_INVALID_HANDLE, "GetLastError() = %lu\n", GetLastError());
attr = GetBkColor(ULongToHandle(0xdeadbeef));
ok(attr == CLR_INVALID, "attr = %x\n", attr);
......@@ -92,7 +92,7 @@ static void test_dc_values(void)
SetLastError(0xdeadbeef);
attr = GetDeviceCaps(ULongToHandle(0xdeadbeef), TECHNOLOGY);
ok(!attr, "GetDeviceCaps rets %d\n", attr);
ok(GetLastError() == ERROR_INVALID_HANDLE, "GetLastError() = %u\n", GetLastError());
ok(GetLastError() == ERROR_INVALID_HANDLE, "GetLastError() = %lu\n", GetLastError());
DeleteDC( hdc );
}
......@@ -129,7 +129,7 @@ static void test_savedc_2(void)
ret, wine_dbgstr_rect(&rc));
ret = GetRegionData(hrgn, sizeof(buffer), rgndata);
ok(ret == sizeof(RGNDATAHEADER), "got %u\n", ret);
ok(!rgndata->rdh.nCount, "got %u rectangles\n", rgndata->rdh.nCount);
ok(!rgndata->rdh.nCount, "got %lu rectangles\n", rgndata->rdh.nCount);
SetRect(&rc, 0, 0, 100, 100);
ok(EqualRect(&rc, &rc_clip), "rects are not equal: %s - %s\n", wine_dbgstr_rect(&rc),
wine_dbgstr_rect(&rc_clip));
......@@ -144,7 +144,7 @@ static void test_savedc_2(void)
ok(ret == 1, "GetClipRgn returned %d instead of 1\n", ret);
ret = GetRegionData(hrgn, sizeof(buffer), rgndata);
ok(ret == sizeof(RGNDATAHEADER) + sizeof(RECT), "got %u\n", ret);
ok(rgndata->rdh.nCount == 1, "got %u rectangles\n", rgndata->rdh.nCount);
ok(rgndata->rdh.nCount == 1, "got %lu rectangles\n", rgndata->rdh.nCount);
SetRect(&rc, 0, 0, 50, 50);
ok(EqualRect((RECT *)rgndata->Buffer, &rc), "got rect %s\n", wine_dbgstr_rect((RECT *)rgndata->Buffer));
......@@ -243,7 +243,7 @@ static void test_savedc(void)
SetLastError(0xdeadbeef);
ret = SaveDC(ULongToHandle(0xdeadbeef));
ok(!ret, "SaveDC returned %u\n", ret);
ok(GetLastError() == ERROR_INVALID_HANDLE, "GetLastError() = %u\n", GetLastError());
ok(GetLastError() == ERROR_INVALID_HANDLE, "GetLastError() = %lu\n", GetLastError());
}
static void test_GdiConvertToDevmodeW(void)
......@@ -263,7 +263,7 @@ static void test_GdiConvertToDevmodeW(void)
memset(&dmA, 0, sizeof(dmA));
dmA.dmSize = sizeof(dmA);
ret = EnumDisplaySettingsA(NULL, ENUM_CURRENT_SETTINGS, &dmA);
ok(ret, "EnumDisplaySettingsExA error %u\n", GetLastError());
ok(ret, "EnumDisplaySettingsExA error %lu\n", GetLastError());
ok(dmA.dmSize >= FIELD_OFFSET(DEVMODEA, dmICMMethod), "dmSize is too small: %04x\n", dmA.dmSize);
ok(dmA.dmSize <= sizeof(DEVMODEA), "dmSize is too large: %04x\n", dmA.dmSize);
......@@ -284,7 +284,7 @@ static void test_GdiConvertToDevmodeW(void)
ok(dmW->dmSize == FIELD_OFFSET(DEVMODEW, dmICMMethod) + sizeof(dmW->dmICMMethod),
"wrong size %u\n", dmW->dmSize);
ok(dmW->dmICMMethod == DMICMMETHOD_NONE,
"expected DMICMMETHOD_NONE, got %u\n", dmW->dmICMMethod);
"expected DMICMMETHOD_NONE, got %lu\n", dmW->dmICMMethod);
HeapFree(GetProcessHeap(), 0, dmW);
dmA.dmSize = 1024;
......@@ -297,13 +297,13 @@ static void test_GdiConvertToDevmodeW(void)
dmA.dmSize = 0;
dmW = pGdiConvertToDevmodeW(&dmA);
ok(!dmW, "GdiConvertToDevmodeW should fail\n");
ok(GetLastError() == 0xdeadbeef, "expected 0xdeadbeef, got %u\n", GetLastError());
ok(GetLastError() == 0xdeadbeef, "expected 0xdeadbeef, got %lu\n", GetLastError());
/* this is the minimal dmSize that XP accepts */
dmA.dmSize = FIELD_OFFSET(DEVMODEA, dmFields);
dmW = pGdiConvertToDevmodeW(&dmA);
ok(dmW->dmSize == FIELD_OFFSET(DEVMODEW, dmFields),
"expected %04x, got %04x\n", FIELD_OFFSET(DEVMODEW, dmFields), dmW->dmSize);
"expected %04lx, got %04x\n", FIELD_OFFSET(DEVMODEW, dmFields), dmW->dmSize);
HeapFree(GetProcessHeap(), 0, dmW);
}
......@@ -415,7 +415,7 @@ static void test_device_caps( HDC hdc, HDC ref_dc, const char *descr, int scale
type, descr );
type = SetBoundsRect( hdc, NULL, DCB_RESET | DCB_ENABLE );
ok( type == (DCB_RESET | DCB_DISABLE) || broken(type == (DCB_SET | DCB_ENABLE)) /* XP */,
"SetBoundsRect returned %x for %s (hdc type %d)\n", type, descr, GetObjectType( hdc ) );
"SetBoundsRect returned %x for %s (hdc type %ld)\n", type, descr, GetObjectType( hdc ) );
SetMapMode( hdc, MM_TEXT );
Rectangle( hdc, 2, 2, 4, 4 );
......@@ -523,15 +523,15 @@ static void test_device_caps( HDC hdc, HDC ref_dc, const char *descr, int scale
ret = GetDeviceGammaRamp( hdc, &ramp );
if (GetObjectType( hdc ) != OBJ_DC || GetDeviceCaps( hdc, TECHNOLOGY ) == DT_RASPRINTER)
{
ok( !ret, "GetDeviceGammaRamp succeeded on %s (type %d)\n", descr, GetObjectType( hdc ) );
ok( !ret, "GetDeviceGammaRamp succeeded on %s (type %ld)\n", descr, GetObjectType( hdc ) );
ok( GetLastError() == ERROR_INVALID_PARAMETER
|| broken(GetLastError() == 0xdeadbeef) /* nt4 */
|| broken(GetLastError() == NO_ERROR), /* Printer DC on Win10 1909+ */
"wrong error %u on %s\n", GetLastError(), descr );
"wrong error %lu on %s\n", GetLastError(), descr );
}
else
{
ok( ret || broken(!ret) /* NT4 */, "GetDeviceGammaRamp failed on %s (type %d), error %u\n",
ok( ret || broken(!ret) /* NT4 */, "GetDeviceGammaRamp failed on %s (type %ld), error %lu\n",
descr, GetObjectType( hdc ), GetLastError() );
}
}
......@@ -723,11 +723,11 @@ static void test_DC_bitmap(void)
oldhbmp = SelectObject( hdcmem, hbmp);
ok( oldhbmp != NULL, "SelectObject returned NULL\n" ); /* a memdc always has a bitmap selected */
col = GetPixel( hdcmem, 0, 0);
ok( col == 0xffffff, "GetPixel returned %08x, expected 00ffffff\n", col);
ok( col == 0xffffff, "GetPixel returned %08lx, expected 00ffffff\n", col);
col = GetPixel( hdcmem, 1, 1);
ok( col == 0x000000, "GetPixel returned %08x, expected 00000000\n", col);
ok( col == 0x000000, "GetPixel returned %08lx, expected 00000000\n", col);
col = GetPixel( hdcmem, 100, 1);
ok( col == CLR_INVALID, "GetPixel returned %08x, expected ffffffff\n", col);
ok( col == CLR_INVALID, "GetPixel returned %08lx, expected ffffffff\n", col);
SelectObject( hdcmem, oldhbmp);
DeleteObject( hbmp);
......@@ -748,10 +748,10 @@ static void test_DC_bitmap(void)
ok( oldhbmp != NULL, "SelectObject returned NULL\n" );
col = GetPixel( hdcmem, 0, 0);
ok( col == 0xffffff,
"GetPixel of a bitmap with 16 bits/pixel returned %08x, expected 00ffffff\n", col);
"GetPixel of a bitmap with 16 bits/pixel returned %08lx, expected 00ffffff\n", col);
col = GetPixel( hdcmem, 1, 1);
ok( col == 0x000000,
"GetPixel of a bitmap with 16 bits/pixel returned returned %08x, expected 00000000\n", col);
"GetPixel of a bitmap with 16 bits/pixel returned returned %08lx, expected 00000000\n", col);
}
if( oldhbmp) SelectObject( hdcmem, oldhbmp);
DeleteObject( hbmp);
......@@ -764,10 +764,10 @@ static void test_DC_bitmap(void)
ok( oldhbmp != NULL, "SelectObject returned NULL\n" );
col = GetPixel( hdcmem, 0, 0);
ok( col == 0xffffff,
"GetPixel of a bitmap with 32 bits/pixel returned %08x, expected 00ffffff\n", col);
"GetPixel of a bitmap with 32 bits/pixel returned %08lx, expected 00ffffff\n", col);
col = GetPixel( hdcmem, 1, 1);
ok( col == 0x000000,
"GetPixel of a bitmap with 32 bits/pixel returned returned %08x, expected 00000000\n", col);
"GetPixel of a bitmap with 32 bits/pixel returned returned %08lx, expected 00000000\n", col);
}
if( oldhbmp) SelectObject( hdcmem, oldhbmp);
DeleteObject( hbmp);
......@@ -1399,13 +1399,13 @@ static void test_printer_dc(void)
ok( display_memdc != NULL, "CreateCompatibleDC failed for screen\n" );
ret = GetDeviceCaps( hdc, TECHNOLOGY );
ok( ret == DT_RASPRINTER, "wrong type %u\n", ret );
ok( ret == DT_RASPRINTER, "wrong type %lu\n", ret );
ret = GetDeviceCaps( memdc, TECHNOLOGY );
ok( ret == DT_RASPRINTER, "wrong type %u\n", ret );
ok( ret == DT_RASPRINTER, "wrong type %lu\n", ret );
ret = GetDeviceCaps( display_memdc, TECHNOLOGY );
ok( ret == DT_RASDISPLAY, "wrong type %u\n", ret );
ok( ret == DT_RASDISPLAY, "wrong type %lu\n", ret );
bmp = CreateBitmap( 100, 100, 1, GetDeviceCaps( hdc, BITSPIXEL ), NULL );
orig = SelectObject( memdc, bmp );
......@@ -1427,7 +1427,7 @@ static void test_printer_dc(void)
ok( BitBlt( display_memdc, 10, 10, 20, 20, memdc, 0, 0, SRCCOPY ), "BitBlt failed\n" );
ret = GetPixel( hdc, 0, 0 );
ok( ret == CLR_INVALID, "wrong pixel value %x\n", ret );
ok( ret == CLR_INVALID, "wrong pixel value %lx\n", ret );
enhmf_dc = CreateEnhMetaFileA( hdc, NULL, NULL, NULL );
ok(enhmf_dc != 0, "CreateEnhMetaFileA failed\n");
......@@ -1463,12 +1463,12 @@ static void print_something(HDC hdc)
di.lpszDatatype = NULL;
di.fwType = 0;
ret = StartDocA(hdc, &di);
ok(ret > 0, "StartDoc failed: %d\n", ret);
ok(ret > 0, "StartDoc failed: %ld\n", ret);
strcpy(buf + 2, "\n% ===> before DOWNLOADHEADER <===\n");
*(WORD *)buf = strlen(buf + 2);
ret = Escape(hdc, POSTSCRIPT_PASSTHROUGH, 0, buf, NULL);
ok(ret == *(WORD *)buf, "POSTSCRIPT_PASSTHROUGH failed: %d\n", ret);
ok(ret == *(WORD *)buf, "POSTSCRIPT_PASSTHROUGH failed: %ld\n", ret);
strcpy(buf, "deadbeef");
ret = ExtEscape(hdc, DOWNLOADHEADER, 0, NULL, sizeof(buf), buf );
......@@ -1478,7 +1478,7 @@ static void print_something(HDC hdc)
strcpy(buf + 2, "\n% ===> after DOWNLOADHEADER <===\n");
*(WORD *)buf = strlen(buf + 2);
ret = Escape(hdc, POSTSCRIPT_PASSTHROUGH, 0, buf, NULL);
ok(ret == *(WORD *)buf, "POSTSCRIPT_PASSTHROUGH failed: %d\n", ret);
ok(ret == *(WORD *)buf, "POSTSCRIPT_PASSTHROUGH failed: %ld\n", ret);
ret = EndDoc(hdc);
ok(ret == 1, "EndDoc failed\n");
......@@ -1695,7 +1695,7 @@ static void test_SetPixel(void)
COLORREF c;
c = SetPixel((HDC)0xdeadbeef, 0, 0, 0);
ok(c == ~0, "SetPixel returned: %x\n", c);
ok(c == ~0, "SetPixel returned: %lx\n", c);
}
......
......@@ -1832,10 +1832,10 @@ static void draw_graphics(HDC hdc, const BITMAPINFO *bmi, BYTE *bits)
ret = PatBlt(hdc, 10, y, 100, 10, rop3[i]);
if(rop_uses_src(rop3[i]))
ok(ret == FALSE || broken(is_ddb), "got TRUE for %x\n", rop3[i]);
ok(ret == FALSE || broken(is_ddb), "got TRUE for %lx\n", rop3[i]);
else
{
ok(ret, "got FALSE for %x\n", rop3[i]);
ok(ret, "got FALSE for %lx\n", rop3[i]);
y += 20;
}
......@@ -1955,7 +1955,7 @@ static void draw_graphics(HDC hdc, const BITMAPINFO *bmi, BYTE *bits)
if(!rop_uses_src(rop3[i]))
{
ret = PatBlt(hdc, 10 + i, y, 100, 20, rop3[i]);
ok(ret, "got FALSE for %x\n", rop3[i]);
ok(ret, "got FALSE for %lx\n", rop3[i]);
y += 25;
}
}
......@@ -1982,7 +1982,7 @@ static void draw_graphics(HDC hdc, const BITMAPINFO *bmi, BYTE *bits)
if(!rop_uses_src(rop3[i]))
{
ret = PatBlt(hdc, 10 + i, y, 100, 20, rop3[i]);
ok(ret, "got FALSE for %x\n", rop3[i]);
ok(ret, "got FALSE for %lx\n", rop3[i]);
y += 25;
}
}
......@@ -2009,7 +2009,7 @@ static void draw_graphics(HDC hdc, const BITMAPINFO *bmi, BYTE *bits)
if(!rop_uses_src(rop3[i]))
{
ret = PatBlt(hdc, 10 + i, y, 100, 20, rop3[i]);
ok(ret, "got FALSE for %x\n", rop3[i]);
ok(ret, "got FALSE for %lx\n", rop3[i]);
y += 25;
}
}
......@@ -2036,7 +2036,7 @@ static void draw_graphics(HDC hdc, const BITMAPINFO *bmi, BYTE *bits)
if(!rop_uses_src(rop3[i]))
{
ret = PatBlt(hdc, 10 + i, y, 100, 20, rop3[i]);
ok(ret, "got FALSE for %x\n", rop3[i]);
ok(ret, "got FALSE for %lx\n", rop3[i]);
y += 25;
}
}
......@@ -2073,7 +2073,7 @@ static void draw_graphics(HDC hdc, const BITMAPINFO *bmi, BYTE *bits)
if(!rop_uses_src(rop3[i]))
{
ret = PatBlt(hdc, 10 + i, y, 100, 20, rop3[i]);
ok(ret, "got FALSE for %x\n", rop3[i]);
ok(ret, "got FALSE for %lx\n", rop3[i]);
y += 25;
}
}
......@@ -2095,7 +2095,7 @@ static void draw_graphics(HDC hdc, const BITMAPINFO *bmi, BYTE *bits)
if(!rop_uses_src(rop3[i]))
{
ret = PatBlt(hdc, 10 + i, y, 100, 20, rop3[i]);
ok(ret, "got FALSE for %x\n", rop3[i]);
ok(ret, "got FALSE for %lx\n", rop3[i]);
y += 25;
}
}
......@@ -2120,7 +2120,7 @@ static void draw_graphics(HDC hdc, const BITMAPINFO *bmi, BYTE *bits)
if(!rop_uses_src(rop3[i]))
{
ret = PatBlt(hdc, 10 + i, y, 100, 20, rop3[i]);
ok(ret, "got FALSE for %x\n", rop3[i]);
ok(ret, "got FALSE for %lx\n", rop3[i]);
y += 25;
}
}
......@@ -2144,7 +2144,7 @@ static void draw_graphics(HDC hdc, const BITMAPINFO *bmi, BYTE *bits)
if(!rop_uses_src(rop3[i]))
{
ret = PatBlt(hdc, 10 + i, y, 100, 20, rop3[i]);
ok(ret, "got FALSE for %x\n", rop3[i]);
ok(ret, "got FALSE for %lx\n", rop3[i]);
y += 25;
}
}
......@@ -2201,7 +2201,7 @@ static void draw_graphics(HDC hdc, const BITMAPINFO *bmi, BYTE *bits)
hatch_brush = CreateHatchBrush(hatch_style, RGB(0xff, 0, 0));
SelectObject(hdc, hatch_brush);
ret = PatBlt(hdc, 10 + i + 30 * hatch_style, y, 20, 20, rop3[i]);
ok(ret, "got FALSE for %x\n", rop3[i]);
ok(ret, "got FALSE for %lx\n", rop3[i]);
SelectObject(hdc, orig_brush);
DeleteObject(hatch_brush);
}
......@@ -2678,19 +2678,19 @@ static void draw_graphics(HDC hdc, const BITMAPINFO *bmi, BYTE *bits)
s = SetPixel( hdc, i * 2, j, DIBINDEX(i) );
g = GetPixel( hdc, i * 2, 0 ); /* retrieve value set with R2_COPYPEN */
ok( s == g, "got %08x and %08x\n", s, g );
ok( s == g, "got %08lx and %08lx\n", s, g );
s = SetPixel( hdc, i * 2, 20 + j, PALETTEINDEX(i) );
g = GetPixel( hdc, i * 2, 20 + 0 ); /* retrieve value set with R2_COPYPEN */
ok( s == g, "got %08x and %08x\n", s, g );
ok( s == g, "got %08lx and %08lx\n", s, g );
s = SetPixel( hdc, i * 2, 40 + j, RGB( (i & 0x07) << 5, (i & 0x38) << 2, i & 0xc0 ) );
g = GetPixel( hdc, i * 2, 40 + 0 ); /* retrieve value set with R2_COPYPEN */
ok( s == g, "got %08x and %08x\n", s, g );
ok( s == g, "got %08lx and %08lx\n", s, g );
s = SetPixel( hdc, i * 2, 60 + j, PALETTERGB( (i & 0x07) << 5, (i & 0x38) << 2, i & 0xc0 ) );
g = GetPixel( hdc, i * 2, 60 + 0 ); /* retrieve value set with R2_COPYPEN */
ok( s == g, "got %08x and %08x\n", s, g );
ok( s == g, "got %08lx and %08lx\n", s, g );
}
SetROP2( hdc, R2_COPYPEN );
......@@ -2699,11 +2699,11 @@ static void draw_graphics(HDC hdc, const BITMAPINFO *bmi, BYTE *bits)
{
s = SetPixel( hdc, i * 2, 80 + j, (j << 24) | RGB( (i & 0x07) << 5, (i & 0x38) << 2, i & 0xc0 ));
g = GetPixel( hdc, i * 2, 80 + j );
ok( s == g, "got %08x and %08x\n", s, g );
ok( s == g, "got %08lx and %08lx\n", s, g );
s = SetPixel( hdc, i * 2 + 1, 80 + j, (j << 24) | i );
g = GetPixel( hdc, i * 2 + 1, 80 + j );
ok( s == g, "got %08x and %08x\n", s, g );
ok( s == g, "got %08lx and %08lx\n", s, g );
}
}
......@@ -3176,10 +3176,10 @@ static void test_simple_graphics(void)
dib = CreateDIBSection(0, bmi, DIB_RGB_COLORS, (void**)&bits, NULL, 0);
ok(dib != NULL, "ret NULL\n");
ok(GetObjectW( dib, sizeof(ds), &ds ), "GetObject failed\n");
ok(ds.dsBitfields[0] == 0, "got %08x\n", ds.dsBitfields[0]);
ok(ds.dsBitfields[1] == 0, "got %08x\n", ds.dsBitfields[1]);
ok(ds.dsBitfields[2] == 0, "got %08x\n", ds.dsBitfields[2]);
ok(ds.dsBmih.biCompression == BI_RGB, "got %x\n", ds.dsBmih.biCompression);
ok(ds.dsBitfields[0] == 0, "got %08lx\n", ds.dsBitfields[0]);
ok(ds.dsBitfields[1] == 0, "got %08lx\n", ds.dsBitfields[1]);
ok(ds.dsBitfields[2] == 0, "got %08lx\n", ds.dsBitfields[2]);
ok(ds.dsBmih.biCompression == BI_RGB, "got %lx\n", ds.dsBmih.biCompression);
orig_bm = SelectObject(mem_dc, dib);
......@@ -3205,10 +3205,10 @@ static void test_simple_graphics(void)
dib = CreateDIBSection(mem_dc, bmi, DIB_RGB_COLORS, (void**)&bits, NULL, 0);
ok(dib != NULL, "ret NULL\n");
ok(GetObjectW( dib, sizeof(ds), &ds ), "GetObject failed\n");
ok(ds.dsBitfields[0] == 0xff0000, "got %08x\n", ds.dsBitfields[0]);
ok(ds.dsBitfields[1] == 0x00ff00, "got %08x\n", ds.dsBitfields[1]);
ok(ds.dsBitfields[2] == 0x0000ff, "got %08x\n", ds.dsBitfields[2]);
ok(ds.dsBmih.biCompression == BI_BITFIELDS, "got %x\n", ds.dsBmih.biCompression);
ok(ds.dsBitfields[0] == 0xff0000, "got %08lx\n", ds.dsBitfields[0]);
ok(ds.dsBitfields[1] == 0x00ff00, "got %08lx\n", ds.dsBitfields[1]);
ok(ds.dsBitfields[2] == 0x0000ff, "got %08lx\n", ds.dsBitfields[2]);
ok(ds.dsBmih.biCompression == BI_BITFIELDS, "got %lx\n", ds.dsBmih.biCompression);
orig_bm = SelectObject(mem_dc, dib);
SelectPalette( mem_dc, default_palette, FALSE );
......@@ -3232,10 +3232,10 @@ static void test_simple_graphics(void)
dib = CreateDIBSection(mem_dc, bmi, DIB_RGB_COLORS, (void**)&bits, NULL, 0);
ok(dib != NULL, "ret NULL\n");
ok(GetObjectW( dib, sizeof(ds), &ds ), "GetObject failed\n");
ok(ds.dsBitfields[0] == 0x0000ff, "got %08x\n", ds.dsBitfields[0]);
ok(ds.dsBitfields[1] == 0x00ff00, "got %08x\n", ds.dsBitfields[1]);
ok(ds.dsBitfields[2] == 0xff0000, "got %08x\n", ds.dsBitfields[2]);
ok(ds.dsBmih.biCompression == BI_BITFIELDS, "got %x\n", ds.dsBmih.biCompression);
ok(ds.dsBitfields[0] == 0x0000ff, "got %08lx\n", ds.dsBitfields[0]);
ok(ds.dsBitfields[1] == 0x00ff00, "got %08lx\n", ds.dsBitfields[1]);
ok(ds.dsBitfields[2] == 0xff0000, "got %08lx\n", ds.dsBitfields[2]);
ok(ds.dsBmih.biCompression == BI_BITFIELDS, "got %lx\n", ds.dsBmih.biCompression);
orig_bm = SelectObject(mem_dc, dib);
......@@ -3258,10 +3258,10 @@ static void test_simple_graphics(void)
dib = CreateDIBSection(mem_dc, bmi, DIB_RGB_COLORS, (void**)&bits, NULL, 0);
ok(dib != NULL, "ret NULL\n");
ok(GetObjectW( dib, sizeof(ds), &ds ), "GetObject failed\n");
ok(ds.dsBitfields[0] == 0x3ff00000, "got %08x\n", ds.dsBitfields[0]);
ok(ds.dsBitfields[1] == 0x000ffc00, "got %08x\n", ds.dsBitfields[1]);
ok(ds.dsBitfields[2] == 0x000003ff, "got %08x\n", ds.dsBitfields[2]);
ok(ds.dsBmih.biCompression == BI_BITFIELDS, "got %x\n", ds.dsBmih.biCompression);
ok(ds.dsBitfields[0] == 0x3ff00000, "got %08lx\n", ds.dsBitfields[0]);
ok(ds.dsBitfields[1] == 0x000ffc00, "got %08lx\n", ds.dsBitfields[1]);
ok(ds.dsBitfields[2] == 0x000003ff, "got %08lx\n", ds.dsBitfields[2]);
ok(ds.dsBmih.biCompression == BI_BITFIELDS, "got %lx\n", ds.dsBmih.biCompression);
orig_bm = SelectObject(mem_dc, dib);
......@@ -3284,10 +3284,10 @@ static void test_simple_graphics(void)
dib = CreateDIBSection(mem_dc, bmi, DIB_RGB_COLORS, (void**)&bits, NULL, 0);
ok(dib != NULL, "ret NULL\n");
ok(GetObjectW( dib, sizeof(ds), &ds ), "GetObject failed\n");
ok(ds.dsBitfields[0] == 0x0003f000, "got %08x\n", ds.dsBitfields[0]);
ok(ds.dsBitfields[1] == 0x00000fc0, "got %08x\n", ds.dsBitfields[1]);
ok(ds.dsBitfields[2] == 0x0000003f, "got %08x\n", ds.dsBitfields[2]);
ok(ds.dsBmih.biCompression == BI_BITFIELDS, "got %x\n", ds.dsBmih.biCompression);
ok(ds.dsBitfields[0] == 0x0003f000, "got %08lx\n", ds.dsBitfields[0]);
ok(ds.dsBitfields[1] == 0x00000fc0, "got %08lx\n", ds.dsBitfields[1]);
ok(ds.dsBitfields[2] == 0x0000003f, "got %08lx\n", ds.dsBitfields[2]);
ok(ds.dsBmih.biCompression == BI_BITFIELDS, "got %lx\n", ds.dsBmih.biCompression);
orig_bm = SelectObject(mem_dc, dib);
......@@ -3324,10 +3324,10 @@ static void test_simple_graphics(void)
dib = CreateDIBSection(0, bmi, DIB_RGB_COLORS, (void**)&bits, NULL, 0);
ok(dib != NULL, "ret NULL\n");
ok(GetObjectW( dib, sizeof(ds), &ds ), "GetObject failed\n");
ok(ds.dsBitfields[0] == 0x7c00, "got %08x\n", ds.dsBitfields[0]);
ok(ds.dsBitfields[1] == 0x03e0, "got %08x\n", ds.dsBitfields[1]);
ok(ds.dsBitfields[2] == 0x001f, "got %08x\n", ds.dsBitfields[2]);
ok(ds.dsBmih.biCompression == BI_BITFIELDS, "got %x\n", ds.dsBmih.biCompression);
ok(ds.dsBitfields[0] == 0x7c00, "got %08lx\n", ds.dsBitfields[0]);
ok(ds.dsBitfields[1] == 0x03e0, "got %08lx\n", ds.dsBitfields[1]);
ok(ds.dsBitfields[2] == 0x001f, "got %08lx\n", ds.dsBitfields[2]);
ok(ds.dsBmih.biCompression == BI_BITFIELDS, "got %lx\n", ds.dsBmih.biCompression);
orig_bm = SelectObject(mem_dc, dib);
......@@ -3349,10 +3349,10 @@ static void test_simple_graphics(void)
dib = CreateDIBSection(0, bmi, DIB_RGB_COLORS, (void**)&bits, NULL, 0);
ok(dib != NULL, "ret NULL\n");
ok(GetObjectW( dib, sizeof(ds), &ds ), "GetObject failed\n");
ok(ds.dsBitfields[0] == 0x0f00, "got %08x\n", ds.dsBitfields[0]);
ok(ds.dsBitfields[1] == 0x00f0, "got %08x\n", ds.dsBitfields[1]);
ok(ds.dsBitfields[2] == 0x000f, "got %08x\n", ds.dsBitfields[2]);
ok(ds.dsBmih.biCompression == BI_BITFIELDS, "got %x\n", ds.dsBmih.biCompression);
ok(ds.dsBitfields[0] == 0x0f00, "got %08lx\n", ds.dsBitfields[0]);
ok(ds.dsBitfields[1] == 0x00f0, "got %08lx\n", ds.dsBitfields[1]);
ok(ds.dsBitfields[2] == 0x000f, "got %08lx\n", ds.dsBitfields[2]);
ok(ds.dsBmih.biCompression == BI_BITFIELDS, "got %lx\n", ds.dsBmih.biCompression);
orig_bm = SelectObject(mem_dc, dib);
......
......@@ -68,15 +68,15 @@ static void test_D3DKMTOpenAdapterFromGdiDisplayName(void)
close_adapter_desc.hAdapter = open_adapter_gdi_desc.hAdapter;
status = pD3DKMTCloseAdapter(&close_adapter_desc);
ok(status == STATUS_SUCCESS, "Got unexpected return code %#x.\n", status);
ok(status == STATUS_SUCCESS, "Got unexpected return code %#lx.\n", status);
/* Invalid parameters */
status = pD3DKMTOpenAdapterFromGdiDisplayName(NULL);
ok(status == STATUS_UNSUCCESSFUL, "Got unexpected return code %#x.\n", status);
ok(status == STATUS_UNSUCCESSFUL, "Got unexpected return code %#lx.\n", status);
memset(&open_adapter_gdi_desc, 0, sizeof(open_adapter_gdi_desc));
status = pD3DKMTOpenAdapterFromGdiDisplayName(&open_adapter_gdi_desc);
ok(status == STATUS_UNSUCCESSFUL, "Got unexpected return code %#x.\n", status);
ok(status == STATUS_UNSUCCESSFUL, "Got unexpected return code %#lx.\n", status);
/* Open adapter */
for (i = 0; EnumDisplayDevicesW(NULL, i, &display_device, 0); ++i)
......@@ -84,10 +84,10 @@ static void test_D3DKMTOpenAdapterFromGdiDisplayName(void)
lstrcpyW(open_adapter_gdi_desc.DeviceName, display_device.DeviceName);
status = pD3DKMTOpenAdapterFromGdiDisplayName(&open_adapter_gdi_desc);
if (display_device.StateFlags & DISPLAY_DEVICE_ATTACHED_TO_DESKTOP)
ok(status == STATUS_SUCCESS, "Got unexpected return code %#x.\n", status);
ok(status == STATUS_SUCCESS, "Got unexpected return code %#lx.\n", status);
else
{
ok(status == STATUS_UNSUCCESSFUL, "Got unexpected return code %#x.\n", status);
ok(status == STATUS_UNSUCCESSFUL, "Got unexpected return code %#lx.\n", status);
continue;
}
......@@ -97,7 +97,7 @@ static void test_D3DKMTOpenAdapterFromGdiDisplayName(void)
close_adapter_desc.hAdapter = open_adapter_gdi_desc.hAdapter;
status = pD3DKMTCloseAdapter(&close_adapter_desc);
ok(status == STATUS_SUCCESS, "Got unexpected return code %#x.\n", status);
ok(status == STATUS_SUCCESS, "Got unexpected return code %#lx.\n", status);
}
}
......@@ -128,7 +128,7 @@ static void test_D3DKMTOpenAdapterFromHdc(void)
win_skip("D3DKMTOpenAdapterFromHdc() is not supported.\n");
return;
}
todo_wine ok(status == STATUS_INVALID_PARAMETER, "Got unexpected return code %#x.\n", status);
todo_wine ok(status == STATUS_INVALID_PARAMETER, "Got unexpected return code %#lx.\n", status);
/* Open adapter */
for (i = 0; EnumDisplayDevicesW(NULL, i, &display_device, 0); ++i)
......@@ -141,7 +141,7 @@ static void test_D3DKMTOpenAdapterFromHdc(void)
hdc = CreateDCW(0, display_device.DeviceName, 0, NULL);
open_adapter_hdc_desc.hDc = hdc;
status = pD3DKMTOpenAdapterFromHdc(&open_adapter_hdc_desc);
todo_wine ok(status == STATUS_SUCCESS, "Got unexpected return code %#x.\n", status);
todo_wine ok(status == STATUS_SUCCESS, "Got unexpected return code %#lx.\n", status);
todo_wine ok(open_adapter_hdc_desc.hAdapter, "Expect not null.\n");
DeleteDC(hdc);
......@@ -149,7 +149,7 @@ static void test_D3DKMTOpenAdapterFromHdc(void)
{
close_adapter_desc.hAdapter = open_adapter_hdc_desc.hAdapter;
status = pD3DKMTCloseAdapter(&close_adapter_desc);
ok(status == STATUS_SUCCESS, "Got unexpected return code %#x.\n", status);
ok(status == STATUS_SUCCESS, "Got unexpected return code %#lx.\n", status);
}
}
......@@ -159,12 +159,12 @@ static void test_D3DKMTOpenAdapterFromHdc(void)
status = pD3DKMTOpenAdapterFromHdc(&open_adapter_hdc_desc);
ReleaseDC(0, hdc);
todo_wine ok(status == (adapter_count > 1 ? STATUS_INVALID_PARAMETER : STATUS_SUCCESS),
"Got unexpected return code %#x.\n", status);
"Got unexpected return code %#lx.\n", status);
if (status == STATUS_SUCCESS)
{
close_adapter_desc.hAdapter = open_adapter_hdc_desc.hAdapter;
status = pD3DKMTCloseAdapter(&close_adapter_desc);
ok(status == STATUS_SUCCESS, "Got unexpected return code %#x.\n", status);
ok(status == STATUS_SUCCESS, "Got unexpected return code %#lx.\n", status);
}
}
......@@ -181,11 +181,11 @@ static void test_D3DKMTCloseAdapter(void)
/* Invalid parameters */
status = pD3DKMTCloseAdapter(NULL);
ok(status == STATUS_INVALID_PARAMETER, "Got unexpected return code %#x.\n", status);
ok(status == STATUS_INVALID_PARAMETER, "Got unexpected return code %#lx.\n", status);
memset(&close_adapter_desc, 0, sizeof(close_adapter_desc));
status = pD3DKMTCloseAdapter(&close_adapter_desc);
ok(status == STATUS_INVALID_PARAMETER, "Got unexpected return code %#x.\n", status);
ok(status == STATUS_INVALID_PARAMETER, "Got unexpected return code %#lx.\n", status);
}
static void test_D3DKMTCreateDevice(void)
......@@ -204,20 +204,20 @@ static void test_D3DKMTCreateDevice(void)
/* Invalid parameters */
status = pD3DKMTCreateDevice(NULL);
ok(status == STATUS_INVALID_PARAMETER, "Got unexpected return code %#x.\n", status);
ok(status == STATUS_INVALID_PARAMETER, "Got unexpected return code %#lx.\n", status);
memset(&create_device_desc, 0, sizeof(create_device_desc));
status = pD3DKMTCreateDevice(&create_device_desc);
ok(status == STATUS_INVALID_PARAMETER, "Got unexpected return code %#x.\n", status);
ok(status == STATUS_INVALID_PARAMETER, "Got unexpected return code %#lx.\n", status);
lstrcpyW(open_adapter_gdi_desc.DeviceName, display1W);
status = pD3DKMTOpenAdapterFromGdiDisplayName(&open_adapter_gdi_desc);
ok(status == STATUS_SUCCESS, "Got unexpected return code %#x.\n", status);
ok(status == STATUS_SUCCESS, "Got unexpected return code %#lx.\n", status);
/* Create device */
create_device_desc.hAdapter = open_adapter_gdi_desc.hAdapter;
status = pD3DKMTCreateDevice(&create_device_desc);
ok(status == STATUS_SUCCESS, "Got unexpected return code %#x.\n", status);
ok(status == STATUS_SUCCESS, "Got unexpected return code %#lx.\n", status);
ok(create_device_desc.hDevice, "Expect not null.\n");
ok(create_device_desc.pCommandBuffer == NULL, "Expect null.\n");
ok(create_device_desc.CommandBufferSize == 0, "Got wrong value %#x.\n", create_device_desc.CommandBufferSize);
......@@ -228,11 +228,11 @@ static void test_D3DKMTCreateDevice(void)
destroy_device_desc.hDevice = create_device_desc.hDevice;
status = pD3DKMTDestroyDevice(&destroy_device_desc);
ok(status == STATUS_SUCCESS, "Got unexpected return code %#x.\n", status);
ok(status == STATUS_SUCCESS, "Got unexpected return code %#lx.\n", status);
close_adapter_desc.hAdapter = open_adapter_gdi_desc.hAdapter;
status = pD3DKMTCloseAdapter(&close_adapter_desc);
ok(status == STATUS_SUCCESS, "Got unexpected return code %#x.\n", status);
ok(status == STATUS_SUCCESS, "Got unexpected return code %#lx.\n", status);
}
static void test_D3DKMTDestroyDevice(void)
......@@ -248,11 +248,11 @@ static void test_D3DKMTDestroyDevice(void)
/* Invalid parameters */
status = pD3DKMTDestroyDevice(NULL);
ok(status == STATUS_INVALID_PARAMETER, "Got unexpected return code %#x.\n", status);
ok(status == STATUS_INVALID_PARAMETER, "Got unexpected return code %#lx.\n", status);
memset(&destroy_device_desc, 0, sizeof(destroy_device_desc));
status = pD3DKMTDestroyDevice(&destroy_device_desc);
ok(status == STATUS_INVALID_PARAMETER, "Got unexpected return code %#x.\n", status);
ok(status == STATUS_INVALID_PARAMETER, "Got unexpected return code %#lx.\n", status);
}
static void test_D3DKMTCheckVidPnExclusiveOwnership(void)
......@@ -384,21 +384,21 @@ static void test_D3DKMTCheckVidPnExclusiveOwnership(void)
/* Invalid parameters */
status = pD3DKMTCheckVidPnExclusiveOwnership(NULL);
ok(status == STATUS_INVALID_PARAMETER, "Got unexpected return code %#x.\n", status);
ok(status == STATUS_INVALID_PARAMETER, "Got unexpected return code %#lx.\n", status);
memset(&check_owner_desc, 0, sizeof(check_owner_desc));
status = pD3DKMTCheckVidPnExclusiveOwnership(&check_owner_desc);
ok(status == STATUS_INVALID_PARAMETER, "Got unexpected return code %#x.\n", status);
ok(status == STATUS_INVALID_PARAMETER, "Got unexpected return code %#lx.\n", status);
/* Test cases */
lstrcpyW(open_adapter_gdi_desc.DeviceName, display1W);
status = pD3DKMTOpenAdapterFromGdiDisplayName(&open_adapter_gdi_desc);
ok(status == STATUS_SUCCESS, "Got unexpected return code %#x.\n", status);
ok(status == STATUS_SUCCESS, "Got unexpected return code %#lx.\n", status);
memset(&create_device_desc, 0, sizeof(create_device_desc));
create_device_desc.hAdapter = open_adapter_gdi_desc.hAdapter;
status = pD3DKMTCreateDevice(&create_device_desc);
ok(status == STATUS_SUCCESS, "Got unexpected return code %#x.\n", status);
ok(status == STATUS_SUCCESS, "Got unexpected return code %#lx.\n", status);
check_owner_desc.hAdapter = open_adapter_gdi_desc.hAdapter;
check_owner_desc.VidPnSourceId = open_adapter_gdi_desc.VidPnSourceId;
......@@ -424,7 +424,7 @@ static void test_D3DKMTCheckVidPnExclusiveOwnership(void)
(status == STATUS_INVALID_PARAMETER && tests1[i].owner_type == D3DKMT_VIDPNSOURCEOWNER_EMULATED)
|| (status == STATUS_SUCCESS && tests1[i].owner_type == D3DKMT_VIDPNSOURCEOWNER_EXCLUSIVE
&& tests1[i - 1].owner_type == D3DKMT_VIDPNSOURCEOWNER_EMULATED),
"Got unexpected return code %#x at test %d.\n", status, i);
"Got unexpected return code %#lx at test %d.\n", status, i);
status = pD3DKMTCheckVidPnExclusiveOwnership(&check_owner_desc);
/* If don't sleep, D3DKMTCheckVidPnExclusiveOwnership may get STATUS_GRAPHICS_PRESENT_UNOCCLUDED instead
......@@ -443,14 +443,14 @@ static void test_D3DKMTCheckVidPnExclusiveOwnership(void)
|| (status == STATUS_GRAPHICS_PRESENT_OCCLUDED /* win8 */
&& tests1[i].owner_type == D3DKMT_VIDPNSOURCEOWNER_EXCLUSIVE
&& tests1[i - 1].owner_type == D3DKMT_VIDPNSOURCEOWNER_EMULATED),
"Got unexpected return code %#x at test %d.\n", status, i);
"Got unexpected return code %#lx at test %d.\n", status, i);
}
/* Set owner and unset owner using different devices */
memset(&create_device_desc2, 0, sizeof(create_device_desc2));
create_device_desc2.hAdapter = open_adapter_gdi_desc.hAdapter;
status = pD3DKMTCreateDevice(&create_device_desc2);
ok(status == STATUS_SUCCESS, "Got unexpected return code %#x.\n", status);
ok(status == STATUS_SUCCESS, "Got unexpected return code %#lx.\n", status);
/* Set owner with the first device */
set_owner_desc.hDevice = create_device_desc.hDevice;
......@@ -459,9 +459,9 @@ static void test_D3DKMTCheckVidPnExclusiveOwnership(void)
set_owner_desc.pVidPnSourceId = &open_adapter_gdi_desc.VidPnSourceId;
set_owner_desc.VidPnSourceCount = 1;
status = pD3DKMTSetVidPnSourceOwner(&set_owner_desc);
ok(status == STATUS_SUCCESS, "Got unexpected return code %#x.\n", status);
ok(status == STATUS_SUCCESS, "Got unexpected return code %#lx.\n", status);
status = pD3DKMTCheckVidPnExclusiveOwnership(&check_owner_desc);
ok(status == STATUS_GRAPHICS_PRESENT_OCCLUDED, "Got unexpected return code %#x.\n", status);
ok(status == STATUS_GRAPHICS_PRESENT_OCCLUDED, "Got unexpected return code %#lx.\n", status);
/* Unset owner with the second device */
set_owner_desc.hDevice = create_device_desc2.hDevice;
......@@ -469,10 +469,10 @@ static void test_D3DKMTCheckVidPnExclusiveOwnership(void)
set_owner_desc.pVidPnSourceId = NULL;
set_owner_desc.VidPnSourceCount = 0;
status = pD3DKMTSetVidPnSourceOwner(&set_owner_desc);
ok(status == STATUS_SUCCESS, "Got unexpected return code %#x.\n", status);
ok(status == STATUS_SUCCESS, "Got unexpected return code %#lx.\n", status);
status = pD3DKMTCheckVidPnExclusiveOwnership(&check_owner_desc);
/* No effect */
ok(status == STATUS_GRAPHICS_PRESENT_OCCLUDED, "Got unexpected return code %#x.\n", status);
ok(status == STATUS_GRAPHICS_PRESENT_OCCLUDED, "Got unexpected return code %#lx.\n", status);
/* Unset owner with the first device */
set_owner_desc.hDevice = create_device_desc.hDevice;
......@@ -480,10 +480,10 @@ static void test_D3DKMTCheckVidPnExclusiveOwnership(void)
set_owner_desc.pVidPnSourceId = NULL;
set_owner_desc.VidPnSourceCount = 0;
status = pD3DKMTSetVidPnSourceOwner(&set_owner_desc);
ok(status == STATUS_SUCCESS, "Got unexpected return code %#x.\n", status);
ok(status == STATUS_SUCCESS, "Got unexpected return code %#lx.\n", status);
status = pD3DKMTCheckVidPnExclusiveOwnership(&check_owner_desc);
/* Proves that the correct device is needed to unset owner */
ok(status == STATUS_SUCCESS || status == STATUS_GRAPHICS_PRESENT_UNOCCLUDED, "Got unexpected return code %#x.\n",
ok(status == STATUS_SUCCESS || status == STATUS_GRAPHICS_PRESENT_UNOCCLUDED, "Got unexpected return code %#lx.\n",
status);
/* Set owner with the first device, set owner again with the second device */
......@@ -504,7 +504,7 @@ static void test_D3DKMTCheckVidPnExclusiveOwnership(void)
ok(status == tests2[i].expected_set_status1
|| (status == STATUS_INVALID_PARAMETER /* win8 */
&& tests2[i].set_owner_type1 == D3DKMT_VIDPNSOURCEOWNER_EMULATED),
"Got unexpected return code %#x at test %d.\n", status, i);
"Got unexpected return code %#lx at test %d.\n", status, i);
}
if (tests2[i].set_owner_type2 != -1)
......@@ -520,7 +520,7 @@ static void test_D3DKMTCheckVidPnExclusiveOwnership(void)
&& tests2[i].set_owner_type2 == D3DKMT_VIDPNSOURCEOWNER_EMULATED)
|| (status == STATUS_SUCCESS && tests2[i].set_owner_type1 == D3DKMT_VIDPNSOURCEOWNER_EMULATED
&& tests2[i].set_owner_type2 == D3DKMT_VIDPNSOURCEOWNER_EXCLUSIVE),
"Got unexpected return code %#x at test %d.\n", status, i);
"Got unexpected return code %#lx at test %d.\n", status, i);
}
status = pD3DKMTCheckVidPnExclusiveOwnership(&check_owner_desc);
......@@ -538,7 +538,7 @@ static void test_D3DKMTCheckVidPnExclusiveOwnership(void)
|| (status == STATUS_GRAPHICS_PRESENT_OCCLUDED /* win8 */
&& tests2[i].set_owner_type2 == D3DKMT_VIDPNSOURCEOWNER_EXCLUSIVE
&& tests2[i].set_owner_type1 == D3DKMT_VIDPNSOURCEOWNER_EMULATED),
"Got unexpected return code %#x at test %d.\n", status, i);
"Got unexpected return code %#lx at test %d.\n", status, i);
/* Unset owner with first device */
if (tests2[i].set_owner_type1 != -1)
......@@ -548,7 +548,7 @@ static void test_D3DKMTCheckVidPnExclusiveOwnership(void)
set_owner_desc.pVidPnSourceId = NULL;
set_owner_desc.VidPnSourceCount = 0;
status = pD3DKMTSetVidPnSourceOwner(&set_owner_desc);
ok(status == STATUS_SUCCESS, "Got unexpected return code %#x at test %d.\n", status, i);
ok(status == STATUS_SUCCESS, "Got unexpected return code %#lx at test %d.\n", status, i);
}
/* Unset owner with second device */
......@@ -559,7 +559,7 @@ static void test_D3DKMTCheckVidPnExclusiveOwnership(void)
set_owner_desc.pVidPnSourceId = NULL;
set_owner_desc.VidPnSourceCount = 0;
status = pD3DKMTSetVidPnSourceOwner(&set_owner_desc);
ok(status == STATUS_SUCCESS, "Got unexpected return code %#x at test %d.\n", status, i);
ok(status == STATUS_SUCCESS, "Got unexpected return code %#lx at test %d.\n", status, i);
}
}
......@@ -570,11 +570,11 @@ static void test_D3DKMTCheckVidPnExclusiveOwnership(void)
set_owner_desc.pVidPnSourceId = &open_adapter_gdi_desc.VidPnSourceId;
set_owner_desc.VidPnSourceCount = 1;
status = pD3DKMTSetVidPnSourceOwner(&set_owner_desc);
ok(status == STATUS_SUCCESS, "Got unexpected return code %#x.\n", status);
ok(status == STATUS_SUCCESS, "Got unexpected return code %#lx.\n", status);
destroy_device_desc.hDevice = create_device_desc.hDevice;
status = pD3DKMTDestroyDevice(&destroy_device_desc);
ok(status == STATUS_SUCCESS, "Got unexpected return code %#x.\n", status);
ok(status == STATUS_SUCCESS, "Got unexpected return code %#lx.\n", status);
set_owner_desc.hDevice = create_device_desc2.hDevice;
owner_type = D3DKMT_VIDPNSOURCEOWNER_EXCLUSIVE;
......@@ -584,15 +584,15 @@ static void test_D3DKMTCheckVidPnExclusiveOwnership(void)
status = pD3DKMTSetVidPnSourceOwner(&set_owner_desc);
/* So ownership is released when device is destroyed. otherwise the return code should be
* STATUS_GRAPHICS_VIDPN_SOURCE_IN_USE */
ok(status == STATUS_SUCCESS, "Got unexpected return code %#x.\n", status);
ok(status == STATUS_SUCCESS, "Got unexpected return code %#lx.\n", status);
destroy_device_desc.hDevice = create_device_desc2.hDevice;
status = pD3DKMTDestroyDevice(&destroy_device_desc);
ok(status == STATUS_SUCCESS, "Got unexpected return code %#x.\n", status);
ok(status == STATUS_SUCCESS, "Got unexpected return code %#lx.\n", status);
close_adapter_desc.hAdapter = open_adapter_gdi_desc.hAdapter;
status = pD3DKMTCloseAdapter(&close_adapter_desc);
ok(status == STATUS_SUCCESS, "Got unexpected return code %#x.\n", status);
ok(status == STATUS_SUCCESS, "Got unexpected return code %#lx.\n", status);
}
static void test_D3DKMTSetVidPnSourceOwner(void)
......@@ -608,7 +608,7 @@ static void test_D3DKMTSetVidPnSourceOwner(void)
/* Invalid parameters */
status = pD3DKMTSetVidPnSourceOwner(&set_owner_desc);
ok(status == STATUS_INVALID_PARAMETER, "Got unexpected return code %#x.\n", status);
ok(status == STATUS_INVALID_PARAMETER, "Got unexpected return code %#lx.\n", status);
}
static void test_D3DKMTCheckOcclusion(void)
......@@ -635,31 +635,31 @@ static void test_D3DKMTCheckOcclusion(void)
/* NULL parameter check */
status = pD3DKMTCheckOcclusion(NULL);
ok(status == STATUS_INVALID_PARAMETER, "Got unexpected return code %#x.\n", status);
ok(status == STATUS_INVALID_PARAMETER, "Got unexpected return code %#lx.\n", status);
occlusion_desc.hWnd = NULL;
status = pD3DKMTCheckOcclusion(&occlusion_desc);
ok(status == STATUS_INVALID_PARAMETER, "Got unexpected return code %#x.\n", status);
ok(status == STATUS_INVALID_PARAMETER, "Got unexpected return code %#lx.\n", status);
hwnd = CreateWindowA("static", "static1", WS_OVERLAPPEDWINDOW | WS_VISIBLE, 0, 0, 200, 200, 0, 0, 0, 0);
ok(hwnd != NULL, "Failed to create window.\n");
occlusion_desc.hWnd = hwnd;
status = pD3DKMTCheckOcclusion(&occlusion_desc);
ok(status == STATUS_SUCCESS, "Got unexpected return code %#x.\n", status);
ok(status == STATUS_SUCCESS, "Got unexpected return code %#lx.\n", status);
/* Minimized state doesn't affect D3DKMTCheckOcclusion */
ShowWindow(hwnd, SW_MINIMIZE);
occlusion_desc.hWnd = hwnd;
status = pD3DKMTCheckOcclusion(&occlusion_desc);
ok(status == STATUS_SUCCESS, "Got unexpected return code %#x.\n", status);
ok(status == STATUS_SUCCESS, "Got unexpected return code %#lx.\n", status);
ShowWindow(hwnd, SW_SHOWNORMAL);
/* Invisible state doesn't affect D3DKMTCheckOcclusion */
ShowWindow(hwnd, SW_HIDE);
occlusion_desc.hWnd = hwnd;
status = pD3DKMTCheckOcclusion(&occlusion_desc);
ok(status == STATUS_SUCCESS, "Got unexpected return code %#x.\n", status);
ok(status == STATUS_SUCCESS, "Got unexpected return code %#lx.\n", status);
ShowWindow(hwnd, SW_SHOW);
/* hwnd2 covers hwnd */
......@@ -668,11 +668,11 @@ static void test_D3DKMTCheckOcclusion(void)
occlusion_desc.hWnd = hwnd;
status = pD3DKMTCheckOcclusion(&occlusion_desc);
ok(status == STATUS_SUCCESS, "Got unexpected return code %#x.\n", status);
ok(status == STATUS_SUCCESS, "Got unexpected return code %#lx.\n", status);
occlusion_desc.hWnd = hwnd2;
status = pD3DKMTCheckOcclusion(&occlusion_desc);
ok(status == STATUS_SUCCESS, "Got unexpected return code %#x.\n", status);
ok(status == STATUS_SUCCESS, "Got unexpected return code %#lx.\n", status);
/* Composition doesn't affect D3DKMTCheckOcclusion */
if (pDwmEnableComposition)
......@@ -683,22 +683,22 @@ static void test_D3DKMTCheckOcclusion(void)
occlusion_desc.hWnd = hwnd;
status = pD3DKMTCheckOcclusion(&occlusion_desc);
/* This result means that D3DKMTCheckOcclusion doesn't check composition status despite MSDN says it will */
ok(status == STATUS_SUCCESS, "Got unexpected return code %#x.\n", status);
ok(status == STATUS_SUCCESS, "Got unexpected return code %#lx.\n", status);
occlusion_desc.hWnd = hwnd2;
status = pD3DKMTCheckOcclusion(&occlusion_desc);
ok(status == STATUS_SUCCESS, "Got unexpected return code %#x.\n", status);
ok(status == STATUS_SUCCESS, "Got unexpected return code %#lx.\n", status);
ShowWindow(hwnd, SW_MINIMIZE);
occlusion_desc.hWnd = hwnd;
status = pD3DKMTCheckOcclusion(&occlusion_desc);
ok(status == STATUS_SUCCESS, "Got unexpected return code %#x.\n", status);
ok(status == STATUS_SUCCESS, "Got unexpected return code %#lx.\n", status);
ShowWindow(hwnd, SW_SHOWNORMAL);
ShowWindow(hwnd, SW_HIDE);
occlusion_desc.hWnd = hwnd;
status = pD3DKMTCheckOcclusion(&occlusion_desc);
ok(status == STATUS_SUCCESS, "Got unexpected return code %#x.\n", status);
ok(status == STATUS_SUCCESS, "Got unexpected return code %#lx.\n", status);
ShowWindow(hwnd, SW_SHOW);
hr = pDwmEnableComposition(DWM_EC_ENABLECOMPOSITION);
......@@ -709,19 +709,19 @@ static void test_D3DKMTCheckOcclusion(void)
lstrcpyW(open_adapter_gdi_desc.DeviceName, display1W);
status = pD3DKMTOpenAdapterFromGdiDisplayName(&open_adapter_gdi_desc);
ok(status == STATUS_SUCCESS, "Got unexpected return code %#x.\n", status);
ok(status == STATUS_SUCCESS, "Got unexpected return code %#lx.\n", status);
memset(&create_device_desc, 0, sizeof(create_device_desc));
create_device_desc.hAdapter = open_adapter_gdi_desc.hAdapter;
status = pD3DKMTCreateDevice(&create_device_desc);
ok(status == STATUS_SUCCESS, "Got unexpected return code %#x.\n", status);
ok(status == STATUS_SUCCESS, "Got unexpected return code %#lx.\n", status);
check_owner_desc.hAdapter = open_adapter_gdi_desc.hAdapter;
check_owner_desc.VidPnSourceId = open_adapter_gdi_desc.VidPnSourceId;
status = pD3DKMTCheckVidPnExclusiveOwnership(&check_owner_desc);
/* D3DKMTCheckVidPnExclusiveOwnership gets STATUS_GRAPHICS_PRESENT_UNOCCLUDED sometimes and with some delay,
* it will always return STATUS_SUCCESS. So there are some timing issues here. */
ok(status == STATUS_SUCCESS || status == STATUS_GRAPHICS_PRESENT_UNOCCLUDED, "Got unexpected return code %#x.\n", status);
ok(status == STATUS_SUCCESS || status == STATUS_GRAPHICS_PRESENT_UNOCCLUDED, "Got unexpected return code %#lx.\n", status);
/* Test D3DKMTCheckOcclusion relationship with video present source owner */
set_owner_desc.hDevice = create_device_desc.hDevice;
......@@ -730,7 +730,7 @@ static void test_D3DKMTCheckOcclusion(void)
set_owner_desc.pVidPnSourceId = &open_adapter_gdi_desc.VidPnSourceId;
set_owner_desc.VidPnSourceCount = 1;
status = pD3DKMTSetVidPnSourceOwner(&set_owner_desc);
ok(status == STATUS_SUCCESS, "Got unexpected return code %#x.\n", status);
ok(status == STATUS_SUCCESS, "Got unexpected return code %#lx.\n", status);
for (i = 0; EnumDisplayDevicesW(NULL, i, &display_device, 0); ++i)
{
......@@ -742,31 +742,31 @@ static void test_D3DKMTCheckOcclusion(void)
occlusion_desc.hWnd = hwnd;
status = pD3DKMTCheckOcclusion(&occlusion_desc);
ok(status == expected_occlusion, "Got unexpected return code %#x.\n", status);
ok(status == expected_occlusion, "Got unexpected return code %#lx.\n", status);
/* Note hwnd2 is not actually occluded but D3DKMTCheckOcclusion reports STATUS_GRAPHICS_PRESENT_OCCLUDED as well */
SetWindowPos(hwnd2, HWND_TOP, 0, 0, 0, 0, SWP_NOMOVE | SWP_NOSIZE);
ShowWindow(hwnd2, SW_SHOW);
occlusion_desc.hWnd = hwnd2;
status = pD3DKMTCheckOcclusion(&occlusion_desc);
ok(status == expected_occlusion, "Got unexpected return code %#x.\n", status);
ok(status == expected_occlusion, "Got unexpected return code %#lx.\n", status);
/* Now hwnd is HWND_TOPMOST. Still reports STATUS_GRAPHICS_PRESENT_OCCLUDED */
ok(SetWindowPos(hwnd, HWND_TOPMOST, 0, 0, 0, 0, SWP_NOMOVE | SWP_NOSIZE), "Failed to SetWindowPos.\n");
ok(GetWindowLongW(hwnd, GWL_EXSTYLE) & WS_EX_TOPMOST, "No WS_EX_TOPMOST style.\n");
occlusion_desc.hWnd = hwnd;
status = pD3DKMTCheckOcclusion(&occlusion_desc);
ok(status == expected_occlusion, "Got unexpected return code %#x.\n", status);
ok(status == expected_occlusion, "Got unexpected return code %#lx.\n", status);
DestroyWindow(hwnd2);
occlusion_desc.hWnd = hwnd;
status = pD3DKMTCheckOcclusion(&occlusion_desc);
ok(status == expected_occlusion, "Got unexpected return code %#x.\n", status);
ok(status == expected_occlusion, "Got unexpected return code %#lx.\n", status);
check_owner_desc.hAdapter = open_adapter_gdi_desc.hAdapter;
check_owner_desc.VidPnSourceId = open_adapter_gdi_desc.VidPnSourceId;
status = pD3DKMTCheckVidPnExclusiveOwnership(&check_owner_desc);
ok(status == STATUS_GRAPHICS_PRESENT_OCCLUDED, "Got unexpected return code %#x.\n", status);
ok(status == STATUS_GRAPHICS_PRESENT_OCCLUDED, "Got unexpected return code %#lx.\n", status);
/* Unset video present source owner */
set_owner_desc.hDevice = create_device_desc.hDevice;
......@@ -774,24 +774,24 @@ static void test_D3DKMTCheckOcclusion(void)
set_owner_desc.pVidPnSourceId = NULL;
set_owner_desc.VidPnSourceCount = 0;
status = pD3DKMTSetVidPnSourceOwner(&set_owner_desc);
ok(status == STATUS_SUCCESS, "Got unexpected return code %#x.\n", status);
ok(status == STATUS_SUCCESS, "Got unexpected return code %#lx.\n", status);
occlusion_desc.hWnd = hwnd;
status = pD3DKMTCheckOcclusion(&occlusion_desc);
ok(status == STATUS_SUCCESS, "Got unexpected return code %#x.\n", status);
ok(status == STATUS_SUCCESS, "Got unexpected return code %#lx.\n", status);
check_owner_desc.hAdapter = open_adapter_gdi_desc.hAdapter;
check_owner_desc.VidPnSourceId = open_adapter_gdi_desc.VidPnSourceId;
status = pD3DKMTCheckVidPnExclusiveOwnership(&check_owner_desc);
ok(status == STATUS_SUCCESS || status == STATUS_GRAPHICS_PRESENT_UNOCCLUDED, "Got unexpected return code %#x.\n", status);
ok(status == STATUS_SUCCESS || status == STATUS_GRAPHICS_PRESENT_UNOCCLUDED, "Got unexpected return code %#lx.\n", status);
destroy_device_desc.hDevice = create_device_desc.hDevice;
status = pD3DKMTDestroyDevice(&destroy_device_desc);
ok(status == STATUS_SUCCESS, "Got unexpected return code %#x.\n", status);
ok(status == STATUS_SUCCESS, "Got unexpected return code %#lx.\n", status);
close_adapter_desc.hAdapter = open_adapter_gdi_desc.hAdapter;
status = pD3DKMTCloseAdapter(&close_adapter_desc);
ok(status == STATUS_SUCCESS, "Got unexpected return code %#x.\n", status);
ok(status == STATUS_SUCCESS, "Got unexpected return code %#lx.\n", status);
DestroyWindow(hwnd);
}
......@@ -812,7 +812,7 @@ static void test_D3DKMTOpenAdapterFromDeviceName_deviface(const GUID *devinterfa
BOOL ret;
set = SetupDiGetClassDevsW(devinterface_guid, NULL, NULL, DIGCF_DEVICEINTERFACE | DIGCF_PRESENT);
ok(set != INVALID_HANDLE_VALUE, "SetupDiGetClassDevs failed, error %u.\n", GetLastError());
ok(set != INVALID_HANDLE_VALUE, "SetupDiGetClassDevs failed, error %lu.\n", GetLastError());
iface_data = (SP_DEVICE_INTERFACE_DETAIL_DATA_W *)iface_detail_buffer;
iface_data->cbSize = sizeof(*iface_data);
......@@ -823,16 +823,16 @@ static void test_D3DKMTOpenAdapterFromDeviceName_deviface(const GUID *devinterfa
{
ret = SetupDiGetDeviceInterfaceDetailW(set, &iface, iface_data,
sizeof(iface_detail_buffer), NULL, &device_data );
ok(ret, "Got unexpected ret %d, GetLastError() %u.\n", ret, GetLastError());
ok(ret, "Got unexpected ret %d, GetLastError() %lu.\n", ret, GetLastError());
status = pD3DKMTOpenAdapterFromDeviceName(&device_name);
todo_wine_if(todo) ok(status == expected_status, "Got status %#x, expected %#x.\n", status, expected_status);
todo_wine_if(todo) ok(status == expected_status, "Got status %#lx, expected %#lx.\n", status, expected_status);
if (!status)
{
ret = SetupDiGetDevicePropertyW(set, &device_data, &DEVPROPKEY_GPU_LUID, &type,
(BYTE *)&luid, sizeof(luid), NULL, 0);
ok(ret || GetLastError() == ERROR_NOT_FOUND, "Got unexpected ret %d, GetLastError() %u.\n",
ok(ret || GetLastError() == ERROR_NOT_FOUND, "Got unexpected ret %d, GetLastError() %lu.\n",
ret, GetLastError());
if (ret)
......@@ -847,7 +847,7 @@ static void test_D3DKMTOpenAdapterFromDeviceName_deviface(const GUID *devinterfa
close_adapter_desc.hAdapter = device_name.hAdapter;
status = pD3DKMTCloseAdapter(&close_adapter_desc);
ok(!status, "Got unexpected status %#x.\n", status);
ok(!status, "Got unexpected status %#lx.\n", status);
}
++i;
}
......@@ -871,11 +871,11 @@ static void test_D3DKMTOpenAdapterFromDeviceName(void)
win_skip("D3DKMTOpenAdapterFromDeviceName() is not supported.\n");
return;
}
ok(status == STATUS_INVALID_PARAMETER, "Got unexpected status %#x.\n", status);
ok(status == STATUS_INVALID_PARAMETER, "Got unexpected status %#lx.\n", status);
memset(&device_name, 0, sizeof(device_name));
status = pD3DKMTOpenAdapterFromDeviceName(&device_name);
ok(status == STATUS_INVALID_PARAMETER, "Got unexpected status %#x.\n", status);
ok(status == STATUS_INVALID_PARAMETER, "Got unexpected status %#lx.\n", status);
winetest_push_context("GUID_DEVINTERFACE_DISPLAY_ADAPTER");
test_D3DKMTOpenAdapterFromDeviceName_deviface(&GUID_DEVINTERFACE_DISPLAY_ADAPTER, STATUS_INVALID_PARAMETER, TRUE);
......
This source diff could not be displayed because it is too large. You can view the blob instead.
......@@ -47,41 +47,41 @@ static void test_gdi_objects(void)
SetLastError(0);
hp = SelectObject(NULL, GetStockObject(BLACK_PEN));
ok(!hp && (GetLastError() == ERROR_INVALID_HANDLE || broken(!GetLastError())),
"SelectObject(NULL DC) expected 0, ERROR_INVALID_HANDLE, got %p, %u\n",
"SelectObject(NULL DC) expected 0, ERROR_INVALID_HANDLE, got %p, %lu\n",
hp, GetLastError());
/* With a valid DC and a NULL object, the call returns 0 but does not SetLastError() */
SetLastError(0);
hp = SelectObject(hdc, NULL);
ok(!hp && !GetLastError(),
"SelectObject(NULL obj) expected 0, NO_ERROR, got %p, %u\n",
"SelectObject(NULL obj) expected 0, NO_ERROR, got %p, %lu\n",
hp, GetLastError());
/* The DC is unaffected by the NULL SelectObject */
SetLastError(0);
hp = SelectObject(hdc, GetStockObject(BLACK_PEN));
ok(hp && !GetLastError(),
"SelectObject(post NULL) expected non-null, NO_ERROR, got %p, %u\n",
"SelectObject(post NULL) expected non-null, NO_ERROR, got %p, %lu\n",
hp, GetLastError());
/* GetCurrentObject does not SetLastError() on a null object */
SetLastError(0);
hp = GetCurrentObject(NULL, OBJ_PEN);
ok(!hp && !GetLastError(),
"GetCurrentObject(NULL DC) expected 0, NO_ERROR, got %p, %u\n",
"GetCurrentObject(NULL DC) expected 0, NO_ERROR, got %p, %lu\n",
hp, GetLastError());
/* DeleteObject does not SetLastError() on a null object */
ret = DeleteObject(NULL);
ok( !ret && !GetLastError(),
"DeleteObject(NULL obj), expected 0, NO_ERROR, got %d, %u\n",
"DeleteObject(NULL obj), expected 0, NO_ERROR, got %d, %lu\n",
ret, GetLastError());
/* GetObject does not SetLastError() on a null object */
SetLastError(0);
i = GetObjectA(NULL, sizeof(buff), buff);
ok (!i && (GetLastError() == 0 || GetLastError() == ERROR_INVALID_PARAMETER),
"GetObject(NULL obj), expected 0, NO_ERROR, got %d, %u\n",
"GetObject(NULL obj), expected 0, NO_ERROR, got %d, %lu\n",
i, GetLastError());
/* GetObject expects ERROR_NOACCESS when passed an invalid buffer */
......@@ -89,21 +89,21 @@ static void test_gdi_objects(void)
SetLastError(0);
i = GetObjectA(hp, (INT_PTR)buff, (LPVOID)sizeof(buff));
ok (!i && (GetLastError() == 0 || GetLastError() == ERROR_NOACCESS),
"GetObject(invalid buff), expected 0, ERROR_NOACCESS, got %d, %u\n",
"GetObject(invalid buff), expected 0, ERROR_NOACCESS, got %d, %lu\n",
i, GetLastError());
/* GetObjectType does SetLastError() on a null object */
SetLastError(0);
i = GetObjectType(NULL);
ok (!i && GetLastError() == ERROR_INVALID_HANDLE,
"GetObjectType(NULL obj), expected 0, ERROR_INVALID_HANDLE, got %d, %u\n",
"GetObjectType(NULL obj), expected 0, ERROR_INVALID_HANDLE, got %d, %lu\n",
i, GetLastError());
/* UnrealizeObject does not SetLastError() on a null object */
SetLastError(0);
i = UnrealizeObject(NULL);
ok (!i && !GetLastError(),
"UnrealizeObject(NULL obj), expected 0, NO_ERROR, got %d, %u\n",
"UnrealizeObject(NULL obj), expected 0, NO_ERROR, got %d, %lu\n",
i, GetLastError());
ReleaseDC(NULL, hdc);
......@@ -125,7 +125,7 @@ static DWORD WINAPI thread_proc(void *param)
struct hgdiobj_event *hgdiobj_event = param;
hgdiobj_event->hdc = CreateDCA("display", NULL, NULL, NULL);
ok(hgdiobj_event->hdc != NULL, "CreateDC error %u\n", GetLastError());
ok(hgdiobj_event->hdc != NULL, "CreateDC error %lu\n", GetLastError());
hgdiobj_event->hgdiobj1 = CreatePen(PS_DASHDOTDOT, 17, RGB(1, 2, 3));
ok(hgdiobj_event->hgdiobj1 != 0, "Failed to create pen\n");
......@@ -135,7 +135,7 @@ static DWORD WINAPI thread_proc(void *param)
SetEvent(hgdiobj_event->ready_event);
status = WaitForSingleObject(hgdiobj_event->stop_event, INFINITE);
ok(status == WAIT_OBJECT_0, "WaitForSingleObject error %u\n", GetLastError());
ok(status == WAIT_OBJECT_0, "WaitForSingleObject error %lu\n", GetLastError());
ok(!GetObjectA(hgdiobj_event->hgdiobj1, sizeof(lp), &lp), "GetObject should fail\n");
......@@ -155,43 +155,43 @@ static void test_thread_objects(void)
BOOL bRet;
hgdiobj_event.stop_event = CreateEventA(NULL, 0, 0, NULL);
ok(hgdiobj_event.stop_event != NULL, "CreateEvent error %u\n", GetLastError());
ok(hgdiobj_event.stop_event != NULL, "CreateEvent error %lu\n", GetLastError());
hgdiobj_event.ready_event = CreateEventA(NULL, 0, 0, NULL);
ok(hgdiobj_event.ready_event != NULL, "CreateEvent error %u\n", GetLastError());
ok(hgdiobj_event.ready_event != NULL, "CreateEvent error %lu\n", GetLastError());
hthread = CreateThread(NULL, 0, thread_proc, &hgdiobj_event, 0, &tid);
ok(hthread != NULL, "CreateThread error %u\n", GetLastError());
ok(hthread != NULL, "CreateThread error %lu\n", GetLastError());
status = WaitForSingleObject(hgdiobj_event.ready_event, INFINITE);
ok(status == WAIT_OBJECT_0, "WaitForSingleObject error %u\n", GetLastError());
ok(status == WAIT_OBJECT_0, "WaitForSingleObject error %lu\n", GetLastError());
ret = GetObjectA(hgdiobj_event.hgdiobj1, sizeof(lp), &lp);
ok(ret == sizeof(lp), "GetObject error %u\n", GetLastError());
ok(ret == sizeof(lp), "GetObject error %lu\n", GetLastError());
ok(lp.lopnStyle == PS_DASHDOTDOT, "wrong pen style %d\n", lp.lopnStyle);
ok(lp.lopnWidth.x == 17, "wrong pen width.y %d\n", lp.lopnWidth.x);
ok(lp.lopnWidth.y == 0, "wrong pen width.y %d\n", lp.lopnWidth.y);
ok(lp.lopnColor == RGB(1, 2, 3), "wrong pen width.y %08x\n", lp.lopnColor);
ok(lp.lopnWidth.x == 17, "wrong pen width.y %ld\n", lp.lopnWidth.x);
ok(lp.lopnWidth.y == 0, "wrong pen width.y %ld\n", lp.lopnWidth.y);
ok(lp.lopnColor == RGB(1, 2, 3), "wrong pen width.y %08lx\n", lp.lopnColor);
ret = GetDeviceCaps(hgdiobj_event.hdc, TECHNOLOGY);
ok(ret == DT_RASDISPLAY, "GetDeviceCaps(TECHNOLOGY) should return DT_RASDISPLAY not %d\n", ret);
bRet = DeleteObject(hgdiobj_event.hgdiobj1);
ok(bRet, "DeleteObject error %u\n", GetLastError());
ok(bRet, "DeleteObject error %lu\n", GetLastError());
bRet = DeleteDC(hgdiobj_event.hdc);
ok(bRet, "DeleteDC error %u\n", GetLastError());
ok(bRet, "DeleteDC error %lu\n", GetLastError());
type = GetObjectType(hgdiobj_event.hgdiobj2);
ok(type == OBJ_REGION, "GetObjectType returned %u\n", type);
ok(type == OBJ_REGION, "GetObjectType returned %lu\n", type);
SetEvent(hgdiobj_event.stop_event);
status = WaitForSingleObject(hthread, INFINITE);
ok(status == WAIT_OBJECT_0, "WaitForSingleObject error %u\n", GetLastError());
ok(status == WAIT_OBJECT_0, "WaitForSingleObject error %lu\n", GetLastError());
CloseHandle(hthread);
type = GetObjectType(hgdiobj_event.hgdiobj2);
ok(type == OBJ_REGION, "GetObjectType returned %u\n", type);
ok(type == OBJ_REGION, "GetObjectType returned %lu\n", type);
bRet = DeleteObject(hgdiobj_event.hgdiobj2);
ok(bRet, "DeleteObject error %u\n", GetLastError());
ok(bRet, "DeleteObject error %lu\n", GetLastError());
CloseHandle(hgdiobj_event.stop_event);
CloseHandle(hgdiobj_event.ready_event);
......@@ -216,7 +216,7 @@ static void test_GetCurrentObject(void)
assert(hdc != 0);
type = GetObjectType(hdc);
ok(type == OBJ_MEMDC, "GetObjectType returned %u\n", type);
ok(type == OBJ_MEMDC, "GetObjectType returned %lu\n", type);
hpen = CreatePen(PS_SOLID, 10, RGB(10, 20, 30));
assert(hpen != 0);
......@@ -354,9 +354,9 @@ static void test_handles_on_win64(void)
hrgn_test = (HRGN)(ULONG_PTR)((ULONG_PTR)hrgn | ((ULONGLONG)cases[i].high << 32) | cases[i].low);
type = GetObjectType( hrgn_test );
if (cases[i].ret)
ok( type == OBJ_REGION, "wrong type %u\n", type );
ok( type == OBJ_REGION, "wrong type %lu\n", type );
else
ok( type == 0, "wrong type %u\n", type );
ok( type == 0, "wrong type %lu\n", type );
ret = DeleteObject(hrgn_test);
ok( cases[i].ret == ret, "DeleteObject should return %s (%p)\n",
cases[i].ret ? "TRUE" : "FALSE", hrgn_test);
......@@ -430,7 +430,7 @@ static void test_shared_handle_table(void)
handle = HandleToULong( hrgn );
entry = &gdi_shared->Handles[handle & 0xffff];
todo_wine
ok(entry->Owner.ProcessId == GetCurrentProcessId(), "ProcessId = %x, expected %x\n",
ok(entry->Owner.ProcessId == GetCurrentProcessId(), "ProcessId = %x, expected %lx\n",
entry->Owner.ProcessId, GetCurrentProcessId());
test_shared_handle_entry( hrgn, NTGDI_OBJ_REGION, FALSE );
......@@ -442,7 +442,7 @@ static void test_shared_handle_table(void)
ok(entry->Type == 4, "Type = %x\n", entry->Type);
ok(entry->Object, "Object = NULL\n");
todo_wine
ok(entry->Owner.ProcessId == GetCurrentProcessId(), "ProcessId = %x, expected %x\n",
ok(entry->Owner.ProcessId == GetCurrentProcessId(), "ProcessId = %x, expected %lx\n",
entry->Owner.ProcessId, GetCurrentProcessId());
ok(entry->Owner.Count == 0, "Count = %u\n", entry->Owner.Count);
......@@ -465,7 +465,7 @@ static void test_shared_handle_table(void)
test_shared_handle_entry( GetStockObject( STOCK_LAST + 1 ), NTGDI_OBJ_BITMAP, TRUE );
dc = CreateDCW(L"display", NULL, NULL, NULL);
ok(GetObjectType(dc) == OBJ_DC, "GetObjectType(dc) = %x\n", GetObjectType(dc));
ok(GetObjectType(dc) == OBJ_DC, "GetObjectType(dc) = %lx\n", GetObjectType(dc));
test_shared_handle_entry( dc, NTGDI_OBJ_DC, FALSE );
DeleteDC(dc);
......
......@@ -48,12 +48,12 @@ static void test_GetICMProfileA( HDC dc )
size = MAX_PATH;
ret = GetICMProfileA( dc, &size, NULL );
ok( !ret, "GetICMProfileA succeeded\n" );
ok( size > 0, "got %u\n", size );
ok( size > 0, "got %lu\n", size );
size = 0;
ret = GetICMProfileA( dc, &size, NULL );
ok( !ret, "GetICMProfileA succeeded\n" );
ok( size > 0, "got %u\n", size );
ok( size > 0, "got %lu\n", size );
size = MAX_PATH;
ret = GetICMProfileA( NULL, &size, filename );
......@@ -67,14 +67,14 @@ static void test_GetICMProfileA( HDC dc )
ok( !ret, "GetICMProfileA succeeded\n" );
ok( size, "expected size > 0\n" );
ok( filename[0] == 0, "Expected filename to be empty\n" );
ok( error == ERROR_INSUFFICIENT_BUFFER, "got %d, expected ERROR_INSUFFICIENT_BUFFER\n", error );
ok( error == ERROR_INSUFFICIENT_BUFFER, "got %ld, expected ERROR_INSUFFICIENT_BUFFER\n", error );
ret = GetICMProfileA( dc, NULL, filename );
ok( !ret, "GetICMProfileA succeeded\n" );
size = MAX_PATH;
ret = GetICMProfileA( dc, &size, filename );
ok( ret, "GetICMProfileA failed %d\n", GetLastError() );
ok( ret, "GetICMProfileA failed %ld\n", GetLastError() );
trace( "%s\n", filename );
}
......@@ -102,7 +102,7 @@ static void test_GetICMProfileW( HDC dc )
/* Vista crashes */
size = MAX_PATH;
ret = GetICMProfileW( dc, &size, NULL );
ok( ret, "GetICMProfileW failed %d\n", GetLastError() );
ok( ret, "GetICMProfileW failed %ld\n", GetLastError() );
}
ret = GetICMProfileW( dc, NULL, filename );
......@@ -115,7 +115,7 @@ static void test_GetICMProfileW( HDC dc )
size = 0;
ret = GetICMProfileW( dc, &size, NULL );
ok( !ret, "GetICMProfileW succeeded\n" );
ok( size > 0, "got %u\n", size );
ok( size > 0, "got %lu\n", size );
size = 0;
SetLastError(0xdeadbeef);
......@@ -123,11 +123,11 @@ static void test_GetICMProfileW( HDC dc )
error = GetLastError();
ok( !ret, "GetICMProfileW succeeded\n" );
ok( size, "expected size > 0\n" );
ok( error == ERROR_INSUFFICIENT_BUFFER, "got %d, expected ERROR_INSUFFICIENT_BUFFER\n", error );
ok( error == ERROR_INSUFFICIENT_BUFFER, "got %ld, expected ERROR_INSUFFICIENT_BUFFER\n", error );
size = MAX_PATH;
ret = GetICMProfileW( dc, &size, filename );
ok( ret, "GetICMProfileW failed %d\n", GetLastError() );
ok( ret, "GetICMProfileW failed %ld\n", GetLastError() );
}
static void test_SetICMMode( HDC dc )
......@@ -145,24 +145,24 @@ static void test_SetICMMode( HDC dc )
SetLastError( 0xdeadbeef );
ret = SetICMMode( NULL, 0 );
ok( !ret, "SetICMMode succeeded (%d)\n", GetLastError() );
ok( !ret, "SetICMMode succeeded (%ld)\n", GetLastError() );
ret = SetICMMode( dc, -1 );
ok( !ret, "SetICMMode succeeded (%d)\n", GetLastError() );
ok( !ret, "SetICMMode succeeded (%ld)\n", GetLastError() );
save = SetICMMode( dc, ICM_QUERY );
ok( save == ICM_ON || save == ICM_OFF, "SetICMMode failed (%d)\n", GetLastError() );
ok( save == ICM_ON || save == ICM_OFF, "SetICMMode failed (%ld)\n", GetLastError() );
if (save == ICM_ON) knob = ICM_OFF; else knob = ICM_ON;
ret = SetICMMode( dc, knob );
todo_wine ok( ret, "SetICMMode failed (%d)\n", GetLastError() );
todo_wine ok( ret, "SetICMMode failed (%ld)\n", GetLastError() );
ret = SetICMMode( dc, ICM_QUERY );
todo_wine ok( ret == knob, "SetICMMode failed (%d)\n", GetLastError() );
todo_wine ok( ret == knob, "SetICMMode failed (%ld)\n", GetLastError() );
ret = SetICMMode( dc, save );
ok( ret, "SetICMMode failed (%d)\n", GetLastError() );
ok( ret, "SetICMMode failed (%ld)\n", GetLastError() );
SetLastError( 0xdeadbeef );
dc = CreateDCW( L"DISPLAY", NULL, NULL, NULL );
......@@ -171,10 +171,10 @@ static void test_SetICMMode( HDC dc )
win_skip( "CreateDCW is not implemented\n" );
return;
}
ok( dc != NULL, "CreateDCW failed (%d)\n", GetLastError() );
ok( dc != NULL, "CreateDCW failed (%ld)\n", GetLastError() );
ret = SetICMMode( dc, ICM_QUERY );
ok( ret == ICM_OFF, "SetICMMode failed (%d)\n", GetLastError() );
ok( ret == ICM_OFF, "SetICMMode failed (%ld)\n", GetLastError() );
DeleteDC( dc );
}
......@@ -235,31 +235,31 @@ static void test_SetICMProfileA( HDC dc )
len = sizeof(profile);
ret = GetICMProfileA( dc, &len, profile );
ok(ret, "GetICMProfileA failed %u\n", GetLastError());
ok(ret, "GetICMProfileA failed %lu\n", GetLastError());
SetLastError( 0xdeadbeef );
ret = SetICMProfileA( NULL, NULL );
error = GetLastError();
ok(!ret, "SetICMProfileA succeeded\n");
ok(error == ERROR_INVALID_PARAMETER,
"expected ERROR_INVALID_PARAMETER, got %u\n", error);
"expected ERROR_INVALID_PARAMETER, got %lu\n", error);
SetLastError( 0xdeadbeef );
ret = SetICMProfileA( NULL, profile );
error = GetLastError();
ok(!ret, "SetICMProfileA succeeded\n");
ok(error == ERROR_INVALID_HANDLE,
"expected ERROR_INVALID_HANDLE, got %u\n", error);
"expected ERROR_INVALID_HANDLE, got %lu\n", error);
SetLastError( 0xdeadbeef );
ret = SetICMProfileA( dc, NULL );
error = GetLastError();
ok(!ret, "SetICMProfileA succeeded\n");
ok(error == ERROR_INVALID_PARAMETER,
"expected ERROR_INVALID_PARAMETER, got %u\n", error);
"expected ERROR_INVALID_PARAMETER, got %lu\n", error);
ret = SetICMProfileA( dc, profile );
ok(ret, "SetICMProfileA failed %u\n", GetLastError());
ok(ret, "SetICMProfileA failed %lu\n", GetLastError());
}
static void test_SetICMProfileW( HDC dc )
......@@ -278,28 +278,28 @@ static void test_SetICMProfileW( HDC dc )
len = ARRAY_SIZE(profile);
ret = GetICMProfileW( dc, &len, profile );
ok(ret, "GetICMProfileW failed %u\n", GetLastError());
ok(ret, "GetICMProfileW failed %lu\n", GetLastError());
SetLastError( 0xdeadbeef );
ret = SetICMProfileW( NULL, NULL );
error = GetLastError();
ok(!ret, "SetICMProfileW succeeded\n");
ok(error == ERROR_INVALID_PARAMETER, "expected ERROR_INVALID_PARAMETER, got %u\n", error);
ok(error == ERROR_INVALID_PARAMETER, "expected ERROR_INVALID_PARAMETER, got %lu\n", error);
SetLastError( 0xdeadbeef );
ret = SetICMProfileW( NULL, profile );
error = GetLastError();
ok(!ret, "SetICMProfileW succeeded\n");
ok(error == ERROR_INVALID_HANDLE, "expected ERROR_INVALID_HANDLE, got %u\n", error);
ok(error == ERROR_INVALID_HANDLE, "expected ERROR_INVALID_HANDLE, got %lu\n", error);
SetLastError( 0xdeadbeef );
ret = SetICMProfileW( dc, NULL );
error = GetLastError();
ok(!ret, "SetICMProfileW succeeded\n");
ok(error == ERROR_INVALID_PARAMETER, "expected ERROR_INVALID_PARAMETER, got %u\n", error);
ok(error == ERROR_INVALID_PARAMETER, "expected ERROR_INVALID_PARAMETER, got %lu\n", error);
ret = SetICMProfileW( dc, profile );
ok(ret, "SetICMProfileW failed %u\n", GetLastError());
ok(ret, "SetICMProfileW failed %lu\n", GetLastError());
}
START_TEST(icm)
......
......@@ -39,8 +39,8 @@ static BOOL (WINAPI *pSetVirtualResolution)(HDC, DWORD, DWORD, DWORD, DWORD);
{ \
POINT _pt = { 1000, 1000 }; \
LPtoDP(_hdc, &_pt, 1); \
ok(rough_match(_pt.x, _x), "expected x %d, got %d\n", (_x), _pt.x); \
ok(rough_match(_pt.y, _y), "expected y %d, got %d\n", (_y), _pt.y); \
ok(rough_match(_pt.x, _x), "expected x %d, got %ld\n", (_x), _pt.x); \
ok(rough_match(_pt.y, _y), "expected y %d, got %ld\n", (_y), _pt.y); \
}
#define expect_world_transform(_hdc, _em11, _em22) \
......@@ -51,7 +51,7 @@ static BOOL (WINAPI *pSetVirtualResolution)(HDC, DWORD, DWORD, DWORD, DWORD);
_ret = GetWorldTransform(_hdc, &_xform); \
if (GetLastError() != ERROR_CALL_NOT_IMPLEMENTED) \
{ \
ok(_ret, "GetWorldTransform error %u\n", GetLastError()); \
ok(_ret, "GetWorldTransform error %lu\n", GetLastError()); \
ok(_xform.eM11 == (_em11), "expected %f, got %f\n", (_em11), _xform.eM11); \
ok(_xform.eM12 == 0.0, "expected 0.0, got %f\n", _xform.eM12); \
ok(_xform.eM21 == 0.0, "expected 0.0, got %f\n", _xform.eM21); \
......@@ -67,9 +67,9 @@ static BOOL (WINAPI *pSetVirtualResolution)(HDC, DWORD, DWORD, DWORD, DWORD);
SIZE _size; \
SetLastError(0xdeadbeef); \
_ret = _func(_hdc, &_size); \
ok(_ret, #_func " error %u\n", GetLastError()); \
ok(_size.cx == (_cx), "expected cx %d, got %d\n", (_cx), _size.cx); \
ok(_size.cy == (_cy), "expected cy %d, got %d\n", (_cy), _size.cy); \
ok(_ret, #_func " error %lu\n", GetLastError()); \
ok(_size.cx == (_cx), "expected cx %ld, got %ld\n", (_cx), _size.cx); \
ok(_size.cy == (_cy), "expected cy %ld, got %ld\n", (_cy), _size.cy); \
}
#define expect_viewport_ext(_hdc, _cx, _cy) expect_dc_ext(GetViewportExtEx, _hdc, _cx, _cy)
......@@ -78,7 +78,8 @@ static BOOL (WINAPI *pSetVirtualResolution)(HDC, DWORD, DWORD, DWORD, DWORD);
static void test_world_transform(void)
{
HDC hdc;
INT ret, size_cx, size_cy, res_x, res_y, dpi_x, dpi_y;
int ret;
LONG size_cx, size_cy, res_x, res_y, dpi_x, dpi_y;
XFORM xform;
SIZE size;
......@@ -99,11 +100,11 @@ static void test_world_transform(void)
res_y = GetDeviceCaps(hdc, VERTRES);
dpi_x = GetDeviceCaps(hdc, LOGPIXELSX);
dpi_y = GetDeviceCaps(hdc, LOGPIXELSY);
trace("dc size %d x %d, resolution %d x %d dpi %d x %d\n",
trace("dc size %ld x %ld, resolution %ld x %ld dpi %ld x %ld\n",
size_cx, size_cy, res_x, res_y, dpi_x, dpi_y );
expect_viewport_ext(hdc, 1, 1);
expect_window_ext(hdc, 1, 1);
expect_viewport_ext(hdc, 1l, 1l);
expect_window_ext(hdc, 1l, 1l);
expect_world_transform(hdc, 1.0, 1.0);
expect_LPtoDP(hdc, 1000, 1000);
......@@ -115,10 +116,10 @@ static void test_world_transform(void)
ok( GetWindowExtEx( hdc, &size ), "GetWindowExtEx failed\n" );
ok( rough_match( size.cx, size_cx * 10 ) ||
rough_match( size.cx, MulDiv( res_x, 254, dpi_x )), /* Vista uses a more precise method */
"expected cx %d or %d, got %d\n", size_cx * 10, MulDiv( res_x, 254, dpi_x ), size.cx );
"expected cx %ld or %d, got %ld\n", size_cx * 10, MulDiv( res_x, 254, dpi_x ), size.cx );
ok( rough_match( size.cy, size_cy * 10 ) ||
rough_match( size.cy, MulDiv( res_y, 254, dpi_y )), /* Vista uses a more precise method */
"expected cy %d or %d, got %d\n", size_cy * 10, MulDiv( res_y, 254, dpi_y ), size.cy );
"expected cy %ld or %d, got %ld\n", size_cy * 10, MulDiv( res_y, 254, dpi_y ), size.cy );
expect_world_transform(hdc, 1.0, 1.0);
expect_LPtoDP(hdc, MulDiv(1000 / 10, res_x, size_cx), -MulDiv(1000 / 10, res_y, size_cy));
......@@ -126,8 +127,8 @@ static void test_world_transform(void)
ret = SetMapMode(hdc, MM_TEXT);
ok(ret == MM_LOMETRIC, "expected MM_LOMETRIC, got %d\n", ret);
expect_viewport_ext(hdc, 1, 1);
expect_window_ext(hdc, 1, 1);
expect_viewport_ext(hdc, 1l, 1l);
expect_window_ext(hdc, 1l, 1l);
expect_world_transform(hdc, 1.0, 1.0);
expect_LPtoDP(hdc, 1000, 1000);
......@@ -139,8 +140,8 @@ static void test_world_transform(void)
return;
}
expect_viewport_ext(hdc, 1, 1);
expect_window_ext(hdc, 1, 1);
expect_viewport_ext(hdc, 1l, 1l);
expect_window_ext(hdc, 1l, 1l);
expect_world_transform(hdc, 1.0, 1.0);
expect_LPtoDP(hdc, 1000, 1000);
......@@ -164,10 +165,10 @@ static void test_world_transform(void)
xform.eDy = 0.0f;
SetLastError(0xdeadbeef);
ret = SetWorldTransform(hdc, &xform);
ok(ret, "SetWorldTransform error %u\n", GetLastError());
ok(ret, "SetWorldTransform error %lu\n", GetLastError());
expect_viewport_ext(hdc, 1, 1);
expect_window_ext(hdc, 1, 1);
expect_viewport_ext(hdc, 1l, 1l);
expect_window_ext(hdc, 1l, 1l);
expect_world_transform(hdc, 20.0, 20.0);
expect_LPtoDP(hdc, 20000, 20000);
......@@ -179,10 +180,10 @@ static void test_world_transform(void)
ok( GetWindowExtEx( hdc, &size ), "GetWindowExtEx failed\n" );
ok( rough_match( size.cx, size_cx * 10 ) ||
rough_match( size.cx, MulDiv( res_x, 254, dpi_x )), /* Vista uses a more precise method */
"expected cx %d or %d, got %d\n", size_cx * 10, MulDiv( res_x, 254, dpi_x ), size.cx );
"expected cx %ld or %d, got %ld\n", size_cx * 10, MulDiv( res_x, 254, dpi_x ), size.cx );
ok( rough_match( size.cy, size_cy * 10 ) ||
rough_match( size.cy, MulDiv( res_y, 254, dpi_y )), /* Vista uses a more precise method */
"expected cy %d or %d, got %d\n", size_cy * 10, MulDiv( res_y, 254, dpi_y ), size.cy );
"expected cy %ld or %d, got %ld\n", size_cy * 10, MulDiv( res_y, 254, dpi_y ), size.cy );
expect_world_transform(hdc, 20.0, 20.0);
expect_LPtoDP(hdc, MulDiv(20000, res_x, size.cx), -MulDiv(20000, res_y, size.cy));
......@@ -190,8 +191,8 @@ static void test_world_transform(void)
ret = SetMapMode(hdc, MM_TEXT);
ok(ret == MM_LOMETRIC, "expected MM_LOMETRIC, got %d\n", ret);
expect_viewport_ext(hdc, 1, 1);
expect_window_ext(hdc, 1, 1);
expect_viewport_ext(hdc, 1l, 1l);
expect_window_ext(hdc, 1l, 1l);
expect_world_transform(hdc, 20.0, 20.0);
expect_LPtoDP(hdc, 20000, 20000);
......@@ -199,17 +200,17 @@ static void test_world_transform(void)
size.cy = 0xdeadbeef;
ret = SetViewportExtEx(hdc, -1, -1, &size);
ok(ret, "SetViewportExtEx(-1, -1) failed\n");
ok(size.cx == 1 && size.cy == 1, "expected 1,1 got %d,%d\n", size.cx, size.cy);
expect_viewport_ext(hdc, 1, 1);
expect_window_ext(hdc, 1, 1);
ok(size.cx == 1 && size.cy == 1, "expected 1,1 got %ld,%ld\n", size.cx, size.cy);
expect_viewport_ext(hdc, 1l, 1l);
expect_window_ext(hdc, 1l, 1l);
expect_world_transform(hdc, 20.0, 20.0);
expect_LPtoDP(hdc, 20000, 20000);
ret = SetMapMode(hdc, MM_ANISOTROPIC);
ok(ret == MM_TEXT, "expected MM_TEXT, got %d\n", ret);
expect_viewport_ext(hdc, 1, 1);
expect_window_ext(hdc, 1, 1);
expect_viewport_ext(hdc, 1l, 1l);
expect_window_ext(hdc, 1l, 1l);
expect_world_transform(hdc, 20.0, 20.0);
expect_LPtoDP(hdc, 20000, 20000);
......@@ -217,9 +218,9 @@ static void test_world_transform(void)
size.cy = 0xdeadbeef;
ret = SetViewportExtEx(hdc, -1, -1, &size);
ok(ret, "SetViewportExtEx(-1, -1) failed\n");
ok(size.cx == 1 && size.cy == 1, "expected 1,1 got %d,%d\n", size.cx, size.cy);
expect_viewport_ext(hdc, -1, -1);
expect_window_ext(hdc, 1, 1);
ok(size.cx == 1 && size.cy == 1, "expected 1,1 got %ld,%ld\n", size.cx, size.cy);
expect_viewport_ext(hdc, -1l, -1l);
expect_window_ext(hdc, 1l, 1l);
expect_world_transform(hdc, 20.0, 20.0);
expect_LPtoDP(hdc, -20000, -20000);
......@@ -228,8 +229,8 @@ static void test_world_transform(void)
ret = GetGraphicsMode(hdc);
ok(ret == GM_COMPATIBLE, "expected GM_COMPATIBLE, got %d\n", ret);
expect_viewport_ext(hdc, -1, -1);
expect_window_ext(hdc, 1, 1);
expect_viewport_ext(hdc, -1l, -1l);
expect_window_ext(hdc, 1l, 1l);
expect_world_transform(hdc, 20.0, 20.0);
expect_LPtoDP(hdc, -20000, -20000);
......@@ -238,7 +239,8 @@ static void test_world_transform(void)
static void test_dc_layout(void)
{
INT ret, size_cx, size_cy, res_x, res_y, dpi_x, dpi_y;
INT ret;
LONG size_cx, size_cy, res_x, res_y, dpi_x, dpi_y;
SIZE size;
POINT pt;
HBITMAP bitmap;
......@@ -265,8 +267,8 @@ static void test_dc_layout(void)
ret = GetMapMode( hdc );
ok(ret == MM_TEXT, "expected MM_TEXT, got %d\n", ret);
expect_viewport_ext(hdc, 1, 1);
expect_window_ext(hdc, 1, 1);
expect_viewport_ext(hdc, 1l, 1l);
expect_window_ext(hdc, 1l, 1l);
expect_world_transform(hdc, 1.0, 1.0);
expect_LPtoDP(hdc, 1000, 1000);
......@@ -282,16 +284,16 @@ static void test_dc_layout(void)
ok(ret == MM_ANISOTROPIC, "expected MM_ANISOTROPIC, got %d\n", ret);
ret = pGetLayout( hdc );
ok(ret == LAYOUT_RTL, "got %x\n", ret);
expect_viewport_ext(hdc, 1, 1);
expect_window_ext(hdc, 1, 1);
expect_viewport_ext(hdc, 1l, 1l);
expect_window_ext(hdc, 1l, 1l);
expect_world_transform(hdc, 1.0, 1.0);
expect_LPtoDP(hdc, -1000 + 99, 1000);
GetViewportOrgEx( hdc, &pt );
ok( pt.x == 0 && pt.y == 0, "wrong origin %d,%d\n", pt.x, pt.y );
ok( pt.x == 0 && pt.y == 0, "wrong origin %ld,%ld\n", pt.x, pt.y );
GetWindowOrgEx( hdc, &pt );
ok( pt.x == 0 && pt.y == 0, "wrong origin %d,%d\n", pt.x, pt.y );
ok( pt.x == 0 && pt.y == 0, "wrong origin %ld,%ld\n", pt.x, pt.y );
GetDCOrgEx( hdc, &pt );
ok( pt.x == 0 && pt.y == 0, "wrong origin %d,%d\n", pt.x, pt.y );
ok( pt.x == 0 && pt.y == 0, "wrong origin %ld,%ld\n", pt.x, pt.y );
if (pGetTransform)
{
XFORM xform;
......@@ -361,10 +363,10 @@ static void test_dc_layout(void)
ok( GetWindowExtEx( hdc, &size ), "GetWindowExtEx failed\n" );
ok( rough_match( size.cx, size_cx * 10 ) ||
rough_match( size.cx, MulDiv( res_x, 254, dpi_x )), /* Vista uses a more precise method */
"expected cx %d or %d, got %d\n", size_cx * 10, MulDiv( res_x, 254, dpi_x ), size.cx );
"expected cx %ld or %d, got %ld\n", size_cx * 10, MulDiv( res_x, 254, dpi_x ), size.cx );
ok( rough_match( size.cy, size_cy * 10 ) ||
rough_match( size.cy, MulDiv( res_y, 254, dpi_y )), /* Vista uses a more precise method */
"expected cy %d or %d, got %d\n", size_cy * 10, MulDiv( res_y, 254, dpi_y ), size.cy );
"expected cy %lxd or %d, got %ld\n", size_cy * 10, MulDiv( res_y, 254, dpi_y ), size.cy );
expect_world_transform(hdc, 1.0, 1.0);
expect_LPtoDP(hdc, -MulDiv(1000 / 10, res_x, size_cx) + 99, -MulDiv(1000 / 10, res_y, size_cy));
......@@ -435,22 +437,22 @@ static void test_SetWindowExt(HDC hdc, LONG cx, LONG cy, LONG expected_vp_cx, LO
SetWindowExtEx(hdc, cx, cy, NULL);
GetWindowExtEx(hdc, &windowExt);
ok(windowExt.cx == cx && windowExt.cy == cy,
"Window extension: Expected %dx%d, got %dx%d\n",
"Window extension: Expected %ldx%ld, got %ldx%ld\n",
cx, cy, windowExt.cx, windowExt.cy);
GetViewportExtEx(hdc, &viewportExt);
ok(rough_match(viewportExt.cx, expected_vp_cx) && rough_match(viewportExt.cy, expected_vp_cy),
"Viewport extents have not been properly adjusted: Expected %dx%d, got %dx%d\n",
"Viewport extents have not been properly adjusted: Expected %ldx%ld, got %ldx%ld\n",
expected_vp_cx, expected_vp_cy, viewportExt.cx, viewportExt.cy);
GetWindowOrgEx(hdc, &windowOrgAfter);
ok(windowOrg.x == windowOrgAfter.x && windowOrg.y == windowOrgAfter.y,
"Window origin changed from (%d,%d) to (%d,%d)\n",
"Window origin changed from (%ld,%ld) to (%ld,%ld)\n",
windowOrg.x, windowOrg.y, windowOrgAfter.x, windowOrgAfter.y);
GetViewportOrgEx(hdc, &viewportOrgAfter);
ok(viewportOrg.x == viewportOrgAfter.x && viewportOrg.y == viewportOrgAfter.y,
"Viewport origin changed from (%d,%d) to (%d,%d)\n",
"Viewport origin changed from (%ld,%ld) to (%ld,%ld)\n",
viewportOrg.x, viewportOrg.y, viewportOrgAfter.x, viewportOrgAfter.y);
}
......@@ -466,22 +468,22 @@ static void test_SetViewportExt(HDC hdc, LONG cx, LONG cy, LONG expected_vp_cx,
SetViewportExtEx(hdc, cx, cy, NULL);
GetViewportExtEx(hdc, &viewportExt);
ok(rough_match(viewportExt.cx, expected_vp_cx) && rough_match(viewportExt.cy, expected_vp_cy),
"Viewport extents have not been properly adjusted: Expected %dx%d, got %dx%d\n",
"Viewport extents have not been properly adjusted: Expected %ldx%ld, got %ldx%ld\n",
expected_vp_cx, expected_vp_cy, viewportExt.cx, viewportExt.cy);
GetWindowExtEx(hdc, &windowExtAfter);
ok(windowExt.cx == windowExtAfter.cx && windowExt.cy == windowExtAfter.cy,
"Window extension changed from %dx%d to %dx%d\n",
"Window extension changed from %ldx%ld to %ldx%ld\n",
windowExt.cx, windowExt.cy, windowExtAfter.cx, windowExtAfter.cy);
GetWindowOrgEx(hdc, &windowOrgAfter);
ok(windowOrg.x == windowOrgAfter.x && windowOrg.y == windowOrgAfter.y,
"Window origin changed from (%d,%d) to (%d,%d)\n",
"Window origin changed from (%ld,%ld) to (%ld,%ld)\n",
windowOrg.x, windowOrg.y, windowOrgAfter.x, windowOrgAfter.y);
GetViewportOrgEx(hdc, &viewportOrgAfter);
ok(viewportOrg.x == viewportOrgAfter.x && viewportOrg.y == viewportOrgAfter.y,
"Viewport origin changed from (%d,%d) to (%d,%d)\n",
"Viewport origin changed from (%ld,%ld) to (%ld,%ld)\n",
viewportOrg.x, viewportOrg.y, viewportOrgAfter.x, viewportOrgAfter.y);
}
......@@ -548,13 +550,13 @@ static void test_setvirtualresolution(void)
r = pSetVirtualResolution(hdc, 4000, 1000, 400, 200); /* 10 pix/mm x 5 pix/mm */
ok(r == TRUE, "got %d\n", r);
expect_LPtoDP(hdc, 1000, 1000);
expect_viewport_ext(hdc, 1, 1);
expect_window_ext(hdc, 1, 1);
expect_viewport_ext(hdc, 1l, 1l);
expect_window_ext(hdc, 1l, 1l);
SetMapMode(hdc, MM_LOMETRIC);
expect_LPtoDP(hdc, 1000, -500);
expect_viewport_ext(hdc, 4000, -1000);
expect_window_ext(hdc, 4000, 2000);
expect_viewport_ext(hdc, 4000l, -1000l);
expect_window_ext(hdc, 4000l, 2000l);
/* Doesn't change the device caps */
ok(horz_res == GetDeviceCaps(hdc, HORZRES), "horz_res changed\n");
......@@ -567,40 +569,40 @@ static void test_setvirtualresolution(void)
SetMapMode(hdc, MM_TEXT);
SetMapMode(hdc, MM_LOMETRIC);
expect_LPtoDP(hdc, 2000, -500);
expect_viewport_ext(hdc, 8000, -1000);
expect_window_ext(hdc, 4000, 2000);
expect_viewport_ext(hdc, 8000l, -1000l);
expect_window_ext(hdc, 4000l, 2000l);
r = pSetVirtualResolution(hdc, 8000, 1000, 200, 200); /* 40 pix/mm x 5 pix/mm */
ok(r == TRUE, "got %d\n", r);
SetMapMode(hdc, MM_TEXT);
SetMapMode(hdc, MM_LOMETRIC);
expect_LPtoDP(hdc, 4000, -500);
expect_viewport_ext(hdc, 8000, -1000);
expect_window_ext(hdc, 2000, 2000);
expect_viewport_ext(hdc, 8000l, -1000l);
expect_window_ext(hdc, 2000l, 2000l);
r = pSetVirtualResolution(hdc, 8000, 1000, 200, 200); /* 40 pix/mm x 5 pix/mm */
ok(r == TRUE, "got %d\n", r);
SetMapMode(hdc, MM_TEXT);
SetMapMode(hdc, MM_LOMETRIC);
expect_LPtoDP(hdc, 4000, -500);
expect_viewport_ext(hdc, 8000, -1000);
expect_window_ext(hdc, 2000, 2000);
expect_viewport_ext(hdc, 8000l, -1000l);
expect_window_ext(hdc, 2000l, 2000l);
r = pSetVirtualResolution(hdc, 8000, 2000, 200, 200); /* 40 pix/mm x 10 pix/mm */
ok(r == TRUE, "got %d\n", r);
SetMapMode(hdc, MM_TEXT);
SetMapMode(hdc, MM_LOMETRIC);
expect_LPtoDP(hdc, 4000, -1000);
expect_viewport_ext(hdc, 8000, -2000);
expect_window_ext(hdc, 2000, 2000);
expect_viewport_ext(hdc, 8000l, -2000l);
expect_window_ext(hdc, 2000l, 2000l);
r = pSetVirtualResolution(hdc, 0, 0, 10, 0); /* Error */
ok(r == FALSE, "got %d\n", r);
SetMapMode(hdc, MM_TEXT);
SetMapMode(hdc, MM_LOMETRIC);
expect_LPtoDP(hdc, 4000, -1000);
expect_viewport_ext(hdc, 8000, -2000);
expect_window_ext(hdc, 2000, 2000);
expect_viewport_ext(hdc, 8000l, -2000l);
expect_window_ext(hdc, 2000l, 2000l);
r = pSetVirtualResolution(hdc, 0, 0, 0, 0); /* Reset to true resolution */
ok(r == TRUE, "got %d\n", r);
......
This source diff could not be displayed because it is too large. You can view the blob instead.
......@@ -58,7 +58,7 @@ static void test_DIB_PAL_COLORS(void) {
memcpy( logpalette->palPalEntry, logpalettedata, sizeof(logpalettedata) );
hpal = CreatePalette( logpalette );
hpalOld = SelectPalette( memhdc, hpal, FALSE );
ok( hpalOld != NULL, "error=%d\n", GetLastError() );
ok( hpalOld != NULL, "error=%ld\n", GetLastError() );
/* Create a DIB BMP which references colours in the logical palette */
memset( bmp, 0x00, sizeof(BITMAPINFO) );
......@@ -78,9 +78,9 @@ static void test_DIB_PAL_COLORS(void) {
*bmpPalPtr++ = 19; /* Pointer to bad logical palette index */
hbmp = CreateDIBSection( memhdc, bmp, DIB_PAL_COLORS, 0, 0, 0 );
ok( hbmp != NULL, "error=%d\n", GetLastError() );
ok( hbmp != NULL, "error=%ld\n", GetLastError() );
hbmpOld = SelectObject( memhdc, hbmp );
ok( hbmpOld != NULL, "error=%d\n", GetLastError() );
ok( hbmpOld != NULL, "error=%ld\n", GetLastError() );
/* Test with a RGB to DIB_PAL_COLORS */
setColor = RGB( logpalettedata[1].peRed, logpalettedata[1].peGreen, logpalettedata[1].peBlue );
......
......@@ -69,13 +69,13 @@ static void test_path_state(void)
ok( !ret, "WidenPath succeeded\n" );
ret = EndPath( hdc );
ok( ret, "EndPath failed error %u\n", GetLastError() );
ok( ret, "EndPath failed error %lu\n", GetLastError() );
ret = WidenPath( hdc );
ok( ret, "WidenPath failed error %u\n", GetLastError() );
ok( ret, "WidenPath failed error %lu\n", GetLastError() );
SelectObject( hdc, orig );
ret = WidenPath( hdc );
ok( ret, "WidenPath failed error %u\n", GetLastError() );
ok( ret, "WidenPath failed error %lu\n", GetLastError() );
BeginPath( hdc );
LineTo( hdc, 100, 100 );
......@@ -84,22 +84,22 @@ static void test_path_state(void)
SaveDC( hdc );
SelectObject( hdc, dib );
ret = EndPath( hdc );
ok( ret, "EndPath failed error %u\n", GetLastError() );
ok( ret, "EndPath failed error %lu\n", GetLastError() );
ret = WidenPath( hdc );
ok( ret, "WidenPath failed error %u\n", GetLastError() );
ok( ret, "WidenPath failed error %lu\n", GetLastError() );
/* path should be open again after RestoreDC */
RestoreDC( hdc, -1 );
ret = WidenPath( hdc );
ok( !ret, "WidenPath succeeded\n" );
ret = EndPath( hdc );
ok( ret, "EndPath failed error %u\n", GetLastError() );
ok( ret, "EndPath failed error %lu\n", GetLastError() );
SaveDC( hdc );
BeginPath( hdc );
RestoreDC( hdc, -1 );
ret = WidenPath( hdc );
ok( ret, "WidenPath failed error %u\n", GetLastError() );
ok( ret, "WidenPath failed error %lu\n", GetLastError() );
/* test all functions with no path at all */
AbortPath( hdc );
......@@ -107,55 +107,55 @@ static void test_path_state(void)
ret = WidenPath( hdc );
ok( !ret, "WidenPath succeeded\n" );
ok( GetLastError() == ERROR_CAN_NOT_COMPLETE || broken(GetLastError() == 0xdeadbeef),
"wrong error %u\n", GetLastError() );
"wrong error %lu\n", GetLastError() );
SetLastError( 0xdeadbeef );
ret = FlattenPath( hdc );
ok( !ret, "FlattenPath succeeded\n" );
ok( GetLastError() == ERROR_CAN_NOT_COMPLETE || broken(GetLastError() == 0xdeadbeef),
"wrong error %u\n", GetLastError() );
"wrong error %lu\n", GetLastError() );
SetLastError( 0xdeadbeef );
ret = StrokePath( hdc );
ok( !ret, "StrokePath succeeded\n" );
ok( GetLastError() == ERROR_CAN_NOT_COMPLETE || broken(GetLastError() == 0xdeadbeef),
"wrong error %u\n", GetLastError() );
"wrong error %lu\n", GetLastError() );
SetLastError( 0xdeadbeef );
ret = FillPath( hdc );
ok( !ret, "FillPath succeeded\n" );
ok( GetLastError() == ERROR_CAN_NOT_COMPLETE || broken(GetLastError() == 0xdeadbeef),
"wrong error %u\n", GetLastError() );
"wrong error %lu\n", GetLastError() );
SetLastError( 0xdeadbeef );
ret = StrokeAndFillPath( hdc );
ok( !ret, "StrokeAndFillPath succeeded\n" );
ok( GetLastError() == ERROR_CAN_NOT_COMPLETE || broken(GetLastError() == 0xdeadbeef),
"wrong error %u\n", GetLastError() );
"wrong error %lu\n", GetLastError() );
SetLastError( 0xdeadbeef );
ret = SelectClipPath( hdc, RGN_OR );
ok( !ret, "SelectClipPath succeeded\n" );
ok( GetLastError() == ERROR_CAN_NOT_COMPLETE || broken(GetLastError() == 0xdeadbeef),
"wrong error %u\n", GetLastError() );
"wrong error %lu\n", GetLastError() );
SetLastError( 0xdeadbeef );
rgn = PathToRegion( hdc );
ok( !rgn, "PathToRegion succeeded\n" );
ok( GetLastError() == ERROR_CAN_NOT_COMPLETE || broken(GetLastError() == 0xdeadbeef),
"wrong error %u\n", GetLastError() );
"wrong error %lu\n", GetLastError() );
SetLastError( 0xdeadbeef );
ret = EndPath( hdc );
ok( !ret, "SelectClipPath succeeded\n" );
ok( GetLastError() == ERROR_CAN_NOT_COMPLETE || broken(GetLastError() == 0xdeadbeef),
"wrong error %u\n", GetLastError() );
"wrong error %lu\n", GetLastError() );
SetLastError( 0xdeadbeef );
ret = CloseFigure( hdc );
ok( !ret, "CloseFigure succeeded\n" );
ok( GetLastError() == ERROR_CAN_NOT_COMPLETE || broken(GetLastError() == 0xdeadbeef),
"wrong error %u\n", GetLastError() );
"wrong error %lu\n", GetLastError() );
/* test all functions with an open path */
AbortPath( hdc );
......@@ -164,7 +164,7 @@ static void test_path_state(void)
ret = WidenPath( hdc );
ok( !ret, "WidenPath succeeded\n" );
ok( GetLastError() == ERROR_CAN_NOT_COMPLETE || broken(GetLastError() == 0xdeadbeef),
"wrong error %u\n", GetLastError() );
"wrong error %lu\n", GetLastError() );
AbortPath( hdc );
BeginPath( hdc );
......@@ -172,7 +172,7 @@ static void test_path_state(void)
ret = FlattenPath( hdc );
ok( !ret, "FlattenPath succeeded\n" );
ok( GetLastError() == ERROR_CAN_NOT_COMPLETE || broken(GetLastError() == 0xdeadbeef),
"wrong error %u\n", GetLastError() );
"wrong error %lu\n", GetLastError() );
AbortPath( hdc );
BeginPath( hdc );
......@@ -180,7 +180,7 @@ static void test_path_state(void)
ret = StrokePath( hdc );
ok( !ret, "StrokePath succeeded\n" );
ok( GetLastError() == ERROR_CAN_NOT_COMPLETE || broken(GetLastError() == 0xdeadbeef),
"wrong error %u\n", GetLastError() );
"wrong error %lu\n", GetLastError() );
AbortPath( hdc );
BeginPath( hdc );
......@@ -188,7 +188,7 @@ static void test_path_state(void)
ret = FillPath( hdc );
ok( !ret, "FillPath succeeded\n" );
ok( GetLastError() == ERROR_CAN_NOT_COMPLETE || broken(GetLastError() == 0xdeadbeef),
"wrong error %u\n", GetLastError() );
"wrong error %lu\n", GetLastError() );
AbortPath( hdc );
BeginPath( hdc );
......@@ -196,7 +196,7 @@ static void test_path_state(void)
ret = StrokeAndFillPath( hdc );
ok( !ret, "StrokeAndFillPath succeeded\n" );
ok( GetLastError() == ERROR_CAN_NOT_COMPLETE || broken(GetLastError() == 0xdeadbeef),
"wrong error %u\n", GetLastError() );
"wrong error %lu\n", GetLastError() );
AbortPath( hdc );
BeginPath( hdc );
......@@ -205,7 +205,7 @@ static void test_path_state(void)
ret = SelectClipPath( hdc, RGN_OR );
ok( !ret, "SelectClipPath succeeded\n" );
ok( GetLastError() == ERROR_CAN_NOT_COMPLETE || broken(GetLastError() == 0xdeadbeef),
"wrong error %u\n", GetLastError() );
"wrong error %lu\n", GetLastError() );
AbortPath( hdc );
BeginPath( hdc );
......@@ -214,7 +214,7 @@ static void test_path_state(void)
rgn = PathToRegion( hdc );
ok( !rgn, "PathToRegion succeeded\n" );
ok( GetLastError() == ERROR_CAN_NOT_COMPLETE || broken(GetLastError() == 0xdeadbeef),
"wrong error %u\n", GetLastError() );
"wrong error %lu\n", GetLastError() );
AbortPath( hdc );
BeginPath( hdc );
......@@ -267,7 +267,7 @@ static void test_path_state(void)
SetLastError( 0xdeadbeef );
ret = SelectClipPath( hdc, RGN_OR );
ok( !ret, "SelectClipPath succeeded on empty path\n" );
ok( GetLastError() == 0xdeadbeef, "wrong error %u\n", GetLastError() );
ok( GetLastError() == 0xdeadbeef, "wrong error %lu\n", GetLastError() );
ok( GetPath( hdc, NULL, NULL, 0 ) == -1, "path not deleted\n" );
BeginPath( hdc );
......@@ -283,7 +283,7 @@ static void test_path_state(void)
SetLastError( 0xdeadbeef );
rgn = PathToRegion( hdc );
ok( !rgn, "PathToRegion succeeded on empty path\n" );
ok( GetLastError() == 0xdeadbeef, "wrong error %u\n", GetLastError() );
ok( GetLastError() == 0xdeadbeef, "wrong error %lu\n", GetLastError() );
DeleteObject( rgn );
ok( GetPath( hdc, NULL, NULL, 0 ) == -1, "path not deleted\n" );
......@@ -293,7 +293,7 @@ static void test_path_state(void)
ret = CloseFigure( hdc );
ok( !ret, "CloseFigure succeeded\n" );
ok( GetLastError() == ERROR_CAN_NOT_COMPLETE || broken(GetLastError() == 0xdeadbeef),
"wrong error %u\n", GetLastError() );
"wrong error %lu\n", GetLastError() );
AbortPath( hdc );
BeginPath( hdc );
......@@ -302,7 +302,7 @@ static void test_path_state(void)
ret = EndPath( hdc );
ok( !ret, "EndPath succeeded\n" );
ok( GetLastError() == ERROR_CAN_NOT_COMPLETE || broken(GetLastError() == 0xdeadbeef),
"wrong error %u\n", GetLastError() );
"wrong error %lu\n", GetLastError() );
DeleteDC( hdc );
DeleteObject( dib );
......@@ -354,7 +354,7 @@ static void test_widenpath(void)
BeginPath(hdc);
ret = WidenPath(hdc);
ok(ret == FALSE && (GetLastError() == ERROR_CAN_NOT_COMPLETE || GetLastError() == 0xdeadbeef),
"WidenPath fails while widening an open path. Return value is %d, should be %d. Error is %u\n", ret, FALSE, GetLastError());
"WidenPath fails while widening an open path. Return value is %d, should be %d. Error is %lu\n", ret, FALSE, GetLastError());
AbortPath(hdc);
......@@ -365,7 +365,7 @@ static void test_widenpath(void)
Polyline(hdc, pnt, 6);
EndPath(hdc);
ret = WidenPath(hdc);
ok(ret == TRUE, "WidenPath failed: %d\n", GetLastError());
ok(ret == TRUE, "WidenPath failed: %ld\n", GetLastError());
nSize = GetPath(hdc, NULL, NULL, 0);
ok(nSize > 6, "WidenPath should compute a widened path with a 1px wide pen. Path length is %d, should be more than 6\n", nSize);
......@@ -410,7 +410,7 @@ static void ok_path(HDC hdc, const char *path_name, const path_test_t *expected,
/* Get the path */
assert(hdc != 0);
size = GetPath(hdc, NULL, NULL, 0);
ok(size > 0, "GetPath returned size %d, last error %d\n", size, GetLastError());
ok(size > 0, "GetPath returned size %d, last error %ld\n", size, GetLastError());
if (size <= 0) return;
pnt = HeapAlloc(GetProcessHeap(), 0, size*sizeof(POINT));
......@@ -429,14 +429,14 @@ static void ok_path(HDC hdc, const char *path_name, const path_test_t *expected,
* floating point to integer conversion */
static const int fudge = 2;
ok( types[idx] == expected[idx].type, "%s: Expected #%d: %s (%d,%d) but got %s (%d,%d)\n",
ok( types[idx] == expected[idx].type, "%s: Expected #%d: %s (%d,%d) but got %s (%ld,%ld)\n",
path_name, idx, type_string[expected[idx].type], expected[idx].x, expected[idx].y,
type_string[types[idx]], pnt[idx].x, pnt[idx].y);
if (types[idx] == expected[idx].type)
ok( (pnt[idx].x >= expected[idx].x - fudge && pnt[idx].x <= expected[idx].x + fudge) &&
(pnt[idx].y >= expected[idx].y - fudge && pnt[idx].y <= expected[idx].y + fudge),
"%s: Expected #%d: %s position (%d,%d) but got (%d,%d)\n", path_name, idx,
"%s: Expected #%d: %s position (%d,%d) but got (%ld,%ld)\n", path_name, idx,
type_string[expected[idx].type], expected[idx].x, expected[idx].y, pnt[idx].x, pnt[idx].y);
}
......@@ -444,7 +444,7 @@ static void ok_path(HDC hdc, const char *path_name, const path_test_t *expected,
{
printf("static const path_test_t %s[] =\n{\n", path_name);
for (idx = 0; idx < size; idx++)
printf(" {%d, %d, %s}, /* %d */\n", pnt[idx].x, pnt[idx].y, type_string[types[idx]], idx);
printf(" {%ld, %ld, %s}, /* %d */\n", pnt[idx].x, pnt[idx].y, type_string[types[idx]], idx);
printf("};\n" );
}
......@@ -612,7 +612,7 @@ static void test_polydraw(void)
BeginPath(hdc);
GetCurrentPositionEx( hdc, &pos );
ok( pos.x == -20 && pos.y == -20, "wrong pos %d,%d\n", pos.x, pos.y );
ok( pos.x == -20 && pos.y == -20, "wrong pos %ld,%ld\n", pos.x, pos.y );
/* closefigure with no previous moveto */
if (!(retb = PolyDraw(hdc, polydraw_pts, polydraw_tps, 2)) &&
......@@ -624,66 +624,66 @@ static void test_polydraw(void)
}
expect(TRUE, retb);
GetCurrentPositionEx( hdc, &pos );
ok( pos.x == 10 && pos.y == 15, "wrong pos %d,%d\n", pos.x, pos.y );
ok( pos.x == 10 && pos.y == 15, "wrong pos %ld,%ld\n", pos.x, pos.y );
LineTo(hdc, -10, -10);
GetCurrentPositionEx( hdc, &pos );
ok( pos.x == -10 && pos.y == -10, "wrong pos %d,%d\n", pos.x, pos.y );
ok( pos.x == -10 && pos.y == -10, "wrong pos %ld,%ld\n", pos.x, pos.y );
MoveToEx(hdc, 100, 100, NULL);
GetCurrentPositionEx( hdc, &pos );
ok( pos.x == 100 && pos.y == 100, "wrong pos %d,%d\n", pos.x, pos.y );
ok( pos.x == 100 && pos.y == 100, "wrong pos %ld,%ld\n", pos.x, pos.y );
LineTo(hdc, 95, 95);
GetCurrentPositionEx( hdc, &pos );
ok( pos.x == 95 && pos.y == 95, "wrong pos %d,%d\n", pos.x, pos.y );
ok( pos.x == 95 && pos.y == 95, "wrong pos %ld,%ld\n", pos.x, pos.y );
/* closefigure with previous moveto */
retb = PolyDraw(hdc, polydraw_pts, polydraw_tps, 2);
expect(TRUE, retb);
GetCurrentPositionEx( hdc, &pos );
ok( pos.x == 10 && pos.y == 15, "wrong pos %d,%d\n", pos.x, pos.y );
ok( pos.x == 10 && pos.y == 15, "wrong pos %ld,%ld\n", pos.x, pos.y );
/* bad bezier points */
retb = PolyDraw(hdc, &(polydraw_pts[2]), &(polydraw_tps[2]), 4);
expect(FALSE, retb);
GetCurrentPositionEx( hdc, &pos );
ok( pos.x == 10 && pos.y == 15, "wrong pos %d,%d\n", pos.x, pos.y );
ok( pos.x == 10 && pos.y == 15, "wrong pos %ld,%ld\n", pos.x, pos.y );
retb = PolyDraw(hdc, &(polydraw_pts[6]), &(polydraw_tps[6]), 4);
expect(FALSE, retb);
GetCurrentPositionEx( hdc, &pos );
ok( pos.x == 10 && pos.y == 15, "wrong pos %d,%d\n", pos.x, pos.y );
ok( pos.x == 10 && pos.y == 15, "wrong pos %ld,%ld\n", pos.x, pos.y );
/* good bezier points */
retb = PolyDraw(hdc, &(polydraw_pts[8]), &(polydraw_tps[8]), 4);
expect(TRUE, retb);
GetCurrentPositionEx( hdc, &pos );
ok( pos.x == 35 && pos.y == 40, "wrong pos %d,%d\n", pos.x, pos.y );
ok( pos.x == 35 && pos.y == 40, "wrong pos %ld,%ld\n", pos.x, pos.y );
/* does lineto or bezierto take precedence? */
retb = PolyDraw(hdc, &(polydraw_pts[12]), &(polydraw_tps[12]), 4);
expect(FALSE, retb);
GetCurrentPositionEx( hdc, &pos );
ok( pos.x == 35 && pos.y == 40, "wrong pos %d,%d\n", pos.x, pos.y );
ok( pos.x == 35 && pos.y == 40, "wrong pos %ld,%ld\n", pos.x, pos.y );
/* bad point type, has already moved cursor position */
retb = PolyDraw(hdc, &(polydraw_pts[15]), &(polydraw_tps[15]), 4);
expect(FALSE, retb);
GetCurrentPositionEx( hdc, &pos );
ok( pos.x == 35 && pos.y == 40, "wrong pos %d,%d\n", pos.x, pos.y );
ok( pos.x == 35 && pos.y == 40, "wrong pos %ld,%ld\n", pos.x, pos.y );
/* bad point type, cursor position is moved, but back to its original spot */
retb = PolyDraw(hdc, &(polydraw_pts[17]), &(polydraw_tps[17]), 4);
expect(FALSE, retb);
GetCurrentPositionEx( hdc, &pos );
ok( pos.x == 35 && pos.y == 40, "wrong pos %d,%d\n", pos.x, pos.y );
ok( pos.x == 35 && pos.y == 40, "wrong pos %ld,%ld\n", pos.x, pos.y );
/* does lineto or moveto take precedence? */
retb = PolyDraw(hdc, &(polydraw_pts[20]), &(polydraw_tps[20]), 3);
expect(TRUE, retb);
GetCurrentPositionEx( hdc, &pos );
ok( pos.x == 65 && pos.y == 65, "wrong pos %d,%d\n", pos.x, pos.y );
ok( pos.x == 65 && pos.y == 65, "wrong pos %ld,%ld\n", pos.x, pos.y );
/* consecutive movetos */
retb = PolyDraw(hdc, &(polydraw_pts[23]), &(polydraw_tps[23]), 4);
expect(TRUE, retb);
GetCurrentPositionEx( hdc, &pos );
ok( pos.x == 80 && pos.y == 80, "wrong pos %d,%d\n", pos.x, pos.y );
ok( pos.x == 80 && pos.y == 80, "wrong pos %ld,%ld\n", pos.x, pos.y );
EndPath(hdc);
ok_path(hdc, "polydraw_path", polydraw_path, ARRAY_SIZE(polydraw_path));
GetCurrentPositionEx( hdc, &pos );
ok( pos.x == 80 && pos.y == 80, "wrong pos %d,%d\n", pos.x, pos.y );
ok( pos.x == 80 && pos.y == 80, "wrong pos %ld,%ld\n", pos.x, pos.y );
done:
ReleaseDC(0, hdc);
}
......@@ -695,27 +695,27 @@ static void test_closefigure(void) {
MoveToEx( hdc, 100, 100, NULL );
GetCurrentPositionEx( hdc, &pos );
ok( pos.x == 100 && pos.y == 100, "wrong pos %d,%d\n", pos.x, pos.y );
ok( pos.x == 100 && pos.y == 100, "wrong pos %ld,%ld\n", pos.x, pos.y );
BeginPath(hdc);
GetCurrentPositionEx( hdc, &pos );
ok( pos.x == 100 && pos.y == 100, "wrong pos %d,%d\n", pos.x, pos.y );
ok( pos.x == 100 && pos.y == 100, "wrong pos %ld,%ld\n", pos.x, pos.y );
MoveToEx(hdc, 95, 95, NULL);
GetCurrentPositionEx( hdc, &pos );
ok( pos.x == 95 && pos.y == 95, "wrong pos %d,%d\n", pos.x, pos.y );
ok( pos.x == 95 && pos.y == 95, "wrong pos %ld,%ld\n", pos.x, pos.y );
LineTo(hdc, 95, 0);
GetCurrentPositionEx( hdc, &pos );
ok( pos.x == 95 && pos.y == 0, "wrong pos %d,%d\n", pos.x, pos.y );
ok( pos.x == 95 && pos.y == 0, "wrong pos %ld,%ld\n", pos.x, pos.y );
LineTo(hdc, 0, 95);
GetCurrentPositionEx( hdc, &pos );
ok( pos.x == 0 && pos.y == 95, "wrong pos %d,%d\n", pos.x, pos.y );
ok( pos.x == 0 && pos.y == 95, "wrong pos %ld,%ld\n", pos.x, pos.y );
CloseFigure(hdc);
GetCurrentPositionEx( hdc, &pos );
ok( pos.x == 0 && pos.y == 95, "wrong pos %d,%d\n", pos.x, pos.y );
ok( pos.x == 0 && pos.y == 95, "wrong pos %ld,%ld\n", pos.x, pos.y );
EndPath(hdc);
GetCurrentPositionEx( hdc, &pos );
ok( pos.x == 0 && pos.y == 95, "wrong pos %d,%d\n", pos.x, pos.y );
ok( pos.x == 0 && pos.y == 95, "wrong pos %ld,%ld\n", pos.x, pos.y );
nSize = GetPath(hdc, NULL, NULL, 0);
AbortPath(hdc);
......@@ -737,7 +737,7 @@ static void test_closefigure(void) {
static void WINAPI linedda_callback(INT x, INT y, LPARAM lparam)
{
POINT **pt = (POINT**)lparam;
ok((*pt)->x == x && (*pt)->y == y, "point mismatch expect(%d,%d) got(%d,%d)\n",
ok((*pt)->x == x && (*pt)->y == y, "point mismatch expect(%ld,%ld) got(%d,%d)\n",
(*pt)->x, (*pt)->y, x, y);
(*pt)++;
......@@ -1910,7 +1910,7 @@ static void test_clipped_polygon_fill(void)
oldbmp = SelectObject( memdc, bmp );
Polygon( memdc, pts, ARRAY_SIZE(pts) );
col = GetPixel( memdc, 1, 1 );
ok( col == RGB( 0x11, 0x22, 0x33 ), "got %06x\n", col );
ok( col == RGB( 0x11, 0x22, 0x33 ), "got %06lx\n", col );
SelectObject( memdc, oldbrush );
SelectObject( memdc, oldbmp );
DeleteObject( brush );
......
......@@ -27,9 +27,17 @@
#include "wine/test.h"
#define expect(expected, got) ok(got == expected, "Expected %.8x, got %.8x\n", expected, got)
#define expect2(expected, alt, got) ok(got == expected || got == alt, \
"Expected %.8x or %.8x, got %.8x\n", expected, alt, got)
#define expect(expected,got) expect_(__LINE__, expected, got)
static inline void expect_(unsigned line, DWORD expected, DWORD got)
{
ok_(__FILE__, line)(expected == got, "Expected %.08lx, got %.08lx\n", expected, got);
}
#define expect2(expected,alt,got) expect2_(__LINE__, expected, alt, got)
static inline void expect2_(unsigned line, DWORD expected, DWORD alt, DWORD got)
{
ok_(__FILE__, line)(expected == got || alt == got,
"Expected %.08lx or %.08lx, got %.08lx\n", expected, alt, got);
}
static void test_logpen(void)
{
......@@ -91,59 +99,59 @@ static void test_logpen(void)
}
obj_type = GetObjectType(hpen);
ok(obj_type == OBJ_PEN, "wrong object type %u\n", obj_type);
ok(obj_type == OBJ_PEN, "wrong object type %lu\n", obj_type);
memset(&lp, 0xb0, sizeof(lp));
SetLastError(0xdeadbeef);
size = GetObjectW(hpen, sizeof(lp), &lp);
ok(size == sizeof(lp), "GetObject returned %d, error %d\n", size, GetLastError());
ok(size == sizeof(lp), "GetObject returned %d, error %ld\n", size, GetLastError());
ok(lp.lopnStyle == pen[i].ret_style, "expected %u, got %u\n", pen[i].ret_style, lp.lopnStyle);
ok(lp.lopnWidth.x == pen[i].ret_width, "expected %u, got %d\n", pen[i].ret_width, lp.lopnWidth.x);
ok(lp.lopnWidth.y == 0, "expected 0, got %d\n", lp.lopnWidth.y);
ok(lp.lopnColor == pen[i].ret_color, "expected %08x, got %08x\n", pen[i].ret_color, lp.lopnColor);
ok(lp.lopnWidth.x == pen[i].ret_width, "expected %u, got %ld\n", pen[i].ret_width, lp.lopnWidth.x);
ok(lp.lopnWidth.y == 0, "expected 0, got %ld\n", lp.lopnWidth.y);
ok(lp.lopnColor == pen[i].ret_color, "expected %08lx, got %08lx\n", pen[i].ret_color, lp.lopnColor);
DeleteObject(hpen);
/* CreatePen behaviour */
SetLastError(0xdeadbeef);
hpen = CreatePen(pen[i].style, pen[i].width, pen[i].color);
ok(hpen != 0, "CreatePen error %d\n", GetLastError());
ok(hpen != 0, "CreatePen error %ld\n", GetLastError());
obj_type = GetObjectType(hpen);
ok(obj_type == OBJ_PEN, "wrong object type %u\n", obj_type);
ok(obj_type == OBJ_PEN, "wrong object type %lu\n", obj_type);
/* check what's the real size of the object */
size = GetObjectW(hpen, 0, NULL);
ok(size == sizeof(lp), "GetObject returned %d, error %d\n", size, GetLastError());
ok(size == sizeof(lp), "GetObject returned %d, error %ld\n", size, GetLastError());
/* ask for truncated data */
memset(&lp, 0xb0, sizeof(lp));
SetLastError(0xdeadbeef);
size = GetObjectW(hpen, sizeof(lp.lopnStyle), &lp);
ok(!size, "GetObject should fail: size %d, error %d\n", size, GetLastError());
ok(!size, "GetObject should fail: size %d, error %ld\n", size, GetLastError());
/* see how larger buffer sizes are handled */
memset(&lp, 0xb0, sizeof(lp));
SetLastError(0xdeadbeef);
size = GetObjectW(hpen, sizeof(lp) * 4, &lp);
ok(size == sizeof(lp), "GetObject returned %d, error %d\n", size, GetLastError());
ok(size == sizeof(lp), "GetObject returned %d, error %ld\n", size, GetLastError());
/* see how larger buffer sizes are handled */
memset(&elp, 0xb0, sizeof(elp));
SetLastError(0xdeadbeef);
size = GetObjectW(hpen, sizeof(elp) * 2, &elp);
ok(size == sizeof(lp), "GetObject returned %d, error %d\n", size, GetLastError());
ok(size == sizeof(lp), "GetObject returned %d, error %ld\n", size, GetLastError());
memset(&lp, 0xb0, sizeof(lp));
SetLastError(0xdeadbeef);
size = GetObjectW(hpen, sizeof(lp), &lp);
ok(size == sizeof(lp), "GetObject returned %d, error %d\n", size, GetLastError());
ok(size == sizeof(lp), "GetObject returned %d, error %ld\n", size, GetLastError());
ok(lp.lopnStyle == pen[i].ret_style, "expected %u, got %u\n", pen[i].ret_style, lp.lopnStyle);
ok(lp.lopnWidth.x == pen[i].ret_width, "expected %u, got %d\n", pen[i].ret_width, lp.lopnWidth.x);
ok(lp.lopnWidth.y == 0, "expected 0, got %d\n", lp.lopnWidth.y);
ok(lp.lopnColor == pen[i].ret_color, "expected %08x, got %08x\n", pen[i].ret_color, lp.lopnColor);
ok(lp.lopnWidth.x == pen[i].ret_width, "expected %u, got %ld\n", pen[i].ret_width, lp.lopnWidth.x);
ok(lp.lopnWidth.y == 0, "expected 0, got %ld\n", lp.lopnWidth.y);
ok(lp.lopnColor == pen[i].ret_color, "expected %08lx, got %08lx\n", pen[i].ret_color, lp.lopnColor);
memset(&elp, 0xb0, sizeof(elp));
SetLastError(0xdeadbeef);
......@@ -153,23 +161,23 @@ static void test_logpen(void)
if (pen[i].style == PS_NULL)
{
ok(hpen == GetStockObject(NULL_PEN), "hpen should be a stock NULL_PEN\n");
ok(size == offsetof(EXTLOGPEN, elpStyleEntry[1]), "GetObject returned %d, error %d\n",
ok(size == offsetof(EXTLOGPEN, elpStyleEntry[1]), "GetObject returned %d, error %ld\n",
size, GetLastError());
ok(elp.elpPenStyle == pen[i].ret_style, "expected %u, got %u\n", pen[i].ret_style, elp.elpPenStyle);
ok(elp.elpWidth == 0, "expected 0, got %u\n", elp.elpWidth);
ok(elp.elpColor == pen[i].ret_color, "expected %08x, got %08x\n", pen[i].ret_color, elp.elpColor);
ok(elp.elpPenStyle == pen[i].ret_style, "expected %u, got %lu\n", pen[i].ret_style, elp.elpPenStyle);
ok(elp.elpWidth == 0, "expected 0, got %lu\n", elp.elpWidth);
ok(elp.elpColor == pen[i].ret_color, "expected %08lx, got %08lx\n", pen[i].ret_color, elp.elpColor);
ok(elp.elpBrushStyle == BS_SOLID, "expected BS_SOLID, got %u\n", elp.elpBrushStyle);
ok(elp.elpHatch == 0, "expected 0, got %p\n", (void *)elp.elpHatch);
ok(elp.elpNumEntries == 0, "expected 0, got %x\n", elp.elpNumEntries);
ok(elp.elpNumEntries == 0, "expected 0, got %lx\n", elp.elpNumEntries);
}
else
{
ok(size == sizeof(LOGPEN), "GetObject returned %d, error %d\n", size, GetLastError());
ok(size == sizeof(LOGPEN), "GetObject returned %d, error %ld\n", size, GetLastError());
memcpy(&lp, &elp, sizeof(lp));
ok(lp.lopnStyle == pen[i].ret_style, "expected %u, got %u\n", pen[i].ret_style, lp.lopnStyle);
ok(lp.lopnWidth.x == pen[i].ret_width, "expected %u, got %d\n", pen[i].ret_width, lp.lopnWidth.x);
ok(lp.lopnWidth.y == 0, "expected 0, got %d\n", lp.lopnWidth.y);
ok(lp.lopnColor == pen[i].ret_color, "expected %08x, got %08x\n", pen[i].ret_color, lp.lopnColor);
ok(lp.lopnWidth.x == pen[i].ret_width, "expected %u, got %ld\n", pen[i].ret_width, lp.lopnWidth.x);
ok(lp.lopnWidth.y == 0, "expected 0, got %ld\n", lp.lopnWidth.y);
ok(lp.lopnColor == pen[i].ret_color, "expected %08lx, got %08lx\n", pen[i].ret_color, lp.lopnColor);
}
DeleteObject(hpen);
......@@ -184,14 +192,14 @@ static void test_logpen(void)
{
ok(hpen == 0, "ExtCreatePen should fail\n");
ok(GetLastError() == ERROR_INVALID_PARAMETER,
"wrong last error value %d\n", GetLastError());
"wrong last error value %ld\n", GetLastError());
SetLastError(0xdeadbeef);
hpen = ExtCreatePen(pen[i].style, pen[i].width, &lb, 0, NULL);
if (pen[i].style != PS_NULL)
{
ok(hpen == 0, "ExtCreatePen with width != 1 should fail\n");
ok(GetLastError() == ERROR_INVALID_PARAMETER,
"wrong last error value %d\n", GetLastError());
"wrong last error value %ld\n", GetLastError());
SetLastError(0xdeadbeef);
hpen = ExtCreatePen(pen[i].style, 1, &lb, 0, NULL);
......@@ -201,7 +209,7 @@ static void test_logpen(void)
{
ok(hpen == 0, "ExtCreatePen with width != 1 should fail\n");
ok(GetLastError() == ERROR_INVALID_PARAMETER,
"wrong last error value %d\n", GetLastError());
"wrong last error value %ld\n", GetLastError());
SetLastError(0xdeadbeef);
hpen = ExtCreatePen(pen[i].style, 1, &lb, 2, user_style);
}
......@@ -214,20 +222,20 @@ static void test_logpen(void)
if (pen[i].style > PS_ALTERNATE)
{
ok(hpen == 0, "ExtCreatePen should fail\n");
ok(GetLastError() == ERROR_INVALID_PARAMETER, "wrong last error value %d\n", GetLastError());
ok(GetLastError() == ERROR_INVALID_PARAMETER, "wrong last error value %ld\n", GetLastError());
goto test_geometric_pens;
}
ok(hpen != 0, "ExtCreatePen error %d\n", GetLastError());
ok(hpen != 0, "ExtCreatePen error %ld\n", GetLastError());
obj_type = GetObjectType(hpen);
/* for some reason XP differentiates PS_NULL here */
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 %lu\n", obj_type);
ok(hpen == GetStockObject(NULL_PEN), "hpen should be a stock NULL_PEN\n");
}
else
ok(obj_type == OBJ_EXTPEN, "wrong object type %u\n", obj_type);
ok(obj_type == OBJ_EXTPEN, "wrong object type %lu\n", obj_type);
/* check what's the real size of the object */
SetLastError(0xdeadbeef);
......@@ -236,17 +244,17 @@ static void test_logpen(void)
{
case PS_NULL:
ok(size == sizeof(LOGPEN),
"GetObject returned %d, error %d\n", size, GetLastError());
"GetObject returned %d, error %ld\n", size, GetLastError());
break;
case PS_USERSTYLE:
ok(size == offsetof( EXTLOGPEN, elpStyleEntry[2] ),
"GetObject returned %d, error %d\n", size, GetLastError());
"GetObject returned %d, error %ld\n", size, GetLastError());
break;
default:
ok(size == offsetof( EXTLOGPEN, elpStyleEntry ),
"GetObject returned %d, error %d\n", size, GetLastError());
"GetObject returned %d, error %ld\n", size, GetLastError());
break;
}
......@@ -254,7 +262,7 @@ static void test_logpen(void)
memset(&elp, 0xb0, sizeof(elp));
SetLastError(0xdeadbeef);
size = GetObjectW(hpen, sizeof(elp.elpPenStyle), &elp);
ok(!size, "GetObject should fail: size %d, error %d\n", size, GetLastError());
ok(!size, "GetObject should fail: size %d, error %ld\n", size, GetLastError());
/* see how larger buffer sizes are handled */
memset(elp_buffer, 0xb0, sizeof(elp_buffer));
......@@ -264,12 +272,12 @@ static void test_logpen(void)
{
case PS_NULL:
ok(size == sizeof(LOGPEN),
"GetObject returned %d, error %d\n", size, GetLastError());
"GetObject returned %d, error %ld\n", size, GetLastError());
memcpy(&lp, ext_pen, sizeof(lp));
ok(lp.lopnStyle == pen[i].ret_style, "expected %u, got %u\n", pen[i].ret_style, lp.lopnStyle);
ok(lp.lopnWidth.x == pen[i].ret_width, "expected %u, got %d\n", pen[i].ret_width, lp.lopnWidth.x);
ok(lp.lopnWidth.y == 0, "expected 0, got %d\n", lp.lopnWidth.y);
ok(lp.lopnColor == pen[i].ret_color, "expected %08x, got %08x\n", pen[i].ret_color, lp.lopnColor);
ok(lp.lopnWidth.x == pen[i].ret_width, "expected %u, got %ld\n", pen[i].ret_width, lp.lopnWidth.x);
ok(lp.lopnWidth.y == 0, "expected 0, got %ld\n", lp.lopnWidth.y);
ok(lp.lopnColor == pen[i].ret_color, "expected %08lx, got %08lx\n", pen[i].ret_color, lp.lopnColor);
/* for PS_NULL it also works this way */
memset(&elp, 0xb0, sizeof(elp));
......@@ -277,31 +285,31 @@ static void test_logpen(void)
SetLastError(0xdeadbeef);
size = GetObjectW(hpen, sizeof(elp), &elp);
ok(size == offsetof(EXTLOGPEN, elpStyleEntry[1]),
"GetObject returned %d, error %d\n", size, GetLastError());
"GetObject returned %d, error %ld\n", size, GetLastError());
ok(ext_pen->elpHatch == unset_hatch, "expected 0xb0b0b0b0, got %p\n", (void *)ext_pen->elpHatch);
ok(ext_pen->elpNumEntries == 0xb0b0b0b0, "expected 0xb0b0b0b0, got %x\n", ext_pen->elpNumEntries);
ok(ext_pen->elpNumEntries == 0xb0b0b0b0, "expected 0xb0b0b0b0, got %lx\n", ext_pen->elpNumEntries);
break;
case PS_USERSTYLE:
ok(size == offsetof( EXTLOGPEN, elpStyleEntry[2] ),
"GetObject returned %d, error %d\n", size, GetLastError());
"GetObject returned %d, error %ld\n", size, GetLastError());
ok(ext_pen->elpHatch == HS_CROSS, "expected HS_CROSS, got %p\n", (void *)ext_pen->elpHatch);
ok(ext_pen->elpNumEntries == 2, "expected 0, got %x\n", ext_pen->elpNumEntries);
ok(ext_style[0] == 0xabc, "expected 0xabc, got %x\n", ext_style[0]);
ok(ext_style[1] == 0xdef, "expected 0xdef, got %x\n", ext_style[1]);
ok(ext_pen->elpNumEntries == 2, "expected 0, got %lx\n", ext_pen->elpNumEntries);
ok(ext_style[0] == 0xabc, "expected 0xabc, got %lx\n", ext_style[0]);
ok(ext_style[1] == 0xdef, "expected 0xdef, got %lx\n", ext_style[1]);
break;
default:
ok(size == offsetof( EXTLOGPEN, elpStyleEntry ),
"GetObject returned %d, error %d\n", size, GetLastError());
"GetObject returned %d, error %ld\n", size, GetLastError());
ok(ext_pen->elpHatch == HS_CROSS, "expected HS_CROSS, got %p\n", (void *)ext_pen->elpHatch);
ok(ext_pen->elpNumEntries == 0, "expected 0, got %x\n", ext_pen->elpNumEntries);
ok(ext_pen->elpNumEntries == 0, "expected 0, got %lx\n", ext_pen->elpNumEntries);
break;
}
ok(ext_pen->elpPenStyle == pen[i].style, "expected %x, got %x\n", pen[i].style, ext_pen->elpPenStyle);
ok(ext_pen->elpWidth == 1, "expected 1, got %x\n", ext_pen->elpWidth);
ok(ext_pen->elpColor == pen[i].ret_color, "expected %08x, got %08x\n", pen[i].ret_color, ext_pen->elpColor);
ok(ext_pen->elpPenStyle == pen[i].style, "expected %x, got %lx\n", pen[i].style, ext_pen->elpPenStyle);
ok(ext_pen->elpWidth == 1, "expected 1, got %lx\n", ext_pen->elpWidth);
ok(ext_pen->elpColor == pen[i].ret_color, "expected %08lx, got %08lx\n", pen[i].ret_color, ext_pen->elpColor);
ok(ext_pen->elpBrushStyle == BS_SOLID, "expected BS_SOLID, got %x\n", ext_pen->elpBrushStyle);
DeleteObject(hpen);
......@@ -328,17 +336,17 @@ test_geometric_pens:
if (pen[i].style > PS_ALTERNATE)
{
ok(hpen == 0, "ExtCreatePen should fail\n");
ok(GetLastError() == ERROR_INVALID_PARAMETER, "wrong last error value %d\n", GetLastError());
ok(GetLastError() == ERROR_INVALID_PARAMETER, "wrong last error value %ld\n", GetLastError());
continue;
}
ok(hpen != 0, "ExtCreatePen error %d\n", GetLastError());
ok(hpen != 0, "ExtCreatePen error %ld\n", GetLastError());
obj_type = GetObjectType(hpen);
/* for some reason XP differentiates PS_NULL here */
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 %lu\n", obj_type);
else
ok(obj_type == OBJ_EXTPEN, "wrong object type %u\n", obj_type);
ok(obj_type == OBJ_EXTPEN, "wrong object type %lu\n", obj_type);
/* check what's the real size of the object */
size = GetObjectW(hpen, 0, NULL);
......@@ -346,17 +354,17 @@ test_geometric_pens:
{
case PS_NULL:
ok(size == sizeof(LOGPEN),
"GetObject returned %d, error %d\n", size, GetLastError());
"GetObject returned %d, error %ld\n", size, GetLastError());
break;
case PS_USERSTYLE:
ok(size == offsetof( EXTLOGPEN, elpStyleEntry[2] ),
"GetObject returned %d, error %d\n", size, GetLastError());
"GetObject returned %d, error %ld\n", size, GetLastError());
break;
default:
ok(size == offsetof( EXTLOGPEN, elpStyleEntry ),
"GetObject returned %d, error %d\n", size, GetLastError());
"GetObject returned %d, error %ld\n", size, GetLastError());
break;
}
......@@ -364,7 +372,7 @@ test_geometric_pens:
memset(&lp, 0xb0, sizeof(lp));
SetLastError(0xdeadbeef);
size = GetObjectW(hpen, sizeof(lp.lopnStyle), &lp);
ok(!size, "GetObject should fail: size %d, error %d\n", size, GetLastError());
ok(!size, "GetObject should fail: size %d, error %ld\n", size, GetLastError());
memset(&lp, 0xb0, sizeof(lp));
SetLastError(0xdeadbeef);
......@@ -372,16 +380,16 @@ test_geometric_pens:
/* for some reason XP differentiates PS_NULL here */
if (pen[i].style == PS_NULL)
{
ok(size == sizeof(LOGPEN), "GetObject returned %d, error %d\n", size, GetLastError());
ok(size == sizeof(LOGPEN), "GetObject returned %d, error %ld\n", size, GetLastError());
ok(lp.lopnStyle == pen[i].ret_style, "expected %u, got %u\n", pen[i].ret_style, lp.lopnStyle);
ok(lp.lopnWidth.x == pen[i].ret_width, "expected %u, got %d\n", pen[i].ret_width, lp.lopnWidth.x);
ok(lp.lopnWidth.y == 0, "expected 0, got %d\n", lp.lopnWidth.y);
ok(lp.lopnColor == pen[i].ret_color, "expected %08x, got %08x\n", pen[i].ret_color, lp.lopnColor);
ok(lp.lopnWidth.x == pen[i].ret_width, "expected %u, got %ld\n", pen[i].ret_width, lp.lopnWidth.x);
ok(lp.lopnWidth.y == 0, "expected 0, got %ld\n", lp.lopnWidth.y);
ok(lp.lopnColor == pen[i].ret_color, "expected %08lx, got %08lx\n", pen[i].ret_color, lp.lopnColor);
}
else
/* XP doesn't set last error here */
ok(!size /*&& GetLastError() == ERROR_INVALID_PARAMETER*/,
"GetObject should fail: size %d, error %d\n", size, GetLastError());
"GetObject should fail: size %d, error %ld\n", size, GetLastError());
memset(elp_buffer, 0xb0, sizeof(elp_buffer));
SetLastError(0xdeadbeef);
......@@ -391,54 +399,54 @@ test_geometric_pens:
{
case PS_NULL:
ok(size == offsetof(EXTLOGPEN, elpStyleEntry[1]),
"GetObject returned %d, error %d\n", size, GetLastError());
"GetObject returned %d, error %ld\n", size, GetLastError());
ok(ext_pen->elpHatch == 0, "expected 0, got %p\n", (void *)ext_pen->elpHatch);
ok(ext_pen->elpNumEntries == 0, "expected 0, got %x\n", ext_pen->elpNumEntries);
ok(ext_pen->elpNumEntries == 0, "expected 0, got %lx\n", ext_pen->elpNumEntries);
/* for PS_NULL it also works this way */
SetLastError(0xdeadbeef);
size = GetObjectW(hpen, sizeof(elp_buffer), &lp);
ok(size == sizeof(LOGPEN),
"GetObject returned %d, error %d\n", size, GetLastError());
"GetObject returned %d, error %ld\n", size, GetLastError());
ok(lp.lopnStyle == pen[i].ret_style, "expected %u, got %u\n", pen[i].ret_style, lp.lopnStyle);
ok(lp.lopnWidth.x == pen[i].ret_width, "expected %u, got %d\n", pen[i].ret_width, lp.lopnWidth.x);
ok(lp.lopnWidth.y == 0, "expected 0, got %d\n", lp.lopnWidth.y);
ok(lp.lopnColor == pen[i].ret_color, "expected %08x, got %08x\n", pen[i].ret_color, lp.lopnColor);
ok(lp.lopnWidth.x == pen[i].ret_width, "expected %u, got %ld\n", pen[i].ret_width, lp.lopnWidth.x);
ok(lp.lopnWidth.y == 0, "expected 0, got %ld\n", lp.lopnWidth.y);
ok(lp.lopnColor == pen[i].ret_color, "expected %08lx, got %08lx\n", pen[i].ret_color, lp.lopnColor);
break;
case PS_USERSTYLE:
ok(!size /*&& GetLastError() == ERROR_INVALID_PARAMETER*/,
"GetObject should fail: size %d, error %d\n", size, GetLastError());
"GetObject should fail: size %d, error %ld\n", size, GetLastError());
size = GetObjectW(hpen, sizeof(elp_buffer), elp_buffer);
ok(size == offsetof( EXTLOGPEN, elpStyleEntry[2] ),
"GetObject returned %d, error %d\n", size, GetLastError());
"GetObject returned %d, error %ld\n", size, GetLastError());
ok(ext_pen->elpHatch == HS_CROSS, "expected HS_CROSS, got %p\n", (void *)ext_pen->elpHatch);
ok(ext_pen->elpNumEntries == 2, "expected 0, got %x\n", ext_pen->elpNumEntries);
ok(ext_style[0] == 0xabc, "expected 0xabc, got %x\n", ext_style[0]);
ok(ext_style[1] == 0xdef, "expected 0xdef, got %x\n", ext_style[1]);
ok(ext_pen->elpNumEntries == 2, "expected 0, got %lx\n", ext_pen->elpNumEntries);
ok(ext_style[0] == 0xabc, "expected 0xabc, got %lx\n", ext_style[0]);
ok(ext_style[1] == 0xdef, "expected 0xdef, got %lx\n", ext_style[1]);
break;
default:
ok(size == offsetof( EXTLOGPEN, elpStyleEntry ),
"GetObject returned %d, error %d\n", size, GetLastError());
"GetObject returned %d, error %ld\n", size, GetLastError());
ok(ext_pen->elpHatch == HS_CROSS, "expected HS_CROSS, got %p\n", (void *)ext_pen->elpHatch);
ok(ext_pen->elpNumEntries == 0, "expected 0, got %x\n", ext_pen->elpNumEntries);
ok(ext_pen->elpNumEntries == 0, "expected 0, got %lx\n", ext_pen->elpNumEntries);
break;
}
/* for some reason XP differentiates PS_NULL here */
if (pen[i].style == PS_NULL)
ok(ext_pen->elpPenStyle == pen[i].ret_style, "expected %x, got %x\n", pen[i].ret_style, ext_pen->elpPenStyle);
ok(ext_pen->elpPenStyle == pen[i].ret_style, "expected %x, got %lx\n", pen[i].ret_style, ext_pen->elpPenStyle);
else
{
ok(ext_pen->elpPenStyle == (PS_GEOMETRIC | pen[i].style), "expected %x, got %x\n", PS_GEOMETRIC | pen[i].style, ext_pen->elpPenStyle);
ok(ext_pen->elpPenStyle == (PS_GEOMETRIC | pen[i].style), "expected %x, got %lx\n", PS_GEOMETRIC | pen[i].style, ext_pen->elpPenStyle);
}
if (pen[i].style == PS_NULL)
ok(ext_pen->elpWidth == 0, "expected 0, got %x\n", ext_pen->elpWidth);
ok(ext_pen->elpWidth == 0, "expected 0, got %lx\n", ext_pen->elpWidth);
else
ok(ext_pen->elpWidth == pen[i].ret_width, "expected %u, got %x\n", pen[i].ret_width, ext_pen->elpWidth);
ok(ext_pen->elpColor == pen[i].ret_color, "expected %08x, got %08x\n", pen[i].ret_color, ext_pen->elpColor);
ok(ext_pen->elpWidth == pen[i].ret_width, "expected %u, got %lx\n", pen[i].ret_width, ext_pen->elpWidth);
ok(ext_pen->elpColor == pen[i].ret_color, "expected %08lx, got %08lx\n", pen[i].ret_color, ext_pen->elpColor);
ok(ext_pen->elpBrushStyle == BS_SOLID, "expected BS_SOLID, got %x\n", ext_pen->elpBrushStyle);
DeleteObject(hpen);
......@@ -478,17 +486,17 @@ static void test_ps_alternate(void)
skip("looks like 9x, skipping PS_ALTERNATE tests\n");
return;
}
ok(pen != NULL, "gle=%d\n", GetLastError());
ok(pen != NULL, "gle=%ld\n", GetLastError());
hdc = CreateCompatibleDC(NULL);
ok(hdc != NULL, "gle=%d\n", GetLastError());
ok(hdc != NULL, "gle=%ld\n", GetLastError());
bmp = CreateBitmap(8, 1, 1, 1, NULL);
ok(bmp != NULL, "gle=%d\n", GetLastError());
ok(bmp != NULL, "gle=%ld\n", GetLastError());
hRet = SelectObject(hdc, bmp);
ok(hRet != NULL, "gle=%d\n", GetLastError());
ok(hRet != NULL, "gle=%ld\n", GetLastError());
hRet = SelectObject(hdc, pen);
ok(hRet != NULL, "gle=%d\n", GetLastError());
ok(hRet != NULL, "gle=%ld\n", GetLastError());
iRet = SetBkMode(hdc, TRANSPARENT);
ok(iRet, "gle=%d\n", GetLastError());
ok(iRet, "gle=%ld\n", GetLastError());
TEST_LINE(0, 1, "10000000")
TEST_LINE(0, 2, "10000000")
......@@ -600,39 +608,39 @@ static void test_brush_pens(void)
lb.lbColor = RGB(12,34,56);
lb.lbHatch = HS_CROSS;
pen = ExtCreatePen( PS_DOT | PS_GEOMETRIC, 3, &lb, 0, NULL );
ok( pen != 0, "ExtCreatePen failed err %u\n", GetLastError() );
ok( pen != 0, "ExtCreatePen failed err %lu\n", GetLastError() );
size = GetObjectW( pen, sizeof(buffer), elp );
ok( size == offsetof( EXTLOGPEN, elpStyleEntry ), "wrong size %u\n", size );
ok( elp->elpPenStyle == (PS_DOT | PS_GEOMETRIC), "wrong pen style %x\n", elp->elpPenStyle );
ok( size == offsetof( EXTLOGPEN, elpStyleEntry ), "wrong size %lu\n", size );
ok( elp->elpPenStyle == (PS_DOT | PS_GEOMETRIC), "wrong pen style %lx\n", elp->elpPenStyle );
ok( elp->elpBrushStyle == lb.lbStyle, "wrong brush style %x\n", elp->elpBrushStyle );
ok( elp->elpColor == RGB(12,34,56), "wrong color %x\n", elp->elpColor );
ok( elp->elpHatch == HS_CROSS, "wrong hatch %lx\n", elp->elpHatch );
ok( elp->elpNumEntries == 0, "wrong entries %x\n", elp->elpNumEntries );
ok( elp->elpColor == RGB(12,34,56), "wrong color %lx\n", elp->elpColor );
ok( elp->elpHatch == HS_CROSS, "wrong hatch %Ix\n", elp->elpHatch );
ok( elp->elpNumEntries == 0, "wrong entries %lx\n", elp->elpNumEntries );
break;
case BS_NULL:
pen = ExtCreatePen( PS_SOLID | PS_GEOMETRIC, 3, &lb, 0, NULL );
ok( pen != 0, "ExtCreatePen failed err %u\n", GetLastError() );
ok( pen != 0, "ExtCreatePen failed err %lu\n", GetLastError() );
size = GetObjectW( pen, sizeof(buffer), elp );
ok( size == sizeof(LOGPEN), "wrong size %u\n", size );
ok( size == sizeof(LOGPEN), "wrong size %lu\n", size );
ok( ((LOGPEN *)elp)->lopnStyle == PS_NULL,
"wrong pen style %x\n", ((LOGPEN *)elp)->lopnStyle );
ok( ((LOGPEN *)elp)->lopnColor == 0,
"wrong color %x\n", ((LOGPEN *)elp)->lopnColor );
"wrong color %lx\n", ((LOGPEN *)elp)->lopnColor );
break;
case BS_PATTERN:
lb.lbColor = RGB(12,34,56);
lb.lbHatch = (ULONG_PTR)bmp;
pen = ExtCreatePen( PS_DOT | PS_GEOMETRIC, 3, &lb, 0, NULL );
ok( pen != 0, "ExtCreatePen failed err %u\n", GetLastError() );
ok( pen != 0, "ExtCreatePen failed err %lu\n", GetLastError() );
size = GetObjectW( pen, sizeof(buffer), elp );
ok( size == offsetof( EXTLOGPEN, elpStyleEntry ), "wrong size %u\n", size );
ok( elp->elpPenStyle == (PS_DOT | PS_GEOMETRIC), "wrong pen style %x\n", elp->elpPenStyle );
ok( size == offsetof( EXTLOGPEN, elpStyleEntry ), "wrong size %lu\n", size );
ok( elp->elpPenStyle == (PS_DOT | PS_GEOMETRIC), "wrong pen style %lx\n", elp->elpPenStyle );
ok( elp->elpBrushStyle == BS_PATTERN, "wrong brush style %x\n", elp->elpBrushStyle );
ok( elp->elpColor == 0, "wrong color %x\n", elp->elpColor );
ok( elp->elpHatch == (ULONG_PTR)bmp, "wrong hatch %lx/%p\n", elp->elpHatch, bmp );
ok( elp->elpNumEntries == 0, "wrong entries %x\n", elp->elpNumEntries );
ok( elp->elpColor == 0, "wrong color %lx\n", elp->elpColor );
ok( elp->elpHatch == (ULONG_PTR)bmp, "wrong hatch %Ix/%p\n", elp->elpHatch, bmp );
ok( elp->elpNumEntries == 0, "wrong entries %lx\n", elp->elpNumEntries );
break;
case BS_DIBPATTERN:
......@@ -640,20 +648,20 @@ static void test_brush_pens(void)
lb.lbColor = DIB_PAL_COLORS;
lb.lbHatch = lb.lbStyle == BS_DIBPATTERN ? (ULONG_PTR)hmem : (ULONG_PTR)info;
pen = ExtCreatePen( PS_DOT | PS_GEOMETRIC, 3, &lb, 0, NULL );
ok( pen != 0, "ExtCreatePen failed err %u\n", GetLastError() );
ok( pen != 0, "ExtCreatePen failed err %lu\n", GetLastError() );
size = GetObjectW( pen, sizeof(buffer), elp );
ok( size == offsetof( EXTLOGPEN, elpStyleEntry ), "wrong size %u\n", size );
ok( elp->elpPenStyle == (PS_DOT | PS_GEOMETRIC), "wrong pen style %x\n", elp->elpPenStyle );
ok( size == offsetof( EXTLOGPEN, elpStyleEntry ), "wrong size %lu\n", size );
ok( elp->elpPenStyle == (PS_DOT | PS_GEOMETRIC), "wrong pen style %lx\n", elp->elpPenStyle );
ok( elp->elpBrushStyle == BS_DIBPATTERNPT, "wrong brush style %x\n", elp->elpBrushStyle );
ok( elp->elpColor == 0, "wrong color %x\n", elp->elpColor );
ok( elp->elpHatch == lb.lbHatch, "wrong hatch %lx/%lx\n", elp->elpHatch, lb.lbHatch );
ok( elp->elpNumEntries == 0, "wrong entries %x\n", elp->elpNumEntries );
ok( elp->elpColor == 0, "wrong color %lx\n", elp->elpColor );
ok( elp->elpHatch == lb.lbHatch, "wrong hatch %Ix/%Ix\n", elp->elpHatch, lb.lbHatch );
ok( elp->elpNumEntries == 0, "wrong entries %lx\n", elp->elpNumEntries );
break;
default:
pen = ExtCreatePen( PS_DOT | PS_GEOMETRIC, 3, &lb, 0, NULL );
ok( !pen, "ExtCreatePen succeeded\n" );
ok( GetLastError() == ERROR_INVALID_PARAMETER, "wrong error %u\n", GetLastError() );
ok( GetLastError() == ERROR_INVALID_PARAMETER, "wrong error %lu\n", GetLastError() );
break;
}
......@@ -665,19 +673,19 @@ static void test_brush_pens(void)
pen = ExtCreatePen( PS_DOT, 1, &lb, 0, NULL );
if (lb.lbStyle == BS_SOLID)
{
ok( pen != 0, "ExtCreatePen failed err %u\n", GetLastError() );
ok( pen != 0, "ExtCreatePen failed err %lu\n", GetLastError() );
size = GetObjectW( pen, sizeof(buffer), elp );
ok( size == offsetof( EXTLOGPEN, elpStyleEntry ), "wrong size %u\n", size );
ok( elp->elpPenStyle == PS_DOT, "wrong pen style %x\n", elp->elpPenStyle );
ok( size == offsetof( EXTLOGPEN, elpStyleEntry ), "wrong size %lu\n", size );
ok( elp->elpPenStyle == PS_DOT, "wrong pen style %lx\n", elp->elpPenStyle );
ok( elp->elpBrushStyle == BS_SOLID, "wrong brush style %x\n", elp->elpBrushStyle );
ok( elp->elpColor == RGB(12,34,56), "wrong color %x\n", elp->elpColor );
ok( elp->elpHatch == HS_CROSS, "wrong hatch %lx\n", elp->elpHatch );
ok( elp->elpColor == RGB(12,34,56), "wrong color %lx\n", elp->elpColor );
ok( elp->elpHatch == HS_CROSS, "wrong hatch %Ix\n", elp->elpHatch );
DeleteObject( pen );
}
else
{
ok( !pen, "ExtCreatePen succeeded\n" );
ok( GetLastError() == ERROR_INVALID_PARAMETER, "wrong error %u\n", GetLastError() );
ok( GetLastError() == ERROR_INVALID_PARAMETER, "wrong error %lu\n", GetLastError() );
}
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment