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 TESTDLL = gdi32.dll
IMPORTS = setupapi user32 gdi32 advapi32 IMPORTS = setupapi user32 gdi32 advapi32
......
This source diff could not be displayed because it is too large. You can view the blob instead.
...@@ -132,19 +132,19 @@ static void verify_region(HRGN hrgn, const RECT *rc) ...@@ -132,19 +132,19 @@ static void verify_region(HRGN hrgn, const RECT *rc)
ret = GetRegionData(hrgn, 0, NULL); ret = GetRegionData(hrgn, 0, NULL);
if (IsRectEmpty(rc)) 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 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; if (!ret) return;
ret = GetRegionData(hrgn, sizeof(rgn), &rgn.data); ret = GetRegionData(hrgn, sizeof(rgn), &rgn.data);
if (IsRectEmpty(rc)) 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 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, rgn.data.rdh.dwSize, rgn.data.rdh.iType, rgn.data.rdh.nCount, rgn.data.rdh.nRgnSize,
wine_dbgstr_rect(&rgn.data.rdh.rcBound)); wine_dbgstr_rect(&rgn.data.rdh.rcBound));
if (rgn.data.rdh.nCount != 0) if (rgn.data.rdh.nCount != 0)
...@@ -154,21 +154,21 @@ static void verify_region(HRGN hrgn, const RECT *rc) ...@@ -154,21 +154,21 @@ static void verify_region(HRGN hrgn, const RECT *rc)
ok(EqualRect(rect, rc), "rects don't match\n"); 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.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 %u\n", rgn.data.rdh.iType); ok(rgn.data.rdh.iType == RDH_RECTANGLES, "expected RDH_RECTANGLES, got %lu\n", rgn.data.rdh.iType);
if (IsRectEmpty(rc)) 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 || ok(rgn.data.rdh.nRgnSize == 0 ||
broken(rgn.data.rdh.nRgnSize == 168), /* NT4 */ 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 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) || ok(rgn.data.rdh.nRgnSize == sizeof(RECT) ||
broken(rgn.data.rdh.nRgnSize == 168), /* NT4 */ 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"); ok(EqualRect(&rgn.data.rdh.rcBound, rc), "rects don't match\n");
} }
...@@ -190,7 +190,7 @@ static void test_ExtCreateRegion(void) ...@@ -190,7 +190,7 @@ static void test_ExtCreateRegion(void)
SetLastError(0xdeadbeef); SetLastError(0xdeadbeef);
hrgn = ExtCreateRegion(NULL, 0, NULL); hrgn = ExtCreateRegion(NULL, 0, NULL);
ok(!hrgn, "ExtCreateRegion should fail\n"); 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.dwSize = 0;
rgn.data.rdh.iType = 0; rgn.data.rdh.iType = 0;
...@@ -202,14 +202,14 @@ static void test_ExtCreateRegion(void) ...@@ -202,14 +202,14 @@ static void test_ExtCreateRegion(void)
SetLastError(0xdeadbeef); SetLastError(0xdeadbeef);
hrgn = ExtCreateRegion(NULL, sizeof(rgn), &rgn.data); hrgn = ExtCreateRegion(NULL, sizeof(rgn), &rgn.data);
ok(!hrgn, "ExtCreateRegion should fail\n"); 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; rgn.data.rdh.dwSize = sizeof(rgn.data.rdh) - 1;
SetLastError(0xdeadbeef); SetLastError(0xdeadbeef);
hrgn = ExtCreateRegion(NULL, sizeof(rgn), &rgn.data); hrgn = ExtCreateRegion(NULL, sizeof(rgn), &rgn.data);
ok(!hrgn, "ExtCreateRegion should fail\n"); 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 */ /* although XP doesn't care about the type Win9x does */
rgn.data.rdh.iType = RDH_RECTANGLES; rgn.data.rdh.iType = RDH_RECTANGLES;
...@@ -218,7 +218,7 @@ static void test_ExtCreateRegion(void) ...@@ -218,7 +218,7 @@ static void test_ExtCreateRegion(void)
/* sizeof(RGNDATAHEADER) is large enough */ /* sizeof(RGNDATAHEADER) is large enough */
SetLastError(0xdeadbeef); SetLastError(0xdeadbeef);
hrgn = ExtCreateRegion(NULL, sizeof(RGNDATAHEADER), &rgn.data); 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); verify_region(hrgn, &empty_rect);
DeleteObject(hrgn); DeleteObject(hrgn);
...@@ -229,11 +229,11 @@ static void test_ExtCreateRegion(void) ...@@ -229,11 +229,11 @@ static void test_ExtCreateRegion(void)
ok(!hrgn, "ExtCreateRegion should fail\n"); ok(!hrgn, "ExtCreateRegion should fail\n");
todo_wine todo_wine
ok(GetLastError() == ERROR_INVALID_PARAMETER || ok(GetLastError() == ERROR_INVALID_PARAMETER ||
broken(GetLastError() == 0xdeadbeef), "0xdeadbeef, got %u\n", GetLastError()); broken(GetLastError() == 0xdeadbeef), "0xdeadbeef, got %lu\n", GetLastError());
SetLastError(0xdeadbeef); SetLastError(0xdeadbeef);
hrgn = ExtCreateRegion(NULL, sizeof(rgn), &rgn.data); 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); verify_region(hrgn, &empty_rect);
DeleteObject(hrgn); DeleteObject(hrgn);
...@@ -243,7 +243,7 @@ static void test_ExtCreateRegion(void) ...@@ -243,7 +243,7 @@ static void test_ExtCreateRegion(void)
SetLastError(0xdeadbeef); SetLastError(0xdeadbeef);
hrgn = ExtCreateRegion(NULL, sizeof(rgn), &rgn.data); 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); verify_region(hrgn, &rc);
DeleteObject(hrgn); DeleteObject(hrgn);
...@@ -256,7 +256,7 @@ static void test_ExtCreateRegion(void) ...@@ -256,7 +256,7 @@ static void test_ExtCreateRegion(void)
SetLastError(0xdeadbeef); SetLastError(0xdeadbeef);
hrgn = ExtCreateRegion(&xform, sizeof(rgn), &rgn.data); 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); verify_region(hrgn, &rc_xformed);
DeleteObject(hrgn); DeleteObject(hrgn);
...@@ -269,7 +269,7 @@ static void test_ExtCreateRegion(void) ...@@ -269,7 +269,7 @@ static void test_ExtCreateRegion(void)
hrgn = ExtCreateRegion(NULL, sizeof(RGNDATAHEADER) + 2 * sizeof(RECT) - 1, &rgn.data); hrgn = ExtCreateRegion(NULL, sizeof(RGNDATAHEADER) + 2 * sizeof(RECT) - 1, &rgn.data);
todo_wine todo_wine
ok(!hrgn, "ExtCreateRegion should fail\n"); ok(!hrgn, "ExtCreateRegion should fail\n");
ok(GetLastError() == 0xdeadbeef, "0xdeadbeef, got %u\n", GetLastError()); ok(GetLastError() == 0xdeadbeef, "0xdeadbeef, got %lu\n", GetLastError());
} }
......
...@@ -47,41 +47,41 @@ static void test_gdi_objects(void) ...@@ -47,41 +47,41 @@ static void test_gdi_objects(void)
SetLastError(0); SetLastError(0);
hp = SelectObject(NULL, GetStockObject(BLACK_PEN)); hp = SelectObject(NULL, GetStockObject(BLACK_PEN));
ok(!hp && (GetLastError() == ERROR_INVALID_HANDLE || broken(!GetLastError())), 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()); hp, GetLastError());
/* With a valid DC and a NULL object, the call returns 0 but does not SetLastError() */ /* With a valid DC and a NULL object, the call returns 0 but does not SetLastError() */
SetLastError(0); SetLastError(0);
hp = SelectObject(hdc, NULL); hp = SelectObject(hdc, NULL);
ok(!hp && !GetLastError(), 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()); hp, GetLastError());
/* The DC is unaffected by the NULL SelectObject */ /* The DC is unaffected by the NULL SelectObject */
SetLastError(0); SetLastError(0);
hp = SelectObject(hdc, GetStockObject(BLACK_PEN)); hp = SelectObject(hdc, GetStockObject(BLACK_PEN));
ok(hp && !GetLastError(), 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()); hp, GetLastError());
/* GetCurrentObject does not SetLastError() on a null object */ /* GetCurrentObject does not SetLastError() on a null object */
SetLastError(0); SetLastError(0);
hp = GetCurrentObject(NULL, OBJ_PEN); hp = GetCurrentObject(NULL, OBJ_PEN);
ok(!hp && !GetLastError(), 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()); hp, GetLastError());
/* DeleteObject does not SetLastError() on a null object */ /* DeleteObject does not SetLastError() on a null object */
ret = DeleteObject(NULL); ret = DeleteObject(NULL);
ok( !ret && !GetLastError(), 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()); ret, GetLastError());
/* GetObject does not SetLastError() on a null object */ /* GetObject does not SetLastError() on a null object */
SetLastError(0); SetLastError(0);
i = GetObjectA(NULL, sizeof(buff), buff); i = GetObjectA(NULL, sizeof(buff), buff);
ok (!i && (GetLastError() == 0 || GetLastError() == ERROR_INVALID_PARAMETER), 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()); i, GetLastError());
/* GetObject expects ERROR_NOACCESS when passed an invalid buffer */ /* GetObject expects ERROR_NOACCESS when passed an invalid buffer */
...@@ -89,21 +89,21 @@ static void test_gdi_objects(void) ...@@ -89,21 +89,21 @@ static void test_gdi_objects(void)
SetLastError(0); SetLastError(0);
i = GetObjectA(hp, (INT_PTR)buff, (LPVOID)sizeof(buff)); i = GetObjectA(hp, (INT_PTR)buff, (LPVOID)sizeof(buff));
ok (!i && (GetLastError() == 0 || GetLastError() == ERROR_NOACCESS), 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()); i, GetLastError());
/* GetObjectType does SetLastError() on a null object */ /* GetObjectType does SetLastError() on a null object */
SetLastError(0); SetLastError(0);
i = GetObjectType(NULL); i = GetObjectType(NULL);
ok (!i && GetLastError() == ERROR_INVALID_HANDLE, 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()); i, GetLastError());
/* UnrealizeObject does not SetLastError() on a null object */ /* UnrealizeObject does not SetLastError() on a null object */
SetLastError(0); SetLastError(0);
i = UnrealizeObject(NULL); i = UnrealizeObject(NULL);
ok (!i && !GetLastError(), 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()); i, GetLastError());
ReleaseDC(NULL, hdc); ReleaseDC(NULL, hdc);
...@@ -125,7 +125,7 @@ static DWORD WINAPI thread_proc(void *param) ...@@ -125,7 +125,7 @@ static DWORD WINAPI thread_proc(void *param)
struct hgdiobj_event *hgdiobj_event = param; struct hgdiobj_event *hgdiobj_event = param;
hgdiobj_event->hdc = CreateDCA("display", NULL, NULL, NULL); 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)); hgdiobj_event->hgdiobj1 = CreatePen(PS_DASHDOTDOT, 17, RGB(1, 2, 3));
ok(hgdiobj_event->hgdiobj1 != 0, "Failed to create pen\n"); ok(hgdiobj_event->hgdiobj1 != 0, "Failed to create pen\n");
...@@ -135,7 +135,7 @@ static DWORD WINAPI thread_proc(void *param) ...@@ -135,7 +135,7 @@ static DWORD WINAPI thread_proc(void *param)
SetEvent(hgdiobj_event->ready_event); SetEvent(hgdiobj_event->ready_event);
status = WaitForSingleObject(hgdiobj_event->stop_event, INFINITE); 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"); ok(!GetObjectA(hgdiobj_event->hgdiobj1, sizeof(lp), &lp), "GetObject should fail\n");
...@@ -155,43 +155,43 @@ static void test_thread_objects(void) ...@@ -155,43 +155,43 @@ static void test_thread_objects(void)
BOOL bRet; BOOL bRet;
hgdiobj_event.stop_event = CreateEventA(NULL, 0, 0, NULL); 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); 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); 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); 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); 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.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.x == 17, "wrong pen width.y %ld\n", lp.lopnWidth.x);
ok(lp.lopnWidth.y == 0, "wrong pen width.y %d\n", lp.lopnWidth.y); 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 %08x\n", lp.lopnColor); ok(lp.lopnColor == RGB(1, 2, 3), "wrong pen width.y %08lx\n", lp.lopnColor);
ret = GetDeviceCaps(hgdiobj_event.hdc, TECHNOLOGY); ret = GetDeviceCaps(hgdiobj_event.hdc, TECHNOLOGY);
ok(ret == DT_RASDISPLAY, "GetDeviceCaps(TECHNOLOGY) should return DT_RASDISPLAY not %d\n", ret); ok(ret == DT_RASDISPLAY, "GetDeviceCaps(TECHNOLOGY) should return DT_RASDISPLAY not %d\n", ret);
bRet = DeleteObject(hgdiobj_event.hgdiobj1); bRet = DeleteObject(hgdiobj_event.hgdiobj1);
ok(bRet, "DeleteObject error %u\n", GetLastError()); ok(bRet, "DeleteObject error %lu\n", GetLastError());
bRet = DeleteDC(hgdiobj_event.hdc); bRet = DeleteDC(hgdiobj_event.hdc);
ok(bRet, "DeleteDC error %u\n", GetLastError()); ok(bRet, "DeleteDC error %lu\n", GetLastError());
type = GetObjectType(hgdiobj_event.hgdiobj2); 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); SetEvent(hgdiobj_event.stop_event);
status = WaitForSingleObject(hthread, INFINITE); 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); CloseHandle(hthread);
type = GetObjectType(hgdiobj_event.hgdiobj2); 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); 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.stop_event);
CloseHandle(hgdiobj_event.ready_event); CloseHandle(hgdiobj_event.ready_event);
...@@ -216,7 +216,7 @@ static void test_GetCurrentObject(void) ...@@ -216,7 +216,7 @@ static void test_GetCurrentObject(void)
assert(hdc != 0); assert(hdc != 0);
type = GetObjectType(hdc); 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)); hpen = CreatePen(PS_SOLID, 10, RGB(10, 20, 30));
assert(hpen != 0); assert(hpen != 0);
...@@ -354,9 +354,9 @@ static void test_handles_on_win64(void) ...@@ -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); hrgn_test = (HRGN)(ULONG_PTR)((ULONG_PTR)hrgn | ((ULONGLONG)cases[i].high << 32) | cases[i].low);
type = GetObjectType( hrgn_test ); type = GetObjectType( hrgn_test );
if (cases[i].ret) if (cases[i].ret)
ok( type == OBJ_REGION, "wrong type %u\n", type ); ok( type == OBJ_REGION, "wrong type %lu\n", type );
else else
ok( type == 0, "wrong type %u\n", type ); ok( type == 0, "wrong type %lu\n", type );
ret = DeleteObject(hrgn_test); ret = DeleteObject(hrgn_test);
ok( cases[i].ret == ret, "DeleteObject should return %s (%p)\n", ok( cases[i].ret == ret, "DeleteObject should return %s (%p)\n",
cases[i].ret ? "TRUE" : "FALSE", hrgn_test); cases[i].ret ? "TRUE" : "FALSE", hrgn_test);
...@@ -430,7 +430,7 @@ static void test_shared_handle_table(void) ...@@ -430,7 +430,7 @@ static void test_shared_handle_table(void)
handle = HandleToULong( hrgn ); handle = HandleToULong( hrgn );
entry = &gdi_shared->Handles[handle & 0xffff]; entry = &gdi_shared->Handles[handle & 0xffff];
todo_wine 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()); entry->Owner.ProcessId, GetCurrentProcessId());
test_shared_handle_entry( hrgn, NTGDI_OBJ_REGION, FALSE ); test_shared_handle_entry( hrgn, NTGDI_OBJ_REGION, FALSE );
...@@ -442,7 +442,7 @@ static void test_shared_handle_table(void) ...@@ -442,7 +442,7 @@ static void test_shared_handle_table(void)
ok(entry->Type == 4, "Type = %x\n", entry->Type); ok(entry->Type == 4, "Type = %x\n", entry->Type);
ok(entry->Object, "Object = NULL\n"); ok(entry->Object, "Object = NULL\n");
todo_wine 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()); entry->Owner.ProcessId, GetCurrentProcessId());
ok(entry->Owner.Count == 0, "Count = %u\n", entry->Owner.Count); ok(entry->Owner.Count == 0, "Count = %u\n", entry->Owner.Count);
...@@ -465,7 +465,7 @@ static void test_shared_handle_table(void) ...@@ -465,7 +465,7 @@ static void test_shared_handle_table(void)
test_shared_handle_entry( GetStockObject( STOCK_LAST + 1 ), NTGDI_OBJ_BITMAP, TRUE ); test_shared_handle_entry( GetStockObject( STOCK_LAST + 1 ), NTGDI_OBJ_BITMAP, TRUE );
dc = CreateDCW(L"display", NULL, NULL, NULL); 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 ); test_shared_handle_entry( dc, NTGDI_OBJ_DC, FALSE );
DeleteDC(dc); DeleteDC(dc);
......
...@@ -48,12 +48,12 @@ static void test_GetICMProfileA( HDC dc ) ...@@ -48,12 +48,12 @@ static void test_GetICMProfileA( HDC dc )
size = MAX_PATH; size = MAX_PATH;
ret = GetICMProfileA( dc, &size, NULL ); ret = GetICMProfileA( dc, &size, NULL );
ok( !ret, "GetICMProfileA succeeded\n" ); ok( !ret, "GetICMProfileA succeeded\n" );
ok( size > 0, "got %u\n", size ); ok( size > 0, "got %lu\n", size );
size = 0; size = 0;
ret = GetICMProfileA( dc, &size, NULL ); ret = GetICMProfileA( dc, &size, NULL );
ok( !ret, "GetICMProfileA succeeded\n" ); ok( !ret, "GetICMProfileA succeeded\n" );
ok( size > 0, "got %u\n", size ); ok( size > 0, "got %lu\n", size );
size = MAX_PATH; size = MAX_PATH;
ret = GetICMProfileA( NULL, &size, filename ); ret = GetICMProfileA( NULL, &size, filename );
...@@ -67,14 +67,14 @@ static void test_GetICMProfileA( HDC dc ) ...@@ -67,14 +67,14 @@ static void test_GetICMProfileA( HDC dc )
ok( !ret, "GetICMProfileA succeeded\n" ); ok( !ret, "GetICMProfileA succeeded\n" );
ok( size, "expected size > 0\n" ); ok( size, "expected size > 0\n" );
ok( filename[0] == 0, "Expected filename to be empty\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 ); ret = GetICMProfileA( dc, NULL, filename );
ok( !ret, "GetICMProfileA succeeded\n" ); ok( !ret, "GetICMProfileA succeeded\n" );
size = MAX_PATH; size = MAX_PATH;
ret = GetICMProfileA( dc, &size, filename ); ret = GetICMProfileA( dc, &size, filename );
ok( ret, "GetICMProfileA failed %d\n", GetLastError() ); ok( ret, "GetICMProfileA failed %ld\n", GetLastError() );
trace( "%s\n", filename ); trace( "%s\n", filename );
} }
...@@ -102,7 +102,7 @@ static void test_GetICMProfileW( HDC dc ) ...@@ -102,7 +102,7 @@ static void test_GetICMProfileW( HDC dc )
/* Vista crashes */ /* Vista crashes */
size = MAX_PATH; size = MAX_PATH;
ret = GetICMProfileW( dc, &size, NULL ); ret = GetICMProfileW( dc, &size, NULL );
ok( ret, "GetICMProfileW failed %d\n", GetLastError() ); ok( ret, "GetICMProfileW failed %ld\n", GetLastError() );
} }
ret = GetICMProfileW( dc, NULL, filename ); ret = GetICMProfileW( dc, NULL, filename );
...@@ -115,7 +115,7 @@ static void test_GetICMProfileW( HDC dc ) ...@@ -115,7 +115,7 @@ static void test_GetICMProfileW( HDC dc )
size = 0; size = 0;
ret = GetICMProfileW( dc, &size, NULL ); ret = GetICMProfileW( dc, &size, NULL );
ok( !ret, "GetICMProfileW succeeded\n" ); ok( !ret, "GetICMProfileW succeeded\n" );
ok( size > 0, "got %u\n", size ); ok( size > 0, "got %lu\n", size );
size = 0; size = 0;
SetLastError(0xdeadbeef); SetLastError(0xdeadbeef);
...@@ -123,11 +123,11 @@ static void test_GetICMProfileW( HDC dc ) ...@@ -123,11 +123,11 @@ static void test_GetICMProfileW( HDC dc )
error = GetLastError(); error = GetLastError();
ok( !ret, "GetICMProfileW succeeded\n" ); ok( !ret, "GetICMProfileW succeeded\n" );
ok( size, "expected size > 0\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; size = MAX_PATH;
ret = GetICMProfileW( dc, &size, filename ); 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 ) static void test_SetICMMode( HDC dc )
...@@ -145,24 +145,24 @@ static void test_SetICMMode( HDC dc ) ...@@ -145,24 +145,24 @@ static void test_SetICMMode( HDC dc )
SetLastError( 0xdeadbeef ); SetLastError( 0xdeadbeef );
ret = SetICMMode( NULL, 0 ); ret = SetICMMode( NULL, 0 );
ok( !ret, "SetICMMode succeeded (%d)\n", GetLastError() ); ok( !ret, "SetICMMode succeeded (%ld)\n", GetLastError() );
ret = SetICMMode( dc, -1 ); ret = SetICMMode( dc, -1 );
ok( !ret, "SetICMMode succeeded (%d)\n", GetLastError() ); ok( !ret, "SetICMMode succeeded (%ld)\n", GetLastError() );
save = SetICMMode( dc, ICM_QUERY ); 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; if (save == ICM_ON) knob = ICM_OFF; else knob = ICM_ON;
ret = SetICMMode( dc, knob ); 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 ); 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 ); ret = SetICMMode( dc, save );
ok( ret, "SetICMMode failed (%d)\n", GetLastError() ); ok( ret, "SetICMMode failed (%ld)\n", GetLastError() );
SetLastError( 0xdeadbeef ); SetLastError( 0xdeadbeef );
dc = CreateDCW( L"DISPLAY", NULL, NULL, NULL ); dc = CreateDCW( L"DISPLAY", NULL, NULL, NULL );
...@@ -171,10 +171,10 @@ static void test_SetICMMode( HDC dc ) ...@@ -171,10 +171,10 @@ static void test_SetICMMode( HDC dc )
win_skip( "CreateDCW is not implemented\n" ); win_skip( "CreateDCW is not implemented\n" );
return; return;
} }
ok( dc != NULL, "CreateDCW failed (%d)\n", GetLastError() ); ok( dc != NULL, "CreateDCW failed (%ld)\n", GetLastError() );
ret = SetICMMode( dc, ICM_QUERY ); 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 ); DeleteDC( dc );
} }
...@@ -235,31 +235,31 @@ static void test_SetICMProfileA( HDC dc ) ...@@ -235,31 +235,31 @@ static void test_SetICMProfileA( HDC dc )
len = sizeof(profile); len = sizeof(profile);
ret = GetICMProfileA( dc, &len, profile ); ret = GetICMProfileA( dc, &len, profile );
ok(ret, "GetICMProfileA failed %u\n", GetLastError()); ok(ret, "GetICMProfileA failed %lu\n", GetLastError());
SetLastError( 0xdeadbeef ); SetLastError( 0xdeadbeef );
ret = SetICMProfileA( NULL, NULL ); ret = SetICMProfileA( NULL, NULL );
error = GetLastError(); error = GetLastError();
ok(!ret, "SetICMProfileA succeeded\n"); ok(!ret, "SetICMProfileA succeeded\n");
ok(error == ERROR_INVALID_PARAMETER, ok(error == ERROR_INVALID_PARAMETER,
"expected ERROR_INVALID_PARAMETER, got %u\n", error); "expected ERROR_INVALID_PARAMETER, got %lu\n", error);
SetLastError( 0xdeadbeef ); SetLastError( 0xdeadbeef );
ret = SetICMProfileA( NULL, profile ); ret = SetICMProfileA( NULL, profile );
error = GetLastError(); error = GetLastError();
ok(!ret, "SetICMProfileA succeeded\n"); ok(!ret, "SetICMProfileA succeeded\n");
ok(error == ERROR_INVALID_HANDLE, ok(error == ERROR_INVALID_HANDLE,
"expected ERROR_INVALID_HANDLE, got %u\n", error); "expected ERROR_INVALID_HANDLE, got %lu\n", error);
SetLastError( 0xdeadbeef ); SetLastError( 0xdeadbeef );
ret = SetICMProfileA( dc, NULL ); ret = SetICMProfileA( dc, NULL );
error = GetLastError(); error = GetLastError();
ok(!ret, "SetICMProfileA succeeded\n"); ok(!ret, "SetICMProfileA succeeded\n");
ok(error == ERROR_INVALID_PARAMETER, 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 ); ret = SetICMProfileA( dc, profile );
ok(ret, "SetICMProfileA failed %u\n", GetLastError()); ok(ret, "SetICMProfileA failed %lu\n", GetLastError());
} }
static void test_SetICMProfileW( HDC dc ) static void test_SetICMProfileW( HDC dc )
...@@ -278,28 +278,28 @@ static void test_SetICMProfileW( HDC dc ) ...@@ -278,28 +278,28 @@ static void test_SetICMProfileW( HDC dc )
len = ARRAY_SIZE(profile); len = ARRAY_SIZE(profile);
ret = GetICMProfileW( dc, &len, profile ); ret = GetICMProfileW( dc, &len, profile );
ok(ret, "GetICMProfileW failed %u\n", GetLastError()); ok(ret, "GetICMProfileW failed %lu\n", GetLastError());
SetLastError( 0xdeadbeef ); SetLastError( 0xdeadbeef );
ret = SetICMProfileW( NULL, NULL ); ret = SetICMProfileW( NULL, NULL );
error = GetLastError(); error = GetLastError();
ok(!ret, "SetICMProfileW succeeded\n"); 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 ); SetLastError( 0xdeadbeef );
ret = SetICMProfileW( NULL, profile ); ret = SetICMProfileW( NULL, profile );
error = GetLastError(); error = GetLastError();
ok(!ret, "SetICMProfileW succeeded\n"); 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 ); SetLastError( 0xdeadbeef );
ret = SetICMProfileW( dc, NULL ); ret = SetICMProfileW( dc, NULL );
error = GetLastError(); error = GetLastError();
ok(!ret, "SetICMProfileW succeeded\n"); 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 ); ret = SetICMProfileW( dc, profile );
ok(ret, "SetICMProfileW failed %u\n", GetLastError()); ok(ret, "SetICMProfileW failed %lu\n", GetLastError());
} }
START_TEST(icm) START_TEST(icm)
......
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) { ...@@ -58,7 +58,7 @@ static void test_DIB_PAL_COLORS(void) {
memcpy( logpalette->palPalEntry, logpalettedata, sizeof(logpalettedata) ); memcpy( logpalette->palPalEntry, logpalettedata, sizeof(logpalettedata) );
hpal = CreatePalette( logpalette ); hpal = CreatePalette( logpalette );
hpalOld = SelectPalette( memhdc, hpal, FALSE ); 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 */ /* Create a DIB BMP which references colours in the logical palette */
memset( bmp, 0x00, sizeof(BITMAPINFO) ); memset( bmp, 0x00, sizeof(BITMAPINFO) );
...@@ -78,9 +78,9 @@ static void test_DIB_PAL_COLORS(void) { ...@@ -78,9 +78,9 @@ static void test_DIB_PAL_COLORS(void) {
*bmpPalPtr++ = 19; /* Pointer to bad logical palette index */ *bmpPalPtr++ = 19; /* Pointer to bad logical palette index */
hbmp = CreateDIBSection( memhdc, bmp, DIB_PAL_COLORS, 0, 0, 0 ); 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 ); 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 */ /* Test with a RGB to DIB_PAL_COLORS */
setColor = RGB( logpalettedata[1].peRed, logpalettedata[1].peGreen, logpalettedata[1].peBlue ); setColor = RGB( logpalettedata[1].peRed, logpalettedata[1].peGreen, logpalettedata[1].peBlue );
......
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