diff --git a/dlls/ddraw/tests/ddraw2.c b/dlls/ddraw/tests/ddraw2.c index 0696a623bb0..2d08718d131 100644 --- a/dlls/ddraw/tests/ddraw2.c +++ b/dlls/ddraw/tests/ddraw2.c @@ -18,7 +18,6 @@ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA */ -#define WINE_NO_LONG_TYPES #include #define COBJMACROS @@ -123,9 +122,9 @@ static BOOL ddraw_get_identifier(IDirectDraw2 *ddraw, DDDEVICEIDENTIFIER *identi HRESULT hr; hr = IDirectDraw2_QueryInterface(ddraw, &IID_IDirectDraw4, (void **)&ddraw4); - ok(SUCCEEDED(hr), "Failed to get IDirectDraw4 interface, hr %#x.\n", hr); + ok(SUCCEEDED(hr), "Failed to get IDirectDraw4 interface, hr %#lx.\n", hr); hr = IDirectDraw4_GetDeviceIdentifier(ddraw4, identifier, 0); - ok(SUCCEEDED(hr), "Failed to get device identifier, hr %#x.\n", hr); + ok(SUCCEEDED(hr), "Failed to get device identifier, hr %#lx.\n", hr); IDirectDraw4_Release(ddraw4); return SUCCEEDED(hr); @@ -213,7 +212,7 @@ static DWORD WINAPI create_window_thread_proc(void *param) p->window = create_window(); ret = SetEvent(p->window_created); - ok(ret, "SetEvent failed, last error %#x.\n", GetLastError()); + ok(ret, "SetEvent failed, last error %lu.\n", GetLastError()); for (;;) { @@ -226,7 +225,7 @@ static DWORD WINAPI create_window_thread_proc(void *param) break; if (res != WAIT_TIMEOUT) { - ok(0, "Wait failed (%#x), last error %#x.\n", res, GetLastError()); + ok(0, "Wait failed (%#lx), last error %lu.\n", res, GetLastError()); break; } } @@ -241,13 +240,13 @@ static void create_window_thread(struct create_window_thread_param *p) DWORD res, tid; p->window_created = CreateEventA(NULL, FALSE, FALSE, NULL); - ok(!!p->window_created, "CreateEvent failed, last error %#x.\n", GetLastError()); + ok(!!p->window_created, "CreateEvent failed, last error %lu.\n", GetLastError()); p->destroy_window = CreateEventA(NULL, FALSE, FALSE, NULL); - ok(!!p->destroy_window, "CreateEvent failed, last error %#x.\n", GetLastError()); + ok(!!p->destroy_window, "CreateEvent failed, last error %lu.\n", GetLastError()); p->thread = CreateThread(NULL, 0, create_window_thread_proc, p, 0, &tid); - ok(!!p->thread, "Failed to create thread, last error %#x.\n", GetLastError()); + ok(!!p->thread, "Failed to create thread, last error %lu.\n", GetLastError()); res = WaitForSingleObject(p->window_created, INFINITE); - ok(res == WAIT_OBJECT_0, "Wait failed (%#x), last error %#x.\n", res, GetLastError()); + ok(res == WAIT_OBJECT_0, "Wait failed (%#lx), last error %lu.\n", res, GetLastError()); } static void destroy_window_thread(struct create_window_thread_param *p) @@ -266,9 +265,9 @@ static IDirectDrawSurface *get_depth_stencil(IDirect3DDevice2 *device) HRESULT hr; hr = IDirect3DDevice2_GetRenderTarget(device, &rt); - ok(SUCCEEDED(hr), "Failed to get render target, hr %#x.\n", hr); + ok(SUCCEEDED(hr), "Failed to get render target, hr %#lx.\n", hr); hr = IDirectDrawSurface_GetAttachedSurface(rt, &caps, &ret); - ok(SUCCEEDED(hr) || hr == DDERR_NOTFOUND, "Failed to get the z buffer, hr %#x.\n", hr); + ok(SUCCEEDED(hr) || hr == DDERR_NOTFOUND, "Failed to get the z buffer, hr %#lx.\n", hr); IDirectDrawSurface_Release(rt); return ret; } @@ -354,14 +353,14 @@ static D3DCOLOR get_surface_color(IDirectDrawSurface *surface, UINT x, UINT y) surface_desc.dwSize = sizeof(surface_desc); hr = IDirectDrawSurface_Lock(surface, &rect, &surface_desc, DDLOCK_READONLY | DDLOCK_WAIT, NULL); - ok(SUCCEEDED(hr), "Failed to lock surface, hr %#x.\n", hr); + ok(SUCCEEDED(hr), "Failed to lock surface, hr %#lx.\n", hr); if (FAILED(hr)) return 0xdeadbeef; color = *((DWORD *)surface_desc.lpSurface) & 0x00ffffff; hr = IDirectDrawSurface_Unlock(surface, NULL); - ok(SUCCEEDED(hr), "Failed to unlock surface, hr %#x.\n", hr); + ok(SUCCEEDED(hr), "Failed to unlock surface, hr %#lx.\n", hr); return color; } @@ -374,7 +373,7 @@ static void fill_surface(IDirectDrawSurface *surface, D3DCOLOR color) DWORD *ptr; hr = IDirectDrawSurface_Lock(surface, NULL, &surface_desc, DDLOCK_WAIT, NULL); - ok(hr == DD_OK, "Got unexpected hr %#x.\n", hr); + ok(hr == DD_OK, "Got unexpected hr %#lx.\n", hr); for (y = 0; y < surface_desc.dwHeight; ++y) { @@ -386,7 +385,7 @@ static void fill_surface(IDirectDrawSurface *surface, D3DCOLOR color) } hr = IDirectDrawSurface_Unlock(surface, NULL); - ok(hr == DD_OK, "Got unexpected hr %#x.\n", hr); + ok(hr == DD_OK, "Got unexpected hr %#lx.\n", hr); } static void check_rect(IDirectDrawSurface *surface, RECT r) @@ -401,8 +400,7 @@ static void check_rect(IDirectDrawSurface *surface, RECT r) {r.top - 1, r.top + 1}, {r.bottom + 1, r.bottom - 1} }; - unsigned int i, j, x_side, y_side; - DWORD color; + unsigned int i, j, x_side, y_side, color; LONG x, y; for (i = 0; i < 2; ++i) @@ -413,14 +411,14 @@ static void check_rect(IDirectDrawSurface *surface, RECT r) { for (y_side = 0; y_side < 2; ++y_side) { - DWORD expected = (x_side == 1 && y_side == 1) ? 0x00ffffff : 0x00000000; + unsigned int expected = (x_side == 1 && y_side == 1) ? 0x00ffffff : 0x00000000; x = x_coords[i][x_side]; y = y_coords[j][y_side]; if (x < 0 || x >= 640 || y < 0 || y >= 480) continue; color = get_surface_color(surface, x, y); - ok(color == expected, "Pixel (%d, %d) has color %08x, expected %08x.\n", x, y, color, expected); + ok(color == expected, "Pixel (%ld, %ld) has color %08x, expected %08x.\n", x, y, color, expected); } } } @@ -483,7 +481,7 @@ static IDirect3DDevice2 *create_device_ex(IDirectDraw2 *ddraw, HWND window, DWOR HRESULT hr; hr = IDirectDraw2_SetCooperativeLevel(ddraw, window, coop_level); - ok(SUCCEEDED(hr), "Failed to set cooperative level, hr %#x.\n", hr); + ok(SUCCEEDED(hr), "Failed to set cooperative level, hr %#lx.\n", hr); memset(&surface_desc, 0, sizeof(surface_desc)); surface_desc.dwSize = sizeof(surface_desc); @@ -495,18 +493,18 @@ static IDirect3DDevice2 *create_device_ex(IDirectDraw2 *ddraw, HWND window, DWOR surface_desc.dwHeight = 480; hr = IDirectDraw2_CreateSurface(ddraw, &surface_desc, &surface, NULL); - ok(SUCCEEDED(hr), "Failed to create surface, hr %#x.\n", hr); + ok(SUCCEEDED(hr), "Failed to create surface, hr %#lx.\n", hr); if (coop_level & DDSCL_NORMAL) { IDirectDrawClipper *clipper; hr = IDirectDraw2_CreateClipper(ddraw, 0, &clipper, NULL); - ok(SUCCEEDED(hr), "Failed to create clipper, hr %#x.\n", hr); + ok(SUCCEEDED(hr), "Failed to create clipper, hr %#lx.\n", hr); hr = IDirectDrawClipper_SetHWnd(clipper, 0, window); - ok(SUCCEEDED(hr), "Failed to set clipper window, hr %#x.\n", hr); + ok(SUCCEEDED(hr), "Failed to set clipper window, hr %#lx.\n", hr); hr = IDirectDrawSurface_SetClipper(surface, clipper); - ok(SUCCEEDED(hr), "Failed to set surface clipper, hr %#x.\n", hr); + ok(SUCCEEDED(hr), "Failed to set surface clipper, hr %#lx.\n", hr); IDirectDrawClipper_Release(clipper); } @@ -535,7 +533,7 @@ static IDirect3DDevice2 *create_device_ex(IDirectDraw2 *ddraw, HWND window, DWOR continue; hr = IDirectDrawSurface_AddAttachedSurface(surface, ds); - ok(SUCCEEDED(hr), "Failed to attach depth buffer, hr %#x.\n", hr); + ok(SUCCEEDED(hr), "Failed to attach depth buffer, hr %#lx.\n", hr); IDirectDrawSurface_Release(ds); if (FAILED(hr)) continue; @@ -564,11 +562,11 @@ static IDirect3DViewport2 *create_viewport(IDirect3DDevice2 *device, UINT x, UIN HRESULT hr; hr = IDirect3DDevice2_GetDirect3D(device, &d3d); - ok(SUCCEEDED(hr), "Failed to get d3d interface, hr %#x.\n", hr); + ok(SUCCEEDED(hr), "Failed to get d3d interface, hr %#lx.\n", hr); hr = IDirect3D2_CreateViewport(d3d, &viewport, NULL); - ok(SUCCEEDED(hr), "Failed to create viewport, hr %#x.\n", hr); + ok(SUCCEEDED(hr), "Failed to create viewport, hr %#lx.\n", hr); hr = IDirect3DDevice2_AddViewport(device, viewport); - ok(SUCCEEDED(hr), "Failed to add viewport, hr %#x.\n", hr); + ok(SUCCEEDED(hr), "Failed to add viewport, hr %#lx.\n", hr); memset(&vp, 0, sizeof(vp)); vp.dwSize = sizeof(vp); vp.dwX = x; @@ -582,7 +580,7 @@ static IDirect3DViewport2 *create_viewport(IDirect3DDevice2 *device, UINT x, UIN vp.dvMinZ = 0.0f; vp.dvMaxZ = 1.0f; hr = IDirect3DViewport2_SetViewport2(viewport, &vp); - ok(SUCCEEDED(hr), "Failed to set viewport data, hr %#x.\n", hr); + ok(SUCCEEDED(hr), "Failed to set viewport data, hr %#lx.\n", hr); IDirect3D2_Release(d3d); return viewport; @@ -595,9 +593,9 @@ static void viewport_set_background(IDirect3DDevice2 *device, IDirect3DViewport2 HRESULT hr; hr = IDirect3DMaterial2_GetHandle(material, device, &material_handle); - ok(SUCCEEDED(hr), "Failed to get material handle, hr %#x.\n", hr); + ok(SUCCEEDED(hr), "Failed to get material handle, hr %#lx.\n", hr); hr = IDirect3DViewport2_SetBackground(viewport, material_handle); - ok(SUCCEEDED(hr), "Failed to set viewport background, hr %#x.\n", hr); + ok(SUCCEEDED(hr), "Failed to set viewport background, hr %#lx.\n", hr); } static void destroy_viewport(IDirect3DDevice2 *device, IDirect3DViewport2 *viewport) @@ -605,7 +603,7 @@ static void destroy_viewport(IDirect3DDevice2 *device, IDirect3DViewport2 *viewp HRESULT hr; hr = IDirect3DDevice2_DeleteViewport(device, viewport); - ok(SUCCEEDED(hr), "Failed to delete viewport, hr %#x.\n", hr); + ok(SUCCEEDED(hr), "Failed to delete viewport, hr %#lx.\n", hr); IDirect3DViewport2_Release(viewport); } @@ -616,11 +614,11 @@ static IDirect3DMaterial2 *create_material(IDirect3DDevice2 *device, D3DMATERIAL HRESULT hr; hr = IDirect3DDevice2_GetDirect3D(device, &d3d); - ok(SUCCEEDED(hr), "Failed to get d3d interface, hr %#x.\n", hr); + ok(SUCCEEDED(hr), "Failed to get d3d interface, hr %#lx.\n", hr); hr = IDirect3D2_CreateMaterial(d3d, &material, NULL); - ok(SUCCEEDED(hr), "Failed to create material, hr %#x.\n", hr); + ok(SUCCEEDED(hr), "Failed to create material, hr %#lx.\n", hr); hr = IDirect3DMaterial2_SetMaterial(material, mat); - ok(SUCCEEDED(hr), "Failed to set material data, hr %#x.\n", hr); + ok(SUCCEEDED(hr), "Failed to set material data, hr %#lx.\n", hr); IDirect3D2_Release(d3d); return material; @@ -710,7 +708,7 @@ static LRESULT CALLBACK test_proc(HWND hwnd, UINT message, WPARAM wparam, LPARAM { if (expect_messages->check_wparam) ok (wparam == expect_messages->expect_wparam, - "Got unexpected wparam %lx for message %x, expected %lx.\n", + "Got unexpected wparam %#Ix for message %#x, expected %#Ix.\n", wparam, message, expect_messages->expect_wparam); ++expect_messages; @@ -732,9 +730,9 @@ static void fix_wndproc(HWND window, LONG_PTR proc) SetWindowLongPtrA(window, GWLP_WNDPROC, proc); hr = IDirectDraw2_SetCooperativeLevel(ddraw, window, DDSCL_EXCLUSIVE | DDSCL_FULLSCREEN); - ok(SUCCEEDED(hr), "SetCooperativeLevel failed, hr %#x.\n", hr); + ok(SUCCEEDED(hr), "SetCooperativeLevel failed, hr %#lx.\n", hr); hr = IDirectDraw2_SetCooperativeLevel(ddraw, window, DDSCL_NORMAL); - ok(SUCCEEDED(hr), "SetCooperativeLevel failed, hr %#x.\n", hr); + ok(SUCCEEDED(hr), "SetCooperativeLevel failed, hr %#lx.\n", hr); IDirectDraw2_Release(ddraw); } @@ -742,7 +740,7 @@ static void fix_wndproc(HWND window, LONG_PTR proc) static HRESULT CALLBACK restore_callback(IDirectDrawSurface *surface, DDSURFACEDESC *desc, void *context) { HRESULT hr = IDirectDrawSurface_Restore(surface); - ok(SUCCEEDED(hr) || hr == DDERR_IMPLICITLYCREATED, "Failed to restore surface, hr %#x.\n", hr); + ok(SUCCEEDED(hr) || hr == DDERR_IMPLICITLYCREATED, "Failed to restore surface, hr %#lx.\n", hr); IDirectDrawSurface_Release(surface); return DDENUMRET_OK; @@ -765,23 +763,23 @@ static void test_coop_level_create_device_window(void) ok(!!ddraw, "Failed to create a ddraw object.\n"); hr = IDirectDraw2_SetCooperativeLevel(ddraw, NULL, DDSCL_NORMAL); - ok(hr == DD_OK, "Got unexpected hr %#x.\n", hr); + ok(hr == DD_OK, "Got unexpected hr %#lx.\n", hr); device_window = FindWindowA("DirectDrawDeviceWnd", "DirectDrawDeviceWnd"); ok(!device_window, "Unexpected device window found.\n"); hr = IDirectDraw2_SetCooperativeLevel(ddraw, NULL, DDSCL_CREATEDEVICEWINDOW); - ok(hr == DDERR_INVALIDPARAMS, "Got unexpected hr %#x.\n", hr); + ok(hr == DDERR_INVALIDPARAMS, "Got unexpected hr %#lx.\n", hr); device_window = FindWindowA("DirectDrawDeviceWnd", "DirectDrawDeviceWnd"); ok(!device_window, "Unexpected device window found.\n"); hr = IDirectDraw2_SetCooperativeLevel(ddraw, NULL, DDSCL_CREATEDEVICEWINDOW | DDSCL_NORMAL); - ok(hr == DDERR_INVALIDPARAMS, "Got unexpected hr %#x.\n", hr); + ok(hr == DDERR_INVALIDPARAMS, "Got unexpected hr %#lx.\n", hr); device_window = FindWindowA("DirectDrawDeviceWnd", "DirectDrawDeviceWnd"); ok(!device_window, "Unexpected device window found.\n"); hr = IDirectDraw2_SetCooperativeLevel(ddraw, NULL, DDSCL_CREATEDEVICEWINDOW | DDSCL_NORMAL | DDSCL_FULLSCREEN); - ok(hr == DDERR_INVALIDPARAMS, "Got unexpected hr %#x.\n", hr); + ok(hr == DDERR_INVALIDPARAMS, "Got unexpected hr %#lx.\n", hr); device_window = FindWindowA("DirectDrawDeviceWnd", "DirectDrawDeviceWnd"); ok(!device_window, "Unexpected device window found.\n"); hr = IDirectDraw2_SetCooperativeLevel(ddraw, NULL, DDSCL_CREATEDEVICEWINDOW | DDSCL_EXCLUSIVE | DDSCL_FULLSCREEN); - ok(hr == DDERR_NOFOCUSWINDOW || broken(hr == DDERR_INVALIDPARAMS), "Got unexpected hr %#x.\n", hr); + ok(hr == DDERR_NOFOCUSWINDOW || broken(hr == DDERR_INVALIDPARAMS), "Got unexpected hr %#lx.\n", hr); device_window = FindWindowA("DirectDrawDeviceWnd", "DirectDrawDeviceWnd"); ok(!device_window, "Unexpected device window found.\n"); @@ -795,48 +793,48 @@ static void test_coop_level_create_device_window(void) } hr = IDirectDraw2_SetCooperativeLevel(ddraw, NULL, DDSCL_NORMAL); - ok(hr == DD_OK, "Got unexpected hr %#x.\n", hr); + ok(hr == DD_OK, "Got unexpected hr %#lx.\n", hr); device_window = FindWindowA("DirectDrawDeviceWnd", "DirectDrawDeviceWnd"); ok(!device_window, "Unexpected device window found.\n"); hr = IDirectDraw2_SetCooperativeLevel(ddraw, focus_window, DDSCL_EXCLUSIVE | DDSCL_FULLSCREEN); - ok(hr == DD_OK, "Got unexpected hr %#x.\n", hr); + ok(hr == DD_OK, "Got unexpected hr %#lx.\n", hr); device_window = FindWindowA("DirectDrawDeviceWnd", "DirectDrawDeviceWnd"); ok(!device_window, "Unexpected device window found.\n"); hr = IDirectDraw2_SetCooperativeLevel(ddraw, NULL, DDSCL_NORMAL); - ok(hr == DD_OK, "Got unexpected hr %#x.\n", hr); + ok(hr == DD_OK, "Got unexpected hr %#lx.\n", hr); device_window = FindWindowA("DirectDrawDeviceWnd", "DirectDrawDeviceWnd"); ok(!device_window, "Unexpected device window found.\n"); hr = IDirectDraw2_SetCooperativeLevel(ddraw, NULL, DDSCL_SETFOCUSWINDOW | DDSCL_CREATEDEVICEWINDOW | DDSCL_EXCLUSIVE | DDSCL_FULLSCREEN); - ok(hr == DDERR_NOHWND, "Got unexpected hr %#x.\n", hr); + ok(hr == DDERR_NOHWND, "Got unexpected hr %#lx.\n", hr); device_window = FindWindowA("DirectDrawDeviceWnd", "DirectDrawDeviceWnd"); ok(!!device_window, "Device window not found.\n"); hr = IDirectDraw2_SetCooperativeLevel(ddraw, NULL, DDSCL_NORMAL); - ok(hr == DD_OK, "Got unexpected hr %#x.\n", hr); + ok(hr == DD_OK, "Got unexpected hr %#lx.\n", hr); device_window = FindWindowA("DirectDrawDeviceWnd", "DirectDrawDeviceWnd"); ok(!device_window, "Unexpected device window found.\n"); hr = IDirectDraw2_SetCooperativeLevel(ddraw, focus_window, DDSCL_SETFOCUSWINDOW | DDSCL_CREATEDEVICEWINDOW | DDSCL_EXCLUSIVE | DDSCL_FULLSCREEN); - ok(hr == DD_OK, "Got unexpected hr %#x.\n", hr); + ok(hr == DD_OK, "Got unexpected hr %#lx.\n", hr); device_window = FindWindowA("DirectDrawDeviceWnd", "DirectDrawDeviceWnd"); ok(!!device_window, "Device window not found.\n"); hr = IDirectDraw2_SetCooperativeLevel(ddraw, NULL, DDSCL_NORMAL); - ok(hr == DD_OK, "Got unexpected hr %#x.\n", hr); + ok(hr == DD_OK, "Got unexpected hr %#lx.\n", hr); device_window = FindWindowA("DirectDrawDeviceWnd", "DirectDrawDeviceWnd"); ok(!device_window, "Unexpected device window found.\n"); hr = IDirectDraw2_SetCooperativeLevel(ddraw, NULL, DDSCL_CREATEDEVICEWINDOW | DDSCL_EXCLUSIVE | DDSCL_FULLSCREEN); - ok(hr == DDERR_NOFOCUSWINDOW, "Got unexpected hr %#x.\n", hr); + ok(hr == DDERR_NOFOCUSWINDOW, "Got unexpected hr %#lx.\n", hr); device_window = FindWindowA("DirectDrawDeviceWnd", "DirectDrawDeviceWnd"); ok(!device_window, "Unexpected device window found.\n"); hr = IDirectDraw2_SetCooperativeLevel(ddraw, focus_window, DDSCL_SETFOCUSWINDOW); - ok(hr == DD_OK, "Got unexpected hr %#x.\n", hr); + ok(hr == DD_OK, "Got unexpected hr %#lx.\n", hr); device_window = FindWindowA("DirectDrawDeviceWnd", "DirectDrawDeviceWnd"); ok(!device_window, "Unexpected device window found.\n"); hr = IDirectDraw2_SetCooperativeLevel(ddraw, NULL, DDSCL_CREATEDEVICEWINDOW | DDSCL_EXCLUSIVE | DDSCL_FULLSCREEN); - ok(hr == DD_OK, "Got unexpected hr %#x.\n", hr); + ok(hr == DD_OK, "Got unexpected hr %#lx.\n", hr); device_window = FindWindowA("DirectDrawDeviceWnd", "DirectDrawDeviceWnd"); ok(!!device_window, "Device window not found.\n"); @@ -847,13 +845,12 @@ static void test_coop_level_create_device_window(void) static void test_clipper_blt(void) { IDirectDrawSurface *src_surface, *dst_surface; + unsigned int color, i, j, x, y; RECT client_rect, src_rect; IDirectDrawClipper *clipper; DDSURFACEDESC surface_desc; - unsigned int i, j, x, y; IDirectDraw2 *ddraw; RGNDATA *rgn_data; - D3DCOLOR color; ULONG refcount; HRGN r1, r2; HWND window; @@ -868,7 +865,7 @@ static void test_clipper_blt(void) 0xff0000ff, 0xff0000ff, 0xff00ff00, 0xffff0000, 0xffffffff, 0xffffffff, 0xff0000ff, 0xff0000ff, 0xff00ff00, 0xffff0000, 0xffffffff, 0xffffffff, }; - static const D3DCOLOR expected1[] = + static const unsigned int expected1[] = { 0x000000ff, 0x0000ff00, 0x00000000, 0x00000000, 0x000000ff, 0x0000ff00, 0x00000000, 0x00000000, @@ -890,7 +887,7 @@ static void test_clipper_blt(void) 0x00000000, 0x00000000, 0x00ff0000, 0x00ff0000, 0x00000000, 0x00000000, 0x0000ff00, 0x00ff0000, }; - static const D3DCOLOR expected2[] = + static const unsigned int expected2[] = { 0x000000ff, 0x000000ff, 0x00000000, 0x00000000, 0x000000ff, 0x000000ff, 0x00000000, 0x00000000, @@ -910,22 +907,22 @@ static void test_clipper_blt(void) ok(ret, "Failed to map client rect.\n"); hr = IDirectDraw2_SetCooperativeLevel(ddraw, window, DDSCL_NORMAL); - ok(SUCCEEDED(hr), "Failed to set cooperative level, hr %#x.\n", hr); + ok(SUCCEEDED(hr), "Failed to set cooperative level, hr %#lx.\n", hr); hr = IDirectDraw2_CreateClipper(ddraw, 0, &clipper, NULL); - ok(SUCCEEDED(hr), "Failed to create clipper, hr %#x.\n", hr); + ok(SUCCEEDED(hr), "Failed to create clipper, hr %#lx.\n", hr); hr = IDirectDrawClipper_GetClipList(clipper, NULL, NULL, &ret); - ok(hr == DDERR_NOCLIPLIST, "Got unexpected hr %#x.\n", hr); + ok(hr == DDERR_NOCLIPLIST, "Got unexpected hr %#lx.\n", hr); hr = IDirectDrawClipper_SetHWnd(clipper, 0, window); - ok(SUCCEEDED(hr), "Failed to set clipper window, hr %#x.\n", hr); + ok(SUCCEEDED(hr), "Failed to set clipper window, hr %#lx.\n", hr); hr = IDirectDrawClipper_GetClipList(clipper, NULL, NULL, &ret); - ok(SUCCEEDED(hr), "Failed to get clip list size, hr %#x.\n", hr); + ok(SUCCEEDED(hr), "Failed to get clip list size, hr %#lx.\n", hr); rgn_data = HeapAlloc(GetProcessHeap(), 0, ret); hr = IDirectDrawClipper_GetClipList(clipper, NULL, rgn_data, &ret); - ok(SUCCEEDED(hr), "Failed to get clip list, hr %#x.\n", hr); - ok(rgn_data->rdh.dwSize == sizeof(rgn_data->rdh), "Got unexpected structure size %#x.\n", rgn_data->rdh.dwSize); - ok(rgn_data->rdh.iType == RDH_RECTANGLES, "Got unexpected type %#x.\n", rgn_data->rdh.iType); - ok(rgn_data->rdh.nCount >= 1, "Got unexpected count %u.\n", rgn_data->rdh.nCount); + ok(SUCCEEDED(hr), "Failed to get clip list, hr %#lx.\n", hr); + ok(rgn_data->rdh.dwSize == sizeof(rgn_data->rdh), "Got unexpected structure size %#lx.\n", rgn_data->rdh.dwSize); + ok(rgn_data->rdh.iType == RDH_RECTANGLES, "Got unexpected type %#lx.\n", rgn_data->rdh.iType); + ok(rgn_data->rdh.nCount >= 1, "Got unexpected count %lu.\n", rgn_data->rdh.nCount); ok(EqualRect(&rgn_data->rdh.rcBound, &client_rect), "Got unexpected bounding rect %s, expected %s.\n", wine_dbgstr_rect(&rgn_data->rdh.rcBound), wine_dbgstr_rect(&client_rect)); @@ -945,11 +942,11 @@ static void test_clipper_blt(void) DeleteObject(r1); hr = IDirectDrawClipper_SetClipList(clipper, rgn_data, 0); - ok(hr == DDERR_CLIPPERISUSINGHWND, "Got unexpected hr %#x.\n", hr); + ok(hr == DDERR_CLIPPERISUSINGHWND, "Got unexpected hr %#lx.\n", hr); hr = IDirectDrawClipper_SetHWnd(clipper, 0, NULL); - ok(SUCCEEDED(hr), "Failed to set clipper window, hr %#x.\n", hr); + ok(SUCCEEDED(hr), "Failed to set clipper window, hr %#lx.\n", hr); hr = IDirectDrawClipper_SetClipList(clipper, rgn_data, 0); - ok(SUCCEEDED(hr), "Failed to set clip list, hr %#x.\n", hr); + ok(SUCCEEDED(hr), "Failed to set clip list, hr %#lx.\n", hr); HeapFree(GetProcessHeap(), 0, rgn_data); @@ -967,33 +964,33 @@ static void test_clipper_blt(void) U4(surface_desc.ddpfPixelFormat).dwBBitMask = 0x000000ff; hr = IDirectDraw2_CreateSurface(ddraw, &surface_desc, &src_surface, NULL); - ok(SUCCEEDED(hr), "Failed to create source surface, hr %#x.\n", hr); + ok(SUCCEEDED(hr), "Failed to create source surface, hr %#lx.\n", hr); hr = IDirectDraw2_CreateSurface(ddraw, &surface_desc, &dst_surface, NULL); - ok(SUCCEEDED(hr), "Failed to create destination surface, hr %#x.\n", hr); + ok(SUCCEEDED(hr), "Failed to create destination surface, hr %#lx.\n", hr); memset(&fx, 0, sizeof(fx)); fx.dwSize = sizeof(fx); hr = IDirectDrawSurface_Blt(src_surface, NULL, NULL, NULL, DDBLT_COLORFILL | DDBLT_WAIT, &fx); - ok(SUCCEEDED(hr), "Failed to clear source surface, hr %#x.\n", hr); + ok(SUCCEEDED(hr), "Failed to clear source surface, hr %#lx.\n", hr); hr = IDirectDrawSurface_Blt(dst_surface, NULL, NULL, NULL, DDBLT_COLORFILL | DDBLT_WAIT, &fx); - ok(SUCCEEDED(hr), "Failed to clear destination surface, hr %#x.\n", hr); + ok(SUCCEEDED(hr), "Failed to clear destination surface, hr %#lx.\n", hr); hr = IDirectDrawSurface_Lock(src_surface, NULL, &surface_desc, DDLOCK_WAIT, NULL); - ok(SUCCEEDED(hr), "Failed to lock source surface, hr %#x.\n", hr); - ok(U1(surface_desc).lPitch == 2560, "Got unexpected surface pitch %u.\n", U1(surface_desc).lPitch); + ok(SUCCEEDED(hr), "Failed to lock source surface, hr %#lx.\n", hr); + ok(U1(surface_desc).lPitch == 2560, "Got unexpected surface pitch %lu.\n", U1(surface_desc).lPitch); ptr = surface_desc.lpSurface; memcpy(&ptr[ 0], &src_data[ 0], 6 * sizeof(DWORD)); memcpy(&ptr[ 640], &src_data[ 6], 6 * sizeof(DWORD)); memcpy(&ptr[1280], &src_data[12], 6 * sizeof(DWORD)); hr = IDirectDrawSurface_Unlock(src_surface, NULL); - ok(SUCCEEDED(hr), "Failed to unlock source surface, hr %#x.\n", hr); + ok(SUCCEEDED(hr), "Failed to unlock source surface, hr %#lx.\n", hr); hr = IDirectDrawSurface_SetClipper(dst_surface, clipper); - ok(SUCCEEDED(hr), "Failed to set clipper, hr %#x.\n", hr); + ok(SUCCEEDED(hr), "Failed to set clipper, hr %#lx.\n", hr); SetRect(&src_rect, 1, 1, 5, 2); hr = IDirectDrawSurface_Blt(dst_surface, NULL, src_surface, &src_rect, DDBLT_WAIT, NULL); - ok(SUCCEEDED(hr), "Failed to blit, hr %#x.\n", hr); + ok(SUCCEEDED(hr), "Failed to blit, hr %#lx.\n", hr); for (i = 0; i < 4; ++i) { for (j = 0; j < 4; ++j) @@ -1009,7 +1006,7 @@ static void test_clipper_blt(void) U5(fx).dwFillColor = 0xff0000ff; hr = IDirectDrawSurface_Blt(dst_surface, NULL, NULL, NULL, DDBLT_COLORFILL | DDBLT_WAIT, &fx); - ok(SUCCEEDED(hr), "Failed to clear destination surface, hr %#x.\n", hr); + ok(SUCCEEDED(hr), "Failed to clear destination surface, hr %#lx.\n", hr); for (i = 0; i < 4; ++i) { for (j = 0; j < 4; ++j) @@ -1023,30 +1020,30 @@ static void test_clipper_blt(void) } hr = IDirectDrawSurface_BltFast(dst_surface, 0, 0, src_surface, NULL, DDBLTFAST_WAIT); - ok(hr == DDERR_BLTFASTCANTCLIP || broken(hr == E_NOTIMPL /* NT4 */), "Got unexpected hr %#x.\n", hr); + ok(hr == DDERR_BLTFASTCANTCLIP || broken(hr == E_NOTIMPL /* NT4 */), "Got unexpected hr %#lx.\n", hr); hr = IDirectDrawClipper_SetHWnd(clipper, 0, window); - ok(SUCCEEDED(hr), "Failed to set clipper window, hr %#x.\n", hr); + ok(SUCCEEDED(hr), "Failed to set clipper window, hr %#lx.\n", hr); hr = IDirectDrawClipper_GetClipList(clipper, NULL, NULL, &ret); - ok(SUCCEEDED(hr), "Failed to get clip list size, hr %#x.\n", hr); + ok(SUCCEEDED(hr), "Failed to get clip list size, hr %#lx.\n", hr); DestroyWindow(window); hr = IDirectDrawClipper_GetClipList(clipper, NULL, NULL, &ret); - ok(hr == E_FAIL, "Got unexpected hr %#x.\n", hr); + ok(hr == E_FAIL, "Got unexpected hr %#lx.\n", hr); hr = IDirectDrawClipper_SetHWnd(clipper, 0, NULL); - ok(SUCCEEDED(hr), "Failed to set clipper window, hr %#x.\n", hr); + ok(SUCCEEDED(hr), "Failed to set clipper window, hr %#lx.\n", hr); hr = IDirectDrawClipper_GetClipList(clipper, NULL, NULL, &ret); - ok(SUCCEEDED(hr), "Failed to get clip list size, hr %#x.\n", hr); + ok(SUCCEEDED(hr), "Failed to get clip list size, hr %#lx.\n", hr); hr = IDirectDrawClipper_SetClipList(clipper, NULL, 0); - ok(SUCCEEDED(hr), "Failed to set clip list, hr %#x.\n", hr); + ok(SUCCEEDED(hr), "Failed to set clip list, hr %#lx.\n", hr); hr = IDirectDrawClipper_GetClipList(clipper, NULL, NULL, &ret); - ok(hr == DDERR_NOCLIPLIST, "Got unexpected hr %#x.\n", hr); + ok(hr == DDERR_NOCLIPLIST, "Got unexpected hr %#lx.\n", hr); hr = IDirectDrawSurface_Blt(dst_surface, NULL, NULL, NULL, DDBLT_COLORFILL | DDBLT_WAIT, &fx); - ok(hr == DDERR_NOCLIPLIST, "Got unexpected hr %#x.\n", hr); + ok(hr == DDERR_NOCLIPLIST, "Got unexpected hr %#lx.\n", hr); IDirectDrawSurface_Release(dst_surface); IDirectDrawSurface_Release(src_surface); refcount = IDirectDrawClipper_Release(clipper); - ok(!refcount, "Clipper has %u references left.\n", refcount); + ok(!refcount, "Clipper has %lu references left.\n", refcount); IDirectDraw2_Release(ddraw); } @@ -1060,7 +1057,7 @@ static void test_coop_level_d3d_state(void) D3DMATERIAL material; IDirectDraw2 *ddraw; DDSURFACEDESC lock; - D3DCOLOR color; + unsigned int color; DWORD value; HWND window; HRESULT hr; @@ -1100,44 +1097,44 @@ static void test_coop_level_d3d_state(void) viewport_set_background(device, viewport, background); hr = IDirect3DDevice2_SetRenderState(device, D3DRENDERSTATE_SRCBLEND, D3DBLEND_SRCALPHA); - ok(hr == DD_OK, "Got unexpected hr %#x.\n", hr); + ok(hr == DD_OK, "Got unexpected hr %#lx.\n", hr); hr = IDirect3DDevice2_SetRenderState(device, D3DRENDERSTATE_DESTBLEND, D3DBLEND_DESTALPHA); - ok(hr == DD_OK, "Got unexpected hr %#x.\n", hr); + ok(hr == DD_OK, "Got unexpected hr %#lx.\n", hr); hr = IDirect3DDevice2_GetRenderTarget(device, &rt); - ok(hr == DD_OK, "Got unexpected hr %#x.\n", hr); + ok(hr == DD_OK, "Got unexpected hr %#lx.\n", hr); hr = IDirect3DDevice2_GetRenderState(device, D3DRENDERSTATE_ZENABLE, &value); - ok(hr == DD_OK, "Got unexpected hr %#x.\n", hr); - ok(!!value, "Got unexpected z-enable state %#x.\n", value); + ok(hr == DD_OK, "Got unexpected hr %#lx.\n", hr); + ok(!!value, "Got unexpected z-enable state %#lx.\n", value); hr = IDirect3DDevice2_GetRenderState(device, D3DRENDERSTATE_ALPHABLENDENABLE, &value); - ok(hr == DD_OK, "Got unexpected hr %#x.\n", hr); - ok(!value, "Got unexpected alpha blend enable state %#x.\n", value); + ok(hr == DD_OK, "Got unexpected hr %#lx.\n", hr); + ok(!value, "Got unexpected alpha blend enable state %#lx.\n", value); hr = IDirect3DDevice2_SetRenderState(device, D3DRENDERSTATE_ALPHABLENDENABLE, TRUE); - ok(hr == DD_OK, "Got unexpected hr %#x.\n", hr); + ok(hr == DD_OK, "Got unexpected hr %#lx.\n", hr); hr = IDirect3DViewport2_Clear(viewport, 1, &clear_rect, D3DCLEAR_TARGET); - ok(hr == DD_OK, "Got unexpected hr %#x.\n", hr); + ok(hr == DD_OK, "Got unexpected hr %#lx.\n", hr); color = get_surface_color(rt, 320, 240); ok(compare_color(color, 0x00ff0000, 1), "Got unexpected color 0x%08x.\n", color); hr = IDirectDraw2_SetCooperativeLevel(ddraw, window, DDSCL_EXCLUSIVE | DDSCL_FULLSCREEN); - ok(hr == DD_OK, "Got unexpected hr %#x.\n", hr); + ok(hr == DD_OK, "Got unexpected hr %#lx.\n", hr); hr = IDirectDrawSurface_IsLost(rt); - ok(hr == DDERR_SURFACELOST, "Got unexpected hr %#x.\n", hr); + ok(hr == DDERR_SURFACELOST, "Got unexpected hr %#lx.\n", hr); memset(&lock, 0, sizeof(lock)); lock.dwSize = sizeof(lock); lock.lpSurface = (void *)0xdeadbeef; hr = IDirectDrawSurface2_Lock(rt, NULL, &lock, DDLOCK_READONLY, NULL); - ok(hr == DDERR_SURFACELOST, "Got unexpected hr %#x.\n", hr); + ok(hr == DDERR_SURFACELOST, "Got unexpected hr %#lx.\n", hr); ok(lock.lpSurface == (void *)0xdeadbeef, "Got unexpected lock.lpSurface %p.\n", lock.lpSurface); hr = restore_surfaces(ddraw); - ok(hr == DD_OK, "Got unexpected hr %#x.\n", hr); + ok(hr == DD_OK, "Got unexpected hr %#lx.\n", hr); hr = IDirectDrawSurface2_Lock(rt, NULL, &lock, DDLOCK_READONLY, NULL); - ok(hr == DD_OK, "Got unexpected hr %#x.\n", hr); + ok(hr == DD_OK, "Got unexpected hr %#lx.\n", hr); hr = IDirectDrawSurface2_Unlock(rt, NULL); - ok(hr == DD_OK, "Got unexpected hr %#x.\n", hr); + ok(hr == DD_OK, "Got unexpected hr %#lx.\n", hr); memset(&material, 0, sizeof(material)); material.dwSize = sizeof(material); @@ -1146,31 +1143,31 @@ static void test_coop_level_d3d_state(void) U3(U(material).diffuse).b = 0.0f; U4(U(material).diffuse).a = 1.0f; hr = IDirect3DMaterial2_SetMaterial(background, &material); - ok(hr == DD_OK, "Got unexpected hr %#x.\n", hr); + ok(hr == DD_OK, "Got unexpected hr %#lx.\n", hr); hr = IDirect3DDevice2_GetRenderTarget(device, &surface); - ok(hr == DD_OK, "Got unexpected hr %#x.\n", hr); + ok(hr == DD_OK, "Got unexpected hr %#lx.\n", hr); ok(surface == rt, "Got unexpected surface %p.\n", surface); hr = IDirect3DDevice2_GetRenderState(device, D3DRENDERSTATE_ZENABLE, &value); - ok(hr == DD_OK, "Got unexpected hr %#x.\n", hr); - ok(!!value, "Got unexpected z-enable state %#x.\n", value); + ok(hr == DD_OK, "Got unexpected hr %#lx.\n", hr); + ok(!!value, "Got unexpected z-enable state %#lx.\n", value); hr = IDirect3DDevice2_GetRenderState(device, D3DRENDERSTATE_ALPHABLENDENABLE, &value); - ok(hr == DD_OK, "Got unexpected hr %#x.\n", hr); - ok(!!value, "Got unexpected alpha blend enable state %#x.\n", value); + ok(hr == DD_OK, "Got unexpected hr %#lx.\n", hr); + ok(!!value, "Got unexpected alpha blend enable state %#lx.\n", value); hr = IDirect3DViewport2_Clear(viewport, 1, &clear_rect, D3DCLEAR_TARGET | D3DCLEAR_ZBUFFER); - ok(hr == DD_OK, "Got unexpected hr %#x.\n", hr); + ok(hr == DD_OK, "Got unexpected hr %#lx.\n", hr); color = get_surface_color(rt, 320, 240); ok(compare_color(color, 0x0000ff00, 1) || broken(compare_color(color, 0x00000000, 1)), "Got unexpected color 0x%08x.\n", color); hr = IDirect3DDevice2_SetCurrentViewport(device, viewport); - ok(hr == DD_OK, "Got unexpected hr %#x.\n", hr); + ok(hr == DD_OK, "Got unexpected hr %#lx.\n", hr); hr = IDirect3DDevice2_BeginScene(device); - ok(hr == DD_OK, "Got unexpected hr %#x.\n", hr); + ok(hr == DD_OK, "Got unexpected hr %#lx.\n", hr); hr = IDirect3DDevice2_DrawPrimitive(device, D3DPT_TRIANGLESTRIP, D3DVT_LVERTEX, quad, ARRAY_SIZE(quad), 0); - ok(hr == DD_OK, "Got unexpected hr %#x.\n", hr); + ok(hr == DD_OK, "Got unexpected hr %#lx.\n", hr); hr = IDirect3DDevice2_EndScene(device); - ok(hr == DD_OK, "Got unexpected hr %#x.\n", hr); + ok(hr == DD_OK, "Got unexpected hr %#lx.\n", hr); color = get_surface_color(rt, 320, 240); ok(compare_color(color, 0x0000ff80, 1), "Got unexpected color 0x%08x.\n", color); @@ -1193,10 +1190,10 @@ static void test_surface_interface_mismatch(void) IDirect3DViewport2 *viewport = NULL; IDirect3DMaterial2 *background = NULL; DDSURFACEDESC surface_desc; + unsigned int color; DWORD z_depth = 0; ULONG refcount; HRESULT hr; - D3DCOLOR color; HWND window; D3DRECT clear_rect = {{0}, {0}, {640}, {480}}; @@ -1223,7 +1220,7 @@ static void test_surface_interface_mismatch(void) surface_desc.dwHeight = 480; hr = IDirectDraw2_CreateSurface(ddraw, &surface_desc, &surface, NULL); - ok(SUCCEEDED(hr), "Failed to create surface, hr %#x.\n", hr); + ok(SUCCEEDED(hr), "Failed to create surface, hr %#lx.\n", hr); hr = IDirectDrawSurface2_QueryInterface(surface, &IID_IDirectDrawSurface3, (void **)&surface3); if (FAILED(hr)) @@ -1246,15 +1243,15 @@ static void test_surface_interface_mismatch(void) surface_desc.dwWidth = 640; surface_desc.dwHeight = 480; hr = IDirectDraw2_CreateSurface(ddraw, &surface_desc, &ds, NULL); - ok(SUCCEEDED(hr), "Failed to create depth buffer, hr %#x.\n", hr); + ok(SUCCEEDED(hr), "Failed to create depth buffer, hr %#lx.\n", hr); if (FAILED(hr)) goto cleanup; /* Using a different surface interface version still works */ hr = IDirectDrawSurface3_AddAttachedSurface(surface3, (IDirectDrawSurface3 *)ds); - ok(SUCCEEDED(hr), "Failed to attach depth buffer, hr %#x.\n", hr); + ok(SUCCEEDED(hr), "Failed to attach depth buffer, hr %#lx.\n", hr); refcount = IDirectDrawSurface_Release(ds); - ok(refcount == 1, "Got unexpected refcount %u.\n", refcount); + ok(refcount == 1, "Got unexpected refcount %lu.\n", refcount); if (FAILED(hr)) goto cleanup; @@ -1269,7 +1266,7 @@ static void test_surface_interface_mismatch(void) viewport_set_background(device, viewport, background); hr = IDirect3DViewport2_Clear(viewport, 1, &clear_rect, D3DCLEAR_TARGET); - ok(SUCCEEDED(hr), "Failed to clear render target, hr %#x.\n", hr); + ok(SUCCEEDED(hr), "Failed to clear render target, hr %#lx.\n", hr); color = get_surface_color(surface, 320, 240); ok(compare_color(color, 0x00ff0000, 1), "Got unexpected color 0x%08x.\n", color); @@ -1297,7 +1294,7 @@ static void test_coop_level_threaded(void) create_window_thread(&p); hr = IDirectDraw2_SetCooperativeLevel(ddraw, p.window, DDSCL_EXCLUSIVE | DDSCL_FULLSCREEN); - ok(SUCCEEDED(hr), "Failed to set cooperative level, hr %#x.\n", hr); + ok(SUCCEEDED(hr), "Failed to set cooperative level, hr %#lx.\n", hr); destroy_window_thread(&p); IDirectDraw2_Release(ddraw); @@ -1312,7 +1309,7 @@ static void test_depth_blit(const GUID *device_guid) {{-1.0}, {-1.0}, {0.50f}, 0, {0xff00ff00}}, {{ 1.0}, {-1.0}, {0.50f}, 0, {0xff00ff00}}, }; - static const D3DCOLOR expected_colors[4][4] = + static const unsigned int expected_colors[4][4] = { {0x00ff0000, 0x00ff0000, 0x0000ff00, 0x0000ff00}, {0x00ff0000, 0x00ff0000, 0x0000ff00, 0x0000ff00}, @@ -1326,8 +1323,7 @@ static void test_depth_blit(const GUID *device_guid) BOOL depth_fill_broken = FALSE; IDirect3DViewport2 *viewport; RECT src_rect, dst_rect; - unsigned int i, j; - D3DCOLOR color; + unsigned int color, i, j; HRESULT hr; IDirectDraw2 *ddraw; DDBLTFX fx; @@ -1353,7 +1349,7 @@ static void test_depth_blit(const GUID *device_guid) memset(&ddsd_existing, 0, sizeof(ddsd_existing)); ddsd_existing.dwSize = sizeof(ddsd_existing); hr = IDirectDrawSurface_GetSurfaceDesc(ds1, &ddsd_existing); - ok(hr == D3D_OK, "Got unexpected hr %#x.\n", hr); + ok(hr == D3D_OK, "Got unexpected hr %#lx.\n", hr); ddsd_new.dwFlags = DDSD_CAPS | DDSD_WIDTH | DDSD_HEIGHT | DDSD_PIXELFORMAT; ddsd_new.ddsCaps.dwCaps = DDSCAPS_ZBUFFER; if (is_software_device_type(device_guid)) @@ -1362,71 +1358,71 @@ static void test_depth_blit(const GUID *device_guid) ddsd_new.dwHeight = ddsd_existing.dwHeight; ddsd_new.ddpfPixelFormat = ddsd_existing.ddpfPixelFormat; hr = IDirectDraw2_CreateSurface(ddraw, &ddsd_new, &ds2, NULL); - ok(SUCCEEDED(hr), "Failed to create a surface, hr %#x.\n", hr); + ok(SUCCEEDED(hr), "Failed to create a surface, hr %#lx.\n", hr); hr = IDirectDraw2_CreateSurface(ddraw, &ddsd_new, &ds3, NULL); - ok(SUCCEEDED(hr), "Failed to create a surface, hr %#x.\n", hr); + ok(SUCCEEDED(hr), "Failed to create a surface, hr %#lx.\n", hr); background = create_diffuse_material(device, 1.0f, 0.0f, 0.0f, 1.0f); viewport = create_viewport(device, 0, 0, ddsd_existing.dwWidth, ddsd_existing.dwHeight); viewport_set_background(device, viewport, background); hr = IDirect3DDevice2_SetCurrentViewport(device, viewport); - ok(SUCCEEDED(hr), "Failed to activate the viewport, hr %#x.\n", hr); + ok(SUCCEEDED(hr), "Failed to activate the viewport, hr %#lx.\n", hr); hr = IDirect3DDevice2_SetRenderState(device, D3DRENDERSTATE_ZENABLE, D3DZB_TRUE); - ok(SUCCEEDED(hr), "Failed to enable z testing, hr %#x.\n", hr); + ok(SUCCEEDED(hr), "Failed to enable z testing, hr %#lx.\n", hr); hr = IDirect3DDevice2_SetRenderState(device, D3DRENDERSTATE_ZFUNC, D3DCMP_LESSEQUAL); - ok(SUCCEEDED(hr), "Failed to set the z function, hr %#x.\n", hr); + ok(SUCCEEDED(hr), "Failed to set the z function, hr %#lx.\n", hr); U1(d3drect).x1 = U2(d3drect).y1 = 0; U3(d3drect).x2 = ddsd_existing.dwWidth; U4(d3drect).y2 = ddsd_existing.dwHeight; hr = IDirect3DViewport2_Clear(viewport, 1, &d3drect, D3DCLEAR_ZBUFFER); - ok(SUCCEEDED(hr), "Failed to clear the z buffer, hr %#x.\n", hr); + ok(SUCCEEDED(hr), "Failed to clear the z buffer, hr %#lx.\n", hr); /* Partial blit. */ SetRect(&src_rect, 0, 0, 320, 240); SetRect(&dst_rect, 0, 0, 320, 240); hr = IDirectDrawSurface_Blt(ds2, &dst_rect, ds1, &src_rect, DDBLT_WAIT, NULL); - ok(SUCCEEDED(hr), "Got unexpected hr %#x.\n", hr); + ok(SUCCEEDED(hr), "Got unexpected hr %#lx.\n", hr); /* Different locations. */ SetRect(&src_rect, 0, 0, 320, 240); SetRect(&dst_rect, 320, 240, 640, 480); hr = IDirectDrawSurface_Blt(ds2, &dst_rect, ds1, &src_rect, DDBLT_WAIT, NULL); - ok(SUCCEEDED(hr), "Got unexpected hr %#x.\n", hr); + ok(SUCCEEDED(hr), "Got unexpected hr %#lx.\n", hr); /* Stretched. */ SetRect(&src_rect, 0, 0, 320, 240); SetRect(&dst_rect, 0, 0, 640, 480); hr = IDirectDrawSurface_Blt(ds2, &dst_rect, ds1, &src_rect, DDBLT_WAIT, NULL); - ok(SUCCEEDED(hr), "Got unexpected hr %#x.\n", hr); + ok(SUCCEEDED(hr), "Got unexpected hr %#lx.\n", hr); /* Flipped. */ SetRect(&src_rect, 0, 480, 640, 0); SetRect(&dst_rect, 0, 0, 640, 480); hr = IDirectDrawSurface_Blt(ds2, &dst_rect, ds1, &src_rect, DDBLT_WAIT, NULL); - ok(hr == DDERR_INVALIDRECT, "Got unexpected hr %#x.\n", hr); + ok(hr == DDERR_INVALIDRECT, "Got unexpected hr %#lx.\n", hr); SetRect(&src_rect, 0, 0, 640, 480); SetRect(&dst_rect, 0, 480, 640, 0); hr = IDirectDrawSurface_Blt(ds2, &dst_rect, ds1, &src_rect, DDBLT_WAIT, NULL); - ok(hr == DDERR_INVALIDRECT, "Got unexpected hr %#x.\n", hr); + ok(hr == DDERR_INVALIDRECT, "Got unexpected hr %#lx.\n", hr); /* Full, explicit. */ SetRect(&src_rect, 0, 0, 640, 480); SetRect(&dst_rect, 0, 0, 640, 480); hr = IDirectDrawSurface_Blt(ds2, &dst_rect, ds1, &src_rect, DDBLT_WAIT, NULL); - ok(SUCCEEDED(hr), "Got unexpected hr %#x.\n", hr); + ok(SUCCEEDED(hr), "Got unexpected hr %#lx.\n", hr); /* Depth -> color blit: Succeeds on Win7 + Radeon HD 5700, fails on WinXP + Radeon X1600 */ /* Depth blit inside a BeginScene / EndScene pair */ hr = IDirect3DDevice2_BeginScene(device); - ok(SUCCEEDED(hr), "Failed to start a scene, hr %#x.\n", hr); + ok(SUCCEEDED(hr), "Failed to start a scene, hr %#lx.\n", hr); /* From the current depth stencil */ hr = IDirectDrawSurface_Blt(ds2, NULL, ds1, NULL, DDBLT_WAIT, NULL); - ok(SUCCEEDED(hr), "Got unexpected hr %#x.\n", hr); + ok(SUCCEEDED(hr), "Got unexpected hr %#lx.\n", hr); /* To the current depth stencil */ hr = IDirectDrawSurface_Blt(ds1, NULL, ds2, NULL, DDBLT_WAIT, NULL); - ok(SUCCEEDED(hr), "Got unexpected hr %#x.\n", hr); + ok(SUCCEEDED(hr), "Got unexpected hr %#lx.\n", hr); /* Between unbound surfaces */ hr = IDirectDrawSurface_Blt(ds3, NULL, ds2, NULL, DDBLT_WAIT, NULL); - ok(SUCCEEDED(hr), "Got unexpected hr %#x.\n", hr); + ok(SUCCEEDED(hr), "Got unexpected hr %#lx.\n", hr); hr = IDirect3DDevice2_EndScene(device); - ok(SUCCEEDED(hr), "Failed to end a scene, hr %#x.\n", hr); + ok(SUCCEEDED(hr), "Failed to end a scene, hr %#lx.\n", hr); /* Avoid changing the depth stencil, it doesn't work properly on Windows. * Instead use DDBLT_DEPTHFILL to clear the depth stencil. Unfortunately @@ -1437,16 +1433,16 @@ static void test_depth_blit(const GUID *device_guid) U5(fx).dwFillDepth = 0; hr = IDirectDrawSurface_Blt(ds2, NULL, NULL, NULL, DDBLT_DEPTHFILL | DDBLT_WAIT, &fx); ok(hr == D3D_OK || broken(is_software_device_type(device_guid) - && hr == 0x8876086c /* D3DERR_INVALIDCALL */), "Got unexpected hr %#x.\n", hr); + && hr == 0x8876086c /* D3DERR_INVALIDCALL */), "Got unexpected hr %#lx.\n", hr); if (hr != D3D_OK) depth_fill_broken = TRUE; /* This clears the Z buffer with 1.0 */ hr = IDirect3DViewport2_Clear(viewport, 1, &d3drect, D3DCLEAR_ZBUFFER | D3DCLEAR_TARGET); - ok(hr == D3D_OK, "Got unexpected hr %#x.\n", hr); + ok(hr == D3D_OK, "Got unexpected hr %#lx.\n", hr); hr = IDirect3DDevice2_GetRenderTarget(device, &rt); - ok(hr == D3D_OK, "Got unexpected hr %#x.\n", hr); + ok(hr == D3D_OK, "Got unexpected hr %#lx.\n", hr); color = get_surface_color(rt, 80, 60); /* For some reason clears and colour fill blits randomly fail with software render target. */ @@ -1462,17 +1458,17 @@ static void test_depth_blit(const GUID *device_guid) SetRect(&dst_rect, 0, 0, 320, 240); hr = IDirectDrawSurface_Blt(ds1, &dst_rect, ds2, NULL, DDBLT_WAIT, NULL); - ok(hr == D3D_OK, "Got unexpected hr %#x.\n", hr); + ok(hr == D3D_OK, "Got unexpected hr %#lx.\n", hr); IDirectDrawSurface_Release(ds3); IDirectDrawSurface_Release(ds2); IDirectDrawSurface_Release(ds1); hr = IDirect3DDevice2_BeginScene(device); - ok(hr == D3D_OK, "Got unexpected hr %#x.\n", hr); + ok(hr == D3D_OK, "Got unexpected hr %#lx.\n", hr); hr = IDirect3DDevice2_DrawPrimitive(device, D3DPT_TRIANGLESTRIP, D3DVT_LVERTEX, quad1, 4, 0); - ok(hr == D3D_OK, "Got unexpected hr %#x.\n", hr); + ok(hr == D3D_OK, "Got unexpected hr %#lx.\n", hr); hr = IDirect3DDevice2_EndScene(device); - ok(hr == D3D_OK, "Got unexpected hr %#x.\n", hr); + ok(hr == D3D_OK, "Got unexpected hr %#lx.\n", hr); for (i = 0; i < 4; ++i) { @@ -1508,7 +1504,7 @@ static void test_texture_load_ckey(void) ddraw = create_ddraw(); ok(!!ddraw, "Failed to create a ddraw object.\n"); hr = IDirectDraw2_SetCooperativeLevel(ddraw, NULL, DDSCL_NORMAL); - ok(SUCCEEDED(hr), "Failed to set cooperative level, hr %#x.\n", hr); + ok(SUCCEEDED(hr), "Failed to set cooperative level, hr %#lx.\n", hr); memset(&ddsd, 0, sizeof(ddsd)); ddsd.dwSize = sizeof(ddsd); @@ -1517,13 +1513,13 @@ static void test_texture_load_ckey(void) ddsd.dwWidth = 128; ddsd.ddsCaps.dwCaps = DDSCAPS_TEXTURE | DDSCAPS_SYSTEMMEMORY; hr = IDirectDraw2_CreateSurface(ddraw, &ddsd, &src, NULL); - ok(SUCCEEDED(hr), "Failed to create source texture, hr %#x.\n", hr); + ok(SUCCEEDED(hr), "Failed to create source texture, hr %#lx.\n", hr); ddsd.ddsCaps.dwCaps = DDSCAPS_TEXTURE; hr = IDirectDraw2_CreateSurface(ddraw, &ddsd, &dst, NULL); - ok(SUCCEEDED(hr), "Failed to create destination texture, hr %#x.\n", hr); + ok(SUCCEEDED(hr), "Failed to create destination texture, hr %#lx.\n", hr); hr = IDirectDrawSurface_QueryInterface(src, &IID_IDirect3DTexture, (void **)&src_tex); - ok(SUCCEEDED(hr) || hr == E_NOINTERFACE, "Failed to get Direct3DTexture interface, hr %#x.\n", hr); + ok(SUCCEEDED(hr) || hr == E_NOINTERFACE, "Failed to get Direct3DTexture interface, hr %#lx.\n", hr); if (FAILED(hr)) { /* 64 bit ddraw does not support d3d */ @@ -1531,11 +1527,11 @@ static void test_texture_load_ckey(void) goto done; } hr = IDirectDrawSurface_QueryInterface(dst, &IID_IDirect3DTexture, (void **)&dst_tex); - ok(SUCCEEDED(hr), "Failed to get Direct3DTexture interface, hr %#x.\n", hr); + ok(SUCCEEDED(hr), "Failed to get Direct3DTexture interface, hr %#lx.\n", hr); /* No surface has a color key */ hr = IDirect3DTexture_Load(dst_tex, src_tex); - ok(SUCCEEDED(hr) || broken(hr == DDERR_INVALIDCAPS), "Got unexpected hr %#x.\n", hr); + ok(SUCCEEDED(hr) || broken(hr == DDERR_INVALIDCAPS), "Got unexpected hr %#lx.\n", hr); if (FAILED(hr)) { /* Testbot Windows NT VMs */ @@ -1545,43 +1541,43 @@ static void test_texture_load_ckey(void) ckey.dwColorSpaceLowValue = ckey.dwColorSpaceHighValue = 0xdeadbeef; hr = IDirectDrawSurface_GetColorKey(dst, DDCKEY_SRCBLT, &ckey); - ok(hr == DDERR_NOCOLORKEY, "Got unexpected hr %#x.\n", hr); - ok(ckey.dwColorSpaceLowValue == 0xdeadbeef, "dwColorSpaceLowValue is %#x.\n", ckey.dwColorSpaceLowValue); - ok(ckey.dwColorSpaceHighValue == 0xdeadbeef, "dwColorSpaceHighValue is %#x.\n", ckey.dwColorSpaceHighValue); + ok(hr == DDERR_NOCOLORKEY, "Got unexpected hr %#lx.\n", hr); + ok(ckey.dwColorSpaceLowValue == 0xdeadbeef, "Got unexpected value 0x%08lx.\n", ckey.dwColorSpaceLowValue); + ok(ckey.dwColorSpaceHighValue == 0xdeadbeef, "Got unexpected value 0x%08lx.\n", ckey.dwColorSpaceHighValue); /* Source surface has a color key */ ckey.dwColorSpaceLowValue = ckey.dwColorSpaceHighValue = 0x0000ff00; hr = IDirectDrawSurface_SetColorKey(src, DDCKEY_SRCBLT, &ckey); - ok(SUCCEEDED(hr), "Failed to set color key, hr %#x.\n", hr); + ok(SUCCEEDED(hr), "Failed to set color key, hr %#lx.\n", hr); hr = IDirect3DTexture_Load(dst_tex, src_tex); - ok(SUCCEEDED(hr), "Got unexpected hr %#x.\n", hr); + ok(SUCCEEDED(hr), "Got unexpected hr %#lx.\n", hr); hr = IDirectDrawSurface_GetColorKey(dst, DDCKEY_SRCBLT, &ckey); - ok(SUCCEEDED(hr), "Got unexpected hr %#x.\n", hr); - ok(ckey.dwColorSpaceLowValue == 0x0000ff00, "dwColorSpaceLowValue is %#x.\n", ckey.dwColorSpaceLowValue); - ok(ckey.dwColorSpaceHighValue == 0x0000ff00, "dwColorSpaceHighValue is %#x.\n", ckey.dwColorSpaceHighValue); + ok(SUCCEEDED(hr), "Got unexpected hr %#lx.\n", hr); + ok(ckey.dwColorSpaceLowValue == 0x0000ff00, "Got unexpected value 0x%08lx.\n", ckey.dwColorSpaceLowValue); + ok(ckey.dwColorSpaceHighValue == 0x0000ff00, "Got unexpected value 0x%08lx.\n", ckey.dwColorSpaceHighValue); /* Both surfaces have a color key: Dest ckey is overwritten */ ckey.dwColorSpaceLowValue = ckey.dwColorSpaceHighValue = 0x000000ff; hr = IDirectDrawSurface_SetColorKey(dst, DDCKEY_SRCBLT, &ckey); - ok(SUCCEEDED(hr), "Failed to set color key, hr %#x.\n", hr); + ok(SUCCEEDED(hr), "Failed to set color key, hr %#lx.\n", hr); hr = IDirect3DTexture_Load(dst_tex, src_tex); - ok(SUCCEEDED(hr), "Got unexpected hr %#x.\n", hr); + ok(SUCCEEDED(hr), "Got unexpected hr %#lx.\n", hr); hr = IDirectDrawSurface_GetColorKey(dst, DDCKEY_SRCBLT, &ckey); - ok(SUCCEEDED(hr), "Got unexpected hr %#x.\n", hr); - ok(ckey.dwColorSpaceLowValue == 0x0000ff00, "dwColorSpaceLowValue is %#x.\n", ckey.dwColorSpaceLowValue); - ok(ckey.dwColorSpaceHighValue == 0x0000ff00, "dwColorSpaceHighValue is %#x.\n", ckey.dwColorSpaceHighValue); + ok(SUCCEEDED(hr), "Got unexpected hr %#lx.\n", hr); + ok(ckey.dwColorSpaceLowValue == 0x0000ff00, "Got unexpected value 0x%08lx.\n", ckey.dwColorSpaceLowValue); + ok(ckey.dwColorSpaceHighValue == 0x0000ff00, "Got unexpected value 0x%08lx.\n", ckey.dwColorSpaceHighValue); /* Only the destination has a color key: It is not deleted */ hr = IDirectDrawSurface_SetColorKey(src, DDCKEY_SRCBLT, NULL); - ok(SUCCEEDED(hr), "Failed to set color key, hr %#x.\n", hr); + ok(SUCCEEDED(hr), "Failed to set color key, hr %#lx.\n", hr); hr = IDirectDrawSurface_GetColorKey(src, DDCKEY_SRCBLT, &ckey); - ok(hr == DDERR_NOCOLORKEY, "Got unexpected hr %#x.\n", hr); + ok(hr == DDERR_NOCOLORKEY, "Got unexpected hr %#lx.\n", hr); hr = IDirect3DTexture_Load(dst_tex, src_tex); - ok(SUCCEEDED(hr), "Got unexpected hr %#x.\n", hr); + ok(SUCCEEDED(hr), "Got unexpected hr %#lx.\n", hr); hr = IDirectDrawSurface_GetColorKey(dst, DDCKEY_SRCBLT, &ckey); - ok(SUCCEEDED(hr), "Got unexpected hr %#x.\n", hr); - ok(ckey.dwColorSpaceLowValue == 0x0000ff00, "dwColorSpaceLowValue is %#x.\n", ckey.dwColorSpaceLowValue); - ok(ckey.dwColorSpaceHighValue == 0x0000ff00, "dwColorSpaceHighValue is %#x.\n", ckey.dwColorSpaceHighValue); + ok(SUCCEEDED(hr), "Got unexpected hr %#lx.\n", hr); + ok(ckey.dwColorSpaceLowValue == 0x0000ff00, "Got unexpected value 0x%08lx.\n", ckey.dwColorSpaceLowValue); + ok(ckey.dwColorSpaceHighValue == 0x0000ff00, "Got unexpected value 0x%08lx.\n", ckey.dwColorSpaceHighValue); done: if (dst_tex) IDirect3DTexture_Release(dst_tex); @@ -1639,7 +1635,7 @@ static void test_viewport_object(void) } hr = IDirectDraw2_QueryInterface(ddraw, &IID_IDirect3D2, (void **)&d3d); - ok(SUCCEEDED(hr) || hr == E_NOINTERFACE, "Failed to get d3d interface, hr %#x.\n", hr); + ok(SUCCEEDED(hr) || hr == E_NOINTERFACE, "Failed to get d3d interface, hr %#lx.\n", hr); if (FAILED(hr)) { skip("D3D interface is not available, skipping test.\n"); @@ -1649,106 +1645,106 @@ static void test_viewport_object(void) old_d3d_ref = get_refcount((IUnknown *)d3d); hr = IDirect3D2_CreateViewport(d3d, &viewport2, NULL); - ok(SUCCEEDED(hr), "Failed to create viewport, hr %#x.\n", hr); + ok(SUCCEEDED(hr), "Failed to create viewport, hr %#lx.\n", hr); ref = get_refcount((IUnknown *)viewport2); - ok(ref == 1, "Got unexpected refcount %u.\n", ref); + ok(ref == 1, "Got unexpected refcount %lu.\n", ref); ref = get_refcount((IUnknown *)d3d); - ok(ref == old_d3d_ref, "Got unexpected refcount %u.\n", ref); + ok(ref == old_d3d_ref, "Got unexpected refcount %lu.\n", ref); memset(&desc, 0, sizeof(desc)); hr = IDirect3DViewport2_GetViewport(viewport2, &desc.vp1); - todo_wine ok(hr == DDERR_INVALIDPARAMS, "Got unexpected hr %#x.\n", hr); + todo_wine ok(hr == DDERR_INVALIDPARAMS, "Got unexpected hr %#lx.\n", hr); desc.vp1.dwSize = sizeof(desc.vp1) + 1; hr = IDirect3DViewport2_GetViewport(viewport2, &desc.vp1); - todo_wine ok(hr == DDERR_INVALIDPARAMS, "Got unexpected hr %#x.\n", hr); + todo_wine ok(hr == DDERR_INVALIDPARAMS, "Got unexpected hr %#lx.\n", hr); desc.vp1.dwSize = sizeof(desc.vp1) - 1; hr = IDirect3DViewport2_GetViewport(viewport2, &desc.vp1); - todo_wine ok(hr == DDERR_INVALIDPARAMS, "Got unexpected hr %#x.\n", hr); + todo_wine ok(hr == DDERR_INVALIDPARAMS, "Got unexpected hr %#lx.\n", hr); desc.vp1.dwSize = sizeof(desc.vp1); hr = IDirect3DViewport2_GetViewport(viewport2, &desc.vp1); - ok(hr == D3DERR_VIEWPORTDATANOTSET, "Got unexpected hr %#x.\n", hr); - ok(desc.vp1.dwSize == sizeof(desc.vp1), "Got unexpected dwSize %u.\n", desc.vp1.dwSize); + ok(hr == D3DERR_VIEWPORTDATANOTSET, "Got unexpected hr %#lx.\n", hr); + ok(desc.vp1.dwSize == sizeof(desc.vp1), "Got unexpected dwSize %lu.\n", desc.vp1.dwSize); hr = IDirect3DViewport2_GetViewport2(viewport2, &desc.vp2); - ok(hr == D3DERR_VIEWPORTDATANOTSET, "Got unexpected hr %#x.\n", hr); - ok(desc.vp2.dwSize == sizeof(desc.vp2), "Got unexpected dwSize %u.\n", desc.vp2.dwSize); + ok(hr == D3DERR_VIEWPORTDATANOTSET, "Got unexpected hr %#lx.\n", hr); + ok(desc.vp2.dwSize == sizeof(desc.vp2), "Got unexpected dwSize %lu.\n", desc.vp2.dwSize); desc.vp2.dwSize = sizeof(desc.vp2) + 1; hr = IDirect3DViewport2_GetViewport2(viewport2, &desc.vp2); - todo_wine ok(hr == DDERR_INVALIDPARAMS, "Got unexpected hr %#x.\n", hr); + todo_wine ok(hr == DDERR_INVALIDPARAMS, "Got unexpected hr %#lx.\n", hr); gamma = (IDirectDrawGammaControl *)0xdeadbeef; hr = IDirect3DViewport2_QueryInterface(viewport2, &IID_IDirectDrawGammaControl, (void **)&gamma); - ok(hr == E_NOINTERFACE, "Got unexpected hr %#x.\n", hr); + ok(hr == E_NOINTERFACE, "Got unexpected hr %#lx.\n", hr); ok(!gamma, "Interface not set to NULL by failed QI call: %p\n", gamma); /* NULL iid: Segfaults */ hr = IDirect3DViewport2_QueryInterface(viewport2, &IID_IDirect3DViewport, (void **)&viewport); - ok(SUCCEEDED(hr), "Failed to QI IDirect3DViewport, hr %#x.\n", hr); + ok(SUCCEEDED(hr), "Failed to QI IDirect3DViewport, hr %#lx.\n", hr); ref = get_refcount((IUnknown *)viewport); - ok(ref == 2, "Got unexpected refcount %u.\n", ref); + ok(ref == 2, "Got unexpected refcount %lu.\n", ref); ref = get_refcount((IUnknown *)viewport2); - ok(ref == 2, "Got unexpected refcount %u.\n", ref); + ok(ref == 2, "Got unexpected refcount %lu.\n", ref); IDirect3DViewport_Release(viewport); viewport = NULL; hr = IDirect3DViewport2_QueryInterface(viewport2, &IID_IDirect3DViewport3, (void **)&viewport3); - ok(SUCCEEDED(hr) || hr == E_NOINTERFACE, "Failed to QI IDirect3DViewport3, hr %#x.\n", hr); + ok(SUCCEEDED(hr) || hr == E_NOINTERFACE, "Failed to QI IDirect3DViewport3, hr %#lx.\n", hr); if (viewport3) { ref = get_refcount((IUnknown *)viewport2); - ok(ref == 2, "Got unexpected refcount %u.\n", ref); + ok(ref == 2, "Got unexpected refcount %lu.\n", ref); ref = get_refcount((IUnknown *)viewport3); - ok(ref == 2, "Got unexpected refcount %u.\n", ref); + ok(ref == 2, "Got unexpected refcount %lu.\n", ref); IDirect3DViewport3_Release(viewport3); } hr = IDirect3DViewport2_QueryInterface(viewport2, &IID_IUnknown, (void **)&unknown); - ok(SUCCEEDED(hr), "Failed to QI IUnknown, hr %#x.\n", hr); + ok(SUCCEEDED(hr), "Failed to QI IUnknown, hr %#lx.\n", hr); ref = get_refcount((IUnknown *)viewport2); - ok(ref == 2, "Got unexpected refcount %u.\n", ref); + ok(ref == 2, "Got unexpected refcount %lu.\n", ref); ref = get_refcount(unknown); - ok(ref == 2, "Got unexpected refcount %u.\n", ref); + ok(ref == 2, "Got unexpected refcount %lu.\n", ref); IUnknown_Release(unknown); hr = IDirect3DDevice2_DeleteViewport(device, NULL); - ok(hr == DDERR_INVALIDPARAMS, "Got unexpected hr %#x.\n", hr); + ok(hr == DDERR_INVALIDPARAMS, "Got unexpected hr %#lx.\n", hr); hr = IDirect3DDevice2_GetCurrentViewport(device, NULL); - ok(hr == D3DERR_NOCURRENTVIEWPORT, "Got unexpected hr %#x.\n", hr); + ok(hr == D3DERR_NOCURRENTVIEWPORT, "Got unexpected hr %#lx.\n", hr); hr = IDirect3D2_CreateViewport(d3d, &another_vp, NULL); - ok(SUCCEEDED(hr), "Failed to create viewport, hr %#x.\n", hr); + ok(SUCCEEDED(hr), "Failed to create viewport, hr %#lx.\n", hr); /* Setting a viewport not in the viewport list fails */ hr = IDirect3DDevice2_SetCurrentViewport(device, another_vp); - ok(hr == DDERR_INVALIDPARAMS, "Got unexpected hr %#x.\n", hr); + ok(hr == DDERR_INVALIDPARAMS, "Got unexpected hr %#lx.\n", hr); /* AddViewport(NULL): Segfault */ hr = IDirect3DDevice2_AddViewport(device, viewport2); - ok(SUCCEEDED(hr), "Failed to add viewport to device, hr %#x.\n", hr); + ok(SUCCEEDED(hr), "Failed to add viewport to device, hr %#lx.\n", hr); ref = get_refcount((IUnknown *) viewport2); - ok(ref == 2, "viewport2 refcount is %u.\n", ref); + ok(ref == 2, "viewport2 refcount is %lu.\n", ref); hr = IDirect3DDevice2_AddViewport(device, another_vp); - ok(SUCCEEDED(hr), "Failed to add viewport to device, hr %#x.\n", hr); + ok(SUCCEEDED(hr), "Failed to add viewport to device, hr %#lx.\n", hr); ref = get_refcount((IUnknown *) another_vp); - ok(ref == 2, "another_vp refcount is %u.\n", ref); + ok(ref == 2, "another_vp refcount is %lu.\n", ref); test_vp = (IDirect3DViewport2 *) 0xbaadc0de; hr = IDirect3DDevice2_GetCurrentViewport(device, &test_vp); - ok(hr == D3DERR_NOCURRENTVIEWPORT, "Got unexpected hr %#x.\n", hr); + ok(hr == D3DERR_NOCURRENTVIEWPORT, "Got unexpected hr %#lx.\n", hr); ok(test_vp == (IDirect3DViewport2 *) 0xbaadc0de, "Got unexpected pointer %p\n", test_vp); hr = IDirect3DDevice2_SetCurrentViewport(device, viewport2); - ok(SUCCEEDED(hr), "Failed to set current viewport, hr %#x.\n", hr); + ok(SUCCEEDED(hr), "Failed to set current viewport, hr %#lx.\n", hr); ref = get_refcount((IUnknown *) viewport2); - ok(ref == 3, "Got unexpected refcount %u.\n", ref); + ok(ref == 3, "Got unexpected refcount %lu.\n", ref); ref = get_refcount((IUnknown *) device); - ok(ref == 1, "Got unexpected refcount %u.\n", ref); + ok(ref == 1, "Got unexpected refcount %lu.\n", ref); test_vp = NULL; hr = IDirect3DDevice2_GetCurrentViewport(device, &test_vp); - ok(hr == D3D_OK, "Got unexpected hr %#x.\n", hr); + ok(hr == D3D_OK, "Got unexpected hr %#lx.\n", hr); ok(test_vp == viewport2, "Got unexpected viewport %p\n", test_vp); ref = get_refcount((IUnknown *) viewport2); - ok(ref == 4, "Got unexpected refcount %u.\n", ref); + ok(ref == 4, "Got unexpected refcount %lu.\n", ref); if (test_vp) IDirect3DViewport2_Release(test_vp); @@ -1756,43 +1752,43 @@ static void test_viewport_object(void) /* Cannot set the viewport to NULL */ hr = IDirect3DDevice2_SetCurrentViewport(device, NULL); - ok(hr == DDERR_INVALIDPARAMS, "Failed to set viewport to NULL, hr %#x.\n", hr); + ok(hr == DDERR_INVALIDPARAMS, "Failed to set viewport to NULL, hr %#lx.\n", hr); test_vp = NULL; hr = IDirect3DDevice2_GetCurrentViewport(device, &test_vp); - ok(hr == D3D_OK, "Got unexpected hr %#x.\n", hr); + ok(hr == D3D_OK, "Got unexpected hr %#lx.\n", hr); ok(test_vp == viewport2, "Got unexpected viewport %p\n", test_vp); if (test_vp) IDirect3DViewport2_Release(test_vp); /* SetCurrentViewport properly releases the old viewport's reference */ hr = IDirect3DDevice2_SetCurrentViewport(device, another_vp); - ok(SUCCEEDED(hr), "Failed to set current viewport, hr %#x.\n", hr); + ok(SUCCEEDED(hr), "Failed to set current viewport, hr %#lx.\n", hr); ref = get_refcount((IUnknown *) viewport2); - ok(ref == 2, "Got unexpected refcount %u.\n", ref); + ok(ref == 2, "Got unexpected refcount %lu.\n", ref); ref = get_refcount((IUnknown *) another_vp); - ok(ref == 3, "Got unexpected refcount %u.\n", ref); + ok(ref == 3, "Got unexpected refcount %lu.\n", ref); /* Deleting the viewport removes the reference added by AddViewport, but not * the one added by SetCurrentViewport. */ hr = IDirect3DDevice2_DeleteViewport(device, another_vp); - ok(SUCCEEDED(hr), "Failed to delete viewport from device, hr %#x.\n", hr); + ok(SUCCEEDED(hr), "Failed to delete viewport from device, hr %#lx.\n", hr); ref = get_refcount((IUnknown *) another_vp); - todo_wine ok(ref == 2, "Got unexpected refcount %u.\n", ref); + todo_wine ok(ref == 2, "Got unexpected refcount %lu.\n", ref); /* GetCurrentViewport fails though */ test_vp = NULL; hr = IDirect3DDevice2_GetCurrentViewport(device, &test_vp); - ok(hr == D3DERR_NOCURRENTVIEWPORT, "Got unexpected hr %#x.\n", hr); + ok(hr == D3DERR_NOCURRENTVIEWPORT, "Got unexpected hr %#lx.\n", hr); ok(!test_vp, "Got unexpected viewport %p\n", test_vp); /* Setting a different viewport does not free the leaked reference. How * do I get rid of it? Leak the viewport for now. */ hr = IDirect3DDevice2_SetCurrentViewport(device, viewport2); - ok(SUCCEEDED(hr), "Failed to set current viewport, hr %#x.\n", hr); + ok(SUCCEEDED(hr), "Failed to set current viewport, hr %#lx.\n", hr); ref = get_refcount((IUnknown *) viewport2); - ok(ref == 3, "Got unexpected refcount %u.\n", ref); + ok(ref == 3, "Got unexpected refcount %lu.\n", ref); ref = get_refcount((IUnknown *) another_vp); - todo_wine ok(ref == 2, "Got unexpected refcount %u.\n", ref); + todo_wine ok(ref == 2, "Got unexpected refcount %lu.\n", ref); memset(&vp, 0, sizeof(vp)); memset(&vp, 0, sizeof(vp2)); @@ -1811,29 +1807,29 @@ static void test_viewport_object(void) vp2.dvClipWidth = 2.0f; vp2.dvClipHeight = 2.0f; hr = IDirect3DViewport2_SetViewport(viewport2, &vp); - ok(hr == DDERR_INVALIDPARAMS, "Got unexpected hr %#x.\n", hr); + ok(hr == DDERR_INVALIDPARAMS, "Got unexpected hr %#lx.\n", hr); hr = IDirect3DViewport2_SetViewport2(viewport2, &vp2); - ok(hr == DDERR_INVALIDPARAMS, "Got unexpected hr %#x.\n", hr); + ok(hr == DDERR_INVALIDPARAMS, "Got unexpected hr %#lx.\n", hr); vp.dwSize = sizeof(vp); hr = IDirect3DViewport2_SetViewport(viewport2, &vp); - ok(SUCCEEDED(hr), "Failed to set viewport data, hr %#x.\n", hr); + ok(SUCCEEDED(hr), "Failed to set viewport data, hr %#lx.\n", hr); vp2.dwSize = sizeof(vp2); hr = IDirect3DViewport2_SetViewport2(viewport2, &vp2); - ok(SUCCEEDED(hr), "Failed to set viewport data, hr %#x.\n", hr); + ok(SUCCEEDED(hr), "Failed to set viewport data, hr %#lx.\n", hr); /* Destroying the device removes the viewport, but does not free the reference * added by SetCurrentViewport. */ IDirect3DDevice2_Release(device); ref = get_refcount((IUnknown *) viewport2); - todo_wine ok(ref == 2, "Got unexpected refcount %u.\n", ref); + todo_wine ok(ref == 2, "Got unexpected refcount %lu.\n", ref); vp.dwSize = sizeof(vp); hr = IDirect3DViewport2_SetViewport(viewport2, &vp); - ok(hr == D3DERR_VIEWPORTHASNODEVICE, "Got unexpected hr %#x.\n", hr); + ok(hr == D3DERR_VIEWPORTHASNODEVICE, "Got unexpected hr %#lx.\n", hr); vp2.dwSize = sizeof(vp2); hr = IDirect3DViewport2_SetViewport2(viewport2, &vp2); - ok(hr == D3DERR_VIEWPORTHASNODEVICE, "Got unexpected hr %#x.\n", hr); + ok(hr == D3DERR_VIEWPORTHASNODEVICE, "Got unexpected hr %#lx.\n", hr); IDirect3DViewport2_Release(another_vp); IDirect3DViewport2_Release(viewport2); @@ -1853,15 +1849,13 @@ static void test_zenable(const GUID *device_guid) {{640.0f}, { 0.0f}, { 1.5f}, {1.0f}, {0xff00ff00}, {0x00000000}, {0.0f}, {0.0f}}, }; IDirect3DMaterial2 *background; + unsigned int color, x, y, i, j; IDirect3DViewport2 *viewport; IDirect3DDevice2 *device; IDirectDrawSurface *rt; IDirectDraw2 *ddraw; - D3DCOLOR color; HWND window; HRESULT hr; - UINT x, y; - UINT i, j; window = create_window(); ddraw = create_ddraw(); @@ -1878,16 +1872,16 @@ static void test_zenable(const GUID *device_guid) viewport = create_viewport(device, 0, 0, 640, 480); viewport_set_background(device, viewport, background); hr = IDirect3DDevice2_SetCurrentViewport(device, viewport); - ok(hr == D3D_OK, "Got unexpected hr %#x.\n", hr); + ok(hr == D3D_OK, "Got unexpected hr %#lx.\n", hr); hr = IDirect3DDevice2_SetRenderState(device, D3DRENDERSTATE_ZENABLE, D3DZB_FALSE); - ok(hr == D3D_OK, "Got unexpected hr %#x.\n", hr); + ok(hr == D3D_OK, "Got unexpected hr %#lx.\n", hr); hr = IDirect3DViewport2_Clear(viewport, 1, &clear_rect, D3DCLEAR_TARGET); - ok(hr == D3D_OK, "Got unexpected hr %#x.\n", hr); + ok(hr == D3D_OK, "Got unexpected hr %#lx.\n", hr); hr = IDirect3DDevice2_GetRenderTarget(device, &rt); - ok(hr == D3D_OK, "Got unexpected hr %#x.\n", hr); + ok(hr == D3D_OK, "Got unexpected hr %#lx.\n", hr); color = get_surface_color(rt, 80, 60); /* For some reason clears and colour fill blits randomly fail with software render target. */ @@ -1902,11 +1896,11 @@ static void test_zenable(const GUID *device_guid) } hr = IDirect3DDevice2_BeginScene(device); - ok(hr == D3D_OK, "Got unexpected hr %#x.\n", hr); + ok(hr == D3D_OK, "Got unexpected hr %#lx.\n", hr); hr = IDirect3DDevice2_DrawPrimitive(device, D3DPT_TRIANGLESTRIP, D3DVT_TLVERTEX, tquad, 4, 0); - ok(hr == D3D_OK, "Got unexpected hr %#x.\n", hr); + ok(hr == D3D_OK, "Got unexpected hr %#lx.\n", hr); hr = IDirect3DDevice2_EndScene(device); - ok(hr == D3D_OK, "Got unexpected hr %#x.\n", hr); + ok(hr == D3D_OK, "Got unexpected hr %#lx.\n", hr); for (i = 0; i < 4; ++i) { @@ -1947,8 +1941,8 @@ static void test_ck_rgba(const GUID *device_guid) D3DCOLOR fill_color; BOOL color_key; BOOL blend; - D3DCOLOR result1, result1_broken; - D3DCOLOR result2, result2_broken; + unsigned int result1, result1_broken; + unsigned int result2, result2_broken; } tests[] = { @@ -1972,12 +1966,11 @@ static void test_ck_rgba(const GUID *device_guid) DDSURFACEDESC surface_desc; IDirect3DDevice2 *device; IDirectDrawSurface *rt; + unsigned int color, i; IDirectDraw2 *ddraw; - D3DCOLOR color; HWND window; DDBLTFX fx; HRESULT hr; - UINT i; window = create_window(); ddraw = create_ddraw(); @@ -1994,7 +1987,7 @@ static void test_ck_rgba(const GUID *device_guid) viewport = create_viewport(device, 0, 0, 640, 480); viewport_set_background(device, viewport, background); hr = IDirect3DDevice2_SetCurrentViewport(device, viewport); - ok(hr == D3D_OK, "Got unexpected hr %#x.\n", hr); + ok(hr == D3D_OK, "Got unexpected hr %#lx.\n", hr); memset(&surface_desc, 0, sizeof(surface_desc)); surface_desc.dwSize = sizeof(surface_desc); @@ -2014,48 +2007,48 @@ static void test_ck_rgba(const GUID *device_guid) surface_desc.ddckCKSrcBlt.dwColorSpaceLowValue = 0xff00ff00; surface_desc.ddckCKSrcBlt.dwColorSpaceHighValue = 0xff00ff00; hr = IDirectDraw2_CreateSurface(ddraw, &surface_desc, &surface, NULL); - ok(hr == DD_OK, "Got unexpected hr %#x.\n", hr); + ok(hr == DD_OK, "Got unexpected hr %#lx.\n", hr); hr = IDirectDrawSurface_QueryInterface(surface, &IID_IDirect3DTexture2, (void **)&texture); - ok(hr == DD_OK, "Got unexpected hr %#x.\n", hr); + ok(hr == DD_OK, "Got unexpected hr %#lx.\n", hr); hr = IDirect3DTexture2_GetHandle(texture, device, &texture_handle); - ok(hr == D3D_OK, "Got unexpected hr %#x.\n", hr); + ok(hr == D3D_OK, "Got unexpected hr %#lx.\n", hr); IDirect3DTexture2_Release(texture); hr = IDirect3DDevice2_SetRenderState(device, D3DRENDERSTATE_TEXTUREHANDLE, texture_handle); - ok(hr == D3D_OK, "Got unexpected hr %#x.\n", hr); + ok(hr == D3D_OK, "Got unexpected hr %#lx.\n", hr); hr = IDirect3DDevice2_SetRenderState(device, D3DRENDERSTATE_SRCBLEND, D3DBLEND_SRCALPHA); - ok(hr == D3D_OK, "Got unexpected hr %#x.\n", hr); + ok(hr == D3D_OK, "Got unexpected hr %#lx.\n", hr); hr = IDirect3DDevice2_SetRenderState(device, D3DRENDERSTATE_DESTBLEND, D3DBLEND_INVSRCALPHA); - ok(hr == D3D_OK, "Got unexpected hr %#x.\n", hr); + ok(hr == D3D_OK, "Got unexpected hr %#lx.\n", hr); hr = IDirect3DDevice2_GetRenderTarget(device, &rt); - ok(hr == D3D_OK, "Got unexpected hr %#x.\n", hr); + ok(hr == D3D_OK, "Got unexpected hr %#lx.\n", hr); for (i = 0; i < ARRAY_SIZE(tests); ++i) { hr = IDirect3DDevice2_SetRenderState(device, D3DRENDERSTATE_COLORKEYENABLE, tests[i].color_key); - ok(hr == D3D_OK, "Got unexpected hr %#x.\n", hr); + ok(hr == D3D_OK, "Got unexpected hr %#lx.\n", hr); hr = IDirect3DDevice2_SetRenderState(device, D3DRENDERSTATE_ALPHABLENDENABLE, tests[i].blend); - ok(hr == D3D_OK, "Got unexpected hr %#x.\n", hr); + ok(hr == D3D_OK, "Got unexpected hr %#lx.\n", hr); memset(&fx, 0, sizeof(fx)); fx.dwSize = sizeof(fx); U5(fx).dwFillColor = tests[i].fill_color; hr = IDirectDrawSurface_Blt(surface, NULL, NULL, NULL, DDBLT_COLORFILL | DDBLT_WAIT, &fx); - ok(hr == DD_OK, "Got unexpected hr %#x.\n", hr); + ok(hr == DD_OK, "Got unexpected hr %#lx.\n", hr); hr = IDirect3DViewport2_Clear(viewport, 1, &clear_rect, D3DCLEAR_TARGET | D3DCLEAR_ZBUFFER); - ok(hr == D3D_OK, "Got unexpected hr %#x.\n", hr); + ok(hr == D3D_OK, "Got unexpected hr %#lx.\n", hr); /* RT clears are broken on Windows for software render target. */ if (is_software_device_type(device_guid)) fill_surface(rt, 0xffff0000); hr = IDirect3DDevice2_BeginScene(device); - ok(hr == D3D_OK, "Got unexpected hr %#x.\n", hr); + ok(hr == D3D_OK, "Got unexpected hr %#lx.\n", hr); hr = IDirect3DDevice2_DrawPrimitive(device, D3DPT_TRIANGLESTRIP, D3DVT_TLVERTEX, &tquad[0], 4, 0); - ok(hr == D3D_OK, "Got unexpected hr %#x.\n", hr); + ok(hr == D3D_OK, "Got unexpected hr %#lx.\n", hr); hr = IDirect3DDevice2_EndScene(device); - ok(hr == D3D_OK, "Got unexpected hr %#x.\n", hr); + ok(hr == D3D_OK, "Got unexpected hr %#lx.\n", hr); color = get_surface_color(rt, 320, 240); ok(compare_color(color, tests[i].result1, 2) || compare_color(color, tests[i].result1_broken, 1), @@ -2064,14 +2057,14 @@ static void test_ck_rgba(const GUID *device_guid) U5(fx).dwFillColor = 0xff0000ff; hr = IDirectDrawSurface_Blt(surface, NULL, NULL, NULL, DDBLT_COLORFILL | DDBLT_WAIT, &fx); - ok(hr == DD_OK, "Got unexpected hr %#x.\n", hr); + ok(hr == DD_OK, "Got unexpected hr %#lx.\n", hr); hr = IDirect3DDevice2_BeginScene(device); - ok(hr == D3D_OK, "Got unexpected hr %#x.\n", hr); + ok(hr == D3D_OK, "Got unexpected hr %#lx.\n", hr); hr = IDirect3DDevice2_DrawPrimitive(device, D3DPT_TRIANGLESTRIP, D3DVT_TLVERTEX, &tquad[4], 4, 0); - ok(hr == D3D_OK, "Got unexpected hr %#x.\n", hr); + ok(hr == D3D_OK, "Got unexpected hr %#lx.\n", hr); hr = IDirect3DDevice2_EndScene(device); - ok(hr == D3D_OK, "Got unexpected hr %#x.\n", hr); + ok(hr == D3D_OK, "Got unexpected hr %#lx.\n", hr); /* This tests that fragments that are masked out by the color key are * discarded, instead of just fully transparent. */ @@ -2083,7 +2076,7 @@ static void test_ck_rgba(const GUID *device_guid) IDirectDrawSurface_Release(rt); hr = IDirect3DDevice2_SetRenderState(device, D3DRENDERSTATE_TEXTUREHANDLE, 0); - ok(hr == D3D_OK, "Got unexpected hr %#x.\n", hr); + ok(hr == D3D_OK, "Got unexpected hr %#lx.\n", hr); IDirectDrawSurface_Release(surface); destroy_viewport(device, viewport); destroy_material(background); @@ -2110,7 +2103,7 @@ static void test_ck_default(void) IDirect3DTexture2 *texture; IDirect3DDevice2 *device; IDirectDraw2 *ddraw; - D3DCOLOR color; + unsigned int color; DWORD value; HWND window; DDBLTFX fx; @@ -2128,13 +2121,13 @@ static void test_ck_default(void) } hr = IDirect3DDevice2_GetRenderTarget(device, &rt); - ok(SUCCEEDED(hr), "Failed to get render target, hr %#x.\n", hr); + ok(SUCCEEDED(hr), "Failed to get render target, hr %#lx.\n", hr); background = create_diffuse_material(device, 0.0, 1.0f, 0.0f, 1.0f); viewport = create_viewport(device, 0, 0, 640, 480); viewport_set_background(device, viewport, background); hr = IDirect3DDevice2_SetCurrentViewport(device, viewport); - ok(SUCCEEDED(hr), "Failed to set current viewport, hr %#x.\n", hr); + ok(SUCCEEDED(hr), "Failed to set current viewport, hr %#lx.\n", hr); memset(&surface_desc, 0, sizeof(surface_desc)); surface_desc.dwSize = sizeof(surface_desc); @@ -2151,50 +2144,50 @@ static void test_ck_default(void) surface_desc.ddckCKSrcBlt.dwColorSpaceLowValue = 0x000000ff; surface_desc.ddckCKSrcBlt.dwColorSpaceHighValue = 0x000000ff; hr = IDirectDraw2_CreateSurface(ddraw, &surface_desc, &surface, NULL); - ok(SUCCEEDED(hr), "Failed to create surface, hr %#x.\n", hr); + ok(SUCCEEDED(hr), "Failed to create surface, hr %#lx.\n", hr); hr = IDirectDrawSurface_QueryInterface(surface, &IID_IDirect3DTexture2, (void **)&texture); - ok(SUCCEEDED(hr), "Failed to get texture interface, hr %#x.\n", hr); + ok(SUCCEEDED(hr), "Failed to get texture interface, hr %#lx.\n", hr); hr = IDirect3DTexture2_GetHandle(texture, device, &texture_handle); - ok(SUCCEEDED(hr), "Failed to get texture handle, hr %#x.\n", hr); + ok(SUCCEEDED(hr), "Failed to get texture handle, hr %#lx.\n", hr); IDirect3DTexture_Release(texture); memset(&fx, 0, sizeof(fx)); fx.dwSize = sizeof(fx); U5(fx).dwFillColor = 0x000000ff; hr = IDirectDrawSurface_Blt(surface, NULL, NULL, NULL, DDBLT_COLORFILL | DDBLT_WAIT, &fx); - ok(SUCCEEDED(hr), "Failed to fill surface, hr %#x.\n", hr); + ok(SUCCEEDED(hr), "Failed to fill surface, hr %#lx.\n", hr); hr = IDirect3DViewport2_Clear(viewport, 1, &clear_rect, D3DCLEAR_TARGET); - ok(SUCCEEDED(hr), "Failed to clear viewport, hr %#x.\n", hr); + ok(SUCCEEDED(hr), "Failed to clear viewport, hr %#lx.\n", hr); hr = IDirect3DDevice2_BeginScene(device); - ok(SUCCEEDED(hr), "Failed to begin scene, hr %#x.\n", hr); + ok(SUCCEEDED(hr), "Failed to begin scene, hr %#lx.\n", hr); hr = IDirect3DDevice2_SetRenderState(device, D3DRENDERSTATE_TEXTUREHANDLE, texture_handle); - ok(SUCCEEDED(hr), "Failed to set texture handle, hr %#x.\n", hr); + ok(SUCCEEDED(hr), "Failed to set texture handle, hr %#lx.\n", hr); hr = IDirect3DDevice2_GetRenderState(device, D3DRENDERSTATE_COLORKEYENABLE, &value); - ok(SUCCEEDED(hr), "Failed to get render state, hr %#x.\n", hr); - ok(!value, "Got unexpected color keying state %#x.\n", value); + ok(SUCCEEDED(hr), "Failed to get render state, hr %#lx.\n", hr); + ok(!value, "Got unexpected color keying state %#lx.\n", value); hr = IDirect3DDevice2_DrawPrimitive(device, D3DPT_TRIANGLESTRIP, D3DVT_TLVERTEX, &tquad[0], 4, 0); - ok(SUCCEEDED(hr), "Failed to draw, hr %#x.\n", hr); + ok(SUCCEEDED(hr), "Failed to draw, hr %#lx.\n", hr); hr = IDirect3DDevice2_EndScene(device); - ok(SUCCEEDED(hr), "Failed to end scene, hr %#x.\n", hr); + ok(SUCCEEDED(hr), "Failed to end scene, hr %#lx.\n", hr); color = get_surface_color(rt, 320, 240); ok(compare_color(color, 0x000000ff, 1), "Got unexpected color 0x%08x.\n", color); hr = IDirect3DViewport2_Clear(viewport, 1, &clear_rect, D3DCLEAR_TARGET); - ok(SUCCEEDED(hr), "Failed to clear viewport, hr %#x.\n", hr); + ok(SUCCEEDED(hr), "Failed to clear viewport, hr %#lx.\n", hr); hr = IDirect3DDevice2_BeginScene(device); - ok(SUCCEEDED(hr), "Failed to begin scene, hr %#x.\n", hr); + ok(SUCCEEDED(hr), "Failed to begin scene, hr %#lx.\n", hr); hr = IDirect3DDevice2_SetRenderState(device, D3DRENDERSTATE_COLORKEYENABLE, TRUE); - ok(SUCCEEDED(hr), "Failed to enable color keying, hr %#x.\n", hr); + ok(SUCCEEDED(hr), "Failed to enable color keying, hr %#lx.\n", hr); hr = IDirect3DDevice2_DrawPrimitive(device, D3DPT_TRIANGLESTRIP, D3DVT_TLVERTEX, &tquad[0], 4, 0); - ok(SUCCEEDED(hr), "Failed to draw, hr %#x.\n", hr); + ok(SUCCEEDED(hr), "Failed to draw, hr %#lx.\n", hr); hr = IDirect3DDevice2_GetRenderState(device, D3DRENDERSTATE_COLORKEYENABLE, &value); - ok(SUCCEEDED(hr), "Failed to get render state, hr %#x.\n", hr); - ok(!!value, "Got unexpected color keying state %#x.\n", value); + ok(SUCCEEDED(hr), "Failed to get render state, hr %#lx.\n", hr); + ok(!!value, "Got unexpected color keying state %#lx.\n", value); hr = IDirect3DDevice2_SetRenderState(device, D3DRENDERSTATE_TEXTUREHANDLE, 0); - ok(SUCCEEDED(hr), "Failed to set texture handle, hr %#x.\n", hr); + ok(SUCCEEDED(hr), "Failed to set texture handle, hr %#lx.\n", hr); hr = IDirect3DDevice2_EndScene(device); - ok(SUCCEEDED(hr), "Failed to end scene, hr %#x.\n", hr); + ok(SUCCEEDED(hr), "Failed to end scene, hr %#lx.\n", hr); color = get_surface_color(rt, 320, 240); ok(compare_color(color, 0x0000ff00, 1), "Got unexpected color 0x%08x.\n", color); @@ -2239,20 +2232,20 @@ static void test_ck_complex(void) surface_desc.dwWidth = 128; surface_desc.dwHeight = 128; hr = IDirectDraw2_CreateSurface(ddraw, &surface_desc, &surface, NULL); - ok(SUCCEEDED(hr), "Failed to create surface, hr %#x.\n", hr); + ok(SUCCEEDED(hr), "Failed to create surface, hr %#lx.\n", hr); hr = IDirectDrawSurface_GetColorKey(surface, DDCKEY_SRCBLT, &color_key); - ok(hr == DDERR_NOCOLORKEY, "Got unexpected hr %#x.\n", hr); + ok(hr == DDERR_NOCOLORKEY, "Got unexpected hr %#lx.\n", hr); color_key.dwColorSpaceLowValue = 0x0000ff00; color_key.dwColorSpaceHighValue = 0x0000ff00; hr = IDirectDrawSurface_SetColorKey(surface, DDCKEY_SRCBLT, &color_key); - ok(SUCCEEDED(hr), "Failed to set color key, hr %#x.\n", hr); + ok(SUCCEEDED(hr), "Failed to set color key, hr %#lx.\n", hr); memset(&color_key, 0, sizeof(color_key)); hr = IDirectDrawSurface_GetColorKey(surface, DDCKEY_SRCBLT, &color_key); - ok(SUCCEEDED(hr), "Failed to get color key, hr %#x.\n", hr); - ok(color_key.dwColorSpaceLowValue == 0x0000ff00, "Got unexpected value 0x%08x.\n", + ok(SUCCEEDED(hr), "Failed to get color key, hr %#lx.\n", hr); + ok(color_key.dwColorSpaceLowValue == 0x0000ff00, "Got unexpected value 0x%08lx.\n", color_key.dwColorSpaceLowValue); - ok(color_key.dwColorSpaceHighValue == 0x0000ff00, "Got unexpected value 0x%08x.\n", + ok(color_key.dwColorSpaceHighValue == 0x0000ff00, "Got unexpected value 0x%08lx.\n", color_key.dwColorSpaceHighValue); mipmap = surface; @@ -2260,20 +2253,20 @@ static void test_ck_complex(void) for (i = 0; i < 7; ++i) { hr = IDirectDrawSurface_GetAttachedSurface(mipmap, &caps, &tmp); - ok(SUCCEEDED(hr), "Failed to get attached surface, i %u, hr %#x.\n", i, hr); + ok(SUCCEEDED(hr), "Failed to get attached surface, i %u, hr %#lx.\n", i, hr); hr = IDirectDrawSurface_GetColorKey(tmp, DDCKEY_SRCBLT, &color_key); - ok(hr == DDERR_NOCOLORKEY, "Got unexpected hr %#x, i %u.\n", hr, i); + ok(hr == DDERR_NOCOLORKEY, "Got unexpected hr %#lx, i %u.\n", hr, i); color_key.dwColorSpaceLowValue = 0x000000ff; color_key.dwColorSpaceHighValue = 0x000000ff; hr = IDirectDrawSurface_SetColorKey(tmp, DDCKEY_SRCBLT, &color_key); - ok(SUCCEEDED(hr), "Failed to set color key, hr %#x, i %u.\n", hr, i); + ok(SUCCEEDED(hr), "Failed to set color key, hr %#lx, i %u.\n", hr, i); memset(&color_key, 0, sizeof(color_key)); hr = IDirectDrawSurface_GetColorKey(tmp, DDCKEY_SRCBLT, &color_key); - ok(SUCCEEDED(hr), "Failed to get color key, hr %#x, i %u.\n", hr, i); - ok(color_key.dwColorSpaceLowValue == 0x000000ff, "Got unexpected value 0x%08x, i %u.\n", + ok(SUCCEEDED(hr), "Failed to get color key, hr %#lx, i %u.\n", hr, i); + ok(color_key.dwColorSpaceLowValue == 0x000000ff, "Got unexpected value 0x%08lx, i %u.\n", color_key.dwColorSpaceLowValue, i); - ok(color_key.dwColorSpaceHighValue == 0x000000ff, "Got unexpected value 0x%08x, i %u.\n", + ok(color_key.dwColorSpaceHighValue == 0x000000ff, "Got unexpected value 0x%08lx, i %u.\n", color_key.dwColorSpaceHighValue, i); IDirectDrawSurface_Release(mipmap); @@ -2282,17 +2275,17 @@ static void test_ck_complex(void) memset(&color_key, 0, sizeof(color_key)); hr = IDirectDrawSurface_GetColorKey(surface, DDCKEY_SRCBLT, &color_key); - ok(SUCCEEDED(hr), "Failed to get color key, hr %#x.\n", hr); - ok(color_key.dwColorSpaceLowValue == 0x0000ff00, "Got unexpected value 0x%08x.\n", + ok(SUCCEEDED(hr), "Failed to get color key, hr %#lx.\n", hr); + ok(color_key.dwColorSpaceLowValue == 0x0000ff00, "Got unexpected value 0x%08lx.\n", color_key.dwColorSpaceLowValue); - ok(color_key.dwColorSpaceHighValue == 0x0000ff00, "Got unexpected value 0x%08x.\n", + ok(color_key.dwColorSpaceHighValue == 0x0000ff00, "Got unexpected value 0x%08lx.\n", color_key.dwColorSpaceHighValue); hr = IDirectDrawSurface_GetAttachedSurface(mipmap, &caps, &tmp); - ok(hr == DDERR_NOTFOUND, "Got unexpected hr %#x.\n", hr); + ok(hr == DDERR_NOTFOUND, "Got unexpected hr %#lx.\n", hr); IDirectDrawSurface_Release(mipmap); refcount = IDirectDrawSurface_Release(surface); - ok(!refcount, "Got unexpected refcount %u.\n", refcount); + ok(!refcount, "Got unexpected refcount %lu.\n", refcount); memset(&surface_desc, 0, sizeof(surface_desc)); surface_desc.dwSize = sizeof(surface_desc); @@ -2300,45 +2293,45 @@ static void test_ck_complex(void) surface_desc.ddsCaps.dwCaps = DDSCAPS_PRIMARYSURFACE | DDSCAPS_COMPLEX | DDSCAPS_FLIP; surface_desc.dwBackBufferCount = 1; hr = IDirectDraw2_CreateSurface(ddraw, &surface_desc, &surface, NULL); - ok(SUCCEEDED(hr), "Failed to create surface, hr %#x.\n", hr); + ok(SUCCEEDED(hr), "Failed to create surface, hr %#lx.\n", hr); hr = IDirectDrawSurface_GetColorKey(surface, DDCKEY_SRCBLT, &color_key); - ok(hr == DDERR_NOCOLORKEY, "Got unexpected hr %#x.\n", hr); + ok(hr == DDERR_NOCOLORKEY, "Got unexpected hr %#lx.\n", hr); color_key.dwColorSpaceLowValue = 0x0000ff00; color_key.dwColorSpaceHighValue = 0x0000ff00; hr = IDirectDrawSurface_SetColorKey(surface, DDCKEY_SRCBLT, &color_key); - ok(SUCCEEDED(hr), "Failed to set color key, hr %#x.\n", hr); + ok(SUCCEEDED(hr), "Failed to set color key, hr %#lx.\n", hr); memset(&color_key, 0, sizeof(color_key)); hr = IDirectDrawSurface_GetColorKey(surface, DDCKEY_SRCBLT, &color_key); - ok(SUCCEEDED(hr), "Failed to get color key, hr %#x.\n", hr); - ok(color_key.dwColorSpaceLowValue == 0x0000ff00, "Got unexpected value 0x%08x.\n", + ok(SUCCEEDED(hr), "Failed to get color key, hr %#lx.\n", hr); + ok(color_key.dwColorSpaceLowValue == 0x0000ff00, "Got unexpected value 0x%08lx.\n", color_key.dwColorSpaceLowValue); - ok(color_key.dwColorSpaceHighValue == 0x0000ff00, "Got unexpected value 0x%08x.\n", + ok(color_key.dwColorSpaceHighValue == 0x0000ff00, "Got unexpected value 0x%08lx.\n", color_key.dwColorSpaceHighValue); hr = IDirectDrawSurface_GetAttachedSurface(surface, &caps, &tmp); - ok(SUCCEEDED(hr), "Failed to get attached surface, hr %#x.\n", hr); + ok(SUCCEEDED(hr), "Failed to get attached surface, hr %#lx.\n", hr); hr = IDirectDrawSurface_GetColorKey(tmp, DDCKEY_SRCBLT, &color_key); - ok(hr == DDERR_NOCOLORKEY, "Got unexpected hr %#x, i %u.\n", hr, i); + ok(hr == DDERR_NOCOLORKEY, "Got unexpected hr %#lx, i %u.\n", hr, i); color_key.dwColorSpaceLowValue = 0x0000ff00; color_key.dwColorSpaceHighValue = 0x0000ff00; hr = IDirectDrawSurface_SetColorKey(tmp, DDCKEY_SRCBLT, &color_key); - ok(SUCCEEDED(hr), "Failed to set color key, hr %#x.\n", hr); + ok(SUCCEEDED(hr), "Failed to set color key, hr %#lx.\n", hr); memset(&color_key, 0, sizeof(color_key)); hr = IDirectDrawSurface_GetColorKey(tmp, DDCKEY_SRCBLT, &color_key); - ok(SUCCEEDED(hr), "Failed to get color key, hr %#x.\n", hr); - ok(color_key.dwColorSpaceLowValue == 0x0000ff00, "Got unexpected value 0x%08x.\n", + ok(SUCCEEDED(hr), "Failed to get color key, hr %#lx.\n", hr); + ok(color_key.dwColorSpaceLowValue == 0x0000ff00, "Got unexpected value 0x%08lx.\n", color_key.dwColorSpaceLowValue); - ok(color_key.dwColorSpaceHighValue == 0x0000ff00, "Got unexpected value 0x%08x.\n", + ok(color_key.dwColorSpaceHighValue == 0x0000ff00, "Got unexpected value 0x%08lx.\n", color_key.dwColorSpaceHighValue); IDirectDrawSurface_Release(tmp); refcount = IDirectDrawSurface_Release(surface); - ok(!refcount, "Got unexpected refcount %u.\n", refcount); + ok(!refcount, "Got unexpected refcount %lu.\n", refcount); refcount = IDirectDraw2_Release(ddraw); - ok(!refcount, "Got unexpected refcount %u.\n", refcount); + ok(!refcount, "Got unexpected refcount %lu.\n", refcount); DestroyWindow(window); } @@ -2360,13 +2353,13 @@ static void test_qi(const char *test_name, IUnknown *base_iface, for (i = 0; i < entry_count; ++i) { hr = IUnknown_QueryInterface(base_iface, tests[i].iid, (void **)&iface1); - ok(hr == tests[i].hr, "Got hr %#x for test \"%s\" %u.\n", hr, test_name, i); + ok(hr == tests[i].hr, "Got hr %#lx for test \"%s\" %u.\n", hr, test_name, i); if (SUCCEEDED(hr)) { for (j = 0; j < entry_count; ++j) { hr = IUnknown_QueryInterface(iface1, tests[j].iid, (void **)&iface2); - ok(hr == tests[j].hr, "Got hr %#x for test \"%s\" %u, %u.\n", hr, test_name, i, j); + ok(hr == tests[j].hr, "Got hr %#lx for test \"%s\" %u, %u.\n", hr, test_name, i, j); if (SUCCEEDED(hr)) { expected_refcount = 0; @@ -2375,7 +2368,7 @@ static void test_qi(const char *test_name, IUnknown *base_iface, if (IsEqualGUID(tests[i].refcount_iid, tests[j].refcount_iid)) ++expected_refcount; refcount = IUnknown_Release(iface2); - ok(refcount == expected_refcount, "Got refcount %u for test \"%s\" %u, %u, expected %u.\n", + ok(refcount == expected_refcount, "Got refcount %lu for test \"%s\" %u, %u, expected %lu.\n", refcount, test_name, i, j, expected_refcount); } } @@ -2384,7 +2377,7 @@ static void test_qi(const char *test_name, IUnknown *base_iface, if (IsEqualGUID(refcount_iid, tests[i].refcount_iid)) ++expected_refcount; refcount = IUnknown_Release(iface1); - ok(refcount == expected_refcount, "Got refcount %u for test \"%s\" %u, expected %u.\n", + ok(refcount == expected_refcount, "Got refcount %lu for test \"%s\" %u, expected %lu.\n", refcount, test_name, i, expected_refcount); } } @@ -2467,9 +2460,9 @@ static void test_surface_qi(void) surface_desc.dwWidth = 512; surface_desc.dwHeight = 512; hr = IDirectDraw2_CreateSurface(ddraw, &surface_desc, (IDirectDrawSurface **)0xdeadbeef, NULL); - ok(hr == E_INVALIDARG, "Got unexpected hr %#x.\n", hr); + ok(hr == E_INVALIDARG, "Got unexpected hr %#lx.\n", hr); hr = IDirectDraw2_CreateSurface(ddraw, &surface_desc, &surface, NULL); - ok(SUCCEEDED(hr), "Failed to create surface, hr %#x.\n", hr); + ok(SUCCEEDED(hr), "Failed to create surface, hr %#lx.\n", hr); test_qi("surface_qi", (IUnknown *)surface, &IID_IDirectDrawSurface, tests, ARRAY_SIZE(tests)); @@ -2580,36 +2573,36 @@ static void test_wndproc(void) WS_MAXIMIZE | WS_CAPTION , 0, 0, 640, 480, 0, 0, 0, 0); proc = GetWindowLongPtrA(window, GWLP_WNDPROC); - ok(proc == (LONG_PTR)test_proc, "Expected wndproc %#lx, got %#lx.\n", + ok(proc == (LONG_PTR)test_proc, "Expected wndproc %#Ix, got %#Ix.\n", (LONG_PTR)test_proc, proc); expect_messages = messages; hr = IDirectDraw2_SetCooperativeLevel(ddraw, window, DDSCL_EXCLUSIVE | DDSCL_FULLSCREEN); - ok(SUCCEEDED(hr), "SetCooperativeLevel failed, hr %#x.\n", hr); + ok(SUCCEEDED(hr), "SetCooperativeLevel failed, hr %#lx.\n", hr); ok(!expect_messages->message, "Expected message %#x, but didn't receive it.\n", expect_messages->message); expect_messages = NULL; proc = GetWindowLongPtrA(window, GWLP_WNDPROC); - ok(proc != (LONG_PTR)test_proc, "Expected wndproc != %#lx, got %#lx.\n", + ok(proc != (LONG_PTR)test_proc, "Expected wndproc != %#Ix, got %#Ix.\n", (LONG_PTR)test_proc, proc); ref = IDirectDraw2_Release(ddraw); - ok(ref == 0, "The ddraw object was not properly freed: refcount %u.\n", ref); + ok(!ref, "Unexpected refcount %lu.\n", ref); proc = GetWindowLongPtrA(window, GWLP_WNDPROC); - ok(proc == (LONG_PTR)test_proc, "Expected wndproc %#lx, got %#lx.\n", + ok(proc == (LONG_PTR)test_proc, "Expected wndproc %#Ix, got %#Ix.\n", (LONG_PTR)test_proc, proc); /* DDSCL_NORMAL doesn't. */ ddraw = create_ddraw(); proc = GetWindowLongPtrA(window, GWLP_WNDPROC); - ok(proc == (LONG_PTR)test_proc, "Expected wndproc %#lx, got %#lx.\n", + ok(proc == (LONG_PTR)test_proc, "Expected wndproc %#Ix, got %#Ix.\n", (LONG_PTR)test_proc, proc); hr = IDirectDraw2_SetCooperativeLevel(ddraw, window, DDSCL_NORMAL | DDSCL_FULLSCREEN); - ok(SUCCEEDED(hr), "SetCooperativeLevel failed, hr %#x.\n", hr); + ok(SUCCEEDED(hr), "SetCooperativeLevel failed, hr %#lx.\n", hr); proc = GetWindowLongPtrA(window, GWLP_WNDPROC); - ok(proc == (LONG_PTR)test_proc, "Expected wndproc %#lx, got %#lx.\n", + ok(proc == (LONG_PTR)test_proc, "Expected wndproc %#Ix, got %#Ix.\n", (LONG_PTR)test_proc, proc); ref = IDirectDraw2_Release(ddraw); - ok(ref == 0, "The ddraw object was not properly freed: refcount %u.\n", ref); + ok(!ref, "Unexpected refcount %lu.\n", ref); proc = GetWindowLongPtrA(window, GWLP_WNDPROC); - ok(proc == (LONG_PTR)test_proc, "Expected wndproc %#lx, got %#lx.\n", + ok(proc == (LONG_PTR)test_proc, "Expected wndproc %#Ix, got %#Ix.\n", (LONG_PTR)test_proc, proc); /* The original window proc is only restored by ddraw if the current @@ -2617,53 +2610,53 @@ static void test_wndproc(void) * from DDSCL_NORMAL to DDSCL_EXCLUSIVE. */ ddraw = create_ddraw(); proc = GetWindowLongPtrA(window, GWLP_WNDPROC); - ok(proc == (LONG_PTR)test_proc, "Expected wndproc %#lx, got %#lx.\n", + ok(proc == (LONG_PTR)test_proc, "Expected wndproc %#Ix, got %#Ix.\n", (LONG_PTR)test_proc, proc); hr = IDirectDraw2_SetCooperativeLevel(ddraw, window, DDSCL_EXCLUSIVE | DDSCL_FULLSCREEN); - ok(SUCCEEDED(hr), "SetCooperativeLevel failed, hr %#x.\n", hr); + ok(SUCCEEDED(hr), "SetCooperativeLevel failed, hr %#lx.\n", hr); proc = GetWindowLongPtrA(window, GWLP_WNDPROC); - ok(proc != (LONG_PTR)test_proc, "Expected wndproc != %#lx, got %#lx.\n", + ok(proc != (LONG_PTR)test_proc, "Expected wndproc != %#Ix, got %#Ix.\n", (LONG_PTR)test_proc, proc); ddraw_proc = proc; hr = IDirectDraw2_SetCooperativeLevel(ddraw, window, DDSCL_NORMAL); - ok(SUCCEEDED(hr), "SetCooperativeLevel failed, hr %#x.\n", hr); + ok(SUCCEEDED(hr), "SetCooperativeLevel failed, hr %#lx.\n", hr); proc = GetWindowLongPtrA(window, GWLP_WNDPROC); - ok(proc == (LONG_PTR)test_proc, "Expected wndproc %#lx, got %#lx.\n", + ok(proc == (LONG_PTR)test_proc, "Expected wndproc %#Ix, got %#Ix.\n", (LONG_PTR)test_proc, proc); hr = IDirectDraw2_SetCooperativeLevel(ddraw, window, DDSCL_EXCLUSIVE | DDSCL_FULLSCREEN); - ok(SUCCEEDED(hr), "SetCooperativeLevel failed, hr %#x.\n", hr); + ok(SUCCEEDED(hr), "SetCooperativeLevel failed, hr %#lx.\n", hr); proc = SetWindowLongPtrA(window, GWLP_WNDPROC, (LONG_PTR)DefWindowProcA); - ok(proc != (LONG_PTR)test_proc, "Expected wndproc != %#lx, got %#lx.\n", + ok(proc != (LONG_PTR)test_proc, "Expected wndproc != %#Ix, got %#Ix.\n", (LONG_PTR)test_proc, proc); hr = IDirectDraw2_SetCooperativeLevel(ddraw, window, DDSCL_NORMAL); - ok(SUCCEEDED(hr), "SetCooperativeLevel failed, hr %#x.\n", hr); + ok(SUCCEEDED(hr), "SetCooperativeLevel failed, hr %#lx.\n", hr); proc = GetWindowLongPtrA(window, GWLP_WNDPROC); - ok(proc == (LONG_PTR)DefWindowProcA, "Expected wndproc %#lx, got %#lx.\n", + ok(proc == (LONG_PTR)DefWindowProcA, "Expected wndproc %#Ix, got %#Ix.\n", (LONG_PTR)DefWindowProcA, proc); hr = IDirectDraw2_SetCooperativeLevel(ddraw, window, DDSCL_EXCLUSIVE | DDSCL_FULLSCREEN); - ok(SUCCEEDED(hr), "SetCooperativeLevel failed, hr %#x.\n", hr); + ok(SUCCEEDED(hr), "SetCooperativeLevel failed, hr %#lx.\n", hr); proc = SetWindowLongPtrA(window, GWLP_WNDPROC, ddraw_proc); - ok(proc == (LONG_PTR)DefWindowProcA, "Expected wndproc %#lx, got %#lx.\n", + ok(proc == (LONG_PTR)DefWindowProcA, "Expected wndproc %#Ix, got %#Ix.\n", (LONG_PTR)DefWindowProcA, proc); ref = IDirectDraw2_Release(ddraw); - ok(ref == 0, "The ddraw object was not properly freed: refcount %u.\n", ref); + ok(!ref, "Unexpected refcount %lu.\n", ref); proc = GetWindowLongPtrA(window, GWLP_WNDPROC); - ok(proc == (LONG_PTR)test_proc, "Expected wndproc %#lx, got %#lx.\n", + ok(proc == (LONG_PTR)test_proc, "Expected wndproc %#Ix, got %#Ix.\n", (LONG_PTR)test_proc, proc); ddraw = create_ddraw(); proc = GetWindowLongPtrA(window, GWLP_WNDPROC); - ok(proc == (LONG_PTR)test_proc, "Expected wndproc %#lx, got %#lx.\n", + ok(proc == (LONG_PTR)test_proc, "Expected wndproc %#Ix, got %#Ix.\n", (LONG_PTR)test_proc, proc); hr = IDirectDraw2_SetCooperativeLevel(ddraw, window, DDSCL_EXCLUSIVE | DDSCL_FULLSCREEN); - ok(SUCCEEDED(hr), "SetCooperativeLevel failed, hr %#x.\n", hr); + ok(SUCCEEDED(hr), "SetCooperativeLevel failed, hr %#lx.\n", hr); proc = SetWindowLongPtrA(window, GWLP_WNDPROC, (LONG_PTR)DefWindowProcA); - ok(proc != (LONG_PTR)test_proc, "Expected wndproc != %#lx, got %#lx.\n", + ok(proc != (LONG_PTR)test_proc, "Expected wndproc != %#Ix, got %#Ix.\n", (LONG_PTR)test_proc, proc); ref = IDirectDraw2_Release(ddraw); - ok(ref == 0, "The ddraw object was not properly freed: refcount %u.\n", ref); + ok(!ref, "Unexpected refcount %lu.\n", ref); proc = GetWindowLongPtrA(window, GWLP_WNDPROC); - ok(proc == (LONG_PTR)DefWindowProcA, "Expected wndproc %#lx, got %#lx.\n", + ok(proc == (LONG_PTR)DefWindowProcA, "Expected wndproc %#Ix, got %#Ix.\n", (LONG_PTR)DefWindowProcA, proc); fix_wndproc(window, (LONG_PTR)test_proc); @@ -2694,12 +2687,12 @@ static void test_window_style(void) SetRect(&fullscreen_rect, 0, 0, registry_mode.dmPelsWidth, registry_mode.dmPelsHeight); hr = IDirectDraw2_SetCooperativeLevel(ddraw, window, DDSCL_EXCLUSIVE | DDSCL_FULLSCREEN); - ok(SUCCEEDED(hr), "SetCooperativeLevel failed, hr %#x.\n", hr); + ok(SUCCEEDED(hr), "SetCooperativeLevel failed, hr %#lx.\n", hr); tmp = GetWindowLongA(window, GWL_STYLE); - todo_wine ok(tmp == style, "Expected window style %#x, got %#x.\n", style, tmp); + todo_wine ok(tmp == style, "Expected window style %#lx, got %#lx.\n", style, tmp); tmp = GetWindowLongA(window, GWL_EXSTYLE); - todo_wine ok(tmp == exstyle, "Expected window extended style %#x, got %#x.\n", exstyle, tmp); + todo_wine ok(tmp == exstyle, "Expected window extended style %#lx, got %#lx.\n", exstyle, tmp); GetWindowRect(window, &r); ok(EqualRect(&r, &fullscreen_rect), "Expected %s, got %s.\n", @@ -2711,9 +2704,9 @@ static void test_window_style(void) ok(ret, "Failed to set foreground window.\n"); tmp = GetWindowLongA(window, GWL_STYLE); - todo_wine ok(tmp == style, "Expected window style %#x, got %#x.\n", style, tmp); + todo_wine ok(tmp == style, "Expected window style %#lx, got %#lx.\n", style, tmp); tmp = GetWindowLongA(window, GWL_EXSTYLE); - todo_wine ok(tmp == exstyle, "Expected window extended style %#x, got %#x.\n", exstyle, tmp); + todo_wine ok(tmp == exstyle, "Expected window extended style %#lx, got %#lx.\n", exstyle, tmp); ret = SetForegroundWindow(window); ok(ret, "Failed to set foreground window.\n"); @@ -2722,77 +2715,77 @@ static void test_window_style(void) ShowWindow(window, SW_HIDE); hr = IDirectDraw2_SetCooperativeLevel(ddraw, window, DDSCL_NORMAL); - ok(SUCCEEDED(hr), "SetCooperativeLevel failed, hr %#x.\n", hr); + ok(SUCCEEDED(hr), "SetCooperativeLevel failed, hr %#lx.\n", hr); tmp = GetWindowLongA(window, GWL_STYLE); - ok(tmp == style, "Expected window style %#x, got %#x.\n", style, tmp); + ok(tmp == style, "Expected window style %#lx, got %#lx.\n", style, tmp); tmp = GetWindowLongA(window, GWL_EXSTYLE); - ok(tmp == exstyle, "Expected window extended style %#x, got %#x.\n", exstyle, tmp); + ok(tmp == exstyle, "Expected window extended style %#lx, got %#lx.\n", exstyle, tmp); hr = IDirectDraw2_SetCooperativeLevel(ddraw, window, DDSCL_EXCLUSIVE | DDSCL_FULLSCREEN | DDSCL_NOWINDOWCHANGES); - ok(SUCCEEDED(hr), "SetCooperativeLevel failed, hr %#x.\n", hr); + ok(SUCCEEDED(hr), "SetCooperativeLevel failed, hr %#lx.\n", hr); tmp = GetWindowLongA(window, GWL_STYLE); - todo_wine ok(tmp == style, "Expected window style %#x, got %#x.\n", style, tmp); + todo_wine ok(tmp == style, "Expected window style %#lx, got %#lx.\n", style, tmp); tmp = GetWindowLongA(window, GWL_EXSTYLE); - todo_wine ok(tmp == exstyle, "Expected window extended style %#x, got %#x.\n", exstyle, tmp); + todo_wine ok(tmp == exstyle, "Expected window extended style %#lx, got %#lx.\n", exstyle, tmp); hr = IDirectDraw2_SetCooperativeLevel(ddraw, window, DDSCL_EXCLUSIVE | DDSCL_FULLSCREEN); - ok(SUCCEEDED(hr), "SetCooperativeLevel failed, hr %#x.\n", hr); + ok(SUCCEEDED(hr), "SetCooperativeLevel failed, hr %#lx.\n", hr); tmp = GetWindowLongA(window, GWL_STYLE); expected_style = style | WS_VISIBLE; - todo_wine ok(tmp == expected_style, "Expected window style %#x, got %#x.\n", expected_style, tmp); + todo_wine ok(tmp == expected_style, "Expected window style %#lx, got %#lx.\n", expected_style, tmp); tmp = GetWindowLongA(window, GWL_EXSTYLE); expected_style = exstyle | WS_EX_TOPMOST; - todo_wine ok(tmp == expected_style, "Expected window extended style %#x, got %#x.\n", expected_style, tmp); + todo_wine ok(tmp == expected_style, "Expected window extended style %#lx, got %#lx.\n", expected_style, tmp); ShowWindow(window, SW_HIDE); tmp = GetWindowLongA(window, GWL_STYLE); - todo_wine ok(tmp == style, "Expected window style %#x, got %#x.\n", style, tmp); + todo_wine ok(tmp == style, "Expected window style %#lx, got %#lx.\n", style, tmp); tmp = GetWindowLongA(window, GWL_EXSTYLE); expected_style = exstyle | WS_EX_TOPMOST; - todo_wine ok(tmp == expected_style, "Expected window extended style %#x, got %#x.\n", expected_style, tmp); + todo_wine ok(tmp == expected_style, "Expected window extended style %#lx, got %#lx.\n", expected_style, tmp); hr = IDirectDraw2_SetCooperativeLevel(ddraw, window, DDSCL_NORMAL | DDSCL_NOWINDOWCHANGES); - ok(SUCCEEDED(hr), "SetCooperativeLevel failed, hr %#x.\n", hr); + ok(SUCCEEDED(hr), "SetCooperativeLevel failed, hr %#lx.\n", hr); tmp = GetWindowLongA(window, GWL_STYLE); - ok(tmp == style, "Expected window style %#x, got %#x.\n", style, tmp); + ok(tmp == style, "Expected window style %#lx, got %#lx.\n", style, tmp); tmp = GetWindowLongA(window, GWL_EXSTYLE); expected_style = exstyle | WS_EX_TOPMOST; - ok(tmp == expected_style, "Expected window extended style %#x, got %#x.\n", expected_style, tmp); + ok(tmp == expected_style, "Expected window extended style %#lx, got %#lx.\n", expected_style, tmp); hr = IDirectDraw2_SetCooperativeLevel(ddraw, window, DDSCL_NORMAL); - ok(SUCCEEDED(hr), "SetCooperativeLevel failed, hr %#x.\n", hr); + ok(SUCCEEDED(hr), "SetCooperativeLevel failed, hr %#lx.\n", hr); tmp = GetWindowLongA(window, GWL_STYLE); - ok(tmp == style, "Expected window style %#x, got %#x.\n", style, tmp); + ok(tmp == style, "Expected window style %#lx, got %#lx.\n", style, tmp); tmp = GetWindowLongA(window, GWL_EXSTYLE); expected_style = exstyle | WS_EX_TOPMOST; - ok(tmp == expected_style, "Expected window extended style %#x, got %#x.\n", expected_style, tmp); + ok(tmp == expected_style, "Expected window extended style %#lx, got %#lx.\n", expected_style, tmp); ret = SetForegroundWindow(window); ok(ret, "Failed to set foreground window.\n"); hr = IDirectDraw2_SetCooperativeLevel(ddraw, window, DDSCL_EXCLUSIVE | DDSCL_FULLSCREEN); - ok(SUCCEEDED(hr), "SetCooperativeLevel failed, hr %#x.\n", hr); + ok(SUCCEEDED(hr), "SetCooperativeLevel failed, hr %#lx.\n", hr); tmp = GetWindowLongA(window, GWL_STYLE); expected_style = style | WS_VISIBLE; - todo_wine ok(tmp == expected_style, "Expected window style %#x, got %#x.\n", expected_style, tmp); + todo_wine ok(tmp == expected_style, "Expected window style %#lx, got %#lx.\n", expected_style, tmp); tmp = GetWindowLongA(window, GWL_EXSTYLE); expected_style = exstyle | WS_EX_TOPMOST; - todo_wine ok(tmp == expected_style, "Expected window extended style %#x, got %#x.\n", expected_style, tmp); + todo_wine ok(tmp == expected_style, "Expected window extended style %#lx, got %#lx.\n", expected_style, tmp); ShowWindow(window, SW_HIDE); hr = IDirectDraw2_SetCooperativeLevel(ddraw, window, DDSCL_NORMAL); - ok(SUCCEEDED(hr), "SetCooperativeLevel failed, hr %#x.\n", hr); + ok(SUCCEEDED(hr), "SetCooperativeLevel failed, hr %#lx.\n", hr); tmp = GetWindowLongA(window, GWL_STYLE); - ok(tmp == style, "Expected window style %#x, got %#x.\n", style, tmp); + ok(tmp == style, "Expected window style %#lx, got %#lx.\n", style, tmp); tmp = GetWindowLongA(window, GWL_EXSTYLE); - ok(tmp == exstyle, "Expected window extended style %#x, got %#x.\n", exstyle, tmp); + ok(tmp == exstyle, "Expected window extended style %#lx, got %#lx.\n", exstyle, tmp); ShowWindow(window, SW_SHOW); ret = SetForegroundWindow(GetDesktopWindow()); @@ -2800,20 +2793,20 @@ static void test_window_style(void) SetActiveWindow(window); ok(GetActiveWindow() == window, "Unexpected active window.\n"); hr = IDirectDraw2_SetCooperativeLevel(ddraw, window, DDSCL_EXCLUSIVE | DDSCL_FULLSCREEN); - ok(SUCCEEDED(hr), "SetCooperativeLevel failed, hr %#x.\n", hr); + ok(SUCCEEDED(hr), "SetCooperativeLevel failed, hr %#lx.\n", hr); tmp = GetWindowLongA(window, GWL_STYLE); expected_style = style | WS_VISIBLE; - todo_wine ok(tmp == expected_style, "Expected window style %#x, got %#x.\n", expected_style, tmp); + todo_wine ok(tmp == expected_style, "Expected window style %#lx, got %#lx.\n", expected_style, tmp); tmp = GetWindowLongA(window, GWL_EXSTYLE); - todo_wine ok(tmp == exstyle, "Expected window extended style %#x, got %#x.\n", exstyle, tmp); + todo_wine ok(tmp == exstyle, "Expected window extended style %#lx, got %#lx.\n", exstyle, tmp); GetWindowRect(window, &r); ok(EqualRect(&r, &fullscreen_rect), "Expected %s, got %s.\n", wine_dbgstr_rect(&fullscreen_rect), wine_dbgstr_rect(&r)); hr = IDirectDraw2_SetCooperativeLevel(ddraw, window, DDSCL_NORMAL); - ok(SUCCEEDED(hr), "SetCooperativeLevel failed, hr %#x.\n", hr); + ok(SUCCEEDED(hr), "SetCooperativeLevel failed, hr %#lx.\n", hr); SetWindowPos(window, NULL, 0, 0, 100, 100, SWP_NOZORDER | SWP_NOACTIVATE); GetWindowRect(window, &r); @@ -2823,13 +2816,13 @@ static void test_window_style(void) ret = SetForegroundWindow(window2); ok(ret, "Failed to set foreground window.\n"); hr = IDirectDraw2_SetCooperativeLevel(ddraw, window, DDSCL_EXCLUSIVE | DDSCL_FULLSCREEN); - ok(SUCCEEDED(hr), "SetCooperativeLevel failed, hr %#x.\n", hr); + ok(SUCCEEDED(hr), "SetCooperativeLevel failed, hr %#lx.\n", hr); tmp = GetWindowLongA(window, GWL_STYLE); expected_style = style | WS_VISIBLE; - todo_wine ok(tmp == expected_style, "Expected window style %#x, got %#x.\n", expected_style, tmp); + todo_wine ok(tmp == expected_style, "Expected window style %#lx, got %#lx.\n", expected_style, tmp); tmp = GetWindowLongA(window, GWL_EXSTYLE); - todo_wine ok(tmp == exstyle, "Expected window extended style %#x, got %#x.\n", exstyle, tmp); + todo_wine ok(tmp == exstyle, "Expected window extended style %#lx, got %#lx.\n", exstyle, tmp); GetWindowRect(window, &r); ok(EqualRect(&r, &fullscreen_rect), "Expected %s, got %s.\n", @@ -2838,46 +2831,46 @@ static void test_window_style(void) ret = SetForegroundWindow(window); ok(ret, "Failed to set foreground window.\n"); hr = IDirectDraw2_SetCooperativeLevel(ddraw, window, DDSCL_EXCLUSIVE | DDSCL_FULLSCREEN); - ok(SUCCEEDED(hr), "SetCooperativeLevel failed, hr %#x.\n", hr); + ok(SUCCEEDED(hr), "SetCooperativeLevel failed, hr %#lx.\n", hr); tmp = GetWindowLongA(window, GWL_STYLE); expected_style = style | WS_VISIBLE; - todo_wine ok(tmp == expected_style, "Expected window style %#x, got %#x.\n", expected_style, tmp); + todo_wine ok(tmp == expected_style, "Expected window style %#lx, got %#lx.\n", expected_style, tmp); tmp = GetWindowLongA(window, GWL_EXSTYLE); expected_style = exstyle | WS_EX_TOPMOST; - todo_wine ok(tmp == expected_style, "Expected window extended style %#x, got %#x.\n", expected_style, tmp); + todo_wine ok(tmp == expected_style, "Expected window extended style %#lx, got %#lx.\n", expected_style, tmp); ShowWindow(window, SW_HIDE); hr = IDirectDraw2_SetCooperativeLevel(ddraw, window, DDSCL_NORMAL); - ok(SUCCEEDED(hr), "SetCooperativeLevel failed, hr %#x.\n", hr); + ok(SUCCEEDED(hr), "SetCooperativeLevel failed, hr %#lx.\n", hr); tmp = GetWindowLongA(window, GWL_STYLE); - ok(tmp == style, "Expected window style %#x, got %#x.\n", style, tmp); + ok(tmp == style, "Expected window style %#lx, got %#lx.\n", style, tmp); tmp = GetWindowLongA(window, GWL_EXSTYLE); - ok(tmp == exstyle, "Expected window extended style %#x, got %#x.\n", exstyle, tmp); + ok(tmp == exstyle, "Expected window extended style %#lx, got %#lx.\n", exstyle, tmp); ShowWindow(window, SW_SHOW); hr = IDirectDraw2_SetCooperativeLevel(ddraw, window, DDSCL_EXCLUSIVE | DDSCL_FULLSCREEN); - ok(SUCCEEDED(hr), "SetCooperativeLevel failed, hr %#x.\n", hr); + ok(SUCCEEDED(hr), "SetCooperativeLevel failed, hr %#lx.\n", hr); tmp = GetWindowLongA(window, GWL_STYLE); expected_style = style | WS_VISIBLE; - todo_wine ok(tmp == expected_style, "Expected window style %#x, got %#x.\n", expected_style, tmp); + todo_wine ok(tmp == expected_style, "Expected window style %#lx, got %#lx.\n", expected_style, tmp); tmp = GetWindowLongA(window, GWL_EXSTYLE); expected_style = exstyle | WS_EX_TOPMOST; - todo_wine ok(tmp == expected_style, "Expected window extended style %#x, got %#x.\n", expected_style, tmp); + todo_wine ok(tmp == expected_style, "Expected window extended style %#lx, got %#lx.\n", expected_style, tmp); ret = SetForegroundWindow(GetDesktopWindow()); ok(ret, "Failed to set foreground window.\n"); tmp = GetWindowLongA(window, GWL_STYLE); expected_style = style | WS_VISIBLE | WS_MINIMIZE; - todo_wine ok(tmp == expected_style, "Expected window style %#x, got %#x.\n", expected_style, tmp); + todo_wine ok(tmp == expected_style, "Expected window style %#lx, got %#lx.\n", expected_style, tmp); tmp = GetWindowLongA(window, GWL_EXSTYLE); expected_style = exstyle | WS_EX_TOPMOST; - todo_wine ok(tmp == expected_style, "Expected window extended style %#x, got %#x.\n", expected_style, tmp); + todo_wine ok(tmp == expected_style, "Expected window extended style %#lx, got %#lx.\n", expected_style, tmp); ref = IDirectDraw2_Release(ddraw); - ok(ref == 0, "The ddraw object was not properly freed: refcount %u.\n", ref); + ok(!ref, "Unexpected refcount %lu.\n", ref); DestroyWindow(window2); DestroyWindow(window); @@ -2898,15 +2891,15 @@ static void test_redundant_mode_set(void) ok(!!ddraw, "Failed to create a ddraw object.\n"); hr = IDirectDraw2_SetCooperativeLevel(ddraw, window, DDSCL_EXCLUSIVE | DDSCL_FULLSCREEN); - ok(SUCCEEDED(hr), "SetCooperativeLevel failed, hr %#x.\n", hr); + ok(SUCCEEDED(hr), "SetCooperativeLevel failed, hr %#lx.\n", hr); surface_desc.dwSize = sizeof(surface_desc); hr = IDirectDraw2_GetDisplayMode(ddraw, &surface_desc); - ok(SUCCEEDED(hr), "GetDisplayMode failed, hr %#x.\n", hr); + ok(SUCCEEDED(hr), "GetDisplayMode failed, hr %#lx.\n", hr); hr = IDirectDraw2_SetDisplayMode(ddraw, surface_desc.dwWidth, surface_desc.dwHeight, U1(surface_desc.ddpfPixelFormat).dwRGBBitCount, 0, 0); - ok(SUCCEEDED(hr), "SetDisplayMode failed, hr %#x.\n", hr); + ok(SUCCEEDED(hr), "SetDisplayMode failed, hr %#lx.\n", hr); GetWindowRect(window, &q); r = q; @@ -2918,14 +2911,14 @@ static void test_redundant_mode_set(void) hr = IDirectDraw2_SetDisplayMode(ddraw, surface_desc.dwWidth, surface_desc.dwHeight, U1(surface_desc.ddpfPixelFormat).dwRGBBitCount, 0, 0); - ok(SUCCEEDED(hr), "SetDisplayMode failed, hr %#x.\n", hr); + ok(SUCCEEDED(hr), "SetDisplayMode failed, hr %#lx.\n", hr); GetWindowRect(window, &s); ok(EqualRect(&r, &s) || broken(EqualRect(&q, &s) /* Windows 10 */), "Expected %s, got %s.\n", wine_dbgstr_rect(&r), wine_dbgstr_rect(&s)); ref = IDirectDraw2_Release(ddraw); - ok(ref == 0, "The ddraw object was not properly freed: refcount %u.\n", ref); + ok(!ref, "Unexpected refcount %lu.\n", ref); DestroyWindow(window); } @@ -3075,10 +3068,10 @@ static void test_coop_level_mode_set(void) memset(&devmode, 0, sizeof(devmode)); devmode.dmSize = sizeof(devmode); ret = EnumDisplaySettingsW(NULL, ENUM_CURRENT_SETTINGS, &devmode); - ok(ret, "EnumDisplaySettingsW failed, error %#x.\n", GetLastError()); + ok(ret, "EnumDisplaySettingsW failed, error %lu.\n", GetLastError()); ok(compare_mode_rect(&devmode, ®istry_mode), "Got a different mode.\n"); ret = EnumDisplaySettingsW(NULL, ENUM_REGISTRY_SETTINGS, &devmode); - ok(ret, "EnumDisplaySettingsW failed, error %#x.\n", GetLastError()); + ok(ret, "EnumDisplaySettingsW failed, error %lu.\n", GetLastError()); ok(compare_mode_rect(&devmode, ®istry_mode), "Got a different mode.\n"); ret = save_display_modes(&original_modes, &display_count); @@ -3089,9 +3082,9 @@ static void test_coop_level_mode_set(void) memset(¶m, 0, sizeof(param)); hr = IDirectDraw2_EnumDisplayModes(ddraw, 0, NULL, ¶m, test_coop_level_mode_set_enum_cb); - ok(SUCCEEDED(hr), "Failed to enumerate display mode, hr %#x.\n", hr); + ok(SUCCEEDED(hr), "Failed to enumerate display mode, hr %#lx.\n", hr); ref = IDirectDraw2_Release(ddraw); - ok(ref == 0, "The ddraw object was not properly freed: refcount %u.\n", ref); + ok(!ref, "Unexpected refcount %lu.\n", ref); if (!param.user32_height) { @@ -3110,7 +3103,7 @@ static void test_coop_level_mode_set(void) devmode.dmPelsWidth = param.user32_width; devmode.dmPelsHeight = param.user32_height; change_ret = ChangeDisplaySettingsW(&devmode, CDS_FULLSCREEN); - ok(change_ret == DISP_CHANGE_SUCCESSFUL, "Failed to change display mode, ret %#x.\n", change_ret); + ok(change_ret == DISP_CHANGE_SUCCESSFUL, "Failed to change display mode, ret %#lx.\n", change_ret); ddraw = create_ddraw(); ok(!!ddraw, "Failed to create a ddraw object.\n"); @@ -3128,7 +3121,7 @@ static void test_coop_level_mode_set(void) 0, 0, 100, 100, 0, 0, 0, 0); hr = IDirectDraw2_SetCooperativeLevel(ddraw, window, DDSCL_EXCLUSIVE | DDSCL_FULLSCREEN); - ok(SUCCEEDED(hr), "SetCooperativeLevel failed, hr %#x.\n", hr); + ok(SUCCEEDED(hr), "SetCooperativeLevel failed, hr %#lx.\n", hr); GetWindowRect(window, &r); ok(EqualRect(&r, &user32_rect), "Expected %s, got %s.\n", wine_dbgstr_rect(&user32_rect), @@ -3140,12 +3133,12 @@ static void test_coop_level_mode_set(void) ddsd.ddsCaps.dwCaps = DDSCAPS_PRIMARYSURFACE; hr = IDirectDraw2_CreateSurface(ddraw, &ddsd, &primary, NULL); - ok(SUCCEEDED(hr), "Failed to create surface, hr %#x.\n",hr); + ok(SUCCEEDED(hr), "Failed to create surface, hr %#lx.\n",hr); hr = IDirectDrawSurface_GetSurfaceDesc(primary, &ddsd); - ok(SUCCEEDED(hr), "Failed to get surface desc, hr %#x.\n", hr); - ok(ddsd.dwWidth == param.user32_width, "Expected surface width %u, got %u.\n", + ok(SUCCEEDED(hr), "Failed to get surface desc, hr %#lx.\n", hr); + ok(ddsd.dwWidth == param.user32_width, "Expected surface width %lu, got %lu.\n", param.user32_width, ddsd.dwWidth); - ok(ddsd.dwHeight == param.user32_height, "Expected surface height %u, got %u.\n", + ok(ddsd.dwHeight == param.user32_height, "Expected surface height %lu, got %lu.\n", param.user32_height, ddsd.dwHeight); GetWindowRect(window, &r); @@ -3158,16 +3151,16 @@ static void test_coop_level_mode_set(void) screen_size.cy = 0; hr = IDirectDrawSurface_IsLost(primary); - ok(hr == DD_OK, "Got unexpected hr %#x.\n", hr); + ok(hr == DD_OK, "Got unexpected hr %#lx.\n", hr); hr = set_display_mode(ddraw, param.ddraw_width, param.ddraw_height); - ok(SUCCEEDED(hr), "Failed to set display mode, hr %#x.\n", hr); + ok(SUCCEEDED(hr), "Failed to set display mode, hr %#lx.\n", hr); hr = IDirectDrawSurface_IsLost(primary); - ok(hr == DDERR_SURFACELOST, "Got unexpected hr %#x.\n", hr); + ok(hr == DDERR_SURFACELOST, "Got unexpected hr %#lx.\n", hr); ok(!expect_messages->message, "Expected message %#x, but didn't receive it.\n", expect_messages->message); expect_messages = NULL; ok(screen_size.cx == param.ddraw_width && screen_size.cy == param.ddraw_height, - "Expected screen size %ux%u, got %ux%u.\n", + "Expected screen size %lux%lu, got %lux%lu.\n", param.ddraw_width, param.ddraw_height, screen_size.cx, screen_size.cy); GetWindowRect(window, &r); @@ -3175,10 +3168,10 @@ static void test_coop_level_mode_set(void) wine_dbgstr_rect(&r)); hr = IDirectDrawSurface_GetSurfaceDesc(primary, &ddsd); - ok(SUCCEEDED(hr), "Failed to get surface desc, hr %#x.\n", hr); - ok(ddsd.dwWidth == param.user32_width, "Expected surface width %u, got %u.\n", + ok(SUCCEEDED(hr), "Failed to get surface desc, hr %#lx.\n", hr); + ok(ddsd.dwWidth == param.user32_width, "Expected surface width %lu, got %lu.\n", param.user32_width, ddsd.dwWidth); - ok(ddsd.dwHeight == param.user32_height, "Expected surface height %u, got %u.\n", + ok(ddsd.dwHeight == param.user32_height, "Expected surface height %lu, got %lu.\n", param.user32_height, ddsd.dwHeight); IDirectDrawSurface_Release(primary); @@ -3188,12 +3181,12 @@ static void test_coop_level_mode_set(void) ddsd.ddsCaps.dwCaps = DDSCAPS_PRIMARYSURFACE; hr = IDirectDraw2_CreateSurface(ddraw, &ddsd, &primary, NULL); - ok(SUCCEEDED(hr), "Failed to create surface, hr %#x.\n",hr); + ok(SUCCEEDED(hr), "Failed to create surface, hr %#lx.\n",hr); hr = IDirectDrawSurface_GetSurfaceDesc(primary, &ddsd); - ok(SUCCEEDED(hr), "Failed to get surface desc, hr %#x.\n", hr); - ok(ddsd.dwWidth == param.ddraw_width, "Expected surface width %u, got %u.\n", + ok(SUCCEEDED(hr), "Failed to get surface desc, hr %#lx.\n", hr); + ok(ddsd.dwWidth == param.ddraw_width, "Expected surface width %lu, got %lu.\n", param.ddraw_width, ddsd.dwWidth); - ok(ddsd.dwHeight == param.ddraw_height, "Expected surface height %u, got %u.\n", + ok(ddsd.dwHeight == param.ddraw_height, "Expected surface height %lu, got %lu.\n", param.ddraw_height, ddsd.dwHeight); GetWindowRect(window, &r); @@ -3206,16 +3199,16 @@ static void test_coop_level_mode_set(void) screen_size.cy = 0; hr = IDirectDrawSurface_IsLost(primary); - ok(hr == DD_OK, "Got unexpected hr %#x.\n", hr); + ok(hr == DD_OK, "Got unexpected hr %#lx.\n", hr); change_ret = ChangeDisplaySettingsW(&devmode, CDS_FULLSCREEN); - ok(change_ret == DISP_CHANGE_SUCCESSFUL, "Failed to change display mode, ret %#x.\n", change_ret); + ok(change_ret == DISP_CHANGE_SUCCESSFUL, "Failed to change display mode, ret %#lx.\n", change_ret); hr = IDirectDrawSurface_IsLost(primary); - ok(hr == DDERR_SURFACELOST, "Got unexpected hr %#x.\n", hr); + ok(hr == DDERR_SURFACELOST, "Got unexpected hr %#lx.\n", hr); ok(!expect_messages->message, "Expected message %#x, but didn't receive it.\n", expect_messages->message); expect_messages = NULL; ok(screen_size.cx == param.user32_width && screen_size.cy == param.user32_height, - "Expected screen size %ux%u, got %ux%u.\n", + "Expected screen size %lux%lu, got %lux%lu.\n", param.user32_width, param.user32_height, screen_size.cx, screen_size.cy); GetWindowRect(window, &r); @@ -3231,7 +3224,7 @@ static void test_coop_level_mode_set(void) ret = EnumDisplaySettingsW(NULL, ENUM_CURRENT_SETTINGS, &devmode); ok(ret, "Failed to get display mode.\n"); ok(devmode.dmPelsWidth == registry_mode.dmPelsWidth - && devmode.dmPelsHeight == registry_mode.dmPelsHeight, "Got unexpected screen size %ux%u.\n", + && devmode.dmPelsHeight == registry_mode.dmPelsHeight, "Got unexpected screen size %lux%lu.\n", devmode.dmPelsWidth, devmode.dmPelsHeight); expect_messages = exclusive_focus_restore_messages; @@ -3244,11 +3237,11 @@ static void test_coop_level_mode_set(void) ret = EnumDisplaySettingsW(NULL, ENUM_CURRENT_SETTINGS, &devmode); ok(ret, "Failed to get display mode.\n"); ok(devmode.dmPelsWidth == param.ddraw_width - && devmode.dmPelsHeight == param.ddraw_height, "Got unexpected screen size %ux%u.\n", + && devmode.dmPelsHeight == param.ddraw_height, "Got unexpected screen size %lux%lu.\n", devmode.dmPelsWidth, devmode.dmPelsHeight); hr = IDirectDraw2_SetCooperativeLevel(ddraw, window, DDSCL_EXCLUSIVE | DDSCL_FULLSCREEN); - ok(SUCCEEDED(hr), "SetCooperativeLevel failed, hr %#x.\n", hr); + ok(SUCCEEDED(hr), "SetCooperativeLevel failed, hr %#lx.\n", hr); /* Normally the primary should be restored here. Unfortunately this causes the * GetSurfaceDesc call after the next display mode change to crash on the Windows 8 * testbot. Another Restore call would presumably avoid the crash, but it also moots @@ -3270,7 +3263,7 @@ static void test_coop_level_mode_set(void) expect_messages = NULL; hr = IDirectDraw2_SetCooperativeLevel(ddraw, window, DDSCL_EXCLUSIVE | DDSCL_FULLSCREEN); - ok(SUCCEEDED(hr), "SetCooperativeLevel failed, hr %#x.\n", hr); + ok(SUCCEEDED(hr), "SetCooperativeLevel failed, hr %#lx.\n", hr); PeekMessageA(&msg, 0, 0, 0, PM_NOREMOVE); expect_messages = exclusive_messages; @@ -3278,17 +3271,17 @@ static void test_coop_level_mode_set(void) screen_size.cy = 0; hr = IDirectDrawSurface_IsLost(primary); - ok(hr == DDERR_SURFACELOST, "Got unexpected hr %#x.\n", hr); + ok(hr == DDERR_SURFACELOST, "Got unexpected hr %#lx.\n", hr); hr = IDirectDraw2_RestoreDisplayMode(ddraw); - ok(SUCCEEDED(hr), "RestoreDisplayMode failed, hr %#x.\n", hr); + ok(SUCCEEDED(hr), "RestoreDisplayMode failed, hr %#lx.\n", hr); hr = IDirectDrawSurface_IsLost(primary); - ok(hr == DDERR_SURFACELOST, "Got unexpected hr %#x.\n", hr); + ok(hr == DDERR_SURFACELOST, "Got unexpected hr %#lx.\n", hr); ok(!expect_messages->message, "Expected message %#x, but didn't receive it.\n", expect_messages->message); expect_messages = NULL; ok(screen_size.cx == registry_mode.dmPelsWidth && screen_size.cy == registry_mode.dmPelsHeight, - "Expected screen size %ux%u, got %ux%u.\n", + "Expected screen size %lux%lu, got %lux%lu.\n", registry_mode.dmPelsWidth, registry_mode.dmPelsHeight, screen_size.cx, screen_size.cy); GetWindowRect(window, &r); @@ -3296,16 +3289,16 @@ static void test_coop_level_mode_set(void) wine_dbgstr_rect(&r)); hr = IDirectDrawSurface_GetSurfaceDesc(primary, &ddsd); - ok(SUCCEEDED(hr), "Failed to get surface desc, hr %#x.\n", hr); - ok(ddsd.dwWidth == param.ddraw_width, "Expected surface width %u, got %u.\n", + ok(SUCCEEDED(hr), "Failed to get surface desc, hr %#lx.\n", hr); + ok(ddsd.dwWidth == param.ddraw_width, "Expected surface width %lu, got %lu.\n", param.ddraw_width, ddsd.dwWidth); - ok(ddsd.dwHeight == param.ddraw_height, "Expected surface height %u, got %u.\n", + ok(ddsd.dwHeight == param.ddraw_height, "Expected surface height %lu, got %lu.\n", param.ddraw_height, ddsd.dwHeight); IDirectDrawSurface_Release(primary); /* For Wine. */ change_ret = ChangeDisplaySettingsW(NULL, CDS_FULLSCREEN); - ok(change_ret == DISP_CHANGE_SUCCESSFUL, "Failed to change display mode, ret %#x.\n", change_ret); + ok(change_ret == DISP_CHANGE_SUCCESSFUL, "Failed to change display mode, ret %#lx.\n", change_ret); memset(&ddsd, 0, sizeof(ddsd)); ddsd.dwSize = sizeof(ddsd); @@ -3313,12 +3306,12 @@ static void test_coop_level_mode_set(void) ddsd.ddsCaps.dwCaps = DDSCAPS_PRIMARYSURFACE; hr = IDirectDraw2_CreateSurface(ddraw, &ddsd, &primary, NULL); - ok(SUCCEEDED(hr), "Failed to create surface, hr %#x.\n",hr); + ok(SUCCEEDED(hr), "Failed to create surface, hr %#lx.\n",hr); hr = IDirectDrawSurface_GetSurfaceDesc(primary, &ddsd); - ok(SUCCEEDED(hr), "Failed to get surface desc, hr %#x.\n", hr); - ok(ddsd.dwWidth == registry_mode.dmPelsWidth, "Expected surface width %u, got %u.\n", + ok(SUCCEEDED(hr), "Failed to get surface desc, hr %#lx.\n", hr); + ok(ddsd.dwWidth == registry_mode.dmPelsWidth, "Expected surface width %lu, got %lu.\n", registry_mode.dmPelsWidth, ddsd.dwWidth); - ok(ddsd.dwHeight == registry_mode.dmPelsHeight, "Expected surface height %u, got %u.\n", + ok(ddsd.dwHeight == registry_mode.dmPelsHeight, "Expected surface height %lu, got %lu.\n", registry_mode.dmPelsHeight, ddsd.dwHeight); GetWindowRect(window, &r); @@ -3326,17 +3319,17 @@ static void test_coop_level_mode_set(void) wine_dbgstr_rect(&r)); hr = IDirectDraw2_SetCooperativeLevel(ddraw, window, DDSCL_NORMAL); - ok(SUCCEEDED(hr), "SetCooperativeLevel failed, hr %#x.\n", hr); + ok(SUCCEEDED(hr), "SetCooperativeLevel failed, hr %#lx.\n", hr); GetWindowRect(window, &r); ok(EqualRect(&r, ®istry_rect), "Expected %s, got %s.\n", wine_dbgstr_rect(®istry_rect), wine_dbgstr_rect(&r)); hr = IDirectDrawSurface_GetSurfaceDesc(primary, &ddsd); - ok(SUCCEEDED(hr), "Failed to get surface desc, hr %#x.\n", hr); - ok(ddsd.dwWidth == registry_mode.dmPelsWidth, "Expected surface width %u, got %u.\n", + ok(SUCCEEDED(hr), "Failed to get surface desc, hr %#lx.\n", hr); + ok(ddsd.dwWidth == registry_mode.dmPelsWidth, "Expected surface width %lu, got %lu.\n", registry_mode.dmPelsWidth, ddsd.dwWidth); - ok(ddsd.dwHeight == registry_mode.dmPelsHeight, "Expected surface height %u, got %u.\n", + ok(ddsd.dwHeight == registry_mode.dmPelsHeight, "Expected surface height %lu, got %lu.\n", registry_mode.dmPelsHeight, ddsd.dwHeight); IDirectDrawSurface_Release(primary); @@ -3346,12 +3339,12 @@ static void test_coop_level_mode_set(void) ddsd.ddsCaps.dwCaps = DDSCAPS_PRIMARYSURFACE; hr = IDirectDraw2_CreateSurface(ddraw, &ddsd, &primary, NULL); - ok(SUCCEEDED(hr), "Failed to create surface, hr %#x.\n",hr); + ok(SUCCEEDED(hr), "Failed to create surface, hr %#lx.\n",hr); hr = IDirectDrawSurface_GetSurfaceDesc(primary, &ddsd); - ok(SUCCEEDED(hr), "Failed to get surface desc, hr %#x.\n", hr); - ok(ddsd.dwWidth == registry_mode.dmPelsWidth, "Expected surface width %u, got %u.\n", + ok(SUCCEEDED(hr), "Failed to get surface desc, hr %#lx.\n", hr); + ok(ddsd.dwWidth == registry_mode.dmPelsWidth, "Expected surface width %lu, got %lu.\n", registry_mode.dmPelsWidth, ddsd.dwWidth); - ok(ddsd.dwHeight == registry_mode.dmPelsHeight, "Expected surface height %u, got %u.\n", + ok(ddsd.dwHeight == registry_mode.dmPelsHeight, "Expected surface height %lu, got %lu.\n", registry_mode.dmPelsHeight, ddsd.dwHeight); GetWindowRect(window, &r); @@ -3364,18 +3357,18 @@ static void test_coop_level_mode_set(void) screen_size.cy = 0; hr = IDirectDrawSurface_IsLost(primary); - ok(hr == DD_OK, "Got unexpected hr %#x.\n", hr); + ok(hr == DD_OK, "Got unexpected hr %#lx.\n", hr); devmode.dmFields = DM_PELSWIDTH | DM_PELSHEIGHT; devmode.dmPelsWidth = param.user32_width; devmode.dmPelsHeight = param.user32_height; change_ret = ChangeDisplaySettingsW(&devmode, CDS_FULLSCREEN); - ok(change_ret == DISP_CHANGE_SUCCESSFUL, "Failed to change display mode, ret %#x.\n", change_ret); + ok(change_ret == DISP_CHANGE_SUCCESSFUL, "Failed to change display mode, ret %#lx.\n", change_ret); hr = IDirectDrawSurface_IsLost(primary); - todo_wine ok(hr == DDERR_SURFACELOST, "Got unexpected hr %#x.\n", hr); + todo_wine ok(hr == DDERR_SURFACELOST, "Got unexpected hr %#lx.\n", hr); ok(!expect_messages->message, "Expected message %#x, but didn't receive it.\n", expect_messages->message); expect_messages = NULL; - ok(!screen_size.cx && !screen_size.cy, "Got unexpected screen size %ux%u.\n", screen_size.cx, screen_size.cy); + ok(!screen_size.cx && !screen_size.cy, "Got unexpected screen size %lux%lu.\n", screen_size.cx, screen_size.cy); GetWindowRect(window, &r); ok(EqualRect(&r, ®istry_rect), "Expected %s, got %s.\n", wine_dbgstr_rect(®istry_rect), @@ -3387,7 +3380,7 @@ static void test_coop_level_mode_set(void) screen_size.cy = 0; hr = IDirectDrawSurface_Restore(primary); - ok(hr == DDERR_WRONGMODE, "Got unexpected hr %#x.\n", hr); + ok(hr == DDERR_WRONGMODE, "Got unexpected hr %#lx.\n", hr); hr = set_display_mode(ddraw, param.ddraw_width, param.ddraw_height); if (hr == DDERR_NOEXCLUSIVEMODE /* NT4 testbot */) { @@ -3396,25 +3389,25 @@ static void test_coop_level_mode_set(void) IDirectDraw2_Release(ddraw); goto done; } - ok(SUCCEEDED(hr), "Failed to set display mode, hr %#x.\n", hr); + ok(SUCCEEDED(hr), "Failed to set display mode, hr %#lx.\n", hr); hr = IDirectDrawSurface_Restore(primary); - ok(hr == DDERR_WRONGMODE, "Got unexpected hr %#x.\n", hr); + ok(hr == DDERR_WRONGMODE, "Got unexpected hr %#lx.\n", hr); hr = IDirectDrawSurface_IsLost(primary); - ok(hr == DDERR_SURFACELOST, "Got unexpected hr %#x.\n", hr); + ok(hr == DDERR_SURFACELOST, "Got unexpected hr %#lx.\n", hr); ok(!expect_messages->message, "Expected message %#x, but didn't receive it.\n", expect_messages->message); expect_messages = NULL; - ok(!screen_size.cx && !screen_size.cy, "Got unexpected screen size %ux%u.\n", screen_size.cx, screen_size.cy); + ok(!screen_size.cx && !screen_size.cy, "Got unexpected screen size %lux%lu.\n", screen_size.cx, screen_size.cy); GetWindowRect(window, &r); ok(EqualRect(&r, ®istry_rect), "Expected %s, got %s.\n", wine_dbgstr_rect(®istry_rect), wine_dbgstr_rect(&r)); hr = IDirectDrawSurface_GetSurfaceDesc(primary, &ddsd); - ok(SUCCEEDED(hr), "Failed to get surface desc, hr %#x.\n", hr); - ok(ddsd.dwWidth == registry_mode.dmPelsWidth, "Expected surface width %u, got %u.\n", + ok(SUCCEEDED(hr), "Failed to get surface desc, hr %#lx.\n", hr); + ok(ddsd.dwWidth == registry_mode.dmPelsWidth, "Expected surface width %lu, got %lu.\n", registry_mode.dmPelsWidth, ddsd.dwWidth); - ok(ddsd.dwHeight == registry_mode.dmPelsHeight, "Expected surface height %u, got %u.\n", + ok(ddsd.dwHeight == registry_mode.dmPelsHeight, "Expected surface height %lu, got %lu.\n", registry_mode.dmPelsHeight, ddsd.dwHeight); IDirectDrawSurface_Release(primary); @@ -3424,12 +3417,12 @@ static void test_coop_level_mode_set(void) ddsd.ddsCaps.dwCaps = DDSCAPS_PRIMARYSURFACE; hr = IDirectDraw2_CreateSurface(ddraw, &ddsd, &primary, NULL); - ok(SUCCEEDED(hr), "Failed to create surface, hr %#x.\n",hr); + ok(SUCCEEDED(hr), "Failed to create surface, hr %#lx.\n",hr); hr = IDirectDrawSurface_GetSurfaceDesc(primary, &ddsd); - ok(SUCCEEDED(hr), "Failed to get surface desc, hr %#x.\n", hr); - ok(ddsd.dwWidth == param.ddraw_width, "Expected surface width %u, got %u.\n", + ok(SUCCEEDED(hr), "Failed to get surface desc, hr %#lx.\n", hr); + ok(ddsd.dwWidth == param.ddraw_width, "Expected surface width %lu, got %lu.\n", param.ddraw_width, ddsd.dwWidth); - ok(ddsd.dwHeight == param.ddraw_height, "Expected surface height %u, got %u.\n", + ok(ddsd.dwHeight == param.ddraw_height, "Expected surface height %lu, got %lu.\n", param.ddraw_height, ddsd.dwHeight); GetWindowRect(window, &r); @@ -3442,25 +3435,25 @@ static void test_coop_level_mode_set(void) screen_size.cy = 0; hr = IDirectDrawSurface_IsLost(primary); - ok(hr == DD_OK, "Got unexpected hr %#x.\n", hr); + ok(hr == DD_OK, "Got unexpected hr %#lx.\n", hr); hr = IDirectDraw2_RestoreDisplayMode(ddraw); - ok(SUCCEEDED(hr), "RestoreDisplayMode failed, hr %#x.\n", hr); + ok(SUCCEEDED(hr), "RestoreDisplayMode failed, hr %#lx.\n", hr); hr = IDirectDrawSurface_IsLost(primary); - ok(hr == DDERR_SURFACELOST, "Got unexpected hr %#x.\n", hr); + ok(hr == DDERR_SURFACELOST, "Got unexpected hr %#lx.\n", hr); ok(!expect_messages->message, "Expected message %#x, but didn't receive it.\n", expect_messages->message); expect_messages = NULL; - ok(!screen_size.cx && !screen_size.cy, "Got unexpected screen size %ux%u.\n", screen_size.cx, screen_size.cy); + ok(!screen_size.cx && !screen_size.cy, "Got unexpected screen size %lux%lu.\n", screen_size.cx, screen_size.cy); GetWindowRect(window, &r); ok(EqualRect(&r, ®istry_rect), "Expected %s, got %s.\n", wine_dbgstr_rect(®istry_rect), wine_dbgstr_rect(&r)); hr = IDirectDrawSurface_GetSurfaceDesc(primary, &ddsd); - ok(SUCCEEDED(hr), "Failed to get surface desc, hr %#x.\n", hr); - ok(ddsd.dwWidth == param.ddraw_width, "Expected surface width %u, got %u.\n", + ok(SUCCEEDED(hr), "Failed to get surface desc, hr %#lx.\n", hr); + ok(ddsd.dwWidth == param.ddraw_width, "Expected surface width %lu, got %lu.\n", param.ddraw_width, ddsd.dwWidth); - ok(ddsd.dwHeight == param.ddraw_height, "Expected surface height %u, got %u.\n", + ok(ddsd.dwHeight == param.ddraw_height, "Expected surface height %lu, got %lu.\n", param.ddraw_height, ddsd.dwHeight); IDirectDrawSurface_Release(primary); @@ -3468,11 +3461,11 @@ static void test_coop_level_mode_set(void) ok(ret, "Failed to get display mode.\n"); ok(devmode.dmPelsWidth == registry_mode.dmPelsWidth && devmode.dmPelsHeight == registry_mode.dmPelsHeight, - "Expected resolution %ux%u, got %ux%u.\n", + "Expected resolution %lux%lu, got %lux%lu.\n", registry_mode.dmPelsWidth, registry_mode.dmPelsHeight, devmode.dmPelsWidth, devmode.dmPelsHeight); change_ret = ChangeDisplaySettingsW(NULL, CDS_FULLSCREEN); - ok(change_ret == DISP_CHANGE_SUCCESSFUL, "Failed to change display mode, ret %#x.\n", change_ret); + ok(change_ret == DISP_CHANGE_SUCCESSFUL, "Failed to change display mode, ret %#lx.\n", change_ret); memset(&ddsd, 0, sizeof(ddsd)); ddsd.dwSize = sizeof(ddsd); @@ -3480,12 +3473,12 @@ static void test_coop_level_mode_set(void) ddsd.ddsCaps.dwCaps = DDSCAPS_PRIMARYSURFACE; hr = IDirectDraw2_CreateSurface(ddraw, &ddsd, &primary, NULL); - ok(SUCCEEDED(hr), "Failed to create surface, hr %#x.\n",hr); + ok(SUCCEEDED(hr), "Failed to create surface, hr %#lx.\n",hr); hr = IDirectDrawSurface_GetSurfaceDesc(primary, &ddsd); - ok(SUCCEEDED(hr), "Failed to get surface desc, hr %#x.\n", hr); - ok(ddsd.dwWidth == registry_mode.dmPelsWidth, "Expected surface width %u, got %u.\n", + ok(SUCCEEDED(hr), "Failed to get surface desc, hr %#lx.\n", hr); + ok(ddsd.dwWidth == registry_mode.dmPelsWidth, "Expected surface width %lu, got %lu.\n", registry_mode.dmPelsWidth, ddsd.dwWidth); - ok(ddsd.dwHeight == registry_mode.dmPelsHeight, "Expected surface height %u, got %u.\n", + ok(ddsd.dwHeight == registry_mode.dmPelsHeight, "Expected surface height %lu, got %lu.\n", registry_mode.dmPelsHeight, ddsd.dwHeight); GetWindowRect(window, &r); @@ -3496,17 +3489,17 @@ static void test_coop_level_mode_set(void) * Resizing the window on mode changes is a property of DDSCL_EXCLUSIVE, * not DDSCL_FULLSCREEN. */ hr = IDirectDraw2_SetCooperativeLevel(ddraw, window, DDSCL_NORMAL | DDSCL_FULLSCREEN); - ok(SUCCEEDED(hr), "SetCooperativeLevel failed, hr %#x.\n", hr); + ok(SUCCEEDED(hr), "SetCooperativeLevel failed, hr %#lx.\n", hr); GetWindowRect(window, &r); ok(EqualRect(&r, ®istry_rect), "Expected %s, got %s.\n", wine_dbgstr_rect(®istry_rect), wine_dbgstr_rect(&r)); hr = IDirectDrawSurface_GetSurfaceDesc(primary, &ddsd); - ok(SUCCEEDED(hr), "Failed to get surface desc, hr %#x.\n", hr); - ok(ddsd.dwWidth == registry_mode.dmPelsWidth, "Expected surface width %u, got %u.\n", + ok(SUCCEEDED(hr), "Failed to get surface desc, hr %#lx.\n", hr); + ok(ddsd.dwWidth == registry_mode.dmPelsWidth, "Expected surface width %lu, got %lu.\n", registry_mode.dmPelsWidth, ddsd.dwWidth); - ok(ddsd.dwHeight == registry_mode.dmPelsHeight, "Expected surface height %u, got %u.\n", + ok(ddsd.dwHeight == registry_mode.dmPelsHeight, "Expected surface height %lu, got %lu.\n", registry_mode.dmPelsHeight, ddsd.dwHeight); IDirectDrawSurface_Release(primary); @@ -3516,12 +3509,12 @@ static void test_coop_level_mode_set(void) ddsd.ddsCaps.dwCaps = DDSCAPS_PRIMARYSURFACE; hr = IDirectDraw2_CreateSurface(ddraw, &ddsd, &primary, NULL); - ok(SUCCEEDED(hr), "Failed to create surface, hr %#x.\n",hr); + ok(SUCCEEDED(hr), "Failed to create surface, hr %#lx.\n",hr); hr = IDirectDrawSurface_GetSurfaceDesc(primary, &ddsd); - ok(SUCCEEDED(hr), "Failed to get surface desc, hr %#x.\n", hr); - ok(ddsd.dwWidth == registry_mode.dmPelsWidth, "Expected surface width %u, got %u.\n", + ok(SUCCEEDED(hr), "Failed to get surface desc, hr %#lx.\n", hr); + ok(ddsd.dwWidth == registry_mode.dmPelsWidth, "Expected surface width %lu, got %lu.\n", registry_mode.dmPelsWidth, ddsd.dwWidth); - ok(ddsd.dwHeight == registry_mode.dmPelsHeight, "Expected surface height %u, got %u.\n", + ok(ddsd.dwHeight == registry_mode.dmPelsHeight, "Expected surface height %lu, got %lu.\n", registry_mode.dmPelsHeight, ddsd.dwHeight); GetWindowRect(window, &r); @@ -3534,18 +3527,18 @@ static void test_coop_level_mode_set(void) screen_size.cy = 0; hr = IDirectDrawSurface_IsLost(primary); - ok(hr == DD_OK, "Got unexpected hr %#x.\n", hr); + ok(hr == DD_OK, "Got unexpected hr %#lx.\n", hr); devmode.dmFields = DM_PELSWIDTH | DM_PELSHEIGHT; devmode.dmPelsWidth = param.user32_width; devmode.dmPelsHeight = param.user32_height; change_ret = ChangeDisplaySettingsW(&devmode, CDS_FULLSCREEN); - ok(change_ret == DISP_CHANGE_SUCCESSFUL, "Failed to change display mode, ret %#x.\n", change_ret); + ok(change_ret == DISP_CHANGE_SUCCESSFUL, "Failed to change display mode, ret %#lx.\n", change_ret); hr = IDirectDrawSurface_IsLost(primary); - todo_wine ok(hr == DDERR_SURFACELOST, "Got unexpected hr %#x.\n", hr); + todo_wine ok(hr == DDERR_SURFACELOST, "Got unexpected hr %#lx.\n", hr); ok(!expect_messages->message, "Expected message %#x, but didn't receive it.\n", expect_messages->message); expect_messages = NULL; - ok(!screen_size.cx && !screen_size.cy, "Got unexpected screen size %ux%u.\n", screen_size.cx, screen_size.cy); + ok(!screen_size.cx && !screen_size.cy, "Got unexpected screen size %lux%lu.\n", screen_size.cx, screen_size.cy); GetWindowRect(window, &r); ok(EqualRect(&r, ®istry_rect), "Expected %s, got %s.\n", wine_dbgstr_rect(®istry_rect), @@ -3557,27 +3550,27 @@ static void test_coop_level_mode_set(void) screen_size.cy = 0; hr = IDirectDrawSurface_Restore(primary); - ok(hr == DDERR_WRONGMODE, "Got unexpected hr %#x.\n", hr); + ok(hr == DDERR_WRONGMODE, "Got unexpected hr %#lx.\n", hr); hr = set_display_mode(ddraw, param.ddraw_width, param.ddraw_height); - ok(SUCCEEDED(hr), "Failed to set display mode, hr %#x.\n", hr); + ok(SUCCEEDED(hr), "Failed to set display mode, hr %#lx.\n", hr); hr = IDirectDrawSurface_Restore(primary); - ok(hr == DDERR_WRONGMODE, "Got unexpected hr %#x.\n", hr); + ok(hr == DDERR_WRONGMODE, "Got unexpected hr %#lx.\n", hr); hr = IDirectDrawSurface_IsLost(primary); - ok(hr == DDERR_SURFACELOST, "Got unexpected hr %#x.\n", hr); + ok(hr == DDERR_SURFACELOST, "Got unexpected hr %#lx.\n", hr); ok(!expect_messages->message, "Expected message %#x, but didn't receive it.\n", expect_messages->message); expect_messages = NULL; - ok(!screen_size.cx && !screen_size.cy, "Got unexpected screen size %ux%u.\n", screen_size.cx, screen_size.cy); + ok(!screen_size.cx && !screen_size.cy, "Got unexpected screen size %lux%lu.\n", screen_size.cx, screen_size.cy); GetWindowRect(window, &r); ok(EqualRect(&r, ®istry_rect), "Expected %s, got %s.\n", wine_dbgstr_rect(®istry_rect), wine_dbgstr_rect(&r)); hr = IDirectDrawSurface_GetSurfaceDesc(primary, &ddsd); - ok(SUCCEEDED(hr), "Failed to get surface desc, hr %#x.\n", hr); - ok(ddsd.dwWidth == registry_mode.dmPelsWidth, "Expected surface width %u, got %u.\n", + ok(SUCCEEDED(hr), "Failed to get surface desc, hr %#lx.\n", hr); + ok(ddsd.dwWidth == registry_mode.dmPelsWidth, "Expected surface width %lu, got %lu.\n", registry_mode.dmPelsWidth, ddsd.dwWidth); - ok(ddsd.dwHeight == registry_mode.dmPelsHeight, "Expected surface height %u, got %u.\n", + ok(ddsd.dwHeight == registry_mode.dmPelsHeight, "Expected surface height %lu, got %lu.\n", registry_mode.dmPelsHeight, ddsd.dwHeight); IDirectDrawSurface_Release(primary); @@ -3587,12 +3580,12 @@ static void test_coop_level_mode_set(void) ddsd.ddsCaps.dwCaps = DDSCAPS_PRIMARYSURFACE; hr = IDirectDraw2_CreateSurface(ddraw, &ddsd, &primary, NULL); - ok(SUCCEEDED(hr), "Failed to create surface, hr %#x.\n",hr); + ok(SUCCEEDED(hr), "Failed to create surface, hr %#lx.\n",hr); hr = IDirectDrawSurface_GetSurfaceDesc(primary, &ddsd); - ok(SUCCEEDED(hr), "Failed to get surface desc, hr %#x.\n", hr); - ok(ddsd.dwWidth == param.ddraw_width, "Expected surface width %u, got %u.\n", + ok(SUCCEEDED(hr), "Failed to get surface desc, hr %#lx.\n", hr); + ok(ddsd.dwWidth == param.ddraw_width, "Expected surface width %lu, got %lu.\n", param.ddraw_width, ddsd.dwWidth); - ok(ddsd.dwHeight == param.ddraw_height, "Expected surface height %u, got %u.\n", + ok(ddsd.dwHeight == param.ddraw_height, "Expected surface height %lu, got %lu.\n", param.ddraw_height, ddsd.dwHeight); GetWindowRect(window, &r); @@ -3605,25 +3598,25 @@ static void test_coop_level_mode_set(void) screen_size.cy = 0; hr = IDirectDrawSurface_IsLost(primary); - ok(hr == DD_OK, "Got unexpected hr %#x.\n", hr); + ok(hr == DD_OK, "Got unexpected hr %#lx.\n", hr); hr = IDirectDraw2_RestoreDisplayMode(ddraw); - ok(SUCCEEDED(hr), "RestoreDisplayMode failed, hr %#x.\n", hr); + ok(SUCCEEDED(hr), "RestoreDisplayMode failed, hr %#lx.\n", hr); hr = IDirectDrawSurface_IsLost(primary); - ok(hr == DDERR_SURFACELOST, "Got unexpected hr %#x.\n", hr); + ok(hr == DDERR_SURFACELOST, "Got unexpected hr %#lx.\n", hr); ok(!expect_messages->message, "Expected message %#x, but didn't receive it.\n", expect_messages->message); expect_messages = NULL; - ok(!screen_size.cx && !screen_size.cy, "Got unexpected screen size %ux%u.\n", screen_size.cx, screen_size.cy); + ok(!screen_size.cx && !screen_size.cy, "Got unexpected screen size %lux%lu.\n", screen_size.cx, screen_size.cy); GetWindowRect(window, &r); ok(EqualRect(&r, ®istry_rect), "Expected %s, got %s.\n", wine_dbgstr_rect(®istry_rect), wine_dbgstr_rect(&r)); hr = IDirectDrawSurface_GetSurfaceDesc(primary, &ddsd); - ok(SUCCEEDED(hr), "Failed to get surface desc, hr %#x.\n", hr); - ok(ddsd.dwWidth == param.ddraw_width, "Expected surface width %u, got %u.\n", + ok(SUCCEEDED(hr), "Failed to get surface desc, hr %#lx.\n", hr); + ok(ddsd.dwWidth == param.ddraw_width, "Expected surface width %lu, got %lu.\n", param.ddraw_width, ddsd.dwWidth); - ok(ddsd.dwHeight == param.ddraw_height, "Expected surface height %u, got %u.\n", + ok(ddsd.dwHeight == param.ddraw_height, "Expected surface height %lu, got %lu.\n", param.ddraw_height, ddsd.dwHeight); IDirectDrawSurface_Release(primary); @@ -3631,11 +3624,11 @@ static void test_coop_level_mode_set(void) ok(ret, "Failed to get display mode.\n"); ok(devmode.dmPelsWidth == registry_mode.dmPelsWidth && devmode.dmPelsHeight == registry_mode.dmPelsHeight, - "Expected resolution %ux%u, got %ux%u.\n", + "Expected resolution %lux%lu, got %lux%lu.\n", registry_mode.dmPelsWidth, registry_mode.dmPelsHeight, devmode.dmPelsWidth, devmode.dmPelsHeight); change_ret = ChangeDisplaySettingsW(NULL, CDS_FULLSCREEN); - ok(change_ret == DISP_CHANGE_SUCCESSFUL, "Failed to change display mode, ret %#x.\n", change_ret); + ok(change_ret == DISP_CHANGE_SUCCESSFUL, "Failed to change display mode, ret %#lx.\n", change_ret); memset(&ddsd, 0, sizeof(ddsd)); ddsd.dwSize = sizeof(ddsd); @@ -3643,12 +3636,12 @@ static void test_coop_level_mode_set(void) ddsd.ddsCaps.dwCaps = DDSCAPS_PRIMARYSURFACE; hr = IDirectDraw2_CreateSurface(ddraw, &ddsd, &primary, NULL); - ok(SUCCEEDED(hr), "Failed to create surface, hr %#x.\n",hr); + ok(SUCCEEDED(hr), "Failed to create surface, hr %#lx.\n",hr); hr = IDirectDrawSurface_GetSurfaceDesc(primary, &ddsd); - ok(SUCCEEDED(hr), "Failed to get surface desc, hr %#x.\n", hr); - ok(ddsd.dwWidth == registry_mode.dmPelsWidth, "Expected surface width %u, got %u.\n", + ok(SUCCEEDED(hr), "Failed to get surface desc, hr %#lx.\n", hr); + ok(ddsd.dwWidth == registry_mode.dmPelsWidth, "Expected surface width %lu, got %lu.\n", registry_mode.dmPelsWidth, ddsd.dwWidth); - ok(ddsd.dwHeight == registry_mode.dmPelsHeight, "Expected surface height %u, got %u.\n", + ok(ddsd.dwHeight == registry_mode.dmPelsHeight, "Expected surface height %lu, got %lu.\n", registry_mode.dmPelsHeight, ddsd.dwHeight); IDirectDrawSurface_Release(primary); @@ -3658,9 +3651,9 @@ static void test_coop_level_mode_set(void) /* Changing the coop level from EXCLUSIVE to NORMAL restores the screen resolution */ hr = IDirectDraw2_SetCooperativeLevel(ddraw, window, DDSCL_EXCLUSIVE | DDSCL_FULLSCREEN); - ok(SUCCEEDED(hr), "SetCooperativeLevel failed, hr %#x.\n", hr); + ok(SUCCEEDED(hr), "SetCooperativeLevel failed, hr %#lx.\n", hr); hr = set_display_mode(ddraw, param.ddraw_width, param.ddraw_height); - ok(SUCCEEDED(hr), "Failed to set display mode, hr %#x.\n", hr); + ok(SUCCEEDED(hr), "Failed to set display mode, hr %#lx.\n", hr); PeekMessageA(&msg, 0, 0, 0, PM_NOREMOVE); expect_messages = exclusive_messages; @@ -3668,13 +3661,13 @@ static void test_coop_level_mode_set(void) screen_size.cy = 0; hr = IDirectDraw2_SetCooperativeLevel(ddraw, window, DDSCL_NORMAL); - ok(SUCCEEDED(hr), "SetCooperativeLevel failed, hr %#x.\n", hr); + ok(SUCCEEDED(hr), "SetCooperativeLevel failed, hr %#lx.\n", hr); ok(!expect_messages->message, "Expected message %#x, but didn't receive it.\n", expect_messages->message); expect_messages = NULL; ok(screen_size.cx == registry_mode.dmPelsWidth && screen_size.cy == registry_mode.dmPelsHeight, - "Expected screen size %ux%u, got %ux%u.\n", + "Expected screen size %lux%lu, got %lux%lu.\n", registry_mode.dmPelsWidth, registry_mode.dmPelsHeight, screen_size.cx, screen_size.cy); @@ -3688,23 +3681,23 @@ static void test_coop_level_mode_set(void) ddsd.ddsCaps.dwCaps = DDSCAPS_PRIMARYSURFACE; hr = IDirectDraw2_CreateSurface(ddraw, &ddsd, &primary, NULL); - ok(SUCCEEDED(hr), "Failed to create surface, hr %#x.\n",hr); + ok(SUCCEEDED(hr), "Failed to create surface, hr %#lx.\n",hr); hr = IDirectDrawSurface_GetSurfaceDesc(primary, &ddsd); - ok(SUCCEEDED(hr), "Failed to get surface desc, hr %#x.\n", hr); - ok(ddsd.dwWidth == registry_mode.dmPelsWidth, "Expected surface width %u, got %u.\n", + ok(SUCCEEDED(hr), "Failed to get surface desc, hr %#lx.\n", hr); + ok(ddsd.dwWidth == registry_mode.dmPelsWidth, "Expected surface width %lu, got %lu.\n", registry_mode.dmPelsWidth, ddsd.dwWidth); - ok(ddsd.dwHeight == registry_mode.dmPelsHeight, "Expected surface height %u, got %u.\n", + ok(ddsd.dwHeight == registry_mode.dmPelsHeight, "Expected surface height %lu, got %lu.\n", registry_mode.dmPelsHeight, ddsd.dwHeight); IDirectDrawSurface_Release(primary); /* The screen restore is a property of DDSCL_EXCLUSIVE */ hr = IDirectDraw2_SetCooperativeLevel(ddraw, window, DDSCL_NORMAL | DDSCL_FULLSCREEN); - ok(SUCCEEDED(hr), "SetCooperativeLevel failed, hr %#x.\n", hr); + ok(SUCCEEDED(hr), "SetCooperativeLevel failed, hr %#lx.\n", hr); hr = set_display_mode(ddraw, param.ddraw_width, param.ddraw_height); - ok(SUCCEEDED(hr), "Failed to set display mode, hr %#x.\n", hr); + ok(SUCCEEDED(hr), "Failed to set display mode, hr %#lx.\n", hr); hr = IDirectDraw2_SetCooperativeLevel(ddraw, window, DDSCL_NORMAL); - ok(SUCCEEDED(hr), "SetCooperativeLevel failed, hr %#x.\n", hr); + ok(SUCCEEDED(hr), "SetCooperativeLevel failed, hr %#lx.\n", hr); memset(&ddsd, 0, sizeof(ddsd)); ddsd.dwSize = sizeof(ddsd); @@ -3712,23 +3705,23 @@ static void test_coop_level_mode_set(void) ddsd.ddsCaps.dwCaps = DDSCAPS_PRIMARYSURFACE; hr = IDirectDraw2_CreateSurface(ddraw, &ddsd, &primary, NULL); - ok(SUCCEEDED(hr), "Failed to create surface, hr %#x.\n",hr); + ok(SUCCEEDED(hr), "Failed to create surface, hr %#lx.\n",hr); hr = IDirectDrawSurface_GetSurfaceDesc(primary, &ddsd); - ok(SUCCEEDED(hr), "Failed to get surface desc, hr %#x.\n", hr); - ok(ddsd.dwWidth == param.ddraw_width, "Expected surface width %u, got %u.\n", + ok(SUCCEEDED(hr), "Failed to get surface desc, hr %#lx.\n", hr); + ok(ddsd.dwWidth == param.ddraw_width, "Expected surface width %lu, got %lu.\n", param.ddraw_width, ddsd.dwWidth); - ok(ddsd.dwHeight == param.ddraw_height, "Expected surface height %u, got %u.\n", + ok(ddsd.dwHeight == param.ddraw_height, "Expected surface height %lu, got %lu.\n", param.ddraw_height, ddsd.dwHeight); IDirectDrawSurface_Release(primary); hr = IDirectDraw2_RestoreDisplayMode(ddraw); - ok(SUCCEEDED(hr), "RestoreDisplayMode failed, hr %#x.\n", hr); + ok(SUCCEEDED(hr), "RestoreDisplayMode failed, hr %#lx.\n", hr); /* If the window is changed at the same time, messages are sent to the new window. */ hr = IDirectDraw2_SetCooperativeLevel(ddraw, window, DDSCL_EXCLUSIVE | DDSCL_FULLSCREEN); - ok(SUCCEEDED(hr), "SetCooperativeLevel failed, hr %#x.\n", hr); + ok(SUCCEEDED(hr), "SetCooperativeLevel failed, hr %#lx.\n", hr); hr = set_display_mode(ddraw, param.ddraw_width, param.ddraw_height); - ok(SUCCEEDED(hr), "Failed to set display mode, hr %#x.\n", hr); + ok(SUCCEEDED(hr), "Failed to set display mode, hr %#lx.\n", hr); PeekMessageA(&msg, 0, 0, 0, PM_NOREMOVE); expect_messages = exclusive_messages; @@ -3738,14 +3731,14 @@ static void test_coop_level_mode_set(void) screen_size2.cy = 0; hr = IDirectDraw2_SetCooperativeLevel(ddraw, window2, DDSCL_NORMAL); - ok(SUCCEEDED(hr), "SetCooperativeLevel failed, hr %#x.\n", hr); + ok(SUCCEEDED(hr), "SetCooperativeLevel failed, hr %#lx.\n", hr); ok(!expect_messages->message, "Expected message %#x, but didn't receive it.\n", expect_messages->message); expect_messages = NULL; - ok(!screen_size.cx && !screen_size.cy, "Got unexpected screen size %ux%u.\n", + ok(!screen_size.cx && !screen_size.cy, "Got unexpected screen size %lux%lu.\n", screen_size.cx, screen_size.cy); ok(screen_size2.cx == registry_mode.dmPelsWidth && screen_size2.cy == registry_mode.dmPelsHeight, - "Expected screen size 2 %ux%u, got %ux%u.\n", + "Expected screen size 2 %lux%lu, got %lux%lu.\n", registry_mode.dmPelsWidth, registry_mode.dmPelsHeight, screen_size2.cx, screen_size2.cy); GetWindowRect(window, &r); @@ -3761,17 +3754,17 @@ static void test_coop_level_mode_set(void) ddsd.ddsCaps.dwCaps = DDSCAPS_PRIMARYSURFACE; hr = IDirectDraw2_CreateSurface(ddraw, &ddsd, &primary, NULL); - ok(SUCCEEDED(hr), "Failed to create surface, hr %#x.\n",hr); + ok(SUCCEEDED(hr), "Failed to create surface, hr %#lx.\n",hr); hr = IDirectDrawSurface_GetSurfaceDesc(primary, &ddsd); - ok(SUCCEEDED(hr), "Failed to get surface desc, hr %#x.\n", hr); - ok(ddsd.dwWidth == registry_mode.dmPelsWidth, "Expected surface width %u, got %u.\n", + ok(SUCCEEDED(hr), "Failed to get surface desc, hr %#lx.\n", hr); + ok(ddsd.dwWidth == registry_mode.dmPelsWidth, "Expected surface width %lu, got %lu.\n", registry_mode.dmPelsWidth, ddsd.dwWidth); - ok(ddsd.dwHeight == registry_mode.dmPelsHeight, "Expected surface height %u, got %u.\n", + ok(ddsd.dwHeight == registry_mode.dmPelsHeight, "Expected surface height %lu, got %lu.\n", registry_mode.dmPelsHeight, ddsd.dwHeight); IDirectDrawSurface_Release(primary); ref = IDirectDraw2_Release(ddraw); - ok(ref == 0, "The ddraw object was not properly freed: refcount %u.\n", ref); + ok(!ref, "Unexpected refcount %lu.\n", ref); GetWindowRect(window, &r); ok(EqualRect(&r, &ddraw_rect), "Expected %s, got %s.\n", wine_dbgstr_rect(&ddraw_rect), @@ -3785,36 +3778,36 @@ static void test_coop_level_mode_set(void) devmode.dmPelsWidth = param.user32_width; devmode.dmPelsHeight = param.user32_height; change_ret = ChangeDisplaySettingsW(&devmode, CDS_UPDATEREGISTRY | CDS_NORESET); - ok(change_ret == DISP_CHANGE_SUCCESSFUL, "ChangeDisplaySettingsW failed with %d.\n", change_ret); + ok(change_ret == DISP_CHANGE_SUCCESSFUL, "ChangeDisplaySettingsW failed with %ld.\n", change_ret); ddraw = create_ddraw(); ok(!!ddraw, "Failed to create a ddraw object.\n"); ref = IDirectDraw2_Release(ddraw); - ok(ref == 0, "The ddraw object was not properly freed: refcount %u.\n", ref); + ok(!ref, "Unexpected refcount %lu.\n", ref); memset(&devmode2, 0, sizeof(devmode2)); devmode2.dmSize = sizeof(devmode2); ret = EnumDisplaySettingsW(NULL, ENUM_CURRENT_SETTINGS, &devmode2); - ok(ret, "EnumDisplaySettingsW failed, error %#x.\n", GetLastError()); + ok(ret, "EnumDisplaySettingsW failed, error %lu.\n", GetLastError()); ok(compare_mode_rect(&devmode2, ®istry_mode), "Got a different mode.\n"); ret = restore_display_modes(original_modes, display_count); ok(ret, "Failed to restore display modes.\n"); /* Test that no mode restorations if no mode changes happened with fullscreen ddraw objects */ change_ret = ChangeDisplaySettingsW(&devmode, CDS_UPDATEREGISTRY | CDS_NORESET); - ok(change_ret == DISP_CHANGE_SUCCESSFUL, "ChangeDisplaySettingsW failed with %d.\n", change_ret); + ok(change_ret == DISP_CHANGE_SUCCESSFUL, "ChangeDisplaySettingsW failed with %ld.\n", change_ret); ddraw = create_ddraw(); ok(!!ddraw, "Failed to create a ddraw object.\n"); hr = IDirectDraw2_SetCooperativeLevel(ddraw, window, DDSCL_EXCLUSIVE | DDSCL_FULLSCREEN); - ok(hr == DD_OK, "SetCooperativeLevel failed, hr %#x.\n", hr); + ok(hr == DD_OK, "SetCooperativeLevel failed, hr %#lx.\n", hr); hr = IDirectDraw2_SetCooperativeLevel(ddraw, window, DDSCL_NORMAL); - ok(hr == DD_OK, "SetCooperativeLevel failed, hr %#x.\n", hr); + ok(hr == DD_OK, "SetCooperativeLevel failed, hr %#lx.\n", hr); ref = IDirectDraw2_Release(ddraw); - ok(ref == 0, "The ddraw object was not properly freed: refcount %u.\n", ref); + ok(!ref, "Unexpected refcount %lu.\n", ref); ret = EnumDisplaySettingsW(NULL, ENUM_CURRENT_SETTINGS, &devmode2); - ok(ret, "EnumDisplaySettingsW failed, error %#x.\n", GetLastError()); + ok(ret, "EnumDisplaySettingsW failed, error %lu.\n", GetLastError()); ok(compare_mode_rect(&devmode2, ®istry_mode), "Got a different mode.\n"); ret = restore_display_modes(original_modes, display_count); ok(ret, "Failed to restore display modes.\n"); @@ -3824,19 +3817,19 @@ static void test_coop_level_mode_set(void) ddraw = create_ddraw(); ok(!!ddraw, "Failed to create a ddraw object.\n"); hr = set_display_mode(ddraw, registry_mode.dmPelsWidth, registry_mode.dmPelsHeight); - ok(hr == DD_OK, "Failed to set display mode, hr %#x.\n", hr); + ok(hr == DD_OK, "Failed to set display mode, hr %#lx.\n", hr); change_ret = ChangeDisplaySettingsW(&devmode, CDS_UPDATEREGISTRY | CDS_NORESET); - ok(change_ret == DISP_CHANGE_SUCCESSFUL, "ChangeDisplaySettingsW failed with %d.\n", change_ret); + ok(change_ret == DISP_CHANGE_SUCCESSFUL, "ChangeDisplaySettingsW failed with %ld.\n", change_ret); ref = IDirectDraw2_Release(ddraw); - ok(ref == 0, "The ddraw object was not properly freed: refcount %u.\n", ref); + ok(!ref, "Unexpected refcount %lu.\n", ref); ret = EnumDisplaySettingsW(NULL, ENUM_CURRENT_SETTINGS, &devmode2); - ok(ret, "EnumDisplaySettingsW failed, error %#x.\n", GetLastError()); + ok(ret, "EnumDisplaySettingsW failed, error %lu.\n", GetLastError()); ok(compare_mode_rect(&devmode2, &devmode), "Got a different mode.\n"); ret = EnumDisplaySettingsW(NULL, ENUM_REGISTRY_SETTINGS, &devmode2); - ok(ret, "EnumDisplaySettingsW failed, error %#x.\n", GetLastError()); + ok(ret, "EnumDisplaySettingsW failed, error %lu.\n", GetLastError()); ok(compare_mode_rect(&devmode2, &devmode), "Got a different mode.\n"); ret = restore_display_modes(original_modes, display_count); ok(ret, "Failed to restore display modes.\n"); @@ -3845,23 +3838,23 @@ static void test_coop_level_mode_set(void) ddraw = create_ddraw(); ok(!!ddraw, "Failed to create a ddraw object.\n"); hr = set_display_mode(ddraw, param.ddraw_width, param.ddraw_height); - ok(hr == DD_OK, "Failed to set display mode, hr %#x.\n", hr); + ok(hr == DD_OK, "Failed to set display mode, hr %#lx.\n", hr); change_ret = ChangeDisplaySettingsW(&devmode, CDS_UPDATEREGISTRY | CDS_NORESET); - ok(change_ret == DISP_CHANGE_SUCCESSFUL, "ChangeDisplaySettingsW failed with %d.\n", change_ret); + ok(change_ret == DISP_CHANGE_SUCCESSFUL, "ChangeDisplaySettingsW failed with %ld.\n", change_ret); hr = IDirectDraw2_RestoreDisplayMode(ddraw); - ok(hr == DD_OK, "RestoreDisplayMode failed, hr %#x.\n", hr); + ok(hr == DD_OK, "RestoreDisplayMode failed, hr %#lx.\n", hr); ret = EnumDisplaySettingsW(NULL, ENUM_CURRENT_SETTINGS, &devmode2); - ok(ret, "EnumDisplaySettingsW failed, error %#x.\n", GetLastError()); + ok(ret, "EnumDisplaySettingsW failed, error %lu.\n", GetLastError()); ok(compare_mode_rect(&devmode2, &devmode), "Got a different mode.\n"); ret = EnumDisplaySettingsW(NULL, ENUM_REGISTRY_SETTINGS, &devmode2); - ok(ret, "EnumDisplaySettingsW failed, error %#x.\n", GetLastError()); + ok(ret, "EnumDisplaySettingsW failed, error %lu.\n", GetLastError()); ok(compare_mode_rect(&devmode2, &devmode), "Got a different mode.\n"); ref = IDirectDraw2_Release(ddraw); - ok(ref == 0, "The ddraw object was not properly freed: refcount %u.\n", ref); + ok(!ref, "Unexpected refcount %lu.\n", ref); done: expect_messages = NULL; @@ -3890,10 +3883,10 @@ static void test_coop_level_mode_set_multi(void) memset(&devmode, 0, sizeof(devmode)); devmode.dmSize = sizeof(devmode); ret = EnumDisplaySettingsW(NULL, ENUM_CURRENT_SETTINGS, &devmode); - ok(ret, "EnumDisplaySettingsW failed, error %#x.\n", GetLastError()); + ok(ret, "EnumDisplaySettingsW failed, error %lu.\n", GetLastError()); ok(compare_mode_rect(&devmode, ®istry_mode), "Got a different mode.\n"); ret = EnumDisplaySettingsW(NULL, ENUM_REGISTRY_SETTINGS, &devmode); - ok(ret, "EnumDisplaySettingsW failed, error %#x.\n", GetLastError()); + ok(ret, "EnumDisplaySettingsW failed, error %lu.\n", GetLastError()); ok(compare_mode_rect(&devmode, ®istry_mode), "Got a different mode.\n"); ret = save_display_modes(&original_modes, &display_count); @@ -3914,14 +3907,14 @@ static void test_coop_level_mode_set_multi(void) DestroyWindow(window); return; } - ok(SUCCEEDED(hr), "Failed to set display mode, hr %#x.\n", hr); + ok(SUCCEEDED(hr), "Failed to set display mode, hr %#lx.\n", hr); w = GetSystemMetrics(SM_CXSCREEN); ok(w == 800, "Got unexpected screen width %u.\n", w); h = GetSystemMetrics(SM_CYSCREEN); ok(h == 600, "Got unexpected screen height %u.\n", h); ref = IDirectDraw2_Release(ddraw1); - ok(ref == 0, "The ddraw object was not properly freed: refcount %u.\n", ref); + ok(!ref, "Unexpected refcount %lu.\n", ref); w = GetSystemMetrics(SM_CXSCREEN); ok(w == registry_mode.dmPelsWidth, "Got unexpected screen width %u.\n", w); h = GetSystemMetrics(SM_CYSCREEN); @@ -3931,7 +3924,7 @@ static void test_coop_level_mode_set_multi(void) * the initial mode, before the first SetDisplayMode() call. */ ddraw1 = create_ddraw(); hr = set_display_mode(ddraw1, 800, 600); - ok(SUCCEEDED(hr), "Failed to set display mode, hr %#x.\n", hr); + ok(SUCCEEDED(hr), "Failed to set display mode, hr %#lx.\n", hr); w = GetSystemMetrics(SM_CXSCREEN); ok(w == 800, "Got unexpected screen width %u.\n", w); h = GetSystemMetrics(SM_CYSCREEN); @@ -3939,21 +3932,21 @@ static void test_coop_level_mode_set_multi(void) ddraw2 = create_ddraw(); hr = set_display_mode(ddraw2, 640, 480); - ok(SUCCEEDED(hr), "Failed to set display mode, hr %#x.\n", hr); + ok(SUCCEEDED(hr), "Failed to set display mode, hr %#lx.\n", hr); w = GetSystemMetrics(SM_CXSCREEN); ok(w == 640, "Got unexpected screen width %u.\n", w); h = GetSystemMetrics(SM_CYSCREEN); ok(h == 480, "Got unexpected screen height %u.\n", h); ref = IDirectDraw2_Release(ddraw2); - ok(ref == 0, "The ddraw object was not properly freed: refcount %u.\n", ref); + ok(!ref, "Unexpected refcount %lu.\n", ref); w = GetSystemMetrics(SM_CXSCREEN); ok(w == registry_mode.dmPelsWidth, "Got unexpected screen width %u.\n", w); h = GetSystemMetrics(SM_CYSCREEN); ok(h == registry_mode.dmPelsHeight, "Got unexpected screen height %u.\n", h); ref = IDirectDraw2_Release(ddraw1); - ok(ref == 0, "The ddraw object was not properly freed: refcount %u.\n", ref); + ok(!ref, "Unexpected refcount %lu.\n", ref); w = GetSystemMetrics(SM_CXSCREEN); ok(w == registry_mode.dmPelsWidth, "Got unexpected screen width %u.\n", w); h = GetSystemMetrics(SM_CYSCREEN); @@ -3962,7 +3955,7 @@ static void test_coop_level_mode_set_multi(void) /* Regardless of release ordering. */ ddraw1 = create_ddraw(); hr = set_display_mode(ddraw1, 800, 600); - ok(SUCCEEDED(hr), "Failed to set display mode, hr %#x.\n", hr); + ok(SUCCEEDED(hr), "Failed to set display mode, hr %#lx.\n", hr); w = GetSystemMetrics(SM_CXSCREEN); ok(w == 800, "Got unexpected screen width %u.\n", w); h = GetSystemMetrics(SM_CYSCREEN); @@ -3970,21 +3963,21 @@ static void test_coop_level_mode_set_multi(void) ddraw2 = create_ddraw(); hr = set_display_mode(ddraw2, 640, 480); - ok(SUCCEEDED(hr), "Failed to set display mode, hr %#x.\n", hr); + ok(SUCCEEDED(hr), "Failed to set display mode, hr %#lx.\n", hr); w = GetSystemMetrics(SM_CXSCREEN); ok(w == 640, "Got unexpected screen width %u.\n", w); h = GetSystemMetrics(SM_CYSCREEN); ok(h == 480, "Got unexpected screen height %u.\n", h); ref = IDirectDraw2_Release(ddraw1); - ok(ref == 0, "The ddraw object was not properly freed: refcount %u.\n", ref); + ok(!ref, "Unexpected refcount %lu.\n", ref); w = GetSystemMetrics(SM_CXSCREEN); ok(w == registry_mode.dmPelsWidth, "Got unexpected screen width %u.\n", w); h = GetSystemMetrics(SM_CYSCREEN); ok(h == registry_mode.dmPelsHeight, "Got unexpected screen height %u.\n", h); ref = IDirectDraw2_Release(ddraw2); - ok(ref == 0, "The ddraw object was not properly freed: refcount %u.\n", ref); + ok(!ref, "Unexpected refcount %lu.\n", ref); w = GetSystemMetrics(SM_CXSCREEN); ok(w == registry_mode.dmPelsWidth, "Got unexpected screen width %u.\n", w); h = GetSystemMetrics(SM_CYSCREEN); @@ -3994,21 +3987,21 @@ static void test_coop_level_mode_set_multi(void) ddraw1 = create_ddraw(); ddraw2 = create_ddraw(); hr = set_display_mode(ddraw2, 640, 480); - ok(SUCCEEDED(hr), "Failed to set display mode, hr %#x.\n", hr); + ok(SUCCEEDED(hr), "Failed to set display mode, hr %#lx.\n", hr); w = GetSystemMetrics(SM_CXSCREEN); ok(w == 640, "Got unexpected screen width %u.\n", w); h = GetSystemMetrics(SM_CYSCREEN); ok(h == 480, "Got unexpected screen height %u.\n", h); ref = IDirectDraw2_Release(ddraw1); - ok(ref == 0, "The ddraw object was not properly freed: refcount %u.\n", ref); + ok(!ref, "Unexpected refcount %lu.\n", ref); w = GetSystemMetrics(SM_CXSCREEN); ok(w == 640, "Got unexpected screen width %u.\n", w); h = GetSystemMetrics(SM_CYSCREEN); ok(h == 480, "Got unexpected screen height %u.\n", h); ref = IDirectDraw2_Release(ddraw2); - ok(ref == 0, "The ddraw object was not properly freed: refcount %u.\n", ref); + ok(!ref, "Unexpected refcount %lu.\n", ref); w = GetSystemMetrics(SM_CXSCREEN); ok(w == registry_mode.dmPelsWidth, "Got unexpected screen width %u.\n", w); h = GetSystemMetrics(SM_CYSCREEN); @@ -4018,7 +4011,7 @@ static void test_coop_level_mode_set_multi(void) * restoring the display mode. */ ddraw1 = create_ddraw(); hr = set_display_mode(ddraw1, 800, 600); - ok(SUCCEEDED(hr), "Failed to set display mode, hr %#x.\n", hr); + ok(SUCCEEDED(hr), "Failed to set display mode, hr %#lx.\n", hr); w = GetSystemMetrics(SM_CXSCREEN); ok(w == 800, "Got unexpected screen width %u.\n", w); h = GetSystemMetrics(SM_CYSCREEN); @@ -4026,24 +4019,24 @@ static void test_coop_level_mode_set_multi(void) ddraw2 = create_ddraw(); hr = set_display_mode(ddraw2, 640, 480); - ok(SUCCEEDED(hr), "Failed to set display mode, hr %#x.\n", hr); + ok(SUCCEEDED(hr), "Failed to set display mode, hr %#lx.\n", hr); w = GetSystemMetrics(SM_CXSCREEN); ok(w == 640, "Got unexpected screen width %u.\n", w); h = GetSystemMetrics(SM_CYSCREEN); ok(h == 480, "Got unexpected screen height %u.\n", h); hr = IDirectDraw2_SetCooperativeLevel(ddraw2, window, DDSCL_EXCLUSIVE | DDSCL_FULLSCREEN); - ok(SUCCEEDED(hr), "SetCooperativeLevel failed, hr %#x.\n", hr); + ok(SUCCEEDED(hr), "SetCooperativeLevel failed, hr %#lx.\n", hr); ref = IDirectDraw2_Release(ddraw1); - ok(ref == 0, "The ddraw object was not properly freed: refcount %u.\n", ref); + ok(!ref, "Unexpected refcount %lu.\n", ref); w = GetSystemMetrics(SM_CXSCREEN); ok(w == 640, "Got unexpected screen width %u.\n", w); h = GetSystemMetrics(SM_CYSCREEN); ok(h == 480, "Got unexpected screen height %u.\n", h); ref = IDirectDraw2_Release(ddraw2); - ok(ref == 0, "The ddraw object was not properly freed: refcount %u.\n", ref); + ok(!ref, "Unexpected refcount %lu.\n", ref); w = GetSystemMetrics(SM_CXSCREEN); ok(w == registry_mode.dmPelsWidth, "Got unexpected screen width %u.\n", w); h = GetSystemMetrics(SM_CYSCREEN); @@ -4052,28 +4045,28 @@ static void test_coop_level_mode_set_multi(void) /* Exclusive mode blocks mode setting on other ddraw objects in general. */ ddraw1 = create_ddraw(); hr = set_display_mode(ddraw1, 800, 600); - ok(SUCCEEDED(hr), "Failed to set display mode, hr %#x.\n", hr); + ok(SUCCEEDED(hr), "Failed to set display mode, hr %#lx.\n", hr); w = GetSystemMetrics(SM_CXSCREEN); ok(w == 800, "Got unexpected screen width %u.\n", w); h = GetSystemMetrics(SM_CYSCREEN); ok(h == 600, "Got unexpected screen height %u.\n", h); hr = IDirectDraw2_SetCooperativeLevel(ddraw1, window, DDSCL_EXCLUSIVE | DDSCL_FULLSCREEN); - ok(SUCCEEDED(hr), "SetCooperativeLevel failed, hr %#x.\n", hr); + ok(SUCCEEDED(hr), "SetCooperativeLevel failed, hr %#lx.\n", hr); ddraw2 = create_ddraw(); hr = set_display_mode(ddraw2, 640, 480); - ok(hr == DDERR_NOEXCLUSIVEMODE, "Got unexpected hr %#x.\n", hr); + ok(hr == DDERR_NOEXCLUSIVEMODE, "Got unexpected hr %#lx.\n", hr); ref = IDirectDraw2_Release(ddraw1); - ok(ref == 0, "The ddraw object was not properly freed: refcount %u.\n", ref); + ok(!ref, "Unexpected refcount %lu.\n", ref); w = GetSystemMetrics(SM_CXSCREEN); ok(w == registry_mode.dmPelsWidth, "Got unexpected screen width %u.\n", w); h = GetSystemMetrics(SM_CYSCREEN); ok(h == registry_mode.dmPelsHeight, "Got unexpected screen height %u.\n", h); ref = IDirectDraw2_Release(ddraw2); - ok(ref == 0, "The ddraw object was not properly freed: refcount %u.\n", ref); + ok(!ref, "Unexpected refcount %lu.\n", ref); w = GetSystemMetrics(SM_CXSCREEN); ok(w == registry_mode.dmPelsWidth, "Got unexpected screen width %u.\n", w); h = GetSystemMetrics(SM_CYSCREEN); @@ -4101,7 +4094,7 @@ static void test_coop_level_mode_set_multi(void) memset(&old_devmode, 0, sizeof(old_devmode)); old_devmode.dmSize = sizeof(old_devmode); ret = EnumDisplaySettingsW(second_monitor_name, ENUM_CURRENT_SETTINGS, &old_devmode); - ok(ret, "EnumDisplaySettingsW failed, error %#x.\n", GetLastError()); + ok(ret, "EnumDisplaySettingsW failed, error %lu.\n", GetLastError()); devmode = old_devmode; while (EnumDisplaySettingsW(second_monitor_name, mode_idx++, &devmode)) @@ -4118,32 +4111,32 @@ static void test_coop_level_mode_set_multi(void) ddraw1 = create_ddraw(); ok(!!ddraw1, "Failed to create a ddraw object.\n"); hr = IDirectDraw2_SetCooperativeLevel(ddraw1, window, DDSCL_EXCLUSIVE | DDSCL_FULLSCREEN); - ok(hr == DD_OK, "SetCooperativeLevel failed, hr %#x.\n", hr); + ok(hr == DD_OK, "SetCooperativeLevel failed, hr %#lx.\n", hr); change_ret = ChangeDisplaySettingsExW(second_monitor_name, &devmode, NULL, CDS_RESET, NULL); - ok(change_ret == DISP_CHANGE_SUCCESSFUL, "ChangeDisplaySettingsExW failed with %d.\n", change_ret); + ok(change_ret == DISP_CHANGE_SUCCESSFUL, "ChangeDisplaySettingsExW failed with %ld.\n", change_ret); memset(&devmode2, 0, sizeof(devmode2)); devmode2.dmSize = sizeof(devmode2); ret = EnumDisplaySettingsW(second_monitor_name, ENUM_CURRENT_SETTINGS, &devmode2); - ok(ret, "EnumDisplaySettingsW failed, error %#x.\n", GetLastError()); + ok(ret, "EnumDisplaySettingsW failed, error %lu.\n", GetLastError()); if (compare_mode_rect(&devmode2, &old_devmode)) { skip("Failed to change display settings of the second monitor.\n"); ref = IDirectDraw2_Release(ddraw1); - ok(ref == 0, "The ddraw object was not properly freed: refcount %u.\n", ref); + ok(!ref, "Unexpected refcount %lu.\n", ref); goto done; } hr = IDirectDraw2_SetCooperativeLevel(ddraw1, window, DDSCL_NORMAL); - ok(hr == DD_OK, "SetCooperativeLevel failed, hr %#x.\n", hr); + ok(hr == DD_OK, "SetCooperativeLevel failed, hr %#lx.\n", hr); ref = IDirectDraw2_Release(ddraw1); - ok(ref == 0, "The ddraw object was not properly freed: refcount %u.\n", ref); + ok(!ref, "Unexpected refcount %lu.\n", ref); memset(&devmode3, 0, sizeof(devmode3)); devmode3.dmSize = sizeof(devmode3); ret = EnumDisplaySettingsW(second_monitor_name, ENUM_CURRENT_SETTINGS, &devmode3); - ok(ret, "EnumDisplaySettingsW failed, error %#x.\n", GetLastError()); + ok(ret, "EnumDisplaySettingsW failed, error %lu.\n", GetLastError()); ok(compare_mode_rect(&devmode3, &devmode2), "Got a different mode.\n"); ret = restore_display_modes(original_modes, display_count); ok(ret, "Failed to restore display modes.\n"); @@ -4153,19 +4146,19 @@ static void test_coop_level_mode_set_multi(void) ddraw1 = create_ddraw(); ok(!!ddraw1, "Failed to create a ddraw object.\n"); hr = set_display_mode(ddraw1, 800, 600); - ok(hr == DD_OK, "Failed to set display mode, hr %#x.\n", hr); + ok(hr == DD_OK, "Failed to set display mode, hr %#lx.\n", hr); change_ret = ChangeDisplaySettingsExW(second_monitor_name, &devmode, NULL, CDS_RESET, NULL); - ok(change_ret == DISP_CHANGE_SUCCESSFUL, "ChangeDisplaySettingsExW failed with %d.\n", change_ret); + ok(change_ret == DISP_CHANGE_SUCCESSFUL, "ChangeDisplaySettingsExW failed with %ld.\n", change_ret); ref = IDirectDraw2_Release(ddraw1); - ok(ref == 0, "The ddraw object was not properly freed: refcount %u.\n", ref); + ok(!ref, "Unexpected refcount %lu.\n", ref); ret = EnumDisplaySettingsW(second_monitor_name, ENUM_CURRENT_SETTINGS, &devmode2); - ok(ret, "EnumDisplaySettingsW failed, error %#x.\n", GetLastError()); + ok(ret, "EnumDisplaySettingsW failed, error %lu.\n", GetLastError()); ok(compare_mode_rect(&devmode2, &old_devmode), "Got a different mode.\n"); ret = EnumDisplaySettingsW(second_monitor_name, ENUM_REGISTRY_SETTINGS, &devmode2); - ok(ret, "EnumDisplaySettingsW failed, error %#x.\n", GetLastError()); + ok(ret, "EnumDisplaySettingsW failed, error %lu.\n", GetLastError()); ok(compare_mode_rect(&devmode2, &old_devmode), "Got a different mode.\n"); ret = restore_display_modes(original_modes, display_count); ok(ret, "Failed to restore display modes.\n"); @@ -4174,23 +4167,23 @@ static void test_coop_level_mode_set_multi(void) ddraw1 = create_ddraw(); ok(!!ddraw1, "Failed to create a ddraw object.\n"); hr = set_display_mode(ddraw1, 800, 600); - ok(hr == DD_OK, "Failed to set display mode, hr %#x.\n", hr); + ok(hr == DD_OK, "Failed to set display mode, hr %#lx.\n", hr); change_ret = ChangeDisplaySettingsExW(second_monitor_name, &devmode, NULL, CDS_RESET, NULL); - ok(change_ret == DISP_CHANGE_SUCCESSFUL, "ChangeDisplaySettingsExW failed with %d.\n", change_ret); + ok(change_ret == DISP_CHANGE_SUCCESSFUL, "ChangeDisplaySettingsExW failed with %ld.\n", change_ret); hr = IDirectDraw2_RestoreDisplayMode(ddraw1); - ok(hr == DD_OK, "RestoreDisplayMode failed, hr %#x.\n", hr); + ok(hr == DD_OK, "RestoreDisplayMode failed, hr %#lx.\n", hr); ret = EnumDisplaySettingsW(second_monitor_name, ENUM_CURRENT_SETTINGS, &devmode2); - ok(ret, "EnumDisplaySettingsW failed, error %#x.\n", GetLastError()); + ok(ret, "EnumDisplaySettingsW failed, error %lu.\n", GetLastError()); ok(compare_mode_rect(&devmode2, &old_devmode), "Got a different mode.\n"); ret = EnumDisplaySettingsW(second_monitor_name, ENUM_REGISTRY_SETTINGS, &devmode2); - ok(ret, "EnumDisplaySettingsW failed, error %#x.\n", GetLastError()); + ok(ret, "EnumDisplaySettingsW failed, error %lu.\n", GetLastError()); ok(compare_mode_rect(&devmode2, &old_devmode), "Got a different mode.\n"); ref = IDirectDraw2_Release(ddraw1); - ok(ref == 0, "The ddraw object was not properly freed: refcount %u.\n", ref); + ok(!ref, "Unexpected refcount %lu.\n", ref); ret = restore_display_modes(original_modes, display_count); ok(ret, "Failed to restore display modes.\n"); @@ -4198,24 +4191,24 @@ static void test_coop_level_mode_set_multi(void) ddraw1 = create_ddraw(); ok(!!ddraw1, "Failed to create a ddraw object.\n"); hr = set_display_mode(ddraw1, 800, 600); - ok(hr == DD_OK, "Failed to set display mode, hr %#x.\n", hr); + ok(hr == DD_OK, "Failed to set display mode, hr %#lx.\n", hr); change_ret = ChangeDisplaySettingsExW(second_monitor_name, &devmode, NULL, CDS_UPDATEREGISTRY | CDS_NORESET, NULL); - ok(change_ret == DISP_CHANGE_SUCCESSFUL, "ChangeDisplaySettingsExW failed with %d.\n", change_ret); + ok(change_ret == DISP_CHANGE_SUCCESSFUL, "ChangeDisplaySettingsExW failed with %ld.\n", change_ret); ref = IDirectDraw2_Release(ddraw1); - ok(ref == 0, "The ddraw object was not properly freed: refcount %u.\n", ref); + ok(!ref, "Unexpected refcount %lu.\n", ref); ret = EnumDisplaySettingsW(second_monitor_name, ENUM_CURRENT_SETTINGS, &devmode2); - ok(ret, "EnumDisplaySettingsW failed, error %#x.\n", GetLastError()); + ok(ret, "EnumDisplaySettingsW failed, error %lu.\n", GetLastError()); ok(devmode2.dmPelsWidth == devmode.dmPelsWidth && devmode2.dmPelsHeight == devmode.dmPelsHeight, - "Expected resolution %ux%u, got %ux%u.\n", devmode.dmPelsWidth, devmode.dmPelsHeight, + "Expected resolution %lux%lu, got %lux%lu.\n", devmode.dmPelsWidth, devmode.dmPelsHeight, devmode2.dmPelsWidth, devmode2.dmPelsHeight); ret = EnumDisplaySettingsW(second_monitor_name, ENUM_REGISTRY_SETTINGS, &devmode2); - ok(ret, "EnumDisplaySettingsW failed, error %#x.\n", GetLastError()); + ok(ret, "EnumDisplaySettingsW failed, error %lu.\n", GetLastError()); ok(devmode2.dmPelsWidth == devmode.dmPelsWidth && devmode2.dmPelsHeight == devmode.dmPelsHeight, - "Expected resolution %ux%u, got %ux%u.\n", devmode.dmPelsWidth, devmode.dmPelsHeight, + "Expected resolution %lux%lu, got %lux%lu.\n", devmode.dmPelsWidth, devmode.dmPelsHeight, devmode2.dmPelsWidth, devmode2.dmPelsHeight); ret = restore_display_modes(original_modes, display_count); ok(ret, "Failed to restore display modes.\n"); @@ -4227,27 +4220,27 @@ static void test_coop_level_mode_set_multi(void) ddraw2 = create_ddraw(); ok(!!ddraw2, "Failed to create a ddraw object.\n"); hr = set_display_mode(ddraw1, 800, 600); - ok(hr == DD_OK, "Failed to set display mode, hr %#x.\n", hr); + ok(hr == DD_OK, "Failed to set display mode, hr %#lx.\n", hr); hr = set_display_mode(ddraw2, 640, 480); - ok(hr == DD_OK, "Failed to set display mode, hr %#x.\n", hr); + ok(hr == DD_OK, "Failed to set display mode, hr %#lx.\n", hr); change_ret = ChangeDisplaySettingsExW(second_monitor_name, &devmode, NULL, CDS_RESET, NULL); - ok(change_ret == DISP_CHANGE_SUCCESSFUL, "ChangeDisplaySettingsExW failed with %d.\n", change_ret); + ok(change_ret == DISP_CHANGE_SUCCESSFUL, "ChangeDisplaySettingsExW failed with %ld.\n", change_ret); hr = IDirectDraw2_RestoreDisplayMode(ddraw2); - ok(hr == DD_OK, "RestoreDisplayMode failed, hr %#x.\n", hr); + ok(hr == DD_OK, "RestoreDisplayMode failed, hr %#lx.\n", hr); ret = EnumDisplaySettingsW(second_monitor_name, ENUM_CURRENT_SETTINGS, &devmode2); - ok(ret, "EnumDisplaySettingsW failed, error %#x.\n", GetLastError()); + ok(ret, "EnumDisplaySettingsW failed, error %lu.\n", GetLastError()); ok(compare_mode_rect(&devmode2, &old_devmode), "Got a different mode.\n"); ret = EnumDisplaySettingsW(second_monitor_name, ENUM_REGISTRY_SETTINGS, &devmode2); - ok(ret, "EnumDisplaySettingsW failed, error %#x.\n", GetLastError()); + ok(ret, "EnumDisplaySettingsW failed, error %lu.\n", GetLastError()); ok(compare_mode_rect(&devmode2, &old_devmode), "Got a different mode.\n"); ref = IDirectDraw2_Release(ddraw2); - ok(ref == 0, "The ddraw object was not properly freed: refcount %u.\n", ref); + ok(!ref, "Unexpected refcount %lu.\n", ref); ref = IDirectDraw2_Release(ddraw1); - ok(ref == 0, "The ddraw object was not properly freed: refcount %u.\n", ref); + ok(!ref, "Unexpected refcount %lu.\n", ref); ret = restore_display_modes(original_modes, display_count); ok(ret, "Failed to restore display modes.\n"); @@ -4258,25 +4251,25 @@ static void test_coop_level_mode_set_multi(void) ddraw2 = create_ddraw(); ok(!!ddraw2, "Failed to create a ddraw object.\n"); hr = set_display_mode(ddraw1, 800, 600); - ok(hr == DD_OK, "Failed to set display mode, hr %#x.\n", hr); + ok(hr == DD_OK, "Failed to set display mode, hr %#lx.\n", hr); hr = set_display_mode(ddraw2, 640, 480); - ok(hr == DD_OK, "Failed to set display mode, hr %#x.\n", hr); + ok(hr == DD_OK, "Failed to set display mode, hr %#lx.\n", hr); change_ret = ChangeDisplaySettingsExW(second_monitor_name, &devmode, NULL, CDS_RESET, NULL); - ok(change_ret == DISP_CHANGE_SUCCESSFUL, "ChangeDisplaySettingsExW failed with %d.\n", change_ret); + ok(change_ret == DISP_CHANGE_SUCCESSFUL, "ChangeDisplaySettingsExW failed with %ld.\n", change_ret); ref = IDirectDraw2_Release(ddraw2); - ok(ref == 0, "The ddraw object was not properly freed: refcount %u.\n", ref); + ok(!ref, "Unexpected refcount %lu.\n", ref); ret = EnumDisplaySettingsW(second_monitor_name, ENUM_CURRENT_SETTINGS, &devmode2); - ok(ret, "EnumDisplaySettingsW failed, error %#x.\n", GetLastError()); + ok(ret, "EnumDisplaySettingsW failed, error %lu.\n", GetLastError()); ok(compare_mode_rect(&devmode2, &old_devmode), "Got a different mode.\n"); ret = EnumDisplaySettingsW(second_monitor_name, ENUM_REGISTRY_SETTINGS, &devmode2); - ok(ret, "EnumDisplaySettingsW failed, error %#x.\n", GetLastError()); + ok(ret, "EnumDisplaySettingsW failed, error %lu.\n", GetLastError()); ok(compare_mode_rect(&devmode2, &old_devmode), "Got a different mode.\n"); ref = IDirectDraw2_Release(ddraw1); - ok(ref == 0, "The ddraw object was not properly freed: refcount %u.\n", ref); + ok(!ref, "Unexpected refcount %lu.\n", ref); done: DestroyWindow(window); @@ -4294,16 +4287,16 @@ static void test_initialize(void) ok(!!ddraw, "Failed to create a ddraw object.\n"); hr = IDirectDraw2_Initialize(ddraw, NULL); - ok(hr == DDERR_ALREADYINITIALIZED, "Initialize returned hr %#x.\n", hr); + ok(hr == DDERR_ALREADYINITIALIZED, "Initialize returned hr %#lx.\n", hr); IDirectDraw2_Release(ddraw); CoInitialize(NULL); hr = CoCreateInstance(&CLSID_DirectDraw, NULL, CLSCTX_INPROC_SERVER, &IID_IDirectDraw2, (void **)&ddraw); - ok(SUCCEEDED(hr), "Failed to create IDirectDraw2 instance, hr %#x.\n", hr); + ok(SUCCEEDED(hr), "Failed to create IDirectDraw2 instance, hr %#lx.\n", hr); hr = IDirectDraw2_Initialize(ddraw, NULL); - ok(hr == DD_OK, "Initialize returned hr %#x, expected DD_OK.\n", hr); + ok(hr == DD_OK, "Initialize returned hr %#lx, expected DD_OK.\n", hr); hr = IDirectDraw2_Initialize(ddraw, NULL); - ok(hr == DDERR_ALREADYINITIALIZED, "Initialize returned hr %#x, expected DDERR_ALREADYINITIALIZED.\n", hr); + ok(hr == DDERR_ALREADYINITIALIZED, "Initialize returned hr %#lx, expected DDERR_ALREADYINITIALIZED.\n", hr); IDirectDraw2_Release(ddraw); CoUninitialize(); } @@ -4324,20 +4317,20 @@ static void test_coop_level_surf_create(void) ddsd.ddsCaps.dwCaps = DDSCAPS_PRIMARYSURFACE; surface = (void *)0xdeadbeef; hr = IDirectDraw2_CreateSurface(ddraw, &ddsd, &surface, NULL); - ok(hr == DDERR_NOCOOPERATIVELEVELSET, "Surface creation returned hr %#x.\n", hr); + ok(hr == DDERR_NOCOOPERATIVELEVELSET, "Surface creation returned hr %#lx.\n", hr); ok(surface == (void *)0xdeadbeef, "Got unexpected surface %p.\n", surface); surface = (void *)0xdeadbeef; hr = IDirectDraw2_CreateSurface(ddraw, NULL, &surface, NULL); - ok(hr == DDERR_NOCOOPERATIVELEVELSET, "Surface creation returned hr %#x.\n", hr); + ok(hr == DDERR_NOCOOPERATIVELEVELSET, "Surface creation returned hr %#lx.\n", hr); ok(surface == (void *)0xdeadbeef, "Got unexpected surface %p.\n", surface); hr = IDirectDraw2_SetCooperativeLevel(ddraw, NULL, DDSCL_NORMAL); - ok(SUCCEEDED(hr), "Failed to set cooperative level, hr %#x.\n", hr); + ok(SUCCEEDED(hr), "Failed to set cooperative level, hr %#lx.\n", hr); surface = (void *)0xdeadbeef; hr = IDirectDraw2_CreateSurface(ddraw, NULL, &surface, NULL); - ok(hr == DDERR_INVALIDPARAMS, "Unexpected hr %#x.\n", hr); + ok(hr == DDERR_INVALIDPARAMS, "Unexpected hr %#lx.\n", hr); ok(surface == (void *)0xdeadbeef, "Got unexpected surface %p.\n", surface); IDirectDraw2_Release(ddraw); @@ -4355,9 +4348,9 @@ static void test_coop_level_multi_window(void) ok(!!ddraw, "Failed to create a ddraw object.\n"); hr = IDirectDraw2_SetCooperativeLevel(ddraw, window1, DDSCL_NORMAL); - ok(SUCCEEDED(hr), "Failed to set cooperative level, hr %#x.\n", hr); + ok(SUCCEEDED(hr), "Failed to set cooperative level, hr %#lx.\n", hr); hr = IDirectDraw2_SetCooperativeLevel(ddraw, window2, DDSCL_NORMAL); - ok(SUCCEEDED(hr), "Failed to set cooperative level, hr %#x.\n", hr); + ok(SUCCEEDED(hr), "Failed to set cooperative level, hr %#lx.\n", hr); ok(IsWindow(window1), "Window 1 was destroyed.\n"); ok(IsWindow(window2), "Window 2 was destroyed.\n"); @@ -4374,7 +4367,7 @@ static void test_clear_rect_count(void) IDirect3DDevice2 *device; IDirectDrawSurface *rt; IDirectDraw2 *ddraw; - D3DCOLOR color; + unsigned int color; HWND window; HRESULT hr; @@ -4390,7 +4383,7 @@ static void test_clear_rect_count(void) } hr = IDirect3DDevice2_GetRenderTarget(device, &rt); - ok(SUCCEEDED(hr), "Failed to get render target, hr %#x.\n", hr); + ok(SUCCEEDED(hr), "Failed to get render target, hr %#lx.\n", hr); white = create_diffuse_material(device, 1.0f, 1.0f, 1.0f, 1.0f); red = create_diffuse_material(device, 1.0f, 0.0f, 0.0f, 1.0f); @@ -4399,20 +4392,20 @@ static void test_clear_rect_count(void) viewport = create_viewport(device, 0, 0, 640, 480); hr = IDirect3DDevice2_SetCurrentViewport(device, viewport); - ok(SUCCEEDED(hr), "Failed to set current viewport, hr %#x.\n", hr); + ok(SUCCEEDED(hr), "Failed to set current viewport, hr %#lx.\n", hr); viewport_set_background(device, viewport, white); hr = IDirect3DViewport2_Clear(viewport, 1, &clear_rect, D3DCLEAR_TARGET); - ok(SUCCEEDED(hr), "Failed to clear viewport, hr %#x.\n", hr); + ok(SUCCEEDED(hr), "Failed to clear viewport, hr %#lx.\n", hr); viewport_set_background(device, viewport, red); hr = IDirect3DViewport2_Clear(viewport, 0, &clear_rect, D3DCLEAR_TARGET); - ok(SUCCEEDED(hr), "Failed to clear viewport, hr %#x.\n", hr); + ok(SUCCEEDED(hr), "Failed to clear viewport, hr %#lx.\n", hr); viewport_set_background(device, viewport, green); hr = IDirect3DViewport2_Clear(viewport, 0, NULL, D3DCLEAR_TARGET); - ok(SUCCEEDED(hr), "Failed to clear viewport, hr %#x.\n", hr); + ok(SUCCEEDED(hr), "Failed to clear viewport, hr %#lx.\n", hr); viewport_set_background(device, viewport, blue); hr = IDirect3DViewport2_Clear(viewport, 0, &clear_rect, D3DCLEAR_TARGET); - ok(SUCCEEDED(hr), "Failed to clear viewport, hr %#x.\n", hr); + ok(SUCCEEDED(hr), "Failed to clear viewport, hr %#lx.\n", hr); color = get_surface_color(rt, 320, 240); ok(compare_color(color, 0x00ffffff, 1) || broken(compare_color(color, 0x000000ff, 1)), @@ -4437,21 +4430,21 @@ static BOOL test_mode_restored(IDirectDraw2 *ddraw, HWND window) memset(&ddsd1, 0, sizeof(ddsd1)); ddsd1.dwSize = sizeof(ddsd1); hr = IDirectDraw2_GetDisplayMode(ddraw, &ddsd1); - ok(SUCCEEDED(hr), "GetDisplayMode failed, hr %#x.\n", hr); + ok(SUCCEEDED(hr), "GetDisplayMode failed, hr %#lx.\n", hr); hr = IDirectDraw2_SetCooperativeLevel(ddraw, window, DDSCL_EXCLUSIVE | DDSCL_FULLSCREEN); - ok(SUCCEEDED(hr), "SetCooperativeLevel failed, hr %#x.\n", hr); + ok(SUCCEEDED(hr), "SetCooperativeLevel failed, hr %#lx.\n", hr); hr = set_display_mode(ddraw, 640, 480); - ok(SUCCEEDED(hr), "Failed to set display mode, hr %#x.\n", hr); + ok(SUCCEEDED(hr), "Failed to set display mode, hr %#lx.\n", hr); hr = IDirectDraw2_SetCooperativeLevel(ddraw, window, DDSCL_NORMAL); - ok(SUCCEEDED(hr), "SetCooperativeLevel failed, hr %#x.\n", hr); + ok(SUCCEEDED(hr), "SetCooperativeLevel failed, hr %#lx.\n", hr); memset(&ddsd2, 0, sizeof(ddsd2)); ddsd2.dwSize = sizeof(ddsd2); hr = IDirectDraw2_GetDisplayMode(ddraw, &ddsd2); - ok(SUCCEEDED(hr), "GetDisplayMode failed, hr %#x.\n", hr); + ok(SUCCEEDED(hr), "GetDisplayMode failed, hr %#lx.\n", hr); hr = IDirectDraw2_RestoreDisplayMode(ddraw); - ok(SUCCEEDED(hr), "RestoreDisplayMode failed, hr %#x.\n", hr); + ok(SUCCEEDED(hr), "RestoreDisplayMode failed, hr %#lx.\n", hr); return ddsd1.dwWidth == ddsd2.dwWidth && ddsd1.dwHeight == ddsd2.dwHeight; } @@ -4475,16 +4468,16 @@ static void test_coop_level_versions(void) /* A failing ddraw1::SetCooperativeLevel call does not have an effect */ hr = IDirectDraw2_QueryInterface(ddraw2, &IID_IDirectDraw, (void **)&ddraw); - ok(SUCCEEDED(hr), "QueryInterface failed, hr %#x.\n", hr); + ok(SUCCEEDED(hr), "QueryInterface failed, hr %#lx.\n", hr); hr = IDirectDraw_SetCooperativeLevel(ddraw, NULL, DDSCL_FULLSCREEN | DDSCL_EXCLUSIVE); - ok(FAILED(hr), "SetCooperativeLevel returned %#x, expected failure.\n", hr); + ok(FAILED(hr), "SetCooperativeLevel returned %#lx, expected failure.\n", hr); restored = test_mode_restored(ddraw2, window); ok(restored, "Display mode not restored after bad ddraw1::SetCooperativeLevel call\n"); /* A successful one does */ hr = IDirectDraw_SetCooperativeLevel(ddraw, NULL, DDSCL_NORMAL); - ok(SUCCEEDED(hr), "SetCooperativeLevel failed, hr %#x.\n", hr); + ok(SUCCEEDED(hr), "SetCooperativeLevel failed, hr %#lx.\n", hr); restored = test_mode_restored(ddraw2, window); ok(!restored, "Display mode restored after good ddraw1::SetCooperativeLevel call\n"); @@ -4494,10 +4487,10 @@ static void test_coop_level_versions(void) ddraw2 = create_ddraw(); ok(!!ddraw2, "Failed to create a ddraw object.\n"); hr = IDirectDraw2_QueryInterface(ddraw2, &IID_IDirectDraw, (void **)&ddraw); - ok(SUCCEEDED(hr), "QueryInterface failed, hr %#x.\n", hr); + ok(SUCCEEDED(hr), "QueryInterface failed, hr %#lx.\n", hr); hr = IDirectDraw_SetCooperativeLevel(ddraw, window, DDSCL_SETFOCUSWINDOW); - ok(SUCCEEDED(hr), "SetCooperativeLevel failed, hr %#x.\n", hr); + ok(SUCCEEDED(hr), "SetCooperativeLevel failed, hr %#lx.\n", hr); restored = test_mode_restored(ddraw2, window); ok(!restored, "Display mode restored after ddraw1::SetCooperativeLevel(SETFOCUSWINDOW) call\n"); @@ -4508,12 +4501,12 @@ static void test_coop_level_versions(void) ddraw2 = create_ddraw(); ok(!!ddraw2, "Failed to create a ddraw object.\n"); hr = IDirectDraw2_QueryInterface(ddraw2, &IID_IDirectDraw, (void **)&ddraw); - ok(SUCCEEDED(hr), "QueryInterface failed, hr %#x.\n", hr); + ok(SUCCEEDED(hr), "QueryInterface failed, hr %#lx.\n", hr); hr = IDirectDraw_SetCooperativeLevel(ddraw, NULL, DDSCL_NORMAL); - ok(SUCCEEDED(hr), "SetCooperativeLevel failed, hr %#x.\n", hr); + ok(SUCCEEDED(hr), "SetCooperativeLevel failed, hr %#lx.\n", hr); hr = IDirectDraw_SetCooperativeLevel(ddraw, NULL, DDSCL_FULLSCREEN | DDSCL_EXCLUSIVE); - ok(FAILED(hr), "SetCooperativeLevel returned %#x, expected failure.\n", hr); + ok(FAILED(hr), "SetCooperativeLevel returned %#lx, expected failure.\n", hr); restored = test_mode_restored(ddraw2, window); ok(!restored, "Display mode restored after good-bad ddraw1::SetCooperativeLevel() call sequence\n"); @@ -4524,14 +4517,14 @@ static void test_coop_level_versions(void) ddraw2 = create_ddraw(); ok(!!ddraw2, "Failed to create a ddraw object.\n"); hr = IDirectDraw2_QueryInterface(ddraw2, &IID_IDirectDraw, (void **)&ddraw); - ok(SUCCEEDED(hr), "QueryInterface failed, hr %#x.\n", hr); + ok(SUCCEEDED(hr), "QueryInterface failed, hr %#lx.\n", hr); hr = IDirectDraw_SetCooperativeLevel(ddraw, NULL, DDSCL_NORMAL); - ok(SUCCEEDED(hr), "SetCooperativeLevel failed, hr %#x.\n", hr); + ok(SUCCEEDED(hr), "SetCooperativeLevel failed, hr %#lx.\n", hr); hr = IDirectDraw2_SetCooperativeLevel(ddraw2, window, DDSCL_FULLSCREEN | DDSCL_EXCLUSIVE); - ok(SUCCEEDED(hr), "SetCooperativeLevel failed, hr %#x.\n", hr); + ok(SUCCEEDED(hr), "SetCooperativeLevel failed, hr %#lx.\n", hr); hr = IDirectDraw2_SetCooperativeLevel(ddraw2, window, DDSCL_NORMAL); - ok(SUCCEEDED(hr), "SetCooperativeLevel failed, hr %#x.\n", hr); + ok(SUCCEEDED(hr), "SetCooperativeLevel failed, hr %#lx.\n", hr); restored = test_mode_restored(ddraw2, window); ok(!restored, "Display mode restored after ddraw1-ddraw2 SetCooperativeLevel() call sequence\n"); @@ -4542,10 +4535,10 @@ static void test_coop_level_versions(void) ddraw2 = create_ddraw(); ok(!!ddraw2, "Failed to create a ddraw object.\n"); hr = IDirectDraw2_QueryInterface(ddraw2, &IID_IDirectDraw, (void **)&ddraw); - ok(SUCCEEDED(hr), "QueryInterface failed, hr %#x.\n", hr); + ok(SUCCEEDED(hr), "QueryInterface failed, hr %#lx.\n", hr); hr = IDirectDraw2_SetCooperativeLevel(ddraw2, window, DDSCL_NORMAL); - ok(SUCCEEDED(hr), "SetCooperativeLevel failed, hr %#x.\n", hr); + ok(SUCCEEDED(hr), "SetCooperativeLevel failed, hr %#lx.\n", hr); memset(&ddsd, 0, sizeof(ddsd)); ddsd.dwSize = sizeof(ddsd); @@ -4553,7 +4546,7 @@ static void test_coop_level_versions(void) ddsd.ddsCaps.dwCaps = DDSCAPS_OFFSCREENPLAIN; ddsd.dwWidth = ddsd.dwHeight = 8; hr = IDirectDraw_CreateSurface(ddraw, &ddsd, &surface, NULL); - ok(SUCCEEDED(hr), "CreateSurface failed, hr %#x.\n", hr); + ok(SUCCEEDED(hr), "CreateSurface failed, hr %#lx.\n", hr); IDirectDrawSurface_Release(surface); restored = test_mode_restored(ddraw2, window); ok(restored, "Display mode not restored after ddraw1::CreateSurface() call\n"); @@ -4570,13 +4563,12 @@ static void test_lighting_interface_versions(void) IDirect3DViewport2 *viewport; IDirect3DDevice2 *device; IDirectDrawSurface *rt; + unsigned int color, i; IDirectDraw2 *ddraw; - D3DCOLOR color; HWND window; HRESULT hr; D3DMATERIALHANDLE mat_handle; DWORD rs; - unsigned int i; ULONG ref; static D3DVERTEX quad[] = { @@ -4605,7 +4597,7 @@ static void test_lighting_interface_versions(void) void *data; DWORD d3drs_lighting, d3drs_specular; DWORD draw_flags; - D3DCOLOR color; + unsigned int color; } tests[] = { @@ -4652,45 +4644,45 @@ static void test_lighting_interface_versions(void) } hr = IDirect3DDevice2_GetRenderTarget(device, &rt); - ok(SUCCEEDED(hr), "Failed to get render target, hr %#x.\n", hr); + ok(SUCCEEDED(hr), "Failed to get render target, hr %#lx.\n", hr); viewport = create_viewport(device, 0, 0, 640, 480); hr = IDirect3DDevice2_SetCurrentViewport(device, viewport); - ok(SUCCEEDED(hr), "Failed to set current viewport, hr %#x.\n", hr); + ok(SUCCEEDED(hr), "Failed to set current viewport, hr %#lx.\n", hr); emissive = create_emissive_material(device, 0.0f, 1.0f, 0.0f, 0.0f); hr = IDirect3DMaterial2_GetHandle(emissive, device, &mat_handle); - ok(SUCCEEDED(hr), "Failed to get material handle, hr %#x.\n", hr); + ok(SUCCEEDED(hr), "Failed to get material handle, hr %#lx.\n", hr); hr = IDirect3DDevice2_SetLightState(device, D3DLIGHTSTATE_MATERIAL, mat_handle); - ok(SUCCEEDED(hr), "Failed to set material state, hr %#x.\n", hr); + ok(SUCCEEDED(hr), "Failed to set material state, hr %#lx.\n", hr); hr = IDirect3DDevice2_SetRenderState(device, D3DRENDERSTATE_ZENABLE, D3DZB_FALSE); - ok(SUCCEEDED(hr), "Failed to disable z test, hr %#x.\n", hr); + ok(SUCCEEDED(hr), "Failed to disable z test, hr %#lx.\n", hr); background = create_diffuse_material(device, 0.1f, 0.1f, 0.1f, 0.1f); viewport_set_background(device, viewport, background); hr = IDirect3DDevice2_GetRenderState(device, D3DRENDERSTATE_SPECULARENABLE, &rs); - ok(SUCCEEDED(hr), "Failed to get specularenable render state, hr %#x.\n", hr); - ok(rs == TRUE, "Initial D3DRENDERSTATE_SPECULARENABLE is %#x, expected TRUE.\n", rs); + ok(SUCCEEDED(hr), "Failed to get specularenable render state, hr %#lx.\n", hr); + ok(rs == TRUE, "Initial D3DRENDERSTATE_SPECULARENABLE is %#lx, expected TRUE.\n", rs); for (i = 0; i < ARRAY_SIZE(tests); i++) { hr = IDirect3DViewport2_Clear(viewport, 1, &clear_rect, D3DCLEAR_TARGET); - ok(SUCCEEDED(hr), "Failed to clear viewport, hr %#x.\n", hr); + ok(SUCCEEDED(hr), "Failed to clear viewport, hr %#lx.\n", hr); hr = IDirect3DDevice2_SetRenderState(device, D3DRENDERSTATE_LIGHTING, tests[i].d3drs_lighting); - ok(SUCCEEDED(hr), "Failed to set lighting render state, hr %#x.\n", hr); + ok(SUCCEEDED(hr), "Failed to set lighting render state, hr %#lx.\n", hr); hr = IDirect3DDevice2_SetRenderState(device, D3DRENDERSTATE_SPECULARENABLE, tests[i].d3drs_specular); - ok(SUCCEEDED(hr), "Failed to set specularenable render state, hr %#x.\n", hr); + ok(SUCCEEDED(hr), "Failed to set specularenable render state, hr %#lx.\n", hr); hr = IDirect3DDevice2_BeginScene(device); - ok(SUCCEEDED(hr), "Failed to begin scene, hr %#x.\n", hr); + ok(SUCCEEDED(hr), "Failed to begin scene, hr %#lx.\n", hr); hr = IDirect3DDevice2_DrawPrimitive(device, D3DPT_TRIANGLESTRIP, tests[i].vertextype, tests[i].data, 4, tests[i].draw_flags | D3DDP_WAIT); - ok(SUCCEEDED(hr), "Failed to draw, hr %#x.\n", hr); + ok(SUCCEEDED(hr), "Failed to draw, hr %#lx.\n", hr); hr = IDirect3DDevice2_EndScene(device); - ok(SUCCEEDED(hr), "Failed to end scene, hr %#x.\n", hr); + ok(SUCCEEDED(hr), "Failed to end scene, hr %#lx.\n", hr); color = get_surface_color(rt, 320, 240); ok(compare_color(color, tests[i].color, 1), @@ -4704,7 +4696,7 @@ static void test_lighting_interface_versions(void) IDirectDrawSurface_Release(rt); IDirect3DDevice2_Release(device); ref = IDirectDraw2_Release(ddraw); - ok(ref == 0, "Ddraw object not properly released, refcount %u.\n", ref); + ok(!ref, "Unexpected refcount %lu.\n", ref); DestroyWindow(window); } @@ -4726,7 +4718,7 @@ static LRESULT CALLBACK activateapp_test_proc(HWND hwnd, UINT message, WPARAM wp activateapp_testdata.received = FALSE; hr = IDirectDraw2_SetCooperativeLevel(activateapp_testdata.ddraw, activateapp_testdata.window, activateapp_testdata.coop_level); - ok(SUCCEEDED(hr), "Recursive SetCooperativeLevel call failed, hr %#x.\n", hr); + ok(SUCCEEDED(hr), "Recursive SetCooperativeLevel call failed, hr %#lx.\n", hr); ok(!activateapp_testdata.received, "Received WM_ACTIVATEAPP during recursive SetCooperativeLevel call.\n"); } activateapp_testdata.received = TRUE; @@ -4758,31 +4750,31 @@ static void test_coop_level_activateapp(void) SetForegroundWindow(window); activateapp_testdata.received = FALSE; hr = IDirectDraw2_SetCooperativeLevel(ddraw, window, DDSCL_EXCLUSIVE | DDSCL_FULLSCREEN); - ok(SUCCEEDED(hr), "Failed to set cooperative level, hr %#x.\n", hr); + ok(SUCCEEDED(hr), "Failed to set cooperative level, hr %#lx.\n", hr); ok(!activateapp_testdata.received, "Received WM_ACTIVATEAPP although window was already active.\n"); hr = IDirectDraw2_SetCooperativeLevel(ddraw, NULL, DDSCL_NORMAL); - ok(SUCCEEDED(hr), "Failed to set cooperative level, hr %#x.\n", hr); + ok(SUCCEEDED(hr), "Failed to set cooperative level, hr %#lx.\n", hr); /* Exclusive with window not active. */ SetForegroundWindow(GetDesktopWindow()); activateapp_testdata.received = FALSE; hr = IDirectDraw2_SetCooperativeLevel(ddraw, window, DDSCL_EXCLUSIVE | DDSCL_FULLSCREEN); - ok(SUCCEEDED(hr), "Failed to set cooperative level, hr %#x.\n", hr); + ok(SUCCEEDED(hr), "Failed to set cooperative level, hr %#lx.\n", hr); ok(activateapp_testdata.received, "Expected WM_ACTIVATEAPP, but did not receive it.\n"); hr = IDirectDraw2_SetCooperativeLevel(ddraw, NULL, DDSCL_NORMAL); - ok(SUCCEEDED(hr), "Failed to set cooperative level, hr %#x.\n", hr); + ok(SUCCEEDED(hr), "Failed to set cooperative level, hr %#lx.\n", hr); /* Normal with window not active, then exclusive with the same window. */ SetForegroundWindow(GetDesktopWindow()); activateapp_testdata.received = FALSE; hr = IDirectDraw2_SetCooperativeLevel(ddraw, window, DDSCL_NORMAL); - ok(SUCCEEDED(hr), "Failed to set cooperative level, hr %#x.\n", hr); + ok(SUCCEEDED(hr), "Failed to set cooperative level, hr %#lx.\n", hr); ok(!activateapp_testdata.received, "Received WM_ACTIVATEAPP when setting DDSCL_NORMAL.\n"); hr = IDirectDraw2_SetCooperativeLevel(ddraw, window, DDSCL_EXCLUSIVE | DDSCL_FULLSCREEN); - ok(SUCCEEDED(hr), "Failed to set cooperative level, hr %#x.\n", hr); + ok(SUCCEEDED(hr), "Failed to set cooperative level, hr %#lx.\n", hr); ok(activateapp_testdata.received, "Expected WM_ACTIVATEAPP, but did not receive it.\n"); hr = IDirectDraw2_SetCooperativeLevel(ddraw, NULL, DDSCL_NORMAL); - ok(SUCCEEDED(hr), "Failed to set cooperative level, hr %#x.\n", hr); + ok(SUCCEEDED(hr), "Failed to set cooperative level, hr %#lx.\n", hr); /* Recursive set of DDSCL_EXCLUSIVE | DDSCL_FULLSCREEN. */ SetForegroundWindow(GetDesktopWindow()); @@ -4791,10 +4783,10 @@ static void test_coop_level_activateapp(void) activateapp_testdata.window = window; activateapp_testdata.coop_level = DDSCL_EXCLUSIVE | DDSCL_FULLSCREEN; hr = IDirectDraw2_SetCooperativeLevel(ddraw, window, DDSCL_EXCLUSIVE | DDSCL_FULLSCREEN); - ok(SUCCEEDED(hr), "Failed to set cooperative level, hr %#x.\n", hr); + ok(SUCCEEDED(hr), "Failed to set cooperative level, hr %#lx.\n", hr); ok(activateapp_testdata.received, "Expected WM_ACTIVATEAPP, but did not receive it.\n"); hr = IDirectDraw2_SetCooperativeLevel(ddraw, NULL, DDSCL_NORMAL); - ok(SUCCEEDED(hr), "Failed to set cooperative level, hr %#x.\n", hr); + ok(SUCCEEDED(hr), "Failed to set cooperative level, hr %#lx.\n", hr); /* The recursive call seems to have some bad effect on native ddraw, despite (apparently) * succeeding. Another switch to exclusive and back to normal is needed to release the @@ -4802,9 +4794,9 @@ static void test_coop_level_activateapp(void) * WM_ACTIVATEAPP messages. */ activateapp_testdata.ddraw = NULL; hr = IDirectDraw2_SetCooperativeLevel(ddraw, window, DDSCL_EXCLUSIVE | DDSCL_FULLSCREEN); - ok(SUCCEEDED(hr), "Failed to set cooperative level, hr %#x.\n", hr); + ok(SUCCEEDED(hr), "Failed to set cooperative level, hr %#lx.\n", hr); hr = IDirectDraw2_SetCooperativeLevel(ddraw, NULL, DDSCL_NORMAL); - ok(SUCCEEDED(hr), "Failed to set cooperative level, hr %#x.\n", hr); + ok(SUCCEEDED(hr), "Failed to set cooperative level, hr %#lx.\n", hr); /* Setting DDSCL_NORMAL with recursive invocation. */ SetForegroundWindow(GetDesktopWindow()); @@ -4813,7 +4805,7 @@ static void test_coop_level_activateapp(void) activateapp_testdata.window = window; activateapp_testdata.coop_level = DDSCL_NORMAL; hr = IDirectDraw2_SetCooperativeLevel(ddraw, window, DDSCL_EXCLUSIVE | DDSCL_FULLSCREEN); - ok(SUCCEEDED(hr), "Failed to set cooperative level, hr %#x.\n", hr); + ok(SUCCEEDED(hr), "Failed to set cooperative level, hr %#lx.\n", hr); ok(activateapp_testdata.received, "Expected WM_ACTIVATEAPP, but did not receive it.\n"); /* DDraw is in exclusive mode now. */ @@ -4823,15 +4815,15 @@ static void test_coop_level_activateapp(void) ddsd.dwBackBufferCount = 1; ddsd.ddsCaps.dwCaps = DDSCAPS_PRIMARYSURFACE | DDSCAPS_COMPLEX | DDSCAPS_FLIP; hr = IDirectDraw2_CreateSurface(ddraw, &ddsd, &surface, NULL); - ok(SUCCEEDED(hr), "Failed to create surface, hr %#x.\n", hr); + ok(SUCCEEDED(hr), "Failed to create surface, hr %#lx.\n", hr); IDirectDrawSurface_Release(surface); /* Recover again, just to be sure. */ activateapp_testdata.ddraw = NULL; hr = IDirectDraw2_SetCooperativeLevel(ddraw, window, DDSCL_EXCLUSIVE | DDSCL_FULLSCREEN); - ok(SUCCEEDED(hr), "Failed to set cooperative level, hr %#x.\n", hr); + ok(SUCCEEDED(hr), "Failed to set cooperative level, hr %#lx.\n", hr); hr = IDirectDraw2_SetCooperativeLevel(ddraw, NULL, DDSCL_NORMAL); - ok(SUCCEEDED(hr), "Failed to set cooperative level, hr %#x.\n", hr); + ok(SUCCEEDED(hr), "Failed to set cooperative level, hr %#lx.\n", hr); DestroyWindow(window); UnregisterClassA("ddraw_test_wndproc_wc", GetModuleHandleA(NULL)); @@ -4907,7 +4899,7 @@ static void test_unsupported_formats(void) { struct format_support_check check = {&formats[i].fmt, FALSE}; hr = IDirect3DDevice2_EnumTextureFormats(device, test_unsupported_formats_cb, &check); - ok(SUCCEEDED(hr), "Failed to enumerate texture formats %#x.\n", hr); + ok(SUCCEEDED(hr), "Got hr %#lx.\n", hr); for (j = 0; j < ARRAY_SIZE(caps); j++) { @@ -4926,7 +4918,7 @@ static void test_unsupported_formats(void) hr = IDirectDraw2_CreateSurface(ddraw, &ddsd, &surface, NULL); ok(SUCCEEDED(hr) == expect_success, - "Got unexpected hr %#x for format %s, caps %#x, expected %s.\n", + "Got unexpected hr %#lx for format %s, caps %#lx, expected %s.\n", hr, formats[i].name, caps[j], expect_success ? "success" : "failure"); if (FAILED(hr)) continue; @@ -4934,7 +4926,7 @@ static void test_unsupported_formats(void) memset(&ddsd, 0, sizeof(ddsd)); ddsd.dwSize = sizeof(ddsd); hr = IDirectDrawSurface_GetSurfaceDesc(surface, &ddsd); - ok(SUCCEEDED(hr), "Failed to get surface desc, hr %#x.\n", hr); + ok(SUCCEEDED(hr), "Failed to get surface desc, hr %#lx.\n", hr); if (caps[j] & DDSCAPS_VIDEOMEMORY) expected_caps = DDSCAPS_VIDEOMEMORY; @@ -4946,7 +4938,7 @@ static void test_unsupported_formats(void) expected_caps = DDSCAPS_SYSTEMMEMORY; ok(ddsd.ddsCaps.dwCaps & expected_caps, - "Expected capability %#x, format %s, input cap %#x.\n", + "Expected caps %#lx, format %s, input caps %#lx.\n", expected_caps, formats[i].name, caps[j]); IDirectDrawSurface_Release(surface); @@ -5176,12 +5168,12 @@ static void test_rt_caps(const GUID *device_guid) memset(palette_entries, 0, sizeof(palette_entries)); hr = IDirectDraw2_CreatePalette(ddraw, DDPCAPS_ALLOW256 | DDPCAPS_8BIT, palette_entries, &palette, NULL); - ok(hr == DD_OK, "Got unexpected hr %#x.\n", hr); + ok(hr == DD_OK, "Got unexpected hr %#lx.\n", hr); memset(&hal_caps, 0, sizeof(hal_caps)); hal_caps.dwSize = sizeof(hal_caps); hr = IDirectDraw2_GetCaps(ddraw, &hal_caps, NULL); - ok(hr == DD_OK, "Got unexpected hr %#x.\n", hr); + ok(hr == DD_OK, "Got unexpected hr %#lx.\n", hr); for (i = 0; i < ARRAY_SIZE(test_data); ++i) { @@ -5216,7 +5208,7 @@ static void test_rt_caps(const GUID *device_guid) hr = IDirectDraw2_CreateSurface(ddraw, &surface_desc, &surface, NULL); ok(hr == expected_hr || broken(test_data[i].create_may_fail || (software_device && test_data[i].pf == &p8_fmt && hr == DDERR_INVALIDPIXELFORMAT)), - "Got unexpected hr %#x, test %u, software_device %u.\n", hr, i, software_device); + "Got unexpected hr %#lx, test %u, software_device %u.\n", hr, i, software_device); if (FAILED(hr)) continue; @@ -5233,7 +5225,7 @@ static void test_rt_caps(const GUID *device_guid) && surface_desc.ddsCaps.dwCaps == (caps_in | DDSCAPS_SYSTEMMEMORY)) || (software_device && caps_in & DDSCAPS_ZBUFFER && surface_desc.ddsCaps.dwCaps == (caps_in | DDSCAPS_SYSTEMMEMORY)), - "Got unexpected caps %#x, expected %#x, test %u, software_device %u.\n", + "Got unexpected caps %#lx, expected %#lx, test %u, software_device %u.\n", surface_desc.ddsCaps.dwCaps, expected_caps, i, software_device); hr = IDirect3D2_CreateDevice(d3d, device_guid, surface, &device); @@ -5241,30 +5233,30 @@ static void test_rt_caps(const GUID *device_guid) ok((!software_device && hr == test_data[i].create_device_hr) || (software_device && (hr == (test_data[i].create_device_hr == D3DERR_SURFACENOTINVIDMEM ? DD_OK : test_data[i].create_device_hr))), - "Got unexpected hr %#x, test %u, software_device %u.\n", hr, i, software_device); + "Got unexpected hr %#lx, test %u, software_device %u.\n", hr, i, software_device); if (FAILED(hr)) { if (hr == DDERR_NOPALETTEATTACHED) { hr = IDirectDrawSurface_SetPalette(surface, palette); - ok(hr == DD_OK, "Got unexpected hr %#x, test %u, software_device %u.\n", hr, i, software_device); + ok(hr == DD_OK, "Got unexpected hr %#lx, test %u, software_device %u.\n", hr, i, software_device); hr = IDirect3D2_CreateDevice(d3d, device_guid, surface, &device); if (software_device) todo_wine - ok(hr == DD_OK, "Got unexpected hr %#x, test %u, software_device %u.\n", + ok(hr == DD_OK, "Got unexpected hr %#lx, test %u, software_device %u.\n", hr, i, software_device); else if (surface_desc.ddsCaps.dwCaps & DDSCAPS_VIDEOMEMORY) - ok(hr == DDERR_INVALIDPIXELFORMAT, "Got unexpected hr %#x, test %u, software_device %u.\n", + ok(hr == DDERR_INVALIDPIXELFORMAT, "Got unexpected hr %#lx, test %u, software_device %u.\n", hr, i, software_device); else - ok(hr == D3DERR_SURFACENOTINVIDMEM, "Got unexpected hr %#x, test %u, software_device %u.\n", + ok(hr == D3DERR_SURFACENOTINVIDMEM, "Got unexpected hr %#lx, test %u, software_device %u.\n", hr, i, software_device); if (hr == DD_OK) { refcount = IDirect3DDevice2_Release(device); - ok(!refcount, "Test %u: The device was not properly freed, refcount %u.\n", i, refcount); + ok(!refcount, "Test %u: The device was not properly freed, refcount %lu.\n", i, refcount); } } IDirectDrawSurface_Release(surface); @@ -5276,10 +5268,10 @@ static void test_rt_caps(const GUID *device_guid) surface_desc.dwWidth = 640; surface_desc.dwHeight = 480; hr = IDirectDraw2_CreateSurface(ddraw, &surface_desc, &surface, NULL); - ok(hr == DD_OK, "Got unexpected hr %#x, test %u, software_device %u.\n", hr, i, software_device); + ok(hr == DD_OK, "Got unexpected hr %#lx, test %u, software_device %u.\n", hr, i, software_device); hr = IDirect3D2_CreateDevice(d3d, device_guid, surface, &device); - ok(hr == DD_OK, "Got unexpected hr %#x, test %u, software_device %u.\n", hr, i, software_device); + ok(hr == DD_OK, "Got unexpected hr %#lx, test %u, software_device %u.\n", hr, i, software_device); } memset(&surface_desc, 0, sizeof(surface_desc)); @@ -5299,12 +5291,12 @@ static void test_rt_caps(const GUID *device_guid) surface_desc.dwWidth = 640; surface_desc.dwHeight = 480; hr = IDirectDraw2_CreateSurface(ddraw, &surface_desc, &rt, NULL); - ok(hr == DD_OK, "Got unexpected hr %#x, test %u, software_device %u.\n", hr, i, software_device); + ok(hr == DD_OK, "Got unexpected hr %#lx, test %u, software_device %u.\n", hr, i, software_device); hr = IDirect3DDevice2_SetRenderTarget(device, rt, 0); ok(hr == test_data[i].set_rt_hr || (software_device && hr == DDERR_NOPALETTEATTACHED) || broken(hr == test_data[i].alternative_set_rt_hr), - "Got unexpected hr %#x, test %u, software_device %u.\n", + "Got unexpected hr %#lx, test %u, software_device %u.\n", hr, i, software_device); if (SUCCEEDED(hr) || hr == DDERR_INVALIDPIXELFORMAT) @@ -5317,19 +5309,19 @@ static void test_rt_caps(const GUID *device_guid) if (hr == DDERR_INVALIDPIXELFORMAT) { refcount = IDirectDrawSurface_AddRef(rt); - ok(refcount == 2, "Test %u: Got unexpected refcount %u.\n", i, refcount); + ok(refcount == 2, "Test %u: Got unexpected refcount %lu.\n", i, refcount); } hr = IDirect3DDevice2_GetRenderTarget(device, &tmp); - ok(hr == DD_OK, "Got unexpected hr %#x, test %u, software_device %u.\n", hr, i, software_device); + ok(hr == DD_OK, "Got unexpected hr %#lx, test %u, software_device %u.\n", hr, i, software_device); ok(tmp == expected_rt, "Got unexpected rt %p, test %u, software_device %u.\n", tmp, i, software_device); IDirectDrawSurface_Release(tmp); IDirectDrawSurface_Release(rt); refcount = IDirect3DDevice2_Release(device); - ok(refcount == 0, "Test %u: The device was not properly freed, refcount %u.\n", i, refcount); + ok(!refcount, "Unexpected refcount %lu.\n", refcount); refcount = IDirectDrawSurface_Release(surface); - ok(refcount == 0, "Test %u: The surface was not properly freed, refcount %u.\n", i, refcount); + ok(!refcount, "Unexpected refcount %lu.\n", refcount); } IDirectDrawPalette_Release(palette); @@ -5337,7 +5329,7 @@ static void test_rt_caps(const GUID *device_guid) done: refcount = IDirectDraw2_Release(ddraw); - ok(refcount == 0, "The ddraw object was not properly freed, refcount %u.\n", refcount); + ok(!refcount, "Unexpected refcount %lu.\n", refcount); DestroyWindow(window); } @@ -5462,7 +5454,7 @@ static void test_primary_caps(void) for (i = 0; i < ARRAY_SIZE(test_data); ++i) { hr = IDirectDraw2_SetCooperativeLevel(ddraw, window, test_data[i].coop_level); - ok(SUCCEEDED(hr), "Failed to set cooperative level, hr %#x.\n", hr); + ok(SUCCEEDED(hr), "Failed to set cooperative level, hr %#lx.\n", hr); memset(&surface_desc, 0, sizeof(surface_desc)); surface_desc.dwSize = sizeof(surface_desc); @@ -5472,23 +5464,23 @@ static void test_primary_caps(void) surface_desc.ddsCaps.dwCaps = test_data[i].caps_in; surface_desc.dwBackBufferCount = test_data[i].back_buffer_count; hr = IDirectDraw2_CreateSurface(ddraw, &surface_desc, &surface, NULL); - ok(hr == test_data[i].hr, "Test %u: Got unexpected hr %#x, expected %#x.\n", i, hr, test_data[i].hr); + ok(hr == test_data[i].hr, "Test %u: Got unexpected hr %#lx, expected %#lx.\n", i, hr, test_data[i].hr); if (FAILED(hr)) continue; memset(&surface_desc, 0, sizeof(surface_desc)); surface_desc.dwSize = sizeof(surface_desc); hr = IDirectDrawSurface_GetSurfaceDesc(surface, &surface_desc); - ok(SUCCEEDED(hr), "Test %u: Failed to get surface desc, hr %#x.\n", i, hr); + ok(SUCCEEDED(hr), "Test %u: Failed to get surface desc, hr %#lx.\n", i, hr); ok((surface_desc.ddsCaps.dwCaps & ~placement) == test_data[i].caps_out, - "Test %u: Got unexpected caps %#x, expected %#x.\n", + "Test %u: Got unexpected caps %#lx, expected %#lx.\n", i, surface_desc.ddsCaps.dwCaps, test_data[i].caps_out); IDirectDrawSurface_Release(surface); } refcount = IDirectDraw2_Release(ddraw); - ok(refcount == 0, "The ddraw object was not properly freed, refcount %u.\n", refcount); + ok(!refcount, "Unexpected refcount %lu.\n", refcount); DestroyWindow(window); } @@ -5573,27 +5565,27 @@ static void test_surface_lock(void) ddsd.ddsCaps.dwCaps = tests[i].caps; hr = IDirectDraw2_CreateSurface(ddraw, &ddsd, &surface, NULL); - ok(SUCCEEDED(hr), "Failed to create surface, type %s, hr %#x.\n", tests[i].name, hr); + ok(SUCCEEDED(hr), "Failed to create surface, type %s, hr %#lx.\n", tests[i].name, hr); memset(&ddsd, 0, sizeof(ddsd)); ddsd.dwSize = sizeof(ddsd); hr = IDirectDrawSurface_Lock(surface, NULL, &ddsd, DDLOCK_WAIT, NULL); - ok(SUCCEEDED(hr), "Failed to lock surface, type %s, hr %#x.\n", tests[i].name, hr); + ok(SUCCEEDED(hr), "Failed to lock surface, type %s, hr %#lx.\n", tests[i].name, hr); if (SUCCEEDED(hr)) { hr = IDirectDrawSurface_Unlock(surface, NULL); - ok(SUCCEEDED(hr), "Failed to unlock surface, type %s, hr %#x.\n", tests[i].name, hr); + ok(SUCCEEDED(hr), "Failed to unlock surface, type %s, hr %#lx.\n", tests[i].name, hr); } memset(&ddsd, 0, sizeof(ddsd)); hr = IDirectDrawSurface_Lock(surface, NULL, &ddsd, DDLOCK_WAIT, NULL); - ok(hr == DDERR_INVALIDPARAMS, "Got unexpected hr %#x, type %s.\n", hr, tests[i].name); + ok(hr == DDERR_INVALIDPARAMS, "Got unexpected hr %#lx, type %s.\n", hr, tests[i].name); IDirectDrawSurface_Release(surface); } refcount = IDirectDraw2_Release(ddraw); - ok(refcount == 0, "The ddraw object was not properly freed, refcount %u.\n", refcount); + ok(!refcount, "Unexpected refcount %lu.\n", refcount); DestroyWindow(window); } @@ -5644,7 +5636,7 @@ static void test_surface_discard(void) } hr = IDirect3DDevice2_GetRenderTarget(device, &target); - ok(SUCCEEDED(hr), "Failed to get render target, hr %#x.\n", hr); + ok(SUCCEEDED(hr), "Failed to get render target, hr %#lx.\n", hr); memset(&ddsd, 0, sizeof(ddsd)); ddsd.dwSize = sizeof(ddsd); @@ -5662,29 +5654,29 @@ static void test_surface_discard(void) memset(&ddsd, 0, sizeof(ddsd)); ddsd.dwSize = sizeof(ddsd); hr = IDirectDrawSurface_Lock(surface, NULL, &ddsd, DDLOCK_WAIT, NULL); - ok(SUCCEEDED(hr), "Failed to lock surface, hr %#x.\n", hr); + ok(SUCCEEDED(hr), "Failed to lock surface, hr %#lx.\n", hr); addr = ddsd.lpSurface; hr = IDirectDrawSurface_Unlock(surface, NULL); - ok(SUCCEEDED(hr), "Failed to unlock surface, hr %#x.\n", hr); + ok(SUCCEEDED(hr), "Failed to unlock surface, hr %#lx.\n", hr); memset(&ddsd, 0, sizeof(ddsd)); ddsd.dwSize = sizeof(ddsd); hr = IDirectDrawSurface_Lock(surface, NULL, &ddsd, DDLOCK_DISCARDCONTENTS | DDLOCK_WAIT, NULL); - ok(SUCCEEDED(hr) , "Failed to lock surface, hr %#x.\n", hr); + ok(SUCCEEDED(hr) , "Failed to lock surface, hr %#lx.\n", hr); discarded = ddsd.lpSurface != addr; hr = IDirectDrawSurface_Unlock(surface, NULL); - ok(SUCCEEDED(hr), "Failed to unlock surface, hr %#x.\n", hr); + ok(SUCCEEDED(hr), "Failed to unlock surface, hr %#lx.\n", hr); hr = IDirectDrawSurface_Blt(target, NULL, surface, NULL, DDBLT_WAIT, NULL); - ok(SUCCEEDED(hr), "Failed to blit, hr %#x.\n", hr); + ok(SUCCEEDED(hr), "Failed to blit, hr %#lx.\n", hr); memset(&ddsd, 0, sizeof(ddsd)); ddsd.dwSize = sizeof(ddsd); hr = IDirectDrawSurface_Lock(surface, NULL, &ddsd, DDLOCK_DISCARDCONTENTS | DDLOCK_WAIT, NULL); - ok(SUCCEEDED(hr), "Failed to lock surface, hr %#x.\n", hr); + ok(SUCCEEDED(hr), "Failed to lock surface, hr %#lx.\n", hr); discarded |= ddsd.lpSurface != addr; hr = IDirectDrawSurface_Unlock(surface, NULL); - ok(SUCCEEDED(hr), "Failed to unlock surface, hr %#x.\n", hr); + ok(SUCCEEDED(hr), "Failed to unlock surface, hr %#lx.\n", hr); IDirectDrawSurface_Release(surface); @@ -5706,11 +5698,10 @@ static void test_flip(void) IDirectDrawSurface *frontbuffer, *backbuffer1, *backbuffer2, *backbuffer3, *surface; DDSCAPS caps = {DDSCAPS_FLIP}; DDSURFACEDESC surface_desc; + unsigned int color, i; BOOL sysmem_primary; IDirectDraw2 *ddraw; DWORD expected_caps; - unsigned int i; - D3DCOLOR color; ULONG refcount; HWND window; HRESULT hr; @@ -5732,7 +5723,7 @@ static void test_flip(void) ok(!!ddraw, "Failed to create a ddraw object.\n"); hr = IDirectDraw2_SetCooperativeLevel(ddraw, window, DDSCL_EXCLUSIVE | DDSCL_FULLSCREEN); - ok(SUCCEEDED(hr), "Failed to set cooperative level, hr %#x.\n", hr); + ok(SUCCEEDED(hr), "Failed to set cooperative level, hr %#lx.\n", hr); for (i = 0; i < ARRAY_SIZE(test_data); ++i) { @@ -5755,90 +5746,90 @@ static void test_flip(void) surface_desc.dwHeight = 512; surface_desc.dwBackBufferCount = 3; hr = IDirectDraw2_CreateSurface(ddraw, &surface_desc, &frontbuffer, NULL); - ok(hr == DDERR_INVALIDCAPS, "%s: Got unexpected hr %#x.\n", test_data[i].name, hr); + ok(hr == DDERR_INVALIDCAPS, "%s: Got unexpected hr %#lx.\n", test_data[i].name, hr); surface_desc.ddsCaps.dwCaps &= ~DDSCAPS_FLIP; surface_desc.dwFlags |= DDSD_BACKBUFFERCOUNT; hr = IDirectDraw2_CreateSurface(ddraw, &surface_desc, &frontbuffer, NULL); - ok(hr == DDERR_INVALIDCAPS, "%s: Got unexpected hr %#x.\n", test_data[i].name, hr); + ok(hr == DDERR_INVALIDCAPS, "%s: Got unexpected hr %#lx.\n", test_data[i].name, hr); surface_desc.ddsCaps.dwCaps &= ~DDSCAPS_COMPLEX; surface_desc.ddsCaps.dwCaps |= DDSCAPS_FLIP; hr = IDirectDraw2_CreateSurface(ddraw, &surface_desc, &frontbuffer, NULL); - ok(hr == DDERR_INVALIDCAPS, "%s: Got unexpected hr %#x.\n", test_data[i].name, hr); + ok(hr == DDERR_INVALIDCAPS, "%s: Got unexpected hr %#lx.\n", test_data[i].name, hr); surface_desc.ddsCaps.dwCaps |= DDSCAPS_COMPLEX; hr = IDirectDraw2_CreateSurface(ddraw, &surface_desc, &frontbuffer, NULL); todo_wine_if(test_data[i].caps & DDSCAPS_TEXTURE) - ok(SUCCEEDED(hr), "%s: Failed to create surface, hr %#x.\n", test_data[i].name, hr); + ok(SUCCEEDED(hr), "%s: Failed to create surface, hr %#lx.\n", test_data[i].name, hr); if (FAILED(hr)) continue; hr = IDirectDraw2_SetCooperativeLevel(ddraw, window, DDSCL_NORMAL | DDSCL_FULLSCREEN); - ok(SUCCEEDED(hr), "%s: Failed to set cooperative level, hr %#x.\n", test_data[i].name, hr); + ok(SUCCEEDED(hr), "%s: Failed to set cooperative level, hr %#lx.\n", test_data[i].name, hr); hr = IDirectDrawSurface_IsLost(frontbuffer); - ok(hr == DD_OK, "%s: Got unexpected hr %#x.\n", test_data[i].name, hr); + ok(hr == DD_OK, "%s: Got unexpected hr %#lx.\n", test_data[i].name, hr); hr = IDirectDrawSurface_Flip(frontbuffer, NULL, DDFLIP_WAIT); if (test_data[i].caps & DDSCAPS_PRIMARYSURFACE) - ok(hr == DDERR_NOEXCLUSIVEMODE, "%s: Got unexpected hr %#x.\n", test_data[i].name, hr); + ok(hr == DDERR_NOEXCLUSIVEMODE, "%s: Got unexpected hr %#lx.\n", test_data[i].name, hr); else - ok(SUCCEEDED(hr), "%s: Failed to flip, hr %#x.\n", test_data[i].name, hr); + ok(SUCCEEDED(hr), "%s: Failed to flip, hr %#lx.\n", test_data[i].name, hr); hr = IDirectDraw2_SetCooperativeLevel(ddraw, window, DDSCL_EXCLUSIVE | DDSCL_FULLSCREEN); - ok(SUCCEEDED(hr), "%s: Failed to set cooperative level, hr %#x.\n", test_data[i].name, hr); + ok(SUCCEEDED(hr), "%s: Failed to set cooperative level, hr %#lx.\n", test_data[i].name, hr); hr = IDirectDrawSurface_IsLost(frontbuffer); - todo_wine ok(hr == DDERR_SURFACELOST, "%s: Got unexpected hr %#x.\n", test_data[i].name, hr); + todo_wine ok(hr == DDERR_SURFACELOST, "%s: Got unexpected hr %#lx.\n", test_data[i].name, hr); hr = restore_surfaces(ddraw); - ok(SUCCEEDED(hr), "%s: Failed to restore surfaces, hr %#x.\n", test_data[i].name, hr); + ok(SUCCEEDED(hr), "%s: Failed to restore surfaces, hr %#lx.\n", test_data[i].name, hr); memset(&surface_desc, 0, sizeof(surface_desc)); surface_desc.dwSize = sizeof(surface_desc); hr = IDirectDrawSurface_GetSurfaceDesc(frontbuffer, &surface_desc); - ok(SUCCEEDED(hr), "%s: Failed to get surface desc, hr %#x.\n", test_data[i].name, hr); + ok(SUCCEEDED(hr), "%s: Failed to get surface desc, hr %#lx.\n", test_data[i].name, hr); expected_caps = DDSCAPS_FRONTBUFFER | DDSCAPS_COMPLEX | DDSCAPS_FLIP | test_data[i].caps; if (test_data[i].caps & DDSCAPS_PRIMARYSURFACE) expected_caps |= DDSCAPS_VISIBLE; ok((surface_desc.ddsCaps.dwCaps & ~placement) == expected_caps, - "%s: Got unexpected caps %#x.\n", test_data[i].name, surface_desc.ddsCaps.dwCaps); + "%s: Got unexpected caps %#lx.\n", test_data[i].name, surface_desc.ddsCaps.dwCaps); sysmem_primary = surface_desc.ddsCaps.dwCaps & DDSCAPS_SYSTEMMEMORY; hr = IDirectDrawSurface_GetAttachedSurface(frontbuffer, &caps, &backbuffer1); - ok(SUCCEEDED(hr), "%s: Failed to get attached surface, hr %#x.\n", test_data[i].name, hr); + ok(SUCCEEDED(hr), "%s: Failed to get attached surface, hr %#lx.\n", test_data[i].name, hr); memset(&surface_desc, 0, sizeof(surface_desc)); surface_desc.dwSize = sizeof(surface_desc); hr = IDirectDrawSurface_GetSurfaceDesc(backbuffer1, &surface_desc); - ok(SUCCEEDED(hr), "%s: Failed to get surface desc, hr %#x.\n", test_data[i].name, hr); - ok(!surface_desc.dwBackBufferCount, "%s: Got unexpected back buffer count %u.\n", + ok(SUCCEEDED(hr), "%s: Failed to get surface desc, hr %#lx.\n", test_data[i].name, hr); + ok(!surface_desc.dwBackBufferCount, "%s: Got unexpected back buffer count %lu.\n", test_data[i].name, surface_desc.dwBackBufferCount); expected_caps &= ~(DDSCAPS_VISIBLE | DDSCAPS_PRIMARYSURFACE | DDSCAPS_FRONTBUFFER); expected_caps |= DDSCAPS_BACKBUFFER; ok((surface_desc.ddsCaps.dwCaps & ~placement) == expected_caps, - "%s: Got unexpected caps %#x.\n", test_data[i].name, surface_desc.ddsCaps.dwCaps); + "%s: Got unexpected caps %#lx.\n", test_data[i].name, surface_desc.ddsCaps.dwCaps); hr = IDirectDrawSurface_GetAttachedSurface(backbuffer1, &caps, &backbuffer2); - ok(SUCCEEDED(hr), "%s: Failed to get attached surface, hr %#x.\n", test_data[i].name, hr); + ok(SUCCEEDED(hr), "%s: Failed to get attached surface, hr %#lx.\n", test_data[i].name, hr); memset(&surface_desc, 0, sizeof(surface_desc)); surface_desc.dwSize = sizeof(surface_desc); hr = IDirectDrawSurface_GetSurfaceDesc(backbuffer2, &surface_desc); - ok(SUCCEEDED(hr), "%s: Failed to get surface desc, hr %#x.\n", test_data[i].name, hr); - ok(!surface_desc.dwBackBufferCount, "%s: Got unexpected back buffer count %u.\n", + ok(SUCCEEDED(hr), "%s: Failed to get surface desc, hr %#lx.\n", test_data[i].name, hr); + ok(!surface_desc.dwBackBufferCount, "%s: Got unexpected back buffer count %lu.\n", test_data[i].name, surface_desc.dwBackBufferCount); expected_caps &= ~DDSCAPS_BACKBUFFER; ok((surface_desc.ddsCaps.dwCaps & ~placement) == expected_caps, - "%s: Got unexpected caps %#x.\n", test_data[i].name, surface_desc.ddsCaps.dwCaps); + "%s: Got unexpected caps %#lx.\n", test_data[i].name, surface_desc.ddsCaps.dwCaps); hr = IDirectDrawSurface_GetAttachedSurface(backbuffer2, &caps, &backbuffer3); - ok(SUCCEEDED(hr), "%s: Failed to get attached surface, hr %#x.\n", test_data[i].name, hr); + ok(SUCCEEDED(hr), "%s: Failed to get attached surface, hr %#lx.\n", test_data[i].name, hr); memset(&surface_desc, 0, sizeof(surface_desc)); surface_desc.dwSize = sizeof(surface_desc); hr = IDirectDrawSurface_GetSurfaceDesc(backbuffer3, &surface_desc); - ok(SUCCEEDED(hr), "%s: Failed to get surface desc, hr %#x.\n", test_data[i].name, hr); - ok(!surface_desc.dwBackBufferCount, "%s: Got unexpected back buffer count %u.\n", + ok(SUCCEEDED(hr), "%s: Failed to get surface desc, hr %#lx.\n", test_data[i].name, hr); + ok(!surface_desc.dwBackBufferCount, "%s: Got unexpected back buffer count %lu.\n", test_data[i].name, surface_desc.dwBackBufferCount); ok((surface_desc.ddsCaps.dwCaps & ~placement) == expected_caps, - "%s: Got unexpected caps %#x.\n", test_data[i].name, surface_desc.ddsCaps.dwCaps); + "%s: Got unexpected caps %#lx.\n", test_data[i].name, surface_desc.ddsCaps.dwCaps); hr = IDirectDrawSurface_GetAttachedSurface(backbuffer3, &caps, &surface); - ok(SUCCEEDED(hr), "%s: Failed to get attached surface, hr %#x.\n", test_data[i].name, hr); + ok(SUCCEEDED(hr), "%s: Failed to get attached surface, hr %#lx.\n", test_data[i].name, hr); ok(surface == frontbuffer, "%s: Got unexpected surface %p, expected %p.\n", test_data[i].name, surface, frontbuffer); IDirectDrawSurface_Release(surface); @@ -5850,19 +5841,19 @@ static void test_flip(void) surface_desc.dwWidth = 640; surface_desc.dwHeight = 480; hr = IDirectDraw2_CreateSurface(ddraw, &surface_desc, &surface, NULL); - ok(SUCCEEDED(hr), "%s: Failed to create surface, hr %#x.\n", test_data[i].name, hr); + ok(SUCCEEDED(hr), "%s: Failed to create surface, hr %#lx.\n", test_data[i].name, hr); hr = IDirectDrawSurface_Flip(frontbuffer, surface, DDFLIP_WAIT); - ok(hr == DDERR_NOTFLIPPABLE, "%s: Got unexpected hr %#x.\n", test_data[i].name, hr); + ok(hr == DDERR_NOTFLIPPABLE, "%s: Got unexpected hr %#lx.\n", test_data[i].name, hr); IDirectDrawSurface_Release(surface); hr = IDirectDrawSurface_Flip(frontbuffer, frontbuffer, DDFLIP_WAIT); - ok(hr == DDERR_NOTFLIPPABLE, "%s: Got unexpected hr %#x.\n", test_data[i].name, hr); + ok(hr == DDERR_NOTFLIPPABLE, "%s: Got unexpected hr %#lx.\n", test_data[i].name, hr); hr = IDirectDrawSurface_Flip(backbuffer1, NULL, DDFLIP_WAIT); - ok(hr == DDERR_NOTFLIPPABLE, "%s: Got unexpected hr %#x.\n", test_data[i].name, hr); + ok(hr == DDERR_NOTFLIPPABLE, "%s: Got unexpected hr %#lx.\n", test_data[i].name, hr); hr = IDirectDrawSurface_Flip(backbuffer2, NULL, DDFLIP_WAIT); - ok(hr == DDERR_NOTFLIPPABLE, "%s: Got unexpected hr %#x.\n", test_data[i].name, hr); + ok(hr == DDERR_NOTFLIPPABLE, "%s: Got unexpected hr %#lx.\n", test_data[i].name, hr); hr = IDirectDrawSurface_Flip(backbuffer3, NULL, DDFLIP_WAIT); - ok(hr == DDERR_NOTFLIPPABLE, "%s: Got unexpected hr %#x.\n", test_data[i].name, hr); + ok(hr == DDERR_NOTFLIPPABLE, "%s: Got unexpected hr %#lx.\n", test_data[i].name, hr); /* The Nvidia Geforce 7 driver cannot do a color fill on a texture backbuffer after * the backbuffer has been locked or GetSurfaceDesc has been called. Do it ourselves @@ -5872,7 +5863,7 @@ static void test_flip(void) fill_surface(backbuffer3, 0xff0000ff); hr = IDirectDrawSurface_Flip(frontbuffer, NULL, DDFLIP_WAIT); - ok(SUCCEEDED(hr), "%s: Failed to flip, hr %#x.\n", test_data[i].name, hr); + ok(SUCCEEDED(hr), "%s: Failed to flip, hr %#lx.\n", test_data[i].name, hr); color = get_surface_color(backbuffer1, 320, 240); /* The testbot seems to just copy the contents of one surface to all the * others, instead of properly flipping. */ @@ -5883,7 +5874,7 @@ static void test_flip(void) fill_surface(backbuffer3, 0xffff0000); hr = IDirectDrawSurface_Flip(frontbuffer, NULL, DDFLIP_WAIT); - ok(SUCCEEDED(hr), "%s: Failed to flip, hr %#x.\n", test_data[i].name, hr); + ok(SUCCEEDED(hr), "%s: Failed to flip, hr %#lx.\n", test_data[i].name, hr); color = get_surface_color(backbuffer1, 320, 240); ok(compare_color(color, 0x000000ff, 1) || broken(sysmem_primary && compare_color(color, 0x00ff0000, 1)), "%s: Got unexpected color 0x%08x.\n", test_data[i].name, color); @@ -5892,7 +5883,7 @@ static void test_flip(void) fill_surface(backbuffer3, 0xff00ff00); hr = IDirectDrawSurface_Flip(frontbuffer, NULL, DDFLIP_WAIT); - ok(SUCCEEDED(hr), "%s: Failed to flip, hr %#x.\n", test_data[i].name, hr); + ok(SUCCEEDED(hr), "%s: Failed to flip, hr %#lx.\n", test_data[i].name, hr); color = get_surface_color(backbuffer1, 320, 240); ok(compare_color(color, 0x00ff0000, 1) || broken(sysmem_primary && compare_color(color, 0x0000ff00, 1)), "%s: Got unexpected color 0x%08x.\n", test_data[i].name, color); @@ -5901,7 +5892,7 @@ static void test_flip(void) fill_surface(backbuffer3, 0xff0000ff); hr = IDirectDrawSurface_Flip(frontbuffer, backbuffer1, DDFLIP_WAIT); - ok(SUCCEEDED(hr), "%s: Failed to flip, hr %#x.\n", test_data[i].name, hr); + ok(SUCCEEDED(hr), "%s: Failed to flip, hr %#lx.\n", test_data[i].name, hr); color = get_surface_color(backbuffer2, 320, 240); ok(compare_color(color, 0x0000ff00, 1) || broken(sysmem_primary && compare_color(color, 0x000000ff, 1)), "%s: Got unexpected color 0x%08x.\n", test_data[i].name, color); @@ -5910,7 +5901,7 @@ static void test_flip(void) fill_surface(backbuffer1, 0xffff0000); hr = IDirectDrawSurface_Flip(frontbuffer, backbuffer2, DDFLIP_WAIT); - ok(SUCCEEDED(hr), "%s: Failed to flip, hr %#x.\n", test_data[i].name, hr); + ok(SUCCEEDED(hr), "%s: Failed to flip, hr %#lx.\n", test_data[i].name, hr); color = get_surface_color(backbuffer1, 320, 240); ok(compare_color(color, 0x00ff0000, 1), "%s: Got unexpected color 0x%08x.\n", test_data[i].name, color); color = get_surface_color(backbuffer3, 320, 240); @@ -5919,7 +5910,7 @@ static void test_flip(void) fill_surface(backbuffer2, 0xff00ff00); hr = IDirectDrawSurface_Flip(frontbuffer, backbuffer3, DDFLIP_WAIT); - ok(SUCCEEDED(hr), "%s: Failed to flip, hr %#x.\n", test_data[i].name, hr); + ok(SUCCEEDED(hr), "%s: Failed to flip, hr %#lx.\n", test_data[i].name, hr); color = get_surface_color(backbuffer1, 320, 240); ok(compare_color(color, 0x00ff0000, 1) || broken(sysmem_primary && compare_color(color, 0x0000ff00, 1)), "%s: Got unexpected color 0x%08x.\n", test_data[i].name, color); @@ -5933,7 +5924,7 @@ static void test_flip(void) } refcount = IDirectDraw2_Release(ddraw); - ok(refcount == 0, "The ddraw object was not properly freed, refcount %u.\n", refcount); + ok(!refcount, "Unexpected refcount %lu.\n", refcount); DestroyWindow(window); } @@ -5971,7 +5962,7 @@ static void test_set_surface_desc(void) ddraw = create_ddraw(); ok(!!ddraw, "Failed to create a ddraw object.\n"); hr = IDirectDraw2_SetCooperativeLevel(ddraw, window, DDSCL_NORMAL); - ok(SUCCEEDED(hr), "Failed to set cooperative level, hr %#x.\n", hr); + ok(SUCCEEDED(hr), "Failed to set cooperative level, hr %#lx.\n", hr); reset_ddsd(&ddsd); ddsd.dwFlags = DDSD_WIDTH | DDSD_HEIGHT | DDSD_CAPS | DDSD_PIXELFORMAT; @@ -5986,131 +5977,131 @@ static void test_set_surface_desc(void) ddsd.ddsCaps.dwCaps = DDSCAPS_SYSTEMMEMORY | DDSCAPS_OFFSCREENPLAIN; hr = IDirectDraw2_CreateSurface(ddraw, &ddsd, &surface, NULL); - ok(SUCCEEDED(hr), "Failed to create surface, hr %#x.\n", hr); + ok(SUCCEEDED(hr), "Failed to create surface, hr %#lx.\n", hr); hr = IDirectDrawSurface_QueryInterface(surface, &IID_IDirectDrawSurface3, (void **)&surface3); - ok(SUCCEEDED(hr), "Failed to get IDirectDrawSurface3 interface, hr %#x.\n", hr); + ok(SUCCEEDED(hr), "Failed to get IDirectDrawSurface3 interface, hr %#lx.\n", hr); IDirectDrawSurface_Release(surface); reset_ddsd(&ddsd); ddsd.dwFlags = DDSD_LPSURFACE; ddsd.lpSurface = data; hr = IDirectDrawSurface3_SetSurfaceDesc(surface3, &ddsd, 0); - ok(SUCCEEDED(hr), "Failed to set surface desc, hr %#x.\n", hr); + ok(SUCCEEDED(hr), "Failed to set surface desc, hr %#lx.\n", hr); /* Redundantly setting the same lpSurface is not an error. */ hr = IDirectDrawSurface3_SetSurfaceDesc(surface3, &ddsd, 0); - ok(SUCCEEDED(hr), "Failed to set surface desc, hr %#x.\n", hr); + ok(SUCCEEDED(hr), "Failed to set surface desc, hr %#lx.\n", hr); hr = IDirectDrawSurface3_GetSurfaceDesc(surface3, &ddsd); - ok(SUCCEEDED(hr), "Failed to get surface desc, hr %#x.\n", hr); + ok(SUCCEEDED(hr), "Failed to get surface desc, hr %#lx.\n", hr); ok(!(ddsd.dwFlags & DDSD_LPSURFACE), "DDSD_LPSURFACE is set.\n"); ok(ddsd.lpSurface == NULL, "lpSurface is %p, expected NULL.\n", ddsd.lpSurface); hr = IDirectDrawSurface3_Lock(surface3, NULL, &ddsd, 0, NULL); - ok(SUCCEEDED(hr), "Failed to lock surface, hr %#x.\n", hr); + ok(SUCCEEDED(hr), "Failed to lock surface, hr %#lx.\n", hr); ok(!(ddsd.dwFlags & DDSD_LPSURFACE), "DDSD_LPSURFACE is set.\n"); ok(ddsd.lpSurface == data, "lpSurface is %p, expected %p.\n", data, data); hr = IDirectDrawSurface3_Unlock(surface3, NULL); - ok(SUCCEEDED(hr), "Failed to unlock surface, hr %#x.\n", hr); + ok(SUCCEEDED(hr), "Failed to unlock surface, hr %#lx.\n", hr); reset_ddsd(&ddsd); ddsd.dwFlags = DDSD_LPSURFACE; ddsd.lpSurface = data; hr = IDirectDrawSurface3_SetSurfaceDesc(surface3, &ddsd, 1); - ok(hr == DDERR_INVALIDPARAMS, "SetSurfaceDesc with flags=1 returned %#x.\n", hr); + ok(hr == DDERR_INVALIDPARAMS, "Got hr %#lx.\n", hr); ddsd.lpSurface = NULL; hr = IDirectDrawSurface3_SetSurfaceDesc(surface3, &ddsd, 0); - ok(hr == DDERR_INVALIDPARAMS, "Setting lpSurface=NULL returned %#x.\n", hr); + ok(hr == DDERR_INVALIDPARAMS, "Got hr %#lx.\n", hr); hr = IDirectDrawSurface3_SetSurfaceDesc(surface3, NULL, 0); - ok(hr == DDERR_INVALIDPARAMS, "SetSurfaceDesc with NULL desc returned %#x.\n", hr); + ok(hr == DDERR_INVALIDPARAMS, "Got hr %#lx.\n", hr); hr = IDirectDrawSurface3_GetSurfaceDesc(surface3, &ddsd); - ok(SUCCEEDED(hr), "Failed to get surface desc, hr %#x.\n", hr); + ok(SUCCEEDED(hr), "Failed to get surface desc, hr %#lx.\n", hr); ok(ddsd.ddsCaps.dwCaps == (DDSCAPS_SYSTEMMEMORY | DDSCAPS_OFFSCREENPLAIN), - "Got unexpected caps %#x.\n", ddsd.ddsCaps.dwCaps); + "Got unexpected caps %#lx.\n", ddsd.ddsCaps.dwCaps); /* Setting the caps is an error. This also means the original description cannot be reapplied. */ hr = IDirectDrawSurface3_SetSurfaceDesc(surface3, &ddsd, 0); - ok(hr == DDERR_INVALIDPARAMS, "Setting the original desc returned %#x.\n", hr); + ok(hr == DDERR_INVALIDPARAMS, "Got hr %#lx.\n", hr); ddsd.dwFlags = DDSD_CAPS; hr = IDirectDrawSurface3_SetSurfaceDesc(surface3, &ddsd, 0); - ok(hr == DDERR_INVALIDPARAMS, "Setting DDSD_CAPS returned %#x.\n", hr); + ok(hr == DDERR_INVALIDPARAMS, "Got hr %#lx.\n", hr); /* dwCaps = 0 is allowed, but ignored. */ ddsd.dwFlags = DDSD_CAPS | DDSD_LPSURFACE; ddsd.lpSurface = data; hr = IDirectDrawSurface3_SetSurfaceDesc(surface3, &ddsd, 0); - ok(hr == DDERR_INVALIDCAPS, "Setting DDSD_CAPS returned %#x.\n", hr); + ok(hr == DDERR_INVALIDCAPS, "Got hr %#lx.\n", hr); ddsd.ddsCaps.dwCaps = DDSCAPS_SYSTEMMEMORY | DDSCAPS_OFFSCREENPLAIN; hr = IDirectDrawSurface3_SetSurfaceDesc(surface3, &ddsd, 0); - ok(hr == DDERR_INVALIDCAPS, "Setting DDSD_CAPS returned %#x.\n", hr); + ok(hr == DDERR_INVALIDCAPS, "Got hr %#lx.\n", hr); ddsd.ddsCaps.dwCaps = 0; hr = IDirectDrawSurface3_SetSurfaceDesc(surface3, &ddsd, 0); - ok(SUCCEEDED(hr), "Failed to set surface desc, hr %#x.\n", hr); + ok(SUCCEEDED(hr), "Failed to set surface desc, hr %#lx.\n", hr); hr = IDirectDrawSurface3_GetSurfaceDesc(surface3, &ddsd); - ok(SUCCEEDED(hr), "Failed to get surface desc, hr %#x.\n", hr); + ok(SUCCEEDED(hr), "Failed to get surface desc, hr %#lx.\n", hr); ok(ddsd.ddsCaps.dwCaps == (DDSCAPS_SYSTEMMEMORY | DDSCAPS_OFFSCREENPLAIN), - "Got unexpected caps %#x.\n", ddsd.ddsCaps.dwCaps); + "Got unexpected caps %#lx.\n", ddsd.ddsCaps.dwCaps); /* Setting the height is allowed, but it cannot be set to 0, and only if LPSURFACE is set too. */ reset_ddsd(&ddsd); ddsd.dwFlags = DDSD_HEIGHT; ddsd.dwHeight = 16; hr = IDirectDrawSurface3_SetSurfaceDesc(surface3, &ddsd, 0); - ok(hr == DDERR_INVALIDPARAMS, "Setting height without lpSurface returned %#x.\n", hr); + ok(hr == DDERR_INVALIDPARAMS, "Got hr %#lx.\n", hr); ddsd.lpSurface = data; ddsd.dwFlags = DDSD_HEIGHT | DDSD_LPSURFACE; hr = IDirectDrawSurface3_SetSurfaceDesc(surface3, &ddsd, 0); - ok(SUCCEEDED(hr), "Failed to set surface desc, hr %#x.\n", hr); + ok(SUCCEEDED(hr), "Failed to set surface desc, hr %#lx.\n", hr); ddsd.dwHeight = 0; hr = IDirectDrawSurface3_SetSurfaceDesc(surface3, &ddsd, 0); - ok(hr == DDERR_INVALIDPARAMS, "Setting height=0 returned %#x.\n", hr); + ok(hr == DDERR_INVALIDPARAMS, "Got hr %#lx.\n", hr); reset_ddsd(&ddsd); hr = IDirectDrawSurface3_GetSurfaceDesc(surface3, &ddsd); - ok(SUCCEEDED(hr), "GetSurfaceDesc failed, hr %#x.\n", hr); - ok(ddsd.dwWidth == 8, "SetSurfaceDesc: Expected width 8, got %u.\n", ddsd.dwWidth); - ok(ddsd.dwHeight == 16, "SetSurfaceDesc: Expected height 16, got %u.\n", ddsd.dwHeight); + ok(SUCCEEDED(hr), "GetSurfaceDesc failed, hr %#lx.\n", hr); + ok(ddsd.dwWidth == 8, "SetSurfaceDesc: Expected width 8, got %lu.\n", ddsd.dwWidth); + ok(ddsd.dwHeight == 16, "SetSurfaceDesc: Expected height 16, got %lu.\n", ddsd.dwHeight); /* Pitch and width can be set, but only together, and only with LPSURFACE. They must not be 0. */ reset_ddsd(&ddsd); ddsd.dwFlags = DDSD_PITCH; U1(ddsd).lPitch = 8 * 4; hr = IDirectDrawSurface3_SetSurfaceDesc(surface3, &ddsd, 0); - ok(hr == DDERR_INVALIDPARAMS, "Setting pitch without lpSurface or width returned %#x.\n", hr); + ok(hr == DDERR_INVALIDPARAMS, "Got hr %#lx.\n", hr); ddsd.dwFlags = DDSD_WIDTH; ddsd.dwWidth = 16; hr = IDirectDrawSurface3_SetSurfaceDesc(surface3, &ddsd, 0); - ok(hr == DDERR_INVALIDPARAMS, "Setting width without lpSurface or pitch returned %#x.\n", hr); + ok(hr == DDERR_INVALIDPARAMS, "Got hr %#lx.\n", hr); ddsd.dwFlags = DDSD_PITCH | DDSD_LPSURFACE; ddsd.lpSurface = data; hr = IDirectDrawSurface3_SetSurfaceDesc(surface3, &ddsd, 0); - ok(hr == DDERR_INVALIDPARAMS, "Setting pitch and lpSurface without width returned %#x.\n", hr); + ok(hr == DDERR_INVALIDPARAMS, "Got hr %#lx.\n", hr); ddsd.dwFlags = DDSD_WIDTH | DDSD_LPSURFACE; hr = IDirectDrawSurface3_SetSurfaceDesc(surface3, &ddsd, 0); - ok(hr == DDERR_INVALIDPARAMS, "Setting width and lpSurface without pitch returned %#x.\n", hr); + ok(hr == DDERR_INVALIDPARAMS, "Got hr %#lx.\n", hr); ddsd.dwFlags = DDSD_WIDTH | DDSD_PITCH | DDSD_LPSURFACE; U1(ddsd).lPitch = 16 * 4; ddsd.dwWidth = 16; hr = IDirectDrawSurface3_SetSurfaceDesc(surface3, &ddsd, 0); - ok(SUCCEEDED(hr), "Failed to set surface desc, hr %#x.\n", hr); + ok(SUCCEEDED(hr), "Failed to set surface desc, hr %#lx.\n", hr); reset_ddsd(&ddsd); hr = IDirectDrawSurface3_GetSurfaceDesc(surface3, &ddsd); - ok(SUCCEEDED(hr), "Failed to get surface desc, hr %#x.\n", hr); - ok(ddsd.dwWidth == 16, "SetSurfaceDesc: Expected width 8, got %u.\n", ddsd.dwWidth); - ok(ddsd.dwHeight == 16, "SetSurfaceDesc: Expected height 16, got %u.\n", ddsd.dwHeight); - ok(U1(ddsd).lPitch == 16 * 4, "SetSurfaceDesc: Expected pitch 64, got %u.\n", U1(ddsd).lPitch); + ok(SUCCEEDED(hr), "Failed to get surface desc, hr %#lx.\n", hr); + ok(ddsd.dwWidth == 16, "SetSurfaceDesc: Expected width 8, got %lu.\n", ddsd.dwWidth); + ok(ddsd.dwHeight == 16, "SetSurfaceDesc: Expected height 16, got %lu.\n", ddsd.dwHeight); + ok(U1(ddsd).lPitch == 16 * 4, "SetSurfaceDesc: Expected pitch 64, got %lu.\n", U1(ddsd).lPitch); /* The pitch must be 32 bit aligned and > 0, but is not verified for sanity otherwise. * @@ -6119,27 +6110,27 @@ static void test_set_surface_desc(void) U1(ddsd).lPitch = 4 * 4; ddsd.lpSurface = data; hr = IDirectDrawSurface3_SetSurfaceDesc(surface3, &ddsd, 0); - ok(SUCCEEDED(hr) || broken(hr == DDERR_INVALIDPARAMS), "Failed to set surface desc, hr %#x.\n", hr); + ok(SUCCEEDED(hr) || broken(hr == DDERR_INVALIDPARAMS), "Failed to set surface desc, hr %#lx.\n", hr); U1(ddsd).lPitch = 4; hr = IDirectDrawSurface3_SetSurfaceDesc(surface3, &ddsd, 0); - ok(SUCCEEDED(hr) || broken(hr == DDERR_INVALIDPARAMS), "Failed to set surface desc, hr %#x.\n", hr); + ok(SUCCEEDED(hr) || broken(hr == DDERR_INVALIDPARAMS), "Failed to set surface desc, hr %#lx.\n", hr); U1(ddsd).lPitch = 16 * 4 + 1; hr = IDirectDrawSurface3_SetSurfaceDesc(surface3, &ddsd, 0); - ok(hr == DDERR_INVALIDPARAMS, "Setting misaligned pitch returned %#x.\n", hr); + ok(hr == DDERR_INVALIDPARAMS, "Got hr %#lx.\n", hr); U1(ddsd).lPitch = 16 * 4 + 3; hr = IDirectDrawSurface3_SetSurfaceDesc(surface3, &ddsd, 0); - ok(hr == DDERR_INVALIDPARAMS, "Setting misaligned pitch returned %#x.\n", hr); + ok(hr == DDERR_INVALIDPARAMS, "Got hr %#lx.\n", hr); U1(ddsd).lPitch = -4; hr = IDirectDrawSurface3_SetSurfaceDesc(surface3, &ddsd, 0); - ok(hr == DDERR_INVALIDPARAMS, "Setting negative pitch returned %#x.\n", hr); + ok(hr == DDERR_INVALIDPARAMS, "Got hr %#lx.\n", hr); U1(ddsd).lPitch = 16 * 4; hr = IDirectDrawSurface3_SetSurfaceDesc(surface3, &ddsd, 0); - ok(SUCCEEDED(hr), "Failed to set surface desc, hr %#x.\n", hr); + ok(SUCCEEDED(hr), "Failed to set surface desc, hr %#lx.\n", hr); reset_ddsd(&ddsd); ddsd.dwFlags = DDSD_WIDTH | DDSD_PITCH | DDSD_LPSURFACE; @@ -6147,13 +6138,13 @@ static void test_set_surface_desc(void) ddsd.dwWidth = 16; ddsd.lpSurface = data; hr = IDirectDrawSurface3_SetSurfaceDesc(surface3, &ddsd, 0); - ok(hr == DDERR_INVALIDPARAMS, "Setting zero pitch returned %#x.\n", hr); + ok(hr == DDERR_INVALIDPARAMS, "Got hr %#lx.\n", hr); ddsd.dwFlags = DDSD_WIDTH | DDSD_PITCH | DDSD_LPSURFACE; U1(ddsd).lPitch = 16 * 4; ddsd.dwWidth = 0; hr = IDirectDrawSurface3_SetSurfaceDesc(surface3, &ddsd, 0); - ok(hr == DDERR_INVALIDPARAMS, "Setting zero width returned %#x.\n", hr); + ok(hr == DDERR_INVALIDPARAMS, "Got hr %#lx.\n", hr); /* Setting the pixelformat without LPSURFACE is an error, but with LPSURFACE it works. */ ddsd.dwFlags = DDSD_PIXELFORMAT; @@ -6164,11 +6155,11 @@ static void test_set_surface_desc(void) U3(ddsd.ddpfPixelFormat).dwGBitMask = 0x0000ff00; U4(ddsd.ddpfPixelFormat).dwBBitMask = 0x000000ff; hr = IDirectDrawSurface3_SetSurfaceDesc(surface3, &ddsd, 0); - ok(hr == DDERR_INVALIDPARAMS, "Setting the pixel format returned %#x.\n", hr); + ok(hr == DDERR_INVALIDPARAMS, "Got hr %#lx.\n", hr); ddsd.dwFlags = DDSD_PIXELFORMAT | DDSD_LPSURFACE; hr = IDirectDrawSurface3_SetSurfaceDesc(surface3, &ddsd, 0); - ok(SUCCEEDED(hr), "Failed to set surface desc, hr %#x.\n", hr); + ok(SUCCEEDED(hr), "Failed to set surface desc, hr %#lx.\n", hr); /* Can't set color keys. */ reset_ddsd(&ddsd); @@ -6176,12 +6167,12 @@ static void test_set_surface_desc(void) ddsd.ddckCKSrcBlt.dwColorSpaceLowValue = 0x00ff0000; ddsd.ddckCKSrcBlt.dwColorSpaceHighValue = 0x00ff0000; hr = IDirectDrawSurface3_SetSurfaceDesc(surface3, &ddsd, 0); - ok(hr == DDERR_INVALIDPARAMS, "Setting ddckCKSrcBlt returned %#x.\n", hr); + ok(hr == DDERR_INVALIDPARAMS, "Got hr %#lx.\n", hr); ddsd.dwFlags = DDSD_CKSRCBLT | DDSD_LPSURFACE; ddsd.lpSurface = data; hr = IDirectDrawSurface3_SetSurfaceDesc(surface3, &ddsd, 0); - ok(hr == DDERR_INVALIDPARAMS, "Setting ddckCKSrcBlt returned %#x.\n", hr); + ok(hr == DDERR_INVALIDPARAMS, "Got hr %#lx.\n", hr); IDirectDrawSurface3_Release(surface3); @@ -6193,7 +6184,7 @@ static void test_set_surface_desc(void) U2(ddsd).dwMipMapCount = 3; ddsd.ddsCaps.dwCaps = DDSCAPS_TEXTURE | DDSCAPS_VIDEOMEMORY | DDSCAPS_COMPLEX | DDSCAPS_MIPMAP; hr = IDirectDraw2_CreateSurface(ddraw, &ddsd, &surface, NULL); - ok(hr == DD_OK || hr == DDERR_NODIRECTDRAWHW || hr == E_NOINTERFACE, "Got unexpected hr %#x.\n", hr); + ok(hr == DD_OK || hr == DDERR_NODIRECTDRAWHW || hr == E_NOINTERFACE, "Got unexpected hr %#lx.\n", hr); if (FAILED(hr)) { @@ -6202,19 +6193,19 @@ static void test_set_surface_desc(void) else { hr = IDirectDrawSurface_QueryInterface(surface, &IID_IDirectDrawSurface3, (void **)&surface3); - ok(hr == DD_OK, "Got unexpected hr %#x.\n", hr); + ok(hr == DD_OK, "Got unexpected hr %#lx.\n", hr); IDirectDrawSurface_Release(surface); /* Changing surface desc for mipmap fails even without changing any * parameters. */ hr = IDirectDrawSurface3_SetSurfaceDesc(surface3, &ddsd, 0); - ok(hr == DDERR_INVALIDSURFACETYPE, "Got unexpected hr %#x.\n", hr); + ok(hr == DDERR_INVALIDSURFACETYPE, "Got unexpected hr %#lx.\n", hr); reset_ddsd(&ddsd); ddsd.dwFlags = DDSD_LPSURFACE; ddsd.lpSurface = data; hr = IDirectDrawSurface3_SetSurfaceDesc(surface3, &ddsd, 0); - ok(hr == DDERR_INVALIDSURFACETYPE, "Got unexpected hr %#x.\n", hr); + ok(hr == DDERR_INVALIDSURFACETYPE, "Got unexpected hr %#lx.\n", hr); IDirectDrawSurface3_Release(surface3); } @@ -6227,7 +6218,7 @@ static void test_set_surface_desc(void) ddsd.ddsCaps.dwCaps = DDSCAPS_TEXTURE | DDSCAPS_SYSTEMMEMORY | DDSCAPS_COMPLEX | DDSCAPS_MIPMAP; hr = IDirectDraw2_CreateSurface(ddraw, &ddsd, &surface, NULL); - ok(hr == DD_OK || hr == DDERR_NODIRECTDRAWHW || hr == E_NOINTERFACE, "Got unexpected hr %#x.\n", hr); + ok(hr == DD_OK || hr == DDERR_NODIRECTDRAWHW || hr == E_NOINTERFACE, "Got unexpected hr %#lx.\n", hr); if (hr == DD_OK) { @@ -6235,15 +6226,15 @@ static void test_set_surface_desc(void) IDirectDrawSurface3 *surface2; hr = IDirectDrawSurface_QueryInterface(surface, &IID_IDirectDrawSurface3, (void **)&surface3); - ok(hr == DD_OK, "Got unexpected hr %#x.\n", hr); + ok(hr == DD_OK, "Got unexpected hr %#lx.\n", hr); IDirectDrawSurface_Release(surface); hr = IDirectDrawSurface3_GetAttachedSurface(surface3, &caps, &surface2); - ok(hr == DD_OK, "Got unexpected hr %#x.\n", hr); + ok(hr == DD_OK, "Got unexpected hr %#lx.\n", hr); reset_ddsd(&ddsd); hr = IDirectDrawSurface3_GetSurfaceDesc(surface2, &ddsd); - ok(hr == DD_OK, "Got unexpected hr %#x.\n", hr); - ok(ddsd.dwWidth == 4, "Got unexpected dwWidth %u.\n", ddsd.dwWidth); + ok(hr == DD_OK, "Got unexpected hr %#lx.\n", hr); + ok(ddsd.dwWidth == 4, "Got unexpected dwWidth %lu.\n", ddsd.dwWidth); reset_ddsd(&ddsd); ddsd.dwFlags = DDSD_WIDTH | DDSD_HEIGHT | DDSD_PITCH | DDSD_LPSURFACE; @@ -6252,7 +6243,7 @@ static void test_set_surface_desc(void) U1(ddsd).lPitch = 16 * 4; ddsd.lpSurface = data; hr = IDirectDrawSurface3_SetSurfaceDesc(surface3, &ddsd, 0); - todo_wine ok(hr == DD_OK, "Got unexpected hr %#x.\n", hr); + todo_wine ok(hr == DD_OK, "Got unexpected hr %#lx.\n", hr); reset_ddsd(&ddsd); ddsd.dwFlags = DDSD_WIDTH | DDSD_HEIGHT | DDSD_PITCH | DDSD_LPSURFACE; @@ -6261,13 +6252,13 @@ static void test_set_surface_desc(void) U1(ddsd).lPitch = 8 * 4; ddsd.lpSurface = data; hr = IDirectDrawSurface3_SetSurfaceDesc(surface3, &ddsd, 0); - ok(hr == DD_OK, "Got unexpected hr %#x.\n", hr); + ok(hr == DD_OK, "Got unexpected hr %#lx.\n", hr); if (0) { /* _Lock causes access violation on Windows. */ reset_ddsd(&ddsd); hr = IDirectDrawSurface3_Lock(surface2, NULL, &ddsd, DDLOCK_WAIT, NULL); - ok(hr == DD_OK, "Got unexpected hr %#x.\n", hr); + ok(hr == DD_OK, "Got unexpected hr %#lx.\n", hr); IDirectDrawSurface3_Unlock(surface2, NULL); } @@ -6281,7 +6272,7 @@ static void test_set_surface_desc(void) U1(ddsd).lPitch = 4 * 4; ddsd.lpSurface = data; hr = IDirectDrawSurface3_SetSurfaceDesc(surface2, &ddsd, 0); - ok(hr == DD_OK, "Got unexpected hr %#x.\n", hr); + ok(hr == DD_OK, "Got unexpected hr %#lx.\n", hr); } IDirectDrawSurface3_Release(surface2); IDirectDrawSurface3_Release(surface3); @@ -6296,7 +6287,7 @@ static void test_set_surface_desc(void) U1(ddsd).lPitch = 8 * 4; ddsd.ddsCaps.dwCaps = DDSCAPS_SYSTEMMEMORY | DDSCAPS_OFFSCREENPLAIN; hr = IDirectDraw2_CreateSurface(ddraw, &ddsd, &surface, NULL); - ok(hr == DDERR_INVALIDPARAMS, "Got unexpected hr %#x.\n", hr); + ok(hr == DDERR_INVALIDPARAMS, "Got unexpected hr %#lx.\n", hr); /* SetSurfaceDesc needs systemmemory surfaces. * @@ -6320,7 +6311,7 @@ static void test_set_surface_desc(void) } hr = IDirectDraw2_CreateSurface(ddraw, &ddsd, &surface, NULL); - ok(hr == DD_OK || hr == DDERR_NODIRECTDRAWHW, "Got unexpected hr %#x.\n", hr); + ok(hr == DD_OK || hr == DDERR_NODIRECTDRAWHW, "Got unexpected hr %#lx.\n", hr); if (FAILED(hr)) { skip("Cannot create a %s surface, skipping vidmem SetSurfaceDesc test.\n", @@ -6328,7 +6319,7 @@ static void test_set_surface_desc(void) goto done; } hr = IDirectDrawSurface_QueryInterface(surface, &IID_IDirectDrawSurface3, (void **)&surface3); - ok(hr == DD_OK, "Got unexpected hr %#x.\n", hr); + ok(hr == DD_OK, "Got unexpected hr %#lx.\n", hr); IDirectDrawSurface_Release(surface); reset_ddsd(&ddsd); @@ -6337,17 +6328,17 @@ static void test_set_surface_desc(void) hr = IDirectDrawSurface3_SetSurfaceDesc(surface3, &ddsd, 0); if (invalid_caps_tests[i].supported) { - ok(hr == DD_OK, "Got unexpected hr %#x.\n", hr); + ok(hr == DD_OK, "Got unexpected hr %#lx.\n", hr); } else { - ok(hr == DDERR_INVALIDSURFACETYPE, "SetSurfaceDesc on a %s surface returned %#x.\n", + ok(hr == DDERR_INVALIDSURFACETYPE, "SetSurfaceDesc on a %s surface returned %#lx.\n", invalid_caps_tests[i].name, hr); /* Check priority of error conditions. */ ddsd.dwFlags = DDSD_WIDTH; hr = IDirectDrawSurface3_SetSurfaceDesc(surface3, &ddsd, 0); - ok(hr == DDERR_INVALIDSURFACETYPE, "SetSurfaceDesc on a %s surface returned %#x.\n", + ok(hr == DDERR_INVALIDSURFACETYPE, "SetSurfaceDesc on a %s surface returned %#lx.\n", invalid_caps_tests[i].name, hr); } @@ -6356,32 +6347,31 @@ static void test_set_surface_desc(void) done: ref = IDirectDraw2_Release(ddraw); - ok(ref == 0, "Ddraw object not properly released, refcount %u.\n", ref); + ok(!ref, "Unexpected refcount %lu.\n", ref); DestroyWindow(window); } static void test_user_memory_getdc(void) { + unsigned int data[16][16], x, y; IDirectDraw2 *ddraw; HWND window; HRESULT hr; DDSURFACEDESC ddsd; IDirectDrawSurface *surface; IDirectDrawSurface3 *surface3; - DWORD data[16][16]; HBITMAP bitmap; DIBSECTION dib; ULONG ref; int size; HDC dc; - unsigned int x, y; window = create_window(); ddraw = create_ddraw(); ok(!!ddraw, "Failed to create a ddraw object.\n"); hr = IDirectDraw2_SetCooperativeLevel(ddraw, window, DDSCL_NORMAL); - ok(SUCCEEDED(hr), "Failed to set cooperative level, hr %#x.\n", hr); + ok(SUCCEEDED(hr), "Failed to set cooperative level, hr %#lx.\n", hr); reset_ddsd(&ddsd); ddsd.dwFlags = DDSD_WIDTH | DDSD_HEIGHT | DDSD_CAPS | DDSD_PIXELFORMAT; @@ -6395,10 +6385,10 @@ static void test_user_memory_getdc(void) U4(ddsd.ddpfPixelFormat).dwBBitMask = 0x000000ff; ddsd.ddsCaps.dwCaps = DDSCAPS_SYSTEMMEMORY | DDSCAPS_OFFSCREENPLAIN; hr = IDirectDraw2_CreateSurface(ddraw, &ddsd, &surface, NULL); - ok(SUCCEEDED(hr), "Failed to create surface, hr %#x.\n", hr); + ok(SUCCEEDED(hr), "Failed to create surface, hr %#lx.\n", hr); hr = IDirectDrawSurface_QueryInterface(surface, &IID_IDirectDrawSurface3, (void **)&surface3); - ok(SUCCEEDED(hr), "Failed to get IDirectDrawSurface3 interface, hr %#x.\n", hr); + ok(SUCCEEDED(hr), "Failed to get IDirectDrawSurface3 interface, hr %#lx.\n", hr); IDirectDrawSurface_Release(surface); memset(data, 0xaa, sizeof(data)); @@ -6406,10 +6396,10 @@ static void test_user_memory_getdc(void) ddsd.dwFlags = DDSD_LPSURFACE; ddsd.lpSurface = data; hr = IDirectDrawSurface3_SetSurfaceDesc(surface3, &ddsd, 0); - ok(SUCCEEDED(hr), "Failed to set surface desc, hr %#x.\n", hr); + ok(SUCCEEDED(hr), "Failed to set surface desc, hr %#lx.\n", hr); hr = IDirectDrawSurface3_GetDC(surface3, &dc); - ok(SUCCEEDED(hr), "Failed to get DC, hr %#x.\n", hr); + ok(SUCCEEDED(hr), "Failed to get DC, hr %#lx.\n", hr); bitmap = GetCurrentObject(dc, OBJ_BITMAP); ok(!!bitmap, "Failed to get bitmap.\n"); size = GetObjectA(bitmap, sizeof(dib), &dib); @@ -6418,7 +6408,7 @@ static void test_user_memory_getdc(void) BitBlt(dc, 0, 0, 16, 8, NULL, 0, 0, WHITENESS); BitBlt(dc, 0, 8, 16, 8, NULL, 0, 0, BLACKNESS); hr = IDirectDrawSurface3_ReleaseDC(surface3, dc); - ok(SUCCEEDED(hr), "Failed to release DC, hr %#x.\n", hr); + ok(SUCCEEDED(hr), "Failed to release DC, hr %#lx.\n", hr); ok(data[0][0] == 0xffffffff, "Expected color 0xffffffff, got %#x.\n", data[0][0]); ok(data[15][15] == 0x00000000, "Expected color 0x00000000, got %#x.\n", data[15][15]); @@ -6429,15 +6419,15 @@ static void test_user_memory_getdc(void) ddsd.dwHeight = 8; U1(ddsd).lPitch = sizeof(*data); hr = IDirectDrawSurface3_SetSurfaceDesc(surface3, &ddsd, 0); - ok(SUCCEEDED(hr), "Failed to set surface desc, hr %#x.\n", hr); + ok(SUCCEEDED(hr), "Failed to set surface desc, hr %#lx.\n", hr); memset(data, 0xaa, sizeof(data)); hr = IDirectDrawSurface3_GetDC(surface3, &dc); - ok(SUCCEEDED(hr), "Failed to get DC, hr %#x.\n", hr); + ok(SUCCEEDED(hr), "Failed to get DC, hr %#lx.\n", hr); BitBlt(dc, 0, 0, 4, 8, NULL, 0, 0, BLACKNESS); BitBlt(dc, 1, 1, 2, 2, NULL, 0, 0, WHITENESS); hr = IDirectDrawSurface3_ReleaseDC(surface3, dc); - ok(SUCCEEDED(hr), "Failed to release DC, hr %#x.\n", hr); + ok(SUCCEEDED(hr), "Failed to release DC, hr %#lx.\n", hr); for (y = 0; y < 4; y++) { @@ -6462,7 +6452,7 @@ static void test_user_memory_getdc(void) IDirectDrawSurface3_Release(surface3); ref = IDirectDraw2_Release(ddraw); - ok(ref == 0, "Ddraw object not properly released, refcount %u.\n", ref); + ok(!ref, "Unexpected refcount %lu.\n", ref); DestroyWindow(window); } @@ -6480,7 +6470,7 @@ static void test_sysmem_overlay(void) ok(!!ddraw, "Failed to create a ddraw object.\n"); hr = IDirectDraw2_SetCooperativeLevel(ddraw, window, DDSCL_NORMAL); - ok(SUCCEEDED(hr), "Failed to set cooperative level, hr %#x.\n", hr); + ok(SUCCEEDED(hr), "Failed to set cooperative level, hr %#lx.\n", hr); reset_ddsd(&ddsd); ddsd.dwFlags = DDSD_CAPS | DDSD_PIXELFORMAT | DDSD_WIDTH | DDSD_HEIGHT; @@ -6494,10 +6484,10 @@ static void test_sysmem_overlay(void) U3(ddsd.ddpfPixelFormat).dwGBitMask = 0x0000ff00; U4(ddsd.ddpfPixelFormat).dwBBitMask = 0x000000ff; hr = IDirectDraw2_CreateSurface(ddraw, &ddsd, &surface, NULL); - ok(hr == DDERR_NOOVERLAYHW, "Got unexpected hr %#x.\n", hr); + ok(hr == DDERR_NOOVERLAYHW, "Got unexpected hr %#lx.\n", hr); ref = IDirectDraw2_Release(ddraw); - ok(ref == 0, "Ddraw object not properly released, refcount %u.\n", ref); + ok(!ref, "Unexpected refcount %lu.\n", ref); DestroyWindow(window); } @@ -6525,7 +6515,7 @@ static void test_primary_palette(void) return; } hr = IDirectDraw2_SetCooperativeLevel(ddraw, window, DDSCL_EXCLUSIVE | DDSCL_FULLSCREEN); - ok(SUCCEEDED(hr), "Failed to set cooperative level, hr %#x.\n", hr); + ok(SUCCEEDED(hr), "Failed to set cooperative level, hr %#lx.\n", hr); memset(&surface_desc, 0, sizeof(surface_desc)); surface_desc.dwSize = sizeof(surface_desc); @@ -6533,22 +6523,22 @@ static void test_primary_palette(void) surface_desc.ddsCaps.dwCaps = DDSCAPS_PRIMARYSURFACE | DDSCAPS_COMPLEX | DDSCAPS_FLIP; surface_desc.dwBackBufferCount = 1; hr = IDirectDraw2_CreateSurface(ddraw, &surface_desc, &primary, NULL); - ok(SUCCEEDED(hr), "Failed to create surface, hr %#x.\n", hr); + ok(SUCCEEDED(hr), "Failed to create surface, hr %#lx.\n", hr); hr = IDirectDrawSurface_GetAttachedSurface(primary, &surface_caps, &backbuffer); - ok(SUCCEEDED(hr), "Failed to get attached surface, hr %#x.\n", hr); + ok(SUCCEEDED(hr), "Failed to get attached surface, hr %#lx.\n", hr); memset(palette_entries, 0, sizeof(palette_entries)); hr = IDirectDraw2_CreatePalette(ddraw, DDPCAPS_8BIT | DDPCAPS_ALLOW256, palette_entries, &palette, NULL); - ok(SUCCEEDED(hr), "Failed to create palette, hr %#x.\n", hr); + ok(SUCCEEDED(hr), "Failed to create palette, hr %#lx.\n", hr); refcount = get_refcount((IUnknown *)palette); - ok(refcount == 1, "Got unexpected refcount %u.\n", refcount); + ok(refcount == 1, "Got unexpected refcount %lu.\n", refcount); hr = IDirectDrawPalette_GetCaps(palette, &palette_caps); - ok(SUCCEEDED(hr), "Failed to get palette caps, hr %#x.\n", hr); - ok(palette_caps == (DDPCAPS_8BIT | DDPCAPS_ALLOW256), "Got unexpected palette caps %#x.\n", palette_caps); + ok(SUCCEEDED(hr), "Failed to get palette caps, hr %#lx.\n", hr); + ok(palette_caps == (DDPCAPS_8BIT | DDPCAPS_ALLOW256), "Got unexpected palette caps %#lx.\n", palette_caps); hr = IDirectDrawSurface_SetPalette(primary, palette); - ok(SUCCEEDED(hr), "Failed to set palette, hr %#x.\n", hr); + ok(SUCCEEDED(hr), "Failed to set palette, hr %#lx.\n", hr); /* The Windows 8 testbot attaches the palette to the backbuffer as well, * and is generally somewhat broken with respect to 8 bpp / palette @@ -6561,99 +6551,99 @@ static void test_primary_palette(void) /* The Windows 8 testbot keeps extra references to the primary and * backbuffer while in 8 bpp mode. */ hr = IDirectDraw2_RestoreDisplayMode(ddraw); - ok(SUCCEEDED(hr), "Failed to restore display mode, hr %#x.\n", hr); + ok(SUCCEEDED(hr), "Failed to restore display mode, hr %#lx.\n", hr); goto done; } refcount = get_refcount((IUnknown *)palette); - ok(refcount == 2, "Got unexpected refcount %u.\n", refcount); + ok(refcount == 2, "Got unexpected refcount %lu.\n", refcount); hr = IDirectDrawPalette_GetCaps(palette, &palette_caps); - ok(SUCCEEDED(hr), "Failed to get palette caps, hr %#x.\n", hr); + ok(SUCCEEDED(hr), "Failed to get palette caps, hr %#lx.\n", hr); ok(palette_caps == (DDPCAPS_8BIT | DDPCAPS_PRIMARYSURFACE | DDPCAPS_ALLOW256), - "Got unexpected palette caps %#x.\n", palette_caps); + "Got unexpected palette caps %#lx.\n", palette_caps); hr = IDirectDrawSurface_SetPalette(primary, NULL); - ok(SUCCEEDED(hr), "Failed to set palette, hr %#x.\n", hr); + ok(SUCCEEDED(hr), "Failed to set palette, hr %#lx.\n", hr); refcount = get_refcount((IUnknown *)palette); - ok(refcount == 1, "Got unexpected refcount %u.\n", refcount); + ok(refcount == 1, "Got unexpected refcount %lu.\n", refcount); hr = IDirectDrawPalette_GetCaps(palette, &palette_caps); - ok(SUCCEEDED(hr), "Failed to get palette caps, hr %#x.\n", hr); - ok(palette_caps == (DDPCAPS_8BIT | DDPCAPS_ALLOW256), "Got unexpected palette caps %#x.\n", palette_caps); + ok(SUCCEEDED(hr), "Failed to get palette caps, hr %#lx.\n", hr); + ok(palette_caps == (DDPCAPS_8BIT | DDPCAPS_ALLOW256), "Got unexpected palette caps %#lx.\n", palette_caps); hr = IDirectDrawSurface_SetPalette(primary, palette); - ok(SUCCEEDED(hr), "Failed to set palette, hr %#x.\n", hr); + ok(SUCCEEDED(hr), "Failed to set palette, hr %#lx.\n", hr); refcount = get_refcount((IUnknown *)palette); - ok(refcount == 2, "Got unexpected refcount %u.\n", refcount); + ok(refcount == 2, "Got unexpected refcount %lu.\n", refcount); hr = IDirectDrawSurface_GetPalette(primary, &tmp); - ok(SUCCEEDED(hr), "Failed to get palette, hr %#x.\n", hr); + ok(SUCCEEDED(hr), "Failed to get palette, hr %#lx.\n", hr); ok(tmp == palette, "Got unexpected palette %p, expected %p.\n", tmp, palette); IDirectDrawPalette_Release(tmp); hr = IDirectDrawSurface_GetPalette(backbuffer, &tmp); - ok(hr == DDERR_NOPALETTEATTACHED, "Got unexpected hr %#x.\n", hr); + ok(hr == DDERR_NOPALETTEATTACHED, "Got unexpected hr %#lx.\n", hr); refcount = IDirectDrawPalette_Release(palette); - ok(refcount == 1, "Got unexpected refcount %u.\n", refcount); + ok(refcount == 1, "Got unexpected refcount %lu.\n", refcount); refcount = IDirectDrawPalette_Release(palette); - ok(!refcount, "Got unexpected refcount %u.\n", refcount); + ok(!refcount, "Got unexpected refcount %lu.\n", refcount); /* Note that this only seems to work when the palette is attached to the * primary surface. When attached to a regular surface, attempting to get * the palette here will cause an access violation. */ hr = IDirectDrawSurface_GetPalette(primary, &tmp); - ok(hr == DDERR_NOPALETTEATTACHED, "Got unexpected hr %#x.\n", hr); + ok(hr == DDERR_NOPALETTEATTACHED, "Got unexpected hr %#lx.\n", hr); hr = IDirectDrawSurface_IsLost(primary); - ok(hr == DD_OK, "Got unexpected hr %#x.\n", hr); + ok(hr == DD_OK, "Got unexpected hr %#lx.\n", hr); memset(&surface_desc, 0, sizeof(surface_desc)); surface_desc.dwSize = sizeof(surface_desc); hr = IDirectDrawSurface_GetSurfaceDesc(primary, &surface_desc); - ok(SUCCEEDED(hr), "Failed to get surface desc, hr %#x.\n", hr); - ok(surface_desc.dwWidth == 640, "Got unexpected surface width %u.\n", surface_desc.dwWidth); - ok(surface_desc.dwHeight == 480, "Got unexpected surface height %u.\n", surface_desc.dwHeight); - ok(U1(surface_desc.ddpfPixelFormat).dwRGBBitCount == 8, "Got unexpected bit count %u.\n", + ok(SUCCEEDED(hr), "Failed to get surface desc, hr %#lx.\n", hr); + ok(surface_desc.dwWidth == 640, "Got unexpected surface width %lu.\n", surface_desc.dwWidth); + ok(surface_desc.dwHeight == 480, "Got unexpected surface height %lu.\n", surface_desc.dwHeight); + ok(U1(surface_desc.ddpfPixelFormat).dwRGBBitCount == 8, "Got unexpected bit count %lu.\n", U1(surface_desc.ddpfPixelFormat).dwRGBBitCount); hr = set_display_mode(ddraw, 640, 480); - ok(SUCCEEDED(hr), "Failed to set display mode, hr %#x.\n", hr); + ok(SUCCEEDED(hr), "Failed to set display mode, hr %#lx.\n", hr); memset(&surface_desc, 0, sizeof(surface_desc)); surface_desc.dwSize = sizeof(surface_desc); hr = IDirectDrawSurface_GetSurfaceDesc(primary, &surface_desc); - ok(SUCCEEDED(hr), "Failed to get surface desc, hr %#x.\n", hr); - ok(surface_desc.dwWidth == 640, "Got unexpected surface width %u.\n", surface_desc.dwWidth); - ok(surface_desc.dwHeight == 480, "Got unexpected surface height %u.\n", surface_desc.dwHeight); + ok(SUCCEEDED(hr), "Failed to get surface desc, hr %#lx.\n", hr); + ok(surface_desc.dwWidth == 640, "Got unexpected surface width %lu.\n", surface_desc.dwWidth); + ok(surface_desc.dwHeight == 480, "Got unexpected surface height %lu.\n", surface_desc.dwHeight); ok(U1(surface_desc.ddpfPixelFormat).dwRGBBitCount == 32 || U1(surface_desc.ddpfPixelFormat).dwRGBBitCount == 24, - "Got unexpected bit count %u.\n", U1(surface_desc.ddpfPixelFormat).dwRGBBitCount); + "Got unexpected bit count %lu.\n", U1(surface_desc.ddpfPixelFormat).dwRGBBitCount); hr = IDirectDrawSurface_IsLost(primary); - ok(hr == DDERR_SURFACELOST, "Got unexpected hr %#x.\n", hr); + ok(hr == DDERR_SURFACELOST, "Got unexpected hr %#lx.\n", hr); hr = IDirectDrawSurface_Restore(primary); - ok(hr == DDERR_WRONGMODE, "Got unexpected hr %#x.\n", hr); + ok(hr == DDERR_WRONGMODE, "Got unexpected hr %#lx.\n", hr); hr = IDirectDrawSurface_IsLost(primary); - ok(hr == DDERR_SURFACELOST, "Got unexpected hr %#x.\n", hr); + ok(hr == DDERR_SURFACELOST, "Got unexpected hr %#lx.\n", hr); memset(&surface_desc, 0, sizeof(surface_desc)); surface_desc.dwSize = sizeof(surface_desc); hr = IDirectDrawSurface_GetSurfaceDesc(primary, &surface_desc); - ok(SUCCEEDED(hr), "Failed to get surface desc, hr %#x.\n", hr); - ok(surface_desc.dwWidth == 640, "Got unexpected surface width %u.\n", surface_desc.dwWidth); - ok(surface_desc.dwHeight == 480, "Got unexpected surface height %u.\n", surface_desc.dwHeight); + ok(SUCCEEDED(hr), "Failed to get surface desc, hr %#lx.\n", hr); + ok(surface_desc.dwWidth == 640, "Got unexpected surface width %lu.\n", surface_desc.dwWidth); + ok(surface_desc.dwHeight == 480, "Got unexpected surface height %lu.\n", surface_desc.dwHeight); ok(U1(surface_desc.ddpfPixelFormat).dwRGBBitCount == 32 || U1(surface_desc.ddpfPixelFormat).dwRGBBitCount == 24, - "Got unexpected bit count %u.\n", U1(surface_desc.ddpfPixelFormat).dwRGBBitCount); + "Got unexpected bit count %lu.\n", U1(surface_desc.ddpfPixelFormat).dwRGBBitCount); done: refcount = IDirectDrawSurface_Release(backbuffer); - ok(refcount == 1, "Got unexpected refcount %u.\n", refcount); + ok(refcount == 1, "Got unexpected refcount %lu.\n", refcount); refcount = IDirectDrawSurface_Release(primary); - ok(!refcount, "Got unexpected refcount %u.\n", refcount); + ok(!refcount, "Got unexpected refcount %lu.\n", refcount); refcount = IDirectDraw2_Release(ddraw); - ok(!refcount, "Got unexpected refcount %u.\n", refcount); + ok(!refcount, "Got unexpected refcount %lu.\n", refcount); DestroyWindow(window); } @@ -6682,7 +6672,7 @@ static void test_surface_attachment(void) ddraw = create_ddraw(); ok(!!ddraw, "Failed to create a ddraw object.\n"); hr = IDirectDraw2_SetCooperativeLevel(ddraw, window, DDSCL_NORMAL); - ok(SUCCEEDED(hr), "Failed to set cooperative level, hr %#x.\n", hr); + ok(SUCCEEDED(hr), "Failed to set cooperative level, hr %#lx.\n", hr); memset(&surface_desc, 0, sizeof(surface_desc)); surface_desc.dwSize = sizeof(surface_desc); @@ -6692,14 +6682,14 @@ static void test_surface_attachment(void) surface_desc.dwWidth = 128; surface_desc.dwHeight = 128; hr = IDirectDraw2_CreateSurface(ddraw, &surface_desc, &surface1, NULL); - ok(SUCCEEDED(hr), "Failed to create surface, hr %#x.\n", hr); + ok(SUCCEEDED(hr), "Failed to create surface, hr %#lx.\n", hr); hr = IDirectDrawSurface_GetAttachedSurface(surface1, &caps, &surface2); - ok(SUCCEEDED(hr), "Failed to get mip level, hr %#x.\n", hr); + ok(SUCCEEDED(hr), "Failed to get mip level, hr %#lx.\n", hr); hr = IDirectDrawSurface_GetAttachedSurface(surface2, &caps, &surface3); - ok(SUCCEEDED(hr), "Failed to get mip level, hr %#x.\n", hr); + ok(SUCCEEDED(hr), "Failed to get mip level, hr %#lx.\n", hr); hr = IDirectDrawSurface_GetAttachedSurface(surface3, &caps, &surface4); - ok(hr == DDERR_NOTFOUND, "Got unexpected hr %#x.\n", hr); + ok(hr == DDERR_NOTFOUND, "Got unexpected hr %#lx.\n", hr); surface_count = 0; IDirectDrawSurface_EnumAttachedSurfaces(surface1, &surface_count, surface_counter); @@ -6718,20 +6708,20 @@ static void test_surface_attachment(void) surface_desc.dwWidth = 16; surface_desc.dwHeight = 16; hr = IDirectDraw2_CreateSurface(ddraw, &surface_desc, &surface4, NULL); - ok(SUCCEEDED(hr), "Failed to create surface, hr %#x.\n", hr); + ok(SUCCEEDED(hr), "Failed to create surface, hr %#lx.\n", hr); hr = IDirectDrawSurface_AddAttachedSurface(surface1, surface4); - ok(hr == DDERR_CANNOTATTACHSURFACE, "Got unexpected hr %#x.\n", hr); + ok(hr == DDERR_CANNOTATTACHSURFACE, "Got unexpected hr %#lx.\n", hr); hr = IDirectDrawSurface_AddAttachedSurface(surface4, surface1); - ok(hr == DDERR_CANNOTATTACHSURFACE, "Got unexpected hr %#x.\n", hr); + ok(hr == DDERR_CANNOTATTACHSURFACE, "Got unexpected hr %#lx.\n", hr); hr = IDirectDrawSurface_AddAttachedSurface(surface3, surface4); - ok(hr == DDERR_CANNOTATTACHSURFACE, "Got unexpected hr %#x.\n", hr); + ok(hr == DDERR_CANNOTATTACHSURFACE, "Got unexpected hr %#lx.\n", hr); hr = IDirectDrawSurface_AddAttachedSurface(surface4, surface3); - ok(hr == DDERR_CANNOTATTACHSURFACE, "Got unexpected hr %#x.\n", hr); + ok(hr == DDERR_CANNOTATTACHSURFACE, "Got unexpected hr %#lx.\n", hr); hr = IDirectDrawSurface_AddAttachedSurface(surface2, surface4); - ok(hr == DDERR_CANNOTATTACHSURFACE, "Got unexpected hr %#x.\n", hr); + ok(hr == DDERR_CANNOTATTACHSURFACE, "Got unexpected hr %#lx.\n", hr); hr = IDirectDrawSurface_AddAttachedSurface(surface4, surface2); - ok(hr == DDERR_CANNOTATTACHSURFACE, "Got unexpected hr %#x.\n", hr); + ok(hr == DDERR_CANNOTATTACHSURFACE, "Got unexpected hr %#lx.\n", hr); IDirectDrawSurface_Release(surface4); @@ -6742,27 +6732,27 @@ static void test_surface_attachment(void) surface_desc.dwWidth = 16; surface_desc.dwHeight = 16; hr = IDirectDraw2_CreateSurface(ddraw, &surface_desc, &surface4, NULL); - ok(SUCCEEDED(hr), "Failed to create surface, hr %#x.\n", hr); + ok(SUCCEEDED(hr), "Failed to create surface, hr %#lx.\n", hr); if (SUCCEEDED(hr = IDirectDrawSurface_AddAttachedSurface(surface1, surface4))) { skip("Running on refrast, skipping some tests.\n"); hr = IDirectDrawSurface_DeleteAttachedSurface(surface1, 0, surface4); - ok(SUCCEEDED(hr), "Failed to detach surface, hr %#x.\n", hr); + ok(SUCCEEDED(hr), "Failed to detach surface, hr %#lx.\n", hr); } else { - ok(hr == DDERR_CANNOTATTACHSURFACE, "Got unexpected hr %#x.\n", hr); + ok(hr == DDERR_CANNOTATTACHSURFACE, "Got unexpected hr %#lx.\n", hr); hr = IDirectDrawSurface_AddAttachedSurface(surface4, surface1); - ok(hr == DDERR_CANNOTATTACHSURFACE, "Got unexpected hr %#x.\n", hr); + ok(hr == DDERR_CANNOTATTACHSURFACE, "Got unexpected hr %#lx.\n", hr); hr = IDirectDrawSurface_AddAttachedSurface(surface3, surface4); - ok(hr == DDERR_CANNOTATTACHSURFACE, "Got unexpected hr %#x.\n", hr); + ok(hr == DDERR_CANNOTATTACHSURFACE, "Got unexpected hr %#lx.\n", hr); hr = IDirectDrawSurface_AddAttachedSurface(surface4, surface3); - ok(hr == DDERR_CANNOTATTACHSURFACE, "Got unexpected hr %#x.\n", hr); + ok(hr == DDERR_CANNOTATTACHSURFACE, "Got unexpected hr %#lx.\n", hr); hr = IDirectDrawSurface_AddAttachedSurface(surface2, surface4); - ok(hr == DDERR_CANNOTATTACHSURFACE, "Got unexpected hr %#x.\n", hr); + ok(hr == DDERR_CANNOTATTACHSURFACE, "Got unexpected hr %#lx.\n", hr); hr = IDirectDrawSurface_AddAttachedSurface(surface4, surface2); - ok(hr == DDERR_CANNOTATTACHSURFACE, "Got unexpected hr %#x.\n", hr); + ok(hr == DDERR_CANNOTATTACHSURFACE, "Got unexpected hr %#lx.\n", hr); } IDirectDrawSurface_Release(surface4); @@ -6771,7 +6761,7 @@ static void test_surface_attachment(void) IDirectDrawSurface_Release(surface1); hr = IDirectDraw2_SetCooperativeLevel(ddraw, window, DDSCL_EXCLUSIVE | DDSCL_FULLSCREEN); - ok(SUCCEEDED(hr), "Failed to set cooperative level, hr %#x.\n", hr); + ok(SUCCEEDED(hr), "Failed to set cooperative level, hr %#lx.\n", hr); /* Try a single primary and two offscreen plain surfaces. */ memset(&surface_desc, 0, sizeof(surface_desc)); @@ -6779,7 +6769,7 @@ static void test_surface_attachment(void) surface_desc.dwFlags = DDSD_CAPS; surface_desc.ddsCaps.dwCaps = DDSCAPS_PRIMARYSURFACE; hr = IDirectDraw2_CreateSurface(ddraw, &surface_desc, &surface1, NULL); - ok(SUCCEEDED(hr), "Failed to create surface, hr %#x.\n", hr); + ok(SUCCEEDED(hr), "Failed to create surface, hr %#lx.\n", hr); memset(&surface_desc, 0, sizeof(surface_desc)); surface_desc.dwSize = sizeof(surface_desc); @@ -6788,7 +6778,7 @@ static void test_surface_attachment(void) surface_desc.dwWidth = registry_mode.dmPelsWidth; surface_desc.dwHeight = registry_mode.dmPelsHeight; hr = IDirectDraw2_CreateSurface(ddraw, &surface_desc, &surface2, NULL); - ok(SUCCEEDED(hr), "Failed to create surface, hr %#x.\n", hr); + ok(SUCCEEDED(hr), "Failed to create surface, hr %#lx.\n", hr); memset(&surface_desc, 0, sizeof(surface_desc)); surface_desc.dwSize = sizeof(surface_desc); @@ -6797,7 +6787,7 @@ static void test_surface_attachment(void) surface_desc.dwWidth = registry_mode.dmPelsWidth; surface_desc.dwHeight = registry_mode.dmPelsHeight; hr = IDirectDraw2_CreateSurface(ddraw, &surface_desc, &surface3, NULL); - ok(SUCCEEDED(hr), "Failed to create surface, hr %#x.\n", hr); + ok(SUCCEEDED(hr), "Failed to create surface, hr %#lx.\n", hr); /* This one has a different size. */ memset(&surface_desc, 0, sizeof(surface_desc)); @@ -6807,33 +6797,33 @@ static void test_surface_attachment(void) surface_desc.dwWidth = 128; surface_desc.dwHeight = 128; hr = IDirectDraw2_CreateSurface(ddraw, &surface_desc, &surface4, NULL); - ok(SUCCEEDED(hr), "Failed to create surface, hr %#x.\n", hr); + ok(SUCCEEDED(hr), "Failed to create surface, hr %#lx.\n", hr); hr = IDirectDrawSurface_AddAttachedSurface(surface1, surface2); - ok(SUCCEEDED(hr), "Failed to attach surface, hr %#x.\n", hr); + ok(SUCCEEDED(hr), "Failed to attach surface, hr %#lx.\n", hr); /* Try the reverse without detaching first. */ hr = IDirectDrawSurface_AddAttachedSurface(surface2, surface1); - ok(hr == DDERR_SURFACEALREADYATTACHED, "Got unexpected hr %#x.\n", hr); + ok(hr == DDERR_SURFACEALREADYATTACHED, "Got unexpected hr %#lx.\n", hr); hr = IDirectDrawSurface_DeleteAttachedSurface(surface1, 0, surface2); - ok(SUCCEEDED(hr), "Failed to detach surface, hr %#x.\n", hr); + ok(SUCCEEDED(hr), "Failed to detach surface, hr %#lx.\n", hr); hr = IDirectDrawSurface_AddAttachedSurface(surface2, surface1); - ok(SUCCEEDED(hr), "Failed to attach surface, hr %#x.\n", hr); + ok(SUCCEEDED(hr), "Failed to attach surface, hr %#lx.\n", hr); /* Try to detach reversed. */ hr = IDirectDrawSurface_DeleteAttachedSurface(surface1, 0, surface2); - ok(hr == DDERR_CANNOTDETACHSURFACE, "Got unexpected hr %#x.\n", hr); + ok(hr == DDERR_CANNOTDETACHSURFACE, "Got unexpected hr %#lx.\n", hr); hr = IDirectDrawSurface_DeleteAttachedSurface(surface2, 0, surface1); - ok(SUCCEEDED(hr), "Failed to detach surface, hr %#x.\n", hr); + ok(SUCCEEDED(hr), "Failed to detach surface, hr %#lx.\n", hr); hr = IDirectDrawSurface_AddAttachedSurface(surface2, surface3); - ok(SUCCEEDED(hr), "Failed to attach surface, hr %#x.\n", hr); + ok(SUCCEEDED(hr), "Failed to attach surface, hr %#lx.\n", hr); hr = IDirectDrawSurface_DeleteAttachedSurface(surface2, 0, surface3); - ok(SUCCEEDED(hr), "Failed to detach surface, hr %#x.\n", hr); + ok(SUCCEEDED(hr), "Failed to detach surface, hr %#lx.\n", hr); hr = IDirectDrawSurface_AddAttachedSurface(surface1, surface4); - ok(hr == DDERR_CANNOTATTACHSURFACE, "Got unexpected hr %#x.\n", hr); + ok(hr == DDERR_CANNOTATTACHSURFACE, "Got unexpected hr %#lx.\n", hr); hr = IDirectDrawSurface_AddAttachedSurface(surface4, surface1); - ok(hr == DDERR_CANNOTATTACHSURFACE, "Got unexpected hr %#x.\n", hr); + ok(hr == DDERR_CANNOTATTACHSURFACE, "Got unexpected hr %#lx.\n", hr); IDirectDrawSurface_Release(surface4); IDirectDrawSurface_Release(surface3); @@ -6848,7 +6838,7 @@ static void test_surface_attachment(void) surface_desc.dwWidth = 64; surface_desc.dwHeight = 64; hr = IDirectDraw2_CreateSurface(ddraw, &surface_desc, &surface1, NULL); - ok(hr == D3D_OK, "Failed to create surface, hr %#x.\n", hr); + ok(hr == D3D_OK, "Failed to create surface, hr %#lx.\n", hr); memset(&surface_desc, 0, sizeof(surface_desc)); surface_desc.dwSize = sizeof(surface_desc); @@ -6861,26 +6851,26 @@ static void test_surface_attachment(void) surface_desc.dwWidth = 32; surface_desc.dwHeight = 32; hr = IDirectDraw2_CreateSurface(ddraw, &surface_desc, &surface2, NULL); - ok(hr == D3D_OK, "Failed to create surface, hr %#x.\n", hr); + ok(hr == D3D_OK, "Failed to create surface, hr %#lx.\n", hr); surface_desc.dwWidth = 64; surface_desc.dwHeight = 64; hr = IDirectDraw2_CreateSurface(ddraw, &surface_desc, &surface3, NULL); - ok(hr == D3D_OK, "Failed to create surface, hr %#x.\n", hr); + ok(hr == D3D_OK, "Failed to create surface, hr %#lx.\n", hr); surface_desc.dwWidth = 128; surface_desc.dwHeight = 128; hr = IDirectDraw2_CreateSurface(ddraw, &surface_desc, &surface4, NULL); - ok(hr == D3D_OK, "Failed to create surface, hr %#x.\n", hr); + ok(hr == D3D_OK, "Failed to create surface, hr %#lx.\n", hr); hr = IDirectDrawSurface_AddAttachedSurface(surface1, surface2); - todo_wine ok(hr == DDERR_CANNOTATTACHSURFACE, "Got unexpected hr %#x.\n", hr); + todo_wine ok(hr == DDERR_CANNOTATTACHSURFACE, "Got unexpected hr %#lx.\n", hr); if (SUCCEEDED(hr)) IDirectDrawSurface2_DeleteAttachedSurface(surface1, 0, surface2); hr = IDirectDrawSurface_AddAttachedSurface(surface1, surface3); - ok(hr == D3D_OK, "Failed to attach depth buffer, hr %#x.\n", hr); + ok(hr == D3D_OK, "Failed to attach depth buffer, hr %#lx.\n", hr); hr = IDirectDrawSurface2_DeleteAttachedSurface(surface1, 0, surface3); - ok(hr == D3D_OK, "Failed to detach depth buffer, hr %#x.\n", hr); + ok(hr == D3D_OK, "Failed to detach depth buffer, hr %#lx.\n", hr); hr = IDirectDrawSurface_AddAttachedSurface(surface1, surface4); - todo_wine ok(hr == DDERR_CANNOTATTACHSURFACE, "Got unexpected hr %#x.\n", hr); + todo_wine ok(hr == DDERR_CANNOTATTACHSURFACE, "Got unexpected hr %#lx.\n", hr); IDirectDrawSurface2_Release(surface4); IDirectDrawSurface2_Release(surface3); @@ -6901,47 +6891,47 @@ static void test_surface_attachment(void) U3(surface_desc.ddpfPixelFormat).dwGBitMask = 0x07e0; U4(surface_desc.ddpfPixelFormat).dwBBitMask = 0x001f; hr = IDirectDraw2_CreateSurface(ddraw, &surface_desc, &surface1, NULL); - ok(SUCCEEDED(hr), "Failed to create surface, hr %#x.\n", hr); + ok(SUCCEEDED(hr), "Failed to create surface, hr %#lx.\n", hr); hr = IDirectDraw2_CreateSurface(ddraw, &surface_desc, &surface3, NULL); - ok(SUCCEEDED(hr), "Failed to create surface, hr %#x.\n", hr); + ok(SUCCEEDED(hr), "Failed to create surface, hr %#lx.\n", hr); surface_desc.ddsCaps.dwCaps = DDSCAPS_ZBUFFER; surface_desc.ddpfPixelFormat.dwFlags = DDPF_ZBUFFER; U1(surface_desc.ddpfPixelFormat).dwZBufferBitDepth = 16; U3(surface_desc.ddpfPixelFormat).dwZBitMask = 0x0000ffff; hr = IDirectDraw2_CreateSurface(ddraw, &surface_desc, &surface2, NULL); - ok(SUCCEEDED(hr), "Failed to create surface, hr %#x.\n", hr); + ok(SUCCEEDED(hr), "Failed to create surface, hr %#lx.\n", hr); hr = IDirectDrawSurface_AddAttachedSurface(surface1, surface2); - ok(SUCCEEDED(hr), "Failed to attach surface, hr %#x.\n", hr); + ok(SUCCEEDED(hr), "Failed to attach surface, hr %#lx.\n", hr); refcount = get_refcount((IUnknown *)surface2); - ok(refcount == 2, "Got unexpected refcount %u.\n", refcount); + ok(refcount == 2, "Got unexpected refcount %lu.\n", refcount); hr = IDirectDrawSurface_AddAttachedSurface(surface1, surface2); - ok(hr == DDERR_SURFACEALREADYATTACHED, "Got unexpected hr %#x.\n", hr); + ok(hr == DDERR_SURFACEALREADYATTACHED, "Got unexpected hr %#lx.\n", hr); /* Attaching while already attached to other surface. */ hr = IDirectDrawSurface_AddAttachedSurface(surface3, surface2); - todo_wine ok(SUCCEEDED(hr), "Failed to attach surface, hr %#x.\n", hr); + todo_wine ok(SUCCEEDED(hr), "Failed to attach surface, hr %#lx.\n", hr); hr = IDirectDrawSurface_DeleteAttachedSurface(surface3, 0, surface2); - todo_wine ok(SUCCEEDED(hr), "Failed to detach surface, hr %#x.\n", hr); + todo_wine ok(SUCCEEDED(hr), "Failed to detach surface, hr %#lx.\n", hr); IDirectDrawSurface_Release(surface3); hr = IDirectDrawSurface_DeleteAttachedSurface(surface1, 0, surface2); - ok(SUCCEEDED(hr), "Failed to detach surface, hr %#x.\n", hr); + ok(SUCCEEDED(hr), "Failed to detach surface, hr %#lx.\n", hr); refcount = get_refcount((IUnknown *)surface2); - ok(refcount == 1, "Got unexpected refcount %u.\n", refcount); + ok(refcount == 1, "Got unexpected refcount %lu.\n", refcount); /* Automatic detachment on release. */ hr = IDirectDrawSurface_AddAttachedSurface(surface1, surface2); - ok(SUCCEEDED(hr), "Failed to attach surface, hr %#x.\n", hr); + ok(SUCCEEDED(hr), "Failed to attach surface, hr %#lx.\n", hr); refcount = get_refcount((IUnknown *)surface2); - ok(refcount == 2, "Got unexpected refcount %u.\n", refcount); + ok(refcount == 2, "Got unexpected refcount %lu.\n", refcount); refcount = IDirectDrawSurface_Release(surface1); - ok(!refcount, "Got unexpected refcount %u.\n", refcount); + ok(!refcount, "Got unexpected refcount %lu.\n", refcount); refcount = IDirectDrawSurface_Release(surface2); - ok(!refcount, "Got unexpected refcount %u.\n", refcount); + ok(!refcount, "Got unexpected refcount %lu.\n", refcount); refcount = IDirectDraw2_Release(ddraw); - ok(!refcount, "Got unexpected refcount %u.\n", refcount); + ok(!refcount, "Got unexpected refcount %lu.\n", refcount); DestroyWindow(window); } @@ -7024,7 +7014,7 @@ static void test_pixel_format(void) hr = IDirectDraw2_SetCooperativeLevel(ddraw, window, DDSCL_NORMAL); if (FAILED(hr)) { - skip("Failed to set cooperative level, hr %#x.\n", hr); + skip("Failed to set cooperative level, hr %#lx.\n", hr); goto cleanup; } @@ -7034,9 +7024,9 @@ static void test_pixel_format(void) if (hdc2) { hr = IDirectDraw2_CreateClipper(ddraw, 0, &clipper, NULL); - ok(SUCCEEDED(hr), "Failed to create clipper, hr %#x.\n", hr); + ok(SUCCEEDED(hr), "Failed to create clipper, hr %#lx.\n", hr); hr = IDirectDrawClipper_SetHWnd(clipper, 0, window2); - ok(SUCCEEDED(hr), "Failed to set clipper window, hr %#x.\n", hr); + ok(SUCCEEDED(hr), "Failed to set clipper window, hr %#lx.\n", hr); test_format = GetPixelFormat(hdc); ok(test_format == format, "window has pixel format %d, expected %d\n", test_format, format); @@ -7051,7 +7041,7 @@ static void test_pixel_format(void) ddsd.ddsCaps.dwCaps = DDSCAPS_PRIMARYSURFACE; hr = IDirectDraw2_CreateSurface(ddraw, &ddsd, &primary, NULL); - ok(SUCCEEDED(hr), "Failed to create surface, hr %#x.\n",hr); + ok(SUCCEEDED(hr), "Failed to create surface, hr %#lx.\n",hr); test_format = GetPixelFormat(hdc); ok(test_format == format, "window has pixel format %d, expected %d\n", test_format, format); @@ -7065,7 +7055,7 @@ static void test_pixel_format(void) if (clipper) { hr = IDirectDrawSurface_SetClipper(primary, clipper); - ok(SUCCEEDED(hr), "Failed to set clipper, hr %#x.\n", hr); + ok(SUCCEEDED(hr), "Failed to set clipper, hr %#lx.\n", hr); test_format = GetPixelFormat(hdc); ok(test_format == format, "window has pixel format %d, expected %d\n", test_format, format); @@ -7080,18 +7070,18 @@ static void test_pixel_format(void) ddsd.ddsCaps.dwCaps = DDSCAPS_OFFSCREENPLAIN; ddsd.dwWidth = ddsd.dwHeight = 64; hr = IDirectDraw2_CreateSurface(ddraw, &ddsd, &offscreen, NULL); - ok(SUCCEEDED(hr), "Failed to create surface, hr %#x.\n",hr); + ok(SUCCEEDED(hr), "Failed to create surface, hr %#lx.\n",hr); memset(&fx, 0, sizeof(fx)); fx.dwSize = sizeof(fx); hr = IDirectDrawSurface_Blt(offscreen, NULL, NULL, NULL, DDBLT_WAIT | DDBLT_COLORFILL, &fx); - ok(SUCCEEDED(hr), "Failed to clear source surface, hr %#x.\n", hr); + ok(SUCCEEDED(hr), "Failed to clear source surface, hr %#lx.\n", hr); test_format = GetPixelFormat(hdc); ok(test_format == format, "window has pixel format %d, expected %d\n", test_format, format); hr = IDirectDrawSurface_Blt(primary, NULL, offscreen, NULL, DDBLT_WAIT, NULL); - ok(SUCCEEDED(hr), "Failed to blit to primary surface, hr %#x.\n", hr); + ok(SUCCEEDED(hr), "Failed to blit to primary surface, hr %#lx.\n", hr); test_format = GetPixelFormat(hdc); ok(test_format == format, "window has pixel format %d, expected %d\n", test_format, format); @@ -7197,7 +7187,7 @@ static void test_create_surface_pitch(void) ddraw = create_ddraw(); ok(!!ddraw, "Failed to create a ddraw object.\n"); hr = IDirectDraw2_SetCooperativeLevel(ddraw, window, DDSCL_NORMAL); - ok(SUCCEEDED(hr), "Failed to set cooperative level, hr %#x.\n", hr); + ok(SUCCEEDED(hr), "Failed to set cooperative level, hr %#lx.\n", hr); mem = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, ((63 * 4) + 8) * 63); @@ -7220,33 +7210,33 @@ static void test_create_surface_pitch(void) if (test_data[i].flags_in & DDSD_LPSURFACE) { HRESULT expected_hr = SUCCEEDED(test_data[i].hr) ? DDERR_INVALIDPARAMS : test_data[i].hr; - ok(hr == expected_hr, "Test %u: Got unexpected hr %#x, expected %#x.\n", i, hr, expected_hr); + ok(hr == expected_hr, "Test %u: Got unexpected hr %#lx, expected %#lx.\n", i, hr, expected_hr); surface_desc.lpSurface = mem; hr = IDirectDraw2_CreateSurface(ddraw, &surface_desc, &surface, NULL); } if ((test_data[i].caps & DDSCAPS_VIDEOMEMORY) && hr == DDERR_NODIRECTDRAWHW) continue; - ok(hr == test_data[i].hr, "Test %u: Got unexpected hr %#x, expected %#x.\n", i, hr, test_data[i].hr); + ok(hr == test_data[i].hr, "Test %u: Got unexpected hr %#lx, expected %#lx.\n", i, hr, test_data[i].hr); if (FAILED(hr)) continue; memset(&surface_desc, 0, sizeof(surface_desc)); surface_desc.dwSize = sizeof(surface_desc); hr = IDirectDrawSurface_GetSurfaceDesc(surface, &surface_desc); - ok(SUCCEEDED(hr), "Test %u: Failed to get surface desc, hr %#x.\n", i, hr); + ok(SUCCEEDED(hr), "Test %u: Failed to get surface desc, hr %#lx.\n", i, hr); ok((surface_desc.dwFlags & flags_mask) == test_data[i].flags_out, - "Test %u: Got unexpected flags %#x, expected %#x.\n", + "Test %u: Got unexpected flags %#lx, expected %#lx.\n", i, surface_desc.dwFlags & flags_mask, test_data[i].flags_out); /* The pitch for textures seems to be implementation specific. */ if (!(test_data[i].caps & DDSCAPS_TEXTURE)) { if (is_ddraw64 && test_data[i].pitch_out32 != test_data[i].pitch_out64) todo_wine ok(U1(surface_desc).lPitch == test_data[i].pitch_out64, - "Test %u: Got unexpected pitch %u, expected %u.\n", + "Test %u: Got unexpected pitch %#lx, expected %#lx.\n", i, U1(surface_desc).lPitch, test_data[i].pitch_out64); else ok(U1(surface_desc).lPitch == test_data[i].pitch_out32, - "Test %u: Got unexpected pitch %u, expected %u.\n", + "Test %u: Got unexpected pitch %#lx, expected %#lx.\n", i, U1(surface_desc).lPitch, test_data[i].pitch_out32); } ok(!surface_desc.lpSurface, "Test %u: Got unexpected lpSurface %p.\n", i, surface_desc.lpSurface); @@ -7256,7 +7246,7 @@ static void test_create_surface_pitch(void) HeapFree(GetProcessHeap(), 0, mem); refcount = IDirectDraw2_Release(ddraw); - ok(!refcount, "Got unexpected refcount %u.\n", refcount); + ok(!refcount, "Got unexpected refcount %lu.\n", refcount); DestroyWindow(window); } @@ -7297,12 +7287,12 @@ static void test_mipmap(void) ddraw = create_ddraw(); ok(!!ddraw, "Failed to create a ddraw object.\n"); hr = IDirectDraw2_SetCooperativeLevel(ddraw, window, DDSCL_NORMAL); - ok(SUCCEEDED(hr), "Failed to set cooperative level, hr %#x.\n", hr); + ok(SUCCEEDED(hr), "Failed to set cooperative level, hr %#lx.\n", hr); memset(&hal_caps, 0, sizeof(hal_caps)); hal_caps.dwSize = sizeof(hal_caps); hr = IDirectDraw2_GetCaps(ddraw, &hal_caps, NULL); - ok(SUCCEEDED(hr), "Failed to get caps, hr %#x.\n", hr); + ok(SUCCEEDED(hr), "Failed to get caps, hr %#lx.\n", hr); if ((hal_caps.ddsCaps.dwCaps & (DDSCAPS_TEXTURE | DDSCAPS_MIPMAP)) != (DDSCAPS_TEXTURE | DDSCAPS_MIPMAP)) { skip("Mipmapped textures not supported, skipping tests.\n"); @@ -7322,22 +7312,22 @@ static void test_mipmap(void) if (tests[i].flags & DDSD_MIPMAPCOUNT) U2(surface_desc).dwMipMapCount = tests[i].mipmap_count_in; hr = IDirectDraw2_CreateSurface(ddraw, &surface_desc, &surface1, NULL); - ok(hr == tests[i].hr, "Test %u: Got unexpected hr %#x.\n", i, hr); + ok(hr == tests[i].hr, "Test %u: Got unexpected hr %#lx.\n", i, hr); if (FAILED(hr)) continue; hr = IDirectDrawSurface_QueryInterface(surface1, &IID_IDirectDrawSurface2, (void **)&surface); - ok(SUCCEEDED(hr), "Test %u: Failed to get IDirectDrawSurface2 interface, hr %#x.\n", i, hr); + ok(SUCCEEDED(hr), "Test %u: Failed to get IDirectDrawSurface2 interface, hr %#lx.\n", i, hr); IDirectDrawSurface_Release(surface1); memset(&surface_desc, 0, sizeof(surface_desc)); surface_desc.dwSize = sizeof(surface_desc); hr = IDirectDrawSurface2_GetSurfaceDesc(surface, &surface_desc); - ok(SUCCEEDED(hr), "Test %u: Failed to get surface desc, hr %#x.\n", i, hr); + ok(SUCCEEDED(hr), "Test %u: Failed to get surface desc, hr %#lx.\n", i, hr); ok(surface_desc.dwFlags & DDSD_MIPMAPCOUNT, - "Test %u: Got unexpected flags %#x.\n", i, surface_desc.dwFlags); + "Test %u: Got unexpected flags %#lx.\n", i, surface_desc.dwFlags); ok(U2(surface_desc).dwMipMapCount == tests[i].mipmap_count_out, - "Test %u: Got unexpected mipmap count %u.\n", i, U2(surface_desc).dwMipMapCount); + "Test %u: Got unexpected mipmap count %lu.\n", i, U2(surface_desc).dwMipMapCount); surface_base = surface; IDirectDrawSurface2_AddRef(surface_base); @@ -7345,31 +7335,31 @@ static void test_mipmap(void) while (mipmap_count > 1) { hr = IDirectDrawSurface2_GetAttachedSurface(surface_base, &caps, &surface_mip); - ok(SUCCEEDED(hr), "Test %u, %u: Failed to get attached surface, hr %#x.\n", i, mipmap_count, hr); + ok(SUCCEEDED(hr), "Test %u, %u: Failed to get attached surface, hr %#lx.\n", i, mipmap_count, hr); memset(&surface_desc, 0, sizeof(surface_desc)); surface_desc.dwSize = sizeof(surface_desc); hr = IDirectDrawSurface2_GetSurfaceDesc(surface_base, &surface_desc); - ok(SUCCEEDED(hr), "Test %u, %u: Failed to get surface desc, hr %#x.\n", i, mipmap_count, hr); + ok(SUCCEEDED(hr), "Test %u, %u: Failed to get surface desc, hr %#lx.\n", i, mipmap_count, hr); ok(surface_desc.dwFlags & DDSD_MIPMAPCOUNT, - "Test %u, %u: Got unexpected flags %#x.\n", i, mipmap_count, surface_desc.dwFlags); + "Test %u, %u: Got unexpected flags %#lx.\n", i, mipmap_count, surface_desc.dwFlags); ok(U2(surface_desc).dwMipMapCount == mipmap_count, - "Test %u, %u: Got unexpected mipmap count %u.\n", + "Test %u, %u: Got unexpected mipmap count %lu.\n", i, mipmap_count, U2(surface_desc).dwMipMapCount); memset(&surface_desc, 0, sizeof(surface_desc)); surface_desc.dwSize = sizeof(surface_desc); hr = IDirectDrawSurface2_Lock(surface_base, NULL, &surface_desc, 0, NULL); - ok(SUCCEEDED(hr), "Test %u, %u: Failed to lock surface, hr %#x.\n", i, mipmap_count, hr); + ok(SUCCEEDED(hr), "Test %u, %u: Failed to lock surface, hr %#lx.\n", i, mipmap_count, hr); ok(surface_desc.dwMipMapCount == mipmap_count, - "Test %u, %u: unexpected change of mipmap count %u.\n", + "Test %u, %u: unexpected change of mipmap count %lu.\n", i, mipmap_count, surface_desc.dwMipMapCount); memset(&surface_desc, 0, sizeof(surface_desc)); surface_desc.dwSize = sizeof(surface_desc); hr = IDirectDrawSurface2_Lock(surface_mip, NULL, &surface_desc, 0, NULL); - ok(SUCCEEDED(hr), "Test %u, %u: Failed to lock surface, hr %#x.\n", i, mipmap_count, hr); + ok(SUCCEEDED(hr), "Test %u, %u: Failed to lock surface, hr %#lx.\n", i, mipmap_count, hr); ok(surface_desc.dwMipMapCount == mipmap_count - 1, - "Test %u, %u: Child mipmap count unexpected %u\n", i, mipmap_count, surface_desc.dwMipMapCount); + "Test %u, %u: Got unexpected child mipmap count %lu.\n", i, mipmap_count, surface_desc.dwMipMapCount); IDirectDrawSurface2_Unlock(surface_mip, NULL); IDirectDrawSurface2_Unlock(surface_base, NULL); @@ -7383,7 +7373,7 @@ static void test_mipmap(void) } refcount = IDirectDraw2_Release(ddraw); - ok(!refcount, "Got unexpected refcount %u.\n", refcount); + ok(!refcount, "Got unexpected refcount %lu.\n", refcount); DestroyWindow(window); } @@ -7409,12 +7399,12 @@ static void test_palette_complex(void) ddraw = create_ddraw(); ok(!!ddraw, "Failed to create a ddraw object.\n"); hr = IDirectDraw2_SetCooperativeLevel(ddraw, window, DDSCL_NORMAL); - ok(SUCCEEDED(hr), "Failed to set cooperative level, hr %#x.\n", hr); + ok(SUCCEEDED(hr), "Failed to set cooperative level, hr %#lx.\n", hr); memset(&hal_caps, 0, sizeof(hal_caps)); hal_caps.dwSize = sizeof(hal_caps); hr = IDirectDraw2_GetCaps(ddraw, &hal_caps, NULL); - ok(SUCCEEDED(hr), "Failed to get caps, hr %#x.\n", hr); + ok(SUCCEEDED(hr), "Failed to get caps, hr %#lx.\n", hr); if ((hal_caps.ddsCaps.dwCaps & (DDSCAPS_TEXTURE | DDSCAPS_MIPMAP)) != (DDSCAPS_TEXTURE | DDSCAPS_MIPMAP)) { skip("Mipmapped textures not supported, skipping mipmap palette test.\n"); @@ -7433,31 +7423,31 @@ static void test_palette_complex(void) surface_desc.ddpfPixelFormat.dwFlags = DDPF_PALETTEINDEXED8 | DDPF_RGB; U1(surface_desc.ddpfPixelFormat).dwRGBBitCount = 8; hr = IDirectDraw2_CreateSurface(ddraw, &surface_desc, &surface1, NULL); - ok(SUCCEEDED(hr), "Failed to create surface, hr %#x.\n", hr); + ok(SUCCEEDED(hr), "Failed to create surface, hr %#lx.\n", hr); hr = IDirectDrawSurface_QueryInterface(surface1, &IID_IDirectDrawSurface2, (void **)&surface); - ok(SUCCEEDED(hr), "Failed to get IDirectDrawSurface2 interface, hr %#x.\n", hr); + ok(SUCCEEDED(hr), "Failed to get IDirectDrawSurface2 interface, hr %#lx.\n", hr); IDirectDrawSurface_Release(surface1); memset(palette_entries, 0, sizeof(palette_entries)); hr = IDirectDraw2_CreatePalette(ddraw, DDPCAPS_8BIT | DDPCAPS_ALLOW256, palette_entries, &palette, NULL); - ok(SUCCEEDED(hr), "Failed to create palette, hr %#x.\n", hr); + ok(SUCCEEDED(hr), "Failed to create palette, hr %#lx.\n", hr); memset(palette_entries, 0, sizeof(palette_entries)); palette_entries[1].peRed = 0xff; palette_entries[1].peGreen = 0x80; hr = IDirectDraw2_CreatePalette(ddraw, DDPCAPS_8BIT | DDPCAPS_ALLOW256, palette_entries, &palette_mipmap, NULL); - ok(SUCCEEDED(hr), "Failed to create palette, hr %#x.\n", hr); + ok(SUCCEEDED(hr), "Failed to create palette, hr %#lx.\n", hr); palette2 = (void *)0xdeadbeef; hr = IDirectDrawSurface2_GetPalette(surface, &palette2); - ok(hr == DDERR_NOPALETTEATTACHED, "Got unexpected hr %#x.\n", hr); + ok(hr == DDERR_NOPALETTEATTACHED, "Got unexpected hr %#lx.\n", hr); ok(!palette2, "Got unexpected palette %p.\n", palette2); hr = IDirectDrawSurface2_SetPalette(surface, palette); - ok(SUCCEEDED(hr), "Failed to set palette, hr %#x.\n", hr); + ok(SUCCEEDED(hr), "Failed to set palette, hr %#lx.\n", hr); hr = IDirectDrawSurface2_GetPalette(surface, &palette2); - ok(SUCCEEDED(hr), "Failed to get palette, hr %#x.\n", hr); + ok(SUCCEEDED(hr), "Failed to get palette, hr %#lx.\n", hr); ok(palette == palette2, "Got unexpected palette %p.\n", palette2); IDirectDrawPalette_Release(palette2); @@ -7466,46 +7456,46 @@ static void test_palette_complex(void) for (i = 0; i < 7; ++i) { hr = IDirectDrawSurface2_GetAttachedSurface(mipmap, &caps, &tmp); - ok(SUCCEEDED(hr), "Failed to get attached surface, i %u, hr %#x.\n", i, hr); + ok(SUCCEEDED(hr), "Failed to get attached surface, i %u, hr %#lx.\n", i, hr); palette2 = (void *)0xdeadbeef; hr = IDirectDrawSurface2_GetPalette(tmp, &palette2); - ok(hr == DDERR_NOPALETTEATTACHED, "Got unexpected hr %#x, i %u.\n", hr, i); + ok(hr == DDERR_NOPALETTEATTACHED, "Got unexpected hr %#lx, i %u.\n", hr, i); ok(!palette2, "Got unexpected palette %p, i %u.\n", palette2, i); hr = IDirectDrawSurface2_SetPalette(tmp, palette_mipmap); - ok(SUCCEEDED(hr), "Failed to set palette, i %u, hr %#x.\n", i, hr); + ok(SUCCEEDED(hr), "Failed to set palette, i %u, hr %#lx.\n", i, hr); hr = IDirectDrawSurface2_GetPalette(tmp, &palette2); - ok(SUCCEEDED(hr), "Failed to get palette, i %u, hr %#x.\n", i, hr); + ok(SUCCEEDED(hr), "Failed to get palette, i %u, hr %#lx.\n", i, hr); ok(palette_mipmap == palette2, "Got unexpected palette %p.\n", palette2); IDirectDrawPalette_Release(palette2); hr = IDirectDrawSurface2_GetDC(tmp, &dc); - ok(SUCCEEDED(hr), "Failed to get DC, i %u, hr %#x.\n", i, hr); + ok(SUCCEEDED(hr), "Failed to get DC, i %u, hr %#lx.\n", i, hr); count = GetDIBColorTable(dc, 1, 1, &rgbquad); ok(count == 1, "Expected count 1, got %u.\n", count); ok(rgbquad.rgbRed == 0xff, "Expected rgbRed = 0xff, got %#x.\n", rgbquad.rgbRed); ok(rgbquad.rgbGreen == 0x80, "Expected rgbGreen = 0x80, got %#x.\n", rgbquad.rgbGreen); ok(rgbquad.rgbBlue == 0x0, "Expected rgbBlue = 0x0, got %#x.\n", rgbquad.rgbBlue); hr = IDirectDrawSurface2_ReleaseDC(tmp, dc); - ok(SUCCEEDED(hr), "Failed to release DC, i %u, hr %#x.\n", i, hr); + ok(SUCCEEDED(hr), "Failed to release DC, i %u, hr %#lx.\n", i, hr); IDirectDrawSurface2_Release(mipmap); mipmap = tmp; } hr = IDirectDrawSurface2_GetAttachedSurface(mipmap, &caps, &tmp); - ok(hr == DDERR_NOTFOUND, "Got unexpected hr %#x.\n", hr); + ok(hr == DDERR_NOTFOUND, "Got unexpected hr %#lx.\n", hr); IDirectDrawSurface2_Release(mipmap); refcount = IDirectDrawSurface2_Release(surface); - ok(!refcount, "Got unexpected refcount %u.\n", refcount); + ok(!refcount, "Got unexpected refcount %lu.\n", refcount); refcount = IDirectDrawPalette_Release(palette_mipmap); - ok(!refcount, "Got unexpected refcount %u.\n", refcount); + ok(!refcount, "Got unexpected refcount %lu.\n", refcount); refcount = IDirectDrawPalette_Release(palette); - ok(!refcount, "Got unexpected refcount %u.\n", refcount); + ok(!refcount, "Got unexpected refcount %lu.\n", refcount); refcount = IDirectDraw2_Release(ddraw); - ok(!refcount, "Got unexpected refcount %u.\n", refcount); + ok(!refcount, "Got unexpected refcount %lu.\n", refcount); DestroyWindow(window); } @@ -7513,30 +7503,29 @@ static void test_p8_blit(void) { IDirectDrawSurface *src, *dst, *dst_p8; DDSURFACEDESC surface_desc; + unsigned int color, x; IDirectDraw2 *ddraw; IDirectDrawPalette *palette, *palette2; ULONG refcount; HWND window; HRESULT hr; PALETTEENTRY palette_entries[256]; - unsigned int x; DDBLTFX fx; BOOL is_warp; static const BYTE src_data[] = {0x10, 0x1, 0x2, 0x3, 0x4, 0x5, 0xff, 0x80}; static const BYTE src_data2[] = {0x10, 0x5, 0x4, 0x3, 0x2, 0x1, 0xff, 0x80}; static const BYTE expected_p8[] = {0x10, 0x1, 0x4, 0x3, 0x4, 0x5, 0xff, 0x80}; - static const D3DCOLOR expected[] = + static const unsigned int expected[] = { 0x00101010, 0x00010101, 0x00020202, 0x00030303, 0x00040404, 0x00050505, 0x00ffffff, 0x00808080, }; - D3DCOLOR color; window = create_window(); ddraw = create_ddraw(); ok(!!ddraw, "Failed to create a ddraw object.\n"); hr = IDirectDraw2_SetCooperativeLevel(ddraw, window, DDSCL_NORMAL); - ok(SUCCEEDED(hr), "Failed to set cooperative level, hr %#x.\n", hr); + ok(SUCCEEDED(hr), "Failed to set cooperative level, hr %#lx.\n", hr); is_warp = ddraw_is_warp(ddraw); memset(palette_entries, 0, sizeof(palette_entries)); @@ -7546,14 +7535,14 @@ static void test_p8_blit(void) palette_entries[4].peRed = 0xff; hr = IDirectDraw2_CreatePalette(ddraw, DDPCAPS_8BIT | DDPCAPS_ALLOW256, palette_entries, &palette, NULL); - ok(SUCCEEDED(hr), "Failed to create palette, hr %#x.\n", hr); + ok(SUCCEEDED(hr), "Failed to create palette, hr %#lx.\n", hr); palette_entries[1].peBlue = 0xff; palette_entries[2].peGreen = 0xff; palette_entries[3].peRed = 0xff; palette_entries[4].peFlags = 0x0; hr = IDirectDraw2_CreatePalette(ddraw, DDPCAPS_8BIT | DDPCAPS_ALLOW256, palette_entries, &palette2, NULL); - ok(SUCCEEDED(hr), "Failed to create palette, hr %#x.\n", hr); + ok(SUCCEEDED(hr), "Failed to create palette, hr %#lx.\n", hr); memset(&surface_desc, 0, sizeof(surface_desc)); surface_desc.dwSize = sizeof(surface_desc); @@ -7565,11 +7554,11 @@ static void test_p8_blit(void) surface_desc.ddpfPixelFormat.dwFlags = DDPF_PALETTEINDEXED8 | DDPF_RGB; U1(surface_desc.ddpfPixelFormat).dwRGBBitCount = 8; hr = IDirectDraw2_CreateSurface(ddraw, &surface_desc, &src, NULL); - ok(SUCCEEDED(hr), "Failed to create surface, hr %#x.\n", hr); + ok(SUCCEEDED(hr), "Failed to create surface, hr %#lx.\n", hr); hr = IDirectDraw2_CreateSurface(ddraw, &surface_desc, &dst_p8, NULL); - ok(SUCCEEDED(hr), "Failed to create surface, hr %#x.\n", hr); + ok(SUCCEEDED(hr), "Failed to create surface, hr %#lx.\n", hr); hr = IDirectDrawSurface_SetPalette(dst_p8, palette2); - ok(SUCCEEDED(hr), "Failed to set palette, hr %#x.\n", hr); + ok(SUCCEEDED(hr), "Failed to set palette, hr %#lx.\n", hr); memset(&surface_desc, 0, sizeof(surface_desc)); surface_desc.dwSize = sizeof(surface_desc); @@ -7585,34 +7574,34 @@ static void test_p8_blit(void) U4(surface_desc.ddpfPixelFormat).dwBBitMask = 0x000000ff; U5(surface_desc.ddpfPixelFormat).dwRGBAlphaBitMask = 0xff000000; hr = IDirectDraw2_CreateSurface(ddraw, &surface_desc, &dst, NULL); - ok(SUCCEEDED(hr), "Failed to create surface, hr %#x.\n", hr); + ok(SUCCEEDED(hr), "Failed to create surface, hr %#lx.\n", hr); memset(&surface_desc, 0, sizeof(surface_desc)); surface_desc.dwSize = sizeof(surface_desc); hr = IDirectDrawSurface_Lock(src, NULL, &surface_desc, DDLOCK_WAIT, NULL); - ok(SUCCEEDED(hr), "Failed to lock source surface, hr %#x.\n", hr); + ok(SUCCEEDED(hr), "Failed to lock source surface, hr %#lx.\n", hr); memcpy(surface_desc.lpSurface, src_data, sizeof(src_data)); hr = IDirectDrawSurface_Unlock(src, NULL); - ok(SUCCEEDED(hr), "Failed to unlock source surface, hr %#x.\n", hr); + ok(SUCCEEDED(hr), "Failed to unlock source surface, hr %#lx.\n", hr); hr = IDirectDrawSurface_Lock(dst_p8, NULL, &surface_desc, DDLOCK_WAIT, NULL); - ok(SUCCEEDED(hr), "Failed to lock destination surface, hr %#x.\n", hr); + ok(SUCCEEDED(hr), "Failed to lock destination surface, hr %#lx.\n", hr); memcpy(surface_desc.lpSurface, src_data2, sizeof(src_data2)); hr = IDirectDrawSurface_Unlock(dst_p8, NULL); - ok(SUCCEEDED(hr), "Failed to unlock destination surface, hr %#x.\n", hr); + ok(SUCCEEDED(hr), "Failed to unlock destination surface, hr %#lx.\n", hr); fx.dwSize = sizeof(fx); fx.dwFillColor = 0xdeadbeef; hr = IDirectDrawSurface_Blt(dst, NULL, NULL, NULL, DDBLT_WAIT | DDBLT_COLORFILL, &fx); - ok(SUCCEEDED(hr), "Failed to color fill %#x.\n", hr); + ok(SUCCEEDED(hr), "Got hr %#lx.\n", hr); hr = IDirectDrawSurface_SetPalette(src, palette); - ok(SUCCEEDED(hr), "Failed to set palette, hr %#x.\n", hr); + ok(SUCCEEDED(hr), "Failed to set palette, hr %#lx.\n", hr); hr = IDirectDrawSurface_Blt(dst, NULL, src, NULL, DDBLT_WAIT, NULL); /* The r500 Windows 7 driver returns E_NOTIMPL. r200 on Windows XP works. * The Geforce 7 driver on Windows Vista returns E_FAIL. Newer Nvidia GPUs work. */ ok(SUCCEEDED(hr) || broken(hr == E_NOTIMPL) || broken(hr == E_FAIL), - "Failed to blit, hr %#x.\n", hr); + "Failed to blit, hr %#lx.\n", hr); if (SUCCEEDED(hr)) { @@ -7631,10 +7620,10 @@ static void test_p8_blit(void) fx.ddckSrcColorkey.dwColorSpaceHighValue = 0x2; fx.ddckSrcColorkey.dwColorSpaceLowValue = 0x2; hr = IDirectDrawSurface7_Blt(dst_p8, NULL, src, NULL, DDBLT_WAIT | DDBLT_KEYSRCOVERRIDE, &fx); - ok(SUCCEEDED(hr), "Failed to blit, hr %#x.\n", hr); + ok(SUCCEEDED(hr), "Failed to blit, hr %#lx.\n", hr); hr = IDirectDrawSurface_Lock(dst_p8, NULL, &surface_desc, DDLOCK_READONLY | DDLOCK_WAIT, NULL); - ok(SUCCEEDED(hr), "Failed to lock destination surface, hr %#x.\n", hr); + ok(SUCCEEDED(hr), "Failed to lock destination surface, hr %#lx.\n", hr); /* A color keyed P8 blit doesn't do anything on WARP - it just leaves the data in the destination * surface untouched. Error checking (DDBLT_KEYSRC without a key * for example) also works as expected. @@ -7645,7 +7634,7 @@ static void test_p8_blit(void) || broken(is_warp && !memcmp(surface_desc.lpSurface, src_data2, sizeof(src_data2))), "Got unexpected P8 color key blit result.\n"); hr = IDirectDrawSurface_Unlock(dst_p8, NULL); - ok(SUCCEEDED(hr), "Failed to unlock destination surface, hr %#x.\n", hr); + ok(SUCCEEDED(hr), "Failed to unlock destination surface, hr %#lx.\n", hr); IDirectDrawSurface_Release(src); IDirectDrawSurface_Release(dst); @@ -7654,7 +7643,7 @@ static void test_p8_blit(void) IDirectDrawPalette_Release(palette2); refcount = IDirectDraw2_Release(ddraw); - ok(!refcount, "Got unexpected refcount %u.\n", refcount); + ok(!refcount, "Got unexpected refcount %lu.\n", refcount); DestroyWindow(window); } @@ -7665,10 +7654,9 @@ static void test_material(void) IDirect3DViewport2 *viewport; IDirect3DDevice2 *device; IDirectDrawSurface *rt; + unsigned int color, i; IDirectDraw2 *ddraw; - D3DCOLOR color; ULONG refcount; - unsigned int i; HWND window; HRESULT hr; BOOL valid; @@ -7703,46 +7691,46 @@ static void test_material(void) } hr = IDirect3DDevice2_GetRenderTarget(device, &rt); - ok(SUCCEEDED(hr), "Failed to get render target, hr %#x.\n", hr); + ok(SUCCEEDED(hr), "Failed to get render target, hr %#lx.\n", hr); background = create_diffuse_material(device, 0.0f, 0.0f, 1.0f, 1.0f); viewport = create_viewport(device, 0, 0, 640, 480); viewport_set_background(device, viewport, background); hr = IDirect3DDevice2_SetCurrentViewport(device, viewport); - ok(SUCCEEDED(hr), "Failed to set current viewport, hr %#x.\n", hr); + ok(SUCCEEDED(hr), "Failed to set current viewport, hr %#lx.\n", hr); material = create_emissive_material(device, 0.0f, 1.0f, 0.0f, 0.0f); hr = IDirect3DMaterial2_GetHandle(material, device, &mat_handle); - ok(SUCCEEDED(hr), "Failed to get material handle, hr %#x.\n", hr); + ok(SUCCEEDED(hr), "Failed to get material handle, hr %#lx.\n", hr); hr = IDirect3DDevice2_GetLightState(device, D3DLIGHTSTATE_MATERIAL, &tmp); - ok(SUCCEEDED(hr), "Failed to get light state, hr %#x.\n", hr); - ok(!tmp, "Got unexpected material handle %#x.\n", tmp); + ok(SUCCEEDED(hr), "Failed to get light state, hr %#lx.\n", hr); + ok(!tmp, "Got unexpected material handle %#lx.\n", tmp); hr = IDirect3DDevice2_SetLightState(device, D3DLIGHTSTATE_MATERIAL, mat_handle); - ok(SUCCEEDED(hr), "Failed to set material state, hr %#x.\n", hr); + ok(SUCCEEDED(hr), "Failed to set material state, hr %#lx.\n", hr); hr = IDirect3DDevice2_GetLightState(device, D3DLIGHTSTATE_MATERIAL, &tmp); - ok(SUCCEEDED(hr), "Failed to get light state, hr %#x.\n", hr); - ok(tmp == mat_handle, "Got unexpected material handle %#x, expected %#x.\n", tmp, mat_handle); + ok(SUCCEEDED(hr), "Failed to get light state, hr %#lx.\n", hr); + ok(tmp == mat_handle, "Got unexpected material handle %#lx, expected %#lx.\n", tmp, mat_handle); hr = IDirect3DDevice2_SetLightState(device, D3DLIGHTSTATE_MATERIAL, 0); - ok(SUCCEEDED(hr), "Failed to set material state, hr %#x.\n", hr); + ok(SUCCEEDED(hr), "Failed to set material state, hr %#lx.\n", hr); hr = IDirect3DDevice2_GetLightState(device, D3DLIGHTSTATE_MATERIAL, &tmp); - ok(SUCCEEDED(hr), "Failed to get light state, hr %#x.\n", hr); - ok(!tmp, "Got unexpected material handle %#x.\n", tmp); + ok(SUCCEEDED(hr), "Failed to get light state, hr %#lx.\n", hr); + ok(!tmp, "Got unexpected material handle %#lx.\n", tmp); for (i = 0; i < ARRAY_SIZE(test_data); ++i) { hr = IDirect3DViewport2_Clear(viewport, 1, &clear_rect, D3DCLEAR_TARGET | D3DCLEAR_ZBUFFER); - ok(SUCCEEDED(hr), "Failed to clear viewport, hr %#x.\n", hr); + ok(SUCCEEDED(hr), "Failed to clear viewport, hr %#lx.\n", hr); hr = IDirect3DDevice2_SetLightState(device, D3DLIGHTSTATE_MATERIAL, test_data[i].material ? mat_handle : 0); - ok(SUCCEEDED(hr), "Failed to set material state, hr %#x.\n", hr); + ok(SUCCEEDED(hr), "Failed to set material state, hr %#lx.\n", hr); hr = IDirect3DDevice2_BeginScene(device); - ok(SUCCEEDED(hr), "Failed to begin scene, hr %#x.\n", hr); + ok(SUCCEEDED(hr), "Failed to begin scene, hr %#lx.\n", hr); hr = IDirect3DDevice2_DrawPrimitive(device, D3DPT_TRIANGLESTRIP, D3DVT_VERTEX, quad, 4, 0); - ok(SUCCEEDED(hr), "Failed to draw, hr %#x.\n", hr); + ok(SUCCEEDED(hr), "Failed to draw, hr %#lx.\n", hr); hr = IDirect3DDevice2_EndScene(device); - ok(SUCCEEDED(hr), "Failed to end scene, hr %#x.\n", hr); + ok(SUCCEEDED(hr), "Failed to end scene, hr %#lx.\n", hr); color = get_surface_color(rt, 320, 240); ok(compare_color(color, test_data[i].expected_color, 1), "Got unexpected color 0x%08x, test %u.\n", color, i); @@ -7751,27 +7739,27 @@ static void test_material(void) destroy_material(material); material = create_diffuse_material(device, 1.0f, 0.0f, 0.0f, 1.0f); hr = IDirect3DMaterial2_GetHandle(material, device, &mat_handle); - ok(SUCCEEDED(hr), "Failed to get material handle, hr %#x.\n", hr); + ok(SUCCEEDED(hr), "Failed to get material handle, hr %#lx.\n", hr); hr = IDirect3DViewport2_SetBackground(viewport, mat_handle); - ok(SUCCEEDED(hr), "Failed to set viewport background, hr %#x.\n", hr); + ok(SUCCEEDED(hr), "Failed to set viewport background, hr %#lx.\n", hr); hr = IDirect3DViewport2_GetBackground(viewport, &tmp, &valid); - ok(SUCCEEDED(hr), "Failed to get viewport background, hr %#x.\n", hr); - ok(tmp == mat_handle, "Got unexpected material handle %#x, expected %#x.\n", tmp, mat_handle); + ok(SUCCEEDED(hr), "Failed to get viewport background, hr %#lx.\n", hr); + ok(tmp == mat_handle, "Got unexpected material handle %#lx, expected %#lx.\n", tmp, mat_handle); ok(valid, "Got unexpected valid %#x.\n", valid); hr = IDirect3DViewport2_Clear(viewport, 1, &clear_rect, D3DCLEAR_TARGET); - ok(SUCCEEDED(hr), "Failed to clear viewport, hr %#x.\n", hr); + ok(SUCCEEDED(hr), "Failed to clear viewport, hr %#lx.\n", hr); color = get_surface_color(rt, 320, 240); ok(compare_color(color, 0x00ff0000, 1), "Got unexpected color 0x%08x.\n", color); hr = IDirect3DViewport2_SetBackground(viewport, 0); - ok(hr == DDERR_INVALIDPARAMS, "Got unexpected hr %#x.\n", hr); + ok(hr == DDERR_INVALIDPARAMS, "Got unexpected hr %#lx.\n", hr); hr = IDirect3DViewport2_GetBackground(viewport, &tmp, &valid); - ok(SUCCEEDED(hr), "Failed to get viewport background, hr %#x.\n", hr); - ok(tmp == mat_handle, "Got unexpected material handle %#x, expected %#x.\n", tmp, mat_handle); + ok(SUCCEEDED(hr), "Failed to get viewport background, hr %#lx.\n", hr); + ok(tmp == mat_handle, "Got unexpected material handle %#lx, expected %#lx.\n", tmp, mat_handle); ok(valid, "Got unexpected valid %#x.\n", valid); hr = IDirect3DViewport2_Clear(viewport, 1, &clear_rect, D3DCLEAR_TARGET); - ok(SUCCEEDED(hr), "Failed to clear viewport, hr %#x.\n", hr); + ok(SUCCEEDED(hr), "Failed to clear viewport, hr %#lx.\n", hr); color = get_surface_color(rt, 320, 240); ok(compare_color(color, 0x00ff0000, 1), "Got unexpected color 0x%08x.\n", color); @@ -7779,11 +7767,11 @@ static void test_material(void) viewport = create_viewport(device, 0, 0, 640, 480); hr = IDirect3DViewport2_GetBackground(viewport, &tmp, &valid); - ok(SUCCEEDED(hr), "Failed to get viewport background, hr %#x.\n", hr); - ok(!tmp, "Got unexpected material handle %#x.\n", tmp); + ok(SUCCEEDED(hr), "Failed to get viewport background, hr %#lx.\n", hr); + ok(!tmp, "Got unexpected material handle %#lx.\n", tmp); ok(!valid, "Got unexpected valid %#x.\n", valid); hr = IDirect3DViewport2_Clear(viewport, 1, &clear_rect, D3DCLEAR_TARGET); - ok(SUCCEEDED(hr), "Failed to clear viewport, hr %#x.\n", hr); + ok(SUCCEEDED(hr), "Failed to clear viewport, hr %#lx.\n", hr); color = get_surface_color(rt, 320, 240); ok(compare_color(color, 0x00000000, 1), "Got unexpected color 0x%08x.\n", color); @@ -7792,9 +7780,9 @@ static void test_material(void) destroy_material(material); IDirectDrawSurface_Release(rt); refcount = IDirect3DDevice2_Release(device); - ok(!refcount, "Device has %u references left.\n", refcount); + ok(!refcount, "Device has %lu references left.\n", refcount); refcount = IDirectDraw2_Release(ddraw); - ok(!refcount, "Ddraw object has %u references left.\n", refcount); + ok(!refcount, "Ddraw object has %lu references left.\n", refcount); DestroyWindow(window); } @@ -7900,12 +7888,11 @@ static void test_lighting(void) IDirect3DDevice2 *device; IDirectDrawSurface *rt; IDirect3DLight *light; + unsigned int color, i; D3DLIGHT2 light_desc; IDirectDraw2 *ddraw; IDirect3D2 *d3d; - D3DCOLOR color; ULONG refcount; - unsigned int i; HWND window; HRESULT hr; @@ -7920,64 +7907,64 @@ static void test_lighting(void) } hr = IDirect3DDevice2_GetDirect3D(device, &d3d); - ok(hr == D3D_OK, "Got unexpected hr %#x.\n", hr); + ok(hr == D3D_OK, "Got unexpected hr %#lx.\n", hr); hr = IDirect3DDevice2_GetRenderTarget(device, &rt); - ok(hr == D3D_OK, "Got unexpected hr %#x.\n", hr); + ok(hr == D3D_OK, "Got unexpected hr %#lx.\n", hr); viewport = create_viewport(device, 0, 0, 640, 480); hr = IDirect3DDevice2_SetCurrentViewport(device, viewport); - ok(hr == D3D_OK, "Got unexpected hr %#x.\n", hr); + ok(hr == D3D_OK, "Got unexpected hr %#lx.\n", hr); material = create_diffuse_and_ambient_material(device, 1.0f, 1.0f, 1.0f, 1.0f); viewport_set_background(device, viewport, material); hr = IDirect3DViewport2_Clear(viewport, 1, &clear_rect, D3DCLEAR_TARGET); - ok(SUCCEEDED(hr), "Failed to clear viewport, hr %#x.\n", hr); + ok(SUCCEEDED(hr), "Failed to clear viewport, hr %#lx.\n", hr); hr = IDirect3DDevice2_SetTransform(device, D3DTRANSFORMSTATE_WORLD, &mat); - ok(SUCCEEDED(hr), "Failed to set world transform, hr %#x.\n", hr); + ok(SUCCEEDED(hr), "Failed to set world transform, hr %#lx.\n", hr); hr = IDirect3DDevice2_SetTransform(device, D3DTRANSFORMSTATE_VIEW, &mat); - ok(SUCCEEDED(hr), "Failed to set view transform, hr %#x.\n", hr); + ok(SUCCEEDED(hr), "Failed to set view transform, hr %#lx.\n", hr); hr = IDirect3DDevice2_SetTransform(device, D3DTRANSFORMSTATE_PROJECTION, &mat); - ok(SUCCEEDED(hr), "Failed to set projection transform, hr %#x.\n", hr); + ok(SUCCEEDED(hr), "Failed to set projection transform, hr %#lx.\n", hr); hr = IDirect3DDevice2_SetRenderState(device, D3DRENDERSTATE_ZENABLE, FALSE); - ok(SUCCEEDED(hr), "Failed to disable zbuffer, hr %#x.\n", hr); + ok(SUCCEEDED(hr), "Failed to disable zbuffer, hr %#lx.\n", hr); hr = IDirect3DDevice2_SetRenderState(device, D3DRENDERSTATE_FOGENABLE, FALSE); - ok(SUCCEEDED(hr), "Failed to disable fog, hr %#x.\n", hr); + ok(SUCCEEDED(hr), "Failed to disable fog, hr %#lx.\n", hr); hr = IDirect3DDevice2_SetRenderState(device, D3DRENDERSTATE_CULLMODE, D3DCULL_NONE); - ok(SUCCEEDED(hr), "Failed to disable culling, hr %#x.\n", hr); + ok(SUCCEEDED(hr), "Failed to disable culling, hr %#lx.\n", hr); hr = IDirect3DDevice2_BeginScene(device); - ok(SUCCEEDED(hr), "Failed to begin scene, hr %#x.\n", hr); + ok(SUCCEEDED(hr), "Failed to begin scene, hr %#lx.\n", hr); /* There is no D3DRENDERSTATE_LIGHTING on ddraw < 7. */ hr = IDirect3DDevice2_SetRenderState(device, D3DRENDERSTATE_LIGHTING, FALSE); - ok(SUCCEEDED(hr), "Failed to disable lighting, hr %#x.\n", hr); + ok(SUCCEEDED(hr), "Failed to disable lighting, hr %#lx.\n", hr); hr = IDirect3DDevice2_DrawIndexedPrimitive(device, D3DPT_TRIANGLELIST, D3DVT_LVERTEX, unlitquad, 4, indices, 6, 0); - ok(SUCCEEDED(hr), "Failed to draw, hr %#x.\n", hr); + ok(SUCCEEDED(hr), "Failed to draw, hr %#lx.\n", hr); hr = IDirect3DDevice2_SetRenderState(device, D3DRENDERSTATE_LIGHTING, TRUE); - ok(SUCCEEDED(hr), "Failed to enable lighting, hr %#x.\n", hr); + ok(SUCCEEDED(hr), "Failed to enable lighting, hr %#lx.\n", hr); hr = IDirect3DDevice2_DrawIndexedPrimitive(device, D3DPT_TRIANGLELIST, D3DVT_LVERTEX, litquad, 4, indices, 6, 0); - ok(SUCCEEDED(hr), "Failed to draw, hr %#x.\n", hr); + ok(SUCCEEDED(hr), "Failed to draw, hr %#lx.\n", hr); hr = IDirect3DDevice2_SetRenderState(device, D3DRENDERSTATE_LIGHTING, FALSE); - ok(SUCCEEDED(hr), "Failed to disable lighting, hr %#x.\n", hr); + ok(SUCCEEDED(hr), "Failed to disable lighting, hr %#lx.\n", hr); hr = IDirect3DDevice2_DrawIndexedPrimitive(device, D3DPT_TRIANGLELIST, D3DVT_VERTEX, unlitnquad, 4, indices, 6, 0); - ok(SUCCEEDED(hr), "Failed to draw, hr %#x.\n", hr); + ok(SUCCEEDED(hr), "Failed to draw, hr %#lx.\n", hr); hr = IDirect3DDevice2_SetRenderState(device, D3DRENDERSTATE_LIGHTING, TRUE); - ok(SUCCEEDED(hr), "Failed to disable lighting, hr %#x.\n", hr); + ok(SUCCEEDED(hr), "Failed to disable lighting, hr %#lx.\n", hr); hr = IDirect3DDevice2_DrawIndexedPrimitive(device, D3DPT_TRIANGLELIST, D3DVT_VERTEX, litnquad, 4, indices, 6, 0); - ok(SUCCEEDED(hr), "Failed to draw, hr %#x.\n", hr); + ok(SUCCEEDED(hr), "Failed to draw, hr %#lx.\n", hr); hr = IDirect3DDevice2_EndScene(device); - ok(SUCCEEDED(hr), "Failed to end scene, hr %#x.\n", hr); + ok(SUCCEEDED(hr), "Failed to end scene, hr %#lx.\n", hr); color = get_surface_color(rt, 160, 360); ok(color == 0x00ff0000, "Unlit quad without normals has color 0x%08x.\n", color); @@ -7989,14 +7976,14 @@ static void test_lighting(void) ok(color == 0x00ffffff, "Lit quad with normals has color 0x%08x.\n", color); hr = IDirect3DMaterial2_GetHandle(material, device, &mat_handle); - ok(hr == D3D_OK, "Got unexpected hr %#x.\n", hr); + ok(hr == D3D_OK, "Got unexpected hr %#lx.\n", hr); hr = IDirect3DDevice2_SetLightState(device, D3DLIGHTSTATE_MATERIAL, mat_handle); - ok(hr == D3D_OK, "Got unexpected hr %#x.\n", hr); + ok(hr == D3D_OK, "Got unexpected hr %#lx.\n", hr); hr = IDirect3DDevice2_SetLightState(device, D3DLIGHTSTATE_AMBIENT, 0xff002000); - ok(hr == D3D_OK, "Got unexpected hr %#x.\n", hr); + ok(hr == D3D_OK, "Got unexpected hr %#lx.\n", hr); hr = IDirect3D2_CreateLight(d3d, &light, NULL); - ok(hr == D3D_OK, "Got unexpected hr %#x.\n", hr); + ok(hr == D3D_OK, "Got unexpected hr %#lx.\n", hr); memset(&light_desc, 0, sizeof(light_desc)); light_desc.dwSize = sizeof(light_desc); light_desc.dltType = D3DLIGHT_DIRECTIONAL; @@ -8006,78 +7993,78 @@ static void test_lighting(void) U4(light_desc.dcvColor).a = 1.0f; U3(light_desc.dvDirection).z = 1.0f; hr = IDirect3DLight_SetLight(light, (D3DLIGHT *)&light_desc); - ok(hr == D3D_OK, "Got unexpected hr %#x.\n", hr); + ok(hr == D3D_OK, "Got unexpected hr %#lx.\n", hr); hr = IDirect3DViewport2_AddLight(viewport, light); - ok(hr == D3D_OK, "Got unexpected hr %#x.\n", hr); + ok(hr == D3D_OK, "Got unexpected hr %#lx.\n", hr); hr = IDirect3DViewport2_AddLight(viewport, light); - ok(hr == D3DERR_LIGHTHASVIEWPORT, "Got unexpected hr %#x.\n", hr); + ok(hr == D3DERR_LIGHTHASVIEWPORT, "Got unexpected hr %#lx.\n", hr); viewport2 = create_viewport(device, 0, 0, 640, 480); hr = IDirect3DViewport2_AddLight(viewport2, light); - ok(hr == D3DERR_LIGHTHASVIEWPORT, "Got unexpected hr %#x.\n", hr); + ok(hr == D3DERR_LIGHTHASVIEWPORT, "Got unexpected hr %#lx.\n", hr); destroy_viewport(device, viewport2); hr = IDirect3DViewport2_Clear(viewport, 1, &clear_rect, D3DCLEAR_TARGET); - ok(hr == D3D_OK, "Got unexpected hr %#x.\n", hr); + ok(hr == D3D_OK, "Got unexpected hr %#lx.\n", hr); hr = IDirect3DDevice2_BeginScene(device); - ok(hr == D3D_OK, "Got unexpected hr %#x.\n", hr); + ok(hr == D3D_OK, "Got unexpected hr %#lx.\n", hr); hr = IDirect3DDevice2_DrawIndexedPrimitive(device, D3DPT_TRIANGLELIST, D3DVT_VERTEX, nquad, 4, indices, 6, 0); - ok(hr == D3D_OK, "Got unexpected hr %#x.\n", hr); + ok(hr == D3D_OK, "Got unexpected hr %#lx.\n", hr); hr = IDirect3DDevice2_EndScene(device); - ok(hr == D3D_OK, "Got unexpected hr %#x.\n", hr); + ok(hr == D3D_OK, "Got unexpected hr %#lx.\n", hr); color = get_surface_color(rt, 320, 240); ok(color == 0x00002000, "Lit quad with no light has color 0x%08x.\n", color); light_desc.dwFlags = D3DLIGHT_ACTIVE; hr = IDirect3DLight_SetLight(light, (D3DLIGHT *)&light_desc); - ok(hr == D3D_OK, "Got unexpected hr %#x.\n", hr); + ok(hr == D3D_OK, "Got unexpected hr %#lx.\n", hr); hr = IDirect3DViewport2_DeleteLight(viewport, light); - ok(hr == D3D_OK, "Got unexpected hr %#x.\n", hr); + ok(hr == D3D_OK, "Got unexpected hr %#lx.\n", hr); light_desc.dwFlags = 0; hr = IDirect3DLight_GetLight(light, (D3DLIGHT *)&light_desc); - ok(hr == D3D_OK, "Got unexpected hr %#x.\n", hr); - ok(light_desc.dwFlags == D3DLIGHT_ACTIVE, "Got unexpected flags %#x.\n", light_desc.dwFlags); + ok(hr == D3D_OK, "Got unexpected hr %#lx.\n", hr); + ok(light_desc.dwFlags == D3DLIGHT_ACTIVE, "Got unexpected flags %#lx.\n", light_desc.dwFlags); hr = IDirect3DViewport2_AddLight(viewport, light); - ok(hr == D3D_OK, "Got unexpected hr %#x.\n", hr); + ok(hr == D3D_OK, "Got unexpected hr %#lx.\n", hr); for (i = 0; i < ARRAY_SIZE(tests); ++i) { hr = IDirect3DDevice2_SetTransform(device, D3DTRANSFORMSTATE_WORLD, tests[i].world_matrix); - ok(SUCCEEDED(hr), "Failed to set world transform, hr %#x.\n", hr); + ok(SUCCEEDED(hr), "Failed to set world transform, hr %#lx.\n", hr); hr = IDirect3DViewport2_Clear(viewport, 1, &clear_rect, D3DCLEAR_TARGET); - ok(SUCCEEDED(hr), "Failed to clear viewport, hr %#x.\n", hr); + ok(SUCCEEDED(hr), "Failed to clear viewport, hr %#lx.\n", hr); hr = IDirect3DDevice2_BeginScene(device); - ok(SUCCEEDED(hr), "Failed to begin scene, hr %#x.\n", hr); + ok(SUCCEEDED(hr), "Failed to begin scene, hr %#lx.\n", hr); hr = IDirect3DDevice2_DrawIndexedPrimitive(device, D3DPT_TRIANGLELIST, D3DVT_VERTEX, tests[i].quad, 4, indices, 6, 0); - ok(SUCCEEDED(hr), "Failed to draw, hr %#x.\n", hr); + ok(SUCCEEDED(hr), "Failed to draw, hr %#lx.\n", hr); hr = IDirect3DDevice2_EndScene(device); - ok(SUCCEEDED(hr), "Failed to end scene, hr %#x.\n", hr); + ok(SUCCEEDED(hr), "Failed to end scene, hr %#lx.\n", hr); color = get_surface_color(rt, 320, 240); ok(color == tests[i].expected, "%s has color 0x%08x.\n", tests[i].message, color); } hr = IDirect3DViewport2_DeleteLight(viewport, light); - ok(SUCCEEDED(hr), "Failed to remove a light from the viewport, hr %#x.\n", hr); + ok(SUCCEEDED(hr), "Failed to remove a light from the viewport, hr %#lx.\n", hr); IDirect3DLight_Release(light); destroy_material(material); destroy_viewport(device, viewport); IDirectDrawSurface2_Release(rt); refcount = IDirect3DDevice2_Release(device); - ok(!refcount, "Device has %u references left.\n", refcount); + ok(!refcount, "Device has %lu references left.\n", refcount); IDirect3D2_Release(d3d); refcount = IDirectDraw2_Release(ddraw); - ok(!refcount, "Ddraw object has %u references left.\n", refcount); + ok(!refcount, "Ddraw object has %lu references left.\n", refcount); DestroyWindow(window); } @@ -8156,8 +8143,7 @@ static void test_specular_lighting(void) }; static const struct expected_color { - unsigned int x, y; - D3DCOLOR color; + unsigned int x, y, color; } expected_directional_local[] = { @@ -8258,13 +8244,12 @@ static void test_specular_lighting(void) IDirectDrawSurface *rt; IDirect3DViewport2 *viewport; IDirect3DMaterial2 *material, *background_material; + unsigned int color, i, j, x, y; IDirect3DLight *light; D3DMATERIALHANDLE mat_handle; - D3DCOLOR color; ULONG refcount; HWND window; HRESULT hr; - unsigned int i, j, x, y; D3DVERTEX *quad; WORD *indices; @@ -8308,61 +8293,61 @@ static void test_specular_lighting(void) } hr = IDirect3DDevice2_GetDirect3D(device, &d3d); - ok(SUCCEEDED(hr), "Failed to get D3D interface, hr %#x.\n", hr); + ok(SUCCEEDED(hr), "Failed to get D3D interface, hr %#lx.\n", hr); hr = IDirect3DDevice2_GetRenderTarget(device, &rt); - ok(SUCCEEDED(hr), "Failed to get render target, hr %#x.\n", hr); + ok(SUCCEEDED(hr), "Failed to get render target, hr %#lx.\n", hr); viewport = create_viewport(device, 0, 0, 640, 480); hr = IDirect3DDevice2_SetCurrentViewport(device, viewport); - ok(SUCCEEDED(hr), "Failed to set current viewport, hr %#x.\n", hr); + ok(SUCCEEDED(hr), "Failed to set current viewport, hr %#lx.\n", hr); hr = IDirect3DDevice2_SetTransform(device, D3DTRANSFORMSTATE_WORLD, &mat); - ok(SUCCEEDED(hr), "Failed to set world transform, hr %#x.\n", hr); + ok(SUCCEEDED(hr), "Failed to set world transform, hr %#lx.\n", hr); hr = IDirect3DDevice2_SetTransform(device, D3DTRANSFORMSTATE_VIEW, &mat); - ok(SUCCEEDED(hr), "Failed to set view transform, hr %#x.\n", hr); + ok(SUCCEEDED(hr), "Failed to set view transform, hr %#lx.\n", hr); hr = IDirect3DDevice2_SetTransform(device, D3DTRANSFORMSTATE_PROJECTION, &mat); - ok(SUCCEEDED(hr), "Failed to set projection transform, hr %#x.\n", hr); + ok(SUCCEEDED(hr), "Failed to set projection transform, hr %#lx.\n", hr); hr = IDirect3DDevice2_SetRenderState(device, D3DRENDERSTATE_ZENABLE, FALSE); - ok(SUCCEEDED(hr), "Failed to disable z-buffering, hr %#x.\n", hr); + ok(SUCCEEDED(hr), "Failed to disable z-buffering, hr %#lx.\n", hr); hr = IDirect3DDevice2_SetRenderState(device, D3DRENDERSTATE_FOGENABLE, FALSE); - ok(SUCCEEDED(hr), "Failed to disable fog, hr %#x.\n", hr); + ok(SUCCEEDED(hr), "Failed to disable fog, hr %#lx.\n", hr); background_material = create_diffuse_material(device, 1.0f, 1.0f, 1.0f, 1.0f); viewport_set_background(device, viewport, background_material); hr = IDirect3D2_CreateLight(d3d, &light, NULL); - ok(SUCCEEDED(hr), "Failed to create a light object, hr %#x.\n", hr); + ok(SUCCEEDED(hr), "Failed to create a light object, hr %#lx.\n", hr); hr = IDirect3DViewport2_AddLight(viewport, light); - ok(SUCCEEDED(hr), "Failed to add a light to the viewport, hr %#x.\n", hr); + ok(SUCCEEDED(hr), "Failed to add a light to the viewport, hr %#lx.\n", hr); hr = IDirect3DDevice2_SetRenderState(device, D3DRENDERSTATE_SPECULARENABLE, TRUE); - ok(SUCCEEDED(hr), "Failed to enable specular lighting, hr %#x.\n", hr); + ok(SUCCEEDED(hr), "Failed to enable specular lighting, hr %#lx.\n", hr); for (i = 0; i < ARRAY_SIZE(tests); ++i) { tests[i].light->dwFlags = D3DLIGHT_ACTIVE; hr = IDirect3DLight_SetLight(light, (D3DLIGHT *)tests[i].light); - ok(SUCCEEDED(hr), "Failed to set light, hr %#x.\n", hr); + ok(SUCCEEDED(hr), "Failed to set light, hr %#lx.\n", hr); material = create_specular_material(device, 1.0f, 1.0f, 1.0f, 1.0f, tests[i].specular_power); hr = IDirect3DMaterial2_GetHandle(material, device, &mat_handle); - ok(SUCCEEDED(hr), "Failed to get material handle, hr %#x.\n", hr); + ok(SUCCEEDED(hr), "Failed to get material handle, hr %#lx.\n", hr); hr = IDirect3DDevice2_SetLightState(device, D3DLIGHTSTATE_MATERIAL, mat_handle); - ok(SUCCEEDED(hr), "Failed to set material state, hr %#x.\n", hr); + ok(SUCCEEDED(hr), "Failed to set material state, hr %#lx.\n", hr); hr = IDirect3DViewport2_Clear(viewport, 1, &clear_rect, D3DCLEAR_TARGET); - ok(SUCCEEDED(hr), "Failed to clear viewport, hr %#x.\n", hr); + ok(SUCCEEDED(hr), "Failed to clear viewport, hr %#lx.\n", hr); hr = IDirect3DDevice2_BeginScene(device); - ok(SUCCEEDED(hr), "Failed to begin scene, hr %#x.\n", hr); + ok(SUCCEEDED(hr), "Failed to begin scene, hr %#lx.\n", hr); hr = IDirect3DDevice2_DrawIndexedPrimitive(device, D3DPT_TRIANGLELIST, D3DVT_VERTEX, quad, vertices_side * vertices_side, indices, indices_count, 0); - ok(SUCCEEDED(hr), "Failed to draw, hr %#x.\n", hr); + ok(SUCCEEDED(hr), "Failed to draw, hr %#lx.\n", hr); hr = IDirect3DDevice2_EndScene(device); - ok(SUCCEEDED(hr), "Failed to end scene, hr %#x.\n", hr); + ok(SUCCEEDED(hr), "Failed to end scene, hr %#lx.\n", hr); for (j = 0; j < tests[i].expected_count; ++j) { @@ -8377,16 +8362,16 @@ static void test_specular_lighting(void) } hr = IDirect3DViewport2_DeleteLight(viewport, light); - ok(SUCCEEDED(hr), "Failed to remove a light from the viewport, hr %#x.\n", hr); + ok(SUCCEEDED(hr), "Failed to remove a light from the viewport, hr %#lx.\n", hr); IDirect3DLight_Release(light); destroy_material(background_material); destroy_viewport(device, viewport); IDirectDrawSurface2_Release(rt); refcount = IDirect3DDevice2_Release(device); - ok(!refcount, "Device has %u references left.\n", refcount); + ok(!refcount, "Device has %lu references left.\n", refcount); IDirect3D2_Release(d3d); refcount = IDirectDraw2_Release(ddraw); - ok(!refcount, "Ddraw object has %u references left.\n", refcount); + ok(!refcount, "Ddraw object has %lu references left.\n", refcount); DestroyWindow(window); HeapFree(GetProcessHeap(), 0, indices); HeapFree(GetProcessHeap(), 0, quad); @@ -8396,17 +8381,17 @@ static void test_palette_gdi(void) { IDirectDrawSurface *surface, *primary; DDSURFACEDESC surface_desc; + unsigned int color, i; IDirectDraw2 *ddraw; IDirectDrawPalette *palette, *palette2; ULONG refcount; HWND window; HRESULT hr; PALETTEENTRY palette_entries[256]; - UINT i; HDC dc; DDBLTFX fx; RECT r; - COLORREF color; + /* On the Windows 8 testbot palette index 0 of the onscreen palette is forced to * r = 0, g = 0, b = 0. Do not attempt to set it to something else as this is * not the point of this test. */ @@ -8434,7 +8419,7 @@ static void test_palette_gdi(void) ddraw = create_ddraw(); ok(!!ddraw, "Failed to create a ddraw object.\n"); hr = IDirectDraw2_SetCooperativeLevel(ddraw, window, DDSCL_NORMAL); - ok(SUCCEEDED(hr), "Failed to set cooperative level, hr %#x.\n", hr); + ok(SUCCEEDED(hr), "Failed to set cooperative level, hr %#lx.\n", hr); memset(&surface_desc, 0, sizeof(surface_desc)); surface_desc.dwSize = sizeof(surface_desc); @@ -8446,7 +8431,7 @@ static void test_palette_gdi(void) surface_desc.ddpfPixelFormat.dwFlags = DDPF_PALETTEINDEXED8 | DDPF_RGB; U1(surface_desc.ddpfPixelFormat).dwRGBBitCount = 8; hr = IDirectDraw2_CreateSurface(ddraw, &surface_desc, &surface, NULL); - ok(SUCCEEDED(hr), "Failed to create surface, hr %#x.\n", hr); + ok(SUCCEEDED(hr), "Failed to create surface, hr %#lx.\n", hr); /* Avoid colors from the Windows default palette. */ memset(palette_entries, 0, sizeof(palette_entries)); @@ -8458,7 +8443,7 @@ static void test_palette_gdi(void) palette_entries[4].peBlue = 0x15; hr = IDirectDraw2_CreatePalette(ddraw, DDPCAPS_8BIT | DDPCAPS_ALLOW256, palette_entries, &palette, NULL); - ok(SUCCEEDED(hr), "Failed to create palette, hr %#x.\n", hr); + ok(SUCCEEDED(hr), "Failed to create palette, hr %#lx.\n", hr); /* If there is no palette assigned and the display mode is not 8 bpp, some * drivers refuse to create a DC while others allow it. If a DC is created, @@ -8471,9 +8456,9 @@ static void test_palette_gdi(void) * contains uninitialized garbage. See comments below for the P8 case. */ hr = IDirectDrawSurface_SetPalette(surface, palette); - ok(SUCCEEDED(hr), "Failed to set palette, hr %#x.\n", hr); + ok(SUCCEEDED(hr), "Failed to set palette, hr %#lx.\n", hr); hr = IDirectDrawSurface_GetDC(surface, &dc); - ok(SUCCEEDED(hr), "Failed to get DC, hr %#x.\n", hr); + ok(SUCCEEDED(hr), "Failed to get DC, hr %#lx.\n", hr); ddraw_palette_handle = SelectPalette(dc, GetStockObject(DEFAULT_PALETTE), FALSE); ok(ddraw_palette_handle == GetStockObject(DEFAULT_PALETTE), "Got unexpected palette %p, expected %p.\n", @@ -8500,7 +8485,7 @@ static void test_palette_gdi(void) palette_entries[4].peGreen = 0x24; palette_entries[4].peBlue = 0x25; hr = IDirectDrawPalette_SetEntries(palette, 0, 4, 1, &palette_entries[4]); - ok(SUCCEEDED(hr), "Failed to set palette entries, hr %#x.\n", hr); + ok(SUCCEEDED(hr), "Failed to set palette entries, hr %#lx.\n", hr); i = GetDIBColorTable(dc, 4, 1, &rgbquad[4]); ok(i == 1, "Expected count 1, got %u.\n", i); @@ -8511,9 +8496,9 @@ static void test_palette_gdi(void) /* Neither does re-setting the palette. */ hr = IDirectDrawSurface_SetPalette(surface, NULL); - ok(SUCCEEDED(hr), "Failed to set palette, hr %#x.\n", hr); + ok(SUCCEEDED(hr), "Failed to set palette, hr %#lx.\n", hr); hr = IDirectDrawSurface_SetPalette(surface, palette); - ok(SUCCEEDED(hr), "Failed to set palette, hr %#x.\n", hr); + ok(SUCCEEDED(hr), "Failed to set palette, hr %#lx.\n", hr); i = GetDIBColorTable(dc, 4, 1, &rgbquad[4]); ok(i == 1, "Expected count 1, got %u.\n", i); @@ -8523,11 +8508,11 @@ static void test_palette_gdi(void) expected1[4].rgbRed, expected1[4].rgbGreen, expected1[4].rgbBlue); hr = IDirectDrawSurface_ReleaseDC(surface, dc); - ok(SUCCEEDED(hr), "Failed to release DC, hr %#x.\n", hr); + ok(SUCCEEDED(hr), "Failed to release DC, hr %#lx.\n", hr); /* Refresh the DC. This updates the palette. */ hr = IDirectDrawSurface_GetDC(surface, &dc); - ok(SUCCEEDED(hr), "Failed to get DC, hr %#x.\n", hr); + ok(SUCCEEDED(hr), "Failed to get DC, hr %#lx.\n", hr); i = GetDIBColorTable(dc, 0, ARRAY_SIZE(rgbquad), rgbquad); ok(i == ARRAY_SIZE(rgbquad), "Expected count 255, got %u.\n", i); for (i = 0; i < ARRAY_SIZE(expected2); i++) @@ -8544,13 +8529,13 @@ static void test_palette_gdi(void) i, rgbquad[i].rgbRed, rgbquad[i].rgbGreen, rgbquad[i].rgbBlue); } hr = IDirectDrawSurface_ReleaseDC(surface, dc); - ok(SUCCEEDED(hr), "Failed to release DC, hr %#x.\n", hr); + ok(SUCCEEDED(hr), "Failed to release DC, hr %#lx.\n", hr); refcount = IDirectDrawSurface_Release(surface); - ok(!refcount, "Got unexpected refcount %u.\n", refcount); + ok(!refcount, "Got unexpected refcount %lu.\n", refcount); hr = IDirectDraw2_SetCooperativeLevel(ddraw, window, DDSCL_FULLSCREEN | DDSCL_EXCLUSIVE); - ok(SUCCEEDED(hr), "Failed to set cooperative level, hr %#x.\n", hr); + ok(SUCCEEDED(hr), "Failed to set cooperative level, hr %#lx.\n", hr); if (FAILED(IDirectDraw2_SetDisplayMode(ddraw, 640, 480, 8, 0, 0))) { win_skip("Failed to set 8 bpp display mode, skipping test.\n"); @@ -8559,30 +8544,30 @@ static void test_palette_gdi(void) DestroyWindow(window); return; } - ok(SUCCEEDED(hr), "Failed to set display mode, hr %#x.\n", hr); + ok(SUCCEEDED(hr), "Failed to set display mode, hr %#lx.\n", hr); memset(&surface_desc, 0, sizeof(surface_desc)); surface_desc.dwSize = sizeof(surface_desc); surface_desc.dwFlags = DDSD_CAPS; surface_desc.ddsCaps.dwCaps = DDSCAPS_PRIMARYSURFACE; hr = IDirectDraw2_CreateSurface(ddraw, &surface_desc, &primary, NULL); - ok(SUCCEEDED(hr), "Failed to create surface, hr %#x.\n", hr); + ok(SUCCEEDED(hr), "Failed to create surface, hr %#lx.\n", hr); memset(&fx, 0, sizeof(fx)); fx.dwSize = sizeof(fx); U5(fx).dwFillColor = 3; SetRect(&r, 0, 0, 319, 479); hr = IDirectDrawSurface_Blt(primary, &r, NULL, NULL, DDBLT_COLORFILL | DDBLT_WAIT, &fx); - ok(SUCCEEDED(hr), "Failed to clear surface, hr %#x.\n", hr); + ok(SUCCEEDED(hr), "Failed to clear surface, hr %#lx.\n", hr); SetRect(&r, 320, 0, 639, 479); U5(fx).dwFillColor = 4; hr = IDirectDrawSurface_Blt(primary, &r, NULL, NULL, DDBLT_COLORFILL | DDBLT_WAIT, &fx); - ok(SUCCEEDED(hr), "Failed to clear surface, hr %#x.\n", hr); + ok(SUCCEEDED(hr), "Failed to clear surface, hr %#lx.\n", hr); hr = IDirectDrawSurface_SetPalette(primary, palette); - ok(SUCCEEDED(hr), "Failed to set palette, hr %#x.\n", hr); + ok(SUCCEEDED(hr), "Failed to set palette, hr %#lx.\n", hr); hr = IDirectDrawSurface_GetDC(primary, &dc); - ok(SUCCEEDED(hr), "Failed to get DC, hr %#x.\n", hr); + ok(SUCCEEDED(hr), "Failed to get DC, hr %#lx.\n", hr); color = GetPixel(dc, 160, 240); ok(color == 0x00030000, "Clear index 3: Got unexpected color 0x%08x.\n", color); @@ -8617,7 +8602,7 @@ static void test_palette_gdi(void) i, rgbquad[i].rgbRed, rgbquad[i].rgbGreen, rgbquad[i].rgbBlue); } hr = IDirectDrawSurface_ReleaseDC(primary, dc); - ok(SUCCEEDED(hr), "Failed to release DC, hr %#x.\n", hr); + ok(SUCCEEDED(hr), "Failed to release DC, hr %#lx.\n", hr); memset(&surface_desc, 0, sizeof(surface_desc)); surface_desc.dwSize = sizeof(surface_desc); @@ -8626,12 +8611,12 @@ static void test_palette_gdi(void) surface_desc.dwHeight = 16; surface_desc.ddsCaps.dwCaps = DDSCAPS_OFFSCREENPLAIN; hr = IDirectDraw2_CreateSurface(ddraw, &surface_desc, &surface, NULL); - ok(SUCCEEDED(hr), "Failed to create surface, hr %#x.\n", hr); + ok(SUCCEEDED(hr), "Failed to create surface, hr %#lx.\n", hr); /* Here the offscreen surface appears to use the primary's palette, * but in all likelihood it is actually the system palette. */ hr = IDirectDrawSurface_GetDC(surface, &dc); - ok(SUCCEEDED(hr), "Failed to get DC, hr %#x.\n", hr); + ok(SUCCEEDED(hr), "Failed to get DC, hr %#lx.\n", hr); i = GetDIBColorTable(dc, 0, ARRAY_SIZE(rgbquad), rgbquad); ok(i == ARRAY_SIZE(rgbquad), "Expected count 255, got %u.\n", i); for (i = 0; i < ARRAY_SIZE(expected2); i++) @@ -8648,7 +8633,7 @@ static void test_palette_gdi(void) i, rgbquad[i].rgbRed, rgbquad[i].rgbGreen, rgbquad[i].rgbBlue); } hr = IDirectDrawSurface_ReleaseDC(surface, dc); - ok(SUCCEEDED(hr), "Failed to release DC, hr %#x.\n", hr); + ok(SUCCEEDED(hr), "Failed to release DC, hr %#lx.\n", hr); /* On real hardware a change to the primary surface's palette applies immediately, * even on device contexts from offscreen surfaces that do not have their own @@ -8664,14 +8649,14 @@ static void test_palette_gdi(void) palette_entries[4].peBlue = 0x56; hr = IDirectDraw2_CreatePalette(ddraw, DDPCAPS_8BIT | DDPCAPS_ALLOW256, palette_entries, &palette2, NULL); - ok(SUCCEEDED(hr), "Failed to create palette, hr %#x.\n", hr); + ok(SUCCEEDED(hr), "Failed to create palette, hr %#lx.\n", hr); hr = IDirectDrawSurface_SetPalette(surface, palette2); - ok(SUCCEEDED(hr), "Failed to set palette, hr %#x.\n", hr); + ok(SUCCEEDED(hr), "Failed to set palette, hr %#lx.\n", hr); /* A palette assigned to the offscreen surface overrides the primary / system * palette. */ hr = IDirectDrawSurface_GetDC(surface, &dc); - ok(SUCCEEDED(hr), "Failed to get DC, hr %#x.\n", hr); + ok(SUCCEEDED(hr), "Failed to get DC, hr %#lx.\n", hr); i = GetDIBColorTable(dc, 0, ARRAY_SIZE(rgbquad), rgbquad); ok(i == ARRAY_SIZE(rgbquad), "Expected count 255, got %u.\n", i); for (i = 0; i < ARRAY_SIZE(expected3); i++) @@ -8688,24 +8673,24 @@ static void test_palette_gdi(void) i, rgbquad[i].rgbRed, rgbquad[i].rgbGreen, rgbquad[i].rgbBlue); } hr = IDirectDrawSurface_ReleaseDC(surface, dc); - ok(SUCCEEDED(hr), "Failed to release DC, hr %#x.\n", hr); + ok(SUCCEEDED(hr), "Failed to release DC, hr %#lx.\n", hr); refcount = IDirectDrawSurface_Release(surface); - ok(!refcount, "Got unexpected refcount %u.\n", refcount); + ok(!refcount, "Got unexpected refcount %lu.\n", refcount); /* The Windows 8 testbot keeps extra references to the primary and * backbuffer while in 8 bpp mode. */ hr = IDirectDraw2_RestoreDisplayMode(ddraw); - ok(SUCCEEDED(hr), "Failed to restore display mode, hr %#x.\n", hr); + ok(SUCCEEDED(hr), "Failed to restore display mode, hr %#lx.\n", hr); refcount = IDirectDrawSurface_Release(primary); - ok(!refcount, "Got unexpected refcount %u.\n", refcount); + ok(!refcount, "Got unexpected refcount %lu.\n", refcount); refcount = IDirectDrawPalette_Release(palette2); - ok(!refcount, "Got unexpected refcount %u.\n", refcount); + ok(!refcount, "Got unexpected refcount %lu.\n", refcount); refcount = IDirectDrawPalette_Release(palette); - ok(!refcount, "Got unexpected refcount %u.\n", refcount); + ok(!refcount, "Got unexpected refcount %lu.\n", refcount); refcount = IDirectDraw2_Release(ddraw); - ok(!refcount, "Got unexpected refcount %u.\n", refcount); + ok(!refcount, "Got unexpected refcount %lu.\n", refcount); DestroyWindow(window); } @@ -8745,18 +8730,18 @@ static void test_palette_alpha(void) return; } hr = IDirectDraw2_SetCooperativeLevel(ddraw, window, DDSCL_EXCLUSIVE | DDSCL_FULLSCREEN); - ok(SUCCEEDED(hr), "Failed to set cooperative level, hr %#x.\n", hr); + ok(SUCCEEDED(hr), "Failed to set cooperative level, hr %#lx.\n", hr); memset(palette_entries, 0, sizeof(palette_entries)); palette_entries[1].peFlags = 0x42; palette_entries[2].peFlags = 0xff; palette_entries[3].peFlags = 0x80; hr = IDirectDraw2_CreatePalette(ddraw, DDPCAPS_ALLOW256 | DDPCAPS_8BIT, palette_entries, &palette, NULL); - ok(SUCCEEDED(hr), "Failed to create palette, hr %#x.\n", hr); + ok(SUCCEEDED(hr), "Failed to create palette, hr %#lx.\n", hr); memset(palette_entries, 0x66, sizeof(palette_entries)); hr = IDirectDrawPalette_GetEntries(palette, 0, 1, 4, palette_entries); - ok(SUCCEEDED(hr), "Failed to get palette entries, hr %#x.\n", hr); + ok(SUCCEEDED(hr), "Failed to get palette entries, hr %#lx.\n", hr); ok(palette_entries[0].peFlags == 0x42, "Got unexpected peFlags 0x%02x, expected 0xff.\n", palette_entries[0].peFlags); ok(palette_entries[1].peFlags == 0xff, "Got unexpected peFlags 0x%02x, expected 0xff.\n", @@ -8775,11 +8760,11 @@ static void test_palette_alpha(void) palette_entries[3].peFlags = 0x80; hr = IDirectDraw2_CreatePalette(ddraw, DDPCAPS_ALLOW256 | DDPCAPS_8BIT | DDPCAPS_ALPHA, palette_entries, &palette, NULL); - ok(SUCCEEDED(hr), "Failed to create palette, hr %#x.\n", hr); + ok(SUCCEEDED(hr), "Failed to create palette, hr %#lx.\n", hr); memset(palette_entries, 0x66, sizeof(palette_entries)); hr = IDirectDrawPalette_GetEntries(palette, 0, 1, 4, palette_entries); - ok(SUCCEEDED(hr), "Failed to get palette entries, hr %#x.\n", hr); + ok(SUCCEEDED(hr), "Failed to get palette entries, hr %#lx.\n", hr); ok(palette_entries[0].peFlags == 0x42, "Got unexpected peFlags 0x%02x, expected 0xff.\n", palette_entries[0].peFlags); ok(palette_entries[1].peFlags == 0xff, "Got unexpected peFlags 0x%02x, expected 0xff.\n", @@ -8798,16 +8783,16 @@ static void test_palette_alpha(void) surface_desc.dwHeight = 128; surface_desc.ddsCaps.dwCaps = test_data[i].caps; hr = IDirectDraw2_CreateSurface(ddraw, &surface_desc, &surface1, NULL); - ok(SUCCEEDED(hr), "Failed to create %s surface, hr %#x.\n", test_data[i].name, hr); + ok(SUCCEEDED(hr), "Failed to create %s surface, hr %#lx.\n", test_data[i].name, hr); hr = IDirectDrawSurface_QueryInterface(surface1, &IID_IDirectDrawSurface2, (void **)&surface); - ok(SUCCEEDED(hr), "Failed to get IDirectDrawSurface2 interface, hr %#x.\n", hr); + ok(SUCCEEDED(hr), "Failed to get IDirectDrawSurface2 interface, hr %#lx.\n", hr); IDirectDrawSurface_Release(surface1); hr = IDirectDrawSurface2_SetPalette(surface, palette); if (test_data[i].attach_allowed) - ok(SUCCEEDED(hr), "Failed to attach palette to %s surface, hr %#x.\n", test_data[i].name, hr); + ok(SUCCEEDED(hr), "Failed to attach palette to %s surface, hr %#lx.\n", test_data[i].name, hr); else - ok(hr == DDERR_INVALIDSURFACETYPE, "Got unexpected hr %#x, %s surface.\n", hr, test_data[i].name); + ok(hr == DDERR_INVALIDSURFACETYPE, "Got unexpected hr %#lx, %s surface.\n", hr, test_data[i].name); if (SUCCEEDED(hr)) { @@ -8817,7 +8802,7 @@ static void test_palette_alpha(void) hr = IDirectDrawSurface2_GetDC(surface, &dc); ok(SUCCEEDED(hr) || broken(hr == DDERR_CANTCREATEDC) /* Win2k testbot */, - "Failed to get DC, hr %#x, %s surface.\n", hr, test_data[i].name); + "Failed to get DC, hr %#lx, %s surface.\n", hr, test_data[i].name); if (SUCCEEDED(hr)) { retval = GetDIBColorTable(dc, 1, 1, &rgbquad); @@ -8831,7 +8816,7 @@ static void test_palette_alpha(void) ok(rgbquad.rgbReserved == 0, "Expected rgbReserved = 0, got %u, %s surface.\n", rgbquad.rgbReserved, test_data[i].name); hr = IDirectDrawSurface2_ReleaseDC(surface, dc); - ok(SUCCEEDED(hr), "Failed to release DC, hr %#x.\n", hr); + ok(SUCCEEDED(hr), "Failed to release DC, hr %#lx.\n", hr); } } IDirectDrawSurface2_Release(surface); @@ -8851,24 +8836,24 @@ static void test_palette_alpha(void) U3(surface_desc.ddpfPixelFormat).dwGBitMask = 0x0000ff00; U4(surface_desc.ddpfPixelFormat).dwBBitMask = 0x000000ff; hr = IDirectDraw2_CreateSurface(ddraw, &surface_desc, &surface1, NULL); - ok(SUCCEEDED(hr), "Failed to create surface, hr %#x.\n", hr); + ok(SUCCEEDED(hr), "Failed to create surface, hr %#lx.\n", hr); hr = IDirectDrawSurface_QueryInterface(surface1, &IID_IDirectDrawSurface2, (void **)&surface); - ok(SUCCEEDED(hr), "Failed to get IDirectDrawSurface2 interface, hr %#x.\n", hr); + ok(SUCCEEDED(hr), "Failed to get IDirectDrawSurface2 interface, hr %#lx.\n", hr); IDirectDrawSurface_Release(surface1); hr = IDirectDrawSurface2_SetPalette(surface, palette); - ok(hr == DDERR_INVALIDSURFACETYPE, "Got unexpected hr %#x.\n", hr); + ok(hr == DDERR_INVALIDSURFACETYPE, "Got unexpected hr %#lx.\n", hr); IDirectDrawSurface2_Release(surface); /* The Windows 8 testbot keeps extra references to the primary * while in 8 bpp mode. */ hr = IDirectDraw2_RestoreDisplayMode(ddraw); - ok(SUCCEEDED(hr), "Failed to restore display mode, hr %#x.\n", hr); + ok(SUCCEEDED(hr), "Failed to restore display mode, hr %#lx.\n", hr); refcount = IDirectDrawPalette_Release(palette); - ok(!refcount, "Got unexpected refcount %u.\n", refcount); + ok(!refcount, "Got unexpected refcount %lu.\n", refcount); refcount = IDirectDraw2_Release(ddraw); - ok(!refcount, "Got unexpected refcount %u.\n", refcount); + ok(!refcount, "Got unexpected refcount %lu.\n", refcount); DestroyWindow(window); } @@ -8891,7 +8876,7 @@ static void test_lost_device(void) ddraw = create_ddraw(); ok(!!ddraw, "Failed to create a ddraw object.\n"); hr = IDirectDraw2_SetCooperativeLevel(ddraw, window1, DDSCL_EXCLUSIVE | DDSCL_FULLSCREEN); - ok(hr == DD_OK, "Got unexpected hr %#x.\n", hr); + ok(hr == DD_OK, "Got unexpected hr %#lx.\n", hr); memset(&surface_desc, 0, sizeof(surface_desc)); surface_desc.dwSize = sizeof(surface_desc); @@ -8899,7 +8884,7 @@ static void test_lost_device(void) surface_desc.ddsCaps.dwCaps = DDSCAPS_PRIMARYSURFACE | DDSCAPS_COMPLEX | DDSCAPS_FLIP; surface_desc.dwBackBufferCount = 1; hr = IDirectDraw2_CreateSurface(ddraw, &surface_desc, &surface, NULL); - ok(hr == DD_OK, "Got unexpected hr %#x.\n", hr); + ok(hr == DD_OK, "Got unexpected hr %#lx.\n", hr); memset(&surface_desc, 0, sizeof(surface_desc)); surface_desc.dwSize = sizeof(surface_desc); @@ -8908,7 +8893,7 @@ static void test_lost_device(void) surface_desc.dwWidth = 100; surface_desc.dwHeight = 100; hr = IDirectDraw2_CreateSurface(ddraw, &surface_desc, &sysmem_surface, NULL); - ok(hr == DD_OK, "Got unexpected hr %#x.\n", hr); + ok(hr == DD_OK, "Got unexpected hr %#lx.\n", hr); memset(&surface_desc, 0, sizeof(surface_desc)); surface_desc.dwSize = sizeof(surface_desc); @@ -8929,83 +8914,83 @@ static void test_lost_device(void) } hr = IDirectDrawSurface_IsLost(surface); - ok(hr == DD_OK, "Got unexpected hr %#x.\n", hr); + ok(hr == DD_OK, "Got unexpected hr %#lx.\n", hr); hr = IDirectDrawSurface_Flip(surface, NULL, DDFLIP_WAIT); - ok(hr == DD_OK, "Got unexpected hr %#x.\n", hr); + ok(hr == DD_OK, "Got unexpected hr %#lx.\n", hr); hr = IDirectDrawSurface_IsLost(sysmem_surface); - ok(hr == DD_OK, "Got unexpected hr %#x.\n", hr); + ok(hr == DD_OK, "Got unexpected hr %#lx.\n", hr); if (vidmem_surface) { hr = IDirectDrawSurface_IsLost(vidmem_surface); - ok(hr == DD_OK, "Got unexpected hr %#x.\n", hr); + ok(hr == DD_OK, "Got unexpected hr %#lx.\n", hr); } ret = SetForegroundWindow(GetDesktopWindow()); ok(ret, "Failed to set foreground window.\n"); hr = IDirectDrawSurface_IsLost(surface); - ok(hr == DDERR_SURFACELOST, "Got unexpected hr %#x.\n", hr); + ok(hr == DDERR_SURFACELOST, "Got unexpected hr %#lx.\n", hr); hr = IDirectDrawSurface_Flip(surface, NULL, DDFLIP_WAIT); - ok(hr == DDERR_SURFACELOST, "Got unexpected hr %#x.\n", hr); + ok(hr == DDERR_SURFACELOST, "Got unexpected hr %#lx.\n", hr); hr = IDirectDrawSurface_Restore(surface); - ok(hr == DDERR_WRONGMODE, "Got unexpected hr %#x.\n", hr); + ok(hr == DDERR_WRONGMODE, "Got unexpected hr %#lx.\n", hr); hr = IDirectDrawSurface_IsLost(surface); - ok(hr == DDERR_SURFACELOST, "Got unexpected hr %#x.\n", hr); + ok(hr == DDERR_SURFACELOST, "Got unexpected hr %#lx.\n", hr); hr = IDirectDrawSurface_IsLost(sysmem_surface); - ok(hr == DD_OK, "Got unexpected hr %#x.\n", hr); + ok(hr == DD_OK, "Got unexpected hr %#lx.\n", hr); hr = IDirectDrawSurface_Restore(sysmem_surface); - ok(hr == DD_OK, "Got unexpected hr %#x.\n", hr); + ok(hr == DD_OK, "Got unexpected hr %#lx.\n", hr); hr = IDirectDrawSurface_IsLost(sysmem_surface); - ok(hr == DD_OK, "Got unexpected hr %#x.\n", hr); + ok(hr == DD_OK, "Got unexpected hr %#lx.\n", hr); if (vidmem_surface) { hr = IDirectDrawSurface_IsLost(vidmem_surface); - ok(hr == DDERR_SURFACELOST, "Got unexpected hr %#x.\n", hr); + ok(hr == DDERR_SURFACELOST, "Got unexpected hr %#lx.\n", hr); hr = IDirectDrawSurface_Restore(vidmem_surface); - ok(hr == DDERR_WRONGMODE, "Got unexpected hr %#x.\n", hr); + ok(hr == DDERR_WRONGMODE, "Got unexpected hr %#lx.\n", hr); hr = IDirectDrawSurface_IsLost(vidmem_surface); - ok(hr == DDERR_SURFACELOST, "Got unexpected hr %#x.\n", hr); + ok(hr == DDERR_SURFACELOST, "Got unexpected hr %#lx.\n", hr); } ret = SetForegroundWindow(window1); ok(ret, "Failed to set foreground window.\n"); hr = IDirectDrawSurface_IsLost(surface); - ok(hr == DDERR_SURFACELOST, "Got unexpected hr %#x.\n", hr); + ok(hr == DDERR_SURFACELOST, "Got unexpected hr %#lx.\n", hr); hr = IDirectDrawSurface_Flip(surface, NULL, DDFLIP_WAIT); - ok(hr == DDERR_SURFACELOST, "Got unexpected hr %#x.\n", hr); + ok(hr == DDERR_SURFACELOST, "Got unexpected hr %#lx.\n", hr); hr = IDirectDrawSurface_IsLost(sysmem_surface); - ok(hr == DD_OK, "Got unexpected hr %#x.\n", hr); + ok(hr == DD_OK, "Got unexpected hr %#lx.\n", hr); if (vidmem_surface) { hr = IDirectDrawSurface_IsLost(vidmem_surface); - ok(hr == DDERR_SURFACELOST, "Got unexpected hr %#x.\n", hr); + ok(hr == DDERR_SURFACELOST, "Got unexpected hr %#lx.\n", hr); } hr = restore_surfaces(ddraw); - ok(hr == DD_OK, "Got unexpected hr %#x.\n", hr); + ok(hr == DD_OK, "Got unexpected hr %#lx.\n", hr); hr = IDirectDrawSurface_IsLost(surface); - ok(hr == DD_OK, "Got unexpected hr %#x.\n", hr); + ok(hr == DD_OK, "Got unexpected hr %#lx.\n", hr); hr = IDirectDrawSurface_Flip(surface, NULL, DDFLIP_WAIT); - ok(hr == DD_OK, "Got unexpected hr %#x.\n", hr); + ok(hr == DD_OK, "Got unexpected hr %#lx.\n", hr); hr = IDirectDrawSurface_IsLost(sysmem_surface); - ok(hr == DD_OK, "Got unexpected hr %#x.\n", hr); + ok(hr == DD_OK, "Got unexpected hr %#lx.\n", hr); if (vidmem_surface) { hr = IDirectDrawSurface_IsLost(vidmem_surface); - ok(hr == DD_OK, "Got unexpected hr %#x.\n", hr); + ok(hr == DD_OK, "Got unexpected hr %#lx.\n", hr); } hr = IDirectDraw2_SetCooperativeLevel(ddraw, window1, DDSCL_NORMAL); - ok(hr == DD_OK, "Got unexpected hr %#x.\n", hr); + ok(hr == DD_OK, "Got unexpected hr %#lx.\n", hr); hr = IDirectDrawSurface_IsLost(surface); - todo_wine ok(hr == DDERR_SURFACELOST, "Got unexpected hr %#x.\n", hr); + todo_wine ok(hr == DDERR_SURFACELOST, "Got unexpected hr %#lx.\n", hr); hr = IDirectDrawSurface_Flip(surface, NULL, DDFLIP_WAIT); - todo_wine ok(hr == DDERR_SURFACELOST, "Got unexpected hr %#x.\n", hr); + todo_wine ok(hr == DDERR_SURFACELOST, "Got unexpected hr %#lx.\n", hr); hr = IDirectDrawSurface_IsLost(sysmem_surface); - ok(hr == DD_OK, "Got unexpected hr %#x.\n", hr); + ok(hr == DD_OK, "Got unexpected hr %#lx.\n", hr); if (vidmem_surface) { hr = IDirectDrawSurface_IsLost(vidmem_surface); - todo_wine ok(hr == DDERR_SURFACELOST, "Got unexpected hr %#x.\n", hr); + todo_wine ok(hr == DDERR_SURFACELOST, "Got unexpected hr %#lx.\n", hr); } /* Trying to restore the primary will crash, probably because flippable @@ -9016,59 +9001,59 @@ static void test_lost_device(void) surface_desc.dwFlags = DDSD_CAPS; surface_desc.ddsCaps.dwCaps = DDSCAPS_PRIMARYSURFACE; hr = IDirectDraw2_CreateSurface(ddraw, &surface_desc, &surface, NULL); - ok(hr == DD_OK, "Got unexpected hr %#x.\n", hr); + ok(hr == DD_OK, "Got unexpected hr %#lx.\n", hr); hr = restore_surfaces(ddraw); - ok(hr == DD_OK, "Got unexpected hr %#x.\n", hr); + ok(hr == DD_OK, "Got unexpected hr %#lx.\n", hr); hr = IDirectDrawSurface_IsLost(surface); - ok(hr == DD_OK, "Got unexpected hr %#x.\n", hr); + ok(hr == DD_OK, "Got unexpected hr %#lx.\n", hr); ret = SetForegroundWindow(GetDesktopWindow()); ok(ret, "Failed to set foreground window.\n"); hr = IDirectDrawSurface_IsLost(surface); - ok(hr == DD_OK, "Got unexpected hr %#x.\n", hr); + ok(hr == DD_OK, "Got unexpected hr %#lx.\n", hr); hr = IDirectDrawSurface_IsLost(sysmem_surface); - ok(hr == DD_OK, "Got unexpected hr %#x.\n", hr); + ok(hr == DD_OK, "Got unexpected hr %#lx.\n", hr); if (vidmem_surface) { hr = IDirectDrawSurface_IsLost(vidmem_surface); - ok(hr == DD_OK, "Got unexpected hr %#x.\n", hr); + ok(hr == DD_OK, "Got unexpected hr %#lx.\n", hr); } ret = SetForegroundWindow(window1); ok(ret, "Failed to set foreground window.\n"); hr = IDirectDrawSurface_IsLost(surface); - ok(hr == DD_OK, "Got unexpected hr %#x.\n", hr); + ok(hr == DD_OK, "Got unexpected hr %#lx.\n", hr); hr = IDirectDrawSurface_IsLost(sysmem_surface); - ok(hr == DD_OK, "Got unexpected hr %#x.\n", hr); + ok(hr == DD_OK, "Got unexpected hr %#lx.\n", hr); if (vidmem_surface) { hr = IDirectDrawSurface_IsLost(vidmem_surface); - ok(hr == DD_OK, "Got unexpected hr %#x.\n", hr); + ok(hr == DD_OK, "Got unexpected hr %#lx.\n", hr); } hr = IDirectDraw2_SetCooperativeLevel(ddraw, window1, DDSCL_EXCLUSIVE | DDSCL_FULLSCREEN); - ok(hr == DD_OK, "Got unexpected hr %#x.\n", hr); + ok(hr == DD_OK, "Got unexpected hr %#lx.\n", hr); hr = IDirectDrawSurface_IsLost(surface); - ok(hr == DDERR_SURFACELOST, "Got unexpected hr %#x.\n", hr); + ok(hr == DDERR_SURFACELOST, "Got unexpected hr %#lx.\n", hr); hr = IDirectDrawSurface_IsLost(sysmem_surface); - ok(hr == DD_OK, "Got unexpected hr %#x.\n", hr); + ok(hr == DD_OK, "Got unexpected hr %#lx.\n", hr); if (vidmem_surface) { hr = IDirectDrawSurface_IsLost(vidmem_surface); - ok(hr == DDERR_SURFACELOST, "Got unexpected hr %#x.\n", hr); + ok(hr == DDERR_SURFACELOST, "Got unexpected hr %#lx.\n", hr); } hr = restore_surfaces(ddraw); - ok(hr == DD_OK, "Got unexpected hr %#x.\n", hr); + ok(hr == DD_OK, "Got unexpected hr %#lx.\n", hr); hr = IDirectDrawSurface_IsLost(surface); - ok(hr == DD_OK, "Got unexpected hr %#x.\n", hr); + ok(hr == DD_OK, "Got unexpected hr %#lx.\n", hr); hr = IDirectDrawSurface_IsLost(sysmem_surface); - ok(hr == DD_OK, "Got unexpected hr %#x.\n", hr); + ok(hr == DD_OK, "Got unexpected hr %#lx.\n", hr); if (vidmem_surface) { hr = IDirectDrawSurface_IsLost(vidmem_surface); - ok(hr == DD_OK, "Got unexpected hr %#x.\n", hr); + ok(hr == DD_OK, "Got unexpected hr %#lx.\n", hr); } IDirectDrawSurface_Release(surface); @@ -9078,103 +9063,103 @@ static void test_lost_device(void) surface_desc.ddsCaps.dwCaps = DDSCAPS_PRIMARYSURFACE | DDSCAPS_COMPLEX | DDSCAPS_FLIP; surface_desc.dwBackBufferCount = 1; hr = IDirectDraw2_CreateSurface(ddraw, &surface_desc, &surface, NULL); - ok(hr == DD_OK, "Got unexpected hr %#x.\n", hr); + ok(hr == DD_OK, "Got unexpected hr %#lx.\n", hr); hr = IDirectDraw2_SetCooperativeLevel(ddraw, window1, DDSCL_EXCLUSIVE | DDSCL_FULLSCREEN); - ok(hr == DD_OK, "Got unexpected hr %#x.\n", hr); + ok(hr == DD_OK, "Got unexpected hr %#lx.\n", hr); hr = IDirectDrawSurface_IsLost(surface); - ok(hr == DD_OK, "Got unexpected hr %#x.\n", hr); + ok(hr == DD_OK, "Got unexpected hr %#lx.\n", hr); hr = IDirectDrawSurface_Flip(surface, NULL, DDFLIP_WAIT); - ok(hr == DD_OK, "Got unexpected hr %#x.\n", hr); + ok(hr == DD_OK, "Got unexpected hr %#lx.\n", hr); hr = IDirectDrawSurface_IsLost(sysmem_surface); - ok(hr == DD_OK, "Got unexpected hr %#x.\n", hr); + ok(hr == DD_OK, "Got unexpected hr %#lx.\n", hr); if (vidmem_surface) { hr = IDirectDrawSurface_IsLost(vidmem_surface); - ok(hr == DD_OK, "Got unexpected hr %#x.\n", hr); + ok(hr == DD_OK, "Got unexpected hr %#lx.\n", hr); } hr = IDirectDraw2_SetCooperativeLevel(ddraw, window1, DDSCL_NORMAL | DDSCL_FULLSCREEN); - ok(hr == DD_OK, "Got unexpected hr %#x.\n", hr); + ok(hr == DD_OK, "Got unexpected hr %#lx.\n", hr); hr = IDirectDrawSurface_IsLost(surface); - ok(hr == DD_OK, "Got unexpected hr %#x.\n", hr); + ok(hr == DD_OK, "Got unexpected hr %#lx.\n", hr); hr = IDirectDrawSurface_Flip(surface, NULL, DDFLIP_WAIT); - ok(hr == DDERR_NOEXCLUSIVEMODE, "Got unexpected hr %#x.\n", hr); + ok(hr == DDERR_NOEXCLUSIVEMODE, "Got unexpected hr %#lx.\n", hr); hr = IDirectDrawSurface_IsLost(sysmem_surface); - ok(hr == DD_OK, "Got unexpected hr %#x.\n", hr); + ok(hr == DD_OK, "Got unexpected hr %#lx.\n", hr); if (vidmem_surface) { hr = IDirectDrawSurface_IsLost(vidmem_surface); - ok(hr == DD_OK, "Got unexpected hr %#x.\n", hr); + ok(hr == DD_OK, "Got unexpected hr %#lx.\n", hr); } hr = IDirectDraw2_SetCooperativeLevel(ddraw, window1, DDSCL_NORMAL); - ok(hr == DD_OK, "Got unexpected hr %#x.\n", hr); + ok(hr == DD_OK, "Got unexpected hr %#lx.\n", hr); hr = IDirectDrawSurface_IsLost(surface); - ok(hr == DD_OK, "Got unexpected hr %#x.\n", hr); + ok(hr == DD_OK, "Got unexpected hr %#lx.\n", hr); hr = IDirectDrawSurface_Flip(surface, NULL, DDFLIP_WAIT); - ok(hr == DDERR_NOEXCLUSIVEMODE, "Got unexpected hr %#x.\n", hr); + ok(hr == DDERR_NOEXCLUSIVEMODE, "Got unexpected hr %#lx.\n", hr); hr = IDirectDrawSurface_IsLost(sysmem_surface); - ok(hr == DD_OK, "Got unexpected hr %#x.\n", hr); + ok(hr == DD_OK, "Got unexpected hr %#lx.\n", hr); if (vidmem_surface) { hr = IDirectDrawSurface_IsLost(vidmem_surface); - ok(hr == DD_OK, "Got unexpected hr %#x.\n", hr); + ok(hr == DD_OK, "Got unexpected hr %#lx.\n", hr); } hr = IDirectDraw2_SetCooperativeLevel(ddraw, window2, DDSCL_NORMAL); - ok(hr == DD_OK, "Got unexpected hr %#x.\n", hr); + ok(hr == DD_OK, "Got unexpected hr %#lx.\n", hr); hr = IDirectDrawSurface_IsLost(surface); - ok(hr == DD_OK, "Got unexpected hr %#x.\n", hr); + ok(hr == DD_OK, "Got unexpected hr %#lx.\n", hr); hr = IDirectDrawSurface_Flip(surface, NULL, DDFLIP_WAIT); - ok(hr == DDERR_NOEXCLUSIVEMODE, "Got unexpected hr %#x.\n", hr); + ok(hr == DDERR_NOEXCLUSIVEMODE, "Got unexpected hr %#lx.\n", hr); hr = IDirectDrawSurface_IsLost(sysmem_surface); - ok(hr == DD_OK, "Got unexpected hr %#x.\n", hr); + ok(hr == DD_OK, "Got unexpected hr %#lx.\n", hr); if (vidmem_surface) { hr = IDirectDrawSurface_IsLost(vidmem_surface); - ok(hr == DD_OK, "Got unexpected hr %#x.\n", hr); + ok(hr == DD_OK, "Got unexpected hr %#lx.\n", hr); } hr = IDirectDraw2_SetCooperativeLevel(ddraw, window2, DDSCL_NORMAL | DDSCL_FULLSCREEN); - ok(hr == DD_OK, "Got unexpected hr %#x.\n", hr); + ok(hr == DD_OK, "Got unexpected hr %#lx.\n", hr); hr = IDirectDrawSurface_IsLost(surface); - ok(hr == DD_OK, "Got unexpected hr %#x.\n", hr); + ok(hr == DD_OK, "Got unexpected hr %#lx.\n", hr); hr = IDirectDrawSurface_Flip(surface, NULL, DDFLIP_WAIT); - ok(hr == DDERR_NOEXCLUSIVEMODE, "Got unexpected hr %#x.\n", hr); + ok(hr == DDERR_NOEXCLUSIVEMODE, "Got unexpected hr %#lx.\n", hr); hr = IDirectDrawSurface_IsLost(sysmem_surface); - ok(hr == DD_OK, "Got unexpected hr %#x.\n", hr); + ok(hr == DD_OK, "Got unexpected hr %#lx.\n", hr); if (vidmem_surface) { hr = IDirectDrawSurface_IsLost(vidmem_surface); - ok(hr == DD_OK, "Got unexpected hr %#x.\n", hr); + ok(hr == DD_OK, "Got unexpected hr %#lx.\n", hr); } hr = IDirectDraw2_SetCooperativeLevel(ddraw, window2, DDSCL_EXCLUSIVE | DDSCL_FULLSCREEN); - ok(hr == DD_OK, "Got unexpected hr %#x.\n", hr); + ok(hr == DD_OK, "Got unexpected hr %#lx.\n", hr); hr = IDirectDrawSurface_IsLost(surface); - ok(hr == DDERR_SURFACELOST, "Got unexpected hr %#x.\n", hr); + ok(hr == DDERR_SURFACELOST, "Got unexpected hr %#lx.\n", hr); hr = IDirectDrawSurface_Flip(surface, NULL, DDFLIP_WAIT); - ok(hr == DDERR_SURFACELOST, "Got unexpected hr %#x.\n", hr); + ok(hr == DDERR_SURFACELOST, "Got unexpected hr %#lx.\n", hr); hr = IDirectDrawSurface_IsLost(sysmem_surface); - ok(hr == DD_OK, "Got unexpected hr %#x.\n", hr); + ok(hr == DD_OK, "Got unexpected hr %#lx.\n", hr); if (vidmem_surface) { hr = IDirectDrawSurface_IsLost(vidmem_surface); - ok(hr == DDERR_SURFACELOST, "Got unexpected hr %#x.\n", hr); + ok(hr == DDERR_SURFACELOST, "Got unexpected hr %#lx.\n", hr); } memset(&caps, 0, sizeof(caps)); caps.dwCaps = DDSCAPS_FLIP; hr = IDirectDrawSurface_GetAttachedSurface(surface, &caps, &back_buffer); - ok(hr == DDERR_SURFACELOST, "Got unexpected hr %#x.\n", hr); + ok(hr == DDERR_SURFACELOST, "Got unexpected hr %#lx.\n", hr); hr = IDirectDrawSurface_Restore(surface); - ok(hr == DD_OK, "Got unexpected hr %#x.\n", hr); + ok(hr == DD_OK, "Got unexpected hr %#lx.\n", hr); hr = IDirectDrawSurface_GetAttachedSurface(surface, &caps, &back_buffer); - ok(hr == DD_OK, "Got unexpected hr %#x.\n", hr); + ok(hr == DD_OK, "Got unexpected hr %#lx.\n", hr); hr = IDirectDrawSurface_IsLost(back_buffer); - ok(hr == DD_OK, "Got unexpected hr %#x.\n", hr); + ok(hr == DD_OK, "Got unexpected hr %#lx.\n", hr); IDirectDrawSurface_Release(back_buffer); if (vidmem_surface) @@ -9182,7 +9167,7 @@ static void test_lost_device(void) IDirectDrawSurface_Release(sysmem_surface); IDirectDrawSurface_Release(surface); refcount = IDirectDraw2_Release(ddraw); - ok(!refcount, "Got unexpected refcount %u.\n", refcount); + ok(!refcount, "Got unexpected refcount %lu.\n", refcount); DestroyWindow(window2); DestroyWindow(window1); } @@ -9200,7 +9185,7 @@ static void test_surface_desc_lock(void) ddraw = create_ddraw(); ok(!!ddraw, "Failed to create a ddraw object.\n"); hr = IDirectDraw2_SetCooperativeLevel(ddraw, window, DDSCL_NORMAL); - ok(SUCCEEDED(hr), "Failed to set cooperative level, hr %#x.\n", hr); + ok(SUCCEEDED(hr), "Failed to set cooperative level, hr %#lx.\n", hr); memset(&surface_desc, 0, sizeof(surface_desc)); surface_desc.dwSize = sizeof(surface_desc); @@ -9209,36 +9194,36 @@ static void test_surface_desc_lock(void) surface_desc.dwHeight = 16; surface_desc.ddsCaps.dwCaps = DDSCAPS_OFFSCREENPLAIN; hr = IDirectDraw2_CreateSurface(ddraw, &surface_desc, &surface, NULL); - ok(SUCCEEDED(hr), "Failed to create surface, hr %#x.\n", hr); + ok(SUCCEEDED(hr), "Failed to create surface, hr %#lx.\n", hr); memset(&surface_desc, 0xaa, sizeof(surface_desc)); surface_desc.dwSize = sizeof(surface_desc); hr = IDirectDrawSurface_GetSurfaceDesc(surface, &surface_desc); - ok(SUCCEEDED(hr), "Failed to get surface desc, hr %#x.\n", hr); + ok(SUCCEEDED(hr), "Failed to get surface desc, hr %#lx.\n", hr); ok(!surface_desc.lpSurface, "Got unexpected lpSurface %p.\n", surface_desc.lpSurface); memset(&surface_desc, 0xaa, sizeof(surface_desc)); surface_desc.dwSize = sizeof(surface_desc); hr = IDirectDrawSurface_Lock(surface, NULL, &surface_desc, 0, NULL); - ok(SUCCEEDED(hr), "Failed to lock surface, hr %#x.\n", hr); + ok(SUCCEEDED(hr), "Failed to lock surface, hr %#lx.\n", hr); ok(surface_desc.lpSurface != NULL, "Got unexpected lpSurface %p.\n", surface_desc.lpSurface); memset(&surface_desc, 0xaa, sizeof(surface_desc)); surface_desc.dwSize = sizeof(surface_desc); hr = IDirectDrawSurface_GetSurfaceDesc(surface, &surface_desc); - ok(SUCCEEDED(hr), "Failed to get surface desc, hr %#x.\n", hr); + ok(SUCCEEDED(hr), "Failed to get surface desc, hr %#lx.\n", hr); ok(!surface_desc.lpSurface, "Got unexpected lpSurface %p.\n", surface_desc.lpSurface); hr = IDirectDrawSurface_Unlock(surface, NULL); - ok(SUCCEEDED(hr), "Failed to unlock surface, hr %#x.\n", hr); + ok(SUCCEEDED(hr), "Failed to unlock surface, hr %#lx.\n", hr); memset(&surface_desc, 0xaa, sizeof(surface_desc)); surface_desc.dwSize = sizeof(surface_desc); hr = IDirectDrawSurface_GetSurfaceDesc(surface, &surface_desc); - ok(SUCCEEDED(hr), "Failed to get surface desc, hr %#x.\n", hr); + ok(SUCCEEDED(hr), "Failed to get surface desc, hr %#lx.\n", hr); ok(!surface_desc.lpSurface, "Got unexpected lpSurface %p.\n", surface_desc.lpSurface); IDirectDrawSurface_Release(surface); refcount = IDirectDraw2_Release(ddraw); - ok(!refcount, "Got unexpected refcount %u.\n", refcount); + ok(!refcount, "Got unexpected refcount %lu.\n", refcount); DestroyWindow(window); } @@ -9253,13 +9238,13 @@ static void test_texturemapblend(void) IDirectDrawSurface *surface, *rt; IDirect3DTexture2 *texture; D3DTEXTUREHANDLE texture_handle; + unsigned int color; HWND window; IDirectDraw2 *ddraw; IDirect3DDevice2 *device; IDirect3DMaterial2 *material; IDirect3DViewport2 *viewport; ULONG ref; - D3DCOLOR color; static D3DTLVERTEX test1_quads[] = { @@ -9296,13 +9281,13 @@ static void test_texturemapblend(void) } hr = IDirect3DDevice2_GetRenderTarget(device, &rt); - ok(SUCCEEDED(hr), "Failed to get render target, hr %#x.\n", hr); + ok(SUCCEEDED(hr), "Failed to get render target, hr %#lx.\n", hr); material = create_diffuse_material(device, 0.0f, 0.0f, 0.0f, 1.0f); viewport = create_viewport(device, 0, 0, 640, 480); viewport_set_background(device, viewport, material); hr = IDirect3DDevice2_SetCurrentViewport(device, viewport); - ok(SUCCEEDED(hr), "Failed to set current viewport, hr %#x.\n", hr); + ok(SUCCEEDED(hr), "Failed to set current viewport, hr %#lx.\n", hr); /* Test alpha with DDPF_ALPHAPIXELS texture - should be taken from texture alpha channel. * @@ -9322,51 +9307,51 @@ static void test_texturemapblend(void) U4(ddsd.ddpfPixelFormat).dwBBitMask = 0x000000ff; U5(ddsd.ddpfPixelFormat).dwRGBAlphaBitMask = 0xff000000; hr = IDirectDraw2_CreateSurface(ddraw, &ddsd, &surface, NULL); - ok(SUCCEEDED(hr), "Failed to create surface, hr %#x.\n", hr); + ok(SUCCEEDED(hr), "Failed to create surface, hr %#lx.\n", hr); hr = IDirectDrawSurface_QueryInterface(surface, &IID_IDirect3DTexture2, (void **)&texture); - ok(SUCCEEDED(hr), "Failed to get texture interface, hr %#x.\n", hr); + ok(SUCCEEDED(hr), "Failed to get texture interface, hr %#lx.\n", hr); hr = IDirect3DTexture2_GetHandle(texture, device, &texture_handle); - ok(SUCCEEDED(hr), "Failed to get texture handle, hr %#x.\n", hr); + ok(SUCCEEDED(hr), "Failed to get texture handle, hr %#lx.\n", hr); hr = IDirect3DDevice2_SetRenderState(device, D3DRENDERSTATE_TEXTUREHANDLE, texture_handle); - ok(SUCCEEDED(hr), "Failed to set render state, hr %#x.\n", hr); + ok(SUCCEEDED(hr), "Failed to set render state, hr %#lx.\n", hr); hr = IDirect3DViewport2_Clear(viewport, 1, &clear_rect, D3DCLEAR_TARGET); - ok(SUCCEEDED(hr), "Failed to clear render target, hr %#x.\n", hr); + ok(SUCCEEDED(hr), "Failed to clear render target, hr %#lx.\n", hr); memset(&fx, 0, sizeof(fx)); fx.dwSize = sizeof(fx); U5(fx).dwFillColor = 0xff0000ff; hr = IDirectDrawSurface_Blt(surface, NULL, NULL, NULL, DDBLT_COLORFILL | DDBLT_WAIT, &fx); - ok(SUCCEEDED(hr), "Failed to clear texture, hr %#x.\n", hr); + ok(SUCCEEDED(hr), "Failed to clear texture, hr %#lx.\n", hr); U5(fx).dwFillColor = 0x800000ff; hr = IDirectDrawSurface_Blt(surface, &rect, NULL, NULL, DDBLT_COLORFILL | DDBLT_WAIT, &fx); - ok(SUCCEEDED(hr), "Failed to clear texture, hr %#x.\n", hr); + ok(SUCCEEDED(hr), "Failed to clear texture, hr %#lx.\n", hr); /* Note that the ddraw1 version of this test runs tests 1-3 with D3DRENDERSTATE_COLORKEYENABLE * enabled, whereas this version only runs test 4 with color keying on. Because no color key * is set on the texture this should not result in different behavior. */ hr = IDirect3DDevice2_SetRenderState(device, D3DRENDERSTATE_CULLMODE, D3DCULL_NONE); - ok(SUCCEEDED(hr), "Failed to set render state, hr %#x.\n", hr); + ok(SUCCEEDED(hr), "Failed to set render state, hr %#lx.\n", hr); hr = IDirect3DDevice2_SetRenderState(device, D3DRENDERSTATE_ZENABLE, D3DZB_FALSE); - ok(SUCCEEDED(hr), "Failed to set render state, hr %#x.\n", hr); + ok(SUCCEEDED(hr), "Failed to set render state, hr %#lx.\n", hr); hr = IDirect3DDevice2_SetRenderState(device, D3DRENDERSTATE_SRCBLEND, D3DBLEND_SRCALPHA); - ok(SUCCEEDED(hr), "Failed to set render state, hr %#x.\n", hr); + ok(SUCCEEDED(hr), "Failed to set render state, hr %#lx.\n", hr); hr = IDirect3DDevice2_SetRenderState(device, D3DRENDERSTATE_DESTBLEND, D3DBLEND_INVSRCALPHA); - ok(SUCCEEDED(hr), "Failed to set render state, hr %#x.\n", hr); + ok(SUCCEEDED(hr), "Failed to set render state, hr %#lx.\n", hr); hr = IDirect3DDevice2_SetRenderState(device, D3DRENDERSTATE_ALPHABLENDENABLE, TRUE); - ok(SUCCEEDED(hr), "Failed to set render state, hr %#x.\n", hr); + ok(SUCCEEDED(hr), "Failed to set render state, hr %#lx.\n", hr); hr = IDirect3DDevice2_SetRenderState(device, D3DRENDERSTATE_TEXTUREMAPBLEND, D3DTBLEND_MODULATE); - ok(SUCCEEDED(hr), "Failed to set render state, hr %#x.\n", hr); + ok(SUCCEEDED(hr), "Failed to set render state, hr %#lx.\n", hr); hr = IDirect3DDevice2_BeginScene(device); - ok(SUCCEEDED(hr), "Failed to begin scene, hr %#x.\n", hr); + ok(SUCCEEDED(hr), "Failed to begin scene, hr %#lx.\n", hr); hr = IDirect3DDevice2_DrawPrimitive(device, D3DPT_TRIANGLESTRIP, D3DVT_TLVERTEX, &test1_quads[0], 4, 0); - ok(SUCCEEDED(hr), "Failed to draw, hr %#x.\n", hr); + ok(SUCCEEDED(hr), "Failed to draw, hr %#lx.\n", hr); hr = IDirect3DDevice2_DrawPrimitive(device, D3DPT_TRIANGLESTRIP, D3DVT_TLVERTEX, &test1_quads[4], 4, 0); - ok(SUCCEEDED(hr), "Failed to draw, hr %#x.\n", hr); + ok(SUCCEEDED(hr), "Failed to draw, hr %#lx.\n", hr); hr = IDirect3DDevice2_EndScene(device); - ok(SUCCEEDED(hr), "Failed to end scene, hr %#x.\n", hr); + ok(SUCCEEDED(hr), "Failed to end scene, hr %#lx.\n", hr); color = get_surface_color(rt, 5, 5); ok(compare_color(color, 0x00000080, 2), "Got unexpected color 0x%08x.\n", color); @@ -9379,7 +9364,7 @@ static void test_texturemapblend(void) IDirect3DTexture2_Release(texture); ref = IDirectDrawSurface_Release(surface); - ok(ref == 0, "Surface not properly released, refcount %u.\n", ref); + ok(!ref, "Unexpected refcount %lu.\n", ref); /* Test alpha with texture that has no alpha channel - alpha should be taken from diffuse vertex color. */ memset(&ddsd, 0, sizeof(ddsd)); @@ -9396,33 +9381,33 @@ static void test_texturemapblend(void) U4(ddsd.ddpfPixelFormat).dwBBitMask = 0x000000ff; hr = IDirectDraw2_CreateSurface(ddraw, &ddsd, &surface, NULL); - ok(SUCCEEDED(hr), "Failed to create surface, hr %#x.\n", hr); + ok(SUCCEEDED(hr), "Failed to create surface, hr %#lx.\n", hr); hr = IDirectDrawSurface_QueryInterface(surface, &IID_IDirect3DTexture2, (void **)&texture); - ok(SUCCEEDED(hr), "Failed to get texture interface, hr %#x.\n", hr); + ok(SUCCEEDED(hr), "Failed to get texture interface, hr %#lx.\n", hr); hr = IDirect3DTexture2_GetHandle(texture, device, &texture_handle); - ok(SUCCEEDED(hr), "Failed to get texture handle, hr %#x.\n", hr); + ok(SUCCEEDED(hr), "Failed to get texture handle, hr %#lx.\n", hr); hr = IDirect3DDevice2_SetRenderState(device, D3DRENDERSTATE_TEXTUREHANDLE, texture_handle); - ok(SUCCEEDED(hr), "Failed to set render state, hr %#x.\n", hr); + ok(SUCCEEDED(hr), "Failed to set render state, hr %#lx.\n", hr); hr = IDirect3DViewport2_Clear(viewport, 1, &clear_rect, D3DCLEAR_TARGET); - ok(SUCCEEDED(hr), "Failed to clear render target, hr %#x.\n", hr); + ok(SUCCEEDED(hr), "Failed to clear render target, hr %#lx.\n", hr); U5(fx).dwFillColor = 0xff0000ff; hr = IDirectDrawSurface_Blt(surface, NULL, NULL, NULL, DDBLT_COLORFILL | DDBLT_WAIT, &fx); - ok(SUCCEEDED(hr), "Failed to clear texture, hr %#x.\n", hr); + ok(SUCCEEDED(hr), "Failed to clear texture, hr %#lx.\n", hr); U5(fx).dwFillColor = 0x800000ff; hr = IDirectDrawSurface_Blt(surface, &rect, NULL, NULL, DDBLT_COLORFILL | DDBLT_WAIT, &fx); - ok(SUCCEEDED(hr), "Failed to clear texture, hr %#x.\n", hr); + ok(SUCCEEDED(hr), "Failed to clear texture, hr %#lx.\n", hr); hr = IDirect3DDevice2_BeginScene(device); - ok(SUCCEEDED(hr), "Failed to begin scene, hr %#x.\n", hr); + ok(SUCCEEDED(hr), "Failed to begin scene, hr %#lx.\n", hr); hr = IDirect3DDevice2_DrawPrimitive(device, D3DPT_TRIANGLESTRIP, D3DVT_TLVERTEX, &test1_quads[0], 4, 0); - ok(SUCCEEDED(hr), "Failed to draw, hr %#x.\n", hr); + ok(SUCCEEDED(hr), "Failed to draw, hr %#lx.\n", hr); hr = IDirect3DDevice2_DrawPrimitive(device, D3DPT_TRIANGLESTRIP, D3DVT_TLVERTEX, &test1_quads[4], 4, 0); - ok(SUCCEEDED(hr), "Failed to draw, hr %#x.\n", hr); + ok(SUCCEEDED(hr), "Failed to draw, hr %#lx.\n", hr); hr = IDirect3DDevice2_EndScene(device); - ok(SUCCEEDED(hr), "Failed to end scene, hr %#x.\n", hr); + ok(SUCCEEDED(hr), "Failed to end scene, hr %#lx.\n", hr); color = get_surface_color(rt, 5, 5); ok(compare_color(color, 0x000000ff, 2), "Got unexpected color 0x%08x.\n", color); @@ -9435,7 +9420,7 @@ static void test_texturemapblend(void) IDirect3DTexture2_Release(texture); ref = IDirectDrawSurface_Release(surface); - ok(ref == 0, "Surface not properly released, refcount %u.\n", ref); + ok(!ref, "Unexpected refcount %lu.\n", ref); /* Test RGB - should multiply color components from diffuse vertex color and texture. */ memset(&ddsd, 0, sizeof(ddsd)); @@ -9452,36 +9437,36 @@ static void test_texturemapblend(void) U4(ddsd.ddpfPixelFormat).dwBBitMask = 0x000000ff; U5(ddsd.ddpfPixelFormat).dwRGBAlphaBitMask = 0xff000000; hr = IDirectDraw2_CreateSurface(ddraw, &ddsd, &surface, NULL); - ok(SUCCEEDED(hr), "Failed to create surface, hr %#x.\n", hr); + ok(SUCCEEDED(hr), "Failed to create surface, hr %#lx.\n", hr); hr = IDirectDrawSurface_QueryInterface(surface, &IID_IDirect3DTexture2, (void **)&texture); - ok(SUCCEEDED(hr), "Failed to get texture interface, hr %#x.\n", hr); + ok(SUCCEEDED(hr), "Failed to get texture interface, hr %#lx.\n", hr); hr = IDirect3DTexture2_GetHandle(texture, device, &texture_handle); - ok(SUCCEEDED(hr), "Failed to get texture handle, hr %#x.\n", hr); + ok(SUCCEEDED(hr), "Failed to get texture handle, hr %#lx.\n", hr); hr = IDirect3DDevice2_SetRenderState(device, D3DRENDERSTATE_TEXTUREHANDLE, texture_handle); - ok(SUCCEEDED(hr), "Failed to set render state, hr %#x.\n", hr); + ok(SUCCEEDED(hr), "Failed to set render state, hr %#lx.\n", hr); hr = IDirect3DViewport2_Clear(viewport, 1, &clear_rect, D3DCLEAR_TARGET); - ok(SUCCEEDED(hr), "Failed to clear render target, hr %#x.\n", hr); + ok(SUCCEEDED(hr), "Failed to clear render target, hr %#lx.\n", hr); U5(fx).dwFillColor = 0x00ffffff; hr = IDirectDrawSurface_Blt(surface, NULL, NULL, NULL, DDBLT_COLORFILL | DDBLT_WAIT, &fx); - ok(SUCCEEDED(hr), "Failed to clear texture, hr %#x.\n", hr); + ok(SUCCEEDED(hr), "Failed to clear texture, hr %#lx.\n", hr); U5(fx).dwFillColor = 0x00ffff80; hr = IDirectDrawSurface_Blt(surface, &rect, NULL, NULL, DDBLT_COLORFILL | DDBLT_WAIT, &fx); - ok(SUCCEEDED(hr), "Failed to clear texture, hr %#x.\n", hr); + ok(SUCCEEDED(hr), "Failed to clear texture, hr %#lx.\n", hr); hr = IDirect3DDevice2_SetRenderState(device, D3DRENDERSTATE_ALPHABLENDENABLE, FALSE); - ok(SUCCEEDED(hr), "Failed to set render state, hr %#x.\n", hr); + ok(SUCCEEDED(hr), "Failed to set render state, hr %#lx.\n", hr); hr = IDirect3DDevice2_BeginScene(device); - ok(SUCCEEDED(hr), "Failed to begin scene, hr %#x.\n", hr); + ok(SUCCEEDED(hr), "Failed to begin scene, hr %#lx.\n", hr); hr = IDirect3DDevice2_DrawPrimitive(device, D3DPT_TRIANGLESTRIP, D3DVT_TLVERTEX, &test2_quads[0], 4, 0); - ok(SUCCEEDED(hr), "Failed to draw, hr %#x.\n", hr); + ok(SUCCEEDED(hr), "Failed to draw, hr %#lx.\n", hr); hr = IDirect3DDevice2_DrawPrimitive(device, D3DPT_TRIANGLESTRIP, D3DVT_TLVERTEX, &test2_quads[4], 4, 0); - ok(SUCCEEDED(hr), "Failed to draw, hr %#x.\n", hr); + ok(SUCCEEDED(hr), "Failed to draw, hr %#lx.\n", hr); hr = IDirect3DDevice2_EndScene(device); - ok(SUCCEEDED(hr), "Failed to end scene, hr %#x.\n", hr); + ok(SUCCEEDED(hr), "Failed to end scene, hr %#lx.\n", hr); color = get_surface_color(rt, 5, 5); ok(compare_color(color, 0x00ff0040, 2), "Got unexpected color 0x%08x.\n", color); @@ -9494,7 +9479,7 @@ static void test_texturemapblend(void) IDirect3DTexture2_Release(texture); ref = IDirectDrawSurface_Release(surface); - ok(ref == 0, "Surface not properly released, refcount %u.\n", ref); + ok(!ref, "Unexpected refcount %lu.\n", ref); /* Test alpha again, now with color keyed texture (colorkey emulation in wine can interfere). */ memset(&ddsd, 0, sizeof(ddsd)); @@ -9511,43 +9496,43 @@ static void test_texturemapblend(void) U4(ddsd.ddpfPixelFormat).dwBBitMask = 0x001f; hr = IDirectDraw2_CreateSurface(ddraw, &ddsd, &surface, NULL); - ok(SUCCEEDED(hr), "Failed to create surface, hr %#x.\n", hr); + ok(SUCCEEDED(hr), "Failed to create surface, hr %#lx.\n", hr); hr = IDirectDrawSurface_QueryInterface(surface, &IID_IDirect3DTexture2, (void **)&texture); - ok(SUCCEEDED(hr), "Failed to get texture interface, hr %#x.\n", hr); + ok(SUCCEEDED(hr), "Failed to get texture interface, hr %#lx.\n", hr); hr = IDirect3DTexture2_GetHandle(texture, device, &texture_handle); - ok(SUCCEEDED(hr), "Failed to get texture handle, hr %#x.\n", hr); + ok(SUCCEEDED(hr), "Failed to get texture handle, hr %#lx.\n", hr); hr = IDirect3DDevice2_SetRenderState(device, D3DRENDERSTATE_TEXTUREHANDLE, texture_handle); - ok(SUCCEEDED(hr), "Failed to set render state, hr %#x.\n", hr); + ok(SUCCEEDED(hr), "Failed to set render state, hr %#lx.\n", hr); hr = IDirect3DViewport2_Clear(viewport, 1, &clear_rect, D3DCLEAR_TARGET); - ok(SUCCEEDED(hr), "Failed to clear render target, hr %#x.\n", hr); + ok(SUCCEEDED(hr), "Failed to clear render target, hr %#lx.\n", hr); U5(fx).dwFillColor = 0xf800; hr = IDirectDrawSurface_Blt(surface, NULL, NULL, NULL, DDBLT_COLORFILL | DDBLT_WAIT, &fx); - ok(SUCCEEDED(hr), "Failed to clear texture, hr %#x.\n", hr); + ok(SUCCEEDED(hr), "Failed to clear texture, hr %#lx.\n", hr); U5(fx).dwFillColor = 0x001f; hr = IDirectDrawSurface_Blt(surface, &rect, NULL, NULL, DDBLT_COLORFILL | DDBLT_WAIT, &fx); - ok(SUCCEEDED(hr), "Failed to clear texture, hr %#x.\n", hr); + ok(SUCCEEDED(hr), "Failed to clear texture, hr %#lx.\n", hr); ckey.dwColorSpaceLowValue = 0x001f; ckey.dwColorSpaceHighValue = 0x001f; hr = IDirectDrawSurface_SetColorKey(surface, DDCKEY_SRCBLT, &ckey); - ok(SUCCEEDED(hr), "Failed to set color key, hr %#x.\n", hr); + ok(SUCCEEDED(hr), "Failed to set color key, hr %#lx.\n", hr); hr = IDirect3DDevice2_SetRenderState(device, D3DRENDERSTATE_ALPHABLENDENABLE, TRUE); - ok(SUCCEEDED(hr), "Failed to set render state, hr %#x.\n", hr); + ok(SUCCEEDED(hr), "Failed to set render state, hr %#lx.\n", hr); hr = IDirect3DDevice2_SetRenderState(device, D3DRENDERSTATE_COLORKEYENABLE, TRUE); - ok(SUCCEEDED(hr), "Failed to set render state, hr %#x.\n", hr); + ok(SUCCEEDED(hr), "Failed to set render state, hr %#lx.\n", hr); hr = IDirect3DDevice2_BeginScene(device); - ok(SUCCEEDED(hr), "Failed to begin scene, hr %#x.\n", hr); + ok(SUCCEEDED(hr), "Failed to begin scene, hr %#lx.\n", hr); hr = IDirect3DDevice2_DrawPrimitive(device, D3DPT_TRIANGLESTRIP, D3DVT_TLVERTEX, &test1_quads[0], 4, 0); - ok(SUCCEEDED(hr), "Failed to draw, hr %#x.\n", hr); + ok(SUCCEEDED(hr), "Failed to draw, hr %#lx.\n", hr); hr = IDirect3DDevice2_DrawPrimitive(device, D3DPT_TRIANGLESTRIP, D3DVT_TLVERTEX, &test1_quads[4], 4, 0); - ok(SUCCEEDED(hr), "Failed to draw, hr %#x.\n", hr); + ok(SUCCEEDED(hr), "Failed to draw, hr %#lx.\n", hr); hr = IDirect3DDevice2_EndScene(device); - ok(SUCCEEDED(hr), "Failed to end scene, hr %#x.\n", hr); + ok(SUCCEEDED(hr), "Failed to end scene, hr %#lx.\n", hr); color = get_surface_color(rt, 5, 5); ok(compare_color(color, 0x00000000, 2), "Got unexpected color 0x%08x.\n", color); @@ -9560,15 +9545,15 @@ static void test_texturemapblend(void) IDirect3DTexture2_Release(texture); ref = IDirectDrawSurface_Release(surface); - ok(ref == 0, "Surface not properly released, refcount %u.\n", ref); + ok(!ref, "Unexpected refcount %lu.\n", ref); destroy_viewport(device, viewport); ref = IDirect3DMaterial2_Release(material); - ok(ref == 0, "Material not properly released, refcount %u.\n", ref); + ok(!ref, "Unexpected refcount %lu.\n", ref); IDirectDrawSurface_Release(rt); IDirect3DDevice2_Release(device); ref = IDirectDraw2_Release(ddraw); - ok(ref == 0, "Ddraw object not properly released, refcount %u.\n", ref); + ok(!ref, "Unexpected refcount %lu.\n", ref); DestroyWindow(window); } @@ -9578,13 +9563,13 @@ static void test_viewport_clear_rect(void) static D3DRECT clear_rect = {{0}, {0}, {640}, {480}}; static D3DRECT clear_rect2 = {{90}, {90}, {110}, {110}}; IDirectDrawSurface *rt; + unsigned int color; HWND window; IDirectDraw2 *ddraw; IDirect3DDevice2 *device; IDirect3DMaterial2 *red, *green; IDirect3DViewport2 *viewport, *viewport2; ULONG ref; - D3DCOLOR color; window = create_window(); ddraw = create_ddraw(); @@ -9598,19 +9583,19 @@ static void test_viewport_clear_rect(void) } hr = IDirect3DDevice2_GetRenderTarget(device, &rt); - ok(SUCCEEDED(hr), "Failed to get render target, hr %#x.\n", hr); + ok(SUCCEEDED(hr), "Failed to get render target, hr %#lx.\n", hr); red = create_diffuse_material(device, 1.0f, 0.0f, 0.0f, 1.0f); viewport = create_viewport(device, 0, 0, 640, 480); viewport_set_background(device, viewport, red); hr = IDirect3DViewport2_Clear(viewport, 1, &clear_rect, D3DCLEAR_TARGET); - ok(SUCCEEDED(hr), "Failed to clear viewport, hr %#x.\n", hr); + ok(SUCCEEDED(hr), "Failed to clear viewport, hr %#lx.\n", hr); green = create_diffuse_material(device, 0.0f, 1.0f, 0.0f, 1.0f); viewport2 = create_viewport(device, 100, 100, 20, 20); viewport_set_background(device, viewport2, green); hr = IDirect3DViewport2_Clear(viewport2, 1, &clear_rect2, D3DCLEAR_TARGET); - ok(SUCCEEDED(hr), "Failed to clear viewport, hr %#x.\n", hr); + ok(SUCCEEDED(hr), "Failed to clear viewport, hr %#lx.\n", hr); color = get_surface_color(rt, 85, 85); /* Outside both. */ ok(compare_color(color, 0x00ff0000, 1), "Got unexpected color 0x%08x.\n", color); @@ -9632,7 +9617,7 @@ static void test_viewport_clear_rect(void) IDirectDrawSurface_Release(rt); IDirect3DDevice2_Release(device); ref = IDirectDraw2_Release(ddraw); - ok(ref == 0, "Ddraw object not properly released, refcount %u.\n", ref); + ok(!ref, "Unexpected refcount %lu.\n", ref); DestroyWindow(window); } @@ -9643,13 +9628,12 @@ static void test_color_fill(void) IDirectDraw2 *ddraw; IDirectDrawSurface *surface, *surface2; DDSURFACEDESC surface_desc; + unsigned int i, *color; ULONG refcount; BOOL is_warp; HWND window; - unsigned int i; DDBLTFX fx; RECT rect = {5, 5, 7, 7}; - DWORD *color; DWORD num_fourcc_codes, *fourcc_codes; DDCAPS hal_caps; BOOL support_uyvy = FALSE, support_yuy2 = FALSE; @@ -9659,7 +9643,7 @@ static void test_color_fill(void) HRESULT colorfill_hr, depthfill_hr; BOOL rop_success; const char *name; - DWORD result; + unsigned int result; BOOL check_result; DDPIXELFORMAT format; } @@ -9814,13 +9798,13 @@ static void test_color_fill(void) } hr = IDirectDraw2_GetFourCCCodes(ddraw, &num_fourcc_codes, NULL); - ok(SUCCEEDED(hr), "Failed to get fourcc codes %#x.\n", hr); + ok(SUCCEEDED(hr), "Got hr %#lx.\n", hr); fourcc_codes = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, num_fourcc_codes * sizeof(*fourcc_codes)); if (!fourcc_codes) goto done; hr = IDirectDraw2_GetFourCCCodes(ddraw, &num_fourcc_codes, fourcc_codes); - ok(SUCCEEDED(hr), "Failed to get fourcc codes %#x.\n", hr); + ok(SUCCEEDED(hr), "Got hr %#lx.\n", hr); for (i = 0; i < num_fourcc_codes; i++) { if (fourcc_codes[i] == MAKEFOURCC('Y', 'U', 'Y', '2')) @@ -9833,7 +9817,7 @@ static void test_color_fill(void) memset(&hal_caps, 0, sizeof(hal_caps)); hal_caps.dwSize = sizeof(hal_caps); hr = IDirectDraw2_GetCaps(ddraw, &hal_caps, NULL); - ok(SUCCEEDED(hr), "Failed to get caps, hr %#x.\n", hr); + ok(SUCCEEDED(hr), "Failed to get caps, hr %#lx.\n", hr); if ((!support_yuy2 && !support_uyvy) || !(hal_caps.dwCaps & DDCAPS_OVERLAY)) skip("Overlays or some YUV formats not supported, skipping YUV colorfill tests.\n"); @@ -9841,7 +9825,7 @@ static void test_color_fill(void) for (i = 0; i < ARRAY_SIZE(tests); i++) { DWORD expected_broken = tests[i].result; - DWORD mask = 0xffffffffu; + unsigned int mask = 0xffffffffu; /* Some Windows drivers modify dwFillColor when it is used on P8 or FourCC formats. */ memset(&fx, 0, sizeof(fx)); @@ -9860,7 +9844,7 @@ static void test_color_fill(void) { struct format_support_check check = {&tests[i].format, FALSE}; hr = IDirect3DDevice2_EnumTextureFormats(device, test_unsupported_formats_cb, &check); - ok(SUCCEEDED(hr), "Failed to enumerate texture formats %#x.\n", hr); + ok(SUCCEEDED(hr), "Got hr %#lx.\n", hr); if (!check.supported) continue; } @@ -9895,16 +9879,16 @@ static void test_color_fill(void) } hr = IDirectDraw2_CreateSurface(ddraw, &surface_desc, &surface, NULL); - ok(SUCCEEDED(hr), "Failed to create surface, hr %#x, surface %s.\n", hr, tests[i].name); + ok(SUCCEEDED(hr), "Failed to create surface, hr %#lx, surface %s.\n", hr, tests[i].name); hr = IDirectDrawSurface_Blt(surface, NULL, NULL, NULL, DDBLT_COLORFILL | DDBLT_WAIT, &fx); todo_wine_if (tests[i].format.dwFourCC) - ok(hr == tests[i].colorfill_hr, "Blt returned %#x, expected %#x, surface %s.\n", + ok(hr == tests[i].colorfill_hr, "Blt returned %#lx, expected %#lx, surface %s.\n", hr, tests[i].colorfill_hr, tests[i].name); hr = IDirectDrawSurface_Blt(surface, &rect, NULL, NULL, DDBLT_COLORFILL | DDBLT_WAIT, &fx); todo_wine_if (tests[i].format.dwFourCC) - ok(hr == tests[i].colorfill_hr, "Blt returned %#x, expected %#x, surface %s.\n", + ok(hr == tests[i].colorfill_hr, "Blt returned %#lx, expected %#lx, surface %s.\n", hr, tests[i].colorfill_hr, tests[i].name); if (SUCCEEDED(hr) && tests[i].check_result) @@ -9912,19 +9896,19 @@ static void test_color_fill(void) memset(&surface_desc, 0, sizeof(surface_desc)); surface_desc.dwSize = sizeof(surface_desc); hr = IDirectDrawSurface_Lock(surface, NULL, &surface_desc, DDLOCK_READONLY, 0); - ok(SUCCEEDED(hr), "Failed to lock surface, hr %#x, surface %s.\n", hr, tests[i].name); + ok(SUCCEEDED(hr), "Failed to lock surface, hr %#lx, surface %s.\n", hr, tests[i].name); color = surface_desc.lpSurface; ok(*color == tests[i].result, "Got clear result 0x%08x, expected 0x%08x, surface %s.\n", *color, tests[i].result, tests[i].name); hr = IDirectDrawSurface_Unlock(surface, NULL); - ok(SUCCEEDED(hr), "Failed to unlock surface, hr %#x, surface %s.\n", hr, tests[i].name); + ok(SUCCEEDED(hr), "Failed to unlock surface, hr %#lx, surface %s.\n", hr, tests[i].name); } hr = IDirectDrawSurface_Blt(surface, NULL, NULL, NULL, DDBLT_DEPTHFILL | DDBLT_WAIT, &fx); - ok(hr == tests[i].depthfill_hr, "Blt returned %#x, expected %#x, surface %s.\n", + ok(hr == tests[i].depthfill_hr, "Blt returned %#lx, expected %#lx, surface %s.\n", hr, tests[i].depthfill_hr, tests[i].name); hr = IDirectDrawSurface_Blt(surface, &rect, NULL, NULL, DDBLT_DEPTHFILL | DDBLT_WAIT, &fx); - ok(hr == tests[i].depthfill_hr, "Blt returned %#x, expected %#x, surface %s.\n", + ok(hr == tests[i].depthfill_hr, "Blt returned %#lx, expected %#lx, surface %s.\n", hr, tests[i].depthfill_hr, tests[i].name); if (SUCCEEDED(hr) && tests[i].check_result) @@ -9932,7 +9916,7 @@ static void test_color_fill(void) memset(&surface_desc, 0, sizeof(surface_desc)); surface_desc.dwSize = sizeof(surface_desc); hr = IDirectDrawSurface_Lock(surface, NULL, &surface_desc, DDLOCK_READONLY, 0); - ok(SUCCEEDED(hr), "Failed to lock surface, hr %#x, surface %s.\n", hr, tests[i].name); + ok(SUCCEEDED(hr), "Failed to lock surface, hr %#lx, surface %s.\n", hr, tests[i].name); color = surface_desc.lpSurface; todo_wine_if(tests[i].caps & DDSCAPS_VIDEOMEMORY && U2(surface_desc).dwZBufferBitDepth != 16) ok((*color & mask) == (tests[i].result & mask) || broken((*color & mask) == (expected_broken & mask)) @@ -9940,15 +9924,15 @@ static void test_color_fill(void) "Got clear result 0x%08x, expected 0x%08x, surface %s.\n", *color & mask, tests[i].result & mask, tests[i].name); hr = IDirectDrawSurface_Unlock(surface, NULL); - ok(SUCCEEDED(hr), "Failed to unlock surface, hr %#x, surface %s.\n", hr, tests[i].name); + ok(SUCCEEDED(hr), "Failed to unlock surface, hr %#lx, surface %s.\n", hr, tests[i].name); } U5(fx).dwFillColor = 0xdeadbeef; fx.dwROP = BLACKNESS; hr = IDirectDrawSurface_Blt(surface, NULL, NULL, NULL, DDBLT_ROP | DDBLT_WAIT, &fx); - ok(FAILED(hr) == !tests[i].rop_success, "Blt returned %#x, expected %s, surface %s.\n", + ok(FAILED(hr) == !tests[i].rop_success, "Blt returned %#lx, expected %s, surface %s.\n", hr, tests[i].rop_success ? "success" : "failure", tests[i].name); - ok(U5(fx).dwFillColor == 0xdeadbeef, "dwFillColor was set to 0x%08x, surface %s\n", + ok(U5(fx).dwFillColor == 0xdeadbeef, "dwFillColor was set to 0x%08lx, surface %s\n", U5(fx).dwFillColor, tests[i].name); if (SUCCEEDED(hr) && tests[i].check_result) @@ -9956,19 +9940,19 @@ static void test_color_fill(void) memset(&surface_desc, 0, sizeof(surface_desc)); surface_desc.dwSize = sizeof(surface_desc); hr = IDirectDrawSurface_Lock(surface, NULL, &surface_desc, DDLOCK_READONLY, 0); - ok(SUCCEEDED(hr), "Failed to lock surface, hr %#x, surface %s.\n", hr, tests[i].name); + ok(SUCCEEDED(hr), "Failed to lock surface, hr %#lx, surface %s.\n", hr, tests[i].name); color = surface_desc.lpSurface; ok(*color == 0, "Got clear result 0x%08x, expected 0x00000000, surface %s.\n", *color, tests[i].name); hr = IDirectDrawSurface_Unlock(surface, NULL); - ok(SUCCEEDED(hr), "Failed to unlock surface, hr %#x, surface %s.\n", hr, tests[i].name); + ok(SUCCEEDED(hr), "Failed to unlock surface, hr %#lx, surface %s.\n", hr, tests[i].name); } fx.dwROP = WHITENESS; hr = IDirectDrawSurface_Blt(surface, NULL, NULL, NULL, DDBLT_ROP | DDBLT_WAIT, &fx); - ok(FAILED(hr) == !tests[i].rop_success, "Blt returned %#x, expected %s, surface %s.\n", + ok(FAILED(hr) == !tests[i].rop_success, "Blt returned %#lx, expected %s, surface %s.\n", hr, tests[i].rop_success ? "success" : "failure", tests[i].name); - ok(U5(fx).dwFillColor == 0xdeadbeef, "dwFillColor was set to 0x%08x, surface %s\n", + ok(U5(fx).dwFillColor == 0xdeadbeef, "dwFillColor was set to 0x%08lx, surface %s\n", U5(fx).dwFillColor, tests[i].name); if (SUCCEEDED(hr) && tests[i].check_result) @@ -9976,13 +9960,13 @@ static void test_color_fill(void) memset(&surface_desc, 0, sizeof(surface_desc)); surface_desc.dwSize = sizeof(surface_desc); hr = IDirectDrawSurface_Lock(surface, NULL, &surface_desc, DDLOCK_READONLY, 0); - ok(SUCCEEDED(hr), "Failed to lock surface, hr %#x, surface %s.\n", hr, tests[i].name); + ok(SUCCEEDED(hr), "Failed to lock surface, hr %#lx, surface %s.\n", hr, tests[i].name); color = surface_desc.lpSurface; /* WHITENESS sets the alpha channel to 0x00. Ignore this for now. */ ok((*color & 0x00ffffff) == 0x00ffffff, "Got clear result 0x%08x, expected 0xffffffff, surface %s.\n", *color, tests[i].name); hr = IDirectDrawSurface_Unlock(surface, NULL); - ok(SUCCEEDED(hr), "Failed to unlock surface, hr %#x, surface %s.\n", hr, tests[i].name); + ok(SUCCEEDED(hr), "Failed to unlock surface, hr %#lx, surface %s.\n", hr, tests[i].name); } IDirectDrawSurface_Release(surface); @@ -10006,78 +9990,78 @@ static void test_color_fill(void) U4(surface_desc.ddpfPixelFormat).dwBBitMask = 0x000000ff; surface_desc.ddsCaps.dwCaps = DDSCAPS_OFFSCREENPLAIN | DDSCAPS_SYSTEMMEMORY; hr = IDirectDraw2_CreateSurface(ddraw, &surface_desc, &surface, NULL); - ok(SUCCEEDED(hr), "Failed to create surface, hr %#x.\n", hr); + ok(SUCCEEDED(hr), "Failed to create surface, hr %#lx.\n", hr); hr = IDirectDraw2_CreateSurface(ddraw, &surface_desc, &surface2, NULL); - ok(SUCCEEDED(hr), "Failed to create surface, hr %#x.\n", hr); + ok(SUCCEEDED(hr), "Failed to create surface, hr %#lx.\n", hr); /* No DDBLTFX. */ hr = IDirectDrawSurface_Blt(surface, NULL, NULL, &rect, DDBLT_COLORFILL | DDBLT_WAIT, NULL); - ok(hr == DDERR_INVALIDPARAMS, "Got unexpected hr %#x.\n", hr); + ok(hr == DDERR_INVALIDPARAMS, "Got unexpected hr %#lx.\n", hr); hr = IDirectDrawSurface_Blt(surface, NULL, NULL, &rect, DDBLT_ROP | DDBLT_WAIT, NULL); - ok(hr == DDERR_INVALIDPARAMS, "Got unexpected hr %#x.\n", hr); + ok(hr == DDERR_INVALIDPARAMS, "Got unexpected hr %#lx.\n", hr); /* Unused source rectangle. */ hr = IDirectDrawSurface_Blt(surface, NULL, NULL, &rect, DDBLT_COLORFILL | DDBLT_WAIT, &fx); - ok(SUCCEEDED(hr), "Got unexpected hr %#x.\n", hr); + ok(SUCCEEDED(hr), "Got unexpected hr %#lx.\n", hr); hr = IDirectDrawSurface_Blt(surface, NULL, NULL, &rect, DDBLT_ROP | DDBLT_WAIT, &fx); - ok(SUCCEEDED(hr), "Got unexpected hr %#x.\n", hr); + ok(SUCCEEDED(hr), "Got unexpected hr %#lx.\n", hr); /* Unused source surface. */ hr = IDirectDrawSurface_Blt(surface, NULL, surface2, NULL, DDBLT_COLORFILL | DDBLT_WAIT, &fx); - ok(hr == DDERR_INVALIDPARAMS, "Got unexpected hr %#x.\n", hr); + ok(hr == DDERR_INVALIDPARAMS, "Got unexpected hr %#lx.\n", hr); hr = IDirectDrawSurface_Blt(surface, NULL, surface2, NULL, DDBLT_ROP | DDBLT_WAIT, &fx); - ok(SUCCEEDED(hr), "Got unexpected hr %#x.\n", hr); + ok(SUCCEEDED(hr), "Got unexpected hr %#lx.\n", hr); hr = IDirectDrawSurface_Blt(surface, NULL, surface2, &rect, DDBLT_COLORFILL | DDBLT_WAIT, &fx); - ok(hr == DDERR_INVALIDPARAMS, "Got unexpected hr %#x.\n", hr); + ok(hr == DDERR_INVALIDPARAMS, "Got unexpected hr %#lx.\n", hr); hr = IDirectDrawSurface_Blt(surface, NULL, surface2, &rect, DDBLT_ROP | DDBLT_WAIT, &fx); - ok(SUCCEEDED(hr), "Got unexpected hr %#x.\n", hr); + ok(SUCCEEDED(hr), "Got unexpected hr %#lx.\n", hr); /* Inverted destination or source rectangle. */ SetRect(&rect, 5, 7, 7, 5); hr = IDirectDrawSurface_Blt(surface, &rect, NULL, NULL, DDBLT_COLORFILL | DDBLT_WAIT, &fx); - ok(hr == DDERR_INVALIDRECT, "Got unexpected hr %#x.\n", hr); + ok(hr == DDERR_INVALIDRECT, "Got unexpected hr %#lx.\n", hr); hr = IDirectDrawSurface_Blt(surface, NULL, NULL, &rect, DDBLT_COLORFILL | DDBLT_WAIT, &fx); - ok(SUCCEEDED(hr), "Got unexpected hr %#x.\n", hr); + ok(SUCCEEDED(hr), "Got unexpected hr %#lx.\n", hr); hr = IDirectDrawSurface_Blt(surface, &rect, surface2, NULL, DDBLT_COLORFILL | DDBLT_WAIT, &fx); - ok(hr == DDERR_INVALIDPARAMS, "Got unexpected hr %#x.\n", hr); + ok(hr == DDERR_INVALIDPARAMS, "Got unexpected hr %#lx.\n", hr); hr = IDirectDrawSurface_Blt(surface, NULL, surface2, &rect, DDBLT_COLORFILL | DDBLT_WAIT, &fx); - ok(hr == DDERR_INVALIDPARAMS, "Got unexpected hr %#x.\n", hr); + ok(hr == DDERR_INVALIDPARAMS, "Got unexpected hr %#lx.\n", hr); hr = IDirectDrawSurface_Blt(surface, NULL, surface2, &rect, DDBLT_ROP | DDBLT_WAIT, &fx); - ok(hr == DDERR_INVALIDRECT, "Got unexpected hr %#x.\n", hr); + ok(hr == DDERR_INVALIDRECT, "Got unexpected hr %#lx.\n", hr); /* Negative rectangle. */ SetRect(&rect, -1, -1, 5, 5); hr = IDirectDrawSurface_Blt(surface, &rect, NULL, NULL, DDBLT_COLORFILL | DDBLT_WAIT, &fx); - ok(hr == DDERR_INVALIDRECT, "Got unexpected hr %#x.\n", hr); + ok(hr == DDERR_INVALIDRECT, "Got unexpected hr %#lx.\n", hr); hr = IDirectDrawSurface_Blt(surface, NULL, NULL, &rect, DDBLT_COLORFILL | DDBLT_WAIT, &fx); - ok(SUCCEEDED(hr), "Got unexpected hr %#x.\n", hr); + ok(SUCCEEDED(hr), "Got unexpected hr %#lx.\n", hr); hr = IDirectDrawSurface_Blt(surface, &rect, surface2, NULL, DDBLT_COLORFILL | DDBLT_WAIT, &fx); - ok(hr == DDERR_INVALIDPARAMS, "Got unexpected hr %#x.\n", hr); + ok(hr == DDERR_INVALIDPARAMS, "Got unexpected hr %#lx.\n", hr); hr = IDirectDrawSurface_Blt(surface, &rect, surface2, &rect, DDBLT_COLORFILL | DDBLT_WAIT, &fx); - ok(hr == DDERR_INVALIDPARAMS, "Got unexpected hr %#x.\n", hr); + ok(hr == DDERR_INVALIDPARAMS, "Got unexpected hr %#lx.\n", hr); hr = IDirectDrawSurface_Blt(surface, NULL, surface2, &rect, DDBLT_ROP | DDBLT_WAIT, &fx); - ok(hr == DDERR_INVALIDRECT, "Got unexpected hr %#x.\n", hr); + ok(hr == DDERR_INVALIDRECT, "Got unexpected hr %#lx.\n", hr); /* Out of bounds rectangle. */ SetRect(&rect, 0, 0, 65, 65); hr = IDirectDrawSurface_Blt(surface, &rect, NULL, NULL, DDBLT_COLORFILL | DDBLT_WAIT, &fx); - ok(hr == DDERR_INVALIDRECT, "Got unexpected hr %#x.\n", hr); + ok(hr == DDERR_INVALIDRECT, "Got unexpected hr %#lx.\n", hr); hr = IDirectDrawSurface_Blt(surface, NULL, surface2, &rect, DDBLT_ROP | DDBLT_WAIT, &fx); - ok(hr == DDERR_INVALIDRECT, "Got unexpected hr %#x.\n", hr); + ok(hr == DDERR_INVALIDRECT, "Got unexpected hr %#lx.\n", hr); /* Combine multiple flags. */ hr = IDirectDrawSurface_Blt(surface, NULL, NULL, NULL, DDBLT_COLORFILL | DDBLT_DEPTHFILL | DDBLT_WAIT, &fx); - ok(SUCCEEDED(hr), "Got unexpected hr %#x.\n", hr); + ok(SUCCEEDED(hr), "Got unexpected hr %#lx.\n", hr); hr = IDirectDrawSurface_Blt(surface, NULL, NULL, NULL, DDBLT_COLORFILL | DDBLT_ROP | DDBLT_WAIT, &fx); - ok(hr == DDERR_INVALIDPARAMS, "Got unexpected hr %#x.\n", hr); + ok(hr == DDERR_INVALIDPARAMS, "Got unexpected hr %#lx.\n", hr); hr = IDirectDrawSurface_Blt(surface, &rect, NULL, NULL, DDBLT_COLORFILL | DDBLT_ROP | DDBLT_WAIT, &fx); - ok(hr == DDERR_INVALIDPARAMS, "Got unexpected hr %#x.\n", hr); + ok(hr == DDERR_INVALIDPARAMS, "Got unexpected hr %#lx.\n", hr); for (i = 0; i < ARRAY_SIZE(rops); i++) { fx.dwROP = rops[i].rop; hr = IDirectDrawSurface_Blt(surface, NULL, surface2, NULL, DDBLT_ROP | DDBLT_WAIT, &fx); - ok(hr == rops[i].hr, "Got unexpected hr %#x for rop %s.\n", hr, rops[i].name); + ok(hr == rops[i].hr, "Got unexpected hr %#lx for rop %s.\n", hr, rops[i].name); } IDirectDrawSurface_Release(surface2); @@ -10091,54 +10075,54 @@ static void test_color_fill(void) U2(surface_desc).dwZBufferBitDepth = get_device_z_depth(device); surface_desc.ddsCaps.dwCaps = DDSCAPS_ZBUFFER; hr = IDirectDraw2_CreateSurface(ddraw, &surface_desc, &surface, NULL); - ok(SUCCEEDED(hr), "Failed to create surface, hr %#x.\n", hr); + ok(SUCCEEDED(hr), "Failed to create surface, hr %#lx.\n", hr); hr = IDirectDraw2_CreateSurface(ddraw, &surface_desc, &surface2, NULL); - ok(SUCCEEDED(hr), "Failed to create surface, hr %#x.\n", hr); + ok(SUCCEEDED(hr), "Failed to create surface, hr %#lx.\n", hr); /* No DDBLTFX. */ hr = IDirectDrawSurface_Blt(surface, NULL, NULL, &rect, DDBLT_DEPTHFILL | DDBLT_WAIT, NULL); - ok(hr == DDERR_INVALIDPARAMS, "Got unexpected hr %#x.\n", hr); + ok(hr == DDERR_INVALIDPARAMS, "Got unexpected hr %#lx.\n", hr); /* Unused source rectangle. */ hr = IDirectDrawSurface_Blt(surface, NULL, NULL, &rect, DDBLT_DEPTHFILL | DDBLT_WAIT, &fx); - ok(SUCCEEDED(hr), "Got unexpected hr %#x.\n", hr); + ok(SUCCEEDED(hr), "Got unexpected hr %#lx.\n", hr); /* Unused source surface. */ hr = IDirectDrawSurface_Blt(surface, NULL, surface2, NULL, DDBLT_DEPTHFILL | DDBLT_WAIT, &fx); - ok(hr == DDERR_INVALIDPARAMS, "Got unexpected hr %#x.\n", hr); + ok(hr == DDERR_INVALIDPARAMS, "Got unexpected hr %#lx.\n", hr); hr = IDirectDrawSurface_Blt(surface, NULL, surface2, &rect, DDBLT_DEPTHFILL | DDBLT_WAIT, &fx); - ok(hr == DDERR_INVALIDPARAMS, "Got unexpected hr %#x.\n", hr); + ok(hr == DDERR_INVALIDPARAMS, "Got unexpected hr %#lx.\n", hr); /* Inverted destination or source rectangle. */ SetRect(&rect, 5, 7, 7, 5); hr = IDirectDrawSurface_Blt(surface, &rect, NULL, NULL, DDBLT_DEPTHFILL | DDBLT_WAIT, &fx); - ok(hr == DDERR_INVALIDRECT, "Got unexpected hr %#x.\n", hr); + ok(hr == DDERR_INVALIDRECT, "Got unexpected hr %#lx.\n", hr); hr = IDirectDrawSurface_Blt(surface, NULL, NULL, &rect, DDBLT_DEPTHFILL | DDBLT_WAIT, &fx); - ok(SUCCEEDED(hr), "Got unexpected hr %#x.\n", hr); + ok(SUCCEEDED(hr), "Got unexpected hr %#lx.\n", hr); hr = IDirectDrawSurface_Blt(surface, &rect, surface2, NULL, DDBLT_DEPTHFILL | DDBLT_WAIT, &fx); - ok(hr == DDERR_INVALIDPARAMS, "Got unexpected hr %#x.\n", hr); + ok(hr == DDERR_INVALIDPARAMS, "Got unexpected hr %#lx.\n", hr); hr = IDirectDrawSurface_Blt(surface, NULL, surface2, &rect, DDBLT_DEPTHFILL | DDBLT_WAIT, &fx); - ok(hr == DDERR_INVALIDPARAMS, "Got unexpected hr %#x.\n", hr); + ok(hr == DDERR_INVALIDPARAMS, "Got unexpected hr %#lx.\n", hr); /* Negative rectangle. */ SetRect(&rect, -1, -1, 5, 5); hr = IDirectDrawSurface_Blt(surface, &rect, NULL, NULL, DDBLT_DEPTHFILL | DDBLT_WAIT, &fx); - ok(hr == DDERR_INVALIDRECT, "Got unexpected hr %#x.\n", hr); + ok(hr == DDERR_INVALIDRECT, "Got unexpected hr %#lx.\n", hr); hr = IDirectDrawSurface_Blt(surface, NULL, NULL, &rect, DDBLT_DEPTHFILL | DDBLT_WAIT, &fx); - ok(SUCCEEDED(hr), "Got unexpected hr %#x.\n", hr); + ok(SUCCEEDED(hr), "Got unexpected hr %#lx.\n", hr); hr = IDirectDrawSurface_Blt(surface, &rect, surface2, NULL, DDBLT_DEPTHFILL | DDBLT_WAIT, &fx); - ok(hr == DDERR_INVALIDPARAMS, "Got unexpected hr %#x.\n", hr); + ok(hr == DDERR_INVALIDPARAMS, "Got unexpected hr %#lx.\n", hr); hr = IDirectDrawSurface_Blt(surface, &rect, surface2, &rect, DDBLT_DEPTHFILL | DDBLT_WAIT, &fx); - ok(hr == DDERR_INVALIDPARAMS, "Got unexpected hr %#x.\n", hr); + ok(hr == DDERR_INVALIDPARAMS, "Got unexpected hr %#lx.\n", hr); /* Out of bounds rectangle. */ SetRect(&rect, 0, 0, 65, 65); hr = IDirectDrawSurface_Blt(surface, &rect, NULL, NULL, DDBLT_DEPTHFILL | DDBLT_WAIT, &fx); - ok(hr == DDERR_INVALIDRECT, "Got unexpected hr %#x.\n", hr); + ok(hr == DDERR_INVALIDRECT, "Got unexpected hr %#lx.\n", hr); /* Combine multiple flags. */ hr = IDirectDrawSurface_Blt(surface, NULL, NULL, NULL, DDBLT_COLORFILL | DDBLT_DEPTHFILL | DDBLT_WAIT, &fx); - ok(hr == DDERR_INVALIDPARAMS, "Got unexpected hr %#x.\n", hr); + ok(hr == DDERR_INVALIDPARAMS, "Got unexpected hr %#lx.\n", hr); IDirectDrawSurface_Release(surface2); IDirectDrawSurface_Release(surface); @@ -10146,7 +10130,7 @@ static void test_color_fill(void) done: IDirect3DDevice2_Release(device); refcount = IDirectDraw2_Release(ddraw); - ok(refcount == 0, "Ddraw object not properly released, refcount %u.\n", refcount); + ok(!refcount, "Unexpected refcount %lu.\n", refcount); DestroyWindow(window); } @@ -10160,6 +10144,7 @@ static void test_colorkey_precision(void) {{ 1.0f}, { 1.0f}, {0.0f}, 0, {0xff000000}, {0}, {1.0f}, {1.0f}}, }; static D3DRECT clear_rect = {{0}, {0}, {640}, {480}}; + unsigned int data[4] = {0}, color_mask, color, t, c; IDirect3DDevice2 *device; IDirectDraw2 *ddraw; IDirectDrawSurface *rt; @@ -10172,11 +10157,8 @@ static void test_colorkey_precision(void) IDirect3DMaterial2 *green; DDSURFACEDESC surface_desc, lock_desc; ULONG refcount; - D3DCOLOR color; - unsigned int t, c; DDCOLORKEY ckey; DDBLTFX fx; - DWORD data[4] = {0}, color_mask; BOOL is_nvidia, is_warp; static const struct { @@ -10231,7 +10213,7 @@ static void test_colorkey_precision(void) return; } hr = IDirect3DDevice2_GetRenderTarget(device, &rt); - ok(SUCCEEDED(hr), "Failed to get render target, hr %#x.\n", hr); + ok(SUCCEEDED(hr), "Failed to get render target, hr %#lx.\n", hr); is_nvidia = ddraw_is_nvidia(ddraw); /* The Windows 8 WARP driver has plenty of false negatives in X8R8G8B8 @@ -10246,16 +10228,16 @@ static void test_colorkey_precision(void) viewport = create_viewport(device, 0, 0, 640, 480); viewport_set_background(device, viewport, green); hr = IDirect3DDevice2_SetCurrentViewport(device, viewport); - ok(SUCCEEDED(hr), "Failed to activate the viewport, hr %#x.\n", hr); + ok(SUCCEEDED(hr), "Failed to activate the viewport, hr %#lx.\n", hr); hr = IDirect3DDevice2_SetRenderState(device, D3DRENDERSTATE_ZENABLE, D3DZB_FALSE); - ok(SUCCEEDED(hr), "Failed to disable z-buffering, hr %#x.\n", hr); + ok(SUCCEEDED(hr), "Failed to disable z-buffering, hr %#lx.\n", hr); hr = IDirect3DDevice2_SetRenderState(device, D3DRENDERSTATE_COLORKEYENABLE, TRUE); - ok(SUCCEEDED(hr), "Failed to enable color keying, hr %#x.\n", hr); + ok(SUCCEEDED(hr), "Failed to enable color keying, hr %#lx.\n", hr); /* There's no way to ignore the texture color in d3d2, so multiply the texture color * with a black vertex color. */ hr = IDirect3DDevice2_SetRenderState(device, D3DRENDERSTATE_TEXTUREMAPBLEND, D3DTBLEND_MODULATEALPHA); - ok(SUCCEEDED(hr), "Failed to set render state, hr %#x.\n", hr); + ok(SUCCEEDED(hr), "Failed to set render state, hr %#lx.\n", hr); memset(&fx, 0, sizeof(fx)); fx.dwSize = sizeof(fx); @@ -10280,9 +10262,9 @@ static void test_colorkey_precision(void) /* Windows XP (at least with the r200 driver, other drivers untested) produces * garbage when doing color keyed texture->texture blits. */ hr = IDirectDraw2_CreateSurface(ddraw, &surface_desc, &src, NULL); - ok(SUCCEEDED(hr), "Failed to create surface, hr %#x.\n", hr); + ok(SUCCEEDED(hr), "Failed to create surface, hr %#lx.\n", hr); hr = IDirectDraw2_CreateSurface(ddraw, &surface_desc, &dst, NULL); - ok(SUCCEEDED(hr), "Failed to create surface, hr %#x.\n", hr); + ok(SUCCEEDED(hr), "Failed to create surface, hr %#lx.\n", hr); U5(fx).dwFillColor = tests[t].clear; /* On the w8 testbot (WARP driver) the blit result has different values in the @@ -10300,21 +10282,21 @@ static void test_colorkey_precision(void) surface_desc.ddckCKSrcBlt.dwColorSpaceLowValue = c << tests[t].shift; surface_desc.ddckCKSrcBlt.dwColorSpaceHighValue = c << tests[t].shift; hr = IDirectDraw2_CreateSurface(ddraw, &surface_desc, &texture, NULL); - ok(SUCCEEDED(hr), "Failed to create surface, hr %#x.\n", hr); + ok(SUCCEEDED(hr), "Failed to create surface, hr %#lx.\n", hr); hr = IDirectDrawSurface4_QueryInterface(texture, &IID_IDirect3DTexture2, (void **)&d3d_texture); - ok(SUCCEEDED(hr), "Failed to get texture interface, hr %#x.\n", hr); + ok(SUCCEEDED(hr), "Failed to get texture interface, hr %#lx.\n", hr); hr = IDirect3DTexture2_GetHandle(d3d_texture, device, &handle); - ok(SUCCEEDED(hr), "Failed to get texture handle, hr %#x.\n", hr); + ok(SUCCEEDED(hr), "Failed to get texture handle, hr %#lx.\n", hr); hr = IDirect3DDevice2_SetRenderState(device, D3DRENDERSTATE_TEXTUREHANDLE, handle); - ok(SUCCEEDED(hr), "Failed to set texture handle, hr %#x.\n", hr); + ok(SUCCEEDED(hr), "Failed to set texture handle, hr %#lx.\n", hr); IDirect3DTexture2_Release(d3d_texture); hr = IDirectDrawSurface_Blt(dst, NULL, NULL, NULL, DDBLT_COLORFILL | DDBLT_WAIT, &fx); - ok(SUCCEEDED(hr), "Failed to clear destination surface, hr %#x.\n", hr); + ok(SUCCEEDED(hr), "Failed to clear destination surface, hr %#lx.\n", hr); hr = IDirectDrawSurface_Lock(src, NULL, &lock_desc, DDLOCK_WAIT, NULL); - ok(SUCCEEDED(hr), "Failed to lock surface, hr %#x.\n", hr); + ok(SUCCEEDED(hr), "Failed to lock surface, hr %#lx.\n", hr); switch (tests[t].bpp) { case 4: @@ -10332,21 +10314,21 @@ static void test_colorkey_precision(void) break; } hr = IDirectDrawSurface_Unlock(src, 0); - ok(SUCCEEDED(hr), "Failed to unlock surface, hr %#x.\n", hr); + ok(SUCCEEDED(hr), "Failed to unlock surface, hr %#lx.\n", hr); hr = IDirectDrawSurface_Blt(texture, NULL, src, NULL, DDBLT_WAIT, NULL); - ok(SUCCEEDED(hr), "Failed to blit, hr %#x.\n", hr); + ok(SUCCEEDED(hr), "Failed to blit, hr %#lx.\n", hr); ckey.dwColorSpaceLowValue = c << tests[t].shift; ckey.dwColorSpaceHighValue = c << tests[t].shift; hr = IDirectDrawSurface_SetColorKey(src, DDCKEY_SRCBLT, &ckey); - ok(SUCCEEDED(hr), "Failed to set color key, hr %#x.\n", hr); + ok(SUCCEEDED(hr), "Failed to set color key, hr %#lx.\n", hr); hr = IDirectDrawSurface_Blt(dst, NULL, src, NULL, DDBLT_KEYSRC | DDBLT_WAIT, NULL); - ok(SUCCEEDED(hr), "Failed to blit, hr %#x.\n", hr); + ok(SUCCEEDED(hr), "Failed to blit, hr %#lx.\n", hr); /* Don't make this read only, it somehow breaks the detection of the Nvidia bug below. */ hr = IDirectDrawSurface_Lock(dst, NULL, &lock_desc, DDLOCK_WAIT, NULL); - ok(SUCCEEDED(hr), "Failed to lock surface, hr %#x.\n", hr); + ok(SUCCEEDED(hr), "Failed to lock surface, hr %#lx.\n", hr); switch (tests[t].bpp) { case 4: @@ -10364,7 +10346,7 @@ static void test_colorkey_precision(void) break; } hr = IDirectDrawSurface_Unlock(dst, 0); - ok(SUCCEEDED(hr), "Failed to unlock surface, hr %#x.\n", hr); + ok(SUCCEEDED(hr), "Failed to unlock surface, hr %#lx.\n", hr); if (!c) { @@ -10406,14 +10388,14 @@ static void test_colorkey_precision(void) (c + 1) << tests[t].shift, data[2], tests[t].name, c); hr = IDirect3DViewport2_Clear(viewport, 1, &clear_rect, D3DCLEAR_TARGET); - ok(SUCCEEDED(hr), "Failed to clear, hr %#x.\n", hr); + ok(SUCCEEDED(hr), "Failed to clear, hr %#lx.\n", hr); hr = IDirect3DDevice2_BeginScene(device); - ok(SUCCEEDED(hr), "Failed to begin scene, hr %#x.\n", hr); + ok(SUCCEEDED(hr), "Failed to begin scene, hr %#lx.\n", hr); hr = IDirect3DDevice2_DrawPrimitive(device, D3DPT_TRIANGLESTRIP, D3DVT_LVERTEX, quad, 4, 0); - ok(SUCCEEDED(hr), "Failed to draw, hr %#x.\n", hr); + ok(SUCCEEDED(hr), "Failed to draw, hr %#lx.\n", hr); hr = IDirect3DDevice2_EndScene(device); - ok(SUCCEEDED(hr), "Failed to end scene, hr %#x.\n", hr); + ok(SUCCEEDED(hr), "Failed to end scene, hr %#lx.\n", hr); color = get_surface_color(rt, 80, 240); if (!c) @@ -10441,7 +10423,7 @@ static void test_colorkey_precision(void) color, tests[t].name, c); hr = IDirect3DDevice2_SetRenderState(device, D3DRENDERSTATE_TEXTUREHANDLE, 0); - ok(SUCCEEDED(hr), "Failed to set texture handle, hr %#x.\n", hr); + ok(SUCCEEDED(hr), "Failed to set texture handle, hr %#lx.\n", hr); IDirectDrawSurface_Release(texture); } IDirectDrawSurface_Release(src); @@ -10454,7 +10436,7 @@ done: IDirectDrawSurface_Release(rt); IDirect3DDevice2_Release(device); refcount = IDirectDraw2_Release(ddraw); - ok(refcount == 0, "Ddraw object not properly released, refcount %u.\n", refcount); + ok(!refcount, "Unexpected refcount %lu.\n", refcount); DestroyWindow(window); } @@ -10472,7 +10454,7 @@ static void test_range_colorkey(void) ddraw = create_ddraw(); ok(!!ddraw, "Failed to create a ddraw object.\n"); hr = IDirectDraw2_SetCooperativeLevel(ddraw, window, DDSCL_NORMAL); - ok(SUCCEEDED(hr), "Failed to set cooperative level, hr %#x.\n", hr); + ok(SUCCEEDED(hr), "Failed to set cooperative level, hr %#lx.\n", hr); memset(&surface_desc, 0, sizeof(surface_desc)); surface_desc.dwSize = sizeof(surface_desc); @@ -10491,100 +10473,99 @@ static void test_range_colorkey(void) surface_desc.ddckCKSrcBlt.dwColorSpaceLowValue = 0x00000000; surface_desc.ddckCKSrcBlt.dwColorSpaceHighValue = 0x00000001; hr = IDirectDraw2_CreateSurface(ddraw, &surface_desc, &surface, NULL); - ok(hr == DDERR_NOCOLORKEYHW, "Got unexpected hr %#x.\n", hr); + ok(hr == DDERR_NOCOLORKEYHW, "Got unexpected hr %#lx.\n", hr); surface_desc.ddckCKSrcBlt.dwColorSpaceLowValue = 0x00000001; surface_desc.ddckCKSrcBlt.dwColorSpaceHighValue = 0x00000000; hr = IDirectDraw2_CreateSurface(ddraw, &surface_desc, &surface, NULL); - ok(hr == DDERR_NOCOLORKEYHW, "Got unexpected hr %#x.\n", hr); + ok(hr == DDERR_NOCOLORKEYHW, "Got unexpected hr %#lx.\n", hr); /* Same for DDSCAPS_OFFSCREENPLAIN. */ surface_desc.ddsCaps.dwCaps = DDSCAPS_OFFSCREENPLAIN; surface_desc.ddckCKSrcBlt.dwColorSpaceLowValue = 0x00000000; surface_desc.ddckCKSrcBlt.dwColorSpaceHighValue = 0x00000001; hr = IDirectDraw2_CreateSurface(ddraw, &surface_desc, &surface, NULL); - ok(hr == DDERR_NOCOLORKEYHW, "Got unexpected hr %#x.\n", hr); + ok(hr == DDERR_NOCOLORKEYHW, "Got unexpected hr %#lx.\n", hr); surface_desc.ddckCKSrcBlt.dwColorSpaceLowValue = 0x00000001; surface_desc.ddckCKSrcBlt.dwColorSpaceHighValue = 0x00000000; hr = IDirectDraw2_CreateSurface(ddraw, &surface_desc, &surface, NULL); - ok(hr == DDERR_NOCOLORKEYHW, "Got unexpected hr %#x.\n", hr); + ok(hr == DDERR_NOCOLORKEYHW, "Got unexpected hr %#lx.\n", hr); surface_desc.ddckCKSrcBlt.dwColorSpaceLowValue = 0x00000000; surface_desc.ddckCKSrcBlt.dwColorSpaceHighValue = 0x00000000; hr = IDirectDraw2_CreateSurface(ddraw, &surface_desc, &surface, NULL); - ok(SUCCEEDED(hr), "Failed to create surface, hr %#x.\n", hr); + ok(SUCCEEDED(hr), "Failed to create surface, hr %#lx.\n", hr); /* Setting a range color key without DDCKEY_COLORSPACE collapses the key. */ ckey.dwColorSpaceLowValue = 0x00000000; ckey.dwColorSpaceHighValue = 0x00000001; hr = IDirectDrawSurface_SetColorKey(surface, DDCKEY_SRCBLT, &ckey); - ok(SUCCEEDED(hr), "Failed to set color key, hr %#x.\n", hr); + ok(SUCCEEDED(hr), "Failed to set color key, hr %#lx.\n", hr); hr = IDirectDrawSurface_GetColorKey(surface, DDCKEY_SRCBLT, &ckey); - ok(SUCCEEDED(hr), "Failed to get color key, hr %#x.\n", hr); - ok(!ckey.dwColorSpaceLowValue, "Got unexpected value 0x%08x.\n", ckey.dwColorSpaceLowValue); - ok(!ckey.dwColorSpaceHighValue, "Got unexpected value 0x%08x.\n", ckey.dwColorSpaceHighValue); + ok(SUCCEEDED(hr), "Failed to get color key, hr %#lx.\n", hr); + ok(!ckey.dwColorSpaceLowValue, "Got unexpected value 0x%08lx.\n", ckey.dwColorSpaceLowValue); + ok(!ckey.dwColorSpaceHighValue, "Got unexpected value 0x%08lx.\n", ckey.dwColorSpaceHighValue); ckey.dwColorSpaceLowValue = 0x00000001; ckey.dwColorSpaceHighValue = 0x00000000; hr = IDirectDrawSurface_SetColorKey(surface, DDCKEY_SRCBLT, &ckey); - ok(SUCCEEDED(hr), "Failed to set color key, hr %#x.\n", hr); + ok(SUCCEEDED(hr), "Failed to set color key, hr %#lx.\n", hr); hr = IDirectDrawSurface_GetColorKey(surface, DDCKEY_SRCBLT, &ckey); - ok(SUCCEEDED(hr), "Failed to get color key, hr %#x.\n", hr); - ok(ckey.dwColorSpaceLowValue == 0x00000001, "Got unexpected value 0x%08x.\n", ckey.dwColorSpaceLowValue); - ok(ckey.dwColorSpaceHighValue == 0x00000001, "Got unexpected value 0x%08x.\n", ckey.dwColorSpaceHighValue); + ok(SUCCEEDED(hr), "Failed to get color key, hr %#lx.\n", hr); + ok(ckey.dwColorSpaceLowValue == 0x00000001, "Got unexpected value 0x%08lx.\n", ckey.dwColorSpaceLowValue); + ok(ckey.dwColorSpaceHighValue == 0x00000001, "Got unexpected value 0x%08lx.\n", ckey.dwColorSpaceHighValue); /* DDCKEY_COLORSPACE is ignored if the key is a single value. */ ckey.dwColorSpaceLowValue = 0x00000000; ckey.dwColorSpaceHighValue = 0x00000000; hr = IDirectDrawSurface_SetColorKey(surface, DDCKEY_SRCBLT | DDCKEY_COLORSPACE, &ckey); - ok(SUCCEEDED(hr), "Failed to set color key, hr %#x.\n", hr); + ok(SUCCEEDED(hr), "Failed to set color key, hr %#lx.\n", hr); /* Using it with a range key results in DDERR_NOCOLORKEYHW. */ ckey.dwColorSpaceLowValue = 0x00000001; ckey.dwColorSpaceHighValue = 0x00000000; hr = IDirectDrawSurface_SetColorKey(surface, DDCKEY_SRCBLT | DDCKEY_COLORSPACE, &ckey); - ok(hr == DDERR_NOCOLORKEYHW, "Got unexpected hr %#x.\n", hr); + ok(hr == DDERR_NOCOLORKEYHW, "Got unexpected hr %#lx.\n", hr); ckey.dwColorSpaceLowValue = 0x00000000; ckey.dwColorSpaceHighValue = 0x00000001; hr = IDirectDrawSurface_SetColorKey(surface, DDCKEY_SRCBLT | DDCKEY_COLORSPACE, &ckey); - ok(hr == DDERR_NOCOLORKEYHW, "Got unexpected hr %#x.\n", hr); + ok(hr == DDERR_NOCOLORKEYHW, "Got unexpected hr %#lx.\n", hr); /* Range destination keys don't work either. */ hr = IDirectDrawSurface_SetColorKey(surface, DDCKEY_DESTBLT | DDCKEY_COLORSPACE, &ckey); - ok(hr == DDERR_NOCOLORKEYHW, "Got unexpected hr %#x.\n", hr); + ok(hr == DDERR_NOCOLORKEYHW, "Got unexpected hr %#lx.\n", hr); /* Just to show it's not because of A, R, and G having equal values. */ ckey.dwColorSpaceLowValue = 0x00000000; ckey.dwColorSpaceHighValue = 0x01010101; hr = IDirectDrawSurface_SetColorKey(surface, DDCKEY_SRCBLT | DDCKEY_COLORSPACE, &ckey); - ok(hr == DDERR_NOCOLORKEYHW, "Got unexpected hr %#x.\n", hr); + ok(hr == DDERR_NOCOLORKEYHW, "Got unexpected hr %#lx.\n", hr); /* None of these operations modified the key. */ hr = IDirectDrawSurface_GetColorKey(surface, DDCKEY_SRCBLT, &ckey); - ok(SUCCEEDED(hr), "Failed to get color key, hr %#x.\n", hr); - ok(!ckey.dwColorSpaceLowValue, "Got unexpected value 0x%08x.\n", ckey.dwColorSpaceLowValue); - ok(!ckey.dwColorSpaceHighValue, "Got unexpected value 0x%08x.\n", ckey.dwColorSpaceHighValue); + ok(SUCCEEDED(hr), "Failed to get color key, hr %#lx.\n", hr); + ok(!ckey.dwColorSpaceLowValue, "Got unexpected value 0x%08lx.\n", ckey.dwColorSpaceLowValue); + ok(!ckey.dwColorSpaceHighValue, "Got unexpected value 0x%08lx.\n", ckey.dwColorSpaceHighValue); IDirectDrawSurface_Release(surface); refcount = IDirectDraw2_Release(ddraw); - ok(!refcount, "Got unexpected refcount %u.\n", refcount); + ok(!refcount, "Got unexpected refcount %lu.\n", refcount); DestroyWindow(window); } static void test_shademode(void) { static D3DRECT clear_rect = {{0}, {0}, {640}, {480}}; + unsigned int color0, color1, i, count; IDirect3DMaterial2 *background; IDirect3DViewport2 *viewport; IDirect3DDevice2 *device; IDirectDrawSurface *rt; - DWORD color0, color1; IDirectDraw2 *ddraw; D3DLVERTEX *quad; ULONG refcount; - UINT i, count; HWND window; HRESULT hr; static D3DLVERTEX quad_strip[] = @@ -10608,7 +10589,7 @@ static void test_shademode(void) { DWORD primtype; DWORD shademode; - DWORD color0, color1; + unsigned int color0, color1; } tests[] = { @@ -10632,16 +10613,16 @@ static void test_shademode(void) } hr = IDirect3DDevice2_GetRenderTarget(device, &rt); - ok(SUCCEEDED(hr), "Failed to get render target, hr %#x.\n", hr); + ok(SUCCEEDED(hr), "Failed to get render target, hr %#lx.\n", hr); background = create_diffuse_material(device, 1.0f, 1.0f, 1.0f, 1.0f); viewport = create_viewport(device, 0, 0, 640, 480); viewport_set_background(device, viewport, background); hr = IDirect3DDevice2_SetCurrentViewport(device, viewport); - ok(SUCCEEDED(hr), "Failed to activate the viewport, hr %#x.\n", hr); + ok(SUCCEEDED(hr), "Failed to activate the viewport, hr %#lx.\n", hr); hr = IDirect3DDevice2_SetRenderState(device, D3DRENDERSTATE_FOGENABLE, FALSE); - ok(SUCCEEDED(hr), "Failed to disable fog, hr %#x.\n", hr); + ok(SUCCEEDED(hr), "Failed to disable fog, hr %#lx.\n", hr); /* Try it first with a TRIANGLESTRIP. Do it with different geometry because * the color fixups we have to do for FLAT shading will be dependent on that. */ @@ -10649,19 +10630,19 @@ static void test_shademode(void) for (i = 0; i < ARRAY_SIZE(tests); ++i) { hr = IDirect3DViewport2_Clear(viewport, 1, &clear_rect, D3DCLEAR_TARGET); - ok(SUCCEEDED(hr), "Failed to clear viewport, hr %#x.\n", hr); + ok(SUCCEEDED(hr), "Failed to clear viewport, hr %#lx.\n", hr); hr = IDirect3DDevice2_SetRenderState(device, D3DRENDERSTATE_SHADEMODE, tests[i].shademode); - ok(hr == D3D_OK, "Failed to set shade mode, hr %#x.\n", hr); + ok(hr == D3D_OK, "Failed to set shade mode, hr %#lx.\n", hr); hr = IDirect3DDevice2_BeginScene(device); - ok(SUCCEEDED(hr), "Failed to begin scene, hr %#x.\n", hr); + ok(SUCCEEDED(hr), "Failed to begin scene, hr %#lx.\n", hr); quad = tests[i].primtype == D3DPT_TRIANGLESTRIP ? quad_strip : quad_list; count = tests[i].primtype == D3DPT_TRIANGLESTRIP ? 4 : 6; hr = IDirect3DDevice2_DrawPrimitive(device, tests[i].primtype, D3DVT_LVERTEX, quad, count, 0); - ok(SUCCEEDED(hr), "Failed to draw, hr %#x.\n", hr); + ok(SUCCEEDED(hr), "Failed to draw, hr %#lx.\n", hr); hr = IDirect3DDevice2_EndScene(device); - ok(SUCCEEDED(hr), "Failed to end scene, hr %#x.\n", hr); + ok(SUCCEEDED(hr), "Failed to end scene, hr %#lx.\n", hr); color0 = get_surface_color(rt, 100, 100); /* Inside first triangle */ color1 = get_surface_color(rt, 500, 350); /* Inside second triangle */ @@ -10681,7 +10662,7 @@ static void test_shademode(void) destroy_material(background); IDirectDrawSurface_Release(rt); refcount = IDirect3DDevice2_Release(device); - ok(!refcount, "Device has %u references left.\n", refcount); + ok(!refcount, "Device has %lu references left.\n", refcount); IDirectDraw2_Release(ddraw); DestroyWindow(window); } @@ -10736,12 +10717,12 @@ static void test_lockrect_invalid(void) ddraw = create_ddraw(); ok(!!ddraw, "Failed to create a ddraw object.\n"); hr = IDirectDraw2_SetCooperativeLevel(ddraw, window, DDSCL_NORMAL); - ok(SUCCEEDED(hr), "Failed to set cooperative level, hr %#x.\n", hr); + ok(SUCCEEDED(hr), "Failed to set cooperative level, hr %#lx.\n", hr); memset(&hal_caps, 0, sizeof(hal_caps)); hal_caps.dwSize = sizeof(hal_caps); hr = IDirectDraw2_GetCaps(ddraw, &hal_caps, NULL); - ok(SUCCEEDED(hr), "Failed to get caps, hr %#x.\n", hr); + ok(SUCCEEDED(hr), "Failed to get caps, hr %#lx.\n", hr); if ((hal_caps.ddsCaps.dwCaps & needed_caps) != needed_caps) { skip("Required surface types not supported, skipping test.\n"); @@ -10764,13 +10745,13 @@ static void test_lockrect_invalid(void) U4(surface_desc.ddpfPixelFormat).dwBBitMask = 0x0000ff; hr = IDirectDraw2_CreateSurface(ddraw, &surface_desc, &surface1, NULL); - ok(SUCCEEDED(hr), "Failed to create surface, hr %#x, type %s.\n", hr, resources[r].name); + ok(SUCCEEDED(hr), "Failed to create surface, hr %#lx, type %s.\n", hr, resources[r].name); hr = IDirectDrawSurface_QueryInterface(surface1, &IID_IDirectDrawSurface2, (void **)&surface); - ok(SUCCEEDED(hr), "Failed to QI IDirectDrawSurface2 interface, hr %#x.\n", hr); + ok(SUCCEEDED(hr), "Failed to QI IDirectDrawSurface2 interface, hr %#lx.\n", hr); IDirectDrawSurface_Release(surface1); hr = IDirectDrawSurface2_Lock(surface, NULL, NULL, DDLOCK_WAIT, NULL); - ok(hr == DDERR_INVALIDPARAMS, "Got unexpected hr %#x, type %s.\n", hr, resources[r].name); + ok(hr == DDERR_INVALIDPARAMS, "Got unexpected hr %#lx, type %s.\n", hr, resources[r].name); for (i = 0; i < ARRAY_SIZE(valid); ++i) { @@ -10780,11 +10761,11 @@ static void test_lockrect_invalid(void) surface_desc.dwSize = sizeof(surface_desc); hr = IDirectDrawSurface2_Lock(surface, rect, &surface_desc, DDLOCK_WAIT, NULL); - ok(SUCCEEDED(hr), "Lock failed (%#x) for rect %s, type %s.\n", + ok(SUCCEEDED(hr), "Lock failed (%#lx) for rect %s, type %s.\n", hr, wine_dbgstr_rect(rect), resources[r].name); hr = IDirectDrawSurface2_Unlock(surface, NULL); - ok(SUCCEEDED(hr), "Failed to unlock surface, hr %#x, type %s.\n", hr, resources[r].name); + ok(SUCCEEDED(hr), "Failed to unlock surface, hr %#lx, type %s.\n", hr, resources[r].name); } for (i = 0; i < ARRAY_SIZE(invalid); ++i) @@ -10795,37 +10776,37 @@ static void test_lockrect_invalid(void) surface_desc.dwSize = sizeof(surface_desc); hr = IDirectDrawSurface2_Lock(surface, rect, &surface_desc, DDLOCK_WAIT, NULL); - ok(hr == resources[r].hr, "Lock returned %#x for rect %s, type %s.\n", + ok(hr == resources[r].hr, "Lock returned %#lx for rect %s, type %s.\n", hr, wine_dbgstr_rect(rect), resources[r].name); if (SUCCEEDED(hr)) { hr = IDirectDrawSurface2_Unlock(surface, NULL); - ok(SUCCEEDED(hr), "Failed to unlock surface, hr %#x, type %s.\n", hr, resources[r].name); + ok(SUCCEEDED(hr), "Failed to unlock surface, hr %#lx, type %s.\n", hr, resources[r].name); } else ok(!surface_desc.lpSurface, "Got unexpected lpSurface %p.\n", surface_desc.lpSurface); } hr = IDirectDrawSurface2_Lock(surface, NULL, &surface_desc, DDLOCK_WAIT, NULL); - ok(SUCCEEDED(hr), "Lock(rect = NULL) failed, hr %#x, type %s.\n", + ok(SUCCEEDED(hr), "Lock(rect = NULL) failed, hr %#lx, type %s.\n", hr, resources[r].name); hr = IDirectDrawSurface2_Lock(surface, NULL, &surface_desc, DDLOCK_WAIT, NULL); - ok(hr == DDERR_SURFACEBUSY, "Double lock(rect = NULL) returned %#x, type %s.\n", + ok(hr == DDERR_SURFACEBUSY, "Double lock(rect = NULL) returned %#lx, type %s.\n", hr, resources[r].name); hr = IDirectDrawSurface2_Unlock(surface, NULL); - ok(SUCCEEDED(hr), "Failed to unlock surface, hr %#x, type %s.\n", hr, resources[r].name); + ok(SUCCEEDED(hr), "Failed to unlock surface, hr %#lx, type %s.\n", hr, resources[r].name); hr = IDirectDrawSurface2_Lock(surface, &valid[0], &surface_desc, DDLOCK_WAIT, NULL); - ok(SUCCEEDED(hr), "Lock(rect = %s) failed (%#x).\n", wine_dbgstr_rect(&valid[0]), hr); + ok(SUCCEEDED(hr), "Lock(rect = %s) failed (%#lx).\n", wine_dbgstr_rect(&valid[0]), hr); hr = IDirectDrawSurface2_Lock(surface, &valid[0], &surface_desc, DDLOCK_WAIT, NULL); - ok(hr == DDERR_SURFACEBUSY, "Double lock(rect = %s) failed (%#x).\n", + ok(hr == DDERR_SURFACEBUSY, "Double lock(rect = %s) failed (%#lx).\n", wine_dbgstr_rect(&valid[0]), hr); /* Locking a different rectangle returns DD_OK, but it seems to break the surface. * Afterwards unlocking the surface fails(NULL rectangle or both locked rectangles) */ hr = IDirectDrawSurface2_Unlock(surface, NULL); - ok(SUCCEEDED(hr), "Failed to unlock surface, hr %#x, type %s.\n", hr, resources[r].name); + ok(SUCCEEDED(hr), "Failed to unlock surface, hr %#lx, type %s.\n", hr, resources[r].name); IDirectDrawSurface2_Release(surface); } @@ -10850,7 +10831,7 @@ static void test_yv12_overlay(void) ddraw = create_ddraw(); ok(!!ddraw, "Failed to create a ddraw object.\n"); hr = IDirectDraw2_SetCooperativeLevel(ddraw, window, DDSCL_NORMAL); - ok(SUCCEEDED(hr), "Failed to set cooperative level, hr %#x.\n", hr); + ok(SUCCEEDED(hr), "Failed to set cooperative level, hr %#lx.\n", hr); if (!(src_surface = create_overlay(ddraw, 256, 256, MAKEFOURCC('Y','V','1','2')))) { @@ -10861,17 +10842,17 @@ static void test_yv12_overlay(void) memset(&desc, 0, sizeof(desc)); desc.dwSize = sizeof(desc); hr = IDirectDrawSurface_Lock(src_surface, NULL, &desc, DDLOCK_WAIT, NULL); - ok(SUCCEEDED(hr), "Failed to lock surface, hr %#x.\n", hr); + ok(SUCCEEDED(hr), "Failed to lock surface, hr %#lx.\n", hr); ok(desc.dwFlags == (DDSD_WIDTH | DDSD_HEIGHT | DDSD_PIXELFORMAT | DDSD_CAPS | DDSD_PITCH), - "Got unexpected flags %#x.\n", desc.dwFlags); + "Got unexpected flags %#lx.\n", desc.dwFlags); ok(desc.ddsCaps.dwCaps == (DDSCAPS_OVERLAY | DDSCAPS_VIDEOMEMORY | DDSCAPS_LOCALVIDMEM | DDSCAPS_HWCODEC) || desc.ddsCaps.dwCaps == (DDSCAPS_OVERLAY | DDSCAPS_VIDEOMEMORY | DDSCAPS_LOCALVIDMEM), - "Got unexpected caps %#x.\n", desc.ddsCaps.dwCaps); - ok(desc.dwWidth == 256, "Got unexpected width %u.\n", desc.dwWidth); - ok(desc.dwHeight == 256, "Got unexpected height %u.\n", desc.dwHeight); + "Got unexpected caps %#lx.\n", desc.ddsCaps.dwCaps); + ok(desc.dwWidth == 256, "Got unexpected width %lu.\n", desc.dwWidth); + ok(desc.dwHeight == 256, "Got unexpected height %lu.\n", desc.dwHeight); /* The overlay pitch seems to have 256 byte alignment. */ - ok(!(U1(desc).lPitch & 0xff), "Got unexpected pitch %u.\n", U1(desc).lPitch); + ok(!(U1(desc).lPitch & 0xff), "Got unexpected pitch %lu.\n", U1(desc).lPitch); /* Fill the surface with some data for the blit test. */ base = desc.lpSurface; @@ -10892,7 +10873,7 @@ static void test_yv12_overlay(void) } hr = IDirectDrawSurface_Unlock(src_surface, NULL); - ok(SUCCEEDED(hr), "Failed to unlock surface, hr %#x.\n", hr); + ok(SUCCEEDED(hr), "Failed to unlock surface, hr %#lx.\n", hr); /* YV12 uses 2x2 blocks with 6 bytes per block (4*Y, 1*U, 1*V). Unlike * other block-based formats like DXT the entire Y channel is stored in @@ -10900,12 +10881,12 @@ static void test_yv12_overlay(void) * locks do not really make sense. Show that they are allowed nevertheless * and the offset points into the luminance data. */ hr = IDirectDrawSurface_Lock(src_surface, &rect, &desc, DDLOCK_WAIT, NULL); - ok(SUCCEEDED(hr), "Failed to lock surface, hr %#x.\n", hr); + ok(SUCCEEDED(hr), "Failed to lock surface, hr %#lx.\n", hr); offset = ((const unsigned char *)desc.lpSurface - base); - ok(offset == rect.top * U1(desc).lPitch + rect.left, "Got unexpected offset %u, expected %u.\n", + ok(offset == rect.top * U1(desc).lPitch + rect.left, "Got unexpected offset %u, expected %lu.\n", offset, rect.top * U1(desc).lPitch + rect.left); hr = IDirectDrawSurface_Unlock(src_surface, NULL); - ok(SUCCEEDED(hr), "Failed to unlock surface, hr %#x.\n", hr); + ok(SUCCEEDED(hr), "Failed to unlock surface, hr %#lx.\n", hr); if (!(dst_surface = create_overlay(ddraw, 256, 256, MAKEFOURCC('Y','V','1','2')))) { @@ -10919,14 +10900,14 @@ static void test_yv12_overlay(void) hr = IDirectDrawSurface_Blt(dst_surface, NULL, src_surface, NULL, DDBLT_WAIT, NULL); /* VMware rejects YV12 blits. This behavior has not been seen on real * hardware yet, so mark it broken. */ - ok(SUCCEEDED(hr) || broken(hr == E_NOTIMPL), "Failed to blit, hr %#x.\n", hr); + ok(SUCCEEDED(hr) || broken(hr == E_NOTIMPL), "Failed to blit, hr %#lx.\n", hr); if (SUCCEEDED(hr)) { memset(&desc, 0, sizeof(desc)); desc.dwSize = sizeof(desc); hr = IDirectDrawSurface_Lock(dst_surface, NULL, &desc, DDLOCK_WAIT, NULL); - ok(SUCCEEDED(hr), "Failed to lock surface, hr %#x.\n", hr); + ok(SUCCEEDED(hr), "Failed to lock surface, hr %#lx.\n", hr); base = desc.lpSurface; ok(base[0] == 0x10, "Got unexpected Y data 0x%02x.\n", base[0]); @@ -10936,7 +10917,7 @@ static void test_yv12_overlay(void) ok(base[0] == 0x30, "Got unexpected U data 0x%02x.\n", base[0]); hr = IDirectDrawSurface_Unlock(dst_surface, NULL); - ok(SUCCEEDED(hr), "Failed to unlock surface, hr %#x.\n", hr); + ok(SUCCEEDED(hr), "Failed to unlock surface, hr %#lx.\n", hr); } IDirectDrawSurface_Release(dst_surface); @@ -10972,7 +10953,7 @@ static void test_offscreen_overlay(void) ddraw = create_ddraw(); ok(!!ddraw, "Failed to create a ddraw object.\n"); hr = IDirectDraw2_SetCooperativeLevel(ddraw, window, DDSCL_NORMAL); - ok(SUCCEEDED(hr), "Failed to set cooperative level, hr %#x.\n", hr); + ok(SUCCEEDED(hr), "Failed to set cooperative level, hr %#lx.\n", hr); if (!(overlay = create_overlay(ddraw, 64, 64, MAKEFOURCC('U','Y','V','Y')))) { @@ -10985,21 +10966,21 @@ static void test_offscreen_overlay(void) surface_desc.dwFlags = DDSD_CAPS; surface_desc.ddsCaps.dwCaps = DDSCAPS_PRIMARYSURFACE; hr = IDirectDraw2_CreateSurface(ddraw, &surface_desc, &primary, NULL); - ok(SUCCEEDED(hr), "Failed to create surface, hr %#x.\n",hr); + ok(SUCCEEDED(hr), "Failed to create surface, hr %#lx.\n",hr); /* On Windows 7, and probably Vista, UpdateOverlay() will return * DDERR_OUTOFCAPS if the dwm is active. Calling GetDC() on the primary * surface prevents this by disabling the dwm. */ hr = IDirectDrawSurface_GetDC(primary, &dc); - ok(SUCCEEDED(hr), "Failed to get DC, hr %#x.\n", hr); + ok(SUCCEEDED(hr), "Failed to get DC, hr %#lx.\n", hr); hr = IDirectDrawSurface_ReleaseDC(primary, dc); - ok(SUCCEEDED(hr), "Failed to release DC, hr %#x.\n", hr); + ok(SUCCEEDED(hr), "Failed to release DC, hr %#lx.\n", hr); /* Try to overlay a NULL surface. */ hr = IDirectDrawSurface_UpdateOverlay(overlay, NULL, NULL, NULL, DDOVER_SHOW, NULL); - ok(hr == DDERR_INVALIDPARAMS, "Got unexpected hr %#x.\n", hr); + ok(hr == DDERR_INVALIDPARAMS, "Got unexpected hr %#lx.\n", hr); hr = IDirectDrawSurface_UpdateOverlay(overlay, NULL, NULL, NULL, DDOVER_HIDE, NULL); - ok(hr == DDERR_INVALIDPARAMS, "Got unexpected hr %#x.\n", hr); + ok(hr == DDERR_INVALIDPARAMS, "Got unexpected hr %#lx.\n", hr); /* Try to overlay an offscreen surface. */ memset(&surface_desc, 0, sizeof(surface_desc)); @@ -11016,18 +10997,18 @@ static void test_offscreen_overlay(void) U3(surface_desc.ddpfPixelFormat).dwGBitMask = 0x07e0; U4(surface_desc.ddpfPixelFormat).dwBBitMask = 0x001f; hr = IDirectDraw2_CreateSurface(ddraw, &surface_desc, &offscreen, NULL); - ok(SUCCEEDED(hr), "Failed to create surface, hr %#x.\n",hr); + ok(SUCCEEDED(hr), "Failed to create surface, hr %#lx.\n",hr); hr = IDirectDrawSurface_UpdateOverlay(overlay, NULL, offscreen, NULL, DDOVER_SHOW, NULL); ok(SUCCEEDED(hr) || broken(hr == DDERR_OUTOFCAPS && dwm_enabled()) || broken(hr == E_NOTIMPL && ddraw_is_vmware(ddraw)), - "Failed to update overlay, hr %#x.\n", hr); + "Failed to update overlay, hr %#lx.\n", hr); /* Try to overlay the primary with a non-overlay surface. */ hr = IDirectDrawSurface_UpdateOverlay(offscreen, NULL, primary, NULL, DDOVER_SHOW, NULL); - ok(hr == DDERR_NOTAOVERLAYSURFACE, "Got unexpected hr %#x.\n", hr); + ok(hr == DDERR_NOTAOVERLAYSURFACE, "Got unexpected hr %#lx.\n", hr); hr = IDirectDrawSurface_UpdateOverlay(offscreen, NULL, primary, NULL, DDOVER_HIDE, NULL); - ok(hr == DDERR_NOTAOVERLAYSURFACE, "Got unexpected hr %#x.\n", hr); + ok(hr == DDERR_NOTAOVERLAYSURFACE, "Got unexpected hr %#lx.\n", hr); IDirectDrawSurface_Release(offscreen); IDirectDrawSurface_Release(primary); @@ -11052,7 +11033,7 @@ static void test_overlay_rect(void) ddraw = create_ddraw(); ok(!!ddraw, "Failed to create a ddraw object.\n"); hr = IDirectDraw2_SetCooperativeLevel(ddraw, window, DDSCL_NORMAL); - ok(SUCCEEDED(hr), "Failed to set cooperative level, hr %#x.\n", hr); + ok(SUCCEEDED(hr), "Failed to set cooperative level, hr %#lx.\n", hr); if (!(overlay = create_overlay(ddraw, 64, 64, MAKEFOURCC('U','Y','V','Y')))) { @@ -11065,15 +11046,15 @@ static void test_overlay_rect(void) surface_desc.dwFlags = DDSD_CAPS; surface_desc.ddsCaps.dwCaps = DDSCAPS_PRIMARYSURFACE; hr = IDirectDraw2_CreateSurface(ddraw, &surface_desc, &primary, NULL); - ok(SUCCEEDED(hr), "Failed to create surface, hr %#x.\n",hr); + ok(SUCCEEDED(hr), "Failed to create surface, hr %#lx.\n",hr); /* On Windows 7, and probably Vista, UpdateOverlay() will return * DDERR_OUTOFCAPS if the dwm is active. Calling GetDC() on the primary * surface prevents this by disabling the dwm. */ hr = IDirectDrawSurface_GetDC(primary, &dc); - ok(SUCCEEDED(hr), "Failed to get DC, hr %#x.\n", hr); + ok(SUCCEEDED(hr), "Failed to get DC, hr %#lx.\n", hr); hr = IDirectDrawSurface_ReleaseDC(primary, dc); - ok(SUCCEEDED(hr), "Failed to release DC, hr %#x.\n", hr); + ok(SUCCEEDED(hr), "Failed to release DC, hr %#lx.\n", hr); /* On Windows 8 and newer DWM can't be turned off, making overlays unusable. */ if (dwm_enabled()) @@ -11086,48 +11067,48 @@ static void test_overlay_rect(void) * used. This is not true in Windows Vista and earlier, but changed in * Windows 7. */ hr = IDirectDrawSurface_UpdateOverlay(overlay, NULL, primary, &rect, DDOVER_SHOW, NULL); - ok(SUCCEEDED(hr), "Failed to update overlay, hr %#x.\n", hr); + ok(SUCCEEDED(hr), "Failed to update overlay, hr %#lx.\n", hr); hr = IDirectDrawSurface_UpdateOverlay(overlay, NULL, primary, NULL, DDOVER_HIDE, NULL); - ok(SUCCEEDED(hr), "Failed to update overlay, hr %#x.\n", hr); + ok(SUCCEEDED(hr), "Failed to update overlay, hr %#lx.\n", hr); hr = IDirectDrawSurface_UpdateOverlay(overlay, NULL, primary, NULL, DDOVER_SHOW, NULL); - ok(hr == DD_OK || hr == DDERR_INVALIDPARAMS, "Got unexpected hr %#x.\n", hr); + ok(hr == DD_OK || hr == DDERR_INVALIDPARAMS, "Got unexpected hr %#lx.\n", hr); /* Show that the overlay position is the (top, left) coordinate of the * destination rectangle. */ OffsetRect(&rect, 32, 16); hr = IDirectDrawSurface_UpdateOverlay(overlay, NULL, primary, &rect, DDOVER_SHOW, NULL); - ok(SUCCEEDED(hr), "Failed to update overlay, hr %#x.\n", hr); + ok(SUCCEEDED(hr), "Failed to update overlay, hr %#lx.\n", hr); pos_x = -1; pos_y = -1; hr = IDirectDrawSurface_GetOverlayPosition(overlay, &pos_x, &pos_y); - ok(SUCCEEDED(hr), "Failed to get overlay position, hr %#x.\n", hr); - ok(pos_x == rect.left, "Got unexpected pos_x %d, expected %d.\n", pos_x, rect.left); - ok(pos_y == rect.top, "Got unexpected pos_y %d, expected %d.\n", pos_y, rect.top); + ok(SUCCEEDED(hr), "Failed to get overlay position, hr %#lx.\n", hr); + ok(pos_x == rect.left, "Got unexpected pos_x %ld, expected %ld.\n", pos_x, rect.left); + ok(pos_y == rect.top, "Got unexpected pos_y %ld, expected %ld.\n", pos_y, rect.top); /* Passing a NULL dest rect sets the position to 0/0. Visually it can be * seen that the overlay overlays the whole primary(==screen). */ hr2 = IDirectDrawSurface_UpdateOverlay(overlay, NULL, primary, NULL, 0, NULL); - ok(hr2 == DD_OK || hr2 == DDERR_INVALIDPARAMS || hr2 == DDERR_OUTOFCAPS, "Got unexpected hr %#x.\n", hr2); + ok(hr2 == DD_OK || hr2 == DDERR_INVALIDPARAMS || hr2 == DDERR_OUTOFCAPS, "Got unexpected hr %#lx.\n", hr2); hr = IDirectDrawSurface_GetOverlayPosition(overlay, &pos_x, &pos_y); - ok(SUCCEEDED(hr), "Failed to get overlay position, hr %#x.\n", hr); + ok(SUCCEEDED(hr), "Failed to get overlay position, hr %#lx.\n", hr); if (SUCCEEDED(hr2)) { - ok(!pos_x, "Got unexpected pos_x %d.\n", pos_x); - ok(!pos_y, "Got unexpected pos_y %d.\n", pos_y); + ok(!pos_x, "Got unexpected pos_x %ld.\n", pos_x); + ok(!pos_y, "Got unexpected pos_y %ld.\n", pos_y); } else { - ok(pos_x == 32, "Got unexpected pos_x %d.\n", pos_x); - ok(pos_y == 16, "Got unexpected pos_y %d.\n", pos_y); + ok(pos_x == 32, "Got unexpected pos_x %ld.\n", pos_x); + ok(pos_y == 16, "Got unexpected pos_y %ld.\n", pos_y); } /* The position cannot be retrieved when the overlay is not shown. */ hr = IDirectDrawSurface_UpdateOverlay(overlay, NULL, primary, &rect, DDOVER_HIDE, NULL); - ok(SUCCEEDED(hr), "Failed to update overlay, hr %#x.\n", hr); + ok(SUCCEEDED(hr), "Failed to update overlay, hr %#lx.\n", hr); pos_x = -1; pos_y = -1; hr = IDirectDrawSurface_GetOverlayPosition(overlay, &pos_x, &pos_y); - ok(hr == DDERR_OVERLAYNOTVISIBLE, "Got unexpected hr %#x.\n", hr); - ok(!pos_x, "Got unexpected pos_x %d.\n", pos_x); - ok(!pos_y, "Got unexpected pos_y %d.\n", pos_y); + ok(hr == DDERR_OVERLAYNOTVISIBLE, "Got unexpected hr %#lx.\n", hr); + ok(!pos_x, "Got unexpected pos_x %ld.\n", pos_x); + ok(!pos_y, "Got unexpected pos_y %ld.\n", pos_y); done: if (primary) @@ -11181,7 +11162,7 @@ static void test_blt(void) } hr = IDirect3DDevice2_GetRenderTarget(device, &rt); - ok(SUCCEEDED(hr), "Failed to get render target, hr %#x.\n", hr); + ok(SUCCEEDED(hr), "Failed to get render target, hr %#lx.\n", hr); memset(&surface_desc, 0, sizeof(surface_desc)); surface_desc.dwSize = sizeof(surface_desc); @@ -11190,36 +11171,36 @@ static void test_blt(void) surface_desc.dwHeight = 480; surface_desc.ddsCaps.dwCaps = DDSCAPS_OFFSCREENPLAIN; hr = IDirectDraw2_CreateSurface(ddraw, &surface_desc, &surface, NULL); - ok(SUCCEEDED(hr), "Failed to create surface, hr %#x.\n", hr); + ok(SUCCEEDED(hr), "Failed to create surface, hr %#lx.\n", hr); hr = IDirectDrawSurface_Blt(surface, NULL, surface, NULL, 0, NULL); - ok(SUCCEEDED(hr), "Failed to blit, hr %#x.\n", hr); + ok(SUCCEEDED(hr), "Failed to blit, hr %#lx.\n", hr); hr = IDirectDrawSurface_Blt(surface, NULL, rt, NULL, 0, NULL); - ok(SUCCEEDED(hr), "Failed to blit, hr %#x.\n", hr); + ok(SUCCEEDED(hr), "Failed to blit, hr %#lx.\n", hr); for (i = 0; i < ARRAY_SIZE(test_data); ++i) { hr = IDirectDrawSurface_Blt(surface, &test_data[i].dst_rect, surface, &test_data[i].src_rect, DDBLT_WAIT, NULL); - ok(hr == test_data[i].hr, "Test %u: Got unexpected hr %#x, expected %#x.\n", i, hr, test_data[i].hr); + ok(hr == test_data[i].hr, "Test %u: Got unexpected hr %#lx, expected %#lx.\n", i, hr, test_data[i].hr); hr = IDirectDrawSurface_Blt(surface, &test_data[i].dst_rect, rt, &test_data[i].src_rect, DDBLT_WAIT, NULL); - ok(hr == test_data[i].hr, "Test %u: Got unexpected hr %#x, expected %#x.\n", i, hr, test_data[i].hr); + ok(hr == test_data[i].hr, "Test %u: Got unexpected hr %#lx, expected %#lx.\n", i, hr, test_data[i].hr); hr = IDirectDrawSurface_Blt(surface, &test_data[i].dst_rect, NULL, &test_data[i].src_rect, DDBLT_WAIT, NULL); - ok(hr == DDERR_INVALIDPARAMS, "Test %u: Got unexpected hr %#x.\n", i, hr); + ok(hr == DDERR_INVALIDPARAMS, "Test %u: Got unexpected hr %#lx.\n", i, hr); hr = IDirectDrawSurface_Blt(surface, &test_data[i].dst_rect, NULL, NULL, DDBLT_WAIT, NULL); - ok(hr == DDERR_INVALIDPARAMS, "Test %u: Got unexpected hr %#x.\n", i, hr); + ok(hr == DDERR_INVALIDPARAMS, "Test %u: Got unexpected hr %#lx.\n", i, hr); } IDirectDrawSurface_Release(surface); IDirectDrawSurface_Release(rt); refcount = IDirect3DDevice2_Release(device); - ok(!refcount, "Device has %u references left.\n", refcount); + ok(!refcount, "Device has %lu references left.\n", refcount); IDirectDraw2_Release(ddraw); DestroyWindow(window); } @@ -11248,11 +11229,10 @@ static void test_blt_z_alpha(void) }; IDirectDrawSurface *src_surface, *dst_surface; DDSURFACEDESC surface_desc; + unsigned int color, i; IDirectDraw2 *ddraw; DDPIXELFORMAT pf; ULONG refcount; - unsigned int i; - D3DCOLOR color; HWND window; HRESULT hr; DDBLTFX fx; @@ -11261,7 +11241,7 @@ static void test_blt_z_alpha(void) ddraw = create_ddraw(); ok(!!ddraw, "Failed to create a ddraw object.\n"); hr = IDirectDraw2_SetCooperativeLevel(ddraw, window, DDSCL_NORMAL); - ok(SUCCEEDED(hr), "Failed to set cooperative level, hr %#x.\n", hr); + ok(SUCCEEDED(hr), "Failed to set cooperative level, hr %#lx.\n", hr); memset(&pf, 0, sizeof(pf)); pf.dwSize = sizeof(pf); @@ -11281,9 +11261,9 @@ static void test_blt_z_alpha(void) surface_desc.ddsCaps.dwCaps = DDSCAPS_OFFSCREENPLAIN; hr = IDirectDraw2_CreateSurface(ddraw, &surface_desc, &src_surface, NULL); - ok(SUCCEEDED(hr), "Failed to create source surface, hr %#x.\n", hr); + ok(SUCCEEDED(hr), "Failed to create source surface, hr %#lx.\n", hr); hr = IDirectDraw2_CreateSurface(ddraw, &surface_desc, &dst_surface, NULL); - ok(SUCCEEDED(hr), "Failed to create destination surface, hr %#x.\n", hr); + ok(SUCCEEDED(hr), "Failed to create destination surface, hr %#lx.\n", hr); memset(&fx, 0, sizeof(fx)); fx.dwSize = sizeof(fx); @@ -11303,14 +11283,14 @@ static void test_blt_z_alpha(void) { U5(fx).dwFillColor = 0x3300ff00; hr = IDirectDrawSurface_Blt(src_surface, NULL, NULL, NULL, DDBLT_COLORFILL | DDBLT_WAIT, &fx); - ok(SUCCEEDED(hr), "Test %u: Got unexpected hr %#x.\n", i, hr); + ok(SUCCEEDED(hr), "Test %u: Got unexpected hr %#lx.\n", i, hr); U5(fx).dwFillColor = 0xccff0000; hr = IDirectDrawSurface_Blt(dst_surface, NULL, NULL, NULL, DDBLT_COLORFILL | DDBLT_WAIT, &fx); - ok(SUCCEEDED(hr), "Test %u: Got unexpected hr %#x.\n", i, hr); + ok(SUCCEEDED(hr), "Test %u: Got unexpected hr %#lx.\n", i, hr); hr = IDirectDrawSurface_Blt(dst_surface, NULL, src_surface, NULL, blt_flags[i] | DDBLT_WAIT, &fx); - ok(SUCCEEDED(hr), "Test %u: Got unexpected hr %#x.\n", i, hr); + ok(SUCCEEDED(hr), "Test %u: Got unexpected hr %#lx.\n", i, hr); color = get_surface_color(dst_surface, 32, 32); ok(compare_color(color, 0x0000ff00, 0), "Test %u: Got unexpected color 0x%08x.\n", i, color); @@ -11319,7 +11299,7 @@ static void test_blt_z_alpha(void) IDirectDrawSurface_Release(dst_surface); IDirectDrawSurface_Release(src_surface); refcount = IDirectDraw2_Release(ddraw); - ok(!refcount, "DirectDraw has %u references left.\n", refcount); + ok(!refcount, "DirectDraw has %lu references left.\n", refcount); DestroyWindow(window); } @@ -11330,8 +11310,8 @@ static void test_cross_device_blt(void) IDirectDraw2 *ddraw, *ddraw2; DDSURFACEDESC surface_desc; HWND window, window2; + unsigned int color; ULONG refcount; - D3DCOLOR color; DDBLTFX fx; HRESULT hr; @@ -11365,7 +11345,7 @@ static void test_cross_device_blt(void) surface_desc.dwHeight = 480; surface_desc.ddsCaps.dwCaps = DDSCAPS_OFFSCREENPLAIN | DDSCAPS_SYSTEMMEMORY; hr = IDirectDraw2_CreateSurface(ddraw, &surface_desc, &sysmem_surface, NULL); - ok(SUCCEEDED(hr), "Failed to create surface, hr %#x.\n", hr); + ok(SUCCEEDED(hr), "Failed to create surface, hr %#lx.\n", hr); memset(&surface_desc, 0, sizeof(surface_desc)); surface_desc.dwSize = sizeof(surface_desc); @@ -11373,7 +11353,7 @@ static void test_cross_device_blt(void) surface_desc.ddsCaps.dwCaps = DDSCAPS_PRIMARYSURFACE | DDSCAPS_COMPLEX | DDSCAPS_FLIP | DDSCAPS_VIDEOMEMORY; surface_desc.dwBackBufferCount = 2; hr = IDirectDraw2_CreateSurface(ddraw, &surface_desc, &surface, NULL); - ok(SUCCEEDED(hr), "Failed to create surface, hr %#x.\n", hr); + ok(SUCCEEDED(hr), "Failed to create surface, hr %#lx.\n", hr); memset(&surface_desc, 0, sizeof(surface_desc)); surface_desc.dwSize = sizeof(surface_desc); @@ -11388,35 +11368,35 @@ static void test_cross_device_blt(void) U3(surface_desc.ddpfPixelFormat).dwGBitMask = 0x000003e0; U4(surface_desc.ddpfPixelFormat).dwBBitMask = 0x0000001f; hr = IDirectDraw2_CreateSurface(ddraw2, &surface_desc, &surface2, NULL); - ok(SUCCEEDED(hr), "Failed to create surface, hr %#x.\n", hr); + ok(SUCCEEDED(hr), "Failed to create surface, hr %#lx.\n", hr); memset(&fx, 0, sizeof(fx)); fx.dwSize = sizeof(fx); U5(fx).dwFillColor = 0xff0000ff; hr = IDirectDrawSurface_Blt(surface2, NULL, NULL, NULL, DDBLT_COLORFILL | DDBLT_WAIT, &fx); - ok(SUCCEEDED(hr), "Failed to fill surface, hr %#x.\n", hr); + ok(SUCCEEDED(hr), "Failed to fill surface, hr %#lx.\n", hr); hr = IDirectDrawSurface_Blt(surface, NULL, surface2, NULL, DDBLT_WAIT, NULL); - ok(hr == E_NOTIMPL, "Got unexpected hr %#x.\n", hr); + ok(hr == E_NOTIMPL, "Got unexpected hr %#lx.\n", hr); hr = IDirectDrawSurface_Flip(surface, NULL, DDFLIP_WAIT); - ok(hr == DD_OK, "Got unexpected hr %#x.\n", hr); + ok(hr == DD_OK, "Got unexpected hr %#lx.\n", hr); hr = IDirectDrawSurface_Blt(surface, NULL, surface2, NULL, DDBLT_WAIT, NULL); - ok(hr == E_NOTIMPL, "Got unexpected hr %#x.\n", hr); + ok(hr == E_NOTIMPL, "Got unexpected hr %#lx.\n", hr); color = get_surface_color(surface, 320, 240); ok(color == 0x00000000, "Got unexpected color 0x%08x.\n", color); hr = IDirectDrawSurface_Blt(sysmem_surface, NULL, surface2, NULL, DDBLT_WAIT, NULL); - ok(hr == E_NOTIMPL, "Got unexpected hr %#x.\n", hr); + ok(hr == E_NOTIMPL, "Got unexpected hr %#lx.\n", hr); color = get_surface_color(sysmem_surface, 320, 240); ok(color == 0x00000000, "Got unexpected color 0x%08x.\n", color); hr = IDirectDraw2_SetCooperativeLevel(ddraw, window, DDSCL_NORMAL); - ok(SUCCEEDED(hr), "Failed to set cooperative level, hr %#x.\n", hr); + ok(SUCCEEDED(hr), "Failed to set cooperative level, hr %#lx.\n", hr); hr = IDirectDrawSurface_IsLost(sysmem_surface); - ok(hr == D3D_OK, "Got unexpected hr %#x.\n", hr); + ok(hr == D3D_OK, "Got unexpected hr %#lx.\n", hr); hr = IDirectDrawSurface_Blt(sysmem_surface, NULL, surface2, NULL, DDBLT_WAIT, NULL); - ok(hr == E_NOTIMPL, "Got unexpected hr %#x.\n", hr); + ok(hr == E_NOTIMPL, "Got unexpected hr %#lx.\n", hr); color = get_surface_color(sysmem_surface, 320, 240); ok(color == 0x00000000, "Got unexpected color 0x%08x.\n", color); @@ -11428,12 +11408,12 @@ static void test_cross_device_blt(void) surface_desc.dwHeight = 480; surface_desc.ddsCaps.dwCaps = DDSCAPS_OFFSCREENPLAIN | DDSCAPS_SYSTEMMEMORY; hr = IDirectDraw2_CreateSurface(ddraw2, &surface_desc, &surface2, NULL); - ok(SUCCEEDED(hr), "Failed to create surface, hr %#x.\n", hr); + ok(SUCCEEDED(hr), "Failed to create surface, hr %#lx.\n", hr); hr = IDirectDrawSurface_Blt(surface2, NULL, NULL, NULL, DDBLT_COLORFILL | DDBLT_WAIT, &fx); - ok(SUCCEEDED(hr), "Failed to fill surface, hr %#x.\n", hr); + ok(SUCCEEDED(hr), "Failed to fill surface, hr %#lx.\n", hr); hr = IDirectDrawSurface_Blt(sysmem_surface, NULL, surface2, NULL, DDBLT_WAIT, NULL); - todo_wine ok(hr == D3D_OK, "Failed to blit, hr %#x.\n", hr); + todo_wine ok(hr == D3D_OK, "Failed to blit, hr %#lx.\n", hr); color = get_surface_color(sysmem_surface, 320, 240); todo_wine ok(compare_color(color, 0x000000ff, 1), "Got unexpected color 0x%08x.\n", color); @@ -11441,9 +11421,9 @@ static void test_cross_device_blt(void) IDirectDrawSurface_Release(surface2); IDirectDrawSurface_Release(sysmem_surface); refcount = IDirect3DDevice2_Release(device); - ok(!refcount, "Device has %u references left.\n", refcount); + ok(!refcount, "Device has %lu references left.\n", refcount); refcount = IDirect3DDevice2_Release(device2); - ok(!refcount, "Device has %u references left.\n", refcount); + ok(!refcount, "Device has %lu references left.\n", refcount); IDirectDraw2_Release(ddraw); IDirectDraw2_Release(ddraw2); DestroyWindow(window); @@ -11518,11 +11498,11 @@ static void test_getdc(void) ddraw = create_ddraw(); ok(!!ddraw, "Failed to create a ddraw object.\n"); hr = IDirectDraw2_SetCooperativeLevel(ddraw, window, DDSCL_NORMAL); - ok(SUCCEEDED(hr), "Failed to set cooperative level, hr %#x.\n", hr); + ok(SUCCEEDED(hr), "Failed to set cooperative level, hr %#lx.\n", hr); surface_desc.dwSize = sizeof(surface_desc); hr = IDirectDraw2_GetDisplayMode(ddraw, &surface_desc); - ok(SUCCEEDED(hr), "Failed to get display mode, hr %#x.\n", hr); + ok(SUCCEEDED(hr), "Failed to get display mode, hr %#lx.\n", hr); screen_bpp = U1(surface_desc.ddpfPixelFormat).dwRGBBitCount; for (i = 0; i < ARRAY_SIZE(test_data); ++i) @@ -11540,7 +11520,7 @@ static void test_getdc(void) surface_desc.ddsCaps.dwCaps = DDSCAPS_TEXTURE; if (FAILED(hr = IDirectDraw2_CreateSurface(ddraw, &surface_desc, &surface, NULL))) { - skip("Failed to create surface for format %s (hr %#x), skipping tests.\n", test_data[i].name, hr); + skip("Failed to create surface for format %s (hr %#lx), skipping tests.\n", test_data[i].name, hr); continue; } } @@ -11549,9 +11529,9 @@ static void test_getdc(void) hr = IDirectDrawSurface_GetDC(surface, &dc); if (test_data[i].getdc_supported) ok(SUCCEEDED(hr) || broken(hr == test_data[i].alt_result || ddraw_is_vmware(ddraw)), - "Got unexpected hr %#x for format %s.\n", hr, test_data[i].name); + "Got unexpected hr %#lx for format %s.\n", hr, test_data[i].name); else - ok(FAILED(hr), "Got unexpected hr %#x for format %s.\n", hr, test_data[i].name); + ok(FAILED(hr), "Got unexpected hr %#lx for format %s.\n", hr, test_data[i].name); if (SUCCEEDED(hr)) { @@ -11562,10 +11542,10 @@ static void test_getdc(void) int size; type = GetObjectType(dc); - ok(type == OBJ_MEMDC, "Got unexpected object type %#x for format %s.\n", type, test_data[i].name); + ok(type == OBJ_MEMDC, "Got unexpected object type %#lx for format %s.\n", type, test_data[i].name); bitmap = GetCurrentObject(dc, OBJ_BITMAP); type = GetObjectType(bitmap); - ok(type == OBJ_BITMAP, "Got unexpected object type %#x for format %s.\n", type, test_data[i].name); + ok(type == OBJ_BITMAP, "Got unexpected object type %#lx for format %s.\n", type, test_data[i].name); size = GetObjectA(bitmap, sizeof(dib), &dib); ok(size == sizeof(dib), "Got unexpected size %d for format %s.\n", size, test_data[i].name); @@ -11589,11 +11569,11 @@ static void test_getdc(void) ok(!!dib.dsBm.bmBits || broken(!pDwmIsCompositionEnabled && dib.dsBm.bmBitsPixel == screen_bpp), "Got unexpected bits %p for format %s.\n", dib.dsBm.bmBits, test_data[i].name); - ok(dib.dsBmih.biSize == sizeof(dib.dsBmih), "Got unexpected size %u for format %s.\n", + ok(dib.dsBmih.biSize == sizeof(dib.dsBmih), "Got unexpected size %lu for format %s.\n", dib.dsBmih.biSize, test_data[i].name); - ok(dib.dsBmih.biWidth == surface_desc.dwWidth, "Got unexpected width %d for format %s.\n", + ok(dib.dsBmih.biWidth == surface_desc.dwWidth, "Got unexpected width %ld for format %s.\n", dib.dsBmih.biHeight, test_data[i].name); - ok(dib.dsBmih.biHeight == surface_desc.dwHeight, "Got unexpected height %d for format %s.\n", + ok(dib.dsBmih.biHeight == surface_desc.dwHeight, "Got unexpected height %ld for format %s.\n", dib.dsBmih.biHeight, test_data[i].name); ok(dib.dsBmih.biPlanes == 1, "Got unexpected plane count %u for format %s.\n", dib.dsBmih.biPlanes, test_data[i].name); @@ -11602,17 +11582,17 @@ static void test_getdc(void) dib.dsBmih.biBitCount, test_data[i].name); ok(dib.dsBmih.biCompression == (U1(test_data[i].format).dwRGBBitCount == 16 ? BI_BITFIELDS : BI_RGB) || broken(U1(test_data[i].format).dwRGBBitCount == 32 && dib.dsBmih.biCompression == BI_BITFIELDS), - "Got unexpected compression %#x for format %s.\n", + "Got unexpected compression %#lx for format %s.\n", dib.dsBmih.biCompression, test_data[i].name); - ok(!dib.dsBmih.biSizeImage, "Got unexpected image size %u for format %s.\n", + ok(!dib.dsBmih.biSizeImage, "Got unexpected image size %lu for format %s.\n", dib.dsBmih.biSizeImage, test_data[i].name); - ok(!dib.dsBmih.biXPelsPerMeter, "Got unexpected horizontal resolution %d for format %s.\n", + ok(!dib.dsBmih.biXPelsPerMeter, "Got unexpected horizontal resolution %ld for format %s.\n", dib.dsBmih.biXPelsPerMeter, test_data[i].name); - ok(!dib.dsBmih.biYPelsPerMeter, "Got unexpected vertical resolution %d for format %s.\n", + ok(!dib.dsBmih.biYPelsPerMeter, "Got unexpected vertical resolution %ld for format %s.\n", dib.dsBmih.biYPelsPerMeter, test_data[i].name); - ok(!dib.dsBmih.biClrUsed, "Got unexpected used colour count %u for format %s.\n", + ok(!dib.dsBmih.biClrUsed, "Got unexpected used colour count %lu for format %s.\n", dib.dsBmih.biClrUsed, test_data[i].name); - ok(!dib.dsBmih.biClrImportant, "Got unexpected important colour count %u for format %s.\n", + ok(!dib.dsBmih.biClrImportant, "Got unexpected important colour count %lu for format %s.\n", dib.dsBmih.biClrImportant, test_data[i].name); if (dib.dsBmih.biCompression == BI_BITFIELDS) @@ -11621,20 +11601,20 @@ static void test_getdc(void) && dib.dsBitfields[1] == U3(test_data[i].format).dwGBitMask && dib.dsBitfields[2] == U4(test_data[i].format).dwBBitMask) || broken(!dib.dsBitfields[0] && !dib.dsBitfields[1] && !dib.dsBitfields[2]), - "Got unexpected colour masks 0x%08x 0x%08x 0x%08x for format %s.\n", + "Got unexpected colour masks 0x%08lx 0x%08lx 0x%08lx for format %s.\n", dib.dsBitfields[0], dib.dsBitfields[1], dib.dsBitfields[2], test_data[i].name); } else { ok(!dib.dsBitfields[0] && !dib.dsBitfields[1] && !dib.dsBitfields[2], - "Got unexpected colour masks 0x%08x 0x%08x 0x%08x for format %s.\n", + "Got unexpected colour masks 0x%08lx 0x%08lx 0x%08lx for format %s.\n", dib.dsBitfields[0], dib.dsBitfields[1], dib.dsBitfields[2], test_data[i].name); } ok(!dib.dshSection, "Got unexpected section %p for format %s.\n", dib.dshSection, test_data[i].name); - ok(!dib.dsOffset, "Got unexpected offset %u for format %s.\n", dib.dsOffset, test_data[i].name); + ok(!dib.dsOffset, "Got unexpected offset %lu for format %s.\n", dib.dsOffset, test_data[i].name); hr = IDirectDrawSurface_ReleaseDC(surface, dc); - ok(hr == DD_OK, "Failed to release DC for format %s, hr %#x.\n", test_data[i].name, hr); + ok(hr == DD_OK, "Failed to release DC for format %s, hr %#lx.\n", test_data[i].name, hr); } else { @@ -11649,152 +11629,152 @@ static void test_getdc(void) surface_desc.ddsCaps.dwCaps = DDSCAPS_TEXTURE | DDSCAPS_COMPLEX | DDSCAPS_MIPMAP; if (FAILED(hr = IDirectDraw2_CreateSurface(ddraw, &surface_desc, &surface, NULL))) { - skip("Failed to create mip-mapped texture for format %s (hr %#x), skipping tests.\n", + skip("Failed to create mip-mapped texture for format %s (hr %#lx), skipping tests.\n", test_data[i].name, hr); continue; } hr = IDirectDrawSurface_GetAttachedSurface(surface, &caps, &tmp); - ok(SUCCEEDED(hr), "Failed to get attached surface for format %s, hr %#x.\n", test_data[i].name, hr); + ok(SUCCEEDED(hr), "Failed to get attached surface for format %s, hr %#lx.\n", test_data[i].name, hr); hr = IDirectDrawSurface_GetAttachedSurface(tmp, &caps, &surface2); - ok(SUCCEEDED(hr), "Failed to get attached surface for format %s, hr %#x.\n", test_data[i].name, hr); + ok(SUCCEEDED(hr), "Failed to get attached surface for format %s, hr %#lx.\n", test_data[i].name, hr); IDirectDrawSurface_Release(tmp); hr = IDirectDrawSurface_GetDC(surface, &dc); - ok(SUCCEEDED(hr), "Failed to get DC for format %s, hr %#x.\n", test_data[i].name, hr); + ok(SUCCEEDED(hr), "Failed to get DC for format %s, hr %#lx.\n", test_data[i].name, hr); hr = IDirectDrawSurface_ReleaseDC(surface, dc); - ok(SUCCEEDED(hr), "Failed to release DC for format %s, hr %#x.\n", test_data[i].name, hr); + ok(SUCCEEDED(hr), "Failed to release DC for format %s, hr %#lx.\n", test_data[i].name, hr); hr = IDirectDrawSurface_GetDC(surface2, &dc); - ok(SUCCEEDED(hr), "Failed to get DC for format %s, hr %#x.\n", test_data[i].name, hr); + ok(SUCCEEDED(hr), "Failed to get DC for format %s, hr %#lx.\n", test_data[i].name, hr); hr = IDirectDrawSurface_ReleaseDC(surface2, dc); - ok(SUCCEEDED(hr), "Failed to release DC for format %s, hr %#x.\n", test_data[i].name, hr); + ok(SUCCEEDED(hr), "Failed to release DC for format %s, hr %#lx.\n", test_data[i].name, hr); hr = IDirectDrawSurface_GetDC(surface, &dc); - ok(SUCCEEDED(hr), "Failed to get DC for format %s, hr %#x.\n", test_data[i].name, hr); + ok(SUCCEEDED(hr), "Failed to get DC for format %s, hr %#lx.\n", test_data[i].name, hr); dc2 = (void *)0x1234; hr = IDirectDrawSurface_GetDC(surface, &dc2); - ok(hr == DDERR_DCALREADYCREATED, "Got unexpected hr %#x for format %s.\n", hr, test_data[i].name); + ok(hr == DDERR_DCALREADYCREATED, "Got unexpected hr %#lx for format %s.\n", hr, test_data[i].name); ok(dc2 == (void *)0x1234, "Got unexpected dc %p for format %s.\n", dc, test_data[i].name); hr = IDirectDrawSurface_ReleaseDC(surface, dc); - ok(SUCCEEDED(hr), "Failed to release DC for format %s, hr %#x.\n", test_data[i].name, hr); + ok(SUCCEEDED(hr), "Failed to release DC for format %s, hr %#lx.\n", test_data[i].name, hr); hr = IDirectDrawSurface_ReleaseDC(surface, dc); - ok(hr == DDERR_NODC, "Got unexpected hr %#x for format %s.\n", hr, test_data[i].name); + ok(hr == DDERR_NODC, "Got unexpected hr %#lx for format %s.\n", hr, test_data[i].name); map_desc.dwSize = sizeof(map_desc); hr = IDirectDrawSurface_Lock(surface, NULL, &map_desc, DDLOCK_READONLY | DDLOCK_WAIT, NULL); - ok(SUCCEEDED(hr), "Failed to map surface for format %s, hr %#x.\n", test_data[i].name, hr); + ok(SUCCEEDED(hr), "Failed to map surface for format %s, hr %#lx.\n", test_data[i].name, hr); hr = IDirectDrawSurface_Lock(surface, NULL, &map_desc, DDLOCK_READONLY | DDLOCK_WAIT, NULL); - ok(hr == DDERR_SURFACEBUSY, "Got unexpected hr %#x for format %s.\n", hr, test_data[i].name); + ok(hr == DDERR_SURFACEBUSY, "Got unexpected hr %#lx for format %s.\n", hr, test_data[i].name); hr = IDirectDrawSurface_Unlock(surface, NULL); - ok(SUCCEEDED(hr), "Failed to unmap surface for format %s, hr %#x.\n", test_data[i].name, hr); + ok(SUCCEEDED(hr), "Failed to unmap surface for format %s, hr %#lx.\n", test_data[i].name, hr); hr = IDirectDrawSurface_Unlock(surface, NULL); - ok(hr == DDERR_NOTLOCKED, "Got unexpected hr %#x for format %s.\n", hr, test_data[i].name); + ok(hr == DDERR_NOTLOCKED, "Got unexpected hr %#lx for format %s.\n", hr, test_data[i].name); hr = IDirectDrawSurface_GetDC(surface, &dc); - ok(SUCCEEDED(hr), "Failed to get DC for format %s, hr %#x.\n", test_data[i].name, hr); + ok(SUCCEEDED(hr), "Failed to get DC for format %s, hr %#lx.\n", test_data[i].name, hr); hr = IDirectDrawSurface_Lock(surface, NULL, &map_desc, DDLOCK_READONLY | DDLOCK_WAIT, NULL); - ok(hr == DDERR_SURFACEBUSY, "Got unexpected hr %#x for format %s.\n", hr, test_data[i].name); + ok(hr == DDERR_SURFACEBUSY, "Got unexpected hr %#lx for format %s.\n", hr, test_data[i].name); hr = IDirectDrawSurface_ReleaseDC(surface, dc); - ok(SUCCEEDED(hr), "Failed to release DC for format %s, hr %#x.\n", test_data[i].name, hr); + ok(SUCCEEDED(hr), "Failed to release DC for format %s, hr %#lx.\n", test_data[i].name, hr); hr = IDirectDrawSurface_Lock(surface, NULL, &map_desc, DDLOCK_READONLY | DDLOCK_WAIT, NULL); - ok(SUCCEEDED(hr), "Failed to map surface for format %s, hr %#x.\n", test_data[i].name, hr); + ok(SUCCEEDED(hr), "Failed to map surface for format %s, hr %#lx.\n", test_data[i].name, hr); hr = IDirectDrawSurface_GetDC(surface, &dc); - ok(SUCCEEDED(hr), "Failed to get DC for format %s, hr %#x.\n", test_data[i].name, hr); + ok(SUCCEEDED(hr), "Failed to get DC for format %s, hr %#lx.\n", test_data[i].name, hr); hr = IDirectDrawSurface_ReleaseDC(surface, dc); - ok(SUCCEEDED(hr), "Failed to release DC for format %s, hr %#x.\n", test_data[i].name, hr); + ok(SUCCEEDED(hr), "Failed to release DC for format %s, hr %#lx.\n", test_data[i].name, hr); /* Geforce 9600, Windows 7 returns E_FAIL. The unlock still seems to work as intended, after- * wards the surface can be locked again. ReleaseDC() does not unlock the surface, trying to * Lock it after ReleaseDC returns DDERR_SURFACEBUSY. ddraw4 and 7 are unaffected. */ hr = IDirectDrawSurface_Unlock(surface, NULL); ok(SUCCEEDED(hr) || broken(ddraw_is_nvidia(ddraw) && hr == E_FAIL), - "Failed to unmap surface for format %s, hr %#x.\n", test_data[i].name, hr); + "Failed to unmap surface for format %s, hr %#lx.\n", test_data[i].name, hr); hr = IDirectDrawSurface_GetDC(surface, &dc); - ok(SUCCEEDED(hr), "Failed to get DC for format %s, hr %#x.\n", test_data[i].name, hr); + ok(SUCCEEDED(hr), "Failed to get DC for format %s, hr %#lx.\n", test_data[i].name, hr); hr = IDirectDrawSurface_GetDC(surface2, &dc2); - ok(SUCCEEDED(hr), "Failed to get DC for format %s, hr %#x.\n", test_data[i].name, hr); + ok(SUCCEEDED(hr), "Failed to get DC for format %s, hr %#lx.\n", test_data[i].name, hr); hr = IDirectDrawSurface_ReleaseDC(surface2, dc2); - ok(SUCCEEDED(hr), "Failed to release DC for format %s, hr %#x.\n", test_data[i].name, hr); + ok(SUCCEEDED(hr), "Failed to release DC for format %s, hr %#lx.\n", test_data[i].name, hr); hr = IDirectDrawSurface_ReleaseDC(surface, dc); - ok(SUCCEEDED(hr), "Failed to release DC for format %s, hr %#x.\n", test_data[i].name, hr); + ok(SUCCEEDED(hr), "Failed to release DC for format %s, hr %#lx.\n", test_data[i].name, hr); hr = IDirectDrawSurface_GetDC(surface2, &dc); - ok(SUCCEEDED(hr), "Failed to get DC for format %s, hr %#x.\n", test_data[i].name, hr); + ok(SUCCEEDED(hr), "Failed to get DC for format %s, hr %#lx.\n", test_data[i].name, hr); hr = IDirectDrawSurface_GetDC(surface, &dc2); - ok(SUCCEEDED(hr), "Failed to get DC for format %s, hr %#x.\n", test_data[i].name, hr); + ok(SUCCEEDED(hr), "Failed to get DC for format %s, hr %#lx.\n", test_data[i].name, hr); hr = IDirectDrawSurface_ReleaseDC(surface, dc2); - ok(SUCCEEDED(hr), "Failed to release DC for format %s, hr %#x.\n", test_data[i].name, hr); + ok(SUCCEEDED(hr), "Failed to release DC for format %s, hr %#lx.\n", test_data[i].name, hr); hr = IDirectDrawSurface_ReleaseDC(surface2, dc); - ok(SUCCEEDED(hr), "Failed to release DC for format %s, hr %#x.\n", test_data[i].name, hr); + ok(SUCCEEDED(hr), "Failed to release DC for format %s, hr %#lx.\n", test_data[i].name, hr); hr = IDirectDrawSurface_Lock(surface, NULL, &map_desc, DDLOCK_READONLY | DDLOCK_WAIT, NULL); - ok(SUCCEEDED(hr), "Failed to map surface for format %s, hr %#x.\n", test_data[i].name, hr); + ok(SUCCEEDED(hr), "Failed to map surface for format %s, hr %#lx.\n", test_data[i].name, hr); hr = IDirectDrawSurface_Lock(surface2, NULL, &map_desc, DDLOCK_READONLY | DDLOCK_WAIT, NULL); - ok(SUCCEEDED(hr), "Failed to map surface for format %s, hr %#x.\n", test_data[i].name, hr); + ok(SUCCEEDED(hr), "Failed to map surface for format %s, hr %#lx.\n", test_data[i].name, hr); hr = IDirectDrawSurface_Unlock(surface2, NULL); - ok(SUCCEEDED(hr), "Failed to unmap surface for format %s, hr %#x.\n", test_data[i].name, hr); + ok(SUCCEEDED(hr), "Failed to unmap surface for format %s, hr %#lx.\n", test_data[i].name, hr); hr = IDirectDrawSurface_Unlock(surface, NULL); - ok(SUCCEEDED(hr), "Failed to unmap surface for format %s, hr %#x.\n", test_data[i].name, hr); + ok(SUCCEEDED(hr), "Failed to unmap surface for format %s, hr %#lx.\n", test_data[i].name, hr); hr = IDirectDrawSurface_Lock(surface, NULL, &map_desc, DDLOCK_READONLY | DDLOCK_WAIT, NULL); - ok(SUCCEEDED(hr), "Failed to map surface for format %s, hr %#x.\n", test_data[i].name, hr); + ok(SUCCEEDED(hr), "Failed to map surface for format %s, hr %#lx.\n", test_data[i].name, hr); hr = IDirectDrawSurface_GetDC(surface, &dc); - ok(SUCCEEDED(hr), "Failed to get DC for format %s, hr %#x.\n", test_data[i].name, hr); + ok(SUCCEEDED(hr), "Failed to get DC for format %s, hr %#lx.\n", test_data[i].name, hr); hr = IDirectDrawSurface_ReleaseDC(surface, dc); - ok(SUCCEEDED(hr), "Failed to release DC for format %s, hr %#x.\n", test_data[i].name, hr); + ok(SUCCEEDED(hr), "Failed to release DC for format %s, hr %#lx.\n", test_data[i].name, hr); hr = IDirectDrawSurface_Unlock(surface, NULL); ok(SUCCEEDED(hr) || broken(ddraw_is_nvidia(ddraw) && hr == E_FAIL), - "Failed to unmap surface for format %s, hr %#x.\n", test_data[i].name, hr); + "Failed to unmap surface for format %s, hr %#lx.\n", test_data[i].name, hr); hr = IDirectDrawSurface_Lock(surface2, NULL, &map_desc, DDLOCK_READONLY | DDLOCK_WAIT, NULL); - ok(SUCCEEDED(hr), "Failed to map surface for format %s, hr %#x.\n", test_data[i].name, hr); + ok(SUCCEEDED(hr), "Failed to map surface for format %s, hr %#lx.\n", test_data[i].name, hr); hr = IDirectDrawSurface_GetDC(surface, &dc); - ok(SUCCEEDED(hr), "Failed to get DC for format %s, hr %#x.\n", test_data[i].name, hr); + ok(SUCCEEDED(hr), "Failed to get DC for format %s, hr %#lx.\n", test_data[i].name, hr); hr = IDirectDrawSurface_ReleaseDC(surface, dc); - ok(SUCCEEDED(hr), "Failed to release DC for format %s, hr %#x.\n", test_data[i].name, hr); + ok(SUCCEEDED(hr), "Failed to release DC for format %s, hr %#lx.\n", test_data[i].name, hr); hr = IDirectDrawSurface_Unlock(surface2, NULL); - ok(SUCCEEDED(hr), "Failed to unmap surface for format %s, hr %#x.\n", test_data[i].name, hr); + ok(SUCCEEDED(hr), "Failed to unmap surface for format %s, hr %#lx.\n", test_data[i].name, hr); hr = IDirectDrawSurface_GetDC(surface, &dc); - ok(SUCCEEDED(hr), "Failed to get DC for format %s, hr %#x.\n", test_data[i].name, hr); + ok(SUCCEEDED(hr), "Failed to get DC for format %s, hr %#lx.\n", test_data[i].name, hr); hr = IDirectDrawSurface_Lock(surface2, NULL, &map_desc, DDLOCK_READONLY | DDLOCK_WAIT, NULL); - ok(SUCCEEDED(hr), "Failed to map surface for format %s, hr %#x.\n", test_data[i].name, hr); + ok(SUCCEEDED(hr), "Failed to map surface for format %s, hr %#lx.\n", test_data[i].name, hr); hr = IDirectDrawSurface_Unlock(surface2, NULL); - ok(SUCCEEDED(hr), "Failed to unmap surface for format %s, hr %#x.\n", test_data[i].name, hr); + ok(SUCCEEDED(hr), "Failed to unmap surface for format %s, hr %#lx.\n", test_data[i].name, hr); hr = IDirectDrawSurface_ReleaseDC(surface, dc); - ok(SUCCEEDED(hr), "Failed to release DC for format %s, hr %#x.\n", test_data[i].name, hr); + ok(SUCCEEDED(hr), "Failed to release DC for format %s, hr %#lx.\n", test_data[i].name, hr); hr = IDirectDrawSurface_GetDC(surface2, &dc); - ok(SUCCEEDED(hr), "Failed to get DC for format %s, hr %#x.\n", test_data[i].name, hr); + ok(SUCCEEDED(hr), "Failed to get DC for format %s, hr %#lx.\n", test_data[i].name, hr); hr = IDirectDrawSurface_Lock(surface, NULL, &map_desc, DDLOCK_READONLY | DDLOCK_WAIT, NULL); - ok(SUCCEEDED(hr), "Failed to map surface for format %s, hr %#x.\n", test_data[i].name, hr); + ok(SUCCEEDED(hr), "Failed to map surface for format %s, hr %#lx.\n", test_data[i].name, hr); hr = IDirectDrawSurface_Unlock(surface, NULL); - ok(SUCCEEDED(hr), "Failed to unmap surface for format %s, hr %#x.\n", test_data[i].name, hr); + ok(SUCCEEDED(hr), "Failed to unmap surface for format %s, hr %#lx.\n", test_data[i].name, hr); hr = IDirectDrawSurface_ReleaseDC(surface2, dc); - ok(SUCCEEDED(hr), "Failed to release DC for format %s, hr %#x.\n", test_data[i].name, hr); + ok(SUCCEEDED(hr), "Failed to release DC for format %s, hr %#lx.\n", test_data[i].name, hr); hr = IDirectDrawSurface_Unlock(surface, NULL); - ok(hr == DDERR_NOTLOCKED, "Got unexpected hr %#x for format %s.\n", hr, test_data[i].name); + ok(hr == DDERR_NOTLOCKED, "Got unexpected hr %#lx for format %s.\n", hr, test_data[i].name); hr = IDirectDrawSurface_GetDC(surface2, &dc); - ok(SUCCEEDED(hr), "Failed to get DC for format %s, hr %#x.\n", test_data[i].name, hr); + ok(SUCCEEDED(hr), "Failed to get DC for format %s, hr %#lx.\n", test_data[i].name, hr); hr = IDirectDrawSurface_Unlock(surface, NULL); - ok(hr == DDERR_NOTLOCKED, "Got unexpected hr %#x for format %s.\n", hr, test_data[i].name); + ok(hr == DDERR_NOTLOCKED, "Got unexpected hr %#lx for format %s.\n", hr, test_data[i].name); hr = IDirectDrawSurface_ReleaseDC(surface2, dc); - ok(SUCCEEDED(hr), "Failed to release DC for format %s, hr %#x.\n", test_data[i].name, hr); + ok(SUCCEEDED(hr), "Failed to release DC for format %s, hr %#lx.\n", test_data[i].name, hr); hr = IDirectDrawSurface_Unlock(surface, NULL); - ok(hr == DDERR_NOTLOCKED, "Got unexpected hr %#x for format %s.\n", hr, test_data[i].name); + ok(hr == DDERR_NOTLOCKED, "Got unexpected hr %#lx for format %s.\n", hr, test_data[i].name); hr = IDirectDrawSurface_Unlock(surface2, NULL); - ok(hr == DDERR_NOTLOCKED, "Got unexpected hr %#x for format %s.\n", hr, test_data[i].name); + ok(hr == DDERR_NOTLOCKED, "Got unexpected hr %#lx for format %s.\n", hr, test_data[i].name); hr = IDirectDrawSurface_GetDC(surface, &dc); - ok(SUCCEEDED(hr), "Failed to get DC for format %s, hr %#x.\n", test_data[i].name, hr); + ok(SUCCEEDED(hr), "Failed to get DC for format %s, hr %#lx.\n", test_data[i].name, hr); hr = IDirectDrawSurface_Unlock(surface2, NULL); - ok(hr == DDERR_NOTLOCKED, "Got unexpected hr %#x for format %s.\n", hr, test_data[i].name); + ok(hr == DDERR_NOTLOCKED, "Got unexpected hr %#lx for format %s.\n", hr, test_data[i].name); hr = IDirectDrawSurface_ReleaseDC(surface, dc); - ok(SUCCEEDED(hr), "Failed to release DC for format %s, hr %#x.\n", test_data[i].name, hr); + ok(SUCCEEDED(hr), "Failed to release DC for format %s, hr %#lx.\n", test_data[i].name, hr); hr = IDirectDrawSurface_Unlock(surface2, NULL); - ok(hr == DDERR_NOTLOCKED, "Got unexpected hr %#x for format %s.\n", hr, test_data[i].name); + ok(hr == DDERR_NOTLOCKED, "Got unexpected hr %#lx for format %s.\n", hr, test_data[i].name); IDirectDrawSurface_Release(surface2); IDirectDrawSurface_Release(surface); @@ -11835,31 +11815,31 @@ static void test_draw_primitive(void) viewport = create_viewport(device, 0, 0, 640, 480); hr = IDirect3DDevice2_SetCurrentViewport(device, viewport); - ok(SUCCEEDED(hr), "Failed to activate the viewport, hr %#x.\n", hr); + ok(SUCCEEDED(hr), "Failed to activate the viewport, hr %#lx.\n", hr); hr = IDirect3DDevice2_GetDirect3D(device, &d3d); - ok(SUCCEEDED(hr), "Failed to get D3D interface, hr %#x.\n", hr); + ok(SUCCEEDED(hr), "Failed to get D3D interface, hr %#lx.\n", hr); IDirect3D2_Release(d3d); hr = IDirect3DDevice2_DrawIndexedPrimitive(device, D3DPT_TRIANGLESTRIP, D3DFVF_XYZ, NULL, 0, NULL, 0, 0); - ok(SUCCEEDED(hr), "Failed to draw, hr %#x.\n", hr); + ok(SUCCEEDED(hr), "Failed to draw, hr %#lx.\n", hr); hr = IDirect3DDevice2_DrawPrimitive(device, D3DPT_TRIANGLESTRIP, D3DFVF_XYZ, NULL, 0, 0); - ok(SUCCEEDED(hr), "Failed to draw, hr %#x.\n", hr); + ok(SUCCEEDED(hr), "Failed to draw, hr %#lx.\n", hr); hr = IDirect3DDevice2_DrawIndexedPrimitive(device, D3DPT_TRIANGLESTRIP, D3DFVF_XYZ, NULL, 0, indices, 4, 0); - ok(SUCCEEDED(hr), "Failed to draw, hr %#x.\n", hr); + ok(SUCCEEDED(hr), "Failed to draw, hr %#lx.\n", hr); hr = IDirect3DDevice2_DrawIndexedPrimitive(device, D3DPT_TRIANGLESTRIP, D3DFVF_XYZ, quad, 4, NULL, 0, 0); - ok(SUCCEEDED(hr), "Failed to draw, hr %#x.\n", hr); + ok(SUCCEEDED(hr), "Failed to draw, hr %#lx.\n", hr); hr = IDirect3DDevice2_DrawPrimitive(device, D3DPT_TRIANGLESTRIP, D3DFVF_XYZ, quad, 4, 0); - ok(SUCCEEDED(hr), "Failed to draw, hr %#x.\n", hr); + ok(SUCCEEDED(hr), "Failed to draw, hr %#lx.\n", hr); hr = IDirect3DDevice2_DrawIndexedPrimitive(device, D3DPT_TRIANGLESTRIP, D3DFVF_XYZ, quad, 4, indices, 4, 0); - ok(SUCCEEDED(hr), "Failed to draw, hr %#x.\n", hr); + ok(SUCCEEDED(hr), "Failed to draw, hr %#lx.\n", hr); destroy_viewport(device, viewport); refcount = IDirect3DDevice2_Release(device); - ok(!refcount, "Device has %u references left.\n", refcount); + ok(!refcount, "Device has %lu references left.\n", refcount); IDirectDraw2_Release(ddraw); DestroyWindow(window); } @@ -11875,8 +11855,8 @@ static void test_edge_antialiasing_blending(void) DDSURFACEDESC surface_desc; IDirect3DDevice2 *device; IDirectDraw2 *ddraw; + unsigned int color; ULONG refcount; - D3DCOLOR color; HWND window; HRESULT hr; @@ -11917,14 +11897,14 @@ static void test_edge_antialiasing_blending(void) memset(&hel_desc, 0, sizeof(hel_desc)); hel_desc.dwSize = sizeof(hel_desc); hr = IDirect3DDevice2_GetCaps(device, &hal_desc, &hel_desc); - ok(SUCCEEDED(hr), "Failed to get device caps, hr %#x.\n", hr); - trace("HAL line edge antialiasing support: %#x.\n", + ok(SUCCEEDED(hr), "Failed to get device caps, hr %#lx.\n", hr); + trace("HAL line edge antialiasing support: %#lx.\n", hal_desc.dpcLineCaps.dwRasterCaps & D3DPRASTERCAPS_ANTIALIASEDGES); - trace("HAL triangle edge antialiasing support: %#x.\n", + trace("HAL triangle edge antialiasing support: %#lx.\n", hal_desc.dpcTriCaps.dwRasterCaps & D3DPRASTERCAPS_ANTIALIASEDGES); - trace("HEL line edge antialiasing support: %#x.\n", + trace("HEL line edge antialiasing support: %#lx.\n", hel_desc.dpcLineCaps.dwRasterCaps & D3DPRASTERCAPS_ANTIALIASEDGES); - trace("HEL triangle edge antialiasing support: %#x.\n", + trace("HEL triangle edge antialiasing support: %#lx.\n", hel_desc.dpcTriCaps.dwRasterCaps & D3DPRASTERCAPS_ANTIALIASEDGES); memset(&surface_desc, 0, sizeof(surface_desc)); @@ -11941,118 +11921,118 @@ static void test_edge_antialiasing_blending(void) U4(surface_desc.ddpfPixelFormat).dwBBitMask = 0x000000ff; U5(surface_desc.ddpfPixelFormat).dwRGBAlphaBitMask = 0xff000000; hr = IDirectDraw2_CreateSurface(ddraw, &surface_desc, &offscreen, NULL); - ok(hr == D3D_OK, "Creating the offscreen render target failed, hr %#x.\n", hr); + ok(hr == D3D_OK, "Creating the offscreen render target failed, hr %#lx.\n", hr); ds = get_depth_stencil(device); hr = IDirectDrawSurface_AddAttachedSurface(offscreen, ds); - todo_wine ok(SUCCEEDED(hr), "Failed to attach depth buffer, hr %#x.\n", hr); + todo_wine ok(SUCCEEDED(hr), "Failed to attach depth buffer, hr %#lx.\n", hr); IDirectDrawSurface_Release(ds); hr = IDirect3DDevice2_SetRenderTarget(device, offscreen, 0); - ok(SUCCEEDED(hr), "Failed to set render target, hr %#x.\n", hr); + ok(SUCCEEDED(hr), "Failed to set render target, hr %#lx.\n", hr); red_background = create_diffuse_material(device, 1.0f, 0.0f, 0.0f, 0.8f); green_background = create_diffuse_material(device, 0.0f, 1.0f, 0.0f, 0.5f); viewport = create_viewport(device, 0, 0, 640, 480); hr = IDirect3DDevice2_SetCurrentViewport(device, viewport); - ok(SUCCEEDED(hr), "Failed to activate the viewport, hr %#x.\n", hr); + ok(SUCCEEDED(hr), "Failed to activate the viewport, hr %#lx.\n", hr); hr = IDirect3DDevice2_SetTransform(device, D3DTRANSFORMSTATE_WORLD, &mat); - ok(SUCCEEDED(hr), "Failed to set world transform, hr %#x.\n", hr); + ok(SUCCEEDED(hr), "Failed to set world transform, hr %#lx.\n", hr); hr = IDirect3DDevice2_SetTransform(device, D3DTRANSFORMSTATE_VIEW, &mat); - ok(SUCCEEDED(hr), "Failed to set view transform, hr %#x.\n", hr); + ok(SUCCEEDED(hr), "Failed to set view transform, hr %#lx.\n", hr); hr = IDirect3DDevice2_SetTransform(device, D3DTRANSFORMSTATE_PROJECTION, &mat); - ok(SUCCEEDED(hr), "Failed to set projection transform, hr %#x.\n", hr); + ok(SUCCEEDED(hr), "Failed to set projection transform, hr %#lx.\n", hr); hr = IDirect3DDevice2_SetRenderState(device, D3DRENDERSTATE_ZENABLE, FALSE); - ok(SUCCEEDED(hr), "Failed to disable Z test, hr %#x.\n", hr); + ok(SUCCEEDED(hr), "Failed to disable Z test, hr %#lx.\n", hr); hr = IDirect3DDevice2_SetRenderState(device, D3DRENDERSTATE_FOGENABLE, FALSE); - ok(SUCCEEDED(hr), "Failed to disable fog, hr %#x.\n", hr); + ok(SUCCEEDED(hr), "Failed to disable fog, hr %#lx.\n", hr); hr = IDirect3DDevice2_SetRenderState(device, D3DRENDERSTATE_CULLMODE, D3DCULL_NONE); - ok(SUCCEEDED(hr), "Failed to disable culling, hr %#x.\n", hr); + ok(SUCCEEDED(hr), "Failed to disable culling, hr %#lx.\n", hr); hr = IDirect3DDevice2_SetRenderState(device, D3DRENDERSTATE_ALPHABLENDENABLE, TRUE); - ok(SUCCEEDED(hr), "Failed to enable blending, hr %#x.\n", hr); + ok(SUCCEEDED(hr), "Failed to enable blending, hr %#lx.\n", hr); hr = IDirect3DDevice2_SetRenderState(device, D3DRENDERSTATE_SRCBLEND, D3DBLEND_SRCALPHA); - ok(SUCCEEDED(hr), "Failed to set src blend, hr %#x.\n", hr); + ok(SUCCEEDED(hr), "Failed to set src blend, hr %#lx.\n", hr); hr = IDirect3DDevice2_SetRenderState(device, D3DRENDERSTATE_DESTBLEND, D3DBLEND_DESTALPHA); - ok(SUCCEEDED(hr), "Failed to set dest blend, hr %#x.\n", hr); + ok(SUCCEEDED(hr), "Failed to set dest blend, hr %#lx.\n", hr); viewport_set_background(device, viewport, red_background); hr = IDirect3DViewport2_Clear(viewport, 1, &clear_rect, D3DCLEAR_TARGET); - ok(SUCCEEDED(hr), "Failed to clear render target, hr %#x.\n", hr); + ok(SUCCEEDED(hr), "Failed to clear render target, hr %#lx.\n", hr); hr = IDirect3DDevice2_BeginScene(device); - ok(SUCCEEDED(hr), "Failed to begin scene, hr %#x.\n", hr); + ok(SUCCEEDED(hr), "Failed to begin scene, hr %#lx.\n", hr); hr = IDirect3DDevice2_DrawPrimitive(device, D3DPT_TRIANGLESTRIP, D3DVT_LVERTEX, green_quad, 4, 0); - ok(SUCCEEDED(hr), "Failed to draw, hr %#x.\n", hr); + ok(SUCCEEDED(hr), "Failed to draw, hr %#lx.\n", hr); hr = IDirect3DDevice2_EndScene(device); - ok(SUCCEEDED(hr), "Failed to end scene, hr %#x.\n", hr); + ok(SUCCEEDED(hr), "Failed to end scene, hr %#lx.\n", hr); color = get_surface_color(offscreen, 320, 240); ok(compare_color(color, 0x00cc7f00, 1), "Got unexpected color 0x%08x.\n", color); viewport_set_background(device, viewport, green_background); hr = IDirect3DViewport2_Clear(viewport, 1, &clear_rect, D3DCLEAR_TARGET); - ok(SUCCEEDED(hr), "Failed to clear render target, hr %#x.\n", hr); + ok(SUCCEEDED(hr), "Failed to clear render target, hr %#lx.\n", hr); hr = IDirect3DDevice2_BeginScene(device); - ok(SUCCEEDED(hr), "Failed to begin scene, hr %#x.\n", hr); + ok(SUCCEEDED(hr), "Failed to begin scene, hr %#lx.\n", hr); hr = IDirect3DDevice2_DrawPrimitive(device, D3DPT_TRIANGLESTRIP, D3DVT_LVERTEX, red_quad, 4, 0); - ok(SUCCEEDED(hr), "Failed to draw, hr %#x.\n", hr); + ok(SUCCEEDED(hr), "Failed to draw, hr %#lx.\n", hr); hr = IDirect3DDevice2_EndScene(device); - ok(SUCCEEDED(hr), "Failed to end scene, hr %#x.\n", hr); + ok(SUCCEEDED(hr), "Failed to end scene, hr %#lx.\n", hr); color = get_surface_color(offscreen, 320, 240); ok(compare_color(color, 0x00cc7f00, 1), "Got unexpected color 0x%08x.\n", color); hr = IDirect3DDevice2_SetRenderState(device, D3DRENDERSTATE_ALPHABLENDENABLE, FALSE); - ok(SUCCEEDED(hr), "Failed to disable blending, hr %#x.\n", hr); + ok(SUCCEEDED(hr), "Failed to disable blending, hr %#lx.\n", hr); viewport_set_background(device, viewport, red_background); hr = IDirect3DViewport2_Clear(viewport, 1, &clear_rect, D3DCLEAR_TARGET); - ok(SUCCEEDED(hr), "Failed to clear render target, hr %#x.\n", hr); + ok(SUCCEEDED(hr), "Failed to clear render target, hr %#lx.\n", hr); hr = IDirect3DDevice2_BeginScene(device); - ok(SUCCEEDED(hr), "Failed to begin scene, hr %#x.\n", hr); + ok(SUCCEEDED(hr), "Failed to begin scene, hr %#lx.\n", hr); hr = IDirect3DDevice2_DrawPrimitive(device, D3DPT_TRIANGLESTRIP, D3DVT_LVERTEX, green_quad, 4, 0); - ok(SUCCEEDED(hr), "Failed to draw, hr %#x.\n", hr); + ok(SUCCEEDED(hr), "Failed to draw, hr %#lx.\n", hr); hr = IDirect3DDevice2_EndScene(device); - ok(SUCCEEDED(hr), "Failed to end scene, hr %#x.\n", hr); + ok(SUCCEEDED(hr), "Failed to end scene, hr %#lx.\n", hr); color = get_surface_color(offscreen, 320, 240); ok(compare_color(color, 0x0000ff00, 1), "Got unexpected color 0x%08x.\n", color); viewport_set_background(device, viewport, green_background); hr = IDirect3DViewport2_Clear(viewport, 1, &clear_rect, D3DCLEAR_TARGET); - ok(SUCCEEDED(hr), "Failed to clear render target, hr %#x.\n", hr); + ok(SUCCEEDED(hr), "Failed to clear render target, hr %#lx.\n", hr); hr = IDirect3DDevice2_BeginScene(device); - ok(SUCCEEDED(hr), "Failed to begin scene, hr %#x.\n", hr); + ok(SUCCEEDED(hr), "Failed to begin scene, hr %#lx.\n", hr); hr = IDirect3DDevice2_DrawPrimitive(device, D3DPT_TRIANGLESTRIP, D3DVT_LVERTEX, red_quad, 4, 0); - ok(SUCCEEDED(hr), "Failed to draw, hr %#x.\n", hr); + ok(SUCCEEDED(hr), "Failed to draw, hr %#lx.\n", hr); hr = IDirect3DDevice2_EndScene(device); - ok(SUCCEEDED(hr), "Failed to end scene, hr %#x.\n", hr); + ok(SUCCEEDED(hr), "Failed to end scene, hr %#lx.\n", hr); color = get_surface_color(offscreen, 320, 240); ok(compare_color(color, 0x00ff0000, 1), "Got unexpected color 0x%08x.\n", color); hr = IDirect3DDevice2_SetRenderState(device, D3DRENDERSTATE_EDGEANTIALIAS, TRUE); - ok(SUCCEEDED(hr), "Failed to enable edge antialiasing, hr %#x.\n", hr); + ok(SUCCEEDED(hr), "Failed to enable edge antialiasing, hr %#lx.\n", hr); viewport_set_background(device, viewport, red_background); hr = IDirect3DViewport2_Clear(viewport, 1, &clear_rect, D3DCLEAR_TARGET); - ok(SUCCEEDED(hr), "Failed to clear render target, hr %#x.\n", hr); + ok(SUCCEEDED(hr), "Failed to clear render target, hr %#lx.\n", hr); hr = IDirect3DDevice2_BeginScene(device); - ok(SUCCEEDED(hr), "Failed to begin scene, hr %#x.\n", hr); + ok(SUCCEEDED(hr), "Failed to begin scene, hr %#lx.\n", hr); hr = IDirect3DDevice2_DrawPrimitive(device, D3DPT_TRIANGLESTRIP, D3DVT_LVERTEX, green_quad, 4, 0); - ok(SUCCEEDED(hr), "Failed to draw, hr %#x.\n", hr); + ok(SUCCEEDED(hr), "Failed to draw, hr %#lx.\n", hr); hr = IDirect3DDevice2_EndScene(device); - ok(SUCCEEDED(hr), "Failed to end scene, hr %#x.\n", hr); + ok(SUCCEEDED(hr), "Failed to end scene, hr %#lx.\n", hr); color = get_surface_color(offscreen, 320, 240); ok(compare_color(color, 0x0000ff00, 1), "Got unexpected color 0x%08x.\n", color); viewport_set_background(device, viewport, green_background); hr = IDirect3DViewport2_Clear(viewport, 1, &clear_rect, D3DCLEAR_TARGET); - ok(SUCCEEDED(hr), "Failed to clear render target, hr %#x.\n", hr); + ok(SUCCEEDED(hr), "Failed to clear render target, hr %#lx.\n", hr); hr = IDirect3DDevice2_BeginScene(device); - ok(SUCCEEDED(hr), "Failed to begin scene, hr %#x.\n", hr); + ok(SUCCEEDED(hr), "Failed to begin scene, hr %#lx.\n", hr); hr = IDirect3DDevice2_DrawPrimitive(device, D3DPT_TRIANGLESTRIP, D3DVT_LVERTEX, red_quad, 4, 0); - ok(SUCCEEDED(hr), "Failed to draw, hr %#x.\n", hr); + ok(SUCCEEDED(hr), "Failed to draw, hr %#lx.\n", hr); hr = IDirect3DDevice2_EndScene(device); - ok(SUCCEEDED(hr), "Failed to end scene, hr %#x.\n", hr); + ok(SUCCEEDED(hr), "Failed to end scene, hr %#lx.\n", hr); color = get_surface_color(offscreen, 320, 240); ok(compare_color(color, 0x00ff0000, 1), "Got unexpected color 0x%08x.\n", color); @@ -12061,7 +12041,7 @@ static void test_edge_antialiasing_blending(void) destroy_material(red_background); destroy_material(green_background); refcount = IDirect3DDevice2_Release(device); - ok(!refcount, "Device has %u references left.\n", refcount); + ok(!refcount, "Device has %lu references left.\n", refcount); IDirectDraw2_Release(ddraw); DestroyWindow(window); } @@ -12079,19 +12059,19 @@ struct transform_input struct transform_output { float x, y, z, w; - DWORD v1, v2, v3, v4; - DWORD unused3, unused4; + unsigned int v1, v2, v3, v4; + unsigned int unused3, unused4; }; static void test_transform_vertices(void) { IDirect3DDevice2 *device; IDirectDrawSurface *rt; + unsigned int color, i; IDirectDraw2 *ddraw; ULONG refcount; HWND window; HRESULT hr; - D3DCOLOR color; IDirect3DViewport2 *viewport; IDirect3DMaterial2 *background; D3DMATERIAL mat; @@ -12127,7 +12107,6 @@ static void test_transform_vertices(void) sizeof(vp_data), 0, 0, 256, 256, 1.0f, 1.0f, 256.0f, 256.0f, 0.0f, 1.0f }; D3DVIEWPORT2 vp2_data; - unsigned int i; DWORD offscreen; static D3DMATRIX mat_scale = { @@ -12191,11 +12170,11 @@ static void test_transform_vertices(void) return; } hr = IDirect3DDevice2_GetRenderTarget(device, &rt); - ok(SUCCEEDED(hr), "Failed to get render target, hr %#x.\n", hr); + ok(SUCCEEDED(hr), "Failed to get render target, hr %#lx.\n", hr); viewport = create_viewport(device, 0, 0, 256, 256); hr = IDirect3DViewport2_SetViewport(viewport, &vp_data); - ok(SUCCEEDED(hr), "Failed to set viewport, hr %#x.\n", hr); + ok(SUCCEEDED(hr), "Failed to set viewport, hr %#lx.\n", hr); memset(&transformdata, 0, sizeof(transformdata)); transformdata.dwSize = sizeof(transformdata); @@ -12207,8 +12186,8 @@ static void test_transform_vertices(void) hr = IDirect3DViewport2_TransformVertices(viewport, ARRAY_SIZE(position_tests), &transformdata, D3DTRANSFORM_UNCLIPPED, &offscreen); - ok(SUCCEEDED(hr), "Failed to transform vertices, hr %#x.\n", hr); - ok(!offscreen, "Offscreen is %x.\n", offscreen); + ok(SUCCEEDED(hr), "Failed to transform vertices, hr %#lx.\n", hr); + ok(!offscreen, "Offscreen is %#lx.\n", offscreen); for (i = 0; i < ARRAY_SIZE(position_tests); ++i) { @@ -12219,7 +12198,7 @@ static void test_transform_vertices(void) }; ok(compare_vec4(&cmp[i], out[i].x, out[i].y, out[i].z, out[i].w, 4096), - "Vertex %u differs. Got %f %f %f %f.\n", i, + "Vertex %u differs. Got %.8e %.8e %.8e %.8e.\n", i, out[i].x, out[i].y, out[i].z, out[i].w); ok(out[i].v1 == position_tests[i].v1 && out[i].v2 == position_tests[i].v2 && out[i].v3 == position_tests[i].v3 && out[i].v4 == position_tests[i].v4, @@ -12230,12 +12209,12 @@ static void test_transform_vertices(void) vp_data = vp_template; hr = IDirect3DViewport2_SetViewport(viewport, &vp_data); - ok(SUCCEEDED(hr), "Failed to set viewport, hr %#x.\n", hr); + ok(SUCCEEDED(hr), "Failed to set viewport, hr %#lx.\n", hr); offscreen = 0xdeadbeef; hr = IDirect3DViewport2_TransformVertices(viewport, ARRAY_SIZE(position_tests), &transformdata, D3DTRANSFORM_UNCLIPPED, &offscreen); - ok(SUCCEEDED(hr), "Failed to transform vertices, hr %#x.\n", hr); - ok(!offscreen, "Offscreen is %x.\n", offscreen); + ok(SUCCEEDED(hr), "Failed to transform vertices, hr %#lx.\n", hr); + ok(!offscreen, "Offscreen is %#lx.\n", offscreen); for (i = 0; i < ARRAY_SIZE(position_tests); ++i) { @@ -12245,19 +12224,19 @@ static void test_transform_vertices(void) {130.5f, 125.5f, 0.5f, 1.0f}, {125.5f, 130.5f, -0.5f, 1.0f}, {125.5f, 130.5f, 0.0f, 1.0f} }; ok(compare_vec4(&cmp[i], out[i].x, out[i].y, out[i].z, out[i].w, 4096), - "Vertex %u differs. Got %f %f %f %f.\n", i, + "Vertex %u differs. Got %.8e %.8e %.8e %.8e.\n", i, out[i].x, out[i].y, out[i].z, out[i].w); } vp_data.dwX = 10; vp_data.dwY = 20; hr = IDirect3DViewport2_SetViewport(viewport, &vp_data); - ok(SUCCEEDED(hr), "Failed to set viewport, hr %#x.\n", hr); + ok(SUCCEEDED(hr), "Failed to set viewport, hr %#lx.\n", hr); offscreen = 0xdeadbeef; hr = IDirect3DViewport2_TransformVertices(viewport, ARRAY_SIZE(position_tests), &transformdata, D3DTRANSFORM_UNCLIPPED, &offscreen); - ok(SUCCEEDED(hr), "Failed to transform vertices, hr %#x.\n", hr); - ok(!offscreen, "Offscreen is %x.\n", offscreen); + ok(SUCCEEDED(hr), "Failed to transform vertices, hr %#lx.\n", hr); + ok(!offscreen, "Offscreen is %#lx.\n", offscreen); for (i = 0; i < ARRAY_SIZE(position_tests); ++i) { static const struct vec4 cmp[] = @@ -12266,7 +12245,7 @@ static void test_transform_vertices(void) {140.5f, 145.5f, 0.5f, 1.0f}, {135.5f, 150.5f, -0.5f, 1.0f}, {135.5f, 150.5f, 0.0f, 1.0f} }; ok(compare_vec4(&cmp[i], out[i].x, out[i].y, out[i].z, out[i].w, 4096), - "Vertex %u differs. Got %f %f %f %f.\n", i, + "Vertex %u differs. Got %.8e %.8e %.8e %.8e.\n", i, out[i].x, out[i].y, out[i].z, out[i].w); } @@ -12274,8 +12253,8 @@ static void test_transform_vertices(void) offscreen = 0xdeadbeef; hr = IDirect3DViewport2_TransformVertices(viewport, ARRAY_SIZE(position_tests), &transformdata, D3DTRANSFORM_CLIPPED, &offscreen); - ok(SUCCEEDED(hr), "Failed to transform vertices, hr %#x.\n", hr); - ok(!offscreen, "Offscreen is %x.\n", offscreen); + ok(SUCCEEDED(hr), "Failed to transform vertices, hr %#lx.\n", hr); + ok(!offscreen, "Offscreen is %#lx.\n", offscreen); for (i = 0; i < ARRAY_SIZE(position_tests); ++i) { static const D3DHVERTEX cmp_h[] = @@ -12288,7 +12267,7 @@ static void test_transform_vertices(void) && compare_float(U2(cmp_h[i]).hy, U2(out_h[i]).hy, 4096) && compare_float(U3(cmp_h[i]).hz, U3(out_h[i]).hz, 4096) && cmp_h[i].dwFlags == out_h[i].dwFlags, - "HVertex %u differs. Got %#x %f %f %f.\n", i, + "HVertex %u differs. Got %#lx %.8e %.8e %.8e.\n", i, out_h[i].dwFlags, U1(out_h[i]).hx, U2(out_h[i]).hy, U3(out_h[i]).hz); /* No scheme has been found behind those return values. It seems to be @@ -12303,7 +12282,7 @@ static void test_transform_vertices(void) {140.5f, 145.5f, 0.5f, 1.0f}, { -0.5f, -0.5f, -0.5f, 1.0f}, {135.5f, 150.5f, 0.0f, 1.0f} }; ok(compare_vec4(&cmp[i], out[i].x, out[i].y, out[i].z, out[i].w, 4096), - "Vertex %u differs. Got %f %f %f %f.\n", i, + "Vertex %u differs. Got %.8e %.8e %.8e %.8e.\n", i, out[i].x, out[i].y, out[i].z, out[i].w); } } @@ -12313,8 +12292,8 @@ static void test_transform_vertices(void) offscreen = 0xdeadbeef; hr = IDirect3DViewport2_TransformVertices(viewport, ARRAY_SIZE(cliptest), &transformdata, D3DTRANSFORM_CLIPPED, &offscreen); - ok(SUCCEEDED(hr), "Failed to transform vertices, hr %#x.\n", hr); - ok(!offscreen, "Offscreen is %x.\n", offscreen); + ok(SUCCEEDED(hr), "Failed to transform vertices, hr %#lx.\n", hr); + ok(!offscreen, "Offscreen is %#lx.\n", offscreen); for (i = 0; i < ARRAY_SIZE(cliptest); ++i) { static const DWORD flags[] = @@ -12324,19 +12303,19 @@ static void test_transform_vertices(void) 0, D3DCLIP_LEFT | D3DCLIP_BOTTOM | D3DCLIP_FRONT, }; - ok(flags[i] == out_h[i].dwFlags, "Cliptest %u returned %#x.\n", i, out_h[i].dwFlags); + ok(flags[i] == out_h[i].dwFlags, "Cliptest %u returned %#lx.\n", i, out_h[i].dwFlags); } vp_data = vp_template; vp_data.dwWidth = 10; vp_data.dwHeight = 480; hr = IDirect3DViewport2_SetViewport(viewport, &vp_data); - ok(SUCCEEDED(hr), "Failed to set viewport, hr %#x.\n", hr); + ok(SUCCEEDED(hr), "Failed to set viewport, hr %#lx.\n", hr); offscreen = 0xdeadbeef; hr = IDirect3DViewport2_TransformVertices(viewport, ARRAY_SIZE(cliptest), &transformdata, D3DTRANSFORM_CLIPPED, &offscreen); - ok(SUCCEEDED(hr), "Failed to transform vertices, hr %#x.\n", hr); - ok(!offscreen, "Offscreen is %x.\n", offscreen); + ok(SUCCEEDED(hr), "Failed to transform vertices, hr %#lx.\n", hr); + ok(!offscreen, "Offscreen is %#lx.\n", offscreen); for (i = 0; i < ARRAY_SIZE(cliptest); ++i) { static const DWORD flags[] = @@ -12346,7 +12325,7 @@ static void test_transform_vertices(void) D3DCLIP_LEFT, D3DCLIP_LEFT | D3DCLIP_FRONT, }; - ok(flags[i] == out_h[i].dwFlags, "Cliptest %u returned %#x.\n", i, out_h[i].dwFlags); + ok(flags[i] == out_h[i].dwFlags, "Cliptest %u returned %#lx.\n", i, out_h[i].dwFlags); } vp_data = vp_template; @@ -12355,11 +12334,11 @@ static void test_transform_vertices(void) vp_data.dvScaleX = 1; vp_data.dvScaleY = 1; hr = IDirect3DViewport2_SetViewport(viewport, &vp_data); - ok(SUCCEEDED(hr), "Failed to set viewport, hr %#x.\n", hr); + ok(SUCCEEDED(hr), "Failed to set viewport, hr %#lx.\n", hr); hr = IDirect3DViewport2_TransformVertices(viewport, ARRAY_SIZE(cliptest), &transformdata, D3DTRANSFORM_CLIPPED, &offscreen); - ok(SUCCEEDED(hr), "Failed to transform vertices, hr %#x.\n", hr); - ok(!offscreen, "Offscreen is %x.\n", offscreen); + ok(SUCCEEDED(hr), "Failed to transform vertices, hr %#lx.\n", hr); + ok(!offscreen, "Offscreen is %#lx.\n", offscreen); for (i = 0; i < ARRAY_SIZE(cliptest); ++i) { static const DWORD flags[] = @@ -12369,7 +12348,7 @@ static void test_transform_vertices(void) 0, D3DCLIP_FRONT, }; - ok(flags[i] == out_h[i].dwFlags, "Cliptest %u returned %#x.\n", i, out_h[i].dwFlags); + ok(flags[i] == out_h[i].dwFlags, "Cliptest %u returned %#lx.\n", i, out_h[i].dwFlags); } /* Finally try to figure out how the DWORD dwOffscreen works. @@ -12380,51 +12359,51 @@ static void test_transform_vertices(void) vp_data.dvScaleX = 10000.0f; vp_data.dvScaleY = 10000.0f; hr = IDirect3DViewport2_SetViewport(viewport, &vp_data); - ok(SUCCEEDED(hr), "Failed to set viewport, hr %#x.\n", hr); + ok(SUCCEEDED(hr), "Failed to set viewport, hr %#lx.\n", hr); transformdata.lpIn = cliptest; offscreen = 0xdeadbeef; hr = IDirect3DViewport2_TransformVertices(viewport, 1, &transformdata, D3DTRANSFORM_UNCLIPPED, &offscreen); - ok(SUCCEEDED(hr), "Failed to transform vertices, hr %#x.\n", hr); - ok(!offscreen, "Offscreen is %x.\n", offscreen); + ok(SUCCEEDED(hr), "Failed to transform vertices, hr %#lx.\n", hr); + ok(!offscreen, "Offscreen is %#lx.\n", offscreen); offscreen = 0xdeadbeef; hr = IDirect3DViewport2_TransformVertices(viewport, 1, &transformdata, D3DTRANSFORM_CLIPPED, &offscreen); - ok(SUCCEEDED(hr), "Failed to transform vertices, hr %#x.\n", hr); - ok(offscreen == (D3DCLIP_RIGHT | D3DCLIP_TOP), "Offscreen is %x.\n", offscreen); + ok(SUCCEEDED(hr), "Failed to transform vertices, hr %#lx.\n", hr); + ok(offscreen == (D3DCLIP_RIGHT | D3DCLIP_TOP), "Offscreen is %#lx.\n", offscreen); offscreen = 0xdeadbeef; hr = IDirect3DViewport2_TransformVertices(viewport, 2, &transformdata, D3DTRANSFORM_CLIPPED, &offscreen); - ok(SUCCEEDED(hr), "Failed to transform vertices, hr %#x.\n", hr); - ok(offscreen == (D3DCLIP_RIGHT | D3DCLIP_TOP), "Offscreen is %x.\n", offscreen); + ok(SUCCEEDED(hr), "Failed to transform vertices, hr %#lx.\n", hr); + ok(offscreen == (D3DCLIP_RIGHT | D3DCLIP_TOP), "Offscreen is %#lx.\n", offscreen); hr = IDirect3DViewport2_TransformVertices(viewport, 3, &transformdata, D3DTRANSFORM_CLIPPED, &offscreen); - ok(SUCCEEDED(hr), "Failed to transform vertices, hr %#x.\n", hr); - ok(!offscreen, "Offscreen is %x.\n", offscreen); + ok(SUCCEEDED(hr), "Failed to transform vertices, hr %#lx.\n", hr); + ok(!offscreen, "Offscreen is %#lx.\n", offscreen); transformdata.lpIn = cliptest + 1; hr = IDirect3DViewport2_TransformVertices(viewport, 1, &transformdata, D3DTRANSFORM_CLIPPED, &offscreen); - ok(SUCCEEDED(hr), "Failed to transform vertices, hr %#x.\n", hr); - ok(offscreen == (D3DCLIP_BACK | D3DCLIP_RIGHT | D3DCLIP_TOP), "Offscreen is %x.\n", offscreen); + ok(SUCCEEDED(hr), "Failed to transform vertices, hr %#lx.\n", hr); + ok(offscreen == (D3DCLIP_BACK | D3DCLIP_RIGHT | D3DCLIP_TOP), "Offscreen is %#lx.\n", offscreen); transformdata.lpIn = cliptest + 2; hr = IDirect3DViewport2_TransformVertices(viewport, 1, &transformdata, D3DTRANSFORM_CLIPPED, &offscreen); - ok(SUCCEEDED(hr), "Failed to transform vertices, hr %#x.\n", hr); - ok(offscreen == (D3DCLIP_BOTTOM | D3DCLIP_LEFT), "Offscreen is %x.\n", offscreen); + ok(SUCCEEDED(hr), "Failed to transform vertices, hr %#lx.\n", hr); + ok(offscreen == (D3DCLIP_BOTTOM | D3DCLIP_LEFT), "Offscreen is %#lx.\n", offscreen); offscreen = 0xdeadbeef; hr = IDirect3DViewport2_TransformVertices(viewport, 2, &transformdata, D3DTRANSFORM_CLIPPED, &offscreen); - ok(SUCCEEDED(hr), "Failed to transform vertices, hr %#x.\n", hr); - ok(offscreen == (D3DCLIP_BOTTOM | D3DCLIP_LEFT), "Offscreen is %x.\n", offscreen); + ok(SUCCEEDED(hr), "Failed to transform vertices, hr %#lx.\n", hr); + ok(offscreen == (D3DCLIP_BOTTOM | D3DCLIP_LEFT), "Offscreen is %#lx.\n", offscreen); transformdata.lpIn = cliptest + 3; hr = IDirect3DViewport2_TransformVertices(viewport, 1, &transformdata, D3DTRANSFORM_CLIPPED, &offscreen); - ok(SUCCEEDED(hr), "Failed to transform vertices, hr %#x.\n", hr); - ok(offscreen == (D3DCLIP_FRONT | D3DCLIP_BOTTOM | D3DCLIP_LEFT), "Offscreen is %x.\n", offscreen); + ok(SUCCEEDED(hr), "Failed to transform vertices, hr %#lx.\n", hr); + ok(offscreen == (D3DCLIP_FRONT | D3DCLIP_BOTTOM | D3DCLIP_LEFT), "Offscreen is %#lx.\n", offscreen); transformdata.lpIn = offscreentest; transformdata.dwInSize = sizeof(offscreentest[0]); @@ -12434,21 +12413,21 @@ static void test_transform_vertices(void) vp_data.dvScaleX = 1.0f; vp_data.dvScaleY = 1.0f; hr = IDirect3DViewport2_SetViewport(viewport, &vp_data); - ok(SUCCEEDED(hr), "Failed to set viewport, hr %#x.\n", hr); + ok(SUCCEEDED(hr), "Failed to set viewport, hr %#lx.\n", hr); offscreen = 0xdeadbeef; hr = IDirect3DViewport2_TransformVertices(viewport, 1, &transformdata, D3DTRANSFORM_CLIPPED, &offscreen); - ok(SUCCEEDED(hr), "Failed to transform vertices, hr %#x.\n", hr); - ok(!offscreen, "Offscreen is %x.\n", offscreen); + ok(SUCCEEDED(hr), "Failed to transform vertices, hr %#lx.\n", hr); + ok(!offscreen, "Offscreen is %#lx.\n", offscreen); vp_data.dwWidth = 256; vp_data.dwHeight = 256; hr = IDirect3DViewport2_SetViewport(viewport, &vp_data); - ok(SUCCEEDED(hr), "Failed to set viewport, hr %#x.\n", hr); + ok(SUCCEEDED(hr), "Failed to set viewport, hr %#lx.\n", hr); hr = IDirect3DViewport2_TransformVertices(viewport, 1, &transformdata, D3DTRANSFORM_CLIPPED, &offscreen); - ok(SUCCEEDED(hr), "Failed to transform vertices, hr %#x.\n", hr); - ok(offscreen == D3DCLIP_RIGHT, "Offscreen is %x.\n", offscreen); + ok(SUCCEEDED(hr), "Failed to transform vertices, hr %#lx.\n", hr); + ok(offscreen == D3DCLIP_RIGHT, "Offscreen is %#lx.\n", offscreen); /* Test the effect of Matrices. * @@ -12464,20 +12443,20 @@ static void test_transform_vertices(void) vp_data.dvMinZ = 0.0f; vp_data.dvMaxZ = 1.0f; hr = IDirect3DViewport2_SetViewport(viewport, &vp_data); - ok(SUCCEEDED(hr), "Failed to set viewport, hr %#x.\n", hr); + ok(SUCCEEDED(hr), "Failed to set viewport, hr %#lx.\n", hr); hr = IDirect3DDevice2_SetTransform(device, D3DTRANSFORMSTATE_WORLD, &mat_translate1); - ok(SUCCEEDED(hr), "Failed to set world transform, hr %#x.\n", hr); + ok(SUCCEEDED(hr), "Failed to set world transform, hr %#lx.\n", hr); hr = IDirect3DDevice2_SetTransform(device, D3DTRANSFORMSTATE_VIEW, &mat_scale); - ok(SUCCEEDED(hr), "Failed to set world transform, hr %#x.\n", hr); + ok(SUCCEEDED(hr), "Failed to set world transform, hr %#lx.\n", hr); hr = IDirect3DDevice2_SetTransform(device, D3DTRANSFORMSTATE_PROJECTION, &mat_translate2); - ok(SUCCEEDED(hr), "Failed to set world transform, hr %#x.\n", hr); + ok(SUCCEEDED(hr), "Failed to set world transform, hr %#lx.\n", hr); transformdata.lpIn = position_tests; transformdata.dwInSize = sizeof(position_tests[0]); hr = IDirect3DViewport2_TransformVertices(viewport, ARRAY_SIZE(position_tests), &transformdata, D3DTRANSFORM_UNCLIPPED, &offscreen); - ok(SUCCEEDED(hr), "Failed to transform vertices, hr %#x.\n", hr); + ok(SUCCEEDED(hr), "Failed to transform vertices, hr %#lx.\n", hr); for (i = 0; i < ARRAY_SIZE(position_tests); ++i) { @@ -12488,7 +12467,7 @@ static void test_transform_vertices(void) }; ok(compare_vec4(&cmp[i], out[i].x, out[i].y, out[i].z, out[i].w, 4096), - "Vertex %u differs. Got %f %f %f %f.\n", i, + "Vertex %u differs. Got %.8e %.8e %.8e %.8e.\n", i, out[i].x, out[i].y, out[i].z, out[i].w); } @@ -12496,48 +12475,48 @@ static void test_transform_vertices(void) offscreen = 0xdeadbeef; hr = IDirect3DViewport2_TransformVertices(viewport, ARRAY_SIZE(position_tests), &transformdata, 0, &offscreen); - ok(hr == DDERR_INVALIDPARAMS, "TransformVertices returned %#x.\n", hr); - ok(offscreen == 0xdeadbeef, "Offscreen is %x.\n", offscreen); + ok(hr == DDERR_INVALIDPARAMS, "Got hr %#lx.\n", hr); + ok(offscreen == 0xdeadbeef, "Offscreen is %#lx.\n", offscreen); /* NULL transform data. */ hr = IDirect3DViewport2_TransformVertices(viewport, 1, NULL, D3DTRANSFORM_UNCLIPPED, &offscreen); - ok(hr == DDERR_INVALIDPARAMS, "TransformVertices returned %#x.\n", hr); - ok(offscreen == 0xdeadbeef, "Offscreen is %x.\n", offscreen); + ok(hr == DDERR_INVALIDPARAMS, "Got hr %#lx.\n", hr); + ok(offscreen == 0xdeadbeef, "Offscreen is %#lx.\n", offscreen); hr = IDirect3DViewport2_TransformVertices(viewport, 0, NULL, D3DTRANSFORM_UNCLIPPED, &offscreen); - ok(hr == DDERR_INVALIDPARAMS, "TransformVertices returned %#x.\n", hr); - ok(offscreen == 0xdeadbeef, "Offscreen is %x.\n", offscreen); + ok(hr == DDERR_INVALIDPARAMS, "Got hr %#lx.\n", hr); + ok(offscreen == 0xdeadbeef, "Offscreen is %#lx.\n", offscreen); /* NULL transform data and NULL dwOffscreen. * * Valid transform data + NULL dwOffscreen -> crash. */ hr = IDirect3DViewport2_TransformVertices(viewport, 1, NULL, D3DTRANSFORM_UNCLIPPED, NULL); - ok(hr == DDERR_INVALIDPARAMS, "TransformVertices returned %#x.\n", hr); + ok(hr == DDERR_INVALIDPARAMS, "Got hr %#lx.\n", hr); /* No vertices. */ hr = IDirect3DViewport2_TransformVertices(viewport, 0, &transformdata, D3DTRANSFORM_UNCLIPPED, &offscreen); - ok(SUCCEEDED(hr), "Failed to transform vertices, hr %#x.\n", hr); - ok(!offscreen, "Offscreen is %x.\n", offscreen); + ok(SUCCEEDED(hr), "Failed to transform vertices, hr %#lx.\n", hr); + ok(!offscreen, "Offscreen is %#lx.\n", offscreen); hr = IDirect3DViewport2_TransformVertices(viewport, 0, &transformdata, D3DTRANSFORM_CLIPPED, &offscreen); - ok(SUCCEEDED(hr), "Failed to transform vertices, hr %#x.\n", hr); - ok(offscreen == ~0U, "Offscreen is %x.\n", offscreen); + ok(SUCCEEDED(hr), "Failed to transform vertices, hr %#lx.\n", hr); + ok(offscreen == ~0u, "Offscreen is %#lx.\n", offscreen); /* Invalid sizes. */ offscreen = 0xdeadbeef; transformdata.dwSize = sizeof(transformdata) - 1; hr = IDirect3DViewport2_TransformVertices(viewport, 1, &transformdata, D3DTRANSFORM_UNCLIPPED, &offscreen); - ok(hr == DDERR_INVALIDPARAMS, "TransformVertices returned %#x.\n", hr); - ok(offscreen == 0xdeadbeef, "Offscreen is %x.\n", offscreen); + ok(hr == DDERR_INVALIDPARAMS, "Got hr %#lx.\n", hr); + ok(offscreen == 0xdeadbeef, "Offscreen is %#lx.\n", offscreen); transformdata.dwSize = sizeof(transformdata) + 1; hr = IDirect3DViewport2_TransformVertices(viewport, 1, &transformdata, D3DTRANSFORM_UNCLIPPED, &offscreen); - ok(hr == DDERR_INVALIDPARAMS, "TransformVertices returned %#x.\n", hr); - ok(offscreen == 0xdeadbeef, "Offscreen is %x.\n", offscreen); + ok(hr == DDERR_INVALIDPARAMS, "Got hr %#lx.\n", hr); + ok(offscreen == 0xdeadbeef, "Offscreen is %#lx.\n", offscreen); /* NULL lpIn or lpOut -> crash, except when transforming 0 vertices. */ transformdata.dwSize = sizeof(transformdata); @@ -12546,8 +12525,8 @@ static void test_transform_vertices(void) offscreen = 0xdeadbeef; hr = IDirect3DViewport2_TransformVertices(viewport, 0, &transformdata, D3DTRANSFORM_CLIPPED, &offscreen); - ok(SUCCEEDED(hr), "Failed to transform vertices, hr %#x.\n", hr); - ok(offscreen == ~0U, "Offscreen is %x.\n", offscreen); + ok(SUCCEEDED(hr), "Failed to transform vertices, hr %#lx.\n", hr); + ok(offscreen == ~0u, "Offscreen is %#lx.\n", offscreen); /* Test how vertices are transformed during draws. */ vp_data.dwX = 20; @@ -12559,22 +12538,22 @@ static void test_transform_vertices(void) vp_data.dvMinZ = 0.0f; vp_data.dvMaxZ = 1.0f; hr = IDirect3DViewport2_SetViewport(viewport, &vp_data); - ok(SUCCEEDED(hr), "Failed to set viewport, hr %#x.\n", hr); + ok(SUCCEEDED(hr), "Failed to set viewport, hr %#lx.\n", hr); hr = IDirect3DDevice2_SetCurrentViewport(device, viewport); - ok(SUCCEEDED(hr), "Failed to activate the viewport, hr %#x.\n", hr); + ok(SUCCEEDED(hr), "Failed to activate the viewport, hr %#lx.\n", hr); - ok(SUCCEEDED(hr), "Failed to clear the render target, hr %#x.\n", hr); + ok(SUCCEEDED(hr), "Failed to clear the render target, hr %#lx.\n", hr); background = create_diffuse_material(device, 0.0f, 0.0f, 1.0f, 0.0f); viewport_set_background(device, viewport, background); hr = IDirect3DViewport2_Clear(viewport, 1, &clear_rect, D3DCLEAR_TARGET); - ok(SUCCEEDED(hr), "Failed to clear viewport, hr %#x.\n", hr); + ok(SUCCEEDED(hr), "Failed to clear viewport, hr %#lx.\n", hr); hr = IDirect3DDevice2_BeginScene(device); - ok(SUCCEEDED(hr), "Failed to begin scene, hr %#x.\n", hr); + ok(SUCCEEDED(hr), "Failed to begin scene, hr %#lx.\n", hr); hr = IDirect3DDevice2_DrawPrimitive(device, D3DPT_TRIANGLESTRIP, D3DVT_LVERTEX, quad, 4, 0); - ok(SUCCEEDED(hr), "Failed to draw, hr %#x.\n", hr); + ok(SUCCEEDED(hr), "Failed to draw, hr %#lx.\n", hr); hr = IDirect3DDevice2_EndScene(device); - ok(SUCCEEDED(hr), "Failed to end scene, hr %#x.\n", hr); + ok(SUCCEEDED(hr), "Failed to end scene, hr %#lx.\n", hr); color = get_surface_color(rt, 128, 143); ok(compare_color(color, 0x000000ff, 1), "Got unexpected color 0x%08x.\n", color); @@ -12607,12 +12586,12 @@ static void test_transform_vertices(void) vp2_data.dvMinZ = 0.0f; vp2_data.dvMaxZ = 2.0f; hr = IDirect3DViewport2_SetViewport2(viewport, &vp2_data); - ok(SUCCEEDED(hr), "Failed to set viewport data, hr %#x.\n", hr); + ok(SUCCEEDED(hr), "Failed to set viewport data, hr %#lx.\n", hr); transformdata.lpIn = position_tests; transformdata.lpOut = out; hr = IDirect3DViewport2_TransformVertices(viewport, ARRAY_SIZE(position_tests), &transformdata, D3DTRANSFORM_UNCLIPPED, &offscreen); - ok(SUCCEEDED(hr), "Failed to transform vertices, hr %#x.\n", hr); + ok(SUCCEEDED(hr), "Failed to transform vertices, hr %#lx.\n", hr); for (i = 0; i < ARRAY_SIZE(position_tests); ++i) { static const struct vec4 cmp[] = @@ -12622,7 +12601,7 @@ static void test_transform_vertices(void) }; ok(compare_vec4(&cmp[i], out[i].x, out[i].y, out[i].z, out[i].w, 4096), - "Vertex %u differs. Got %f %f %f %f.\n", i, + "Vertex %u differs. Got %.8e %.8e %.8e %.8e.\n", i, out[i].x, out[i].y, out[i].z, out[i].w); } @@ -12633,16 +12612,16 @@ static void test_transform_vertices(void) U3(U(mat).diffuse).b = 0.0f; U4(U(mat).diffuse).a = 0.0f; hr = IDirect3DMaterial2_SetMaterial(background, &mat); - ok(SUCCEEDED(hr), "Failed to set material data, hr %#x.\n", hr); + ok(SUCCEEDED(hr), "Failed to set material data, hr %#lx.\n", hr); hr = IDirect3DViewport2_Clear(viewport, 1, &clear_rect, D3DCLEAR_TARGET); - ok(SUCCEEDED(hr), "Failed to clear viewport, hr %#x.\n", hr); + ok(SUCCEEDED(hr), "Failed to clear viewport, hr %#lx.\n", hr); hr = IDirect3DDevice2_BeginScene(device); - ok(SUCCEEDED(hr), "Failed to begin scene, hr %#x.\n", hr); + ok(SUCCEEDED(hr), "Failed to begin scene, hr %#lx.\n", hr); hr = IDirect3DDevice2_DrawPrimitive(device, D3DPT_TRIANGLESTRIP, D3DVT_LVERTEX, quad, 4, 0); - ok(SUCCEEDED(hr), "Failed to draw, hr %#x.\n", hr); + ok(SUCCEEDED(hr), "Failed to draw, hr %#lx.\n", hr); hr = IDirect3DDevice2_EndScene(device); - ok(SUCCEEDED(hr), "Failed to end scene, hr %#x.\n", hr); + ok(SUCCEEDED(hr), "Failed to end scene, hr %#lx.\n", hr); color = get_surface_color(rt, 58, 118); ok(compare_color(color, 0x0000ff00, 1), "Got unexpected color 0x%08x.\n", color); @@ -12663,11 +12642,11 @@ static void test_transform_vertices(void) ok(compare_color(color, 0x0000ff00, 1), "Got unexpected color 0x%08x.\n", color); hr = IDirect3DDevice2_SetTransform(device, D3DTRANSFORMSTATE_WORLD, &mat_identity); - ok(SUCCEEDED(hr), "Failed to set world transform, hr %#x.\n", hr); + ok(SUCCEEDED(hr), "Failed to set world transform, hr %#lx.\n", hr); hr = IDirect3DDevice2_SetTransform(device, D3DTRANSFORMSTATE_VIEW, &mat_identity); - ok(SUCCEEDED(hr), "Failed to set world transform, hr %#x.\n", hr); + ok(SUCCEEDED(hr), "Failed to set world transform, hr %#lx.\n", hr); hr = IDirect3DDevice2_SetTransform(device, D3DTRANSFORMSTATE_PROJECTION, &mat_transform3); - ok(SUCCEEDED(hr), "Failed to set world transform, hr %#x.\n", hr); + ok(SUCCEEDED(hr), "Failed to set world transform, hr %#lx.\n", hr); vp2_data.dwX = 0.0; vp2_data.dwY = 0.0; @@ -12680,14 +12659,14 @@ static void test_transform_vertices(void) vp2_data.dvMinZ = 0.0f; vp2_data.dvMaxZ = 0.5f; hr = IDirect3DViewport2_SetViewport2(viewport, &vp2_data); - ok(SUCCEEDED(hr), "Failed to set viewport data, hr %#x.\n", hr); + ok(SUCCEEDED(hr), "Failed to set viewport data, hr %#lx.\n", hr); transformdata.lpIn = cliptest; transformdata.dwInSize = sizeof(cliptest[0]); offscreen = 0xdeadbeef; hr = IDirect3DViewport2_TransformVertices(viewport, ARRAY_SIZE(cliptest), &transformdata, D3DTRANSFORM_CLIPPED, &offscreen); - ok(SUCCEEDED(hr), "Failed to transform vertices, hr %#x.\n", hr); - ok(!offscreen, "Offscreen is %x.\n", offscreen); + ok(SUCCEEDED(hr), "Failed to transform vertices, hr %#lx.\n", hr); + ok(!offscreen, "Offscreen is %#lx.\n", offscreen); for (i = 0; i < ARRAY_SIZE(cliptest); ++i) { static const D3DHVERTEX cmp_h[] = @@ -12701,7 +12680,7 @@ static void test_transform_vertices(void) && compare_float(U2(cmp_h[i]).hy, U2(out_h[i]).hy, 4096) && compare_float(U3(cmp_h[i]).hz, U3(out_h[i]).hz, 4096) && cmp_h[i].dwFlags == out_h[i].dwFlags, - "HVertex %u differs. Got %#x %f %f %f.\n", i, + "HVertex %u differs. Got %#lx %.8e %.8e %.8e.\n", i, out_h[i].dwFlags, U1(out_h[i]).hx, U2(out_h[i]).hy, U3(out_h[i]).hz); } @@ -12709,7 +12688,7 @@ static void test_transform_vertices(void) destroy_viewport(device, viewport); IDirect3DMaterial2_Release(background); refcount = IDirect3DDevice_Release(device); - ok(!refcount, "Device has %u references left.\n", refcount); + ok(!refcount, "Device has %lu references left.\n", refcount); IDirectDraw2_Release(ddraw); DestroyWindow(window); } @@ -12732,14 +12711,14 @@ static void test_display_mode_surface_pixel_format(void) surface_desc.dwSize = sizeof(surface_desc); hr = IDirectDraw2_GetDisplayMode(ddraw, &surface_desc); - ok(SUCCEEDED(hr), "Failed to get display mode, hr %#x.\n", hr); + ok(SUCCEEDED(hr), "Failed to get display mode, hr %#lx.\n", hr); width = surface_desc.dwWidth; height = surface_desc.dwHeight; window = CreateWindowA("static", "ddraw_test", WS_OVERLAPPEDWINDOW, 0, 0, width, height, NULL, NULL, NULL, NULL); hr = IDirectDraw2_SetCooperativeLevel(ddraw, window, DDSCL_EXCLUSIVE | DDSCL_FULLSCREEN); - ok(SUCCEEDED(hr), "Failed to set cooperative level, hr %#x.\n", hr); + ok(SUCCEEDED(hr), "Failed to set cooperative level, hr %#lx.\n", hr); bpp = 0; if (SUCCEEDED(IDirectDraw2_SetDisplayMode(ddraw, width, height, 16, 0, 0))) @@ -12752,10 +12731,10 @@ static void test_display_mode_surface_pixel_format(void) surface_desc.dwSize = sizeof(surface_desc); hr = IDirectDraw2_GetDisplayMode(ddraw, &surface_desc); - ok(SUCCEEDED(hr), "Failed to get display mode, hr %#x.\n", hr); - ok(surface_desc.dwWidth == width, "Got width %u, expected %u.\n", surface_desc.dwWidth, width); - ok(surface_desc.dwHeight == height, "Got height %u, expected %u.\n", surface_desc.dwHeight, height); - ok(U1(surface_desc.ddpfPixelFormat).dwRGBBitCount == bpp, "Got bpp %u, expected %u.\n", + ok(SUCCEEDED(hr), "Failed to get display mode, hr %#lx.\n", hr); + ok(surface_desc.dwWidth == width, "Got width %lu, expected %u.\n", surface_desc.dwWidth, width); + ok(surface_desc.dwHeight == height, "Got height %lu, expected %u.\n", surface_desc.dwHeight, height); + ok(U1(surface_desc.ddpfPixelFormat).dwRGBBitCount == bpp, "Got bpp %lu, expected %u.\n", U1(surface_desc.ddpfPixelFormat).dwRGBBitCount, bpp); memset(&surface_desc, 0, sizeof(surface_desc)); @@ -12764,14 +12743,14 @@ static void test_display_mode_surface_pixel_format(void) surface_desc.dwBackBufferCount = 1; surface_desc.ddsCaps.dwCaps = DDSCAPS_COMPLEX | DDSCAPS_FLIP | DDSCAPS_PRIMARYSURFACE; hr = IDirectDraw2_CreateSurface(ddraw, &surface_desc, &surface, NULL); - ok(hr == D3D_OK, "Failed to create surface, hr %#x.\n", hr); + ok(hr == D3D_OK, "Failed to create surface, hr %#lx.\n", hr); hr = IDirectDrawSurface_GetSurfaceDesc(surface, &surface_desc); - ok(SUCCEEDED(hr), "Failed to get surface desc, hr %#x.\n", hr); - ok(surface_desc.dwWidth == width, "Got width %u, expected %u.\n", surface_desc.dwWidth, width); - ok(surface_desc.dwHeight == height, "Got height %u, expected %u.\n", surface_desc.dwHeight, height); - ok(surface_desc.ddpfPixelFormat.dwFlags == DDPF_RGB, "Got unexpected pixel format flags %#x.\n", + ok(SUCCEEDED(hr), "Failed to get surface desc, hr %#lx.\n", hr); + ok(surface_desc.dwWidth == width, "Got width %lu, expected %u.\n", surface_desc.dwWidth, width); + ok(surface_desc.dwHeight == height, "Got height %lu, expected %u.\n", surface_desc.dwHeight, height); + ok(surface_desc.ddpfPixelFormat.dwFlags == DDPF_RGB, "Got unexpected pixel format flags %#lx.\n", surface_desc.ddpfPixelFormat.dwFlags); - ok(U1(surface_desc.ddpfPixelFormat).dwRGBBitCount == bpp, "Got bpp %u, expected %u.\n", + ok(U1(surface_desc.ddpfPixelFormat).dwRGBBitCount == bpp, "Got bpp %lu, expected %u.\n", U1(surface_desc.ddpfPixelFormat).dwRGBBitCount, bpp); IDirectDrawSurface_Release(surface); @@ -12782,17 +12761,17 @@ static void test_display_mode_surface_pixel_format(void) surface_desc.dwHeight = height; surface_desc.ddsCaps.dwCaps = DDSCAPS_OFFSCREENPLAIN; hr = IDirectDraw2_CreateSurface(ddraw, &surface_desc, &surface, NULL); - ok(hr == D3D_OK, "Failed to create surface, hr %#x.\n", hr); + ok(hr == D3D_OK, "Failed to create surface, hr %#lx.\n", hr); hr = IDirectDrawSurface_GetSurfaceDesc(surface, &surface_desc); - ok(SUCCEEDED(hr), "Failed to get surface desc, hr %#x.\n", hr); - ok(surface_desc.ddpfPixelFormat.dwFlags == DDPF_RGB, "Got unexpected pixel format flags %#x.\n", + ok(SUCCEEDED(hr), "Failed to get surface desc, hr %#lx.\n", hr); + ok(surface_desc.ddpfPixelFormat.dwFlags == DDPF_RGB, "Got unexpected pixel format flags %#lx.\n", surface_desc.ddpfPixelFormat.dwFlags); - ok(U1(surface_desc.ddpfPixelFormat).dwRGBBitCount == bpp, "Got bpp %u, expected %u.\n", + ok(U1(surface_desc.ddpfPixelFormat).dwRGBBitCount == bpp, "Got bpp %lu, expected %u.\n", U1(surface_desc.ddpfPixelFormat).dwRGBBitCount, bpp); IDirectDrawSurface_Release(surface); refcount = IDirectDraw2_Release(ddraw); - ok(!refcount, "DirectDraw has %u references left.\n", refcount); + ok(!refcount, "DirectDraw has %lu references left.\n", refcount); DestroyWindow(window); } @@ -12850,7 +12829,7 @@ static void test_surface_desc_size(void) return; } hr = IDirectDraw2_SetCooperativeLevel(ddraw, NULL, DDSCL_NORMAL); - ok(SUCCEEDED(hr), "Failed to set cooperative level, hr %#x.\n", hr); + ok(SUCCEEDED(hr), "Failed to set cooperative level, hr %#lx.\n", hr); for (i = 0; i < ARRAY_SIZE(surface_caps); ++i) { @@ -12866,9 +12845,9 @@ static void test_surface_desc_size(void) continue; } hr = IDirectDrawSurface_QueryInterface(surface, &IID_IDirectDrawSurface2, (void **)&surface2); - ok(hr == DD_OK, "Failed to query IDirectDrawSurface2, hr %#x, type %s.\n", hr, surface_caps[i].name); + ok(hr == DD_OK, "Failed to query IDirectDrawSurface2, hr %#lx, type %s.\n", hr, surface_caps[i].name); hr = IDirectDrawSurface_QueryInterface(surface, &IID_IDirectDrawSurface7, (void **)&surface7); - ok(hr == DD_OK, "Failed to query IDirectDrawSurface7, hr %#x, type %s.\n", hr, surface_caps[i].name); + ok(hr == DD_OK, "Failed to query IDirectDrawSurface7, hr %#lx, type %s.\n", hr, surface_caps[i].name); /* GetSurfaceDesc() */ for (j = 0; j < ARRAY_SIZE(desc_sizes); ++j) @@ -12877,21 +12856,21 @@ static void test_surface_desc_size(void) desc.dwSize = desc_sizes[j]; expected_hr = desc.dwSize == sizeof(DDSURFACEDESC) ? DD_OK : DDERR_INVALIDPARAMS; hr = IDirectDrawSurface_GetSurfaceDesc(surface, &desc.desc1); - ok(hr == expected_hr, "Got hr %#x, expected %#x, dwSize %u, type %s.\n", + ok(hr == expected_hr, "Got hr %#lx, expected %#lx, size %u, type %s.\n", hr, expected_hr, desc_sizes[j], surface_caps[i].name); memset(&desc, 0, sizeof(desc)); desc.dwSize = desc_sizes[j]; expected_hr = desc.dwSize == sizeof(DDSURFACEDESC) ? DD_OK : DDERR_INVALIDPARAMS; hr = IDirectDrawSurface2_GetSurfaceDesc(surface2, &desc.desc1); - ok(hr == expected_hr, "Got hr %#x, expected %#x, dwSize %u, type %s.\n", + ok(hr == expected_hr, "Got hr %#lx, expected %#lx, size %u, type %s.\n", hr, expected_hr, desc_sizes[j], surface_caps[i].name); memset(&desc, 0, sizeof(desc)); desc.dwSize = desc_sizes[j]; expected_hr = desc.dwSize == sizeof(DDSURFACEDESC2) ? DD_OK : DDERR_INVALIDPARAMS; hr = IDirectDrawSurface7_GetSurfaceDesc(surface7, &desc.desc2); - ok(hr == expected_hr, "Got hr %#x, expected %#x, dwSize %u, type %s.\n", + ok(hr == expected_hr, "Got hr %#lx, expected %#lx, size %u, type %s.\n", hr, expected_hr, desc_sizes[j], surface_caps[i].name); } @@ -12908,22 +12887,22 @@ static void test_surface_desc_size(void) desc.blob[sizeof(DDSURFACEDESC2)] = 0xef; hr = IDirectDrawSurface_Lock(surface, NULL, &desc.desc1, 0, 0); expected_hr = valid_size ? DD_OK : DDERR_INVALIDPARAMS; - ok(hr == expected_hr, "Got hr %#x, expected %#x, dwSize %u, type %s.\n", + ok(hr == expected_hr, "Got hr %#lx, expected %#lx, size %u, type %s.\n", hr, expected_hr, desc_sizes[j], surface_caps[i].name); - ok(desc.dwSize == desc_sizes[j], "dwSize was changed from %u to %u, type %s.\n", + ok(desc.dwSize == desc_sizes[j], "dwSize was changed from %u to %lu, type %s.\n", desc_sizes[j], desc.dwSize, surface_caps[i].name); - ok(desc.blob[sizeof(DDSURFACEDESC2)] == 0xef, "Got unexpected byte %02x, dwSize %u, type %s.\n", + ok(desc.blob[sizeof(DDSURFACEDESC2)] == 0xef, "Got unexpected byte %02x, size %u, type %s.\n", desc.blob[sizeof(DDSURFACEDESC2)], desc_sizes[j], surface_caps[i].name); if (SUCCEEDED(hr)) { - ok(desc.desc1.dwWidth == 128, "Got unexpected width %u, dwSize %u, type %s.\n", + ok(desc.desc1.dwWidth == 128, "Got unexpected width %lu, size %u, type %s.\n", desc.desc1.dwWidth, desc_sizes[j], surface_caps[i].name); - ok(desc.desc1.dwHeight == 128, "Got unexpected height %u, dwSize %u, type %s.\n", + ok(desc.desc1.dwHeight == 128, "Got unexpected height %lu, size %u, type %s.\n", desc.desc1.dwHeight, desc_sizes[j], surface_caps[i].name); expected_texture_stage = desc_sizes[j] >= sizeof(DDSURFACEDESC2) ? 0 : 0xdeadbeef; todo_wine_if(!expected_texture_stage) ok(desc.desc2.dwTextureStage == expected_texture_stage, - "Got unexpected texture stage %#x, dwSize %u, type %s.\n", + "Got unexpected texture stage %#lx, size %u, type %s.\n", desc.desc2.dwTextureStage, desc_sizes[j], surface_caps[i].name); IDirectDrawSurface_Unlock(surface, NULL); } @@ -12934,22 +12913,22 @@ static void test_surface_desc_size(void) desc.blob[sizeof(DDSURFACEDESC2)] = 0xef; hr = IDirectDrawSurface2_Lock(surface2, NULL, &desc.desc1, 0, 0); expected_hr = valid_size ? DD_OK : DDERR_INVALIDPARAMS; - ok(hr == expected_hr, "Got hr %#x, expected %#x, dwSize %u, type %s.\n", + ok(hr == expected_hr, "Got hr %#lx, expected %#lx, size %u, type %s.\n", hr, expected_hr, desc_sizes[j], surface_caps[i].name); - ok(desc.dwSize == desc_sizes[j], "dwSize was changed from %u to %u, type %s.\n", + ok(desc.dwSize == desc_sizes[j], "dwSize was changed from %u to %lu, type %s.\n", desc_sizes[j], desc.dwSize, surface_caps[i].name); - ok(desc.blob[sizeof(DDSURFACEDESC2)] == 0xef, "Got unexpected byte %02x, dwSize %u, type %s.\n", + ok(desc.blob[sizeof(DDSURFACEDESC2)] == 0xef, "Got unexpected byte %02x, size %u, type %s.\n", desc.blob[sizeof(DDSURFACEDESC2)], desc_sizes[j], surface_caps[i].name); if (SUCCEEDED(hr)) { - ok(desc.desc2.dwWidth == 128, "Got unexpected width %u, dwSize %u, type %s.\n", + ok(desc.desc2.dwWidth == 128, "Got unexpected width %lu, size %u, type %s.\n", desc.desc2.dwWidth, desc_sizes[j], surface_caps[i].name); - ok(desc.desc2.dwHeight == 128, "Got unexpected height %u, dwSize %u, type %s.\n", + ok(desc.desc2.dwHeight == 128, "Got unexpected height %lu, size %u, type %s.\n", desc.desc2.dwHeight, desc_sizes[j], surface_caps[i].name); expected_texture_stage = desc_sizes[j] >= sizeof(DDSURFACEDESC2) ? 0 : 0xdeadbeef; todo_wine_if(!expected_texture_stage) ok(desc.desc2.dwTextureStage == expected_texture_stage, - "Got unexpected texture stage %#x, dwSize %u, type %s.\n", + "Got unexpected texture stage %#lx, size %u, type %s.\n", desc.desc2.dwTextureStage, desc_sizes[j], surface_caps[i].name); IDirectDrawSurface2_Unlock(surface2, NULL); } @@ -12960,21 +12939,21 @@ static void test_surface_desc_size(void) desc.blob[sizeof(DDSURFACEDESC2)] = 0xef; hr = IDirectDrawSurface7_Lock(surface7, NULL, &desc.desc2, 0, 0); expected_hr = valid_size ? DD_OK : DDERR_INVALIDPARAMS; - ok(hr == expected_hr, "Got hr %#x, expected %#x, dwSize %u, type %s.\n", + ok(hr == expected_hr, "Got hr %#lx, expected %#lx, size %u, type %s.\n", hr, expected_hr, desc_sizes[j], surface_caps[i].name); - ok(desc.dwSize == desc_sizes[j], "dwSize was changed from %u to %u, type %s.\n", + ok(desc.dwSize == desc_sizes[j], "dwSize was changed from %u to %lu, type %s.\n", desc_sizes[j], desc.dwSize, surface_caps[i].name); - ok(desc.blob[sizeof(DDSURFACEDESC2)] == 0xef, "Got unexpected byte %02x, dwSize %u, type %s.\n", + ok(desc.blob[sizeof(DDSURFACEDESC2)] == 0xef, "Got unexpected byte %02x, size %u, type %s.\n", desc.blob[sizeof(DDSURFACEDESC2)], desc_sizes[j], surface_caps[i].name); if (SUCCEEDED(hr)) { - ok(desc.desc2.dwWidth == 128, "Got unexpected width %u, dwSize %u, type %s.\n", + ok(desc.desc2.dwWidth == 128, "Got unexpected width %lu, size %u, type %s.\n", desc.desc2.dwWidth, desc_sizes[j], surface_caps[i].name); - ok(desc.desc2.dwHeight == 128, "Got unexpected height %u, dwSize %u, type %s.\n", + ok(desc.desc2.dwHeight == 128, "Got unexpected height %lu, size %u, type %s.\n", desc.desc2.dwHeight, desc_sizes[j], surface_caps[i].name); expected_texture_stage = desc_sizes[j] >= sizeof(DDSURFACEDESC2) ? 0 : 0xdeadbeef; ok(desc.desc2.dwTextureStage == expected_texture_stage, - "Got unexpected texture stage %#x, dwSize %u, type %s.\n", + "Got unexpected texture stage %#lx, size %u, type %s.\n", desc.desc2.dwTextureStage, desc_sizes[j], surface_caps[i].name); IDirectDrawSurface7_Unlock(surface7, NULL); } @@ -12993,17 +12972,17 @@ static void test_surface_desc_size(void) expected_hr = (desc.dwSize == sizeof(DDSURFACEDESC) || desc.dwSize == sizeof(DDSURFACEDESC2)) ? DD_OK : DDERR_INVALIDPARAMS; hr = IDirectDraw2_GetDisplayMode(ddraw, &desc.desc1); - ok(hr == expected_hr, "Got hr %#x, expected %#x, size %u.\n", hr, expected_hr, desc_sizes[j]); + ok(hr == expected_hr, "Got hr %#lx, expected %#lx, size %u.\n", hr, expected_hr, desc_sizes[j]); if (SUCCEEDED(hr)) { - ok(desc.dwSize == sizeof(DDSURFACEDESC), "Wrong size %u for %u.\n", desc.dwSize, desc_sizes[j]); + ok(desc.dwSize == sizeof(DDSURFACEDESC), "Wrong size %lu for %u.\n", desc.dwSize, desc_sizes[j]); ok(desc.blob[desc_sizes[j]] == 0xcc, "Overflow for size %u.\n", desc_sizes[j]); ok(desc.blob[desc_sizes[j] - 1] != 0xcc, "Struct not cleared for size %u.\n", desc_sizes[j]); } } refcount = IDirectDraw2_Release(ddraw); - ok(!refcount, "DirectDraw has %u references left.\n", refcount); + ok(!refcount, "DirectDraw has %lu references left.\n", refcount); } static void test_ck_operation(void) @@ -13012,12 +12991,11 @@ static void test_ck_operation(void) IDirectDrawSurface7 *src7, *dst7; IDirectDrawSurface *surface1; DDSURFACEDESC surface_desc; + unsigned int i, *color; IDirectDraw2 *ddraw; ULONG refcount; HWND window; HRESULT hr; - D3DCOLOR *color; - unsigned int i; DDCOLORKEY ckey; DDBLTFX fx; @@ -13025,7 +13003,7 @@ static void test_ck_operation(void) ddraw = create_ddraw(); ok(!!ddraw, "Failed to create a ddraw object.\n"); hr = IDirectDraw2_SetCooperativeLevel(ddraw, window, DDSCL_NORMAL); - ok(SUCCEEDED(hr), "Failed to set cooperative level, hr %#x.\n", hr); + ok(SUCCEEDED(hr), "Failed to set cooperative level, hr %#lx.\n", hr); memset(&surface_desc, 0, sizeof(surface_desc)); surface_desc.dwSize = sizeof(surface_desc); @@ -13039,22 +13017,22 @@ static void test_ck_operation(void) U3(surface_desc.ddpfPixelFormat).dwGBitMask = 0x0000ff00; U4(surface_desc.ddpfPixelFormat).dwBBitMask = 0x000000ff; hr = IDirectDraw2_CreateSurface(ddraw, &surface_desc, &surface1, NULL); - ok(SUCCEEDED(hr), "Failed to create surface, hr %#x.\n", hr); + ok(SUCCEEDED(hr), "Failed to create surface, hr %#lx.\n", hr); hr = IDirectDrawSurface_QueryInterface(surface1, &IID_IDirectDrawSurface2, (void **)&dst); - ok(SUCCEEDED(hr), "Failed to query IDirectDrawSurface2, hr %#x.\n", hr); + ok(SUCCEEDED(hr), "Failed to query IDirectDrawSurface2, hr %#lx.\n", hr); IDirectDrawSurface_Release(surface1); surface_desc.dwFlags |= DDSD_CKSRCBLT; surface_desc.ddckCKSrcBlt.dwColorSpaceLowValue = 0x00ff00ff; surface_desc.ddckCKSrcBlt.dwColorSpaceHighValue = 0x00ff00ff; hr = IDirectDraw2_CreateSurface(ddraw, &surface_desc, &surface1, NULL); - ok(SUCCEEDED(hr), "Failed to create surface, hr %#x.\n", hr); + ok(SUCCEEDED(hr), "Failed to create surface, hr %#lx.\n", hr); hr = IDirectDrawSurface_QueryInterface(surface1, &IID_IDirectDrawSurface2, (void **)&src); - ok(SUCCEEDED(hr), "Failed to query IDirectDrawSurface2, hr %#x.\n", hr); + ok(SUCCEEDED(hr), "Failed to query IDirectDrawSurface2, hr %#lx.\n", hr); IDirectDrawSurface_Release(surface1); hr = IDirectDrawSurface2_Lock(src, NULL, &surface_desc, DDLOCK_WAIT, NULL); - ok(SUCCEEDED(hr), "Failed to lock surface, hr %#x.\n", hr); + ok(SUCCEEDED(hr), "Failed to lock surface, hr %#lx.\n", hr); ok(!(surface_desc.dwFlags & DDSD_LPSURFACE), "Surface desc has LPSURFACE Flags set.\n"); color = surface_desc.lpSurface; color[0] = 0x77010203; @@ -13062,33 +13040,33 @@ static void test_ck_operation(void) color[2] = 0x77ff00ff; color[3] = 0x00ff00ff; hr = IDirectDrawSurface2_Unlock(src, NULL); - ok(SUCCEEDED(hr), "Failed to unlock surface, hr %#x.\n", hr); + ok(SUCCEEDED(hr), "Failed to unlock surface, hr %#lx.\n", hr); for (i = 0; i < 2; ++i) { hr = IDirectDrawSurface2_Lock(dst, NULL, &surface_desc, DDLOCK_WAIT, NULL); - ok(SUCCEEDED(hr), "Failed to lock surface, hr %#x.\n", hr); + ok(SUCCEEDED(hr), "Failed to lock surface, hr %#lx.\n", hr); color = surface_desc.lpSurface; color[0] = 0xcccccccc; color[1] = 0xcccccccc; color[2] = 0xcccccccc; color[3] = 0xcccccccc; hr = IDirectDrawSurface2_Unlock(dst, NULL); - ok(SUCCEEDED(hr), "Failed to unlock surface, hr %#x.\n", hr); + ok(SUCCEEDED(hr), "Failed to unlock surface, hr %#lx.\n", hr); if (i) { hr = IDirectDrawSurface2_BltFast(dst, 0, 0, src, NULL, DDBLTFAST_SRCCOLORKEY); - ok(SUCCEEDED(hr), "Failed to blit, hr %#x.\n", hr); + ok(SUCCEEDED(hr), "Failed to blit, hr %#lx.\n", hr); } else { hr = IDirectDrawSurface2_Blt(dst, NULL, src, NULL, DDBLT_KEYSRC, NULL); - ok(SUCCEEDED(hr), "Failed to blit, hr %#x.\n", hr); + ok(SUCCEEDED(hr), "Failed to blit, hr %#lx.\n", hr); } hr = IDirectDrawSurface2_Lock(dst, NULL, &surface_desc, DDLOCK_WAIT | DDLOCK_READONLY, NULL); - ok(SUCCEEDED(hr), "Failed to lock surface, hr %#x.\n", hr); + ok(SUCCEEDED(hr), "Failed to lock surface, hr %#lx.\n", hr); ok(!(surface_desc.dwFlags & DDSD_LPSURFACE), "Surface desc has LPSURFACE Flags set.\n"); color = surface_desc.lpSurface; /* Different behavior on some drivers / windows versions. Some versions ignore the X channel when @@ -13106,66 +13084,66 @@ static void test_ck_operation(void) "Destination data after blitting is %08x %08x %08x %08x, i=%u.\n", color[0], color[1], color[2], color[3], i); hr = IDirectDrawSurface2_Unlock(dst, NULL); - ok(SUCCEEDED(hr), "Failed to unlock surface, hr %#x.\n", hr); + ok(SUCCEEDED(hr), "Failed to unlock surface, hr %#lx.\n", hr); } hr = IDirectDrawSurface2_GetColorKey(src, DDCKEY_SRCBLT, &ckey); - ok(SUCCEEDED(hr), "Failed to get color key, hr %#x.\n", hr); + ok(SUCCEEDED(hr), "Failed to get color key, hr %#lx.\n", hr); ok(ckey.dwColorSpaceLowValue == 0x00ff00ff && ckey.dwColorSpaceHighValue == 0x00ff00ff, - "Got unexpected color key low=%08x high=%08x.\n", ckey.dwColorSpaceLowValue, ckey.dwColorSpaceHighValue); + "Got unexpected color key low=%08lx high=%08lx.\n", ckey.dwColorSpaceLowValue, ckey.dwColorSpaceHighValue); ckey.dwColorSpaceLowValue = ckey.dwColorSpaceHighValue = 0x0000ff00; hr = IDirectDrawSurface2_SetColorKey(src, DDCKEY_SRCBLT, &ckey); - ok(SUCCEEDED(hr), "Failed to set color key, hr %#x.\n", hr); + ok(SUCCEEDED(hr), "Failed to set color key, hr %#lx.\n", hr); ckey.dwColorSpaceLowValue = ckey.dwColorSpaceHighValue = 0; hr = IDirectDrawSurface2_GetColorKey(src, DDCKEY_SRCBLT, &ckey); - ok(SUCCEEDED(hr), "Failed to get color key, hr %#x.\n", hr); + ok(SUCCEEDED(hr), "Failed to get color key, hr %#lx.\n", hr); ok(ckey.dwColorSpaceLowValue == 0x0000ff00 && ckey.dwColorSpaceHighValue == 0x0000ff00, - "Got unexpected color key low=%08x high=%08x.\n", ckey.dwColorSpaceLowValue, ckey.dwColorSpaceHighValue); + "Got unexpected color key low=%08lx high=%08lx.\n", ckey.dwColorSpaceLowValue, ckey.dwColorSpaceHighValue); surface_desc.ddckCKSrcBlt.dwColorSpaceLowValue = 0; surface_desc.ddckCKSrcBlt.dwColorSpaceHighValue = 0; hr = IDirectDrawSurface2_GetSurfaceDesc(src, &surface_desc); - ok(SUCCEEDED(hr), "Failed to get surface desc, hr %#x.\n", hr); + ok(SUCCEEDED(hr), "Failed to get surface desc, hr %#lx.\n", hr); ok(surface_desc.ddckCKSrcBlt.dwColorSpaceLowValue == 0x0000ff00 && surface_desc.ddckCKSrcBlt.dwColorSpaceHighValue == 0x0000ff00, - "Got unexpected color key low=%08x high=%08x.\n", surface_desc.ddckCKSrcBlt.dwColorSpaceLowValue, + "Got unexpected color key low=%08lx high=%08lx.\n", surface_desc.ddckCKSrcBlt.dwColorSpaceLowValue, surface_desc.ddckCKSrcBlt.dwColorSpaceHighValue); /* Test SetColorKey with dwColorSpaceHighValue < dwColorSpaceLowValue */ ckey.dwColorSpaceLowValue = 0x000000ff; ckey.dwColorSpaceHighValue = 0x00000000; hr = IDirectDrawSurface2_SetColorKey(src, DDCKEY_SRCBLT, &ckey); - ok(SUCCEEDED(hr), "Failed to set color key, hr %#x.\n", hr); + ok(SUCCEEDED(hr), "Failed to set color key, hr %#lx.\n", hr); ckey.dwColorSpaceLowValue = ckey.dwColorSpaceHighValue = 0; hr = IDirectDrawSurface2_GetColorKey(src, DDCKEY_SRCBLT, &ckey); - ok(SUCCEEDED(hr), "Failed to get color key, hr %#x.\n", hr); + ok(SUCCEEDED(hr), "Failed to get color key, hr %#lx.\n", hr); ok(ckey.dwColorSpaceLowValue == 0x000000ff && ckey.dwColorSpaceHighValue == 0x000000ff, - "Got unexpected color key low=%08x high=%08x.\n", ckey.dwColorSpaceLowValue, ckey.dwColorSpaceHighValue); + "Got unexpected color key low=%08lx high=%08lx.\n", ckey.dwColorSpaceLowValue, ckey.dwColorSpaceHighValue); ckey.dwColorSpaceLowValue = 0x000000ff; ckey.dwColorSpaceHighValue = 0x00000001; hr = IDirectDrawSurface2_SetColorKey(src, DDCKEY_SRCBLT, &ckey); - ok(SUCCEEDED(hr), "Failed to set color key, hr %#x.\n", hr); + ok(SUCCEEDED(hr), "Failed to set color key, hr %#lx.\n", hr); ckey.dwColorSpaceLowValue = ckey.dwColorSpaceHighValue = 0; hr = IDirectDrawSurface2_GetColorKey(src, DDCKEY_SRCBLT, &ckey); - ok(SUCCEEDED(hr), "Failed to get color key, hr %#x.\n", hr); + ok(SUCCEEDED(hr), "Failed to get color key, hr %#lx.\n", hr); ok(ckey.dwColorSpaceLowValue == 0x000000ff && ckey.dwColorSpaceHighValue == 0x000000ff, - "Got unexpected color key low=%08x high=%08x.\n", ckey.dwColorSpaceLowValue, ckey.dwColorSpaceHighValue); + "Got unexpected color key low=%08lx high=%08lx.\n", ckey.dwColorSpaceLowValue, ckey.dwColorSpaceHighValue); ckey.dwColorSpaceLowValue = 0x000000fe; ckey.dwColorSpaceHighValue = 0x000000fd; hr = IDirectDrawSurface2_SetColorKey(src, DDCKEY_SRCBLT, &ckey); - ok(SUCCEEDED(hr), "Failed to set color key, hr %#x.\n", hr); + ok(SUCCEEDED(hr), "Failed to set color key, hr %#lx.\n", hr); ckey.dwColorSpaceLowValue = ckey.dwColorSpaceHighValue = 0; hr = IDirectDrawSurface2_GetColorKey(src, DDCKEY_SRCBLT, &ckey); - ok(SUCCEEDED(hr), "Failed to get color key, hr %#x.\n", hr); + ok(SUCCEEDED(hr), "Failed to get color key, hr %#lx.\n", hr); ok(ckey.dwColorSpaceLowValue == 0x000000fe && ckey.dwColorSpaceHighValue == 0x000000fe, - "Got unexpected color key low=%08x high=%08x.\n", ckey.dwColorSpaceLowValue, ckey.dwColorSpaceHighValue); + "Got unexpected color key low=%08lx high=%08lx.\n", ckey.dwColorSpaceLowValue, ckey.dwColorSpaceHighValue); IDirectDrawSurface2_Release(src); IDirectDrawSurface2_Release(dst); @@ -13185,25 +13163,25 @@ static void test_ck_operation(void) U4(surface_desc.ddpfPixelFormat).dwBBitMask = 0x000000ff; U5(surface_desc.ddpfPixelFormat).dwRGBAlphaBitMask = 0xff000000; hr = IDirectDraw2_CreateSurface(ddraw, &surface_desc, &surface1, NULL); - ok(SUCCEEDED(hr), "Failed to create surface, hr %#x.\n", hr); + ok(SUCCEEDED(hr), "Failed to create surface, hr %#lx.\n", hr); hr = IDirectDrawSurface_QueryInterface(surface1, &IID_IDirectDrawSurface2, (void **)&dst); - ok(SUCCEEDED(hr), "Failed to query IDirectDrawSurface2, hr %#x.\n", hr); + ok(SUCCEEDED(hr), "Failed to query IDirectDrawSurface2, hr %#lx.\n", hr); IDirectDrawSurface_Release(surface1); hr = IDirectDraw2_CreateSurface(ddraw, &surface_desc, &surface1, NULL); - ok(SUCCEEDED(hr), "Failed to create surface, hr %#x.\n", hr); + ok(SUCCEEDED(hr), "Failed to create surface, hr %#lx.\n", hr); hr = IDirectDrawSurface_QueryInterface(surface1, &IID_IDirectDrawSurface2, (void **)&src); - ok(SUCCEEDED(hr), "Failed to query IDirectDrawSurface2, hr %#x.\n", hr); + ok(SUCCEEDED(hr), "Failed to query IDirectDrawSurface2, hr %#lx.\n", hr); IDirectDrawSurface_Release(surface1); ckey.dwColorSpaceLowValue = 0x0000ff00; ckey.dwColorSpaceHighValue = 0x0000ff00; hr = IDirectDrawSurface2_SetColorKey(dst, DDCKEY_SRCBLT, &ckey); - ok(SUCCEEDED(hr), "Failed to set color key, hr %#x.\n", hr); + ok(SUCCEEDED(hr), "Failed to set color key, hr %#lx.\n", hr); ckey.dwColorSpaceLowValue = 0x00ff0000; ckey.dwColorSpaceHighValue = 0x00ff0000; hr = IDirectDrawSurface2_SetColorKey(dst, DDCKEY_DESTBLT, &ckey); - ok(SUCCEEDED(hr) || hr == DDERR_NOCOLORKEYHW, "Failed to set color key, hr %#x.\n", hr); + ok(SUCCEEDED(hr) || hr == DDERR_NOCOLORKEYHW, "Failed to set color key, hr %#lx.\n", hr); if (FAILED(hr)) { /* Nvidia reject dest keys, AMD allows them. This applies to vidmem and sysmem surfaces. */ @@ -13214,11 +13192,11 @@ static void test_ck_operation(void) ckey.dwColorSpaceLowValue = 0x000000ff; ckey.dwColorSpaceHighValue = 0x000000ff; hr = IDirectDrawSurface2_SetColorKey(src, DDCKEY_SRCBLT, &ckey); - ok(SUCCEEDED(hr), "Failed to set color key, hr %#x.\n", hr); + ok(SUCCEEDED(hr), "Failed to set color key, hr %#lx.\n", hr); ckey.dwColorSpaceLowValue = 0x000000aa; ckey.dwColorSpaceHighValue = 0x000000aa; hr = IDirectDrawSurface2_SetColorKey(src, DDCKEY_DESTBLT, &ckey); - ok(SUCCEEDED(hr), "Failed to set color key, hr %#x.\n", hr); + ok(SUCCEEDED(hr), "Failed to set color key, hr %#lx.\n", hr); memset(&fx, 0, sizeof(fx)); fx.dwSize = sizeof(fx); @@ -13228,7 +13206,7 @@ static void test_ck_operation(void) fx.ddckDestColorkey.dwColorSpaceLowValue = 0x00001100; hr = IDirectDrawSurface2_Lock(src, NULL, &surface_desc, DDLOCK_WAIT, NULL); - ok(SUCCEEDED(hr), "Failed to lock surface, hr %#x.\n", hr); + ok(SUCCEEDED(hr), "Failed to lock surface, hr %#lx.\n", hr); color = surface_desc.lpSurface; color[0] = 0x000000ff; /* Applies to src blt key in src surface. */ color[1] = 0x000000aa; /* Applies to dst blt key in src surface. */ @@ -13237,21 +13215,21 @@ static void test_ck_operation(void) color[4] = 0x00001100; /* Src color key in ddbltfx. */ color[5] = 0x00110000; /* Dst color key in ddbltfx. */ hr = IDirectDrawSurface2_Unlock(src, NULL); - ok(SUCCEEDED(hr), "Failed to unlock surface, hr %#x.\n", hr); + ok(SUCCEEDED(hr), "Failed to unlock surface, hr %#lx.\n", hr); hr = IDirectDrawSurface2_Lock(dst, NULL, &surface_desc, DDLOCK_WAIT, NULL); - ok(SUCCEEDED(hr), "Failed to lock surface, hr %#x.\n", hr); + ok(SUCCEEDED(hr), "Failed to lock surface, hr %#lx.\n", hr); color = surface_desc.lpSurface; color[0] = color[1] = color[2] = color[3] = color[4] = color[5] = 0x55555555; hr = IDirectDrawSurface2_Unlock(dst, NULL); - ok(SUCCEEDED(hr), "Failed to unlock surface, hr %#x.\n", hr); + ok(SUCCEEDED(hr), "Failed to unlock surface, hr %#lx.\n", hr); /* Test a blit without keying. */ hr = IDirectDrawSurface2_Blt(dst, NULL, src, NULL, 0, &fx); - ok(SUCCEEDED(hr), "Failed to blit, hr %#x.\n", hr); + ok(SUCCEEDED(hr), "Failed to blit, hr %#lx.\n", hr); hr = IDirectDrawSurface2_Lock(dst, NULL, &surface_desc, DDLOCK_WAIT, NULL); - ok(SUCCEEDED(hr), "Failed to lock surface, hr %#x.\n", hr); + ok(SUCCEEDED(hr), "Failed to lock surface, hr %#lx.\n", hr); color = surface_desc.lpSurface; /* Should have copied src data unmodified to dst. */ ok(color[0] == 0x000000ff && color[1] == 0x000000aa && color[2] == 0x00ff0000 && @@ -13261,14 +13239,14 @@ static void test_ck_operation(void) color[0] = color[1] = color[2] = color[3] = color[4] = color[5] = 0x55555555; hr = IDirectDrawSurface2_Unlock(dst, NULL); - ok(SUCCEEDED(hr), "Failed to unlock surface, hr %#x.\n", hr); + ok(SUCCEEDED(hr), "Failed to unlock surface, hr %#lx.\n", hr); /* Src key. */ hr = IDirectDrawSurface2_Blt(dst, NULL, src, NULL, DDBLT_KEYSRC, &fx); - ok(SUCCEEDED(hr), "Failed to blit, hr %#x.\n", hr); + ok(SUCCEEDED(hr), "Failed to blit, hr %#lx.\n", hr); hr = IDirectDrawSurface2_Lock(dst, NULL, &surface_desc, DDLOCK_WAIT, NULL); - ok(SUCCEEDED(hr), "Failed to lock surface, hr %#x.\n", hr); + ok(SUCCEEDED(hr), "Failed to lock surface, hr %#lx.\n", hr); color = surface_desc.lpSurface; /* Src key applied to color[0]. It is unmodified, the others are copied. */ ok(color[0] == 0x55555555 && color[1] == 0x000000aa && color[2] == 0x00ff0000 && @@ -13278,14 +13256,14 @@ static void test_ck_operation(void) color[0] = color[1] = color[2] = color[3] = color[4] = color[5] = 0x55555555; hr = IDirectDrawSurface2_Unlock(dst, NULL); - ok(SUCCEEDED(hr), "Failed to unlock surface, hr %#x.\n", hr); + ok(SUCCEEDED(hr), "Failed to unlock surface, hr %#lx.\n", hr); /* Src override. */ hr = IDirectDrawSurface2_Blt(dst, NULL, src, NULL, DDBLT_KEYSRCOVERRIDE, &fx); - ok(SUCCEEDED(hr), "Failed to blit, hr %#x.\n", hr); + ok(SUCCEEDED(hr), "Failed to blit, hr %#lx.\n", hr); hr = IDirectDrawSurface2_Lock(dst, NULL, &surface_desc, DDLOCK_WAIT, NULL); - ok(SUCCEEDED(hr), "Failed to lock surface, hr %#x.\n", hr); + ok(SUCCEEDED(hr), "Failed to lock surface, hr %#lx.\n", hr); color = surface_desc.lpSurface; /* Override key applied to color[5]. It is unmodified, the others are copied. */ ok(color[0] == 0x000000ff && color[1] == 0x000000aa && color[2] == 0x00ff0000 && @@ -13295,14 +13273,14 @@ static void test_ck_operation(void) color[0] = color[1] = color[2] = color[3] = color[4] = color[5] = 0x55555555; hr = IDirectDrawSurface2_Unlock(dst, NULL); - ok(SUCCEEDED(hr), "Failed to unlock surface, hr %#x.\n", hr); + ok(SUCCEEDED(hr), "Failed to unlock surface, hr %#lx.\n", hr); /* Src override AND src key. That is not supposed to work. */ hr = IDirectDrawSurface2_Blt(dst, NULL, src, NULL, DDBLT_KEYSRC | DDBLT_KEYSRCOVERRIDE, &fx); - ok(hr == DDERR_INVALIDPARAMS, "Got unexpected hr %#x.\n", hr); + ok(hr == DDERR_INVALIDPARAMS, "Got unexpected hr %#lx.\n", hr); hr = IDirectDrawSurface2_Lock(dst, NULL, &surface_desc, DDLOCK_WAIT, NULL); - ok(SUCCEEDED(hr), "Failed to lock surface, hr %#x.\n", hr); + ok(SUCCEEDED(hr), "Failed to lock surface, hr %#lx.\n", hr); color = surface_desc.lpSurface; /* Ensure the destination was not changed. */ ok(color[0] == 0x55555555 && color[1] == 0x55555555 && color[2] == 0x55555555 && @@ -13318,14 +13296,14 @@ static void test_ck_operation(void) color[4] = 0x000000aa; /* Dest key in src surface. */ color[5] = 0x000000aa; /* Dest key in src surface. */ hr = IDirectDrawSurface2_Unlock(dst, NULL); - ok(SUCCEEDED(hr), "Failed to unlock surface, hr %#x.\n", hr); + ok(SUCCEEDED(hr), "Failed to unlock surface, hr %#lx.\n", hr); /* Dest key blit. The key is taken from the SOURCE surface in v2! */ hr = IDirectDrawSurface2_Blt(dst, NULL, src, NULL, DDBLT_KEYDEST, &fx); - ok(SUCCEEDED(hr), "Failed to blit, hr %#x.\n", hr); + ok(SUCCEEDED(hr), "Failed to blit, hr %#lx.\n", hr); hr = IDirectDrawSurface2_Lock(dst, NULL, &surface_desc, DDLOCK_WAIT, NULL); - ok(SUCCEEDED(hr), "Failed to lock surface, hr %#x.\n", hr); + ok(SUCCEEDED(hr), "Failed to lock surface, hr %#lx.\n", hr); color = surface_desc.lpSurface; /* Dst key applied to color[4,5], they are the only changed pixels. */ ok(color[0] == 0x00ff0000 && color[1] == 0x00ff0000 && color[2] == 0x00001100 && @@ -13340,23 +13318,23 @@ static void test_ck_operation(void) color[4] = 0x000000aa; /* Dest key in src surface. */ color[5] = 0x000000aa; /* Dest key in src surface. */ hr = IDirectDrawSurface2_Unlock(dst, NULL); - ok(SUCCEEDED(hr), "Failed to unlock surface, hr %#x.\n", hr); + ok(SUCCEEDED(hr), "Failed to unlock surface, hr %#lx.\n", hr); /* What happens with a QI'd newer version of the interface? It takes the key * from the destination surface. */ hr = IDirectDrawSurface2_QueryInterface(src, &IID_IDirectDrawSurface7, (void **)&src7); - ok(SUCCEEDED(hr), "Failed to query IDirectDrawSurface interface, hr %#x.\n", hr); + ok(SUCCEEDED(hr), "Failed to query IDirectDrawSurface interface, hr %#lx.\n", hr); hr = IDirectDrawSurface2_QueryInterface(dst, &IID_IDirectDrawSurface7, (void **)&dst7); - ok(SUCCEEDED(hr), "Failed to query IDirectDrawSurface interface, hr %#x.\n", hr); + ok(SUCCEEDED(hr), "Failed to query IDirectDrawSurface interface, hr %#lx.\n", hr); hr = IDirectDrawSurface7_Blt(dst7, NULL, src7, NULL, DDBLT_KEYDEST, &fx); - ok(SUCCEEDED(hr), "Failed to blit, hr %#x.\n", hr); + ok(SUCCEEDED(hr), "Failed to blit, hr %#lx.\n", hr); IDirectDrawSurface7_Release(dst7); IDirectDrawSurface7_Release(src7); hr = IDirectDrawSurface2_Lock(dst, NULL, &surface_desc, DDLOCK_WAIT, NULL); - ok(SUCCEEDED(hr), "Failed to lock surface, hr %#x.\n", hr); + ok(SUCCEEDED(hr), "Failed to lock surface, hr %#lx.\n", hr); color = surface_desc.lpSurface; /* Dst key applied to color[0,1], they are the only changed pixels. */ todo_wine ok(color[0] == 0x000000ff && color[1] == 0x000000aa && color[2] == 0x00001100 && @@ -13371,14 +13349,14 @@ static void test_ck_operation(void) color[4] = 0x000000aa; /* Dest key in src surface. */ color[5] = 0x000000aa; /* Dest key in src surface. */ hr = IDirectDrawSurface2_Unlock(dst, NULL); - ok(SUCCEEDED(hr), "Failed to unlock surface, hr %#x.\n", hr); + ok(SUCCEEDED(hr), "Failed to unlock surface, hr %#lx.\n", hr); /* Dest override key blit. */ hr = IDirectDrawSurface2_Blt(dst, NULL, src, NULL, DDBLT_KEYDESTOVERRIDE, &fx); - ok(SUCCEEDED(hr), "Failed to blit, hr %#x.\n", hr); + ok(SUCCEEDED(hr), "Failed to blit, hr %#lx.\n", hr); hr = IDirectDrawSurface2_Lock(dst, NULL, &surface_desc, DDLOCK_WAIT, NULL); - ok(SUCCEEDED(hr), "Failed to lock surface, hr %#x.\n", hr); + ok(SUCCEEDED(hr), "Failed to lock surface, hr %#lx.\n", hr); color = surface_desc.lpSurface; /* Dst key applied to color[2,3], they are the only changed pixels. */ ok(color[0] == 0x00ff0000 && color[1] == 0x00ff0000 && color[2] == 0x00ff0000 && @@ -13393,14 +13371,14 @@ static void test_ck_operation(void) color[4] = 0x000000aa; /* Dest key in src surface. */ color[5] = 0x000000aa; /* Dest key in src surface. */ hr = IDirectDrawSurface2_Unlock(dst, NULL); - ok(SUCCEEDED(hr), "Failed to unlock surface, hr %#x.\n", hr); + ok(SUCCEEDED(hr), "Failed to unlock surface, hr %#lx.\n", hr); /* Dest override together with surface key. Supposed to fail. */ hr = IDirectDrawSurface2_Blt(dst, NULL, src, NULL, DDBLT_KEYDEST | DDBLT_KEYDESTOVERRIDE, &fx); - ok(hr == DDERR_INVALIDPARAMS, "Got unexpected hr %#x.\n", hr); + ok(hr == DDERR_INVALIDPARAMS, "Got unexpected hr %#lx.\n", hr); hr = IDirectDrawSurface2_Lock(dst, NULL, &surface_desc, DDLOCK_WAIT, NULL); - ok(SUCCEEDED(hr), "Failed to lock surface, hr %#x.\n", hr); + ok(SUCCEEDED(hr), "Failed to lock surface, hr %#lx.\n", hr); color = surface_desc.lpSurface; /* Destination is unchanged. */ ok(color[0] == 0x00ff0000 && color[1] == 0x00ff0000 && color[2] == 0x00001100 && @@ -13408,17 +13386,17 @@ static void test_ck_operation(void) "Got unexpected content %08x %08x %08x %08x %08x %08x.\n", color[0], color[1], color[2], color[3], color[4], color[5]); hr = IDirectDrawSurface2_Unlock(dst, NULL); - ok(SUCCEEDED(hr), "Failed to unlock surface, hr %#x.\n", hr); + ok(SUCCEEDED(hr), "Failed to unlock surface, hr %#lx.\n", hr); /* Source and destination key. This is driver dependent. New HW treats it like * DDBLT_KEYSRC. Older HW and some software renderers apply both keys. */ if (0) { hr = IDirectDrawSurface2_Blt(dst, NULL, src, NULL, DDBLT_KEYDEST | DDBLT_KEYSRC, &fx); - ok(SUCCEEDED(hr), "Failed to blit, hr %#x.\n", hr); + ok(SUCCEEDED(hr), "Failed to blit, hr %#lx.\n", hr); hr = IDirectDrawSurface2_Lock(dst, NULL, &surface_desc, DDLOCK_WAIT, NULL); - ok(SUCCEEDED(hr), "Failed to lock surface, hr %#x.\n", hr); + ok(SUCCEEDED(hr), "Failed to lock surface, hr %#lx.\n", hr); color = surface_desc.lpSurface; /* Color[0] is filtered by the src key, 2-5 are filtered by the dst key, if * the driver applies it. */ @@ -13434,31 +13412,31 @@ static void test_ck_operation(void) color[4] = 0x000000aa; /* Dest key in src surface. */ color[5] = 0x000000aa; /* Dest key in src surface. */ hr = IDirectDrawSurface2_Unlock(dst, NULL); - ok(SUCCEEDED(hr), "Failed to unlock surface, hr %#x.\n", hr); + ok(SUCCEEDED(hr), "Failed to unlock surface, hr %#lx.\n", hr); } /* Override keys without ddbltfx parameter fail */ hr = IDirectDrawSurface2_Blt(dst, NULL, src, NULL, DDBLT_KEYDESTOVERRIDE, NULL); - ok(hr == DDERR_INVALIDPARAMS, "Got unexpected hr %#x.\n", hr); + ok(hr == DDERR_INVALIDPARAMS, "Got unexpected hr %#lx.\n", hr); hr = IDirectDrawSurface2_Blt(dst, NULL, src, NULL, DDBLT_KEYSRCOVERRIDE, NULL); - ok(hr == DDERR_INVALIDPARAMS, "Got unexpected hr %#x.\n", hr); + ok(hr == DDERR_INVALIDPARAMS, "Got unexpected hr %#lx.\n", hr); /* Try blitting without keys in the source surface. */ hr = IDirectDrawSurface2_SetColorKey(src, DDCKEY_SRCBLT, NULL); - ok(SUCCEEDED(hr), "Failed to set color key, hr %#x.\n", hr); + ok(SUCCEEDED(hr), "Failed to set color key, hr %#lx.\n", hr); hr = IDirectDrawSurface2_SetColorKey(src, DDCKEY_DESTBLT, NULL); - ok(SUCCEEDED(hr), "Failed to set color key, hr %#x.\n", hr); + ok(SUCCEEDED(hr), "Failed to set color key, hr %#lx.\n", hr); /* That fails now. Do not bother to check that the data is unmodified. */ hr = IDirectDrawSurface2_Blt(dst, NULL, src, NULL, DDBLT_KEYSRC, &fx); - ok(hr == DDERR_INVALIDPARAMS, "Got unexpected hr %#x.\n", hr); + ok(hr == DDERR_INVALIDPARAMS, "Got unexpected hr %#lx.\n", hr); /* Surprisingly this still works. It uses the old key from the src surface. */ hr = IDirectDrawSurface2_Blt(dst, NULL, src, NULL, DDBLT_KEYDEST, &fx); - ok(SUCCEEDED(hr), "Failed to blit, hr %#x.\n", hr); + ok(SUCCEEDED(hr), "Failed to blit, hr %#lx.\n", hr); hr = IDirectDrawSurface2_Lock(dst, NULL, &surface_desc, DDLOCK_WAIT, NULL); - ok(SUCCEEDED(hr), "Failed to lock surface, hr %#x.\n", hr); + ok(SUCCEEDED(hr), "Failed to lock surface, hr %#lx.\n", hr); color = surface_desc.lpSurface; /* Dst key applied to color[4,5], they are the only changed pixels. */ ok(color[0] == 0x00ff0000 && color[1] == 0x00ff0000 && color[2] == 0x00001100 && @@ -13466,37 +13444,37 @@ static void test_ck_operation(void) "Got unexpected content %08x %08x %08x %08x %08x %08x.\n", color[0], color[1], color[2], color[3], color[4], color[5]); hr = IDirectDrawSurface2_Unlock(dst, NULL); - ok(SUCCEEDED(hr), "Failed to unlock surface, hr %#x.\n", hr); + ok(SUCCEEDED(hr), "Failed to unlock surface, hr %#lx.\n", hr); /* This returns DDERR_NOCOLORKEY as expected. */ hr = IDirectDrawSurface2_GetColorKey(src, DDCKEY_DESTBLT, &ckey); - ok(hr == DDERR_NOCOLORKEY, "Got unexpected hr %#x.\n", hr); + ok(hr == DDERR_NOCOLORKEY, "Got unexpected hr %#lx.\n", hr); /* GetSurfaceDesc returns a zeroed key as expected. */ surface_desc.ddckCKSrcBlt.dwColorSpaceLowValue = 0x12345678; surface_desc.ddckCKSrcBlt.dwColorSpaceHighValue = 0x12345678; hr = IDirectDrawSurface2_GetSurfaceDesc(src, &surface_desc); - ok(SUCCEEDED(hr), "Failed to get surface desc, hr %#x.\n", hr); + ok(SUCCEEDED(hr), "Failed to get surface desc, hr %#lx.\n", hr); ok(!surface_desc.ddckCKSrcBlt.dwColorSpaceLowValue && !surface_desc.ddckCKSrcBlt.dwColorSpaceHighValue, - "Got unexpected color key low=%08x high=%08x.\n", surface_desc.ddckCKSrcBlt.dwColorSpaceLowValue, + "Got unexpected color key low=%08lx high=%08lx.\n", surface_desc.ddckCKSrcBlt.dwColorSpaceLowValue, surface_desc.ddckCKSrcBlt.dwColorSpaceHighValue); /* Try blitting without keys in the destination surface. */ hr = IDirectDrawSurface2_SetColorKey(dst, DDCKEY_SRCBLT, NULL); - ok(SUCCEEDED(hr), "Failed to set color key, hr %#x.\n", hr); + ok(SUCCEEDED(hr), "Failed to set color key, hr %#lx.\n", hr); hr = IDirectDrawSurface2_SetColorKey(dst, DDCKEY_DESTBLT, NULL); - ok(SUCCEEDED(hr), "Failed to set color key, hr %#x.\n", hr); + ok(SUCCEEDED(hr), "Failed to set color key, hr %#lx.\n", hr); /* This fails, as sanity would dictate. */ hr = IDirectDrawSurface2_Blt(dst, NULL, src, NULL, DDBLT_KEYDEST, &fx); - ok(hr == DDERR_INVALIDPARAMS, "Got unexpected hr %#x.\n", hr); + ok(hr == DDERR_INVALIDPARAMS, "Got unexpected hr %#lx.\n", hr); done: IDirectDrawSurface2_Release(src); IDirectDrawSurface2_Release(dst); refcount = IDirectDraw2_Release(ddraw); - ok(!refcount, "DirectDraw has %u references left.\n", refcount); + ok(!refcount, "DirectDraw has %lu references left.\n", refcount); DestroyWindow(window); } @@ -13520,38 +13498,37 @@ static void test_set_render_state(void) } hr = IDirect3DDevice2_SetRenderState(device, D3DRENDERSTATE_ZVISIBLE, TRUE); - ok(hr == D3D_OK, "Got unexpected hr %#x.\n", hr); + ok(hr == D3D_OK, "Got unexpected hr %#lx.\n", hr); hr = IDirect3DDevice2_SetRenderState(device, D3DRENDERSTATE_ZVISIBLE, FALSE); - ok(hr == D3D_OK, "Got unexpected hr %#x.\n", hr); + ok(hr == D3D_OK, "Got unexpected hr %#lx.\n", hr); hr = IDirect3DDevice2_SetRenderState(device, D3DRENDERSTATE_TEXTUREHANDLE, 0); - ok(hr == D3D_OK, "Got unexpected hr %#x.\n", hr); + ok(hr == D3D_OK, "Got unexpected hr %#lx.\n", hr); state = 0xdeadbeef; hr = IDirect3DDevice2_GetRenderState(device, D3DRENDERSTATE_TEXTUREHANDLE, &state); - ok(hr == D3D_OK, "Got unexpected hr %#x.\n", hr); - ok(!state, "Got unexpected render state %#x.\n", state); + ok(hr == D3D_OK, "Got unexpected hr %#lx.\n", hr); + ok(!state, "Got unexpected render state %#lx.\n", state); hr = IDirect3DDevice2_SetRenderState(device, D3DRENDERSTATE_TEXTUREMAPBLEND, D3DTBLEND_MODULATE); - ok(hr == D3D_OK, "Got unexpected hr %#x.\n", hr); + ok(hr == D3D_OK, "Got unexpected hr %#lx.\n", hr); hr = IDirect3DDevice2_GetRenderState(device, D3DRENDERSTATE_TEXTUREMAPBLEND, &state); - ok(hr == D3D_OK, "Got unexpected hr %#x.\n", hr); - ok(state == D3DTBLEND_MODULATE, "Got unexpected render state %#x.\n", state); + ok(hr == D3D_OK, "Got unexpected hr %#lx.\n", hr); + ok(state == D3DTBLEND_MODULATE, "Got unexpected render state %#lx.\n", state); refcount = IDirect3DDevice2_Release(device); - ok(!refcount, "Device has %u references left.\n", refcount); + ok(!refcount, "Device has %lu references left.\n", refcount); refcount = IDirectDraw2_Release(ddraw); - ok(!refcount, "DirectDraw has %u references left.\n", refcount); + ok(!refcount, "DirectDraw has %lu references left.\n", refcount); DestroyWindow(window); } static void test_depth_readback(void) { - DWORD depth, expected_depth, max_diff, passed_fmts = 0; + unsigned int depth, expected_depth, i, x, y, max_diff, passed_fmts = 0; IDirect3DMaterial2 *blue_background; IDirectDrawSurface *rt, *ds; IDirect3DViewport2 *viewport; DDSURFACEDESC surface_desc; IDirect3DDevice2 *device; - unsigned int i, x, y; IDirectDraw2 *ddraw; ULONG refcount; HWND window; @@ -13592,16 +13569,16 @@ static void test_depth_readback(void) } hr = IDirect3DDevice2_GetRenderTarget(device, &rt); - ok(SUCCEEDED(hr), "Failed to get render target, hr %#x.\n", hr); + ok(SUCCEEDED(hr), "Failed to get render target, hr %#lx.\n", hr); blue_background = create_diffuse_material(device, 0.0f, 0.0f, 1.0f, 1.0f); viewport = create_viewport(device, 0, 0, 640, 480); viewport_set_background(device, viewport, blue_background); hr = IDirect3DDevice2_SetCurrentViewport(device, viewport); - ok(SUCCEEDED(hr), "Failed to set current viewport, hr %#x.\n", hr); + ok(SUCCEEDED(hr), "Failed to set current viewport, hr %#lx.\n", hr); ds = get_depth_stencil(device); hr = IDirectDrawSurface_DeleteAttachedSurface(rt, 0, ds); - ok(SUCCEEDED(hr), "Failed to detach depth buffer, hr %#x.\n", hr); + ok(SUCCEEDED(hr), "Failed to detach depth buffer, hr %#lx.\n", hr); IDirectDrawSurface_Release(ds); for (i = 0; i < ARRAY_SIZE(tests); ++i) @@ -13621,23 +13598,23 @@ static void test_depth_readback(void) } hr = IDirectDrawSurface_AddAttachedSurface(rt, ds); - ok(SUCCEEDED(hr), "Failed to attach depth buffer, hr %#x.\n", hr); + ok(SUCCEEDED(hr), "Failed to attach depth buffer, hr %#lx.\n", hr); hr = IDirect3DDevice2_SetRenderTarget(device, rt, 0); - ok(SUCCEEDED(hr), "Failed to set render target, hr %#x.\n", hr); + ok(SUCCEEDED(hr), "Failed to set render target, hr %#lx.\n", hr); hr = IDirect3DViewport2_Clear(viewport, 1, &clear_rect, D3DCLEAR_TARGET | D3DCLEAR_ZBUFFER); - ok(SUCCEEDED(hr), "Failed to clear, hr %#x.\n", hr); + ok(SUCCEEDED(hr), "Failed to clear, hr %#lx.\n", hr); hr = IDirect3DDevice2_BeginScene(device); - ok(SUCCEEDED(hr), "Failed to begin scene, hr %#x.\n", hr); + ok(SUCCEEDED(hr), "Failed to begin scene, hr %#lx.\n", hr); hr = IDirect3DDevice2_DrawPrimitive(device, D3DPT_TRIANGLESTRIP, D3DVT_LVERTEX, quad, 4, 0); - ok(SUCCEEDED(hr), "Failed to draw, hr %#x.\n", hr); + ok(SUCCEEDED(hr), "Failed to draw, hr %#lx.\n", hr); hr = IDirect3DDevice2_EndScene(device); - ok(SUCCEEDED(hr), "Failed to end scene, hr %#x.\n", hr); + ok(SUCCEEDED(hr), "Failed to end scene, hr %#lx.\n", hr); memset(&surface_desc, 0, sizeof(surface_desc)); surface_desc.dwSize = sizeof(surface_desc); hr = IDirectDrawSurface_Lock(ds, NULL, &surface_desc, DDLOCK_READONLY | DDLOCK_WAIT, NULL); - ok(SUCCEEDED(hr), "Failed to lock surface, hr %#x.\n", hr); + ok(SUCCEEDED(hr), "Failed to lock surface, hr %#lx.\n", hr); all_pass = TRUE; for (y = 60; y < 480; y += 120) @@ -13663,13 +13640,13 @@ static void test_depth_readback(void) } hr = IDirectDrawSurface_Unlock(ds, NULL); - ok(SUCCEEDED(hr), "Failed to unlock surface, hr %#x.\n", hr); + ok(SUCCEEDED(hr), "Failed to unlock surface, hr %#lx.\n", hr); if (all_pass) passed_fmts++; hr = IDirectDrawSurface_DeleteAttachedSurface(rt, 0, ds); - ok(SUCCEEDED(hr), "Failed to detach depth buffer, hr %#x.\n", hr); + ok(SUCCEEDED(hr), "Failed to detach depth buffer, hr %#lx.\n", hr); IDirectDrawSurface_Release(ds); } @@ -13679,7 +13656,7 @@ static void test_depth_readback(void) destroy_material(blue_background); IDirectDrawSurface_Release(rt); refcount = IDirect3DDevice2_Release(device); - ok(!refcount, "Device has %u references left.\n", refcount); + ok(!refcount, "Device has %lu references left.\n", refcount); IDirectDraw2_Release(ddraw); DestroyWindow(window); } @@ -13692,8 +13669,8 @@ static void test_clear(void) IDirect3DDevice2 *device; IDirectDrawSurface *rt; IDirectDraw2 *ddraw; + unsigned int color; D3DRECT rect[2]; - D3DCOLOR color; ULONG refcount; HWND window; HRESULT hr; @@ -13709,11 +13686,11 @@ static void test_clear(void) return; } hr = IDirect3DDevice2_GetRenderTarget(device, &rt); - ok(SUCCEEDED(hr), "Failed to get render target, hr %#x.\n", hr); + ok(SUCCEEDED(hr), "Failed to get render target, hr %#lx.\n", hr); viewport = create_viewport(device, 0, 0, 640, 480); hr = IDirect3DDevice2_SetCurrentViewport(device, viewport); - ok(SUCCEEDED(hr), "Failed to set current viewport, hr %#x.\n", hr); + ok(SUCCEEDED(hr), "Failed to set current viewport, hr %#lx.\n", hr); white = create_diffuse_material(device, 1.0f, 1.0f, 1.0f, 1.0f); red = create_diffuse_material(device, 1.0f, 0.0f, 0.0f, 1.0f); @@ -13722,7 +13699,7 @@ static void test_clear(void) viewport_set_background(device, viewport, white); hr = IDirect3DViewport2_Clear(viewport, 1, &rect_full, D3DCLEAR_TARGET); - ok(SUCCEEDED(hr), "Failed to clear, hr %#x.\n", hr); + ok(SUCCEEDED(hr), "Failed to clear, hr %#lx.\n", hr); /* Positive x, negative y. */ U1(rect[0]).x1 = 0; @@ -13740,7 +13717,7 @@ static void test_clear(void) * refuse negative rectangles, but it will not clear them either. */ viewport_set_background(device, viewport, red); hr = IDirect3DViewport2_Clear(viewport, 2, rect, D3DCLEAR_TARGET); - ok(SUCCEEDED(hr), "Failed to clear, hr %#x.\n", hr); + ok(SUCCEEDED(hr), "Failed to clear, hr %#lx.\n", hr); color = get_surface_color(rt, 160, 360); ok(compare_color(color, 0x00ffffff, 0), "Clear rectangle 3 (pos, neg) has color 0x%08x.\n", color); @@ -13753,7 +13730,7 @@ static void test_clear(void) viewport_set_background(device, viewport, white); hr = IDirect3DViewport2_Clear(viewport, 1, &rect_full, D3DCLEAR_TARGET); - ok(SUCCEEDED(hr), "Failed to clear, hr %#x.\n", hr); + ok(SUCCEEDED(hr), "Failed to clear, hr %#lx.\n", hr); /* negative x, negative y. * Also ignored, except on WARP, which clears the entire screen. */ @@ -13763,7 +13740,7 @@ static void test_clear(void) U4(rect_negneg).y2 = 0; viewport_set_background(device, viewport, green); hr = IDirect3DViewport2_Clear(viewport, 1, &rect_negneg, D3DCLEAR_TARGET); - ok(SUCCEEDED(hr), "Failed to clear, hr %#x.\n", hr); + ok(SUCCEEDED(hr), "Failed to clear, hr %#lx.\n", hr); color = get_surface_color(rt, 160, 360); ok(compare_color(color, 0x00ffffff, 0) @@ -13785,19 +13762,19 @@ static void test_clear(void) /* Test how the viewport affects clears. */ viewport_set_background(device, viewport, white); hr = IDirect3DViewport2_Clear(viewport, 1, &rect_full, D3DCLEAR_TARGET); - ok(SUCCEEDED(hr), "Failed to clear, hr %#x.\n", hr); + ok(SUCCEEDED(hr), "Failed to clear, hr %#lx.\n", hr); viewport2 = create_viewport(device, 160, 120, 160, 120); hr = IDirect3DDevice2_SetCurrentViewport(device, viewport2); - ok(SUCCEEDED(hr), "Failed to set current viewport, hr %#x.\n", hr); + ok(SUCCEEDED(hr), "Failed to set current viewport, hr %#lx.\n", hr); viewport_set_background(device, viewport2, blue); hr = IDirect3DViewport2_Clear(viewport2, 1, &rect_full, D3DCLEAR_TARGET); - ok(SUCCEEDED(hr), "Failed to clear, hr %#x.\n", hr); + ok(SUCCEEDED(hr), "Failed to clear, hr %#lx.\n", hr); viewport3 = create_viewport(device, 320, 240, 320, 240); hr = IDirect3DDevice2_SetCurrentViewport(device, viewport3); - ok(SUCCEEDED(hr), "Failed to set current viewport, hr %#x.\n", hr); + ok(SUCCEEDED(hr), "Failed to set current viewport, hr %#lx.\n", hr); U1(rect[0]).x1 = 160; U2(rect[0]).y1 = 120; @@ -13805,10 +13782,10 @@ static void test_clear(void) U4(rect[0]).y2 = 360; viewport_set_background(device, viewport3, green); hr = IDirect3DViewport2_Clear(viewport3, 1, &rect[0], D3DCLEAR_TARGET); - ok(SUCCEEDED(hr), "Failed to clear, hr %#x.\n", hr); + ok(SUCCEEDED(hr), "Failed to clear, hr %#lx.\n", hr); hr = IDirect3DDevice2_SetCurrentViewport(device, viewport); - ok(SUCCEEDED(hr), "Failed to set current viewport, hr %#x.\n", hr); + ok(SUCCEEDED(hr), "Failed to set current viewport, hr %#lx.\n", hr); color = get_surface_color(rt, 158, 118); ok(compare_color(color, 0x00ffffff, 0), "(158, 118) has color 0x%08x.\n", color); @@ -13840,13 +13817,13 @@ static void test_clear(void) /* The clear rectangle is rendertarget absolute, not relative to the * viewport. */ hr = IDirect3DViewport2_Clear(viewport, 1, &rect_full, D3DCLEAR_TARGET); - ok(SUCCEEDED(hr), "Failed to clear, hr %#x.\n", hr); + ok(SUCCEEDED(hr), "Failed to clear, hr %#lx.\n", hr); U1(rect[0]).x1 = 330; U2(rect[0]).y1 = 250; U3(rect[0]).x2 = 340; U4(rect[0]).y2 = 260; hr = IDirect3DViewport2_Clear(viewport3, 1, &rect[0], D3DCLEAR_TARGET); - ok(SUCCEEDED(hr), "Failed to clear, hr %#x.\n", hr); + ok(SUCCEEDED(hr), "Failed to clear, hr %#lx.\n", hr); color = get_surface_color(rt, 328, 248); ok(compare_color(color, 0x00ffffff, 0), "(328, 248) has color 0x%08x.\n", color); @@ -13896,9 +13873,9 @@ static void test_clear(void) IDirect3DMaterial2_Release(blue); IDirectDrawSurface_Release(rt); refcount = IDirect3DDevice2_Release(device); - ok(!refcount, "Device has %u references left.\n", refcount); + ok(!refcount, "Device has %lu references left.\n", refcount); refcount = IDirectDraw2_Release(ddraw); - ok(!refcount, "Ddraw object has %u references left.\n", refcount); + ok(!refcount, "Ddraw object has %lu references left.\n", refcount); DestroyWindow(window); } @@ -13956,12 +13933,12 @@ static HRESULT WINAPI enum_surfaces_create_cb(IDirectDrawSurface *surface, DDSUR struct enum_surfaces_param *param = context; ok(!surface, "Unexpected surface %p.\n", surface); - ok((desc->dwFlags & expect_flags) == expect_flags, "Got unexpected flags %#x.\n", desc->dwFlags); + ok((desc->dwFlags & expect_flags) == expect_flags, "Got unexpected flags %#lx.\n", desc->dwFlags); if (param->count < ARRAY_SIZE(param->modes)) { const DDSURFACEDESC *expect = ¶m->modes[param->count]; - ok(desc->dwWidth == expect->dwWidth, "Expected width %u, got %u.\n", expect->dwWidth, desc->dwWidth); - ok(desc->dwHeight == expect->dwHeight, "Expected height %u, got %u.\n", expect->dwHeight, desc->dwHeight); + ok(desc->dwWidth == expect->dwWidth, "Expected width %lu, got %lu.\n", expect->dwWidth, desc->dwWidth); + ok(desc->dwHeight == expect->dwHeight, "Expected height %lu, got %lu.\n", expect->dwHeight, desc->dwHeight); ok(!memcmp(&U4(*desc).ddpfPixelFormat, &U4(*expect).ddpfPixelFormat, sizeof(U4(*desc).ddpfPixelFormat)), "Pixel formats didn't match.\n"); } @@ -13986,18 +13963,18 @@ static void test_enum_surfaces(void) memset(&desc, 0, sizeof(desc)); desc.dwSize = sizeof(desc); hr = IDirectDraw2_GetDisplayMode(ddraw, &desc); - ok(hr == DD_OK, "Failed to get display mode, hr %#x.\n", hr); + ok(hr == DD_OK, "Failed to get display mode, hr %#lx.\n", hr); current_format = desc.ddpfPixelFormat; hr = IDirectDraw2_SetCooperativeLevel(ddraw, NULL, DDSCL_NORMAL); - ok(hr == DD_OK, "Failed to set cooperative level, hr %#x.\n", hr); + ok(hr == DD_OK, "Failed to set cooperative level, hr %#lx.\n", hr); hr = IDirectDraw2_EnumSurfaces(ddraw, DDENUMSURFACES_ALL, NULL, NULL, enum_surfaces_cb); - ok(hr == DDERR_INVALIDPARAMS, "Got unexpected hr %#x.\n", hr); + ok(hr == DDERR_INVALIDPARAMS, "Got unexpected hr %#lx.\n", hr); hr = IDirectDraw2_EnumSurfaces(ddraw, DDENUMSURFACES_CANBECREATED | DDENUMSURFACES_ALL, NULL, NULL, enum_surfaces_cb); - ok(hr == DDERR_INVALIDPARAMS, "Got unexpected hr %#x.\n", hr); + ok(hr == DDERR_INVALIDPARAMS, "Got unexpected hr %#lx.\n", hr); memset(&desc, 0, sizeof(desc)); desc.dwSize = sizeof(desc); @@ -14007,52 +13984,52 @@ static void test_enum_surfaces(void) desc.dwWidth = 32; desc.dwHeight = 32; hr = IDirectDraw2_CreateSurface(ddraw, &desc, ¶m.surfaces[0], NULL); - ok(SUCCEEDED(hr), "Failed to create a surface, hr %#x.\n", hr); + ok(SUCCEEDED(hr), "Failed to create a surface, hr %#lx.\n", hr); hr = IDirectDrawSurface_GetAttachedSurface(param.surfaces[0], &desc.ddsCaps, ¶m.surfaces[1]); - ok(SUCCEEDED(hr), "Failed to get attached surface, hr %#x.\n", hr); + ok(SUCCEEDED(hr), "Failed to get attached surface, hr %#lx.\n", hr); hr = IDirectDrawSurface_GetAttachedSurface(param.surfaces[1], &desc.ddsCaps, ¶m.surfaces[2]); - ok(SUCCEEDED(hr), "Failed to get attached surface, hr %#x.\n", hr); + ok(SUCCEEDED(hr), "Failed to get attached surface, hr %#lx.\n", hr); hr = IDirectDrawSurface_GetAttachedSurface(param.surfaces[2], &desc.ddsCaps, ¶m.surfaces[3]); - ok(hr == DDERR_NOTFOUND, "Got unexpected hr %#x.\n", hr); + ok(hr == DDERR_NOTFOUND, "Got unexpected hr %#lx.\n", hr); ok(!param.surfaces[3], "Got unexpected pointer %p.\n", param.surfaces[3]); param.count = 0; hr = IDirectDraw2_EnumSurfaces(ddraw, DDENUMSURFACES_DOESEXIST | DDENUMSURFACES_ALL, &desc, ¶m, enum_surfaces_cb); - ok(SUCCEEDED(hr), "Failed to enumerate surfaces, hr %#x.\n", hr); + ok(SUCCEEDED(hr), "Failed to enumerate surfaces, hr %#lx.\n", hr); ok(param.count == 3, "Got unexpected number of enumerated surfaces %u.\n", param.count); param.count = 0; hr = IDirectDraw2_EnumSurfaces(ddraw, DDENUMSURFACES_DOESEXIST | DDENUMSURFACES_ALL, NULL, ¶m, enum_surfaces_cb); - ok(SUCCEEDED(hr), "Failed to enumerate surfaces, hr %#x.\n", hr); + ok(SUCCEEDED(hr), "Failed to enumerate surfaces, hr %#lx.\n", hr); ok(param.count == 3, "Got unexpected number of enumerated surfaces %u.\n", param.count); desc.dwFlags = DDSD_WIDTH | DDSD_HEIGHT; param.count = 0; hr = IDirectDraw2_EnumSurfaces(ddraw, DDENUMSURFACES_DOESEXIST | DDENUMSURFACES_MATCH, &desc, ¶m, enum_surfaces_cb); - ok(hr == DD_OK, "Failed to enumerate surfaces, hr %#x.\n", hr); + ok(hr == DD_OK, "Failed to enumerate surfaces, hr %#lx.\n", hr); ok(param.count == 1, "Got unexpected number of enumerated surfaces %u.\n", param.count); param.count = 0; hr = IDirectDraw2_EnumSurfaces(ddraw, DDENUMSURFACES_DOESEXIST | DDENUMSURFACES_NOMATCH, &desc, ¶m, enum_surfaces_cb); - ok(hr == DD_OK, "Failed to enumerate surfaces, hr %#x.\n", hr); + ok(hr == DD_OK, "Failed to enumerate surfaces, hr %#lx.\n", hr); ok(param.count == 2, "Got unexpected number of enumerated surfaces %u.\n", param.count); desc.dwFlags = 0; param.count = 0; hr = IDirectDraw2_EnumSurfaces(ddraw, DDENUMSURFACES_DOESEXIST | DDENUMSURFACES_MATCH, &desc, ¶m, enum_surfaces_cb); - ok(hr == DD_OK, "Failed to enumerate surfaces, hr %#x.\n", hr); + ok(hr == DD_OK, "Failed to enumerate surfaces, hr %#lx.\n", hr); ok(param.count == 3, "Got unexpected number of enumerated surfaces %u.\n", param.count); desc.dwFlags = 0; param.count = 0; hr = IDirectDraw2_EnumSurfaces(ddraw, DDENUMSURFACES_DOESEXIST, &desc, ¶m, enum_surfaces_cb); - ok(hr == DD_OK, "Failed to enumerate surfaces, hr %#x.\n", hr); + ok(hr == DD_OK, "Failed to enumerate surfaces, hr %#lx.\n", hr); ok(param.count == 3, "Got unexpected number of enumerated surfaces %u.\n", param.count); IDirectDrawSurface_Release(param.surfaces[2]); @@ -14062,7 +14039,7 @@ static void test_enum_surfaces(void) param.count = 0; hr = IDirectDraw2_EnumSurfaces(ddraw, DDENUMSURFACES_DOESEXIST | DDENUMSURFACES_ALL, NULL, ¶m, enum_surfaces_cb); - ok(hr == DD_OK, "Failed to enumerate surfaces, hr %#x.\n", hr); + ok(hr == DD_OK, "Failed to enumerate surfaces, hr %#lx.\n", hr); ok(!param.count, "Got unexpected number of enumerated surfaces %u.\n", param.count); memset(&desc, 0, sizeof(desc)); @@ -14072,15 +14049,15 @@ static void test_enum_surfaces(void) hr = IDirectDraw2_EnumSurfaces(ddraw, DDENUMSURFACES_CANBECREATED | DDENUMSURFACES_ALL, &desc, ¶m, enum_surfaces_create_cb); - ok(hr == DDERR_INVALIDPARAMS, "Failed to enumerate surfaces, hr %#x.\n", hr); + ok(hr == DDERR_INVALIDPARAMS, "Failed to enumerate surfaces, hr %#lx.\n", hr); hr = IDirectDraw2_EnumSurfaces(ddraw, DDENUMSURFACES_CANBECREATED | DDENUMSURFACES_NOMATCH, &desc, ¶m, enum_surfaces_create_cb); - ok(hr == DDERR_INVALIDPARAMS, "Failed to enumerate surfaces, hr %#x.\n", hr); + ok(hr == DDERR_INVALIDPARAMS, "Failed to enumerate surfaces, hr %#lx.\n", hr); hr = IDirectDraw2_EnumSurfaces(ddraw, DDENUMSURFACES_CANBECREATED, &desc, ¶m, enum_surfaces_create_cb); - ok(hr == DDERR_INVALIDPARAMS, "Failed to enumerate surfaces, hr %#x.\n", hr); + ok(hr == DDERR_INVALIDPARAMS, "Failed to enumerate surfaces, hr %#lx.\n", hr); /* When not passed width and height, the callback is called with every * available display resolution. */ @@ -14089,13 +14066,13 @@ static void test_enum_surfaces(void) desc.dwFlags |= DDSD_PIXELFORMAT; U4(desc).ddpfPixelFormat = current_format; hr = IDirectDraw2_EnumDisplayModes(ddraw, 0, &desc, ¶m, build_mode_list_cb); - ok(hr == DD_OK, "Failed to build mode list, hr %#x.\n", hr); + ok(hr == DD_OK, "Failed to build mode list, hr %#lx.\n", hr); param.count = 0; desc.dwFlags &= ~DDSD_PIXELFORMAT; hr = IDirectDraw2_EnumSurfaces(ddraw, DDENUMSURFACES_CANBECREATED | DDENUMSURFACES_MATCH, &desc, ¶m, enum_surfaces_create_cb); - ok(hr == DD_OK, "Failed to enumerate surfaces, hr %#x.\n", hr); + ok(hr == DD_OK, "Failed to enumerate surfaces, hr %#lx.\n", hr); ok(param.count == param.mode_count, "Expected %u surfaces, got %u.\n", param.mode_count, param.count); desc.dwFlags |= DDSD_WIDTH | DDSD_HEIGHT; @@ -14106,15 +14083,15 @@ static void test_enum_surfaces(void) param.count = 0; hr = IDirectDraw2_EnumSurfaces(ddraw, DDENUMSURFACES_CANBECREATED | DDENUMSURFACES_MATCH, &desc, ¶m, enum_surfaces_create_cb); - ok(hr == DD_OK, "Failed to enumerate surfaces, hr %#x.\n", hr); + ok(hr == DD_OK, "Failed to enumerate surfaces, hr %#lx.\n", hr); ok(param.count == 1, "Got unexpected number of enumerated surfaces %u.\n", param.count); hr = IDirectDraw2_CreateSurface(ddraw, &desc, ¶m.surfaces[0], NULL); - ok(hr == DD_OK, "Failed to create surface, hr %#x.\n", hr); + ok(hr == DD_OK, "Failed to create surface, hr %#lx.\n", hr); param.count = 0; hr = IDirectDraw2_EnumSurfaces(ddraw, DDENUMSURFACES_CANBECREATED | DDENUMSURFACES_DOESEXIST | DDENUMSURFACES_MATCH, &desc, ¶m, enum_surfaces_create_cb); - ok(hr == DD_OK, "Failed to enumerate surfaces, hr %#x.\n", hr); + ok(hr == DD_OK, "Failed to enumerate surfaces, hr %#lx.\n", hr); ok(param.count == 1, "Got unexpected number of enumerated surfaces %u.\n", param.count); IDirectDrawSurface2_Release(param.surfaces[0]); @@ -14126,7 +14103,7 @@ static void test_enum_surfaces(void) param.count = 0; hr = IDirectDraw2_EnumSurfaces(ddraw, DDENUMSURFACES_CANBECREATED | DDENUMSURFACES_MATCH, &desc, ¶m, enum_surfaces_create_cb); - ok(hr == DD_OK, "Failed to enumerate surfaces, hr %#x.\n", hr); + ok(hr == DD_OK, "Failed to enumerate surfaces, hr %#lx.\n", hr); ok(!param.count, "Got unexpected number of enumerated surfaces %u.\n", param.count); IDirectDraw2_Release(ddraw); @@ -14200,19 +14177,19 @@ static void test_viewport(void) } hr = IDirect3DDevice2_GetDirect3D(device, &d3d); - ok(SUCCEEDED(hr), "Failed to get Direct3D2 interface, hr %#x.\n", hr); + ok(SUCCEEDED(hr), "Failed to get Direct3D2 interface, hr %#lx.\n", hr); hr = IDirect3DDevice2_SetRenderState(device, D3DRENDERSTATE_ZENABLE, D3DZB_FALSE); - ok(SUCCEEDED(hr), "Failed to disable depth test, hr %#x.\n", hr); + ok(SUCCEEDED(hr), "Failed to disable depth test, hr %#lx.\n", hr); hr = IDirect3DDevice2_SetRenderState(device, D3DRENDERSTATE_CULLMODE, D3DCULL_NONE); - ok(SUCCEEDED(hr), "Failed to disable culling, hr %#x.\n", hr); + ok(SUCCEEDED(hr), "Failed to disable culling, hr %#lx.\n", hr); hr = IDirect3DDevice2_SetTransform(device, D3DTRANSFORMSTATE_WORLD, &mat); - ok(SUCCEEDED(hr), "Failed to set world transform, hr %#x.\n", hr); + ok(SUCCEEDED(hr), "Failed to set world transform, hr %#lx.\n", hr); hr = IDirect3DDevice2_SetTransform(device, D3DTRANSFORMSTATE_VIEW, &mat); - ok(SUCCEEDED(hr), "Failed to set view transform, hr %#x.\n", hr); + ok(SUCCEEDED(hr), "Failed to set view transform, hr %#lx.\n", hr); hr = IDirect3DDevice2_SetTransform(device, D3DTRANSFORMSTATE_PROJECTION, &mat); - ok(SUCCEEDED(hr), "Failed to set projection transform, hr %#x.\n", hr); + ok(SUCCEEDED(hr), "Failed to set projection transform, hr %#lx.\n", hr); black_background = create_diffuse_material(device, 0.0f, 0.0f, 0.0f, 0.0f); @@ -14235,23 +14212,23 @@ static void test_viewport(void) surface_desc.dwHeight = rt_sizes[i].y; surface_desc.ddsCaps.dwCaps = DDSCAPS_OFFSCREENPLAIN | DDSCAPS_3DDEVICE; hr = IDirectDraw2_CreateSurface(ddraw, &surface_desc, &rt, NULL); - ok(hr == DD_OK, "Got unexpected hr %#x.\n", hr); + ok(hr == DD_OK, "Got unexpected hr %#lx.\n", hr); surface_desc.dwFlags = DDSD_CAPS | DDSD_PIXELFORMAT | DDSD_WIDTH | DDSD_HEIGHT; surface_desc.ddsCaps.dwCaps = DDSCAPS_ZBUFFER; surface_desc.ddpfPixelFormat = z_fmt; hr = IDirectDraw2_CreateSurface(ddraw, &surface_desc, &ds, NULL); - ok(hr == DD_OK, "Got unexpected hr %#x.\n", hr); + ok(hr == DD_OK, "Got unexpected hr %#lx.\n", hr); hr = IDirectDrawSurface_AddAttachedSurface(rt, ds); - ok(hr == DD_OK, "Got unexpected hr %#x.\n", hr); + ok(hr == DD_OK, "Got unexpected hr %#lx.\n", hr); hr = IDirect3DDevice2_SetRenderTarget(device, rt, 0); - ok(hr == DD_OK, "Got unexpected hr %#x.\n", hr); + ok(hr == DD_OK, "Got unexpected hr %#lx.\n", hr); } else { hr = IDirect3DDevice2_GetRenderTarget(device, &rt); - ok(hr == DD_OK, "Got unexpected hr %#x.\n", hr); + ok(hr == DD_OK, "Got unexpected hr %#lx.\n", hr); } full_viewport = create_viewport(device, 0, 0, rt_sizes[i].x, rt_sizes[i].y); @@ -14263,18 +14240,18 @@ static void test_viewport(void) for (j = 0; j < ARRAY_SIZE(tests); ++j) { - winetest_push_context(tests[j].message); + winetest_push_context("%s", tests[j].message); expected_failure = tests[j].vp.dwX + tests[j].vp.dwWidth > rt_sizes[i].x || tests[j].vp.dwY + tests[j].vp.dwHeight > rt_sizes[i].y; hr = IDirect3DViewport2_Clear(full_viewport, 1, &clear_rect, D3DCLEAR_TARGET); - ok(hr == DD_OK, "Got unexpected hr %#x.\n", hr); + ok(hr == DD_OK, "Got unexpected hr %#lx.\n", hr); hr = IDirect3D2_CreateViewport(d3d, &viewport, NULL); - ok(hr == DD_OK, "Got unexpected hr %#x.\n", hr); + ok(hr == DD_OK, "Got unexpected hr %#lx.\n", hr); hr = IDirect3DViewport2_SetViewport2(viewport, NULL); - ok(hr == E_INVALIDARG, "Got unexpected hr %#x.\n", hr); + ok(hr == E_INVALIDARG, "Got unexpected hr %#lx.\n", hr); memset(&vp, 0, sizeof(vp)); vp.dwSize = sizeof(vp); vp.dwX = tests[j].vp.dwX; @@ -14286,14 +14263,14 @@ static void test_viewport(void) vp.dvMinZ = 0.0f; vp.dvMaxZ = 1.0f; hr = IDirect3DViewport2_SetViewport(viewport, &vp); - ok(hr == D3DERR_VIEWPORTHASNODEVICE, "Got unexpected hr %#x.\n", hr); + ok(hr == D3DERR_VIEWPORTHASNODEVICE, "Got unexpected hr %#lx.\n", hr); hr = IDirect3DDevice2_AddViewport(device, viewport); - ok(hr == DD_OK, "Got unexpected hr %#x.\n", hr); + ok(hr == DD_OK, "Got unexpected hr %#lx.\n", hr); hr = IDirect3DViewport2_SetViewport(viewport, &vp); - ok(hr == (expected_failure ? E_INVALIDARG : DD_OK), "Got unexpected hr %#x.\n", hr); + ok(hr == (expected_failure ? E_INVALIDARG : DD_OK), "Got unexpected hr %#lx.\n", hr); hr = IDirect3DDevice2_SetCurrentViewport(device, viewport); - ok(hr == DD_OK, "Got unexpected hr %#x.\n", hr); + ok(hr == DD_OK, "Got unexpected hr %#lx.\n", hr); if (expected_failure) { destroy_viewport(device, viewport); @@ -14302,11 +14279,11 @@ static void test_viewport(void) } hr = IDirect3DDevice2_BeginScene(device); - ok(hr == DD_OK, "Got unexpected hr %#x.\n", hr); + ok(hr == DD_OK, "Got unexpected hr %#lx.\n", hr); hr = IDirect3DDevice2_DrawPrimitive(device, D3DPT_TRIANGLESTRIP, D3DVT_LVERTEX, quad, 4, 0); - ok(hr == DD_OK, "Got unexpected hr %#x.\n", hr); + ok(hr == DD_OK, "Got unexpected hr %#lx.\n", hr); hr = IDirect3DDevice2_EndScene(device); - ok(hr == DD_OK, "Got unexpected hr %#x.\n", hr); + ok(hr == DD_OK, "Got unexpected hr %#lx.\n", hr); check_rect(rt, tests[j].expected_rect); @@ -14317,7 +14294,7 @@ static void test_viewport(void) destroy_viewport(device, full_viewport); hr = IDirectDrawSurface_DeleteAttachedSurface(rt, 0, ds); - ok(SUCCEEDED(hr), "Failed to detach surface, hr %#x (i %u).\n", hr, i); + ok(SUCCEEDED(hr), "Failed to detach surface, hr %#lx (i %u).\n", hr, i); IDirectDrawSurface_Release(ds); IDirectDrawSurface_Release(rt); @@ -14327,7 +14304,7 @@ static void test_viewport(void) destroy_material(black_background); refcount = IDirect3DDevice2_Release(device); - ok(!refcount, "Device has %u references left.\n", refcount); + ok(!refcount, "Device has %lu references left.\n", refcount); IDirect3D2_Release(d3d); IDirectDraw2_Release(ddraw); DestroyWindow(window); @@ -14389,48 +14366,48 @@ static void test_find_device(void) result.dwSize = sizeof(result); search.dwSize = sizeof(search); hr = IDirect3D2_FindDevice(d3d, NULL, NULL); - ok(hr == DDERR_INVALIDPARAMS, "Got unexpected hr %#x.\n", hr); + ok(hr == DDERR_INVALIDPARAMS, "Got unexpected hr %#lx.\n", hr); hr = IDirect3D2_FindDevice(d3d, NULL, &result); - ok(hr == DDERR_INVALIDPARAMS, "Got unexpected hr %#x.\n", hr); + ok(hr == DDERR_INVALIDPARAMS, "Got unexpected hr %#lx.\n", hr); hr = IDirect3D2_FindDevice(d3d, &search, NULL); - ok(hr == DDERR_INVALIDPARAMS, "Got unexpected hr %#x.\n", hr); + ok(hr == DDERR_INVALIDPARAMS, "Got unexpected hr %#lx.\n", hr); hr = IDirect3D2_FindDevice(d3d, &search, &result); - ok(hr == D3D_OK, "Got unexpected hr %#x.\n", hr); - ok(result.dwSize == sizeof(result), "Got unexpected result size %u.\n", result.dwSize); + ok(hr == D3D_OK, "Got unexpected hr %#lx.\n", hr); + ok(result.dwSize == sizeof(result), "Got unexpected result size %lu.\n", result.dwSize); ok(result.ddHwDesc.dwSize == sizeof(result_v2.hw_desc), - "Got unexpected HW desc size %u.\n", result.ddHwDesc.dwSize); + "Got unexpected HW desc size %lu.\n", result.ddHwDesc.dwSize); ok(result.ddSwDesc.dwSize == sizeof(result_v2.sw_desc), - "Got unexpected SW desc size %u.\n", result.ddSwDesc.dwSize); + "Got unexpected SW desc size %lu.\n", result.ddSwDesc.dwSize); memset(&search, 0, sizeof(search)); memset(&result, 0, sizeof(result)); hr = IDirect3D2_FindDevice(d3d, &search, &result); - ok(hr == DDERR_INVALIDPARAMS, "Got unexpected hr %#x.\n", hr); + ok(hr == DDERR_INVALIDPARAMS, "Got unexpected hr %#lx.\n", hr); search.dwSize = sizeof(search) + 1; result.dwSize = sizeof(result) + 1; hr = IDirect3D2_FindDevice(d3d, &search, &result); - ok(hr == DDERR_INVALIDPARAMS, "Got unexpected hr %#x.\n", hr); + ok(hr == DDERR_INVALIDPARAMS, "Got unexpected hr %#lx.\n", hr); search.dwSize = sizeof(search); memset(&result_v1, 0, sizeof(result_v1)); result_v1.size = sizeof(result_v1); hr = IDirect3D2_FindDevice(d3d, &search, (D3DFINDDEVICERESULT *)&result_v1); - ok(hr == D3D_OK, "Got unexpected hr %#x.\n", hr); + ok(hr == D3D_OK, "Got unexpected hr %#lx.\n", hr); ok(result_v1.hw_desc.dwSize == sizeof(result_v2.hw_desc), - "Got unexpected HW desc size %u.\n", result_v1.hw_desc.dwSize); + "Got unexpected HW desc size %lu.\n", result_v1.hw_desc.dwSize); ok(result_v1.sw_desc.dwSize == sizeof(result_v2.sw_desc), - "Got unexpected SW desc size %u.\n", result_v1.sw_desc.dwSize); + "Got unexpected SW desc size %lu.\n", result_v1.sw_desc.dwSize); memset(&result_v2, 0, sizeof(result_v2)); result_v2.size = sizeof(result_v2); hr = IDirect3D2_FindDevice(d3d, &search, (D3DFINDDEVICERESULT *)&result_v2); - ok(hr == D3D_OK, "Got unexpected hr %#x.\n", hr); + ok(hr == D3D_OK, "Got unexpected hr %#lx.\n", hr); ok(result_v2.hw_desc.dwSize == sizeof(result_v2.hw_desc), - "Got unexpected HW desc size %u.\n", result_v2.hw_desc.dwSize); + "Got unexpected HW desc size %lu.\n", result_v2.hw_desc.dwSize); ok(result_v2.sw_desc.dwSize == sizeof(result_v2.sw_desc), - "Got unexpected SW desc size %u.\n", result_v2.sw_desc.dwSize); + "Got unexpected SW desc size %lu.\n", result_v2.sw_desc.dwSize); for (i = 0; i < ARRAY_SIZE(tests); ++i) { @@ -14443,21 +14420,21 @@ static void test_find_device(void) result.dwSize = sizeof(result); hr = IDirect3D2_FindDevice(d3d, &search, &result); - ok(hr == tests[i].hr, "Test %u: Got unexpected hr %#x.\n", i, hr); - ok(result.dwSize == sizeof(result), "Test %u: Got unexpected result size %u.\n", i, result.dwSize); + ok(hr == tests[i].hr, "Test %u: Got unexpected hr %#lx.\n", i, hr); + ok(result.dwSize == sizeof(result), "Test %u: Got unexpected result size %lu.\n", i, result.dwSize); if (SUCCEEDED(hr)) { ok(result.ddHwDesc.dwSize == sizeof(result_v2.hw_desc), - "Test %u: Got unexpected HW desc size %u.\n", i, result.ddHwDesc.dwSize); + "Test %u: Got unexpected HW desc size %lu.\n", i, result.ddHwDesc.dwSize); ok(result.ddSwDesc.dwSize == sizeof(result_v2.sw_desc), - "Test %u: Got unexpected SW desc size %u.\n", i, result.ddSwDesc.dwSize); + "Test %u: Got unexpected SW desc size %lu.\n", i, result.ddSwDesc.dwSize); } else { ok(!result.ddHwDesc.dwSize, - "Test %u: Got unexpected HW desc size %u.\n", i, result.ddHwDesc.dwSize); + "Test %u: Got unexpected HW desc size %lu.\n", i, result.ddHwDesc.dwSize); ok(!result.ddSwDesc.dwSize, - "Test %u: Got unexpected SW desc size %u.\n", i, result.ddSwDesc.dwSize); + "Test %u: Got unexpected SW desc size %lu.\n", i, result.ddSwDesc.dwSize); } } @@ -14484,7 +14461,7 @@ static void test_find_device(void) search.dcmColorModel = 0xdeadbeef; result.dwSize = sizeof(result); hr = IDirect3D2_FindDevice(d3d, &search, &result); - ok(hr == D3D_OK, "Got unexpected hr %#x.\n", hr); + ok(hr == D3D_OK, "Got unexpected hr %#lx.\n", hr); IDirect3D2_Release(d3d); IDirectDraw2_Release(ddraw); @@ -14500,9 +14477,9 @@ static LRESULT CALLBACK killfocus_proc(HWND window, UINT message, WPARAM wparam, if (message == WM_KILLFOCUS) { ref = IDirectDrawSurface_Release(killfocus_surface); - ok(!ref, "Unexpected surface refcount %u.\n", ref); + ok(!ref, "Unexpected surface refcount %lu.\n", ref); ref = IDirectDraw2_Release(killfocus_ddraw); - ok(!ref, "Unexpected ddraw refcount %u.\n", ref); + ok(!ref, "Unexpected ddraw refcount %lu.\n", ref); killfocus_ddraw = NULL; } @@ -14527,14 +14504,14 @@ static void test_killfocus(void) ok(!!killfocus_ddraw, "Failed to create a ddraw object.\n"); hr = IDirectDraw2_SetCooperativeLevel(killfocus_ddraw, window, DDSCL_FULLSCREEN | DDSCL_EXCLUSIVE); - ok(SUCCEEDED(hr), "Failed to set cooperative level, hr %#x.\n", hr); + ok(SUCCEEDED(hr), "Failed to set cooperative level, hr %#lx.\n", hr); memset(&surface_desc, 0, sizeof(surface_desc)); surface_desc.dwSize = sizeof(surface_desc); surface_desc.dwFlags = DDSD_CAPS; surface_desc.ddsCaps.dwCaps = DDSCAPS_PRIMARYSURFACE; hr = IDirectDraw2_CreateSurface(killfocus_ddraw, &surface_desc, &killfocus_surface, NULL); - ok(SUCCEEDED(hr), "Failed to create surface, hr %#x.\n", hr); + ok(SUCCEEDED(hr), "Failed to create surface, hr %#lx.\n", hr); SetForegroundWindow(GetDesktopWindow()); ok(!killfocus_ddraw, "WM_KILLFOCUS was not received.\n"); @@ -14557,38 +14534,38 @@ static void test_gdi_surface(void) ddraw = create_ddraw(); ok(!!ddraw, "Failed to create a ddraw object.\n"); hr = IDirectDraw2_SetCooperativeLevel(ddraw, window, DDSCL_NORMAL); - ok(hr == DD_OK, "Got unexpected hr %#x.\n", hr); + ok(hr == DD_OK, "Got unexpected hr %#lx.\n", hr); /* Retrieving the GDI surface requires a primary surface to exist. */ gdi_surface = (void *)0xc0dec0de; hr = IDirectDraw2_GetGDISurface(ddraw, &gdi_surface); - ok(hr == DDERR_NOTFOUND, "Got unexpected hr %#x.\n", hr); + ok(hr == DDERR_NOTFOUND, "Got unexpected hr %#lx.\n", hr); ok(!gdi_surface, "Got unexpected surface %p.\n", gdi_surface); hr = IDirectDraw2_FlipToGDISurface(ddraw); - ok(hr == DDERR_NOTFOUND, "Got unexpected hr %#x.\n", hr); + ok(hr == DDERR_NOTFOUND, "Got unexpected hr %#lx.\n", hr); memset(&surface_desc, 0, sizeof(surface_desc)); surface_desc.dwSize = sizeof(surface_desc); surface_desc.dwFlags = DDSD_CAPS; surface_desc.ddsCaps.dwCaps = DDSCAPS_PRIMARYSURFACE; hr = IDirectDraw2_CreateSurface(ddraw, &surface_desc, &primary, NULL); - ok(hr == DD_OK, "Got unexpected hr %#x.\n", hr); + ok(hr == DD_OK, "Got unexpected hr %#lx.\n", hr); hr = IDirectDraw2_GetGDISurface(ddraw, &gdi_surface); - ok(hr == DD_OK, "Got unexpected hr %#x.\n", hr); + ok(hr == DD_OK, "Got unexpected hr %#lx.\n", hr); ok(gdi_surface == primary, "Got unexpected surface %p, expected %p.\n", gdi_surface, primary); IDirectDrawSurface_Release(gdi_surface); /* Flipping to the GDI surface requires the primary surface to be * flippable. */ hr = IDirectDraw2_FlipToGDISurface(ddraw); - ok(hr == DDERR_NOTFLIPPABLE, "Got unexpected hr %#x.\n", hr); + ok(hr == DDERR_NOTFLIPPABLE, "Got unexpected hr %#lx.\n", hr); IDirectDrawSurface_Release(primary); hr = IDirectDraw2_SetCooperativeLevel(ddraw, window, DDSCL_EXCLUSIVE | DDSCL_FULLSCREEN); - ok(hr == DD_OK, "Got unexpected hr %#x.\n", hr); + ok(hr == DD_OK, "Got unexpected hr %#lx.\n", hr); memset(&surface_desc, 0, sizeof(surface_desc)); surface_desc.dwSize = sizeof(surface_desc); @@ -14596,40 +14573,40 @@ static void test_gdi_surface(void) surface_desc.ddsCaps.dwCaps = DDSCAPS_PRIMARYSURFACE | DDSCAPS_COMPLEX | DDSCAPS_FLIP; U5(surface_desc).dwBackBufferCount = 1; hr = IDirectDraw2_CreateSurface(ddraw, &surface_desc, &primary, NULL); - ok(hr == DD_OK, "Got unexpected hr %#x.\n", hr); + ok(hr == DD_OK, "Got unexpected hr %#lx.\n", hr); hr = IDirectDrawSurface_GetAttachedSurface(primary, &caps, &backbuffer); - ok(hr == DD_OK, "Got unexpected hr %#x.\n", hr); + ok(hr == DD_OK, "Got unexpected hr %#lx.\n", hr); ok(backbuffer != primary, "Got unexpected backbuffer %p.\n", backbuffer); hr = IDirectDraw2_GetGDISurface(ddraw, &gdi_surface); - ok(hr == DD_OK, "Got unexpected hr %#x.\n", hr); + ok(hr == DD_OK, "Got unexpected hr %#lx.\n", hr); ok(gdi_surface == primary, "Got unexpected surface %p, expected %p.\n", gdi_surface, primary); IDirectDrawSurface_Release(gdi_surface); hr = IDirectDrawSurface_Flip(primary, NULL, DDFLIP_WAIT); - ok(hr == DD_OK, "Got unexpected hr %#x.\n", hr); + ok(hr == DD_OK, "Got unexpected hr %#lx.\n", hr); hr = IDirectDraw2_GetGDISurface(ddraw, &gdi_surface); - ok(hr == DD_OK, "Got unexpected hr %#x.\n", hr); + ok(hr == DD_OK, "Got unexpected hr %#lx.\n", hr); ok(gdi_surface == backbuffer || broken(gdi_surface == primary), "Got unexpected surface %p, expected %p.\n", gdi_surface, backbuffer); IDirectDrawSurface_Release(gdi_surface); hr = IDirectDraw2_FlipToGDISurface(ddraw); - ok(hr == DD_OK, "Got unexpected hr %#x.\n", hr); + ok(hr == DD_OK, "Got unexpected hr %#lx.\n", hr); hr = IDirectDraw2_GetGDISurface(ddraw, &gdi_surface); - ok(hr == DD_OK, "Got unexpected hr %#x.\n", hr); + ok(hr == DD_OK, "Got unexpected hr %#lx.\n", hr); ok(gdi_surface == primary, "Got unexpected surface %p, expected %p.\n", gdi_surface, primary); IDirectDrawSurface_Release(gdi_surface); hr = IDirectDraw2_FlipToGDISurface(ddraw); - ok(hr == DD_OK, "Got unexpected hr %#x.\n", hr); + ok(hr == DD_OK, "Got unexpected hr %#lx.\n", hr); IDirectDrawSurface_Release(backbuffer); IDirectDrawSurface_Release(primary); refcount = IDirectDraw2_Release(ddraw); - ok(!refcount, "%u references left.\n", refcount); + ok(!refcount, "%lu references left.\n", refcount); DestroyWindow(window); } @@ -14642,9 +14619,8 @@ static void test_alphatest(void) IDirect3DViewport2 *viewport; IDirect3DDevice2 *device; IDirectDrawSurface *rt; + unsigned int color, i; IDirectDraw2 *ddraw; - unsigned int i; - D3DCOLOR color; ULONG refcount; HWND window; DWORD value; @@ -14653,9 +14629,7 @@ static void test_alphatest(void) static const struct { D3DCMPFUNC func; - D3DCOLOR color_less; - D3DCOLOR color_equal; - D3DCOLOR color_greater; + unsigned int color_less, color_equal, color_greater; } test_data[] = { @@ -14687,61 +14661,61 @@ static void test_alphatest(void) return; } hr = IDirect3DDevice2_GetRenderTarget(device, &rt); - ok(hr == D3D_OK, "Got unexpected hr %#x.\n", hr); + ok(hr == D3D_OK, "Got unexpected hr %#lx.\n", hr); blue = create_diffuse_material(device, 0.0f, 0.0f, 1.0f, 1.0f); failed = create_diffuse_material(device, 1.0f, 0.0f, 0.0f, 1.0f); viewport = create_viewport(device, 0, 0, 640, 480); hr = IDirect3DDevice2_SetCurrentViewport(device, viewport); - ok(hr == D3D_OK, "Got unexpected hr %#x.\n", hr); + ok(hr == D3D_OK, "Got unexpected hr %#lx.\n", hr); viewport_set_background(device, viewport, blue); hr = IDirect3DViewport2_Clear(viewport, 1, &rect_full, D3DCLEAR_TARGET); - ok(hr == D3D_OK, "Got unexpected hr %#x.\n", hr); + ok(hr == D3D_OK, "Got unexpected hr %#lx.\n", hr); hr = IDirect3DDevice2_SetRenderState(device, D3DRENDERSTATE_LIGHTING, FALSE); - ok(hr == D3D_OK, "Got unexpected hr %#x.\n", hr); + ok(hr == D3D_OK, "Got unexpected hr %#lx.\n", hr); hr = IDirect3DDevice2_SetRenderState(device, D3DRENDERSTATE_ZENABLE, FALSE); - ok(hr == D3D_OK, "Got unexpected hr %#x.\n", hr); + ok(hr == D3D_OK, "Got unexpected hr %#lx.\n", hr); hr = IDirect3DDevice2_SetRenderState(device, D3DRENDERSTATE_ALPHATESTENABLE, TRUE); - ok(hr == D3D_OK, "Got unexpected hr %#x.\n", hr); + ok(hr == D3D_OK, "Got unexpected hr %#lx.\n", hr); viewport_set_background(device, viewport, failed); for (i = 0; i < ARRAY_SIZE(test_data); ++i) { hr = IDirect3DDevice2_SetRenderState(device, D3DRENDERSTATE_ALPHAFUNC, test_data[i].func); - ok(hr == D3D_OK, "Got unexpected hr %#x.\n", hr); + ok(hr == D3D_OK, "Got unexpected hr %#lx.\n", hr); hr = IDirect3DViewport2_Clear(viewport, 1, &rect_full, D3DCLEAR_TARGET); - ok(hr == D3D_OK, "Got unexpected hr %#x.\n", hr); + ok(hr == D3D_OK, "Got unexpected hr %#lx.\n", hr); hr = IDirect3DDevice2_SetRenderState(device, D3DRENDERSTATE_ALPHAREF, 0x70); - ok(hr == D3D_OK, "Got unexpected hr %#x.\n", hr); + ok(hr == D3D_OK, "Got unexpected hr %#lx.\n", hr); hr = IDirect3DDevice2_BeginScene(device); - ok(hr == D3D_OK, "Got unexpected hr %#x.\n", hr); + ok(hr == D3D_OK, "Got unexpected hr %#lx.\n", hr); hr = IDirect3DDevice2_DrawPrimitive(device, D3DPT_TRIANGLESTRIP, D3DVT_LVERTEX, quad, ARRAY_SIZE(quad), 0); - ok(hr == D3D_OK, "Got unexpected hr %#x.\n", hr); + ok(hr == D3D_OK, "Got unexpected hr %#lx.\n", hr); hr = IDirect3DDevice2_EndScene(device); - ok(hr == D3D_OK, "Got unexpected hr %#x.\n", hr); + ok(hr == D3D_OK, "Got unexpected hr %#lx.\n", hr); color = get_surface_color(rt, 320, 240); ok(compare_color(color, test_data[i].color_greater, 0), "Alphatest failed, color 0x%08x, expected 0x%08x, alpha > ref, func %u.\n", color, test_data[i].color_greater, test_data[i].func); hr = IDirect3DViewport2_Clear(viewport, 1, &rect_full, D3DCLEAR_TARGET); - ok(hr == D3D_OK, "Got unexpected hr %#x.\n", hr); + ok(hr == D3D_OK, "Got unexpected hr %#lx.\n", hr); hr = IDirect3DDevice2_SetRenderState(device, D3DRENDERSTATE_ALPHAREF, 0xff70); - ok(hr == D3D_OK, "Got unexpected hr %#x.\n", hr); + ok(hr == D3D_OK, "Got unexpected hr %#lx.\n", hr); hr = IDirect3DDevice2_GetRenderState(device, D3DRENDERSTATE_ALPHAREF, &value); - ok(hr == D3D_OK, "Got unexpected hr %#x.\n", hr); - ok(value == 0xff70, "Got unexpected value %#x.\n", value); + ok(hr == D3D_OK, "Got unexpected hr %#lx.\n", hr); + ok(value == 0xff70, "Got unexpected value %#lx.\n", value); hr = IDirect3DDevice2_BeginScene(device); - ok(hr == D3D_OK, "Got unexpected hr %#x.\n", hr); + ok(hr == D3D_OK, "Got unexpected hr %#lx.\n", hr); hr = IDirect3DDevice2_DrawPrimitive(device, D3DPT_TRIANGLESTRIP, D3DVT_LVERTEX, quad, ARRAY_SIZE(quad), 0); - ok(hr == D3D_OK, "Got unexpected hr %#x.\n", hr); + ok(hr == D3D_OK, "Got unexpected hr %#lx.\n", hr); hr = IDirect3DDevice2_EndScene(device); - ok(hr == D3D_OK, "Got unexpected hr %#x.\n", hr); + ok(hr == D3D_OK, "Got unexpected hr %#lx.\n", hr); color = get_surface_color(rt, 320, 240); ok(compare_color(color, test_data[i].color_greater, 0), "Alphatest failed, color 0x%08x, expected 0x%08x, alpha > ref, func %u.\n", @@ -14753,9 +14727,9 @@ static void test_alphatest(void) destroy_material(blue); IDirectDrawSurface_Release(rt); refcount = IDirect3DDevice2_Release(device); - ok(!refcount, "Device has %u references left.\n", refcount); + ok(!refcount, "Device has %lu references left.\n", refcount); refcount = IDirectDraw2_Release(ddraw); - ok(!refcount, "DirectDraw has %u references left.\n", refcount); + ok(!refcount, "DirectDraw has %lu references left.\n", refcount); DestroyWindow(window); } @@ -14776,24 +14750,24 @@ static void test_clipper_refcount(void) ddraw = create_ddraw(); ok(!!ddraw, "Failed to create a ddraw object.\n"); hr = IDirectDraw2_SetCooperativeLevel(ddraw, window, DDSCL_NORMAL); - ok(hr == DD_OK, "Got unexpected hr %#x.\n", hr); + ok(hr == DD_OK, "Got unexpected hr %#lx.\n", hr); memset(&surface_desc, 0, sizeof(surface_desc)); surface_desc.dwSize = sizeof(surface_desc); surface_desc.dwFlags = DDSD_CAPS; surface_desc.ddsCaps.dwCaps = DDSCAPS_PRIMARYSURFACE; hr = IDirectDraw2_CreateSurface(ddraw, &surface_desc, &surface, NULL); - ok(hr == DD_OK, "Got unexpected hr %#x.\n", hr); + ok(hr == DD_OK, "Got unexpected hr %#lx.\n", hr); hr = IDirectDraw2_CreateClipper(ddraw, 0, &clipper, NULL); - ok(SUCCEEDED(hr), "Failed to create clipper, hr %#x.\n", hr); + ok(SUCCEEDED(hr), "Failed to create clipper, hr %#lx.\n", hr); refcount = get_refcount((IUnknown *)clipper); - ok(refcount == 1, "Got unexpected refcount %u.\n", refcount); + ok(refcount == 1, "Got unexpected refcount %lu.\n", refcount); /* Show that clipper validation doesn't somehow happen through per-clipper vtable * pointers. */ hr = IDirectDraw2_CreateClipper(ddraw, 0, &clipper2, NULL); - ok(SUCCEEDED(hr), "Failed to create clipper, hr %#x.\n", hr); + ok(SUCCEEDED(hr), "Failed to create clipper, hr %#lx.\n", hr); ok(clipper->lpVtbl == clipper2->lpVtbl, "Got different clipper vtables %p and %p.\n", clipper->lpVtbl, clipper2->lpVtbl); orig_vtbl = clipper->lpVtbl; @@ -14801,50 +14775,50 @@ static void test_clipper_refcount(void) /* Surfaces hold a reference to clippers. No surprises there. */ hr = IDirectDrawSurface_SetClipper(surface, clipper); - ok(SUCCEEDED(hr), "Failed to set clipper, hr %#x.\n", hr); + ok(SUCCEEDED(hr), "Failed to set clipper, hr %#lx.\n", hr); refcount = get_refcount((IUnknown *)clipper); - ok(refcount == 2, "Got unexpected refcount %u.\n", refcount); + ok(refcount == 2, "Got unexpected refcount %lu.\n", refcount); hr = IDirectDrawSurface_GetClipper(surface, &clipper2); - ok(SUCCEEDED(hr), "Failed to get clipper, hr %#x.\n", hr); + ok(SUCCEEDED(hr), "Failed to get clipper, hr %#lx.\n", hr); ok(clipper == clipper2, "Got clipper %p, expected %p.\n", clipper2, clipper); refcount = IDirectDrawClipper_Release(clipper2); - ok(refcount == 2, "Got unexpected refcount %u.\n", refcount); + ok(refcount == 2, "Got unexpected refcount %lu.\n", refcount); hr = IDirectDrawSurface_SetClipper(surface, NULL); - ok(SUCCEEDED(hr), "Failed to set clipper, hr %#x.\n", hr); + ok(SUCCEEDED(hr), "Failed to set clipper, hr %#lx.\n", hr); refcount = get_refcount((IUnknown *)clipper); - ok(refcount == 1, "Got unexpected refcount %u.\n", refcount); + ok(refcount == 1, "Got unexpected refcount %lu.\n", refcount); hr = IDirectDrawSurface_SetClipper(surface, clipper); - ok(SUCCEEDED(hr), "Failed to set clipper, hr %#x.\n", hr); + ok(SUCCEEDED(hr), "Failed to set clipper, hr %#lx.\n", hr); refcount = get_refcount((IUnknown *)clipper); - ok(refcount == 2, "Got unexpected refcount %u.\n", refcount); + ok(refcount == 2, "Got unexpected refcount %lu.\n", refcount); refcount = IDirectDrawSurface_Release(surface); - ok(!refcount, "%u references left.\n", refcount); + ok(!refcount, "%lu references left.\n", refcount); refcount = get_refcount((IUnknown *)clipper); - ok(refcount == 1, "Got unexpected refcount %u.\n", refcount); + ok(refcount == 1, "Got unexpected refcount %lu.\n", refcount); /* SetClipper with an invalid pointer crashes. */ /* Clipper methods work with a broken vtable, with the exception of Release. */ clipper->lpVtbl = (void *)0xdeadbeef; refcount = orig_vtbl->AddRef(clipper); - todo_wine ok(refcount == 2, "Got unexpected refcount %u.\n", refcount); + todo_wine ok(refcount == 2, "Got unexpected refcount %lu.\n", refcount); refcount = orig_vtbl->Release(clipper); - ok(!refcount, "Got unexpected refcount %u.\n", refcount); + ok(!refcount, "Got unexpected refcount %lu.\n", refcount); clipper->lpVtbl = orig_vtbl; refcount = orig_vtbl->Release(clipper); - todo_wine ok(refcount == 1, "Got unexpected refcount %u.\n", refcount); + todo_wine ok(refcount == 1, "Got unexpected refcount %lu.\n", refcount); /* Fix the refcount difference because Wine did not increase the ref in the * AddRef call above. */ if (refcount) { refcount = IDirectDrawClipper_Release(clipper); - ok(!refcount, "Got unexpected refcount %u.\n", refcount); + ok(!refcount, "Got unexpected refcount %lu.\n", refcount); } /* Steal the reference and see what happens - releasing the surface works fine. @@ -14852,11 +14826,11 @@ static void test_clipper_refcount(void) * release it after the GetClipper call is likely to crash, and certain to crash * if we allocate and zero as much heap memory as we can get. */ hr = IDirectDraw2_CreateSurface(ddraw, &surface_desc, &surface, NULL); - ok(hr == DD_OK, "Got unexpected hr %#x.\n", hr); + ok(hr == DD_OK, "Got unexpected hr %#lx.\n", hr); hr = IDirectDraw2_CreateClipper(ddraw, 0, &clipper, NULL); - ok(SUCCEEDED(hr), "Failed to create clipper, hr %#x.\n", hr); + ok(SUCCEEDED(hr), "Failed to create clipper, hr %#lx.\n", hr); hr = IDirectDrawSurface_SetClipper(surface, clipper); - ok(SUCCEEDED(hr), "Failed to set clipper, hr %#x.\n", hr); + ok(SUCCEEDED(hr), "Failed to set clipper, hr %#lx.\n", hr); IDirectDrawClipper_Release(clipper); IDirectDrawClipper_Release(clipper); @@ -14872,7 +14846,7 @@ static void test_clipper_refcount(void) * The same Windows and driver versions run the test without heap corruption on * a Geforce 1060 GTX card. I have not seen the problem on AMD GPUs either. */ hr = IDirectDrawSurface_GetClipper(surface, &clipper2); - ok(SUCCEEDED(hr), "Failed to get clipper, hr %#x.\n", hr); + ok(SUCCEEDED(hr), "Failed to get clipper, hr %#lx.\n", hr); ok(clipper == clipper2, "Got clipper %p, expected %p.\n", clipper2, clipper); } @@ -14880,10 +14854,10 @@ static void test_clipper_refcount(void) * vtable through the clipper pointer because it is no longer pointing to * valid memory. */ refcount = orig_vtbl->Release(clipper); - ok(!refcount, "%u references left.\n", refcount); + ok(!refcount, "%lu references left.\n", refcount); refcount = IDirectDrawSurface_Release(surface); - ok(!refcount, "%u references left.\n", refcount); + ok(!refcount, "%lu references left.\n", refcount); /* It looks like the protection against invalid thispointers is part of * the IDirectDrawClipper method implementation, not IDirectDrawSurface. */ @@ -14896,33 +14870,33 @@ static void test_clipper_refcount(void) clipper->lpVtbl = orig_vtbl; refcount = orig_vtbl->AddRef(clipper); - todo_wine ok(!refcount, "Got refcount %u.\n", refcount); + todo_wine ok(!refcount, "Got refcount %lu.\n", refcount); refcount = orig_vtbl->AddRef((IDirectDrawClipper *)(ULONG_PTR)0xdeadbeef); - ok(!refcount, "Got refcount %u.\n", refcount); + ok(!refcount, "Got refcount %lu.\n", refcount); changed = 0x1234; hr = orig_vtbl->IsClipListChanged(clipper, &changed); - todo_wine ok(hr == DDERR_INVALIDPARAMS, "Got unexpected hr %#x.\n", hr); + todo_wine ok(hr == DDERR_INVALIDPARAMS, "Got unexpected hr %#lx.\n", hr); todo_wine ok(changed == 0x1234, "'changed' changed: %x.\n", changed); changed = 0x1234; hr = orig_vtbl->IsClipListChanged((IDirectDrawClipper *)(ULONG_PTR)0xdeadbeef, &changed); - ok(hr == DDERR_INVALIDPARAMS, "Got unexpected hr %#x.\n", hr); + ok(hr == DDERR_INVALIDPARAMS, "Got unexpected hr %#lx.\n", hr); ok(changed == 0x1234, "'changed' changed: %x.\n", changed); /* Nope, we can't initialize our fake clipper. */ hr = IDirectDraw2_QueryInterface(ddraw, &IID_IDirectDraw, (void **)&ddraw1); - ok(SUCCEEDED(hr), "Failed to get ddraw1 interface, hr %#x.\n", hr); + ok(SUCCEEDED(hr), "Failed to get ddraw1 interface, hr %#lx.\n", hr); hr = orig_vtbl->Initialize(clipper, ddraw1, 0); - todo_wine ok(hr == DDERR_INVALIDPARAMS, "Got unexpected hr %#x.\n", hr); + todo_wine ok(hr == DDERR_INVALIDPARAMS, "Got unexpected hr %#lx.\n", hr); IDirectDraw_Release(ddraw1); HeapFree(GetProcessHeap(), 0, clipper); refcount = IDirectDraw2_Release(ddraw); - ok(!refcount, "%u references left.\n", refcount); + ok(!refcount, "%lu references left.\n", refcount); DestroyWindow(window); } @@ -14975,35 +14949,35 @@ static void test_caps(void) hal_caps.dwSize = sizeof(hal_caps); hel_caps.dwSize = sizeof(hel_caps); hr = IDirectDraw2_GetCaps(ddraw, &hal_caps, &hel_caps); - ok(hr == DD_OK, "Got unexpected hr %#x.\n", hr); + ok(hr == DD_OK, "Got unexpected hr %#lx.\n", hr); ok(hal_caps.ddsOldCaps.dwCaps == hal_caps.ddsCaps.dwCaps, - "Got unexpected caps %#x, expected %#x.\n", + "Got unexpected caps %#lx, expected %#lx.\n", hal_caps.ddsOldCaps.dwCaps, hal_caps.ddsCaps.dwCaps); ok(hel_caps.ddsOldCaps.dwCaps == hel_caps.ddsCaps.dwCaps, - "Got unexpected caps %#x, expected %#x.\n", + "Got unexpected caps %#lx, expected %#lx.\n", hel_caps.ddsOldCaps.dwCaps, hel_caps.ddsCaps.dwCaps); no3d = !(hal_caps.ddsCaps.dwCaps & DDSCAPS_3DDEVICE); if (hal_caps.ddsCaps.dwCaps) { - ok(!(hal_caps.ddsCaps.dwCaps & caps_never), "Got unexpected caps %#x.\n", hal_caps.ddsCaps.dwCaps); - ok(!(~hal_caps.ddsCaps.dwCaps & caps_always), "Got unexpected caps %#x.\n", hal_caps.ddsCaps.dwCaps); + ok(!(hal_caps.ddsCaps.dwCaps & caps_never), "Got unexpected caps %#lx.\n", hal_caps.ddsCaps.dwCaps); + ok(!(~hal_caps.ddsCaps.dwCaps & caps_always), "Got unexpected caps %#lx.\n", hal_caps.ddsCaps.dwCaps); todo_wine_if(no3d) ok(!(~hal_caps.ddsCaps.dwCaps & caps_hal), - "Got unexpected caps %#x.\n", hal_caps.ddsCaps.dwCaps); + "Got unexpected caps %#lx.\n", hal_caps.ddsCaps.dwCaps); } - ok(!(hel_caps.ddsCaps.dwCaps & caps_never), "Got unexpected caps %#x.\n", hel_caps.ddsCaps.dwCaps); - ok(!(~hel_caps.ddsCaps.dwCaps & caps_always), "Got unexpected caps %#x.\n", hel_caps.ddsCaps.dwCaps); + ok(!(hel_caps.ddsCaps.dwCaps & caps_never), "Got unexpected caps %#lx.\n", hel_caps.ddsCaps.dwCaps); + ok(!(~hel_caps.ddsCaps.dwCaps & caps_always), "Got unexpected caps %#lx.\n", hel_caps.ddsCaps.dwCaps); todo_wine_if(!no3d) ok(!(hel_caps.ddsCaps.dwCaps & caps_hal), - "Got unexpected caps %#x.\n", hel_caps.ddsCaps.dwCaps); + "Got unexpected caps %#lx.\n", hel_caps.ddsCaps.dwCaps); IDirectDraw2_Release(ddraw); if (hal_caps.ddsCaps.dwCaps) { hr = DirectDrawCreate((GUID *)DDCREATE_HARDWAREONLY, &ddraw1, NULL); - ok(hr == DD_OK, "Got unexpected hr %#x.\n", hr); + ok(hr == DD_OK, "Got unexpected hr %#lx.\n", hr); hr = IDirectDraw_QueryInterface(ddraw1, &IID_IDirectDraw2, (void **)&ddraw); - ok(hr == DD_OK, "Got unexpected hr %#x.\n", hr); + ok(hr == DD_OK, "Got unexpected hr %#lx.\n", hr); IDirectDraw_Release(ddraw1); memset(&hal_caps, 0, sizeof(hal_caps)); @@ -15011,39 +14985,39 @@ static void test_caps(void) hal_caps.dwSize = sizeof(hal_caps); hel_caps.dwSize = sizeof(hel_caps); hr = IDirectDraw2_GetCaps(ddraw, &hal_caps, &hel_caps); - ok(hr == DD_OK, "Got unexpected hr %#x.\n", hr); + ok(hr == DD_OK, "Got unexpected hr %#lx.\n", hr); ok(hal_caps.ddsOldCaps.dwCaps == hal_caps.ddsCaps.dwCaps, - "Got unexpected caps %#x, expected %#x.\n", + "Got unexpected caps %#lx, expected %#lx.\n", hal_caps.ddsOldCaps.dwCaps, hal_caps.ddsCaps.dwCaps); ok(hel_caps.ddsOldCaps.dwCaps == hel_caps.ddsCaps.dwCaps, - "Got unexpected caps %#x, expected %#x.\n", + "Got unexpected caps %#lx, expected %#lx.\n", hel_caps.ddsOldCaps.dwCaps, hel_caps.ddsCaps.dwCaps); - ok(!(hal_caps.ddsCaps.dwCaps & caps_never), "Got unexpected caps %#x.\n", hal_caps.ddsCaps.dwCaps); - ok(!(~hal_caps.ddsCaps.dwCaps & caps_always), "Got unexpected caps %#x.\n", hal_caps.ddsCaps.dwCaps); + ok(!(hal_caps.ddsCaps.dwCaps & caps_never), "Got unexpected caps %#lx.\n", hal_caps.ddsCaps.dwCaps); + ok(!(~hal_caps.ddsCaps.dwCaps & caps_always), "Got unexpected caps %#lx.\n", hal_caps.ddsCaps.dwCaps); todo_wine_if(no3d) ok(!(~hal_caps.ddsCaps.dwCaps & caps_hal), - "Got unexpected caps %#x.\n", hal_caps.ddsCaps.dwCaps); + "Got unexpected caps %#lx.\n", hal_caps.ddsCaps.dwCaps); if (is_ddraw64) { - ok(!(hel_caps.ddsCaps.dwCaps & caps_never), "Got unexpected caps %#x.\n", hel_caps.ddsCaps.dwCaps); - ok(!(~hel_caps.ddsCaps.dwCaps & caps_always), "Got unexpected caps %#x.\n", hel_caps.ddsCaps.dwCaps); + ok(!(hel_caps.ddsCaps.dwCaps & caps_never), "Got unexpected caps %#lx.\n", hel_caps.ddsCaps.dwCaps); + ok(!(~hel_caps.ddsCaps.dwCaps & caps_always), "Got unexpected caps %#lx.\n", hel_caps.ddsCaps.dwCaps); todo_wine_if(!no3d) ok(!(hel_caps.ddsCaps.dwCaps & caps_hal), - "Got unexpected caps %#x.\n", hel_caps.ddsCaps.dwCaps); + "Got unexpected caps %#lx.\n", hel_caps.ddsCaps.dwCaps); } else { - todo_wine ok(!hel_caps.ddsCaps.dwCaps, "Got unexpected caps %#x.\n", hel_caps.ddsCaps.dwCaps); + todo_wine ok(!hel_caps.ddsCaps.dwCaps, "Got unexpected caps %#lx.\n", hel_caps.ddsCaps.dwCaps); } IDirectDraw2_Release(ddraw); } hr = DirectDrawCreate((GUID *)DDCREATE_EMULATIONONLY, &ddraw1, NULL); - ok(hr == DD_OK || (is_ddraw64 && hr == E_FAIL), "Got unexpected hr %#x.\n", hr); + ok(hr == DD_OK || (is_ddraw64 && hr == E_FAIL), "Got unexpected hr %#lx.\n", hr); if (SUCCEEDED(hr)) { hr = IDirectDraw_QueryInterface(ddraw1, &IID_IDirectDraw2, (void **)&ddraw); - ok(hr == DD_OK, "Got unexpected hr %#x.\n", hr); + ok(hr == DD_OK, "Got unexpected hr %#lx.\n", hr); IDirectDraw_Release(ddraw1); memset(&hal_caps, 0, sizeof(hal_caps)); @@ -15051,19 +15025,19 @@ static void test_caps(void) hal_caps.dwSize = sizeof(hal_caps); hel_caps.dwSize = sizeof(hel_caps); hr = IDirectDraw2_GetCaps(ddraw, &hal_caps, &hel_caps); - ok(hr == DD_OK, "Got unexpected hr %#x.\n", hr); + ok(hr == DD_OK, "Got unexpected hr %#lx.\n", hr); ok(hal_caps.ddsOldCaps.dwCaps == hal_caps.ddsCaps.dwCaps, - "Got unexpected caps %#x, expected %#x.\n", + "Got unexpected caps %#lx, expected %#lx.\n", hal_caps.ddsOldCaps.dwCaps, hal_caps.ddsCaps.dwCaps); ok(hel_caps.ddsOldCaps.dwCaps == hel_caps.ddsCaps.dwCaps, - "Got unexpected caps %#x, expected %#x.\n", + "Got unexpected caps %#lx, expected %#lx.\n", hel_caps.ddsOldCaps.dwCaps, hel_caps.ddsCaps.dwCaps); - todo_wine ok(!hal_caps.ddsCaps.dwCaps, "Got unexpected caps %#x.\n", hal_caps.ddsCaps.dwCaps); - ok(!(hel_caps.ddsCaps.dwCaps & caps_never), "Got unexpected caps %#x.\n", hel_caps.ddsCaps.dwCaps); - ok(!(~hel_caps.ddsCaps.dwCaps & caps_always), "Got unexpected caps %#x.\n", hel_caps.ddsCaps.dwCaps); + todo_wine ok(!hal_caps.ddsCaps.dwCaps, "Got unexpected caps %#lx.\n", hal_caps.ddsCaps.dwCaps); + ok(!(hel_caps.ddsCaps.dwCaps & caps_never), "Got unexpected caps %#lx.\n", hel_caps.ddsCaps.dwCaps); + ok(!(~hel_caps.ddsCaps.dwCaps & caps_always), "Got unexpected caps %#lx.\n", hel_caps.ddsCaps.dwCaps); todo_wine_if(!no3d) ok(!(hel_caps.ddsCaps.dwCaps & caps_hal), - "Got unexpected caps %#x.\n", hel_caps.ddsCaps.dwCaps); + "Got unexpected caps %#lx.\n", hel_caps.ddsCaps.dwCaps); IDirectDraw2_Release(ddraw); } @@ -15082,7 +15056,7 @@ static void test_d32_support(void) ddraw = create_ddraw(); ok(!!ddraw, "Failed to create a ddraw object.\n"); hr = IDirectDraw2_SetCooperativeLevel(ddraw, window, DDSCL_NORMAL); - ok(hr == DD_OK, "Got unexpected hr %#x.\n", hr); + ok(hr == DD_OK, "Got unexpected hr %#lx.\n", hr); memset(&surface_desc, 0, sizeof(surface_desc)); surface_desc.dwSize = sizeof(surface_desc); @@ -15092,21 +15066,21 @@ static void test_d32_support(void) surface_desc.dwWidth = 64; surface_desc.dwHeight = 64; hr = IDirectDraw2_CreateSurface(ddraw, &surface_desc, &surface, NULL); - ok(hr == DD_OK, "Got unexpected hr %#x.\n", hr); + ok(hr == DD_OK, "Got unexpected hr %#lx.\n", hr); memset(&surface_desc, 0, sizeof(surface_desc)); surface_desc.dwSize = sizeof(surface_desc); hr = IDirectDrawSurface_GetSurfaceDesc(surface, &surface_desc); - ok(hr == DD_OK, "Got unexpected hr %#x.\n", hr); - ok((surface_desc.dwFlags & DDSD_ZBUFFERBITDEPTH), "Got unexpected flags %#x.\n", surface_desc.dwFlags); + ok(hr == DD_OK, "Got unexpected hr %#lx.\n", hr); + ok((surface_desc.dwFlags & DDSD_ZBUFFERBITDEPTH), "Got unexpected flags %#lx.\n", surface_desc.dwFlags); ok(U2(surface_desc).dwZBufferBitDepth == 32, - "Got unexpected dwZBufferBitDepth %u.\n", U2(surface_desc).dwZBufferBitDepth); + "Got unexpected dwZBufferBitDepth %lu.\n", U2(surface_desc).dwZBufferBitDepth); ok(!(surface_desc.ddsCaps.dwCaps & DDSCAPS_VIDEOMEMORY), - "Got unexpected surface caps %#x.\n", surface_desc.ddsCaps.dwCaps); + "Got unexpected surface caps %#lx.\n", surface_desc.ddsCaps.dwCaps); IDirectDrawSurface_Release(surface); refcount = IDirectDraw2_Release(ddraw); - ok(!refcount, "%u references left.\n", refcount); + ok(!refcount, "%lu references left.\n", refcount); DestroyWindow(window); } @@ -15160,13 +15134,13 @@ static void test_cursor_clipping(void) memset(&surface_desc, 0, sizeof(surface_desc)); surface_desc.dwSize = sizeof(surface_desc); hr = IDirectDraw2_GetDisplayMode(ddraw, &surface_desc); - ok(hr == DD_OK, "GetDisplayMode failed, hr %#x.\n", hr); + ok(hr == DD_OK, "GetDisplayMode failed, hr %#lx.\n", hr); memset(¶m, 0, sizeof(param)); param.old_width = surface_desc.dwWidth; param.old_height = surface_desc.dwHeight; hr = IDirectDraw2_EnumDisplayModes(ddraw, 0, NULL, ¶m, find_different_mode_callback); - ok(hr == DD_OK, "EnumDisplayModes failed, hr %#x.\n", hr); + ok(hr == DD_OK, "EnumDisplayModes failed, hr %#lx.\n", hr); if (!(param.new_width && param.new_height)) { skip("Failed to find a different mode than %ux%u.\n", param.old_width, param.old_height); @@ -15174,87 +15148,87 @@ static void test_cursor_clipping(void) } ret = ClipCursor(NULL); - ok(ret, "ClipCursor failed, error %#x.\n", GetLastError()); + ok(ret, "ClipCursor failed, error %lu.\n", GetLastError()); get_virtual_rect(&rect); ret = GetClipCursor(&clip_rect); - ok(ret, "GetClipCursor failed, error %#x.\n", GetLastError()); + ok(ret, "GetClipCursor failed, error %lu.\n", GetLastError()); ok(EqualRect(&clip_rect, &rect), "Expect clip rect %s, got %s.\n", wine_dbgstr_rect(&rect), wine_dbgstr_rect(&clip_rect)); /* Set cooperative level to normal */ hr = IDirectDraw2_SetCooperativeLevel(ddraw, window, DDSCL_NORMAL); - ok(hr == DD_OK, "SetCooperativeLevel failed, hr %#x.\n", hr); + ok(hr == DD_OK, "SetCooperativeLevel failed, hr %#lx.\n", hr); flush_events(); get_virtual_rect(&rect); ret = GetClipCursor(&clip_rect); - ok(ret, "GetClipCursor failed, error %#x.\n", GetLastError()); + ok(ret, "GetClipCursor failed, error %lu.\n", GetLastError()); ok(EqualRect(&clip_rect, &rect), "Expect clip rect %s, got %s.\n", wine_dbgstr_rect(&rect), wine_dbgstr_rect(&clip_rect)); hr = set_display_mode(ddraw, param.new_width, param.new_height); - ok(hr == DD_OK || hr == DDERR_UNSUPPORTED, "SetDisplayMode failed, hr %#x.\n", hr); + ok(hr == DD_OK || hr == DDERR_UNSUPPORTED, "SetDisplayMode failed, hr %#lx.\n", hr); if (FAILED(hr)) { - win_skip("SetDisplayMode failed, hr %#x.\n", hr); + win_skip("SetDisplayMode failed, hr %#lx.\n", hr); goto done; } flush_events(); get_virtual_rect(&rect); ret = GetClipCursor(&clip_rect); - ok(ret, "GetClipCursor failed, error %#x.\n", GetLastError()); + ok(ret, "GetClipCursor failed, error %lu.\n", GetLastError()); ok(EqualRect(&clip_rect, &rect), "Expect clip rect %s, got %s.\n", wine_dbgstr_rect(&rect), wine_dbgstr_rect(&clip_rect)); hr = IDirectDraw2_RestoreDisplayMode(ddraw); - ok(hr == DD_OK, "RestoreDisplayMode failed, hr %#x.\n", hr); + ok(hr == DD_OK, "RestoreDisplayMode failed, hr %#lx.\n", hr); flush_events(); get_virtual_rect(&rect); ret = GetClipCursor(&clip_rect); - ok(ret, "GetClipCursor failed, error %#x.\n", GetLastError()); + ok(ret, "GetClipCursor failed, error %lu.\n", GetLastError()); ok(EqualRect(&clip_rect, &rect), "Expect clip rect %s, got %s.\n", wine_dbgstr_rect(&rect), wine_dbgstr_rect(&clip_rect)); /* Switch to full screen cooperative level */ hr = IDirectDraw2_SetCooperativeLevel(ddraw, window, DDSCL_EXCLUSIVE | DDSCL_FULLSCREEN); - ok(hr == DD_OK, "SetCooperativeLevel failed, hr %#x.\n", hr); + ok(hr == DD_OK, "SetCooperativeLevel failed, hr %#lx.\n", hr); flush_events(); SetRect(&rect, 0, 0, param.old_width, param.old_height); ret = GetClipCursor(&clip_rect); - ok(ret, "GetClipCursor failed, error %#x.\n", GetLastError()); + ok(ret, "GetClipCursor failed, error %lu.\n", GetLastError()); ok(EqualRect(&clip_rect, &rect), "Expect clip rect %s, got %s.\n", wine_dbgstr_rect(&rect), wine_dbgstr_rect(&clip_rect)); hr = set_display_mode(ddraw, param.new_width, param.new_height); - ok(hr == DD_OK || hr == DDERR_UNSUPPORTED, "SetDisplayMode failed, hr %#x.\n", hr); + ok(hr == DD_OK || hr == DDERR_UNSUPPORTED, "SetDisplayMode failed, hr %#lx.\n", hr); if (FAILED(hr)) { - win_skip("SetDisplayMode failed, hr %#x.\n", hr); + win_skip("SetDisplayMode failed, hr %#lx.\n", hr); goto done; } flush_events(); SetRect(&rect, 0, 0, param.new_width, param.new_height); ret = GetClipCursor(&clip_rect); - ok(ret, "GetClipCursor failed, error %#x.\n", GetLastError()); + ok(ret, "GetClipCursor failed, error %lu.\n", GetLastError()); ok(EqualRect(&clip_rect, &rect), "Expect clip rect %s, got %s.\n", wine_dbgstr_rect(&rect), wine_dbgstr_rect(&clip_rect)); /* Restore display mode */ hr = IDirectDraw2_RestoreDisplayMode(ddraw); - ok(hr == DD_OK, "RestoreDisplayMode failed, hr %#x.\n", hr); + ok(hr == DD_OK, "RestoreDisplayMode failed, hr %#lx.\n", hr); flush_events(); SetRect(&rect, 0, 0, param.old_width, param.old_height); ret = GetClipCursor(&clip_rect); - ok(ret, "GetClipCursor failed, error %#x.\n", GetLastError()); + ok(ret, "GetClipCursor failed, error %lu.\n", GetLastError()); ok(EqualRect(&clip_rect, &rect), "Expect clip rect %s, got %s.\n", wine_dbgstr_rect(&rect), wine_dbgstr_rect(&clip_rect)); /* Switch to normal cooperative level */ hr = IDirectDraw2_SetCooperativeLevel(ddraw, window, DDSCL_NORMAL); - ok(hr == DD_OK, "SetCooperativeLevel failed, hr %#x.\n", hr); + ok(hr == DD_OK, "SetCooperativeLevel failed, hr %#lx.\n", hr); flush_events(); get_virtual_rect(&rect); ret = GetClipCursor(&clip_rect); - ok(ret, "GetClipCursor failed, error %#x.\n", GetLastError()); + ok(ret, "GetClipCursor failed, error %lu.\n", GetLastError()); ok(EqualRect(&clip_rect, &rect), "Expect clip rect %s, got %s.\n", wine_dbgstr_rect(&rect), wine_dbgstr_rect(&clip_rect)); @@ -15281,10 +15255,10 @@ static BOOL CALLBACK test_window_position_cb(HMONITOR monitor, HDC hdc, RECT *mo flush_events(); hr = IDirectDraw2_SetCooperativeLevel(ddraw, window, DDSCL_EXCLUSIVE | DDSCL_FULLSCREEN); - ok(hr == DD_OK, "SetCooperativeLevel failed, hr %#x.\n", hr); + ok(hr == DD_OK, "SetCooperativeLevel failed, hr %#lx.\n", hr); flush_events(); ret = GetWindowRect(window, &window_rect); - ok(ret, "GetWindowRect failed, error %#x.\n", GetLastError()); + ok(ret, "GetWindowRect failed, error %lu.\n", GetLastError()); SetRect(&primary_rect, 0, 0, GetSystemMetrics(SM_CXSCREEN), GetSystemMetrics(SM_CYSCREEN)); ok(EqualRect(&window_rect, &primary_rect), "Expect window rect %s, got %s.\n", wine_dbgstr_rect(&primary_rect), wine_dbgstr_rect(&window_rect)); @@ -15295,9 +15269,9 @@ static BOOL CALLBACK test_window_position_cb(HMONITOR monitor, HDC hdc, RECT *mo ret = MoveWindow(window, new_rect.left, new_rect.top, new_rect.right - new_rect.left, new_rect.bottom - new_rect.top, TRUE); - ok(ret, "Got unexpected ret %#x, error %#x.\n", ret, GetLastError()); + ok(ret, "Got unexpected ret %#x, error %lu.\n", ret, GetLastError()); ret = GetWindowRect(window, &window_rect); - ok(ret, "Got unexpected ret %#x, error %#x.\n", ret, GetLastError()); + ok(ret, "Got unexpected ret %#x, error %lu.\n", ret, GetLastError()); ok(EqualRect(&window_rect, &new_rect), "Expected window rect %s, got %s.\n", wine_dbgstr_rect(monitor_rect), wine_dbgstr_rect(&window_rect)); @@ -15305,7 +15279,7 @@ static BOOL CALLBACK test_window_position_cb(HMONITOR monitor, HDC hdc, RECT *mo * on the second resize remains. */ flush_events(); ret = GetWindowRect(window, &window_rect); - ok(ret, "Got unexpected ret %#x, error %#x.\n", ret, GetLastError()); + ok(ret, "Got unexpected ret %#x, error %lu.\n", ret, GetLastError()); /* Both Windows and Wine change the size of the window. On Windows it is exactly the new size but in Wine * it may get adjusted depending on window manager. */ ok(window_rect.right != monitor_rect->right && window_rect.bottom != monitor_rect->bottom, @@ -15314,15 +15288,15 @@ static BOOL CALLBACK test_window_position_cb(HMONITOR monitor, HDC hdc, RECT *mo ret = MoveWindow(window, new_rect.left, new_rect.top, new_rect.right - new_rect.left, new_rect.bottom - new_rect.top, TRUE); - ok(ret, "Got unexpected ret %#x, error %#x.\n", ret, GetLastError()); + ok(ret, "Got unexpected ret %#x, error %lu.\n", ret, GetLastError()); ret = GetWindowRect(window, &window_rect); - ok(ret, "Got unexpected ret %#x, error %#x.\n", ret, GetLastError()); + ok(ret, "Got unexpected ret %#x, error %lu.\n", ret, GetLastError()); ok(EqualRect(&window_rect, &new_rect), "Expected window rect %s, got %s.\n", wine_dbgstr_rect(monitor_rect), wine_dbgstr_rect(&window_rect)); flush_events(); ret = GetWindowRect(window, &window_rect); - ok(ret, "Got unexpected ret %#x, error %#x.\n", ret, GetLastError()); + ok(ret, "Got unexpected ret %#x, error %lu.\n", ret, GetLastError()); ok(window_rect.right != monitor_rect->right && window_rect.bottom != monitor_rect->bottom, "Expected window rect %s, got %s.\n", wine_dbgstr_rect(monitor_rect), wine_dbgstr_rect(&window_rect)); @@ -15330,25 +15304,25 @@ static BOOL CALLBACK test_window_position_cb(HMONITOR monitor, HDC hdc, RECT *mo /* Window activation should restore the window to fit the whole primary monitor */ ret = SetWindowPos(window, 0, monitor_rect->left, monitor_rect->top, 0, 0, SWP_NOZORDER | SWP_NOSIZE); - ok(ret, "SetWindowPos failed, error %#x.\n", GetLastError()); + ok(ret, "SetWindowPos failed, error %lu.\n", GetLastError()); ret = SetForegroundWindow(GetDesktopWindow()); ok(ret, "Failed to set foreground window.\n"); flush_events(); ret = ShowWindow(window, SW_RESTORE); - ok(ret, "Failed to restore window, error %#x.\n", GetLastError()); + ok(ret, "Failed to restore window, error %lu.\n", GetLastError()); flush_events(); ret = SetForegroundWindow(window); - ok(ret, "SetForegroundWindow failed, error %#x.\n", GetLastError()); + ok(ret, "SetForegroundWindow failed, error %lu.\n", GetLastError()); flush_events(); ret = GetWindowRect(window, &window_rect); - ok(ret, "GetWindowRect failed, error %#x.\n", GetLastError()); + ok(ret, "GetWindowRect failed, error %lu.\n", GetLastError()); ok(EqualRect(&window_rect, &primary_rect), "Expect window rect %s, got %s.\n", wine_dbgstr_rect(&primary_rect), wine_dbgstr_rect(&window_rect)); hr = IDirectDraw2_SetCooperativeLevel(ddraw, window, DDSCL_NORMAL); - ok(hr == DD_OK, "SetCooperativeLevel failed, hr %#x.\n", hr); + ok(hr == DD_OK, "SetCooperativeLevel failed, hr %#lx.\n", hr); ret = GetWindowRect(window, &window_rect); - ok(ret, "GetWindowRect failed, error %#x.\n", GetLastError()); + ok(ret, "GetWindowRect failed, error %lu.\n", GetLastError()); ok(EqualRect(&window_rect, &primary_rect), "Expect window rect %s, got %s.\n", wine_dbgstr_rect(&primary_rect), wine_dbgstr_rect(&window_rect)); @@ -15379,14 +15353,14 @@ static BOOL CALLBACK test_get_display_mode_cb(HMONITOR monitor, HDC hdc, RECT *m /* Test that DirectDraw doesn't use the device window to determine which monitor to use */ ret = SetWindowPos(window, 0, monitor_rect->left, monitor_rect->top, 0, 0, SWP_NOZORDER | SWP_NOSIZE); - ok(ret, "SetWindowPos failed, error %#x.\n", GetLastError()); + ok(ret, "SetWindowPos failed, error %lu.\n", GetLastError()); surface_desc.dwSize = sizeof(surface_desc); hr = IDirectDraw2_GetDisplayMode(ddraw, &surface_desc); - ok(hr == DD_OK, "GetDisplayMode failed, hr %#x.\n", hr); - ok(surface_desc.dwWidth == GetSystemMetrics(SM_CXSCREEN), "Expect width %d, got %d.\n", + ok(hr == DD_OK, "GetDisplayMode failed, hr %#lx.\n", hr); + ok(surface_desc.dwWidth == GetSystemMetrics(SM_CXSCREEN), "Expect width %d, got %lu.\n", GetSystemMetrics(SM_CXSCREEN), surface_desc.dwWidth); - ok(surface_desc.dwHeight == GetSystemMetrics(SM_CYSCREEN), "Expect height %d, got %d.\n", + ok(surface_desc.dwHeight == GetSystemMetrics(SM_CYSCREEN), "Expect height %d, got %lu.\n", GetSystemMetrics(SM_CYSCREEN), surface_desc.dwHeight); DestroyWindow(window); @@ -15413,41 +15387,39 @@ static void test_get_display_mode(void) ok(!!window, "Failed to create a window.\n"); hr = IDirectDraw2_SetCooperativeLevel(ddraw, window, DDSCL_EXCLUSIVE | DDSCL_FULLSCREEN); - ok(hr == DD_OK, "SetCooperativeLevel failed, hr %#x.\n", hr); + ok(hr == DD_OK, "SetCooperativeLevel failed, hr %#lx.\n", hr); memset(&devmode, 0, sizeof(devmode)); devmode.dmSize = sizeof(devmode); ret = EnumDisplaySettingsW(NULL, ENUM_CURRENT_SETTINGS, &devmode); - ok(ret, "EnumDisplaySettingsW failed, error %#x.\n", GetLastError()); + ok(ret, "EnumDisplaySettingsW failed, error %lu.\n", GetLastError()); surface_desc.dwSize = sizeof(surface_desc); hr = IDirectDraw2_GetDisplayMode(ddraw, &surface_desc); - ok(hr == DD_OK, "GetDisplayMode failed, hr %#x.\n", hr); - ok(surface_desc.dwSize == sizeof(surface_desc), "Expected dwSize %u, got %u.\n", - sizeof(surface_desc), surface_desc.dwSize); - ok(surface_desc.dwFlags == flags, "Expected dwFlags %#x, got %#x.\n", flags, + ok(hr == DD_OK, "GetDisplayMode failed, hr %#lx.\n", hr); + ok(surface_desc.dwSize == sizeof(surface_desc), "Got dwSize %lu.\n", surface_desc.dwSize); + ok(surface_desc.dwFlags == flags, "Expected dwFlags %#lx, got %#lx.\n", flags, surface_desc.dwFlags); - ok(surface_desc.dwWidth == devmode.dmPelsWidth, "Expected width %u, got %u.\n", + ok(surface_desc.dwWidth == devmode.dmPelsWidth, "Expected width %lu, got %lu.\n", devmode.dmPelsWidth, surface_desc.dwWidth); - ok(surface_desc.dwHeight == devmode.dmPelsHeight, "Expected height %u, got %u.\n", + ok(surface_desc.dwHeight == devmode.dmPelsHeight, "Expected height %lu, got %lu.\n", devmode.dmPelsHeight, surface_desc.dwHeight); - ok(surface_desc.dwRefreshRate == devmode.dmDisplayFrequency, "Expected frequency %u, got %u.\n", + ok(surface_desc.dwRefreshRate == devmode.dmDisplayFrequency, "Expected frequency %lu, got %lu.\n", devmode.dmDisplayFrequency, surface_desc.dwRefreshRate); ok(surface_desc.ddpfPixelFormat.dwSize == sizeof(surface_desc.ddpfPixelFormat), - "Expected ddpfPixelFormat.dwSize %u, got %u.\n", sizeof(surface_desc.ddpfPixelFormat), - surface_desc.ddpfPixelFormat.dwSize); + "Got ddpfPixelFormat.dwSize %lu.\n", surface_desc.ddpfPixelFormat.dwSize); ok(surface_desc.ddpfPixelFormat.dwRGBBitCount == devmode.dmBitsPerPel, - "Expected ddpfPixelFormat.dwRGBBitCount %u, got %u.\n", devmode.dmBitsPerPel, + "Expected ddpfPixelFormat.dwRGBBitCount %lu, got %lu.\n", devmode.dmBitsPerPel, surface_desc.ddpfPixelFormat.dwRGBBitCount); ok(surface_desc.lPitch == devmode.dmPelsWidth * devmode.dmBitsPerPel / 8, - "Expected pitch %u, got %u.\n", devmode.dmPelsWidth * devmode.dmBitsPerPel / 8, + "Expected pitch %lu, got %lu.\n", devmode.dmPelsWidth * devmode.dmBitsPerPel / 8, surface_desc.lPitch); memset(¶m, 0, sizeof(param)); param.old_frequency = surface_desc.dwRefreshRate; hr = IDirectDraw2_EnumDisplayModes(ddraw, DDEDM_REFRESHRATES, NULL, ¶m, find_different_mode_callback); - ok(hr == DD_OK, "EnumDisplayModes failed, hr %#x.\n", hr); + ok(hr == DD_OK, "EnumDisplayModes failed, hr %#lx.\n", hr); if (!param.new_frequency) { skip("Failed to find a display mode with a different frequency.\n"); @@ -15456,17 +15428,17 @@ static void test_get_display_mode(void) hr = IDirectDraw2_SetDisplayMode(ddraw, param.new_width, param.new_height, param.new_bpp, param.new_frequency, 0); - ok(hr == DD_OK, "SetDisplayMode failed, hr %#x.\n", hr); + ok(hr == DD_OK, "SetDisplayMode failed, hr %#lx.\n", hr); hr = IDirectDraw2_GetDisplayMode(ddraw, &surface_desc); - ok(hr == DD_OK, "GetDisplayMode failed, hr %#x.\n", hr); - ok(surface_desc.dwWidth == param.new_width, "Expected width %u, got %u.\n", param.new_width, + ok(hr == DD_OK, "GetDisplayMode failed, hr %#lx.\n", hr); + ok(surface_desc.dwWidth == param.new_width, "Expected width %u, got %lu.\n", param.new_width, surface_desc.dwWidth); - ok(surface_desc.dwHeight == param.new_height, "Expected height %u, got %u.\n", param.new_height, + ok(surface_desc.dwHeight == param.new_height, "Expected height %u, got %lu.\n", param.new_height, surface_desc.dwHeight); - ok(surface_desc.dwRefreshRate == param.new_frequency, "Expected frequency %u, got %u.\n", + ok(surface_desc.dwRefreshRate == param.new_frequency, "Expected frequency %u, got %lu.\n", param.new_frequency, surface_desc.dwRefreshRate); ok(surface_desc.ddpfPixelFormat.dwRGBBitCount == param.new_bpp, - "Expected ddpfPixelFormat.dwRGBBitCount %u, got %u.\n", devmode.dmBitsPerPel, + "Expected ddpfPixelFormat.dwRGBBitCount %lu, got %lu.\n", devmode.dmBitsPerPel, surface_desc.ddpfPixelFormat.dwRGBBitCount); done: @@ -15489,9 +15461,9 @@ static void test_texture_wrong_caps(const GUID *device_guid) {32}, {0x00ff0000}, {0x0000ff00}, {0x000000ff}, {0xff000000} }; D3DRECT clear_rect = {{0}, {0}, {640}, {480}}; + unsigned int color, expected_color; IDirectDrawSurface *surface, *rt; D3DTEXTUREHANDLE texture_handle; - D3DCOLOR color, expected_color; IDirect3DMaterial2 *background; IDirect3DViewport2 *viewport; IDirect3DTexture2 *texture; @@ -15512,11 +15484,11 @@ static void test_texture_wrong_caps(const GUID *device_guid) return; } hr = IDirect3DDevice2_GetRenderTarget(device, &rt); - ok(hr == D3D_OK, "Got unexpected hr %#x.\n", hr); + ok(hr == D3D_OK, "Got unexpected hr %#lx.\n", hr); viewport = create_viewport(device, 0, 0, 640, 480); hr = IDirect3DDevice2_SetCurrentViewport(device, viewport); - ok(hr == D3D_OK, "Got unexpected hr %#x.\n", hr); + ok(hr == D3D_OK, "Got unexpected hr %#lx.\n", hr); memset(&ddsd, 0, sizeof(ddsd)); ddsd.dwSize = sizeof(ddsd); @@ -15526,33 +15498,33 @@ static void test_texture_wrong_caps(const GUID *device_guid) ddsd.ddsCaps.dwCaps = DDSCAPS_OFFSCREENPLAIN; U4(ddsd).ddpfPixelFormat = fmt; hr = IDirectDraw2_CreateSurface(ddraw, &ddsd, &surface, NULL); - ok(hr == DD_OK, "Got unexpected hr %#x.\n", hr); + ok(hr == DD_OK, "Got unexpected hr %#lx.\n", hr); hr = IDirectDrawSurface_QueryInterface(surface, &IID_IDirect3DTexture2, (void **)&texture); - ok(hr == DD_OK, "Got unexpected hr %#x.\n", hr); + ok(hr == DD_OK, "Got unexpected hr %#lx.\n", hr); hr = IDirect3DTexture2_GetHandle(texture, device, &texture_handle); - ok(hr == D3D_OK, "Got unexpected hr %#x.\n", hr); + ok(hr == D3D_OK, "Got unexpected hr %#lx.\n", hr); fill_surface(surface, 0xff00ff00); hr = IDirect3DDevice2_SetRenderState(device, D3DRENDERSTATE_ZENABLE, D3DZB_FALSE); - ok(hr == D3D_OK, "Got unexpected hr %#x.\n", hr); + ok(hr == D3D_OK, "Got unexpected hr %#lx.\n", hr); hr = IDirect3DDevice2_SetRenderState(device, D3DRENDERSTATE_TEXTUREHANDLE, texture_handle); - ok(hr == D3D_OK, "Got unexpected hr %#x.\n", hr); + ok(hr == D3D_OK, "Got unexpected hr %#lx.\n", hr); background = create_diffuse_material(device, 1.0f, 0.0f, 0.0f, 1.0f); viewport_set_background(device, viewport, background); hr = IDirect3DViewport2_Clear(viewport, 1, &clear_rect, D3DCLEAR_TARGET); - ok(hr == D3D_OK, "Got unexpected hr %#x.\n", hr); + ok(hr == D3D_OK, "Got unexpected hr %#lx.\n", hr); if (is_software_device_type(device_guid)) fill_surface(rt, 0xffff0000); hr = IDirect3DDevice2_BeginScene(device); - ok(hr == D3D_OK, "Got unexpected hr %#x.\n", hr); + ok(hr == D3D_OK, "Got unexpected hr %#lx.\n", hr); hr = IDirect3DDevice2_DrawPrimitive(device, D3DPT_TRIANGLESTRIP, D3DVT_LVERTEX, quad, ARRAY_SIZE(quad), 0); - ok(hr == D3D_OK, "Got unexpected hr %#x.\n", hr); + ok(hr == D3D_OK, "Got unexpected hr %#lx.\n", hr); hr = IDirect3DDevice2_EndScene(device); - ok(hr == D3D_OK, "Got unexpected hr %#x.\n", hr); + ok(hr == D3D_OK, "Got unexpected hr %#lx.\n", hr); expected_color = is_software_device_type(device_guid) ? 0x0000ff00 : 0x00ffffff; color = get_surface_color(rt, 320, 240); @@ -15565,7 +15537,7 @@ static void test_texture_wrong_caps(const GUID *device_guid) destroy_material(background); IDirectDraw2_Release(ddraw); refcount = IDirect3DDevice2_Release(device); - ok(!refcount, "Device has %u references left.\n", refcount); + ok(!refcount, "Device has %lu references left.\n", refcount); DestroyWindow(window); } @@ -15577,11 +15549,10 @@ static void test_filling_convention(void) static const DWORD colour_right = 0x00000000; static const DWORD colour_left = 0x00ff0000; static const DWORD colour_top = 0x0000ff00; + unsigned int colour, expected, i, j, x, y; IDirect3DMaterial2 *background; IDirect3DViewport2 *viewport; IDirect3DDevice2 *device; - unsigned int i, j, x, y; - DWORD colour, expected; IDirectDraw2 *ddraw; DDSURFACEDESC desc; IDirect3D2 *d3d; @@ -15909,15 +15880,15 @@ static void test_filling_convention(void) } hr = IDirect3DDevice2_GetDirect3D(device, &d3d); - ok(hr == DD_OK, "Got unexpected hr %#x.\n", hr); + ok(hr == DD_OK, "Got unexpected hr %#lx.\n", hr); hr = IDirect3DDevice2_GetRenderTarget(device, &backbuffer); - ok(hr == DD_OK, "Got unexpected hr %#x.\n", hr); + ok(hr == DD_OK, "Got unexpected hr %#lx.\n", hr); viewport = create_viewport(device, 0, 0, vp_size, vp_size); background = create_diffuse_material(device, 0.0f, 0.0f, 1.0f, 1.0f); viewport_set_background(device, viewport, background); hr = IDirect3DDevice2_SetCurrentViewport(device, viewport); - ok(hr == D3D_OK, "Got unexpected hr %#x.\n", hr); + ok(hr == D3D_OK, "Got unexpected hr %#lx.\n", hr); memset(&desc, 0, sizeof(desc)); desc.dwSize = sizeof(desc); @@ -15932,7 +15903,7 @@ static void test_filling_convention(void) desc.ddpfPixelFormat.dwGBitMask = 0x0000ff00; desc.ddpfPixelFormat.dwBBitMask = 0x000000ff; hr = IDirectDraw2_CreateSurface(ddraw, &desc, &rt, NULL); - ok(hr == D3D_OK, "Got unexpected hr %#x.\n", hr); + ok(hr == D3D_OK, "Got unexpected hr %#lx.\n", hr); /* Nvidia on Windows 10 refuses to set the offscreen RT * if it does not have an attached depth stencil. */ @@ -15941,7 +15912,7 @@ static void test_filling_convention(void) desc.dwSize = sizeof(desc); desc.ddpfPixelFormat.dwSize = sizeof(desc.ddpfPixelFormat); hr = IDirectDrawSurface_GetPixelFormat(ds, &desc.ddpfPixelFormat); - ok(hr == D3D_OK, "Got unexpected hr %#x.\n", hr); + ok(hr == D3D_OK, "Got unexpected hr %#lx.\n", hr); IDirectDrawSurface4_Release(ds); desc.dwFlags = DDSD_CAPS | DDSD_WIDTH | DDSD_HEIGHT | DDSD_PIXELFORMAT; @@ -15949,14 +15920,14 @@ static void test_filling_convention(void) desc.dwWidth = vp_size; desc.dwHeight = vp_size; hr = IDirectDraw2_CreateSurface(ddraw, &desc, &ds, NULL); - ok(hr == D3D_OK, "Got unexpected hr %#x.\n", hr); + ok(hr == D3D_OK, "Got unexpected hr %#lx.\n", hr); hr = IDirectDrawSurface_AddAttachedSurface(rt, ds); - ok(SUCCEEDED(hr), "Failed to attach depth buffer, hr %#x.\n", hr); + ok(SUCCEEDED(hr), "Failed to attach depth buffer, hr %#lx.\n", hr); hr = IDirect3DDevice2_SetRenderState(device, D3DRENDERSTATE_LIGHTING, FALSE); - ok(hr == D3D_OK, "Got unexpected hr %#x.\n", hr); + ok(hr == D3D_OK, "Got unexpected hr %#lx.\n", hr); hr = IDirect3DDevice2_SetRenderState(device, D3DRENDERSTATE_ZENABLE, D3DZB_FALSE); - ok(hr == D3D_OK, "Got unexpected hr %#x.\n", hr); + ok(hr == D3D_OK, "Got unexpected hr %#lx.\n", hr); for (i = 0; i < ARRAY_SIZE(tests); ++i) { @@ -15965,17 +15936,17 @@ static void test_filling_convention(void) cur = j ? rt : backbuffer; hr = IDirect3DDevice2_SetRenderTarget(device, cur, 0); - ok(hr == D3D_OK, "Got unexpected hr %#x.\n", hr); + ok(hr == D3D_OK, "Got unexpected hr %#lx.\n", hr); hr = IDirect3DViewport2_Clear(viewport, 1, &clear_rect, D3DCLEAR_TARGET); - ok(hr == D3D_OK, "Got unexpected hr %#x.\n", hr); + ok(hr == D3D_OK, "Got unexpected hr %#lx.\n", hr); hr = IDirect3DDevice2_BeginScene(device); - ok(hr == D3D_OK, "Got unexpected hr %#x.\n", hr); + ok(hr == D3D_OK, "Got unexpected hr %#lx.\n", hr); hr = IDirect3DDevice2_DrawPrimitive(device, D3DPT_TRIANGLELIST, tests[i].fvf, tests[i].geometry, 12, 0); - ok(hr == D3D_OK, "Got unexpected hr %#x.\n", hr); + ok(hr == D3D_OK, "Got unexpected hr %#lx.\n", hr); hr = IDirect3DDevice2_EndScene(device); - ok(hr == D3D_OK, "Got unexpected hr %#x.\n", hr); + ok(hr == D3D_OK, "Got unexpected hr %#lx.\n", hr); for (y = 0; y < 8; y++) { @@ -16026,9 +15997,9 @@ static void test_filling_convention(void) IDirectDrawSurface_Release(ds); IDirect3D2_Release(d3d); refcount = IDirect3DDevice2_Release(device); - ok(!refcount, "Device has %u references left.\n", refcount); + ok(!refcount, "Device has %lu references left.\n", refcount); refcount = IDirectDraw2_Release(ddraw); - ok(!refcount, "Device has %u references left.\n", refcount); + ok(!refcount, "Device has %lu references left.\n", refcount); DestroyWindow(window); }