From: Zebediah Figura zfigura@codeweavers.com
--- dlls/ddraw/tests/ddraw4.c | 5409 ++++++++++++++++++------------------- 1 file changed, 2689 insertions(+), 2720 deletions(-)
diff --git a/dlls/ddraw/tests/ddraw4.c b/dlls/ddraw/tests/ddraw4.c index a3352b8da3c..153cc89d095 100644 --- a/dlls/ddraw/tests/ddraw4.c +++ b/dlls/ddraw/tests/ddraw4.c @@ -18,7 +18,6 @@ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA */
-#define WINE_NO_LONG_TYPES #define COBJMACROS
#include "wine/test.h" @@ -128,7 +127,7 @@ static BOOL ddraw_get_identifier(IDirectDraw4 *ddraw, DDDEVICEIDENTIFIER *identi HRESULT hr;
hr = IDirectDraw4_GetDeviceIdentifier(ddraw, 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);
return SUCCEEDED(hr); } @@ -215,7 +214,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 (;;) { @@ -228,7 +227,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; } } @@ -243,13 +242,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) @@ -268,9 +267,9 @@ static IDirectDrawSurface4 *get_depth_stencil(IDirect3DDevice3 *device) HRESULT hr;
hr = IDirect3DDevice3_GetRenderTarget(device, &rt); - ok(SUCCEEDED(hr), "Failed to get the render target, hr %#x.\n", hr); + ok(SUCCEEDED(hr), "Failed to get the render target, hr %#lx.\n", hr); hr = IDirectDrawSurface4_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); IDirectDrawSurface4_Release(rt); return ret; } @@ -356,14 +355,14 @@ static D3DCOLOR get_surface_color(IDirectDrawSurface4 *surface, UINT x, UINT y) surface_desc.dwSize = sizeof(surface_desc);
hr = IDirectDrawSurface4_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 = IDirectDrawSurface4_Unlock(surface, &rect); - ok(SUCCEEDED(hr), "Failed to unlock surface, hr %#x.\n", hr); + ok(SUCCEEDED(hr), "Failed to unlock surface, hr %#lx.\n", hr);
return color; } @@ -376,7 +375,7 @@ static void fill_surface(IDirectDrawSurface4 *surface, D3DCOLOR color) DWORD *ptr;
hr = IDirectDrawSurface4_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) { @@ -388,7 +387,7 @@ static void fill_surface(IDirectDrawSurface4 *surface, D3DCOLOR color) }
hr = IDirectDrawSurface4_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(IDirectDrawSurface4 *surface, RECT r) @@ -403,8 +402,7 @@ static void check_rect(IDirectDrawSurface4 *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 color, i, j, x_side, y_side; LONG x, y;
for (i = 0; i < 2; ++i) @@ -415,14 +413,14 @@ static void check_rect(IDirectDrawSurface4 *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); } } } @@ -470,7 +468,7 @@ static IDirect3DDevice3 *create_device_ex(HWND window, DWORD coop_level, const G return NULL;
hr = IDirectDraw4_SetCooperativeLevel(ddraw4, 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); @@ -482,18 +480,18 @@ static IDirect3DDevice3 *create_device_ex(HWND window, DWORD coop_level, const G surface_desc.dwHeight = 480;
hr = IDirectDraw4_CreateSurface(ddraw4, &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 = IDirectDraw4_CreateClipper(ddraw4, 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 = IDirectDrawSurface4_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); }
@@ -525,7 +523,7 @@ static IDirect3DDevice3 *create_device_ex(HWND window, DWORD coop_level, const G surface_desc.dwWidth = 640; surface_desc.dwHeight = 480; hr = IDirectDraw4_CreateSurface(ddraw4, &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)) { IDirect3D3_Release(d3d3); @@ -534,7 +532,7 @@ static IDirect3DDevice3 *create_device_ex(HWND window, DWORD coop_level, const G }
hr = IDirectDrawSurface4_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); IDirectDrawSurface4_Release(ds); if (FAILED(hr)) { @@ -565,11 +563,11 @@ static IDirect3DViewport3 *create_viewport(IDirect3DDevice3 *device, UINT x, UIN HRESULT hr;
hr = IDirect3DDevice3_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 = IDirect3D3_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 = IDirect3DDevice3_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; @@ -583,7 +581,7 @@ static IDirect3DViewport3 *create_viewport(IDirect3DDevice3 *device, UINT x, UIN vp.dvMinZ = 0.0f; vp.dvMaxZ = 1.0f; hr = IDirect3DViewport3_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); IDirect3D3_Release(d3d);
return viewport; @@ -594,7 +592,7 @@ static void destroy_viewport(IDirect3DDevice3 *device, IDirect3DViewport3 *viewp HRESULT hr;
hr = IDirect3DDevice3_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); IDirect3DViewport3_Release(viewport); }
@@ -605,11 +603,11 @@ static IDirect3DMaterial3 *create_material(IDirect3DDevice3 *device, D3DMATERIAL HRESULT hr;
hr = IDirect3DDevice3_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 = IDirect3D3_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 = IDirect3DMaterial3_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); IDirect3D3_Release(d3d);
return material; @@ -703,13 +701,13 @@ 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);
if (focus_test_ddraw) { hr = IDirectDraw4_TestCooperativeLevel(focus_test_ddraw); - ok(hr == expect_messages->ddraw_state, "Got ddraw state %#x on message %#x, expected %#x.\n", + ok(hr == expect_messages->ddraw_state, "Got ddraw state %#lx on message %#x, expected %#lx.\n", hr, message, expect_messages->ddraw_state); }
@@ -732,9 +730,9 @@ static void fix_wndproc(HWND window, LONG_PTR proc)
SetWindowLongPtrA(window, GWLP_WNDPROC, proc); hr = IDirectDraw4_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 = IDirectDraw4_SetCooperativeLevel(ddraw, window, DDSCL_NORMAL); - ok(SUCCEEDED(hr), "SetCooperativeLevel failed, hr %#x.\n", hr); + ok(SUCCEEDED(hr), "SetCooperativeLevel failed, hr %#lx.\n", hr);
IDirectDraw4_Release(ddraw); } @@ -777,17 +775,17 @@ static void test_process_vertices(void) }
hr = IDirect3DDevice3_GetDirect3D(device, &d3d3); - ok(SUCCEEDED(hr), "Failed to get Direct3D3 interface, hr %#x.\n", hr); + ok(SUCCEEDED(hr), "Failed to get Direct3D3 interface, hr %#lx.\n", hr);
memset(&vb_desc, 0, sizeof(vb_desc)); vb_desc.dwSize = sizeof(vb_desc); vb_desc.dwFVF = D3DFVF_XYZ; vb_desc.dwNumVertices = 3; hr = IDirect3D3_CreateVertexBuffer(d3d3, &vb_desc, &src_vb, 0, NULL); - ok(SUCCEEDED(hr), "Failed to create source vertex buffer, hr %#x.\n", hr); + ok(SUCCEEDED(hr), "Failed to create source vertex buffer, hr %#lx.\n", hr);
hr = IDirect3DVertexBuffer_Lock(src_vb, DDLOCK_WRITEONLY, (void **)&src_data, NULL); - ok(SUCCEEDED(hr), "Failed to lock source vertex buffer, hr %#x.\n", hr); + ok(SUCCEEDED(hr), "Failed to lock source vertex buffer, hr %#lx.\n", hr); src_data[0].x = -1.0f; src_data[0].y = -1.0f; src_data[0].z = -1.0f; @@ -798,19 +796,19 @@ static void test_process_vertices(void) src_data[2].y = 1.0f; src_data[2].z = 1.0f; hr = IDirect3DVertexBuffer_Unlock(src_vb); - ok(SUCCEEDED(hr), "Failed to unlock source vertex buffer, hr %#x.\n", hr); + ok(SUCCEEDED(hr), "Failed to unlock source vertex buffer, hr %#lx.\n", hr);
memset(&vb_desc, 0, sizeof(vb_desc)); vb_desc.dwSize = sizeof(vb_desc); vb_desc.dwFVF = D3DFVF_XYZRHW; vb_desc.dwNumVertices = 3; hr = IDirect3D3_CreateVertexBuffer(d3d3, &vb_desc, &dst_vb, 0, NULL); - ok(SUCCEEDED(hr), "Failed to create destination vertex buffer, hr %#x.\n", hr); + ok(SUCCEEDED(hr), "Failed to create destination vertex buffer, hr %#lx.\n", hr);
hr = IDirect3D3_CreateViewport(d3d3, &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 = IDirect3DDevice3_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); vp2.dwSize = sizeof(vp2); vp2.dwX = 10; vp2.dwY = 20; @@ -823,22 +821,22 @@ static void test_process_vertices(void) vp2.dvMinZ = -2.0f; vp2.dvMaxZ = 3.0f; hr = IDirect3DViewport3_SetViewport2(viewport, &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); hr = IDirect3DDevice3_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 = IDirect3DDevice3_SetTransform(device, D3DTRANSFORMSTATE_WORLD, &identity); - ok(SUCCEEDED(hr), "Failed to set world transformation, hr %#x.\n", hr); + ok(SUCCEEDED(hr), "Failed to set world transformation, hr %#lx.\n", hr); hr = IDirect3DDevice3_SetTransform(device, D3DTRANSFORMSTATE_VIEW, &identity); - ok(SUCCEEDED(hr), "Failed to set view transformation, hr %#x.\n", hr); + ok(SUCCEEDED(hr), "Failed to set view transformation, hr %#lx.\n", hr); hr = IDirect3DDevice3_SetTransform(device, D3DTRANSFORMSTATE_PROJECTION, &identity); - ok(SUCCEEDED(hr), "Failed to set projection transformation, hr %#x.\n", hr); + ok(SUCCEEDED(hr), "Failed to set projection transformation, hr %#lx.\n", hr);
hr = IDirect3DVertexBuffer_ProcessVertices(dst_vb, D3DVOP_TRANSFORM, 0, 3, src_vb, 0, device, 0); - ok(SUCCEEDED(hr), "Failed to process vertices, hr %#x.\n", hr); + ok(SUCCEEDED(hr), "Failed to process vertices, hr %#lx.\n", hr);
hr = IDirect3DVertexBuffer_Lock(dst_vb, DDLOCK_READONLY, (void **)&dst_data, NULL); - ok(SUCCEEDED(hr), "Failed to lock destination vertex buffer, hr %#x.\n", hr); + ok(SUCCEEDED(hr), "Failed to lock destination vertex buffer, hr %#lx.\n", hr); ok(compare_vec4(&dst_data[0], -6.500e+1f, +1.800e+2f, +2.000e-1f, +1.000e+0f, 4096), "Got unexpected vertex 0 {%.8e, %.8e, %.8e, %.8e}.\n", dst_data[0].x, dst_data[0].y, dst_data[0].z, dst_data[0].w); @@ -849,16 +847,16 @@ static void test_process_vertices(void) "Got unexpected vertex 2 {%.8e, %.8e, %.8e, %.8e}.\n", dst_data[2].x, dst_data[2].y, dst_data[2].z, dst_data[2].w); hr = IDirect3DVertexBuffer_Unlock(dst_vb); - ok(SUCCEEDED(hr), "Failed to unlock destination vertex buffer, hr %#x.\n", hr); + ok(SUCCEEDED(hr), "Failed to unlock destination vertex buffer, hr %#lx.\n", hr);
hr = IDirect3DDevice3_MultiplyTransform(device, D3DTRANSFORMSTATE_PROJECTION, &projection); - ok(SUCCEEDED(hr), "Failed to set projection transformation, hr %#x.\n", hr); + ok(SUCCEEDED(hr), "Failed to set projection transformation, hr %#lx.\n", hr);
hr = IDirect3DVertexBuffer_ProcessVertices(dst_vb, D3DVOP_TRANSFORM, 0, 3, src_vb, 0, device, 0); - ok(SUCCEEDED(hr), "Failed to process vertices, hr %#x.\n", hr); + ok(SUCCEEDED(hr), "Failed to process vertices, hr %#lx.\n", hr);
hr = IDirect3DVertexBuffer_Lock(dst_vb, DDLOCK_READONLY, (void **)&dst_data, NULL); - ok(SUCCEEDED(hr), "Failed to lock destination vertex buffer, hr %#x.\n", hr); + ok(SUCCEEDED(hr), "Failed to lock destination vertex buffer, hr %#lx.\n", hr); ok(compare_vec4(&dst_data[0], +8.500e+1f, -1.000e+2f, +1.800e+0f, +1.000e+0f, 4096), "Got unexpected vertex 0 {%.8e, %.8e, %.8e, %.8e}.\n", dst_data[0].x, dst_data[0].y, dst_data[0].z, dst_data[0].w); @@ -869,7 +867,7 @@ static void test_process_vertices(void) "Got unexpected vertex 2 {%.8e, %.8e, %.8e, %.8e}.\n", dst_data[2].x, dst_data[2].y, dst_data[2].z, dst_data[2].w); hr = IDirect3DVertexBuffer_Unlock(dst_vb); - ok(SUCCEEDED(hr), "Failed to unlock destination vertex buffer, hr %#x.\n", hr); + ok(SUCCEEDED(hr), "Failed to unlock destination vertex buffer, hr %#lx.\n", hr);
vp2.dwSize = sizeof(vp2); vp2.dwX = 30; @@ -883,13 +881,13 @@ static void test_process_vertices(void) vp2.dvMinZ = 3.0f; vp2.dvMaxZ = -2.0f; hr = IDirect3DViewport3_SetViewport2(viewport, &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);
hr = IDirect3DVertexBuffer_ProcessVertices(dst_vb, D3DVOP_TRANSFORM, 0, 3, src_vb, 0, device, 0); - ok(SUCCEEDED(hr), "Failed to process vertices, hr %#x.\n", hr); + ok(SUCCEEDED(hr), "Failed to process vertices, hr %#lx.\n", hr);
hr = IDirect3DVertexBuffer_Lock(dst_vb, DDLOCK_READONLY, (void **)&dst_data, NULL); - ok(SUCCEEDED(hr), "Failed to lock destination vertex buffer, hr %#x.\n", hr); + ok(SUCCEEDED(hr), "Failed to lock destination vertex buffer, hr %#lx.\n", hr); ok(compare_vec4(&dst_data[0], +7.500e+1f, +4.000e+1f, -8.000e-1f, +1.000e+0f, 4096), "Got unexpected vertex 0 {%.8e, %.8e, %.8e, %.8e}.\n", dst_data[0].x, dst_data[0].y, dst_data[0].z, dst_data[0].w); @@ -900,7 +898,7 @@ static void test_process_vertices(void) "Got unexpected vertex 2 {%.8e, %.8e, %.8e, %.8e}.\n", dst_data[2].x, dst_data[2].y, dst_data[2].z, dst_data[2].w); hr = IDirect3DVertexBuffer_Unlock(dst_vb); - ok(SUCCEEDED(hr), "Failed to unlock destination vertex buffer, hr %#x.\n", hr); + ok(SUCCEEDED(hr), "Failed to unlock destination vertex buffer, hr %#lx.\n", hr);
vp1.dwSize = sizeof(vp1); vp1.dwX = 30; @@ -914,13 +912,13 @@ static void test_process_vertices(void) vp1.dvMinZ = -2.0f; vp1.dvMaxZ = 3.0f; hr = IDirect3DViewport3_SetViewport(viewport, &vp1); - ok(SUCCEEDED(hr), "Failed to set viewport data, hr %#x.\n", hr); + ok(SUCCEEDED(hr), "Failed to set viewport data, hr %#lx.\n", hr);
hr = IDirect3DVertexBuffer_ProcessVertices(dst_vb, D3DVOP_TRANSFORM, 0, 3, src_vb, 0, device, 0); - ok(SUCCEEDED(hr), "Failed to process vertices, hr %#x.\n", hr); + ok(SUCCEEDED(hr), "Failed to process vertices, hr %#lx.\n", hr);
hr = IDirect3DVertexBuffer_Lock(dst_vb, DDLOCK_READONLY, (void **)&dst_data, NULL); - ok(SUCCEEDED(hr), "Failed to lock destination vertex buffer, hr %#x.\n", hr); + ok(SUCCEEDED(hr), "Failed to lock destination vertex buffer, hr %#lx.\n", hr); ok(compare_vec4(&dst_data[0], +1.100e+2f, +6.800e+1f, +7.000e+0f, +1.000e+0f, 4096), "Got unexpected vertex 0 {%.8e, %.8e, %.8e, %.8e}.\n", dst_data[0].x, dst_data[0].y, dst_data[0].z, dst_data[0].w); @@ -931,10 +929,10 @@ static void test_process_vertices(void) "Got unexpected vertex 2 {%.8e, %.8e, %.8e, %.8e}.\n", dst_data[2].x, dst_data[2].y, dst_data[2].z, dst_data[2].w); hr = IDirect3DVertexBuffer_Unlock(dst_vb); - ok(SUCCEEDED(hr), "Failed to unlock destination vertex buffer, hr %#x.\n", hr); + ok(SUCCEEDED(hr), "Failed to unlock destination vertex buffer, hr %#lx.\n", hr);
hr = IDirect3DDevice3_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);
IDirect3DVertexBuffer_Release(dst_vb); IDirect3DVertexBuffer_Release(src_vb); @@ -955,23 +953,23 @@ static void test_coop_level_create_device_window(void) ok(!!ddraw, "Failed to create a ddraw object.\n");
hr = IDirectDraw4_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 = IDirectDraw4_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 = IDirectDraw4_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 = IDirectDraw4_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 = IDirectDraw4_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");
@@ -985,48 +983,48 @@ static void test_coop_level_create_device_window(void) }
hr = IDirectDraw4_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 = IDirectDraw4_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 = IDirectDraw4_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 = IDirectDraw4_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 = IDirectDraw4_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 = IDirectDraw4_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 = IDirectDraw4_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 = IDirectDraw4_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 = IDirectDraw4_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 = IDirectDraw4_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");
@@ -1037,13 +1035,12 @@ static void test_coop_level_create_device_window(void) static void test_clipper_blt(void) { IDirectDrawSurface4 *src_surface, *dst_surface; + unsigned int color, i, j, x, y; RECT client_rect, src_rect; IDirectDrawClipper *clipper; DDSURFACEDESC2 surface_desc; - unsigned int i, j, x, y; IDirectDraw4 *ddraw; RGNDATA *rgn_data; - D3DCOLOR color; ULONG refcount; HRGN r1, r2; HWND window; @@ -1058,7 +1055,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, @@ -1080,7 +1077,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, @@ -1100,22 +1097,22 @@ static void test_clipper_blt(void) ok(ret, "Failed to map client rect.\n");
hr = IDirectDraw4_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 = IDirectDraw4_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)); @@ -1135,11 +1132,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);
@@ -1157,33 +1154,33 @@ static void test_clipper_blt(void) U4(U4(surface_desc).ddpfPixelFormat).dwBBitMask = 0x000000ff;
hr = IDirectDraw4_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 = IDirectDraw4_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 = IDirectDrawSurface4_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 = IDirectDrawSurface4_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 = IDirectDrawSurface4_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 = IDirectDrawSurface4_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 = IDirectDrawSurface4_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 = IDirectDrawSurface4_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) @@ -1199,7 +1196,7 @@ static void test_clipper_blt(void)
U5(fx).dwFillColor = 0xff0000ff; hr = IDirectDrawSurface4_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) @@ -1213,30 +1210,30 @@ static void test_clipper_blt(void) }
hr = IDirectDrawSurface4_BltFast(dst_surface, 0, 0, src_surface, NULL, DDBLTFAST_WAIT); - ok(hr == DDERR_BLTFASTCANTCLIP, "Got unexpected hr %#x.\n", hr); + ok(hr == DDERR_BLTFASTCANTCLIP, "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 = IDirectDrawSurface4_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);
IDirectDrawSurface4_Release(dst_surface); IDirectDrawSurface4_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); IDirectDraw4_Release(ddraw); }
@@ -1248,8 +1245,8 @@ static void test_coop_level_d3d_state(void) IDirect3DDevice3 *device; IDirectDraw4 *ddraw; DDSURFACEDESC2 lock; + unsigned int color; IDirect3D3 *d3d; - D3DCOLOR color; DWORD value; HWND window; HRESULT hr; @@ -1278,29 +1275,29 @@ static void test_coop_level_d3d_state(void) viewport = create_viewport(device, 0, 0, 640, 480);
hr = IDirect3DDevice3_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 = IDirect3DDevice3_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 = IDirect3DDevice3_GetRenderTarget(device, &rt); - ok(hr == DD_OK, "Got unexpected hr %#x.\n", hr); + ok(hr == DD_OK, "Got unexpected hr %#lx.\n", hr); hr = IDirect3DDevice3_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 = IDirect3DDevice3_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 = IDirect3DDevice3_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 = IDirect3DViewport3_Clear2(viewport, 1, &clear_rect, D3DCLEAR_TARGET, 0xffff0000, 0.0f, 0); - 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 = IDirect3DDevice3_GetDirect3D(device, &d3d); - ok(hr == DD_OK, "Got unexpected hr %#x.\n", hr); + ok(hr == DD_OK, "Got unexpected hr %#lx.\n", hr); hr = IDirect3D3_QueryInterface(d3d, &IID_IDirectDraw4, (void **)&ddraw); - ok(hr == DD_OK, "Got unexpected hr %#x.\n", hr); + ok(hr == DD_OK, "Got unexpected hr %#lx.\n", hr); IDirect3D3_Release(d3d);
if (ddraw_is_warp(ddraw)) @@ -1311,49 +1308,49 @@ static void test_coop_level_d3d_state(void) }
hr = IDirectDraw4_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 = IDirectDrawSurface4_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 = IDirectDrawSurface4_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 = IDirectDraw4_RestoreAllSurfaces(ddraw); - ok(hr == DD_OK, "Got unexpected hr %#x.\n", hr); + ok(hr == DD_OK, "Got unexpected hr %#lx.\n", hr);
hr = IDirectDrawSurface4_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 = IDirectDrawSurface4_Unlock(rt, NULL); - ok(hr == DD_OK, "Got unexpected hr %#x.\n", hr); + ok(hr == DD_OK, "Got unexpected hr %#lx.\n", hr);
hr = IDirect3DDevice3_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); IDirectDrawSurface4_Release(surface); hr = IDirect3DDevice3_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 = IDirect3DDevice3_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 = IDirect3DViewport3_Clear2(viewport, 1, &clear_rect, D3DCLEAR_TARGET | D3DCLEAR_ZBUFFER, 0xff00ff00, 1.0f, 0); - 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), "Got unexpected color 0x%08x.\n", color);
hr = IDirect3DDevice3_SetCurrentViewport(device, viewport); - ok(hr == DD_OK, "Got unexpected hr %#x.\n", hr); + ok(hr == DD_OK, "Got unexpected hr %#lx.\n", hr); hr = IDirect3DDevice3_BeginScene(device); - ok(hr == DD_OK, "Got unexpected hr %#x.\n", hr); + ok(hr == DD_OK, "Got unexpected hr %#lx.\n", hr); hr = IDirect3DDevice3_DrawPrimitive(device, D3DPT_TRIANGLESTRIP, D3DFVF_XYZ | D3DFVF_DIFFUSE, 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 = IDirect3DDevice3_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) || broken(ddraw_is_warp(ddraw) && compare_color(color, 0x0000ff00, 0)), @@ -1377,9 +1374,9 @@ static void test_surface_interface_mismatch(void) IDirect3DViewport3 *viewport = NULL; DDSURFACEDESC2 surface_desc; DDPIXELFORMAT z_fmt; + unsigned int color; ULONG refcount; HRESULT hr; - D3DCOLOR color; HWND window; D3DRECT clear_rect = {{0}, {0}, {640}, {480}};
@@ -1387,7 +1384,7 @@ static void test_surface_interface_mismatch(void) ddraw = create_ddraw(); ok(!!ddraw, "Failed to create a ddraw object.\n"); hr = IDirectDraw4_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); @@ -1397,10 +1394,10 @@ static void test_surface_interface_mismatch(void) surface_desc.dwHeight = 480;
hr = IDirectDraw4_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 = IDirectDrawSurface4_QueryInterface(surface, &IID_IDirectDrawSurface3, (void **)&surface3); - ok(SUCCEEDED(hr), "Failed to QI IDirectDrawSurface3, hr %#x.\n", hr); + ok(SUCCEEDED(hr), "Failed to QI IDirectDrawSurface3, hr %#lx.\n", hr);
if (FAILED(IDirectDraw4_QueryInterface(ddraw, &IID_IDirect3D3, (void **)&d3d))) { @@ -1424,15 +1421,15 @@ static void test_surface_interface_mismatch(void) surface_desc.dwWidth = 640; surface_desc.dwHeight = 480; hr = IDirectDraw4_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 = IDirectDrawSurface4_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;
@@ -1445,7 +1442,7 @@ static void test_surface_interface_mismatch(void) viewport = create_viewport(device, 0, 0, 640, 480);
hr = IDirect3DViewport3_Clear2(viewport, 1, &clear_rect, D3DCLEAR_TARGET, 0xffff0000, 0.0f, 0); - 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(surface, 320, 240); ok(compare_color(color, 0x00ff0000, 1), "Got unexpected color 0x%08x.\n", color);
@@ -1471,7 +1468,7 @@ static void test_coop_level_threaded(void) create_window_thread(&p);
hr = IDirectDraw4_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); IDirectDraw4_Release(ddraw); @@ -1491,7 +1488,7 @@ static void test_depth_blit(const GUID *device_guid) { -1.0, -1.0, 0.50f, 0xff00ff00}, { 1.0, -1.0, 0.50f, 0xff00ff00}, }; - static const D3DCOLOR expected_colors[4][4] = + static const unsigned int expected_colors[4][4] = { {0x00ff0000, 0x00ff0000, 0x0000ff00, 0x0000ff00}, {0x00ff0000, 0x00ff0000, 0x0000ff00, 0x0000ff00}, @@ -1503,9 +1500,8 @@ static void test_depth_blit(const GUID *device_guid) IDirect3DDevice3 *device; IDirectDrawSurface4 *ds1, *ds2, *ds3, *rt; IDirect3DViewport3 *viewport; + unsigned int color, i, j; RECT src_rect, dst_rect; - unsigned int i, j; - D3DCOLOR color; HRESULT hr; IDirect3D3 *d3d; IDirectDraw4 *ddraw; @@ -1522,9 +1518,9 @@ static void test_depth_blit(const GUID *device_guid) }
hr = IDirect3DDevice3_GetDirect3D(device, &d3d); - ok(hr == D3D_OK, "Got unexpected hr %#x.\n", hr); + ok(hr == D3D_OK, "Got unexpected hr %#lx.\n", hr); hr = IDirect3D3_QueryInterface(d3d, &IID_IDirectDraw4, (void **)&ddraw); - ok(hr == D3D_OK, "Got unexpected hr %#x.\n", hr); + ok(hr == D3D_OK, "Got unexpected hr %#lx.\n", hr); IDirect3D3_Release(d3d);
ds1 = get_depth_stencil(device); @@ -1534,7 +1530,7 @@ static void test_depth_blit(const GUID *device_guid) memset(&ddsd_existing, 0, sizeof(ddsd_existing)); ddsd_existing.dwSize = sizeof(ddsd_existing); hr = IDirectDrawSurface4_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)) @@ -1543,70 +1539,70 @@ static void test_depth_blit(const GUID *device_guid) ddsd_new.dwHeight = ddsd_existing.dwHeight; U4(ddsd_new).ddpfPixelFormat = U4(ddsd_existing).ddpfPixelFormat; hr = IDirectDraw4_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 = IDirectDraw4_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); IDirectDraw4_Release(ddraw);
viewport = create_viewport(device, 0, 0, ddsd_existing.dwWidth, ddsd_existing.dwHeight); hr = IDirect3DDevice3_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 = IDirect3DDevice3_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 = IDirect3DDevice3_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 = IDirect3DViewport3_Clear2(viewport, 1, &d3drect, D3DCLEAR_ZBUFFER, 0, 0.0f, 0); - 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 = IDirectDrawSurface4_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 = IDirectDrawSurface4_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 = IDirectDrawSurface4_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 = IDirectDrawSurface4_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 = IDirectDrawSurface4_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 = IDirectDrawSurface4_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 = IDirect3DDevice3_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 = IDirectDrawSurface4_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 = IDirectDrawSurface4_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 = IDirectDrawSurface4_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 = IDirect3DDevice3_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 @@ -1615,13 +1611,13 @@ static void test_depth_blit(const GUID *device_guid) memset(&fx, 0, sizeof(fx)); fx.dwSize = sizeof(fx); hr = IDirectDrawSurface4_Blt(ds2, NULL, NULL, NULL, DDBLT_DEPTHFILL | DDBLT_WAIT, &fx); - ok(hr == D3D_OK, "Got unexpected hr %#x.\n", hr); + ok(hr == D3D_OK, "Got unexpected hr %#lx.\n", hr);
hr = IDirect3DDevice3_GetRenderTarget(device, &rt); - ok(hr == D3D_OK, "Got unexpected hr %#x.\n", hr); + ok(hr == D3D_OK, "Got unexpected hr %#lx.\n", hr);
hr = IDirect3DViewport3_Clear2(viewport, 1, &d3drect, D3DCLEAR_ZBUFFER | D3DCLEAR_TARGET, 0xffff0000, 1.0f, 0); - 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. */ @@ -1637,18 +1633,18 @@ static void test_depth_blit(const GUID *device_guid)
SetRect(&dst_rect, 0, 0, 320, 240); hr = IDirectDrawSurface4_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); IDirectDrawSurface4_Release(ds3); IDirectDrawSurface4_Release(ds2); IDirectDrawSurface4_Release(ds1);
hr = IDirect3DDevice3_BeginScene(device); - ok(hr == D3D_OK, "Got unexpected hr %#x.\n", hr); + ok(hr == D3D_OK, "Got unexpected hr %#lx.\n", hr); hr = IDirect3DDevice3_DrawPrimitive(device, D3DPT_TRIANGLESTRIP, D3DFVF_XYZ | D3DFVF_DIFFUSE, quad1, 4, 0); - ok(hr == D3D_OK, "Got unexpected hr %#x.\n", hr); + ok(hr == D3D_OK, "Got unexpected hr %#lx.\n", hr); hr = IDirect3DDevice3_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) { @@ -1682,7 +1678,7 @@ static void test_texture_load_ckey(void) ddraw = create_ddraw(); ok(!!ddraw, "Failed to create a ddraw object.\n"); hr = IDirectDraw4_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); @@ -1691,13 +1687,13 @@ static void test_texture_load_ckey(void) ddsd.dwWidth = 128; ddsd.ddsCaps.dwCaps = DDSCAPS_TEXTURE | DDSCAPS_SYSTEMMEMORY; hr = IDirectDraw4_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 = IDirectDraw4_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 = IDirectDrawSurface4_QueryInterface(src, &IID_IDirect3DTexture2, (void **)&src_tex); - ok(SUCCEEDED(hr) || hr == E_NOINTERFACE, "Failed to get Direct3DTexture2 interface, hr %#x.\n", hr); + ok(SUCCEEDED(hr) || hr == E_NOINTERFACE, "Failed to get Direct3DTexture2 interface, hr %#lx.\n", hr); if (FAILED(hr)) { /* 64 bit ddraw does not support d3d */ @@ -1708,50 +1704,50 @@ static void test_texture_load_ckey(void) return; } hr = IDirectDrawSurface4_QueryInterface(dst, &IID_IDirect3DTexture2, (void **)&dst_tex); - ok(SUCCEEDED(hr), "Failed to get Direct3DTexture2 interface, hr %#x.\n", hr); + ok(SUCCEEDED(hr), "Failed to get Direct3DTexture2 interface, hr %#lx.\n", hr);
/* No surface has a color key */ hr = IDirect3DTexture2_Load(dst_tex, src_tex); - ok(SUCCEEDED(hr), "Got unexpected hr %#x.\n", hr); + ok(SUCCEEDED(hr), "Got unexpected hr %#lx.\n", hr); ckey.dwColorSpaceLowValue = ckey.dwColorSpaceHighValue = 0xdeadbeef; hr = IDirectDrawSurface4_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 = IDirectDrawSurface4_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 = IDirect3DTexture2_Load(dst_tex, src_tex); - ok(SUCCEEDED(hr), "Got unexpected hr %#x.\n", hr); + ok(SUCCEEDED(hr), "Got unexpected hr %#lx.\n", hr); hr = IDirectDrawSurface4_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 = IDirectDrawSurface4_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 = IDirect3DTexture2_Load(dst_tex, src_tex); - ok(SUCCEEDED(hr), "Got unexpected hr %#x.\n", hr); + ok(SUCCEEDED(hr), "Got unexpected hr %#lx.\n", hr); hr = IDirectDrawSurface4_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 = IDirectDrawSurface4_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 = IDirectDrawSurface4_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 = IDirect3DTexture2_Load(dst_tex, src_tex); - ok(SUCCEEDED(hr), "Got unexpected hr %#x.\n", hr); + ok(SUCCEEDED(hr), "Got unexpected hr %#lx.\n", hr); hr = IDirectDrawSurface4_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);
IDirect3DTexture2_Release(dst_tex); IDirect3DTexture2_Release(src_tex); @@ -1804,109 +1800,109 @@ static void test_viewport_object(void) return; } hr = IDirect3DDevice3_GetDirect3D(device, &d3d); - ok(hr == DD_OK, "Got unexpected hr %#x.\n", hr); + ok(hr == DD_OK, "Got unexpected hr %#lx.\n", hr); hr = IDirect3D3_QueryInterface(d3d, &IID_IDirectDraw4, (void **)&ddraw); - ok(hr == DD_OK, "Got unexpected hr %#x.\n", hr); + ok(hr == DD_OK, "Got unexpected hr %#lx.\n", hr); old_d3d_ref = get_refcount((IUnknown *) d3d);
hr = IDirect3D3_CreateViewport(d3d, &viewport3, NULL); - ok(hr == DD_OK, "Got unexpected hr %#x.\n", hr); + ok(hr == DD_OK, "Got unexpected hr %#lx.\n", hr); ref = get_refcount((IUnknown *)viewport3); - 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 = IDirect3DViewport3_GetViewport(viewport3, &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 = IDirect3DViewport3_GetViewport(viewport3, &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 = IDirect3DViewport3_GetViewport(viewport3, &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 = IDirect3DViewport3_GetViewport(viewport3, &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 = IDirect3DViewport3_GetViewport2(viewport3, &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 = IDirect3DViewport3_GetViewport2(viewport3, &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(viewport3, &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 = IDirect3DViewport3_QueryInterface(viewport3, &IID_IDirect3DViewport, (void **)&viewport); - ok(hr == DD_OK, "Got unexpected hr %#x.\n", hr); + ok(hr == DD_OK, "Got unexpected 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 *)viewport3); - ok(ref == 2, "Got unexpected refcount %u.\n", ref); + ok(ref == 2, "Got unexpected refcount %lu.\n", ref); IDirect3DViewport_Release(viewport); viewport = NULL;
hr = IDirect3DViewport3_QueryInterface(viewport3, &IID_IDirect3DViewport3, (void **)&viewport2); - ok(hr == DD_OK, "Got unexpected hr %#x.\n", hr); + ok(hr == DD_OK, "Got unexpected 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 *)viewport3); - ok(ref == 2, "Got unexpected refcount %u.\n", ref); + ok(ref == 2, "Got unexpected refcount %lu.\n", ref); IDirect3DViewport3_Release(viewport2);
hr = IDirect3DViewport3_QueryInterface(viewport3, &IID_IUnknown, (void **)&unknown); - ok(hr == DD_OK, "Got unexpected hr %#x.\n", hr); + ok(hr == DD_OK, "Got unexpected hr %#lx.\n", hr); ref = get_refcount((IUnknown *)viewport3); - 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 = IDirect3DDevice3_DeleteViewport(device, NULL); - ok(hr == DDERR_INVALIDPARAMS, "Got unexpected hr %#x.\n", hr); + ok(hr == DDERR_INVALIDPARAMS, "Got unexpected hr %#lx.\n", hr); hr = IDirect3DDevice3_GetCurrentViewport(device, NULL); - ok(hr == D3DERR_NOCURRENTVIEWPORT, "Got unexpected hr %#x.\n", hr); + ok(hr == D3DERR_NOCURRENTVIEWPORT, "Got unexpected hr %#lx.\n", hr);
hr = IDirect3D3_CreateViewport(d3d, &another_vp, NULL); - ok(hr == DD_OK, "Got unexpected hr %#x.\n", hr); + ok(hr == DD_OK, "Got unexpected hr %#lx.\n", hr);
/* Setting a viewport not in the viewport list fails */ hr = IDirect3DDevice3_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 = IDirect3DDevice3_AddViewport(device, viewport3); - ok(hr == DD_OK, "Got unexpected hr %#x.\n", hr); + ok(hr == DD_OK, "Got unexpected hr %#lx.\n", hr); ref = get_refcount((IUnknown *) viewport3); - ok(ref == 2, "Got unexpected refcount %u.\n", ref); + ok(ref == 2, "Got unexpected refcount %lu.\n", ref); hr = IDirect3DDevice3_AddViewport(device, another_vp); - ok(hr == DD_OK, "Got unexpected hr %#x.\n", hr); + ok(hr == DD_OK, "Got unexpected hr %#lx.\n", hr); ref = get_refcount((IUnknown *) another_vp); - ok(ref == 2, "Got unexpected refcount %u.\n", ref); + ok(ref == 2, "Got unexpected refcount %lu.\n", ref);
test_vp = (IDirect3DViewport3 *) 0xbaadc0de; hr = IDirect3DDevice3_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 == (IDirect3DViewport3 *) 0xbaadc0de, "Got unexpected pointer %p.\n", test_vp);
hr = IDirect3DDevice3_SetCurrentViewport(device, viewport3); - ok(hr == DD_OK, "Got unexpected hr %#x.\n", hr); + ok(hr == DD_OK, "Got unexpected hr %#lx.\n", hr); ref = get_refcount((IUnknown *) viewport3); - 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 = IDirect3DDevice3_GetCurrentViewport(device, &test_vp); - ok(hr == DD_OK, "Got unexpected hr %#x.\n", hr); + ok(hr == DD_OK, "Got unexpected hr %#lx.\n", hr); ok(test_vp == viewport3, "Got unexpected viewport %p.\n", test_vp); ref = get_refcount((IUnknown *) viewport3); - ok(ref == 4, "Got unexpected refcount %u.\n", ref); + ok(ref == 4, "Got unexpected refcount %lu.\n", ref); if (test_vp) IDirect3DViewport3_Release(test_vp);
@@ -1914,42 +1910,42 @@ static void test_viewport_object(void)
/* Cannot set the viewport to NULL */ hr = IDirect3DDevice3_SetCurrentViewport(device, NULL); - ok(hr == DDERR_INVALIDPARAMS, "Got unexpected hr %#x.\n", hr); + ok(hr == DDERR_INVALIDPARAMS, "Got unexpected hr %#lx.\n", hr); test_vp = NULL; hr = IDirect3DDevice3_GetCurrentViewport(device, &test_vp); - ok(hr == DD_OK, "Got unexpected hr %#x.\n", hr); + ok(hr == DD_OK, "Got unexpected hr %#lx.\n", hr); ok(test_vp == viewport3, "Got unexpected viewport %p.\n", test_vp); if (test_vp) IDirect3DViewport3_Release(test_vp);
/* SetCurrentViewport properly releases the old viewport's reference */ hr = IDirect3DDevice3_SetCurrentViewport(device, another_vp); - ok(hr == DD_OK, "Got unexpected hr %#x.\n", hr); + ok(hr == DD_OK, "Got unexpected hr %#lx.\n", hr); ref = get_refcount((IUnknown *) viewport3); - 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);
/* Unlike device2::DeleteViewport, device3::DeleteViewport releases the * reference held by SetCurrentViewport */ hr = IDirect3DDevice3_DeleteViewport(device, another_vp); - ok(hr == DD_OK, "Got unexpected hr %#x.\n", hr); + ok(hr == DD_OK, "Got unexpected hr %#lx.\n", hr); ref = get_refcount((IUnknown *) another_vp); - ok(ref == 1, "Got unexpected refcount %u.\n", ref); + ok(ref == 1, "Got unexpected refcount %lu.\n", ref);
/* GetCurrentViewport still fails */ test_vp = NULL; hr = IDirect3DDevice3_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 doesn't have any surprises now */ hr = IDirect3DDevice3_SetCurrentViewport(device, viewport3); - ok(hr == DD_OK, "Got unexpected hr %#x.\n", hr); + ok(hr == DD_OK, "Got unexpected hr %#lx.\n", hr); ref = get_refcount((IUnknown *) viewport3); - ok(ref == 3, "Got unexpected refcount %u.\n", ref); + ok(ref == 3, "Got unexpected refcount %lu.\n", ref); ref = get_refcount((IUnknown *) another_vp); - ok(ref == 1, "Got unexpected refcount %u.\n", ref); + ok(ref == 1, "Got unexpected refcount %lu.\n", ref);
memset(&vp, 0, sizeof(vp)); memset(&vp, 0, sizeof(vp2)); @@ -1969,16 +1965,16 @@ static void test_viewport_object(void) vp2.dvClipWidth = 2.0f; vp2.dvClipHeight = 2.0f; hr = IDirect3DViewport3_SetViewport(viewport3, &vp); - ok(hr == DDERR_INVALIDPARAMS, "Got unexpected hr %#x.\n", hr); + ok(hr == DDERR_INVALIDPARAMS, "Got unexpected hr %#lx.\n", hr); hr = IDirect3DViewport3_SetViewport2(viewport3, &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 = IDirect3DViewport3_SetViewport(viewport3, &vp); - ok(hr == DD_OK, "Got unexpected hr %#x.\n", hr); + ok(hr == DD_OK, "Got unexpected hr %#lx.\n", hr); vp2.dwSize = sizeof(vp2); hr = IDirect3DViewport3_SetViewport2(viewport3, &vp2); - ok(hr == DD_OK, "Got unexpected hr %#x.\n", hr); + ok(hr == DD_OK, "Got unexpected hr %#lx.\n", hr);
vp2.dwSize = sizeof(vp2); vp2.dwX = 160; @@ -1992,12 +1988,12 @@ static void test_viewport_object(void) vp2.dvMinZ = 0.5f; vp2.dvMaxZ = 2.0f; hr = IDirect3DViewport3_SetViewport2(viewport3, &vp2); - ok(hr == DD_OK, "Got unexpected hr %#x.\n", hr); + ok(hr == DD_OK, "Got unexpected hr %#lx.\n", hr);
memset(&vp, 0xff, sizeof(vp)); vp.dwSize = sizeof(vp); hr = IDirect3DViewport3_GetViewport(viewport3, &vp); - ok(hr == DD_OK, "Got unexpected hr %#x.\n", hr); + ok(hr == DD_OK, "Got unexpected hr %#lx.\n", hr); ok(vp.dvMaxX == 4.5f && vp.dvMaxY == -1.75f && vp.dvScaleX == 192.0f && vp.dvScaleY == -240.0f && vp.dvMinZ == 0.0f && vp.dvMaxZ == 1.0f, "Got unexpected values %g, %g, %g, %g, %g, %g.\n", @@ -2011,12 +2007,12 @@ static void test_viewport_object(void) vp2.dvMaxZ = 0.5f;
hr = IDirect3DViewport3_SetViewport2(viewport3, &vp2); - ok(hr == DD_OK, "Got unexpected hr %#x.\n", hr); + ok(hr == DD_OK, "Got unexpected hr %#lx.\n", hr);
memset(&vp, 0xff, sizeof(vp)); vp.dwSize = sizeof(vp); hr = IDirect3DViewport3_GetViewport(viewport3, &vp); - ok(hr == DD_OK, "Got unexpected hr %#x.\n", hr); + ok(hr == DD_OK, "Got unexpected hr %#lx.\n", hr); ok(vp.dvMaxX == -3.0f && vp.dvMaxY == 1.75f && vp.dvScaleX == -320.0f && vp.dvScaleY == 180.0f && vp.dvMinZ == 0.0f && vp.dvMaxZ == 1.0f, "Got unexpected values %g, %g, %g, %g, %g, %g.\n", @@ -2026,12 +2022,12 @@ static void test_viewport_object(void) vp.dvMinZ = 0.5f; vp.dvMaxZ = 2.0f; hr = IDirect3DViewport3_SetViewport(viewport3, &vp); - ok(hr == DD_OK, "Got unexpected hr %#x.\n", hr); + ok(hr == DD_OK, "Got unexpected hr %#lx.\n", hr);
memset(&vp2, 0xff, sizeof(vp2)); vp2.dwSize = sizeof(vp2); hr = IDirect3DViewport3_GetViewport2(viewport3, &vp2); - ok(hr == DD_OK, "Got unexpected hr %#x.\n", hr); + ok(hr == DD_OK, "Got unexpected hr %#lx.\n", hr); ok(vp2.dvClipX == 0.75f && vp2.dvClipY == 1.0f && vp2.dvClipWidth == -1.5f && vp2.dvClipHeight == 2.0f && vp2.dvMinZ == 0.0f && vp2.dvMaxZ == 1.0f, "Got unexpected values %g, %g, %g, %g, %g, %g.\n", @@ -2045,12 +2041,12 @@ static void test_viewport_object(void) vp.dvMaxZ = 0.5f;
hr = IDirect3DViewport3_SetViewport(viewport3, &vp); - ok(hr == DD_OK, "Got unexpected hr %#x.\n", hr); + ok(hr == DD_OK, "Got unexpected hr %#lx.\n", hr);
memset(&vp2, 0xff, sizeof(vp2)); vp2.dwSize = sizeof(vp2); hr = IDirect3DViewport3_GetViewport2(viewport3, &vp2); - ok(hr == DD_OK, "Got unexpected hr %#x.\n", hr); + ok(hr == DD_OK, "Got unexpected hr %#lx.\n", hr); ok(vp2.dvClipX == -1.25f && vp2.dvClipY == -0.75f && vp2.dvClipWidth == 2.5f && vp2.dvClipHeight == -1.5f && vp2.dvMinZ == 0.0f && vp2.dvMaxZ == 1.0f, "Got unexpected values %g, %g, %g, %g, %g, %g.\n", @@ -2059,12 +2055,12 @@ static void test_viewport_object(void) /* Destroying the device removes the viewport and releases the reference */ IDirect3DDevice3_Release(device); ref = get_refcount((IUnknown *) viewport3); - ok(ref == 1, "Got unexpected refcount %u.\n", ref); + ok(ref == 1, "Got unexpected refcount %lu.\n", ref);
memset(&vp2, 0xff, sizeof(vp2)); vp2.dwSize = sizeof(vp2); hr = IDirect3DViewport3_GetViewport2(viewport3, &vp2); - ok(hr == DD_OK, "Got unexpected hr %#x.\n", hr); + ok(hr == DD_OK, "Got unexpected hr %#lx.\n", hr); ok(vp2.dvClipX == -1.25f && vp2.dvClipY == -0.75f && vp2.dvClipWidth == 2.5f && vp2.dvClipHeight == -1.5f && vp2.dvMinZ == 0.0f && vp2.dvMaxZ == 1.0f, "Got unexpected values %g, %g, %g, %g, %g, %g.\n", @@ -2072,15 +2068,15 @@ static void test_viewport_object(void)
vp.dwSize = sizeof(vp); hr = IDirect3DViewport3_SetViewport(viewport3, &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 = IDirect3DViewport3_SetViewport2(viewport3, &vp2); - ok(hr == D3DERR_VIEWPORTHASNODEVICE, "Got unexpected hr %#x.\n", hr); + ok(hr == D3DERR_VIEWPORTHASNODEVICE, "Got unexpected hr %#lx.\n", hr);
ref = IDirect3DViewport3_Release(another_vp); - ok(!ref, "Got unexpected refcount %u.\n", ref); + ok(!ref, "Got unexpected refcount %lu.\n", ref); ref = IDirect3DViewport3_Release(viewport3); - ok(!ref, "Got unexpected refcount %u.\n", ref); + ok(!ref, "Got unexpected refcount %lu.\n", ref); IDirect3D3_Release(d3d); DestroyWindow(window); IDirectDraw4_Release(ddraw); @@ -2101,14 +2097,12 @@ static void test_zenable(const GUID *device_guid) {{640.0f, 480.0f, 1.5f, 1.0f}, 0xff00ff00}, {{640.0f, 0.0f, 1.5f, 1.0f}, 0xff00ff00}, }; + unsigned int color, x, y, i, j; IDirect3DViewport3 *viewport; IDirect3DDevice3 *device; IDirectDrawSurface4 *rt; - D3DCOLOR color; HWND window; HRESULT hr; - UINT x, y; - UINT i, j;
window = create_window(); if (!(device = create_device_ex(window, DDSCL_NORMAL, device_guid))) @@ -2120,16 +2114,16 @@ static void test_zenable(const GUID *device_guid)
viewport = create_viewport(device, 0, 0, 640, 480); hr = IDirect3DDevice3_SetCurrentViewport(device, viewport); - ok(hr == D3D_OK, "Got unexpected hr %#x.\n", hr); + ok(hr == D3D_OK, "Got unexpected hr %#lx.\n", hr);
hr = IDirect3DDevice3_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 = IDirect3DViewport3_Clear2(viewport, 1, &clear_rect, D3DCLEAR_TARGET | D3DCLEAR_ZBUFFER, 0xffff0000, 0.0f, 0); - ok(hr == D3D_OK, "Got unexpected hr %#x.\n", hr); + ok(hr == D3D_OK, "Got unexpected hr %#lx.\n", hr);
hr = IDirect3DDevice3_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. */ @@ -2144,11 +2138,11 @@ static void test_zenable(const GUID *device_guid) }
hr = IDirect3DDevice3_BeginScene(device); - ok(hr == D3D_OK, "Got unexpected hr %#x.\n", hr); + ok(hr == D3D_OK, "Got unexpected hr %#lx.\n", hr); hr = IDirect3DDevice3_DrawPrimitive(device, D3DPT_TRIANGLESTRIP, D3DFVF_XYZRHW | D3DFVF_DIFFUSE, tquad, 4, 0); - ok(hr == D3D_OK, "Got unexpected hr %#x.\n", hr); + ok(hr == D3D_OK, "Got unexpected hr %#lx.\n", hr); hr = IDirect3DDevice3_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) { @@ -2192,8 +2186,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[] = { @@ -2215,13 +2209,12 @@ static void test_ck_rgba(const GUID *device_guid) IDirect3DTexture2 *texture; IDirect3DDevice3 *device; IDirectDrawSurface4 *rt; + unsigned int color, i; IDirectDraw4 *ddraw; IDirect3D3 *d3d; - D3DCOLOR color; HWND window; DDBLTFX fx; HRESULT hr; - UINT i;
window = create_window(); if (!(device = create_device_ex(window, DDSCL_NORMAL, device_guid))) @@ -2233,12 +2226,12 @@ static void test_ck_rgba(const GUID *device_guid)
viewport = create_viewport(device, 0, 0, 640, 480); hr = IDirect3DDevice3_SetCurrentViewport(device, viewport); - ok(hr == D3D_OK, "Got unexpected hr %#x.\n", hr); + ok(hr == D3D_OK, "Got unexpected hr %#lx.\n", hr);
hr = IDirect3DDevice3_GetDirect3D(device, &d3d); - ok(hr == D3D_OK, "Got unexpected hr %#x.\n", hr); + ok(hr == D3D_OK, "Got unexpected hr %#lx.\n", hr); hr = IDirect3D3_QueryInterface(d3d, &IID_IDirectDraw4, (void **)&ddraw); - ok(hr == D3D_OK, "Got unexpected hr %#x.\n", hr); + ok(hr == D3D_OK, "Got unexpected hr %#lx.\n", hr); IDirect3D3_Release(d3d);
memset(&surface_desc, 0, sizeof(surface_desc)); @@ -2259,44 +2252,44 @@ static void test_ck_rgba(const GUID *device_guid) surface_desc.ddckCKSrcBlt.dwColorSpaceLowValue = 0xff00ff00; surface_desc.ddckCKSrcBlt.dwColorSpaceHighValue = 0xff00ff00; hr = IDirectDraw4_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 = IDirectDrawSurface4_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 = IDirect3DDevice3_SetTexture(device, 0, texture); - ok(hr == D3D_OK, "Got unexpected hr %#x.\n", hr); + ok(hr == D3D_OK, "Got unexpected hr %#lx.\n", hr); hr = IDirect3DDevice3_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 = IDirect3DDevice3_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 = IDirect3DDevice3_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 = IDirect3DDevice3_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 = IDirect3DDevice3_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 = IDirectDrawSurface4_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 = IDirect3DViewport3_Clear2(viewport, 1, &clear_rect, D3DCLEAR_TARGET | D3DCLEAR_ZBUFFER, 0xffff0000, 1.0f, 0); - 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 = IDirect3DDevice3_BeginScene(device); - ok(hr == D3D_OK, "Got unexpected hr %#x.\n", hr); + ok(hr == D3D_OK, "Got unexpected hr %#lx.\n", hr); hr = IDirect3DDevice3_DrawPrimitive(device, D3DPT_TRIANGLESTRIP, D3DFVF_XYZRHW | D3DFVF_TEX1, &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 = IDirect3DDevice3_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), @@ -2305,14 +2298,14 @@ static void test_ck_rgba(const GUID *device_guid)
U5(fx).dwFillColor = 0xff0000ff; hr = IDirectDrawSurface4_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 = IDirect3DDevice3_BeginScene(device); - ok(hr == D3D_OK, "Got unexpected hr %#x.\n", hr); + ok(hr == D3D_OK, "Got unexpected hr %#lx.\n", hr); hr = IDirect3DDevice3_DrawPrimitive(device, D3DPT_TRIANGLESTRIP, D3DFVF_XYZRHW | D3DFVF_TEX1, &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 = IDirect3DDevice3_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. */ @@ -2352,8 +2345,8 @@ static void test_ck_default(void) IDirect3DTexture2 *texture; IDirect3DDevice3 *device; IDirectDraw4 *ddraw; + unsigned int color; IDirect3D3 *d3d; - D3DCOLOR color; DWORD value; HWND window; DDBLTFX fx; @@ -2368,17 +2361,17 @@ static void test_ck_default(void) }
hr = IDirect3DDevice3_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 = IDirect3D3_QueryInterface(d3d, &IID_IDirectDraw4, (void **)&ddraw); - ok(SUCCEEDED(hr), "Failed to get ddraw interface, hr %#x.\n", hr); + ok(SUCCEEDED(hr), "Failed to get ddraw interface, hr %#lx.\n", hr); IDirect3D3_Release(d3d);
hr = IDirect3DDevice3_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 = IDirect3DDevice3_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); @@ -2395,45 +2388,45 @@ static void test_ck_default(void) surface_desc.ddckCKSrcBlt.dwColorSpaceLowValue = 0x000000ff; surface_desc.ddckCKSrcBlt.dwColorSpaceHighValue = 0x000000ff; hr = IDirectDraw4_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 = IDirectDrawSurface4_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 = IDirect3DDevice3_SetTexture(device, 0, texture); - ok(SUCCEEDED(hr), "Failed to set texture, hr %#x.\n", hr); + ok(SUCCEEDED(hr), "Failed to set texture, hr %#lx.\n", hr);
memset(&fx, 0, sizeof(fx)); fx.dwSize = sizeof(fx); U5(fx).dwFillColor = 0x000000ff; hr = IDirectDrawSurface4_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 = IDirect3DViewport3_Clear2(viewport, 1, &clear_rect, D3DCLEAR_TARGET, 0xff00ff00, 1.0f, 0); - ok(SUCCEEDED(hr), "Failed to clear viewport, hr %#x.\n", hr); + ok(SUCCEEDED(hr), "Failed to clear viewport, hr %#lx.\n", hr); hr = IDirect3DDevice3_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 = IDirect3DDevice3_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 = IDirect3DDevice3_DrawPrimitive(device, D3DPT_TRIANGLESTRIP, D3DFVF_XYZRHW | D3DFVF_TEX1, &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 = IDirect3DDevice3_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 = IDirect3DViewport3_Clear2(viewport, 1, &clear_rect, D3DCLEAR_TARGET, 0xff00ff00, 1.0f, 0); - ok(SUCCEEDED(hr), "Failed to clear viewport, hr %#x.\n", hr); + ok(SUCCEEDED(hr), "Failed to clear viewport, hr %#lx.\n", hr); hr = IDirect3DDevice3_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 = IDirect3DDevice3_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 = IDirect3DDevice3_DrawPrimitive(device, D3DPT_TRIANGLESTRIP, D3DFVF_XYZRHW | D3DFVF_TEX1, &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 = IDirect3DDevice3_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 = IDirect3DDevice3_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);
@@ -2468,9 +2461,9 @@ static void test_ck_complex(void) return; } hr = IDirect3DDevice3_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 = IDirect3D3_QueryInterface(d3d, &IID_IDirectDraw4, (void **)&ddraw); - ok(SUCCEEDED(hr), "Failed to get ddraw interface, hr %#x.\n", hr); + ok(SUCCEEDED(hr), "Failed to get ddraw interface, hr %#lx.\n", hr); IDirect3D3_Release(d3d);
memset(&surface_desc, 0, sizeof(surface_desc)); @@ -2480,20 +2473,20 @@ static void test_ck_complex(void) surface_desc.dwWidth = 128; surface_desc.dwHeight = 128; hr = IDirectDraw4_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 = IDirectDrawSurface4_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 = IDirectDrawSurface4_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 = IDirectDrawSurface4_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; @@ -2501,20 +2494,20 @@ static void test_ck_complex(void) for (i = 0; i < 7; ++i) { hr = IDirectDrawSurface4_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 = IDirectDrawSurface4_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 = IDirectDrawSurface4_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 = IDirectDrawSurface4_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); @@ -2523,17 +2516,17 @@ static void test_ck_complex(void)
memset(&color_key, 0, sizeof(color_key)); hr = IDirectDrawSurface4_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 = IDirectDrawSurface4_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 = IDirectDrawSurface4_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); @@ -2541,46 +2534,46 @@ static void test_ck_complex(void) surface_desc.ddsCaps.dwCaps = DDSCAPS_PRIMARYSURFACE | DDSCAPS_COMPLEX | DDSCAPS_FLIP; U5(surface_desc).dwBackBufferCount = 1; hr = IDirectDraw4_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 = IDirectDrawSurface4_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 = IDirectDrawSurface4_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 = IDirectDrawSurface4_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 = IDirectDrawSurface4_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 = IDirectDrawSurface4_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 = IDirectDrawSurface4_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 = IDirectDrawSurface4_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 = IDirectDrawSurface4_Release(surface); - ok(!refcount, "Got unexpected refcount %u.\n", refcount); + ok(!refcount, "Got unexpected refcount %lu.\n", refcount); IDirectDraw4_Release(ddraw); refcount = IDirect3DDevice3_Release(device); - ok(!refcount, "Got unexpected refcount %u.\n", refcount); + ok(!refcount, "Got unexpected refcount %lu.\n", refcount); DestroyWindow(window); }
@@ -2602,13 +2595,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; @@ -2617,7 +2610,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); } } @@ -2626,7 +2619,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); } } @@ -2701,7 +2694,7 @@ static void test_surface_qi(void) ddraw = create_ddraw(); ok(!!ddraw, "Failed to create a ddraw object.\n"); hr = IDirectDraw4_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); @@ -2710,9 +2703,9 @@ static void test_surface_qi(void) surface_desc.dwWidth = 512; surface_desc.dwHeight = 512; hr = IDirectDraw4_CreateSurface(ddraw, &surface_desc, (IDirectDrawSurface4 **)0xdeadbeef, NULL); - ok(hr == E_INVALIDARG, "Got unexpected hr %#x.\n", hr); + ok(hr == E_INVALIDARG, "Got unexpected hr %#lx.\n", hr); hr = IDirectDraw4_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_IDirectDrawSurface4, tests, ARRAY_SIZE(tests));
@@ -2818,36 +2811,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 = IDirectDraw4_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 = IDirectDraw4_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 = IDirectDraw4_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 = IDirectDraw4_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 @@ -2855,53 +2848,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 = IDirectDraw4_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 = IDirectDraw4_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 = IDirectDraw4_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 = IDirectDraw4_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 = IDirectDraw4_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 = IDirectDraw4_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 = IDirectDraw4_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 = IDirectDraw4_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); @@ -2932,12 +2925,12 @@ static void test_window_style(void) SetRect(&fullscreen_rect, 0, 0, registry_mode.dmPelsWidth, registry_mode.dmPelsHeight);
hr = IDirectDraw4_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", @@ -2949,9 +2942,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"); @@ -2960,77 +2953,77 @@ static void test_window_style(void) ShowWindow(window, SW_HIDE);
hr = IDirectDraw4_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 = IDirectDraw4_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 = IDirectDraw4_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 = IDirectDraw4_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 = IDirectDraw4_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 = IDirectDraw4_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 = IDirectDraw4_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()); @@ -3038,20 +3031,20 @@ static void test_window_style(void) SetActiveWindow(window); ok(GetActiveWindow() == window, "Unexpected active window.\n"); hr = IDirectDraw4_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 = IDirectDraw4_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); @@ -3061,13 +3054,13 @@ static void test_window_style(void) ret = SetForegroundWindow(window2); ok(ret, "Failed to set foreground window.\n"); hr = IDirectDraw4_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", @@ -3076,46 +3069,46 @@ static void test_window_style(void) ret = SetForegroundWindow(window); ok(ret, "Failed to set foreground window.\n"); hr = IDirectDraw4_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 = IDirectDraw4_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 = IDirectDraw4_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 = IDirectDraw4_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); @@ -3136,15 +3129,15 @@ static void test_redundant_mode_set(void) ok(!!ddraw, "Failed to create a ddraw object.\n");
hr = IDirectDraw4_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 = IDirectDraw4_GetDisplayMode(ddraw, &surface_desc); - ok(SUCCEEDED(hr), "GetDisplayMode failed, hr %#x.\n", hr); + ok(SUCCEEDED(hr), "GetDisplayMode failed, hr %#lx.\n", hr);
hr = IDirectDraw4_SetDisplayMode(ddraw, surface_desc.dwWidth, surface_desc.dwHeight, U1(U4(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; @@ -3156,14 +3149,14 @@ static void test_redundant_mode_set(void)
hr = IDirectDraw4_SetDisplayMode(ddraw, surface_desc.dwWidth, surface_desc.dwHeight, U1(U4(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 = IDirectDraw4_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); } @@ -3313,10 +3306,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); @@ -3327,9 +3320,9 @@ static void test_coop_level_mode_set(void)
memset(¶m, 0, sizeof(param)); hr = IDirectDraw4_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 = IDirectDraw4_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) { @@ -3348,7 +3341,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"); @@ -3366,7 +3359,7 @@ static void test_coop_level_mode_set(void) 0, 0, 100, 100, 0, 0, 0, 0);
hr = IDirectDraw4_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), @@ -3378,12 +3371,12 @@ static void test_coop_level_mode_set(void) ddsd.ddsCaps.dwCaps = DDSCAPS_PRIMARYSURFACE;
hr = IDirectDraw4_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 = IDirectDrawSurface4_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); @@ -3396,16 +3389,16 @@ static void test_coop_level_mode_set(void) screen_size.cy = 0;
hr = IDirectDrawSurface4_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 = IDirectDrawSurface4_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); @@ -3413,10 +3406,10 @@ static void test_coop_level_mode_set(void) wine_dbgstr_rect(&r));
hr = IDirectDrawSurface4_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); IDirectDrawSurface4_Release(primary);
@@ -3426,12 +3419,12 @@ static void test_coop_level_mode_set(void) ddsd.ddsCaps.dwCaps = DDSCAPS_PRIMARYSURFACE;
hr = IDirectDraw4_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 = IDirectDrawSurface4_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); @@ -3444,16 +3437,16 @@ static void test_coop_level_mode_set(void) screen_size.cy = 0;
hr = IDirectDrawSurface4_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 = IDirectDrawSurface4_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); @@ -3472,7 +3465,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; @@ -3485,11 +3478,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 = IDirectDraw4_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 @@ -3511,7 +3504,7 @@ static void test_coop_level_mode_set(void) expect_messages = NULL;
hr = IDirectDraw4_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; @@ -3519,17 +3512,17 @@ static void test_coop_level_mode_set(void) screen_size.cy = 0;
hr = IDirectDrawSurface4_IsLost(primary); - ok(hr == DDERR_SURFACELOST, "Got unexpected hr %#x.\n", hr); + ok(hr == DDERR_SURFACELOST, "Got unexpected hr %#lx.\n", hr); hr = IDirectDraw4_RestoreDisplayMode(ddraw); - ok(SUCCEEDED(hr), "RestoreDisplayMode failed, hr %#x.\n", hr); + ok(SUCCEEDED(hr), "RestoreDisplayMode failed, hr %#lx.\n", hr); hr = IDirectDrawSurface4_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); @@ -3537,16 +3530,16 @@ static void test_coop_level_mode_set(void) wine_dbgstr_rect(&r));
hr = IDirectDrawSurface4_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); IDirectDrawSurface4_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); @@ -3554,12 +3547,12 @@ static void test_coop_level_mode_set(void) ddsd.ddsCaps.dwCaps = DDSCAPS_PRIMARYSURFACE;
hr = IDirectDraw4_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 = IDirectDrawSurface4_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); @@ -3567,17 +3560,17 @@ static void test_coop_level_mode_set(void) wine_dbgstr_rect(&r));
hr = IDirectDraw4_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 = IDirectDrawSurface4_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); IDirectDrawSurface4_Release(primary);
@@ -3587,12 +3580,12 @@ static void test_coop_level_mode_set(void) ddsd.ddsCaps.dwCaps = DDSCAPS_PRIMARYSURFACE;
hr = IDirectDraw4_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 = IDirectDrawSurface4_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); @@ -3605,18 +3598,18 @@ static void test_coop_level_mode_set(void) screen_size.cy = 0;
hr = IDirectDrawSurface4_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 = IDirectDrawSurface4_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), @@ -3628,27 +3621,27 @@ static void test_coop_level_mode_set(void) screen_size.cy = 0;
hr = IDirectDrawSurface4_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 = IDirectDrawSurface4_Restore(primary); - ok(hr == DDERR_WRONGMODE, "Got unexpected hr %#x.\n", hr); + ok(hr == DDERR_WRONGMODE, "Got unexpected hr %#lx.\n", hr); hr = IDirectDrawSurface4_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 = IDirectDrawSurface4_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); IDirectDrawSurface4_Release(primary);
@@ -3658,12 +3651,12 @@ static void test_coop_level_mode_set(void) ddsd.ddsCaps.dwCaps = DDSCAPS_PRIMARYSURFACE;
hr = IDirectDraw4_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 = IDirectDrawSurface4_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); @@ -3676,25 +3669,25 @@ static void test_coop_level_mode_set(void) screen_size.cy = 0;
hr = IDirectDrawSurface4_IsLost(primary); - ok(hr == DD_OK, "Got unexpected hr %#x.\n", hr); + ok(hr == DD_OK, "Got unexpected hr %#lx.\n", hr); hr = IDirectDraw4_RestoreDisplayMode(ddraw); - ok(SUCCEEDED(hr), "RestoreDisplayMode failed, hr %#x.\n", hr); + ok(SUCCEEDED(hr), "RestoreDisplayMode failed, hr %#lx.\n", hr); hr = IDirectDrawSurface4_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 = IDirectDrawSurface4_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); IDirectDrawSurface4_Release(primary);
@@ -3702,11 +3695,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); @@ -3714,12 +3707,12 @@ static void test_coop_level_mode_set(void) ddsd.ddsCaps.dwCaps = DDSCAPS_PRIMARYSURFACE;
hr = IDirectDraw4_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 = IDirectDrawSurface4_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); @@ -3730,17 +3723,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 = IDirectDraw4_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 = IDirectDrawSurface4_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); IDirectDrawSurface4_Release(primary);
@@ -3750,12 +3743,12 @@ static void test_coop_level_mode_set(void) ddsd.ddsCaps.dwCaps = DDSCAPS_PRIMARYSURFACE;
hr = IDirectDraw4_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 = IDirectDrawSurface4_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); @@ -3768,18 +3761,18 @@ static void test_coop_level_mode_set(void) screen_size.cy = 0;
hr = IDirectDrawSurface4_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 = IDirectDrawSurface4_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), @@ -3791,27 +3784,27 @@ static void test_coop_level_mode_set(void) screen_size.cy = 0;
hr = IDirectDrawSurface4_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 = IDirectDrawSurface4_Restore(primary); - ok(hr == DDERR_WRONGMODE, "Got unexpected hr %#x.\n", hr); + ok(hr == DDERR_WRONGMODE, "Got unexpected hr %#lx.\n", hr); hr = IDirectDrawSurface4_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 = IDirectDrawSurface4_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); IDirectDrawSurface4_Release(primary);
@@ -3821,12 +3814,12 @@ static void test_coop_level_mode_set(void) ddsd.ddsCaps.dwCaps = DDSCAPS_PRIMARYSURFACE;
hr = IDirectDraw4_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 = IDirectDrawSurface4_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); @@ -3839,25 +3832,25 @@ static void test_coop_level_mode_set(void) screen_size.cy = 0;
hr = IDirectDrawSurface4_IsLost(primary); - ok(hr == DD_OK, "Got unexpected hr %#x.\n", hr); + ok(hr == DD_OK, "Got unexpected hr %#lx.\n", hr); hr = IDirectDraw4_RestoreDisplayMode(ddraw); - ok(SUCCEEDED(hr), "RestoreDisplayMode failed, hr %#x.\n", hr); + ok(SUCCEEDED(hr), "RestoreDisplayMode failed, hr %#lx.\n", hr); hr = IDirectDrawSurface4_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 = IDirectDrawSurface4_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); IDirectDrawSurface4_Release(primary);
@@ -3865,11 +3858,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); @@ -3877,12 +3870,12 @@ static void test_coop_level_mode_set(void) ddsd.ddsCaps.dwCaps = DDSCAPS_PRIMARYSURFACE;
hr = IDirectDraw4_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 = IDirectDrawSurface4_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); IDirectDrawSurface4_Release(primary);
@@ -3892,9 +3885,9 @@ static void test_coop_level_mode_set(void)
/* Changing the coop level from EXCLUSIVE to NORMAL restores the screen resolution */ hr = IDirectDraw4_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; @@ -3902,13 +3895,13 @@ static void test_coop_level_mode_set(void) screen_size.cy = 0;
hr = IDirectDraw4_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);
@@ -3922,23 +3915,23 @@ static void test_coop_level_mode_set(void) ddsd.ddsCaps.dwCaps = DDSCAPS_PRIMARYSURFACE;
hr = IDirectDraw4_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 = IDirectDrawSurface4_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); IDirectDrawSurface4_Release(primary);
/* The screen restore is a property of DDSCL_EXCLUSIVE */ hr = IDirectDraw4_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 = IDirectDraw4_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); @@ -3946,23 +3939,23 @@ static void test_coop_level_mode_set(void) ddsd.ddsCaps.dwCaps = DDSCAPS_PRIMARYSURFACE;
hr = IDirectDraw4_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 = IDirectDrawSurface4_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); IDirectDrawSurface4_Release(primary);
hr = IDirectDraw4_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 = IDirectDraw4_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; @@ -3972,14 +3965,14 @@ static void test_coop_level_mode_set(void) screen_size2.cy = 0;
hr = IDirectDraw4_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); @@ -3995,17 +3988,17 @@ static void test_coop_level_mode_set(void) ddsd.ddsCaps.dwCaps = DDSCAPS_PRIMARYSURFACE;
hr = IDirectDraw4_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 = IDirectDrawSurface4_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); IDirectDrawSurface4_Release(primary);
ref = IDirectDraw4_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), @@ -4019,36 +4012,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 = IDirectDraw4_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 = IDirectDraw4_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 = IDirectDraw4_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 = IDirectDraw4_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"); @@ -4058,19 +4051,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 = IDirectDraw4_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"); @@ -4079,23 +4072,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 = IDirectDraw4_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 = IDirectDraw4_Release(ddraw); - ok(ref == 0, "The ddraw object was not properly freed: refcount %u.\n", ref); + ok(!ref, "Unexpected refcount %lu.\n", ref);
expect_messages = NULL; DestroyWindow(window); @@ -4123,10 +4116,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); @@ -4140,14 +4133,14 @@ static void test_coop_level_mode_set_multi(void) /* With just a single ddraw object, the display mode is restored on * release. */ 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);
ref = IDirectDraw4_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); @@ -4157,7 +4150,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); @@ -4165,21 +4158,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 = IDirectDraw4_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 = IDirectDraw4_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); @@ -4188,7 +4181,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); @@ -4196,21 +4189,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 = IDirectDraw4_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 = IDirectDraw4_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); @@ -4220,21 +4213,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 = IDirectDraw4_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 = IDirectDraw4_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); @@ -4244,7 +4237,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); @@ -4252,24 +4245,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 = IDirectDraw4_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 = IDirectDraw4_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 = IDirectDraw4_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); @@ -4278,28 +4271,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 = IDirectDraw4_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 = IDirectDraw4_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 = IDirectDraw4_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); @@ -4327,7 +4320,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)) @@ -4344,32 +4337,32 @@ static void test_coop_level_mode_set_multi(void) ddraw1 = create_ddraw(); ok(!!ddraw1, "Failed to create a ddraw object.\n"); hr = IDirectDraw4_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 = IDirectDraw4_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 = IDirectDraw4_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 = IDirectDraw4_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"); @@ -4379,19 +4372,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 = IDirectDraw4_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"); @@ -4400,23 +4393,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 = IDirectDraw4_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 = IDirectDraw4_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");
@@ -4424,24 +4417,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 = IDirectDraw4_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"); @@ -4453,27 +4446,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 = IDirectDraw4_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 = IDirectDraw4_Release(ddraw2); - ok(ref == 0, "The ddraw object was not properly freed: refcount %u.\n", ref); + ok(!ref, "Unexpected refcount %lu.\n", ref); ref = IDirectDraw4_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");
@@ -4484,25 +4477,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 = IDirectDraw4_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 = IDirectDraw4_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); @@ -4520,16 +4513,16 @@ static void test_initialize(void) ok(!!ddraw, "Failed to create a ddraw object.\n");
hr = IDirectDraw4_Initialize(ddraw, NULL); - ok(hr == DDERR_ALREADYINITIALIZED, "Initialize returned hr %#x.\n", hr); + ok(hr == DDERR_ALREADYINITIALIZED, "Initialize returned hr %#lx.\n", hr); IDirectDraw4_Release(ddraw);
CoInitialize(NULL); hr = CoCreateInstance(&CLSID_DirectDraw, NULL, CLSCTX_INPROC_SERVER, &IID_IDirectDraw4, (void **)&ddraw); - ok(SUCCEEDED(hr), "Failed to create IDirectDraw4 instance, hr %#x.\n", hr); + ok(SUCCEEDED(hr), "Failed to create IDirectDraw4 instance, hr %#lx.\n", hr); hr = IDirectDraw4_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 = IDirectDraw4_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); IDirectDraw4_Release(ddraw); CoUninitialize(); } @@ -4550,20 +4543,20 @@ static void test_coop_level_surf_create(void) ddsd.ddsCaps.dwCaps = DDSCAPS_PRIMARYSURFACE; surface = (void *)0xdeadbeef; hr = IDirectDraw4_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 = IDirectDraw4_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 = IDirectDraw4_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 = IDirectDraw4_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);
IDirectDraw4_Release(ddraw); @@ -4598,7 +4591,7 @@ static void test_vb_discard(void) }
hr = IDirect3DDevice3_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);
memset(&desc, 0, sizeof(desc)); desc.dwSize = sizeof(desc); @@ -4606,29 +4599,29 @@ static void test_vb_discard(void) desc.dwFVF = D3DFVF_XYZRHW; desc.dwNumVertices = vbsize; hr = IDirect3D3_CreateVertexBuffer(d3d, &desc, &buffer, 0, NULL); - ok(SUCCEEDED(hr), "Failed to create vertex buffer, hr %#x.\n", hr); + ok(SUCCEEDED(hr), "Failed to create vertex buffer, hr %#lx.\n", hr);
hr = IDirect3DVertexBuffer_Lock(buffer, DDLOCK_DISCARDCONTENTS, (void **)&data, NULL); - ok(SUCCEEDED(hr), "Failed to lock vertex buffer, hr %#x.\n", hr); + ok(SUCCEEDED(hr), "Failed to lock vertex buffer, hr %#lx.\n", hr); memcpy(data, quad, sizeof(quad)); hr = IDirect3DVertexBuffer_Unlock(buffer); - ok(SUCCEEDED(hr), "Failed to unlock vertex buffer, hr %#x.\n", hr); + ok(SUCCEEDED(hr), "Failed to unlock vertex buffer, hr %#lx.\n", hr);
hr = IDirect3DDevice3_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 = IDirect3DDevice3_DrawPrimitiveVB(device, D3DPT_TRIANGLESTRIP, buffer, 0, 4, 0); - ok(SUCCEEDED(hr), "Failed to draw, hr %#x.\n", hr); + ok(SUCCEEDED(hr), "Failed to draw, hr %#lx.\n", hr); hr = IDirect3DDevice3_EndScene(device); - ok(SUCCEEDED(hr), "Failed to end scene, hr %#x.\n", hr); + ok(SUCCEEDED(hr), "Failed to end scene, hr %#lx.\n", hr);
hr = IDirect3DVertexBuffer_Lock(buffer, DDLOCK_DISCARDCONTENTS, (void **)&data, NULL); - ok(SUCCEEDED(hr), "Failed to lock vertex buffer, hr %#x.\n", hr); + ok(SUCCEEDED(hr), "Failed to lock vertex buffer, hr %#lx.\n", hr); memset(data, 0xaa, sizeof(struct vec4) * vbsize); hr = IDirect3DVertexBuffer_Unlock(buffer); - ok(SUCCEEDED(hr), "Failed to unlock vertex buffer, hr %#x.\n", hr); + ok(SUCCEEDED(hr), "Failed to unlock vertex buffer, hr %#lx.\n", hr);
hr = IDirect3DVertexBuffer_Lock(buffer, DDLOCK_DISCARDCONTENTS, (void **)&data, NULL); - ok(SUCCEEDED(hr), "Failed to lock vertex buffer, hr %#x.\n", hr); + ok(SUCCEEDED(hr), "Failed to lock vertex buffer, hr %#lx.\n", hr); for (i = 0; i < sizeof(struct vec4) * vbsize; i++) { if (data[i] != 0xaa) @@ -4638,7 +4631,7 @@ static void test_vb_discard(void) } } hr = IDirect3DVertexBuffer_Unlock(buffer); - ok(SUCCEEDED(hr), "Failed to unlock vertex buffer, hr %#x.\n", hr); + ok(SUCCEEDED(hr), "Failed to unlock vertex buffer, hr %#lx.\n", hr);
IDirect3DVertexBuffer_Release(buffer); IDirect3D3_Release(d3d); @@ -4658,9 +4651,9 @@ static void test_coop_level_multi_window(void) ok(!!ddraw, "Failed to create a ddraw object.\n");
hr = IDirectDraw4_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 = IDirectDraw4_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");
@@ -4689,7 +4682,7 @@ static void test_draw_strided(void)
IDirectDrawSurface4 *rt; IDirect3DDevice3 *device; - D3DCOLOR color; + unsigned int color; HWND window; HRESULT hr; D3DDRAWPRIMITIVESTRIDEDDATA strided; @@ -4705,15 +4698,15 @@ static void test_draw_strided(void) }
hr = IDirect3DDevice3_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 = IDirect3DDevice3_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 = IDirect3DViewport3_Clear2(viewport, 1, &clear_rect, D3DCLEAR_TARGET, 0x00000000, 0.0f, 0); - ok(SUCCEEDED(hr), "Failed to clear the viewport, hr %#x.\n", hr); + ok(SUCCEEDED(hr), "Failed to clear the viewport, hr %#lx.\n", hr);
hr = IDirect3DDevice3_BeginScene(device); - ok(SUCCEEDED(hr), "Failed to begin scene, hr %#x.\n", hr); + ok(SUCCEEDED(hr), "Failed to begin scene, hr %#lx.\n", hr);
memset(&strided, 0x55, sizeof(strided)); strided.position.lpvData = position; @@ -4722,10 +4715,10 @@ static void test_draw_strided(void) strided.diffuse.dwStride = sizeof(*diffuse); hr = IDirect3DDevice3_DrawIndexedPrimitiveStrided(device, D3DPT_TRIANGLELIST, D3DFVF_XYZ | D3DFVF_DIFFUSE, &strided, 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 = IDirect3DDevice3_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); @@ -4854,18 +4847,16 @@ static void test_lighting(void) struct vertex *src_data1; IDirectDrawSurface4 *rt; IDirect3DLight *light; + unsigned int color, i; D3DLIGHT2 light_desc; IDirect3D3 *d3d; - D3DCOLOR color; ULONG refcount; - unsigned int i; HWND window; HRESULT hr; struct { struct vec4 position; - DWORD diffuse; - DWORD specular; + unsigned int diffuse, specular; } *dst_data;
@@ -4878,111 +4869,111 @@ static void test_lighting(void) }
hr = IDirect3DDevice3_GetDirect3D(device, &d3d); - ok(hr == D3D_OK, "Got unexpected hr %#x.\n", hr); + ok(hr == D3D_OK, "Got unexpected hr %#lx.\n", hr);
hr = IDirect3DDevice3_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 = IDirect3DDevice3_SetCurrentViewport(device, viewport); - ok(hr == D3D_OK, "Got unexpected hr %#x.\n", hr); + ok(hr == D3D_OK, "Got unexpected hr %#lx.\n", hr);
hr = IDirect3DViewport3_Clear2(viewport, 1, &clear_rect, D3DCLEAR_TARGET, 0xffffffff, 0.0f, 0); - ok(hr == D3D_OK, "Got unexpected hr %#x.\n", hr); + ok(hr == D3D_OK, "Got unexpected hr %#lx.\n", hr);
hr = IDirect3DDevice3_SetTransform(device, D3DTRANSFORMSTATE_WORLD, &mat); - ok(hr == D3D_OK, "Got unexpected hr %#x.\n", hr); + ok(hr == D3D_OK, "Got unexpected hr %#lx.\n", hr); hr = IDirect3DDevice3_SetTransform(device, D3DTRANSFORMSTATE_VIEW, &mat); - ok(hr == D3D_OK, "Got unexpected hr %#x.\n", hr); + ok(hr == D3D_OK, "Got unexpected hr %#lx.\n", hr); hr = IDirect3DDevice3_SetTransform(device, D3DTRANSFORMSTATE_PROJECTION, &mat); - ok(hr == D3D_OK, "Got unexpected hr %#x.\n", hr); + ok(hr == D3D_OK, "Got unexpected hr %#lx.\n", hr); hr = IDirect3DDevice3_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 = IDirect3DDevice3_SetRenderState(device, D3DRENDERSTATE_FOGENABLE, FALSE); - ok(hr == D3D_OK, "Got unexpected hr %#x.\n", hr); + ok(hr == D3D_OK, "Got unexpected hr %#lx.\n", hr); hr = IDirect3DDevice3_SetRenderState(device, D3DRENDERSTATE_STENCILENABLE, FALSE); - ok(hr == D3D_OK, "Got unexpected hr %#x.\n", hr); + ok(hr == D3D_OK, "Got unexpected hr %#lx.\n", hr); hr = IDirect3DDevice3_SetRenderState(device, D3DRENDERSTATE_CULLMODE, D3DCULL_NONE); - ok(hr == D3D_OK, "Got unexpected hr %#x.\n", hr); + ok(hr == D3D_OK, "Got unexpected hr %#lx.\n", hr);
hr = IDirect3DDevice3_BeginScene(device); - ok(hr == D3D_OK, "Got unexpected hr %#x.\n", hr); + ok(hr == D3D_OK, "Got unexpected hr %#lx.\n", hr);
memset(&vb_desc, 0, sizeof(vb_desc)); vb_desc.dwSize = sizeof(vb_desc); vb_desc.dwFVF = fvf; vb_desc.dwNumVertices = 2; hr = IDirect3D3_CreateVertexBuffer(d3d, &vb_desc, &src_vb1, 0, NULL); - ok(hr == D3D_OK, "Got unexpected hr %#x.\n", hr); + ok(hr == D3D_OK, "Got unexpected hr %#lx.\n", hr); vb_desc.dwSize = sizeof(vb_desc); vb_desc.dwFVF = nfvf; vb_desc.dwNumVertices = 2; hr = IDirect3D3_CreateVertexBuffer(d3d, &vb_desc, &src_vb2, 0, NULL); - ok(hr == D3D_OK, "Got unexpected hr %#x.\n", hr); + ok(hr == D3D_OK, "Got unexpected hr %#lx.\n", hr);
memset(&vb_desc, 0, sizeof(vb_desc)); vb_desc.dwSize = sizeof(vb_desc); vb_desc.dwFVF = D3DFVF_XYZRHW | D3DFVF_DIFFUSE | D3DFVF_SPECULAR; vb_desc.dwNumVertices = 4; hr = IDirect3D3_CreateVertexBuffer(d3d, &vb_desc, &dst_vb, 0, NULL); - ok(hr == D3D_OK, "Got unexpected hr %#x.\n", hr); + ok(hr == D3D_OK, "Got unexpected hr %#lx.\n", hr);
hr = IDirect3DVertexBuffer_Lock(src_vb1, 0, (void **)&src_data1, NULL); - ok(hr == D3D_OK, "Got unexpected hr %#x.\n", hr); + ok(hr == D3D_OK, "Got unexpected hr %#lx.\n", hr); memcpy(src_data1, unlitquad, sizeof(*src_data1)); memcpy(&src_data1[1], litquad, sizeof(*src_data1)); hr = IDirect3DVertexBuffer_Unlock(src_vb1); - ok(hr == D3D_OK, "Got unexpected hr %#x.\n", hr); + ok(hr == D3D_OK, "Got unexpected hr %#lx.\n", hr);
hr = IDirect3DVertexBuffer_Lock(src_vb2, 0, (void **)&src_data2, NULL); - ok(hr == D3D_OK, "Got unexpected hr %#x.\n", hr); + ok(hr == D3D_OK, "Got unexpected hr %#lx.\n", hr); memcpy(src_data2, unlitnquad, sizeof(*src_data2)); memcpy(&src_data2[1], litnquad, sizeof(*src_data2)); hr = IDirect3DVertexBuffer_Unlock(src_vb2); - ok(hr == D3D_OK, "Got unexpected hr %#x.\n", hr); + ok(hr == D3D_OK, "Got unexpected hr %#lx.\n", hr);
/* There is no D3DRENDERSTATE_LIGHTING on ddraw < 7. */ hr = IDirect3DDevice3_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 = IDirect3DVertexBuffer_ProcessVertices(dst_vb, D3DVOP_TRANSFORM, 0, 1, src_vb1, 0, device, 0); - ok(hr == D3D_OK, "Got unexpected hr %#x.\n", hr); + ok(hr == D3D_OK, "Got unexpected hr %#lx.\n", hr); hr = IDirect3DDevice3_DrawIndexedPrimitive(device, D3DPT_TRIANGLELIST, fvf, unlitquad, 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 = IDirect3DDevice3_SetRenderState(device, D3DRENDERSTATE_LIGHTING, TRUE); - ok(hr == D3D_OK, "Got unexpected hr %#x.\n", hr); + ok(hr == D3D_OK, "Got unexpected hr %#lx.\n", hr); hr = IDirect3DVertexBuffer_ProcessVertices(dst_vb, D3DVOP_TRANSFORM | D3DVOP_LIGHT, 1, 1, src_vb1, 1, device, 0); - ok(hr == D3D_OK, "Got unexpected hr %#x.\n", hr); + ok(hr == D3D_OK, "Got unexpected hr %#lx.\n", hr); hr = IDirect3DDevice3_DrawIndexedPrimitive(device, D3DPT_TRIANGLELIST, fvf, litquad, 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 = IDirect3DDevice3_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 = IDirect3DVertexBuffer_ProcessVertices(dst_vb, D3DVOP_TRANSFORM, 2, 1, src_vb2, 0, device, 0); - ok(hr == D3D_OK, "Got unexpected hr %#x.\n", hr); + ok(hr == D3D_OK, "Got unexpected hr %#lx.\n", hr); hr = IDirect3DDevice3_DrawIndexedPrimitive(device, D3DPT_TRIANGLELIST, nfvf, unlitnquad, 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 = IDirect3DDevice3_SetRenderState(device, D3DRENDERSTATE_LIGHTING, TRUE); - ok(hr == D3D_OK, "Got unexpected hr %#x.\n", hr); + ok(hr == D3D_OK, "Got unexpected hr %#lx.\n", hr); hr = IDirect3DVertexBuffer_ProcessVertices(dst_vb, D3DVOP_TRANSFORM | D3DVOP_LIGHT, 3, 1, src_vb2, 1, device, 0); - ok(hr == D3D_OK, "Got unexpected hr %#x.\n", hr); + ok(hr == D3D_OK, "Got unexpected hr %#lx.\n", hr); hr = IDirect3DDevice3_DrawIndexedPrimitive(device, D3DPT_TRIANGLELIST, nfvf, litnquad, 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 = IDirect3DDevice3_EndScene(device); - ok(hr == D3D_OK, "Got unexpected hr %#x.\n", hr); + ok(hr == D3D_OK, "Got unexpected hr %#lx.\n", hr);
hr = IDirect3DVertexBuffer_Lock(dst_vb, 0, (void **)&dst_data, NULL); - 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, 160, 360); ok(color == 0x00ff0000, "Unlit quad without normals has color 0x%08x.\n", color); @@ -5013,18 +5004,18 @@ static void test_lighting(void) "Unexpected specular color 0x%08x.\n", dst_data[3].specular);
hr = IDirect3DVertexBuffer_Unlock(dst_vb); - 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, 0.0f, 1.0f, 1.0f, 0.5f); hr = IDirect3DMaterial3_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 = IDirect3DDevice3_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 = IDirect3DDevice3_SetLightState(device, D3DLIGHTSTATE_AMBIENT, 0xff008000); - ok(hr == D3D_OK, "Got unexpected hr %#x.\n", hr); + ok(hr == D3D_OK, "Got unexpected hr %#lx.\n", hr);
hr = IDirect3D3_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; @@ -5034,75 +5025,75 @@ static void test_lighting(void) U4(light_desc.dcvColor).a = 0.5f; 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 = IDirect3DViewport3_AddLight(viewport, light); - ok(hr == D3D_OK, "Got unexpected hr %#x.\n", hr); + ok(hr == D3D_OK, "Got unexpected hr %#lx.\n", hr); hr = IDirect3DViewport3_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 = IDirect3DViewport3_AddLight(viewport2, light); - ok(hr == D3DERR_LIGHTHASVIEWPORT, "Got unexpected hr %#x.\n", hr); + ok(hr == D3DERR_LIGHTHASVIEWPORT, "Got unexpected hr %#lx.\n", hr); IDirect3DViewport3_Release(viewport2);
hr = IDirect3DViewport3_Clear2(viewport, 1, &clear_rect, D3DCLEAR_TARGET, 0xffffffff, 0.0f, 0); - ok(hr == D3D_OK, "Got unexpected hr %#x.\n", hr); + ok(hr == D3D_OK, "Got unexpected hr %#lx.\n", hr);
hr = IDirect3DDevice3_BeginScene(device); - ok(hr == D3D_OK, "Got unexpected hr %#x.\n", hr); + ok(hr == D3D_OK, "Got unexpected hr %#lx.\n", hr);
hr = IDirect3DDevice3_DrawIndexedPrimitive(device, D3DPT_TRIANGLELIST, nfvf, 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 = IDirect3DDevice3_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 == 0x00008000, "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 = IDirect3DViewport3_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 = IDirect3DViewport3_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 = IDirect3DVertexBuffer_Lock(src_vb2, 0, (void **)&src_data2, NULL); - ok(hr == D3D_OK, "Got unexpected hr %#x.\n", hr); + ok(hr == D3D_OK, "Got unexpected hr %#lx.\n", hr); memcpy(src_data2, tests[i].quad, sizeof(*src_data2)); hr = IDirect3DVertexBuffer_Unlock(src_vb2); - ok(hr == D3D_OK, "Got unexpected hr %#x.\n", hr); + ok(hr == D3D_OK, "Got unexpected hr %#lx.\n", hr);
hr = IDirect3DDevice3_SetTransform(device, D3DTRANSFORMSTATE_WORLD, tests[i].world_matrix); - ok(hr == D3D_OK, "Got unexpected hr %#x.\n", hr); + ok(hr == D3D_OK, "Got unexpected hr %#lx.\n", hr);
hr = IDirect3DViewport3_Clear2(viewport, 1, &clear_rect, D3DCLEAR_TARGET, 0xffffffff, 0.0f, 0); - ok(hr == D3D_OK, "Got unexpected hr %#x.\n", hr); + ok(hr == D3D_OK, "Got unexpected hr %#lx.\n", hr);
hr = IDirect3DDevice3_BeginScene(device); - ok(hr == D3D_OK, "Got unexpected hr %#x.\n", hr); + ok(hr == D3D_OK, "Got unexpected hr %#lx.\n", hr);
hr = IDirect3DVertexBuffer_ProcessVertices(dst_vb, D3DVOP_TRANSFORM | D3DVOP_LIGHT, 0, 1, src_vb2, 0, device, 0); - ok(hr == D3D_OK, "Got unexpected hr %#x.\n", hr); + ok(hr == D3D_OK, "Got unexpected hr %#lx.\n", hr); hr = IDirect3DDevice3_DrawIndexedPrimitive(device, D3DPT_TRIANGLELIST, nfvf, tests[i].quad, 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 = IDirect3DDevice3_EndScene(device); - ok(hr == D3D_OK, "Got unexpected hr %#x.\n", hr); + ok(hr == D3D_OK, "Got unexpected hr %#lx.\n", hr);
hr = IDirect3DVertexBuffer_Lock(dst_vb, 0, (void **)&dst_data, NULL); - 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 == tests[i].expected, "%s has color 0x%08x.\n", tests[i].message, color); @@ -5112,7 +5103,7 @@ static void test_lighting(void) "%s has specular color 0x%08x.\n", tests[i].message, dst_data[0].specular);
hr = IDirect3DVertexBuffer_Unlock(dst_vb); - ok(hr == D3D_OK, "Got unexpected hr %#x.\n", hr); + ok(hr == D3D_OK, "Got unexpected hr %#lx.\n", hr); }
IDirect3DVertexBuffer_Release(src_vb1); @@ -5120,13 +5111,13 @@ static void test_lighting(void) IDirect3DVertexBuffer_Release(dst_vb);
hr = IDirect3DViewport3_DeleteLight(viewport, light); - ok(hr == D3D_OK, "Got unexpected hr %#x.\n", hr); + ok(hr == D3D_OK, "Got unexpected hr %#lx.\n", hr); IDirect3DLight_Release(light); destroy_material(material); IDirect3DViewport3_Release(viewport); IDirectDrawSurface4_Release(rt); refcount = IDirect3DDevice3_Release(device); - ok(!refcount, "Device has %u references left.\n", refcount); + ok(!refcount, "Device has %lu references left.\n", refcount); IDirect3D3_Release(d3d); DestroyWindow(window); } @@ -5225,8 +5216,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[] = { @@ -5330,6 +5320,7 @@ static void test_specular_lighting(void) IDirect3DLight *light, *dummy_lights[64]; IDirect3DVertexBuffer *src_vb, *dst_vb; struct vertex *quad, *src_data; + unsigned int color, i, j, x, y; D3DVERTEXBUFFERDESC vb_desc; D3DMATERIALHANDLE mat_handle; IDirect3DViewport3 *viewport; @@ -5338,16 +5329,13 @@ static void test_specular_lighting(void) IDirectDrawSurface4 *rt; D3DLIGHT2 light_desc; IDirect3D3 *d3d; - D3DCOLOR color; ULONG refcount; HWND window; HRESULT hr; - unsigned int i, j, x, y; struct { struct vec4 position; - DWORD diffuse; - DWORD specular; + unsigned int diffuse, specular; } *dst_data; WORD *indices;
@@ -5387,25 +5375,25 @@ static void test_specular_lighting(void) }
hr = IDirect3DDevice3_GetDirect3D(device, &d3d); - ok(hr == D3D_OK, "Got unexpected hr %#x.\n", hr); + ok(hr == D3D_OK, "Got unexpected hr %#lx.\n", hr);
hr = IDirect3DDevice3_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 = IDirect3DDevice3_SetCurrentViewport(device, viewport); - ok(hr == D3D_OK, "Got unexpected hr %#x.\n", hr); + ok(hr == D3D_OK, "Got unexpected hr %#lx.\n", hr);
hr = IDirect3DDevice3_SetTransform(device, D3DTRANSFORMSTATE_WORLD, &mat); - ok(hr == D3D_OK, "Got unexpected hr %#x.\n", hr); + ok(hr == D3D_OK, "Got unexpected hr %#lx.\n", hr); hr = IDirect3DDevice3_SetTransform(device, D3DTRANSFORMSTATE_VIEW, &mat); - ok(hr == D3D_OK, "Got unexpected hr %#x.\n", hr); + ok(hr == D3D_OK, "Got unexpected hr %#lx.\n", hr); hr = IDirect3DDevice3_SetTransform(device, D3DTRANSFORMSTATE_PROJECTION, &mat); - ok(hr == D3D_OK, "Got unexpected hr %#x.\n", hr); + ok(hr == D3D_OK, "Got unexpected hr %#lx.\n", hr); hr = IDirect3DDevice3_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 = IDirect3DDevice3_SetRenderState(device, D3DRENDERSTATE_FOGENABLE, FALSE); - 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); @@ -5416,79 +5404,79 @@ static void test_specular_lighting(void) for (i = 0; i < ARRAY_SIZE(dummy_lights); ++i) { hr = IDirect3D3_CreateLight(d3d, &dummy_lights[i], NULL); - ok(hr == D3D_OK, "Got unexpected hr %#x.\n", hr); + ok(hr == D3D_OK, "Got unexpected hr %#lx.\n", hr); hr = IDirect3DViewport3_AddLight(viewport, dummy_lights[i]); - ok(hr == D3D_OK, "Got unexpected hr %#x.\n", hr); + ok(hr == D3D_OK, "Got unexpected hr %#lx.\n", hr); hr = IDirect3DLight_SetLight(dummy_lights[i], (D3DLIGHT *)&light_desc); - ok(hr == D3D_OK, "Got unexpected hr %#x.\n", hr); + ok(hr == D3D_OK, "Got unexpected hr %#lx.\n", hr); }
hr = IDirect3D3_CreateLight(d3d, &light, NULL); - ok(hr == D3D_OK, "Got unexpected hr %#x.\n", hr); + ok(hr == D3D_OK, "Got unexpected hr %#lx.\n", hr); hr = IDirect3DViewport3_AddLight(viewport, light); - ok(hr == D3D_OK, "Got unexpected hr %#x.\n", hr); + ok(hr == D3D_OK, "Got unexpected hr %#lx.\n", hr);
hr = IDirect3DDevice3_SetRenderState(device, D3DRENDERSTATE_SPECULARENABLE, TRUE); - ok(hr == D3D_OK, "Got unexpected hr %#x.\n", hr); + ok(hr == D3D_OK, "Got unexpected hr %#lx.\n", hr);
memset(&vb_desc, 0, sizeof(vb_desc)); vb_desc.dwSize = sizeof(vb_desc); vb_desc.dwFVF = fvf; vb_desc.dwNumVertices = ARRAY_SIZE(vertices); hr = IDirect3D3_CreateVertexBuffer(d3d, &vb_desc, &src_vb, 0, NULL); - ok(hr == D3D_OK, "Got unexpected hr %#x.\n", hr); + ok(hr == D3D_OK, "Got unexpected hr %#lx.\n", hr); hr = IDirect3DVertexBuffer_Lock(src_vb, 0, (void **)&src_data, NULL); - ok(hr == D3D_OK, "Got unexpected hr %#x.\n", hr); + ok(hr == D3D_OK, "Got unexpected hr %#lx.\n", hr); memcpy(src_data, vertices, sizeof(vertices)); hr = IDirect3DVertexBuffer_Unlock(src_vb); - ok(hr == D3D_OK, "Got unexpected hr %#x.\n", hr); + ok(hr == D3D_OK, "Got unexpected hr %#lx.\n", hr);
memset(&vb_desc, 0, sizeof(vb_desc)); vb_desc.dwSize = sizeof(vb_desc); vb_desc.dwFVF = D3DFVF_XYZRHW | D3DFVF_DIFFUSE | D3DFVF_SPECULAR; vb_desc.dwNumVertices = ARRAY_SIZE(vertices); hr = IDirect3D3_CreateVertexBuffer(d3d, &vb_desc, &dst_vb, 0, NULL); - 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) { tests[i].light->dwFlags = D3DLIGHT_ACTIVE; hr = IDirect3DLight_SetLight(light, (D3DLIGHT *)tests[i].light); - ok(hr == D3D_OK, "Got unexpected hr %#x.\n", hr); + ok(hr == D3D_OK, "Got unexpected hr %#lx.\n", hr);
hr = IDirect3DDevice3_SetRenderState(device, D3DRENDERSTATE_LOCALVIEWER, tests[i].local_viewer); - ok(hr == D3D_OK, "Got unexpected hr %#x.\n", hr); + ok(hr == D3D_OK, "Got unexpected hr %#lx.\n", hr);
material = create_specular_material(device, 1.0f, 1.0f, 1.0f, 0.5f, tests[i].specular_power); hr = IDirect3DMaterial3_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 = IDirect3DDevice3_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 = IDirect3DViewport3_Clear2(viewport, 1, &clear_rect, D3DCLEAR_TARGET, 0xffffffff, 0.0f, 0); - ok(hr == D3D_OK, "Got unexpected hr %#x.\n", hr); + ok(hr == D3D_OK, "Got unexpected hr %#lx.\n", hr);
hr = IDirect3DDevice3_BeginScene(device); - ok(hr == D3D_OK, "Got unexpected hr %#x.\n", hr); + ok(hr == D3D_OK, "Got unexpected hr %#lx.\n", hr);
hr = IDirect3DVertexBuffer_Lock(dst_vb, 0, (void **)&dst_data, NULL); - ok(hr == D3D_OK, "Got unexpected hr %#x.\n", hr); + ok(hr == D3D_OK, "Got unexpected hr %#lx.\n", hr); memset(dst_data, 0, sizeof(*dst_data) * ARRAY_SIZE(vertices)); hr = IDirect3DVertexBuffer_Unlock(dst_vb); - ok(hr == D3D_OK, "Got unexpected hr %#x.\n", hr); + ok(hr == D3D_OK, "Got unexpected hr %#lx.\n", hr);
hr = IDirect3DVertexBuffer_ProcessVertices(dst_vb, D3DVOP_TRANSFORM | D3DVOP_LIGHT, 0, ARRAY_SIZE(vertices), src_vb, 0, device, 0); - ok(hr == D3D_OK, "Got unexpected hr %#x.\n", hr); + ok(hr == D3D_OK, "Got unexpected hr %#lx.\n", hr); hr = IDirect3DDevice3_DrawIndexedPrimitive(device, D3DPT_TRIANGLELIST, fvf, quad, vertices_side * vertices_side, indices, indices_count, 0); - ok(hr == D3D_OK, "Got unexpected hr %#x.\n", hr); + ok(hr == D3D_OK, "Got unexpected hr %#lx.\n", hr);
hr = IDirect3DDevice3_EndScene(device); - ok(hr == D3D_OK, "Got unexpected hr %#x.\n", hr); + ok(hr == D3D_OK, "Got unexpected hr %#lx.\n", hr);
hr = IDirect3DVertexBuffer_Lock(dst_vb, 0, (void **)&dst_data, NULL); - ok(hr == D3D_OK, "Got unexpected hr %#x.\n", hr); + ok(hr == D3D_OK, "Got unexpected hr %#lx.\n", hr);
for (j = 0; j < tests[i].expected_count; ++j) { @@ -5504,7 +5492,7 @@ static void test_specular_lighting(void) tests[i].expected[j].color, j, dst_data[j].specular, i); } hr = IDirect3DVertexBuffer_Unlock(dst_vb); - ok(hr == D3D_OK, "Got unexpected hr %#x.\n", hr); + ok(hr == D3D_OK, "Got unexpected hr %#lx.\n", hr);
destroy_material(material); } @@ -5516,12 +5504,12 @@ static void test_specular_lighting(void) IDirect3DVertexBuffer_Release(src_vb);
hr = IDirect3DViewport3_DeleteLight(viewport, light); - ok(hr == D3D_OK, "Got unexpected hr %#x.\n", hr); + ok(hr == D3D_OK, "Got unexpected hr %#lx.\n", hr); IDirect3DLight_Release(light); IDirect3DViewport3_Release(viewport); IDirectDrawSurface4_Release(rt); refcount = IDirect3DDevice3_Release(device); - ok(!refcount, "Device has %u references left.\n", refcount); + ok(!refcount, "Device has %lu references left.\n", refcount); IDirect3D3_Release(d3d); DestroyWindow(window); heap_free(indices); @@ -5532,7 +5520,7 @@ static void test_clear_rect_count(void) { IDirectDrawSurface4 *rt; IDirect3DDevice3 *device; - D3DCOLOR color; + unsigned int color; HWND window; HRESULT hr; IDirect3DViewport3 *viewport; @@ -5547,19 +5535,19 @@ static void test_clear_rect_count(void) }
hr = IDirect3DDevice3_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 = IDirect3DDevice3_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 = IDirect3DViewport3_Clear2(viewport, 1, &clear_rect, D3DCLEAR_TARGET, 0x00ffffff, 0.0f, 0); - ok(SUCCEEDED(hr), "Failed to clear the viewport, hr %#x.\n", hr); + ok(SUCCEEDED(hr), "Failed to clear the viewport, hr %#lx.\n", hr); hr = IDirect3DViewport3_Clear2(viewport, 0, &clear_rect, D3DCLEAR_TARGET, 0x00ff0000, 0.0f, 0); - ok(SUCCEEDED(hr), "Failed to clear the viewport, hr %#x.\n", hr); + ok(SUCCEEDED(hr), "Failed to clear the viewport, hr %#lx.\n", hr); hr = IDirect3DViewport3_Clear2(viewport, 0, NULL, D3DCLEAR_TARGET, 0x0000ff00, 0.0f, 0); - ok(SUCCEEDED(hr), "Failed to clear the viewport, hr %#x.\n", hr); + ok(SUCCEEDED(hr), "Failed to clear the viewport, hr %#lx.\n", hr); hr = IDirect3DViewport3_Clear2(viewport, 1, NULL, D3DCLEAR_TARGET, 0x000000ff, 0.0f, 0); - ok(SUCCEEDED(hr), "Failed to clear the viewport, hr %#x.\n", hr); + ok(SUCCEEDED(hr), "Failed to clear the viewport, hr %#lx.\n", hr);
color = get_surface_color(rt, 320, 240); ok(compare_color(color, 0x00ffffff, 1) || broken(compare_color(color, 0x000000ff, 1)), @@ -5579,21 +5567,21 @@ static BOOL test_mode_restored(IDirectDraw4 *ddraw, HWND window) memset(&ddsd1, 0, sizeof(ddsd1)); ddsd1.dwSize = sizeof(ddsd1); hr = IDirectDraw4_GetDisplayMode(ddraw, &ddsd1); - ok(SUCCEEDED(hr), "GetDisplayMode failed, hr %#x.\n", hr); + ok(SUCCEEDED(hr), "GetDisplayMode failed, hr %#lx.\n", hr);
hr = IDirectDraw4_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 = IDirectDraw4_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 = IDirectDraw4_GetDisplayMode(ddraw, &ddsd2); - ok(SUCCEEDED(hr), "GetDisplayMode failed, hr %#x.\n", hr); + ok(SUCCEEDED(hr), "GetDisplayMode failed, hr %#lx.\n", hr); hr = IDirectDraw4_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; } @@ -5617,16 +5605,16 @@ static void test_coop_level_versions(void)
/* A failing ddraw1::SetCooperativeLevel call does not have an effect */ hr = IDirectDraw4_QueryInterface(ddraw4, &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(ddraw4, 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(ddraw4, window); ok(!restored, "Display mode restored after good ddraw1::SetCooperativeLevel call\n");
@@ -5636,10 +5624,10 @@ static void test_coop_level_versions(void) ddraw4 = create_ddraw(); ok(!!ddraw4, "Failed to create a ddraw object.\n"); hr = IDirectDraw4_QueryInterface(ddraw4, &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(ddraw4, window); ok(!restored, "Display mode restored after ddraw1::SetCooperativeLevel(SETFOCUSWINDOW) call\n");
@@ -5650,12 +5638,12 @@ static void test_coop_level_versions(void) ddraw4 = create_ddraw(); ok(!!ddraw4, "Failed to create a ddraw object.\n"); hr = IDirectDraw4_QueryInterface(ddraw4, &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(ddraw4, window); ok(!restored, "Display mode restored after good-bad ddraw1::SetCooperativeLevel() call sequence\n");
@@ -5666,14 +5654,14 @@ static void test_coop_level_versions(void) ddraw4 = create_ddraw(); ok(!!ddraw4, "Failed to create a ddraw object.\n"); hr = IDirectDraw4_QueryInterface(ddraw4, &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 = IDirectDraw4_SetCooperativeLevel(ddraw4, window, DDSCL_FULLSCREEN | DDSCL_EXCLUSIVE); - ok(SUCCEEDED(hr), "SetCooperativeLevel failed, hr %#x.\n", hr); + ok(SUCCEEDED(hr), "SetCooperativeLevel failed, hr %#lx.\n", hr); hr = IDirectDraw4_SetCooperativeLevel(ddraw4, 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(ddraw4, window); ok(!restored, "Display mode restored after ddraw1-ddraw4 SetCooperativeLevel() call sequence\n"); @@ -5684,10 +5672,10 @@ static void test_coop_level_versions(void) ddraw4 = create_ddraw(); ok(!!ddraw4, "Failed to create a ddraw object.\n"); hr = IDirectDraw4_QueryInterface(ddraw4, &IID_IDirectDraw, (void **)&ddraw); - ok(SUCCEEDED(hr), "QueryInterface failed, hr %#x.\n", hr); + ok(SUCCEEDED(hr), "QueryInterface failed, hr %#lx.\n", hr);
hr = IDirectDraw4_SetCooperativeLevel(ddraw4, 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); @@ -5695,7 +5683,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(ddraw4, window); ok(restored, "Display mode not restored after ddraw1::CreateSurface() call\n"); @@ -5712,12 +5700,11 @@ static void test_lighting_interface_versions(void) IDirect3DViewport3 *viewport; IDirect3DDevice3 *device; IDirectDrawSurface4 *rt; - D3DCOLOR color; + unsigned int color, i; HWND window; HRESULT hr; D3DMATERIALHANDLE mat_handle; DWORD rs; - unsigned int i; ULONG ref; static D3DVERTEX quad[] = { @@ -5779,7 +5766,7 @@ static void test_lighting_interface_versions(void) void *data; DWORD d3drs_lighting, d3drs_specular; DWORD draw_flags; - D3DCOLOR color; + unsigned int color; } tests[] = { @@ -5853,42 +5840,42 @@ static void test_lighting_interface_versions(void) }
hr = IDirect3DDevice3_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 = IDirect3DDevice3_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 = IDirect3DMaterial3_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 = IDirect3DDevice3_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 = IDirect3DDevice3_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);
hr = IDirect3DDevice3_GetRenderState(device, D3DRENDERSTATE_SPECULARENABLE, &rs); - ok(SUCCEEDED(hr), "Failed to get specularenable render state, hr %#x.\n", hr); - ok(rs == FALSE, "Initial D3DRENDERSTATE_SPECULARENABLE is %#x, expected FALSE.\n", rs); + ok(SUCCEEDED(hr), "Failed to get specularenable render state, hr %#lx.\n", hr); + ok(rs == FALSE, "Initial D3DRENDERSTATE_SPECULARENABLE is %#lx, expected FALSE.\n", rs);
for (i = 0; i < ARRAY_SIZE(tests); i++) { hr = IDirect3DViewport3_Clear2(viewport, 1, &clear_rect, D3DCLEAR_TARGET, 0xff202020, 0.0f, 0); - ok(SUCCEEDED(hr), "Failed to clear viewport, hr %#x.\n", hr); + ok(SUCCEEDED(hr), "Failed to clear viewport, hr %#lx.\n", hr);
hr = IDirect3DDevice3_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 = IDirect3DDevice3_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 = IDirect3DDevice3_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 = IDirect3DDevice3_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), @@ -5900,7 +5887,7 @@ static void test_lighting_interface_versions(void) destroy_viewport(device, viewport); IDirectDrawSurface4_Release(rt); ref = IDirect3DDevice3_Release(device); - ok(ref == 0, "Device not properly released, refcount %u.\n", ref); + ok(!ref, "Unexpected refcount %lu.\n", ref); DestroyWindow(window); }
@@ -5922,7 +5909,7 @@ static LRESULT CALLBACK activateapp_test_proc(HWND hwnd, UINT message, WPARAM wp activateapp_testdata.received = FALSE; hr = IDirectDraw4_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; @@ -5954,31 +5941,31 @@ static void test_coop_level_activateapp(void) SetForegroundWindow(window); activateapp_testdata.received = FALSE; hr = IDirectDraw4_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 = IDirectDraw4_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 = IDirectDraw4_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 = IDirectDraw4_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 = IDirectDraw4_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 = IDirectDraw4_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 = IDirectDraw4_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()); @@ -5987,10 +5974,10 @@ static void test_coop_level_activateapp(void) activateapp_testdata.window = window; activateapp_testdata.coop_level = DDSCL_EXCLUSIVE | DDSCL_FULLSCREEN; hr = IDirectDraw4_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 = IDirectDraw4_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 @@ -5998,9 +5985,9 @@ static void test_coop_level_activateapp(void) * WM_ACTIVATEAPP messages. */ activateapp_testdata.ddraw = NULL; hr = IDirectDraw4_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 = IDirectDraw4_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()); @@ -6009,7 +5996,7 @@ static void test_coop_level_activateapp(void) activateapp_testdata.window = window; activateapp_testdata.coop_level = DDSCL_NORMAL; hr = IDirectDraw4_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. */ @@ -6019,15 +6006,15 @@ static void test_coop_level_activateapp(void) U5(ddsd).dwBackBufferCount = 1; ddsd.ddsCaps.dwCaps = DDSCAPS_PRIMARYSURFACE | DDSCAPS_COMPLEX | DDSCAPS_FLIP; hr = IDirectDraw4_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); IDirectDrawSurface4_Release(surface);
/* Recover again, just to be sure. */ activateapp_testdata.ddraw = NULL; hr = IDirectDraw4_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 = IDirectDraw4_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)); @@ -6089,14 +6076,14 @@ static void test_texturemanage(void) ddraw = create_ddraw(); ok(!!ddraw, "Failed to create a ddraw object.\n"); hr = IDirectDraw4_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(&hal_caps, 0, sizeof(hal_caps)); hal_caps.dwSize = sizeof(hal_caps); memset(&hel_caps, 0, sizeof(hel_caps)); hel_caps.dwSize = sizeof(hel_caps); hr = IDirectDraw4_GetCaps(ddraw, &hal_caps, &hel_caps); - 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("Managed textures not supported, skipping managed texture test.\n"); @@ -6115,20 +6102,20 @@ static void test_texturemanage(void) ddsd.dwHeight = 4;
hr = IDirectDraw4_CreateSurface(ddraw, &ddsd, &surface, NULL); - ok(hr == tests[i].hr, "Got unexpected, hr %#x, case %u.\n", hr, i); + ok(hr == tests[i].hr, "Got unexpected, hr %#lx, case %u.\n", hr, i); if (FAILED(hr)) continue;
memset(&ddsd, 0, sizeof(ddsd)); ddsd.dwSize = sizeof(ddsd); hr = IDirectDrawSurface4_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);
ok(ddsd.ddsCaps.dwCaps == tests[i].caps_out, - "Input caps %#x, %#x, expected output caps %#x, got %#x, case %u.\n", + "Input caps %#lx, %#lx, expected output caps %#lx, got %#lx, case %u.\n", tests[i].caps_in, tests[i].caps2_in, tests[i].caps_out, ddsd.ddsCaps.dwCaps, i); ok(ddsd.ddsCaps.dwCaps2 == tests[i].caps2_out, - "Input caps %#x, %#x, expected output caps %#x, got %#x, case %u.\n", + "Input caps %#lx, %#lx, expected output caps %#lx, got %#lx, case %u.\n", tests[i].caps_in, tests[i].caps2_in, tests[i].caps2_out, ddsd.ddsCaps.dwCaps2, i);
IDirectDrawSurface4_Release(surface); @@ -6288,23 +6275,23 @@ static void test_block_formats_creation(void) }
hr = IDirect3DDevice3_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 = IDirect3D3_QueryInterface(d3d, &IID_IDirectDraw4, (void **) &ddraw); - ok(SUCCEEDED(hr), "Failed to get ddraw interface, hr %#x.\n", hr); + ok(SUCCEEDED(hr), "Failed to get ddraw interface, hr %#lx.\n", hr); IDirect3D3_Release(d3d);
hr = IDirect3DDevice3_EnumTextureFormats(device, test_block_formats_creation_cb, &supported_fmts); - ok(SUCCEEDED(hr), "Failed to enumerate texture formats %#x.\n", hr); + ok(SUCCEEDED(hr), "Got hr %#lx.\n", hr);
hr = IDirectDraw4_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 cleanup; hr = IDirectDraw4_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++) { for (j = 0; j < ARRAY_SIZE(formats); j++) @@ -6318,7 +6305,7 @@ static void test_block_formats_creation(void) memset(&hal_caps, 0, sizeof(hal_caps)); hal_caps.dwSize = sizeof(hal_caps); hr = IDirectDraw4_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);
mem = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, 2 * 2 * 16 + 1);
@@ -6376,7 +6363,7 @@ static void test_block_formats_creation(void) hr = IDirectDraw4_CreateSurface(ddraw, &ddsd, &surface, NULL); todo_wine_if (todo) ok(hr == expect_hr, - "Got unexpected hr %#x for format %s, resource type %s, size %ux%u, expected %#x.\n", + "Got unexpected hr %#lx for format %s, resource type %s, size %ux%u, expected %#lx.\n", hr, formats[i].name, types[j].name, w, h, expect_hr);
if (SUCCEEDED(hr)) @@ -6419,7 +6406,7 @@ static void test_block_formats_creation(void) ddsd.dwHeight = 8;
hr = IDirectDraw4_CreateSurface(ddraw, &ddsd, &surface, NULL); - ok(hr == user_mem_tests[j].hr, "Test %u: Got unexpected hr %#x, format %s.\n", j, hr, formats[i].name); + ok(hr == user_mem_tests[j].hr, "Test %u: Got unexpected hr %#lx, format %s.\n", j, hr, formats[i].name);
if (FAILED(hr)) continue; @@ -6427,15 +6414,15 @@ static void test_block_formats_creation(void) memset(&ddsd, 0, sizeof(ddsd)); ddsd.dwSize = sizeof(ddsd); hr = IDirectDrawSurface4_GetSurfaceDesc(surface, &ddsd); - ok(SUCCEEDED(hr), "Test %u: Failed to get surface desc, hr %#x.\n", j, hr); + ok(SUCCEEDED(hr), "Test %u: Failed to get surface desc, hr %#lx.\n", j, hr); ok(ddsd.dwFlags == (DDSD_CAPS | DDSD_WIDTH | DDSD_HEIGHT | DDSD_PIXELFORMAT | DDSD_LINEARSIZE), - "Test %u: Got unexpected flags %#x.\n", j, ddsd.dwFlags); + "Test %u: Got unexpected flags %#lx.\n", j, ddsd.dwFlags); if (user_mem_tests[j].flags & DDSD_LPSURFACE) - ok(U1(ddsd).dwLinearSize == ~0u, "Test %u: Got unexpected linear size %#x.\n", + ok(U1(ddsd).dwLinearSize == ~0u, "Test %u: Got unexpected linear size %#lx.\n", j, U1(ddsd).dwLinearSize); else ok(U1(ddsd).dwLinearSize == 2 * 2 * formats[i].block_size, - "Test %u: Got unexpected linear size %#x, expected %#x.\n", + "Test %u: Got unexpected linear size %#lx, expected %#x.\n", j, U1(ddsd).dwLinearSize, 2 * 2 * formats[i].block_size); IDirectDrawSurface4_Release(surface); } @@ -6512,16 +6499,16 @@ static void test_unsupported_formats(void) }
hr = IDirect3DDevice3_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 = IDirect3D3_QueryInterface(d3d, &IID_IDirectDraw4, (void **) &ddraw); - ok(SUCCEEDED(hr), "Failed to get ddraw interface, hr %#x.\n", hr); + ok(SUCCEEDED(hr), "Failed to get ddraw interface, hr %#lx.\n", hr); IDirect3D3_Release(d3d);
for (i = 0; i < ARRAY_SIZE(formats); i++) { struct format_support_check check = {&formats[i].fmt, FALSE}; hr = IDirect3DDevice3_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++) { @@ -6540,7 +6527,7 @@ static void test_unsupported_formats(void)
hr = IDirectDraw4_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; @@ -6548,7 +6535,7 @@ static void test_unsupported_formats(void) memset(&ddsd, 0, sizeof(ddsd)); ddsd.dwSize = sizeof(ddsd); hr = IDirectDrawSurface4_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; @@ -6560,7 +6547,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]);
IDirectDrawSurface4_Release(surface); @@ -6786,7 +6773,7 @@ static void test_rt_caps(const GUID *device_guid) ddraw = create_ddraw(); ok(!!ddraw, "Failed to create a ddraw object.\n"); hr = IDirectDraw4_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);
if (FAILED(IDirectDraw4_QueryInterface(ddraw, &IID_IDirect3D3, (void **)&d3d))) { @@ -6805,12 +6792,12 @@ static void test_rt_caps(const GUID *device_guid)
memset(palette_entries, 0, sizeof(palette_entries)); hr = IDirectDraw4_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 = IDirectDraw4_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) { @@ -6842,14 +6829,14 @@ static void test_rt_caps(const GUID *device_guid) ok(hr == expected_hr || (software_device && (surface_desc.ddsCaps.dwCaps & (DDSCAPS_VIDEOMEMORY | DDSCAPS_ZBUFFER)) == (DDSCAPS_VIDEOMEMORY | DDSCAPS_ZBUFFER) && hr == DDERR_UNSUPPORTED) || broken(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;
memset(&surface_desc, 0, sizeof(surface_desc)); surface_desc.dwSize = sizeof(surface_desc); hr = IDirectDrawSurface4_GetSurfaceDesc(surface, &surface_desc); - 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);
if ((caps_in & DDSCAPS_SYSTEMMEMORY) || (test_data[i].caps2_in & (DDSCAPS2_D3DTEXTUREMANAGE | DDSCAPS2_TEXTUREMANAGE)) || !(hal_caps.ddsCaps.dwCaps & DDSCAPS_VIDEOMEMORY)) @@ -6861,11 +6848,11 @@ static void test_rt_caps(const GUID *device_guid) && surface_desc.ddsCaps.dwCaps == (caps_in | DDSCAPS_SYSTEMMEMORY)) || (software_device && test_data[i].pf == &z_fmt && 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);
ok(surface_desc.ddsCaps.dwCaps2 == test_data[i].caps2_in, - "Got unexpected caps2 %#x, expected %#x, test %u, software_device %u.\n", + "Got unexpected caps2 %#lx, expected %#lx, test %u, software_device %u.\n", surface_desc.ddsCaps.dwCaps2, test_data[i].caps2_in, i, software_device);
hr = IDirect3D3_CreateDevice(d3d, device_guid, surface, &device, NULL); @@ -6873,13 +6860,13 @@ 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 = IDirectDrawSurface4_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); if (software_device) { /* _CreateDevice succeeds with software device, but the palette gets extra reference @@ -6890,10 +6877,10 @@ static void test_rt_caps(const GUID *device_guid) } hr = IDirect3D3_CreateDevice(d3d, device_guid, surface, &device, NULL); 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); } IDirectDrawSurface4_Release(surface); @@ -6905,10 +6892,10 @@ static void test_rt_caps(const GUID *device_guid) surface_desc.dwWidth = 640; surface_desc.dwHeight = 480; hr = IDirectDraw4_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 = IDirect3D3_CreateDevice(d3d, device_guid, surface, &device, 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); }
memset(&surface_desc, 0, sizeof(surface_desc)); @@ -6924,12 +6911,12 @@ static void test_rt_caps(const GUID *device_guid) surface_desc.dwWidth = 640; surface_desc.dwHeight = 480; hr = IDirectDraw4_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 = IDirect3DDevice3_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) expected_rt = rt; @@ -6937,24 +6924,24 @@ static void test_rt_caps(const GUID *device_guid) expected_rt = surface;
hr = IDirect3DDevice3_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);
IDirectDrawSurface4_Release(tmp); IDirectDrawSurface4_Release(rt); refcount = IDirect3DDevice3_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 = IDirectDrawSurface4_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); }
refcount = IDirectDrawPalette_Release(palette); - ok(!refcount, "Got unexpected refcount %u.\n", refcount); + ok(!refcount, "Got unexpected refcount %lu.\n", refcount); IDirect3D3_Release(d3d);
done: refcount = IDirectDraw4_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); }
@@ -7079,7 +7066,7 @@ static void test_primary_caps(void) for (i = 0; i < ARRAY_SIZE(test_data); ++i) { hr = IDirectDraw4_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); @@ -7089,23 +7076,23 @@ static void test_primary_caps(void) surface_desc.ddsCaps.dwCaps = test_data[i].caps_in; U5(surface_desc).dwBackBufferCount = test_data[i].back_buffer_count; hr = IDirectDraw4_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 = IDirectDrawSurface4_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);
IDirectDrawSurface4_Release(surface); }
refcount = IDirectDraw4_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); }
@@ -7194,7 +7181,7 @@ static void test_surface_lock(void) ddraw = create_ddraw(); ok(!!ddraw, "Failed to create a ddraw object.\n"); hr = IDirectDraw4_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 (FAILED(IDirectDraw4_QueryInterface(ddraw, &IID_IDirect3D3, (void **)&d3d))) { @@ -7230,21 +7217,21 @@ static void test_surface_lock(void) ddsd.ddsCaps.dwCaps2 = tests[i].caps2;
hr = IDirectDraw4_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 = IDirectDrawSurface4_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 = IDirectDrawSurface4_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 = IDirectDrawSurface4_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);
IDirectDrawSurface4_Release(surface); } @@ -7253,7 +7240,7 @@ done: if (d3d) IDirect3D3_Release(d3d); refcount = IDirectDraw4_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); }
@@ -7305,11 +7292,11 @@ static void test_surface_discard(void) return; } hr = IDirect3DDevice3_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 = IDirect3D3_QueryInterface(d3d, &IID_IDirectDraw4, (void **)&ddraw); - ok(SUCCEEDED(hr), "Failed to get ddraw interface, hr %#x.\n", hr); + ok(SUCCEEDED(hr), "Failed to get ddraw interface, hr %#lx.\n", hr); hr = IDirect3DDevice3_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); @@ -7319,34 +7306,34 @@ static void test_surface_discard(void) ddsd.dwWidth = 64; ddsd.dwHeight = 64; hr = IDirectDraw4_CreateSurface(ddraw, &ddsd, &surface, NULL); - ok(SUCCEEDED(hr), "Failed to create offscreen surface, hr %#x, case %u.\n", hr, i); + ok(SUCCEEDED(hr), "Failed to create offscreen surface, hr %#lx, case %u.\n", hr, i);
memset(&ddsd, 0, sizeof(ddsd)); ddsd.dwSize = sizeof(ddsd); hr = IDirectDrawSurface4_Lock(surface, 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); addr = ddsd.lpSurface; hr = IDirectDrawSurface4_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 = IDirectDrawSurface4_Lock(surface, NULL, &ddsd, DDLOCK_DISCARDCONTENTS, 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 = IDirectDrawSurface4_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 = IDirectDrawSurface4_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 = IDirectDrawSurface4_Lock(surface, NULL, &ddsd, DDLOCK_DISCARDCONTENTS, 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 = IDirectDrawSurface4_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);
IDirectDrawSurface4_Release(surface);
@@ -7369,11 +7356,10 @@ static void test_flip(void) IDirectDrawSurface4 *frontbuffer, *backbuffer1, *backbuffer2, *backbuffer3, *surface; DDSCAPS2 caps = {DDSCAPS_FLIP, 0, 0, {0}}; DDSURFACEDESC2 surface_desc; + unsigned int color, i; BOOL sysmem_primary; IDirectDraw4 *ddraw; DWORD expected_caps; - unsigned int i; - D3DCOLOR color; ULONG refcount; HWND window; HRESULT hr; @@ -7395,7 +7381,7 @@ static void test_flip(void) ok(!!ddraw, "Failed to create a ddraw object.\n");
hr = IDirectDraw4_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) { @@ -7418,93 +7404,93 @@ static void test_flip(void) surface_desc.dwHeight = 512; U5(surface_desc).dwBackBufferCount = 3; hr = IDirectDraw4_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 = IDirectDraw4_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 = IDirectDraw4_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 = IDirectDraw4_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;
memset(&surface_desc, 0, sizeof(surface_desc)); surface_desc.dwSize = sizeof(surface_desc); hr = IDirectDrawSurface4_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 = IDirectDrawSurface4_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 = IDirectDrawSurface4_GetSurfaceDesc(backbuffer1, &surface_desc); - ok(SUCCEEDED(hr), "%s: Failed to get surface desc, hr %#x.\n", test_data[i].name, hr); - ok(!U5(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(!U5(surface_desc).dwBackBufferCount, "%s: Got unexpected back buffer count %lu.\n", test_data[i].name, U5(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 = IDirectDrawSurface4_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 = IDirectDrawSurface4_GetSurfaceDesc(backbuffer2, &surface_desc); - ok(SUCCEEDED(hr), "%s: Failed to get surface desc, hr %#x.\n", test_data[i].name, hr); - ok(!U5(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(!U5(surface_desc).dwBackBufferCount, "%s: Got unexpected back buffer count %lu.\n", test_data[i].name, U5(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 = IDirectDrawSurface4_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 = IDirectDrawSurface4_GetSurfaceDesc(backbuffer3, &surface_desc); - ok(SUCCEEDED(hr), "%s: Failed to get surface desc, hr %#x.\n", test_data[i].name, hr); - ok(!U5(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(!U5(surface_desc).dwBackBufferCount, "%s: Got unexpected back buffer count %lu.\n", test_data[i].name, U5(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 = IDirectDrawSurface4_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); IDirectDrawSurface4_Release(surface);
hr = IDirectDraw4_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 = IDirectDrawSurface4_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 = IDirectDrawSurface4_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 = IDirectDraw4_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 = IDirectDrawSurface4_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 = IDirectDraw4_RestoreAllSurfaces(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); @@ -7513,19 +7499,19 @@ static void test_flip(void) surface_desc.dwWidth = 640; surface_desc.dwHeight = 480; hr = IDirectDraw4_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 = IDirectDrawSurface4_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); IDirectDrawSurface4_Release(surface);
hr = IDirectDrawSurface4_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 = IDirectDrawSurface4_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 = IDirectDrawSurface4_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 = IDirectDrawSurface4_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. Do it ourselves as a workaround. Unlike ddraw1 @@ -7535,7 +7521,7 @@ static void test_flip(void) fill_surface(backbuffer3, 0xff0000ff);
hr = IDirectDrawSurface4_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. */ @@ -7546,7 +7532,7 @@ static void test_flip(void) fill_surface(backbuffer3, 0xffff0000);
hr = IDirectDrawSurface4_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); @@ -7555,7 +7541,7 @@ static void test_flip(void) fill_surface(backbuffer3, 0xff00ff00);
hr = IDirectDrawSurface4_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); @@ -7564,7 +7550,7 @@ static void test_flip(void) fill_surface(backbuffer3, 0xff0000ff);
hr = IDirectDrawSurface4_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); @@ -7573,7 +7559,7 @@ static void test_flip(void) fill_surface(backbuffer1, 0xffff0000);
hr = IDirectDrawSurface4_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); @@ -7582,7 +7568,7 @@ static void test_flip(void) fill_surface(backbuffer2, 0xff00ff00);
hr = IDirectDrawSurface4_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); @@ -7596,7 +7582,7 @@ static void test_flip(void) }
refcount = IDirectDraw4_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); }
@@ -7635,7 +7621,7 @@ static void test_set_surface_desc(void) ddraw = create_ddraw(); ok(!!ddraw, "Failed to create a ddraw object.\n"); hr = IDirectDraw4_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; @@ -7650,130 +7636,130 @@ static void test_set_surface_desc(void) ddsd.ddsCaps.dwCaps = DDSCAPS_SYSTEMMEMORY | DDSCAPS_OFFSCREENPLAIN;
hr = IDirectDraw4_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);
reset_ddsd(&ddsd); ddsd.dwFlags = DDSD_LPSURFACE; ddsd.lpSurface = data; hr = IDirectDrawSurface4_SetSurfaceDesc(surface, &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 = IDirectDrawSurface4_SetSurfaceDesc(surface, &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 = IDirectDrawSurface4_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); ok(!(ddsd.dwFlags & DDSD_LPSURFACE), "DDSD_LPSURFACE is set.\n"); ok(ddsd.lpSurface == NULL, "lpSurface is %p, expected NULL.\n", ddsd.lpSurface);
hr = IDirectDrawSurface4_Lock(surface, 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 = IDirectDrawSurface4_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);
reset_ddsd(&ddsd); ddsd.dwFlags = DDSD_LPSURFACE; ddsd.lpSurface = data; hr = IDirectDrawSurface4_SetSurfaceDesc(surface, &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 = IDirectDrawSurface4_SetSurfaceDesc(surface, &ddsd, 0); - ok(hr == DDERR_INVALIDPARAMS, "Setting lpSurface=NULL returned %#x.\n", hr); + ok(hr == DDERR_INVALIDPARAMS, "Got hr %#lx.\n", hr);
hr = IDirectDrawSurface4_SetSurfaceDesc(surface, NULL, 0); - ok(hr == DDERR_INVALIDPARAMS, "SetSurfaceDesc with NULL desc returned %#x.\n", hr); + ok(hr == DDERR_INVALIDPARAMS, "Got hr %#lx.\n", hr);
hr = IDirectDrawSurface4_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); ok(ddsd.ddsCaps.dwCaps == (DDSCAPS_SYSTEMMEMORY | DDSCAPS_OFFSCREENPLAIN), - "Got unexpected caps %#x.\n", ddsd.ddsCaps.dwCaps); - ok(ddsd.ddsCaps.dwCaps2 == 0, "Got unexpected caps2 %#x.\n", 0); + "Got unexpected caps %#lx.\n", ddsd.ddsCaps.dwCaps); + ok(ddsd.ddsCaps.dwCaps2 == 0, "Got unexpected caps2 %#lx.\n", ddsd.ddsCaps.dwCaps2);
/* Setting the caps is an error. This also means the original description cannot be reapplied. */ hr = IDirectDrawSurface4_SetSurfaceDesc(surface, &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 = IDirectDrawSurface4_SetSurfaceDesc(surface, &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. Caps2 can be anything and is ignored too. */ ddsd.dwFlags = DDSD_CAPS | DDSD_LPSURFACE; ddsd.lpSurface = data; hr = IDirectDrawSurface4_SetSurfaceDesc(surface, &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 = IDirectDrawSurface4_SetSurfaceDesc(surface, &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; ddsd.ddsCaps.dwCaps2 = 0xdeadbeef; hr = IDirectDrawSurface4_SetSurfaceDesc(surface, &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 = IDirectDrawSurface4_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); ok(ddsd.ddsCaps.dwCaps == (DDSCAPS_SYSTEMMEMORY | DDSCAPS_OFFSCREENPLAIN), - "Got unexpected caps %#x.\n", ddsd.ddsCaps.dwCaps); - ok(ddsd.ddsCaps.dwCaps2 == 0, "Got unexpected caps2 %#x.\n", 0); + "Got unexpected caps %#lx.\n", ddsd.ddsCaps.dwCaps); + ok(ddsd.ddsCaps.dwCaps2 == 0, "Got unexpected caps2 %#lx.\n", ddsd.ddsCaps.dwCaps2);
/* 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 = IDirectDrawSurface4_SetSurfaceDesc(surface, &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 = IDirectDrawSurface4_SetSurfaceDesc(surface, &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 = IDirectDrawSurface4_SetSurfaceDesc(surface, &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 = IDirectDrawSurface4_GetSurfaceDesc(surface, &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 = IDirectDrawSurface4_SetSurfaceDesc(surface, &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 = IDirectDrawSurface4_SetSurfaceDesc(surface, &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 = IDirectDrawSurface4_SetSurfaceDesc(surface, &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 = IDirectDrawSurface4_SetSurfaceDesc(surface, &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 = IDirectDrawSurface4_SetSurfaceDesc(surface, &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 = IDirectDrawSurface4_GetSurfaceDesc(surface, &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. * @@ -7782,27 +7768,27 @@ static void test_set_surface_desc(void) U1(ddsd).lPitch = 4 * 4; ddsd.lpSurface = data; hr = IDirectDrawSurface4_SetSurfaceDesc(surface, &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 = IDirectDrawSurface4_SetSurfaceDesc(surface, &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 = IDirectDrawSurface4_SetSurfaceDesc(surface, &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 = IDirectDrawSurface4_SetSurfaceDesc(surface, &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 = IDirectDrawSurface4_SetSurfaceDesc(surface, &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 = IDirectDrawSurface4_SetSurfaceDesc(surface, &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; @@ -7810,13 +7796,13 @@ static void test_set_surface_desc(void) ddsd.dwWidth = 16; ddsd.lpSurface = data; hr = IDirectDrawSurface4_SetSurfaceDesc(surface, &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 = IDirectDrawSurface4_SetSurfaceDesc(surface, &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; @@ -7827,11 +7813,11 @@ static void test_set_surface_desc(void) U3(U4(ddsd).ddpfPixelFormat).dwGBitMask = 0x0000ff00; U4(U4(ddsd).ddpfPixelFormat).dwBBitMask = 0x000000ff; hr = IDirectDrawSurface4_SetSurfaceDesc(surface, &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 = IDirectDrawSurface4_SetSurfaceDesc(surface, &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); @@ -7839,12 +7825,12 @@ static void test_set_surface_desc(void) ddsd.ddckCKSrcBlt.dwColorSpaceLowValue = 0x00ff0000; ddsd.ddckCKSrcBlt.dwColorSpaceHighValue = 0x00ff0000; hr = IDirectDrawSurface4_SetSurfaceDesc(surface, &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 = IDirectDrawSurface4_SetSurfaceDesc(surface, &ddsd, 0); - ok(hr == DDERR_INVALIDPARAMS, "Setting ddckCKSrcBlt returned %#x.\n", hr); + ok(hr == DDERR_INVALIDPARAMS, "Got hr %#lx.\n", hr);
IDirectDrawSurface4_Release(surface);
@@ -7857,7 +7843,7 @@ static void test_set_surface_desc(void) ddsd.ddsCaps.dwCaps = DDSCAPS_TEXTURE | DDSCAPS_VIDEOMEMORY | DDSCAPS_COMPLEX | DDSCAPS_MIPMAP;
hr = IDirectDraw4_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)) { @@ -7868,13 +7854,13 @@ static void test_set_surface_desc(void) /* Changing surface desc for mipmap fails even without changing any * parameters. */ hr = IDirectDrawSurface4_SetSurfaceDesc(surface, &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 = IDirectDrawSurface4_SetSurfaceDesc(surface, &ddsd, 0); - ok(hr == DDERR_INVALIDSURFACETYPE, "Got unexpected hr %#x.\n", hr); + ok(hr == DDERR_INVALIDSURFACETYPE, "Got unexpected hr %#lx.\n", hr); IDirectDrawSurface4_Release(surface); }
@@ -7887,7 +7873,7 @@ static void test_set_surface_desc(void) ddsd.ddsCaps.dwCaps = DDSCAPS_TEXTURE | DDSCAPS_SYSTEMMEMORY | DDSCAPS_COMPLEX | DDSCAPS_MIPMAP;
hr = IDirectDraw4_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) { @@ -7895,11 +7881,11 @@ static void test_set_surface_desc(void) IDirectDrawSurface4 *surface2;
hr = IDirectDrawSurface4_GetAttachedSurface(surface, &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 = IDirectDrawSurface4_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; @@ -7908,7 +7894,7 @@ static void test_set_surface_desc(void) U1(ddsd).lPitch = 16 * 4; ddsd.lpSurface = data; hr = IDirectDrawSurface4_SetSurfaceDesc(surface, &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; @@ -7917,13 +7903,13 @@ static void test_set_surface_desc(void) U1(ddsd).lPitch = 8 * 4; ddsd.lpSurface = data; hr = IDirectDrawSurface4_SetSurfaceDesc(surface, &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 = IDirectDrawSurface4_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); IDirectDrawSurface4_Unlock(surface2, NULL); }
@@ -7934,12 +7920,12 @@ static void test_set_surface_desc(void) U1(ddsd).lPitch = 4 * 4; ddsd.lpSurface = data; hr = IDirectDrawSurface4_SetSurfaceDesc(surface2, &ddsd, 0); - ok(hr == DD_OK, "Got unexpected hr %#x.\n", hr); + ok(hr == DD_OK, "Got unexpected hr %#lx.\n", hr);
reset_ddsd(&ddsd); /* Does not crash now after setting user memory for the level. */ hr = IDirectDrawSurface4_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); ok(ddsd.lpSurface == data, "Got unexpected lpSurface %p.\n", ddsd.lpSurface); IDirectDrawSurface4_Unlock(surface2, NULL);
@@ -7950,7 +7936,7 @@ static void test_set_surface_desc(void) U1(ddsd).lPitch = 16 * 4; ddsd.lpSurface = data; hr = IDirectDrawSurface4_SetSurfaceDesc(surface2, &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);
IDirectDrawSurface4_Release(surface2); IDirectDrawSurface4_Release(surface); @@ -7965,10 +7951,10 @@ static void test_set_surface_desc(void) U1(ddsd).lPitch = 8 * 4; ddsd.ddsCaps.dwCaps = DDSCAPS_SYSTEMMEMORY | DDSCAPS_OFFSCREENPLAIN; hr = IDirectDraw4_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 = IDirectDrawSurface4_SetSurfaceDesc(surface, &ddsd, 0); - ok(hr == DDERR_INVALIDCAPS, "Got unexpected hr %#x.\n", hr); + ok(hr == DDERR_INVALIDCAPS, "Got unexpected hr %#lx.\n", hr);
reset_ddsd(&ddsd); ddsd.dwFlags = DDSD_WIDTH | DDSD_HEIGHT; @@ -7976,7 +7962,7 @@ static void test_set_surface_desc(void) ddsd.dwHeight = 8; /* Cannot reset lpSurface. */ hr = IDirectDrawSurface4_SetSurfaceDesc(surface, &ddsd, 0); - ok(hr == DDERR_INVALIDPARAMS, "Got unexpected hr %#x.\n", hr); + ok(hr == DDERR_INVALIDPARAMS, "Got unexpected hr %#lx.\n", hr);
reset_ddsd(&ddsd); ddsd.dwFlags = DDSD_WIDTH | DDSD_HEIGHT | DDSD_LPSURFACE | DDSD_PITCH; @@ -7986,7 +7972,7 @@ static void test_set_surface_desc(void) U1(ddsd).lPitch = 8 * 4; /* Can change the parameters of surface created with DDSD_LPSURFACE. */ hr = IDirectDrawSurface4_SetSurfaceDesc(surface, &ddsd, 0); - ok(hr == DD_OK, "Got unexpected hr %#x.\n", hr); + ok(hr == DD_OK, "Got unexpected hr %#lx.\n", hr);
IDirectDrawSurface4_Release(surface);
@@ -8013,7 +7999,7 @@ static void test_set_surface_desc(void) }
hr = IDirectDraw4_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", @@ -8027,17 +8013,17 @@ static void test_set_surface_desc(void) hr = IDirectDrawSurface4_SetSurfaceDesc(surface, &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 = IDirectDrawSurface4_SetSurfaceDesc(surface, &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); }
@@ -8046,31 +8032,30 @@ static void test_set_surface_desc(void)
done: ref = IDirectDraw4_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; IDirectDraw4 *ddraw; HWND window; HRESULT hr; DDSURFACEDESC2 ddsd; IDirectDrawSurface4 *surface; - 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 = IDirectDraw4_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; @@ -8084,17 +8069,17 @@ static void test_user_memory_getdc(void) U4(U4(ddsd).ddpfPixelFormat).dwBBitMask = 0x000000ff; ddsd.ddsCaps.dwCaps = DDSCAPS_SYSTEMMEMORY | DDSCAPS_OFFSCREENPLAIN; hr = IDirectDraw4_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);
memset(data, 0xaa, sizeof(data)); reset_ddsd(&ddsd); ddsd.dwFlags = DDSD_LPSURFACE; ddsd.lpSurface = data; hr = IDirectDrawSurface4_SetSurfaceDesc(surface, &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 = IDirectDrawSurface4_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); bitmap = GetCurrentObject(dc, OBJ_BITMAP); ok(!!bitmap, "Failed to get bitmap.\n"); size = GetObjectA(bitmap, sizeof(dib), &dib); @@ -8103,7 +8088,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 = IDirectDrawSurface4_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);
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]); @@ -8114,15 +8099,15 @@ static void test_user_memory_getdc(void) ddsd.dwHeight = 8; U1(ddsd).lPitch = sizeof(*data); hr = IDirectDrawSurface4_SetSurfaceDesc(surface, &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 = IDirectDrawSurface4_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); BitBlt(dc, 0, 0, 4, 8, NULL, 0, 0, BLACKNESS); BitBlt(dc, 1, 1, 2, 2, NULL, 0, 0, WHITENESS); hr = IDirectDrawSurface4_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);
for (y = 0; y < 4; y++) { @@ -8147,7 +8132,7 @@ static void test_user_memory_getdc(void)
IDirectDrawSurface4_Release(surface); ref = IDirectDraw4_Release(ddraw); - ok(ref == 0, "Ddraw object not properly released, refcount %u.\n", ref); + ok(!ref, "Unexpected refcount %lu.\n", ref); DestroyWindow(window); }
@@ -8165,7 +8150,7 @@ static void test_sysmem_overlay(void) ok(!!ddraw, "Failed to create a ddraw object.\n");
hr = IDirectDraw4_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; @@ -8179,10 +8164,10 @@ static void test_sysmem_overlay(void) U3(U4(ddsd).ddpfPixelFormat).dwGBitMask = 0x0000ff00; U4(U4(ddsd).ddpfPixelFormat).dwBBitMask = 0x000000ff; hr = IDirectDraw4_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 = IDirectDraw4_Release(ddraw); - ok(ref == 0, "Ddraw object not properly released, refcount %u.\n", ref); + ok(!ref, "Unexpected refcount %lu.\n", ref); DestroyWindow(window); }
@@ -8210,7 +8195,7 @@ static void test_primary_palette(void) return; } hr = IDirectDraw4_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); @@ -8218,22 +8203,22 @@ static void test_primary_palette(void) surface_desc.ddsCaps.dwCaps = DDSCAPS_PRIMARYSURFACE | DDSCAPS_COMPLEX | DDSCAPS_FLIP; U5(surface_desc).dwBackBufferCount = 1; hr = IDirectDraw4_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 = IDirectDrawSurface4_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 = IDirectDraw4_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 = IDirectDrawSurface4_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 @@ -8246,99 +8231,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 = IDirectDraw4_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 = IDirectDrawSurface4_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 = IDirectDrawSurface4_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 = IDirectDrawSurface4_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 = IDirectDrawSurface4_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 = IDirectDrawSurface4_GetPalette(primary, &tmp); - ok(hr == DDERR_NOPALETTEATTACHED, "Got unexpected hr %#x.\n", hr); + ok(hr == DDERR_NOPALETTEATTACHED, "Got unexpected hr %#lx.\n", hr);
hr = IDirectDrawSurface4_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 = IDirectDrawSurface4_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(U4(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(U4(surface_desc).ddpfPixelFormat).dwRGBBitCount == 8, "Got unexpected bit count %lu.\n", U1(U4(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 = IDirectDrawSurface4_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(U4(surface_desc).ddpfPixelFormat).dwRGBBitCount == 32 || U1(U4(surface_desc).ddpfPixelFormat).dwRGBBitCount == 24, - "Got unexpected bit count %u.\n", U1(U4(surface_desc).ddpfPixelFormat).dwRGBBitCount); + "Got unexpected bit count %lu.\n", U1(U4(surface_desc).ddpfPixelFormat).dwRGBBitCount);
hr = IDirectDrawSurface4_IsLost(primary); - ok(hr == DDERR_SURFACELOST, "Got unexpected hr %#x.\n", hr); + ok(hr == DDERR_SURFACELOST, "Got unexpected hr %#lx.\n", hr); hr = IDirectDrawSurface4_Restore(primary); - ok(hr == DDERR_WRONGMODE, "Got unexpected hr %#x.\n", hr); + ok(hr == DDERR_WRONGMODE, "Got unexpected hr %#lx.\n", hr); hr = IDirectDrawSurface4_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 = IDirectDrawSurface4_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(U4(surface_desc).ddpfPixelFormat).dwRGBBitCount == 32 || U1(U4(surface_desc).ddpfPixelFormat).dwRGBBitCount == 24, - "Got unexpected bit count %u.\n", U1(U4(surface_desc).ddpfPixelFormat).dwRGBBitCount); + "Got unexpected bit count %lu.\n", U1(U4(surface_desc).ddpfPixelFormat).dwRGBBitCount);
done: refcount = IDirectDrawSurface4_Release(backbuffer); - ok(refcount == 1, "Got unexpected refcount %u.\n", refcount); + ok(refcount == 1, "Got unexpected refcount %lu.\n", refcount); refcount = IDirectDrawSurface4_Release(primary); - ok(!refcount, "Got unexpected refcount %u.\n", refcount); + ok(!refcount, "Got unexpected refcount %lu.\n", refcount); refcount = IDirectDraw4_Release(ddraw); - ok(!refcount, "Got unexpected refcount %u.\n", refcount); + ok(!refcount, "Got unexpected refcount %lu.\n", refcount); DestroyWindow(window); }
@@ -8368,7 +8353,7 @@ static void test_surface_attachment(void) ddraw = create_ddraw(); ok(!!ddraw, "Failed to create a ddraw object.\n"); hr = IDirectDraw4_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); @@ -8378,14 +8363,14 @@ static void test_surface_attachment(void) surface_desc.dwWidth = 128; surface_desc.dwHeight = 128; hr = IDirectDraw4_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 = IDirectDrawSurface4_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 = IDirectDrawSurface4_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 = IDirectDrawSurface4_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; IDirectDrawSurface4_EnumAttachedSurfaces(surface1, &surface_count, surface_counter); @@ -8404,20 +8389,20 @@ static void test_surface_attachment(void) surface_desc.dwWidth = 16; surface_desc.dwHeight = 16; hr = IDirectDraw4_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 = IDirectDrawSurface4_AddAttachedSurface(surface1, surface4); - ok(hr == DDERR_CANNOTATTACHSURFACE, "Got unexpected hr %#x.\n", hr); + ok(hr == DDERR_CANNOTATTACHSURFACE, "Got unexpected hr %#lx.\n", hr); hr = IDirectDrawSurface4_AddAttachedSurface(surface4, surface1); - ok(hr == DDERR_CANNOTATTACHSURFACE, "Got unexpected hr %#x.\n", hr); + ok(hr == DDERR_CANNOTATTACHSURFACE, "Got unexpected hr %#lx.\n", hr); hr = IDirectDrawSurface4_AddAttachedSurface(surface3, surface4); - ok(hr == DDERR_CANNOTATTACHSURFACE, "Got unexpected hr %#x.\n", hr); + ok(hr == DDERR_CANNOTATTACHSURFACE, "Got unexpected hr %#lx.\n", hr); hr = IDirectDrawSurface4_AddAttachedSurface(surface4, surface3); - ok(hr == DDERR_CANNOTATTACHSURFACE, "Got unexpected hr %#x.\n", hr); + ok(hr == DDERR_CANNOTATTACHSURFACE, "Got unexpected hr %#lx.\n", hr); hr = IDirectDrawSurface4_AddAttachedSurface(surface2, surface4); - ok(hr == DDERR_CANNOTATTACHSURFACE, "Got unexpected hr %#x.\n", hr); + ok(hr == DDERR_CANNOTATTACHSURFACE, "Got unexpected hr %#lx.\n", hr); hr = IDirectDrawSurface4_AddAttachedSurface(surface4, surface2); - ok(hr == DDERR_CANNOTATTACHSURFACE, "Got unexpected hr %#x.\n", hr); + ok(hr == DDERR_CANNOTATTACHSURFACE, "Got unexpected hr %#lx.\n", hr);
IDirectDrawSurface4_Release(surface4);
@@ -8428,27 +8413,27 @@ static void test_surface_attachment(void) surface_desc.dwWidth = 16; surface_desc.dwHeight = 16; hr = IDirectDraw4_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 = IDirectDrawSurface4_AddAttachedSurface(surface1, surface4))) { skip("Running on refrast, skipping some tests.\n"); hr = IDirectDrawSurface4_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 = IDirectDrawSurface4_AddAttachedSurface(surface4, surface1); - ok(hr == DDERR_CANNOTATTACHSURFACE, "Got unexpected hr %#x.\n", hr); + ok(hr == DDERR_CANNOTATTACHSURFACE, "Got unexpected hr %#lx.\n", hr); hr = IDirectDrawSurface4_AddAttachedSurface(surface3, surface4); - ok(hr == DDERR_CANNOTATTACHSURFACE, "Got unexpected hr %#x.\n", hr); + ok(hr == DDERR_CANNOTATTACHSURFACE, "Got unexpected hr %#lx.\n", hr); hr = IDirectDrawSurface4_AddAttachedSurface(surface4, surface3); - ok(hr == DDERR_CANNOTATTACHSURFACE, "Got unexpected hr %#x.\n", hr); + ok(hr == DDERR_CANNOTATTACHSURFACE, "Got unexpected hr %#lx.\n", hr); hr = IDirectDrawSurface4_AddAttachedSurface(surface2, surface4); - ok(hr == DDERR_CANNOTATTACHSURFACE, "Got unexpected hr %#x.\n", hr); + ok(hr == DDERR_CANNOTATTACHSURFACE, "Got unexpected hr %#lx.\n", hr); hr = IDirectDrawSurface4_AddAttachedSurface(surface4, surface2); - ok(hr == DDERR_CANNOTATTACHSURFACE, "Got unexpected hr %#x.\n", hr); + ok(hr == DDERR_CANNOTATTACHSURFACE, "Got unexpected hr %#lx.\n", hr); }
IDirectDrawSurface4_Release(surface4); @@ -8457,7 +8442,7 @@ static void test_surface_attachment(void) IDirectDrawSurface4_Release(surface1);
hr = IDirectDraw4_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)); @@ -8465,7 +8450,7 @@ static void test_surface_attachment(void) surface_desc.dwFlags = DDSD_CAPS; surface_desc.ddsCaps.dwCaps = DDSCAPS_PRIMARYSURFACE; hr = IDirectDraw4_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); @@ -8474,7 +8459,7 @@ static void test_surface_attachment(void) surface_desc.dwWidth = registry_mode.dmPelsWidth; surface_desc.dwHeight = registry_mode.dmPelsHeight; hr = IDirectDraw4_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); @@ -8483,7 +8468,7 @@ static void test_surface_attachment(void) surface_desc.dwWidth = registry_mode.dmPelsWidth; surface_desc.dwHeight = registry_mode.dmPelsHeight; hr = IDirectDraw4_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)); @@ -8493,33 +8478,33 @@ static void test_surface_attachment(void) surface_desc.dwWidth = 128; surface_desc.dwHeight = 128; hr = IDirectDraw4_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 = IDirectDrawSurface4_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 = IDirectDrawSurface4_AddAttachedSurface(surface2, surface1); - ok(hr == DDERR_SURFACEALREADYATTACHED, "Got unexpected hr %#x.\n", hr); + ok(hr == DDERR_SURFACEALREADYATTACHED, "Got unexpected hr %#lx.\n", hr); hr = IDirectDrawSurface4_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 = IDirectDrawSurface4_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 = IDirectDrawSurface4_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 = IDirectDrawSurface4_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 = IDirectDrawSurface4_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 = IDirectDrawSurface4_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 = IDirectDrawSurface4_AddAttachedSurface(surface1, surface4); - ok(hr == DDERR_CANNOTATTACHSURFACE, "Got unexpected hr %#x.\n", hr); + ok(hr == DDERR_CANNOTATTACHSURFACE, "Got unexpected hr %#lx.\n", hr); hr = IDirectDrawSurface4_AddAttachedSurface(surface4, surface1); - ok(hr == DDERR_CANNOTATTACHSURFACE, "Got unexpected hr %#x.\n", hr); + ok(hr == DDERR_CANNOTATTACHSURFACE, "Got unexpected hr %#lx.\n", hr);
IDirectDrawSurface4_Release(surface4); IDirectDrawSurface4_Release(surface3); @@ -8534,7 +8519,7 @@ static void test_surface_attachment(void) surface_desc.dwWidth = 64; surface_desc.dwHeight = 64; hr = IDirectDraw4_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); @@ -8547,26 +8532,26 @@ static void test_surface_attachment(void) surface_desc.dwWidth = 32; surface_desc.dwHeight = 32; hr = IDirectDraw4_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 = IDirectDraw4_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 = IDirectDraw4_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)) IDirectDrawSurface4_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 = IDirectDrawSurface4_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);
IDirectDrawSurface4_Release(surface4); IDirectDrawSurface4_Release(surface3); @@ -8587,72 +8572,72 @@ static void test_surface_attachment(void) U3(U4(surface_desc).ddpfPixelFormat).dwGBitMask = 0x07e0; U4(U4(surface_desc).ddpfPixelFormat).dwBBitMask = 0x001f; hr = IDirectDraw4_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 = IDirectDraw4_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; U4(surface_desc).ddpfPixelFormat.dwFlags = DDPF_ZBUFFER; U1(U4(surface_desc).ddpfPixelFormat).dwZBufferBitDepth = 16; U3(U4(surface_desc).ddpfPixelFormat).dwZBitMask = 0x0000ffff; hr = IDirectDraw4_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 = IDirectDrawSurface4_QueryInterface(surface1, &IID_IDirectDrawSurface, (void **)&surface1v1); - ok(SUCCEEDED(hr), "Failed to get interface, hr %#x.\n", hr); + ok(SUCCEEDED(hr), "Failed to get interface, hr %#lx.\n", hr); hr = IDirectDrawSurface4_QueryInterface(surface2, &IID_IDirectDrawSurface, (void **)&surface2v1); - ok(SUCCEEDED(hr), "Failed to get interface, hr %#x.\n", hr); + ok(SUCCEEDED(hr), "Failed to get interface, hr %#lx.\n", hr);
hr = IDirectDrawSurface4_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 = get_refcount((IUnknown *)surface2v1); - ok(refcount == 1, "Got unexpected refcount %u.\n", refcount); + ok(refcount == 1, "Got unexpected refcount %lu.\n", refcount); hr = IDirectDrawSurface4_AddAttachedSurface(surface1, surface2); - ok(hr == DDERR_SURFACEALREADYATTACHED, "Got unexpected hr %#x.\n", hr); + ok(hr == DDERR_SURFACEALREADYATTACHED, "Got unexpected hr %#lx.\n", hr); hr = IDirectDrawSurface_AddAttachedSurface(surface1v1, surface2v1); - todo_wine ok(hr == DDERR_CANNOTATTACHSURFACE, "Got unexpected hr %#x.\n", hr); + todo_wine ok(hr == DDERR_CANNOTATTACHSURFACE, "Got unexpected hr %#lx.\n", hr); hr = IDirectDrawSurface_DeleteAttachedSurface(surface1v1, 0, surface2v1); - ok(hr == DDERR_SURFACENOTATTACHED, "Got unexpected hr %#x.\n", hr); + ok(hr == DDERR_SURFACENOTATTACHED, "Got unexpected hr %#lx.\n", hr);
/* Attaching while already attached to other surface. */ hr = IDirectDrawSurface4_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 = IDirectDrawSurface4_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); IDirectDrawSurface4_Release(surface3);
hr = IDirectDrawSurface4_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); refcount = get_refcount((IUnknown *)surface2v1); - ok(refcount == 1, "Got unexpected refcount %u.\n", refcount); + ok(refcount == 1, "Got unexpected refcount %lu.\n", refcount);
/* DeleteAttachedSurface() when attaching via IDirectDrawSurface. */ hr = IDirectDrawSurface_AddAttachedSurface(surface1v1, surface2v1); - ok(SUCCEEDED(hr), "Failed to attach surface, hr %#x.\n", hr); + ok(SUCCEEDED(hr), "Failed to attach surface, hr %#lx.\n", hr); hr = IDirectDrawSurface4_DeleteAttachedSurface(surface1, 0, surface2); - ok(hr == DDERR_SURFACENOTATTACHED, "Got unexpected hr %#x.\n", hr); + ok(hr == DDERR_SURFACENOTATTACHED, "Got unexpected hr %#lx.\n", hr); hr = IDirectDrawSurface_DeleteAttachedSurface(surface1v1, 0, surface2v1); - ok(SUCCEEDED(hr), "Failed to detach surface, hr %#x.\n", hr); + ok(SUCCEEDED(hr), "Failed to detach surface, hr %#lx.\n", hr); refcount = IDirectDrawSurface4_Release(surface2); - ok(!refcount, "Got unexpected refcount %u.\n", refcount); + ok(!refcount, "Got unexpected refcount %lu.\n", refcount); refcount = IDirectDrawSurface4_Release(surface1); - ok(!refcount, "Got unexpected refcount %u.\n", refcount); + ok(!refcount, "Got unexpected refcount %lu.\n", refcount);
/* Automatic detachment on release. */ hr = IDirectDrawSurface_AddAttachedSurface(surface1v1, surface2v1); - 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 *)surface2v1); - ok(refcount == 2, "Got unexpected refcount %u.\n", refcount); + ok(refcount == 2, "Got unexpected refcount %lu.\n", refcount); refcount = IDirectDrawSurface_Release(surface1v1); - ok(!refcount, "Got unexpected refcount %u.\n", refcount); + ok(!refcount, "Got unexpected refcount %lu.\n", refcount); refcount = IDirectDrawSurface_Release(surface2v1); - ok(!refcount, "Got unexpected refcount %u.\n", refcount); + ok(!refcount, "Got unexpected refcount %lu.\n", refcount); refcount = IDirectDraw4_Release(ddraw); - ok(!refcount, "Got unexpected refcount %u.\n", refcount); + ok(!refcount, "Got unexpected refcount %lu.\n", refcount); DestroyWindow(window); }
@@ -8688,7 +8673,7 @@ static void test_private_data(void) ddraw = create_ddraw(); ok(!!ddraw, "Failed to create a ddraw object.\n"); hr = IDirectDraw4_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(&surface_desc); surface_desc.dwFlags = DDSD_CAPS | DDSD_HEIGHT | DDSD_WIDTH; @@ -8696,27 +8681,27 @@ static void test_private_data(void) surface_desc.dwHeight = 4; surface_desc.dwWidth = 4; hr = IDirectDraw4_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);
/* NULL pointers are not valid, but don't cause a crash. */ hr = IDirectDrawSurface4_SetPrivateData(surface, &ddraw_private_data_test_guid, NULL, sizeof(IUnknown *), DDSPD_IUNKNOWNPOINTER); - ok(hr == DDERR_INVALIDPARAMS, "Got unexpected hr %#x.\n", hr); + ok(hr == DDERR_INVALIDPARAMS, "Got unexpected hr %#lx.\n", hr); hr = IDirectDrawSurface4_SetPrivateData(surface, &ddraw_private_data_test_guid, NULL, 0, 0); - ok(hr == DDERR_INVALIDPARAMS, "Got unexpected hr %#x.\n", hr); + ok(hr == DDERR_INVALIDPARAMS, "Got unexpected hr %#lx.\n", hr); hr = IDirectDrawSurface4_SetPrivateData(surface, &ddraw_private_data_test_guid, NULL, 1, 0); - ok(hr == DDERR_INVALIDPARAMS, "Got unexpected hr %#x.\n", hr); + ok(hr == DDERR_INVALIDPARAMS, "Got unexpected hr %#lx.\n", hr);
/* DDSPD_IUNKNOWNPOINTER needs sizeof(IUnknown *) bytes of data. */ hr = IDirectDrawSurface4_SetPrivateData(surface, &ddraw_private_data_test_guid, ddraw, 0, DDSPD_IUNKNOWNPOINTER); - ok(hr == DDERR_INVALIDPARAMS, "Got unexpected hr %#x.\n", hr); + ok(hr == DDERR_INVALIDPARAMS, "Got unexpected hr %#lx.\n", hr); hr = IDirectDrawSurface4_SetPrivateData(surface, &ddraw_private_data_test_guid, ddraw, 5, DDSPD_IUNKNOWNPOINTER); - ok(hr == DDERR_INVALIDPARAMS, "Got unexpected hr %#x.\n", hr); + ok(hr == DDERR_INVALIDPARAMS, "Got unexpected hr %#lx.\n", hr); hr = IDirectDrawSurface4_SetPrivateData(surface, &ddraw_private_data_test_guid, ddraw, sizeof(ddraw) * 2, DDSPD_IUNKNOWNPOINTER); - ok(hr == DDERR_INVALIDPARAMS, "Got unexpected hr %#x.\n", hr); + ok(hr == DDERR_INVALIDPARAMS, "Got unexpected hr %#lx.\n", hr);
/* Note that with a size != 0 and size != sizeof(IUnknown *) and * DDSPD_IUNKNOWNPOINTER set SetPrivateData in ddraw4 and ddraw7 @@ -8725,85 +8710,85 @@ static void test_private_data(void) * that depends on this we don't care about this behavior. */ hr = IDirectDrawSurface4_SetPrivateData(surface, &ddraw_private_data_test_guid, ddraw, sizeof(ddraw), DDSPD_IUNKNOWNPOINTER); - ok(SUCCEEDED(hr), "Failed to set private data, hr %#x.\n", hr); + ok(SUCCEEDED(hr), "Failed to set private data, hr %#lx.\n", hr); hr = IDirectDrawSurface4_SetPrivateData(surface, &ddraw_private_data_test_guid, ddraw, 0, DDSPD_IUNKNOWNPOINTER); - ok(hr == DDERR_INVALIDPARAMS, "Got unexpected hr %#x.\n", hr); + ok(hr == DDERR_INVALIDPARAMS, "Got unexpected hr %#lx.\n", hr); size = sizeof(ptr); hr = IDirectDrawSurface4_GetPrivateData(surface, &ddraw_private_data_test_guid, &ptr, &size); - ok(SUCCEEDED(hr), "Failed to get private data, hr %#x.\n", hr); + ok(SUCCEEDED(hr), "Failed to get private data, hr %#lx.\n", hr); hr = IDirectDrawSurface4_FreePrivateData(surface, &ddraw_private_data_test_guid); - ok(SUCCEEDED(hr), "Failed to free private data, hr %#x.\n", hr); + ok(SUCCEEDED(hr), "Failed to free private data, hr %#lx.\n", hr);
refcount = get_refcount((IUnknown *)ddraw); hr = IDirectDrawSurface4_SetPrivateData(surface, &ddraw_private_data_test_guid, ddraw, sizeof(ddraw), DDSPD_IUNKNOWNPOINTER); - ok(SUCCEEDED(hr), "Failed to set private data, hr %#x.\n", hr); + ok(SUCCEEDED(hr), "Failed to set private data, hr %#lx.\n", hr); refcount2 = get_refcount((IUnknown *)ddraw); - ok(refcount2 == refcount + 1, "Got unexpected refcount %u.\n", refcount2); + ok(refcount2 == refcount + 1, "Got unexpected refcount %lu.\n", refcount2);
hr = IDirectDrawSurface4_FreePrivateData(surface, &ddraw_private_data_test_guid); - ok(SUCCEEDED(hr), "Failed to free private data, hr %#x.\n", hr); + ok(SUCCEEDED(hr), "Failed to free private data, hr %#lx.\n", hr); refcount2 = get_refcount((IUnknown *)ddraw); - ok(refcount2 == refcount, "Got unexpected refcount %u.\n", refcount2); + ok(refcount2 == refcount, "Got unexpected refcount %lu.\n", refcount2);
hr = IDirectDrawSurface4_SetPrivateData(surface, &ddraw_private_data_test_guid, ddraw, sizeof(ddraw), DDSPD_IUNKNOWNPOINTER); - ok(SUCCEEDED(hr), "Failed to set private data, hr %#x.\n", hr); + ok(SUCCEEDED(hr), "Failed to set private data, hr %#lx.\n", hr); hr = IDirectDrawSurface4_SetPrivateData(surface, &ddraw_private_data_test_guid, surface, sizeof(surface), DDSPD_IUNKNOWNPOINTER); - ok(SUCCEEDED(hr), "Failed to set private data, hr %#x.\n", hr); + ok(SUCCEEDED(hr), "Failed to set private data, hr %#lx.\n", hr); refcount2 = get_refcount((IUnknown *)ddraw); - ok(refcount2 == refcount, "Got unexpected refcount %u.\n", refcount2); + ok(refcount2 == refcount, "Got unexpected refcount %lu.\n", refcount2);
hr = IDirectDrawSurface4_SetPrivateData(surface, &ddraw_private_data_test_guid, ddraw, sizeof(ddraw), DDSPD_IUNKNOWNPOINTER); - ok(SUCCEEDED(hr), "Failed to set private data, hr %#x.\n", hr); + ok(SUCCEEDED(hr), "Failed to set private data, hr %#lx.\n", hr); size = 2 * sizeof(ptr); hr = IDirectDrawSurface4_GetPrivateData(surface, &ddraw_private_data_test_guid, &ptr, &size); - ok(SUCCEEDED(hr), "Failed to get private data, hr %#x.\n", hr); - ok(size == sizeof(ddraw), "Got unexpected size %u.\n", size); + ok(SUCCEEDED(hr), "Failed to get private data, hr %#lx.\n", hr); + ok(size == sizeof(ddraw), "Got unexpected size %lu.\n", size); refcount2 = get_refcount(ptr); /* Object is NOT addref'ed by the getter. */ ok(ptr == (IUnknown *)ddraw, "Returned interface pointer is %p, expected %p.\n", ptr, ddraw); - ok(refcount2 == refcount + 1, "Got unexpected refcount %u.\n", refcount2); + ok(refcount2 == refcount + 1, "Got unexpected refcount %lu.\n", refcount2);
ptr = (IUnknown *)0xdeadbeef; size = 1; hr = IDirectDrawSurface4_GetPrivateData(surface, &ddraw_private_data_test_guid, NULL, &size); - ok(hr == DDERR_MOREDATA, "Got unexpected hr %#x.\n", hr); - ok(size == sizeof(ddraw), "Got unexpected size %u.\n", size); + ok(hr == DDERR_MOREDATA, "Got unexpected hr %#lx.\n", hr); + ok(size == sizeof(ddraw), "Got unexpected size %lu.\n", size); size = 2 * sizeof(ptr); hr = IDirectDrawSurface4_GetPrivateData(surface, &ddraw_private_data_test_guid, NULL, &size); - ok(hr == DDERR_INVALIDPARAMS, "Got unexpected hr %#x.\n", hr); - ok(size == 2 * sizeof(ptr), "Got unexpected size %u.\n", size); + ok(hr == DDERR_INVALIDPARAMS, "Got unexpected hr %#lx.\n", hr); + ok(size == 2 * sizeof(ptr), "Got unexpected size %lu.\n", size); size = 1; hr = IDirectDrawSurface4_GetPrivateData(surface, &ddraw_private_data_test_guid, &ptr, &size); - ok(hr == DDERR_MOREDATA, "Got unexpected hr %#x.\n", hr); - ok(size == sizeof(ddraw), "Got unexpected size %u.\n", size); + ok(hr == DDERR_MOREDATA, "Got unexpected hr %#lx.\n", hr); + ok(size == sizeof(ddraw), "Got unexpected size %lu.\n", size); ok(ptr == (IUnknown *)0xdeadbeef, "Got unexpected pointer %p.\n", ptr); hr = IDirectDrawSurface4_GetPrivateData(surface, &ddraw_private_data_test_guid2, NULL, NULL); - ok(hr == DDERR_NOTFOUND, "Got unexpected hr %#x.\n", hr); + ok(hr == DDERR_NOTFOUND, "Got unexpected hr %#lx.\n", hr); size = 0xdeadbabe; hr = IDirectDrawSurface4_GetPrivateData(surface, &ddraw_private_data_test_guid2, &ptr, &size); - ok(hr == DDERR_NOTFOUND, "Got unexpected hr %#x.\n", hr); + ok(hr == DDERR_NOTFOUND, "Got unexpected hr %#lx.\n", hr); ok(ptr == (IUnknown *)0xdeadbeef, "Got unexpected pointer %p.\n", ptr); - ok(size == 0xdeadbabe, "Got unexpected size %u.\n", size); + ok(size == 0xdeadbabe, "Got unexpected size %lu.\n", size); hr = IDirectDrawSurface4_GetPrivateData(surface, &ddraw_private_data_test_guid, NULL, NULL); - ok(hr == DDERR_INVALIDPARAMS, "Got unexpected hr %#x.\n", hr); + ok(hr == DDERR_INVALIDPARAMS, "Got unexpected hr %#lx.\n", hr);
refcount3 = IDirectDrawSurface4_Release(surface); - ok(!refcount3, "Got unexpected refcount %u.\n", refcount3); + ok(!refcount3, "Got unexpected refcount %lu.\n", refcount3);
/* Destroying the surface frees the reference held on the private data. It also frees * the reference the surface is holding on its creating object. */ refcount2 = get_refcount((IUnknown *)ddraw); - ok(refcount2 == refcount - 1, "Got unexpected refcount %u.\n", refcount2); + ok(refcount2 == refcount - 1, "Got unexpected refcount %lu.\n", refcount2);
memset(&hal_caps, 0, sizeof(hal_caps)); hal_caps.dwSize = sizeof(hal_caps); hr = IDirectDraw4_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)) { reset_ddsd(&surface_desc); @@ -8813,14 +8798,14 @@ static void test_private_data(void) surface_desc.dwWidth = 4; U2(surface_desc).dwMipMapCount = 2; hr = IDirectDraw4_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 = IDirectDrawSurface4_GetAttachedSurface(surface, &caps, &surface2); - 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 = IDirectDrawSurface4_SetPrivateData(surface, &ddraw_private_data_test_guid, data, sizeof(data), 0); - ok(SUCCEEDED(hr), "Failed to set private data, hr %#x.\n", hr); + ok(SUCCEEDED(hr), "Failed to set private data, hr %#lx.\n", hr); hr = IDirectDrawSurface4_GetPrivateData(surface2, &ddraw_private_data_test_guid, NULL, NULL); - ok(hr == DDERR_NOTFOUND, "Got unexpected hr %#x.\n", hr); + ok(hr == DDERR_NOTFOUND, "Got unexpected hr %#lx.\n", hr);
IDirectDrawSurface4_Release(surface2); IDirectDrawSurface4_Release(surface); @@ -8829,7 +8814,7 @@ static void test_private_data(void) skip("Mipmapped textures not supported, skipping mipmap private data test.\n");
refcount = IDirectDraw4_Release(ddraw); - ok(!refcount, "Got unexpected refcount %u.\n", refcount); + ok(!refcount, "Got unexpected refcount %lu.\n", refcount); DestroyWindow(window); }
@@ -8912,7 +8897,7 @@ static void test_pixel_format(void) hr = IDirectDraw4_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; }
@@ -8922,9 +8907,9 @@ static void test_pixel_format(void) if (hdc2) { hr = IDirectDraw4_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); @@ -8939,7 +8924,7 @@ static void test_pixel_format(void) ddsd.ddsCaps.dwCaps = DDSCAPS_PRIMARYSURFACE;
hr = IDirectDraw4_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); @@ -8953,7 +8938,7 @@ static void test_pixel_format(void) if (clipper) { hr = IDirectDrawSurface4_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); @@ -8968,18 +8953,18 @@ static void test_pixel_format(void) ddsd.ddsCaps.dwCaps = DDSCAPS_OFFSCREENPLAIN; ddsd.dwWidth = ddsd.dwHeight = 64; hr = IDirectDraw4_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 = IDirectDrawSurface4_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 = IDirectDrawSurface4_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); @@ -9104,7 +9089,7 @@ static void test_create_surface_pitch(void) ddraw = create_ddraw(); ok(!!ddraw, "Failed to create a ddraw object.\n"); hr = IDirectDraw4_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);
@@ -9127,33 +9112,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 = IDirectDraw4_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 = IDirectDrawSurface4_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); @@ -9163,7 +9148,7 @@ static void test_create_surface_pitch(void)
HeapFree(GetProcessHeap(), 0, mem); refcount = IDirectDraw4_Release(ddraw); - ok(!refcount, "Got unexpected refcount %u.\n", refcount); + ok(!refcount, "Got unexpected refcount %lu.\n", refcount); DestroyWindow(window); }
@@ -9203,12 +9188,12 @@ static void test_mipmap(void) ddraw = create_ddraw(); ok(!!ddraw, "Failed to create a ddraw object.\n"); hr = IDirectDraw4_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 = IDirectDraw4_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"); @@ -9228,18 +9213,18 @@ static void test_mipmap(void) if (tests[i].flags & DDSD_MIPMAPCOUNT) U2(surface_desc).dwMipMapCount = tests[i].mipmap_count_in; hr = IDirectDraw4_CreateSurface(ddraw, &surface_desc, &surface, 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;
memset(&surface_desc, 0, sizeof(surface_desc)); surface_desc.dwSize = sizeof(surface_desc); hr = IDirectDrawSurface4_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; IDirectDrawSurface4_AddRef(surface_base); @@ -9247,31 +9232,31 @@ static void test_mipmap(void) while (mipmap_count > 1) { hr = IDirectDrawSurface4_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 = IDirectDrawSurface4_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 = IDirectDrawSurface4_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 = IDirectDrawSurface4_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); IDirectDrawSurface4_Unlock(surface_mip, NULL); IDirectDrawSurface4_Unlock(surface_base, NULL);
@@ -9285,7 +9270,7 @@ static void test_mipmap(void) }
refcount = IDirectDraw4_Release(ddraw); - ok(!refcount, "Got unexpected refcount %u.\n", refcount); + ok(!refcount, "Got unexpected refcount %lu.\n", refcount); DestroyWindow(window); }
@@ -9310,12 +9295,12 @@ static void test_palette_complex(void) ddraw = create_ddraw(); ok(!!ddraw, "Failed to create a ddraw object.\n"); hr = IDirectDraw4_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 = IDirectDraw4_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"); @@ -9334,28 +9319,28 @@ static void test_palette_complex(void) U4(surface_desc).ddpfPixelFormat.dwFlags = DDPF_PALETTEINDEXED8 | DDPF_RGB; U1(U4(surface_desc).ddpfPixelFormat).dwRGBBitCount = 8; hr = IDirectDraw4_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(palette_entries, 0, sizeof(palette_entries)); hr = IDirectDraw4_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 = IDirectDraw4_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 = IDirectDrawSurface4_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 = IDirectDrawSurface4_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 = IDirectDrawSurface4_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);
@@ -9364,46 +9349,46 @@ static void test_palette_complex(void) for (i = 0; i < 7; ++i) { hr = IDirectDrawSurface4_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 = IDirectDrawSurface4_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 = IDirectDrawSurface4_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 = IDirectDrawSurface4_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 = IDirectDrawSurface4_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 = IDirectDrawSurface4_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);
IDirectDrawSurface4_Release(mipmap); mipmap = tmp; }
hr = IDirectDrawSurface4_GetAttachedSurface(mipmap, &caps, &tmp); - ok(hr == DDERR_NOTFOUND, "Got unexpected hr %#x.\n", hr); + ok(hr == DDERR_NOTFOUND, "Got unexpected hr %#lx.\n", hr); IDirectDrawSurface4_Release(mipmap); refcount = IDirectDrawSurface4_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 = IDirectDraw4_Release(ddraw); - ok(!refcount, "Got unexpected refcount %u.\n", refcount); + ok(!refcount, "Got unexpected refcount %lu.\n", refcount); DestroyWindow(window); }
@@ -9411,30 +9396,29 @@ static void test_p8_blit(void) { IDirectDrawSurface4 *src, *dst, *dst_p8; DDSURFACEDESC2 surface_desc; + unsigned int color, x; IDirectDraw4 *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 = IDirectDraw4_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)); @@ -9444,14 +9428,14 @@ static void test_p8_blit(void) palette_entries[4].peRed = 0xff; hr = IDirectDraw4_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 = IDirectDraw4_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); @@ -9463,11 +9447,11 @@ static void test_p8_blit(void) U4(surface_desc).ddpfPixelFormat.dwFlags = DDPF_PALETTEINDEXED8 | DDPF_RGB; U1(U4(surface_desc).ddpfPixelFormat).dwRGBBitCount = 8; hr = IDirectDraw4_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 = IDirectDraw4_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 = IDirectDrawSurface4_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); @@ -9483,34 +9467,34 @@ static void test_p8_blit(void) U4(U4(surface_desc).ddpfPixelFormat).dwBBitMask = 0x000000ff; U5(U4(surface_desc).ddpfPixelFormat).dwRGBAlphaBitMask = 0xff000000; hr = IDirectDraw4_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 = IDirectDrawSurface4_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 = IDirectDrawSurface4_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 = IDirectDrawSurface4_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 = IDirectDrawSurface4_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 = IDirectDrawSurface4_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 = IDirectDrawSurface4_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 = IDirectDrawSurface4_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)) { @@ -9529,10 +9513,10 @@ static void test_p8_blit(void) fx.ddckSrcColorkey.dwColorSpaceHighValue = 0x2; fx.ddckSrcColorkey.dwColorSpaceLowValue = 0x2; hr = IDirectDrawSurface4_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 = IDirectDrawSurface4_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. @@ -9543,7 +9527,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 = IDirectDrawSurface4_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);
IDirectDrawSurface4_Release(src); IDirectDrawSurface4_Release(dst); @@ -9552,7 +9536,7 @@ static void test_p8_blit(void) IDirectDrawPalette_Release(palette2);
refcount = IDirectDraw4_Release(ddraw); - ok(!refcount, "Got unexpected refcount %u.\n", refcount); + ok(!refcount, "Got unexpected refcount %lu.\n", refcount); DestroyWindow(window); }
@@ -9563,9 +9547,8 @@ static void test_material(void) IDirect3DViewport3 *viewport; IDirect3DDevice3 *device; IDirectDrawSurface4 *rt; - D3DCOLOR color; + unsigned int color, i; ULONG refcount; - unsigned int i; HWND window; HRESULT hr; BOOL valid; @@ -9614,46 +9597,46 @@ static void test_material(void) }
hr = IDirect3DDevice3_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 = IDirect3DDevice3_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 = IDirect3DMaterial3_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 = IDirect3DDevice3_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 = IDirect3DDevice3_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 = IDirect3DDevice3_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 = IDirect3DDevice3_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 = IDirect3DDevice3_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 = IDirect3DViewport3_Clear2(viewport, 1, &clear_rect, D3DCLEAR_TARGET | D3DCLEAR_ZBUFFER, 0xff0000ff, 1.0f, 0); - ok(SUCCEEDED(hr), "Failed to clear viewport, hr %#x.\n", hr); + ok(SUCCEEDED(hr), "Failed to clear viewport, hr %#lx.\n", hr);
hr = IDirect3DDevice3_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 = IDirect3DDevice3_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, D3DFVF_XYZ | D3DFVF_NORMAL | D3DFVF_DIFFUSE, test_data[i].data, 4, 0); - ok(SUCCEEDED(hr), "Failed to draw, hr %#x.\n", hr); + ok(SUCCEEDED(hr), "Failed to draw, hr %#lx.\n", hr); hr = IDirect3DDevice3_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); @@ -9662,27 +9645,27 @@ static void test_material(void) destroy_material(material); material = create_diffuse_material(device, 1.0f, 0.0f, 0.0f, 1.0f); hr = IDirect3DMaterial3_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 = IDirect3DViewport3_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 = IDirect3DViewport3_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 = IDirect3DViewport3_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 = IDirect3DViewport3_SetBackground(viewport, 0); - ok(hr == DDERR_INVALIDPARAMS, "Got unexpected hr %#x.\n", hr); + ok(hr == DDERR_INVALIDPARAMS, "Got unexpected hr %#lx.\n", hr); hr = IDirect3DViewport3_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 = IDirect3DViewport3_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);
@@ -9690,11 +9673,11 @@ static void test_material(void) viewport = create_viewport(device, 0, 0, 640, 480);
hr = IDirect3DViewport3_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 = IDirect3DViewport3_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);
@@ -9702,7 +9685,7 @@ static void test_material(void) destroy_material(material); IDirectDrawSurface4_Release(rt); refcount = IDirect3DDevice3_Release(device); - ok(!refcount, "Device has %u references left.\n", refcount); + ok(!refcount, "Device has %lu references left.\n", refcount); DestroyWindow(window); }
@@ -9710,17 +9693,17 @@ static void test_palette_gdi(void) { IDirectDrawSurface4 *surface, *primary; DDSURFACEDESC2 surface_desc; + unsigned int color, i; IDirectDraw4 *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. */ @@ -9748,7 +9731,7 @@ static void test_palette_gdi(void) ddraw = create_ddraw(); ok(!!ddraw, "Failed to create a ddraw object.\n"); hr = IDirectDraw4_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); @@ -9760,7 +9743,7 @@ static void test_palette_gdi(void) U4(surface_desc).ddpfPixelFormat.dwFlags = DDPF_PALETTEINDEXED8 | DDPF_RGB; U1(U4(surface_desc).ddpfPixelFormat).dwRGBBitCount = 8; hr = IDirectDraw4_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)); @@ -9772,7 +9755,7 @@ static void test_palette_gdi(void) palette_entries[4].peBlue = 0x15; hr = IDirectDraw4_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, @@ -9785,9 +9768,9 @@ static void test_palette_gdi(void) * contains uninitialized garbage. See comments below for the P8 case. */
hr = IDirectDrawSurface4_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 = IDirectDrawSurface4_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", @@ -9814,7 +9797,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); @@ -9825,9 +9808,9 @@ static void test_palette_gdi(void)
/* Neither does re-setting the palette. */ hr = IDirectDrawSurface4_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 = IDirectDrawSurface4_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); @@ -9837,11 +9820,11 @@ static void test_palette_gdi(void) expected1[4].rgbRed, expected1[4].rgbGreen, expected1[4].rgbBlue);
hr = IDirectDrawSurface4_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 = IDirectDrawSurface4_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++) @@ -9858,13 +9841,13 @@ static void test_palette_gdi(void) i, rgbquad[i].rgbRed, rgbquad[i].rgbGreen, rgbquad[i].rgbBlue); } hr = IDirectDrawSurface4_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 = IDirectDrawSurface4_Release(surface); - ok(!refcount, "Got unexpected refcount %u.\n", refcount); + ok(!refcount, "Got unexpected refcount %lu.\n", refcount);
hr = IDirectDraw4_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(IDirectDraw4_SetDisplayMode(ddraw, 640, 480, 8, 0, 0))) { win_skip("Failed to set 8 bpp display mode, skipping test.\n"); @@ -9873,30 +9856,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 = IDirectDraw4_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 = IDirectDrawSurface4_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 = IDirectDrawSurface4_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 = IDirectDrawSurface4_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 = IDirectDrawSurface4_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); @@ -9931,7 +9914,7 @@ static void test_palette_gdi(void) i, rgbquad[i].rgbRed, rgbquad[i].rgbGreen, rgbquad[i].rgbBlue); } hr = IDirectDrawSurface4_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); @@ -9940,12 +9923,12 @@ static void test_palette_gdi(void) surface_desc.dwHeight = 16; surface_desc.ddsCaps.dwCaps = DDSCAPS_OFFSCREENPLAIN; hr = IDirectDraw4_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 = IDirectDrawSurface4_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++) @@ -9962,7 +9945,7 @@ static void test_palette_gdi(void) i, rgbquad[i].rgbRed, rgbquad[i].rgbGreen, rgbquad[i].rgbBlue); } hr = IDirectDrawSurface4_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 @@ -9978,14 +9961,14 @@ static void test_palette_gdi(void) palette_entries[4].peBlue = 0x56; hr = IDirectDraw4_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 = IDirectDrawSurface4_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 = IDirectDrawSurface4_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++) @@ -10002,24 +9985,24 @@ static void test_palette_gdi(void) i, rgbquad[i].rgbRed, rgbquad[i].rgbGreen, rgbquad[i].rgbBlue); } hr = IDirectDrawSurface4_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 = IDirectDrawSurface4_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 = IDirectDraw4_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 = IDirectDrawSurface4_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 = IDirectDraw4_Release(ddraw); - ok(!refcount, "Got unexpected refcount %u.\n", refcount); + ok(!refcount, "Got unexpected refcount %lu.\n", refcount); DestroyWindow(window); }
@@ -10058,18 +10041,18 @@ static void test_palette_alpha(void) return; } hr = IDirectDraw4_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 = IDirectDraw4_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", @@ -10088,11 +10071,11 @@ static void test_palette_alpha(void) palette_entries[3].peFlags = 0x80; hr = IDirectDraw4_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", @@ -10111,13 +10094,13 @@ static void test_palette_alpha(void) surface_desc.dwHeight = 128; surface_desc.ddsCaps.dwCaps = test_data[i].caps; hr = IDirectDraw4_CreateSurface(ddraw, &surface_desc, &surface, 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 = IDirectDrawSurface4_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)) { @@ -10126,7 +10109,7 @@ static void test_palette_alpha(void) UINT retval;
hr = IDirectDrawSurface4_GetDC(surface, &dc); - ok(SUCCEEDED(hr), "Failed to get DC, hr %#x, %s surface.\n", hr, test_data[i].name); + ok(SUCCEEDED(hr), "Failed to get DC, hr %#lx, %s surface.\n", hr, test_data[i].name); retval = GetDIBColorTable(dc, 1, 1, &rgbquad); ok(retval == 1, "GetDIBColorTable returned unexpected result %u.\n", retval); ok(rgbquad.rgbRed == 0xff, "Expected rgbRed = 0xff, got %#x, %s surface.\n", @@ -10138,7 +10121,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 = IDirectDrawSurface4_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); } IDirectDrawSurface4_Release(surface); } @@ -10157,20 +10140,20 @@ static void test_palette_alpha(void) U3(U4(surface_desc).ddpfPixelFormat).dwGBitMask = 0x0000ff00; U4(U4(surface_desc).ddpfPixelFormat).dwBBitMask = 0x000000ff; hr = IDirectDraw4_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 = IDirectDrawSurface4_SetPalette(surface, palette); - ok(hr == DDERR_INVALIDSURFACETYPE, "Got unexpected hr %#x.\n", hr); + ok(hr == DDERR_INVALIDSURFACETYPE, "Got unexpected hr %#lx.\n", hr); IDirectDrawSurface4_Release(surface);
/* The Windows 8 testbot keeps extra references to the primary * while in 8 bpp mode. */ hr = IDirectDraw4_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 = IDirectDraw4_Release(ddraw); - ok(!refcount, "Got unexpected refcount %u.\n", refcount); + ok(!refcount, "Got unexpected refcount %lu.\n", refcount); DestroyWindow(window); }
@@ -10200,7 +10183,7 @@ static void test_vb_writeonly(void) }
hr = IDirect3DDevice3_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);
memset(&desc, 0, sizeof(desc)); desc.dwSize = sizeof(desc); @@ -10208,32 +10191,32 @@ static void test_vb_writeonly(void) desc.dwFVF = D3DFVF_XYZRHW; desc.dwNumVertices = ARRAY_SIZE(quad); hr = IDirect3D3_CreateVertexBuffer(d3d, &desc, &buffer, 0, NULL); - ok(SUCCEEDED(hr), "Failed to create vertex buffer, hr %#x.\n", hr); + ok(SUCCEEDED(hr), "Failed to create vertex buffer, hr %#lx.\n", hr);
hr = IDirect3DVertexBuffer_Lock(buffer, DDLOCK_DISCARDCONTENTS, &ptr, NULL); - ok(SUCCEEDED(hr), "Failed to lock vertex buffer, hr %#x.\n", hr); + ok(SUCCEEDED(hr), "Failed to lock vertex buffer, hr %#lx.\n", hr); memcpy(ptr, quad, sizeof(quad)); hr = IDirect3DVertexBuffer_Unlock(buffer); - ok(SUCCEEDED(hr), "Failed to unlock vertex buffer, hr %#x.\n", hr); + ok(SUCCEEDED(hr), "Failed to unlock vertex buffer, hr %#lx.\n", hr);
hr = IDirect3DDevice3_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 = IDirect3DDevice3_DrawPrimitiveVB(device, D3DPT_TRIANGLESTRIP, buffer, 0, 4, 0); - ok(SUCCEEDED(hr), "Failed to draw, hr %#x.\n", hr); + ok(SUCCEEDED(hr), "Failed to draw, hr %#lx.\n", hr); hr = IDirect3DDevice3_EndScene(device); - ok(SUCCEEDED(hr), "Failed to end scene, hr %#x.\n", hr); + ok(SUCCEEDED(hr), "Failed to end scene, hr %#lx.\n", hr);
hr = IDirect3DVertexBuffer_Lock(buffer, 0, &ptr, NULL); - ok(SUCCEEDED(hr), "Failed to lock vertex buffer, hr %#x.\n", hr); + ok(SUCCEEDED(hr), "Failed to lock vertex buffer, hr %#lx.\n", hr); ok (!memcmp(ptr, quad, sizeof(quad)), "Got unexpected vertex buffer data.\n"); hr = IDirect3DVertexBuffer_Unlock(buffer); - ok(SUCCEEDED(hr), "Failed to unlock vertex buffer, hr %#x.\n", hr); + ok(SUCCEEDED(hr), "Failed to unlock vertex buffer, hr %#lx.\n", hr);
hr = IDirect3DVertexBuffer_Lock(buffer, DDLOCK_READONLY, &ptr, NULL); - ok(SUCCEEDED(hr), "Failed to lock vertex buffer, hr %#x.\n", hr); + ok(SUCCEEDED(hr), "Failed to lock vertex buffer, hr %#lx.\n", hr); ok (!memcmp(ptr, quad, sizeof(quad)), "Got unexpected vertex buffer data.\n"); hr = IDirect3DVertexBuffer_Unlock(buffer); - ok(SUCCEEDED(hr), "Failed to unlock vertex buffer, hr %#x.\n", hr); + ok(SUCCEEDED(hr), "Failed to unlock vertex buffer, hr %#lx.\n", hr);
IDirect3DVertexBuffer_Release(buffer); IDirect3D3_Release(d3d); @@ -10260,7 +10243,7 @@ static void test_lost_device(void) ddraw = create_ddraw(); ok(!!ddraw, "Failed to create a ddraw object.\n"); hr = IDirectDraw4_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); @@ -10268,7 +10251,7 @@ static void test_lost_device(void) surface_desc.ddsCaps.dwCaps = DDSCAPS_PRIMARYSURFACE | DDSCAPS_COMPLEX | DDSCAPS_FLIP; U5(surface_desc).dwBackBufferCount = 1; hr = IDirectDraw4_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); @@ -10277,7 +10260,7 @@ static void test_lost_device(void) surface_desc.dwWidth = 100; surface_desc.dwHeight = 100; hr = IDirectDraw4_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); @@ -10298,93 +10281,93 @@ static void test_lost_device(void) }
hr = IDirectDraw4_TestCooperativeLevel(ddraw); - ok(hr == DD_OK, "Got unexpected hr %#x.\n", hr); + ok(hr == DD_OK, "Got unexpected hr %#lx.\n", hr); hr = IDirectDrawSurface4_IsLost(surface); - ok(hr == DD_OK, "Got unexpected hr %#x.\n", hr); + ok(hr == DD_OK, "Got unexpected hr %#lx.\n", hr); hr = IDirectDrawSurface4_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 = IDirectDrawSurface4_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 = IDirectDrawSurface4_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 = IDirectDraw4_TestCooperativeLevel(ddraw); - ok(hr == DDERR_NOEXCLUSIVEMODE, "Got unexpected hr %#x.\n", hr); + ok(hr == DDERR_NOEXCLUSIVEMODE, "Got unexpected hr %#lx.\n", hr); hr = IDirectDrawSurface4_IsLost(surface); - ok(hr == DDERR_SURFACELOST, "Got unexpected hr %#x.\n", hr); + ok(hr == DDERR_SURFACELOST, "Got unexpected hr %#lx.\n", hr); hr = IDirectDrawSurface4_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 = IDirectDrawSurface4_Restore(surface); - ok(hr == DDERR_WRONGMODE, "Got unexpected hr %#x.\n", hr); + ok(hr == DDERR_WRONGMODE, "Got unexpected hr %#lx.\n", hr); hr = IDirectDrawSurface4_IsLost(surface); - ok(hr == DDERR_SURFACELOST, "Got unexpected hr %#x.\n", hr); + ok(hr == DDERR_SURFACELOST, "Got unexpected hr %#lx.\n", hr); hr = IDirectDrawSurface4_IsLost(sysmem_surface); - ok(hr == DD_OK, "Got unexpected hr %#x.\n", hr); + ok(hr == DD_OK, "Got unexpected hr %#lx.\n", hr); hr = IDirectDrawSurface4_Restore(sysmem_surface); - ok(hr == DD_OK, "Got unexpected hr %#x.\n", hr); + ok(hr == DD_OK, "Got unexpected hr %#lx.\n", hr); hr = IDirectDrawSurface4_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 = IDirectDrawSurface4_IsLost(vidmem_surface); - ok(hr == DDERR_SURFACELOST, "Got unexpected hr %#x.\n", hr); + ok(hr == DDERR_SURFACELOST, "Got unexpected hr %#lx.\n", hr); hr = IDirectDrawSurface4_Restore(vidmem_surface); - ok(hr == DDERR_WRONGMODE, "Got unexpected hr %#x.\n", hr); + ok(hr == DDERR_WRONGMODE, "Got unexpected hr %#lx.\n", hr); hr = IDirectDrawSurface4_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 = IDirectDraw4_TestCooperativeLevel(ddraw); - ok(hr == DD_OK, "Got unexpected hr %#x.\n", hr); + ok(hr == DD_OK, "Got unexpected hr %#lx.\n", hr); hr = IDirectDrawSurface4_IsLost(surface); - ok(hr == DDERR_SURFACELOST, "Got unexpected hr %#x.\n", hr); + ok(hr == DDERR_SURFACELOST, "Got unexpected hr %#lx.\n", hr); hr = IDirectDrawSurface4_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 = IDirectDrawSurface4_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 = IDirectDrawSurface4_IsLost(vidmem_surface); - ok(hr == DDERR_SURFACELOST, "Got unexpected hr %#x.\n", hr); + ok(hr == DDERR_SURFACELOST, "Got unexpected hr %#lx.\n", hr); }
hr = IDirectDraw4_RestoreAllSurfaces(ddraw); - ok(hr == DD_OK, "Got unexpected hr %#x.\n", hr); + ok(hr == DD_OK, "Got unexpected hr %#lx.\n", hr); hr = IDirectDraw4_TestCooperativeLevel(ddraw); - ok(hr == DD_OK, "Got unexpected hr %#x.\n", hr); + ok(hr == DD_OK, "Got unexpected hr %#lx.\n", hr); hr = IDirectDrawSurface4_IsLost(surface); - ok(hr == DD_OK, "Got unexpected hr %#x.\n", hr); + ok(hr == DD_OK, "Got unexpected hr %#lx.\n", hr); hr = IDirectDrawSurface4_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 = IDirectDrawSurface4_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 = IDirectDrawSurface4_IsLost(vidmem_surface); - ok(hr == DD_OK, "Got unexpected hr %#x.\n", hr); + ok(hr == DD_OK, "Got unexpected hr %#lx.\n", hr); }
hr = IDirectDraw4_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 = IDirectDraw4_TestCooperativeLevel(ddraw); - ok(hr == DD_OK, "Got unexpected hr %#x.\n", hr); + ok(hr == DD_OK, "Got unexpected hr %#lx.\n", hr); hr = IDirectDrawSurface4_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 = IDirectDrawSurface4_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 = IDirectDrawSurface4_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 = IDirectDrawSurface4_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 @@ -10395,76 +10378,76 @@ static void test_lost_device(void) surface_desc.dwFlags = DDSD_CAPS; surface_desc.ddsCaps.dwCaps = DDSCAPS_PRIMARYSURFACE; hr = IDirectDraw4_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 = IDirectDraw4_RestoreAllSurfaces(ddraw); - ok(hr == DD_OK, "Got unexpected hr %#x.\n", hr); + ok(hr == DD_OK, "Got unexpected hr %#lx.\n", hr);
hr = IDirectDraw4_TestCooperativeLevel(ddraw); - ok(hr == DD_OK, "Got unexpected hr %#x.\n", hr); + ok(hr == DD_OK, "Got unexpected hr %#lx.\n", hr); hr = IDirectDrawSurface4_IsLost(surface); - ok(hr == DD_OK, "Got unexpected hr %#x.\n", hr); + ok(hr == DD_OK, "Got unexpected hr %#lx.\n", hr); hr = IDirectDrawSurface4_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 = IDirectDrawSurface4_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 = IDirectDraw4_TestCooperativeLevel(ddraw); - ok(hr == DD_OK, "Got unexpected hr %#x.\n", hr); + ok(hr == DD_OK, "Got unexpected hr %#lx.\n", hr); hr = IDirectDrawSurface4_IsLost(surface); - ok(hr == DD_OK, "Got unexpected hr %#x.\n", hr); + ok(hr == DD_OK, "Got unexpected hr %#lx.\n", hr); hr = IDirectDrawSurface4_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 = IDirectDrawSurface4_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 = IDirectDraw4_TestCooperativeLevel(ddraw); - ok(hr == DD_OK, "Got unexpected hr %#x.\n", hr); + ok(hr == DD_OK, "Got unexpected hr %#lx.\n", hr); hr = IDirectDrawSurface4_IsLost(surface); - ok(hr == DD_OK, "Got unexpected hr %#x.\n", hr); + ok(hr == DD_OK, "Got unexpected hr %#lx.\n", hr); hr = IDirectDrawSurface4_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 = IDirectDrawSurface4_IsLost(vidmem_surface); - ok(hr == DD_OK, "Got unexpected hr %#x.\n", hr); + ok(hr == DD_OK, "Got unexpected hr %#lx.\n", hr); }
hr = IDirectDraw4_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 = IDirectDraw4_TestCooperativeLevel(ddraw); - ok(hr == DD_OK, "Got unexpected hr %#x.\n", hr); + ok(hr == DD_OK, "Got unexpected hr %#lx.\n", hr); hr = IDirectDrawSurface4_IsLost(surface); - ok(hr == DDERR_SURFACELOST, "Got unexpected hr %#x.\n", hr); + ok(hr == DDERR_SURFACELOST, "Got unexpected hr %#lx.\n", hr); hr = IDirectDrawSurface4_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 = IDirectDrawSurface4_IsLost(vidmem_surface); - ok(hr == DDERR_SURFACELOST, "Got unexpected hr %#x.\n", hr); + ok(hr == DDERR_SURFACELOST, "Got unexpected hr %#lx.\n", hr); }
hr = IDirectDraw4_RestoreAllSurfaces(ddraw); - ok(hr == DD_OK, "Got unexpected hr %#x.\n", hr); + ok(hr == DD_OK, "Got unexpected hr %#lx.\n", hr); hr = IDirectDraw4_TestCooperativeLevel(ddraw); - ok(hr == DD_OK, "Got unexpected hr %#x.\n", hr); + ok(hr == DD_OK, "Got unexpected hr %#lx.\n", hr); hr = IDirectDrawSurface4_IsLost(surface); - ok(hr == DD_OK, "Got unexpected hr %#x.\n", hr); + ok(hr == DD_OK, "Got unexpected hr %#lx.\n", hr); hr = IDirectDrawSurface4_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 = IDirectDrawSurface4_IsLost(vidmem_surface); - ok(hr == DD_OK, "Got unexpected hr %#x.\n", hr); + ok(hr == DD_OK, "Got unexpected hr %#lx.\n", hr); }
IDirectDrawSurface4_Release(surface); @@ -10474,116 +10457,116 @@ static void test_lost_device(void) surface_desc.ddsCaps.dwCaps = DDSCAPS_PRIMARYSURFACE | DDSCAPS_COMPLEX | DDSCAPS_FLIP; U5(surface_desc).dwBackBufferCount = 1; hr = IDirectDraw4_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 = IDirectDraw4_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 = IDirectDraw4_TestCooperativeLevel(ddraw); - ok(hr == DD_OK, "Got unexpected hr %#x.\n", hr); + ok(hr == DD_OK, "Got unexpected hr %#lx.\n", hr); hr = IDirectDrawSurface4_IsLost(surface); - ok(hr == DD_OK, "Got unexpected hr %#x.\n", hr); + ok(hr == DD_OK, "Got unexpected hr %#lx.\n", hr); hr = IDirectDrawSurface4_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 = IDirectDrawSurface4_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 = IDirectDrawSurface4_IsLost(vidmem_surface); - ok(hr == DD_OK, "Got unexpected hr %#x.\n", hr); + ok(hr == DD_OK, "Got unexpected hr %#lx.\n", hr); }
hr = IDirectDraw4_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 = IDirectDraw4_TestCooperativeLevel(ddraw); - ok(hr == DD_OK, "Got unexpected hr %#x.\n", hr); + ok(hr == DD_OK, "Got unexpected hr %#lx.\n", hr); hr = IDirectDrawSurface4_IsLost(surface); - ok(hr == DD_OK, "Got unexpected hr %#x.\n", hr); + ok(hr == DD_OK, "Got unexpected hr %#lx.\n", hr); hr = IDirectDrawSurface4_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 = IDirectDrawSurface4_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 = IDirectDrawSurface4_IsLost(vidmem_surface); - ok(hr == DD_OK, "Got unexpected hr %#x.\n", hr); + ok(hr == DD_OK, "Got unexpected hr %#lx.\n", hr); }
hr = IDirectDraw4_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 = IDirectDraw4_TestCooperativeLevel(ddraw); - ok(hr == DD_OK, "Got unexpected hr %#x.\n", hr); + ok(hr == DD_OK, "Got unexpected hr %#lx.\n", hr); hr = IDirectDrawSurface4_IsLost(surface); - ok(hr == DD_OK, "Got unexpected hr %#x.\n", hr); + ok(hr == DD_OK, "Got unexpected hr %#lx.\n", hr); hr = IDirectDrawSurface4_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 = IDirectDrawSurface4_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 = IDirectDrawSurface4_IsLost(vidmem_surface); - ok(hr == DD_OK, "Got unexpected hr %#x.\n", hr); + ok(hr == DD_OK, "Got unexpected hr %#lx.\n", hr); }
hr = IDirectDraw4_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 = IDirectDraw4_TestCooperativeLevel(ddraw); - ok(hr == DD_OK, "Got unexpected hr %#x.\n", hr); + ok(hr == DD_OK, "Got unexpected hr %#lx.\n", hr); hr = IDirectDrawSurface4_IsLost(surface); - ok(hr == DD_OK, "Got unexpected hr %#x.\n", hr); + ok(hr == DD_OK, "Got unexpected hr %#lx.\n", hr); hr = IDirectDrawSurface4_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 = IDirectDrawSurface4_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 = IDirectDrawSurface4_IsLost(vidmem_surface); - ok(hr == DD_OK, "Got unexpected hr %#x.\n", hr); + ok(hr == DD_OK, "Got unexpected hr %#lx.\n", hr); }
hr = IDirectDraw4_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 = IDirectDraw4_TestCooperativeLevel(ddraw); - ok(hr == DD_OK, "Got unexpected hr %#x.\n", hr); + ok(hr == DD_OK, "Got unexpected hr %#lx.\n", hr); hr = IDirectDrawSurface4_IsLost(surface); - ok(hr == DD_OK, "Got unexpected hr %#x.\n", hr); + ok(hr == DD_OK, "Got unexpected hr %#lx.\n", hr); hr = IDirectDrawSurface4_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 = IDirectDrawSurface4_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 = IDirectDrawSurface4_IsLost(vidmem_surface); - ok(hr == DD_OK, "Got unexpected hr %#x.\n", hr); + ok(hr == DD_OK, "Got unexpected hr %#lx.\n", hr); }
hr = IDirectDraw4_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 = IDirectDraw4_TestCooperativeLevel(ddraw); - ok(hr == DD_OK, "Got unexpected hr %#x.\n", hr); + ok(hr == DD_OK, "Got unexpected hr %#lx.\n", hr); hr = IDirectDrawSurface4_IsLost(surface); - ok(hr == DDERR_SURFACELOST, "Got unexpected hr %#x.\n", hr); + ok(hr == DDERR_SURFACELOST, "Got unexpected hr %#lx.\n", hr); hr = IDirectDrawSurface4_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 = IDirectDrawSurface4_IsLost(vidmem_surface); - ok(hr == DDERR_SURFACELOST, "Got unexpected hr %#x.\n", hr); + ok(hr == DDERR_SURFACELOST, "Got unexpected hr %#lx.\n", hr); }
hr = IDirectDrawSurface4_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);
memset(&caps, 0, sizeof(caps)); caps.dwCaps = DDSCAPS_FLIP;
hr = IDirectDrawSurface4_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 = IDirectDrawSurface4_Restore(surface); - ok(hr == DD_OK, "Got unexpected hr %#x.\n", hr); + ok(hr == DD_OK, "Got unexpected hr %#lx.\n", hr); hr = IDirectDrawSurface4_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 = IDirectDrawSurface4_IsLost(back_buffer); - ok(hr == DD_OK, "Got unexpected hr %#x.\n", hr); + ok(hr == DD_OK, "Got unexpected hr %#lx.\n", hr); IDirectDrawSurface4_Release(back_buffer);
if (vidmem_surface) @@ -10591,7 +10574,7 @@ static void test_lost_device(void) IDirectDrawSurface4_Release(sysmem_surface); IDirectDrawSurface4_Release(surface); refcount = IDirectDraw4_Release(ddraw); - ok(!refcount, "Got unexpected refcount %u.\n", refcount); + ok(!refcount, "Got unexpected refcount %lu.\n", refcount); DestroyWindow(window2); DestroyWindow(window1); } @@ -10609,7 +10592,7 @@ static void test_surface_desc_lock(void) ddraw = create_ddraw(); ok(!!ddraw, "Failed to create a ddraw object.\n"); hr = IDirectDraw4_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); @@ -10618,36 +10601,36 @@ static void test_surface_desc_lock(void) surface_desc.dwHeight = 16; surface_desc.ddsCaps.dwCaps = DDSCAPS_OFFSCREENPLAIN; hr = IDirectDraw4_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 = IDirectDrawSurface4_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 = IDirectDrawSurface4_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 = IDirectDrawSurface4_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 = IDirectDrawSurface4_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 = IDirectDrawSurface4_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);
IDirectDrawSurface4_Release(surface); refcount = IDirectDraw4_Release(ddraw); - ok(!refcount, "Got unexpected refcount %u.\n", refcount); + ok(!refcount, "Got unexpected refcount %lu.\n", refcount); DestroyWindow(window); }
@@ -10662,9 +10645,9 @@ static void test_texturemapblend(void) IDirect3DDevice3 *device; DWORD texturemapblend; IDirectDraw4 *ddraw; + unsigned int color; IDirect3D3 *d3d; DDCOLORKEY ckey; - D3DCOLOR color; ULONG refcount; DWORD value; HWND window; @@ -10709,23 +10692,23 @@ static void test_texturemapblend(void) }
hr = IDirect3DDevice3_GetDirect3D(device, &d3d); - ok(hr == D3D_OK, "Got unexpected hr %#x.\n", hr); + ok(hr == D3D_OK, "Got unexpected hr %#lx.\n", hr); hr = IDirect3D3_QueryInterface(d3d, &IID_IDirectDraw4, (void **)&ddraw); - ok(hr == D3D_OK, "Got unexpected hr %#x.\n", hr); + ok(hr == D3D_OK, "Got unexpected hr %#lx.\n", hr); hr = IDirect3DDevice3_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 = IDirect3DDevice3_SetCurrentViewport(device, viewport); - ok(hr == D3D_OK, "Got unexpected hr %#x.\n", hr); + ok(hr == D3D_OK, "Got unexpected hr %#lx.\n", hr);
hr = IDirect3DDevice3_GetRenderState(device, D3DRENDERSTATE_TEXTUREMAPBLEND, &texturemapblend); - ok(hr == D3D_OK, "Got unexpected hr %#x.\n", hr); - ok(texturemapblend == D3DTBLEND_MODULATE, "Got unexpected texture map blend %#x.\n", texturemapblend); + ok(hr == D3D_OK, "Got unexpected hr %#lx.\n", hr); + ok(texturemapblend == D3DTBLEND_MODULATE, "Got unexpected texture map blend %#lx.\n", texturemapblend);
hr = IDirect3DDevice3_GetTextureStageState(device, 0, D3DTSS_ALPHAOP, &value); - ok(hr == D3D_OK, "Got unexpected hr %#x.\n", hr); - ok(value == D3DTOP_SELECTARG1, "Got unexpected D3DTSS_ALPHAOP value %#x.\n", value); + ok(hr == D3D_OK, "Got unexpected hr %#lx.\n", hr); + ok(value == D3DTOP_SELECTARG1, "Got unexpected D3DTSS_ALPHAOP value %#lx.\n", value);
/* Test alpha with DDPF_ALPHAPIXELS texture - should be taken from texture * alpha channel. @@ -10747,74 +10730,74 @@ static void test_texturemapblend(void) U4(U4(surface_desc).ddpfPixelFormat).dwBBitMask = 0x000000ff; U5(U4(surface_desc).ddpfPixelFormat).dwRGBAlphaBitMask = 0xff000000; hr = IDirectDraw4_CreateSurface(ddraw, &surface_desc, &surface, NULL); - ok(hr == D3D_OK, "Got unexpected hr %#x.\n", hr); + ok(hr == D3D_OK, "Got unexpected hr %#lx.\n", hr);
hr = IDirectDrawSurface4_QueryInterface(surface, &IID_IDirect3DTexture2, (void **)&texture); - ok(hr == D3D_OK, "Got unexpected hr %#x.\n", hr); + ok(hr == D3D_OK, "Got unexpected hr %#lx.\n", hr); hr = IDirect3DDevice3_SetTexture(device, 0, texture); - ok(hr == D3D_OK, "Got unexpected hr %#x.\n", hr); + ok(hr == D3D_OK, "Got unexpected hr %#lx.\n", hr);
hr = IDirect3DDevice3_GetTextureStageState(device, 0, D3DTSS_ALPHAOP, &value); - ok(hr == D3D_OK, "Got unexpected hr %#x.\n", hr); - ok(value == D3DTOP_SELECTARG1, "Got unexpected D3DTSS_ALPHAOP value %#x.\n", value); + ok(hr == D3D_OK, "Got unexpected hr %#lx.\n", hr); + ok(value == D3DTOP_SELECTARG1, "Got unexpected D3DTSS_ALPHAOP value %#lx.\n", value);
hr = IDirect3DDevice3_SetTexture(device, 0, NULL); - ok(hr == D3D_OK, "Got unexpected hr %#x.\n", hr); + ok(hr == D3D_OK, "Got unexpected hr %#lx.\n", hr);
hr = IDirect3DDevice3_GetTextureStageState(device, 0, D3DTSS_ALPHAOP, &value); - ok(hr == D3D_OK, "Got unexpected hr %#x.\n", hr); - ok(value == D3DTOP_SELECTARG1, "Got unexpected D3DTSS_ALPHAOP value %#x.\n", value); + ok(hr == D3D_OK, "Got unexpected hr %#lx.\n", hr); + ok(value == D3DTOP_SELECTARG1, "Got unexpected D3DTSS_ALPHAOP value %#lx.\n", value);
hr = IDirect3DDevice3_SetTexture(device, 0, texture); - ok(hr == D3D_OK, "Got unexpected hr %#x.\n", hr); + ok(hr == D3D_OK, "Got unexpected hr %#lx.\n", hr);
hr = IDirect3DViewport3_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);
memset(&fx, 0, sizeof(fx)); fx.dwSize = sizeof(fx); U5(fx).dwFillColor = 0xff0000ff; hr = IDirectDrawSurface4_Blt(surface, NULL, NULL, NULL, DDBLT_COLORFILL | DDBLT_WAIT, &fx); - ok(hr == D3D_OK, "Got unexpected hr %#x.\n", hr); + ok(hr == D3D_OK, "Got unexpected hr %#lx.\n", hr); U5(fx).dwFillColor = 0x800000ff; hr = IDirectDrawSurface4_Blt(surface, &rect, NULL, NULL, DDBLT_COLORFILL | DDBLT_WAIT, &fx); - ok(hr == D3D_OK, "Got unexpected hr %#x.\n", hr); + ok(hr == D3D_OK, "Got unexpected 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 = IDirect3DDevice3_SetRenderState(device, D3DRENDERSTATE_CULLMODE, D3DCULL_NONE); - ok(hr == D3D_OK, "Got unexpected hr %#x.\n", hr); + ok(hr == D3D_OK, "Got unexpected hr %#lx.\n", hr); hr = IDirect3DDevice3_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 = IDirect3DDevice3_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 = IDirect3DDevice3_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 = IDirect3DDevice3_SetRenderState(device, D3DRENDERSTATE_ALPHABLENDENABLE, TRUE); - ok(hr == D3D_OK, "Got unexpected hr %#x.\n", hr); + ok(hr == D3D_OK, "Got unexpected hr %#lx.\n", hr);
#if 0 /* Disable the call to test that the device has this state by default. */ hr = IDirect3DDevice3_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); #endif
/* Texture stage state does not change so legacy texture blending stays enabled. */ hr = IDirect3DDevice3_SetTextureStageState(device, 0, D3DTSS_COLOROP, D3DTOP_MODULATE); - ok(hr == D3D_OK, "Got unexpected hr %#x.\n", hr); + ok(hr == D3D_OK, "Got unexpected hr %#lx.\n", hr);
hr = IDirect3DDevice3_BeginScene(device); - ok(hr == D3D_OK, "Got unexpected hr %#x.\n", hr); + ok(hr == D3D_OK, "Got unexpected hr %#lx.\n", hr); hr = IDirect3DDevice3_DrawPrimitive(device, D3DPT_TRIANGLESTRIP, D3DFVF_XYZRHW | D3DFVF_DIFFUSE | D3DFVF_TEX1, &test1_quads[0], 4, 0); - ok(hr == D3D_OK, "Got unexpected hr %#x.\n", hr); + ok(hr == D3D_OK, "Got unexpected hr %#lx.\n", hr); hr = IDirect3DDevice3_DrawPrimitive(device, D3DPT_TRIANGLESTRIP, D3DFVF_XYZRHW | D3DFVF_DIFFUSE | D3DFVF_TEX1, &test1_quads[4], 4, 0); - ok(hr == D3D_OK, "Got unexpected hr %#x.\n", hr); + ok(hr == D3D_OK, "Got unexpected hr %#lx.\n", hr); hr = IDirect3DDevice3_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, 5, 5); ok(compare_color(color, 0x00000080, 2), "Got unexpected color 0x%08x.\n", color); @@ -10827,21 +10810,21 @@ static void test_texturemapblend(void)
/* Turn legacy texture blending off. */ hr = IDirect3DDevice3_SetTextureStageState(device, 0, D3DTSS_ALPHAOP, D3DTOP_SELECTARG2); - ok(hr == D3D_OK, "Got unexpected hr %#x.\n", hr); + ok(hr == D3D_OK, "Got unexpected hr %#lx.\n", hr); hr = IDirect3DDevice3_SetTexture(device, 0, texture); - ok(hr == D3D_OK, "Got unexpected hr %#x.\n", hr); + ok(hr == D3D_OK, "Got unexpected hr %#lx.\n", hr); hr = IDirect3DViewport3_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 = IDirect3DDevice3_BeginScene(device); - ok(hr == D3D_OK, "Got unexpected hr %#x.\n", hr); + ok(hr == D3D_OK, "Got unexpected hr %#lx.\n", hr); hr = IDirect3DDevice3_DrawPrimitive(device, D3DPT_TRIANGLESTRIP, D3DFVF_XYZRHW | D3DFVF_DIFFUSE | D3DFVF_TEX1, &test1_quads[0], 4, 0); - ok(hr == D3D_OK, "Got unexpected hr %#x.\n", hr); + ok(hr == D3D_OK, "Got unexpected hr %#lx.\n", hr); hr = IDirect3DDevice3_DrawPrimitive(device, D3DPT_TRIANGLESTRIP, D3DFVF_XYZRHW | D3DFVF_DIFFUSE | D3DFVF_TEX1, &test1_quads[4], 4, 0); - ok(hr == D3D_OK, "Got unexpected hr %#x.\n", hr); + ok(hr == D3D_OK, "Got unexpected hr %#lx.\n", hr); hr = IDirect3DDevice3_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, 5, 5); ok(compare_color(color, 0x000000ff, 2), "Got unexpected color 0x%08x.\n", color); @@ -10855,21 +10838,21 @@ static void test_texturemapblend(void) /* This doesn't turn legacy texture blending on again, as setting the same * _TEXTUREMAPBLEND value. */ hr = IDirect3DDevice3_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 = IDirect3DDevice3_SetTexture(device, 0, texture); - ok(hr == D3D_OK, "Got unexpected hr %#x.\n", hr); + ok(hr == D3D_OK, "Got unexpected hr %#lx.\n", hr); hr = IDirect3DViewport3_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 = IDirect3DDevice3_BeginScene(device); - ok(hr == D3D_OK, "Got unexpected hr %#x.\n", hr); + ok(hr == D3D_OK, "Got unexpected hr %#lx.\n", hr); hr = IDirect3DDevice3_DrawPrimitive(device, D3DPT_TRIANGLESTRIP, D3DFVF_XYZRHW | D3DFVF_DIFFUSE | D3DFVF_TEX1, &test1_quads[0], 4, 0); - ok(hr == D3D_OK, "Got unexpected hr %#x.\n", hr); + ok(hr == D3D_OK, "Got unexpected hr %#lx.\n", hr); hr = IDirect3DDevice3_DrawPrimitive(device, D3DPT_TRIANGLESTRIP, D3DFVF_XYZRHW | D3DFVF_DIFFUSE | D3DFVF_TEX1, &test1_quads[4], 4, 0); - ok(hr == D3D_OK, "Got unexpected hr %#x.\n", hr); + ok(hr == D3D_OK, "Got unexpected hr %#lx.\n", hr); hr = IDirect3DDevice3_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, 5, 5); ok(compare_color(color, 0x000000ff, 2), "Got unexpected color 0x%08x.\n", color); @@ -10882,23 +10865,23 @@ static void test_texturemapblend(void)
/* Turn legacy texture blending on again. */ hr = IDirect3DDevice3_SetRenderState(device, D3DRENDERSTATE_TEXTUREMAPBLEND, D3DTBLEND_ADD); - ok(hr == D3D_OK, "Got unexpected hr %#x.\n", hr); + ok(hr == D3D_OK, "Got unexpected hr %#lx.\n", hr); hr = IDirect3DDevice3_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 = IDirect3DDevice3_SetTexture(device, 0, texture); - ok(hr == D3D_OK, "Got unexpected hr %#x.\n", hr); + ok(hr == D3D_OK, "Got unexpected hr %#lx.\n", hr); hr = IDirect3DViewport3_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 = IDirect3DDevice3_BeginScene(device); - ok(hr == D3D_OK, "Got unexpected hr %#x.\n", hr); + ok(hr == D3D_OK, "Got unexpected hr %#lx.\n", hr); hr = IDirect3DDevice3_DrawPrimitive(device, D3DPT_TRIANGLESTRIP, D3DFVF_XYZRHW | D3DFVF_DIFFUSE | D3DFVF_TEX1, &test1_quads[0], 4, 0); - ok(hr == D3D_OK, "Got unexpected hr %#x.\n", hr); + ok(hr == D3D_OK, "Got unexpected hr %#lx.\n", hr); hr = IDirect3DDevice3_DrawPrimitive(device, D3DPT_TRIANGLESTRIP, D3DFVF_XYZRHW | D3DFVF_DIFFUSE | D3DFVF_TEX1, &test1_quads[4], 4, 0); - ok(hr == D3D_OK, "Got unexpected hr %#x.\n", hr); + ok(hr == D3D_OK, "Got unexpected hr %#lx.\n", hr); hr = IDirect3DDevice3_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, 5, 5); ok(compare_color(color, 0x00000080, 2), "Got unexpected color 0x%08x.\n", color); @@ -10910,10 +10893,10 @@ static void test_texturemapblend(void) ok(compare_color(color, 0x000000ff, 2), "Got unexpected color 0x%08x.\n", color);
hr = IDirect3DDevice3_SetTexture(device, 0, NULL); - ok(hr == D3D_OK, "Got unexpected hr %#x.\n", hr); + ok(hr == D3D_OK, "Got unexpected hr %#lx.\n", hr); IDirect3DTexture2_Release(texture); refcount = IDirectDrawSurface4_Release(surface); - ok(!refcount, "Surface not properly released, refcount %u.\n", refcount); + ok(!refcount, "Unexpected refcount %lu.\n", refcount);
/* Test alpha with texture that has no alpha channel - alpha should be * taken from diffuse vertex color. */ @@ -10931,37 +10914,37 @@ static void test_texturemapblend(void) U4(U4(surface_desc).ddpfPixelFormat).dwBBitMask = 0x000000ff;
hr = IDirectDraw4_CreateSurface(ddraw, &surface_desc, &surface, NULL); - ok(hr == D3D_OK, "Got unexpected hr %#x.\n", hr); + ok(hr == D3D_OK, "Got unexpected hr %#lx.\n", hr);
hr = IDirectDrawSurface4_QueryInterface(surface, &IID_IDirect3DTexture2, (void **)&texture); - ok(hr == D3D_OK, "Got unexpected hr %#x.\n", hr); + ok(hr == D3D_OK, "Got unexpected hr %#lx.\n", hr); hr = IDirect3DDevice3_SetTexture(device, 0, texture); - ok(hr == D3D_OK, "Got unexpected hr %#x.\n", hr); + ok(hr == D3D_OK, "Got unexpected hr %#lx.\n", hr);
hr = IDirect3DDevice3_GetTextureStageState(device, 0, D3DTSS_ALPHAOP, &value); - ok(hr == D3D_OK, "Got unexpected hr %#x.\n", hr); - ok(value == D3DTOP_SELECTARG2, "Got unexpected D3DTSS_ALPHAOP value %#x.\n", value); + ok(hr == D3D_OK, "Got unexpected hr %#lx.\n", hr); + ok(value == D3DTOP_SELECTARG2, "Got unexpected D3DTSS_ALPHAOP value %#lx.\n", value);
hr = IDirect3DViewport3_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);
U5(fx).dwFillColor = 0xff0000ff; hr = IDirectDrawSurface4_Blt(surface, NULL, NULL, NULL, DDBLT_COLORFILL | DDBLT_WAIT, &fx); - ok(hr == D3D_OK, "Got unexpected hr %#x.\n", hr); + ok(hr == D3D_OK, "Got unexpected hr %#lx.\n", hr); U5(fx).dwFillColor = 0x800000ff; hr = IDirectDrawSurface4_Blt(surface, &rect, NULL, NULL, DDBLT_COLORFILL | DDBLT_WAIT, &fx); - ok(hr == D3D_OK, "Got unexpected hr %#x.\n", hr); + ok(hr == D3D_OK, "Got unexpected hr %#lx.\n", hr);
hr = IDirect3DDevice3_BeginScene(device); - ok(hr == D3D_OK, "Got unexpected hr %#x.\n", hr); + ok(hr == D3D_OK, "Got unexpected hr %#lx.\n", hr); hr = IDirect3DDevice3_DrawPrimitive(device, D3DPT_TRIANGLESTRIP, D3DFVF_XYZRHW | D3DFVF_DIFFUSE | D3DFVF_TEX1, &test1_quads[0], 4, 0); - ok(hr == D3D_OK, "Got unexpected hr %#x.\n", hr); + ok(hr == D3D_OK, "Got unexpected hr %#lx.\n", hr); hr = IDirect3DDevice3_DrawPrimitive(device, D3DPT_TRIANGLESTRIP, D3DFVF_XYZRHW | D3DFVF_DIFFUSE | D3DFVF_TEX1, &test1_quads[4], 4, 0); - ok(hr == D3D_OK, "Got unexpected hr %#x.\n", hr); + ok(hr == D3D_OK, "Got unexpected hr %#lx.\n", hr); hr = IDirect3DDevice3_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, 5, 5); ok(compare_color(color, 0x000000ff, 2), "Got unexpected color 0x%08x.\n", color); @@ -10973,10 +10956,10 @@ static void test_texturemapblend(void) ok(compare_color(color, 0x00000080, 2), "Got unexpected color 0x%08x.\n", color);
hr = IDirect3DDevice3_SetTexture(device, 0, NULL); - ok(SUCCEEDED(hr), "Failed to set texture, hr %#x.\n", hr); + ok(SUCCEEDED(hr), "Failed to set texture, hr %#lx.\n", hr); IDirect3DTexture2_Release(texture); refcount = IDirectDrawSurface4_Release(surface); - ok(!refcount, "Surface not properly released, refcount %u.\n", refcount); + ok(!refcount, "Unexpected refcount %lu.\n", refcount);
/* Test RGB - should multiply color components from diffuse vertex color * and texture. */ @@ -10994,36 +10977,36 @@ static void test_texturemapblend(void) U4(U4(surface_desc).ddpfPixelFormat).dwBBitMask = 0x000000ff; U5(U4(surface_desc).ddpfPixelFormat).dwRGBAlphaBitMask = 0xff000000; hr = IDirectDraw4_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 = IDirectDrawSurface4_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 = IDirect3DDevice3_SetTexture(device, 0, texture); - ok(SUCCEEDED(hr), "Failed to set texture, hr %#x.\n", hr); + ok(SUCCEEDED(hr), "Failed to set texture, hr %#lx.\n", hr);
hr = IDirect3DViewport3_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 = IDirectDrawSurface4_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 = IDirectDrawSurface4_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 = IDirect3DDevice3_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 = IDirect3DDevice3_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 = IDirect3DDevice3_DrawPrimitive(device, D3DPT_TRIANGLESTRIP, D3DFVF_XYZRHW | D3DFVF_DIFFUSE | D3DFVF_TEX1, &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 = IDirect3DDevice3_DrawPrimitive(device, D3DPT_TRIANGLESTRIP, D3DFVF_XYZRHW | D3DFVF_DIFFUSE | D3DFVF_TEX1, &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 = IDirect3DDevice3_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); @@ -11035,10 +11018,10 @@ static void test_texturemapblend(void) ok(compare_color(color, 0x008000ff, 2), "Got unexpected color 0x%08x.\n", color);
hr = IDirect3DDevice3_SetTexture(device, 0, NULL); - ok(SUCCEEDED(hr), "Failed to set texture, hr %#x.\n", hr); + ok(SUCCEEDED(hr), "Failed to set texture, hr %#lx.\n", hr); IDirect3DTexture2_Release(texture); refcount = IDirectDrawSurface4_Release(surface); - ok(!refcount, "Surface not properly released, refcount %u.\n", refcount); + ok(!refcount, "Unexpected refcount %lu.\n", refcount);
/* Test alpha again, now with color keyed texture (colorkey emulation in * wine can interfere). */ @@ -11056,43 +11039,43 @@ static void test_texturemapblend(void) U4(U4(surface_desc).ddpfPixelFormat).dwBBitMask = 0x001f;
hr = IDirectDraw4_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 = IDirectDrawSurface4_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 = IDirect3DDevice3_SetTexture(device, 0, texture); - ok(SUCCEEDED(hr), "Failed to set texture, hr %#x.\n", hr); + ok(SUCCEEDED(hr), "Failed to set texture, hr %#lx.\n", hr);
hr = IDirect3DViewport3_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 = IDirectDrawSurface4_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 = IDirectDrawSurface4_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 = IDirectDrawSurface4_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 = IDirect3DDevice3_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 = IDirect3DDevice3_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 = IDirect3DDevice3_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 = IDirect3DDevice3_DrawPrimitive(device, D3DPT_TRIANGLESTRIP, D3DFVF_XYZRHW | D3DFVF_DIFFUSE | D3DFVF_TEX1, &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 = IDirect3DDevice3_DrawPrimitive(device, D3DPT_TRIANGLESTRIP, D3DFVF_XYZRHW | D3DFVF_DIFFUSE | D3DFVF_TEX1, &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 = IDirect3DDevice3_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); @@ -11104,22 +11087,23 @@ static void test_texturemapblend(void) ok(compare_color(color, 0x00800000, 2), "Got unexpected color 0x%08x.\n", color);
hr = IDirect3DDevice3_SetTexture(device, 0, NULL); - ok(SUCCEEDED(hr), "Failed to set texture, hr %#x.\n", hr); + ok(SUCCEEDED(hr), "Failed to set texture, hr %#lx.\n", hr); IDirect3DTexture2_Release(texture); refcount = IDirectDrawSurface4_Release(surface); - ok(!refcount, "Surface not properly released, refcount %u.\n", refcount); + ok(!refcount, "Unexpected refcount %lu.\n", refcount);
destroy_viewport(device, viewport); IDirectDrawSurface4_Release(rt); IDirect3DDevice3_Release(device); IDirect3D3_Release(d3d); refcount = IDirectDraw4_Release(ddraw); - ok(!refcount, "Ddraw object not properly released, refcount %u.\n", refcount); + ok(!refcount, "Ddraw object not properly released, refcount %lu.\n", refcount); DestroyWindow(window); }
static void test_signed_formats(void) { + unsigned int color, expected_color; HRESULT hr; IDirect3DDevice3 *device; IDirect3D3 *d3d; @@ -11130,7 +11114,6 @@ static void test_signed_formats(void) DDSURFACEDESC2 surface_desc; ULONG refcount; HWND window; - D3DCOLOR color, expected_color; D3DRECT clear_rect; static struct { @@ -11202,7 +11185,7 @@ static void test_signed_formats(void) }, /* No V16U16 or Q8W8V8U8 support in ddraw. */ }; - static const D3DCOLOR expected_colors[4][4] = + static const unsigned int expected_colors[4][4] = { {0x00808080, 0x00fefeff, 0x00010780, 0x008080ff}, {0x00018080, 0x00800180, 0x0080fe80, 0x00fe8080}, @@ -11225,7 +11208,7 @@ static void test_signed_formats(void) memset(&hel_desc, 0, sizeof(hel_desc)); hel_desc.dwSize = sizeof(hel_desc); hr = IDirect3DDevice3_GetCaps(device, &device_desc, &hel_desc); - ok(SUCCEEDED(hr), "Failed to get device caps, hr %#x.\n", hr); + ok(SUCCEEDED(hr), "Failed to get device caps, hr %#lx.\n", hr); if (!(device_desc.dwTextureOpCaps & D3DTEXOPCAPS_BLENDFACTORALPHA)) { skip("D3DTOP_BLENDFACTORALPHA not supported, skipping bumpmap format tests.\n"); @@ -11233,43 +11216,43 @@ static void test_signed_formats(void) }
hr = IDirect3DDevice3_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 = IDirect3D3_QueryInterface(d3d, &IID_IDirectDraw4, (void **)&ddraw); - ok(SUCCEEDED(hr), "Failed to get ddraw interface, hr %#x.\n", hr); + ok(SUCCEEDED(hr), "Failed to get ddraw interface, hr %#lx.\n", hr); hr = IDirect3DDevice3_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); hr = IDirectDrawSurface4_GetSurfaceDesc(rt, &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); viewport = create_viewport(device, 0, 0, surface_desc.dwWidth, surface_desc.dwHeight); hr = IDirect3DDevice3_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); U1(clear_rect).x1 = 0; U2(clear_rect).y1 = 0; U3(clear_rect).x2 = surface_desc.dwWidth; U4(clear_rect).y2 = surface_desc.dwHeight;
hr = IDirect3DDevice3_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);
/* dst = tex * 0.5 + 1.0 * (1.0 - 0.5) = tex * 0.5 + 0.5 */ hr = IDirect3DDevice3_SetRenderState(device, D3DRENDERSTATE_TEXTUREFACTOR, 0x80ffffff); - 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 = IDirect3DDevice3_SetTextureStageState(device, 0, D3DTSS_COLOROP, D3DTOP_BLENDFACTORALPHA); - ok(SUCCEEDED(hr), "Failed to set texture stage state, hr %#x.\n", hr); + ok(SUCCEEDED(hr), "Failed to set texture stage state, hr %#lx.\n", hr); hr = IDirect3DDevice3_SetTextureStageState(device, 0, D3DTSS_COLORARG1, D3DTA_TEXTURE); - ok(SUCCEEDED(hr), "Failed to set texture stage state, hr %#x.\n", hr); + ok(SUCCEEDED(hr), "Failed to set texture stage state, hr %#lx.\n", hr); hr = IDirect3DDevice3_SetTextureStageState(device, 0, D3DTSS_COLORARG2, D3DTA_TFACTOR); - ok(SUCCEEDED(hr), "Failed to set texture stage state, hr %#x.\n", hr); + ok(SUCCEEDED(hr), "Failed to set texture stage state, hr %#lx.\n", hr);
for (i = 0; i < ARRAY_SIZE(formats); i++) { for (width = 1; width < 5; width += 3) { hr = IDirect3DViewport3_Clear2(viewport, 1, &clear_rect, D3DCLEAR_TARGET, 0x00000000, 0.0f, 0); - ok(SUCCEEDED(hr), "Failed to clear viewport, hr %#x.\n", hr); + ok(SUCCEEDED(hr), "Failed to clear viewport, hr %#lx.\n", hr);
memset(&surface_desc, 0, sizeof(surface_desc)); surface_desc.dwSize = sizeof(surface_desc); @@ -11284,19 +11267,19 @@ static void test_signed_formats(void) skip("%s textures not supported, skipping.\n", formats[i].name); continue; } - ok(SUCCEEDED(hr), "Failed to create surface, hr %#x, format %s.\n", hr, formats[i].name); + ok(SUCCEEDED(hr), "Failed to create surface, hr %#lx, format %s.\n", hr, formats[i].name);
hr = IDirectDrawSurface4_QueryInterface(surface, &IID_IDirect3DTexture2, (void **)&texture); - ok(SUCCEEDED(hr), "Failed to get Direct3DTexture2 interface, hr %#x, format %s.\n", + ok(SUCCEEDED(hr), "Failed to get Direct3DTexture2 interface, hr %#lx, format %s.\n", hr, formats[i].name); hr = IDirect3DDevice3_SetTexture(device, 0, texture); - ok(SUCCEEDED(hr), "Failed to set texture, hr %#x, format %s.\n", hr, formats[i].name); + ok(SUCCEEDED(hr), "Failed to set texture, hr %#lx, format %s.\n", hr, formats[i].name); IDirect3DTexture2_Release(texture);
memset(&surface_desc, 0, sizeof(surface_desc)); surface_desc.dwSize = sizeof(surface_desc); hr = IDirectDrawSurface4_Lock(surface, NULL, &surface_desc, 0, NULL); - ok(SUCCEEDED(hr), "Failed to lock surface, hr %#x, format %s.\n", hr, formats[i].name); + ok(SUCCEEDED(hr), "Failed to lock surface, hr %#lx, format %s.\n", hr, formats[i].name); for (y = 0; y < 4; y++) { memcpy((char *)surface_desc.lpSurface + y * U1(surface_desc).lPitch, @@ -11304,15 +11287,15 @@ static void test_signed_formats(void) width * formats[i].pixel_size); } hr = IDirectDrawSurface4_Unlock(surface, NULL); - ok(SUCCEEDED(hr), "Failed to unlock surface, hr %#x, format %s.\n", hr, formats[i].name); + ok(SUCCEEDED(hr), "Failed to unlock surface, hr %#lx, format %s.\n", hr, formats[i].name);
hr = IDirect3DDevice3_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 = IDirect3DDevice3_DrawPrimitive(device, D3DPT_TRIANGLESTRIP, D3DFVF_XYZ | D3DFVF_TEX1, quad, 4, 0); - ok(SUCCEEDED(hr), "Failed to draw, hr %#x.\n", hr); + ok(SUCCEEDED(hr), "Failed to draw, hr %#lx.\n", hr); hr = IDirect3DDevice3_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 (y = 0; y < 4; y++) { @@ -11341,7 +11324,7 @@ static void test_signed_formats(void)
done: refcount = IDirect3DDevice3_Release(device); - ok(!refcount, "Device has %u references left.\n", refcount); + ok(!refcount, "Device has %lu references left.\n", refcount); DestroyWindow(window); }
@@ -11353,13 +11336,12 @@ static void test_color_fill(void) IDirectDraw4 *ddraw; IDirectDrawSurface4 *surface, *surface2; DDSURFACEDESC2 surface_desc; + unsigned int i, *color; DDPIXELFORMAT z_fmt; ULONG refcount; HWND window; - unsigned int i; DDBLTFX fx; RECT rect = {5, 5, 7, 7}; - DWORD *color; DWORD supported_fmts = 0, num_fourcc_codes, *fourcc_codes; DDCAPS hal_caps; static const struct @@ -11368,7 +11350,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; } @@ -11532,9 +11514,9 @@ static void test_color_fill(void) }
hr = IDirect3DDevice3_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 = IDirect3D3_QueryInterface(d3d, &IID_IDirectDraw4, (void **)&ddraw); - ok(SUCCEEDED(hr), "Failed to get ddraw interface, hr %#x.\n", hr); + ok(SUCCEEDED(hr), "Failed to get ddraw interface, hr %#lx.\n", hr);
memset(&z_fmt, 0, sizeof(z_fmt)); IDirect3D3_EnumZBufferFormats(d3d, &IID_IDirect3DHALDevice, enum_z_fmt, &z_fmt); @@ -11548,13 +11530,13 @@ static void test_color_fill(void) IDirect3D3_Release(d3d);
hr = IDirectDraw4_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 = IDirectDraw4_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')) @@ -11567,7 +11549,7 @@ static void test_color_fill(void) memset(&hal_caps, 0, sizeof(hal_caps)); hal_caps.dwSize = sizeof(hal_caps); hr = IDirectDraw4_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 (!(supported_fmts & (SUPPORT_YUY2 | SUPPORT_UYVY)) || !(hal_caps.dwCaps & DDCAPS_OVERLAY)) skip("Overlays or some YUV formats not supported, skipping YUV colorfill tests.\n"); @@ -11622,16 +11604,16 @@ static void test_color_fill(void) }
hr = IDirectDraw4_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 = IDirectDrawSurface4_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 = IDirectDrawSurface4_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) @@ -11639,19 +11621,19 @@ static void test_color_fill(void) memset(&surface_desc, 0, sizeof(surface_desc)); surface_desc.dwSize = sizeof(surface_desc); hr = IDirectDrawSurface4_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 = IDirectDrawSurface4_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 = IDirectDrawSurface4_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 = IDirectDrawSurface4_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) @@ -11659,22 +11641,22 @@ static void test_color_fill(void) memset(&surface_desc, 0, sizeof(surface_desc)); surface_desc.dwSize = sizeof(surface_desc); hr = IDirectDrawSurface4_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 & U3(z_fmt).dwZBitMask) == (tests[i].result & U3(z_fmt).dwZBitMask) || broken((*color & U3(z_fmt).dwZBitMask) == (expected_broken & U3(z_fmt).dwZBitMask)), - "Got clear result 0x%08x, expected 0x%08x, surface %s.\n", + "Got clear result 0x%08lx, expected 0x%08lx, surface %s.\n", *color & U3(z_fmt).dwZBitMask, tests[i].result & U3(z_fmt).dwZBitMask, tests[i].name); hr = IDirectDrawSurface4_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 = IDirectDrawSurface4_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) @@ -11682,19 +11664,19 @@ static void test_color_fill(void) memset(&surface_desc, 0, sizeof(surface_desc)); surface_desc.dwSize = sizeof(surface_desc); hr = IDirectDrawSurface4_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 = IDirectDrawSurface4_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 = IDirectDrawSurface4_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) @@ -11702,13 +11684,13 @@ static void test_color_fill(void) memset(&surface_desc, 0, sizeof(surface_desc)); surface_desc.dwSize = sizeof(surface_desc); hr = IDirectDrawSurface4_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 = IDirectDrawSurface4_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); }
IDirectDrawSurface4_Release(surface); @@ -11732,78 +11714,78 @@ static void test_color_fill(void) U4(U4(surface_desc).ddpfPixelFormat).dwBBitMask = 0x000000ff; surface_desc.ddsCaps.dwCaps = DDSCAPS_OFFSCREENPLAIN | DDSCAPS_SYSTEMMEMORY; hr = IDirectDraw4_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 = IDirectDraw4_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 = IDirectDrawSurface4_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 = IDirectDrawSurface4_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 = IDirectDrawSurface4_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 = IDirectDrawSurface4_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 = IDirectDrawSurface4_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 = IDirectDrawSurface4_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 = IDirectDrawSurface4_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 = IDirectDrawSurface4_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 = IDirectDrawSurface4_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 = IDirectDrawSurface4_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 = IDirectDrawSurface4_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 = IDirectDrawSurface4_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 = IDirectDrawSurface4_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 = IDirectDrawSurface4_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 = IDirectDrawSurface4_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 = IDirectDrawSurface4_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 = IDirectDrawSurface4_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 = IDirectDrawSurface4_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 = IDirectDrawSurface4_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 = IDirectDrawSurface4_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 = IDirectDrawSurface4_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 = IDirectDrawSurface4_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 = IDirectDrawSurface4_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 = IDirectDrawSurface4_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); }
IDirectDrawSurface4_Release(surface2); @@ -11820,54 +11802,54 @@ static void test_color_fill(void) U4(surface_desc).ddpfPixelFormat = z_fmt; surface_desc.ddsCaps.dwCaps = DDSCAPS_ZBUFFER; hr = IDirectDraw4_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 = IDirectDraw4_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 = IDirectDrawSurface4_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 = IDirectDrawSurface4_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 = IDirectDrawSurface4_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 = IDirectDrawSurface4_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 = IDirectDrawSurface4_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 = IDirectDrawSurface4_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 = IDirectDrawSurface4_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 = IDirectDrawSurface4_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 = IDirectDrawSurface4_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 = IDirectDrawSurface4_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 = IDirectDrawSurface4_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 = IDirectDrawSurface4_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 = IDirectDrawSurface4_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 = IDirectDrawSurface4_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);
IDirectDrawSurface4_Release(surface2); IDirectDrawSurface4_Release(surface); @@ -11875,7 +11857,7 @@ static void test_color_fill(void) done: IDirectDraw4_Release(ddraw); refcount = IDirect3DDevice3_Release(device); - ok(!refcount, "Device has %u references left.\n", refcount); + ok(!refcount, "Device has %lu references left.\n", refcount); DestroyWindow(window); }
@@ -11898,6 +11880,7 @@ static void test_texcoordindex(void) static const DWORD fvf = D3DFVF_XYZ | D3DFVF_TEX3; static D3DRECT clear_rect = {{0}, {0}, {640}, {480}}; IDirect3DDevice3 *device; + unsigned int color; IDirect3D3 *d3d; IDirectDraw4 *ddraw; IDirectDrawSurface4 *rt; @@ -11908,7 +11891,6 @@ static void test_texcoordindex(void) IDirect3DTexture2 *texture1, *texture2; DDSURFACEDESC2 surface_desc; ULONG refcount; - D3DCOLOR color; DWORD *ptr;
window = create_window(); @@ -11920,13 +11902,13 @@ static void test_texcoordindex(void) }
hr = IDirect3DDevice3_GetDirect3D(device, &d3d); - ok(SUCCEEDED(hr), "Failed to get Direct3D3 interface, hr %#x.\n", hr); + ok(SUCCEEDED(hr), "Failed to get Direct3D3 interface, hr %#lx.\n", hr); hr = IDirect3D3_QueryInterface(d3d, &IID_IDirectDraw4, (void **)&ddraw); - ok(SUCCEEDED(hr), "Failed to get DirectDraw4 interface, hr %#x.\n", hr); + ok(SUCCEEDED(hr), "Failed to get DirectDraw4 interface, hr %#lx.\n", hr); IDirect3D3_Release(d3d);
hr = IDirect3DDevice3_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); @@ -11942,14 +11924,14 @@ static void test_texcoordindex(void) U4(U4(surface_desc).ddpfPixelFormat).dwBBitMask = 0x000000ff; U5(U4(surface_desc).ddpfPixelFormat).dwRGBAlphaBitMask = 0xff000000; hr = IDirectDraw4_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 = IDirectDraw4_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); hr = IDirectDrawSurface4_Lock(surface1, 0, &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); ptr = surface_desc.lpSurface; ptr[0] = 0xff000000; ptr[1] = 0xff00ff00; @@ -11957,12 +11939,12 @@ static void test_texcoordindex(void) ptr[0] = 0xff0000ff; ptr[1] = 0xff00ffff; hr = IDirectDrawSurface4_Unlock(surface1, 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, 0, sizeof(surface_desc)); surface_desc.dwSize = sizeof(surface_desc); hr = IDirectDrawSurface4_Lock(surface2, 0, &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); ptr = surface_desc.lpSurface; ptr[0] = 0xff000000; ptr[1] = 0xff0000ff; @@ -11970,50 +11952,50 @@ static void test_texcoordindex(void) ptr[0] = 0xffff0000; ptr[1] = 0xffff00ff; hr = IDirectDrawSurface4_Unlock(surface2, 0); - ok(SUCCEEDED(hr), "Failed to unlock surface, hr %#x.\n", hr); + ok(SUCCEEDED(hr), "Failed to unlock surface, hr %#lx.\n", hr);
viewport = create_viewport(device, 0, 0, 640, 480); hr = IDirect3DDevice3_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 = IDirectDrawSurface4_QueryInterface(surface1, &IID_IDirect3DTexture2, (void **)&texture1); - 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 = IDirectDrawSurface4_QueryInterface(surface2, &IID_IDirect3DTexture2, (void **)&texture2); - 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 = IDirect3DDevice3_SetTexture(device, 0, texture1); - ok(SUCCEEDED(hr), "Failed to set texture, hr %#x.\n", hr); + ok(SUCCEEDED(hr), "Failed to set texture, hr %#lx.\n", hr); hr = IDirect3DDevice3_SetTexture(device, 1, texture2); - ok(SUCCEEDED(hr), "Failed to set texture, hr %#x.\n", hr); + ok(SUCCEEDED(hr), "Failed to set texture, hr %#lx.\n", hr); hr = IDirect3DDevice3_SetTextureStageState(device, 0, D3DTSS_COLOROP, D3DTOP_SELECTARG1); - ok(SUCCEEDED(hr), "Failed to set color op, hr %#x.\n", hr); + ok(SUCCEEDED(hr), "Failed to set color op, hr %#lx.\n", hr); hr = IDirect3DDevice3_SetTextureStageState(device, 0, D3DTSS_COLORARG1, D3DTA_TEXTURE); - ok(SUCCEEDED(hr), "Failed to set color arg, hr %#x.\n", hr); + ok(SUCCEEDED(hr), "Failed to set color arg, hr %#lx.\n", hr); hr = IDirect3DDevice3_SetTextureStageState(device, 1, D3DTSS_COLOROP, D3DTOP_ADD); - ok(SUCCEEDED(hr), "Failed to set color op, hr %#x.\n", hr); + ok(SUCCEEDED(hr), "Failed to set color op, hr %#lx.\n", hr); hr = IDirect3DDevice3_SetTextureStageState(device, 1, D3DTSS_COLORARG1, D3DTA_TEXTURE); - ok(SUCCEEDED(hr), "Failed to set color arg, hr %#x.\n", hr); + ok(SUCCEEDED(hr), "Failed to set color arg, hr %#lx.\n", hr); hr = IDirect3DDevice3_SetTextureStageState(device, 1, D3DTSS_COLORARG2, D3DTA_CURRENT); - ok(SUCCEEDED(hr), "Failed to set color arg, hr %#x.\n", hr); + ok(SUCCEEDED(hr), "Failed to set color arg, hr %#lx.\n", hr); hr = IDirect3DDevice3_SetTextureStageState(device, 2, D3DTSS_COLOROP, D3DTOP_DISABLE); - ok(SUCCEEDED(hr), "Failed to set color op, hr %#x.\n", hr); + ok(SUCCEEDED(hr), "Failed to set color op, hr %#lx.\n", hr);
hr = IDirect3DDevice3_SetTextureStageState(device, 0, D3DTSS_TEXCOORDINDEX, 1); - ok(SUCCEEDED(hr), "Failed to set texcoord index, hr %#x.\n", hr); + ok(SUCCEEDED(hr), "Failed to set texcoord index, hr %#lx.\n", hr); hr = IDirect3DDevice3_SetTextureStageState(device, 1, D3DTSS_TEXCOORDINDEX, 0); - ok(SUCCEEDED(hr), "Failed to set texcoord index, hr %#x.\n", hr); + ok(SUCCEEDED(hr), "Failed to set texcoord index, hr %#lx.\n", hr);
hr = IDirect3DDevice3_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 = IDirect3DViewport3_Clear2(viewport, 1, &clear_rect, D3DCLEAR_TARGET, 0xffffff00, 1.0f, 0); - ok(SUCCEEDED(hr), "Failed to clear, hr %#x.\n", hr); + ok(SUCCEEDED(hr), "Failed to clear, hr %#lx.\n", hr);
hr = IDirect3DDevice3_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 = IDirect3DDevice3_DrawPrimitive(device, D3DPT_TRIANGLESTRIP, fvf, quad, 4, 0); - ok(SUCCEEDED(hr), "Failed to draw, hr %#x.\n", hr); + ok(SUCCEEDED(hr), "Failed to draw, hr %#lx.\n", hr); hr = IDirect3DDevice3_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, 120); ok(compare_color(color, 0x000000ff, 2), "Got unexpected color 0x%08x.\n", color); @@ -12027,17 +12009,17 @@ static void test_texcoordindex(void) /* D3DTSS_TEXTURETRANSFORMFLAGS was introduced in D3D7, can't test it here. */
hr = IDirect3DDevice3_SetTextureStageState(device, 1, D3DTSS_TEXCOORDINDEX, 2); - ok(SUCCEEDED(hr), "Failed to set texcoord index, hr %#x.\n", hr); + ok(SUCCEEDED(hr), "Failed to set texcoord index, hr %#lx.\n", hr);
hr = IDirect3DViewport3_Clear2(viewport, 1, &clear_rect, D3DCLEAR_TARGET, 0xffffff00, 1.0f, 0); - ok(SUCCEEDED(hr), "Failed to clear, hr %#x.\n", hr); + ok(SUCCEEDED(hr), "Failed to clear, hr %#lx.\n", hr);
hr = IDirect3DDevice3_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 = IDirect3DDevice3_DrawPrimitive(device, D3DPT_TRIANGLESTRIP, fvf, quad, 4, 0); - ok(SUCCEEDED(hr), "Failed to draw, hr %#x.\n", hr); + ok(SUCCEEDED(hr), "Failed to draw, hr %#lx.\n", hr); hr = IDirect3DDevice3_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, 120); ok(compare_color(color, 0x000000ff, 2), "Got unexpected color 0x%08x.\n", color); @@ -12058,7 +12040,7 @@ static void test_texcoordindex(void) IDirectDrawSurface4_Release(rt); IDirectDraw4_Release(ddraw); refcount = IDirect3DDevice3_Release(device); - ok(!refcount, "Device has %u references left.\n", refcount); + ok(!refcount, "Device has %lu references left.\n", refcount); DestroyWindow(window); }
@@ -12076,6 +12058,7 @@ static void test_colorkey_precision(void) {{ 1.0f, -1.0f, 0.0f}, {1.0f, 1.0f}}, {{ 1.0f, 1.0f, 0.0f}, {1.0f, 0.0f}}, }; + unsigned int data[4] = {0}, color_mask, color, t, c; IDirect3DDevice3 *device; IDirect3D3 *d3d; IDirectDraw4 *ddraw; @@ -12087,11 +12070,8 @@ static void test_colorkey_precision(void) IDirect3DTexture2 *d3d_texture; DDSURFACEDESC2 surface_desc, lock_desc; ULONG refcount; - D3DCOLOR color; - unsigned int t, c; DDCOLORKEY ckey; DDBLTFX fx; - DWORD data[4] = {0}, color_mask; D3DRECT clear_rect = {{0}, {0}, {640}, {480}}; BOOL is_nvidia, is_warp; static const struct @@ -12145,12 +12125,12 @@ static void test_colorkey_precision(void) }
hr = IDirect3DDevice3_GetDirect3D(device, &d3d); - ok(SUCCEEDED(hr), "Failed to get Direct3D3 interface, hr %#x.\n", hr); + ok(SUCCEEDED(hr), "Failed to get Direct3D3 interface, hr %#lx.\n", hr); hr = IDirect3D3_QueryInterface(d3d, &IID_IDirectDraw4, (void **)&ddraw); - ok(SUCCEEDED(hr), "Failed to get DirectDraw4 interface, hr %#x.\n", hr); + ok(SUCCEEDED(hr), "Failed to get DirectDraw4 interface, hr %#lx.\n", hr); IDirect3D3_Release(d3d); hr = IDirect3DDevice3_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 @@ -12163,24 +12143,24 @@ static void test_colorkey_precision(void)
viewport = create_viewport(device, 0, 0, 640, 480); hr = IDirect3DDevice3_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 = IDirect3DDevice3_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 = IDirect3DDevice3_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); /* Multiply the texture read result with 0, that way the result color if the key doesn't * match is constant. In theory color keying works without reading the texture result * (meaning we could just op=arg1, arg1=tfactor), but the Geforce7 Windows driver begs * to differ. */ hr = IDirect3DDevice3_SetTextureStageState(device, 0, D3DTSS_COLOROP, D3DTOP_MODULATE); - ok(SUCCEEDED(hr), "Failed to set color op, hr %#x.\n", hr); + ok(SUCCEEDED(hr), "Failed to set color op, hr %#lx.\n", hr); hr = IDirect3DDevice3_SetTextureStageState(device, 0, D3DTSS_COLORARG1, D3DTA_TEXTURE); - ok(SUCCEEDED(hr), "Failed to set color arg, hr %#x.\n", hr); + ok(SUCCEEDED(hr), "Failed to set color arg, hr %#lx.\n", hr); hr = IDirect3DDevice3_SetTextureStageState(device, 0, D3DTSS_COLORARG2, D3DTA_TFACTOR); - ok(SUCCEEDED(hr), "Failed to set color arg, hr %#x.\n", hr); + ok(SUCCEEDED(hr), "Failed to set color arg, hr %#lx.\n", hr); hr = IDirect3DDevice3_SetRenderState(device, D3DRENDERSTATE_TEXTUREFACTOR, 0x00000000); - 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); @@ -12205,9 +12185,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 = IDirectDraw4_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 = IDirectDraw4_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 @@ -12225,17 +12205,17 @@ static void test_colorkey_precision(void) surface_desc.ddckCKSrcBlt.dwColorSpaceLowValue = c << tests[t].shift; surface_desc.ddckCKSrcBlt.dwColorSpaceHighValue = c << tests[t].shift; hr = IDirectDraw4_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 = IDirect3DDevice3_SetTexture(device, 0, d3d_texture); - ok(SUCCEEDED(hr), "Failed to set texture, hr %#x.\n", hr); + ok(SUCCEEDED(hr), "Failed to set texture, hr %#lx.\n", hr);
hr = IDirectDrawSurface4_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 = IDirectDrawSurface4_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: @@ -12253,21 +12233,21 @@ static void test_colorkey_precision(void) break; } hr = IDirectDrawSurface4_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 = IDirectDrawSurface4_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 = IDirectDrawSurface4_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 = IDirectDrawSurface4_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 = IDirectDrawSurface4_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: @@ -12285,7 +12265,7 @@ static void test_colorkey_precision(void) break; } hr = IDirectDrawSurface4_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) { @@ -12328,14 +12308,14 @@ static void test_colorkey_precision(void) (c + 1) << tests[t].shift, data[2], tests[t].name, c);
hr = IDirect3DViewport3_Clear2(viewport, 1, &clear_rect, D3DCLEAR_TARGET, 0x0000ff00, 1.0f, 0); - ok(SUCCEEDED(hr), "Failed to clear, hr %#x.\n", hr); + ok(SUCCEEDED(hr), "Failed to clear, hr %#lx.\n", hr);
hr = IDirect3DDevice3_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 = IDirect3DDevice3_DrawPrimitive(device, D3DPT_TRIANGLESTRIP, D3DFVF_XYZ | D3DFVF_TEX1, quad, 4, 0); - ok(SUCCEEDED(hr), "Failed to draw, hr %#x.\n", hr); + ok(SUCCEEDED(hr), "Failed to draw, hr %#lx.\n", hr); hr = IDirect3DDevice3_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) @@ -12374,7 +12354,7 @@ static void test_colorkey_precision(void) IDirectDrawSurface4_Release(rt); IDirectDraw4_Release(ddraw); refcount = IDirect3DDevice3_Release(device); - ok(!refcount, "Device has %u references left.\n", refcount); + ok(!refcount, "Device has %lu references left.\n", refcount); DestroyWindow(window); }
@@ -12392,7 +12372,7 @@ static void test_range_colorkey(void) ddraw = create_ddraw(); ok(!!ddraw, "Failed to create a ddraw object.\n"); hr = IDirectDraw4_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); @@ -12411,100 +12391,99 @@ static void test_range_colorkey(void) surface_desc.ddckCKSrcBlt.dwColorSpaceLowValue = 0x00000000; surface_desc.ddckCKSrcBlt.dwColorSpaceHighValue = 0x00000001; hr = IDirectDraw4_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 = IDirectDraw4_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 = IDirectDraw4_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 = IDirectDraw4_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 = IDirectDraw4_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 = IDirectDrawSurface4_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 = IDirectDrawSurface4_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 = IDirectDrawSurface4_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 = IDirectDrawSurface4_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 = IDirectDrawSurface4_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 = IDirectDrawSurface4_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 = IDirectDrawSurface4_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 = IDirectDrawSurface4_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 = IDirectDrawSurface4_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 = IDirectDrawSurface4_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);
IDirectDrawSurface4_Release(surface); refcount = IDirectDraw4_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) { IDirect3DVertexBuffer *vb_strip, *vb_list, *buffer; + unsigned int color0, color1, count, i; IDirect3DViewport3 *viewport; IDirect3DDevice3 *device; D3DVERTEXBUFFERDESC desc; IDirectDrawSurface4 *rt; - DWORD color0, color1; void *data = NULL; IDirect3D3 *d3d; ULONG refcount; - UINT i, count; HWND window; HRESULT hr; static D3DRECT clear_rect = {{0}, {0}, {640}, {480}}; @@ -12534,7 +12513,7 @@ static void test_shademode(void) { DWORD primtype; DWORD shademode; - DWORD color0, color1; + unsigned int color0, color1; } tests[] = { @@ -12555,16 +12534,16 @@ static void test_shademode(void) }
hr = IDirect3DDevice3_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 = IDirect3DDevice3_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 = IDirect3DDevice3_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 = IDirect3DDevice3_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);
memset(&desc, 0, sizeof(desc)); desc.dwSize = sizeof(desc); @@ -12572,21 +12551,21 @@ static void test_shademode(void) desc.dwFVF = D3DFVF_XYZ | D3DFVF_DIFFUSE; desc.dwNumVertices = ARRAY_SIZE(quad_strip); hr = IDirect3D3_CreateVertexBuffer(d3d, &desc, &vb_strip, 0, NULL); - ok(hr == D3D_OK, "Failed to create vertex buffer, hr %#x.\n", hr); + ok(hr == D3D_OK, "Failed to create vertex buffer, hr %#lx.\n", hr); hr = IDirect3DVertexBuffer_Lock(vb_strip, 0, &data, NULL); - ok(hr == D3D_OK, "Failed to lock vertex buffer, hr %#x.\n", hr); + ok(hr == D3D_OK, "Failed to lock vertex buffer, hr %#lx.\n", hr); memcpy(data, quad_strip, sizeof(quad_strip)); hr = IDirect3DVertexBuffer_Unlock(vb_strip); - ok(hr == D3D_OK, "Failed to unlock vertex buffer, hr %#x.\n", hr); + ok(hr == D3D_OK, "Failed to unlock vertex buffer, hr %#lx.\n", hr);
desc.dwNumVertices = ARRAY_SIZE(quad_list); hr = IDirect3D3_CreateVertexBuffer(d3d, &desc, &vb_list, 0, NULL); - ok(hr == D3D_OK, "Failed to create vertex buffer, hr %#x.\n", hr); + ok(hr == D3D_OK, "Failed to create vertex buffer, hr %#lx.\n", hr); hr = IDirect3DVertexBuffer_Lock(vb_list, 0, &data, NULL); - ok(hr == D3D_OK, "Failed to lock vertex buffer, hr %#x.\n", hr); + ok(hr == D3D_OK, "Failed to lock vertex buffer, hr %#lx.\n", hr); memcpy(data, quad_list, sizeof(quad_list)); hr = IDirect3DVertexBuffer_Unlock(vb_list); - ok(hr == D3D_OK, "Failed to unlock vertex buffer, hr %#x.\n", hr); + ok(hr == D3D_OK, "Failed to unlock vertex buffer, 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. */ @@ -12594,19 +12573,19 @@ static void test_shademode(void) for (i = 0; i < ARRAY_SIZE(tests); ++i) { hr = IDirect3DViewport3_Clear2(viewport, 1, &clear_rect, D3DCLEAR_TARGET, 0xffffffff, 0.0f, 0); - ok(SUCCEEDED(hr), "Failed to clear viewport, hr %#x.\n", hr); + ok(SUCCEEDED(hr), "Failed to clear viewport, hr %#lx.\n", hr);
hr = IDirect3DDevice3_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 = IDirect3DDevice3_BeginScene(device); - ok(SUCCEEDED(hr), "Failed to begin scene, hr %#x.\n", hr); + ok(SUCCEEDED(hr), "Failed to begin scene, hr %#lx.\n", hr); buffer = tests[i].primtype == D3DPT_TRIANGLESTRIP ? vb_strip : vb_list; count = tests[i].primtype == D3DPT_TRIANGLESTRIP ? 4 : 6; hr = IDirect3DDevice3_DrawPrimitiveVB(device, tests[i].primtype, buffer, 0, count, 0); - ok(SUCCEEDED(hr), "Failed to draw, hr %#x.\n", hr); + ok(SUCCEEDED(hr), "Failed to draw, hr %#lx.\n", hr); hr = IDirect3DDevice3_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 */ @@ -12628,7 +12607,7 @@ static void test_shademode(void) IDirectDrawSurface4_Release(rt); IDirect3D3_Release(d3d); refcount = IDirect3DDevice3_Release(device); - ok(!refcount, "Device has %u references left.\n", refcount); + ok(!refcount, "Device has %lu references left.\n", refcount); DestroyWindow(window); }
@@ -12689,12 +12668,12 @@ static void test_lockrect_invalid(void) ddraw = create_ddraw(); ok(!!ddraw, "Failed to create a ddraw object.\n"); hr = IDirectDraw4_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 = IDirectDraw4_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 || !(hal_caps.ddsCaps.dwCaps & DDSCAPS2_TEXTUREMANAGE)) { @@ -12721,13 +12700,13 @@ static void test_lockrect_invalid(void) hr = IDirectDraw4_CreateSurface(ddraw, &surface_desc, &surface, NULL); if (!resources[r].allowed) { - ok(hr == DDERR_INVALIDCAPS, "Got unexpected hr %#x, type %s.\n", hr, resources[r].name); + ok(hr == DDERR_INVALIDCAPS, "Got unexpected hr %#lx, type %s.\n", hr, resources[r].name); continue; } - 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 = IDirectDrawSurface4_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) { @@ -12737,11 +12716,11 @@ static void test_lockrect_invalid(void) surface_desc.dwSize = sizeof(surface_desc);
hr = IDirectDrawSurface4_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 = IDirectDrawSurface4_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) @@ -12752,37 +12731,37 @@ static void test_lockrect_invalid(void) surface_desc.dwSize = sizeof(surface_desc);
hr = IDirectDrawSurface4_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 = IDirectDrawSurface4_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 = IDirectDrawSurface4_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 = IDirectDrawSurface4_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 = IDirectDrawSurface4_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 = IDirectDrawSurface4_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 = IDirectDrawSurface4_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 = IDirectDrawSurface4_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);
IDirectDrawSurface4_Release(surface); } @@ -12807,7 +12786,7 @@ static void test_yv12_overlay(void) ddraw = create_ddraw(); ok(!!ddraw, "Failed to create a ddraw object.\n"); hr = IDirectDraw4_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')))) { @@ -12818,17 +12797,17 @@ static void test_yv12_overlay(void) memset(&desc, 0, sizeof(desc)); desc.dwSize = sizeof(desc); hr = IDirectDrawSurface4_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; @@ -12849,7 +12828,7 @@ static void test_yv12_overlay(void) }
hr = IDirectDrawSurface4_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 @@ -12857,12 +12836,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 = IDirectDrawSurface4_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 = IDirectDrawSurface4_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')))) { @@ -12876,14 +12855,14 @@ static void test_yv12_overlay(void) hr = IDirectDrawSurface4_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 = IDirectDrawSurface4_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]); @@ -12893,7 +12872,7 @@ static void test_yv12_overlay(void) ok(base[0] == 0x30, "Got unexpected U data 0x%02x.\n", base[0]);
hr = IDirectDrawSurface4_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); }
IDirectDrawSurface4_Release(dst_surface); @@ -12929,7 +12908,7 @@ static void test_offscreen_overlay(void) ddraw = create_ddraw(); ok(!!ddraw, "Failed to create a ddraw object.\n"); hr = IDirectDraw4_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')))) { @@ -12942,21 +12921,21 @@ static void test_offscreen_overlay(void) surface_desc.dwFlags = DDSD_CAPS; surface_desc.ddsCaps.dwCaps = DDSCAPS_PRIMARYSURFACE; hr = IDirectDraw4_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 = IDirectDrawSurface4_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 = IDirectDrawSurface4_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 = IDirectDrawSurface4_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 = IDirectDrawSurface4_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)); @@ -12973,18 +12952,18 @@ static void test_offscreen_overlay(void) U3(U4(surface_desc).ddpfPixelFormat).dwGBitMask = 0x07e0; U4(U4(surface_desc).ddpfPixelFormat).dwBBitMask = 0x001f; hr = IDirectDraw4_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 = IDirectDrawSurface4_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 = IDirectDrawSurface4_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 = IDirectDrawSurface4_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);
IDirectDrawSurface4_Release(offscreen); IDirectDrawSurface4_Release(primary); @@ -13009,7 +12988,7 @@ static void test_overlay_rect(void) ddraw = create_ddraw(); ok(!!ddraw, "Failed to create a ddraw object.\n"); hr = IDirectDraw4_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')))) { @@ -13022,15 +13001,15 @@ static void test_overlay_rect(void) surface_desc.dwFlags = DDSD_CAPS; surface_desc.ddsCaps.dwCaps = DDSCAPS_PRIMARYSURFACE; hr = IDirectDraw4_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 = IDirectDrawSurface4_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 = IDirectDrawSurface4_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()) @@ -13043,48 +13022,48 @@ static void test_overlay_rect(void) * used. This is not true in Windows Vista and earlier, but changed in * Windows 7. */ hr = IDirectDrawSurface4_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 = IDirectDrawSurface4_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 = IDirectDrawSurface4_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 = IDirectDrawSurface4_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 = IDirectDrawSurface4_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 = IDirectDrawSurface4_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 = IDirectDrawSurface4_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 = IDirectDrawSurface4_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 = IDirectDrawSurface4_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) @@ -13136,12 +13115,12 @@ static void test_blt(void) }
hr = IDirect3DDevice3_GetDirect3D(device, &d3d); - ok(SUCCEEDED(hr), "Failed to get Direct3D3 interface, hr %#x.\n", hr); + ok(SUCCEEDED(hr), "Failed to get Direct3D3 interface, hr %#lx.\n", hr); hr = IDirect3D3_QueryInterface(d3d, &IID_IDirectDraw4, (void **)&ddraw); - ok(SUCCEEDED(hr), "Failed to get DirectDraw4 interface, hr %#x.\n", hr); + ok(SUCCEEDED(hr), "Failed to get DirectDraw4 interface, hr %#lx.\n", hr); IDirect3D3_Release(d3d); hr = IDirect3DDevice3_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); @@ -13150,37 +13129,37 @@ static void test_blt(void) surface_desc.dwHeight = 480; surface_desc.ddsCaps.dwCaps = DDSCAPS_OFFSCREENPLAIN; hr = IDirectDraw4_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 = IDirectDrawSurface4_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 = IDirectDrawSurface4_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 = IDirectDrawSurface4_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 = IDirectDrawSurface4_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 = IDirectDrawSurface4_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 = IDirectDrawSurface4_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); }
IDirectDrawSurface4_Release(surface); IDirectDrawSurface4_Release(rt); IDirectDraw4_Release(ddraw); refcount = IDirect3DDevice3_Release(device); - ok(!refcount, "Device has %u references left.\n", refcount); + ok(!refcount, "Device has %lu references left.\n", refcount); DestroyWindow(window); }
@@ -13208,11 +13187,10 @@ static void test_blt_z_alpha(void) }; IDirectDrawSurface4 *src_surface, *dst_surface; DDSURFACEDESC2 surface_desc; + unsigned int color, i; IDirectDraw4 *ddraw; DDPIXELFORMAT pf; ULONG refcount; - unsigned int i; - D3DCOLOR color; HWND window; HRESULT hr; DDBLTFX fx; @@ -13221,7 +13199,7 @@ static void test_blt_z_alpha(void) ddraw = create_ddraw(); ok(!!ddraw, "Failed to create a ddraw object.\n"); hr = IDirectDraw4_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); @@ -13241,9 +13219,9 @@ static void test_blt_z_alpha(void) surface_desc.ddsCaps.dwCaps = DDSCAPS_OFFSCREENPLAIN;
hr = IDirectDraw4_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 = IDirectDraw4_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); @@ -13263,14 +13241,14 @@ static void test_blt_z_alpha(void) { U5(fx).dwFillColor = 0x3300ff00; hr = IDirectDrawSurface4_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 = IDirectDrawSurface4_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 = IDirectDrawSurface4_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); @@ -13279,7 +13257,7 @@ static void test_blt_z_alpha(void) IDirectDrawSurface4_Release(dst_surface); IDirectDrawSurface4_Release(src_surface); refcount = IDirectDraw4_Release(ddraw); - ok(!refcount, "DirectDraw has %u references left.\n", refcount); + ok(!refcount, "DirectDraw has %lu references left.\n", refcount); DestroyWindow(window); }
@@ -13290,9 +13268,9 @@ static void test_cross_device_blt(void) IDirectDraw4 *ddraw, *ddraw2; DDSURFACEDESC2 surface_desc; HWND window, window2; + unsigned int color; IDirect3D3 *d3d; ULONG refcount; - D3DCOLOR color; DDBLTFX fx; HRESULT hr;
@@ -13315,15 +13293,15 @@ static void test_cross_device_blt(void) }
hr = IDirect3DDevice3_GetDirect3D(device, &d3d); - ok(SUCCEEDED(hr), "Failed to get Direct3D3 interface, hr %#x.\n", hr); + ok(SUCCEEDED(hr), "Failed to get Direct3D3 interface, hr %#lx.\n", hr); hr = IDirect3D3_QueryInterface(d3d, &IID_IDirectDraw4, (void **)&ddraw); - ok(SUCCEEDED(hr), "Failed to get DirectDraw4 interface, hr %#x.\n", hr); + ok(SUCCEEDED(hr), "Failed to get DirectDraw4 interface, hr %#lx.\n", hr); IDirect3D3_Release(d3d);
hr = IDirect3DDevice3_GetDirect3D(device2, &d3d); - ok(SUCCEEDED(hr), "Failed to get Direct3D3 interface, hr %#x.\n", hr); + ok(SUCCEEDED(hr), "Failed to get Direct3D3 interface, hr %#lx.\n", hr); hr = IDirect3D3_QueryInterface(d3d, &IID_IDirectDraw4, (void **)&ddraw2); - ok(SUCCEEDED(hr), "Failed to get DirectDraw4 interface, hr %#x.\n", hr); + ok(SUCCEEDED(hr), "Failed to get DirectDraw4 interface, hr %#lx.\n", hr); IDirect3D3_Release(d3d);
memset(&surface_desc, 0, sizeof(surface_desc)); @@ -13333,7 +13311,7 @@ static void test_cross_device_blt(void) surface_desc.dwHeight = 480; surface_desc.ddsCaps.dwCaps = DDSCAPS_OFFSCREENPLAIN | DDSCAPS_SYSTEMMEMORY; hr = IDirectDraw4_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); @@ -13341,7 +13319,7 @@ static void test_cross_device_blt(void) surface_desc.ddsCaps.dwCaps = DDSCAPS_PRIMARYSURFACE | DDSCAPS_COMPLEX | DDSCAPS_FLIP | DDSCAPS_VIDEOMEMORY; U5(surface_desc).dwBackBufferCount = 2; hr = IDirectDraw4_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); @@ -13356,35 +13334,35 @@ static void test_cross_device_blt(void) U3(U4(surface_desc).ddpfPixelFormat).dwGBitMask = 0x000003e0; U4(U4(surface_desc).ddpfPixelFormat).dwBBitMask = 0x0000001f; hr = IDirectDraw4_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 = IDirectDrawSurface4_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 = IDirectDrawSurface4_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 = IDirectDrawSurface4_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 = IDirectDrawSurface4_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 = IDirectDrawSurface4_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 = IDirectDraw4_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 = IDirectDrawSurface4_IsLost(sysmem_surface); - ok(hr == D3D_OK, "Got unexpected hr %#x.\n", hr); + ok(hr == D3D_OK, "Got unexpected hr %#lx.\n", hr);
hr = IDirectDrawSurface4_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);
@@ -13396,12 +13374,12 @@ static void test_cross_device_blt(void) surface_desc.dwHeight = 480; surface_desc.ddsCaps.dwCaps = DDSCAPS_OFFSCREENPLAIN | DDSCAPS_SYSTEMMEMORY; hr = IDirectDraw4_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 = IDirectDrawSurface4_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 = IDirectDrawSurface4_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);
@@ -13411,9 +13389,9 @@ static void test_cross_device_blt(void) IDirectDraw4_Release(ddraw); IDirectDraw4_Release(ddraw2); refcount = IDirect3DDevice3_Release(device); - ok(!refcount, "Device has %u references left.\n", refcount); + ok(!refcount, "Device has %lu references left.\n", refcount); refcount = IDirect3DDevice3_Release(device2); - ok(!refcount, "Device has %u references left.\n", refcount); + ok(!refcount, "Device has %lu references left.\n", refcount); DestroyWindow(window); DestroyWindow(window2); } @@ -13438,8 +13416,8 @@ static void test_color_clamping(void) IDirect3DViewport3 *viewport; IDirect3DDevice3 *device; IDirectDrawSurface4 *rt; + unsigned int color; ULONG refcount; - D3DCOLOR color; HWND window; HRESULT hr;
@@ -13452,53 +13430,53 @@ static void test_color_clamping(void) }
hr = IDirect3DDevice3_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 = IDirect3DDevice3_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 = IDirect3DDevice3_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 = IDirect3DDevice3_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 = IDirect3DDevice3_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 = IDirect3DDevice3_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 = IDirect3DDevice3_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 = IDirect3DDevice3_SetRenderState(device, D3DRENDERSTATE_STENCILENABLE, FALSE); - ok(SUCCEEDED(hr), "Failed to disable stencil test, hr %#x.\n", hr); + ok(SUCCEEDED(hr), "Failed to disable stencil test, hr %#lx.\n", hr); hr = IDirect3DDevice3_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 = IDirect3DDevice3_SetRenderState(device, D3DRENDERSTATE_TEXTUREFACTOR, 0xff404040); - ok(SUCCEEDED(hr), "Failed to set texture factor, hr %#x.\n", hr); + ok(SUCCEEDED(hr), "Failed to set texture factor, hr %#lx.\n", hr); hr = IDirect3DDevice3_SetTextureStageState(device, 0, D3DTSS_COLOROP, D3DTOP_ADD); - ok(SUCCEEDED(hr), "Failed to set color op, hr %#x.\n", hr); + ok(SUCCEEDED(hr), "Failed to set color op, hr %#lx.\n", hr); hr = IDirect3DDevice3_SetTextureStageState(device, 0, D3DTSS_COLORARG1, D3DTA_DIFFUSE); - ok(SUCCEEDED(hr), "Failed to set color arg, hr %#x.\n", hr); + ok(SUCCEEDED(hr), "Failed to set color arg, hr %#lx.\n", hr); hr = IDirect3DDevice3_SetTextureStageState(device, 0, D3DTSS_COLORARG2, D3DTA_SPECULAR); - ok(SUCCEEDED(hr), "Failed to set color arg, hr %#x.\n", hr); + ok(SUCCEEDED(hr), "Failed to set color arg, hr %#lx.\n", hr); hr = IDirect3DDevice3_SetTextureStageState(device, 1, D3DTSS_COLOROP, D3DTOP_MODULATE); - ok(SUCCEEDED(hr), "Failed to set color op, hr %#x.\n", hr); + ok(SUCCEEDED(hr), "Failed to set color op, hr %#lx.\n", hr); hr = IDirect3DDevice3_SetTextureStageState(device, 1, D3DTSS_COLORARG1, D3DTA_TFACTOR); - ok(SUCCEEDED(hr), "Failed to set color arg, hr %#x.\n", hr); + ok(SUCCEEDED(hr), "Failed to set color arg, hr %#lx.\n", hr); hr = IDirect3DDevice3_SetTextureStageState(device, 1, D3DTSS_COLORARG2, D3DTA_CURRENT); - ok(SUCCEEDED(hr), "Failed to set color arg, hr %#x.\n", hr); + ok(SUCCEEDED(hr), "Failed to set color arg, hr %#lx.\n", hr);
hr = IDirect3DViewport3_Clear2(viewport, 1, &clear_rect, D3DCLEAR_TARGET, 0xff00ff00, 0.0f, 0); - ok(SUCCEEDED(hr), "Failed to clear viewport, hr %#x.\n", hr); + ok(SUCCEEDED(hr), "Failed to clear viewport, hr %#lx.\n", hr);
hr = IDirect3DDevice3_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 = IDirect3DDevice3_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 = IDirect3DDevice3_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, 0x00404040, 1), "Got unexpected color 0x%08x.\n", color); @@ -13506,7 +13484,7 @@ static void test_color_clamping(void) destroy_viewport(device, viewport); IDirectDrawSurface4_Release(rt); refcount = IDirect3DDevice3_Release(device); - ok(!refcount, "Device has %u references left.\n", refcount); + ok(!refcount, "Device has %lu references left.\n", refcount); DestroyWindow(window); }
@@ -13578,11 +13556,11 @@ static void test_getdc(void) ddraw = create_ddraw(); ok(!!ddraw, "Failed to create a ddraw object.\n"); hr = IDirectDraw4_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 = IDirectDraw4_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(U4(surface_desc).ddpfPixelFormat).dwRGBBitCount;
for (i = 0; i < ARRAY_SIZE(test_data); ++i) @@ -13601,7 +13579,7 @@ static void test_getdc(void) surface_desc.ddsCaps.dwCaps2 = DDSCAPS2_TEXTUREMANAGE; if (FAILED(hr = IDirectDraw4_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; } } @@ -13610,9 +13588,9 @@ static void test_getdc(void) hr = IDirectDrawSurface4_GetDC(surface, &dc); if (test_data[i].getdc_supported) ok(SUCCEEDED(hr) || broken(hr == test_data[i].alt_result), - "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)) { @@ -13623,10 +13601,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); @@ -13650,11 +13628,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); @@ -13663,17 +13641,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) @@ -13682,20 +13660,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 = IDirectDrawSurface4_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 { @@ -13711,147 +13689,147 @@ static void test_getdc(void) surface_desc.ddsCaps.dwCaps2 = DDSCAPS2_TEXTUREMANAGE; if (FAILED(hr = IDirectDraw4_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 = IDirectDrawSurface4_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 = IDirectDrawSurface4_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); IDirectDrawSurface4_Release(tmp);
hr = IDirectDrawSurface4_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 = IDirectDrawSurface4_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 = IDirectDrawSurface4_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 = IDirectDrawSurface4_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 = IDirectDrawSurface4_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 = IDirectDrawSurface4_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 = IDirectDrawSurface4_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 = IDirectDrawSurface4_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 = IDirectDrawSurface4_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 = IDirectDrawSurface4_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 = IDirectDrawSurface4_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 = IDirectDrawSurface4_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 = IDirectDrawSurface4_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 = IDirectDrawSurface4_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 = IDirectDrawSurface4_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 = IDirectDrawSurface4_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 = IDirectDrawSurface4_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 = IDirectDrawSurface4_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 = IDirectDrawSurface4_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 = IDirectDrawSurface4_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 = IDirectDrawSurface4_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 = IDirectDrawSurface4_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 = IDirectDrawSurface4_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 = IDirectDrawSurface4_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 = IDirectDrawSurface4_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 = IDirectDrawSurface4_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 = IDirectDrawSurface4_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 = IDirectDrawSurface4_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 = IDirectDrawSurface4_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 = IDirectDrawSurface4_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 = IDirectDrawSurface4_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 = IDirectDrawSurface4_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 = IDirectDrawSurface4_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 = IDirectDrawSurface4_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 = IDirectDrawSurface4_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 = IDirectDrawSurface4_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 = IDirectDrawSurface4_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 = IDirectDrawSurface4_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 = IDirectDrawSurface4_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 = IDirectDrawSurface4_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 = IDirectDrawSurface4_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 = IDirectDrawSurface4_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 = IDirectDrawSurface4_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 = IDirectDrawSurface4_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 = IDirectDrawSurface4_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 = IDirectDrawSurface4_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 = IDirectDrawSurface4_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 = IDirectDrawSurface4_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 = IDirectDrawSurface4_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 = IDirectDrawSurface4_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 = IDirectDrawSurface4_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 = IDirectDrawSurface4_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 = IDirectDrawSurface4_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 = IDirectDrawSurface4_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 = IDirectDrawSurface4_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 = IDirectDrawSurface4_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 = IDirectDrawSurface4_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);
IDirectDrawSurface4_Release(surface2); IDirectDrawSurface4_Release(surface); @@ -13892,77 +13870,77 @@ static void test_draw_primitive(void)
viewport = create_viewport(device, 0, 0, 640, 480); hr = IDirect3DDevice3_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 = IDirect3DDevice3_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);
memset(&vb_desc, 0, sizeof(vb_desc)); vb_desc.dwSize = sizeof(vb_desc); vb_desc.dwFVF = D3DFVF_XYZ; vb_desc.dwNumVertices = 4; hr = IDirect3D3_CreateVertexBuffer(d3d, &vb_desc, &vb, 0, NULL); - ok(SUCCEEDED(hr), "Failed to create vertex buffer, hr %#x.\n", hr); + ok(SUCCEEDED(hr), "Failed to create vertex buffer, hr %#lx.\n", hr);
IDirect3D3_Release(d3d);
memset(&strided, 0, sizeof(strided));
hr = IDirect3DDevice3_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 = IDirect3DDevice3_DrawIndexedPrimitiveStrided(device, D3DPT_TRIANGLESTRIP, D3DFVF_XYZ, &strided, 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 = IDirect3DDevice3_DrawIndexedPrimitiveVB(device, D3DPT_TRIANGLESTRIP, vb, NULL, 0, 0); - ok(SUCCEEDED(hr), "Failed to draw, hr %#x.\n", hr); + ok(SUCCEEDED(hr), "Failed to draw, hr %#lx.\n", hr); hr = IDirect3DDevice3_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 = IDirect3DDevice3_DrawPrimitiveStrided(device, D3DPT_TRIANGLESTRIP, D3DFVF_XYZ, &strided, 0, 0); - ok(SUCCEEDED(hr), "Failed to draw, hr %#x.\n", hr); + ok(SUCCEEDED(hr), "Failed to draw, hr %#lx.\n", hr); hr = IDirect3DDevice3_DrawPrimitiveVB(device, D3DPT_TRIANGLESTRIP, vb, 0, 0, 0); - ok(SUCCEEDED(hr), "Failed to draw, hr %#x.\n", hr); + ok(SUCCEEDED(hr), "Failed to draw, hr %#lx.\n", hr);
hr = IDirect3DDevice3_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 = IDirect3DDevice3_DrawIndexedPrimitiveStrided(device, D3DPT_TRIANGLESTRIP, D3DFVF_XYZ, &strided, 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 = IDirect3DDevice3_DrawIndexedPrimitiveVB(device, D3DPT_TRIANGLESTRIP, vb, indices, 4, 0); - ok(SUCCEEDED(hr), "Failed to draw, hr %#x.\n", hr); + ok(SUCCEEDED(hr), "Failed to draw, hr %#lx.\n", hr);
strided.position.lpvData = quad; strided.position.dwStride = sizeof(*quad); hr = IDirect3DVertexBuffer_Lock(vb, 0, &data, NULL); - ok(SUCCEEDED(hr), "Failed to lock vertex buffer, hr %#x.\n", hr); + ok(SUCCEEDED(hr), "Failed to lock vertex buffer, hr %#lx.\n", hr); memcpy(data, quad, sizeof(quad)); hr = IDirect3DVertexBuffer_Unlock(vb); - ok(SUCCEEDED(hr), "Failed to unlock vertex buffer, hr %#x.\n", hr); + ok(SUCCEEDED(hr), "Failed to unlock vertex buffer, hr %#lx.\n", hr);
hr = IDirect3DDevice3_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 = IDirect3DDevice3_DrawIndexedPrimitiveStrided(device, D3DPT_TRIANGLESTRIP, D3DFVF_XYZ, &strided, 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 = IDirect3DDevice3_DrawIndexedPrimitiveVB(device, D3DPT_TRIANGLESTRIP, vb, NULL, 0, 0); - ok(SUCCEEDED(hr), "Failed to draw, hr %#x.\n", hr); + ok(SUCCEEDED(hr), "Failed to draw, hr %#lx.\n", hr); hr = IDirect3DDevice3_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 = IDirect3DDevice3_DrawPrimitiveStrided(device, D3DPT_TRIANGLESTRIP, D3DFVF_XYZ, &strided, 4, 0); - ok(SUCCEEDED(hr), "Failed to draw, hr %#x.\n", hr); + ok(SUCCEEDED(hr), "Failed to draw, hr %#lx.\n", hr); hr = IDirect3DDevice3_DrawPrimitiveVB(device, D3DPT_TRIANGLESTRIP, vb, 0, 4, 0); - ok(SUCCEEDED(hr), "Failed to draw, hr %#x.\n", hr); + ok(SUCCEEDED(hr), "Failed to draw, hr %#lx.\n", hr); hr = IDirect3DDevice3_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); hr = IDirect3DDevice3_DrawIndexedPrimitiveStrided(device, D3DPT_TRIANGLESTRIP, D3DFVF_XYZ, &strided, 4, indices, 4, 0); - ok(SUCCEEDED(hr), "Failed to draw, hr %#x.\n", hr); + ok(SUCCEEDED(hr), "Failed to draw, hr %#lx.\n", hr); hr = IDirect3DDevice3_DrawIndexedPrimitiveVB(device, D3DPT_TRIANGLESTRIP, vb, indices, 4, 0); - ok(SUCCEEDED(hr), "Failed to draw, hr %#x.\n", hr); + ok(SUCCEEDED(hr), "Failed to draw, hr %#lx.\n", hr);
IDirect3DVertexBuffer_Release(vb); destroy_viewport(device, viewport); refcount = IDirect3DDevice3_Release(device); - ok(!refcount, "Device has %u references left.\n", refcount); + ok(!refcount, "Device has %lu references left.\n", refcount); DestroyWindow(window); }
@@ -13975,9 +13953,9 @@ static void test_edge_antialiasing_blending(void) DDSURFACEDESC2 surface_desc; IDirect3DDevice3 *device; IDirectDraw4 *ddraw; + unsigned int color; IDirect3D3 *d3d; ULONG refcount; - D3DCOLOR color; HWND window; HRESULT hr;
@@ -14026,20 +14004,20 @@ static void test_edge_antialiasing_blending(void) memset(&hel_desc, 0, sizeof(hel_desc)); hel_desc.dwSize = sizeof(hel_desc); hr = IDirect3DDevice3_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);
hr = IDirect3DDevice3_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 = IDirect3D3_QueryInterface(d3d, &IID_IDirectDraw4, (void **)&ddraw); - ok(SUCCEEDED(hr), "Failed to get DirectDraw4 interface, hr %#x.\n", hr); + ok(SUCCEEDED(hr), "Failed to get DirectDraw4 interface, hr %#lx.\n", hr); IDirect3D3_Release(d3d);
memset(&surface_desc, 0, sizeof(surface_desc)); @@ -14055,126 +14033,126 @@ static void test_edge_antialiasing_blending(void) U4(U4(surface_desc).ddpfPixelFormat).dwBBitMask = 0x000000ff; U5(U4(surface_desc).ddpfPixelFormat).dwRGBAlphaBitMask = 0xff000000; hr = IDirectDraw4_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 = IDirectDrawSurface4_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); IDirectDrawSurface4_Release(ds);
hr = IDirect3DDevice3_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);
viewport = create_viewport(device, 0, 0, 640, 480); hr = IDirect3DDevice3_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 = IDirect3DDevice3_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 = IDirect3DDevice3_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 = IDirect3DDevice3_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 = IDirect3DDevice3_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 = IDirect3DDevice3_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 = IDirect3DDevice3_SetRenderState(device, D3DRENDERSTATE_STENCILENABLE, FALSE); - ok(SUCCEEDED(hr), "Failed to disable stencil test, hr %#x.\n", hr); + ok(SUCCEEDED(hr), "Failed to disable stencil test, hr %#lx.\n", hr); hr = IDirect3DDevice3_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 = IDirect3DDevice3_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 = IDirect3DDevice3_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 = IDirect3DDevice3_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);
hr = IDirect3DDevice3_SetTextureStageState(device, 0, D3DTSS_COLOROP, D3DTOP_SELECTARG1); - ok(SUCCEEDED(hr), "Failed to set color op, hr %#x.\n", hr); + ok(SUCCEEDED(hr), "Failed to set color op, hr %#lx.\n", hr); hr = IDirect3DDevice3_SetTextureStageState(device, 0, D3DTSS_COLORARG1, D3DTA_DIFFUSE); - ok(SUCCEEDED(hr), "Failed to set color arg, hr %#x.\n", hr); + ok(SUCCEEDED(hr), "Failed to set color arg, hr %#lx.\n", hr); hr = IDirect3DDevice3_SetTextureStageState(device, 0, D3DTSS_ALPHAOP, D3DTOP_SELECTARG1); - ok(SUCCEEDED(hr), "Failed to set alpha op, hr %#x.\n", hr); + ok(SUCCEEDED(hr), "Failed to set alpha op, hr %#lx.\n", hr); hr = IDirect3DDevice3_SetTextureStageState(device, 0, D3DTSS_ALPHAARG1, D3DTA_DIFFUSE); - ok(SUCCEEDED(hr), "Failed to set alpha arg, hr %#x.\n", hr); + ok(SUCCEEDED(hr), "Failed to set alpha arg, hr %#lx.\n", hr);
hr = IDirect3DViewport3_Clear2(viewport, 1, &clear_rect, D3DCLEAR_TARGET, 0xccff0000, 0.0f, 0); - ok(SUCCEEDED(hr), "Failed to clear viewport, hr %#x.\n", hr); + ok(SUCCEEDED(hr), "Failed to clear viewport, hr %#lx.\n", hr); hr = IDirect3DDevice3_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 = IDirect3DDevice3_DrawPrimitive(device, D3DPT_TRIANGLESTRIP, D3DFVF_XYZ | D3DFVF_DIFFUSE, 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 = IDirect3DDevice3_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 = IDirect3DViewport3_Clear2(viewport, 1, &clear_rect, D3DCLEAR_TARGET, 0x7f00ff00, 0.0f, 0); - ok(SUCCEEDED(hr), "Failed to clear viewport, hr %#x.\n", hr); + ok(SUCCEEDED(hr), "Failed to clear viewport, hr %#lx.\n", hr); hr = IDirect3DDevice3_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 = IDirect3DDevice3_DrawPrimitive(device, D3DPT_TRIANGLESTRIP, D3DFVF_XYZ | D3DFVF_DIFFUSE, 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 = IDirect3DDevice3_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 = IDirect3DDevice3_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);
hr = IDirect3DViewport3_Clear2(viewport, 1, &clear_rect, D3DCLEAR_TARGET, 0xccff0000, 0.0f, 0); - ok(SUCCEEDED(hr), "Failed to clear viewport, hr %#x.\n", hr); + ok(SUCCEEDED(hr), "Failed to clear viewport, hr %#lx.\n", hr); hr = IDirect3DDevice3_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 = IDirect3DDevice3_DrawPrimitive(device, D3DPT_TRIANGLESTRIP, D3DFVF_XYZ | D3DFVF_DIFFUSE, 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 = IDirect3DDevice3_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);
hr = IDirect3DViewport3_Clear2(viewport, 1, &clear_rect, D3DCLEAR_TARGET, 0x7f00ff00, 0.0f, 0); - ok(SUCCEEDED(hr), "Failed to clear viewport, hr %#x.\n", hr); + ok(SUCCEEDED(hr), "Failed to clear viewport, hr %#lx.\n", hr); hr = IDirect3DDevice3_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 = IDirect3DDevice3_DrawPrimitive(device, D3DPT_TRIANGLESTRIP, D3DFVF_XYZ | D3DFVF_DIFFUSE, 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 = IDirect3DDevice3_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 = IDirect3DDevice3_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);
hr = IDirect3DViewport3_Clear2(viewport, 1, &clear_rect, D3DCLEAR_TARGET, 0xccff0000, 0.0f, 0); - ok(SUCCEEDED(hr), "Failed to clear viewport, hr %#x.\n", hr); + ok(SUCCEEDED(hr), "Failed to clear viewport, hr %#lx.\n", hr); hr = IDirect3DDevice3_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 = IDirect3DDevice3_DrawPrimitive(device, D3DPT_TRIANGLESTRIP, D3DFVF_XYZ | D3DFVF_DIFFUSE, 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 = IDirect3DDevice3_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);
hr = IDirect3DViewport3_Clear2(viewport, 1, &clear_rect, D3DCLEAR_TARGET, 0x7f00ff00, 0.0f, 0); - ok(SUCCEEDED(hr), "Failed to clear viewport, hr %#x.\n", hr); + ok(SUCCEEDED(hr), "Failed to clear viewport, hr %#lx.\n", hr); hr = IDirect3DDevice3_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 = IDirect3DDevice3_DrawPrimitive(device, D3DPT_TRIANGLESTRIP, D3DFVF_XYZ | D3DFVF_DIFFUSE, 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 = IDirect3DDevice3_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);
@@ -14182,7 +14160,7 @@ static void test_edge_antialiasing_blending(void) IDirectDraw4_Release(ddraw); destroy_viewport(device, viewport); refcount = IDirect3DDevice3_Release(device); - ok(!refcount, "Device has %u references left.\n", refcount); + ok(!refcount, "Device has %lu references left.\n", refcount); DestroyWindow(window); }
@@ -14199,18 +14177,18 @@ 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) { IDirect3DDevice3 *device; IDirectDrawSurface4 *rt; + unsigned int color; ULONG refcount; HWND window; HRESULT hr; - D3DCOLOR color; IDirect3DViewport3 *viewport; static struct transform_input position_tests[] = { @@ -14309,11 +14287,11 @@ static void test_transform_vertices(void) return; } hr = IDirect3DDevice3_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); @@ -14325,8 +14303,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) { @@ -14337,7 +14315,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, @@ -14348,12 +14326,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) { @@ -14363,19 +14341,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[] = @@ -14384,7 +14362,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); }
@@ -14392,8 +14370,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[] = @@ -14406,7 +14384,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 @@ -14421,7 +14399,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); } } @@ -14431,8 +14409,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[] = @@ -14442,19 +14420,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[] = @@ -14464,7 +14442,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; @@ -14473,11 +14451,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[] = @@ -14487,7 +14465,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. @@ -14498,51 +14476,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]); @@ -14552,21 +14530,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. * @@ -14582,20 +14560,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 = IDirect3DDevice3_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 = IDirect3DDevice3_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 = IDirect3DDevice3_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) { @@ -14606,7 +14584,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); }
@@ -14614,48 +14592,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); @@ -14664,8 +14642,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; @@ -14677,20 +14655,20 @@ static void test_transform_vertices(void) vp_data.dvMinZ = 0.0f; vp_data.dvMaxZ = 1.0f; hr = IDirect3DViewport3_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 = IDirect3DDevice3_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 = IDirect3DViewport3_Clear2(viewport, 1, &clear_rect, D3DCLEAR_TARGET, 0x000000ff, 0.0f, 0); - ok(SUCCEEDED(hr), "Failed to clear viewport, hr %#x.\n", hr); + ok(SUCCEEDED(hr), "Failed to clear viewport, hr %#lx.\n", hr);
hr = IDirect3DDevice3_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 = IDirect3DDevice3_DrawPrimitive(device, D3DPT_TRIANGLESTRIP, D3DFVF_XYZ | D3DFVF_DIFFUSE, quad, 4, 0); - ok(SUCCEEDED(hr), "Failed to draw, hr %#x.\n", hr); + ok(SUCCEEDED(hr), "Failed to draw, hr %#lx.\n", hr); hr = IDirect3DDevice3_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); @@ -14723,12 +14701,12 @@ static void test_transform_vertices(void) vp2_data.dvMinZ = 0.0f; vp2_data.dvMaxZ = 2.0f; hr = IDirect3DViewport3_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 = IDirect3DViewport3_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[] = @@ -14738,20 +14716,20 @@ 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); }
hr = IDirect3DViewport3_Clear2(viewport, 1, &clear_rect, D3DCLEAR_TARGET, 0x0000ff00, 0.0f, 0); - ok(SUCCEEDED(hr), "Failed to clear viewport, hr %#x.\n", hr); + ok(SUCCEEDED(hr), "Failed to clear viewport, hr %#lx.\n", hr);
hr = IDirect3DDevice3_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 = IDirect3DDevice3_DrawPrimitive(device, D3DPT_TRIANGLESTRIP, D3DFVF_XYZ | D3DFVF_DIFFUSE, quad, 4, 0); - ok(SUCCEEDED(hr), "Failed to draw, hr %#x.\n", hr); + ok(SUCCEEDED(hr), "Failed to draw, hr %#lx.\n", hr); hr = IDirect3DDevice3_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); @@ -14772,11 +14750,11 @@ static void test_transform_vertices(void) ok(compare_color(color, 0x0000ff00, 1), "Got unexpected color 0x%08x.\n", color);
hr = IDirect3DDevice3_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 = IDirect3DDevice3_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 = IDirect3DDevice3_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; @@ -14789,14 +14767,14 @@ static void test_transform_vertices(void) vp2_data.dvMinZ = 0.0f; vp2_data.dvMaxZ = 0.5f; hr = IDirect3DViewport3_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 = IDirect3DViewport3_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[] = @@ -14810,14 +14788,14 @@ 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); }
destroy_viewport(device, viewport); IDirectDrawSurface4_Release(rt); refcount = IDirect3DDevice3_Release(device); - ok(!refcount, "Device has %u references left.\n", refcount); + ok(!refcount, "Device has %lu references left.\n", refcount); DestroyWindow(window); }
@@ -14839,14 +14817,14 @@ static void test_display_mode_surface_pixel_format(void)
surface_desc.dwSize = sizeof(surface_desc); hr = IDirectDraw4_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 = IDirectDraw4_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(IDirectDraw4_SetDisplayMode(ddraw, width, height, 16, 0, 0))) @@ -14859,10 +14837,10 @@ static void test_display_mode_surface_pixel_format(void)
surface_desc.dwSize = sizeof(surface_desc); hr = IDirectDraw4_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(U4(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(U4(surface_desc).ddpfPixelFormat).dwRGBBitCount == bpp, "Got bpp %lu, expected %u.\n", U1(U4(surface_desc).ddpfPixelFormat).dwRGBBitCount, bpp);
memset(&surface_desc, 0, sizeof(surface_desc)); @@ -14871,14 +14849,14 @@ static void test_display_mode_surface_pixel_format(void) U5(surface_desc).dwBackBufferCount = 1; surface_desc.ddsCaps.dwCaps = DDSCAPS_COMPLEX | DDSCAPS_FLIP | DDSCAPS_PRIMARYSURFACE; hr = IDirectDraw4_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 = IDirectDrawSurface4_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(U4(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(U4(surface_desc).ddpfPixelFormat.dwFlags == DDPF_RGB, "Got unexpected pixel format flags %#lx.\n", U4(surface_desc).ddpfPixelFormat.dwFlags); - ok(U1(U4(surface_desc).ddpfPixelFormat).dwRGBBitCount == bpp, "Got bpp %u, expected %u.\n", + ok(U1(U4(surface_desc).ddpfPixelFormat).dwRGBBitCount == bpp, "Got bpp %lu, expected %u.\n", U1(U4(surface_desc).ddpfPixelFormat).dwRGBBitCount, bpp); IDirectDrawSurface4_Release(surface);
@@ -14889,17 +14867,17 @@ static void test_display_mode_surface_pixel_format(void) surface_desc.dwHeight = height; surface_desc.ddsCaps.dwCaps = DDSCAPS_OFFSCREENPLAIN; hr = IDirectDraw4_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 = IDirectDrawSurface4_GetSurfaceDesc(surface, &surface_desc); - ok(SUCCEEDED(hr), "Failed to get surface desc, hr %#x.\n", hr); - ok(U4(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(U4(surface_desc).ddpfPixelFormat.dwFlags == DDPF_RGB, "Got unexpected pixel format flags %#lx.\n", U4(surface_desc).ddpfPixelFormat.dwFlags); - ok(U1(U4(surface_desc).ddpfPixelFormat).dwRGBBitCount == bpp, "Got bpp %u, expected %u.\n", + ok(U1(U4(surface_desc).ddpfPixelFormat).dwRGBBitCount == bpp, "Got bpp %lu, expected %u.\n", U1(U4(surface_desc).ddpfPixelFormat).dwRGBBitCount, bpp); IDirectDrawSurface4_Release(surface);
refcount = IDirectDraw4_Release(ddraw); - ok(!refcount, "DirectDraw has %u references left.\n", refcount); + ok(!refcount, "DirectDraw has %lu references left.\n", refcount); DestroyWindow(window); }
@@ -14957,7 +14935,7 @@ static void test_surface_desc_size(void) return; } hr = IDirectDraw4_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) { @@ -14973,9 +14951,9 @@ static void test_surface_desc_size(void) continue; } hr = IDirectDrawSurface_QueryInterface(surface4, &IID_IDirectDrawSurface, (void **)&surface); - ok(hr == DD_OK, "Failed to query IDirectDrawSurface, hr %#x, type %s.\n", hr, surface_caps[i].name); + ok(hr == DD_OK, "Failed to query IDirectDrawSurface, hr %#lx, type %s.\n", hr, surface_caps[i].name); hr = IDirectDrawSurface_QueryInterface(surface4, &IID_IDirectDrawSurface3, (void **)&surface3); - ok(hr == DD_OK, "Failed to query IDirectDrawSurface3, hr %#x, type %s.\n", hr, surface_caps[i].name); + ok(hr == DD_OK, "Failed to query IDirectDrawSurface3, hr %#lx, type %s.\n", hr, surface_caps[i].name);
/* GetSurfaceDesc() */ for (j = 0; j < ARRAY_SIZE(desc_sizes); ++j) @@ -14984,21 +14962,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 = IDirectDrawSurface3_GetSurfaceDesc(surface3, &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 = IDirectDrawSurface4_GetSurfaceDesc(surface4, &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); }
@@ -15015,22 +14993,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); } @@ -15041,22 +15019,22 @@ static void test_surface_desc_size(void) desc.blob[sizeof(DDSURFACEDESC2)] = 0xef; hr = IDirectDrawSurface3_Lock(surface3, 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); IDirectDrawSurface3_Unlock(surface3, NULL); } @@ -15067,21 +15045,21 @@ static void test_surface_desc_size(void) desc.blob[sizeof(DDSURFACEDESC2)] = 0xef; hr = IDirectDrawSurface4_Lock(surface4, 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); IDirectDrawSurface4_Unlock(surface4, NULL); } @@ -15100,17 +15078,17 @@ static void test_surface_desc_size(void) expected_hr = (desc.dwSize == sizeof(DDSURFACEDESC) || desc.dwSize == sizeof(DDSURFACEDESC2)) ? DD_OK : DDERR_INVALIDPARAMS; hr = IDirectDraw4_GetDisplayMode(ddraw, &desc.desc2); - 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(DDSURFACEDESC2), "Wrong size %u for %u.\n", desc.dwSize, desc_sizes[j]); + ok(desc.dwSize == sizeof(DDSURFACEDESC2), "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 = IDirectDraw4_Release(ddraw); - ok(!refcount, "DirectDraw has %u references left.\n", refcount); + ok(!refcount, "DirectDraw has %lu references left.\n", refcount); }
static void test_get_surface_from_dc(void) @@ -15129,7 +15107,7 @@ static void test_get_surface_from_dc(void) ddraw = create_ddraw(); ok(!!ddraw, "Failed to create a ddraw object.\n"); hr = IDirectDraw4_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); @@ -15139,59 +15117,59 @@ static void test_get_surface_from_dc(void) surface_desc.ddsCaps.dwCaps = DDSCAPS_OFFSCREENPLAIN;
hr = IDirectDraw4_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 = IDirectDrawSurface4_QueryInterface(surface, &IID_IDirectDrawSurface, (void **)&surface1); - ok(SUCCEEDED(hr), "Failed to query IDirectDrawSurface interface, hr %#x.\n", hr); + ok(SUCCEEDED(hr), "Failed to query IDirectDrawSurface interface, hr %#lx.\n", hr);
refcount = get_refcount((IUnknown *)surface1); - ok(refcount == 1, "Got unexpected refcount %u.\n", refcount); + ok(refcount == 1, "Got unexpected refcount %lu.\n", refcount); refcount = get_refcount((IUnknown *)surface); - ok(refcount == 1, "Got unexpected refcount %u.\n", refcount); + ok(refcount == 1, "Got unexpected refcount %lu.\n", refcount);
hr = IDirectDrawSurface4_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);
tmp = (void *)0xdeadbeef; device_dc = (void *)0xdeadbeef; hr = GetSurfaceFromDC(NULL, &tmp, &device_dc); - ok(hr == DDERR_NOTFOUND, "Got unexpected hr %#x.\n", hr); + ok(hr == DDERR_NOTFOUND, "Got unexpected hr %#lx.\n", hr); ok(!tmp, "Got unexpected surface %p.\n", tmp); ok(!device_dc, "Got unexpected device_dc %p.\n", device_dc);
device_dc = (void *)0xdeadbeef; hr = GetSurfaceFromDC(dc, NULL, &device_dc); - ok(hr == E_INVALIDARG, "Got unexpected hr %#x.\n", hr); + ok(hr == E_INVALIDARG, "Got unexpected hr %#lx.\n", hr); ok(device_dc == (void *)0xdeadbeef, "Got unexpected device_dc %p.\n", device_dc);
tmp = (void *)0xdeadbeef; hr = GetSurfaceFromDC(dc, &tmp, NULL); - ok(hr == E_INVALIDARG, "Got unexpected hr %#x.\n", hr); + ok(hr == E_INVALIDARG, "Got unexpected hr %#lx.\n", hr); ok(!tmp, "Got unexpected surface %p.\n", tmp);
hr = GetSurfaceFromDC(dc, &tmp, &device_dc); - ok(SUCCEEDED(hr), "GetSurfaceFromDC failed, hr %#x.\n", hr); + ok(SUCCEEDED(hr), "GetSurfaceFromDC failed, hr %#lx.\n", hr); ok(tmp == surface1, "Got unexpected surface %p, expected %p.\n", tmp, surface1); IDirectDrawSurface_Release(tmp);
ret = GetObjectType(device_dc); - todo_wine ok(ret == OBJ_DC, "Got unexpected object type %#x.\n", ret); + todo_wine ok(ret == OBJ_DC, "Got unexpected object type %#lx.\n", ret); ret = GetDeviceCaps(device_dc, TECHNOLOGY); - todo_wine ok(ret == DT_RASDISPLAY, "Got unexpected technology %#x.\n", ret); + todo_wine ok(ret == DT_RASDISPLAY, "Got unexpected technology %#lx.\n", ret);
hr = IDirectDraw4_GetSurfaceFromDC(ddraw, dc, NULL); - ok(hr == E_INVALIDARG, "Got unexpected hr %#x.\n", hr); + ok(hr == E_INVALIDARG, "Got unexpected hr %#lx.\n", hr);
hr = IDirectDraw4_GetSurfaceFromDC(ddraw, dc, (IDirectDrawSurface4 **)&tmp); - ok(SUCCEEDED(hr), "GetSurfaceFromDC failed, hr %#x.\n", hr); + ok(SUCCEEDED(hr), "GetSurfaceFromDC failed, hr %#lx.\n", hr); ok(tmp == surface1, "Got unexpected surface %p, expected %p.\n", tmp, surface1);
refcount = get_refcount((IUnknown *)surface1); - ok(refcount == 2, "Got unexpected refcount %u.\n", refcount); + ok(refcount == 2, "Got unexpected refcount %lu.\n", refcount); refcount = get_refcount((IUnknown *)surface); - ok(refcount == 1, "Got unexpected refcount %u.\n", refcount); + ok(refcount == 1, "Got unexpected refcount %lu.\n", refcount);
hr = IDirectDrawSurface4_ReleaseDC(surface, dc); - ok(SUCCEEDED(hr), "ReleaseDC failed, hr %#x.\n", hr); + ok(SUCCEEDED(hr), "ReleaseDC failed, hr %#lx.\n", hr);
IDirectDrawSurface_Release(tmp);
@@ -15201,20 +15179,20 @@ static void test_get_surface_from_dc(void) tmp = (void *)0xdeadbeef; device_dc = (void *)0xdeadbeef; hr = GetSurfaceFromDC(dc, &tmp, &device_dc); - ok(hr == DDERR_NOTFOUND, "Got unexpected hr %#x.\n", hr); + ok(hr == DDERR_NOTFOUND, "Got unexpected hr %#lx.\n", hr); ok(!tmp, "Got unexpected surface %p.\n", tmp); ok(!device_dc, "Got unexpected device_dc %p.\n", device_dc);
tmp = (void *)0xdeadbeef; hr = IDirectDraw4_GetSurfaceFromDC(ddraw, dc, (IDirectDrawSurface4 **)&tmp); - ok(hr == DDERR_NOTFOUND, "Got unexpected hr %#x.\n", hr); + ok(hr == DDERR_NOTFOUND, "Got unexpected hr %#lx.\n", hr); ok(!tmp, "Got unexpected surface %p.\n", tmp);
ok(DeleteDC(dc), "DeleteDC failed.\n");
tmp = (void *)0xdeadbeef; hr = IDirectDraw4_GetSurfaceFromDC(ddraw, NULL, (IDirectDrawSurface4 **)&tmp); - ok(hr == DDERR_NOTFOUND, "Got unexpected hr %#x.\n", hr); + ok(hr == DDERR_NOTFOUND, "Got unexpected hr %#lx.\n", hr); ok(!tmp, "Got unexpected surface %p.\n", tmp);
IDirectDrawSurface4_Release(surface); @@ -15228,12 +15206,11 @@ static void test_ck_operation(void) IDirectDrawSurface4 *src, *dst; IDirectDrawSurface *src1, *dst1; DDSURFACEDESC2 surface_desc; + unsigned int i, *color; IDirectDraw4 *ddraw; ULONG refcount; HWND window; HRESULT hr; - D3DCOLOR *color; - unsigned int i; DDCOLORKEY ckey; DDBLTFX fx;
@@ -15241,7 +15218,7 @@ static void test_ck_operation(void) ddraw = create_ddraw(); ok(!!ddraw, "Failed to create a ddraw object.\n"); hr = IDirectDraw4_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); @@ -15255,16 +15232,16 @@ static void test_ck_operation(void) U3(U4(surface_desc).ddpfPixelFormat).dwGBitMask = 0x0000ff00; U4(U4(surface_desc).ddpfPixelFormat).dwBBitMask = 0x000000ff; hr = IDirectDraw4_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);
surface_desc.dwFlags |= DDSD_CKSRCBLT; surface_desc.ddckCKSrcBlt.dwColorSpaceLowValue = 0x00ff00ff; surface_desc.ddckCKSrcBlt.dwColorSpaceHighValue = 0x00ff00ff; hr = IDirectDraw4_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 = IDirectDrawSurface4_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; @@ -15272,33 +15249,33 @@ static void test_ck_operation(void) color[2] = 0x77ff00ff; color[3] = 0x00ff00ff; hr = IDirectDrawSurface4_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 = IDirectDrawSurface4_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 = IDirectDrawSurface4_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 = IDirectDrawSurface4_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 = IDirectDrawSurface4_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 = IDirectDrawSurface4_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 @@ -15316,66 +15293,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 = IDirectDrawSurface4_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 = IDirectDrawSurface4_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 = IDirectDrawSurface4_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 = IDirectDrawSurface4_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 = IDirectDrawSurface4_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 = IDirectDrawSurface4_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 = IDirectDrawSurface4_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 = IDirectDrawSurface4_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 = IDirectDrawSurface4_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 = IDirectDrawSurface4_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 = IDirectDrawSurface4_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);
IDirectDrawSurface4_Release(src); IDirectDrawSurface4_Release(dst); @@ -15395,18 +15372,18 @@ static void test_ck_operation(void) U4(U4(surface_desc).ddpfPixelFormat).dwBBitMask = 0x000000ff; U5(U4(surface_desc).ddpfPixelFormat).dwRGBAlphaBitMask = 0xff000000; hr = IDirectDraw4_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); hr = IDirectDraw4_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);
ckey.dwColorSpaceLowValue = 0x0000ff00; ckey.dwColorSpaceHighValue = 0x0000ff00; hr = IDirectDrawSurface4_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 = IDirectDrawSurface4_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. */ @@ -15417,11 +15394,11 @@ static void test_ck_operation(void) ckey.dwColorSpaceLowValue = 0x000000ff; ckey.dwColorSpaceHighValue = 0x000000ff; hr = IDirectDrawSurface4_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 = IDirectDrawSurface4_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); @@ -15431,7 +15408,7 @@ static void test_ck_operation(void) fx.ddckDestColorkey.dwColorSpaceLowValue = 0x00001100;
hr = IDirectDrawSurface4_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. */ @@ -15440,21 +15417,21 @@ static void test_ck_operation(void) color[4] = 0x00001100; /* Src color key in ddbltfx. */ color[5] = 0x00110000; /* Dst color key in ddbltfx. */ hr = IDirectDrawSurface4_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 = IDirectDrawSurface4_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 = IDirectDrawSurface4_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 = IDirectDrawSurface4_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 = IDirectDrawSurface4_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 && @@ -15464,14 +15441,14 @@ static void test_ck_operation(void)
color[0] = color[1] = color[2] = color[3] = color[4] = color[5] = 0x55555555; hr = IDirectDrawSurface4_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 = IDirectDrawSurface4_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 = IDirectDrawSurface4_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 && @@ -15481,14 +15458,14 @@ static void test_ck_operation(void)
color[0] = color[1] = color[2] = color[3] = color[4] = color[5] = 0x55555555; hr = IDirectDrawSurface4_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 = IDirectDrawSurface4_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 = IDirectDrawSurface4_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 && @@ -15498,14 +15475,14 @@ static void test_ck_operation(void)
color[0] = color[1] = color[2] = color[3] = color[4] = color[5] = 0x55555555; hr = IDirectDrawSurface4_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 = IDirectDrawSurface4_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 = IDirectDrawSurface4_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 && @@ -15521,14 +15498,14 @@ static void test_ck_operation(void) color[4] = 0x000000aa; /* Dest key in src surface. */ color[5] = 0x000000aa; /* Dest key in src surface. */ hr = IDirectDrawSurface4_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 DESTINATION surface in v4! */ hr = IDirectDrawSurface4_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 = IDirectDrawSurface4_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 && @@ -15543,23 +15520,23 @@ static void test_ck_operation(void) color[4] = 0x000000aa; /* Dest key in src surface. */ color[5] = 0x000000aa; /* Dest key in src surface. */ hr = IDirectDrawSurface4_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 older version of the interface? It takes the key * from the source surface. */ hr = IDirectDrawSurface4_QueryInterface(src, &IID_IDirectDrawSurface, (void **)&src1); - 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 = IDirectDrawSurface4_QueryInterface(dst, &IID_IDirectDrawSurface, (void **)&dst1); - 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 = IDirectDrawSurface_Blt(dst1, NULL, src1, NULL, DDBLT_KEYDEST, &fx); - ok(SUCCEEDED(hr), "Failed to blit, hr %#x.\n", hr); + ok(SUCCEEDED(hr), "Failed to blit, hr %#lx.\n", hr);
IDirectDrawSurface_Release(dst1); IDirectDrawSurface_Release(src1);
hr = IDirectDrawSurface7_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 && @@ -15574,14 +15551,14 @@ static void test_ck_operation(void) color[4] = 0x000000aa; /* Dest key in src surface. */ color[5] = 0x000000aa; /* Dest key in src surface. */ hr = IDirectDrawSurface7_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 = IDirectDrawSurface4_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 = IDirectDrawSurface4_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 && @@ -15596,14 +15573,14 @@ static void test_ck_operation(void) color[4] = 0x000000aa; /* Dest key in src surface. */ color[5] = 0x000000aa; /* Dest key in src surface. */ hr = IDirectDrawSurface4_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 = IDirectDrawSurface4_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 = IDirectDrawSurface4_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 && @@ -15611,17 +15588,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 = IDirectDrawSurface4_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 = IDirectDrawSurface4_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 = IDirectDrawSurface4_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. */ @@ -15637,31 +15614,31 @@ static void test_ck_operation(void) color[4] = 0x000000aa; /* Dest key in src surface. */ color[5] = 0x000000aa; /* Dest key in src surface. */ hr = IDirectDrawSurface4_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 = IDirectDrawSurface4_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 = IDirectDrawSurface4_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 = IDirectDrawSurface4_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 = IDirectDrawSurface4_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 = IDirectDrawSurface4_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);
/* Dest key blit still works, the destination surface key is used in v4. */ hr = IDirectDrawSurface4_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 = IDirectDrawSurface4_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 && @@ -15669,23 +15646,23 @@ 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 = IDirectDrawSurface4_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);
/* Try blitting without keys in the destination surface. */ hr = IDirectDrawSurface4_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 = IDirectDrawSurface4_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 = IDirectDrawSurface4_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: IDirectDrawSurface4_Release(src); IDirectDrawSurface4_Release(dst); refcount = IDirectDraw4_Release(ddraw); - ok(!refcount, "DirectDraw has %u references left.\n", refcount); + ok(!refcount, "DirectDraw has %lu references left.\n", refcount); DestroyWindow(window); }
@@ -15712,7 +15689,7 @@ static void test_vb_refcount(void) }
hr = IDirect3DDevice3_GetDirect3D(device, &d3d); - ok(SUCCEEDED(hr), "Failed to get Direct3D3 interface, hr %#x.\n", hr); + ok(SUCCEEDED(hr), "Failed to get Direct3D3 interface, hr %#lx.\n", hr);
prev_d3d_refcount = get_refcount((IUnknown *)d3d); prev_device_refcount = get_refcount((IUnknown *)device); @@ -15722,33 +15699,33 @@ static void test_vb_refcount(void) vb_desc.dwFVF = D3DFVF_XYZ; vb_desc.dwNumVertices = 4; hr = IDirect3D3_CreateVertexBuffer(d3d, &vb_desc, &vb, 0, NULL); - ok(SUCCEEDED(hr), "Failed to create vertex buffer, hr %#x.\n", hr); + ok(SUCCEEDED(hr), "Failed to create vertex buffer, hr %#lx.\n", hr);
cur_d3d_refcount = get_refcount((IUnknown *)d3d); cur_device_refcount = get_refcount((IUnknown *)device); - ok(cur_d3d_refcount == prev_d3d_refcount, "D3D object refcount changed from %u to %u.\n", + ok(cur_d3d_refcount == prev_d3d_refcount, "D3D object refcount changed from %lu to %lu.\n", prev_d3d_refcount, cur_d3d_refcount); - ok(cur_device_refcount == prev_device_refcount, "Device refcount changed from %u to %u.\n", + ok(cur_device_refcount == prev_device_refcount, "Device refcount changed from %lu to %lu.\n", prev_device_refcount, cur_device_refcount);
hr = IDirect3DVertexBuffer_QueryInterface(vb, &IID_IDirect3DVertexBuffer, (void **)&vb1); - ok(hr == DD_OK, "Failed to query IDirect3DVertexBuffer, hr %#x.\n", hr); + ok(hr == DD_OK, "Failed to query IDirect3DVertexBuffer, hr %#lx.\n", hr); IDirect3DVertexBuffer_Release(vb1);
hr = IDirect3DVertexBuffer_QueryInterface(vb, &IID_IDirect3DVertexBuffer7, (void **)&vb7); - ok(hr == E_NOINTERFACE, "Querying IDirect3DVertexBuffer7 returned unexpected hr %#x.\n", hr); + ok(hr == E_NOINTERFACE, "Querying IDirect3DVertexBuffer7 returned unexpected hr %#lx.\n", hr);
hr = IDirect3DVertexBuffer_QueryInterface(vb, &IID_IUnknown, (void **)&unk); - ok(hr == DD_OK, "Failed to query IUnknown, hr %#x.\n", hr); + ok(hr == DD_OK, "Failed to query IUnknown, hr %#lx.\n", hr); ok((IUnknown *)vb == unk, "IDirect3DVertexBuffer and IUnknown interface pointers don't match, %p != %p.\n", vb, unk); IUnknown_Release(unk);
refcount = IDirect3DVertexBuffer_Release(vb); - ok(!refcount, "Vertex buffer has %u references left.\n", refcount); + ok(!refcount, "Vertex buffer has %lu references left.\n", refcount); IDirect3D3_Release(d3d); refcount = IDirect3DDevice3_Release(device); - ok(!refcount, "Device has %u references left.\n", refcount); + ok(!refcount, "Device has %lu references left.\n", refcount); DestroyWindow(window); }
@@ -15827,7 +15804,7 @@ static void test_compute_sphere_visibility(void)
viewport = create_viewport(device, 0, 0, 640, 480); hr = IDirect3DDevice3_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);
IDirect3DDevice3_SetTransform(device, D3DTRANSFORMSTATE_WORLD, &identity);
@@ -15838,17 +15815,17 @@ static void test_compute_sphere_visibility(void)
hr = IDirect3DDevice3_ComputeSphereVisibility(device, tests[i].center, tests[i].radius, tests[i].sphere_count, 0, result); - ok(hr == D3D_OK, "Got unexpected hr %#x.\n", hr); + ok(hr == D3D_OK, "Got unexpected hr %#lx.\n", hr);
for (j = 0; j < tests[i].sphere_count; ++j) todo_wine_if(tests[i].todo) - ok(result[j] == tests[i].expected[j], "Test %u sphere %u: expected %#x, got %#x.\n", + ok(result[j] == tests[i].expected[j], "Test %u sphere %u: expected %#lx, got %#lx.\n", i, j, tests[i].expected[j], result[j]); }
destroy_viewport(device, viewport); refcount = IDirect3DDevice3_Release(device); - ok(!refcount, "Device has %u references left.\n", refcount); + ok(!refcount, "Device has %lu references left.\n", refcount); DestroyWindow(window); }
@@ -15873,9 +15850,9 @@ static void test_texture_stages_limits(void) return; } hr = IDirect3DDevice3_GetDirect3D(device, &d3d); - ok(SUCCEEDED(hr), "Failed to get Direct3D interface, hr %#x.\n", hr); + ok(SUCCEEDED(hr), "Failed to get Direct3D interface, hr %#lx.\n", hr); hr = IDirect3D3_QueryInterface(d3d, &IID_IDirectDraw4, (void **)&ddraw); - ok(SUCCEEDED(hr), "Failed to get DirectDraw interface, hr %#x.\n", hr); + ok(SUCCEEDED(hr), "Failed to get DirectDraw interface, hr %#lx.\n", hr); IDirect3D3_Release(d3d);
memset(&surface_desc, 0, sizeof(surface_desc)); @@ -15885,25 +15862,25 @@ static void test_texture_stages_limits(void) surface_desc.dwWidth = 16; surface_desc.dwHeight = 16; hr = IDirectDraw4_CreateSurface(ddraw, &surface_desc, &surface, 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); hr = IDirectDrawSurface4_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); IDirectDrawSurface4_Release(surface);
for (i = 0; i < 8; ++i) { hr = IDirect3DDevice3_SetTexture(device, i, texture); - ok(hr == D3D_OK, "Failed to set texture %u, hr %#x.\n", i, hr); + ok(hr == D3D_OK, "Failed to set texture %u, hr %#lx.\n", i, hr); hr = IDirect3DDevice3_SetTexture(device, i, NULL); - ok(hr == D3D_OK, "Failed to set texture %u, hr %#x.\n", i, hr); + ok(hr == D3D_OK, "Failed to set texture %u, hr %#lx.\n", i, hr); hr = IDirect3DDevice3_SetTextureStageState(device, i, D3DTSS_COLOROP, D3DTOP_ADD); - ok(hr == D3D_OK, "Failed to set texture stage state %u, hr %#x.\n", i, hr); + ok(hr == D3D_OK, "Failed to set texture stage state %u, hr %#lx.\n", i, hr); }
IDirectDraw4_Release(ddraw); IDirect3DTexture2_Release(texture); refcount = IDirect3DDevice3_Release(device); - ok(!refcount, "Device has %u references left.\n", refcount); + ok(!refcount, "Device has %lu references left.\n", refcount); DestroyWindow(window); }
@@ -15924,39 +15901,38 @@ static void test_set_render_state(void) }
hr = IDirect3DDevice3_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 = IDirect3DDevice3_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 = IDirect3DDevice3_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 = IDirect3DDevice3_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 = IDirect3DDevice3_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 = IDirect3DDevice3_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 = IDirect3DDevice3_Release(device); - ok(!refcount, "Device has %u references left.\n", refcount); + ok(!refcount, "Device has %lu references left.\n", refcount); DestroyWindow(window); }
static void test_map_synchronisation(void) { LARGE_INTEGER frequency, diff, ts[3]; + unsigned int i, j, tri_count, colour; IDirect3DVertexBuffer *buffer; IDirect3DViewport3 *viewport; - unsigned int i, j, tri_count; D3DVERTEXBUFFERDESC vb_desc; IDirect3DDevice3 *device; BOOL unsynchronised, ret; IDirectDrawSurface4 *rt; IDirect3D3 *d3d; - D3DCOLOR colour; ULONG refcount; HWND window; HRESULT hr; @@ -16017,13 +15993,13 @@ static void test_map_synchronisation(void) }
hr = IDirect3DDevice3_GetDirect3D(device, &d3d); - ok(SUCCEEDED(hr), "Failed to get Direct3D3 interface, hr %#x.\n", hr); + ok(SUCCEEDED(hr), "Failed to get Direct3D3 interface, hr %#lx.\n", hr);
hr = IDirect3DDevice3_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 = IDirect3DDevice3_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);
tri_count = 0x1000;
@@ -16035,25 +16011,25 @@ static void test_map_synchronisation(void) vb_desc.dwFVF = D3DFVF_XYZ | D3DFVF_DIFFUSE; vb_desc.dwNumVertices = tri_count + 2; hr = IDirect3D3_CreateVertexBuffer(d3d, &vb_desc, &buffer, 0, NULL); - ok(SUCCEEDED(hr), "Failed to create vertex buffer, hr %#x.\n", hr); + ok(SUCCEEDED(hr), "Failed to create vertex buffer, hr %#lx.\n", hr); hr = IDirect3DVertexBuffer_Lock(buffer, DDLOCK_DISCARDCONTENTS, (void **)&quads, NULL); - ok(SUCCEEDED(hr), "Failed to lock vertex buffer, hr %#x.\n", hr); + ok(SUCCEEDED(hr), "Failed to lock vertex buffer, hr %#lx.\n", hr); for (j = 0; j < vb_desc.dwNumVertices / 4; ++j) { quads[j] = quad1; } hr = IDirect3DVertexBuffer_Unlock(buffer); - ok(SUCCEEDED(hr), "Failed to unlock vertex buffer, hr %#x.\n", hr); + ok(SUCCEEDED(hr), "Failed to unlock vertex buffer, hr %#lx.\n", hr);
/* Initial draw to initialise states, compile shaders, etc. */ hr = IDirect3DViewport3_Clear2(viewport, 1, &clear_rect, D3DCLEAR_TARGET, 0xff0000ff, 0.0f, 0); - ok(SUCCEEDED(hr), "Failed to clear, hr %#x.\n", hr); + ok(SUCCEEDED(hr), "Failed to clear, hr %#lx.\n", hr); hr = IDirect3DDevice3_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 = IDirect3DDevice3_DrawPrimitiveVB(device, D3DPT_TRIANGLESTRIP, buffer, 0, vb_desc.dwNumVertices, 0); - ok(SUCCEEDED(hr), "Failed to draw, hr %#x.\n", hr); + ok(SUCCEEDED(hr), "Failed to draw, hr %#lx.\n", hr); hr = IDirect3DDevice3_EndScene(device); - ok(SUCCEEDED(hr), "Failed to end scene, hr %#x.\n", hr); + ok(SUCCEEDED(hr), "Failed to end scene, hr %#lx.\n", hr); /* Read the result to ensure the GPU has finished drawing. */ colour = get_surface_color(rt, 320, 240);
@@ -16061,25 +16037,25 @@ static void test_map_synchronisation(void) ret = QueryPerformanceCounter(&ts[0]); ok(ret, "Failed to read performance counter.\n"); hr = IDirect3DViewport3_Clear2(viewport, 1, &clear_rect, D3DCLEAR_TARGET, 0xff0000ff, 0.0f, 0); - ok(SUCCEEDED(hr), "Failed to clear, hr %#x.\n", hr); + ok(SUCCEEDED(hr), "Failed to clear, hr %#lx.\n", hr); hr = IDirect3DDevice3_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 = IDirect3DDevice3_DrawPrimitiveVB(device, D3DPT_TRIANGLESTRIP, buffer, 0, vb_desc.dwNumVertices, 0); - ok(SUCCEEDED(hr), "Failed to draw, hr %#x.\n", hr); + ok(SUCCEEDED(hr), "Failed to draw, hr %#lx.\n", hr); hr = IDirect3DDevice3_EndScene(device); - ok(SUCCEEDED(hr), "Failed to end scene, hr %#x.\n", hr); + ok(SUCCEEDED(hr), "Failed to end scene, hr %#lx.\n", hr); colour = get_surface_color(rt, 320, 240); /* Time drawing a single triangle. */ ret = QueryPerformanceCounter(&ts[1]); ok(ret, "Failed to read performance counter.\n"); hr = IDirect3DViewport3_Clear2(viewport, 1, &clear_rect, D3DCLEAR_TARGET, 0xff0000ff, 0.0f, 0); - ok(SUCCEEDED(hr), "Failed to clear, hr %#x.\n", hr); + ok(SUCCEEDED(hr), "Failed to clear, hr %#lx.\n", hr); hr = IDirect3DDevice3_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 = IDirect3DDevice3_DrawPrimitiveVB(device, D3DPT_TRIANGLESTRIP, buffer, 0, 3, 0); - ok(SUCCEEDED(hr), "Failed to draw, hr %#x.\n", hr); + ok(SUCCEEDED(hr), "Failed to draw, hr %#lx.\n", hr); hr = IDirect3DDevice3_EndScene(device); - ok(SUCCEEDED(hr), "Failed to end scene, hr %#x.\n", hr); + ok(SUCCEEDED(hr), "Failed to end scene, hr %#lx.\n", hr); colour = get_surface_color(rt, 320, 240); ret = QueryPerformanceCounter(&ts[2]); ok(ret, "Failed to read performance counter.\n"); @@ -16095,32 +16071,32 @@ static void test_map_synchronisation(void) for (i = 0; i < ARRAY_SIZE(tests); ++i) { hr = IDirect3D3_CreateVertexBuffer(d3d, &vb_desc, &buffer, 0, NULL); - ok(SUCCEEDED(hr), "Failed to create vertex buffer, hr %#x.\n", hr); + ok(SUCCEEDED(hr), "Failed to create vertex buffer, hr %#lx.\n", hr); hr = IDirect3DVertexBuffer_Lock(buffer, DDLOCK_DISCARDCONTENTS, (void **)&quads, NULL); - ok(SUCCEEDED(hr), "Failed to lock vertex buffer, hr %#x.\n", hr); + ok(SUCCEEDED(hr), "Failed to lock vertex buffer, hr %#lx.\n", hr); for (j = 0; j < vb_desc.dwNumVertices / 4; ++j) { quads[j] = quad1; } hr = IDirect3DVertexBuffer_Unlock(buffer); - ok(SUCCEEDED(hr), "Failed to unlock vertex buffer, hr %#x.\n", hr); + ok(SUCCEEDED(hr), "Failed to unlock vertex buffer, hr %#lx.\n", hr);
/* Start a draw operation. */ hr = IDirect3DViewport3_Clear2(viewport, 1, &clear_rect, D3DCLEAR_TARGET, 0xff0000ff, 0.0f, 0); - ok(SUCCEEDED(hr), "Failed to clear, hr %#x.\n", hr); + ok(SUCCEEDED(hr), "Failed to clear, hr %#lx.\n", hr); hr = IDirect3DDevice3_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 = IDirect3DDevice3_DrawPrimitiveVB(device, D3DPT_TRIANGLESTRIP, buffer, 0, vb_desc.dwNumVertices, 0); - ok(SUCCEEDED(hr), "Failed to draw, hr %#x.\n", hr); + ok(SUCCEEDED(hr), "Failed to draw, hr %#lx.\n", hr); hr = IDirect3DDevice3_EndScene(device); - ok(SUCCEEDED(hr), "Failed to end scene, hr %#x.\n", hr); + ok(SUCCEEDED(hr), "Failed to end scene, hr %#lx.\n", hr);
/* Map the last quad while the draw is in progress. */ hr = IDirect3DVertexBuffer_Lock(buffer, DDLOCK_WAIT | tests[i].flags, (void **)&quads, NULL); - ok(SUCCEEDED(hr), "Failed to lock vertex buffer, hr %#x.\n", hr); + ok(SUCCEEDED(hr), "Failed to lock vertex buffer, hr %#lx.\n", hr); quads[(vb_desc.dwNumVertices / 4) - 1] = quad2; hr = IDirect3DVertexBuffer_Unlock(buffer); - ok(SUCCEEDED(hr), "Failed to unlock vertex buffer, hr %#x.\n", hr); + ok(SUCCEEDED(hr), "Failed to unlock vertex buffer, hr %#lx.\n", hr);
colour = get_surface_color(rt, 320, 240); unsynchronised = compare_color(colour, 0x00ffff00, 1); @@ -16134,18 +16110,17 @@ static void test_map_synchronisation(void) IDirectDrawSurface4_Release(rt); IDirect3D3_Release(d3d); refcount = IDirect3DDevice3_Release(device); - ok(!refcount, "Device has %u references left.\n", refcount); + ok(!refcount, "Device 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; IDirectDrawSurface4 *rt, *ds; IDirect3DViewport3 *viewport; DDSURFACEDESC2 surface_desc; IDirect3DDevice3 *device; - unsigned int i, x, y; IDirectDraw4 *ddraw; IDirect3D3 *d3d; ULONG refcount; @@ -16193,19 +16168,19 @@ static void test_depth_readback(void) }
hr = IDirect3DDevice3_GetDirect3D(device, &d3d); - ok(SUCCEEDED(hr), "Failed to get Direct3D3 interface, hr %#x.\n", hr); + ok(SUCCEEDED(hr), "Failed to get Direct3D3 interface, hr %#lx.\n", hr); hr = IDirect3D3_QueryInterface(d3d, &IID_IDirectDraw4, (void **)&ddraw); - ok(SUCCEEDED(hr), "Failed to get ddraw interface, hr %#x.\n", hr); + ok(SUCCEEDED(hr), "Failed to get ddraw interface, hr %#lx.\n", hr);
hr = IDirect3DDevice3_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 = IDirect3DDevice3_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 = IDirectDrawSurface4_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); IDirectDrawSurface4_Release(ds);
for (i = 0; i < ARRAY_SIZE(tests); ++i) @@ -16232,19 +16207,19 @@ 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 = IDirect3DDevice3_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 = IDirect3DViewport3_Clear2(viewport, 1, &clear_rect, D3DCLEAR_TARGET | D3DCLEAR_ZBUFFER, 0xff0000ff, 1.0f, 0); - ok(SUCCEEDED(hr), "Failed to clear, hr %#x.\n", hr); + ok(SUCCEEDED(hr), "Failed to clear, hr %#lx.\n", hr); hr = IDirect3DDevice3_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 = IDirect3DDevice3_DrawPrimitive(device, D3DPT_TRIANGLESTRIP, D3DFVF_XYZ | D3DFVF_DIFFUSE, quad, 4, 0); - ok(SUCCEEDED(hr), "Failed to draw, hr %#x.\n", hr); + ok(SUCCEEDED(hr), "Failed to draw, hr %#lx.\n", hr); hr = IDirect3DDevice3_EndScene(device); - ok(SUCCEEDED(hr), "Failed to end scene, hr %#x.\n", hr); + ok(SUCCEEDED(hr), "Failed to end scene, hr %#lx.\n", hr);
all_pass = TRUE; for (y = 60; y < 480; y += 120) @@ -16255,7 +16230,7 @@ static void test_depth_readback(void) memset(&surface_desc, 0, sizeof(surface_desc)); surface_desc.dwSize = sizeof(surface_desc); hr = IDirectDrawSurface4_Lock(ds, &r, &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);
depth = *((DWORD *)surface_desc.lpSurface) & tests[i].z_mask; expected_depth = (x * (0.9 / 640.0) + y * (0.1 / 480.0)) * tests[i].z_mask; @@ -16275,7 +16250,7 @@ static void test_depth_readback(void) all_pass = FALSE;
hr = IDirectDrawSurface4_Unlock(ds, &r); - ok(SUCCEEDED(hr), "Failed to unlock surface, hr %#x.\n", hr); + ok(SUCCEEDED(hr), "Failed to unlock surface, hr %#lx.\n", hr); } }
@@ -16283,7 +16258,7 @@ static void test_depth_readback(void) passed_fmts++;
hr = IDirectDrawSurface4_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); IDirectDrawSurface4_Release(ds); }
@@ -16294,7 +16269,7 @@ static void test_depth_readback(void) IDirectDraw4_Release(ddraw); IDirect3D3_Release(d3d); refcount = IDirect3DDevice3_Release(device); - ok(!refcount, "Device has %u references left.\n", refcount); + ok(!refcount, "Device has %lu references left.\n", refcount); DestroyWindow(window); }
@@ -16305,9 +16280,9 @@ static void test_clear(void) IDirect3DDevice3 *device; IDirectDrawSurface4 *rt; IDirectDraw4 *ddraw; + unsigned int color; IDirect3D3 *d3d; D3DRECT rect[2]; - D3DCOLOR color; ULONG refcount; HWND window; HRESULT hr; @@ -16321,19 +16296,19 @@ static void test_clear(void) }
hr = IDirect3DDevice3_GetDirect3D(device, &d3d); - ok(SUCCEEDED(hr), "Failed to get Direct3D3 interface, hr %#x.\n", hr); + ok(SUCCEEDED(hr), "Failed to get Direct3D3 interface, hr %#lx.\n", hr); hr = IDirect3D3_QueryInterface(d3d, &IID_IDirectDraw4, (void **)&ddraw); - ok(SUCCEEDED(hr), "Failed to get ddraw interface, hr %#x.\n", hr); + ok(SUCCEEDED(hr), "Failed to get ddraw interface, hr %#lx.\n", hr);
hr = IDirect3DDevice3_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 = IDirect3DDevice3_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 = IDirect3DViewport3_Clear2(viewport, 1, &rect_full, D3DCLEAR_TARGET, 0xffffffff, 0.0, 0); - 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; @@ -16350,7 +16325,7 @@ static void test_clear(void) /* Clear 2 rectangles with one call. Unlike d3d8/9, the refrast does not * refuse negative rectangles, but it will not clear them either. */ hr = IDirect3DViewport3_Clear2(viewport, 2, rect, D3DCLEAR_TARGET, 0xffff0000, 0.0f, 0); - 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); @@ -16362,7 +16337,7 @@ static void test_clear(void) ok(compare_color(color, 0x00ffffff, 0), "Clear rectangle 4 (neg, neg) has color 0x%08x.\n", color);
hr = IDirect3DViewport3_Clear2(viewport, 1, &rect_full, D3DCLEAR_TARGET, 0xffffffff, 0.0, 0); - 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. */ U1(rect_negneg).x1 = 640; @@ -16370,7 +16345,7 @@ static void test_clear(void) U3(rect_negneg).x2 = 320; U4(rect_negneg).y2 = 0; hr = IDirect3DViewport3_Clear2(viewport, 1, &rect_negneg, D3DCLEAR_TARGET, 0xff00ff00, 0.0f, 0); - 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) @@ -16391,28 +16366,28 @@ static void test_clear(void)
/* Test how the viewport affects clears. */ hr = IDirect3DViewport3_Clear2(viewport, 1, &rect_full, D3DCLEAR_TARGET, 0xffffffff, 0.0f, 0); - 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 = IDirect3DDevice3_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);
hr = IDirect3DViewport3_Clear2(viewport2, 1, &rect_full, D3DCLEAR_TARGET, 0xff0000ff, 0.0f, 0); - 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 = IDirect3DDevice3_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; U3(rect[0]).x2 = 480; U4(rect[0]).y2 = 360; hr = IDirect3DViewport3_Clear2(viewport3, 1, &rect[0], D3DCLEAR_TARGET, 0xff00ff00, 0.0f, 0); - ok(SUCCEEDED(hr), "Failed to clear, hr %#x.\n", hr); + ok(SUCCEEDED(hr), "Failed to clear, hr %#lx.\n", hr);
hr = IDirect3DDevice3_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); @@ -16444,13 +16419,13 @@ static void test_clear(void) /* The clear rectangle is rendertarget absolute, not relative to the * viewport. */ hr = IDirect3DViewport3_Clear2(viewport, 1, &rect_full, D3DCLEAR_TARGET, 0xffffffff, 0.0f, 0); - 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 = IDirect3DViewport3_Clear2(viewport3, 1, &rect[0], D3DCLEAR_TARGET, 0xff00ff00, 0.0f, 0); - 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); @@ -16498,7 +16473,7 @@ static void test_clear(void) IDirectDraw4_Release(ddraw); IDirect3D3_Release(d3d); refcount = IDirect3DDevice3_Release(device); - ok(!refcount, "Device has %u references left.\n", refcount); + ok(!refcount, "Device has %lu references left.\n", refcount); DestroyWindow(window); }
@@ -16556,12 +16531,12 @@ static HRESULT WINAPI enum_surfaces_create_cb(IDirectDrawSurface4 *surface, DDSU 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 DDSURFACEDESC2 *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"); } @@ -16586,18 +16561,18 @@ static void test_enum_surfaces(void) memset(&desc, 0, sizeof(desc)); desc.dwSize = sizeof(desc); hr = IDirectDraw4_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 = U4(desc).ddpfPixelFormat;
hr = IDirectDraw4_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 = IDirectDraw4_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 = IDirectDraw4_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); @@ -16607,52 +16582,52 @@ static void test_enum_surfaces(void) desc.dwWidth = 32; desc.dwHeight = 32; hr = IDirectDraw4_CreateSurface(ddraw, &desc, ¶m.surfaces[0], NULL); - ok(hr == DD_OK, "Failed to create a surface, hr %#x.\n", hr); + ok(hr == DD_OK, "Failed to create a surface, hr %#lx.\n", hr);
hr = IDirectDrawSurface4_GetAttachedSurface(param.surfaces[0], &desc.ddsCaps, ¶m.surfaces[1]); - ok(hr == DD_OK, "Failed to get attached surface, hr %#x.\n", hr); + ok(hr == DD_OK, "Failed to get attached surface, hr %#lx.\n", hr); hr = IDirectDrawSurface4_GetAttachedSurface(param.surfaces[1], &desc.ddsCaps, ¶m.surfaces[2]); - ok(hr == DD_OK, "Failed to get attached surface, hr %#x.\n", hr); + ok(hr == DD_OK, "Failed to get attached surface, hr %#lx.\n", hr); hr = IDirectDrawSurface4_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 = IDirectDraw4_EnumSurfaces(ddraw, DDENUMSURFACES_DOESEXIST | DDENUMSURFACES_ALL, &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);
param.count = 0; hr = IDirectDraw4_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 == 3, "Got unexpected number of enumerated surfaces %u.\n", param.count);
desc.dwFlags = DDSD_WIDTH | DDSD_HEIGHT; param.count = 0; hr = IDirectDraw4_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 = IDirectDraw4_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 = IDirectDraw4_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 = IDirectDraw4_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);
IDirectDrawSurface4_Release(param.surfaces[2]); @@ -16662,7 +16637,7 @@ static void test_enum_surfaces(void) param.count = 0; hr = IDirectDraw4_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)); @@ -16672,15 +16647,15 @@ static void test_enum_surfaces(void)
hr = IDirectDraw4_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 = IDirectDraw4_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 = IDirectDraw4_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. */ @@ -16689,13 +16664,13 @@ static void test_enum_surfaces(void) desc.dwFlags |= DDSD_PIXELFORMAT; U4(desc).ddpfPixelFormat = current_format; hr = IDirectDraw4_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 = IDirectDraw4_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; @@ -16706,15 +16681,15 @@ static void test_enum_surfaces(void) param.count = 0; hr = IDirectDraw4_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 = IDirectDraw4_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 = IDirectDraw4_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); IDirectDrawSurface4_Release(param.surfaces[0]);
@@ -16726,7 +16701,7 @@ static void test_enum_surfaces(void) param.count = 0; hr = IDirectDraw4_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);
IDirectDraw4_Release(ddraw); @@ -16796,21 +16771,21 @@ static void test_viewport(void) }
hr = IDirect3DDevice3_GetDirect3D(device, &d3d); - ok(SUCCEEDED(hr), "Failed to get Direct3D3 interface, hr %#x.\n", hr); + ok(SUCCEEDED(hr), "Failed to get Direct3D3 interface, hr %#lx.\n", hr); hr = IDirect3D3_QueryInterface(d3d, &IID_IDirectDraw4, (void **)&ddraw); - ok(SUCCEEDED(hr), "Failed to get ddraw interface, hr %#x.\n", hr); + ok(SUCCEEDED(hr), "Failed to get ddraw interface, hr %#lx.\n", hr);
hr = IDirect3DDevice3_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 = IDirect3DDevice3_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 = IDirect3DDevice3_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 = IDirect3DDevice3_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 = IDirect3DDevice3_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);
ds = get_depth_stencil(device); memset(&surface_desc, 0, sizeof(surface_desc)); @@ -16831,23 +16806,23 @@ static void test_viewport(void) surface_desc.dwHeight = rt_sizes[i].y; surface_desc.ddsCaps.dwCaps = DDSCAPS_OFFSCREENPLAIN | DDSCAPS_3DDEVICE; hr = IDirectDraw4_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; U4(surface_desc).ddpfPixelFormat = z_fmt; hr = IDirectDraw4_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 = IDirectDrawSurface4_AddAttachedSurface(rt, ds); - ok(hr == DD_OK, "Got unexpected hr %#x.\n", hr); + ok(hr == DD_OK, "Got unexpected hr %#lx.\n", hr);
hr = IDirect3DDevice3_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 = IDirect3DDevice3_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); @@ -16864,12 +16839,12 @@ static void test_viewport(void) || tests[j].vp.dwY + tests[j].vp.dwHeight > rt_sizes[i].y;
hr = IDirect3DViewport3_Clear2(full_viewport, 1, &clear_rect, D3DCLEAR_TARGET, 0xff000000, 0.0f, 0); - ok(hr == DD_OK, "Got unexpected hr %#x.\n", hr); + ok(hr == DD_OK, "Got unexpected hr %#lx.\n", hr);
hr = IDirect3D3_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 = IDirect3DViewport3_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; @@ -16883,14 +16858,14 @@ static void test_viewport(void) vp.dvMinZ = 0.0f; vp.dvMaxZ = 1.0f; hr = IDirect3DViewport3_SetViewport2(viewport, &vp); - ok(hr == D3DERR_VIEWPORTHASNODEVICE, "Got unexpected hr %#x.\n", hr); + ok(hr == D3DERR_VIEWPORTHASNODEVICE, "Got unexpected hr %#lx.\n", hr); hr = IDirect3DDevice3_AddViewport(device, viewport); - ok(hr == DD_OK, "Got unexpected hr %#x.\n", hr); + ok(hr == DD_OK, "Got unexpected hr %#lx.\n", hr); hr = IDirect3DViewport3_SetViewport2(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 = IDirect3DDevice3_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); @@ -16899,11 +16874,11 @@ static void test_viewport(void) }
hr = IDirect3DDevice3_BeginScene(device); - ok(hr == DD_OK, "Got unexpected hr %#x.\n", hr); + ok(hr == DD_OK, "Got unexpected hr %#lx.\n", hr); hr = IDirect3DDevice3_DrawPrimitive(device, D3DPT_TRIANGLESTRIP, D3DFVF_XYZ, quad, 4, 0); - ok(hr == DD_OK, "Got unexpected hr %#x.\n", hr); + ok(hr == DD_OK, "Got unexpected hr %#lx.\n", hr); hr = IDirect3DDevice3_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);
@@ -16914,7 +16889,7 @@ static void test_viewport(void) destroy_viewport(device, full_viewport);
hr = IDirectDrawSurface4_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); IDirectDrawSurface4_Release(ds);
IDirectDrawSurface4_Release(rt); @@ -16923,7 +16898,7 @@ static void test_viewport(void) }
refcount = IDirect3DDevice3_Release(device); - ok(!refcount, "Device has %u references left.\n", refcount); + ok(!refcount, "Device has %lu references left.\n", refcount); IDirect3D3_Release(d3d); IDirectDraw4_Release(ddraw); DestroyWindow(window); @@ -16985,48 +16960,48 @@ static void test_find_device(void) result.dwSize = sizeof(result); search.dwSize = sizeof(search); hr = IDirect3D3_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 = IDirect3D3_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 = IDirect3D3_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 = IDirect3D3_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.ddHwDesc), - "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.ddSwDesc), - "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 = IDirect3D3_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 = IDirect3D3_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 = IDirect3D3_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.ddHwDesc), - "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.ddSwDesc), - "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 = IDirect3D3_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.ddHwDesc), - "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.ddSwDesc), - "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) { @@ -17039,21 +17014,21 @@ static void test_find_device(void) result.dwSize = sizeof(result);
hr = IDirect3D3_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.ddHwDesc), - "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.ddSwDesc), - "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); } }
@@ -17080,7 +17055,7 @@ static void test_find_device(void) search.dcmColorModel = 0xdeadbeef; result.dwSize = sizeof(result); hr = IDirect3D3_FindDevice(d3d, &search, &result); - ok(hr == D3D_OK, "Got unexpected hr %#x.\n", hr); + ok(hr == D3D_OK, "Got unexpected hr %#lx.\n", hr);
IDirect3D3_Release(d3d); IDirectDraw4_Release(ddraw); @@ -17096,9 +17071,9 @@ static LRESULT CALLBACK killfocus_proc(HWND window, UINT message, WPARAM wparam, if (message == WM_KILLFOCUS) { ref = IDirectDrawSurface4_Release(killfocus_surface); - ok(!ref, "Unexpected surface refcount %u.\n", ref); + ok(!ref, "Unexpected surface refcount %lu.\n", ref); ref = IDirectDraw4_Release(killfocus_ddraw); - ok(!ref, "Unexpected ddraw refcount %u.\n", ref); + ok(!ref, "Unexpected ddraw refcount %lu.\n", ref); killfocus_ddraw = NULL; }
@@ -17123,14 +17098,14 @@ static void test_killfocus(void) ok(!!killfocus_ddraw, "Failed to create a ddraw object.\n");
hr = IDirectDraw4_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 = IDirectDraw4_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"); @@ -17150,8 +17125,8 @@ static void test_sysmem_draw(void) IDirect3DVertexBuffer *vb; IDirect3DDevice3 *device; IDirectDraw4 *ddraw; + unsigned int color; IDirect3D3 *d3d; - D3DCOLOR color; ULONG refcount; HWND window; HRESULT hr; @@ -17186,54 +17161,54 @@ static void test_sysmem_draw(void) }
hr = IDirect3DDevice3_GetDirect3D(device, &d3d); - ok(hr == DD_OK, "Got unexpected hr %#x.\n", hr); + ok(hr == DD_OK, "Got unexpected hr %#lx.\n", hr); hr = IDirect3D3_QueryInterface(d3d, &IID_IDirectDraw4, (void **)&ddraw); - ok(hr == DD_OK, "Got unexpected hr %#x.\n", hr); + ok(hr == DD_OK, "Got unexpected hr %#lx.\n", hr); hr = IDirect3DDevice3_GetRenderTarget(device, &rt); - 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, 640, 480); hr = IDirect3DDevice3_SetCurrentViewport(device, viewport); - ok(hr == DD_OK, "Got unexpected hr %#x.\n", hr); + ok(hr == DD_OK, "Got unexpected hr %#lx.\n", hr);
hr = IDirect3DDevice3_SetRenderState(device, D3DRENDERSTATE_LIGHTING, FALSE); - ok(hr == DD_OK, "Got unexpected hr %#x.\n", hr); + ok(hr == DD_OK, "Got unexpected hr %#lx.\n", hr);
vb_desc.dwSize = sizeof(vb_desc); vb_desc.dwCaps = D3DVBCAPS_SYSTEMMEMORY; vb_desc.dwFVF = D3DFVF_XYZ | D3DFVF_DIFFUSE; vb_desc.dwNumVertices = ARRAY_SIZE(quad); hr = IDirect3D3_CreateVertexBuffer(d3d, &vb_desc, &vb, 0, NULL); - ok(hr == DD_OK, "Got unexpected hr %#x.\n", hr); + ok(hr == DD_OK, "Got unexpected hr %#lx.\n", hr);
hr = IDirect3DVertexBuffer_Lock(vb, 0, (void **)&data, NULL); - ok(hr == DD_OK, "Got unexpected hr %#x.\n", hr); + ok(hr == DD_OK, "Got unexpected hr %#lx.\n", hr); memcpy(data, quad, sizeof(quad)); hr = IDirect3DVertexBuffer_Unlock(vb); - ok(hr == DD_OK, "Got unexpected hr %#x.\n", hr); + ok(hr == DD_OK, "Got unexpected hr %#lx.\n", hr);
hr = IDirect3DViewport3_Clear2(viewport, 1, &rect_full, D3DCLEAR_TARGET, 0xffffffff, 0.0f, 0); - ok(hr == DD_OK, "Got unexpected hr %#x.\n", hr); + ok(hr == DD_OK, "Got unexpected hr %#lx.\n", hr);
hr = IDirect3DDevice3_BeginScene(device); - ok(hr == DD_OK, "Got unexpected hr %#x.\n", hr); + ok(hr == DD_OK, "Got unexpected hr %#lx.\n", hr); hr = IDirect3DDevice3_DrawPrimitiveVB(device, D3DPT_TRIANGLESTRIP, vb, 4, 4, 0); - ok(hr == DD_OK, "Got unexpected hr %#x.\n", hr); + ok(hr == DD_OK, "Got unexpected hr %#lx.\n", hr); hr = IDirect3DDevice3_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, 0x00007f7f, 1), "Got unexpected color 0x%08x.\n", color);
hr = IDirect3DViewport3_Clear2(viewport, 1, &rect_full, D3DCLEAR_TARGET, 0xffffffff, 0.0f, 0); - ok(hr == DD_OK, "Got unexpected hr %#x.\n", hr); + ok(hr == DD_OK, "Got unexpected hr %#lx.\n", hr);
hr = IDirect3DDevice3_BeginScene(device); - ok(hr == DD_OK, "Got unexpected hr %#x.\n", hr); + ok(hr == DD_OK, "Got unexpected hr %#lx.\n", hr); hr = IDirect3DDevice3_DrawIndexedPrimitiveVB(device, D3DPT_TRIANGLESTRIP, vb, indices, 4, 0); - ok(hr == DD_OK, "Got unexpected hr %#x.\n", hr); + ok(hr == DD_OK, "Got unexpected hr %#lx.\n", hr); hr = IDirect3DDevice3_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, 0x00007f7f, 1), "Got unexpected color 0x%08x.\n", color); @@ -17252,22 +17227,22 @@ static void test_sysmem_draw(void) U4(U4(surface_desc).ddpfPixelFormat).dwBBitMask = 0x000000ff; U5(U4(surface_desc).ddpfPixelFormat).dwRGBAlphaBitMask = 0xff000000; hr = IDirectDraw4_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 = IDirectDrawSurface4_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); IDirectDrawSurface4_Release(surface); hr = IDirect3DDevice3_SetTexture(device, 0, texture); - ok(hr == D3D_OK, "Got unexpected hr %#x.\n", hr); + ok(hr == D3D_OK, "Got unexpected hr %#lx.\n", hr);
hr = IDirect3DViewport3_Clear2(viewport, 1, &rect_full, D3DCLEAR_TARGET, 0xffffffff, 0.0f, 0); - ok(hr == D3D_OK, "Got unexpected hr %#x.\n", hr); + ok(hr == D3D_OK, "Got unexpected hr %#lx.\n", hr);
hr = IDirect3DDevice3_BeginScene(device); - ok(hr == D3D_OK, "Got unexpected hr %#x.\n", hr); + ok(hr == D3D_OK, "Got unexpected hr %#lx.\n", hr); hr = IDirect3DDevice3_DrawPrimitiveVB(device, D3DPT_TRIANGLESTRIP, vb, 0, 4, 0); - ok(hr == D3D_OK, "Got unexpected hr %#x.\n", hr); + ok(hr == D3D_OK, "Got unexpected hr %#lx.\n", hr); hr = IDirect3DDevice3_EndScene(device); - ok(hr == D3D_OK || hr == D3DERR_SCENE_END_FAILED, "Got unexpected hr %#x.\n", hr); + ok(hr == D3D_OK || hr == D3DERR_SCENE_END_FAILED, "Got unexpected hr %#lx.\n", hr);
IDirect3DTexture2_Release(texture); IDirect3DVertexBuffer_Release(vb); @@ -17276,7 +17251,7 @@ static void test_sysmem_draw(void) IDirectDraw4_Release(ddraw); IDirect3D3_Release(d3d); refcount = IDirect3DDevice3_Release(device); - ok(!refcount, "Device has %u references left.\n", refcount); + ok(!refcount, "Device has %lu references left.\n", refcount); DestroyWindow(window); }
@@ -17294,38 +17269,38 @@ static void test_gdi_surface(void) ddraw = create_ddraw(); ok(!!ddraw, "Failed to create a ddraw object.\n"); hr = IDirectDraw4_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 = IDirectDraw4_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 = IDirectDraw4_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 = IDirectDraw4_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 = IDirectDraw4_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); IDirectDrawSurface4_Release(gdi_surface);
/* Flipping to the GDI surface requires the primary surface to be * flippable. */ hr = IDirectDraw4_FlipToGDISurface(ddraw); - ok(hr == DDERR_NOTFLIPPABLE, "Got unexpected hr %#x.\n", hr); + ok(hr == DDERR_NOTFLIPPABLE, "Got unexpected hr %#lx.\n", hr);
IDirectDrawSurface4_Release(primary);
hr = IDirectDraw4_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); @@ -17333,40 +17308,40 @@ static void test_gdi_surface(void) surface_desc.ddsCaps.dwCaps = DDSCAPS_PRIMARYSURFACE | DDSCAPS_COMPLEX | DDSCAPS_FLIP; U5(surface_desc).dwBackBufferCount = 1; hr = IDirectDraw4_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 = IDirectDrawSurface4_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 = IDirectDraw4_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); IDirectDrawSurface4_Release(gdi_surface);
hr = IDirectDrawSurface4_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 = IDirectDraw4_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); IDirectDrawSurface4_Release(gdi_surface);
hr = IDirectDraw4_FlipToGDISurface(ddraw); - ok(hr == DD_OK, "Got unexpected hr %#x.\n", hr); + ok(hr == DD_OK, "Got unexpected hr %#lx.\n", hr);
hr = IDirectDraw4_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); IDirectDrawSurface4_Release(gdi_surface);
hr = IDirectDraw4_FlipToGDISurface(ddraw); - ok(hr == DD_OK, "Got unexpected hr %#x.\n", hr); + ok(hr == DD_OK, "Got unexpected hr %#lx.\n", hr);
IDirectDrawSurface4_Release(backbuffer); IDirectDrawSurface4_Release(primary);
refcount = IDirectDraw4_Release(ddraw); - ok(!refcount, "%u references left.\n", refcount); + ok(!refcount, "%lu references left.\n", refcount); DestroyWindow(window); }
@@ -17378,8 +17353,7 @@ static void test_alphatest(void) IDirect3DViewport3 *viewport; IDirect3DDevice3 *device; IDirectDrawSurface4 *rt; - unsigned int i; - D3DCOLOR color; + unsigned int color, i; ULONG refcount; HWND window; DWORD value; @@ -17388,9 +17362,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[] = { @@ -17424,56 +17396,56 @@ static void test_alphatest(void) return; } hr = IDirect3DDevice3_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 = IDirect3DDevice3_SetCurrentViewport(device, viewport); - ok(hr == D3D_OK, "Got unexpected hr %#x.\n", hr); + ok(hr == D3D_OK, "Got unexpected hr %#lx.\n", hr);
hr = IDirect3DViewport3_Clear2(viewport, 1, &rect_full, D3DCLEAR_TARGET, 0xff0000ff, 0.0f, 0); - ok(hr == D3D_OK, "Got unexpected hr %#x.\n", hr); + ok(hr == D3D_OK, "Got unexpected hr %#lx.\n", hr); hr = IDirect3DDevice3_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 = IDirect3DDevice3_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 = IDirect3DDevice3_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);
for (i = 0; i < ARRAY_SIZE(test_data); ++i) { hr = IDirect3DDevice3_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 = IDirect3DViewport3_Clear2(viewport, 1, &rect_full, D3DCLEAR_TARGET, ALPHATEST_FAILED, 0.0f, 0); - ok(hr == D3D_OK, "Got unexpected hr %#x.\n", hr); + ok(hr == D3D_OK, "Got unexpected hr %#lx.\n", hr); hr = IDirect3DDevice3_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 = IDirect3DDevice3_BeginScene(device); - ok(hr == D3D_OK, "Got unexpected hr %#x.\n", hr); + ok(hr == D3D_OK, "Got unexpected hr %#lx.\n", hr); hr = IDirect3DDevice3_DrawPrimitive(device, D3DPT_TRIANGLESTRIP, D3DFVF_XYZ | D3DFVF_DIFFUSE, 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 = IDirect3DDevice3_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 = IDirect3DViewport3_Clear2(viewport, 1, &rect_full, D3DCLEAR_TARGET, ALPHATEST_FAILED, 0.0f, 0); - ok(hr == D3D_OK, "Got unexpected hr %#x.\n", hr); + ok(hr == D3D_OK, "Got unexpected hr %#lx.\n", hr); hr = IDirect3DDevice3_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 = IDirect3DDevice3_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 = IDirect3DDevice3_BeginScene(device); - ok(hr == D3D_OK, "Got unexpected hr %#x.\n", hr); + ok(hr == D3D_OK, "Got unexpected hr %#lx.\n", hr); hr = IDirect3DDevice3_DrawPrimitive(device, D3DPT_TRIANGLESTRIP, D3DFVF_XYZ | D3DFVF_DIFFUSE, 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 = IDirect3DDevice3_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", @@ -17483,7 +17455,7 @@ static void test_alphatest(void) destroy_viewport(device, viewport); IDirectDrawSurface4_Release(rt); refcount = IDirect3DDevice3_Release(device); - ok(!refcount, "Device has %u references left.\n", refcount); + ok(!refcount, "Device has %lu references left.\n", refcount); DestroyWindow(window); }
@@ -17504,24 +17476,24 @@ static void test_clipper_refcount(void) ddraw = create_ddraw(); ok(!!ddraw, "Failed to create a ddraw object.\n"); hr = IDirectDraw4_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 = IDirectDraw4_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 = IDirectDraw4_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 = IDirectDraw4_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; @@ -17529,50 +17501,50 @@ static void test_clipper_refcount(void)
/* Surfaces hold a reference to clippers. No surprises there. */ hr = IDirectDrawSurface4_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 = IDirectDrawSurface4_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 = IDirectDrawSurface4_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 = IDirectDrawSurface4_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 = IDirectDrawSurface4_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. @@ -17580,11 +17552,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 = IDirectDraw4_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 = IDirectDraw4_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 = IDirectDrawSurface4_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); @@ -17600,7 +17572,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 = IDirectDrawSurface4_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); }
@@ -17608,10 +17580,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 = IDirectDrawSurface4_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. */ @@ -17624,33 +17596,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 = IDirectDraw4_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 = IDirectDraw4_Release(ddraw); - ok(!refcount, "%u references left.\n", refcount); + ok(!refcount, "%lu references left.\n", refcount); DestroyWindow(window); }
@@ -17703,35 +17675,35 @@ static void test_caps(void) hal_caps.dwSize = sizeof(hal_caps); hel_caps.dwSize = sizeof(hel_caps); hr = IDirectDraw4_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);
IDirectDraw4_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_IDirectDraw4, (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)); @@ -17739,27 +17711,27 @@ static void test_caps(void) hal_caps.dwSize = sizeof(hal_caps); hel_caps.dwSize = sizeof(hel_caps); hr = IDirectDraw4_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); - todo_wine ok(!hel_caps.ddsCaps.dwCaps, "Got unexpected caps %#x.\n", hel_caps.ddsCaps.dwCaps); + "Got unexpected caps %#lx.\n", hal_caps.ddsCaps.dwCaps); + todo_wine ok(!hel_caps.ddsCaps.dwCaps, "Got unexpected caps %#lx.\n", hel_caps.ddsCaps.dwCaps);
IDirectDraw4_Release(ddraw); }
hr = DirectDrawCreate((GUID *)DDCREATE_EMULATIONONLY, &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_IDirectDraw4, (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)); @@ -17767,19 +17739,19 @@ static void test_caps(void) hal_caps.dwSize = sizeof(hal_caps); hel_caps.dwSize = sizeof(hel_caps); hr = IDirectDraw4_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);
IDirectDraw4_Release(ddraw); } @@ -17797,7 +17769,7 @@ static void test_d32_support(void) ddraw = create_ddraw(); ok(!!ddraw, "Failed to create a ddraw object.\n"); hr = IDirectDraw4_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); @@ -17810,25 +17782,25 @@ static void test_d32_support(void) surface_desc.dwWidth = 64; surface_desc.dwHeight = 64; hr = IDirectDraw4_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 = IDirectDrawSurface4_GetSurfaceDesc(surface, &surface_desc); - ok(hr == DD_OK, "Got unexpected hr %#x.\n", hr); - ok((surface_desc.dwFlags & DDSD_PIXELFORMAT), "Got unexpected flags %#x.\n", surface_desc.dwFlags); + ok(hr == DD_OK, "Got unexpected hr %#lx.\n", hr); + ok((surface_desc.dwFlags & DDSD_PIXELFORMAT), "Got unexpected flags %#lx.\n", surface_desc.dwFlags); ok(U4(surface_desc).ddpfPixelFormat.dwFlags & DDPF_ZBUFFER, - "Got unexpected format flags %#x.\n", U4(surface_desc).ddpfPixelFormat.dwFlags); + "Got unexpected format flags %#lx.\n", U4(surface_desc).ddpfPixelFormat.dwFlags); ok(U1(U4(surface_desc).ddpfPixelFormat).dwZBufferBitDepth == 32, - "Got unexpected dwZBufferBitDepth %u.\n", U1(U4(surface_desc).ddpfPixelFormat).dwZBufferBitDepth); + "Got unexpected dwZBufferBitDepth %lu.\n", U1(U4(surface_desc).ddpfPixelFormat).dwZBufferBitDepth); ok(U3(U4(surface_desc).ddpfPixelFormat).dwZBitMask == 0xffffffff, - "Got unexpected Z mask 0x%08x.\n", U3(U4(surface_desc).ddpfPixelFormat).dwZBitMask); + "Got unexpected Z mask 0x%08lx.\n", U3(U4(surface_desc).ddpfPixelFormat).dwZBitMask); 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); IDirectDrawSurface4_Release(surface);
refcount = IDirectDraw4_Release(ddraw); - ok(!refcount, "%u references left.\n", refcount); + ok(!refcount, "%lu references left.\n", refcount); DestroyWindow(window); }
@@ -18030,11 +18002,11 @@ static void test_surface_format_conversion_alpha(void) ddraw = create_ddraw(); ok(!!ddraw, "Failed to create a ddraw object.\n"); hr = IDirectDraw4_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);
hr = IDirect3DDevice3_EnumTextureFormats(device, test_block_formats_creation_cb, &supported_fmts); - ok(hr == DD_OK, "Got unexpected hr %#x.\n", hr); + ok(hr == DD_OK, "Got unexpected hr %#lx.\n", hr);
is_wine = !strcmp(winetest_platform, "wine");
@@ -18072,17 +18044,17 @@ static void test_surface_format_conversion_alpha(void) U4(surface_desc).ddpfPixelFormat = src_format->fmt; surface_desc.ddsCaps.dwCaps = test_caps[j].src_caps; hr = IDirectDraw4_CreateSurface(ddraw, &surface_desc, &src_surf, NULL); - ok(hr == DD_OK, "Test (%u, %u), got unexpected hr %#x.\n", j, i, hr); + ok(hr == DD_OK, "Test (%u, %u), got unexpected hr %#lx.\n", j, i, hr);
U4(surface_desc).ddpfPixelFormat = dst_format->fmt; surface_desc.ddsCaps.dwCaps = test_caps[j].dst_caps; hr = IDirectDraw4_CreateSurface(ddraw, &surface_desc, &dst_surf, NULL); - ok(hr == DD_OK, "Test (%u, %u), got unexpected hr %#x.\n", j, i, hr); + ok(hr == DD_OK, "Test (%u, %u), got unexpected hr %#lx.\n", j, i, hr);
memset(&lock, 0, sizeof(lock)); lock.dwSize = sizeof(lock); hr = IDirectDrawSurface4_Lock(src_surf, NULL, &lock, 0, NULL); - ok(hr == DD_OK, "Got unexpected hr %#x.\n", hr); + ok(hr == DD_OK, "Got unexpected hr %#lx.\n", hr); pitch = U1(lock).lPitch; for (y = 0; y < src_format->y_blocks; ++y) { @@ -18091,7 +18063,7 @@ static void test_surface_format_conversion_alpha(void) src_format->block_size * src_format->x_blocks); } hr = IDirectDrawSurface4_Unlock(src_surf, NULL); - ok(hr == DD_OK, "Got unexpected hr %#x.\n", hr); + ok(hr == DD_OK, "Got unexpected hr %#lx.\n", hr);
hr = IDirectDrawSurface4_Blt(dst_surf, NULL, src_surf, NULL, DDBLT_WAIT, NULL); if (!is_wine && FAILED(hr)) @@ -18099,17 +18071,17 @@ static void test_surface_format_conversion_alpha(void) /* Some software blits are rejected on Windows. */ IDirectDrawSurface4_Release(dst_surf); IDirectDrawSurface4_Release(src_surf); - skip("Skipping test (%u, %u), cannot blit %s -> %s, hr %#x.\n", j, i, + skip("Skipping test (%u, %u), cannot blit %s -> %s, hr %#lx.\n", j, i, src_format->name, dst_format->name, hr); continue; } - ok(hr == DD_OK, "Test (%u, %s -> %s), got unexpected hr %#x.\n", j, + ok(hr == DD_OK, "Test (%u, %s -> %s), got unexpected hr %#lx.\n", j, src_format->name, dst_format->name, hr);
memset(&lock, 0, sizeof(lock)); lock.dwSize = sizeof(lock); hr = IDirectDrawSurface4_Lock(dst_surf, NULL, &lock, 0, NULL); - ok(hr == DD_OK, "Got unexpected hr %#x.\n", hr); + ok(hr == DD_OK, "Got unexpected hr %#lx.\n", hr); pitch = U1(lock).lPitch;
for (y = 0; y < dst_format->y_blocks; ++y) @@ -18137,7 +18109,7 @@ static void test_surface_format_conversion_alpha(void) break; } hr = IDirectDrawSurface4_Unlock(dst_surf, NULL); - ok(hr == DD_OK, "Got unexpected hr %#x.\n", hr); + ok(hr == DD_OK, "Got unexpected hr %#lx.\n", hr);
IDirectDrawSurface4_Release(dst_surf); IDirectDrawSurface4_Release(src_surf); @@ -18146,7 +18118,7 @@ static void test_surface_format_conversion_alpha(void)
IDirect3DDevice3_Release(device); refcount = IDirectDraw4_Release(ddraw); - ok(!refcount, "%u references left.\n", refcount); + ok(!refcount, "%lu references left.\n", refcount); DestroyWindow(window); }
@@ -18200,13 +18172,13 @@ static void test_cursor_clipping(void) memset(&surface_desc, 0, sizeof(surface_desc)); surface_desc.dwSize = sizeof(surface_desc); hr = IDirectDraw4_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 = IDirectDraw4_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); @@ -18214,87 +18186,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 = IDirectDraw4_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 = IDirectDraw4_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 = IDirectDraw4_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 = IDirectDraw4_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 = IDirectDraw4_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));
@@ -18321,10 +18293,10 @@ static BOOL CALLBACK test_window_position_cb(HMONITOR monitor, HDC hdc, RECT *mo flush_events();
hr = IDirectDraw4_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)); @@ -18335,9 +18307,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)); @@ -18345,7 +18317,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, @@ -18354,15 +18326,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)); @@ -18370,25 +18342,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 = IDirectDraw4_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));
@@ -18419,14 +18391,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 = IDirectDraw4_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); @@ -18453,41 +18425,39 @@ static void test_get_display_mode(void) ok(!!window, "Failed to create a window.\n");
hr = IDirectDraw4_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 = IDirectDraw4_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 = IDirectDraw4_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"); @@ -18496,17 +18466,17 @@ static void test_get_display_mode(void)
hr = IDirectDraw4_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 = IDirectDraw4_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: @@ -18540,8 +18510,8 @@ 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; IDirectDrawSurface4 *surface, *rt; - D3DCOLOR color, expected_color; IDirect3DViewport3 *viewport; IDirect3DTexture2 *texture; IDirect3DDevice3 *device; @@ -18560,15 +18530,15 @@ static void test_texture_wrong_caps(const GUID *device_guid) return; } hr = IDirect3DDevice3_GetDirect3D(device, &d3d); - ok(hr == D3D_OK, "Got unexpected hr %#x.\n", hr); + ok(hr == D3D_OK, "Got unexpected hr %#lx.\n", hr); hr = IDirect3D3_QueryInterface(d3d, &IID_IDirectDraw4, (void **)&ddraw); - ok(hr == D3D_OK, "Got unexpected hr %#x.\n", hr); + ok(hr == D3D_OK, "Got unexpected hr %#lx.\n", hr); hr = IDirect3DDevice3_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 = IDirect3DDevice3_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); @@ -18578,35 +18548,35 @@ static void test_texture_wrong_caps(const GUID *device_guid) ddsd.ddsCaps.dwCaps = DDSCAPS_OFFSCREENPLAIN; U4(ddsd).ddpfPixelFormat = fmt; hr = IDirectDraw4_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 = IDirectDrawSurface4_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);
fill_surface(surface, 0xff00ff00);
hr = IDirect3DDevice3_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 = IDirect3DDevice3_SetTextureStageState(device, 0, D3DTSS_COLOROP, D3DTOP_SELECTARG1); - ok(hr == D3D_OK, "Got unexpected hr %#x.\n", hr); + ok(hr == D3D_OK, "Got unexpected hr %#lx.\n", hr); hr = IDirect3DDevice3_SetTextureStageState(device, 0, D3DTSS_ALPHAOP, D3DTOP_SELECTARG1); - ok(hr == D3D_OK, "Got unexpected hr %#x.\n", hr); + ok(hr == D3D_OK, "Got unexpected hr %#lx.\n", hr); hr = IDirect3DDevice3_SetTextureStageState(device, 0, D3DTSS_COLORARG1, D3DTA_TEXTURE); - ok(hr == D3D_OK, "Got unexpected hr %#x.\n", hr); + ok(hr == D3D_OK, "Got unexpected hr %#lx.\n", hr); hr = IDirect3DDevice3_SetTextureStageState(device, 0, D3DTSS_ALPHAARG1, D3DTA_TEXTURE);
- ok(hr == D3D_OK, "Got unexpected hr %#x.\n", hr); + ok(hr == D3D_OK, "Got unexpected hr %#lx.\n", hr); hr = IDirect3DDevice3_SetTexture(device, 0, texture); - ok(hr == D3D_OK, "Got unexpected hr %#x.\n", hr); + ok(hr == D3D_OK, "Got unexpected hr %#lx.\n", hr); hr = IDirect3DViewport3_Clear2(viewport, 1, &clear_rect, D3DCLEAR_TARGET, 0x000000ff, 0.0f, 0); - ok(hr == D3D_OK, "Got unexpected hr %#x.\n", hr); + ok(hr == D3D_OK, "Got unexpected hr %#lx.\n", hr); hr = IDirect3DDevice3_BeginScene(device); - ok(hr == D3D_OK, "Got unexpected hr %#x.\n", hr); + ok(hr == D3D_OK, "Got unexpected hr %#lx.\n", hr); hr = IDirect3DDevice3_DrawPrimitive(device, D3DPT_TRIANGLESTRIP, D3DFVF_XYZ | D3DFVF_TEX1, quad, 4, 0); - ok(hr == D3D_OK, "Got unexpected hr %#x.\n", hr); + ok(hr == D3D_OK, "Got unexpected hr %#lx.\n", hr); hr = IDirect3DDevice3_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); @@ -18619,7 +18589,7 @@ static void test_texture_wrong_caps(const GUID *device_guid) IDirectDraw4_Release(ddraw); IDirect3D3_Release(d3d); refcount = IDirect3DDevice3_Release(device); - ok(!refcount, "Device has %u references left.\n", refcount); + ok(!refcount, "Device has %lu references left.\n", refcount); DestroyWindow(window); }
@@ -18631,10 +18601,9 @@ 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; IDirect3DViewport3 *viewport; IDirect3DDevice3 *device; - unsigned int i, j, x, y; - DWORD colour, expected; IDirectDraw4 *ddraw; DDSURFACEDESC2 desc; IDirect3D3 *d3d; @@ -18970,14 +18939,14 @@ static void test_filling_convention(void) }
hr = IDirect3DDevice3_GetDirect3D(device, &d3d); - ok(hr == DD_OK, "Got unexpected hr %#x.\n", hr); + ok(hr == DD_OK, "Got unexpected hr %#lx.\n", hr); hr = IDirect3D3_QueryInterface(d3d, &IID_IDirectDraw4, (void **)&ddraw); - ok(hr == DD_OK, "Got unexpected hr %#x.\n", hr); + ok(hr == DD_OK, "Got unexpected hr %#lx.\n", hr); hr = IDirect3DDevice3_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); hr = IDirect3DDevice3_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); @@ -18992,7 +18961,7 @@ static void test_filling_convention(void) desc.ddpfPixelFormat.dwGBitMask = 0x0000ff00; desc.ddpfPixelFormat.dwBBitMask = 0x000000ff; hr = IDirectDraw4_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. */ @@ -19001,7 +18970,7 @@ static void test_filling_convention(void) desc.dwSize = sizeof(desc); desc.ddpfPixelFormat.dwSize = sizeof(desc.ddpfPixelFormat); hr = IDirectDrawSurface4_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; @@ -19009,14 +18978,14 @@ static void test_filling_convention(void) desc.dwWidth = vp_size; desc.dwHeight = vp_size; hr = IDirectDraw4_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 = IDirectDrawSurface4_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 = IDirect3DDevice3_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 = IDirect3DDevice3_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) { @@ -19025,17 +18994,17 @@ static void test_filling_convention(void) cur = j ? rt : backbuffer;
hr = IDirect3DDevice3_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 = IDirect3DViewport3_Clear2(viewport, 1, &clear_rect, D3DCLEAR_TARGET, colour_clear, 0.0f, 0); - ok(hr == D3D_OK, "Got unexpected hr %#x.\n", hr); + ok(hr == D3D_OK, "Got unexpected hr %#lx.\n", hr);
hr = IDirect3DDevice3_BeginScene(device); - ok(hr == D3D_OK, "Got unexpected hr %#x.\n", hr); + ok(hr == D3D_OK, "Got unexpected hr %#lx.\n", hr); hr = IDirect3DDevice3_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 = IDirect3DDevice3_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++) { @@ -19087,7 +19056,7 @@ static void test_filling_convention(void) IDirectDraw4_Release(ddraw); IDirect3D3_Release(d3d); refcount = IDirect3DDevice3_Release(device); - ok(!refcount, "Device has %u references left.\n", refcount); + ok(!refcount, "Device has %lu references left.\n", refcount); DestroyWindow(window); }
From: Zebediah Figura zfigura@codeweavers.com
--- dlls/ddraw/tests/ddraw7.c | 5232 ++++++++++++++++++------------------- 1 file changed, 2599 insertions(+), 2633 deletions(-)
diff --git a/dlls/ddraw/tests/ddraw7.c b/dlls/ddraw/tests/ddraw7.c index 8d1da1335fa..a4d270fe5f1 100644 --- a/dlls/ddraw/tests/ddraw7.c +++ b/dlls/ddraw/tests/ddraw7.c @@ -18,7 +18,6 @@ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA */
-#define WINE_NO_LONG_TYPES #define COBJMACROS
#include "wine/test.h" @@ -150,7 +149,7 @@ static BOOL ddraw_get_identifier(IDirectDraw7 *ddraw, DDDEVICEIDENTIFIER2 *ident HRESULT hr;
hr = IDirectDraw7_GetDeviceIdentifier(ddraw, 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);
return SUCCEEDED(hr); } @@ -237,7 +236,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 (;;) { @@ -250,7 +249,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; } } @@ -265,13 +264,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) @@ -290,9 +289,9 @@ static IDirectDrawSurface7 *get_depth_stencil(IDirect3DDevice7 *device) HRESULT hr;
hr = IDirect3DDevice7_GetRenderTarget(device, &rt); - ok(SUCCEEDED(hr), "Failed to get the render target, hr %#x.\n", hr); + ok(SUCCEEDED(hr), "Failed to get the render target, hr %#lx.\n", hr); hr = IDirectDrawSurface7_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); IDirectDrawSurface7_Release(rt); return ret; } @@ -378,14 +377,14 @@ static D3DCOLOR get_surface_color(IDirectDrawSurface7 *surface, UINT x, UINT y) surface_desc.dwSize = sizeof(surface_desc);
hr = IDirectDrawSurface7_Lock(surface, &rect, &surface_desc, 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); if (FAILED(hr)) return 0xdeadbeef;
color = *((DWORD *)surface_desc.lpSurface) & 0x00ffffff;
hr = IDirectDrawSurface7_Unlock(surface, &rect); - ok(SUCCEEDED(hr), "Failed to unlock surface, hr %#x.\n", hr); + ok(SUCCEEDED(hr), "Failed to unlock surface, hr %#lx.\n", hr);
return color; } @@ -398,7 +397,7 @@ static void fill_surface(IDirectDrawSurface7 *surface, D3DCOLOR color) DWORD *ptr;
hr = IDirectDrawSurface7_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) { @@ -410,7 +409,7 @@ static void fill_surface(IDirectDrawSurface7 *surface, D3DCOLOR color) }
hr = IDirectDrawSurface7_Unlock(surface, NULL); - ok(hr == DD_OK, "Got unexpected hr %#x.\n", hr); + ok(hr == DD_OK, "Got unexpected hr %#lx.\n", hr); }
#define check_rect(a, b) check_rect_(__LINE__, a, b) @@ -426,8 +425,7 @@ static void check_rect_(unsigned int line, IDirectDrawSurface7 *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) @@ -438,14 +436,14 @@ static void check_rect_(unsigned int line, IDirectDrawSurface7 *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_(__FILE__, line)(color == expected, "Pixel (%d, %d) has color %08x, expected %08x.\n", + ok_(__FILE__, line)(color == expected, "Pixel (%ld, %ld) has color %08x, expected %08x.\n", x, y, color, expected); } } @@ -498,7 +496,7 @@ static IDirect3DDevice7 *create_device_ex(HWND window, DWORD coop_level, const G return NULL;
hr = IDirectDraw7_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); @@ -510,18 +508,18 @@ static IDirect3DDevice7 *create_device_ex(HWND window, DWORD coop_level, const G surface_desc.dwHeight = 480;
hr = IDirectDraw7_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 = IDirectDraw7_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 = IDirectDrawSurface7_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); }
@@ -552,7 +550,7 @@ static IDirect3DDevice7 *create_device_ex(HWND window, DWORD coop_level, const G surface_desc.dwWidth = 640; surface_desc.dwHeight = 480; hr = IDirectDraw7_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)) { IDirect3D7_Release(d3d7); @@ -561,7 +559,7 @@ static IDirect3DDevice7 *create_device_ex(HWND window, DWORD coop_level, const G }
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); IDirectDrawSurface7_Release(ds); if (FAILED(hr)) { @@ -595,7 +593,7 @@ static IDirect3DDevice7 *create_device(HWND window, DWORD coop_level) return NULL;
hr = IDirect3D7_EnumDevices(d3d7, enum_devtype_cb, &hal_ok); - ok(hr == DD_OK, "Got unexpected hr %#x.\n", hr); + ok(hr == DD_OK, "Got unexpected hr %#lx.\n", hr); if (hal_ok) device_guid = &IID_IDirect3DTnLHalDevice;
@@ -623,13 +621,13 @@ 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);
if (focus_test_ddraw) { hr = IDirectDraw7_TestCooperativeLevel(focus_test_ddraw); - ok(hr == expect_messages->ddraw_state, "Got ddraw state %#x on message %#x, expected %#x.\n", + ok(hr == expect_messages->ddraw_state, "Got ddraw state %#lx on message %#x, expected %#lx.\n", hr, message, expect_messages->ddraw_state); }
@@ -652,9 +650,9 @@ static void fix_wndproc(HWND window, LONG_PTR proc)
SetWindowLongPtrA(window, GWLP_WNDPROC, proc); hr = IDirectDraw7_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 = IDirectDraw7_SetCooperativeLevel(ddraw, window, DDSCL_NORMAL); - ok(SUCCEEDED(hr), "SetCooperativeLevel failed, hr %#x.\n", hr); + ok(SUCCEEDED(hr), "SetCooperativeLevel failed, hr %#lx.\n", hr);
IDirectDraw7_Release(ddraw); } @@ -703,17 +701,17 @@ static void test_process_vertices(void) }
hr = IDirect3DDevice7_GetDirect3D(device, &d3d7); - ok(hr == DD_OK, "Got unexpected hr %#x.\n", hr); + ok(hr == DD_OK, "Got unexpected hr %#lx.\n", hr);
memset(&vb_desc, 0, sizeof(vb_desc)); vb_desc.dwSize = sizeof(vb_desc); vb_desc.dwFVF = D3DFVF_XYZ; vb_desc.dwNumVertices = 4; hr = IDirect3D7_CreateVertexBuffer(d3d7, &vb_desc, &src_vb, 0); - ok(hr == DD_OK, "Got unexpected hr %#x.\n", hr); + ok(hr == DD_OK, "Got unexpected hr %#lx.\n", hr);
hr = IDirect3DVertexBuffer7_Lock(src_vb, 0, (void **)&src_data, NULL); - ok(hr == DD_OK, "Got unexpected hr %#x.\n", hr); + ok(hr == DD_OK, "Got unexpected hr %#lx.\n", hr); src_data[0].x = 0.0f; src_data[0].y = 0.0f; src_data[0].z = 0.0f; @@ -727,7 +725,7 @@ static void test_process_vertices(void) src_data[3].y = -0.5f; src_data[3].z = 0.25f; hr = IDirect3DVertexBuffer7_Unlock(src_vb); - ok(hr == DD_OK, "Got unexpected hr %#x.\n", hr); + ok(hr == DD_OK, "Got unexpected hr %#lx.\n", hr);
memset(&vb_desc, 0, sizeof(vb_desc)); vb_desc.dwSize = sizeof(vb_desc); @@ -735,7 +733,7 @@ static void test_process_vertices(void) vb_desc.dwNumVertices = 4; /* MSDN says that the last parameter must be 0 - check that. */ hr = IDirect3D7_CreateVertexBuffer(d3d7, &vb_desc, &dst_vb1, 4); - ok(hr == DD_OK, "Got unexpected hr %#x.\n", hr); + ok(hr == DD_OK, "Got unexpected hr %#lx.\n", hr);
memset(&vb_desc, 0, sizeof(vb_desc)); vb_desc.dwSize = sizeof(vb_desc); @@ -743,7 +741,7 @@ static void test_process_vertices(void) vb_desc.dwNumVertices = 5; /* MSDN says that the last parameter must be 0 - check that. */ hr = IDirect3D7_CreateVertexBuffer(d3d7, &vb_desc, &dst_vb2, 12345678); - ok(hr == DD_OK, "Got unexpected hr %#x.\n", hr); + ok(hr == DD_OK, "Got unexpected hr %#lx.\n", hr);
memset(&vp, 0, sizeof(vp)); vp.dwX = 64; @@ -753,15 +751,15 @@ static void test_process_vertices(void) vp.dvMinZ = 0.0f; vp.dvMaxZ = 1.0f; hr = IDirect3DDevice7_SetViewport(device, &vp); - ok(hr == DD_OK, "Got unexpected hr %#x.\n", hr); + ok(hr == DD_OK, "Got unexpected hr %#lx.\n", hr);
hr = IDirect3DVertexBuffer7_ProcessVertices(dst_vb1, D3DVOP_TRANSFORM, 0, 4, src_vb, 0, device, 0); - ok(hr == DD_OK, "Got unexpected hr %#x.\n", hr); + ok(hr == DD_OK, "Got unexpected hr %#lx.\n", hr); hr = IDirect3DVertexBuffer7_ProcessVertices(dst_vb2, D3DVOP_TRANSFORM, 0, 4, src_vb, 0, device, 0); - ok(hr == DD_OK, "Got unexpected hr %#x.\n", hr); + ok(hr == DD_OK, "Got unexpected hr %#lx.\n", hr);
hr = IDirect3DVertexBuffer7_Lock(dst_vb1, 0, (void **)&dst_data, NULL); - ok(hr == DD_OK, "Got unexpected hr %#x.\n", hr); + ok(hr == DD_OK, "Got unexpected hr %#lx.\n", hr); ok(compare_vec4(&dst_data[0], +1.280e+2f, +1.280e+2f, +0.000e+0f, +1.000e+0f, 4096), "Got unexpected vertex 0 {%.8e, %.8e, %.8e, %.8e}.\n", dst_data[0].x, dst_data[0].y, dst_data[0].z, dst_data[0].w); @@ -775,10 +773,10 @@ static void test_process_vertices(void) "Got unexpected vertex 3 {%.8e, %.8e, %.8e, %.8e}.\n", dst_data[3].x, dst_data[3].y, dst_data[3].z, dst_data[3].w); hr = IDirect3DVertexBuffer7_Unlock(dst_vb1); - ok(hr == DD_OK, "Got unexpected hr %#x.\n", hr); + ok(hr == DD_OK, "Got unexpected hr %#lx.\n", hr);
hr = IDirect3DVertexBuffer7_Lock(dst_vb2, 0, (void **)&dst_data2, NULL); - ok(hr == DD_OK, "Got unexpected hr %#x.\n", hr); + ok(hr == DD_OK, "Got unexpected hr %#lx.\n", hr); /* Small thing without much practical meaning, but I stumbled upon it, * so let's check for it: If the output vertex buffer has no RHW value, * the RHW value of the last vertex is written into the next vertex. */ @@ -786,21 +784,21 @@ static void test_process_vertices(void) "Got unexpected vertex 4 {%.8e, %.8e, %.8e}.\n", dst_data2[4].x, dst_data2[4].y, dst_data2[4].z); hr = IDirect3DVertexBuffer7_Unlock(dst_vb2); - ok(hr == DD_OK, "Got unexpected hr %#x.\n", hr); + ok(hr == DD_OK, "Got unexpected hr %#lx.\n", hr);
/* Test degenerate viewport z ranges. */ vp.dvMinZ = 0.0f; vp.dvMaxZ = 0.0f; hr = IDirect3DDevice7_SetViewport(device, &vp); - ok(hr == DD_OK, "Got unexpected hr %#x.\n", hr); + ok(hr == DD_OK, "Got unexpected hr %#lx.\n", hr);
hr = IDirect3DVertexBuffer7_ProcessVertices(dst_vb1, D3DVOP_TRANSFORM, 0, 4, src_vb, 0, device, 0); - ok(hr == DD_OK, "Got unexpected hr %#x.\n", hr); + ok(hr == DD_OK, "Got unexpected hr %#lx.\n", hr); hr = IDirect3DVertexBuffer7_ProcessVertices(dst_vb2, D3DVOP_TRANSFORM, 0, 4, src_vb, 0, device, 0); - ok(hr == DD_OK, "Got unexpected hr %#x.\n", hr); + ok(hr == DD_OK, "Got unexpected hr %#lx.\n", hr);
hr = IDirect3DVertexBuffer7_Lock(dst_vb1, 0, (void **)&dst_data, NULL); - ok(hr == DD_OK, "Got unexpected hr %#x.\n", hr); + ok(hr == DD_OK, "Got unexpected hr %#lx.\n", hr); ok(compare_vec4(&dst_data[0], +1.280e+2f, +1.280e+2f, +0.000e+0f, +1.000e+0f, 4096), "Got unexpected vertex 0 {%.8e, %.8e, %.8e, %.8e}.\n", dst_data[0].x, dst_data[0].y, dst_data[0].z, dst_data[0].w); @@ -814,20 +812,20 @@ static void test_process_vertices(void) "Got unexpected vertex 3 {%.8e, %.8e, %.8e, %.8e}.\n", dst_data[3].x, dst_data[3].y, dst_data[3].z, dst_data[3].w); hr = IDirect3DVertexBuffer7_Unlock(dst_vb1); - ok(hr == DD_OK, "Got unexpected hr %#x.\n", hr); + ok(hr == DD_OK, "Got unexpected hr %#lx.\n", hr);
vp.dvMinZ = 1.0f; vp.dvMaxZ = 0.0f; hr = IDirect3DDevice7_SetViewport(device, &vp); - ok(hr == DD_OK, "Got unexpected hr %#x.\n", hr); + ok(hr == DD_OK, "Got unexpected hr %#lx.\n", hr);
hr = IDirect3DVertexBuffer7_ProcessVertices(dst_vb1, D3DVOP_TRANSFORM, 0, 4, src_vb, 0, device, 0); - ok(hr == DD_OK, "Got unexpected hr %#x.\n", hr); + ok(hr == DD_OK, "Got unexpected hr %#lx.\n", hr); hr = IDirect3DVertexBuffer7_ProcessVertices(dst_vb2, D3DVOP_TRANSFORM, 0, 4, src_vb, 0, device, 0); - ok(hr == DD_OK, "Got unexpected hr %#x.\n", hr); + ok(hr == DD_OK, "Got unexpected hr %#lx.\n", hr);
hr = IDirect3DVertexBuffer7_Lock(dst_vb1, 0, (void **)&dst_data, NULL); - ok(hr == DD_OK, "Got unexpected hr %#x.\n", hr); + ok(hr == DD_OK, "Got unexpected hr %#lx.\n", hr); ok(compare_vec4(&dst_data[0], +1.280e+2f, +1.280e+2f, +1.000e+0f, +1.000e+0f, 4096), "Got unexpected vertex 0 {%.8e, %.8e, %.8e, %.8e}.\n", dst_data[0].x, dst_data[0].y, dst_data[0].z, dst_data[0].w); @@ -841,7 +839,7 @@ static void test_process_vertices(void) "Got unexpected vertex 3 {%.8e, %.8e, %.8e, %.8e}.\n", dst_data[3].x, dst_data[3].y, dst_data[3].z, dst_data[3].w); hr = IDirect3DVertexBuffer7_Unlock(dst_vb1); - ok(hr == DD_OK, "Got unexpected hr %#x.\n", hr); + ok(hr == DD_OK, "Got unexpected hr %#lx.\n", hr);
/* Try a more complicated viewport, same vertices. */ memset(&vp, 0, sizeof(vp)); @@ -852,13 +850,13 @@ static void test_process_vertices(void) vp.dvMinZ = -2.0f; vp.dvMaxZ = 4.0f; hr = IDirect3DDevice7_SetViewport(device, &vp); - ok(hr == DD_OK, "Got unexpected hr %#x.\n", hr); + ok(hr == DD_OK, "Got unexpected hr %#lx.\n", hr);
hr = IDirect3DVertexBuffer7_ProcessVertices(dst_vb1, D3DVOP_TRANSFORM, 0, 4, src_vb, 0, device, 0); - ok(hr == DD_OK, "Got unexpected hr %#x.\n", hr); + ok(hr == DD_OK, "Got unexpected hr %#lx.\n", hr);
hr = IDirect3DVertexBuffer7_Lock(dst_vb1, 0, (void **)&dst_data, NULL); - ok(hr == DD_OK, "Got unexpected hr %#x.\n", hr); + ok(hr == DD_OK, "Got unexpected hr %#lx.\n", hr); ok(compare_vec4(&dst_data[0], +1.330e+2f, +7.000e+1f, -2.000e+0f, +1.000e+0f, 4096), "Got unexpected vertex 0 {%.8e, %.8e, %.8e, %.8e}.\n", dst_data[0].x, dst_data[0].y, dst_data[0].z, dst_data[0].w); @@ -872,20 +870,20 @@ static void test_process_vertices(void) "Got unexpected vertex 3 {%.8e, %.8e, %.8e, %.8e}.\n", dst_data[3].x, dst_data[3].y, dst_data[3].z, dst_data[3].w); hr = IDirect3DVertexBuffer7_Unlock(dst_vb1); - ok(hr == DD_OK, "Got unexpected hr %#x.\n", hr); + ok(hr == DD_OK, "Got unexpected hr %#lx.\n", hr);
hr = IDirect3DDevice7_SetTransform(device, D3DTRANSFORMSTATE_WORLD, &world); - ok(hr == DD_OK, "Got unexpected hr %#x.\n", hr); + ok(hr == DD_OK, "Got unexpected hr %#lx.\n", hr); hr = IDirect3DDevice7_SetTransform(device, D3DTRANSFORMSTATE_VIEW, &view); - ok(hr == DD_OK, "Got unexpected hr %#x.\n", hr); + ok(hr == DD_OK, "Got unexpected hr %#lx.\n", hr); hr = IDirect3DDevice7_SetTransform(device, D3DTRANSFORMSTATE_PROJECTION, &proj); - ok(hr == DD_OK, "Got unexpected hr %#x.\n", hr); + ok(hr == DD_OK, "Got unexpected hr %#lx.\n", hr);
hr = IDirect3DVertexBuffer7_ProcessVertices(dst_vb1, D3DVOP_TRANSFORM, 0, 4, src_vb, 0, device, 0); - ok(hr == DD_OK, "Got unexpected hr %#x.\n", hr); + ok(hr == DD_OK, "Got unexpected hr %#lx.\n", hr);
hr = IDirect3DVertexBuffer7_Lock(dst_vb1, 0, (void **)&dst_data, NULL); - ok(hr == DD_OK, "Got unexpected hr %#x.\n", hr); + ok(hr == DD_OK, "Got unexpected hr %#lx.\n", hr); ok(compare_vec4(&dst_data[0], +2.560e+2f, +7.000e+1f, -2.000e+0f, +3.333e-1f, 4096), "Got unexpected vertex 0 {%.8e, %.8e, %.8e, %.8e}.\n", dst_data[0].x, dst_data[0].y, dst_data[0].z, dst_data[0].w); @@ -899,7 +897,7 @@ static void test_process_vertices(void) "Got unexpected vertex 3 {%.8e, %.8e, %.8e, %.8e}.\n", dst_data[3].x, dst_data[3].y, dst_data[3].z, dst_data[3].w); hr = IDirect3DVertexBuffer7_Unlock(dst_vb1); - ok(hr == DD_OK, "Got unexpected hr %#x.\n", hr); + ok(hr == DD_OK, "Got unexpected hr %#lx.\n", hr);
IDirect3DVertexBuffer7_Release(dst_vb2); IDirect3DVertexBuffer7_Release(dst_vb1); @@ -920,23 +918,23 @@ static void test_coop_level_create_device_window(void) ok(!!ddraw, "Failed to create a ddraw object.\n");
hr = IDirectDraw7_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 = IDirectDraw7_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 = IDirectDraw7_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 = IDirectDraw7_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 = IDirectDraw7_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");
@@ -950,48 +948,48 @@ static void test_coop_level_create_device_window(void) }
hr = IDirectDraw7_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 = IDirectDraw7_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 = IDirectDraw7_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 = IDirectDraw7_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 = IDirectDraw7_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 = IDirectDraw7_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 = IDirectDraw7_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 = IDirectDraw7_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 = IDirectDraw7_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 = IDirectDraw7_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");
@@ -1002,13 +1000,12 @@ static void test_coop_level_create_device_window(void) static void test_clipper_blt(void) { IDirectDrawSurface7 *src_surface, *dst_surface; + unsigned int color, i, j, x, y; RECT client_rect, src_rect; IDirectDrawClipper *clipper; DDSURFACEDESC2 surface_desc; - unsigned int i, j, x, y; IDirectDraw7 *ddraw; RGNDATA *rgn_data; - D3DCOLOR color; ULONG refcount; HRGN r1, r2; HWND window; @@ -1023,7 +1020,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, @@ -1045,7 +1042,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, @@ -1065,22 +1062,22 @@ static void test_clipper_blt(void) ok(ret, "Failed to map client rect.\n");
hr = IDirectDraw7_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 = IDirectDraw7_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)); @@ -1100,11 +1097,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);
@@ -1122,33 +1119,33 @@ static void test_clipper_blt(void) U4(U4(surface_desc).ddpfPixelFormat).dwBBitMask = 0x000000ff;
hr = IDirectDraw7_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 = IDirectDraw7_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 = IDirectDrawSurface7_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 = IDirectDrawSurface7_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 = IDirectDrawSurface7_Lock(src_surface, NULL, &surface_desc, 0, 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 = IDirectDrawSurface7_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 = IDirectDrawSurface7_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 = IDirectDrawSurface7_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) @@ -1164,7 +1161,7 @@ static void test_clipper_blt(void)
U5(fx).dwFillColor = 0xff0000ff; hr = IDirectDrawSurface7_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) @@ -1178,30 +1175,30 @@ static void test_clipper_blt(void) }
hr = IDirectDrawSurface7_BltFast(dst_surface, 0, 0, src_surface, NULL, DDBLTFAST_WAIT); - ok(hr == DDERR_BLTFASTCANTCLIP, "Got unexpected hr %#x.\n", hr); + ok(hr == DDERR_BLTFASTCANTCLIP, "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 = IDirectDrawSurface7_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);
IDirectDrawSurface7_Release(dst_surface); IDirectDrawSurface7_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); IDirectDraw7_Release(ddraw); }
@@ -1211,8 +1208,8 @@ static void test_coop_level_d3d_state(void) IDirect3DDevice7 *device; IDirectDraw7 *ddraw; DDSURFACEDESC2 lock; + unsigned int color; IDirect3D7 *d3d; - D3DCOLOR color; DDSCAPS2 caps; DWORD value; HWND window; @@ -1240,92 +1237,92 @@ static void test_coop_level_d3d_state(void) }
hr = IDirect3DDevice7_SetRenderState(device, D3DRENDERSTATE_LIGHTING, FALSE); - ok(hr == DD_OK, "Got unexpected hr %#x.\n", hr); + ok(hr == DD_OK, "Got unexpected hr %#lx.\n", hr); hr = IDirect3DDevice7_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 = IDirect3DDevice7_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 = IDirect3DDevice7_GetRenderTarget(device, &rt); - ok(hr == DD_OK, "Got unexpected hr %#x.\n", hr); + ok(hr == DD_OK, "Got unexpected hr %#lx.\n", hr); hr = IDirect3DDevice7_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 = IDirect3DDevice7_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 = IDirect3DDevice7_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 = IDirect3DDevice7_Clear(device, 0, NULL, D3DCLEAR_TARGET, 0xffff0000, 0.0f, 0); - 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 = IDirect3DDevice7_GetDirect3D(device, &d3d); - ok(hr == DD_OK, "Got unexpected hr %#x.\n", hr); + ok(hr == DD_OK, "Got unexpected hr %#lx.\n", hr); hr = IDirect3D7_QueryInterface(d3d, &IID_IDirectDraw7, (void **)&ddraw); - ok(hr == DD_OK, "Got unexpected hr %#x.\n", hr); + ok(hr == DD_OK, "Got unexpected hr %#lx.\n", hr); IDirect3D7_Release(d3d); hr = IDirectDraw7_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 = IDirectDrawSurface7_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 = IDirectDrawSurface7_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);
memset(&caps, 0, sizeof(caps)); caps.dwCaps = DDSCAPS_ZBUFFER; hr = IDirectDrawSurface7_GetAttachedSurface(rt, &caps, &surface); - ok(hr == DDERR_SURFACELOST, "Got unexpected hr %#x.\n", hr); + ok(hr == DDERR_SURFACELOST, "Got unexpected hr %#lx.\n", hr); caps.dwCaps = DDSCAPS_FLIP; hr = IDirectDrawSurface7_GetAttachedSurface(rt, &caps, &surface); - ok(hr == DDERR_SURFACELOST, "Got unexpected hr %#x.\n", hr); + ok(hr == DDERR_SURFACELOST, "Got unexpected hr %#lx.\n", hr);
hr = IDirectDraw7_RestoreAllSurfaces(ddraw); - ok(hr == DD_OK, "Got unexpected hr %#x.\n", hr); + ok(hr == DD_OK, "Got unexpected hr %#lx.\n", hr);
hr = IDirectDrawSurface7_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 = IDirectDrawSurface7_Unlock(rt, NULL); - ok(hr == DD_OK, "Got unexpected hr %#x.\n", hr); + ok(hr == DD_OK, "Got unexpected hr %#lx.\n", hr);
caps.dwCaps = DDSCAPS_ZBUFFER; hr = IDirectDrawSurface7_GetAttachedSurface(rt, &caps, &surface); - ok(hr == DD_OK, "Got unexpected hr %#x.\n", hr); + ok(hr == DD_OK, "Got unexpected hr %#lx.\n", hr); IDirectDrawSurface7_Release(surface);
caps.dwCaps = DDSCAPS_FLIP; hr = IDirectDrawSurface7_GetAttachedSurface(rt, &caps, &surface); - ok(hr == DDERR_NOTFOUND, "Got unexpected hr %#x.\n", hr); + ok(hr == DDERR_NOTFOUND, "Got unexpected hr %#lx.\n", hr);
IDirectDraw7_Release(ddraw);
hr = IDirect3DDevice7_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 = IDirect3DDevice7_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 = IDirect3DDevice7_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 = IDirect3DDevice7_Clear(device, 0, NULL, D3DCLEAR_TARGET | D3DCLEAR_ZBUFFER, 0xff00ff00, 1.0f, 0); - 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), "Got unexpected color 0x%08x.\n", color);
hr = IDirect3DDevice7_BeginScene(device); - ok(hr == DD_OK, "Got unexpected hr %#x.\n", hr); + ok(hr == DD_OK, "Got unexpected hr %#lx.\n", hr); hr = IDirect3DDevice7_DrawPrimitive(device, D3DPT_TRIANGLESTRIP, D3DFVF_XYZ | D3DFVF_DIFFUSE, 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 = IDirect3DDevice7_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);
@@ -1344,16 +1341,16 @@ static void test_surface_interface_mismatch(void) IDirect3DDevice7 *device = NULL; DDSURFACEDESC2 surface_desc; DDPIXELFORMAT z_fmt; + unsigned int color; ULONG refcount; HRESULT hr; - D3DCOLOR color; HWND window;
window = create_window(); ddraw = create_ddraw(); ok(!!ddraw, "Failed to create a ddraw object.\n"); hr = IDirectDraw7_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); @@ -1363,10 +1360,10 @@ static void test_surface_interface_mismatch(void) surface_desc.dwHeight = 480;
hr = IDirectDraw7_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 = IDirectDrawSurface7_QueryInterface(surface, &IID_IDirectDrawSurface3, (void **)&surface3); - ok(SUCCEEDED(hr), "Failed to QI IDirectDrawSurface3, hr %#x.\n", hr); + ok(SUCCEEDED(hr), "Failed to QI IDirectDrawSurface3, hr %#lx.\n", hr);
if (FAILED(IDirectDraw7_QueryInterface(ddraw, &IID_IDirect3D7, (void **)&d3d))) { @@ -1390,15 +1387,15 @@ static void test_surface_interface_mismatch(void) surface_desc.dwWidth = 640; surface_desc.dwHeight = 480; hr = IDirectDraw7_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 = IDirectDrawSurface7_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;
@@ -1409,7 +1406,7 @@ static void test_surface_interface_mismatch(void) goto cleanup;
hr = IDirect3DDevice7_Clear(device, 0, NULL, D3DCLEAR_TARGET, 0xffff0000, 0.0f, 0); - 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);
@@ -1433,7 +1430,7 @@ static void test_coop_level_threaded(void) create_window_thread(&p);
hr = IDirectDraw7_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); IDirectDraw7_Release(ddraw); @@ -1454,7 +1451,7 @@ static void test_depth_blit(const GUID *device_guid) { -1.0, -1.0, 0.50f, 0xff00ff00}, { 1.0, -1.0, 0.50f, 0xff00ff00}, }; - static const D3DCOLOR expected_colors[4][4] = + static const unsigned int expected_colors[4][4] = { {0x00ff0000, 0x00ff0000, 0x0000ff00, 0x0000ff00}, {0x00ff0000, 0x00ff0000, 0x0000ff00, 0x0000ff00}, @@ -1464,9 +1461,8 @@ static void test_depth_blit(const GUID *device_guid) DDSURFACEDESC2 ddsd_new, ddsd_existing;
IDirectDrawSurface7 *ds1, *ds2, *ds3, *rt; + unsigned int color, i, j; RECT src_rect, dst_rect; - unsigned int i, j; - D3DCOLOR color; HRESULT hr; IDirect3D7 *d3d; IDirectDraw7 *ddraw; @@ -1482,9 +1478,9 @@ static void test_depth_blit(const GUID *device_guid) }
hr = IDirect3DDevice7_GetDirect3D(device, &d3d); - ok(SUCCEEDED(hr), "Failed to get Direct3D7 interface, hr %#x.\n", hr); + ok(SUCCEEDED(hr), "Failed to get Direct3D7 interface, hr %#lx.\n", hr); hr = IDirect3D7_QueryInterface(d3d, &IID_IDirectDraw7, (void **)&ddraw); - ok(SUCCEEDED(hr), "Failed to get DirectDraw7 interface, hr %#x.\n", hr); + ok(SUCCEEDED(hr), "Failed to get DirectDraw7 interface, hr %#lx.\n", hr); IDirect3D7_Release(d3d);
ds1 = get_depth_stencil(device); @@ -1494,7 +1490,7 @@ static void test_depth_blit(const GUID *device_guid) memset(&ddsd_existing, 0, sizeof(ddsd_existing)); ddsd_existing.dwSize = sizeof(ddsd_existing); hr = IDirectDrawSurface7_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)) @@ -1503,66 +1499,66 @@ static void test_depth_blit(const GUID *device_guid) ddsd_new.dwHeight = ddsd_existing.dwHeight; U4(ddsd_new).ddpfPixelFormat = U4(ddsd_existing).ddpfPixelFormat; hr = IDirectDraw7_CreateSurface(ddraw, &ddsd_new, &ds2, NULL); - ok(SUCCEEDED(hr), "Failed to create a z buffer, hr %#x.\n", hr); + ok(SUCCEEDED(hr), "Failed to create a z buffer, hr %#lx.\n", hr); hr = IDirectDraw7_CreateSurface(ddraw, &ddsd_new, &ds3, NULL); - ok(SUCCEEDED(hr), "Failed to create a z buffer, hr %#x.\n", hr); + ok(SUCCEEDED(hr), "Failed to create a z buffer, hr %#lx.\n", hr); IDirectDraw7_Release(ddraw);
hr = IDirect3DDevice7_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 = IDirect3DDevice7_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); hr = IDirect3DDevice7_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 = IDirect3DDevice7_Clear(device, 0, NULL, D3DCLEAR_ZBUFFER, 0, 0.0f, 0); - 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 = IDirectDrawSurface7_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 = IDirectDrawSurface7_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 = IDirectDrawSurface7_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 = IDirectDrawSurface7_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 = IDirectDrawSurface7_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 = IDirectDrawSurface7_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 = IDirect3DDevice7_BeginScene(device); - ok(SUCCEEDED(hr), "Failed to start scene, hr %#x.\n", hr); + ok(SUCCEEDED(hr), "Failed to start scene, hr %#lx.\n", hr); /* From the current depth stencil */ hr = IDirectDrawSurface7_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 = IDirectDrawSurface7_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 = IDirectDrawSurface7_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 = IDirect3DDevice7_EndScene(device); - ok(SUCCEEDED(hr), "Failed to end scene, hr %#x.\n", hr); + ok(SUCCEEDED(hr), "Failed to end 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 @@ -1571,13 +1567,13 @@ static void test_depth_blit(const GUID *device_guid) memset(&fx, 0, sizeof(fx)); fx.dwSize = sizeof(fx); hr = IDirectDrawSurface7_Blt(ds2, NULL, NULL, NULL, DDBLT_DEPTHFILL | DDBLT_WAIT, &fx); - ok(hr == D3D_OK, "Got unexpected hr %#x.\n", hr); + ok(hr == D3D_OK, "Got unexpected hr %#lx.\n", hr);
hr = IDirect3DDevice7_Clear(device, 0, NULL, D3DCLEAR_ZBUFFER | D3DCLEAR_TARGET, 0xffff0000, 1.0f, 0); - ok(hr == D3D_OK, "Got unexpected hr %#x.\n", hr); + ok(hr == D3D_OK, "Got unexpected hr %#lx.\n", hr);
hr = IDirect3DDevice7_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. */ @@ -1593,18 +1589,18 @@ static void test_depth_blit(const GUID *device_guid)
SetRect(&dst_rect, 0, 0, 320, 240); hr = IDirectDrawSurface7_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); IDirectDrawSurface7_Release(ds3); IDirectDrawSurface7_Release(ds2); IDirectDrawSurface7_Release(ds1);
hr = IDirect3DDevice7_BeginScene(device); - ok(hr == D3D_OK, "Got unexpected hr %#x.\n", hr); + ok(hr == D3D_OK, "Got unexpected hr %#lx.\n", hr); hr = IDirect3DDevice7_DrawPrimitive(device, D3DPT_TRIANGLESTRIP, D3DFVF_XYZ | D3DFVF_DIFFUSE, quad1, 4, 0); - ok(hr == D3D_OK, "Got unexpected hr %#x.\n", hr); + ok(hr == D3D_OK, "Got unexpected hr %#lx.\n", hr); hr = IDirect3DDevice7_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) { @@ -1645,9 +1641,9 @@ static void test_texture_load_ckey(void) }
hr = IDirect3DDevice7_GetDirect3D(device, &d3d); - ok(SUCCEEDED(hr), "Failed to get Direct3D7 interface, hr %#x.\n", hr); + ok(SUCCEEDED(hr), "Failed to get Direct3D7 interface, hr %#lx.\n", hr); hr = IDirect3D7_QueryInterface(d3d, &IID_IDirectDraw7, (void **)&ddraw); - ok(SUCCEEDED(hr), "Failed to get DirectDraw7 interface, hr %#x.\n", hr); + ok(SUCCEEDED(hr), "Failed to get DirectDraw7 interface, hr %#lx.\n", hr); IDirect3D7_Release(d3d);
memset(&ddsd, 0, sizeof(ddsd)); @@ -1657,52 +1653,52 @@ static void test_texture_load_ckey(void) ddsd.dwWidth = 128; ddsd.ddsCaps.dwCaps = DDSCAPS_TEXTURE | DDSCAPS_SYSTEMMEMORY; hr = IDirectDraw7_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 = IDirectDraw7_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);
/* No surface has a color key */ hr = IDirect3DDevice7_Load(device, dst, NULL, src, NULL, 0); - ok(SUCCEEDED(hr), "Got unexpected hr %#x.\n", hr); + ok(SUCCEEDED(hr), "Got unexpected hr %#lx.\n", hr); ckey.dwColorSpaceLowValue = ckey.dwColorSpaceHighValue = 0xdeadbeef; hr = IDirectDrawSurface7_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 = IDirectDrawSurface7_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 = IDirect3DDevice7_Load(device, dst, NULL, src, NULL, 0); - ok(SUCCEEDED(hr), "Got unexpected hr %#x.\n", hr); + ok(SUCCEEDED(hr), "Got unexpected hr %#lx.\n", hr); hr = IDirectDrawSurface7_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 = IDirectDrawSurface7_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 = IDirect3DDevice7_Load(device, dst, NULL, src, NULL, 0); - ok(SUCCEEDED(hr), "Got unexpected hr %#x.\n", hr); + ok(SUCCEEDED(hr), "Got unexpected hr %#lx.\n", hr); hr = IDirectDrawSurface7_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 deleted. This behavior differs from * IDirect3DTexture(2)::Load */ hr = IDirectDrawSurface7_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 = IDirectDrawSurface7_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 = IDirect3DDevice7_Load(device, dst, NULL, src, NULL, 0); - ok(SUCCEEDED(hr), "Got unexpected hr %#x.\n", hr); + ok(SUCCEEDED(hr), "Got unexpected hr %#lx.\n", hr); hr = IDirectDrawSurface7_GetColorKey(dst, DDCKEY_SRCBLT, &ckey); - todo_wine ok(hr == DDERR_NOCOLORKEY, "Got unexpected hr %#x.\n", hr); + todo_wine ok(hr == DDERR_NOCOLORKEY, "Got unexpected hr %#lx.\n", hr);
IDirectDrawSurface7_Release(dst); IDirectDrawSurface7_Release(src); @@ -1725,13 +1721,11 @@ static void test_zenable(const GUID *device_guid) {{640.0f, 480.0f, 1.5f, 1.0f}, 0xff00ff00}, {{640.0f, 0.0f, 1.5f, 1.0f}, 0xff00ff00}, }; + unsigned int color, x, y, i, j; IDirect3DDevice7 *device; IDirectDrawSurface7 *rt; - D3DCOLOR color; HWND window; HRESULT hr; - UINT x, y; - UINT i, j;
window = create_window(); if (!(device = create_device_ex(window, DDSCL_NORMAL, device_guid))) @@ -1742,13 +1736,13 @@ static void test_zenable(const GUID *device_guid) }
hr = IDirect3DDevice7_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 = IDirect3DDevice7_Clear(device, 0, NULL, D3DCLEAR_TARGET | D3DCLEAR_ZBUFFER, 0xffff0000, 0.0f, 0); - ok(hr == D3D_OK, "Got unexpected hr %#x.\n", hr); + ok(hr == D3D_OK, "Got unexpected hr %#lx.\n", hr);
hr = IDirect3DDevice7_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. */ @@ -1763,11 +1757,11 @@ static void test_zenable(const GUID *device_guid) }
hr = IDirect3DDevice7_BeginScene(device); - ok(hr == D3D_OK, "Got unexpected hr %#x.\n", hr); + ok(hr == D3D_OK, "Got unexpected hr %#lx.\n", hr); hr = IDirect3DDevice7_DrawPrimitive(device, D3DPT_TRIANGLESTRIP, D3DFVF_XYZRHW | D3DFVF_DIFFUSE, tquad, 4, 0); - ok(hr == D3D_OK, "Got unexpected hr %#x.\n", hr); + ok(hr == D3D_OK, "Got unexpected hr %#lx.\n", hr); hr = IDirect3DDevice7_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) { @@ -1809,8 +1803,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[] = { @@ -1830,13 +1824,12 @@ static void test_ck_rgba(const GUID *device_guid) DDSURFACEDESC2 surface_desc; IDirect3DDevice7 *device; IDirectDrawSurface7 *rt; + unsigned int color, i; IDirectDraw7 *ddraw; IDirect3D7 *d3d; - D3DCOLOR color; HWND window; DDBLTFX fx; HRESULT hr; - UINT i;
window = create_window(); if (!(device = create_device_ex(window, DDSCL_NORMAL, device_guid))) @@ -1847,9 +1840,9 @@ static void test_ck_rgba(const GUID *device_guid) }
hr = IDirect3DDevice7_GetDirect3D(device, &d3d); - ok(hr == D3D_OK, "Got unexpected hr %#x.\n", hr); + ok(hr == D3D_OK, "Got unexpected hr %#lx.\n", hr); hr = IDirect3D7_QueryInterface(d3d, &IID_IDirectDraw7, (void **)&ddraw); - ok(hr == D3D_OK, "Got unexpected hr %#x.\n", hr); + ok(hr == D3D_OK, "Got unexpected hr %#lx.\n", hr); IDirect3D7_Release(d3d);
memset(&surface_desc, 0, sizeof(surface_desc)); @@ -1870,43 +1863,43 @@ static void test_ck_rgba(const GUID *device_guid) surface_desc.ddckCKSrcBlt.dwColorSpaceLowValue = 0xff00ff00; surface_desc.ddckCKSrcBlt.dwColorSpaceHighValue = 0xff00ff00; hr = IDirectDraw7_CreateSurface(ddraw, &surface_desc, &texture, NULL); - ok(hr == DD_OK, "Got unexpected hr %#x.\n", hr); + ok(hr == DD_OK, "Got unexpected hr %#lx.\n", hr);
hr = IDirect3DDevice7_SetTexture(device, 0, texture); - ok(hr == D3D_OK, "Got unexpected hr %#x.\n", hr); + ok(hr == D3D_OK, "Got unexpected hr %#lx.\n", hr); hr = IDirect3DDevice7_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 = IDirect3DDevice7_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 = IDirect3DDevice7_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 = IDirect3DDevice7_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 = IDirect3DDevice7_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 = IDirectDrawSurface7_Blt(texture, 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 = IDirect3DDevice7_Clear(device, 0, NULL, D3DCLEAR_TARGET | D3DCLEAR_ZBUFFER, 0xffff0000, 1.0f, 0); - 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 = IDirect3DDevice7_BeginScene(device); - ok(hr == D3D_OK, "Got unexpected hr %#x.\n", hr); + ok(hr == D3D_OK, "Got unexpected hr %#lx.\n", hr); hr = IDirect3DDevice7_DrawPrimitive(device, D3DPT_TRIANGLESTRIP, D3DFVF_XYZRHW | D3DFVF_TEX1, &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 = IDirect3DDevice7_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), @@ -1915,14 +1908,14 @@ static void test_ck_rgba(const GUID *device_guid)
U5(fx).dwFillColor = 0xff0000ff; hr = IDirectDrawSurface7_Blt(texture, 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 = IDirect3DDevice7_BeginScene(device); - ok(hr == D3D_OK, "Got unexpected hr %#x.\n", hr); + ok(hr == D3D_OK, "Got unexpected hr %#lx.\n", hr); hr = IDirect3DDevice7_DrawPrimitive(device, D3DPT_TRIANGLESTRIP, D3DFVF_XYZRHW | D3DFVF_TEX1, &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 = IDirect3DDevice7_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. */ @@ -1957,8 +1950,8 @@ static void test_ck_default(void) DDSURFACEDESC2 surface_desc; IDirect3DDevice7 *device; IDirectDraw7 *ddraw; + unsigned int color; IDirect3D7 *d3d; - D3DCOLOR color; DWORD value; HWND window; DDBLTFX fx; @@ -1973,13 +1966,13 @@ static void test_ck_default(void) }
hr = IDirect3DDevice7_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 = IDirect3D7_QueryInterface(d3d, &IID_IDirectDraw7, (void **)&ddraw); - ok(SUCCEEDED(hr), "Failed to get ddraw interface, hr %#x.\n", hr); + ok(SUCCEEDED(hr), "Failed to get ddraw interface, hr %#lx.\n", hr); IDirect3D7_Release(d3d);
hr = IDirect3DDevice7_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); @@ -1996,43 +1989,43 @@ static void test_ck_default(void) surface_desc.ddckCKSrcBlt.dwColorSpaceLowValue = 0x000000ff; surface_desc.ddckCKSrcBlt.dwColorSpaceHighValue = 0x000000ff; hr = IDirectDraw7_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 = IDirect3DDevice7_SetTexture(device, 0, surface); - ok(SUCCEEDED(hr), "Failed to set texture, hr %#x.\n", hr); + ok(SUCCEEDED(hr), "Failed to set texture, hr %#lx.\n", hr);
memset(&fx, 0, sizeof(fx)); fx.dwSize = sizeof(fx); U5(fx).dwFillColor = 0x000000ff; hr = IDirectDrawSurface7_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 = IDirect3DDevice7_Clear(device, 0, NULL, D3DCLEAR_TARGET, 0xff00ff00, 1.0f, 0); - 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 = IDirect3DDevice7_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 = IDirect3DDevice7_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 = IDirect3DDevice7_DrawPrimitive(device, D3DPT_TRIANGLESTRIP, D3DFVF_XYZRHW | D3DFVF_TEX1, &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 = IDirect3DDevice7_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 = IDirect3DDevice7_Clear(device, 0, NULL, D3DCLEAR_TARGET, 0xff00ff00, 1.0f, 0); - 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 = IDirect3DDevice7_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 = IDirect3DDevice7_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 = IDirect3DDevice7_DrawPrimitive(device, D3DPT_TRIANGLESTRIP, D3DFVF_XYZRHW | D3DFVF_TEX1, &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 = IDirect3DDevice7_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 = IDirect3DDevice7_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);
@@ -2066,11 +2059,11 @@ static void test_ck_complex(void) return; } hr = IDirect3DDevice7_GetCaps(device, &device_desc); - ok(SUCCEEDED(hr), "Failed to get device caps, hr %#x.\n", hr); + ok(SUCCEEDED(hr), "Failed to get device caps, hr %#lx.\n", hr); hr = IDirect3DDevice7_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 = IDirect3D7_QueryInterface(d3d, &IID_IDirectDraw7, (void **)&ddraw); - ok(SUCCEEDED(hr), "Failed to get ddraw interface, hr %#x.\n", hr); + ok(SUCCEEDED(hr), "Failed to get ddraw interface, hr %#lx.\n", hr); IDirect3D7_Release(d3d);
memset(&surface_desc, 0, sizeof(surface_desc)); @@ -2080,20 +2073,20 @@ static void test_ck_complex(void) surface_desc.dwWidth = 128; surface_desc.dwHeight = 128; hr = IDirectDraw7_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 = IDirectDrawSurface7_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 = IDirectDrawSurface7_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 = IDirectDrawSurface7_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; @@ -2101,24 +2094,24 @@ static void test_ck_complex(void) for (i = 0; i < 7; ++i) { hr = IDirectDrawSurface7_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 = IDirectDrawSurface7_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 = IDirectDrawSurface7_SetColorKey(tmp, DDCKEY_SRCBLT, &color_key); - ok(hr == DDERR_NOTONMIPMAPSUBLEVEL, "Got unexpected hr %#x, i %u.\n", hr, i); + ok(hr == DDERR_NOTONMIPMAPSUBLEVEL, "Got unexpected hr %#lx, i %u.\n", hr, i);
IDirectDrawSurface_Release(mipmap); mipmap = tmp; }
hr = IDirectDrawSurface7_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 = IDirectDrawSurface7_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); @@ -2126,43 +2119,43 @@ static void test_ck_complex(void) surface_desc.ddsCaps.dwCaps = DDSCAPS_PRIMARYSURFACE | DDSCAPS_COMPLEX | DDSCAPS_FLIP; U5(surface_desc).dwBackBufferCount = 1; hr = IDirectDraw7_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 = IDirectDrawSurface7_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 = IDirectDrawSurface7_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 = IDirectDrawSurface7_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 = IDirectDrawSurface7_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 = IDirectDrawSurface7_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 = IDirectDrawSurface7_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 = IDirectDrawSurface7_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 = IDirectDrawSurface7_Release(surface); - ok(!refcount, "Got unexpected refcount %u.\n", refcount); + ok(!refcount, "Got unexpected refcount %lu.\n", refcount);
if (!(device_desc.dpcTriCaps.dwTextureCaps & D3DPTEXTURECAPS_CUBEMAP)) { @@ -2177,47 +2170,47 @@ static void test_ck_complex(void) surface_desc.dwWidth = 128; surface_desc.dwHeight = 128; hr = IDirectDraw7_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 = IDirectDrawSurface7_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 = IDirectDrawSurface7_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);
caps.dwCaps2 = DDSCAPS2_CUBEMAP_NEGATIVEZ; hr = IDirectDrawSurface7_GetAttachedSurface(surface, &caps, &mipmap); - 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 = IDirectDrawSurface7_GetColorKey(mipmap, 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 = 0x000000ff; color_key.dwColorSpaceHighValue = 0x000000ff; hr = IDirectDrawSurface7_SetColorKey(mipmap, 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);
color_key.dwColorSpaceLowValue = 0; color_key.dwColorSpaceHighValue = 0; hr = IDirectDrawSurface7_GetColorKey(mipmap, DDCKEY_SRCBLT, &color_key); - ok(SUCCEEDED(hr), "Failed to get color key, hr %#x.\n", hr); - ok(color_key.dwColorSpaceLowValue == 0x000000ff, "Got unexpected value 0x%08x.\n", + ok(SUCCEEDED(hr), "Failed to get color key, hr %#lx.\n", hr); + ok(color_key.dwColorSpaceLowValue == 0x000000ff, "Got unexpected value 0x%08lx.\n", color_key.dwColorSpaceLowValue); - ok(color_key.dwColorSpaceHighValue == 0x000000ff, "Got unexpected value 0x%08x.\n", + ok(color_key.dwColorSpaceHighValue == 0x000000ff, "Got unexpected value 0x%08lx.\n", color_key.dwColorSpaceHighValue);
IDirectDrawSurface_AddRef(mipmap); for (i = 0; i < 7; ++i) { hr = IDirectDrawSurface7_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 = IDirectDrawSurface7_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 = IDirectDrawSurface7_SetColorKey(tmp, DDCKEY_SRCBLT, &color_key); - ok(hr == DDERR_NOTONMIPMAPSUBLEVEL, "Got unexpected hr %#x, i %u.\n", hr, i); + ok(hr == DDERR_NOTONMIPMAPSUBLEVEL, "Got unexpected hr %#lx, i %u.\n", hr, i);
IDirectDrawSurface_Release(mipmap); mipmap = tmp; @@ -2226,12 +2219,12 @@ static void test_ck_complex(void) IDirectDrawSurface7_Release(mipmap);
refcount = IDirectDrawSurface7_Release(surface); - ok(!refcount, "Got unexpected refcount %u.\n", refcount); + ok(!refcount, "Got unexpected refcount %lu.\n", refcount);
cleanup: IDirectDraw7_Release(ddraw); refcount = IDirect3DDevice7_Release(device); - ok(!refcount, "Got unexpected refcount %u.\n", refcount); + ok(!refcount, "Got unexpected refcount %lu.\n", refcount); DestroyWindow(window); }
@@ -2253,13 +2246,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; @@ -2268,7 +2261,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); } } @@ -2277,7 +2270,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); } } @@ -2353,7 +2346,7 @@ static void test_surface_qi(void) ddraw = create_ddraw(); ok(!!ddraw, "Failed to create a ddraw object.\n"); hr = IDirectDraw7_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); @@ -2362,9 +2355,9 @@ static void test_surface_qi(void) surface_desc.dwWidth = 512; surface_desc.dwHeight = 512; hr = IDirectDraw7_CreateSurface(ddraw, &surface_desc, (IDirectDrawSurface7 **)0xdeadbeef, NULL); - ok(hr == E_INVALIDARG, "Got unexpected hr %#x.\n", hr); + ok(hr == E_INVALIDARG, "Got unexpected hr %#lx.\n", hr); hr = IDirectDraw7_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_IDirectDrawSurface7, tests, ARRAY_SIZE(tests));
@@ -2470,36 +2463,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 = IDirectDraw7_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 = IDirectDraw7_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 = IDirectDraw7_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 = IDirectDraw7_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 @@ -2507,53 +2500,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 = IDirectDraw7_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 = IDirectDraw7_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 = IDirectDraw7_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 = IDirectDraw7_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 = IDirectDraw7_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 = IDirectDraw7_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 = IDirectDraw7_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 = IDirectDraw7_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); @@ -2584,12 +2577,12 @@ static void test_window_style(void) SetRect(&fullscreen_rect, 0, 0, registry_mode.dmPelsWidth, registry_mode.dmPelsHeight);
hr = IDirectDraw7_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", @@ -2601,9 +2594,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"); @@ -2612,77 +2605,77 @@ static void test_window_style(void) ShowWindow(window, SW_HIDE);
hr = IDirectDraw7_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 = IDirectDraw7_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 = IDirectDraw7_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 = IDirectDraw7_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 = IDirectDraw7_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 = IDirectDraw7_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 = IDirectDraw7_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()); @@ -2690,20 +2683,20 @@ static void test_window_style(void) SetActiveWindow(window); ok(GetActiveWindow() == window, "Unexpected active window.\n"); hr = IDirectDraw7_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 = IDirectDraw7_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); @@ -2713,13 +2706,13 @@ static void test_window_style(void) ret = SetForegroundWindow(window2); ok(ret, "Failed to set foreground window.\n"); hr = IDirectDraw7_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", @@ -2728,46 +2721,46 @@ static void test_window_style(void) ret = SetForegroundWindow(window); ok(ret, "Failed to set foreground window.\n"); hr = IDirectDraw7_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 = IDirectDraw7_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 = IDirectDraw7_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 = IDirectDraw7_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); @@ -2787,15 +2780,15 @@ static void test_redundant_mode_set(void) ddraw = create_ddraw(); ok(!!ddraw, "Failed to create a ddraw object.\n"); hr = IDirectDraw7_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 = IDirectDraw7_GetDisplayMode(ddraw, &surface_desc); - ok(SUCCEEDED(hr), "GetDisplayMode failed, hr %#x.\n", hr); + ok(SUCCEEDED(hr), "GetDisplayMode failed, hr %#lx.\n", hr);
hr = IDirectDraw7_SetDisplayMode(ddraw, surface_desc.dwWidth, surface_desc.dwHeight, U1(U4(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; @@ -2807,14 +2800,14 @@ static void test_redundant_mode_set(void)
hr = IDirectDraw7_SetDisplayMode(ddraw, surface_desc.dwWidth, surface_desc.dwHeight, U1(U4(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 = IDirectDraw7_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); } @@ -2964,10 +2957,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); @@ -2978,9 +2971,9 @@ static void test_coop_level_mode_set(void)
memset(¶m, 0, sizeof(param)); hr = IDirectDraw7_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 = IDirectDraw7_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) { @@ -2999,7 +2992,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"); @@ -3017,7 +3010,7 @@ static void test_coop_level_mode_set(void) 0, 0, 100, 100, 0, 0, 0, 0);
hr = IDirectDraw7_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), @@ -3029,12 +3022,12 @@ static void test_coop_level_mode_set(void) ddsd.ddsCaps.dwCaps = DDSCAPS_PRIMARYSURFACE;
hr = IDirectDraw7_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 = IDirectDrawSurface7_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); @@ -3047,16 +3040,16 @@ static void test_coop_level_mode_set(void) screen_size.cy = 0;
hr = IDirectDrawSurface7_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 = IDirectDrawSurface7_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); @@ -3064,10 +3057,10 @@ static void test_coop_level_mode_set(void) wine_dbgstr_rect(&r));
hr = IDirectDrawSurface7_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); IDirectDrawSurface7_Release(primary);
@@ -3077,12 +3070,12 @@ static void test_coop_level_mode_set(void) ddsd.ddsCaps.dwCaps = DDSCAPS_PRIMARYSURFACE;
hr = IDirectDraw7_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 = IDirectDrawSurface7_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); @@ -3095,16 +3088,16 @@ static void test_coop_level_mode_set(void) screen_size.cy = 0;
hr = IDirectDrawSurface7_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 = IDirectDrawSurface7_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); @@ -3123,7 +3116,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; @@ -3136,11 +3129,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 = IDirectDraw7_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 @@ -3162,7 +3155,7 @@ static void test_coop_level_mode_set(void) expect_messages = NULL;
hr = IDirectDraw7_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; @@ -3170,17 +3163,17 @@ static void test_coop_level_mode_set(void) screen_size.cy = 0;
hr = IDirectDrawSurface7_IsLost(primary); - ok(hr == DDERR_SURFACELOST, "Got unexpected hr %#x.\n", hr); + ok(hr == DDERR_SURFACELOST, "Got unexpected hr %#lx.\n", hr); hr = IDirectDraw7_RestoreDisplayMode(ddraw); - ok(SUCCEEDED(hr), "RestoreDisplayMode failed, hr %#x.\n", hr); + ok(SUCCEEDED(hr), "RestoreDisplayMode failed, hr %#lx.\n", hr); hr = IDirectDrawSurface7_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); @@ -3188,16 +3181,16 @@ static void test_coop_level_mode_set(void) wine_dbgstr_rect(&r));
hr = IDirectDrawSurface7_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); IDirectDrawSurface7_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); @@ -3205,12 +3198,12 @@ static void test_coop_level_mode_set(void) ddsd.ddsCaps.dwCaps = DDSCAPS_PRIMARYSURFACE;
hr = IDirectDraw7_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 = IDirectDrawSurface7_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); @@ -3218,17 +3211,17 @@ static void test_coop_level_mode_set(void) wine_dbgstr_rect(&r));
hr = IDirectDraw7_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 = IDirectDrawSurface7_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); IDirectDrawSurface7_Release(primary);
@@ -3238,12 +3231,12 @@ static void test_coop_level_mode_set(void) ddsd.ddsCaps.dwCaps = DDSCAPS_PRIMARYSURFACE;
hr = IDirectDraw7_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 = IDirectDrawSurface7_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); @@ -3256,18 +3249,18 @@ static void test_coop_level_mode_set(void) screen_size.cy = 0;
hr = IDirectDrawSurface7_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 = IDirectDrawSurface7_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), @@ -3279,27 +3272,27 @@ static void test_coop_level_mode_set(void) screen_size.cy = 0;
hr = IDirectDrawSurface7_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 = IDirectDrawSurface7_Restore(primary); - ok(hr == DDERR_WRONGMODE, "Got unexpected hr %#x.\n", hr); + ok(hr == DDERR_WRONGMODE, "Got unexpected hr %#lx.\n", hr); hr = IDirectDrawSurface7_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 = IDirectDrawSurface7_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); IDirectDrawSurface7_Release(primary);
@@ -3309,12 +3302,12 @@ static void test_coop_level_mode_set(void) ddsd.ddsCaps.dwCaps = DDSCAPS_PRIMARYSURFACE;
hr = IDirectDraw7_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 = IDirectDrawSurface7_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); @@ -3327,25 +3320,25 @@ static void test_coop_level_mode_set(void) screen_size.cy = 0;
hr = IDirectDrawSurface7_IsLost(primary); - ok(hr == DD_OK, "Got unexpected hr %#x.\n", hr); + ok(hr == DD_OK, "Got unexpected hr %#lx.\n", hr); hr = IDirectDraw7_RestoreDisplayMode(ddraw); - ok(SUCCEEDED(hr), "RestoreDisplayMode failed, hr %#x.\n", hr); + ok(SUCCEEDED(hr), "RestoreDisplayMode failed, hr %#lx.\n", hr); hr = IDirectDrawSurface7_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 = IDirectDrawSurface7_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); IDirectDrawSurface7_Release(primary);
@@ -3353,11 +3346,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); @@ -3365,12 +3358,12 @@ static void test_coop_level_mode_set(void) ddsd.ddsCaps.dwCaps = DDSCAPS_PRIMARYSURFACE;
hr = IDirectDraw7_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 = IDirectDrawSurface7_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); @@ -3381,17 +3374,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 = IDirectDraw7_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 = IDirectDrawSurface7_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); IDirectDrawSurface7_Release(primary);
@@ -3401,12 +3394,12 @@ static void test_coop_level_mode_set(void) ddsd.ddsCaps.dwCaps = DDSCAPS_PRIMARYSURFACE;
hr = IDirectDraw7_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 = IDirectDrawSurface7_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); @@ -3419,18 +3412,18 @@ static void test_coop_level_mode_set(void) screen_size.cy = 0;
hr = IDirectDrawSurface7_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 = IDirectDrawSurface7_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), @@ -3442,27 +3435,27 @@ static void test_coop_level_mode_set(void) screen_size.cy = 0;
hr = IDirectDrawSurface7_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 = IDirectDrawSurface7_Restore(primary); - ok(hr == DDERR_WRONGMODE, "Got unexpected hr %#x.\n", hr); + ok(hr == DDERR_WRONGMODE, "Got unexpected hr %#lx.\n", hr); hr = IDirectDrawSurface7_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 = IDirectDrawSurface7_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); IDirectDrawSurface7_Release(primary);
@@ -3472,12 +3465,12 @@ static void test_coop_level_mode_set(void) ddsd.ddsCaps.dwCaps = DDSCAPS_PRIMARYSURFACE;
hr = IDirectDraw7_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 = IDirectDrawSurface7_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); @@ -3490,25 +3483,25 @@ static void test_coop_level_mode_set(void) screen_size.cy = 0;
hr = IDirectDrawSurface7_IsLost(primary); - ok(hr == DD_OK, "Got unexpected hr %#x.\n", hr); + ok(hr == DD_OK, "Got unexpected hr %#lx.\n", hr); hr = IDirectDraw7_RestoreDisplayMode(ddraw); - ok(SUCCEEDED(hr), "RestoreDisplayMode failed, hr %#x.\n", hr); + ok(SUCCEEDED(hr), "RestoreDisplayMode failed, hr %#lx.\n", hr); hr = IDirectDrawSurface7_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 = IDirectDrawSurface7_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); IDirectDrawSurface7_Release(primary);
@@ -3516,11 +3509,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); @@ -3528,12 +3521,12 @@ static void test_coop_level_mode_set(void) ddsd.ddsCaps.dwCaps = DDSCAPS_PRIMARYSURFACE;
hr = IDirectDraw7_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 = IDirectDrawSurface7_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); IDirectDrawSurface7_Release(primary);
@@ -3543,9 +3536,9 @@ static void test_coop_level_mode_set(void)
/* Changing the coop level from EXCLUSIVE to NORMAL restores the screen resolution */ hr = IDirectDraw7_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; @@ -3553,13 +3546,13 @@ static void test_coop_level_mode_set(void) screen_size.cy = 0;
hr = IDirectDraw7_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);
@@ -3573,23 +3566,23 @@ static void test_coop_level_mode_set(void) ddsd.ddsCaps.dwCaps = DDSCAPS_PRIMARYSURFACE;
hr = IDirectDraw7_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 = IDirectDrawSurface7_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); IDirectDrawSurface7_Release(primary);
/* The screen restore is a property of DDSCL_EXCLUSIVE */ hr = IDirectDraw7_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 = IDirectDraw7_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); @@ -3597,23 +3590,23 @@ static void test_coop_level_mode_set(void) ddsd.ddsCaps.dwCaps = DDSCAPS_PRIMARYSURFACE;
hr = IDirectDraw7_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 = IDirectDrawSurface7_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); IDirectDrawSurface7_Release(primary);
hr = IDirectDraw7_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 = IDirectDraw7_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; @@ -3623,14 +3616,14 @@ static void test_coop_level_mode_set(void) screen_size2.cy = 0;
hr = IDirectDraw7_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); @@ -3646,17 +3639,17 @@ static void test_coop_level_mode_set(void) ddsd.ddsCaps.dwCaps = DDSCAPS_PRIMARYSURFACE;
hr = IDirectDraw7_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 = IDirectDrawSurface7_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); IDirectDrawSurface7_Release(primary);
ref = IDirectDraw7_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), @@ -3670,36 +3663,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 = IDirectDraw7_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 = IDirectDraw7_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 = IDirectDraw7_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 = IDirectDraw7_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"); @@ -3709,19 +3702,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 = IDirectDraw7_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"); @@ -3730,23 +3723,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 = IDirectDraw7_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 = IDirectDraw7_Release(ddraw); - ok(ref == 0, "The ddraw object was not properly freed: refcount %u.\n", ref); + ok(!ref, "Unexpected refcount %lu.\n", ref);
expect_messages = NULL; DestroyWindow(window); @@ -3774,10 +3767,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); @@ -3791,14 +3784,14 @@ static void test_coop_level_mode_set_multi(void) /* With just a single ddraw object, the display mode is restored on * release. */ 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);
ref = IDirectDraw7_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); @@ -3808,7 +3801,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); @@ -3816,21 +3809,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 = IDirectDraw7_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 = IDirectDraw7_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); @@ -3839,7 +3832,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); @@ -3847,21 +3840,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 = IDirectDraw7_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 = IDirectDraw7_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); @@ -3871,21 +3864,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 = IDirectDraw7_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 = IDirectDraw7_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); @@ -3895,7 +3888,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); @@ -3903,24 +3896,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 = IDirectDraw7_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 = IDirectDraw7_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 = IDirectDraw7_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); @@ -3929,28 +3922,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 = IDirectDraw7_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 = IDirectDraw7_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 = IDirectDraw7_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); @@ -3978,7 +3971,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)) @@ -3995,32 +3988,32 @@ static void test_coop_level_mode_set_multi(void) ddraw1 = create_ddraw(); ok(!!ddraw1, "Failed to create a ddraw object.\n"); hr = IDirectDraw7_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 = IDirectDraw7_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 = IDirectDraw7_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 = IDirectDraw7_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"); @@ -4030,19 +4023,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 = IDirectDraw7_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"); @@ -4051,23 +4044,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 = IDirectDraw7_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 = IDirectDraw7_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");
@@ -4075,24 +4068,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 = IDirectDraw7_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"); @@ -4104,27 +4097,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 = IDirectDraw7_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 = IDirectDraw7_Release(ddraw2); - ok(ref == 0, "The ddraw object was not properly freed: refcount %u.\n", ref); + ok(!ref, "Unexpected refcount %lu.\n", ref); ref = IDirectDraw7_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");
@@ -4135,25 +4128,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 = IDirectDraw7_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 = IDirectDraw7_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); @@ -4171,16 +4164,16 @@ static void test_initialize(void) ok(!!ddraw, "Failed to create a ddraw object.\n");
hr = IDirectDraw7_Initialize(ddraw, NULL); - ok(hr == DDERR_ALREADYINITIALIZED, "Initialize returned hr %#x.\n", hr); + ok(hr == DDERR_ALREADYINITIALIZED, "Initialize returned hr %#lx.\n", hr); IDirectDraw7_Release(ddraw);
CoInitialize(NULL); hr = CoCreateInstance(&CLSID_DirectDraw, NULL, CLSCTX_INPROC_SERVER, &IID_IDirectDraw7, (void **)&ddraw); - ok(SUCCEEDED(hr), "Failed to create IDirectDraw7 instance, hr %#x.\n", hr); + ok(SUCCEEDED(hr), "Failed to create IDirectDraw7 instance, hr %#lx.\n", hr); hr = IDirectDraw7_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 = IDirectDraw7_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); IDirectDraw7_Release(ddraw); CoUninitialize(); } @@ -4201,20 +4194,20 @@ static void test_coop_level_surf_create(void) ddsd.ddsCaps.dwCaps = DDSCAPS_PRIMARYSURFACE; surface = (void *)0xdeadbeef; hr = IDirectDraw7_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 = IDirectDraw7_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 = IDirectDraw7_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 = IDirectDraw7_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);
IDirectDraw7_Release(ddraw); @@ -4249,7 +4242,7 @@ static void test_vb_discard(void) }
hr = IDirect3DDevice7_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);
memset(&desc, 0, sizeof(desc)); desc.dwSize = sizeof(desc); @@ -4257,29 +4250,29 @@ static void test_vb_discard(void) desc.dwFVF = D3DFVF_XYZRHW; desc.dwNumVertices = vbsize; hr = IDirect3D7_CreateVertexBuffer(d3d, &desc, &buffer, 0); - ok(SUCCEEDED(hr), "Failed to create vertex buffer, hr %#x.\n", hr); + ok(SUCCEEDED(hr), "Failed to create vertex buffer, hr %#lx.\n", hr);
hr = IDirect3DVertexBuffer7_Lock(buffer, DDLOCK_DISCARDCONTENTS, (void **)&data, NULL); - ok(SUCCEEDED(hr), "Failed to lock vertex buffer, hr %#x.\n", hr); + ok(SUCCEEDED(hr), "Failed to lock vertex buffer, hr %#lx.\n", hr); memcpy(data, quad, sizeof(quad)); hr = IDirect3DVertexBuffer7_Unlock(buffer); - ok(SUCCEEDED(hr), "Failed to unlock vertex buffer, hr %#x.\n", hr); + ok(SUCCEEDED(hr), "Failed to unlock vertex buffer, hr %#lx.\n", hr);
hr = IDirect3DDevice7_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 = IDirect3DDevice7_DrawPrimitiveVB(device, D3DPT_TRIANGLESTRIP, buffer, 0, 4, 0); - ok(SUCCEEDED(hr), "Failed to draw, hr %#x.\n", hr); + ok(SUCCEEDED(hr), "Failed to draw, hr %#lx.\n", hr); hr = IDirect3DDevice7_EndScene(device); - ok(SUCCEEDED(hr), "Failed to end scene, hr %#x.\n", hr); + ok(SUCCEEDED(hr), "Failed to end scene, hr %#lx.\n", hr);
hr = IDirect3DVertexBuffer7_Lock(buffer, DDLOCK_DISCARDCONTENTS, (void **)&data, NULL); - ok(SUCCEEDED(hr), "Failed to lock vertex buffer, hr %#x.\n", hr); + ok(SUCCEEDED(hr), "Failed to lock vertex buffer, hr %#lx.\n", hr); memset(data, 0xaa, sizeof(struct vec4) * vbsize); hr = IDirect3DVertexBuffer7_Unlock(buffer); - ok(SUCCEEDED(hr), "Failed to unlock vertex buffer, hr %#x.\n", hr); + ok(SUCCEEDED(hr), "Failed to unlock vertex buffer, hr %#lx.\n", hr);
hr = IDirect3DVertexBuffer7_Lock(buffer, DDLOCK_DISCARDCONTENTS, (void **)&data, NULL); - ok(SUCCEEDED(hr), "Failed to lock vertex buffer, hr %#x.\n", hr); + ok(SUCCEEDED(hr), "Failed to lock vertex buffer, hr %#lx.\n", hr); for (i = 0; i < sizeof(struct vec4) * vbsize; i++) { if (data[i] != 0xaa) @@ -4289,7 +4282,7 @@ static void test_vb_discard(void) } } hr = IDirect3DVertexBuffer7_Unlock(buffer); - ok(SUCCEEDED(hr), "Failed to unlock vertex buffer, hr %#x.\n", hr); + ok(SUCCEEDED(hr), "Failed to unlock vertex buffer, hr %#lx.\n", hr);
IDirect3DVertexBuffer7_Release(buffer); IDirect3D7_Release(d3d); @@ -4309,9 +4302,9 @@ static void test_coop_level_multi_window(void) ok(!!ddraw, "Failed to create a ddraw object.\n");
hr = IDirectDraw7_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 = IDirectDraw7_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");
@@ -4340,7 +4333,7 @@ static void test_draw_strided(void)
IDirectDrawSurface7 *rt; IDirect3DDevice7 *device; - D3DCOLOR color; + unsigned int color; HWND window; HRESULT hr; D3DDRAWPRIMITIVESTRIDEDDATA strided; @@ -4354,14 +4347,14 @@ static void test_draw_strided(void) }
hr = IDirect3DDevice7_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 = IDirect3DDevice7_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 = IDirect3DDevice7_Clear(device, 0, NULL, D3DCLEAR_TARGET, 0x00000000, 1.0f, 0); - 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 = IDirect3DDevice7_BeginScene(device); - ok(SUCCEEDED(hr), "Failed to begin scene, hr %#x.\n", hr); + ok(SUCCEEDED(hr), "Failed to begin scene, hr %#lx.\n", hr);
memset(&strided, 0x55, sizeof(strided)); strided.position.lpvData = position; @@ -4370,10 +4363,10 @@ static void test_draw_strided(void) strided.diffuse.dwStride = sizeof(*diffuse); hr = IDirect3DDevice7_DrawIndexedPrimitiveStrided(device, D3DPT_TRIANGLELIST, D3DFVF_XYZ | D3DFVF_DIFFUSE, &strided, 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 = IDirect3DDevice7_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); @@ -4498,19 +4491,17 @@ static void test_lighting(void) struct vertex *src_data1; IDirect3DDevice7 *device; IDirectDrawSurface7 *rt; + unsigned int color, i; IDirectDraw7 *ddraw; IDirect3D7 *d3d; - D3DCOLOR color; ULONG refcount; - unsigned int i; BOOL is_warp; HWND window; HRESULT hr; struct { struct vec4 position; - DWORD diffuse; - DWORD specular; + unsigned int diffuse, specular; } *dst_data;
@@ -4522,113 +4513,113 @@ static void test_lighting(void) return; } hr = IDirect3DDevice7_GetDirect3D(device, &d3d); - ok(hr == D3D_OK, "Got unexpected hr %#x.\n", hr); + ok(hr == D3D_OK, "Got unexpected hr %#lx.\n", hr); hr = IDirect3D7_QueryInterface(d3d, &IID_IDirectDraw7, (void **)&ddraw); - ok(hr == D3D_OK, "Got unexpected hr %#x.\n", hr); + ok(hr == D3D_OK, "Got unexpected hr %#lx.\n", hr);
is_warp = ddraw_is_warp(ddraw);
hr = IDirect3DDevice7_GetRenderTarget(device, &rt); - ok(hr == D3D_OK, "Got unexpected hr %#x.\n", hr); + ok(hr == D3D_OK, "Got unexpected hr %#lx.\n", hr);
hr = IDirect3DDevice7_Clear(device, 0, NULL, D3DCLEAR_TARGET, 0xffffffff, 0.0, 0); - ok(hr == D3D_OK, "Got unexpected hr %#x.\n", hr); + ok(hr == D3D_OK, "Got unexpected hr %#lx.\n", hr);
hr = IDirect3DDevice7_SetTransform(device, D3DTRANSFORMSTATE_WORLD, &mat); - ok(hr == D3D_OK, "Got unexpected hr %#x.\n", hr); + ok(hr == D3D_OK, "Got unexpected hr %#lx.\n", hr); hr = IDirect3DDevice7_SetTransform(device, D3DTRANSFORMSTATE_VIEW, &mat); - ok(hr == D3D_OK, "Got unexpected hr %#x.\n", hr); + ok(hr == D3D_OK, "Got unexpected hr %#lx.\n", hr); hr = IDirect3DDevice7_SetTransform(device, D3DTRANSFORMSTATE_PROJECTION, &mat); - ok(hr == D3D_OK, "Got unexpected hr %#x.\n", hr); + ok(hr == D3D_OK, "Got unexpected hr %#lx.\n", hr); hr = IDirect3DDevice7_SetRenderState(device, D3DRENDERSTATE_CLIPPING, FALSE); - ok(hr == D3D_OK, "Got unexpected hr %#x.\n", hr); + ok(hr == D3D_OK, "Got unexpected hr %#lx.\n", hr); hr = IDirect3DDevice7_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 = IDirect3DDevice7_SetRenderState(device, D3DRENDERSTATE_FOGENABLE, FALSE); - ok(hr == D3D_OK, "Got unexpected hr %#x.\n", hr); + ok(hr == D3D_OK, "Got unexpected hr %#lx.\n", hr); hr = IDirect3DDevice7_SetRenderState(device, D3DRENDERSTATE_STENCILENABLE, FALSE); - ok(hr == D3D_OK, "Got unexpected hr %#x.\n", hr); + ok(hr == D3D_OK, "Got unexpected hr %#lx.\n", hr); hr = IDirect3DDevice7_SetRenderState(device, D3DRENDERSTATE_CULLMODE, D3DCULL_NONE); - ok(hr == D3D_OK, "Got unexpected hr %#x.\n", hr); + ok(hr == D3D_OK, "Got unexpected hr %#lx.\n", hr);
hr = IDirect3DDevice7_BeginScene(device); - ok(hr == D3D_OK, "Got unexpected hr %#x.\n", hr); + ok(hr == D3D_OK, "Got unexpected hr %#lx.\n", hr);
memset(&vb_desc, 0, sizeof(vb_desc)); vb_desc.dwSize = sizeof(vb_desc); vb_desc.dwFVF = fvf; vb_desc.dwNumVertices = 2; hr = IDirect3D7_CreateVertexBuffer(d3d, &vb_desc, &src_vb1, 0); - ok(hr == D3D_OK, "Got unexpected hr %#x.\n", hr); + ok(hr == D3D_OK, "Got unexpected hr %#lx.\n", hr); vb_desc.dwSize = sizeof(vb_desc); vb_desc.dwFVF = nfvf; vb_desc.dwNumVertices = 2; hr = IDirect3D7_CreateVertexBuffer(d3d, &vb_desc, &src_vb2, 0); - ok(hr == D3D_OK, "Got unexpected hr %#x.\n", hr); + ok(hr == D3D_OK, "Got unexpected hr %#lx.\n", hr);
memset(&vb_desc, 0, sizeof(vb_desc)); vb_desc.dwSize = sizeof(vb_desc); vb_desc.dwFVF = D3DFVF_XYZRHW | D3DFVF_DIFFUSE | D3DFVF_SPECULAR; vb_desc.dwNumVertices = 4; hr = IDirect3D7_CreateVertexBuffer(d3d, &vb_desc, &dst_vb, 0); - ok(hr == D3D_OK, "Got unexpected hr %#x.\n", hr); + ok(hr == D3D_OK, "Got unexpected hr %#lx.\n", hr);
hr = IDirect3DVertexBuffer7_Lock(src_vb1, 0, (void **)&src_data1, NULL); - ok(hr == D3D_OK, "Got unexpected hr %#x.\n", hr); + ok(hr == D3D_OK, "Got unexpected hr %#lx.\n", hr); memcpy(src_data1, unlitquad, sizeof(*src_data1)); memcpy(&src_data1[1], litquad, sizeof(*src_data1)); hr = IDirect3DVertexBuffer7_Unlock(src_vb1); - ok(hr == D3D_OK, "Got unexpected hr %#x.\n", hr); + ok(hr == D3D_OK, "Got unexpected hr %#lx.\n", hr);
hr = IDirect3DVertexBuffer7_Lock(src_vb2, 0, (void **)&src_data2, NULL); - ok(hr == D3D_OK, "Got unexpected hr %#x.\n", hr); + ok(hr == D3D_OK, "Got unexpected hr %#lx.\n", hr); memcpy(src_data2, unlitnquad, sizeof(*src_data2)); memcpy(&src_data2[1], litnquad, sizeof(*src_data2)); hr = IDirect3DVertexBuffer7_Unlock(src_vb2); - ok(hr == D3D_OK, "Got unexpected hr %#x.\n", hr); + ok(hr == D3D_OK, "Got unexpected hr %#lx.\n", hr);
/* No lights are defined... That means, lit vertices should be entirely black. */ hr = IDirect3DDevice7_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 = IDirect3DVertexBuffer7_ProcessVertices(dst_vb, D3DVOP_TRANSFORM, 0, 1, src_vb1, 0, device, 0); - ok(hr == D3D_OK, "Got unexpected hr %#x.\n", hr); + ok(hr == D3D_OK, "Got unexpected hr %#lx.\n", hr); hr = IDirect3DDevice7_DrawIndexedPrimitive(device, D3DPT_TRIANGLELIST, fvf, unlitquad, 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 = IDirect3DDevice7_SetRenderState(device, D3DRENDERSTATE_LIGHTING, TRUE); - ok(hr == D3D_OK, "Got unexpected hr %#x.\n", hr); + ok(hr == D3D_OK, "Got unexpected hr %#lx.\n", hr); hr = IDirect3DVertexBuffer7_ProcessVertices(dst_vb, D3DVOP_TRANSFORM | D3DVOP_LIGHT, 1, 1, src_vb1, 1, device, 0); - ok(hr == D3D_OK, "Got unexpected hr %#x.\n", hr); + ok(hr == D3D_OK, "Got unexpected hr %#lx.\n", hr); hr = IDirect3DDevice7_DrawIndexedPrimitive(device, D3DPT_TRIANGLELIST, fvf, litquad, 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 = IDirect3DDevice7_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 = IDirect3DVertexBuffer7_ProcessVertices(dst_vb, D3DVOP_TRANSFORM, 2, 1, src_vb2, 0, device, 0); - ok(hr == D3D_OK, "Got unexpected hr %#x.\n", hr); + ok(hr == D3D_OK, "Got unexpected hr %#lx.\n", hr); hr = IDirect3DDevice7_DrawIndexedPrimitive(device, D3DPT_TRIANGLELIST, nfvf, unlitnquad, 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 = IDirect3DDevice7_SetRenderState(device, D3DRENDERSTATE_LIGHTING, TRUE); - ok(hr == D3D_OK, "Got unexpected hr %#x.\n", hr); + ok(hr == D3D_OK, "Got unexpected hr %#lx.\n", hr); hr = IDirect3DVertexBuffer7_ProcessVertices(dst_vb, D3DVOP_TRANSFORM | D3DVOP_LIGHT, 3, 1, src_vb2, 1, device, 0); - ok(hr == D3D_OK, "Got unexpected hr %#x.\n", hr); + ok(hr == D3D_OK, "Got unexpected hr %#lx.\n", hr); hr = IDirect3DDevice7_DrawIndexedPrimitive(device, D3DPT_TRIANGLELIST, nfvf, litnquad, 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 = IDirect3DDevice7_EndScene(device); - ok(hr == D3D_OK, "Got unexpected hr %#x.\n", hr); + ok(hr == D3D_OK, "Got unexpected hr %#lx.\n", hr);
hr = IDirect3DVertexBuffer7_Lock(dst_vb, 0, (void **)&dst_data, NULL); - 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, 160, 360); ok(color == 0x00ff0000, "Unlit quad without normals has color 0x%08x, expected 0x00ff0000.\n", color); @@ -4659,41 +4650,41 @@ static void test_lighting(void) "Unexpected specular color 0x%08x.\n", dst_data[3].specular);
hr = IDirect3DVertexBuffer7_Unlock(dst_vb); - ok(hr == D3D_OK, "Got unexpected hr %#x.\n", hr); + ok(hr == D3D_OK, "Got unexpected hr %#lx.\n", hr);
hr = IDirect3DDevice7_LightEnable(device, 0, TRUE); - 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 = IDirect3DVertexBuffer7_Lock(src_vb2, 0, (void **)&src_data2, NULL); - ok(hr == D3D_OK, "Got unexpected hr %#x.\n", hr); + ok(hr == D3D_OK, "Got unexpected hr %#lx.\n", hr); memcpy(src_data2, tests[i].quad, sizeof(*src_data2)); hr = IDirect3DVertexBuffer7_Unlock(src_vb2); - ok(hr == D3D_OK, "Got unexpected hr %#x.\n", hr); + ok(hr == D3D_OK, "Got unexpected hr %#lx.\n", hr);
hr = IDirect3DDevice7_SetTransform(device, D3DTRANSFORMSTATE_WORLD, tests[i].world_matrix); - ok(hr == D3D_OK, "Got unexpected hr %#x.\n", hr); + ok(hr == D3D_OK, "Got unexpected hr %#lx.\n", hr);
hr = IDirect3DDevice7_Clear(device, 0, NULL, D3DCLEAR_TARGET, 0xffffffff, 0.0, 0); - ok(hr == D3D_OK, "Got unexpected hr %#x.\n", hr); + ok(hr == D3D_OK, "Got unexpected hr %#lx.\n", hr);
hr = IDirect3DDevice7_BeginScene(device); - ok(hr == D3D_OK, "Got unexpected hr %#x.\n", hr); + ok(hr == D3D_OK, "Got unexpected hr %#lx.\n", hr);
hr = IDirect3DVertexBuffer7_ProcessVertices(dst_vb, D3DVOP_TRANSFORM | D3DVOP_LIGHT, 0, 1, src_vb2, 0, device, 0); - ok(hr == D3D_OK, "Got unexpected hr %#x.\n", hr); + ok(hr == D3D_OK, "Got unexpected hr %#lx.\n", hr);
hr = IDirect3DDevice7_DrawIndexedPrimitive(device, D3DPT_TRIANGLELIST, nfvf, tests[i].quad, 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 = IDirect3DDevice7_EndScene(device); - ok(hr == D3D_OK, "Got unexpected hr %#x.\n", hr); + ok(hr == D3D_OK, "Got unexpected hr %#lx.\n", hr);
hr = IDirect3DVertexBuffer7_Lock(dst_vb, 0, (void **)&dst_data, NULL); - 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 == tests[i].expected || broken(is_warp && (color == 0x000000ff || color == 0x00ff00ff)), @@ -4705,7 +4696,7 @@ static void test_lighting(void) "%s has specular color 0x%08x.\n", tests[i].message, dst_data[0].specular);
hr = IDirect3DVertexBuffer7_Unlock(dst_vb); - ok(hr == D3D_OK, "Got unexpected hr %#x.\n", hr); + ok(hr == D3D_OK, "Got unexpected hr %#lx.\n", hr); }
IDirect3DVertexBuffer7_Release(src_vb1); @@ -4717,7 +4708,7 @@ static void test_lighting(void) IDirectDraw7_Release(ddraw); IDirect3D7_Release(d3d); refcount = IDirect3DDevice7_Release(device); - ok(!refcount, "Device has %u references left.\n", refcount); + ok(!refcount, "Device has %lu references left.\n", refcount); DestroyWindow(window); }
@@ -4813,8 +4804,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[] = { @@ -4995,11 +4985,10 @@ static void test_specular_lighting(void) {&point_range, FALSE, 0.0f, expected_point_range_0, expected_point_range, ARRAY_SIZE(expected_point_range_0), TRUE}, };
+ unsigned int color, expected_color, i, j, x, y; IDirect3DVertexBuffer7 *src_vb, *dst_vb; - D3DCOLOR color, expected_color; D3DVERTEXBUFFERDESC vb_desc; IDirect3DDevice7 *device; - unsigned int i, j, x, y; IDirectDrawSurface7 *rt; D3DMATERIAL7 material; struct vec3 *src_data; @@ -5012,8 +5001,7 @@ static void test_specular_lighting(void) struct { struct vec4 position; - DWORD diffuse; - DWORD specular; + unsigned int diffuse, specular; } *dst_data;
window = create_window(); @@ -5024,7 +5012,7 @@ static void test_specular_lighting(void) return; } hr = IDirect3DDevice7_GetDirect3D(device, &d3d); - ok(hr == D3D_OK, "Got unexpected hr %#x.\n", hr); + ok(hr == D3D_OK, "Got unexpected hr %#lx.\n", hr);
quad = heap_alloc(vertices_side * vertices_side * sizeof(*quad)); indices = heap_alloc(indices_count * sizeof(*indices)); @@ -5054,52 +5042,52 @@ static void test_specular_lighting(void) }
hr = IDirect3DDevice7_GetRenderTarget(device, &rt); - ok(hr == D3D_OK, "Got unexpected hr %#x.\n", hr); + ok(hr == D3D_OK, "Got unexpected hr %#lx.\n", hr);
hr = IDirect3DDevice7_SetTransform(device, D3DTRANSFORMSTATE_WORLD, &mat); - ok(hr == D3D_OK, "Got unexpected hr %#x.\n", hr); + ok(hr == D3D_OK, "Got unexpected hr %#lx.\n", hr); hr = IDirect3DDevice7_SetTransform(device, D3DTRANSFORMSTATE_VIEW, &mat); - ok(hr == D3D_OK, "Got unexpected hr %#x.\n", hr); + ok(hr == D3D_OK, "Got unexpected hr %#lx.\n", hr); hr = IDirect3DDevice7_SetTransform(device, D3DTRANSFORMSTATE_PROJECTION, &mat); - ok(hr == D3D_OK, "Got unexpected hr %#x.\n", hr); + ok(hr == D3D_OK, "Got unexpected hr %#lx.\n", hr); hr = IDirect3DDevice7_SetRenderState(device, D3DRENDERSTATE_CLIPPING, FALSE); - ok(hr == D3D_OK, "Got unexpected hr %#x.\n", hr); + ok(hr == D3D_OK, "Got unexpected hr %#lx.\n", hr); hr = IDirect3DDevice7_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 = IDirect3DDevice7_SetRenderState(device, D3DRENDERSTATE_FOGENABLE, FALSE); - ok(hr == D3D_OK, "Got unexpected hr %#x.\n", hr); + ok(hr == D3D_OK, "Got unexpected hr %#lx.\n", hr);
hr = IDirect3DDevice7_LightEnable(device, 0, TRUE); - ok(hr == D3D_OK, "Got unexpected hr %#x.\n", hr); + ok(hr == D3D_OK, "Got unexpected hr %#lx.\n", hr); hr = IDirect3DDevice7_SetRenderState(device, D3DRENDERSTATE_SPECULARENABLE, TRUE); - ok(hr == D3D_OK, "Got unexpected hr %#x.\n", hr); + ok(hr == D3D_OK, "Got unexpected hr %#lx.\n", hr);
memset(&vb_desc, 0, sizeof(vb_desc)); vb_desc.dwSize = sizeof(vb_desc); vb_desc.dwFVF = fvf; vb_desc.dwNumVertices = ARRAY_SIZE(vertices); hr = IDirect3D7_CreateVertexBuffer(d3d, &vb_desc, &src_vb, 0); - ok(hr == D3D_OK, "Got unexpected hr %#x.\n", hr); + ok(hr == D3D_OK, "Got unexpected hr %#lx.\n", hr); hr = IDirect3DVertexBuffer7_Lock(src_vb, 0, (void **)&src_data, NULL); - ok(hr == D3D_OK, "Got unexpected hr %#x.\n", hr); + ok(hr == D3D_OK, "Got unexpected hr %#lx.\n", hr); memcpy(src_data, vertices, sizeof(vertices)); hr = IDirect3DVertexBuffer7_Unlock(src_vb); - ok(hr == D3D_OK, "Got unexpected hr %#x.\n", hr); + ok(hr == D3D_OK, "Got unexpected hr %#lx.\n", hr);
memset(&vb_desc, 0, sizeof(vb_desc)); vb_desc.dwSize = sizeof(vb_desc); vb_desc.dwFVF = D3DFVF_XYZRHW | D3DFVF_DIFFUSE | D3DFVF_SPECULAR; vb_desc.dwNumVertices = ARRAY_SIZE(vertices); hr = IDirect3D7_CreateVertexBuffer(d3d, &vb_desc, &dst_vb, 0); - 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 = IDirect3DDevice7_SetLight(device, 0, tests[i].light); - ok(hr == D3D_OK, "Got unexpected hr %#x.\n", hr); + ok(hr == D3D_OK, "Got unexpected hr %#lx.\n", hr);
hr = IDirect3DDevice7_SetRenderState(device, D3DRENDERSTATE_LOCALVIEWER, tests[i].local_viewer); - ok(hr == D3D_OK, "Got unexpected hr %#x.\n", hr); + ok(hr == D3D_OK, "Got unexpected hr %#lx.\n", hr);
memset(&material, 0, sizeof(material)); U1(U2(material).specular).r = 1.0f; @@ -5108,33 +5096,33 @@ static void test_specular_lighting(void) U4(U2(material).specular).a = 0.5f; U4(material).power = tests[i].specular_power; hr = IDirect3DDevice7_SetMaterial(device, &material); - ok(hr == D3D_OK, "Got unexpected hr %#x.\n", hr); + ok(hr == D3D_OK, "Got unexpected hr %#lx.\n", hr);
hr = IDirect3DDevice7_Clear(device, 0, NULL, D3DCLEAR_TARGET, 0xffffffff, 0.0, 0); - ok(hr == D3D_OK, "Got unexpected hr %#x.\n", hr); + ok(hr == D3D_OK, "Got unexpected hr %#lx.\n", hr);
hr = IDirect3DDevice7_BeginScene(device); - ok(hr == D3D_OK, "Got unexpected hr %#x.\n", hr); + ok(hr == D3D_OK, "Got unexpected hr %#lx.\n", hr);
hr = IDirect3DVertexBuffer7_Lock(dst_vb, 0, (void **)&dst_data, NULL); - ok(hr == D3D_OK, "Got unexpected hr %#x.\n", hr); + ok(hr == D3D_OK, "Got unexpected hr %#lx.\n", hr); memset(dst_data, 0, sizeof(*dst_data) * ARRAY_SIZE(vertices)); hr = IDirect3DVertexBuffer7_Unlock(dst_vb); - ok(hr == D3D_OK, "Got unexpected hr %#x.\n", hr); + ok(hr == D3D_OK, "Got unexpected hr %#lx.\n", hr);
hr = IDirect3DVertexBuffer7_ProcessVertices(dst_vb, D3DVOP_TRANSFORM | D3DVOP_LIGHT, 0, ARRAY_SIZE(vertices), src_vb, 0, device, 0); - ok(hr == D3D_OK, "Got unexpected hr %#x.\n", hr); + ok(hr == D3D_OK, "Got unexpected hr %#lx.\n", hr);
hr = IDirect3DDevice7_DrawIndexedPrimitive(device, D3DPT_TRIANGLELIST, fvf, quad, vertices_side * vertices_side, indices, indices_count, 0); - ok(hr == D3D_OK, "Got unexpected hr %#x.\n", hr); + ok(hr == D3D_OK, "Got unexpected hr %#lx.\n", hr);
hr = IDirect3DDevice7_EndScene(device); - ok(hr == D3D_OK, "Got unexpected hr %#x.\n", hr); + ok(hr == D3D_OK, "Got unexpected hr %#lx.\n", hr);
hr = IDirect3DVertexBuffer7_Lock(dst_vb, 0, (void **)&dst_data, NULL); - ok(hr == D3D_OK, "Got unexpected hr %#x.\n", hr); + ok(hr == D3D_OK, "Got unexpected hr %#lx.\n", hr);
ok(tests[i].expected_count == ARRAY_SIZE(vertices), "Array size mismatch.\n"); for (j = 0; j < tests[i].expected_count; ++j) @@ -5153,7 +5141,7 @@ static void test_specular_lighting(void) expected_color, j, dst_data[j].specular, i); } hr = IDirect3DVertexBuffer7_Unlock(dst_vb); - ok(hr == D3D_OK, "Got unexpected hr %#x.\n", hr); + ok(hr == D3D_OK, "Got unexpected hr %#lx.\n", hr); }
IDirect3DVertexBuffer7_Release(dst_vb); @@ -5162,7 +5150,7 @@ static void test_specular_lighting(void)
IDirect3D7_Release(d3d); refcount = IDirect3DDevice7_Release(device); - ok(!refcount, "Device has %u references left.\n", refcount); + ok(!refcount, "Device has %lu references left.\n", refcount); DestroyWindow(window); heap_free(indices); heap_free(quad); @@ -5172,7 +5160,7 @@ static void test_clear_rect_count(void) { IDirectDrawSurface7 *rt; IDirect3DDevice7 *device; - D3DCOLOR color; + unsigned int color; HWND window; HRESULT hr; D3DRECT rect = {{0}, {0}, {640}, {480}}; @@ -5186,21 +5174,21 @@ static void test_clear_rect_count(void) }
hr = IDirect3DDevice7_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 = IDirect3DDevice7_Clear(device, 0, NULL, D3DCLEAR_TARGET, 0x00ffffff, 1.0f, 0); - 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 = IDirect3DDevice7_Clear(device, 0, &rect, D3DCLEAR_TARGET, 0x00ff0000, 1.0f, 0); - 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(rt, 320, 240); ok(compare_color(color, 0x00ffffff, 1) || broken(compare_color(color, 0x00ff0000, 1)), "Clear with count = 0, rect != NULL has color %#08x.\n", color);
hr = IDirect3DDevice7_Clear(device, 0, NULL, D3DCLEAR_TARGET, 0x00ffffff, 1.0f, 0); - 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 = IDirect3DDevice7_Clear(device, 1, NULL, D3DCLEAR_TARGET, 0x0000ff00, 1.0f, 0); - 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(rt, 320, 240); ok(compare_color(color, 0x0000ff00, 1), @@ -5219,21 +5207,21 @@ static BOOL test_mode_restored(IDirectDraw7 *ddraw, HWND window) memset(&ddsd1, 0, sizeof(ddsd1)); ddsd1.dwSize = sizeof(ddsd1); hr = IDirectDraw7_GetDisplayMode(ddraw, &ddsd1); - ok(SUCCEEDED(hr), "GetDisplayMode failed, hr %#x.\n", hr); + ok(SUCCEEDED(hr), "GetDisplayMode failed, hr %#lx.\n", hr);
hr = IDirectDraw7_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 = IDirectDraw7_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 = IDirectDraw7_GetDisplayMode(ddraw, &ddsd2); - ok(SUCCEEDED(hr), "GetDisplayMode failed, hr %#x.\n", hr); + ok(SUCCEEDED(hr), "GetDisplayMode failed, hr %#lx.\n", hr); hr = IDirectDraw7_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; } @@ -5257,16 +5245,16 @@ static void test_coop_level_versions(void)
/* A failing ddraw1::SetCooperativeLevel call does not have an effect */ hr = IDirectDraw7_QueryInterface(ddraw7, &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(ddraw7, 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(ddraw7, window); ok(!restored, "Display mode restored after good ddraw1::SetCooperativeLevel call\n");
@@ -5276,10 +5264,10 @@ static void test_coop_level_versions(void) ddraw7 = create_ddraw(); ok(!!ddraw7, "Failed to create a ddraw object.\n"); hr = IDirectDraw7_QueryInterface(ddraw7, &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(ddraw7, window); ok(!restored, "Display mode restored after ddraw1::SetCooperativeLevel(SETFOCUSWINDOW) call\n");
@@ -5290,12 +5278,12 @@ static void test_coop_level_versions(void) ddraw7 = create_ddraw(); ok(!!ddraw7, "Failed to create a ddraw object.\n"); hr = IDirectDraw7_QueryInterface(ddraw7, &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(ddraw7, window); ok(!restored, "Display mode restored after good-bad ddraw1::SetCooperativeLevel() call sequence\n");
@@ -5306,14 +5294,14 @@ static void test_coop_level_versions(void) ddraw7 = create_ddraw(); ok(!!ddraw7, "Failed to create a ddraw object.\n"); hr = IDirectDraw7_QueryInterface(ddraw7, &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 = IDirectDraw7_SetCooperativeLevel(ddraw7, window, DDSCL_FULLSCREEN | DDSCL_EXCLUSIVE); - ok(SUCCEEDED(hr), "SetCooperativeLevel failed, hr %#x.\n", hr); + ok(SUCCEEDED(hr), "SetCooperativeLevel failed, hr %#lx.\n", hr); hr = IDirectDraw7_SetCooperativeLevel(ddraw7, 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(ddraw7, window); ok(!restored, "Display mode restored after ddraw1-ddraw7 SetCooperativeLevel() call sequence\n"); @@ -5324,10 +5312,10 @@ static void test_coop_level_versions(void) ddraw7 = create_ddraw(); ok(!!ddraw7, "Failed to create a ddraw object.\n"); hr = IDirectDraw7_QueryInterface(ddraw7, &IID_IDirectDraw, (void **)&ddraw); - ok(SUCCEEDED(hr), "QueryInterface failed, hr %#x.\n", hr); + ok(SUCCEEDED(hr), "QueryInterface failed, hr %#lx.\n", hr);
hr = IDirectDraw7_SetCooperativeLevel(ddraw7, 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); @@ -5335,7 +5323,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(ddraw7, window); ok(restored, "Display mode not restored after ddraw1::CreateSurface() call\n"); @@ -5362,7 +5350,7 @@ static void test_fog_special(void) static const struct { DWORD vertexmode, tablemode; - D3DCOLOR color_left, color_right; + unsigned int color_left, color_right; } tests[] = { @@ -5374,9 +5362,8 @@ static void test_fog_special(void) float f; DWORD d; } conv; - D3DCOLOR color; + unsigned int color, i; HRESULT hr; - unsigned int i; HWND window; IDirect3DDevice7 *device; IDirectDrawSurface7 *rt; @@ -5390,39 +5377,39 @@ static void test_fog_special(void) }
hr = IDirect3DDevice7_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 = IDirect3DDevice7_SetRenderState(device, D3DRENDERSTATE_FOGENABLE, TRUE); - ok(SUCCEEDED(hr), "Failed to enable fog, hr %#x.\n", hr); + ok(SUCCEEDED(hr), "Failed to enable fog, hr %#lx.\n", hr); hr = IDirect3DDevice7_SetRenderState(device, D3DRENDERSTATE_FOGCOLOR, 0xffff0000); - ok(SUCCEEDED(hr), "Failed to set fog color, hr %#x.\n", hr); + ok(SUCCEEDED(hr), "Failed to set fog color, hr %#lx.\n", hr); hr = IDirect3DDevice7_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 = IDirect3DDevice7_SetRenderState(device, D3DRENDERSTATE_ZENABLE, D3DZB_FALSE); - ok(SUCCEEDED(hr), "Failed to disable lighting, hr %#x.\n", hr); + ok(SUCCEEDED(hr), "Failed to disable lighting, hr %#lx.\n", hr);
conv.f = 0.5f; hr = IDirect3DDevice7_SetRenderState(device, D3DRENDERSTATE_FOGSTART, conv.d); - ok(SUCCEEDED(hr), "Failed to set fog start, hr %#x.\n", hr); + ok(SUCCEEDED(hr), "Failed to set fog start, hr %#lx.\n", hr); hr = IDirect3DDevice7_SetRenderState(device, D3DRENDERSTATE_FOGEND, conv.d); - ok(SUCCEEDED(hr), "Failed to set fog end, hr %#x.\n", hr); + ok(SUCCEEDED(hr), "Failed to set fog end, hr %#lx.\n", hr);
for (i = 0; i < ARRAY_SIZE(tests); ++i) { hr = IDirect3DDevice7_Clear(device, 0, NULL, D3DCLEAR_TARGET, 0x000000ff, 1.0f, 0); - 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 = IDirect3DDevice7_SetRenderState(device, D3DRENDERSTATE_FOGVERTEXMODE, tests[i].vertexmode); - ok(SUCCEEDED(hr), "Failed to set fogvertexmode, hr %#x.\n", hr); + ok(SUCCEEDED(hr), "Failed to set fogvertexmode, hr %#lx.\n", hr); hr = IDirect3DDevice7_SetRenderState(device, D3DRENDERSTATE_FOGTABLEMODE, tests[i].tablemode); - ok(SUCCEEDED(hr), "Failed to set fogtablemode, hr %#x.\n", hr); + ok(SUCCEEDED(hr), "Failed to set fogtablemode, hr %#lx.\n", hr);
hr = IDirect3DDevice7_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 = IDirect3DDevice7_DrawPrimitive(device, D3DPT_TRIANGLESTRIP, D3DFVF_XYZ | D3DFVF_DIFFUSE, quad, 4, 0); - ok(SUCCEEDED(hr), "Failed to draw, hr %#x.\n", hr); + ok(SUCCEEDED(hr), "Failed to draw, hr %#lx.\n", hr); hr = IDirect3DDevice7_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, 310, 240); ok(compare_color(color, tests[i].color_left, 1), @@ -5433,7 +5420,7 @@ static void test_fog_special(void) }
hr = IDirect3DDevice7_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);
IDirectDrawSurface7_Release(rt); IDirect3DDevice7_Release(device); @@ -5444,11 +5431,10 @@ static void test_lighting_interface_versions(void) { IDirect3DDevice7 *device; IDirectDrawSurface7 *rt; - D3DCOLOR color; + unsigned int color, i; HWND window; HRESULT hr; DWORD rs; - unsigned int i; ULONG ref; D3DMATERIAL7 material; static D3DVERTEX quad[] = @@ -5511,7 +5497,7 @@ static void test_lighting_interface_versions(void) void *data; DWORD d3drs_lighting, d3drs_specular; DWORD draw_flags; - D3DCOLOR color; + unsigned int color; } tests[] = { @@ -5583,44 +5569,44 @@ static void test_lighting_interface_versions(void) }
hr = IDirect3DDevice7_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(&material, 0, sizeof(material)); U2(U3(material).emissive).g = 1.0f; hr = IDirect3DDevice7_SetMaterial(device, &material); - ok(SUCCEEDED(hr), "Failed set material, hr %#x.\n", hr); + ok(SUCCEEDED(hr), "Failed set material, hr %#lx.\n", hr); hr = IDirect3DDevice7_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);
hr = IDirect3DDevice7_GetRenderState(device, D3DRENDERSTATE_LIGHTING, &rs); - ok(SUCCEEDED(hr), "Failed to get lighting render state, hr %#x.\n", hr); - ok(rs == TRUE, "Initial D3DRENDERSTATE_LIGHTING is %#x, expected TRUE.\n", rs); + ok(SUCCEEDED(hr), "Failed to get lighting render state, hr %#lx.\n", hr); + ok(rs == TRUE, "Initial D3DRENDERSTATE_LIGHTING is %#lx, expected TRUE.\n", rs); hr = IDirect3DDevice7_GetRenderState(device, D3DRENDERSTATE_SPECULARENABLE, &rs); - ok(SUCCEEDED(hr), "Failed to get specularenable render state, hr %#x.\n", hr); - ok(rs == FALSE, "Initial D3DRENDERSTATE_SPECULARENABLE is %#x, expected FALSE.\n", rs); + ok(SUCCEEDED(hr), "Failed to get specularenable render state, hr %#lx.\n", hr); + ok(rs == FALSE, "Initial D3DRENDERSTATE_SPECULARENABLE is %#lx, expected FALSE.\n", rs);
for (i = 0; i < ARRAY_SIZE(tests); ++i) { hr = IDirect3DDevice7_Clear(device, 0, NULL, D3DCLEAR_TARGET, 0xff202020, 0.0f, 0); - ok(SUCCEEDED(hr), "Failed to clear viewport, hr %#x.\n", hr); + ok(SUCCEEDED(hr), "Failed to clear viewport, hr %#lx.\n", hr);
hr = IDirect3DDevice7_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 = IDirect3DDevice7_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 = IDirect3DDevice7_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 = IDirect3DDevice7_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 = IDirect3DDevice7_EndScene(device); - ok(SUCCEEDED(hr), "Failed to end scene, hr %#x.\n", hr); + ok(SUCCEEDED(hr), "Failed to end scene, hr %#lx.\n", hr);
hr = IDirect3DDevice7_GetRenderState(device, D3DRENDERSTATE_LIGHTING, &rs); - ok(SUCCEEDED(hr), "Failed to get lighting render state, hr %#x.\n", hr); - ok(rs == tests[i].d3drs_lighting, "D3DRENDERSTATE_LIGHTING is %#x, expected %#x.\n", + ok(SUCCEEDED(hr), "Failed to get lighting render state, hr %#lx.\n", hr); + ok(rs == tests[i].d3drs_lighting, "D3DRENDERSTATE_LIGHTING is %#lx, expected %#lx.\n", rs, tests[i].d3drs_lighting);
color = get_surface_color(rt, 320, 240); @@ -5631,7 +5617,7 @@ static void test_lighting_interface_versions(void)
IDirectDrawSurface7_Release(rt); ref = IDirect3DDevice7_Release(device); - ok(ref == 0, "Device not properly released, refcount %u.\n", ref); + ok(!ref, "Unexpected refcount %lu.\n", ref); DestroyWindow(window); }
@@ -5653,7 +5639,7 @@ static LRESULT CALLBACK activateapp_test_proc(HWND hwnd, UINT message, WPARAM wp activateapp_testdata.received = FALSE; hr = IDirectDraw7_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; @@ -5685,31 +5671,31 @@ static void test_coop_level_activateapp(void) SetForegroundWindow(window); activateapp_testdata.received = FALSE; hr = IDirectDraw7_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 = IDirectDraw7_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 = IDirectDraw7_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 = IDirectDraw7_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 = IDirectDraw7_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 = IDirectDraw7_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 = IDirectDraw7_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()); @@ -5718,10 +5704,10 @@ static void test_coop_level_activateapp(void) activateapp_testdata.window = window; activateapp_testdata.coop_level = DDSCL_EXCLUSIVE | DDSCL_FULLSCREEN; hr = IDirectDraw7_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 = IDirectDraw7_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 @@ -5729,9 +5715,9 @@ static void test_coop_level_activateapp(void) * WM_ACTIVATEAPP messages. */ activateapp_testdata.ddraw = NULL; hr = IDirectDraw7_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 = IDirectDraw7_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()); @@ -5740,7 +5726,7 @@ static void test_coop_level_activateapp(void) activateapp_testdata.window = window; activateapp_testdata.coop_level = DDSCL_NORMAL; hr = IDirectDraw7_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. */ @@ -5750,15 +5736,15 @@ static void test_coop_level_activateapp(void) U5(ddsd).dwBackBufferCount = 1; ddsd.ddsCaps.dwCaps = DDSCAPS_PRIMARYSURFACE | DDSCAPS_COMPLEX | DDSCAPS_FLIP; hr = IDirectDraw7_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); IDirectDrawSurface7_Release(surface);
/* Recover again, just to be sure. */ activateapp_testdata.ddraw = NULL; hr = IDirectDraw7_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 = IDirectDraw7_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)); @@ -5820,14 +5806,14 @@ static void test_texturemanage(void) ddraw = create_ddraw(); ok(!!ddraw, "Failed to create a ddraw object.\n"); hr = IDirectDraw7_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(&hal_caps, 0, sizeof(hal_caps)); hal_caps.dwSize = sizeof(hal_caps); memset(&hel_caps, 0, sizeof(hel_caps)); hel_caps.dwSize = sizeof(hel_caps); hr = IDirectDraw7_GetCaps(ddraw, &hal_caps, &hel_caps); - 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("Managed textures not supported, skipping managed texture test.\n"); @@ -5847,22 +5833,22 @@ static void test_texturemanage(void)
hr = IDirectDraw7_CreateSurface(ddraw, &ddsd, &surface, NULL); if (tests[i].hr == DD_OK && is_ddraw64 && (tests[i].caps_in & DDSCAPS_TEXTURE)) - todo_wine ok(hr == E_NOINTERFACE, "Test %u: Got unexpected hr %#x.\n", i, hr); + todo_wine ok(hr == E_NOINTERFACE, "Test %u: Got unexpected hr %#lx.\n", i, hr); else - ok(hr == tests[i].hr, "Test %u: Got unexpected hr %#x, expected %#x.\n", i, hr, tests[i].hr); + ok(hr == tests[i].hr, "Test %u: Got unexpected hr %#lx, expected %#lx.\n", i, hr, tests[i].hr); if (FAILED(hr)) continue;
memset(&ddsd, 0, sizeof(ddsd)); ddsd.dwSize = sizeof(ddsd); hr = IDirectDrawSurface7_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);
ok(ddsd.ddsCaps.dwCaps == tests[i].caps_out, - "Input caps %#x, %#x, expected output caps %#x, got %#x, case %u.\n", + "Input caps %#lx, %#lx, expected output caps %#lx, got %#lx, case %u.\n", tests[i].caps_in, tests[i].caps2_in, tests[i].caps_out, ddsd.ddsCaps.dwCaps, i); ok(ddsd.ddsCaps.dwCaps2 == tests[i].caps2_out, - "Input caps %#x, %#x, expected output caps %#x, got %#x, case %u.\n", + "Input caps %#lx, %#lx, expected output caps %#lx, got %#lx, case %u.\n", tests[i].caps_in, tests[i].caps2_in, tests[i].caps2_out, ddsd.ddsCaps.dwCaps2, i);
IDirectDrawSurface7_Release(surface); @@ -6022,23 +6008,23 @@ static void test_block_formats_creation(void) }
hr = IDirect3DDevice7_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 = IDirect3D7_QueryInterface(d3d, &IID_IDirectDraw7, (void **) &ddraw); - ok(SUCCEEDED(hr), "Failed to get ddraw interface, hr %#x.\n", hr); + ok(SUCCEEDED(hr), "Failed to get ddraw interface, hr %#lx.\n", hr); IDirect3D7_Release(d3d);
hr = IDirect3DDevice7_EnumTextureFormats(device, test_block_formats_creation_cb, &supported_fmts); - ok(SUCCEEDED(hr), "Failed to enumerate texture formats %#x.\n", hr); + ok(SUCCEEDED(hr), "Got hr %#lx.\n", hr);
hr = IDirectDraw7_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 cleanup; hr = IDirectDraw7_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++) { for (j = 0; j < ARRAY_SIZE(formats); ++j) @@ -6052,7 +6038,7 @@ static void test_block_formats_creation(void) memset(&hal_caps, 0, sizeof(hal_caps)); hal_caps.dwSize = sizeof(hal_caps); hr = IDirectDraw7_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);
mem = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, 2 * 2 * 16 + 1);
@@ -6110,7 +6096,7 @@ static void test_block_formats_creation(void) hr = IDirectDraw7_CreateSurface(ddraw, &ddsd, &surface, NULL); todo_wine_if (todo) ok(hr == expect_hr, - "Got unexpected hr %#x for format %s, resource type %s, size %ux%u, expected %#x.\n", + "Got unexpected hr %#lx for format %s, resource type %s, size %ux%u, expected %#lx.\n", hr, formats[i].name, types[j].name, w, h, expect_hr);
if (SUCCEEDED(hr)) @@ -6153,7 +6139,7 @@ static void test_block_formats_creation(void) ddsd.dwHeight = 8;
hr = IDirectDraw7_CreateSurface(ddraw, &ddsd, &surface, NULL); - ok(hr == user_mem_tests[j].hr, "Test %u: Got unexpected hr %#x, format %s.\n", j, hr, formats[i].name); + ok(hr == user_mem_tests[j].hr, "Test %u: Got unexpected hr %#lx, format %s.\n", j, hr, formats[i].name);
if (FAILED(hr)) continue; @@ -6161,15 +6147,15 @@ static void test_block_formats_creation(void) memset(&ddsd, 0, sizeof(ddsd)); ddsd.dwSize = sizeof(ddsd); hr = IDirectDrawSurface7_GetSurfaceDesc(surface, &ddsd); - ok(SUCCEEDED(hr), "Test %u: Failed to get surface desc, hr %#x.\n", j, hr); + ok(SUCCEEDED(hr), "Test %u: Failed to get surface desc, hr %#lx.\n", j, hr); ok(ddsd.dwFlags == (DDSD_CAPS | DDSD_WIDTH | DDSD_HEIGHT | DDSD_PIXELFORMAT | DDSD_LINEARSIZE), - "Test %u: Got unexpected flags %#x.\n", j, ddsd.dwFlags); + "Test %u: Got unexpected flags %#lx.\n", j, ddsd.dwFlags); if (user_mem_tests[j].flags & DDSD_LPSURFACE) - ok(U1(ddsd).dwLinearSize == ~0u, "Test %u: Got unexpected linear size %#x.\n", + ok(U1(ddsd).dwLinearSize == ~0u, "Test %u: Got unexpected linear size %#lx.\n", j, U1(ddsd).dwLinearSize); else ok(U1(ddsd).dwLinearSize == 2 * 2 * formats[i].block_size, - "Test %u: Got unexpected linear size %#x, expected %#x.\n", + "Test %u: Got unexpected linear size %#lx, expected %#x.\n", j, U1(ddsd).dwLinearSize, 2 * 2 * formats[i].block_size); IDirectDrawSurface7_Release(surface); } @@ -6246,16 +6232,16 @@ static void test_unsupported_formats(void) }
hr = IDirect3DDevice7_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 = IDirect3D7_QueryInterface(d3d, &IID_IDirectDraw7, (void **) &ddraw); - ok(SUCCEEDED(hr), "Failed to get ddraw interface, hr %#x.\n", hr); + ok(SUCCEEDED(hr), "Failed to get ddraw interface, hr %#lx.\n", hr); IDirect3D7_Release(d3d);
for (i = 0; i < ARRAY_SIZE(formats); ++i) { struct format_support_check check = {&formats[i].fmt, FALSE}; hr = IDirect3DDevice7_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) { @@ -6274,7 +6260,7 @@ static void test_unsupported_formats(void)
hr = IDirectDraw7_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; @@ -6282,7 +6268,7 @@ static void test_unsupported_formats(void) memset(&ddsd, 0, sizeof(ddsd)); ddsd.dwSize = sizeof(ddsd); hr = IDirectDrawSurface7_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; @@ -6294,7 +6280,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]);
IDirectDrawSurface7_Release(surface); @@ -6520,7 +6506,7 @@ static void test_rt_caps(const GUID *device_guid) ddraw = create_ddraw(); ok(!!ddraw, "Failed to create a ddraw object.\n"); hr = IDirectDraw7_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 (FAILED(IDirectDraw7_QueryInterface(ddraw, &IID_IDirect3D7, (void **)&d3d))) { @@ -6539,12 +6525,12 @@ static void test_rt_caps(const GUID *device_guid)
memset(palette_entries, 0, sizeof(palette_entries)); hr = IDirectDraw7_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 = IDirectDraw7_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) { @@ -6576,14 +6562,14 @@ static void test_rt_caps(const GUID *device_guid) ok(hr == expected_hr || (software_device && (surface_desc.ddsCaps.dwCaps & (DDSCAPS_VIDEOMEMORY | DDSCAPS_ZBUFFER)) == (DDSCAPS_VIDEOMEMORY | DDSCAPS_ZBUFFER) && hr == DDERR_UNSUPPORTED) || broken(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;
memset(&surface_desc, 0, sizeof(surface_desc)); surface_desc.dwSize = sizeof(surface_desc); hr = IDirectDrawSurface7_GetSurfaceDesc(surface, &surface_desc); - 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);
if ((caps_in & DDSCAPS_SYSTEMMEMORY) || (test_data[i].caps2_in & (DDSCAPS2_D3DTEXTUREMANAGE | DDSCAPS2_TEXTUREMANAGE)) || !(hal_caps.ddsCaps.dwCaps & DDSCAPS_VIDEOMEMORY)) @@ -6595,34 +6581,34 @@ static void test_rt_caps(const GUID *device_guid) && surface_desc.ddsCaps.dwCaps == (caps_in | DDSCAPS_SYSTEMMEMORY)) || (software_device && test_data[i].pf == &z_fmt && 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);
ok(surface_desc.ddsCaps.dwCaps2 == test_data[i].caps2_in, - "Got unexpected caps2 %#x, expected %#x, test %u, software_device %u.\n", + "Got unexpected caps2 %#lx, expected %#lx, test %u, software_device %u.\n", surface_desc.ddsCaps.dwCaps2, test_data[i].caps2_in, i, software_device);
hr = IDirect3D7_CreateDevice(d3d, device_guid, surface, &device); 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 = IDirectDrawSurface7_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 = IDirect3D7_CreateDevice(d3d, device_guid, surface, &device); 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 if (software_device) todo_wine - ok(hr == E_FAIL, "Got unexpected hr %#x, test %u, software_device %u.\n", + ok(hr == E_FAIL, "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); } IDirectDrawSurface7_Release(surface); @@ -6634,10 +6620,10 @@ static void test_rt_caps(const GUID *device_guid) surface_desc.dwWidth = 640; surface_desc.dwHeight = 480; hr = IDirectDraw7_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 = IDirect3D7_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)); @@ -6653,12 +6639,12 @@ static void test_rt_caps(const GUID *device_guid) surface_desc.dwWidth = 640; surface_desc.dwHeight = 480; hr = IDirectDraw7_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 = IDirect3DDevice7_SetRenderTarget(device, rt, 0); ok(hr == test_data[i].set_rt_hr || (software_device && hr == DDERR_NOPALETTEATTACHED) || 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) expected_rt = rt; @@ -6666,24 +6652,24 @@ static void test_rt_caps(const GUID *device_guid) expected_rt = surface;
hr = IDirect3DDevice7_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);
IDirectDrawSurface7_Release(tmp); IDirectDrawSurface7_Release(rt); refcount = IDirect3DDevice7_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 = IDirectDrawSurface7_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); }
refcount = IDirectDrawPalette_Release(palette); - ok(!refcount, "Got unexpected refcount %u.\n", refcount); + ok(!refcount, "Got unexpected refcount %lu.\n", refcount); IDirect3D7_Release(d3d);
done: refcount = IDirectDraw7_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); }
@@ -6808,7 +6794,7 @@ static void test_primary_caps(void) for (i = 0; i < ARRAY_SIZE(test_data); ++i) { hr = IDirectDraw7_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); @@ -6818,23 +6804,23 @@ static void test_primary_caps(void) surface_desc.ddsCaps.dwCaps = test_data[i].caps_in; U5(surface_desc).dwBackBufferCount = test_data[i].back_buffer_count; hr = IDirectDraw7_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 = IDirectDrawSurface7_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);
IDirectDrawSurface7_Release(surface); }
refcount = IDirectDraw7_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); }
@@ -6963,7 +6949,7 @@ static void test_surface_lock(void) ddraw = create_ddraw(); ok(!!ddraw, "Failed to create a ddraw object.\n"); hr = IDirectDraw7_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 (FAILED(IDirectDraw7_QueryInterface(ddraw, &IID_IDirect3D7, (void **)&d3d))) { @@ -6972,7 +6958,7 @@ static void test_surface_lock(void) }
hr = IDirect3D7_EnumDevices(d3d, enum_devtype_cb, &hal_ok); - ok(SUCCEEDED(hr), "Failed to enumerate devices, hr %#x.\n", hr); + ok(SUCCEEDED(hr), "Failed to enumerate devices, hr %#lx.\n", hr); if (hal_ok) devtype = &IID_IDirect3DTnLHalDevice;
@@ -6991,12 +6977,12 @@ static void test_surface_lock(void) ddsd.dwHeight = 64; ddsd.ddsCaps.dwCaps = DDSCAPS_OFFSCREENPLAIN | DDSCAPS_3DDEVICE; hr = IDirectDraw7_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 = IDirect3D7_CreateDevice(d3d, devtype, surface, &device); - ok(SUCCEEDED(hr), "Failed to create device, hr %#x.\n", hr); + ok(SUCCEEDED(hr), "Failed to create device, hr %#lx.\n", hr); hr = IDirect3DDevice7_GetCaps(device, &device_desc); - ok(SUCCEEDED(hr), "Failed to get device caps, hr %#x.\n", hr); + ok(SUCCEEDED(hr), "Failed to get device caps, hr %#lx.\n", hr); cubemap_supported = !!(device_desc.dpcTriCaps.dwTextureCaps & D3DPTEXTURECAPS_CUBEMAP); IDirect3DDevice7_Release(device);
@@ -7025,30 +7011,30 @@ static void test_surface_lock(void) ddsd.ddsCaps.dwCaps2 = tests[i].caps2;
hr = IDirectDraw7_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 = IDirectDrawSurface7_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)) { - ok(ddsd.dwSize == sizeof(ddsd), "Got unexpected dwSize %u, type %s.\n", ddsd.dwSize, tests[i].name); + ok(ddsd.dwSize == sizeof(ddsd), "Got unexpected dwSize %lu, type %s.\n", ddsd.dwSize, tests[i].name); hr = IDirectDrawSurface7_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)); expected_hr = tests[i].caps & DDSCAPS_TEXTURE && !(tests[i].caps & DDSCAPS_VIDEOMEMORY) ? DD_OK : DDERR_INVALIDPARAMS; hr = IDirectDrawSurface7_Lock(surface, NULL, &ddsd, DDLOCK_WAIT, NULL); - ok(hr == expected_hr, "Got hr %#x, expected %#x, type %s.\n", hr, expected_hr, tests[i].name); + ok(hr == expected_hr, "Got hr %#lx, expected %#lx, type %s.\n", hr, expected_hr, tests[i].name); if (SUCCEEDED(hr)) { - ok(!ddsd.dwSize, "Got unexpected dwSize %u, type %s.\n", ddsd.dwSize, tests[i].name); + ok(!ddsd.dwSize, "Got unexpected dwSize %lu, type %s.\n", ddsd.dwSize, tests[i].name); ok(!!ddsd.lpSurface, "Got NULL lpSurface, type %s.\n", tests[i].name); hr = IDirectDrawSurface7_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); }
IDirectDrawSurface7_Release(surface); @@ -7058,7 +7044,7 @@ done: if (d3d) IDirect3D7_Release(d3d); refcount = IDirectDraw7_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); }
@@ -7110,11 +7096,11 @@ static void test_surface_discard(void) return; } hr = IDirect3DDevice7_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 = IDirect3D7_QueryInterface(d3d, &IID_IDirectDraw7, (void **)&ddraw); - ok(SUCCEEDED(hr), "Failed to get ddraw interface, hr %#x.\n", hr); + ok(SUCCEEDED(hr), "Failed to get ddraw interface, hr %#lx.\n", hr); hr = IDirect3DDevice7_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); @@ -7124,34 +7110,34 @@ static void test_surface_discard(void) ddsd.dwWidth = 64; ddsd.dwHeight = 64; hr = IDirectDraw7_CreateSurface(ddraw, &ddsd, &surface, NULL); - ok(SUCCEEDED(hr), "Failed to create offscreen surface, hr %#x, case %u.\n", hr, i); + ok(SUCCEEDED(hr), "Failed to create offscreen surface, hr %#lx, case %u.\n", hr, i);
memset(&ddsd, 0, sizeof(ddsd)); ddsd.dwSize = sizeof(ddsd); hr = IDirectDrawSurface7_Lock(surface, 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); addr = ddsd.lpSurface; hr = IDirectDrawSurface7_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 = IDirectDrawSurface7_Lock(surface, NULL, &ddsd, DDLOCK_DISCARDCONTENTS, 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 = IDirectDrawSurface7_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 = IDirectDrawSurface7_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 = IDirectDrawSurface7_Lock(surface, NULL, &ddsd, DDLOCK_DISCARDCONTENTS, 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 = IDirectDrawSurface7_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);
IDirectDrawSurface7_Release(surface);
@@ -7176,11 +7162,10 @@ static void test_flip(void) DDSURFACEDESC2 surface_desc; D3DDEVICEDESC7 device_desc; IDirect3DDevice7 *device; + unsigned int color, i; BOOL sysmem_primary; IDirectDraw7 *ddraw; DWORD expected_caps; - unsigned int i; - D3DCOLOR color; ULONG refcount; HWND window; HRESULT hr; @@ -7202,7 +7187,7 @@ static void test_flip(void) ok(!!ddraw, "Failed to create a ddraw object.\n");
hr = IDirectDraw7_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) { @@ -7225,95 +7210,95 @@ static void test_flip(void) surface_desc.dwHeight = 512; U5(surface_desc).dwBackBufferCount = 3; hr = IDirectDraw7_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 = IDirectDraw7_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 = IDirectDraw7_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 = IDirectDraw7_CreateSurface(ddraw, &surface_desc, &frontbuffer, NULL); if (is_ddraw64 && test_data[i].caps & DDSCAPS_TEXTURE) - todo_wine ok(hr == E_NOINTERFACE, "%s: Got unexpected hr %#x.\n", test_data[i].name, hr); + todo_wine ok(hr == E_NOINTERFACE, "%s: Got unexpected hr %#lx.\n", test_data[i].name, hr); else 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;
memset(&surface_desc, 0, sizeof(surface_desc)); surface_desc.dwSize = sizeof(surface_desc); hr = IDirectDrawSurface7_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 = IDirectDrawSurface7_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 = IDirectDrawSurface7_GetSurfaceDesc(backbuffer1, &surface_desc); - ok(SUCCEEDED(hr), "%s: Failed to get surface desc, hr %#x.\n", test_data[i].name, hr); - ok(!U5(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(!U5(surface_desc).dwBackBufferCount, "%s: Got unexpected back buffer count %lu.\n", test_data[i].name, U5(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 = IDirectDrawSurface7_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 = IDirectDrawSurface7_GetSurfaceDesc(backbuffer2, &surface_desc); - ok(SUCCEEDED(hr), "%s: Failed to get surface desc, hr %#x.\n", test_data[i].name, hr); - ok(!U5(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(!U5(surface_desc).dwBackBufferCount, "%s: Got unexpected back buffer count %lu.\n", test_data[i].name, U5(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 = IDirectDrawSurface7_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 = IDirectDrawSurface7_GetSurfaceDesc(backbuffer3, &surface_desc); - ok(SUCCEEDED(hr), "%s: Failed to get surface desc, hr %#x.\n", test_data[i].name, hr); - ok(!U5(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(!U5(surface_desc).dwBackBufferCount, "%s: Got unexpected back buffer count %lu.\n", test_data[i].name, U5(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 = IDirectDrawSurface7_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); IDirectDrawSurface7_Release(surface);
hr = IDirectDraw7_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 = IDirectDrawSurface7_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 = IDirectDrawSurface7_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 = IDirectDraw7_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 = IDirectDrawSurface7_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 = IDirectDraw7_RestoreAllSurfaces(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); @@ -7322,19 +7307,19 @@ static void test_flip(void) surface_desc.dwWidth = 640; surface_desc.dwHeight = 480; hr = IDirectDraw7_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 = IDirectDrawSurface7_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); IDirectDrawSurface7_Release(surface);
hr = IDirectDrawSurface7_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 = IDirectDrawSurface7_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 = IDirectDrawSurface7_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 = IDirectDrawSurface7_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. Do it ourselves as a workaround. Unlike ddraw1 @@ -7344,7 +7329,7 @@ static void test_flip(void) fill_surface(backbuffer3, 0xff0000ff);
hr = IDirectDrawSurface7_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. */ @@ -7355,7 +7340,7 @@ static void test_flip(void) fill_surface(backbuffer3, 0xffff0000);
hr = IDirectDrawSurface7_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); @@ -7364,7 +7349,7 @@ static void test_flip(void) fill_surface(backbuffer3, 0xff00ff00);
hr = IDirectDrawSurface7_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); @@ -7373,7 +7358,7 @@ static void test_flip(void) fill_surface(backbuffer3, 0xff0000ff);
hr = IDirectDrawSurface7_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); @@ -7382,7 +7367,7 @@ static void test_flip(void) fill_surface(backbuffer1, 0xffff0000);
hr = IDirectDrawSurface7_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); @@ -7391,7 +7376,7 @@ static void test_flip(void) fill_surface(backbuffer2, 0xff00ff00);
hr = IDirectDrawSurface7_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); @@ -7410,7 +7395,7 @@ static void test_flip(void) goto done; } hr = IDirect3DDevice7_GetCaps(device, &device_desc); - ok(SUCCEEDED(hr), "Failed to get device caps, hr %#x.\n", hr); + ok(SUCCEEDED(hr), "Failed to get device caps, hr %#lx.\n", hr); IDirect3DDevice7_Release(device); if (!(device_desc.dpcTriCaps.dwTextureCaps & D3DPTEXTURECAPS_CUBEMAP)) { @@ -7427,33 +7412,33 @@ static void test_flip(void) surface_desc.dwHeight = 128; U5(surface_desc).dwBackBufferCount = 3; hr = IDirectDraw7_CreateSurface(ddraw, &surface_desc, &frontbuffer, NULL); - ok(hr == DDERR_INVALIDCAPS, "Got unexpected hr %#x.\n", hr); + ok(hr == DDERR_INVALIDCAPS, "Got unexpected hr %#lx.\n", hr);
surface_desc.ddsCaps.dwCaps &= ~DDSCAPS_FLIP; surface_desc.dwFlags |= DDSD_BACKBUFFERCOUNT; hr = IDirectDraw7_CreateSurface(ddraw, &surface_desc, &frontbuffer, NULL); - ok(hr == DDERR_INVALIDPARAMS, "Got unexpected hr %#x.\n", hr); + ok(hr == DDERR_INVALIDPARAMS, "Got unexpected hr %#lx.\n", hr);
surface_desc.ddsCaps.dwCaps &= ~DDSCAPS_COMPLEX; surface_desc.ddsCaps.dwCaps |= DDSCAPS_FLIP; hr = IDirectDraw7_CreateSurface(ddraw, &surface_desc, &frontbuffer, NULL); - ok(hr == DDERR_INVALIDCAPS, "Got unexpected hr %#x.\n", hr); + ok(hr == DDERR_INVALIDCAPS, "Got unexpected hr %#lx.\n", hr);
surface_desc.ddsCaps.dwCaps |= DDSCAPS_COMPLEX; hr = IDirectDraw7_CreateSurface(ddraw, &surface_desc, &frontbuffer, NULL); - ok(hr == DDERR_INVALIDPARAMS, "Got unexpected hr %#x.\n", hr); + ok(hr == DDERR_INVALIDPARAMS, "Got unexpected hr %#lx.\n", hr);
U5(surface_desc).dwBackBufferCount = 1; hr = IDirectDraw7_CreateSurface(ddraw, &surface_desc, &frontbuffer, NULL); - ok(hr == DDERR_INVALIDPARAMS, "Got unexpected hr %#x.\n", hr); + ok(hr == DDERR_INVALIDPARAMS, "Got unexpected hr %#lx.\n", hr);
U5(surface_desc).dwBackBufferCount = 0; hr = IDirectDraw7_CreateSurface(ddraw, &surface_desc, &frontbuffer, NULL); - ok(hr == DDERR_INVALIDCAPS, "Got unexpected hr %#x.\n", hr); + ok(hr == DDERR_INVALIDCAPS, "Got unexpected hr %#lx.\n", hr);
done: refcount = IDirectDraw7_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); }
@@ -7492,7 +7477,7 @@ static void test_set_surface_desc(void) ddraw = create_ddraw(); ok(!!ddraw, "Failed to create a ddraw object.\n"); hr = IDirectDraw7_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; @@ -7507,131 +7492,131 @@ static void test_set_surface_desc(void) ddsd.ddsCaps.dwCaps = DDSCAPS_SYSTEMMEMORY | DDSCAPS_OFFSCREENPLAIN;
hr = IDirectDraw7_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);
reset_ddsd(&ddsd); ddsd.dwFlags = DDSD_LPSURFACE; ddsd.lpSurface = data; hr = IDirectDrawSurface7_SetSurfaceDesc(surface, &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 = IDirectDrawSurface7_SetSurfaceDesc(surface, &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 = IDirectDrawSurface7_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); ok(!(ddsd.dwFlags & DDSD_LPSURFACE), "DDSD_LPSURFACE is set.\n"); ok(ddsd.lpSurface == NULL, "lpSurface is %p, expected NULL.\n", ddsd.lpSurface);
hr = IDirectDrawSurface7_Lock(surface, 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 = IDirectDrawSurface7_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);
reset_ddsd(&ddsd); ddsd.dwFlags = DDSD_LPSURFACE; ddsd.lpSurface = data; hr = IDirectDrawSurface7_SetSurfaceDesc(surface, &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 = IDirectDrawSurface7_SetSurfaceDesc(surface, &ddsd, 0); - ok(hr == DDERR_INVALIDPARAMS, "Setting lpSurface=NULL returned %#x.\n", hr); + ok(hr == DDERR_INVALIDPARAMS, "Got hr %#lx.\n", hr);
hr = IDirectDrawSurface7_SetSurfaceDesc(surface, NULL, 0); - ok(hr == DDERR_INVALIDPARAMS, "SetSurfaceDesc with NULL desc returned %#x.\n", hr); + ok(hr == DDERR_INVALIDPARAMS, "Got hr %#lx.\n", hr);
hr = IDirectDrawSurface7_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); ok(ddsd.ddsCaps.dwCaps == (DDSCAPS_SYSTEMMEMORY | DDSCAPS_OFFSCREENPLAIN), - "Got unexpected caps %#x.\n", ddsd.ddsCaps.dwCaps); - ok(ddsd.ddsCaps.dwCaps2 == 0, "Got unexpected caps2 %#x.\n", 0); + "Got unexpected caps %#lx.\n", ddsd.ddsCaps.dwCaps); + ok(ddsd.ddsCaps.dwCaps2 == 0, "Got unexpected caps2 %#lx.\n", ddsd.ddsCaps.dwCaps2);
/* Setting the caps is an error. This also means the original description cannot be reapplied. */ hr = IDirectDrawSurface7_SetSurfaceDesc(surface, &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 = IDirectDrawSurface7_SetSurfaceDesc(surface, &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. Caps2 can be anything and is ignored too. */ ddsd.dwFlags = DDSD_CAPS | DDSD_LPSURFACE; ddsd.lpSurface = data; hr = IDirectDrawSurface7_SetSurfaceDesc(surface, &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 = IDirectDrawSurface7_SetSurfaceDesc(surface, &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; ddsd.ddsCaps.dwCaps2 = 0xdeadbeef; hr = IDirectDrawSurface7_SetSurfaceDesc(surface, &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 = IDirectDrawSurface7_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); ok(ddsd.ddsCaps.dwCaps == (DDSCAPS_SYSTEMMEMORY | DDSCAPS_OFFSCREENPLAIN), - "Got unexpected caps %#x.\n", ddsd.ddsCaps.dwCaps); - ok(ddsd.ddsCaps.dwCaps2 == 0, "Got unexpected caps2 %#x.\n", 0); + "Got unexpected caps %#lx.\n", ddsd.ddsCaps.dwCaps); + ok(ddsd.ddsCaps.dwCaps2 == 0, "Got unexpected caps2 %#lx.\n", ddsd.ddsCaps.dwCaps2);
/* 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 = IDirectDrawSurface7_SetSurfaceDesc(surface, &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 = IDirectDrawSurface7_SetSurfaceDesc(surface, &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 = IDirectDrawSurface7_SetSurfaceDesc(surface, &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 = IDirectDrawSurface7_GetSurfaceDesc(surface, &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 = IDirectDrawSurface7_SetSurfaceDesc(surface, &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 = IDirectDrawSurface7_SetSurfaceDesc(surface, &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 = IDirectDrawSurface7_SetSurfaceDesc(surface, &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 = IDirectDrawSurface7_SetSurfaceDesc(surface, &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 = IDirectDrawSurface7_SetSurfaceDesc(surface, &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 = IDirectDrawSurface7_GetSurfaceDesc(surface, &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. * @@ -7640,27 +7625,27 @@ static void test_set_surface_desc(void) U1(ddsd).lPitch = 4 * 4; ddsd.lpSurface = data; hr = IDirectDrawSurface7_SetSurfaceDesc(surface, &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 = IDirectDrawSurface7_SetSurfaceDesc(surface, &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 = IDirectDrawSurface7_SetSurfaceDesc(surface, &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 = IDirectDrawSurface7_SetSurfaceDesc(surface, &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 = IDirectDrawSurface7_SetSurfaceDesc(surface, &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 = IDirectDrawSurface7_SetSurfaceDesc(surface, &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; @@ -7668,13 +7653,13 @@ static void test_set_surface_desc(void) ddsd.dwWidth = 16; ddsd.lpSurface = data; hr = IDirectDrawSurface7_SetSurfaceDesc(surface, &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 = IDirectDrawSurface7_SetSurfaceDesc(surface, &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; @@ -7685,11 +7670,11 @@ static void test_set_surface_desc(void) U3(U4(ddsd).ddpfPixelFormat).dwGBitMask = 0x0000ff00; U4(U4(ddsd).ddpfPixelFormat).dwBBitMask = 0x000000ff; hr = IDirectDrawSurface7_SetSurfaceDesc(surface, &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 = IDirectDrawSurface7_SetSurfaceDesc(surface, &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); @@ -7697,12 +7682,12 @@ static void test_set_surface_desc(void) ddsd.ddckCKSrcBlt.dwColorSpaceLowValue = 0x00ff0000; ddsd.ddckCKSrcBlt.dwColorSpaceHighValue = 0x00ff0000; hr = IDirectDrawSurface7_SetSurfaceDesc(surface, &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 = IDirectDrawSurface7_SetSurfaceDesc(surface, &ddsd, 0); - ok(hr == DDERR_INVALIDPARAMS, "Setting ddckCKSrcBlt returned %#x.\n", hr); + ok(hr == DDERR_INVALIDPARAMS, "Got hr %#lx.\n", hr);
IDirectDrawSurface7_Release(surface);
@@ -7715,7 +7700,7 @@ static void test_set_surface_desc(void) ddsd.ddsCaps.dwCaps = DDSCAPS_TEXTURE | DDSCAPS_VIDEOMEMORY | DDSCAPS_COMPLEX | DDSCAPS_MIPMAP;
hr = IDirectDraw7_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)) { @@ -7726,13 +7711,13 @@ static void test_set_surface_desc(void) /* Changing surface desc for mipmap fails even without changing any * parameters. */ hr = IDirectDrawSurface7_SetSurfaceDesc(surface, &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 = IDirectDrawSurface7_SetSurfaceDesc(surface, &ddsd, 0); - ok(hr == DDERR_INVALIDSURFACETYPE, "Got unexpected hr %#x.\n", hr); + ok(hr == DDERR_INVALIDSURFACETYPE, "Got unexpected hr %#lx.\n", hr); IDirectDrawSurface7_Release(surface); }
@@ -7745,7 +7730,7 @@ static void test_set_surface_desc(void) ddsd.ddsCaps.dwCaps = DDSCAPS_TEXTURE | DDSCAPS_SYSTEMMEMORY | DDSCAPS_COMPLEX | DDSCAPS_MIPMAP;
hr = IDirectDraw7_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) { @@ -7754,14 +7739,14 @@ static void test_set_surface_desc(void) IDirectDrawSurface7 *surface2;
hr = IDirectDrawSurface7_GetAttachedSurface(surface, &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 = IDirectDrawSurface7_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);
hr = IDirectDrawSurface7_Lock(surface2, NULL, &ddsd, 0, NULL); - ok(hr == DD_OK, "Got unexpected hr %#x.\n", hr); + ok(hr == DD_OK, "Got unexpected hr %#lx.\n", hr); surface2_system_mem = ddsd.lpSurface; IDirectDrawSurface7_Unlock(surface2, NULL);
@@ -7772,7 +7757,7 @@ static void test_set_surface_desc(void) U1(ddsd).lPitch = 16 * 4; ddsd.lpSurface = data; hr = IDirectDrawSurface7_SetSurfaceDesc(surface, &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; @@ -7781,11 +7766,11 @@ static void test_set_surface_desc(void) U1(ddsd).lPitch = 8 * 4; ddsd.lpSurface = data; hr = IDirectDrawSurface7_SetSurfaceDesc(surface, &ddsd, 0); - ok(hr == DD_OK, "Got unexpected hr %#x.\n", hr); + ok(hr == DD_OK, "Got unexpected hr %#lx.\n", hr);
reset_ddsd(&ddsd); hr = IDirectDrawSurface7_Lock(surface2, NULL, &ddsd, 0, NULL); - ok(hr == DD_OK, "Got unexpected hr %#x.\n", hr); + ok(hr == DD_OK, "Got unexpected hr %#lx.\n", hr); ok(ddsd.lpSurface == surface2_system_mem, "Got unexpected lpSurface %p.\n", ddsd.lpSurface); IDirectDrawSurface7_Unlock(surface2, NULL);
@@ -7796,11 +7781,11 @@ static void test_set_surface_desc(void) U1(ddsd).lPitch = 4 * 4; ddsd.lpSurface = data; hr = IDirectDrawSurface7_SetSurfaceDesc(surface2, &ddsd, 0); - ok(hr == DD_OK, "Got unexpected hr %#x.\n", hr); + ok(hr == DD_OK, "Got unexpected hr %#lx.\n", hr);
reset_ddsd(&ddsd); hr = IDirectDrawSurface7_Lock(surface2, NULL, &ddsd, 0, NULL); - ok(hr == DD_OK, "Got unexpected hr %#x.\n", hr); + ok(hr == DD_OK, "Got unexpected hr %#lx.\n", hr); ok(ddsd.lpSurface == data, "Got unexpected lpSurface %p.\n", ddsd.lpSurface); IDirectDrawSurface7_Unlock(surface2, NULL);
@@ -7811,7 +7796,7 @@ static void test_set_surface_desc(void) U1(ddsd).lPitch = 16 * 4; ddsd.lpSurface = data; hr = IDirectDrawSurface7_SetSurfaceDesc(surface2, &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);
IDirectDrawSurface7_Release(surface2); IDirectDrawSurface7_Release(surface); @@ -7826,10 +7811,10 @@ static void test_set_surface_desc(void) U1(ddsd).lPitch = 8 * 4; ddsd.ddsCaps.dwCaps = DDSCAPS_SYSTEMMEMORY | DDSCAPS_OFFSCREENPLAIN; hr = IDirectDraw7_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 = IDirectDrawSurface7_SetSurfaceDesc(surface, &ddsd, 0); - ok(hr == DDERR_INVALIDCAPS, "Got unexpected hr %#x.\n", hr); + ok(hr == DDERR_INVALIDCAPS, "Got unexpected hr %#lx.\n", hr);
reset_ddsd(&ddsd); ddsd.dwFlags = DDSD_WIDTH | DDSD_HEIGHT; @@ -7837,7 +7822,7 @@ static void test_set_surface_desc(void) ddsd.dwHeight = 8; /* Cannot reset lpSurface. */ hr = IDirectDrawSurface7_SetSurfaceDesc(surface, &ddsd, 0); - ok(hr == DDERR_INVALIDPARAMS, "Got unexpected hr %#x.\n", hr); + ok(hr == DDERR_INVALIDPARAMS, "Got unexpected hr %#lx.\n", hr);
reset_ddsd(&ddsd); ddsd.dwFlags = DDSD_WIDTH | DDSD_HEIGHT | DDSD_LPSURFACE | DDSD_PITCH; @@ -7847,7 +7832,7 @@ static void test_set_surface_desc(void) U1(ddsd).lPitch = 8 * 4; /* Can change the parameters of surface created with DDSD_LPSURFACE. */ hr = IDirectDrawSurface7_SetSurfaceDesc(surface, &ddsd, 0); - ok(hr == DD_OK, "Got unexpected hr %#x.\n", hr); + ok(hr == DD_OK, "Got unexpected hr %#lx.\n", hr);
IDirectDrawSurface7_Release(surface);
@@ -7876,9 +7861,9 @@ static void test_set_surface_desc(void)
hr = IDirectDraw7_CreateSurface(ddraw, &ddsd, &surface, NULL); if (is_ddraw64 && (invalid_caps_tests[i].caps & DDSCAPS_TEXTURE)) - todo_wine ok(hr == E_NOINTERFACE, "Test %u: Got unexpected hr %#x.\n", i, hr); + todo_wine ok(hr == E_NOINTERFACE, "Test %u: Got unexpected hr %#lx.\n", i, hr); else - ok(hr == DD_OK || hr == DDERR_NODIRECTDRAWHW, "Test %u: Got unexpected hr %#x.\n", i, hr); + ok(hr == DD_OK || hr == DDERR_NODIRECTDRAWHW, "Test %u: Got unexpected hr %#lx.\n", i, hr); if (FAILED(hr)) continue;
@@ -7888,17 +7873,17 @@ static void test_set_surface_desc(void) hr = IDirectDrawSurface7_SetSurfaceDesc(surface, &ddsd, 0); if (invalid_caps_tests[i].supported) { - ok(SUCCEEDED(hr), "Failed to set surface desc, hr %#x.\n", hr); + ok(SUCCEEDED(hr), "Failed to set surface desc, 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 = IDirectDrawSurface7_SetSurfaceDesc(surface, &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); }
@@ -7906,30 +7891,29 @@ static void test_set_surface_desc(void) }
ref = IDirectDraw7_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; IDirectDraw7 *ddraw; HWND window; HRESULT hr; DDSURFACEDESC2 ddsd; IDirectDrawSurface7 *surface; - DWORD data[16][16]; HGDIOBJ *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 = IDirectDraw7_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; @@ -7943,17 +7927,17 @@ static void test_user_memory_getdc(void) U4(U4(ddsd).ddpfPixelFormat).dwBBitMask = 0x000000ff; ddsd.ddsCaps.dwCaps = DDSCAPS_SYSTEMMEMORY | DDSCAPS_OFFSCREENPLAIN; hr = IDirectDraw7_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);
memset(data, 0xaa, sizeof(data)); reset_ddsd(&ddsd); ddsd.dwFlags = DDSD_LPSURFACE; ddsd.lpSurface = data; hr = IDirectDrawSurface7_SetSurfaceDesc(surface, &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 = IDirectDrawSurface7_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); bitmap = GetCurrentObject(dc, OBJ_BITMAP); ok(!!bitmap, "Failed to get bitmap.\n"); size = GetObjectA(bitmap, sizeof(dib), &dib); @@ -7962,7 +7946,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 = IDirectDrawSurface7_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);
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]); @@ -7973,15 +7957,15 @@ static void test_user_memory_getdc(void) ddsd.dwHeight = 8; U1(ddsd).lPitch = sizeof(*data); hr = IDirectDrawSurface7_SetSurfaceDesc(surface, &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 = IDirectDrawSurface7_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); BitBlt(dc, 0, 0, 4, 8, NULL, 0, 0, BLACKNESS); BitBlt(dc, 1, 1, 2, 2, NULL, 0, 0, WHITENESS); hr = IDirectDrawSurface7_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);
for (y = 0; y < 4; y++) { @@ -8006,7 +7990,7 @@ static void test_user_memory_getdc(void)
IDirectDrawSurface7_Release(surface); ref = IDirectDraw7_Release(ddraw); - ok(ref == 0, "Ddraw object not properly released, refcount %u.\n", ref); + ok(!ref, "Unexpected refcount %lu.\n", ref); DestroyWindow(window); }
@@ -8023,7 +8007,7 @@ static void test_sysmem_overlay(void) ddraw = create_ddraw(); ok(!!ddraw, "Failed to create a ddraw object.\n"); hr = IDirectDraw7_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; @@ -8037,10 +8021,10 @@ static void test_sysmem_overlay(void) U3(U4(ddsd).ddpfPixelFormat).dwGBitMask = 0x0000ff00; U4(U4(ddsd).ddpfPixelFormat).dwBBitMask = 0x000000ff; hr = IDirectDraw7_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 = IDirectDraw7_Release(ddraw); - ok(ref == 0, "Ddraw object not properly released, refcount %u.\n", ref); + ok(!ref, "Unexpected refcount %lu.\n", ref); DestroyWindow(window); }
@@ -8068,7 +8052,7 @@ static void test_primary_palette(void) return; } hr = IDirectDraw7_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); @@ -8076,22 +8060,22 @@ static void test_primary_palette(void) surface_desc.ddsCaps.dwCaps = DDSCAPS_PRIMARYSURFACE | DDSCAPS_COMPLEX | DDSCAPS_FLIP; U5(surface_desc).dwBackBufferCount = 1; hr = IDirectDraw7_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 = IDirectDrawSurface7_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 = IDirectDraw7_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 = IDirectDrawSurface7_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 @@ -8104,99 +8088,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 = IDirectDraw7_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 = IDirectDrawSurface7_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 = IDirectDrawSurface7_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 = IDirectDrawSurface7_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 = IDirectDrawSurface7_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 = IDirectDrawSurface7_GetPalette(primary, &tmp); - ok(hr == DDERR_NOPALETTEATTACHED, "Got unexpected hr %#x.\n", hr); + ok(hr == DDERR_NOPALETTEATTACHED, "Got unexpected hr %#lx.\n", hr);
hr = IDirectDrawSurface7_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 = IDirectDrawSurface7_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(U4(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(U4(surface_desc).ddpfPixelFormat).dwRGBBitCount == 8, "Got unexpected bit count %lu.\n", U1(U4(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 = IDirectDrawSurface7_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(U4(surface_desc).ddpfPixelFormat).dwRGBBitCount == 32 || U1(U4(surface_desc).ddpfPixelFormat).dwRGBBitCount == 24, - "Got unexpected bit count %u.\n", U1(U4(surface_desc).ddpfPixelFormat).dwRGBBitCount); + "Got unexpected bit count %lu.\n", U1(U4(surface_desc).ddpfPixelFormat).dwRGBBitCount);
hr = IDirectDrawSurface7_IsLost(primary); - ok(hr == DDERR_SURFACELOST, "Got unexpected hr %#x.\n", hr); + ok(hr == DDERR_SURFACELOST, "Got unexpected hr %#lx.\n", hr); hr = IDirectDrawSurface7_Restore(primary); - ok(hr == DDERR_WRONGMODE, "Got unexpected hr %#x.\n", hr); + ok(hr == DDERR_WRONGMODE, "Got unexpected hr %#lx.\n", hr); hr = IDirectDrawSurface7_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 = IDirectDrawSurface7_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(U4(surface_desc).ddpfPixelFormat).dwRGBBitCount == 32 || U1(U4(surface_desc).ddpfPixelFormat).dwRGBBitCount == 24, - "Got unexpected bit count %u.\n", U1(U4(surface_desc).ddpfPixelFormat).dwRGBBitCount); + "Got unexpected bit count %lu.\n", U1(U4(surface_desc).ddpfPixelFormat).dwRGBBitCount);
done: refcount = IDirectDrawSurface7_Release(backbuffer); - ok(refcount == 1, "Got unexpected refcount %u.\n", refcount); + ok(refcount == 1, "Got unexpected refcount %lu.\n", refcount); refcount = IDirectDrawSurface7_Release(primary); - ok(!refcount, "Got unexpected refcount %u.\n", refcount); + ok(!refcount, "Got unexpected refcount %lu.\n", refcount); refcount = IDirectDraw7_Release(ddraw); - ok(!refcount, "Got unexpected refcount %u.\n", refcount); + ok(!refcount, "Got unexpected refcount %lu.\n", refcount); DestroyWindow(window); }
@@ -8226,7 +8210,7 @@ static void test_surface_attachment(void) ddraw = create_ddraw(); ok(!!ddraw, "Failed to create a ddraw object.\n"); hr = IDirectDraw7_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); @@ -8244,11 +8228,11 @@ static void test_surface_attachment(void) }
hr = IDirectDrawSurface7_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 = IDirectDrawSurface7_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 = IDirectDrawSurface7_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; IDirectDrawSurface7_EnumAttachedSurfaces(surface1, &surface_count, surface_counter); @@ -8267,20 +8251,20 @@ static void test_surface_attachment(void) surface_desc.dwWidth = 16; surface_desc.dwHeight = 16; hr = IDirectDraw7_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 = IDirectDrawSurface7_AddAttachedSurface(surface1, surface4); - ok(hr == DDERR_CANNOTATTACHSURFACE, "Got unexpected hr %#x.\n", hr); + ok(hr == DDERR_CANNOTATTACHSURFACE, "Got unexpected hr %#lx.\n", hr); hr = IDirectDrawSurface7_AddAttachedSurface(surface4, surface1); - ok(hr == DDERR_CANNOTATTACHSURFACE, "Got unexpected hr %#x.\n", hr); + ok(hr == DDERR_CANNOTATTACHSURFACE, "Got unexpected hr %#lx.\n", hr); hr = IDirectDrawSurface7_AddAttachedSurface(surface3, surface4); - ok(hr == DDERR_CANNOTATTACHSURFACE, "Got unexpected hr %#x.\n", hr); + ok(hr == DDERR_CANNOTATTACHSURFACE, "Got unexpected hr %#lx.\n", hr); hr = IDirectDrawSurface7_AddAttachedSurface(surface4, surface3); - ok(hr == DDERR_CANNOTATTACHSURFACE, "Got unexpected hr %#x.\n", hr); + ok(hr == DDERR_CANNOTATTACHSURFACE, "Got unexpected hr %#lx.\n", hr); hr = IDirectDrawSurface7_AddAttachedSurface(surface2, surface4); - ok(hr == DDERR_CANNOTATTACHSURFACE, "Got unexpected hr %#x.\n", hr); + ok(hr == DDERR_CANNOTATTACHSURFACE, "Got unexpected hr %#lx.\n", hr); hr = IDirectDrawSurface7_AddAttachedSurface(surface4, surface2); - ok(hr == DDERR_CANNOTATTACHSURFACE, "Got unexpected hr %#x.\n", hr); + ok(hr == DDERR_CANNOTATTACHSURFACE, "Got unexpected hr %#lx.\n", hr);
IDirectDrawSurface7_Release(surface4);
@@ -8291,20 +8275,20 @@ static void test_surface_attachment(void) surface_desc.dwWidth = 16; surface_desc.dwHeight = 16; hr = IDirectDraw7_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 = IDirectDrawSurface7_AddAttachedSurface(surface1, surface4); - ok(hr == DDERR_CANNOTATTACHSURFACE, "Got unexpected hr %#x.\n", hr); + ok(hr == DDERR_CANNOTATTACHSURFACE, "Got unexpected hr %#lx.\n", hr); hr = IDirectDrawSurface7_AddAttachedSurface(surface4, surface1); - ok(hr == DDERR_CANNOTATTACHSURFACE, "Got unexpected hr %#x.\n", hr); + ok(hr == DDERR_CANNOTATTACHSURFACE, "Got unexpected hr %#lx.\n", hr); hr = IDirectDrawSurface7_AddAttachedSurface(surface3, surface4); - ok(hr == DDERR_CANNOTATTACHSURFACE, "Got unexpected hr %#x.\n", hr); + ok(hr == DDERR_CANNOTATTACHSURFACE, "Got unexpected hr %#lx.\n", hr); hr = IDirectDrawSurface7_AddAttachedSurface(surface4, surface3); - ok(hr == DDERR_CANNOTATTACHSURFACE, "Got unexpected hr %#x.\n", hr); + ok(hr == DDERR_CANNOTATTACHSURFACE, "Got unexpected hr %#lx.\n", hr); hr = IDirectDrawSurface7_AddAttachedSurface(surface2, surface4); - ok(hr == DDERR_CANNOTATTACHSURFACE, "Got unexpected hr %#x.\n", hr); + ok(hr == DDERR_CANNOTATTACHSURFACE, "Got unexpected hr %#lx.\n", hr); hr = IDirectDrawSurface7_AddAttachedSurface(surface4, surface2); - ok(hr == DDERR_CANNOTATTACHSURFACE, "Got unexpected hr %#x.\n", hr); + ok(hr == DDERR_CANNOTATTACHSURFACE, "Got unexpected hr %#lx.\n", hr);
IDirectDrawSurface7_Release(surface4); IDirectDrawSurface7_Release(surface3); @@ -8312,7 +8296,7 @@ static void test_surface_attachment(void) IDirectDrawSurface7_Release(surface1);
hr = IDirectDraw7_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)); @@ -8320,7 +8304,7 @@ static void test_surface_attachment(void) surface_desc.dwFlags = DDSD_CAPS; surface_desc.ddsCaps.dwCaps = DDSCAPS_PRIMARYSURFACE; hr = IDirectDraw7_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); @@ -8329,7 +8313,7 @@ static void test_surface_attachment(void) surface_desc.dwWidth = registry_mode.dmPelsWidth; surface_desc.dwHeight = registry_mode.dmPelsHeight; hr = IDirectDraw7_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); @@ -8338,7 +8322,7 @@ static void test_surface_attachment(void) surface_desc.dwWidth = registry_mode.dmPelsWidth; surface_desc.dwHeight = registry_mode.dmPelsHeight; hr = IDirectDraw7_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)); @@ -8348,18 +8332,18 @@ static void test_surface_attachment(void) surface_desc.dwWidth = 128; surface_desc.dwHeight = 128; hr = IDirectDraw7_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 = IDirectDrawSurface7_AddAttachedSurface(surface1, surface2); - ok(hr == DDERR_CANNOTATTACHSURFACE, "Got unexpected hr %#x.\n", hr); + ok(hr == DDERR_CANNOTATTACHSURFACE, "Got unexpected hr %#lx.\n", hr); hr = IDirectDrawSurface7_AddAttachedSurface(surface2, surface1); - ok(hr == DDERR_CANNOTATTACHSURFACE, "Got unexpected hr %#x.\n", hr); + ok(hr == DDERR_CANNOTATTACHSURFACE, "Got unexpected hr %#lx.\n", hr); hr = IDirectDrawSurface7_AddAttachedSurface(surface2, surface3); - ok(hr == DDERR_CANNOTATTACHSURFACE, "Got unexpected hr %#x.\n", hr); + ok(hr == DDERR_CANNOTATTACHSURFACE, "Got unexpected hr %#lx.\n", hr); hr = IDirectDrawSurface7_AddAttachedSurface(surface1, surface4); - ok(hr == DDERR_CANNOTATTACHSURFACE, "Got unexpected hr %#x.\n", hr); + ok(hr == DDERR_CANNOTATTACHSURFACE, "Got unexpected hr %#lx.\n", hr); hr = IDirectDrawSurface7_AddAttachedSurface(surface4, surface1); - ok(hr == DDERR_CANNOTATTACHSURFACE, "Got unexpected hr %#x.\n", hr); + ok(hr == DDERR_CANNOTATTACHSURFACE, "Got unexpected hr %#lx.\n", hr);
IDirectDrawSurface7_Release(surface4); IDirectDrawSurface7_Release(surface3); @@ -8374,7 +8358,7 @@ static void test_surface_attachment(void) surface_desc.dwWidth = 64; surface_desc.dwHeight = 64; hr = IDirectDraw7_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); @@ -8387,26 +8371,26 @@ static void test_surface_attachment(void) surface_desc.dwWidth = 32; surface_desc.dwHeight = 32; hr = IDirectDraw7_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 = IDirectDraw7_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 = IDirectDraw7_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)) IDirectDrawSurface7_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 = IDirectDrawSurface7_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);
IDirectDrawSurface7_Release(surface4); IDirectDrawSurface7_Release(surface3); @@ -8427,72 +8411,72 @@ static void test_surface_attachment(void) U3(U4(surface_desc).ddpfPixelFormat).dwGBitMask = 0x07e0; U4(U4(surface_desc).ddpfPixelFormat).dwBBitMask = 0x001f; hr = IDirectDraw7_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 = IDirectDraw7_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; U4(surface_desc).ddpfPixelFormat.dwFlags = DDPF_ZBUFFER; U1(U4(surface_desc).ddpfPixelFormat).dwZBufferBitDepth = 16; U3(U4(surface_desc).ddpfPixelFormat).dwZBitMask = 0x0000ffff; hr = IDirectDraw7_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 = IDirectDrawSurface7_QueryInterface(surface1, &IID_IDirectDrawSurface, (void **)&surface1v1); - ok(SUCCEEDED(hr), "Failed to get interface, hr %#x.\n", hr); + ok(SUCCEEDED(hr), "Failed to get interface, hr %#lx.\n", hr); hr = IDirectDrawSurface7_QueryInterface(surface2, &IID_IDirectDrawSurface, (void **)&surface2v1); - ok(SUCCEEDED(hr), "Failed to get interface, hr %#x.\n", hr); + ok(SUCCEEDED(hr), "Failed to get interface, hr %#lx.\n", hr);
hr = IDirectDrawSurface7_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 = get_refcount((IUnknown *)surface2v1); - ok(refcount == 1, "Got unexpected refcount %u.\n", refcount); + ok(refcount == 1, "Got unexpected refcount %lu.\n", refcount); hr = IDirectDrawSurface7_AddAttachedSurface(surface1, surface2); - ok(hr == DDERR_SURFACEALREADYATTACHED, "Got unexpected hr %#x.\n", hr); + ok(hr == DDERR_SURFACEALREADYATTACHED, "Got unexpected hr %#lx.\n", hr); hr = IDirectDrawSurface_AddAttachedSurface(surface1v1, surface2v1); - todo_wine ok(hr == DDERR_CANNOTATTACHSURFACE, "Got unexpected hr %#x.\n", hr); + todo_wine ok(hr == DDERR_CANNOTATTACHSURFACE, "Got unexpected hr %#lx.\n", hr); hr = IDirectDrawSurface_DeleteAttachedSurface(surface1v1, 0, surface2v1); - ok(hr == DDERR_SURFACENOTATTACHED, "Got unexpected hr %#x.\n", hr); + ok(hr == DDERR_SURFACENOTATTACHED, "Got unexpected hr %#lx.\n", hr);
/* Attaching while already attached to other surface. */ hr = IDirectDrawSurface7_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 = IDirectDrawSurface7_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); IDirectDrawSurface7_Release(surface3);
hr = IDirectDrawSurface7_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); refcount = get_refcount((IUnknown *)surface2v1); - ok(refcount == 1, "Got unexpected refcount %u.\n", refcount); + ok(refcount == 1, "Got unexpected refcount %lu.\n", refcount);
/* DeleteAttachedSurface() when attaching via IDirectDrawSurface. */ hr = IDirectDrawSurface_AddAttachedSurface(surface1v1, surface2v1); - ok(SUCCEEDED(hr), "Failed to attach surface, hr %#x.\n", hr); + ok(SUCCEEDED(hr), "Failed to attach surface, hr %#lx.\n", hr); hr = IDirectDrawSurface7_DeleteAttachedSurface(surface1, 0, surface2); - ok(hr == DDERR_SURFACENOTATTACHED, "Got unexpected hr %#x.\n", hr); + ok(hr == DDERR_SURFACENOTATTACHED, "Got unexpected hr %#lx.\n", hr); hr = IDirectDrawSurface_DeleteAttachedSurface(surface1v1, 0, surface2v1); - ok(SUCCEEDED(hr), "Failed to detach surface, hr %#x.\n", hr); + ok(SUCCEEDED(hr), "Failed to detach surface, hr %#lx.\n", hr); refcount = IDirectDrawSurface7_Release(surface2); - ok(!refcount, "Got unexpected refcount %u.\n", refcount); + ok(!refcount, "Got unexpected refcount %lu.\n", refcount); refcount = IDirectDrawSurface7_Release(surface1); - ok(!refcount, "Got unexpected refcount %u.\n", refcount); + ok(!refcount, "Got unexpected refcount %lu.\n", refcount);
/* Automatic detachment on release. */ hr = IDirectDrawSurface_AddAttachedSurface(surface1v1, surface2v1); - 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 *)surface2v1); - ok(refcount == 2, "Got unexpected refcount %u.\n", refcount); + ok(refcount == 2, "Got unexpected refcount %lu.\n", refcount); refcount = IDirectDrawSurface_Release(surface1v1); - ok(!refcount, "Got unexpected refcount %u.\n", refcount); + ok(!refcount, "Got unexpected refcount %lu.\n", refcount); refcount = IDirectDrawSurface_Release(surface2v1); - ok(!refcount, "Got unexpected refcount %u.\n", refcount); + ok(!refcount, "Got unexpected refcount %lu.\n", refcount); refcount = IDirectDraw7_Release(ddraw); - ok(!refcount, "Got unexpected refcount %u.\n", refcount); + ok(!refcount, "Got unexpected refcount %lu.\n", refcount); DestroyWindow(window); }
@@ -8528,7 +8512,7 @@ static void test_private_data(void) ddraw = create_ddraw(); ok(!!ddraw, "Failed to create a ddraw object.\n"); hr = IDirectDraw7_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(&surface_desc); surface_desc.dwFlags = DDSD_CAPS | DDSD_HEIGHT | DDSD_WIDTH; @@ -8536,27 +8520,27 @@ static void test_private_data(void) surface_desc.dwHeight = 4; surface_desc.dwWidth = 4; hr = IDirectDraw7_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);
/* NULL pointers are not valid, but don't cause a crash. */ hr = IDirectDrawSurface7_SetPrivateData(surface, &ddraw_private_data_test_guid, NULL, sizeof(IUnknown *), DDSPD_IUNKNOWNPOINTER); - ok(hr == DDERR_INVALIDPARAMS, "Got unexpected hr %#x.\n", hr); + ok(hr == DDERR_INVALIDPARAMS, "Got unexpected hr %#lx.\n", hr); hr = IDirectDrawSurface7_SetPrivateData(surface, &ddraw_private_data_test_guid, NULL, 0, 0); - ok(hr == DDERR_INVALIDPARAMS, "Got unexpected hr %#x.\n", hr); + ok(hr == DDERR_INVALIDPARAMS, "Got unexpected hr %#lx.\n", hr); hr = IDirectDrawSurface7_SetPrivateData(surface, &ddraw_private_data_test_guid, NULL, 1, 0); - ok(hr == DDERR_INVALIDPARAMS, "Got unexpected hr %#x.\n", hr); + ok(hr == DDERR_INVALIDPARAMS, "Got unexpected hr %#lx.\n", hr);
/* DDSPD_IUNKNOWNPOINTER needs sizeof(IUnknown *) bytes of data. */ hr = IDirectDrawSurface7_SetPrivateData(surface, &ddraw_private_data_test_guid, ddraw, 0, DDSPD_IUNKNOWNPOINTER); - ok(hr == DDERR_INVALIDPARAMS, "Got unexpected hr %#x.\n", hr); + ok(hr == DDERR_INVALIDPARAMS, "Got unexpected hr %#lx.\n", hr); hr = IDirectDrawSurface7_SetPrivateData(surface, &ddraw_private_data_test_guid, ddraw, 5, DDSPD_IUNKNOWNPOINTER); - ok(hr == DDERR_INVALIDPARAMS, "Got unexpected hr %#x.\n", hr); + ok(hr == DDERR_INVALIDPARAMS, "Got unexpected hr %#lx.\n", hr); hr = IDirectDrawSurface7_SetPrivateData(surface, &ddraw_private_data_test_guid, ddraw, sizeof(ddraw) * 2, DDSPD_IUNKNOWNPOINTER); - ok(hr == DDERR_INVALIDPARAMS, "Got unexpected hr %#x.\n", hr); + ok(hr == DDERR_INVALIDPARAMS, "Got unexpected hr %#lx.\n", hr);
/* Note that with a size != 0 and size != sizeof(IUnknown *) and * DDSPD_IUNKNOWNPOINTER set SetPrivateData in ddraw4 and ddraw7 @@ -8565,85 +8549,85 @@ static void test_private_data(void) * that depends on this we don't care about this behavior. */ hr = IDirectDrawSurface7_SetPrivateData(surface, &ddraw_private_data_test_guid, ddraw, sizeof(ddraw), DDSPD_IUNKNOWNPOINTER); - ok(SUCCEEDED(hr), "Failed to set private data, hr %#x.\n", hr); + ok(SUCCEEDED(hr), "Failed to set private data, hr %#lx.\n", hr); hr = IDirectDrawSurface7_SetPrivateData(surface, &ddraw_private_data_test_guid, ddraw, 0, DDSPD_IUNKNOWNPOINTER); - ok(hr == DDERR_INVALIDPARAMS, "Got unexpected hr %#x.\n", hr); + ok(hr == DDERR_INVALIDPARAMS, "Got unexpected hr %#lx.\n", hr); size = sizeof(ptr); hr = IDirectDrawSurface7_GetPrivateData(surface, &ddraw_private_data_test_guid, &ptr, &size); - ok(SUCCEEDED(hr), "Failed to get private data, hr %#x.\n", hr); + ok(SUCCEEDED(hr), "Failed to get private data, hr %#lx.\n", hr); hr = IDirectDrawSurface7_FreePrivateData(surface, &ddraw_private_data_test_guid); - ok(SUCCEEDED(hr), "Failed to free private data, hr %#x.\n", hr); + ok(SUCCEEDED(hr), "Failed to free private data, hr %#lx.\n", hr);
refcount = get_refcount((IUnknown *)ddraw); hr = IDirectDrawSurface7_SetPrivateData(surface, &ddraw_private_data_test_guid, ddraw, sizeof(ddraw), DDSPD_IUNKNOWNPOINTER); - ok(SUCCEEDED(hr), "Failed to set private data, hr %#x.\n", hr); + ok(SUCCEEDED(hr), "Failed to set private data, hr %#lx.\n", hr); refcount2 = get_refcount((IUnknown *)ddraw); - ok(refcount2 == refcount + 1, "Got unexpected refcount %u.\n", refcount2); + ok(refcount2 == refcount + 1, "Got unexpected refcount %lu.\n", refcount2);
hr = IDirectDrawSurface7_FreePrivateData(surface, &ddraw_private_data_test_guid); - ok(SUCCEEDED(hr), "Failed to free private data, hr %#x.\n", hr); + ok(SUCCEEDED(hr), "Failed to free private data, hr %#lx.\n", hr); refcount2 = get_refcount((IUnknown *)ddraw); - ok(refcount2 == refcount, "Got unexpected refcount %u.\n", refcount2); + ok(refcount2 == refcount, "Got unexpected refcount %lu.\n", refcount2);
hr = IDirectDrawSurface7_SetPrivateData(surface, &ddraw_private_data_test_guid, ddraw, sizeof(ddraw), DDSPD_IUNKNOWNPOINTER); - ok(SUCCEEDED(hr), "Failed to set private data, hr %#x.\n", hr); + ok(SUCCEEDED(hr), "Failed to set private data, hr %#lx.\n", hr); hr = IDirectDrawSurface7_SetPrivateData(surface, &ddraw_private_data_test_guid, surface, sizeof(surface), DDSPD_IUNKNOWNPOINTER); - ok(SUCCEEDED(hr), "Failed to set private data, hr %#x.\n", hr); + ok(SUCCEEDED(hr), "Failed to set private data, hr %#lx.\n", hr); refcount2 = get_refcount((IUnknown *)ddraw); - ok(refcount2 == refcount, "Got unexpected refcount %u.\n", refcount2); + ok(refcount2 == refcount, "Got unexpected refcount %lu.\n", refcount2);
hr = IDirectDrawSurface7_SetPrivateData(surface, &ddraw_private_data_test_guid, ddraw, sizeof(ddraw), DDSPD_IUNKNOWNPOINTER); - ok(SUCCEEDED(hr), "Failed to set private data, hr %#x.\n", hr); + ok(SUCCEEDED(hr), "Failed to set private data, hr %#lx.\n", hr); size = 2 * sizeof(ptr); hr = IDirectDrawSurface7_GetPrivateData(surface, &ddraw_private_data_test_guid, &ptr, &size); - ok(SUCCEEDED(hr), "Failed to get private data, hr %#x.\n", hr); - ok(size == sizeof(ddraw), "Got unexpected size %u.\n", size); + ok(SUCCEEDED(hr), "Failed to get private data, hr %#lx.\n", hr); + ok(size == sizeof(ddraw), "Got unexpected size %lu.\n", size); refcount2 = get_refcount(ptr); /* Object is NOT addref'ed by the getter. */ ok(ptr == (IUnknown *)ddraw, "Returned interface pointer is %p, expected %p.\n", ptr, ddraw); - ok(refcount2 == refcount + 1, "Got unexpected refcount %u.\n", refcount2); + ok(refcount2 == refcount + 1, "Got unexpected refcount %lu.\n", refcount2);
ptr = (IUnknown *)0xdeadbeef; size = 1; hr = IDirectDrawSurface7_GetPrivateData(surface, &ddraw_private_data_test_guid, NULL, &size); - ok(hr == DDERR_MOREDATA, "Got unexpected hr %#x.\n", hr); - ok(size == sizeof(ddraw), "Got unexpected size %u.\n", size); + ok(hr == DDERR_MOREDATA, "Got unexpected hr %#lx.\n", hr); + ok(size == sizeof(ddraw), "Got unexpected size %lu.\n", size); size = 2 * sizeof(ptr); hr = IDirectDrawSurface7_GetPrivateData(surface, &ddraw_private_data_test_guid, NULL, &size); - ok(hr == DDERR_INVALIDPARAMS, "Got unexpected hr %#x.\n", hr); - ok(size == 2 * sizeof(ptr), "Got unexpected size %u.\n", size); + ok(hr == DDERR_INVALIDPARAMS, "Got unexpected hr %#lx.\n", hr); + ok(size == 2 * sizeof(ptr), "Got unexpected size %lu.\n", size); size = 1; hr = IDirectDrawSurface7_GetPrivateData(surface, &ddraw_private_data_test_guid, &ptr, &size); - ok(hr == DDERR_MOREDATA, "Got unexpected hr %#x.\n", hr); - ok(size == sizeof(ddraw), "Got unexpected size %u.\n", size); + ok(hr == DDERR_MOREDATA, "Got unexpected hr %#lx.\n", hr); + ok(size == sizeof(ddraw), "Got unexpected size %lu.\n", size); ok(ptr == (IUnknown *)0xdeadbeef, "Got unexpected pointer %p.\n", ptr); hr = IDirectDrawSurface7_GetPrivateData(surface, &ddraw_private_data_test_guid2, NULL, NULL); - ok(hr == DDERR_NOTFOUND, "Got unexpected hr %#x.\n", hr); + ok(hr == DDERR_NOTFOUND, "Got unexpected hr %#lx.\n", hr); size = 0xdeadbabe; hr = IDirectDrawSurface7_GetPrivateData(surface, &ddraw_private_data_test_guid2, &ptr, &size); - ok(hr == DDERR_NOTFOUND, "Got unexpected hr %#x.\n", hr); + ok(hr == DDERR_NOTFOUND, "Got unexpected hr %#lx.\n", hr); ok(ptr == (IUnknown *)0xdeadbeef, "Got unexpected pointer %p.\n", ptr); - ok(size == 0xdeadbabe, "Got unexpected size %u.\n", size); + ok(size == 0xdeadbabe, "Got unexpected size %lu.\n", size); hr = IDirectDrawSurface7_GetPrivateData(surface, &ddraw_private_data_test_guid, NULL, NULL); - ok(hr == DDERR_INVALIDPARAMS, "Got unexpected hr %#x.\n", hr); + ok(hr == DDERR_INVALIDPARAMS, "Got unexpected hr %#lx.\n", hr);
refcount3 = IDirectDrawSurface7_Release(surface); - ok(!refcount3, "Got unexpected refcount %u.\n", refcount3); + ok(!refcount3, "Got unexpected refcount %lu.\n", refcount3);
/* Destroying the surface frees the reference held on the private data. It also frees * the reference the surface is holding on its creating object. */ refcount2 = get_refcount((IUnknown *)ddraw); - ok(refcount2 == refcount - 1, "Got unexpected refcount %u.\n", refcount2); + ok(refcount2 == refcount - 1, "Got unexpected refcount %lu.\n", refcount2);
memset(&hal_caps, 0, sizeof(hal_caps)); hal_caps.dwSize = sizeof(hal_caps); hr = IDirectDraw7_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) && !is_ddraw64) { @@ -8654,14 +8638,14 @@ static void test_private_data(void) surface_desc.dwWidth = 4; U2(surface_desc).dwMipMapCount = 2; hr = IDirectDraw7_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 = IDirectDrawSurface7_GetAttachedSurface(surface, &caps, &surface2); - 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 = IDirectDrawSurface7_SetPrivateData(surface, &ddraw_private_data_test_guid, data, sizeof(data), 0); - ok(SUCCEEDED(hr), "Failed to set private data, hr %#x.\n", hr); + ok(SUCCEEDED(hr), "Failed to set private data, hr %#lx.\n", hr); hr = IDirectDrawSurface7_GetPrivateData(surface2, &ddraw_private_data_test_guid, NULL, NULL); - ok(hr == DDERR_NOTFOUND, "Got unexpected hr %#x.\n", hr); + ok(hr == DDERR_NOTFOUND, "Got unexpected hr %#lx.\n", hr);
IDirectDrawSurface7_Release(surface2); IDirectDrawSurface7_Release(surface); @@ -8670,7 +8654,7 @@ static void test_private_data(void) skip("Mipmapped textures not supported, skipping mipmap private data test.\n");
refcount = IDirectDraw7_Release(ddraw); - ok(!refcount, "Got unexpected refcount %u.\n", refcount); + ok(!refcount, "Got unexpected refcount %lu.\n", refcount); DestroyWindow(window); }
@@ -8753,7 +8737,7 @@ static void test_pixel_format(void) hr = IDirectDraw7_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; }
@@ -8763,9 +8747,9 @@ static void test_pixel_format(void) if (hdc2) { hr = IDirectDraw7_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); @@ -8780,7 +8764,7 @@ static void test_pixel_format(void) ddsd.ddsCaps.dwCaps = DDSCAPS_PRIMARYSURFACE;
hr = IDirectDraw7_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); @@ -8794,7 +8778,7 @@ static void test_pixel_format(void) if (clipper) { hr = IDirectDrawSurface7_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); @@ -8809,18 +8793,18 @@ static void test_pixel_format(void) ddsd.ddsCaps.dwCaps = DDSCAPS_OFFSCREENPLAIN; ddsd.dwWidth = ddsd.dwHeight = 64; hr = IDirectDraw7_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 = IDirectDrawSurface7_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 = IDirectDrawSurface7_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); @@ -8945,7 +8929,7 @@ static void test_create_surface_pitch(void) ddraw = create_ddraw(); ok(!!ddraw, "Failed to create a ddraw object.\n"); hr = IDirectDraw7_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);
@@ -8968,36 +8952,36 @@ 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 = IDirectDraw7_CreateSurface(ddraw, &surface_desc, &surface, NULL); } if ((test_data[i].caps & DDSCAPS_VIDEOMEMORY) && hr == DDERR_NODIRECTDRAWHW) continue; if (is_ddraw64 && (test_data[i].caps & DDSCAPS_TEXTURE) && SUCCEEDED(test_data[i].hr)) - todo_wine ok(hr == E_NOINTERFACE, "Test %u: Got unexpected hr %#x.\n", i, hr); + todo_wine ok(hr == E_NOINTERFACE, "Test %u: Got unexpected hr %#lx.\n", i, hr); else - 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 = IDirectDrawSurface7_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); @@ -9007,7 +8991,7 @@ static void test_create_surface_pitch(void)
HeapFree(GetProcessHeap(), 0, mem); refcount = IDirectDraw7_Release(ddraw); - ok(!refcount, "Got unexpected refcount %u.\n", refcount); + ok(!refcount, "Got unexpected refcount %lu.\n", refcount); DestroyWindow(window); }
@@ -9047,12 +9031,12 @@ static void test_mipmap(void) ddraw = create_ddraw(); ok(!!ddraw, "Failed to create a ddraw object.\n"); hr = IDirectDraw7_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 = IDirectDraw7_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) || is_ddraw64) { @@ -9073,18 +9057,18 @@ static void test_mipmap(void) if (tests[i].flags & DDSD_MIPMAPCOUNT) U2(surface_desc).dwMipMapCount = tests[i].mipmap_count_in; hr = IDirectDraw7_CreateSurface(ddraw, &surface_desc, &surface, 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;
memset(&surface_desc, 0, sizeof(surface_desc)); surface_desc.dwSize = sizeof(surface_desc); hr = IDirectDrawSurface7_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; IDirectDrawSurface7_AddRef(surface_base); @@ -9092,31 +9076,31 @@ static void test_mipmap(void) while (mipmap_count > 1) { hr = IDirectDrawSurface7_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 = IDirectDrawSurface7_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 = IDirectDrawSurface7_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 = IDirectDrawSurface7_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); IDirectDrawSurface7_Unlock(surface_mip, NULL); IDirectDrawSurface7_Unlock(surface_base, NULL);
@@ -9130,7 +9114,7 @@ static void test_mipmap(void) }
refcount = IDirectDraw7_Release(ddraw); - ok(!refcount, "Got unexpected refcount %u.\n", refcount); + ok(!refcount, "Got unexpected refcount %lu.\n", refcount); DestroyWindow(window); }
@@ -9152,12 +9136,12 @@ static void test_palette_complex(void) ddraw = create_ddraw(); ok(!!ddraw, "Failed to create a ddraw object.\n"); hr = IDirectDraw7_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 = IDirectDraw7_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) || is_ddraw64) { @@ -9177,21 +9161,21 @@ static void test_palette_complex(void) U4(surface_desc).ddpfPixelFormat.dwFlags = DDPF_PALETTEINDEXED8 | DDPF_RGB; U1(U4(surface_desc).ddpfPixelFormat).dwRGBBitCount = 8; hr = IDirectDraw7_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(palette_entries, 0, sizeof(palette_entries)); hr = IDirectDraw7_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);
palette2 = (void *)0xdeadbeef; hr = IDirectDrawSurface7_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 = IDirectDrawSurface7_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 = IDirectDrawSurface7_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);
@@ -9200,17 +9184,17 @@ static void test_palette_complex(void) for (i = 0; i < 7; ++i) { hr = IDirectDrawSurface7_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 = IDirectDrawSurface7_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 = IDirectDrawSurface7_SetPalette(tmp, palette); - ok(hr == DDERR_NOTONMIPMAPSUBLEVEL, "Got unexpected hr %#x, i %u.\n", hr, i); + ok(hr == DDERR_NOTONMIPMAPSUBLEVEL, "Got unexpected hr %#lx, i %u.\n", hr, i);
hr = IDirectDrawSurface7_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);
/* Ddraw7 uses the palette of the mipmap for GetDC, just like previous @@ -9223,10 +9207,10 @@ static void test_palette_complex(void) }
hr = IDirectDrawSurface7_GetAttachedSurface(mipmap, &caps, &tmp); - ok(hr == DDERR_NOTFOUND, "Got unexpected hr %#x.\n", hr); + ok(hr == DDERR_NOTFOUND, "Got unexpected hr %#lx.\n", hr); IDirectDrawSurface7_Release(mipmap); refcount = IDirectDrawSurface7_Release(surface); - ok(!refcount, "Got unexpected refcount %u.\n", refcount); + ok(!refcount, "Got unexpected refcount %lu.\n", refcount);
/* Test DDERR_INVALIDPIXELFORMAT vs DDERR_NOTONMIPMAPSUBLEVEL. */ memset(&surface_desc, 0, sizeof(surface_desc)); @@ -9242,21 +9226,21 @@ static void test_palette_complex(void) U3(U4(surface_desc).ddpfPixelFormat).dwGBitMask = 0x0000ff00; U4(U4(surface_desc).ddpfPixelFormat).dwBBitMask = 0x000000ff; hr = IDirectDraw7_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 = IDirectDrawSurface7_GetAttachedSurface(surface, &caps, &mipmap); - 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 = IDirectDrawSurface7_SetPalette(mipmap, palette); - ok(hr == DDERR_NOTONMIPMAPSUBLEVEL, "Got unexpected hr %#x.\n", hr); + ok(hr == DDERR_NOTONMIPMAPSUBLEVEL, "Got unexpected hr %#lx.\n", hr);
IDirectDrawSurface7_Release(mipmap); refcount = IDirectDrawSurface7_Release(surface); - 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 = IDirectDraw7_Release(ddraw); - ok(!refcount, "Got unexpected refcount %u.\n", refcount); + ok(!refcount, "Got unexpected refcount %lu.\n", refcount); DestroyWindow(window); }
@@ -9264,30 +9248,29 @@ static void test_p8_blit(void) { IDirectDrawSurface7 *src, *dst, *dst_p8; DDSURFACEDESC2 surface_desc; + unsigned int color, x; IDirectDraw7 *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 = IDirectDraw7_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)); @@ -9297,14 +9280,14 @@ static void test_p8_blit(void) palette_entries[4].peRed = 0xff; hr = IDirectDraw7_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 = IDirectDraw7_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); @@ -9316,11 +9299,11 @@ static void test_p8_blit(void) U4(surface_desc).ddpfPixelFormat.dwFlags = DDPF_PALETTEINDEXED8 | DDPF_RGB; U1(U4(surface_desc).ddpfPixelFormat).dwRGBBitCount = 8; hr = IDirectDraw7_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 = IDirectDraw7_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 = IDirectDrawSurface7_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); @@ -9336,34 +9319,34 @@ static void test_p8_blit(void) U4(U4(surface_desc).ddpfPixelFormat).dwBBitMask = 0x000000ff; U5(U4(surface_desc).ddpfPixelFormat).dwRGBAlphaBitMask = 0xff000000; hr = IDirectDraw7_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 = IDirectDrawSurface7_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 = IDirectDrawSurface7_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 = IDirectDrawSurface7_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 = IDirectDrawSurface7_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 = IDirectDrawSurface7_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 = IDirectDrawSurface7_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 = IDirectDrawSurface7_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)) { @@ -9382,10 +9365,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 = IDirectDrawSurface7_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. @@ -9396,7 +9379,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 = IDirectDrawSurface7_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);
IDirectDrawSurface7_Release(src); IDirectDrawSurface7_Release(dst); @@ -9405,7 +9388,7 @@ static void test_p8_blit(void) IDirectDrawPalette_Release(palette2);
refcount = IDirectDraw7_Release(ddraw); - ok(!refcount, "Got unexpected refcount %u.\n", refcount); + ok(!refcount, "Got unexpected refcount %lu.\n", refcount); DestroyWindow(window); }
@@ -9427,7 +9410,7 @@ static void test_material(void) }
hr = IDirect3DDevice7_GetMaterial(device, &material); - ok(SUCCEEDED(hr), "Failed to get material, hr %#x.\n", hr); + ok(SUCCEEDED(hr), "Failed to get material, hr %#lx.\n", hr); ok(!memcmp(&U(material).diffuse, &null_color, sizeof(null_color)), "Got unexpected diffuse color {%.8e, %.8e, %.8e, %.8e}.\n", U1(U(material).diffuse).r, U2(U(material).diffuse).g, @@ -9447,7 +9430,7 @@ static void test_material(void) ok(U4(material).power == 0.0f, "Got unexpected power %.8e.\n", U4(material).power);
refcount = IDirect3DDevice7_Release(device); - ok(!refcount, "Device has %u references left.\n", refcount); + ok(!refcount, "Device has %lu references left.\n", refcount); DestroyWindow(window); }
@@ -9455,17 +9438,17 @@ static void test_palette_gdi(void) { IDirectDrawSurface7 *surface, *primary; DDSURFACEDESC2 surface_desc; + unsigned int color, i; IDirectDraw7 *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. */ @@ -9493,7 +9476,7 @@ static void test_palette_gdi(void) ddraw = create_ddraw(); ok(!!ddraw, "Failed to create a ddraw object.\n"); hr = IDirectDraw7_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); @@ -9505,7 +9488,7 @@ static void test_palette_gdi(void) U4(surface_desc).ddpfPixelFormat.dwFlags = DDPF_PALETTEINDEXED8 | DDPF_RGB; U1(U4(surface_desc).ddpfPixelFormat).dwRGBBitCount = 8; hr = IDirectDraw7_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)); @@ -9517,7 +9500,7 @@ static void test_palette_gdi(void) palette_entries[4].peBlue = 0x15; hr = IDirectDraw7_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, @@ -9530,9 +9513,9 @@ static void test_palette_gdi(void) * contains uninitialized garbage. See comments below for the P8 case. */
hr = IDirectDrawSurface7_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 = IDirectDrawSurface7_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", @@ -9559,7 +9542,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); @@ -9570,9 +9553,9 @@ static void test_palette_gdi(void)
/* Neither does re-setting the palette. */ hr = IDirectDrawSurface7_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 = IDirectDrawSurface7_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); @@ -9582,11 +9565,11 @@ static void test_palette_gdi(void) expected1[4].rgbRed, expected1[4].rgbGreen, expected1[4].rgbBlue);
hr = IDirectDrawSurface7_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 = IDirectDrawSurface7_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) @@ -9603,13 +9586,13 @@ static void test_palette_gdi(void) i, rgbquad[i].rgbRed, rgbquad[i].rgbGreen, rgbquad[i].rgbBlue); } hr = IDirectDrawSurface7_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 = IDirectDrawSurface7_Release(surface); - ok(!refcount, "Got unexpected refcount %u.\n", refcount); + ok(!refcount, "Got unexpected refcount %lu.\n", refcount);
hr = IDirectDraw7_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(IDirectDraw7_SetDisplayMode(ddraw, 640, 480, 8, 0, 0))) { win_skip("Failed to set 8 bpp display mode, skipping test.\n"); @@ -9618,30 +9601,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 = IDirectDraw7_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 = IDirectDrawSurface7_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 = IDirectDrawSurface7_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 = IDirectDrawSurface7_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 = IDirectDrawSurface7_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); @@ -9676,7 +9659,7 @@ static void test_palette_gdi(void) i, rgbquad[i].rgbRed, rgbquad[i].rgbGreen, rgbquad[i].rgbBlue); } hr = IDirectDrawSurface7_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); @@ -9685,12 +9668,12 @@ static void test_palette_gdi(void) surface_desc.dwHeight = 16; surface_desc.ddsCaps.dwCaps = DDSCAPS_OFFSCREENPLAIN; hr = IDirectDraw7_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 = IDirectDrawSurface7_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) @@ -9707,7 +9690,7 @@ static void test_palette_gdi(void) i, rgbquad[i].rgbRed, rgbquad[i].rgbGreen, rgbquad[i].rgbBlue); } hr = IDirectDrawSurface7_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 @@ -9723,14 +9706,14 @@ static void test_palette_gdi(void) palette_entries[4].peBlue = 0x56; hr = IDirectDraw7_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 = IDirectDrawSurface7_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 = IDirectDrawSurface7_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) @@ -9747,24 +9730,24 @@ static void test_palette_gdi(void) i, rgbquad[i].rgbRed, rgbquad[i].rgbGreen, rgbquad[i].rgbBlue); } hr = IDirectDrawSurface7_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 = IDirectDrawSurface7_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 = IDirectDraw7_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 = IDirectDrawSurface7_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 = IDirectDraw7_Release(ddraw); - ok(!refcount, "Got unexpected refcount %u.\n", refcount); + ok(!refcount, "Got unexpected refcount %lu.\n", refcount); DestroyWindow(window); }
@@ -9803,18 +9786,18 @@ static void test_palette_alpha(void) return; } hr = IDirectDraw7_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 = IDirectDraw7_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", @@ -9833,11 +9816,11 @@ static void test_palette_alpha(void) palette_entries[3].peFlags = 0x80; hr = IDirectDraw7_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", @@ -9857,17 +9840,17 @@ static void test_palette_alpha(void) surface_desc.ddsCaps.dwCaps = test_data[i].caps; hr = IDirectDraw7_CreateSurface(ddraw, &surface_desc, &surface, NULL); if (is_ddraw64 && test_data[i].caps & DDSCAPS_TEXTURE) - todo_wine ok(hr == E_NOINTERFACE, "%s: Got unexpected hr %#x.\n", test_data[i].name, hr); + todo_wine ok(hr == E_NOINTERFACE, "%s: Got unexpected hr %#lx.\n", test_data[i].name, hr); else - 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); if (FAILED(hr)) continue;
hr = IDirectDrawSurface7_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)) { @@ -9876,7 +9859,7 @@ static void test_palette_alpha(void) UINT retval;
hr = IDirectDrawSurface7_GetDC(surface, &dc); - ok(SUCCEEDED(hr), "Failed to get DC, hr %#x, %s surface.\n", hr, test_data[i].name); + ok(SUCCEEDED(hr), "Failed to get DC, hr %#lx, %s surface.\n", hr, test_data[i].name); retval = GetDIBColorTable(dc, 1, 1, &rgbquad); ok(retval == 1, "GetDIBColorTable returned unexpected result %u.\n", retval); ok(rgbquad.rgbRed == 0xff, "Expected rgbRed = 0xff, got %#x, %s surface.\n", @@ -9888,7 +9871,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 = IDirectDrawSurface7_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); } IDirectDrawSurface7_Release(surface); } @@ -9907,20 +9890,20 @@ static void test_palette_alpha(void) U3(U4(surface_desc).ddpfPixelFormat).dwGBitMask = 0x0000ff00; U4(U4(surface_desc).ddpfPixelFormat).dwBBitMask = 0x000000ff; hr = IDirectDraw7_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 = IDirectDrawSurface7_SetPalette(surface, palette); - ok(hr == DDERR_INVALIDSURFACETYPE, "Got unexpected hr %#x.\n", hr); + ok(hr == DDERR_INVALIDSURFACETYPE, "Got unexpected hr %#lx.\n", hr); IDirectDrawSurface7_Release(surface);
/* The Windows 8 testbot keeps extra references to the primary * while in 8 bpp mode. */ hr = IDirectDraw7_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 = IDirectDraw7_Release(ddraw); - ok(!refcount, "Got unexpected refcount %u.\n", refcount); + ok(!refcount, "Got unexpected refcount %lu.\n", refcount); DestroyWindow(window); }
@@ -9950,7 +9933,7 @@ static void test_vb_writeonly(void) }
hr = IDirect3DDevice7_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);
memset(&desc, 0, sizeof(desc)); desc.dwSize = sizeof(desc); @@ -9958,32 +9941,32 @@ static void test_vb_writeonly(void) desc.dwFVF = D3DFVF_XYZRHW; desc.dwNumVertices = ARRAY_SIZE(quad); hr = IDirect3D7_CreateVertexBuffer(d3d, &desc, &buffer, 0); - ok(SUCCEEDED(hr), "Failed to create vertex buffer, hr %#x.\n", hr); + ok(SUCCEEDED(hr), "Failed to create vertex buffer, hr %#lx.\n", hr);
hr = IDirect3DVertexBuffer7_Lock(buffer, DDLOCK_DISCARDCONTENTS, &ptr, NULL); - ok(SUCCEEDED(hr), "Failed to lock vertex buffer, hr %#x.\n", hr); + ok(SUCCEEDED(hr), "Failed to lock vertex buffer, hr %#lx.\n", hr); memcpy(ptr, quad, sizeof(quad)); hr = IDirect3DVertexBuffer7_Unlock(buffer); - ok(SUCCEEDED(hr), "Failed to unlock vertex buffer, hr %#x.\n", hr); + ok(SUCCEEDED(hr), "Failed to unlock vertex buffer, hr %#lx.\n", hr);
hr = IDirect3DDevice7_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 = IDirect3DDevice7_DrawPrimitiveVB(device, D3DPT_TRIANGLESTRIP, buffer, 0, 4, 0); - ok(SUCCEEDED(hr), "Failed to draw, hr %#x.\n", hr); + ok(SUCCEEDED(hr), "Failed to draw, hr %#lx.\n", hr); hr = IDirect3DDevice7_EndScene(device); - ok(SUCCEEDED(hr), "Failed to end scene, hr %#x.\n", hr); + ok(SUCCEEDED(hr), "Failed to end scene, hr %#lx.\n", hr);
hr = IDirect3DVertexBuffer7_Lock(buffer, 0, &ptr, NULL); - ok(SUCCEEDED(hr), "Failed to lock vertex buffer, hr %#x.\n", hr); + ok(SUCCEEDED(hr), "Failed to lock vertex buffer, hr %#lx.\n", hr); ok (!memcmp(ptr, quad, sizeof(quad)), "Got unexpected vertex buffer data.\n"); hr = IDirect3DVertexBuffer7_Unlock(buffer); - ok(SUCCEEDED(hr), "Failed to unlock vertex buffer, hr %#x.\n", hr); + ok(SUCCEEDED(hr), "Failed to unlock vertex buffer, hr %#lx.\n", hr);
hr = IDirect3DVertexBuffer7_Lock(buffer, DDLOCK_READONLY, &ptr, NULL); - ok(SUCCEEDED(hr), "Failed to lock vertex buffer, hr %#x.\n", hr); + ok(SUCCEEDED(hr), "Failed to lock vertex buffer, hr %#lx.\n", hr); ok (!memcmp(ptr, quad, sizeof(quad)), "Got unexpected vertex buffer data.\n"); hr = IDirect3DVertexBuffer7_Unlock(buffer); - ok(SUCCEEDED(hr), "Failed to unlock vertex buffer, hr %#x.\n", hr); + ok(SUCCEEDED(hr), "Failed to unlock vertex buffer, hr %#lx.\n", hr);
IDirect3DVertexBuffer7_Release(buffer); IDirect3D7_Release(d3d); @@ -10010,7 +9993,7 @@ static void test_lost_device(void) ddraw = create_ddraw(); ok(!!ddraw, "Failed to create a ddraw object.\n"); hr = IDirectDraw7_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); @@ -10018,7 +10001,7 @@ static void test_lost_device(void) surface_desc.ddsCaps.dwCaps = DDSCAPS_PRIMARYSURFACE | DDSCAPS_COMPLEX | DDSCAPS_FLIP; U5(surface_desc).dwBackBufferCount = 1; hr = IDirectDraw7_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); @@ -10027,7 +10010,7 @@ static void test_lost_device(void) surface_desc.dwWidth = 100; surface_desc.dwHeight = 100; hr = IDirectDraw7_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); @@ -10048,93 +10031,93 @@ static void test_lost_device(void) }
hr = IDirectDraw7_TestCooperativeLevel(ddraw); - ok(hr == DD_OK, "Got unexpected hr %#x.\n", hr); + ok(hr == DD_OK, "Got unexpected hr %#lx.\n", hr); hr = IDirectDrawSurface7_IsLost(surface); - ok(hr == DD_OK, "Got unexpected hr %#x.\n", hr); + ok(hr == DD_OK, "Got unexpected hr %#lx.\n", hr); hr = IDirectDrawSurface7_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 = IDirectDrawSurface7_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 = IDirectDrawSurface7_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 = IDirectDraw7_TestCooperativeLevel(ddraw); - ok(hr == DDERR_NOEXCLUSIVEMODE, "Got unexpected hr %#x.\n", hr); + ok(hr == DDERR_NOEXCLUSIVEMODE, "Got unexpected hr %#lx.\n", hr); hr = IDirectDrawSurface7_IsLost(surface); - ok(hr == DDERR_SURFACELOST, "Got unexpected hr %#x.\n", hr); + ok(hr == DDERR_SURFACELOST, "Got unexpected hr %#lx.\n", hr); hr = IDirectDrawSurface7_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 = IDirectDrawSurface7_Restore(surface); - ok(hr == DDERR_WRONGMODE, "Got unexpected hr %#x.\n", hr); + ok(hr == DDERR_WRONGMODE, "Got unexpected hr %#lx.\n", hr); hr = IDirectDrawSurface7_IsLost(surface); - ok(hr == DDERR_SURFACELOST, "Got unexpected hr %#x.\n", hr); + ok(hr == DDERR_SURFACELOST, "Got unexpected hr %#lx.\n", hr); hr = IDirectDrawSurface7_IsLost(sysmem_surface); - ok(hr == DD_OK, "Got unexpected hr %#x.\n", hr); + ok(hr == DD_OK, "Got unexpected hr %#lx.\n", hr); hr = IDirectDrawSurface7_Restore(sysmem_surface); - ok(hr == DD_OK, "Got unexpected hr %#x.\n", hr); + ok(hr == DD_OK, "Got unexpected hr %#lx.\n", hr); hr = IDirectDrawSurface7_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 = IDirectDrawSurface7_IsLost(vidmem_surface); - ok(hr == DDERR_SURFACELOST, "Got unexpected hr %#x.\n", hr); + ok(hr == DDERR_SURFACELOST, "Got unexpected hr %#lx.\n", hr); hr = IDirectDrawSurface7_Restore(vidmem_surface); - ok(hr == DDERR_WRONGMODE, "Got unexpected hr %#x.\n", hr); + ok(hr == DDERR_WRONGMODE, "Got unexpected hr %#lx.\n", hr); hr = IDirectDrawSurface7_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 = IDirectDraw7_TestCooperativeLevel(ddraw); - ok(hr == DD_OK, "Got unexpected hr %#x.\n", hr); + ok(hr == DD_OK, "Got unexpected hr %#lx.\n", hr); hr = IDirectDrawSurface7_IsLost(surface); - ok(hr == DDERR_SURFACELOST, "Got unexpected hr %#x.\n", hr); + ok(hr == DDERR_SURFACELOST, "Got unexpected hr %#lx.\n", hr); hr = IDirectDrawSurface7_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 = IDirectDrawSurface7_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 = IDirectDrawSurface7_IsLost(vidmem_surface); - ok(hr == DDERR_SURFACELOST, "Got unexpected hr %#x.\n", hr); + ok(hr == DDERR_SURFACELOST, "Got unexpected hr %#lx.\n", hr); }
hr = IDirectDraw7_RestoreAllSurfaces(ddraw); - ok(hr == DD_OK, "Got unexpected hr %#x.\n", hr); + ok(hr == DD_OK, "Got unexpected hr %#lx.\n", hr); hr = IDirectDraw7_TestCooperativeLevel(ddraw); - ok(hr == DD_OK, "Got unexpected hr %#x.\n", hr); + ok(hr == DD_OK, "Got unexpected hr %#lx.\n", hr); hr = IDirectDrawSurface7_IsLost(surface); - ok(hr == DD_OK, "Got unexpected hr %#x.\n", hr); + ok(hr == DD_OK, "Got unexpected hr %#lx.\n", hr); hr = IDirectDrawSurface7_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 = IDirectDrawSurface7_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 = IDirectDrawSurface7_IsLost(vidmem_surface); - ok(hr == DD_OK, "Got unexpected hr %#x.\n", hr); + ok(hr == DD_OK, "Got unexpected hr %#lx.\n", hr); }
hr = IDirectDraw7_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 = IDirectDraw7_TestCooperativeLevel(ddraw); - ok(hr == DD_OK, "Got unexpected hr %#x.\n", hr); + ok(hr == DD_OK, "Got unexpected hr %#lx.\n", hr); hr = IDirectDrawSurface7_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 = IDirectDrawSurface7_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 = IDirectDrawSurface7_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 = IDirectDrawSurface7_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 @@ -10145,78 +10128,78 @@ static void test_lost_device(void) surface_desc.dwFlags = DDSD_CAPS; surface_desc.ddsCaps.dwCaps = DDSCAPS_PRIMARYSURFACE; hr = IDirectDraw7_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 = IDirectDrawSurface7_IsLost(sysmem_surface); - ok(hr == DD_OK, "Got unexpected hr %#x.\n", hr); + ok(hr == DD_OK, "Got unexpected hr %#lx.\n", hr); hr = IDirectDraw7_RestoreAllSurfaces(ddraw); - ok(hr == DD_OK, "Got unexpected hr %#x.\n", hr); + ok(hr == DD_OK, "Got unexpected hr %#lx.\n", hr);
hr = IDirectDraw7_TestCooperativeLevel(ddraw); - ok(hr == DD_OK, "Got unexpected hr %#x.\n", hr); + ok(hr == DD_OK, "Got unexpected hr %#lx.\n", hr); hr = IDirectDrawSurface7_IsLost(surface); - ok(hr == DD_OK, "Got unexpected hr %#x.\n", hr); + ok(hr == DD_OK, "Got unexpected hr %#lx.\n", hr); hr = IDirectDrawSurface7_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 = IDirectDrawSurface7_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 = IDirectDraw7_TestCooperativeLevel(ddraw); - ok(hr == DD_OK, "Got unexpected hr %#x.\n", hr); + ok(hr == DD_OK, "Got unexpected hr %#lx.\n", hr); hr = IDirectDrawSurface7_IsLost(surface); - ok(hr == DD_OK, "Got unexpected hr %#x.\n", hr); + ok(hr == DD_OK, "Got unexpected hr %#lx.\n", hr); hr = IDirectDrawSurface7_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 = IDirectDrawSurface7_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 = IDirectDraw7_TestCooperativeLevel(ddraw); - ok(hr == DD_OK, "Got unexpected hr %#x.\n", hr); + ok(hr == DD_OK, "Got unexpected hr %#lx.\n", hr); hr = IDirectDrawSurface7_IsLost(surface); - ok(hr == DD_OK, "Got unexpected hr %#x.\n", hr); + ok(hr == DD_OK, "Got unexpected hr %#lx.\n", hr); hr = IDirectDrawSurface7_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 = IDirectDrawSurface7_IsLost(vidmem_surface); - ok(hr == DD_OK, "Got unexpected hr %#x.\n", hr); + ok(hr == DD_OK, "Got unexpected hr %#lx.\n", hr); }
hr = IDirectDraw7_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 = IDirectDraw7_TestCooperativeLevel(ddraw); - ok(hr == DD_OK, "Got unexpected hr %#x.\n", hr); + ok(hr == DD_OK, "Got unexpected hr %#lx.\n", hr); hr = IDirectDrawSurface7_IsLost(surface); - ok(hr == DDERR_SURFACELOST, "Got unexpected hr %#x.\n", hr); + ok(hr == DDERR_SURFACELOST, "Got unexpected hr %#lx.\n", hr); hr = IDirectDrawSurface7_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 = IDirectDrawSurface7_IsLost(vidmem_surface); - ok(hr == DDERR_SURFACELOST, "Got unexpected hr %#x.\n", hr); + ok(hr == DDERR_SURFACELOST, "Got unexpected hr %#lx.\n", hr); }
hr = IDirectDraw7_RestoreAllSurfaces(ddraw); - ok(hr == DD_OK, "Got unexpected hr %#x.\n", hr); + ok(hr == DD_OK, "Got unexpected hr %#lx.\n", hr); hr = IDirectDraw7_TestCooperativeLevel(ddraw); - ok(hr == DD_OK, "Got unexpected hr %#x.\n", hr); + ok(hr == DD_OK, "Got unexpected hr %#lx.\n", hr); hr = IDirectDrawSurface7_IsLost(surface); - ok(hr == DD_OK, "Got unexpected hr %#x.\n", hr); + ok(hr == DD_OK, "Got unexpected hr %#lx.\n", hr); hr = IDirectDrawSurface7_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 = IDirectDrawSurface7_IsLost(vidmem_surface); - ok(hr == DD_OK, "Got unexpected hr %#x.\n", hr); + ok(hr == DD_OK, "Got unexpected hr %#lx.\n", hr); }
IDirectDrawSurface7_Release(surface); @@ -10226,115 +10209,115 @@ static void test_lost_device(void) surface_desc.ddsCaps.dwCaps = DDSCAPS_PRIMARYSURFACE | DDSCAPS_COMPLEX | DDSCAPS_FLIP; U5(surface_desc).dwBackBufferCount = 1; hr = IDirectDraw7_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 = IDirectDraw7_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 = IDirectDraw7_TestCooperativeLevel(ddraw); - ok(hr == DD_OK, "Got unexpected hr %#x.\n", hr); + ok(hr == DD_OK, "Got unexpected hr %#lx.\n", hr); hr = IDirectDrawSurface7_IsLost(surface); - ok(hr == DD_OK, "Got unexpected hr %#x.\n", hr); + ok(hr == DD_OK, "Got unexpected hr %#lx.\n", hr); hr = IDirectDrawSurface7_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 = IDirectDrawSurface7_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 = IDirectDrawSurface7_IsLost(vidmem_surface); - ok(hr == DD_OK, "Got unexpected hr %#x.\n", hr); + ok(hr == DD_OK, "Got unexpected hr %#lx.\n", hr); }
hr = IDirectDraw7_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 = IDirectDraw7_TestCooperativeLevel(ddraw); - ok(hr == DD_OK, "Got unexpected hr %#x.\n", hr); + ok(hr == DD_OK, "Got unexpected hr %#lx.\n", hr); hr = IDirectDrawSurface7_IsLost(surface); - ok(hr == DD_OK, "Got unexpected hr %#x.\n", hr); + ok(hr == DD_OK, "Got unexpected hr %#lx.\n", hr); hr = IDirectDrawSurface7_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 = IDirectDrawSurface7_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 = IDirectDrawSurface7_IsLost(vidmem_surface); - ok(hr == DD_OK, "Got unexpected hr %#x.\n", hr); + ok(hr == DD_OK, "Got unexpected hr %#lx.\n", hr); }
hr = IDirectDraw7_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 = IDirectDraw7_TestCooperativeLevel(ddraw); - ok(hr == DD_OK, "Got unexpected hr %#x.\n", hr); + ok(hr == DD_OK, "Got unexpected hr %#lx.\n", hr); hr = IDirectDrawSurface7_IsLost(surface); - ok(hr == DD_OK, "Got unexpected hr %#x.\n", hr); + ok(hr == DD_OK, "Got unexpected hr %#lx.\n", hr); hr = IDirectDrawSurface7_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 = IDirectDrawSurface7_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 = IDirectDrawSurface7_IsLost(vidmem_surface); - ok(hr == DD_OK, "Got unexpected hr %#x.\n", hr); + ok(hr == DD_OK, "Got unexpected hr %#lx.\n", hr); }
hr = IDirectDraw7_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 = IDirectDraw7_TestCooperativeLevel(ddraw); - ok(hr == DD_OK, "Got unexpected hr %#x.\n", hr); + ok(hr == DD_OK, "Got unexpected hr %#lx.\n", hr); hr = IDirectDrawSurface7_IsLost(surface); - ok(hr == DD_OK, "Got unexpected hr %#x.\n", hr); + ok(hr == DD_OK, "Got unexpected hr %#lx.\n", hr); hr = IDirectDrawSurface7_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 = IDirectDrawSurface7_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 = IDirectDrawSurface7_IsLost(vidmem_surface); - ok(hr == DD_OK, "Got unexpected hr %#x.\n", hr); + ok(hr == DD_OK, "Got unexpected hr %#lx.\n", hr); }
hr = IDirectDraw7_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 = IDirectDraw7_TestCooperativeLevel(ddraw); - ok(hr == DD_OK, "Got unexpected hr %#x.\n", hr); + ok(hr == DD_OK, "Got unexpected hr %#lx.\n", hr); hr = IDirectDrawSurface7_IsLost(surface); - ok(hr == DD_OK, "Got unexpected hr %#x.\n", hr); + ok(hr == DD_OK, "Got unexpected hr %#lx.\n", hr); hr = IDirectDrawSurface7_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 = IDirectDrawSurface7_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 = IDirectDrawSurface7_IsLost(vidmem_surface); - ok(hr == DD_OK, "Got unexpected hr %#x.\n", hr); + ok(hr == DD_OK, "Got unexpected hr %#lx.\n", hr); }
hr = IDirectDraw7_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 = IDirectDraw7_TestCooperativeLevel(ddraw); - ok(hr == DD_OK, "Got unexpected hr %#x.\n", hr); + ok(hr == DD_OK, "Got unexpected hr %#lx.\n", hr); hr = IDirectDrawSurface7_IsLost(surface); - ok(hr == DDERR_SURFACELOST, "Got unexpected hr %#x.\n", hr); + ok(hr == DDERR_SURFACELOST, "Got unexpected hr %#lx.\n", hr); hr = IDirectDrawSurface7_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 = IDirectDrawSurface7_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 = IDirectDrawSurface7_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 = IDirectDrawSurface7_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 = IDirectDrawSurface7_Restore(surface); - ok(hr == DD_OK, "Got unexpected hr %#x.\n", hr); + ok(hr == DD_OK, "Got unexpected hr %#lx.\n", hr); hr = IDirectDrawSurface7_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 = IDirectDrawSurface7_IsLost(back_buffer); - ok(hr == DD_OK, "Got unexpected hr %#x.\n", hr); + ok(hr == DD_OK, "Got unexpected hr %#lx.\n", hr);
IDirectDrawSurface7_Release(back_buffer);
@@ -10343,7 +10326,7 @@ static void test_lost_device(void) IDirectDrawSurface7_Release(sysmem_surface); IDirectDrawSurface7_Release(surface); refcount = IDirectDraw7_Release(ddraw); - ok(!refcount, "Got unexpected refcount %u.\n", refcount); + ok(!refcount, "Got unexpected refcount %lu.\n", refcount); DestroyWindow(window2); DestroyWindow(window1); } @@ -10386,12 +10369,12 @@ static void test_resource_priority(void) ddraw = create_ddraw(); ok(!!ddraw, "Failed to create a ddraw object.\n"); hr = IDirectDraw7_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 = IDirectDraw7_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 || !(hal_caps.ddsCaps.dwCaps & DDSCAPS2_TEXTUREMANAGE)) { @@ -10411,48 +10394,48 @@ static void test_resource_priority(void) hr = IDirectDraw7_CreateSurface(ddraw, &surface_desc, &surface, NULL); if (is_ddraw64 && (test_data[i].caps & DDSCAPS_TEXTURE)) { - todo_wine ok(hr == E_NOINTERFACE, "Got unexpected hr %#x, type %s.\n", hr, test_data[i].name); + todo_wine ok(hr == E_NOINTERFACE, "Got unexpected hr %#lx, type %s.\n", hr, test_data[i].name); if (SUCCEEDED(hr)) IDirectDrawSurface7_Release(surface); continue; } - ok(SUCCEEDED(hr), "Failed to create surface, hr %#x, type %s.\n", hr, test_data[i].name); + ok(SUCCEEDED(hr), "Failed to create surface, hr %#lx, type %s.\n", hr, test_data[i].name);
/* Priority == NULL segfaults. */ priority = 0xdeadbeef; hr = IDirectDrawSurface7_GetPriority(surface, &priority); - ok(hr == test_data[i].hr, "Got unexpected hr %#x, type %s.\n", hr, test_data[i].name); + ok(hr == test_data[i].hr, "Got unexpected hr %#lx, type %s.\n", hr, test_data[i].name); if (SUCCEEDED(test_data[i].hr)) - ok(priority == 0, "Got unexpected priority %u, type %s.\n", priority, test_data[i].name); + ok(priority == 0, "Got unexpected priority %lu, type %s.\n", priority, test_data[i].name); else - ok(priority == 0xdeadbeef, "Got unexpected priority %u, type %s.\n", priority, test_data[i].name); + ok(priority == 0xdeadbeef, "Got unexpected priority %lu, type %s.\n", priority, test_data[i].name);
if (!test_data[i].crash) { hr = IDirectDrawSurface7_SetPriority(surface, 1); - ok(hr == test_data[i].hr, "Got unexpected hr %#x, type %s.\n", hr, test_data[i].name); + ok(hr == test_data[i].hr, "Got unexpected hr %#lx, type %s.\n", hr, test_data[i].name); hr = IDirectDrawSurface7_GetPriority(surface, &priority); - ok(hr == test_data[i].hr, "Got unexpected hr %#x, type %s.\n", hr, test_data[i].name); + ok(hr == test_data[i].hr, "Got unexpected hr %#lx, type %s.\n", hr, test_data[i].name); if (SUCCEEDED(test_data[i].hr)) { - ok(priority == 1, "Got unexpected priority %u, type %s.\n", priority, test_data[i].name); + ok(priority == 1, "Got unexpected priority %lu, type %s.\n", priority, test_data[i].name); hr = IDirectDrawSurface7_SetPriority(surface, 2); - ok(hr == test_data[i].hr, "Got unexpected hr %#x, type %s.\n", hr, test_data[i].name); + ok(hr == test_data[i].hr, "Got unexpected hr %#lx, type %s.\n", hr, test_data[i].name); } else - ok(priority == 0xdeadbeef, "Got unexpected priority %u, type %s.\n", priority, test_data[i].name); + ok(priority == 0xdeadbeef, "Got unexpected priority %lu, type %s.\n", priority, test_data[i].name); }
if (test_data[i].caps2 & DDSCAPS2_CUBEMAP) { caps.dwCaps2 = DDSCAPS2_CUBEMAP_NEGATIVEZ; hr = IDirectDrawSurface7_GetAttachedSurface(surface, &caps, &mipmap); - 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); /* IDirectDrawSurface7_SetPriority crashes when called on non-positive X surfaces on Windows */ priority = 0xdeadbeef; hr = IDirectDrawSurface7_GetPriority(mipmap, &priority); - ok(hr == DDERR_INVALIDPARAMS, "Got unexpected hr %#x, type %s.\n", hr, test_data[i].name); - ok(priority == 0xdeadbeef, "Got unexpected priority %u, type %s.\n", priority, test_data[i].name); + ok(hr == DDERR_INVALIDPARAMS, "Got unexpected hr %#lx, type %s.\n", hr, test_data[i].name); + ok(priority == 0xdeadbeef, "Got unexpected priority %lu, type %s.\n", priority, test_data[i].name);
IDirectDrawSurface7_Release(mipmap); } @@ -10472,27 +10455,27 @@ static void test_resource_priority(void) surface_desc.ddsCaps.dwCaps2 = DDSCAPS2_TEXTUREMANAGE; U2(surface_desc).dwMipMapCount = 2; hr = IDirectDraw7_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); caps.dwCaps2 = 0; hr = IDirectDrawSurface7_GetAttachedSurface(surface, &caps, &mipmap); - ok(SUCCEEDED(hr), "Failed to get attached surface, hr %#x.\n", hr); + ok(SUCCEEDED(hr), "Failed to get attached surface, hr %#lx.\n", hr);
priority = 0xdeadbeef; hr = IDirectDrawSurface7_GetPriority(mipmap, &priority); - ok(hr == DDERR_INVALIDPARAMS, "Got unexpected hr %#x, type managed mipmap.\n", hr); - ok(priority == 0xdeadbeef, "Got unexpected priority %u, type managed mipmap.\n", priority); + ok(hr == DDERR_INVALIDPARAMS, "Got unexpected hr %#lx, type managed mipmap.\n", hr); + ok(priority == 0xdeadbeef, "Got unexpected priority %lu, type managed mipmap.\n", priority); /* SetPriority on the mipmap surface crashes. */ hr = IDirectDrawSurface7_GetPriority(surface, &priority); - ok(SUCCEEDED(hr), "Failed to get priority, hr %#x.\n", hr); - ok(priority == 0, "Got unexpected priority %u, type managed mipmap.\n", priority); + ok(SUCCEEDED(hr), "Failed to get priority, hr %#lx.\n", hr); + ok(priority == 0, "Got unexpected priority %lu, type managed mipmap.\n", priority);
IDirectDrawSurface7_Release(mipmap); refcount = IDirectDrawSurface7_Release(surface); - ok(!refcount, "Got unexpected refcount %u.\n", refcount); + ok(!refcount, "Got unexpected refcount %lu.\n", refcount);
done: refcount = IDirectDraw7_Release(ddraw); - ok(!refcount, "Got unexpected refcount %u.\n", refcount); + ok(!refcount, "Got unexpected refcount %lu.\n", refcount); DestroyWindow(window); }
@@ -10509,7 +10492,7 @@ static void test_surface_desc_lock(void) ddraw = create_ddraw(); ok(!!ddraw, "Failed to create a ddraw object.\n"); hr = IDirectDraw7_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); @@ -10518,36 +10501,36 @@ static void test_surface_desc_lock(void) surface_desc.dwHeight = 16; surface_desc.ddsCaps.dwCaps = DDSCAPS_OFFSCREENPLAIN; hr = IDirectDraw7_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 = IDirectDrawSurface7_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 = IDirectDrawSurface7_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 = IDirectDrawSurface7_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 = IDirectDrawSurface7_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 = IDirectDrawSurface7_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);
IDirectDrawSurface7_Release(surface); refcount = IDirectDraw7_Release(ddraw); - ok(!refcount, "Got unexpected refcount %u.\n", refcount); + ok(!refcount, "Got unexpected refcount %lu.\n", refcount); DestroyWindow(window); }
@@ -10556,9 +10539,9 @@ static void test_fog_interpolation(void) HRESULT hr; IDirect3DDevice7 *device; IDirectDrawSurface7 *rt; + unsigned int color, i; ULONG refcount; HWND window; - D3DCOLOR color; static struct { struct vec3 position; @@ -10577,7 +10560,6 @@ static void test_fog_interpolation(void) DWORD d; float f; } conv; - unsigned int i; static const struct { D3DFOGMODE vfog, tfog; @@ -10607,30 +10589,30 @@ static void test_fog_interpolation(void) }
hr = IDirect3DDevice7_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 = IDirect3DDevice7_GetCaps(device, &caps); - ok(SUCCEEDED(hr), "Failed to get device caps, hr %#x.\n", hr); + ok(SUCCEEDED(hr), "Failed to get device caps, hr %#lx.\n", hr); if (!(caps.dpcTriCaps.dwRasterCaps & D3DPRASTERCAPS_FOGTABLE)) skip("D3DPRASTERCAPS_FOGTABLE not supported, skipping some fog tests\n");
hr = IDirect3DDevice7_SetRenderState(device, D3DRENDERSTATE_LIGHTING, 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 = IDirect3DDevice7_SetRenderState(device, D3DRENDERSTATE_ZENABLE, 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 = IDirect3DDevice7_SetRenderState(device, D3DRENDERSTATE_FOGENABLE, 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 = IDirect3DDevice7_SetRenderState(device, D3DRENDERSTATE_FOGCOLOR, 0x0000ff00); - ok(SUCCEEDED(hr), "Failed to set render state, hr %#x.\n", hr); + ok(SUCCEEDED(hr), "Failed to set render state, hr %#lx.\n", hr); conv.f = 5.0; hr = IDirect3DDevice7_SetRenderState(device, D3DRENDERSTATE_FOGDENSITY, conv.d); - 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 = IDirect3DDevice7_SetTextureStageState(device, 0, D3DTSS_COLOROP, D3DTOP_SELECTARG1); - ok(SUCCEEDED(hr), "Failed to set texture stage state, hr %#x.\n", hr); + ok(SUCCEEDED(hr), "Failed to set texture stage state, hr %#lx.\n", hr); hr = IDirect3DDevice7_SetTextureStageState(device, 0, D3DTSS_COLORARG1, D3DTA_TFACTOR); - ok(SUCCEEDED(hr), "Failed to set texture stage state, hr %#x.\n", hr); + ok(SUCCEEDED(hr), "Failed to set texture stage state, hr %#lx.\n", hr); hr = IDirect3DDevice7_SetRenderState(device, D3DRENDERSTATE_TEXTUREFACTOR, 0x000000ff); - ok(SUCCEEDED(hr), "Failed to set render state, hr %#x.\n", hr); + ok(SUCCEEDED(hr), "Failed to set render state, hr %#lx.\n", hr);
for (i = 0; i < ARRAY_SIZE(tests); ++i) { @@ -10638,21 +10620,21 @@ static void test_fog_interpolation(void) continue;
hr = IDirect3DDevice7_Clear(device, 0, NULL, D3DCLEAR_TARGET, 0x00808080, 0.0f, 0); - ok(SUCCEEDED(hr), "Failed to clear, hr %#x.\n", hr); + ok(SUCCEEDED(hr), "Failed to clear, hr %#lx.\n", hr);
hr = IDirect3DDevice7_SetRenderState(device, D3DRENDERSTATE_SHADEMODE, tests[i].shade); - 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 = IDirect3DDevice7_SetRenderState(device, D3DRENDERSTATE_FOGVERTEXMODE, tests[i].vfog); - 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 = IDirect3DDevice7_SetRenderState(device, D3DRENDERSTATE_FOGTABLEMODE, tests[i].tfog); - 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 = IDirect3DDevice7_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 = IDirect3DDevice7_DrawPrimitive(device, D3DPT_TRIANGLESTRIP, D3DFVF_XYZ | D3DFVF_DIFFUSE | D3DFVF_SPECULAR, quad, 4, 0); - ok(SUCCEEDED(hr), "Failed to draw, hr %#x.\n", hr); + ok(SUCCEEDED(hr), "Failed to draw, hr %#lx.\n", hr); hr = IDirect3DDevice7_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, 0, 240); ok(compare_color(color, 0x000000ff, 2), "Got unexpected color 0x%08x, case %u.\n", color, i); @@ -10666,7 +10648,7 @@ static void test_fog_interpolation(void)
IDirectDrawSurface7_Release(rt); refcount = IDirect3DDevice7_Release(device); - ok(!refcount, "Device has %u references left.\n", refcount); + ok(!refcount, "Device has %lu references left.\n", refcount); DestroyWindow(window); }
@@ -10714,7 +10696,7 @@ static void test_fog_process_vertices(void) struct vertex vertex; D3DFOGMODE fog_vertex_mode, fog_table_mode; BOOL range_fog; - D3DCOLOR expected_color, expected_broken; + unsigned int expected_color, expected_broken; } tests[] = { @@ -10738,7 +10720,7 @@ static void test_fog_process_vertices(void) struct { struct vec4 position; - D3DCOLOR diffuse, specular; + unsigned int diffuse, specular; } *dst_data;
@@ -10761,42 +10743,42 @@ static void test_fog_process_vertices(void) return; } hr = IDirect3DDevice7_GetDirect3D(device, &d3d); - ok(hr == D3D_OK, "Got unexpected hr %#x.\n", hr); + ok(hr == D3D_OK, "Got unexpected hr %#lx.\n", hr);
hr = IDirect3DDevice7_SetTransform(device, D3DTRANSFORMSTATE_WORLD, &model_matrix); - ok(hr == D3D_OK, "Got unexpected hr %#x.\n", hr); + ok(hr == D3D_OK, "Got unexpected hr %#lx.\n", hr); hr = IDirect3DDevice7_SetTransform(device, D3DTRANSFORMSTATE_VIEW, &view_matrix); - ok(hr == D3D_OK, "Got unexpected hr %#x.\n", hr); + ok(hr == D3D_OK, "Got unexpected hr %#lx.\n", hr); hr = IDirect3DDevice7_SetTransform(device, D3DTRANSFORMSTATE_PROJECTION, &identity_matrix); - ok(hr == D3D_OK, "Got unexpected hr %#x.\n", hr); + ok(hr == D3D_OK, "Got unexpected hr %#lx.\n", hr);
memset(&vb_desc, 0, sizeof(vb_desc)); vb_desc.dwSize = sizeof(vb_desc); vb_desc.dwFVF = D3DFVF_XYZ | D3DFVF_NORMAL; vb_desc.dwNumVertices = 1; hr = IDirect3D7_CreateVertexBuffer(d3d, &vb_desc, &src_vb, 0); - ok(hr == D3D_OK, "Got unexpected hr %#x.\n", hr); + ok(hr == D3D_OK, "Got unexpected hr %#lx.\n", hr);
memset(&vb_desc, 0, sizeof(vb_desc)); vb_desc.dwSize = sizeof(vb_desc); vb_desc.dwFVF = D3DFVF_XYZRHW | D3DFVF_DIFFUSE | D3DFVF_SPECULAR; vb_desc.dwNumVertices = 1; hr = IDirect3D7_CreateVertexBuffer(d3d, &vb_desc, &dst_vb, 0); - ok(hr == D3D_OK, "Got unexpected hr %#x.\n", hr); + ok(hr == D3D_OK, "Got unexpected hr %#lx.\n", hr);
hr = IDirect3DDevice7_LightEnable(device, 0, TRUE); - ok(hr == D3D_OK, "Got unexpected hr %#x.\n", hr); + ok(hr == D3D_OK, "Got unexpected hr %#lx.\n", hr); hr = IDirect3DDevice7_SetRenderState(device, D3DRENDERSTATE_SPECULARENABLE, TRUE); - ok(hr == D3D_OK, "Got unexpected hr %#x.\n", hr); + ok(hr == D3D_OK, "Got unexpected hr %#lx.\n", hr); hr = IDirect3DDevice7_SetRenderState(device, D3DRENDERSTATE_LIGHTING, TRUE); - ok(hr == D3D_OK, "Got unexpected hr %#x.\n", hr); + ok(hr == D3D_OK, "Got unexpected hr %#lx.\n", hr); hr = IDirect3DDevice7_SetRenderState(device, D3DRENDERSTATE_FOGENABLE, TRUE); - ok(hr == D3D_OK, "Got unexpected hr %#x.\n", hr); + ok(hr == D3D_OK, "Got unexpected hr %#lx.\n", hr); hr = IDirect3DDevice7_SetRenderState(device, D3DRENDERSTATE_CLIPPING, FALSE); - ok(hr == D3D_OK, "Got unexpected hr %#x.\n", hr); + ok(hr == D3D_OK, "Got unexpected hr %#lx.\n", hr);
hr = IDirect3DDevice7_SetLight(device, 0, &directional_light); - ok(hr == D3D_OK, "Got unexpected hr %#x.\n", hr); + ok(hr == D3D_OK, "Got unexpected hr %#lx.\n", hr);
memset(&material, 0, sizeof(material)); U1(U2(material).specular).r = 0.0f; @@ -10805,7 +10787,7 @@ static void test_fog_process_vertices(void) U4(U2(material).specular).a = 0.5f; U4(material).power = 5.0f; hr = IDirect3DDevice7_SetMaterial(device, &material); - 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) { @@ -10813,27 +10795,27 @@ static void test_fog_process_vertices(void) tests[i].fog_vertex_mode); hr = IDirect3DDevice7_SetRenderState(device, D3DRENDERSTATE_FOGTABLEMODE, tests[i].fog_table_mode); - ok(hr == D3D_OK, "Got unexpected hr %#x.\n", hr); + ok(hr == D3D_OK, "Got unexpected hr %#lx.\n", hr); hr = IDirect3DDevice7_SetRenderState(device, D3DRENDERSTATE_RANGEFOGENABLE, tests[i].range_fog); - ok(hr == D3D_OK, "Got unexpected hr %#x.\n", hr); + ok(hr == D3D_OK, "Got unexpected hr %#lx.\n", hr);
hr = IDirect3DVertexBuffer7_Lock(src_vb, 0, (void **)&src_data, NULL); - ok(hr == D3D_OK, "Got unexpected hr %#x.\n", hr); + ok(hr == D3D_OK, "Got unexpected hr %#lx.\n", hr); *src_data = tests[i].vertex; hr = IDirect3DVertexBuffer7_Unlock(src_vb); - ok(hr == D3D_OK, "Got unexpected hr %#x.\n", hr); + ok(hr == D3D_OK, "Got unexpected hr %#lx.\n", hr);
hr = IDirect3DVertexBuffer7_Lock(dst_vb, 0, (void **)&dst_data, NULL); - ok(hr == D3D_OK, "Got unexpected hr %#x.\n", hr); + ok(hr == D3D_OK, "Got unexpected hr %#lx.\n", hr); memset(dst_data, 0, sizeof(*dst_data)); hr = IDirect3DVertexBuffer7_Unlock(dst_vb); - ok(hr == D3D_OK, "Got unexpected hr %#x.\n", hr); + ok(hr == D3D_OK, "Got unexpected hr %#lx.\n", hr); hr = IDirect3DVertexBuffer7_ProcessVertices(dst_vb, D3DVOP_TRANSFORM | D3DVOP_LIGHT, 0, 1, src_vb, 0, device, 0); - ok(hr == D3D_OK, "Got unexpected hr %#x.\n", hr); + ok(hr == D3D_OK, "Got unexpected hr %#lx.\n", hr);
hr = IDirect3DVertexBuffer7_Lock(dst_vb, 0, (void **)&dst_data, NULL); - ok(hr == D3D_OK, "Got unexpected hr %#x.\n", hr); + ok(hr == D3D_OK, "Got unexpected hr %#lx.\n", hr);
ok(compare_color(dst_data->specular, tests[i].expected_color, 1) || broken(tests[i].expected_broken @@ -10842,14 +10824,14 @@ static void test_fog_process_vertices(void) tests[i].expected_color, dst_data->specular, i);
hr = IDirect3DVertexBuffer7_Unlock(dst_vb); - ok(hr == D3D_OK, "Got unexpected hr %#x.\n", hr); + ok(hr == D3D_OK, "Got unexpected hr %#lx.\n", hr); }
IDirect3DVertexBuffer7_Release(dst_vb); IDirect3DVertexBuffer7_Release(src_vb); IDirect3D7_Release(d3d); refcount = IDirect3DDevice7_Release(device); - ok(!refcount, "Device has %u references left.\n", refcount); + ok(!refcount, "Device has %lu references left.\n", refcount); DestroyWindow(window); }
@@ -10858,9 +10840,9 @@ static void test_negative_fixedfunction_fog(void) HRESULT hr; IDirect3DDevice7 *device; IDirectDrawSurface7 *rt; + unsigned int color, i; ULONG refcount; HWND window; - D3DCOLOR color; static struct { struct vec3 position; @@ -10885,7 +10867,6 @@ static void test_negative_fixedfunction_fog(void) {{ 0.0f, 480.0f, -0.5f, 1.0f}, 0xffff0000}, {{640.0f, 480.0f, -0.5f, 1.0f}, 0xffff0000}, }; - unsigned int i; static D3DMATRIX zero = { 1.0f, 0.0f, 0.0f, 0.0f, @@ -10947,22 +10928,22 @@ static void test_negative_fixedfunction_fog(void) }
hr = IDirect3DDevice7_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 = IDirect3DDevice7_GetCaps(device, &caps); - ok(SUCCEEDED(hr), "Failed to get device caps, hr %#x.\n", hr); + ok(SUCCEEDED(hr), "Failed to get device caps, hr %#lx.\n", hr); if (!(caps.dpcTriCaps.dwRasterCaps & D3DPRASTERCAPS_FOGTABLE)) skip("D3DPRASTERCAPS_FOGTABLE not supported, skipping some fog tests.\n");
hr = IDirect3DDevice7_SetRenderState(device, D3DRENDERSTATE_LIGHTING, 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 = IDirect3DDevice7_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 = IDirect3DDevice7_SetRenderState(device, D3DRENDERSTATE_FOGENABLE, 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 = IDirect3DDevice7_SetRenderState(device, D3DRENDERSTATE_FOGCOLOR, 0x0000ff00); - 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 = IDirect3DDevice7_SetRenderState(device, D3DRENDERSTATE_CLIPPING, FALSE); - ok(SUCCEEDED(hr), "SetRenderState failed, hr %#x.\n", hr); + ok(SUCCEEDED(hr), "SetRenderState failed, hr %#lx.\n", hr);
for (i = 0; i < ARRAY_SIZE(tests); ++i) { @@ -10970,26 +10951,26 @@ static void test_negative_fixedfunction_fog(void) continue;
hr = IDirect3DDevice7_Clear(device, 0, NULL, D3DCLEAR_TARGET, 0x000000ff, 0.0f, 0); - ok(SUCCEEDED(hr), "Failed to clear, hr %#x.\n", hr); + ok(SUCCEEDED(hr), "Failed to clear, hr %#lx.\n", hr);
hr = IDirect3DDevice7_SetTransform(device, D3DTRANSFORMSTATE_PROJECTION, tests[i].matrix); - 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 = IDirect3DDevice7_SetRenderState(device, D3DRENDERSTATE_FOGSTART, tests[i].start.d); - 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 = IDirect3DDevice7_SetRenderState(device, D3DRENDERSTATE_FOGEND, tests[i].end.d); - 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 = IDirect3DDevice7_SetRenderState(device, D3DRENDERSTATE_FOGVERTEXMODE, tests[i].vfog); - 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 = IDirect3DDevice7_SetRenderState(device, D3DRENDERSTATE_FOGTABLEMODE, tests[i].tfog); - 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 = IDirect3DDevice7_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 = IDirect3DDevice7_DrawPrimitive(device, D3DPT_TRIANGLESTRIP, tests[i].pos_type | D3DFVF_DIFFUSE, tests[i].quad, 4, 0); - ok(SUCCEEDED(hr), "Failed to draw, hr %#x.\n", hr); + ok(SUCCEEDED(hr), "Failed to draw, hr %#lx.\n", hr); hr = IDirect3DDevice7_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, 0, 240); ok(compare_color(color, tests[i].color, 2) || broken(compare_color(color, tests[i].color_broken, 2)) @@ -10999,7 +10980,7 @@ static void test_negative_fixedfunction_fog(void)
IDirectDrawSurface7_Release(rt); refcount = IDirect3DDevice7_Release(device); - ok(!refcount, "Device has %u references left.\n", refcount); + ok(!refcount, "Device has %lu references left.\n", refcount); DestroyWindow(window); }
@@ -11008,9 +10989,9 @@ static void test_table_fog_zw(void) HRESULT hr; IDirect3DDevice7 *device; IDirectDrawSurface7 *rt; + unsigned int color, i; ULONG refcount; HWND window; - D3DCOLOR color; static struct { struct vec4 position; @@ -11035,7 +11016,7 @@ static void test_table_fog_zw(void) { float z, w; D3DZBUFFERTYPE z_test; - D3DCOLOR color; + unsigned int color; } tests[] = { @@ -11048,7 +11029,6 @@ static void test_table_fog_zw(void) {0.3f, 0.0f, D3DZB_TRUE, 0x00b24c00}, {0.3f, 0.0f, D3DZB_FALSE, 0x00b24c00}, }; - unsigned int i;
window = create_window(); if (!(device = create_device(window, DDSCL_NORMAL))) @@ -11059,33 +11039,33 @@ static void test_table_fog_zw(void) }
hr = IDirect3DDevice7_GetCaps(device, &caps); - ok(SUCCEEDED(hr), "Failed to get device caps, hr %#x.\n", hr); + ok(SUCCEEDED(hr), "Failed to get device caps, hr %#lx.\n", hr); if (!(caps.dpcTriCaps.dwRasterCaps & D3DPRASTERCAPS_FOGTABLE)) { skip("D3DPRASTERCAPS_FOGTABLE not supported, skipping POSITIONT table fog test.\n"); goto done; } hr = IDirect3DDevice7_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 = IDirect3DDevice7_SetRenderState(device, D3DRENDERSTATE_LIGHTING, 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 = IDirect3DDevice7_SetRenderState(device, D3DRENDERSTATE_FOGENABLE, 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 = IDirect3DDevice7_SetRenderState(device, D3DRENDERSTATE_FOGCOLOR, 0x0000ff00); - 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 = IDirect3DDevice7_SetRenderState(device, D3DRENDERSTATE_CLIPPING, FALSE); - ok(SUCCEEDED(hr), "SetRenderState failed, hr %#x.\n", hr); + ok(SUCCEEDED(hr), "SetRenderState failed, hr %#lx.\n", hr); /* Work around an AMD Windows driver bug. Needs a proj matrix applied redundantly. */ hr = IDirect3DDevice7_SetTransform(device, D3DTRANSFORMSTATE_PROJECTION, &identity); - 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 = IDirect3DDevice7_SetRenderState(device, D3DRENDERSTATE_FOGTABLEMODE, D3DFOG_LINEAR); - ok(SUCCEEDED(hr), "Failed to set render state, hr %#x.\n", hr); + ok(SUCCEEDED(hr), "Failed to set render state, hr %#lx.\n", hr);
for (i = 0; i < ARRAY_SIZE(tests); ++i) { hr = IDirect3DDevice7_Clear(device, 0, NULL, D3DCLEAR_TARGET | D3DCLEAR_ZBUFFER, 0x000000ff, 1.0f, 0); - ok(SUCCEEDED(hr), "Failed to clear, hr %#x.\n", hr); + ok(SUCCEEDED(hr), "Failed to clear, hr %#lx.\n", hr);
quad[0].position.z = tests[i].z; quad[1].position.z = tests[i].z; @@ -11096,15 +11076,15 @@ static void test_table_fog_zw(void) quad[2].position.w = tests[i].w; quad[3].position.w = tests[i].w; hr = IDirect3DDevice7_SetRenderState(device, D3DRENDERSTATE_ZENABLE, tests[i].z_test); - 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 = IDirect3DDevice7_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 = IDirect3DDevice7_DrawPrimitive(device, D3DPT_TRIANGLESTRIP, D3DFVF_XYZRHW | D3DFVF_DIFFUSE, quad, 4, 0); - ok(SUCCEEDED(hr), "Failed to draw, hr %#x.\n", hr); + ok(SUCCEEDED(hr), "Failed to draw, hr %#lx.\n", hr); hr = IDirect3DDevice7_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, 0, 240); ok(compare_color(color, tests[i].color, 2), @@ -11114,12 +11094,13 @@ static void test_table_fog_zw(void) IDirectDrawSurface7_Release(rt); done: refcount = IDirect3DDevice7_Release(device); - ok(!refcount, "Device has %u references left.\n", refcount); + ok(!refcount, "Device has %lu references left.\n", refcount); DestroyWindow(window); }
static void test_signed_formats(void) { + unsigned int color, expected_color; HRESULT hr; IDirect3DDevice7 *device; IDirect3D7 *d3d; @@ -11128,7 +11109,6 @@ static void test_signed_formats(void) DDSURFACEDESC2 surface_desc; ULONG refcount; HWND window; - D3DCOLOR color, expected_color; static struct { struct vec3 position; @@ -11199,7 +11179,7 @@ static void test_signed_formats(void) }, /* No V16U16 or Q8W8V8U8 support in ddraw. */ }; - static const D3DCOLOR expected_colors[4][4] = + static const unsigned int expected_colors[4][4] = { {0x00808080, 0x00fefeff, 0x00010780, 0x008080ff}, {0x00018080, 0x00800180, 0x0080fe80, 0x00fe8080}, @@ -11218,7 +11198,7 @@ static void test_signed_formats(void) }
hr = IDirect3DDevice7_GetCaps(device, &device_desc); - ok(SUCCEEDED(hr), "Failed to get device caps, hr %#x.\n", hr); + ok(SUCCEEDED(hr), "Failed to get device caps, hr %#lx.\n", hr); if (!(device_desc.dwTextureOpCaps & D3DTEXOPCAPS_BLENDFACTORALPHA)) { skip("D3DTOP_BLENDFACTORALPHA not supported, skipping bumpmap format tests.\n"); @@ -11226,31 +11206,31 @@ static void test_signed_formats(void) }
hr = IDirect3DDevice7_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 = IDirect3D7_QueryInterface(d3d, &IID_IDirectDraw7, (void **)&ddraw); - ok(SUCCEEDED(hr), "Failed to get ddraw interface, hr %#x.\n", hr); + ok(SUCCEEDED(hr), "Failed to get ddraw interface, hr %#lx.\n", hr); hr = IDirect3DDevice7_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 = IDirect3DDevice7_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);
/* dst = tex * 0.5 + 1.0 * (1.0 - 0.5) = tex * 0.5 + 0.5 */ hr = IDirect3DDevice7_SetRenderState(device, D3DRENDERSTATE_TEXTUREFACTOR, 0x80ffffff); - 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 = IDirect3DDevice7_SetTextureStageState(device, 0, D3DTSS_COLOROP, D3DTOP_BLENDFACTORALPHA); - ok(SUCCEEDED(hr), "Failed to set texture stage state, hr %#x.\n", hr); + ok(SUCCEEDED(hr), "Failed to set texture stage state, hr %#lx.\n", hr); hr = IDirect3DDevice7_SetTextureStageState(device, 0, D3DTSS_COLORARG1, D3DTA_TEXTURE); - ok(SUCCEEDED(hr), "Failed to set texture stage state, hr %#x.\n", hr); + ok(SUCCEEDED(hr), "Failed to set texture stage state, hr %#lx.\n", hr); hr = IDirect3DDevice7_SetTextureStageState(device, 0, D3DTSS_COLORARG2, D3DTA_TFACTOR); - ok(SUCCEEDED(hr), "Failed to set texture stage state, hr %#x.\n", hr); + ok(SUCCEEDED(hr), "Failed to set texture stage state, hr %#lx.\n", hr);
for (i = 0; i < ARRAY_SIZE(formats); ++i) { for (width = 1; width < 5; width += 3) { hr = IDirect3DDevice7_Clear(device, 0, NULL, D3DCLEAR_TARGET, 0x00000000, 0.0f, 0); - 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(&surface_desc, 0, sizeof(surface_desc)); surface_desc.dwSize = sizeof(surface_desc); @@ -11265,14 +11245,14 @@ static void test_signed_formats(void) skip("%s textures not supported, skipping.\n", formats[i].name); continue; } - ok(SUCCEEDED(hr), "Failed to create surface, hr %#x, format %s.\n", hr, formats[i].name); + ok(SUCCEEDED(hr), "Failed to create surface, hr %#lx, format %s.\n", hr, formats[i].name); hr = IDirect3DDevice7_SetTexture(device, 0, surface); - ok(SUCCEEDED(hr), "Failed to set texture, hr %#x, format %s.\n", hr, formats[i].name); + ok(SUCCEEDED(hr), "Failed to set texture, hr %#lx, format %s.\n", hr, formats[i].name);
memset(&surface_desc, 0, sizeof(surface_desc)); surface_desc.dwSize = sizeof(surface_desc); hr = IDirectDrawSurface7_Lock(surface, NULL, &surface_desc, 0, NULL); - ok(SUCCEEDED(hr), "Failed to lock surface, hr %#x, format %s.\n", hr, formats[i].name); + ok(SUCCEEDED(hr), "Failed to lock surface, hr %#lx, format %s.\n", hr, formats[i].name); for (y = 0; y < 4; y++) { memcpy((char *)surface_desc.lpSurface + y * U1(surface_desc).lPitch, @@ -11280,15 +11260,15 @@ static void test_signed_formats(void) width * formats[i].pixel_size); } hr = IDirectDrawSurface7_Unlock(surface, NULL); - ok(SUCCEEDED(hr), "Failed to unlock surface, hr %#x, format %s.\n", hr, formats[i].name); + ok(SUCCEEDED(hr), "Failed to unlock surface, hr %#lx, format %s.\n", hr, formats[i].name);
hr = IDirect3DDevice7_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 = IDirect3DDevice7_DrawPrimitive(device, D3DPT_TRIANGLESTRIP, D3DFVF_XYZ | D3DFVF_TEX1, quad, 4, 0); - ok(SUCCEEDED(hr), "Failed to draw, hr %#x.\n", hr); + ok(SUCCEEDED(hr), "Failed to draw, hr %#lx.\n", hr); hr = IDirect3DDevice7_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 (y = 0; y < 4; y++) { @@ -11317,7 +11297,7 @@ static void test_signed_formats(void)
done: refcount = IDirect3DDevice7_Release(device); - ok(!refcount, "Device has %u references left.\n", refcount); + ok(!refcount, "Device has %lu references left.\n", refcount); DestroyWindow(window); }
@@ -11329,13 +11309,12 @@ static void test_color_fill(void) IDirectDraw7 *ddraw; IDirectDrawSurface7 *surface, *surface2; DDSURFACEDESC2 surface_desc; + unsigned int i, *color; DDPIXELFORMAT z_fmt; ULONG refcount; HWND window; - unsigned int i; DDBLTFX fx; RECT rect = {5, 5, 7, 7}; - DWORD *color; DWORD supported_fmts = 0, num_fourcc_codes, *fourcc_codes; DDCAPS hal_caps; static const struct @@ -11344,7 +11323,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; } @@ -11508,9 +11487,9 @@ static void test_color_fill(void) }
hr = IDirect3DDevice7_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 = IDirect3D7_QueryInterface(d3d, &IID_IDirectDraw7, (void **)&ddraw); - ok(SUCCEEDED(hr), "Failed to get ddraw interface, hr %#x.\n", hr); + ok(SUCCEEDED(hr), "Failed to get ddraw interface, hr %#lx.\n", hr);
memset(&z_fmt, 0, sizeof(z_fmt)); IDirect3D7_EnumZBufferFormats(d3d, &IID_IDirect3DHALDevice, enum_z_fmt, &z_fmt); @@ -11524,13 +11503,13 @@ static void test_color_fill(void) IDirect3D7_Release(d3d);
hr = IDirectDraw7_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 = IDirectDraw7_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')) @@ -11543,7 +11522,7 @@ static void test_color_fill(void) memset(&hal_caps, 0, sizeof(hal_caps)); hal_caps.dwSize = sizeof(hal_caps); hr = IDirectDraw7_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 (!(supported_fmts & (SUPPORT_YUY2 | SUPPORT_UYVY)) || !(hal_caps.dwCaps & DDCAPS_OVERLAY)) skip("Overlays or some YUV formats not supported, skipping YUV colorfill tests.\n"); @@ -11598,16 +11577,16 @@ static void test_color_fill(void) }
hr = IDirectDraw7_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 = IDirectDrawSurface7_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 = IDirectDrawSurface7_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) @@ -11615,19 +11594,19 @@ static void test_color_fill(void) memset(&surface_desc, 0, sizeof(surface_desc)); surface_desc.dwSize = sizeof(surface_desc); hr = IDirectDrawSurface7_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 = IDirectDrawSurface7_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 = IDirectDrawSurface7_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 = IDirectDrawSurface7_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) @@ -11635,22 +11614,22 @@ static void test_color_fill(void) memset(&surface_desc, 0, sizeof(surface_desc)); surface_desc.dwSize = sizeof(surface_desc); hr = IDirectDrawSurface7_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 & U3(z_fmt).dwZBitMask) == (tests[i].result & U3(z_fmt).dwZBitMask) || broken((*color & U3(z_fmt).dwZBitMask) == (expected_broken & U3(z_fmt).dwZBitMask)), - "Got clear result 0x%08x, expected 0x%08x, surface %s.\n", + "Got clear result 0x%08lx, expected 0x%08lx, surface %s.\n", *color & U3(z_fmt).dwZBitMask, tests[i].result & U3(z_fmt).dwZBitMask, tests[i].name); hr = IDirectDrawSurface7_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 = IDirectDrawSurface7_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) @@ -11658,19 +11637,19 @@ static void test_color_fill(void) memset(&surface_desc, 0, sizeof(surface_desc)); surface_desc.dwSize = sizeof(surface_desc); hr = IDirectDrawSurface7_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 = IDirectDrawSurface7_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 = IDirectDrawSurface7_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) @@ -11678,13 +11657,13 @@ static void test_color_fill(void) memset(&surface_desc, 0, sizeof(surface_desc)); surface_desc.dwSize = sizeof(surface_desc); hr = IDirectDrawSurface7_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 = IDirectDrawSurface7_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); }
IDirectDrawSurface7_Release(surface); @@ -11708,78 +11687,78 @@ static void test_color_fill(void) U4(U4(surface_desc).ddpfPixelFormat).dwBBitMask = 0x000000ff; surface_desc.ddsCaps.dwCaps = DDSCAPS_OFFSCREENPLAIN | DDSCAPS_SYSTEMMEMORY; hr = IDirectDraw7_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 = IDirectDraw7_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 = IDirectDrawSurface7_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 = IDirectDrawSurface7_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 = IDirectDrawSurface7_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 = IDirectDrawSurface7_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 = IDirectDrawSurface7_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 = IDirectDrawSurface7_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 = IDirectDrawSurface7_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 = IDirectDrawSurface7_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 = IDirectDrawSurface7_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 = IDirectDrawSurface7_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 = IDirectDrawSurface7_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 = IDirectDrawSurface7_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 = IDirectDrawSurface7_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 = IDirectDrawSurface7_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 = IDirectDrawSurface7_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 = IDirectDrawSurface7_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 = IDirectDrawSurface7_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 = IDirectDrawSurface7_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 = IDirectDrawSurface7_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 = IDirectDrawSurface7_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 = IDirectDrawSurface7_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 = IDirectDrawSurface7_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 = IDirectDrawSurface7_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 = IDirectDrawSurface7_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); }
IDirectDrawSurface7_Release(surface2); @@ -11796,54 +11775,54 @@ static void test_color_fill(void) U4(surface_desc).ddpfPixelFormat = z_fmt; surface_desc.ddsCaps.dwCaps = DDSCAPS_ZBUFFER; hr = IDirectDraw7_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 = IDirectDraw7_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 = IDirectDrawSurface7_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 = IDirectDrawSurface7_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 = IDirectDrawSurface7_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 = IDirectDrawSurface7_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 = IDirectDrawSurface7_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 = IDirectDrawSurface7_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 = IDirectDrawSurface7_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 = IDirectDrawSurface7_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 = IDirectDrawSurface7_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 = IDirectDrawSurface7_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 = IDirectDrawSurface7_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 = IDirectDrawSurface7_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 = IDirectDrawSurface7_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 = IDirectDrawSurface7_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);
IDirectDrawSurface7_Release(surface2); IDirectDrawSurface7_Release(surface); @@ -11851,7 +11830,7 @@ static void test_color_fill(void) done: IDirectDraw7_Release(ddraw); refcount = IDirect3DDevice7_Release(device); - ok(!refcount, "Device has %u references left.\n", refcount); + ok(!refcount, "Device has %lu references left.\n", refcount); DestroyWindow(window); }
@@ -11880,6 +11859,7 @@ static void test_texcoordindex(void) }; static const DWORD fvf = D3DFVF_XYZ | D3DFVF_TEX3; IDirect3DDevice7 *device; + unsigned int color; IDirect3D7 *d3d; IDirectDraw7 *ddraw; IDirectDrawSurface7 *rt; @@ -11888,7 +11868,6 @@ static void test_texcoordindex(void) IDirectDrawSurface7 *texture1, *texture2; DDSURFACEDESC2 surface_desc; ULONG refcount; - D3DCOLOR color; DWORD *ptr;
window = create_window(); @@ -11900,13 +11879,13 @@ static void test_texcoordindex(void) }
hr = IDirect3DDevice7_GetDirect3D(device, &d3d); - ok(SUCCEEDED(hr), "Failed to get Direct3D7 interface, hr %#x.\n", hr); + ok(SUCCEEDED(hr), "Failed to get Direct3D7 interface, hr %#lx.\n", hr); hr = IDirect3D7_QueryInterface(d3d, &IID_IDirectDraw7, (void **)&ddraw); - ok(SUCCEEDED(hr), "Failed to get DirectDraw7 interface, hr %#x.\n", hr); + ok(SUCCEEDED(hr), "Failed to get DirectDraw7 interface, hr %#lx.\n", hr); IDirect3D7_Release(d3d);
hr = IDirect3DDevice7_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); @@ -11922,14 +11901,14 @@ static void test_texcoordindex(void) U4(U4(surface_desc).ddpfPixelFormat).dwBBitMask = 0x000000ff; U5(U4(surface_desc).ddpfPixelFormat).dwRGBAlphaBitMask = 0xff000000; hr = IDirectDraw7_CreateSurface(ddraw, &surface_desc, &texture1, NULL); - ok(SUCCEEDED(hr), "Failed to create surface, hr %#x.\n", hr); + ok(SUCCEEDED(hr), "Failed to create surface, hr %#lx.\n", hr); hr = IDirectDraw7_CreateSurface(ddraw, &surface_desc, &texture2, 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 = IDirectDrawSurface7_Lock(texture1, 0, &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); ptr = surface_desc.lpSurface; ptr[0] = 0xff000000; ptr[1] = 0xff00ff00; @@ -11937,12 +11916,12 @@ static void test_texcoordindex(void) ptr[0] = 0xff0000ff; ptr[1] = 0xff00ffff; hr = IDirectDrawSurface7_Unlock(texture1, 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, 0, sizeof(surface_desc)); surface_desc.dwSize = sizeof(surface_desc); hr = IDirectDrawSurface7_Lock(texture2, 0, &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); ptr = surface_desc.lpSurface; ptr[0] = 0xff000000; ptr[1] = 0xff0000ff; @@ -11950,44 +11929,44 @@ static void test_texcoordindex(void) ptr[0] = 0xffff0000; ptr[1] = 0xffff00ff; hr = IDirectDrawSurface7_Unlock(texture2, 0); - ok(SUCCEEDED(hr), "Failed to unlock surface, hr %#x.\n", hr); + ok(SUCCEEDED(hr), "Failed to unlock surface, hr %#lx.\n", hr);
hr = IDirect3DDevice7_SetTexture(device, 0, texture1); - ok(SUCCEEDED(hr), "Failed to set texture, hr %#x.\n", hr); + ok(SUCCEEDED(hr), "Failed to set texture, hr %#lx.\n", hr); hr = IDirect3DDevice7_SetTexture(device, 1, texture2); - ok(SUCCEEDED(hr), "Failed to set texture, hr %#x.\n", hr); + ok(SUCCEEDED(hr), "Failed to set texture, hr %#lx.\n", hr); hr = IDirect3DDevice7_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 = IDirect3DDevice7_SetTextureStageState(device, 0, D3DTSS_COLOROP, D3DTOP_SELECTARG1); - ok(SUCCEEDED(hr), "Failed to set color op, hr %#x.\n", hr); + ok(SUCCEEDED(hr), "Failed to set color op, hr %#lx.\n", hr); hr = IDirect3DDevice7_SetTextureStageState(device, 0, D3DTSS_COLORARG1, D3DTA_TEXTURE); - ok(SUCCEEDED(hr), "Failed to set color arg, hr %#x.\n", hr); + ok(SUCCEEDED(hr), "Failed to set color arg, hr %#lx.\n", hr); hr = IDirect3DDevice7_SetTextureStageState(device, 1, D3DTSS_COLOROP, D3DTOP_ADD); - ok(SUCCEEDED(hr), "Failed to set color op, hr %#x.\n", hr); + ok(SUCCEEDED(hr), "Failed to set color op, hr %#lx.\n", hr); hr = IDirect3DDevice7_SetTextureStageState(device, 1, D3DTSS_COLORARG1, D3DTA_TEXTURE); - ok(SUCCEEDED(hr), "Failed to set color arg, hr %#x.\n", hr); + ok(SUCCEEDED(hr), "Failed to set color arg, hr %#lx.\n", hr); hr = IDirect3DDevice7_SetTextureStageState(device, 1, D3DTSS_COLORARG2, D3DTA_CURRENT); - ok(SUCCEEDED(hr), "Failed to set color arg, hr %#x.\n", hr); + ok(SUCCEEDED(hr), "Failed to set color arg, hr %#lx.\n", hr); hr = IDirect3DDevice7_SetTextureStageState(device, 2, D3DTSS_COLOROP, D3DTOP_DISABLE); - ok(SUCCEEDED(hr), "Failed to set color op, hr %#x.\n", hr); + ok(SUCCEEDED(hr), "Failed to set color op, hr %#lx.\n", hr);
hr = IDirect3DDevice7_SetTextureStageState(device, 0, D3DTSS_TEXCOORDINDEX, 1); - ok(SUCCEEDED(hr), "Failed to set texcoord index, hr %#x.\n", hr); + ok(SUCCEEDED(hr), "Failed to set texcoord index, hr %#lx.\n", hr); hr = IDirect3DDevice7_SetTextureStageState(device, 1, D3DTSS_TEXCOORDINDEX, 0); - ok(SUCCEEDED(hr), "Failed to set texcoord index, hr %#x.\n", hr); + ok(SUCCEEDED(hr), "Failed to set texcoord index, hr %#lx.\n", hr);
hr = IDirect3DDevice7_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 = IDirect3DDevice7_Clear(device, 0, NULL, D3DCLEAR_TARGET, 0xffffff00, 1.0f, 0); - ok(SUCCEEDED(hr), "Failed to clear, hr %#x.\n", hr); + ok(SUCCEEDED(hr), "Failed to clear, hr %#lx.\n", hr);
hr = IDirect3DDevice7_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 = IDirect3DDevice7_DrawPrimitive(device, D3DPT_TRIANGLESTRIP, fvf, quad, 4, 0); - ok(SUCCEEDED(hr), "Failed to draw, hr %#x.\n", hr); + ok(SUCCEEDED(hr), "Failed to draw, hr %#lx.\n", hr); hr = IDirect3DDevice7_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, 120); ok(compare_color(color, 0x000000ff, 2), "Got unexpected color 0x%08x.\n", color); @@ -11999,19 +11978,19 @@ static void test_texcoordindex(void) ok(compare_color(color, 0x00ffffff, 2), "Got unexpected color 0x%08x.\n", color);
hr = IDirect3DDevice7_SetTextureStageState(device, 1, D3DTSS_TEXTURETRANSFORMFLAGS, D3DTTFF_COUNT2); - ok(SUCCEEDED(hr), "Failed to set texture transform flags, hr %#x.\n", hr); + ok(SUCCEEDED(hr), "Failed to set texture transform flags, hr %#lx.\n", hr); hr = IDirect3DDevice7_SetTransform(device, D3DTRANSFORMSTATE_TEXTURE1, &mat); - ok(SUCCEEDED(hr), "Failed to set transformation matrix, hr %#x.\n", hr); + ok(SUCCEEDED(hr), "Failed to set transformation matrix, hr %#lx.\n", hr);
hr = IDirect3DDevice7_Clear(device, 0, NULL, D3DCLEAR_TARGET, 0xffffff00, 1.0f, 0); - ok(SUCCEEDED(hr), "Failed to clear, hr %#x.\n", hr); + ok(SUCCEEDED(hr), "Failed to clear, hr %#lx.\n", hr);
hr = IDirect3DDevice7_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 = IDirect3DDevice7_DrawPrimitive(device, D3DPT_TRIANGLESTRIP, fvf, quad, 4, 0); - ok(SUCCEEDED(hr), "Failed to draw, hr %#x.\n", hr); + ok(SUCCEEDED(hr), "Failed to draw, hr %#lx.\n", hr); hr = IDirect3DDevice7_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, 120); ok(compare_color(color, 0x000000ff, 2), "Got unexpected color 0x%08x.\n", color); @@ -12023,19 +12002,19 @@ static void test_texcoordindex(void) ok(compare_color(color, 0x0000ffff, 2), "Got unexpected color 0x%08x.\n", color);
hr = IDirect3DDevice7_SetTextureStageState(device, 1, D3DTSS_TEXTURETRANSFORMFLAGS, D3DTTFF_DISABLE); - ok(SUCCEEDED(hr), "Failed to set texture transform flags, hr %#x.\n", hr); + ok(SUCCEEDED(hr), "Failed to set texture transform flags, hr %#lx.\n", hr); hr = IDirect3DDevice7_SetTextureStageState(device, 1, D3DTSS_TEXCOORDINDEX, 2); - ok(SUCCEEDED(hr), "Failed to set texcoord index, hr %#x.\n", hr); + ok(SUCCEEDED(hr), "Failed to set texcoord index, hr %#lx.\n", hr);
hr = IDirect3DDevice7_Clear(device, 0, NULL, D3DCLEAR_TARGET, 0xffffff00, 1.0f, 0); - ok(SUCCEEDED(hr), "Failed to clear, hr %#x.\n", hr); + ok(SUCCEEDED(hr), "Failed to clear, hr %#lx.\n", hr);
hr = IDirect3DDevice7_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 = IDirect3DDevice7_DrawPrimitive(device, D3DPT_TRIANGLESTRIP, fvf, quad, 4, 0); - ok(SUCCEEDED(hr), "Failed to draw, hr %#x.\n", hr); + ok(SUCCEEDED(hr), "Failed to draw, hr %#lx.\n", hr); hr = IDirect3DDevice7_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, 120); ok(compare_color(color, 0x000000ff, 2), "Got unexpected color 0x%08x.\n", color); @@ -12052,7 +12031,7 @@ static void test_texcoordindex(void) IDirectDrawSurface7_Release(rt); IDirectDraw7_Release(ddraw); refcount = IDirect3DDevice7_Release(device); - ok(!refcount, "Device has %u references left.\n", refcount); + ok(!refcount, "Device has %lu references left.\n", refcount); DestroyWindow(window); }
@@ -12113,18 +12092,16 @@ static void test_colorkey_precision(void) }, };
+ unsigned int data[4] = {0}, color_mask, color, t, c; IDirectDrawSurface7 *src, *dst, *texture; DDSURFACEDESC2 surface_desc, lock_desc; - DWORD data[4] = {0}, color_mask; IDirect3DDevice7 *device; IDirectDrawSurface7 *rt; IDirectDraw7 *ddraw; - unsigned int t, c; DDCOLORKEY ckey; IDirect3D7 *d3d; BOOL is_nvidia; ULONG refcount; - D3DCOLOR color; HWND window; HRESULT hr; DDBLTFX fx; @@ -12138,12 +12115,12 @@ static void test_colorkey_precision(void) }
hr = IDirect3DDevice7_GetDirect3D(device, &d3d); - ok(hr == DD_OK, "Got unexpected hr %#x.\n", hr); + ok(hr == DD_OK, "Got unexpected hr %#lx.\n", hr); hr = IDirect3D7_QueryInterface(d3d, &IID_IDirectDraw7, (void **)&ddraw); - ok(hr == DD_OK, "Got unexpected hr %#x.\n", hr); + ok(hr == DD_OK, "Got unexpected hr %#lx.\n", hr); IDirect3D7_Release(d3d); hr = IDirect3DDevice7_GetRenderTarget(device, &rt); - ok(hr == DD_OK, "Got unexpected hr %#x.\n", hr); + ok(hr == DD_OK, "Got unexpected hr %#lx.\n", hr);
is_nvidia = ddraw_is_nvidia(ddraw); /* The Windows 8 WARP driver has plenty of false negatives in X8R8G8B8 @@ -12158,23 +12135,23 @@ static void test_colorkey_precision(void) }
hr = IDirect3DDevice7_SetRenderState(device, D3DRENDERSTATE_LIGHTING, FALSE); - ok(hr == DD_OK, "Got unexpected hr %#x.\n", hr); + ok(hr == DD_OK, "Got unexpected hr %#lx.\n", hr); hr = IDirect3DDevice7_SetRenderState(device, D3DRENDERSTATE_ZENABLE, D3DZB_FALSE); - ok(hr == DD_OK, "Got unexpected hr %#x.\n", hr); + ok(hr == DD_OK, "Got unexpected hr %#lx.\n", hr); hr = IDirect3DDevice7_SetRenderState(device, D3DRENDERSTATE_COLORKEYENABLE, TRUE); - ok(hr == DD_OK, "Got unexpected hr %#x.\n", hr); + ok(hr == DD_OK, "Got unexpected hr %#lx.\n", hr); /* Multiply the texture read result with 0, that way the result color if the key doesn't * match is constant. In theory color keying works without reading the texture result * (meaning we could just op=arg1, arg1=tfactor), but the Geforce7 Windows driver begs * to differ. */ hr = IDirect3DDevice7_SetTextureStageState(device, 0, D3DTSS_COLOROP, D3DTOP_MODULATE); - ok(hr == DD_OK, "Got unexpected hr %#x.\n", hr); + ok(hr == DD_OK, "Got unexpected hr %#lx.\n", hr); hr = IDirect3DDevice7_SetTextureStageState(device, 0, D3DTSS_COLORARG1, D3DTA_TEXTURE); - ok(hr == DD_OK, "Got unexpected hr %#x.\n", hr); + ok(hr == DD_OK, "Got unexpected hr %#lx.\n", hr); hr = IDirect3DDevice7_SetTextureStageState(device, 0, D3DTSS_COLORARG2, D3DTA_TFACTOR); - ok(hr == DD_OK, "Got unexpected hr %#x.\n", hr); + ok(hr == DD_OK, "Got unexpected hr %#lx.\n", hr); hr = IDirect3DDevice7_SetRenderState(device, D3DRENDERSTATE_TEXTUREFACTOR, 0x00000000); - ok(hr == DD_OK, "Got unexpected hr %#x.\n", hr); + ok(hr == DD_OK, "Got unexpected hr %#lx.\n", hr);
memset(&fx, 0, sizeof(fx)); fx.dwSize = sizeof(fx); @@ -12199,9 +12176,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 = IDirectDraw7_CreateSurface(ddraw, &surface_desc, &src, NULL); - ok(hr == DD_OK, "Got unexpected hr %#x.\n", hr); + ok(hr == DD_OK, "Got unexpected hr %#lx.\n", hr); hr = IDirectDraw7_CreateSurface(ddraw, &surface_desc, &dst, NULL); - ok(hr == DD_OK, "Got unexpected hr %#x.\n", hr); + ok(hr == DD_OK, "Got unexpected hr %#lx.\n", hr);
U5(fx).dwFillColor = tests[t].clear; /* On the w8 testbot (WARP driver) the blit result has different values in the @@ -12219,15 +12196,15 @@ static void test_colorkey_precision(void) surface_desc.ddckCKSrcBlt.dwColorSpaceLowValue = c << tests[t].shift; surface_desc.ddckCKSrcBlt.dwColorSpaceHighValue = c << tests[t].shift; hr = IDirectDraw7_CreateSurface(ddraw, &surface_desc, &texture, NULL); - ok(hr == DD_OK, "Got unexpected hr %#x.\n", hr); + ok(hr == DD_OK, "Got unexpected hr %#lx.\n", hr); hr = IDirect3DDevice7_SetTexture(device, 0, texture); - ok(hr == DD_OK, "Got unexpected hr %#x.\n", hr); + ok(hr == DD_OK, "Got unexpected hr %#lx.\n", hr);
hr = IDirectDrawSurface7_Blt(dst, 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 = IDirectDrawSurface7_Lock(src, NULL, &lock_desc, DDLOCK_WAIT, NULL); - ok(hr == DD_OK, "Got unexpected hr %#x.\n", hr); + ok(hr == DD_OK, "Got unexpected hr %#lx.\n", hr); switch (tests[t].bpp) { case 4: @@ -12245,21 +12222,21 @@ static void test_colorkey_precision(void) break; } hr = IDirectDrawSurface7_Unlock(src, 0); - ok(hr == DD_OK, "Got unexpected hr %#x.\n", hr); + ok(hr == DD_OK, "Got unexpected hr %#lx.\n", hr); hr = IDirectDrawSurface7_Blt(texture, NULL, src, NULL, DDBLT_WAIT, NULL); - ok(hr == DD_OK, "Got unexpected hr %#x.\n", hr); + ok(hr == DD_OK, "Got unexpected hr %#lx.\n", hr);
ckey.dwColorSpaceLowValue = c << tests[t].shift; ckey.dwColorSpaceHighValue = c << tests[t].shift; hr = IDirectDrawSurface7_SetColorKey(src, DDCKEY_SRCBLT, &ckey); - ok(hr == DD_OK, "Got unexpected hr %#x.\n", hr); + ok(hr == DD_OK, "Got unexpected hr %#lx.\n", hr);
hr = IDirectDrawSurface7_Blt(dst, NULL, src, NULL, DDBLT_KEYSRC | DDBLT_WAIT, NULL); - ok(hr == DD_OK, "Got unexpected hr %#x.\n", hr); + ok(hr == DD_OK, "Got unexpected hr %#lx.\n", hr);
/* Don't make this read only, it somehow breaks the detection of the Nvidia bug below. */ hr = IDirectDrawSurface7_Lock(dst, NULL, &lock_desc, DDLOCK_WAIT, NULL); - ok(hr == DD_OK, "Got unexpected hr %#x.\n", hr); + ok(hr == DD_OK, "Got unexpected hr %#lx.\n", hr); switch (tests[t].bpp) { case 4: @@ -12277,7 +12254,7 @@ static void test_colorkey_precision(void) break; } hr = IDirectDrawSurface7_Unlock(dst, 0); - ok(hr == DD_OK, "Got unexpected hr %#x.\n", hr); + ok(hr == DD_OK, "Got unexpected hr %#lx.\n", hr);
if (!c) { @@ -12319,14 +12296,14 @@ static void test_colorkey_precision(void) (c + 1) << tests[t].shift, data[2], tests[t].name, c);
hr = IDirect3DDevice7_Clear(device, 0, NULL, D3DCLEAR_TARGET, 0x0000ff00, 1.0f, 0); - ok(hr == DD_OK, "Got unexpected hr %#x.\n", hr); + ok(hr == DD_OK, "Got unexpected hr %#lx.\n", hr);
hr = IDirect3DDevice7_BeginScene(device); - ok(hr == DD_OK, "Got unexpected hr %#x.\n", hr); + ok(hr == DD_OK, "Got unexpected hr %#lx.\n", hr); hr = IDirect3DDevice7_DrawPrimitive(device, D3DPT_TRIANGLESTRIP, D3DFVF_XYZ | D3DFVF_TEX1, quad, 4, 0); - ok(hr == DD_OK, "Got unexpected hr %#x.\n", hr); + ok(hr == DD_OK, "Got unexpected hr %#lx.\n", hr); hr = IDirect3DDevice7_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, 80, 240);
@@ -12359,7 +12336,7 @@ done: IDirectDrawSurface7_Release(rt); IDirectDraw7_Release(ddraw); refcount = IDirect3DDevice7_Release(device); - ok(!refcount, "Device has %u references left.\n", refcount); + ok(!refcount, "Device has %lu references left.\n", refcount); DestroyWindow(window); }
@@ -12377,7 +12354,7 @@ static void test_range_colorkey(void) ddraw = create_ddraw(); ok(!!ddraw, "Failed to create a ddraw object.\n"); hr = IDirectDraw7_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); @@ -12396,99 +12373,98 @@ static void test_range_colorkey(void) surface_desc.ddckCKSrcBlt.dwColorSpaceLowValue = 0x00000000; surface_desc.ddckCKSrcBlt.dwColorSpaceHighValue = 0x00000001; hr = IDirectDraw7_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 = IDirectDraw7_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 = IDirectDraw7_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 = IDirectDraw7_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 = IDirectDraw7_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 = IDirectDrawSurface7_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 = IDirectDrawSurface7_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 = IDirectDrawSurface7_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 = IDirectDrawSurface7_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 = IDirectDrawSurface7_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 = IDirectDrawSurface7_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 = IDirectDrawSurface7_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 = IDirectDrawSurface7_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 = IDirectDrawSurface7_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 = IDirectDrawSurface7_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);
IDirectDrawSurface7_Release(surface); refcount = IDirectDraw7_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) { IDirect3DVertexBuffer7 *vb_strip, *vb_list, *buffer; + unsigned int color0, color1, i, count; IDirect3DDevice7 *device; D3DVERTEXBUFFERDESC desc; IDirectDrawSurface7 *rt; - DWORD color0, color1; void *data = NULL; IDirect3D7 *d3d; ULONG refcount; - UINT i, count; HWND window; HRESULT hr; static const struct @@ -12517,7 +12493,7 @@ static void test_shademode(void) { DWORD primtype; DWORD shademode; - DWORD color0, color1; + unsigned int color0, color1; } tests[] = { @@ -12538,14 +12514,14 @@ static void test_shademode(void) }
hr = IDirect3DDevice7_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 = IDirect3DDevice7_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 = IDirect3DDevice7_SetRenderState(device, D3DRENDERSTATE_LIGHTING, FALSE); - ok(hr == D3D_OK, "Failed to disable lighting, hr %#x.\n", hr); + ok(hr == D3D_OK, "Failed to disable lighting, hr %#lx.\n", hr); hr = IDirect3DDevice7_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);
memset(&desc, 0, sizeof(desc)); desc.dwSize = sizeof(desc); @@ -12553,21 +12529,21 @@ static void test_shademode(void) desc.dwFVF = D3DFVF_XYZ | D3DFVF_DIFFUSE; desc.dwNumVertices = ARRAY_SIZE(quad_strip); hr = IDirect3D7_CreateVertexBuffer(d3d, &desc, &vb_strip, 0); - ok(hr == D3D_OK, "Failed to create vertex buffer, hr %#x.\n", hr); + ok(hr == D3D_OK, "Failed to create vertex buffer, hr %#lx.\n", hr); hr = IDirect3DVertexBuffer7_Lock(vb_strip, 0, &data, NULL); - ok(hr == D3D_OK, "Failed to lock vertex buffer, hr %#x.\n", hr); + ok(hr == D3D_OK, "Failed to lock vertex buffer, hr %#lx.\n", hr); memcpy(data, quad_strip, sizeof(quad_strip)); hr = IDirect3DVertexBuffer7_Unlock(vb_strip); - ok(hr == D3D_OK, "Failed to unlock vertex buffer, hr %#x.\n", hr); + ok(hr == D3D_OK, "Failed to unlock vertex buffer, hr %#lx.\n", hr);
desc.dwNumVertices = ARRAY_SIZE(quad_list); hr = IDirect3D7_CreateVertexBuffer(d3d, &desc, &vb_list, 0); - ok(hr == D3D_OK, "Failed to create vertex buffer, hr %#x.\n", hr); + ok(hr == D3D_OK, "Failed to create vertex buffer, hr %#lx.\n", hr); hr = IDirect3DVertexBuffer7_Lock(vb_list, 0, &data, NULL); - ok(hr == D3D_OK, "Failed to lock vertex buffer, hr %#x.\n", hr); + ok(hr == D3D_OK, "Failed to lock vertex buffer, hr %#lx.\n", hr); memcpy(data, quad_list, sizeof(quad_list)); hr = IDirect3DVertexBuffer7_Unlock(vb_list); - ok(hr == D3D_OK, "Failed to unlock vertex buffer, hr %#x.\n", hr); + ok(hr == D3D_OK, "Failed to unlock vertex buffer, 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. */ @@ -12575,19 +12551,19 @@ static void test_shademode(void) for (i = 0; i < ARRAY_SIZE(tests); ++i) { hr = IDirect3DDevice7_Clear(device, 0, NULL, D3DCLEAR_TARGET, 0xffffffff, 0.0f, 0); - ok(hr == D3D_OK, "Failed to clear, hr %#x.\n", hr); + ok(hr == D3D_OK, "Failed to clear, hr %#lx.\n", hr);
hr = IDirect3DDevice7_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 = IDirect3DDevice7_BeginScene(device); - ok(SUCCEEDED(hr), "Failed to begin scene, hr %#x.\n", hr); + ok(SUCCEEDED(hr), "Failed to begin scene, hr %#lx.\n", hr); buffer = tests[i].primtype == D3DPT_TRIANGLESTRIP ? vb_strip : vb_list; count = tests[i].primtype == D3DPT_TRIANGLESTRIP ? 4 : 6; hr = IDirect3DDevice7_DrawPrimitiveVB(device, tests[i].primtype, buffer, 0, count, 0); - ok(SUCCEEDED(hr), "Failed to draw, hr %#x.\n", hr); + ok(SUCCEEDED(hr), "Failed to draw, hr %#lx.\n", hr); hr = IDirect3DDevice7_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 */ @@ -12608,7 +12584,7 @@ static void test_shademode(void) IDirectDrawSurface7_Release(rt); IDirect3D7_Release(d3d); refcount = IDirect3DDevice7_Release(device); - ok(!refcount, "Device has %u references left.\n", refcount); + ok(!refcount, "Device has %lu references left.\n", refcount); DestroyWindow(window); }
@@ -12672,12 +12648,12 @@ static void test_lockrect_invalid(void) ddraw = create_ddraw(); ok(!!ddraw, "Failed to create a ddraw object.\n"); hr = IDirectDraw7_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 = IDirectDraw7_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 || !(hal_caps.ddsCaps.dwCaps & DDSCAPS2_TEXTUREMANAGE)) { @@ -12704,21 +12680,21 @@ static void test_lockrect_invalid(void) hr = IDirectDraw7_CreateSurface(ddraw, &surface_desc, &surface, NULL); if (!resources[r].allowed) { - ok(hr == DDERR_INVALIDCAPS, "Got unexpected hr %#x, type %s.\n", hr, resources[r].name); + ok(hr == DDERR_INVALIDCAPS, "Got unexpected hr %#lx, type %s.\n", hr, resources[r].name); continue; } if (is_ddraw64 && (resources[r].caps & DDSCAPS_TEXTURE)) { - todo_wine ok(hr == E_NOINTERFACE, "Got unexpected hr %#x, type %s.\n", hr, resources[r].name); + todo_wine ok(hr == E_NOINTERFACE, "Got unexpected hr %#lx, type %s.\n", hr, resources[r].name); if (SUCCEEDED(hr)) IDirectDrawSurface7_Release(surface); continue; } - 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);
/* Crashes in ddraw7 hr = IDirectDrawSurface7_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) @@ -12729,11 +12705,11 @@ static void test_lockrect_invalid(void) locked_desc.dwSize = sizeof(locked_desc);
hr = IDirectDrawSurface7_Lock(surface, rect, &locked_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 = IDirectDrawSurface7_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) @@ -12745,37 +12721,37 @@ static void test_lockrect_invalid(void)
hr = IDirectDrawSurface7_Lock(surface, rect, &locked_desc, DDLOCK_WAIT, NULL); todo_wine_if (SUCCEEDED(resources[r].hr)) - 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 = IDirectDrawSurface7_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(!locked_desc.lpSurface, "Got unexpected lpSurface %p.\n", locked_desc.lpSurface); }
hr = IDirectDrawSurface7_Lock(surface, NULL, &locked_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 = IDirectDrawSurface7_Lock(surface, NULL, &locked_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 = IDirectDrawSurface7_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 = IDirectDrawSurface7_Lock(surface, &valid[0], &locked_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 = IDirectDrawSurface7_Lock(surface, &valid[0], &locked_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 = IDirectDrawSurface7_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);
IDirectDrawSurface7_Release(surface); } @@ -12800,7 +12776,7 @@ static void test_yv12_overlay(void) ddraw = create_ddraw(); ok(!!ddraw, "Failed to create a ddraw object.\n"); hr = IDirectDraw7_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')))) { @@ -12811,17 +12787,17 @@ static void test_yv12_overlay(void) memset(&desc, 0, sizeof(desc)); desc.dwSize = sizeof(desc); hr = IDirectDrawSurface7_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; @@ -12842,7 +12818,7 @@ static void test_yv12_overlay(void) }
hr = IDirectDrawSurface7_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 @@ -12850,12 +12826,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 = IDirectDrawSurface7_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 = IDirectDrawSurface7_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')))) { @@ -12869,14 +12845,14 @@ static void test_yv12_overlay(void) hr = IDirectDrawSurface7_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 = IDirectDrawSurface7_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]); @@ -12886,7 +12862,7 @@ static void test_yv12_overlay(void) ok(base[0] == 0x30, "Got unexpected U data 0x%02x.\n", base[0]);
hr = IDirectDrawSurface7_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); }
IDirectDrawSurface7_Release(dst_surface); @@ -12922,7 +12898,7 @@ static void test_offscreen_overlay(void) ddraw = create_ddraw(); ok(!!ddraw, "Failed to create a ddraw object.\n"); hr = IDirectDraw7_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')))) { @@ -12935,21 +12911,21 @@ static void test_offscreen_overlay(void) surface_desc.dwFlags = DDSD_CAPS; surface_desc.ddsCaps.dwCaps = DDSCAPS_PRIMARYSURFACE; hr = IDirectDraw7_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 = IDirectDrawSurface7_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 = IDirectDrawSurface7_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 = IDirectDrawSurface7_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 = IDirectDrawSurface7_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)); @@ -12966,18 +12942,18 @@ static void test_offscreen_overlay(void) U3(U4(surface_desc).ddpfPixelFormat).dwGBitMask = 0x07e0; U4(U4(surface_desc).ddpfPixelFormat).dwBBitMask = 0x001f; hr = IDirectDraw7_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 = IDirectDrawSurface7_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 = IDirectDrawSurface7_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 = IDirectDrawSurface7_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);
IDirectDrawSurface7_Release(offscreen); IDirectDrawSurface7_Release(primary); @@ -13002,7 +12978,7 @@ static void test_overlay_rect(void) ddraw = create_ddraw(); ok(!!ddraw, "Failed to create a ddraw object.\n"); hr = IDirectDraw7_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')))) { @@ -13015,15 +12991,15 @@ static void test_overlay_rect(void) surface_desc.dwFlags = DDSD_CAPS; surface_desc.ddsCaps.dwCaps = DDSCAPS_PRIMARYSURFACE; hr = IDirectDraw7_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 = IDirectDrawSurface7_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 = IDirectDrawSurface7_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()) @@ -13036,48 +13012,48 @@ static void test_overlay_rect(void) * used. This is not true in Windows Vista and earlier, but changed in * Windows 7. */ hr = IDirectDrawSurface7_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 = IDirectDrawSurface7_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 = IDirectDrawSurface7_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 = IDirectDrawSurface7_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 = IDirectDrawSurface7_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 = IDirectDrawSurface7_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 = IDirectDrawSurface7_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 = IDirectDrawSurface7_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 = IDirectDrawSurface7_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) @@ -13129,12 +13105,12 @@ static void test_blt(void) }
hr = IDirect3DDevice7_GetDirect3D(device, &d3d); - ok(SUCCEEDED(hr), "Failed to get Direct3D7 interface, hr %#x.\n", hr); + ok(SUCCEEDED(hr), "Failed to get Direct3D7 interface, hr %#lx.\n", hr); hr = IDirect3D7_QueryInterface(d3d, &IID_IDirectDraw7, (void **)&ddraw); - ok(SUCCEEDED(hr), "Failed to get DirectDraw7 interface, hr %#x.\n", hr); + ok(SUCCEEDED(hr), "Failed to get DirectDraw7 interface, hr %#lx.\n", hr); IDirect3D7_Release(d3d); hr = IDirect3DDevice7_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); @@ -13143,37 +13119,37 @@ static void test_blt(void) surface_desc.dwHeight = 480; surface_desc.ddsCaps.dwCaps = DDSCAPS_OFFSCREENPLAIN; hr = IDirectDraw7_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 = IDirectDrawSurface7_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 = IDirectDrawSurface7_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 = IDirectDrawSurface7_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 = IDirectDrawSurface7_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 = IDirectDrawSurface7_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 = IDirectDrawSurface7_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); }
IDirectDrawSurface7_Release(surface); IDirectDrawSurface7_Release(rt); IDirectDraw7_Release(ddraw); refcount = IDirect3DDevice7_Release(device); - ok(!refcount, "Device has %u references left.\n", refcount); + ok(!refcount, "Device has %lu references left.\n", refcount); DestroyWindow(window); }
@@ -13201,11 +13177,10 @@ static void test_blt_z_alpha(void) }; IDirectDrawSurface7 *src_surface, *dst_surface; DDSURFACEDESC2 surface_desc; + unsigned int color, i; IDirectDraw7 *ddraw; DDPIXELFORMAT pf; ULONG refcount; - unsigned int i; - D3DCOLOR color; HWND window; HRESULT hr; DDBLTFX fx; @@ -13214,7 +13189,7 @@ static void test_blt_z_alpha(void) ddraw = create_ddraw(); ok(!!ddraw, "Failed to create a ddraw object.\n"); hr = IDirectDraw7_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); @@ -13234,9 +13209,9 @@ static void test_blt_z_alpha(void) surface_desc.ddsCaps.dwCaps = DDSCAPS_OFFSCREENPLAIN;
hr = IDirectDraw7_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 = IDirectDraw7_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); @@ -13256,14 +13231,14 @@ static void test_blt_z_alpha(void) { U5(fx).dwFillColor = 0x3300ff00; hr = IDirectDrawSurface7_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 = IDirectDrawSurface7_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 = IDirectDrawSurface7_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); @@ -13272,7 +13247,7 @@ static void test_blt_z_alpha(void) IDirectDrawSurface7_Release(dst_surface); IDirectDrawSurface7_Release(src_surface); refcount = IDirectDraw7_Release(ddraw); - ok(!refcount, "DirectDraw has %u references left.\n", refcount); + ok(!refcount, "DirectDraw has %lu references left.\n", refcount); DestroyWindow(window); }
@@ -13283,9 +13258,9 @@ static void test_cross_device_blt(void) IDirectDraw7 *ddraw, *ddraw2; DDSURFACEDESC2 surface_desc; HWND window, window2; + unsigned int color; IDirect3D7 *d3d; ULONG refcount; - D3DCOLOR color; DDBLTFX fx; HRESULT hr;
@@ -13308,15 +13283,15 @@ static void test_cross_device_blt(void) }
hr = IDirect3DDevice7_GetDirect3D(device, &d3d); - ok(SUCCEEDED(hr), "Failed to get Direct3D7 interface, hr %#x.\n", hr); + ok(SUCCEEDED(hr), "Failed to get Direct3D7 interface, hr %#lx.\n", hr); hr = IDirect3D7_QueryInterface(d3d, &IID_IDirectDraw7, (void **)&ddraw); - ok(SUCCEEDED(hr), "Failed to get DirectDraw7 interface, hr %#x.\n", hr); + ok(SUCCEEDED(hr), "Failed to get DirectDraw7 interface, hr %#lx.\n", hr); IDirect3D7_Release(d3d);
hr = IDirect3DDevice7_GetDirect3D(device2, &d3d); - ok(SUCCEEDED(hr), "Failed to get Direct3D7 interface, hr %#x.\n", hr); + ok(SUCCEEDED(hr), "Failed to get Direct3D7 interface, hr %#lx.\n", hr); hr = IDirect3D7_QueryInterface(d3d, &IID_IDirectDraw7, (void **)&ddraw2); - ok(SUCCEEDED(hr), "Failed to get DirectDraw7 interface, hr %#x.\n", hr); + ok(SUCCEEDED(hr), "Failed to get DirectDraw7 interface, hr %#lx.\n", hr); IDirect3D7_Release(d3d);
memset(&surface_desc, 0, sizeof(surface_desc)); @@ -13326,7 +13301,7 @@ static void test_cross_device_blt(void) surface_desc.dwHeight = 480; surface_desc.ddsCaps.dwCaps = DDSCAPS_OFFSCREENPLAIN | DDSCAPS_SYSTEMMEMORY; hr = IDirectDraw7_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); @@ -13334,7 +13309,7 @@ static void test_cross_device_blt(void) surface_desc.ddsCaps.dwCaps = DDSCAPS_PRIMARYSURFACE | DDSCAPS_COMPLEX | DDSCAPS_FLIP | DDSCAPS_VIDEOMEMORY; U5(surface_desc).dwBackBufferCount = 2; hr = IDirectDraw7_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); @@ -13349,35 +13324,35 @@ static void test_cross_device_blt(void) U3(U4(surface_desc).ddpfPixelFormat).dwGBitMask = 0x000003e0; U4(U4(surface_desc).ddpfPixelFormat).dwBBitMask = 0x0000001f; hr = IDirectDraw7_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 = IDirectDrawSurface7_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 = IDirectDrawSurface7_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 = IDirectDrawSurface7_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 = IDirectDrawSurface7_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 = IDirectDrawSurface7_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 = IDirectDraw7_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 = IDirectDrawSurface7_IsLost(sysmem_surface); - ok(hr == D3D_OK, "Got unexpected hr %#x.\n", hr); + ok(hr == D3D_OK, "Got unexpected hr %#lx.\n", hr);
hr = IDirectDrawSurface7_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);
@@ -13389,12 +13364,12 @@ static void test_cross_device_blt(void) surface_desc.dwHeight = 480; surface_desc.ddsCaps.dwCaps = DDSCAPS_OFFSCREENPLAIN | DDSCAPS_SYSTEMMEMORY; hr = IDirectDraw7_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 = IDirectDrawSurface7_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 = IDirectDrawSurface7_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);
@@ -13404,9 +13379,9 @@ static void test_cross_device_blt(void) IDirectDraw7_Release(ddraw); IDirectDraw7_Release(ddraw2); refcount = IDirect3DDevice7_Release(device); - ok(!refcount, "Device has %u references left.\n", refcount); + ok(!refcount, "Device has %lu references left.\n", refcount); refcount = IDirect3DDevice7_Release(device2); - ok(!refcount, "Device has %u references left.\n", refcount); + ok(!refcount, "Device has %lu references left.\n", refcount); DestroyWindow(window); DestroyWindow(window2); } @@ -13429,8 +13404,8 @@ static void test_color_clamping(void) }; IDirect3DDevice7 *device; IDirectDrawSurface7 *rt; + unsigned int color; ULONG refcount; - D3DCOLOR color; HWND window; HRESULT hr;
@@ -13443,60 +13418,60 @@ static void test_color_clamping(void) }
hr = IDirect3DDevice7_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 = IDirect3DDevice7_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 = IDirect3DDevice7_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 = IDirect3DDevice7_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 = IDirect3DDevice7_SetRenderState(device, D3DRENDERSTATE_CLIPPING, FALSE); - ok(SUCCEEDED(hr), "Failed to disable clipping, hr %#x.\n", hr); + ok(SUCCEEDED(hr), "Failed to disable clipping, hr %#lx.\n", hr); hr = IDirect3DDevice7_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 = IDirect3DDevice7_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 = IDirect3DDevice7_SetRenderState(device, D3DRENDERSTATE_STENCILENABLE, FALSE); - ok(SUCCEEDED(hr), "Failed to disable stencil test, hr %#x.\n", hr); + ok(SUCCEEDED(hr), "Failed to disable stencil test, hr %#lx.\n", hr); hr = IDirect3DDevice7_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 = IDirect3DDevice7_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 = IDirect3DDevice7_SetRenderState(device, D3DRENDERSTATE_TEXTUREFACTOR, 0xff404040); - ok(SUCCEEDED(hr), "Failed to set texture factor, hr %#x.\n", hr); + ok(SUCCEEDED(hr), "Failed to set texture factor, hr %#lx.\n", hr); hr = IDirect3DDevice7_SetTextureStageState(device, 0, D3DTSS_COLOROP, D3DTOP_ADD); - ok(SUCCEEDED(hr), "Failed to set color op, hr %#x.\n", hr); + ok(SUCCEEDED(hr), "Failed to set color op, hr %#lx.\n", hr); hr = IDirect3DDevice7_SetTextureStageState(device, 0, D3DTSS_COLORARG1, D3DTA_DIFFUSE); - ok(SUCCEEDED(hr), "Failed to set color arg, hr %#x.\n", hr); + ok(SUCCEEDED(hr), "Failed to set color arg, hr %#lx.\n", hr); hr = IDirect3DDevice7_SetTextureStageState(device, 0, D3DTSS_COLORARG2, D3DTA_SPECULAR); - ok(SUCCEEDED(hr), "Failed to set color arg, hr %#x.\n", hr); + ok(SUCCEEDED(hr), "Failed to set color arg, hr %#lx.\n", hr); hr = IDirect3DDevice7_SetTextureStageState(device, 1, D3DTSS_COLOROP, D3DTOP_MODULATE); - ok(SUCCEEDED(hr), "Failed to set color op, hr %#x.\n", hr); + ok(SUCCEEDED(hr), "Failed to set color op, hr %#lx.\n", hr); hr = IDirect3DDevice7_SetTextureStageState(device, 1, D3DTSS_COLORARG1, D3DTA_TFACTOR); - ok(SUCCEEDED(hr), "Failed to set color arg, hr %#x.\n", hr); + ok(SUCCEEDED(hr), "Failed to set color arg, hr %#lx.\n", hr); hr = IDirect3DDevice7_SetTextureStageState(device, 1, D3DTSS_COLORARG2, D3DTA_CURRENT); - ok(SUCCEEDED(hr), "Failed to set color arg, hr %#x.\n", hr); + ok(SUCCEEDED(hr), "Failed to set color arg, hr %#lx.\n", hr);
hr = IDirect3DDevice7_Clear(device, 0, NULL, D3DCLEAR_TARGET, 0xff00ff00, 0.0f, 0); - ok(SUCCEEDED(hr), "Failed to clear, hr %#x.\n", hr); + ok(SUCCEEDED(hr), "Failed to clear, hr %#lx.\n", hr);
hr = IDirect3DDevice7_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 = IDirect3DDevice7_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 = IDirect3DDevice7_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, 0x00404040, 1), "Got unexpected color 0x%08x.\n", color);
IDirectDrawSurface7_Release(rt); refcount = IDirect3DDevice7_Release(device); - ok(!refcount, "Device has %u references left.\n", refcount); + ok(!refcount, "Device has %lu references left.\n", refcount); DestroyWindow(window); }
@@ -13568,11 +13543,11 @@ static void test_getdc(void) ddraw = create_ddraw(); ok(!!ddraw, "Failed to create a ddraw object.\n"); hr = IDirectDraw7_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 = IDirectDraw7_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(U4(surface_desc).ddpfPixelFormat).dwRGBBitCount;
for (i = 0; i < ARRAY_SIZE(test_data); ++i) @@ -13591,7 +13566,7 @@ static void test_getdc(void) surface_desc.ddsCaps.dwCaps2 = DDSCAPS2_TEXTUREMANAGE; if (FAILED(hr = IDirectDraw7_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; } } @@ -13600,9 +13575,9 @@ static void test_getdc(void) hr = IDirectDrawSurface7_GetDC(surface, &dc); if (test_data[i].getdc_supported) ok(SUCCEEDED(hr) || broken(hr == test_data[i].alt_result), - "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)) { @@ -13613,10 +13588,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); @@ -13640,11 +13615,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); @@ -13653,17 +13628,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) @@ -13672,20 +13647,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 = IDirectDrawSurface7_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 { @@ -13701,149 +13676,149 @@ static void test_getdc(void) surface_desc.ddsCaps.dwCaps2 = DDSCAPS2_CUBEMAP | DDSCAPS2_CUBEMAP_ALLFACES | DDSCAPS2_TEXTUREMANAGE; if (FAILED(hr = IDirectDraw7_CreateSurface(ddraw, &surface_desc, &surface, NULL))) { - skip("Failed to create cube texture for format %s (hr %#x), skipping tests.\n", test_data[i].name, hr); + skip("Failed to create cube texture for format %s (hr %#lx), skipping tests.\n", test_data[i].name, hr); continue; }
hr = IDirectDrawSurface7_GetAttachedSurface(surface, &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); hr = IDirectDrawSurface7_GetAttachedSurface(surface2, &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); IDirectDrawSurface7_Release(surface2); hr = IDirectDrawSurface7_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); IDirectDrawSurface7_Release(tmp);
hr = IDirectDrawSurface7_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 = IDirectDrawSurface7_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 = IDirectDrawSurface7_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 = IDirectDrawSurface7_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 = IDirectDrawSurface7_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 = IDirectDrawSurface7_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 = IDirectDrawSurface7_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 = IDirectDrawSurface7_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 = IDirectDrawSurface7_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 = IDirectDrawSurface7_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 = IDirectDrawSurface7_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 = IDirectDrawSurface7_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 = IDirectDrawSurface7_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 = IDirectDrawSurface7_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 = IDirectDrawSurface7_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 = IDirectDrawSurface7_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 = IDirectDrawSurface7_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 = IDirectDrawSurface7_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 = IDirectDrawSurface7_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 = IDirectDrawSurface7_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 = IDirectDrawSurface7_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 = IDirectDrawSurface7_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 = IDirectDrawSurface7_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 = IDirectDrawSurface7_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 = IDirectDrawSurface7_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 = IDirectDrawSurface7_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 = IDirectDrawSurface7_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 = IDirectDrawSurface7_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 = IDirectDrawSurface7_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 = IDirectDrawSurface7_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 = IDirectDrawSurface7_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 = IDirectDrawSurface7_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 = IDirectDrawSurface7_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 = IDirectDrawSurface7_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 = IDirectDrawSurface7_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 = IDirectDrawSurface7_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 = IDirectDrawSurface7_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 = IDirectDrawSurface7_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 = IDirectDrawSurface7_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 = IDirectDrawSurface7_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 = IDirectDrawSurface7_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 = IDirectDrawSurface7_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 = IDirectDrawSurface7_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 = IDirectDrawSurface7_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 = IDirectDrawSurface7_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 = IDirectDrawSurface7_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 = IDirectDrawSurface7_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 = IDirectDrawSurface7_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 = IDirectDrawSurface7_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 = IDirectDrawSurface7_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 = IDirectDrawSurface7_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 = IDirectDrawSurface7_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 = IDirectDrawSurface7_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 = IDirectDrawSurface7_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 = IDirectDrawSurface7_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 = IDirectDrawSurface7_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 = IDirectDrawSurface7_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);
IDirectDrawSurface7_Release(surface2); IDirectDrawSurface7_Release(surface); @@ -13883,84 +13858,84 @@ static void test_draw_primitive(void) }
hr = IDirect3DDevice7_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 = IDirect3D7_QueryInterface(d3d, &IID_IDirectDraw7, (void **)&ddraw); - ok(SUCCEEDED(hr), "Failed to get DirectDraw7 interface, hr %#x.\n", hr); + ok(SUCCEEDED(hr), "Failed to get DirectDraw7 interface, hr %#lx.\n", hr);
memset(&vb_desc, 0, sizeof(vb_desc)); vb_desc.dwSize = sizeof(vb_desc); vb_desc.dwFVF = D3DFVF_XYZ; vb_desc.dwNumVertices = 4; hr = IDirect3D7_CreateVertexBuffer(d3d, &vb_desc, &vb, 0); - ok(SUCCEEDED(hr), "Failed to create vertex buffer, hr %#x.\n", hr); + ok(SUCCEEDED(hr), "Failed to create vertex buffer, hr %#lx.\n", hr);
IDirect3D7_Release(d3d);
memset(&strided, 0, sizeof(strided));
hr = IDirect3DDevice7_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 = IDirect3DDevice7_DrawIndexedPrimitiveStrided(device, D3DPT_TRIANGLESTRIP, D3DFVF_XYZ, &strided, 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 = IDirect3DDevice7_DrawIndexedPrimitiveVB(device, D3DPT_TRIANGLESTRIP, vb, 0, 0, NULL, 0, 0); - todo_wine ok(hr == E_FAIL, "Got unexpected hr %#x.\n", hr); + todo_wine ok(hr == E_FAIL, "Got unexpected hr %#lx.\n", hr); hr = IDirect3DDevice7_DrawIndexedPrimitiveVB(device, D3DPT_TRIANGLESTRIP, vb, 0, 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 = IDirect3DDevice7_DrawPrimitive(device, D3DPT_TRIANGLESTRIP, D3DFVF_XYZ, NULL, 0, 0); /* r200 rejects 0 vertices */ - ok(SUCCEEDED(hr) || broken(ddraw_is_amd(ddraw) && hr == E_FAIL), "Failed to draw, hr %#x.\n", hr); + ok(SUCCEEDED(hr) || broken(ddraw_is_amd(ddraw) && hr == E_FAIL), "Failed to draw, hr %#lx.\n", hr); hr = IDirect3DDevice7_DrawPrimitiveStrided(device, D3DPT_TRIANGLESTRIP, D3DFVF_XYZ, &strided, 0, 0); - ok(SUCCEEDED(hr), "Failed to draw, hr %#x.\n", hr); + ok(SUCCEEDED(hr), "Failed to draw, hr %#lx.\n", hr); hr = IDirect3DDevice7_DrawPrimitiveVB(device, D3DPT_TRIANGLESTRIP, vb, 0, 0, 0); - ok(SUCCEEDED(hr) || broken(ddraw_is_amd(ddraw) && hr == E_FAIL), "Failed to draw, hr %#x.\n", hr); + ok(SUCCEEDED(hr) || broken(ddraw_is_amd(ddraw) && hr == E_FAIL), "Failed to draw, hr %#lx.\n", hr);
hr = IDirect3DDevice7_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 = IDirect3DDevice7_DrawIndexedPrimitiveStrided(device, D3DPT_TRIANGLESTRIP, D3DFVF_XYZ, &strided, 0, indices, 4, 0); - ok(SUCCEEDED(hr), "Failed to draw, hr %#x.\n", hr); + ok(SUCCEEDED(hr), "Failed to draw, hr %#lx.\n", hr); /* Interestingly r200 rejects this, but not the call with a NULL index buffer and 0 indices. */ hr = IDirect3DDevice7_DrawIndexedPrimitiveVB(device, D3DPT_TRIANGLESTRIP, vb, 0, 0, indices, 4, 0); - ok(SUCCEEDED(hr) || broken(ddraw_is_amd(ddraw) && hr == E_FAIL), "Failed to draw, hr %#x.\n", hr); + ok(SUCCEEDED(hr) || broken(ddraw_is_amd(ddraw) && hr == E_FAIL), "Failed to draw, hr %#lx.\n", hr);
strided.position.lpvData = quad; strided.position.dwStride = sizeof(*quad); hr = IDirect3DVertexBuffer7_Lock(vb, 0, &data, NULL); - ok(SUCCEEDED(hr), "Failed to lock vertex buffer, hr %#x.\n", hr); + ok(SUCCEEDED(hr), "Failed to lock vertex buffer, hr %#lx.\n", hr); memcpy(data, quad, sizeof(quad)); hr = IDirect3DVertexBuffer7_Unlock(vb); - ok(SUCCEEDED(hr), "Failed to unlock vertex buffer, hr %#x.\n", hr); + ok(SUCCEEDED(hr), "Failed to unlock vertex buffer, hr %#lx.\n", hr);
hr = IDirect3DDevice7_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 = IDirect3DDevice7_DrawIndexedPrimitiveStrided(device, D3DPT_TRIANGLESTRIP, D3DFVF_XYZ, &strided, 4, NULL, 0, 0); /* r200 again fails this, this time with E_OUTOFMEMORY. */ - ok(SUCCEEDED(hr) || broken(ddraw_is_amd(ddraw) && hr == E_OUTOFMEMORY), "Failed to draw, hr %#x.\n", hr); + ok(SUCCEEDED(hr) || broken(ddraw_is_amd(ddraw) && hr == E_OUTOFMEMORY), "Failed to draw, hr %#lx.\n", hr); hr = IDirect3DDevice7_DrawIndexedPrimitiveVB(device, D3DPT_TRIANGLESTRIP, vb, 0, 4, NULL, 0, 0); - ok(SUCCEEDED(hr), "Failed to draw, hr %#x.\n", hr); + ok(SUCCEEDED(hr), "Failed to draw, hr %#lx.\n", hr); /* Now this draw should work, but r200 rejects it too - presumably earlier tests broke * driver internal state. */ hr = IDirect3DDevice7_DrawPrimitive(device, D3DPT_TRIANGLESTRIP, D3DFVF_XYZ, quad, 4, 0); - ok(SUCCEEDED(hr) || broken(ddraw_is_amd(ddraw) && hr == E_FAIL), "Failed to draw, hr %#x.\n", hr); + ok(SUCCEEDED(hr) || broken(ddraw_is_amd(ddraw) && hr == E_FAIL), "Failed to draw, hr %#lx.\n", hr); hr = IDirect3DDevice7_DrawPrimitiveStrided(device, D3DPT_TRIANGLESTRIP, D3DFVF_XYZ, &strided, 4, 0); - ok(SUCCEEDED(hr), "Failed to draw, hr %#x.\n", hr); + ok(SUCCEEDED(hr), "Failed to draw, hr %#lx.\n", hr); hr = IDirect3DDevice7_DrawPrimitiveVB(device, D3DPT_TRIANGLESTRIP, vb, 0, 4, 0); - ok(SUCCEEDED(hr), "Failed to draw, hr %#x.\n", hr); + ok(SUCCEEDED(hr), "Failed to draw, hr %#lx.\n", hr);
hr = IDirect3DDevice7_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); hr = IDirect3DDevice7_DrawIndexedPrimitiveStrided(device, D3DPT_TRIANGLESTRIP, D3DFVF_XYZ, &strided, 4, indices, 4, 0); - ok(SUCCEEDED(hr), "Failed to draw, hr %#x.\n", hr); + ok(SUCCEEDED(hr), "Failed to draw, hr %#lx.\n", hr); hr = IDirect3DDevice7_DrawIndexedPrimitiveVB(device, D3DPT_TRIANGLESTRIP, vb, 0, 4, indices, 4, 0); - ok(SUCCEEDED(hr), "Failed to draw, hr %#x.\n", hr); + ok(SUCCEEDED(hr), "Failed to draw, hr %#lx.\n", hr);
IDirect3DVertexBuffer7_Release(vb); IDirectDraw7_Release(ddraw); refcount = IDirect3DDevice7_Release(device); - ok(!refcount, "Device has %u references left.\n", refcount); + ok(!refcount, "Device has %lu references left.\n", refcount); DestroyWindow(window); }
@@ -13971,9 +13946,9 @@ static void test_edge_antialiasing_blending(void) D3DDEVICEDESC7 device_desc; IDirect3DDevice7 *device; IDirectDraw7 *ddraw; + unsigned int color; IDirect3D7 *d3d; ULONG refcount; - D3DCOLOR color; HWND window; HRESULT hr;
@@ -14018,16 +13993,16 @@ static void test_edge_antialiasing_blending(void) }
hr = IDirect3DDevice7_GetCaps(device, &device_desc); - ok(SUCCEEDED(hr), "Failed to get device caps, hr %#x.\n", hr); - trace("Line edge antialiasing support: %#x.\n", + ok(SUCCEEDED(hr), "Failed to get device caps, hr %#lx.\n", hr); + trace("Line edge antialiasing support: %#lx.\n", device_desc.dpcLineCaps.dwRasterCaps & D3DPRASTERCAPS_ANTIALIASEDGES); - trace("Triangle edge antialiasing support: %#x.\n", + trace("Triangle edge antialiasing support: %#lx.\n", device_desc.dpcTriCaps.dwRasterCaps & D3DPRASTERCAPS_ANTIALIASEDGES);
hr = IDirect3DDevice7_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 = IDirect3D7_QueryInterface(d3d, &IID_IDirectDraw7, (void **)&ddraw); - ok(SUCCEEDED(hr), "Failed to get DirectDraw7 interface, hr %#x.\n", hr); + ok(SUCCEEDED(hr), "Failed to get DirectDraw7 interface, hr %#lx.\n", hr); IDirect3D7_Release(d3d);
memset(&surface_desc, 0, sizeof(surface_desc)); @@ -14043,128 +14018,128 @@ static void test_edge_antialiasing_blending(void) U4(U4(surface_desc).ddpfPixelFormat).dwBBitMask = 0x000000ff; U5(U4(surface_desc).ddpfPixelFormat).dwRGBAlphaBitMask = 0xff000000; hr = IDirectDraw7_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);
hr = IDirect3DDevice7_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);
hr = IDirect3DDevice7_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 = IDirect3DDevice7_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 = IDirect3DDevice7_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 = IDirect3DDevice7_SetRenderState(device, D3DRENDERSTATE_CLIPPING, FALSE); - ok(SUCCEEDED(hr), "Failed to disable clipping, hr %#x.\n", hr); + ok(SUCCEEDED(hr), "Failed to disable clipping, hr %#lx.\n", hr); hr = IDirect3DDevice7_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 = IDirect3DDevice7_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 = IDirect3DDevice7_SetRenderState(device, D3DRENDERSTATE_STENCILENABLE, FALSE); - ok(SUCCEEDED(hr), "Failed to disable stencil test, hr %#x.\n", hr); + ok(SUCCEEDED(hr), "Failed to disable stencil test, hr %#lx.\n", hr); hr = IDirect3DDevice7_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 = IDirect3DDevice7_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 = IDirect3DDevice7_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 = IDirect3DDevice7_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 = IDirect3DDevice7_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);
hr = IDirect3DDevice7_SetTextureStageState(device, 0, D3DTSS_COLOROP, D3DTOP_SELECTARG1); - ok(SUCCEEDED(hr), "Failed to set color op, hr %#x.\n", hr); + ok(SUCCEEDED(hr), "Failed to set color op, hr %#lx.\n", hr); hr = IDirect3DDevice7_SetTextureStageState(device, 0, D3DTSS_COLORARG1, D3DTA_DIFFUSE); - ok(SUCCEEDED(hr), "Failed to set color arg, hr %#x.\n", hr); + ok(SUCCEEDED(hr), "Failed to set color arg, hr %#lx.\n", hr); hr = IDirect3DDevice7_SetTextureStageState(device, 0, D3DTSS_ALPHAOP, D3DTOP_SELECTARG1); - ok(SUCCEEDED(hr), "Failed to set alpha op, hr %#x.\n", hr); + ok(SUCCEEDED(hr), "Failed to set alpha op, hr %#lx.\n", hr); hr = IDirect3DDevice7_SetTextureStageState(device, 0, D3DTSS_ALPHAARG1, D3DTA_DIFFUSE); - ok(SUCCEEDED(hr), "Failed to set alpha arg, hr %#x.\n", hr); + ok(SUCCEEDED(hr), "Failed to set alpha arg, hr %#lx.\n", hr);
hr = IDirect3DDevice7_Clear(device, 0, NULL, D3DCLEAR_TARGET, 0xccff0000, 0.0f, 0); - ok(SUCCEEDED(hr), "Failed to clear, hr %#x.\n", hr); + ok(SUCCEEDED(hr), "Failed to clear, hr %#lx.\n", hr); hr = IDirect3DDevice7_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 = IDirect3DDevice7_DrawPrimitive(device, D3DPT_TRIANGLESTRIP, D3DFVF_XYZ | D3DFVF_DIFFUSE, 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 = IDirect3DDevice7_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 = IDirect3DDevice7_Clear(device, 0, NULL, D3DCLEAR_TARGET, 0x7f00ff00, 0.0f, 0); - ok(SUCCEEDED(hr), "Failed to clear, hr %#x.\n", hr); + ok(SUCCEEDED(hr), "Failed to clear, hr %#lx.\n", hr); hr = IDirect3DDevice7_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 = IDirect3DDevice7_DrawPrimitive(device, D3DPT_TRIANGLESTRIP, D3DFVF_XYZ | D3DFVF_DIFFUSE, 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 = IDirect3DDevice7_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 = IDirect3DDevice7_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);
hr = IDirect3DDevice7_Clear(device, 0, NULL, D3DCLEAR_TARGET, 0xccff0000, 0.0f, 0); - ok(SUCCEEDED(hr), "Failed to clear, hr %#x.\n", hr); + ok(SUCCEEDED(hr), "Failed to clear, hr %#lx.\n", hr); hr = IDirect3DDevice7_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 = IDirect3DDevice7_DrawPrimitive(device, D3DPT_TRIANGLESTRIP, D3DFVF_XYZ | D3DFVF_DIFFUSE, 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 = IDirect3DDevice7_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);
hr = IDirect3DDevice7_Clear(device, 0, NULL, D3DCLEAR_TARGET, 0x7f00ff00, 0.0f, 0); - ok(SUCCEEDED(hr), "Failed to clear, hr %#x.\n", hr); + ok(SUCCEEDED(hr), "Failed to clear, hr %#lx.\n", hr); hr = IDirect3DDevice7_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 = IDirect3DDevice7_DrawPrimitive(device, D3DPT_TRIANGLESTRIP, D3DFVF_XYZ | D3DFVF_DIFFUSE, 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 = IDirect3DDevice7_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 = IDirect3DDevice7_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);
hr = IDirect3DDevice7_Clear(device, 0, NULL, D3DCLEAR_TARGET, 0xccff0000, 0.0f, 0); - ok(SUCCEEDED(hr), "Failed to clear, hr %#x.\n", hr); + ok(SUCCEEDED(hr), "Failed to clear, hr %#lx.\n", hr); hr = IDirect3DDevice7_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 = IDirect3DDevice7_DrawPrimitive(device, D3DPT_TRIANGLESTRIP, D3DFVF_XYZ | D3DFVF_DIFFUSE, 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 = IDirect3DDevice7_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);
hr = IDirect3DDevice7_Clear(device, 0, NULL, D3DCLEAR_TARGET, 0x7f00ff00, 0.0f, 0); - ok(SUCCEEDED(hr), "Failed to clear, hr %#x.\n", hr); + ok(SUCCEEDED(hr), "Failed to clear, hr %#lx.\n", hr); hr = IDirect3DDevice7_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 = IDirect3DDevice7_DrawPrimitive(device, D3DPT_TRIANGLESTRIP, D3DFVF_XYZ | D3DFVF_DIFFUSE, 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 = IDirect3DDevice7_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);
IDirectDrawSurface7_Release(offscreen); IDirectDraw7_Release(ddraw); refcount = IDirect3DDevice7_Release(device); - ok(!refcount, "Device has %u references left.\n", refcount); + ok(!refcount, "Device has %lu references left.\n", refcount); DestroyWindow(window); }
@@ -14186,14 +14161,14 @@ static void test_display_mode_surface_pixel_format(void)
surface_desc.dwSize = sizeof(surface_desc); hr = IDirectDraw7_GetDisplayMode(ddraw, &surface_desc); - ok(hr == DD_OK, "Got unexpected hr %#x.\n", hr); + ok(hr == DD_OK, "Got unexpected 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 = IDirectDraw7_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);
bpp = 0; if (SUCCEEDED(IDirectDraw7_SetDisplayMode(ddraw, width, height, 16, 0, 0))) @@ -14206,10 +14181,10 @@ static void test_display_mode_surface_pixel_format(void)
surface_desc.dwSize = sizeof(surface_desc); hr = IDirectDraw7_GetDisplayMode(ddraw, &surface_desc); - ok(hr == DD_OK, "Got unexpected 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(U4(surface_desc).ddpfPixelFormat).dwRGBBitCount == bpp, "Got bpp %u, expected %u.\n", + ok(hr == DD_OK, "Got unexpected 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(U4(surface_desc).ddpfPixelFormat).dwRGBBitCount == bpp, "Got bpp %lu, expected %u.\n", U1(U4(surface_desc).ddpfPixelFormat).dwRGBBitCount, bpp);
memset(&surface_desc, 0, sizeof(surface_desc)); @@ -14218,14 +14193,14 @@ static void test_display_mode_surface_pixel_format(void) U5(surface_desc).dwBackBufferCount = 1; surface_desc.ddsCaps.dwCaps = DDSCAPS_COMPLEX | DDSCAPS_FLIP | DDSCAPS_PRIMARYSURFACE; hr = IDirectDraw7_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 = IDirectDrawSurface7_GetSurfaceDesc(surface, &surface_desc); - ok(hr == DD_OK, "Got unexpected 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(U4(surface_desc).ddpfPixelFormat.dwFlags == DDPF_RGB, "Got unexpected pixel format flags %#x.\n", + ok(hr == DD_OK, "Got unexpected 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(U4(surface_desc).ddpfPixelFormat.dwFlags == DDPF_RGB, "Got unexpected pixel format flags %#lx.\n", U4(surface_desc).ddpfPixelFormat.dwFlags); - ok(U1(U4(surface_desc).ddpfPixelFormat).dwRGBBitCount == bpp, "Got bpp %u, expected %u.\n", + ok(U1(U4(surface_desc).ddpfPixelFormat).dwRGBBitCount == bpp, "Got bpp %lu, expected %u.\n", U1(U4(surface_desc).ddpfPixelFormat).dwRGBBitCount, bpp); IDirectDrawSurface7_Release(surface);
@@ -14236,18 +14211,18 @@ static void test_display_mode_surface_pixel_format(void) surface_desc.dwHeight = height; surface_desc.ddsCaps.dwCaps = DDSCAPS_OFFSCREENPLAIN; hr = IDirectDraw7_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 = IDirectDrawSurface7_GetSurfaceDesc(surface, &surface_desc); - ok(hr == DD_OK, "Got unexpected hr %#x.\n", hr); - ok(U4(surface_desc).ddpfPixelFormat.dwFlags == DDPF_RGB, "Got unexpected pixel format flags %#x.\n", + ok(hr == DD_OK, "Got unexpected hr %#lx.\n", hr); + ok(U4(surface_desc).ddpfPixelFormat.dwFlags == DDPF_RGB, "Got unexpected pixel format flags %#lx.\n", U4(surface_desc).ddpfPixelFormat.dwFlags); - ok(U1(U4(surface_desc).ddpfPixelFormat).dwRGBBitCount == bpp, "Got bpp %u, expected %u.\n", + ok(U1(U4(surface_desc).ddpfPixelFormat).dwRGBBitCount == bpp, "Got bpp %lu, expected %u.\n", U1(U4(surface_desc).ddpfPixelFormat).dwRGBBitCount, bpp); IDirectDrawSurface7_Release(surface);
/* Test compatibility mode mipmap texture creation. */ hr = IDirectDraw7_SetDisplayMode(ddraw, width, height, 16, 0, 0); - ok(hr == DD_OK || hr == E_NOTIMPL, "Got unexpected hr %#x.\n", hr); + ok(hr == DD_OK || hr == E_NOTIMPL, "Got unexpected hr %#lx.\n", hr); if (FAILED(hr)) { win_skip("SetDisplayMode failed, skipping test."); @@ -14264,13 +14239,13 @@ static void test_display_mode_surface_pixel_format(void) U1(surface_desc).lPitch = surface_desc.dwWidth * bpp / 8; surface_desc.ddsCaps.dwCaps = DDSCAPS_TEXTURE | DDSCAPS_COMPLEX | DDSCAPS_MIPMAP | DDSCAPS_VIDEOMEMORY; hr = IDirectDraw7_CreateSurface(ddraw, &surface_desc, &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 (surface) IDirectDrawSurface7_Release(surface);
done: refcount = IDirectDraw7_Release(ddraw); - ok(!refcount, "DirectDraw has %u references left.\n", refcount); + ok(!refcount, "DirectDraw has %lu references left.\n", refcount); DestroyWindow(window); }
@@ -14328,7 +14303,7 @@ static void test_surface_desc_size(void) return; } hr = IDirectDraw7_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) { @@ -14344,9 +14319,9 @@ static void test_surface_desc_size(void) continue; } hr = IDirectDrawSurface_QueryInterface(surface7, &IID_IDirectDrawSurface, (void **)&surface); - ok(hr == DD_OK, "Failed to query IDirectDrawSurface, hr %#x, type %s.\n", hr, surface_caps[i].name); + ok(hr == DD_OK, "Failed to query IDirectDrawSurface, hr %#lx, type %s.\n", hr, surface_caps[i].name); hr = IDirectDrawSurface_QueryInterface(surface7, &IID_IDirectDrawSurface3, (void **)&surface3); - ok(hr == DD_OK, "Failed to query IDirectDrawSurface3, hr %#x, type %s.\n", hr, surface_caps[i].name); + ok(hr == DD_OK, "Failed to query IDirectDrawSurface3, hr %#lx, type %s.\n", hr, surface_caps[i].name);
/* GetSurfaceDesc() */ for (j = 0; j < ARRAY_SIZE(desc_sizes); ++j) @@ -14355,21 +14330,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 = IDirectDrawSurface3_GetSurfaceDesc(surface3, &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); }
@@ -14388,22 +14363,22 @@ static void test_surface_desc_size(void) desc.blob[sizeof(DDSURFACEDESC2)] = 0xef; hr = IDirectDrawSurface_Lock(surface, NULL, &desc.desc1, 0, 0); expected_hr = ignore_size || 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); } @@ -14414,22 +14389,22 @@ static void test_surface_desc_size(void) desc.blob[sizeof(DDSURFACEDESC2)] = 0xef; hr = IDirectDrawSurface3_Lock(surface3, NULL, &desc.desc1, 0, 0); expected_hr = ignore_size || 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); IDirectDrawSurface3_Unlock(surface3, NULL); } @@ -14440,21 +14415,21 @@ static void test_surface_desc_size(void) desc.blob[sizeof(DDSURFACEDESC2)] = 0xef; hr = IDirectDrawSurface7_Lock(surface7, NULL, &desc.desc2, 0, 0); expected_hr = ignore_size || 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); } @@ -14473,17 +14448,17 @@ static void test_surface_desc_size(void) expected_hr = (desc.dwSize == sizeof(DDSURFACEDESC) || desc.dwSize == sizeof(DDSURFACEDESC2)) ? DD_OK : DDERR_INVALIDPARAMS; hr = IDirectDraw7_GetDisplayMode(ddraw, &desc.desc2); - 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(DDSURFACEDESC2), "Wrong size %u for %u.\n", desc.dwSize, desc_sizes[j]); + ok(desc.dwSize == sizeof(DDSURFACEDESC2), "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 = IDirectDraw7_Release(ddraw); - ok(!refcount, "DirectDraw has %u references left.\n", refcount); + ok(!refcount, "DirectDraw has %lu references left.\n", refcount); }
static void test_get_surface_from_dc(void) @@ -14502,7 +14477,7 @@ static void test_get_surface_from_dc(void) ddraw = create_ddraw(); ok(!!ddraw, "Failed to create a ddraw object.\n"); hr = IDirectDraw7_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); @@ -14512,59 +14487,59 @@ static void test_get_surface_from_dc(void) surface_desc.ddsCaps.dwCaps = DDSCAPS_OFFSCREENPLAIN;
hr = IDirectDraw7_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 = IDirectDrawSurface7_QueryInterface(surface, &IID_IDirectDrawSurface, (void **)&surface1); - ok(SUCCEEDED(hr), "Failed to query IDirectDrawSurface interface, hr %#x.\n", hr); + ok(SUCCEEDED(hr), "Failed to query IDirectDrawSurface interface, hr %#lx.\n", hr);
refcount = get_refcount((IUnknown *)surface1); - ok(refcount == 1, "Got unexpected refcount %u.\n", refcount); + ok(refcount == 1, "Got unexpected refcount %lu.\n", refcount); refcount = get_refcount((IUnknown *)surface); - ok(refcount == 1, "Got unexpected refcount %u.\n", refcount); + ok(refcount == 1, "Got unexpected refcount %lu.\n", refcount);
hr = IDirectDrawSurface7_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);
tmp1 = (void *)0xdeadbeef; device_dc = (void *)0xdeadbeef; hr = GetSurfaceFromDC(NULL, &tmp1, &device_dc); - ok(hr == DDERR_NOTFOUND, "Got unexpected hr %#x.\n", hr); + ok(hr == DDERR_NOTFOUND, "Got unexpected hr %#lx.\n", hr); ok(!tmp1, "Got unexpected surface %p.\n", tmp1); ok(!device_dc, "Got unexpected device_dc %p.\n", device_dc);
device_dc = (void *)0xdeadbeef; hr = GetSurfaceFromDC(dc, NULL, &device_dc); - ok(hr == E_INVALIDARG, "Got unexpected hr %#x.\n", hr); + ok(hr == E_INVALIDARG, "Got unexpected hr %#lx.\n", hr); ok(device_dc == (void *)0xdeadbeef, "Got unexpected device_dc %p.\n", device_dc);
tmp1 = (void *)0xdeadbeef; hr = GetSurfaceFromDC(dc, &tmp1, NULL); - ok(hr == E_INVALIDARG, "Got unexpected hr %#x.\n", hr); + ok(hr == E_INVALIDARG, "Got unexpected hr %#lx.\n", hr); ok(!tmp1, "Got unexpected surface %p.\n", tmp1);
hr = GetSurfaceFromDC(dc, &tmp1, &device_dc); - ok(SUCCEEDED(hr), "GetSurfaceFromDC failed, hr %#x.\n", hr); + ok(SUCCEEDED(hr), "GetSurfaceFromDC failed, hr %#lx.\n", hr); ok(tmp1 == surface1, "Got unexpected surface %p, expected %p.\n", tmp1, surface1); IDirectDrawSurface_Release(tmp1);
ret = GetObjectType(device_dc); - todo_wine ok(ret == OBJ_DC, "Got unexpected object type %#x.\n", ret); + todo_wine ok(ret == OBJ_DC, "Got unexpected object type %#lx.\n", ret); ret = GetDeviceCaps(device_dc, TECHNOLOGY); - todo_wine ok(ret == DT_RASDISPLAY, "Got unexpected technology %#x.\n", ret); + todo_wine ok(ret == DT_RASDISPLAY, "Got unexpected technology %#lx.\n", ret);
hr = IDirectDraw7_GetSurfaceFromDC(ddraw, dc, NULL); - ok(hr == E_INVALIDARG, "Got unexpected hr %#x.\n", hr); + ok(hr == E_INVALIDARG, "Got unexpected hr %#lx.\n", hr);
hr = IDirectDraw7_GetSurfaceFromDC(ddraw, dc, &tmp); - ok(SUCCEEDED(hr), "GetSurfaceFromDC failed, hr %#x.\n", hr); + ok(SUCCEEDED(hr), "GetSurfaceFromDC failed, hr %#lx.\n", hr); ok(tmp == surface, "Got unexpected surface %p, expected %p.\n", tmp, surface);
refcount = get_refcount((IUnknown *)surface1); - ok(refcount == 1, "Got unexpected refcount %u.\n", refcount); + ok(refcount == 1, "Got unexpected refcount %lu.\n", refcount); refcount = get_refcount((IUnknown *)surface); - ok(refcount == 2, "Got unexpected refcount %u.\n", refcount); + ok(refcount == 2, "Got unexpected refcount %lu.\n", refcount);
hr = IDirectDrawSurface7_ReleaseDC(surface, dc); - ok(SUCCEEDED(hr), "ReleaseDC failed, hr %#x.\n", hr); + ok(SUCCEEDED(hr), "ReleaseDC failed, hr %#lx.\n", hr);
IDirectDrawSurface_Release(tmp);
@@ -14574,20 +14549,20 @@ static void test_get_surface_from_dc(void) tmp1 = (void *)0xdeadbeef; device_dc = (void *)0xdeadbeef; hr = GetSurfaceFromDC(dc, &tmp1, &device_dc); - ok(hr == DDERR_NOTFOUND, "Got unexpected hr %#x.\n", hr); + ok(hr == DDERR_NOTFOUND, "Got unexpected hr %#lx.\n", hr); ok(!tmp1, "Got unexpected surface %p.\n", tmp1); ok(!device_dc, "Got unexpected device_dc %p.\n", device_dc);
tmp = (void *)0xdeadbeef; hr = IDirectDraw7_GetSurfaceFromDC(ddraw, dc, &tmp); - ok(hr == DDERR_NOTFOUND, "Got unexpected hr %#x.\n", hr); + ok(hr == DDERR_NOTFOUND, "Got unexpected hr %#lx.\n", hr); ok(!tmp, "Got unexpected surface %p.\n", tmp);
ok(DeleteDC(dc), "DeleteDC failed.\n");
tmp = (void *)0xdeadbeef; hr = IDirectDraw7_GetSurfaceFromDC(ddraw, NULL, &tmp); - ok(hr == DDERR_NOTFOUND, "Got unexpected hr %#x.\n", hr); + ok(hr == DDERR_NOTFOUND, "Got unexpected hr %#lx.\n", hr); ok(!tmp, "Got unexpected surface %p.\n", tmp);
IDirectDrawSurface7_Release(surface); @@ -14601,12 +14576,11 @@ static void test_ck_operation(void) IDirectDrawSurface7 *src, *dst; IDirectDrawSurface *src1, *dst1; DDSURFACEDESC2 surface_desc; + unsigned int i, *color; IDirectDraw7 *ddraw; ULONG refcount; HWND window; HRESULT hr; - D3DCOLOR *color; - unsigned int i; DDCOLORKEY ckey; DDBLTFX fx;
@@ -14614,7 +14588,7 @@ static void test_ck_operation(void) ddraw = create_ddraw(); ok(!!ddraw, "Failed to create a ddraw object.\n"); hr = IDirectDraw7_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); @@ -14628,16 +14602,16 @@ static void test_ck_operation(void) U3(U4(surface_desc).ddpfPixelFormat).dwGBitMask = 0x0000ff00; U4(U4(surface_desc).ddpfPixelFormat).dwBBitMask = 0x000000ff; hr = IDirectDraw7_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);
surface_desc.dwFlags |= DDSD_CKSRCBLT; surface_desc.ddckCKSrcBlt.dwColorSpaceLowValue = 0x00ff00ff; surface_desc.ddckCKSrcBlt.dwColorSpaceHighValue = 0x00ff00ff; hr = IDirectDraw7_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 = IDirectDrawSurface7_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; @@ -14645,33 +14619,33 @@ static void test_ck_operation(void) color[2] = 0x77ff00ff; color[3] = 0x00ff00ff; hr = IDirectDrawSurface7_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 = IDirectDrawSurface7_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 = IDirectDrawSurface7_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 = IDirectDrawSurface7_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 = IDirectDrawSurface7_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 = IDirectDrawSurface7_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 @@ -14689,66 +14663,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 = IDirectDrawSurface7_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 = IDirectDrawSurface7_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 = IDirectDrawSurface7_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 = IDirectDrawSurface7_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 = IDirectDrawSurface7_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 = IDirectDrawSurface7_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 = IDirectDrawSurface7_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 = IDirectDrawSurface7_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 = IDirectDrawSurface7_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 = IDirectDrawSurface7_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 = IDirectDrawSurface7_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);
IDirectDrawSurface7_Release(src); IDirectDrawSurface7_Release(dst); @@ -14768,18 +14742,18 @@ static void test_ck_operation(void) U4(U4(surface_desc).ddpfPixelFormat).dwBBitMask = 0x000000ff; U5(U4(surface_desc).ddpfPixelFormat).dwRGBAlphaBitMask = 0xff000000; hr = IDirectDraw7_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); hr = IDirectDraw7_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);
ckey.dwColorSpaceLowValue = 0x0000ff00; ckey.dwColorSpaceHighValue = 0x0000ff00; hr = IDirectDrawSurface7_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 = IDirectDrawSurface7_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. */ @@ -14790,11 +14764,11 @@ static void test_ck_operation(void) ckey.dwColorSpaceLowValue = 0x000000ff; ckey.dwColorSpaceHighValue = 0x000000ff; hr = IDirectDrawSurface7_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 = IDirectDrawSurface7_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); @@ -14804,7 +14778,7 @@ static void test_ck_operation(void) fx.ddckDestColorkey.dwColorSpaceLowValue = 0x00001100;
hr = IDirectDrawSurface7_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. */ @@ -14813,21 +14787,21 @@ static void test_ck_operation(void) color[4] = 0x00001100; /* Src color key in ddbltfx. */ color[5] = 0x00110000; /* Dst color key in ddbltfx. */ hr = IDirectDrawSurface7_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 = IDirectDrawSurface7_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 = IDirectDrawSurface7_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 = IDirectDrawSurface7_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 = IDirectDrawSurface7_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 && @@ -14837,14 +14811,14 @@ static void test_ck_operation(void)
color[0] = color[1] = color[2] = color[3] = color[4] = color[5] = 0x55555555; hr = IDirectDrawSurface7_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 = IDirectDrawSurface7_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 = IDirectDrawSurface7_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 && @@ -14854,14 +14828,14 @@ static void test_ck_operation(void)
color[0] = color[1] = color[2] = color[3] = color[4] = color[5] = 0x55555555; hr = IDirectDrawSurface7_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 = IDirectDrawSurface7_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 = IDirectDrawSurface7_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 && @@ -14871,14 +14845,14 @@ static void test_ck_operation(void)
color[0] = color[1] = color[2] = color[3] = color[4] = color[5] = 0x55555555; hr = IDirectDrawSurface7_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 = IDirectDrawSurface7_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 = IDirectDrawSurface7_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 && @@ -14894,14 +14868,14 @@ static void test_ck_operation(void) color[4] = 0x000000aa; /* Dest key in src surface. */ color[5] = 0x000000aa; /* Dest key in src surface. */ hr = IDirectDrawSurface7_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 DESTINATION surface in v7! */ hr = IDirectDrawSurface7_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 = IDirectDrawSurface7_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 && @@ -14916,23 +14890,23 @@ static void test_ck_operation(void) color[4] = 0x000000aa; /* Dest key in src surface. */ color[5] = 0x000000aa; /* Dest key in src surface. */ hr = IDirectDrawSurface7_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 older version of the interface? It takes the key * from the source surface. */ hr = IDirectDrawSurface7_QueryInterface(src, &IID_IDirectDrawSurface, (void **)&src1); - 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_QueryInterface(dst, &IID_IDirectDrawSurface, (void **)&dst1); - 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 = IDirectDrawSurface_Blt(dst1, NULL, src1, NULL, DDBLT_KEYDEST, &fx); - ok(SUCCEEDED(hr), "Failed to blit, hr %#x.\n", hr); + ok(SUCCEEDED(hr), "Failed to blit, hr %#lx.\n", hr);
IDirectDrawSurface_Release(dst1); IDirectDrawSurface_Release(src1);
hr = IDirectDrawSurface7_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 && @@ -14947,14 +14921,14 @@ static void test_ck_operation(void) color[4] = 0x000000aa; /* Dest key in src surface. */ color[5] = 0x000000aa; /* Dest key in src surface. */ hr = IDirectDrawSurface7_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 = IDirectDrawSurface7_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 = IDirectDrawSurface7_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 && @@ -14969,14 +14943,14 @@ static void test_ck_operation(void) color[4] = 0x000000aa; /* Dest key in src surface. */ color[5] = 0x000000aa; /* Dest key in src surface. */ hr = IDirectDrawSurface7_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 = IDirectDrawSurface7_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 = IDirectDrawSurface7_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 && @@ -14984,17 +14958,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 = IDirectDrawSurface7_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 = IDirectDrawSurface7_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 = IDirectDrawSurface7_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. */ @@ -15010,31 +14984,31 @@ static void test_ck_operation(void) color[4] = 0x000000aa; /* Dest key in src surface. */ color[5] = 0x000000aa; /* Dest key in src surface. */ hr = IDirectDrawSurface7_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 = IDirectDrawSurface7_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 = IDirectDrawSurface7_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 = IDirectDrawSurface7_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 = IDirectDrawSurface7_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 = IDirectDrawSurface7_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);
/* Dest key blit still works, the destination surface key is used in v7. */ hr = IDirectDrawSurface7_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 = IDirectDrawSurface7_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 && @@ -15042,23 +15016,23 @@ 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 = IDirectDrawSurface7_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);
/* Try blitting without keys in the destination surface. */ hr = IDirectDrawSurface7_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 = IDirectDrawSurface7_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 = IDirectDrawSurface7_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: IDirectDrawSurface7_Release(src); IDirectDrawSurface7_Release(dst); refcount = IDirectDraw7_Release(ddraw); - ok(!refcount, "DirectDraw has %u references left.\n", refcount); + ok(!refcount, "DirectDraw has %lu references left.\n", refcount); DestroyWindow(window); }
@@ -15085,7 +15059,7 @@ static void test_vb_refcount(void) }
hr = IDirect3DDevice7_GetDirect3D(device, &d3d); - ok(SUCCEEDED(hr), "Failed to get Direct3D7 interface, hr %#x.\n", hr); + ok(SUCCEEDED(hr), "Failed to get Direct3D7 interface, hr %#lx.\n", hr);
prev_d3d_refcount = get_refcount((IUnknown *)d3d); prev_device_refcount = get_refcount((IUnknown *)device); @@ -15095,37 +15069,37 @@ static void test_vb_refcount(void) vb_desc.dwFVF = D3DFVF_XYZ; vb_desc.dwNumVertices = 4; hr = IDirect3D7_CreateVertexBuffer(d3d, &vb_desc, &vb, 0); - ok(SUCCEEDED(hr), "Failed to create vertex buffer, hr %#x.\n", hr); + ok(SUCCEEDED(hr), "Failed to create vertex buffer, hr %#lx.\n", hr);
cur_d3d_refcount = get_refcount((IUnknown *)d3d); cur_device_refcount = get_refcount((IUnknown *)device); - ok(cur_d3d_refcount > prev_d3d_refcount, "D3D object refcount didn't change from %u.\n", prev_d3d_refcount); - ok(cur_device_refcount == prev_device_refcount, "Device refcount changed from %u to %u.\n", + ok(cur_d3d_refcount > prev_d3d_refcount, "D3D object refcount didn't change from %lu.\n", prev_d3d_refcount); + ok(cur_device_refcount == prev_device_refcount, "Device refcount changed from %lu to %lu.\n", prev_device_refcount, cur_device_refcount);
prev_d3d_refcount = cur_d3d_refcount; hr = IDirect3DVertexBuffer7_QueryInterface(vb, &IID_IDirect3DVertexBuffer7, (void **)&vb7); - ok(hr == DD_OK, "Failed to query IDirect3DVertexBuffer7, hr %#x.\n", hr); + ok(hr == DD_OK, "Failed to query IDirect3DVertexBuffer7, hr %#lx.\n", hr); cur_d3d_refcount = get_refcount((IUnknown *)d3d); - ok(cur_d3d_refcount == prev_d3d_refcount, "D3D object refcount changed from %u to %u.\n", + ok(cur_d3d_refcount == prev_d3d_refcount, "D3D object refcount changed from %lu to %lu.\n", prev_d3d_refcount, cur_d3d_refcount); IDirect3DVertexBuffer7_Release(vb7);
hr = IDirect3DVertexBuffer7_QueryInterface(vb, &IID_IDirect3DVertexBuffer, (void **)&vb1); - ok(hr == E_NOINTERFACE, "Querying IDirect3DVertexBuffer returned unexpected hr %#x.\n", hr); + ok(hr == E_NOINTERFACE, "Querying IDirect3DVertexBuffer returned unexpected hr %#lx.\n", hr);
hr = IDirect3DVertexBuffer_QueryInterface(vb, &IID_IUnknown, (void **)&unk); - ok(hr == DD_OK, "Failed to query IUnknown, hr %#x.\n", hr); + ok(hr == DD_OK, "Failed to query IUnknown, hr %#lx.\n", hr); ok((IUnknown *)vb == unk, "IDirect3DVertexBuffer7 and IUnknown interface pointers don't match, %p != %p.\n", vb, unk); IUnknown_Release(unk);
refcount = IDirect3DVertexBuffer7_Release(vb); - ok(!refcount, "Vertex buffer has %u references left.\n", refcount); + ok(!refcount, "Vertex buffer has %lu references left.\n", refcount);
IDirect3D7_Release(d3d); refcount = IDirect3DDevice7_Release(device); - ok(!refcount, "Device has %u references left.\n", refcount); + ok(!refcount, "Device has %lu references left.\n", refcount); DestroyWindow(window); }
@@ -15207,7 +15181,7 @@ static void test_compute_sphere_visibility(void) }
hr = IDirect3DDevice7_SetClipPlane(device, 0, clip_plane); - ok(SUCCEEDED(hr), "Failed to set user clip plane, hr %#x.\n", hr); + ok(SUCCEEDED(hr), "Failed to set user clip plane, hr %#lx.\n", hr);
IDirect3DDevice7_SetTransform(device, D3DTRANSFORMSTATE_WORLD, &identity);
@@ -15218,19 +15192,19 @@ static void test_compute_sphere_visibility(void)
hr = IDirect3DDevice7_SetRenderState(device, D3DRENDERSTATE_CLIPPLANEENABLE, tests[i].enable_planes); - ok(SUCCEEDED(hr), "Failed to enable / disable user clip planes, hr %#x.\n", hr); + ok(SUCCEEDED(hr), "Failed to enable / disable user clip planes, hr %#lx.\n", hr);
hr = IDirect3DDevice7_ComputeSphereVisibility(device, tests[i].center, tests[i].radius, tests[i].sphere_count, 0, result); - ok(hr == D3D_OK, "Got unexpected hr %#x.\n", hr); + ok(hr == D3D_OK, "Got unexpected hr %#lx.\n", hr);
for (j = 0; j < tests[i].sphere_count; ++j) - ok(result[j] == tests[i].expected[j], "Test %u sphere %u: expected %#x, got %#x.\n", + ok(result[j] == tests[i].expected[j], "Test %u sphere %u: expected %#lx, got %#lx.\n", i, j, tests[i].expected[j], result[j]); }
refcount = IDirect3DDevice7_Release(device); - ok(!refcount, "Device has %u references left.\n", refcount); + ok(!refcount, "Device has %lu references left.\n", refcount); DestroyWindow(window); }
@@ -15255,7 +15229,7 @@ static void test_clip_planes_limits(void)
memset(&caps, 0, sizeof(caps)); hr = IDirect3DDevice7_GetCaps(device, &caps); - ok(SUCCEEDED(hr), "Failed to get device caps, hr %#x.\n", hr); + ok(SUCCEEDED(hr), "Failed to get device caps, hr %#lx.\n", hr);
trace("Max user clip planes: %u.\n", caps.wMaxUserClipPlanes);
@@ -15263,7 +15237,7 @@ static void test_clip_planes_limits(void) { memset(plane, 0xff, sizeof(plane)); hr = IDirect3DDevice7_GetClipPlane(device, i, plane); - ok(hr == D3D_OK, "Failed to get clip plane %u, hr %#x.\n", i, hr); + ok(hr == D3D_OK, "Failed to get clip plane %u, hr %#lx.\n", i, hr); ok(!plane[0] && !plane[1] && !plane[2] && !plane[3], "Got unexpected plane %u: %.8e, %.8e, %.8e, %.8e.\n", i, plane[0], plane[1], plane[2], plane[3]); @@ -15276,31 +15250,31 @@ static void test_clip_planes_limits(void) { plane[3] = i; hr = IDirect3DDevice7_SetClipPlane(device, i, plane); - ok(hr == D3D_OK, "Failed to set clip plane %u, hr %#x.\n", i, hr); + ok(hr == D3D_OK, "Failed to set clip plane %u, hr %#lx.\n", i, hr); } for (i = 0; i < caps.wMaxUserClipPlanes; ++i) { memset(plane, 0xff, sizeof(plane)); hr = IDirect3DDevice7_GetClipPlane(device, i, plane); - ok(hr == D3D_OK, "Failed to get clip plane %u, hr %#x.\n", i, hr); + ok(hr == D3D_OK, "Failed to get clip plane %u, hr %#lx.\n", i, hr); ok(plane[0] == 2.0f && plane[1] == 8.0f && plane[2] == 5.0f && plane[3] == i, "Got unexpected plane %u: %.8e, %.8e, %.8e, %.8e.\n", i, plane[0], plane[1], plane[2], plane[3]); }
hr = IDirect3DDevice7_SetRenderState(device, D3DRENDERSTATE_CLIPPLANEENABLE, 0xffffffff); - 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 = IDirect3DDevice7_GetRenderState(device, D3DRENDERSTATE_CLIPPLANEENABLE, &state); - ok(SUCCEEDED(hr), "Failed to get render state, hr %#x.\n", hr); - ok(state == 0xffffffff, "Got unexpected state %#x.\n", state); + ok(SUCCEEDED(hr), "Failed to get render state, hr %#lx.\n", hr); + ok(state == 0xffffffff, "Got unexpected state %#lx.\n", state); hr = IDirect3DDevice7_SetRenderState(device, D3DRENDERSTATE_CLIPPLANEENABLE, 0x80000000); - 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 = IDirect3DDevice7_GetRenderState(device, D3DRENDERSTATE_CLIPPLANEENABLE, &state); - ok(SUCCEEDED(hr), "Failed to get render state, hr %#x.\n", hr); - ok(state == 0x80000000, "Got unexpected state %#x.\n", state); + ok(SUCCEEDED(hr), "Failed to get render state, hr %#lx.\n", hr); + ok(state == 0x80000000, "Got unexpected state %#lx.\n", state);
refcount = IDirect3DDevice7_Release(device); - ok(!refcount, "Device has %u references left.\n", refcount); + ok(!refcount, "Device has %lu references left.\n", refcount); DestroyWindow(window); }
@@ -15324,9 +15298,9 @@ static void test_texture_stages_limits(void) return; } hr = IDirect3DDevice7_GetDirect3D(device, &d3d); - ok(SUCCEEDED(hr), "Failed to get Direct3D interface, hr %#x.\n", hr); + ok(SUCCEEDED(hr), "Failed to get Direct3D interface, hr %#lx.\n", hr); hr = IDirect3D7_QueryInterface(d3d, &IID_IDirectDraw7, (void **)&ddraw); - ok(SUCCEEDED(hr), "Failed to get DirectDraw interface, hr %#x.\n", hr); + ok(SUCCEEDED(hr), "Failed to get DirectDraw interface, hr %#lx.\n", hr); IDirect3D7_Release(d3d);
memset(&surface_desc, 0, sizeof(surface_desc)); @@ -15336,22 +15310,22 @@ static void test_texture_stages_limits(void) surface_desc.dwWidth = 16; surface_desc.dwHeight = 16; hr = IDirectDraw7_CreateSurface(ddraw, &surface_desc, &texture, 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);
for (i = 0; i < 8; ++i) { hr = IDirect3DDevice7_SetTexture(device, i, texture); - ok(hr == D3D_OK, "Failed to set texture %u, hr %#x.\n", i, hr); + ok(hr == D3D_OK, "Failed to set texture %u, hr %#lx.\n", i, hr); hr = IDirect3DDevice7_SetTexture(device, i, NULL); - ok(hr == D3D_OK, "Failed to set texture %u, hr %#x.\n", i, hr); + ok(hr == D3D_OK, "Failed to set texture %u, hr %#lx.\n", i, hr); hr = IDirect3DDevice7_SetTextureStageState(device, i, D3DTSS_COLOROP, D3DTOP_ADD); - ok(hr == D3D_OK, "Failed to set texture stage state %u, hr %#x.\n", i, hr); + ok(hr == D3D_OK, "Failed to set texture stage state %u, hr %#lx.\n", i, hr); }
IDirectDrawSurface7_Release(texture); IDirectDraw7_Release(ddraw); refcount = IDirect3DDevice7_Release(device); - ok(!refcount, "Device has %u references left.\n", refcount); + ok(!refcount, "Device has %lu references left.\n", refcount); DestroyWindow(window); }
@@ -15372,41 +15346,40 @@ static void test_set_render_state(void) }
hr = IDirect3DDevice7_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 = IDirect3DDevice7_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);
/* States deprecated in D3D7 */ hr = IDirect3DDevice7_SetRenderState(device, D3DRENDERSTATE_TEXTUREHANDLE, 0); - ok(hr == DDERR_INVALIDPARAMS, "Got unexpected hr %#x.\n", hr); + ok(hr == DDERR_INVALIDPARAMS, "Got unexpected hr %#lx.\n", hr); state = 0xdeadbeef; hr = IDirect3DDevice7_GetRenderState(device, D3DRENDERSTATE_TEXTUREHANDLE, &state); - ok(hr == DDERR_INVALIDPARAMS, "Got unexpected hr %#x.\n", hr); - ok(state == 0xdeadbeef, "Got unexpected render state %#x.\n", state); + ok(hr == DDERR_INVALIDPARAMS, "Got unexpected hr %#lx.\n", hr); + ok(state == 0xdeadbeef, "Got unexpected render state %#lx.\n", state); hr = IDirect3DDevice7_SetRenderState(device, D3DRENDERSTATE_TEXTUREMAPBLEND, D3DTBLEND_MODULATE); - ok(hr == DDERR_INVALIDPARAMS, "Got unexpected hr %#x.\n", hr); + ok(hr == DDERR_INVALIDPARAMS, "Got unexpected hr %#lx.\n", hr); state = 0xdeadbeef; hr = IDirect3DDevice7_GetRenderState(device, D3DRENDERSTATE_TEXTUREMAPBLEND, &state); - ok(hr == DDERR_INVALIDPARAMS, "Got unexpected hr %#x.\n", hr); - ok(state == 0xdeadbeef, "Got unexpected render state %#x.\n", state); + ok(hr == DDERR_INVALIDPARAMS, "Got unexpected hr %#lx.\n", hr); + ok(state == 0xdeadbeef, "Got unexpected render state %#lx.\n", state);
refcount = IDirect3DDevice7_Release(device); - ok(!refcount, "Device has %u references left.\n", refcount); + ok(!refcount, "Device has %lu references left.\n", refcount); DestroyWindow(window); }
static void test_map_synchronisation(void) { LARGE_INTEGER frequency, diff, ts[3]; + unsigned int colour, i, j, tri_count; IDirect3DVertexBuffer7 *buffer; - unsigned int i, j, tri_count; D3DVERTEXBUFFERDESC vb_desc; IDirect3DDevice7 *device; BOOL unsynchronised, ret; IDirectDrawSurface7 *rt; IDirectDraw7 *ddraw; IDirect3D7 *d3d; - D3DCOLOR colour; ULONG refcount; HWND window; HRESULT hr; @@ -15463,9 +15436,9 @@ static void test_map_synchronisation(void) }
hr = IDirect3DDevice7_GetDirect3D(device, &d3d); - ok(SUCCEEDED(hr), "Failed to get Direct3D7 interface, hr %#x.\n", hr); + ok(SUCCEEDED(hr), "Failed to get Direct3D7 interface, hr %#lx.\n", hr); hr = IDirect3D7_QueryInterface(d3d, &IID_IDirectDraw7, (void **)&ddraw); - ok(SUCCEEDED(hr), "Failed to get ddraw interface, hr %#x.\n", hr); + ok(SUCCEEDED(hr), "Failed to get ddraw interface, hr %#lx.\n", hr); /* Maps are always synchronised on WARP. */ if (ddraw_is_warp(ddraw)) { @@ -15474,7 +15447,7 @@ static void test_map_synchronisation(void) }
hr = IDirect3DDevice7_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);
tri_count = 0x1000;
@@ -15486,28 +15459,28 @@ static void test_map_synchronisation(void) vb_desc.dwFVF = D3DFVF_XYZ | D3DFVF_DIFFUSE; vb_desc.dwNumVertices = tri_count + 2; hr = IDirect3D7_CreateVertexBuffer(d3d, &vb_desc, &buffer, 0); - ok(SUCCEEDED(hr), "Failed to create vertex buffer, hr %#x.\n", hr); + ok(SUCCEEDED(hr), "Failed to create vertex buffer, hr %#lx.\n", hr); hr = IDirect3DVertexBuffer7_Lock(buffer, DDLOCK_DISCARDCONTENTS, (void **)&quads, NULL); - ok(SUCCEEDED(hr), "Failed to lock vertex buffer, hr %#x.\n", hr); + ok(SUCCEEDED(hr), "Failed to lock vertex buffer, hr %#lx.\n", hr); for (j = 0; j < vb_desc.dwNumVertices / 4; ++j) { quads[j] = quad1; } hr = IDirect3DVertexBuffer7_Unlock(buffer); - ok(SUCCEEDED(hr), "Failed to unlock vertex buffer, hr %#x.\n", hr); + ok(SUCCEEDED(hr), "Failed to unlock vertex buffer, hr %#lx.\n", hr);
hr = IDirect3DDevice7_SetRenderState(device, D3DRENDERSTATE_LIGHTING, 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);
/* Initial draw to initialise states, compile shaders, etc. */ hr = IDirect3DDevice7_Clear(device, 0, NULL, D3DCLEAR_TARGET, 0xff0000ff, 0.0f, 0); - ok(SUCCEEDED(hr), "Failed to clear, hr %#x.\n", hr); + ok(SUCCEEDED(hr), "Failed to clear, hr %#lx.\n", hr); hr = IDirect3DDevice7_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 = IDirect3DDevice7_DrawPrimitiveVB(device, D3DPT_TRIANGLESTRIP, buffer, 0, vb_desc.dwNumVertices, 0); - ok(SUCCEEDED(hr), "Failed to draw, hr %#x.\n", hr); + ok(SUCCEEDED(hr), "Failed to draw, hr %#lx.\n", hr); hr = IDirect3DDevice7_EndScene(device); - ok(SUCCEEDED(hr), "Failed to end scene, hr %#x.\n", hr); + ok(SUCCEEDED(hr), "Failed to end scene, hr %#lx.\n", hr); /* Read the result to ensure the GPU has finished drawing. */ colour = get_surface_color(rt, 320, 240);
@@ -15515,25 +15488,25 @@ static void test_map_synchronisation(void) ret = QueryPerformanceCounter(&ts[0]); ok(ret, "Failed to read performance counter.\n"); hr = IDirect3DDevice7_Clear(device, 0, NULL, D3DCLEAR_TARGET, 0xff0000ff, 0.0f, 0); - ok(SUCCEEDED(hr), "Failed to clear, hr %#x.\n", hr); + ok(SUCCEEDED(hr), "Failed to clear, hr %#lx.\n", hr); hr = IDirect3DDevice7_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 = IDirect3DDevice7_DrawPrimitiveVB(device, D3DPT_TRIANGLESTRIP, buffer, 0, vb_desc.dwNumVertices, 0); - ok(SUCCEEDED(hr), "Failed to draw, hr %#x.\n", hr); + ok(SUCCEEDED(hr), "Failed to draw, hr %#lx.\n", hr); hr = IDirect3DDevice7_EndScene(device); - ok(SUCCEEDED(hr), "Failed to end scene, hr %#x.\n", hr); + ok(SUCCEEDED(hr), "Failed to end scene, hr %#lx.\n", hr); colour = get_surface_color(rt, 320, 240); /* Time drawing a single triangle. */ ret = QueryPerformanceCounter(&ts[1]); ok(ret, "Failed to read performance counter.\n"); hr = IDirect3DDevice7_Clear(device, 0, NULL, D3DCLEAR_TARGET, 0xff0000ff, 0.0f, 0); - ok(SUCCEEDED(hr), "Failed to clear, hr %#x.\n", hr); + ok(SUCCEEDED(hr), "Failed to clear, hr %#lx.\n", hr); hr = IDirect3DDevice7_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 = IDirect3DDevice7_DrawPrimitiveVB(device, D3DPT_TRIANGLESTRIP, buffer, 0, 3, 0); - ok(SUCCEEDED(hr), "Failed to draw, hr %#x.\n", hr); + ok(SUCCEEDED(hr), "Failed to draw, hr %#lx.\n", hr); hr = IDirect3DDevice7_EndScene(device); - ok(SUCCEEDED(hr), "Failed to end scene, hr %#x.\n", hr); + ok(SUCCEEDED(hr), "Failed to end scene, hr %#lx.\n", hr); colour = get_surface_color(rt, 320, 240); ret = QueryPerformanceCounter(&ts[2]); ok(ret, "Failed to read performance counter.\n"); @@ -15549,32 +15522,32 @@ static void test_map_synchronisation(void) for (i = 0; i < ARRAY_SIZE(tests); ++i) { hr = IDirect3D7_CreateVertexBuffer(d3d, &vb_desc, &buffer, 0); - ok(SUCCEEDED(hr), "Failed to create vertex buffer, hr %#x.\n", hr); + ok(SUCCEEDED(hr), "Failed to create vertex buffer, hr %#lx.\n", hr); hr = IDirect3DVertexBuffer7_Lock(buffer, DDLOCK_DISCARDCONTENTS, (void **)&quads, NULL); - ok(SUCCEEDED(hr), "Failed to lock vertex buffer, hr %#x.\n", hr); + ok(SUCCEEDED(hr), "Failed to lock vertex buffer, hr %#lx.\n", hr); for (j = 0; j < vb_desc.dwNumVertices / 4; ++j) { quads[j] = quad1; } hr = IDirect3DVertexBuffer7_Unlock(buffer); - ok(SUCCEEDED(hr), "Failed to unlock vertex buffer, hr %#x.\n", hr); + ok(SUCCEEDED(hr), "Failed to unlock vertex buffer, hr %#lx.\n", hr);
/* Start a draw operation. */ hr = IDirect3DDevice7_Clear(device, 0, NULL, D3DCLEAR_TARGET, 0xff0000ff, 0.0f, 0); - ok(SUCCEEDED(hr), "Failed to clear, hr %#x.\n", hr); + ok(SUCCEEDED(hr), "Failed to clear, hr %#lx.\n", hr); hr = IDirect3DDevice7_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 = IDirect3DDevice7_DrawPrimitiveVB(device, D3DPT_TRIANGLESTRIP, buffer, 0, vb_desc.dwNumVertices, 0); - ok(SUCCEEDED(hr), "Failed to draw, hr %#x.\n", hr); + ok(SUCCEEDED(hr), "Failed to draw, hr %#lx.\n", hr); hr = IDirect3DDevice7_EndScene(device); - ok(SUCCEEDED(hr), "Failed to end scene, hr %#x.\n", hr); + ok(SUCCEEDED(hr), "Failed to end scene, hr %#lx.\n", hr);
/* Map the last quad while the draw is in progress. */ hr = IDirect3DVertexBuffer7_Lock(buffer, DDLOCK_WAIT | tests[i].flags, (void **)&quads, NULL); - ok(SUCCEEDED(hr), "Failed to lock vertex buffer, hr %#x.\n", hr); + ok(SUCCEEDED(hr), "Failed to lock vertex buffer, hr %#lx.\n", hr); quads[(vb_desc.dwNumVertices / 4) - 1] = quad2; hr = IDirect3DVertexBuffer7_Unlock(buffer); - ok(SUCCEEDED(hr), "Failed to unlock vertex buffer, hr %#x.\n", hr); + ok(SUCCEEDED(hr), "Failed to unlock vertex buffer, hr %#lx.\n", hr);
colour = get_surface_color(rt, 320, 240); unsynchronised = compare_color(colour, 0x00ffff00, 1); @@ -15589,17 +15562,16 @@ done: IDirectDraw7_Release(ddraw); IDirect3D7_Release(d3d); refcount = IDirect3DDevice7_Release(device); - ok(!refcount, "Device has %u references left.\n", refcount); + ok(!refcount, "Device has %lu references left.\n", refcount); DestroyWindow(window); }
static void test_depth_readback(void) { - DWORD depth, expected_depth, max_diff, raw_value, passed_fmts = 0; + unsigned int depth, expected_depth, raw_value, i, x, y, max_diff, passed_fmts = 0; IDirectDrawSurface7 *rt, *ds; DDSURFACEDESC2 surface_desc; IDirect3DDevice7 *device; - unsigned int i, x, y; IDirectDraw7 *ddraw; IDirect3D7 *d3d; ULONG refcount; @@ -15646,19 +15618,19 @@ static void test_depth_readback(void) }
hr = IDirect3DDevice7_GetDirect3D(device, &d3d); - ok(SUCCEEDED(hr), "Failed to get Direct3D7 interface, hr %#x.\n", hr); + ok(SUCCEEDED(hr), "Failed to get Direct3D7 interface, hr %#lx.\n", hr); hr = IDirect3D7_QueryInterface(d3d, &IID_IDirectDraw7, (void **)&ddraw); - ok(SUCCEEDED(hr), "Failed to get ddraw interface, hr %#x.\n", hr); + ok(SUCCEEDED(hr), "Failed to get ddraw interface, hr %#lx.\n", hr);
hr = IDirect3DDevice7_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 = IDirect3DDevice7_SetRenderState(device, D3DRENDERSTATE_LIGHTING, 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);
ds = get_depth_stencil(device); hr = IDirectDrawSurface7_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); IDirectDrawSurface7_Release(ds);
for (i = 0; i < ARRAY_SIZE(tests); ++i) @@ -15685,18 +15657,18 @@ 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 = IDirect3DDevice7_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 = IDirect3DDevice7_Clear(device, 0, NULL, D3DCLEAR_TARGET | D3DCLEAR_ZBUFFER, 0xff0000ff, 1.0f, 0); - ok(SUCCEEDED(hr), "Failed to clear, hr %#x.\n", hr); + ok(SUCCEEDED(hr), "Failed to clear, hr %#lx.\n", hr); hr = IDirect3DDevice7_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 = IDirect3DDevice7_DrawPrimitive(device, D3DPT_TRIANGLESTRIP, D3DFVF_XYZ | D3DFVF_DIFFUSE, quad, 4, 0); - ok(SUCCEEDED(hr), "Failed to draw, hr %#x.\n", hr); + ok(SUCCEEDED(hr), "Failed to draw, hr %#lx.\n", hr); hr = IDirect3DDevice7_EndScene(device); - ok(SUCCEEDED(hr), "Failed to end scene, hr %#x.\n", hr); + ok(SUCCEEDED(hr), "Failed to end scene, hr %#lx.\n", hr);
all_zero = all_one = all_pass = TRUE; for (y = 60; y < 480; y += 120) @@ -15707,7 +15679,7 @@ static void test_depth_readback(void) memset(&surface_desc, 0, sizeof(surface_desc)); surface_desc.dwSize = sizeof(surface_desc); hr = IDirectDrawSurface7_Lock(ds, &r, &surface_desc, 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);
raw_value = *((DWORD *)surface_desc.lpSurface); if (raw_value) @@ -15746,14 +15718,14 @@ static void test_depth_readback(void) all_pass = FALSE;
hr = IDirectDrawSurface7_Unlock(ds, &r); - 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 = IDirectDrawSurface7_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); IDirectDrawSurface7_Release(ds); }
@@ -15763,7 +15735,7 @@ static void test_depth_readback(void) IDirectDraw7_Release(ddraw); IDirect3D7_Release(d3d); refcount = IDirect3DDevice7_Release(device); - ok(!refcount, "Device has %u references left.\n", refcount); + ok(!refcount, "Device has %lu references left.\n", refcount); DestroyWindow(window); }
@@ -15774,9 +15746,9 @@ static void test_clear(void) D3DVIEWPORT7 vp, old_vp; IDirectDraw7 *ddraw; D3DRECT rect_negneg; + unsigned int color; IDirect3D7 *d3d; D3DRECT rect[2]; - D3DCOLOR color; ULONG refcount; HWND window; HRESULT hr; @@ -15790,15 +15762,15 @@ static void test_clear(void) }
hr = IDirect3DDevice7_GetDirect3D(device, &d3d); - ok(SUCCEEDED(hr), "Failed to get Direct3D7 interface, hr %#x.\n", hr); + ok(SUCCEEDED(hr), "Failed to get Direct3D7 interface, hr %#lx.\n", hr); hr = IDirect3D7_QueryInterface(d3d, &IID_IDirectDraw7, (void **)&ddraw); - ok(SUCCEEDED(hr), "Failed to get ddraw interface, hr %#x.\n", hr); + ok(SUCCEEDED(hr), "Failed to get ddraw interface, hr %#lx.\n", hr);
hr = IDirect3DDevice7_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 = IDirect3DDevice7_Clear(device, 0, NULL, D3DCLEAR_TARGET, 0xffffffff, 0.0f, 0); - 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; @@ -15815,7 +15787,7 @@ static void test_clear(void) /* Clear 2 rectangles with one call. Unlike d3d8/9, the refrast does not * refuse negative rectangles, but it will not clear them either. */ hr = IDirect3DDevice7_Clear(device, 2, rect, D3DCLEAR_TARGET, 0xffff0000, 0.0f, 0); - 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); @@ -15827,7 +15799,7 @@ static void test_clear(void) ok(compare_color(color, 0x00ffffff, 0), "Clear rectangle 4 (neg, neg) has color 0x%08x.\n", color);
hr = IDirect3DDevice7_Clear(device, 0, NULL, D3DCLEAR_TARGET, 0xffffffff, 0.0, 0); - 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. */ U1(rect_negneg).x1 = 640; @@ -15835,7 +15807,7 @@ static void test_clear(void) U3(rect_negneg).x2 = 320; U4(rect_negneg).y2 = 0; hr = IDirect3DDevice7_Clear(device, 1, &rect_negneg, D3DCLEAR_TARGET, 0xff00ff00, 0.0f, 0); - 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) @@ -15856,9 +15828,9 @@ static void test_clear(void)
/* Test how the viewport affects clears. */ hr = IDirect3DDevice7_Clear(device, 0, NULL, D3DCLEAR_TARGET, 0xffffffff, 0.0f, 0); - ok(SUCCEEDED(hr), "Failed to clear, hr %#x.\n", hr); + ok(SUCCEEDED(hr), "Failed to clear, hr %#lx.\n", hr); hr = IDirect3DDevice7_GetViewport(device, &old_vp); - ok(SUCCEEDED(hr), "Failed to get viewport, hr %#x.\n", hr); + ok(SUCCEEDED(hr), "Failed to get viewport, hr %#lx.\n", hr);
vp.dwX = 160; vp.dwY = 120; @@ -15867,9 +15839,9 @@ static void test_clear(void) vp.dvMinZ = 0.0f; vp.dvMaxZ = 1.0f; hr = IDirect3DDevice7_SetViewport(device, &vp); - ok(SUCCEEDED(hr), "Failed to set viewport, hr %#x.\n", hr); + ok(SUCCEEDED(hr), "Failed to set viewport, hr %#lx.\n", hr); hr = IDirect3DDevice7_Clear(device, 0, NULL, D3DCLEAR_TARGET, 0xff0000ff, 0.0f, 0); - ok(SUCCEEDED(hr), "Failed to clear, hr %#x.\n", hr); + ok(SUCCEEDED(hr), "Failed to clear, hr %#lx.\n", hr);
vp.dwX = 320; vp.dwY = 240; @@ -15878,17 +15850,17 @@ static void test_clear(void) vp.dvMinZ = 0.0f; vp.dvMaxZ = 1.0f; hr = IDirect3DDevice7_SetViewport(device, &vp); - ok(SUCCEEDED(hr), "Failed to set viewport, hr %#x.\n", hr); + ok(SUCCEEDED(hr), "Failed to set viewport, hr %#lx.\n", hr);
U1(rect[0]).x1 = 160; U2(rect[0]).y1 = 120; U3(rect[0]).x2 = 480; U4(rect[0]).y2 = 360; hr = IDirect3DDevice7_Clear(device, 1, &rect[0], D3DCLEAR_TARGET, 0xff00ff00, 0.0f, 0); - ok(SUCCEEDED(hr), "Failed to clear, hr %#x.\n", hr); + ok(SUCCEEDED(hr), "Failed to clear, hr %#lx.\n", hr);
hr = IDirect3DDevice7_SetViewport(device, &old_vp); - ok(SUCCEEDED(hr), "Failed to set viewport, hr %#x.\n", hr); + ok(SUCCEEDED(hr), "Failed to set 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); @@ -15924,7 +15896,7 @@ static void test_clear(void) IDirectDraw7_Release(ddraw); IDirect3D7_Release(d3d); refcount = IDirect3DDevice7_Release(device); - ok(!refcount, "Device has %u references left.\n", refcount); + ok(!refcount, "Device has %lu references left.\n", refcount); DestroyWindow(window); }
@@ -15982,12 +15954,12 @@ static HRESULT WINAPI enum_surfaces_create_cb(IDirectDrawSurface7 *surface, DDSU 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 DDSURFACEDESC2 *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"); } @@ -16012,21 +15984,21 @@ static void test_enum_surfaces(void) memset(&desc, 0, sizeof(desc)); desc.dwSize = sizeof(desc); hr = IDirectDraw7_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 = U4(desc).ddpfPixelFormat;
hr = IDirectDraw7_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 = IDirectDraw7_EnumSurfaces(ddraw, DDENUMSURFACES_DOESEXIST | DDENUMSURFACES_ALL, NULL, NULL, NULL); - ok(hr == DDERR_INVALIDPARAMS, "Got unexpected hr %#x.\n", hr); + ok(hr == DDERR_INVALIDPARAMS, "Got unexpected hr %#lx.\n", hr);
hr = IDirectDraw7_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 = IDirectDraw7_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); @@ -16043,49 +16015,49 @@ static void test_enum_surfaces(void) }
hr = IDirectDrawSurface7_GetAttachedSurface(param.surfaces[0], &desc.ddsCaps, ¶m.surfaces[1]); - ok(hr == DD_OK, "Failed to get attached surface, hr %#x.\n", hr); + ok(hr == DD_OK, "Failed to get attached surface, hr %#lx.\n", hr); hr = IDirectDrawSurface7_GetAttachedSurface(param.surfaces[1], &desc.ddsCaps, ¶m.surfaces[2]); - ok(hr == DD_OK, "Failed to get attached surface, hr %#x.\n", hr); + ok(hr == DD_OK, "Failed to get attached surface, hr %#lx.\n", hr); hr = IDirectDrawSurface7_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 = IDirectDraw7_EnumSurfaces(ddraw, DDENUMSURFACES_DOESEXIST | DDENUMSURFACES_ALL, &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);
param.count = 0; hr = IDirectDraw7_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 == 3, "Got unexpected number of enumerated surfaces %u.\n", param.count);
desc.dwFlags = DDSD_WIDTH | DDSD_HEIGHT; param.count = 0; hr = IDirectDraw7_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 = IDirectDraw7_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 = IDirectDraw7_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 = IDirectDraw7_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);
IDirectDrawSurface7_Release(param.surfaces[2]); @@ -16095,7 +16067,7 @@ static void test_enum_surfaces(void) param.count = 0; hr = IDirectDraw7_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)); @@ -16105,15 +16077,15 @@ static void test_enum_surfaces(void)
hr = IDirectDraw7_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 = IDirectDraw7_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 = IDirectDraw7_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. */ @@ -16122,13 +16094,13 @@ static void test_enum_surfaces(void) desc.dwFlags |= DDSD_PIXELFORMAT; U4(desc).ddpfPixelFormat = current_format; hr = IDirectDraw7_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 = IDirectDraw7_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; @@ -16139,15 +16111,15 @@ static void test_enum_surfaces(void) param.count = 0; hr = IDirectDraw7_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 = IDirectDraw7_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 = IDirectDraw7_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); IDirectDrawSurface7_Release(param.surfaces[0]);
@@ -16159,7 +16131,7 @@ static void test_enum_surfaces(void) param.count = 0; hr = IDirectDraw7_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);
IDirectDraw7_Release(ddraw); @@ -16223,26 +16195,26 @@ static void test_viewport(void) }
hr = IDirect3DDevice7_GetDirect3D(device, &d3d); - ok(hr == DD_OK, "Got unexpected hr %#x.\n", hr); + ok(hr == DD_OK, "Got unexpected hr %#lx.\n", hr); hr = IDirect3D7_QueryInterface(d3d, &IID_IDirectDraw7, (void **)&ddraw); - ok(hr == DD_OK, "Got unexpected hr %#x.\n", hr); + ok(hr == DD_OK, "Got unexpected hr %#lx.\n", hr); IDirect3D7_Release(d3d);
hr = IDirect3DDevice7_SetRenderState(device, D3DRENDERSTATE_LIGHTING, FALSE); - ok(hr == DD_OK, "Got unexpected hr %#x.\n", hr); + ok(hr == DD_OK, "Got unexpected hr %#lx.\n", hr);
/* Well, by default the vertices without color info should be white, and without any texture * ops this should just show up in the output, but the r200 driver begs to differ and draws a * random color. */ hr = IDirect3DDevice7_SetTextureStageState(device, 0, D3DTSS_COLOROP, D3DTOP_SELECTARG1); - ok(hr == DD_OK, "Got unexpected hr %#x.\n", hr); + ok(hr == DD_OK, "Got unexpected hr %#lx.\n", hr); hr = IDirect3DDevice7_SetTextureStageState(device, 0, D3DTSS_COLORARG1, D3DTA_TFACTOR); - ok(hr == DD_OK, "Got unexpected hr %#x.\n", hr); + ok(hr == DD_OK, "Got unexpected hr %#lx.\n", hr); hr = IDirect3DDevice7_SetRenderState(device, D3DRENDERSTATE_TEXTUREFACTOR, 0x00ffffff); - ok(hr == DD_OK, "Got unexpected hr %#x.\n", hr); + ok(hr == DD_OK, "Got unexpected hr %#lx.\n", hr);
hr = IDirect3DDevice7_SetViewport(device, NULL); - ok(hr == E_INVALIDARG, "Got unexpected hr %#x.\n", hr); + ok(hr == E_INVALIDARG, "Got unexpected hr %#lx.\n", hr);
ds = get_depth_stencil(device); memset(&surface_desc, 0, sizeof(surface_desc)); @@ -16263,23 +16235,23 @@ static void test_viewport(void) surface_desc.dwHeight = rt_sizes[i].y; surface_desc.ddsCaps.dwCaps = DDSCAPS_OFFSCREENPLAIN | DDSCAPS_3DDEVICE; hr = IDirectDraw7_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; U4(surface_desc).ddpfPixelFormat = z_fmt; hr = IDirectDraw7_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 = IDirectDrawSurface7_AddAttachedSurface(rt, ds); - ok(hr == DD_OK, "Got unexpected hr %#x.\n", hr); + ok(hr == DD_OK, "Got unexpected hr %#lx.\n", hr);
hr = IDirect3DDevice7_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 = IDirect3DDevice7_GetRenderTarget(device, &rt); - ok(hr == DD_OK, "Got unexpected hr %#x.\n", hr); + ok(hr == DD_OK, "Got unexpected hr %#lx.\n", hr); }
for (j = 0; j < ARRAY_SIZE(tests); ++j) @@ -16288,32 +16260,32 @@ static void test_viewport(void)
hr = IDirect3DDevice7_Clear(device, 0, NULL, D3DCLEAR_TARGET | D3DCLEAR_ZBUFFER, 0xff000000, tests[j].expected_z - z_eps, 0); - ok(hr == DD_OK, "Got unexpected hr %#x.\n", hr); + ok(hr == DD_OK, "Got unexpected hr %#lx.\n", hr); hr = IDirect3DDevice7_SetRenderState(device, D3DRENDERSTATE_ZFUNC, D3DCMP_GREATER); - ok(hr == DD_OK, "Got unexpected hr %#x.\n", hr); + ok(hr == DD_OK, "Got unexpected hr %#lx.\n", hr);
hr = IDirect3DDevice7_SetRenderState(device, D3DRENDERSTATE_ZENABLE, !i); - ok(hr == DD_OK, "Got unexpected hr %#x.\n", hr); + ok(hr == DD_OK, "Got unexpected hr %#lx.\n", hr);
hr = IDirect3DDevice7_SetViewport(device, &tests[j].vp); if (tests[j].vp.dwX + tests[j].vp.dwWidth > rt_sizes[i].x || tests[j].vp.dwY + tests[j].vp.dwHeight > rt_sizes[i].y) { - ok(hr == E_INVALIDARG, "Got unexpected hr %#x.\n", hr); + ok(hr == E_INVALIDARG, "Got unexpected hr %#lx.\n", hr); winetest_pop_context(); continue; } else { - ok(hr == DD_OK, "Got unexpected hr %#x.\n", hr); + ok(hr == DD_OK, "Got unexpected hr %#lx.\n", hr); }
hr = IDirect3DDevice7_BeginScene(device); - ok(hr == DD_OK, "Got unexpected hr %#x.\n", hr); + ok(hr == DD_OK, "Got unexpected hr %#lx.\n", hr); hr = IDirect3DDevice7_DrawPrimitive(device, D3DPT_TRIANGLESTRIP, D3DFVF_XYZ, quad, 4, 0); - ok(hr == DD_OK, "Got unexpected hr %#x.\n", hr); + ok(hr == DD_OK, "Got unexpected hr %#lx.\n", hr); hr = IDirect3DDevice7_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);
@@ -16321,16 +16293,16 @@ static void test_viewport(void) { hr = IDirect3DDevice7_Clear(device, 0, NULL, D3DCLEAR_TARGET | D3DCLEAR_ZBUFFER, 0xff000000, tests[j].expected_z + z_eps, 0); - ok(hr == DD_OK, "Got unexpected hr %#x.\n", hr); + ok(hr == DD_OK, "Got unexpected hr %#lx.\n", hr); hr = IDirect3DDevice7_SetRenderState(device, D3DRENDERSTATE_ZFUNC, D3DCMP_LESS); - ok(hr == DD_OK, "Got unexpected hr %#x.\n", hr); + ok(hr == DD_OK, "Got unexpected hr %#lx.\n", hr);
hr = IDirect3DDevice7_BeginScene(device); - ok(hr == DD_OK, "Got unexpected hr %#x.\n", hr); + ok(hr == DD_OK, "Got unexpected hr %#lx.\n", hr); hr = IDirect3DDevice7_DrawPrimitive(device, D3DPT_TRIANGLESTRIP, D3DFVF_XYZ, quad, 4, 0); - ok(hr == DD_OK, "Got unexpected hr %#x.\n", hr); + ok(hr == DD_OK, "Got unexpected hr %#lx.\n", hr); hr = IDirect3DDevice7_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); } @@ -16339,7 +16311,7 @@ static void test_viewport(void) }
hr = IDirectDrawSurface7_DeleteAttachedSurface(rt, 0, ds); - ok(hr == DD_OK, "Got unexpected hr %#x.\n", hr); + ok(hr == DD_OK, "Got unexpected hr %#lx.\n", hr); IDirectDrawSurface7_Release(ds); IDirectDrawSurface7_Release(rt);
@@ -16347,7 +16319,7 @@ static void test_viewport(void) }
refcount = IDirect3DDevice7_Release(device); - ok(!refcount, "Device has %u references left.\n", refcount); + ok(!refcount, "Device has %lu references left.\n", refcount); IDirectDraw7_Release(ddraw); DestroyWindow(window); } @@ -16362,7 +16334,7 @@ static unsigned int validate_loaded_surface(IDirectDrawSurface7 *surface, unsign memset(&surface_desc, 0, sizeof(surface_desc)); surface_desc.dwSize = sizeof(surface_desc); hr = IDirectDrawSurface7_Lock(surface, NULL, &surface_desc, DDLOCK_WAIT, NULL); - ok(SUCCEEDED(hr), "Failed to map surface, hr %#x.\n", hr); + ok(SUCCEEDED(hr), "Failed to map surface, hr %#lx.\n", hr);
for (y = 0, diff = 0; y < surface_desc.dwHeight; ++y) { @@ -16392,7 +16364,7 @@ static unsigned int validate_loaded_surface(IDirectDrawSurface7 *surface, unsign }
hr = IDirectDrawSurface7_Unlock(surface, NULL); - ok(SUCCEEDED(hr), "Failed to unmap surface, hr %#x.\n", hr); + ok(SUCCEEDED(hr), "Failed to unmap surface, hr %#lx.\n", hr);
return diff; } @@ -16461,14 +16433,14 @@ static void test_device_load(void) }
hr = IDirect3DDevice7_GetDirect3D(device, &d3d); - ok(SUCCEEDED(hr), "Failed to get Direct3D7 interface, hr %#x.\n", hr); + ok(SUCCEEDED(hr), "Failed to get Direct3D7 interface, hr %#lx.\n", hr); hr = IDirect3D7_QueryInterface(d3d, &IID_IDirectDraw7, (void **)&ddraw); - ok(SUCCEEDED(hr), "Failed to get ddraw interface, hr %#x.\n", hr); + ok(SUCCEEDED(hr), "Failed to get ddraw interface, hr %#lx.\n", hr); IDirect3D7_Release(d3d);
memset(&d3d_caps, 0, sizeof(d3d_caps)); hr = IDirect3DDevice7_GetCaps(device, &d3d_caps); - ok(SUCCEEDED(hr), "Failed to get caps, hr %#x.\n", hr); + ok(SUCCEEDED(hr), "Failed to get caps, hr %#lx.\n", hr); cube_support = d3d_caps.dpcTriCaps.dwTextureCaps & D3DPTEXTURECAPS_CUBEMAP;
for (i = 0; i < ARRAY_SIZE(tests); ++i) @@ -16505,7 +16477,7 @@ static void test_device_load(void) U3(U4(surface_desc).ddpfPixelFormat).dwGBitMask = 0x0000ff00; U4(U4(surface_desc).ddpfPixelFormat).dwBBitMask = 0x000000ff; hr = IDirectDraw7_CreateSurface(ddraw, &surface_desc, &src_surface, NULL); - ok(SUCCEEDED(hr), "Test %u: Failed to create source surface, hr %#x.\n", i, hr); + ok(SUCCEEDED(hr), "Test %u: Failed to create source surface, hr %#lx.\n", i, hr);
surface_desc.dwFlags = DDSD_CAPS | DDSD_WIDTH | DDSD_HEIGHT | DDSD_PIXELFORMAT; if (tests[i].dst_mip_count) @@ -16522,7 +16494,7 @@ static void test_device_load(void) surface_desc.dwHeight = tests[i].dst_h; U2(surface_desc).dwMipMapCount = tests[i].dst_mip_count; hr = IDirectDraw7_CreateSurface(ddraw, &surface_desc, &dst_surface, NULL); - ok(SUCCEEDED(hr), "Test %u: Failed to create destination surface, hr %#x.\n", i, hr); + ok(SUCCEEDED(hr), "Test %u: Failed to create destination surface, hr %#lx.\n", i, hr);
src_count = dst_count = 1; if (tests[i].src_flags & TEX_MIP) @@ -16542,9 +16514,9 @@ static void test_device_load(void) memset(&surface_desc, 0, sizeof(surface_desc)); surface_desc.dwSize = sizeof(surface_desc); hr = IDirectDrawSurface7_GetSurfaceDesc(surface, &surface_desc); - ok(SUCCEEDED(hr), "Test %u: Failed to get surface description, hr %#x.\n", i, hr); + ok(SUCCEEDED(hr), "Test %u: Failed to get surface description, hr %#lx.\n", i, hr); ok(U2(surface_desc).dwMipMapCount == src_count, - "Test %u: Got unexpected mip count %u, expected %u.\n", + "Test %u: Got unexpected mip count %lu, expected %u.\n", i, U2(surface_desc).dwMipMapCount, src_count); }
@@ -16553,7 +16525,7 @@ static void test_device_load(void) memset(&surface_desc, 0, sizeof(surface_desc)); surface_desc.dwSize = sizeof(surface_desc); hr = IDirectDrawSurface7_Lock(surface, NULL, &surface_desc, DDLOCK_WAIT, NULL); - ok(SUCCEEDED(hr), "Test %u: Failed to map surface, hr %#x.\n", i, hr); + ok(SUCCEEDED(hr), "Test %u: Failed to map surface, hr %#lx.\n", i, hr);
for (y = 0; y < surface_desc.dwHeight; ++y) { @@ -16570,7 +16542,7 @@ static void test_device_load(void) }
hr = IDirectDrawSurface7_Unlock(surface, NULL); - ok(SUCCEEDED(hr), "Test %u: Failed to unmap surface, hr %#x.\n", i, hr); + ok(SUCCEEDED(hr), "Test %u: Failed to unmap surface, hr %#lx.\n", i, hr);
hr = IDirectDrawSurface7_GetAttachedSurface(surface, &mip_caps, &tmp); IDirectDrawSurface7_Release(surface); @@ -16599,9 +16571,9 @@ static void test_device_load(void) memset(&surface_desc, 0, sizeof(surface_desc)); surface_desc.dwSize = sizeof(surface_desc); hr = IDirectDrawSurface7_GetSurfaceDesc(surface, &surface_desc); - ok(SUCCEEDED(hr), "Test %u: Failed to get surface description, hr %#x.\n", i, hr); + ok(SUCCEEDED(hr), "Test %u: Failed to get surface description, hr %#lx.\n", i, hr); ok(U2(surface_desc).dwMipMapCount == dst_count, - "Test %u: Got unexpected mip count %u, expected %u.\n", + "Test %u: Got unexpected mip count %lu, expected %u.\n", i, U2(surface_desc).dwMipMapCount, dst_count); }
@@ -16611,7 +16583,7 @@ static void test_device_load(void) fx.dwSize = sizeof(fx); U5(fx).dwFillColor = 0x00000000; hr = IDirectDrawSurface7_Blt(surface, NULL, NULL, NULL, DDBLT_COLORFILL | DDBLT_WAIT, &fx); - ok(SUCCEEDED(hr), "Test %u: Failed to clear surface, hr %#x.\n", i, hr); + ok(SUCCEEDED(hr), "Test %u: Failed to clear surface, hr %#lx.\n", i, hr);
hr = IDirectDrawSurface7_GetAttachedSurface(surface, &mip_caps, &tmp); IDirectDrawSurface7_Release(surface); @@ -16634,7 +16606,7 @@ static void test_device_load(void) dst_surface, tests[i].dst_flags & NULL_COORDS ? NULL : &dst_point, src_surface, tests[i].src_flags & NULL_COORDS ? NULL : &src_rect, tests[i].dst_flags & TEX_CUBE ? DDSCAPS2_CUBEMAP_ALLFACES : 0); - 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 (SUCCEEDED(hr)) { @@ -16758,46 +16730,46 @@ static void test_device_load(void) U4(surface_desc).ddpfPixelFormat.dwFlags = DDPF_RGB | DDPF_PALETTEINDEXED8; U1(U4(surface_desc).ddpfPixelFormat).dwRGBBitCount = 8; hr = IDirectDraw7_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 = IDirectDraw7_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); hr = IDirectDrawSurface7_GetAttachedSurface(src_surface, &mip_caps, &surface); - ok(SUCCEEDED(hr), "Failed to get surface, hr %#x.\n", hr); + ok(SUCCEEDED(hr), "Failed to get surface, hr %#lx.\n", hr);
/* Test palette copying. */ memset(table1, 0, sizeof(table1)); table1[0].peBlue = 1; hr = IDirectDraw7_CreatePalette(ddraw, DDPCAPS_ALLOW256 | DDPCAPS_8BIT, table1, &src_palette, NULL); - ok(SUCCEEDED(hr), "Failed to create source palette, hr %#x.\n", hr); + ok(SUCCEEDED(hr), "Failed to create source palette, hr %#lx.\n", hr); table1[0].peBlue = 3; hr = IDirectDraw7_CreatePalette(ddraw, DDPCAPS_ALLOW256 | DDPCAPS_8BIT, table1, &dst_palette, NULL); - ok(SUCCEEDED(hr), "Failed to create destination palette, hr %#x.\n", hr); + ok(SUCCEEDED(hr), "Failed to create destination palette, hr %#lx.\n", hr);
hr = IDirectDrawSurface7_SetPalette(src_surface, 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 = IDirect3DDevice7_Load(device, dst_surface, NULL, src_surface, NULL, 0); - ok(SUCCEEDED(hr), "Failed to load texture, hr %#x.\n", hr); + ok(SUCCEEDED(hr), "Failed to load texture, hr %#lx.\n", hr);
hr = IDirectDrawSurface7_GetPalette(surface, &palette); - ok(hr == DDERR_NOPALETTEATTACHED, "Got unexpected hr %#x.\n", hr); + ok(hr == DDERR_NOPALETTEATTACHED, "Got unexpected hr %#lx.\n", hr); hr = IDirectDrawSurface7_GetPalette(dst_surface, &palette); - ok(hr == DDERR_NOPALETTEATTACHED, "Got unexpected hr %#x.\n", hr); + ok(hr == DDERR_NOPALETTEATTACHED, "Got unexpected hr %#lx.\n", hr);
hr = IDirectDrawSurface7_SetPalette(surface, src_palette); - ok(hr == DDERR_NOTONMIPMAPSUBLEVEL, "Got unexpected hr %#x.\n", hr); + ok(hr == DDERR_NOTONMIPMAPSUBLEVEL, "Got unexpected hr %#lx.\n", hr); hr = IDirectDrawSurface7_SetPalette(dst_surface, dst_palette); - ok(SUCCEEDED(hr), "Failed to set palette, hr %#x.\n", hr); + ok(SUCCEEDED(hr), "Failed to set palette, hr %#lx.\n", hr);
hr = IDirect3DDevice7_Load(device, dst_surface, NULL, src_surface, NULL, 0); - ok(SUCCEEDED(hr), "Failed to load texture, hr %#x.\n", hr); + ok(SUCCEEDED(hr), "Failed to load texture, hr %#lx.\n", hr);
hr = IDirectDrawSurface7_GetPalette(dst_surface, &palette); - ok(SUCCEEDED(hr), "Failed to get palette, hr %#x.\n", hr); + ok(SUCCEEDED(hr), "Failed to get palette, hr %#lx.\n", hr); ok(palette == dst_palette, "Got unexpected palette %p, expected %p.\n", palette, dst_palette); memset(table1, 0, sizeof(table1)); hr = IDirectDrawPalette_GetEntries(palette, 0, 0, 256, table1); - ok(SUCCEEDED(hr), "Failed to retrieve palette entries, hr %#x.\n", hr); + ok(SUCCEEDED(hr), "Failed to retrieve palette entries, hr %#lx.\n", hr); ok(table1[0].peBlue == 1, "Got unexpected palette colour %#x.\n", (unsigned int)table1[0].peBlue); IDirectDrawPalette_Release(palette);
@@ -16808,20 +16780,20 @@ static void test_device_load(void) colour_key.dwColorSpaceLowValue = 32; colour_key.dwColorSpaceHighValue = 64; hr = IDirectDrawSurface7_SetColorKey(src_surface, DDCKEY_SRCBLT, &colour_key); - ok(SUCCEEDED(hr), "Failed to set colour-key, hr %#x.\n", hr); + ok(SUCCEEDED(hr), "Failed to set colour-key, hr %#lx.\n", hr); hr = IDirectDrawSurface7_SetColorKey(surface, DDCKEY_SRCBLT, &colour_key); - ok(hr == DDERR_NOTONMIPMAPSUBLEVEL, "Got unexpected hr %#x.\n", hr); + ok(hr == DDERR_NOTONMIPMAPSUBLEVEL, "Got unexpected hr %#lx.\n", hr);
hr = IDirectDrawSurface7_GetColorKey(dst_surface, DDCKEY_SRCBLT, &colour_key); - ok(hr == DDERR_NOCOLORKEY, "Got unexpected hr %#x.\n", hr); + ok(hr == DDERR_NOCOLORKEY, "Got unexpected hr %#lx.\n", hr);
hr = IDirect3DDevice7_Load(device, dst_surface, NULL, src_surface, NULL, 0); - ok(SUCCEEDED(hr), "Failed to load texture, hr %#x.\n", hr); + ok(SUCCEEDED(hr), "Failed to load texture, hr %#lx.\n", hr);
hr = IDirectDrawSurface7_GetColorKey(dst_surface, DDCKEY_SRCBLT, &colour_key); - ok(SUCCEEDED(hr), "Failed to get colour-key, hr %#x.\n", hr); - ok(colour_key.dwColorSpaceLowValue == 32, "Got unexpected value %u.\n", colour_key.dwColorSpaceLowValue); - ok(colour_key.dwColorSpaceHighValue == 32, "Got unexpected value %u.\n", colour_key.dwColorSpaceHighValue); + ok(SUCCEEDED(hr), "Failed to get colour-key, hr %#lx.\n", hr); + ok(colour_key.dwColorSpaceLowValue == 32, "Got unexpected value %lu.\n", colour_key.dwColorSpaceLowValue); + ok(colour_key.dwColorSpaceHighValue == 32, "Got unexpected value %lu.\n", colour_key.dwColorSpaceHighValue);
IDirectDrawSurface7_Release(surface); IDirectDrawSurface7_Release(dst_surface); @@ -16829,7 +16801,7 @@ static void test_device_load(void)
IDirectDraw7_Release(ddraw); refcount = IDirect3DDevice7_Release(device); - ok(!refcount, "Device has %u references left.\n", refcount); + ok(!refcount, "Device has %lu references left.\n", refcount); DestroyWindow(window); }
@@ -16837,9 +16809,8 @@ static void test_color_vertex(void) { IDirect3DDevice7 *device; IDirectDrawSurface7 *rt; + unsigned int colour, i; D3DMATERIAL7 material; - D3DCOLOR colour; - unsigned int i; ULONG refcount; HWND window; HRESULT hr; @@ -16887,7 +16858,8 @@ static void test_color_vertex(void) * should allow deduction of where the material colour came from. */ static const struct { - DWORD fvf, color_vertex, ambient, emissive, result; + DWORD fvf, color_vertex, ambient, emissive; + unsigned int result; void *vtx; } tests[] = @@ -16919,40 +16891,40 @@ static void test_color_vertex(void) return; } hr = IDirect3DDevice7_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 = IDirect3DDevice7_SetRenderState(device, D3DRENDERSTATE_LIGHTING, 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 = IDirect3DDevice7_SetRenderState(device, D3DRENDERSTATE_AMBIENT, 0xffffffff); - 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(&material, 0, sizeof(material)); U3(U1(material).ambient).b = 0.5f; U3(U3(material).emissive).b = 0.25f; hr = IDirect3DDevice7_SetMaterial(device, &material); - ok(SUCCEEDED(hr), "Failed to set material, hr %#x\n", hr); + ok(SUCCEEDED(hr), "Failed to set material, hr %#lx\n", hr);
for (i = 0; i < ARRAY_SIZE(tests); ++i) { hr = IDirect3DDevice7_SetRenderState(device, D3DRENDERSTATE_COLORVERTEX, tests[i].color_vertex); - 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 = IDirect3DDevice7_SetRenderState(device, D3DRENDERSTATE_AMBIENTMATERIALSOURCE, tests[i].ambient); - 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 = IDirect3DDevice7_SetRenderState(device, D3DRENDERSTATE_EMISSIVEMATERIALSOURCE, tests[i].emissive); - 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 = IDirect3DDevice7_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 = IDirect3DDevice7_Clear(device, 0, NULL, D3DCLEAR_TARGET, 0x77777777, 0.0f, 0); - ok(SUCCEEDED(hr), "Failed to clear depth/stencil, hr %#x.\n", hr); + ok(SUCCEEDED(hr), "Failed to clear depth/stencil, hr %#lx.\n", hr);
hr = IDirect3DDevice7_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 = IDirect3DDevice7_DrawPrimitive(device, D3DPT_TRIANGLESTRIP, D3DFVF_XYZ | tests[i].fvf, tests[i].vtx, 4, 0); - ok(SUCCEEDED(hr), "Failed to draw, hr %#x.\n", hr); + ok(SUCCEEDED(hr), "Failed to draw, hr %#lx.\n", hr); hr = IDirect3DDevice7_EndScene(device); - ok(SUCCEEDED(hr), "Failed to end scene, hr %#x.\n", hr); + ok(SUCCEEDED(hr), "Failed to end scene, hr %#lx.\n", hr);
colour = get_surface_color(rt, 320, 240); ok(compare_color(colour, tests[i].result, 1), @@ -16962,7 +16934,7 @@ static void test_color_vertex(void)
IDirectDrawSurface7_Release(rt); refcount = IDirect3DDevice7_Release(device); - ok(!refcount, "Device has %u references left.\n", refcount); + ok(!refcount, "Device has %lu references left.\n", refcount); DestroyWindow(window); }
@@ -16976,9 +16948,9 @@ static LRESULT CALLBACK killfocus_proc(HWND window, UINT message, WPARAM wparam, if (message == WM_KILLFOCUS) { ref = IDirectDrawSurface7_Release(killfocus_surface); - ok(!ref, "Unexpected surface refcount %u.\n", ref); + ok(!ref, "Unexpected surface refcount %lu.\n", ref); ref = IDirectDraw7_Release(killfocus_ddraw); - ok(!ref, "Unexpected ddraw refcount %u.\n", ref); + ok(!ref, "Unexpected ddraw refcount %lu.\n", ref); killfocus_ddraw = NULL; }
@@ -17003,14 +16975,14 @@ static void test_killfocus(void) ok(!!killfocus_ddraw, "Failed to create a ddraw object.\n");
hr = IDirectDraw7_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 = IDirectDraw7_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"); @@ -17027,8 +16999,8 @@ static void test_sysmem_draw(void) IDirect3DVertexBuffer7 *vb; IDirect3DDevice7 *device; IDirectDraw7 *ddraw; + unsigned int colour; IDirect3D7 *d3d; - D3DCOLOR colour; ULONG refcount; HWND window; HRESULT hr; @@ -17059,50 +17031,50 @@ static void test_sysmem_draw(void) }
hr = IDirect3DDevice7_GetDirect3D(device, &d3d); - ok(hr == DD_OK, "Got unexpected hr %#x.\n", hr); + ok(hr == DD_OK, "Got unexpected hr %#lx.\n", hr); hr = IDirect3D7_QueryInterface(d3d, &IID_IDirectDraw7, (void **)&ddraw); - ok(hr == DD_OK, "Got unexpected hr %#x.\n", hr); + ok(hr == DD_OK, "Got unexpected hr %#lx.\n", hr); hr = IDirect3DDevice7_GetRenderTarget(device, &rt); - ok(hr == DD_OK, "Got unexpected hr %#x.\n", hr); + ok(hr == DD_OK, "Got unexpected hr %#lx.\n", hr);
hr = IDirect3DDevice7_SetRenderState(device, D3DRENDERSTATE_LIGHTING, FALSE); - ok(hr == DD_OK, "Got unexpected hr %#x.\n", hr); + ok(hr == DD_OK, "Got unexpected hr %#lx.\n", hr);
vb_desc.dwSize = sizeof(vb_desc); vb_desc.dwCaps = D3DVBCAPS_SYSTEMMEMORY; vb_desc.dwFVF = D3DFVF_XYZ | D3DFVF_DIFFUSE; vb_desc.dwNumVertices = 4; hr = IDirect3D7_CreateVertexBuffer(d3d, &vb_desc, &vb, 0); - ok(hr == DD_OK, "Got unexpected hr %#x.\n", hr); + ok(hr == DD_OK, "Got unexpected hr %#lx.\n", hr);
hr = IDirect3DVertexBuffer7_Lock(vb, 0, (void **)&data, NULL); - ok(hr == DD_OK, "Got unexpected hr %#x.\n", hr); + ok(hr == DD_OK, "Got unexpected hr %#lx.\n", hr); memcpy(data, quad, sizeof(quad)); hr = IDirect3DVertexBuffer7_Unlock(vb); - ok(hr == DD_OK, "Got unexpected hr %#x.\n", hr); + ok(hr == DD_OK, "Got unexpected hr %#lx.\n", hr);
hr = IDirect3DDevice7_Clear(device, 0, NULL, D3DCLEAR_TARGET, 0x77777777, 0.0f, 0); - ok(hr == DD_OK, "Got unexpected hr %#x.\n", hr); + ok(hr == DD_OK, "Got unexpected hr %#lx.\n", hr);
hr = IDirect3DDevice7_BeginScene(device); - ok(hr == DD_OK, "Got unexpected hr %#x.\n", hr); + ok(hr == DD_OK, "Got unexpected hr %#lx.\n", hr); hr = IDirect3DDevice7_DrawPrimitiveVB(device, D3DPT_TRIANGLESTRIP, vb, 0, 4, 0); - ok(hr == DD_OK, "Got unexpected hr %#x.\n", hr); + ok(hr == DD_OK, "Got unexpected hr %#lx.\n", hr); hr = IDirect3DDevice7_EndScene(device); - ok(hr == DD_OK, "Got unexpected hr %#x.\n", hr); + ok(hr == DD_OK, "Got unexpected hr %#lx.\n", hr);
colour = get_surface_color(rt, 320, 240); ok(compare_color(colour, 0x00007f7f, 1), "Got unexpected colour 0x%08x.\n", colour);
hr = IDirect3DDevice7_Clear(device, 0, NULL, D3DCLEAR_TARGET, 0x77777777, 0.0f, 0); - ok(hr == DD_OK, "Got unexpected hr %#x.\n", hr); + ok(hr == DD_OK, "Got unexpected hr %#lx.\n", hr);
hr = IDirect3DDevice7_BeginScene(device); - ok(hr == DD_OK, "Got unexpected hr %#x.\n", hr); + ok(hr == DD_OK, "Got unexpected hr %#lx.\n", hr); hr = IDirect3DDevice7_DrawIndexedPrimitiveVB(device, D3DPT_TRIANGLESTRIP, vb, 0, 4, indices, 4, 0); - ok(hr == DD_OK, "Got unexpected hr %#x.\n", hr); + ok(hr == DD_OK, "Got unexpected hr %#lx.\n", hr); hr = IDirect3DDevice7_EndScene(device); - ok(hr == DD_OK, "Got unexpected hr %#x.\n", hr); + ok(hr == DD_OK, "Got unexpected hr %#lx.\n", hr);
colour = get_surface_color(rt, 320, 240); ok(compare_color(colour, 0x00007f7f, 1), "Got unexpected colour 0x%08x.\n", colour); @@ -17121,19 +17093,19 @@ static void test_sysmem_draw(void) U4(U4(surface_desc).ddpfPixelFormat).dwBBitMask = 0x000000ff; U5(U4(surface_desc).ddpfPixelFormat).dwRGBAlphaBitMask = 0xff000000; hr = IDirectDraw7_CreateSurface(ddraw, &surface_desc, &texture, NULL); - ok(hr == DD_OK, "Got unexpected hr %#x.\n", hr); + ok(hr == DD_OK, "Got unexpected hr %#lx.\n", hr); hr = IDirect3DDevice7_SetTexture(device, 0, texture); - ok(hr == D3D_OK, "Got unexpected hr %#x.\n", hr); + ok(hr == D3D_OK, "Got unexpected hr %#lx.\n", hr);
hr = IDirect3DDevice7_Clear(device, 0, NULL, D3DCLEAR_TARGET, 0x77777777, 0.0f, 0); - ok(hr == D3D_OK, "Got unexpected hr %#x.\n", hr); + ok(hr == D3D_OK, "Got unexpected hr %#lx.\n", hr);
hr = IDirect3DDevice7_BeginScene(device); - ok(hr == D3D_OK, "Got unexpected hr %#x.\n", hr); + ok(hr == D3D_OK, "Got unexpected hr %#lx.\n", hr); hr = IDirect3DDevice7_DrawPrimitiveVB(device, D3DPT_TRIANGLESTRIP, vb, 0, 4, 0); - ok(hr == D3D_OK, "Got unexpected hr %#x.\n", hr); + ok(hr == D3D_OK, "Got unexpected hr %#lx.\n", hr); hr = IDirect3DDevice7_EndScene(device); - ok(hr == D3D_OK || hr == D3DERR_SCENE_END_FAILED, "Got unexpected hr %#x.\n", hr); + ok(hr == D3D_OK || hr == D3DERR_SCENE_END_FAILED, "Got unexpected hr %#lx.\n", hr);
IDirectDrawSurface7_Release(texture); IDirect3DVertexBuffer7_Release(vb); @@ -17141,7 +17113,7 @@ static void test_sysmem_draw(void) IDirectDraw7_Release(ddraw); IDirect3D7_Release(d3d); refcount = IDirect3DDevice7_Release(device); - ok(!refcount, "Device has %u references left.\n", refcount); + ok(!refcount, "Device has %lu references left.\n", refcount); DestroyWindow(window); }
@@ -17159,38 +17131,38 @@ static void test_gdi_surface(void) ddraw = create_ddraw(); ok(!!ddraw, "Failed to create a ddraw object.\n"); hr = IDirectDraw7_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 = IDirectDraw7_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 = IDirectDraw7_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 = IDirectDraw7_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 = IDirectDraw7_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); IDirectDrawSurface7_Release(gdi_surface);
/* Flipping to the GDI surface requires the primary surface to be * flippable. */ hr = IDirectDraw7_FlipToGDISurface(ddraw); - ok(hr == DDERR_NOTFLIPPABLE, "Got unexpected hr %#x.\n", hr); + ok(hr == DDERR_NOTFLIPPABLE, "Got unexpected hr %#lx.\n", hr);
IDirectDrawSurface7_Release(primary);
hr = IDirectDraw7_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); @@ -17198,40 +17170,40 @@ static void test_gdi_surface(void) surface_desc.ddsCaps.dwCaps = DDSCAPS_PRIMARYSURFACE | DDSCAPS_COMPLEX | DDSCAPS_FLIP; U5(surface_desc).dwBackBufferCount = 1; hr = IDirectDraw7_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 = IDirectDrawSurface7_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 = IDirectDraw7_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); IDirectDrawSurface7_Release(gdi_surface);
hr = IDirectDrawSurface7_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 = IDirectDraw7_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); IDirectDrawSurface7_Release(gdi_surface);
hr = IDirectDraw7_FlipToGDISurface(ddraw); - ok(hr == DD_OK, "Got unexpected hr %#x.\n", hr); + ok(hr == DD_OK, "Got unexpected hr %#lx.\n", hr);
hr = IDirectDraw7_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); IDirectDrawSurface7_Release(gdi_surface);
hr = IDirectDraw7_FlipToGDISurface(ddraw); - ok(hr == DD_OK, "Got unexpected hr %#x.\n", hr); + ok(hr == DD_OK, "Got unexpected hr %#lx.\n", hr);
IDirectDrawSurface7_Release(backbuffer); IDirectDrawSurface7_Release(primary);
refcount = IDirectDraw7_Release(ddraw); - ok(!refcount, "%u references left.\n", refcount); + ok(!refcount, "%lu references left.\n", refcount); DestroyWindow(window); }
@@ -17289,52 +17261,52 @@ static void test_multiply_transform(void) for (i = 0; i < ARRAY_SIZE(tests); ++i) { hr = IDirect3DDevice7_GetTransform(device, tests[i], &ret_mat); - ok(hr == D3D_OK, "Test %u: Got unexpected hr %#x.\n", i, hr); + ok(hr == D3D_OK, "Test %u: Got unexpected hr %#lx.\n", i, hr); ok(!memcmp(&ret_mat, &mat1, sizeof(mat1)), "Test %u: Got unexpected transform matrix.\n", i);
hr = IDirect3DDevice7_MultiplyTransform(device, tests[i], &mat2); - ok(hr == D3D_OK, "Test %u: Got unexpected hr %#x.\n", i, hr); + ok(hr == D3D_OK, "Test %u: Got unexpected hr %#lx.\n", i, hr);
hr = IDirect3DDevice7_GetTransform(device, tests[i], &ret_mat); - ok(hr == D3D_OK, "Test %u: Got unexpected hr %#x.\n", i, hr); + ok(hr == D3D_OK, "Test %u: Got unexpected hr %#lx.\n", i, hr); ok(!memcmp(&ret_mat, &mat2, sizeof(mat2)), "Test %u: Got unexpected transform matrix.\n", i);
/* MultiplyTransform() goes directly into the primary stateblock. */
hr = IDirect3DDevice7_SetTransform(device, tests[i], &mat1); - ok(hr == D3D_OK, "Test %u: Got unexpected hr %#x.\n", i, hr); + ok(hr == D3D_OK, "Test %u: Got unexpected hr %#lx.\n", i, hr);
hr = IDirect3DDevice7_BeginStateBlock(device); - ok(hr == D3D_OK, "Test %u: Got unexpected hr %#x.\n", i, hr); + ok(hr == D3D_OK, "Test %u: Got unexpected hr %#lx.\n", i, hr);
hr = IDirect3DDevice7_MultiplyTransform(device, tests[i], &mat2); - ok(hr == D3D_OK, "Test %u: Got unexpected hr %#x.\n", i, hr); + ok(hr == D3D_OK, "Test %u: Got unexpected hr %#lx.\n", i, hr);
hr = IDirect3DDevice7_EndStateBlock(device, &stateblock); - ok(hr == D3D_OK, "Test %u: Got unexpected hr %#x.\n", i, hr); + ok(hr == D3D_OK, "Test %u: Got unexpected hr %#lx.\n", i, hr);
hr = IDirect3DDevice7_GetTransform(device, tests[i], &ret_mat); - ok(hr == D3D_OK, "Test %u: Got unexpected hr %#x.\n", i, hr); + ok(hr == D3D_OK, "Test %u: Got unexpected hr %#lx.\n", i, hr); ok(!memcmp(&ret_mat, &mat2, sizeof(mat2)), "Test %u: Got unexpected transform matrix.\n", i);
hr = IDirect3DDevice7_CaptureStateBlock(device, stateblock); - ok(hr == D3D_OK, "Test %u: Got unexpected hr %#x.\n", i, hr); + ok(hr == D3D_OK, "Test %u: Got unexpected hr %#lx.\n", i, hr);
hr = IDirect3DDevice7_SetTransform(device, tests[i], &mat1); - ok(hr == D3D_OK, "Test %u: Got unexpected hr %#x.\n", i, hr); + ok(hr == D3D_OK, "Test %u: Got unexpected hr %#lx.\n", i, hr);
hr = IDirect3DDevice7_ApplyStateBlock(device, stateblock); - ok(hr == D3D_OK, "Test %u: Got unexpected hr %#x.\n", i, hr); + ok(hr == D3D_OK, "Test %u: Got unexpected hr %#lx.\n", i, hr);
hr = IDirect3DDevice7_GetTransform(device, tests[i], &ret_mat); - ok(hr == D3D_OK, "Test %u: Got unexpected hr %#x.\n", i, hr); + ok(hr == D3D_OK, "Test %u: Got unexpected hr %#lx.\n", i, hr); ok(!memcmp(&ret_mat, &mat1, sizeof(mat1)), "Test %u: Got unexpected transform matrix.\n", i);
IDirect3DDevice7_DeleteStateBlock(device, stateblock); }
refcount = IDirect3DDevice7_Release(device); - ok(!refcount, "Device has %u references left.\n", refcount); + ok(!refcount, "Device has %lu references left.\n", refcount); DestroyWindow(window); }
@@ -17344,8 +17316,7 @@ static void test_alphatest(void) #define ALPHATEST_FAILED 0x00ff0000 IDirect3DDevice7 *device; IDirectDrawSurface7 *rt; - unsigned int i; - D3DCOLOR color; + unsigned int color, i; ULONG refcount; HWND window; DWORD value; @@ -17354,9 +17325,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[] = { @@ -17390,52 +17359,52 @@ static void test_alphatest(void) return; } hr = IDirect3DDevice7_GetRenderTarget(device, &rt); - ok(hr == D3D_OK, "Got unexpected hr %#x.\n", hr); + ok(hr == D3D_OK, "Got unexpected hr %#lx.\n", hr);
hr = IDirect3DDevice7_Clear(device, 0, NULL, D3DCLEAR_TARGET, 0xff0000ff, 0.0f, 0); - ok(hr == D3D_OK, "Got unexpected hr %#x.\n", hr); + ok(hr == D3D_OK, "Got unexpected hr %#lx.\n", hr); hr = IDirect3DDevice7_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 = IDirect3DDevice7_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 = IDirect3DDevice7_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);
for (i = 0; i < ARRAY_SIZE(test_data); ++i) { hr = IDirect3DDevice7_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 = IDirect3DDevice7_Clear(device, 0, NULL, D3DCLEAR_TARGET, ALPHATEST_FAILED, 0.0f, 0); - ok(hr == D3D_OK, "Got unexpected hr %#x.\n", hr); + ok(hr == D3D_OK, "Got unexpected hr %#lx.\n", hr); hr = IDirect3DDevice7_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 = IDirect3DDevice7_BeginScene(device); - ok(hr == D3D_OK, "Got unexpected hr %#x.\n", hr); + ok(hr == D3D_OK, "Got unexpected hr %#lx.\n", hr); hr = IDirect3DDevice7_DrawPrimitive(device, D3DPT_TRIANGLESTRIP, D3DFVF_XYZ | D3DFVF_DIFFUSE, 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 = IDirect3DDevice7_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 = IDirect3DDevice7_Clear(device, 0, NULL, D3DCLEAR_TARGET, ALPHATEST_FAILED, 0.0f, 0); - ok(hr == D3D_OK, "Got unexpected hr %#x.\n", hr); + ok(hr == D3D_OK, "Got unexpected hr %#lx.\n", hr); hr = IDirect3DDevice7_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 = IDirect3DDevice7_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 = IDirect3DDevice7_BeginScene(device); - ok(hr == D3D_OK, "Got unexpected hr %#x.\n", hr); + ok(hr == D3D_OK, "Got unexpected hr %#lx.\n", hr); hr = IDirect3DDevice7_DrawPrimitive(device, D3DPT_TRIANGLESTRIP, D3DFVF_XYZ | D3DFVF_DIFFUSE, 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 = IDirect3DDevice7_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", @@ -17444,7 +17413,7 @@ static void test_alphatest(void)
IDirectDrawSurface7_Release(rt); refcount = IDirect3DDevice7_Release(device); - ok(!refcount, "Device has %u references left.\n", refcount); + ok(!refcount, "Device has %lu references left.\n", refcount); DestroyWindow(window); }
@@ -17465,24 +17434,24 @@ static void test_clipper_refcount(void) ddraw = create_ddraw(); ok(!!ddraw, "Failed to create a ddraw object.\n"); hr = IDirectDraw7_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 = IDirectDraw7_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 = IDirectDraw7_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 = IDirectDraw7_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; @@ -17490,50 +17459,50 @@ static void test_clipper_refcount(void)
/* Surfaces hold a reference to clippers. No surprises there. */ hr = IDirectDrawSurface7_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 = IDirectDrawSurface7_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 = IDirectDrawSurface7_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 = IDirectDrawSurface7_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 = IDirectDrawSurface7_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. @@ -17541,11 +17510,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 = IDirectDraw7_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 = IDirectDraw7_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 = IDirectDrawSurface7_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); @@ -17561,7 +17530,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 = IDirectDrawSurface7_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); }
@@ -17569,10 +17538,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 = IDirectDrawSurface7_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. */ @@ -17585,33 +17554,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 = IDirectDraw7_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 = IDirectDraw7_Release(ddraw); - ok(!refcount, "%u references left.\n", refcount); + ok(!refcount, "%lu references left.\n", refcount); DestroyWindow(window); }
@@ -17633,56 +17602,56 @@ static void test_begin_end_state_block(void) }
hr = IDirect3DDevice7_BeginStateBlock(device); - ok(hr == D3D_OK, "Got unexpected hr %#x.\n", hr); + ok(hr == D3D_OK, "Got unexpected hr %#lx.\n", hr);
hr = IDirect3DDevice7_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);
stateblock = 0xdeadbeef; hr = IDirect3DDevice7_EndStateBlock(device, &stateblock); - ok(hr == D3D_OK, "Got unexpected hr %#x.\n", hr); - ok(!!stateblock && stateblock != 0xdeadbeef, "Got unexpected stateblock %#x.\n", stateblock); + ok(hr == D3D_OK, "Got unexpected hr %#lx.\n", hr); + ok(!!stateblock && stateblock != 0xdeadbeef, "Got unexpected stateblock %#lx.\n", stateblock);
stateblock2 = 0xdeadbeef; hr = IDirect3DDevice7_EndStateBlock(device, &stateblock2); - ok(hr == D3DERR_NOTINBEGINSTATEBLOCK, "Got unexpected hr %#x.\n", hr); - ok(stateblock2 == 0xdeadbeef, "Got unexpected stateblock %#x.\n", stateblock2); + ok(hr == D3DERR_NOTINBEGINSTATEBLOCK, "Got unexpected hr %#lx.\n", hr); + ok(stateblock2 == 0xdeadbeef, "Got unexpected stateblock %#lx.\n", stateblock2);
hr = IDirect3DDevice7_GetRenderState(device, D3DRENDERSTATE_LIGHTING, &value); - ok(hr == D3D_OK, "Got unexpected hr %#x.\n", hr); - ok(value == TRUE, "Got unexpected value %#x.\n", value); + ok(hr == D3D_OK, "Got unexpected hr %#lx.\n", hr); + ok(value == TRUE, "Got unexpected value %#lx.\n", value);
hr = IDirect3DDevice7_BeginStateBlock(device); - ok(hr == D3D_OK, "Got unexpected hr %#x.\n", hr); + ok(hr == D3D_OK, "Got unexpected hr %#lx.\n", hr);
hr = IDirect3DDevice7_BeginStateBlock(device); - ok(hr == D3DERR_INBEGINSTATEBLOCK, "Got unexpected hr %#x.\n", hr); + ok(hr == D3DERR_INBEGINSTATEBLOCK, "Got unexpected hr %#lx.\n", hr);
hr = IDirect3DDevice7_ApplyStateBlock(device, stateblock); - ok(hr == D3DERR_INBEGINSTATEBLOCK, "Got unexpected hr %#x.\n", hr); + ok(hr == D3DERR_INBEGINSTATEBLOCK, "Got unexpected hr %#lx.\n", hr);
hr = IDirect3DDevice7_CaptureStateBlock(device, stateblock); - ok(hr == D3DERR_INBEGINSTATEBLOCK, "Got unexpected hr %#x.\n", hr); + ok(hr == D3DERR_INBEGINSTATEBLOCK, "Got unexpected hr %#lx.\n", hr);
hr = IDirect3DDevice7_CreateStateBlock(device, D3DSBT_ALL, &stateblock2); - ok(hr == D3DERR_INBEGINSTATEBLOCK, "Got unexpected hr %#x.\n", hr); + ok(hr == D3DERR_INBEGINSTATEBLOCK, "Got unexpected hr %#lx.\n", hr);
hr = IDirect3DDevice7_GetRenderState(device, D3DRENDERSTATE_LIGHTING, &value); - ok(hr == D3D_OK, "Got unexpected hr %#x.\n", hr); - ok(value == TRUE, "Got unexpected value %#x.\n", value); + ok(hr == D3D_OK, "Got unexpected hr %#lx.\n", hr); + ok(value == TRUE, "Got unexpected value %#lx.\n", value);
hr = IDirect3DDevice7_EndStateBlock(device, &stateblock2); - ok(hr == D3D_OK, "Got unexpected hr %#x.\n", hr); + ok(hr == D3D_OK, "Got unexpected hr %#lx.\n", hr);
hr = IDirect3DDevice7_ApplyStateBlock(device, stateblock2); - ok(hr == D3D_OK, "Got unexpected hr %#x.\n", hr); + ok(hr == D3D_OK, "Got unexpected hr %#lx.\n", hr);
hr = IDirect3DDevice7_GetRenderState(device, D3DRENDERSTATE_LIGHTING, &value); - ok(hr == D3D_OK, "Got unexpected hr %#x.\n", hr); - ok(value == TRUE, "Got unexpected value %#x.\n", value); + ok(hr == D3D_OK, "Got unexpected hr %#lx.\n", hr); + ok(value == TRUE, "Got unexpected value %#lx.\n", value);
refcount = IDirect3DDevice7_Release(device); - ok(!refcount, "Device has %u references left.\n", refcount); + ok(!refcount, "Device has %lu references left.\n", refcount); DestroyWindow(window); }
@@ -17734,77 +17703,77 @@ static void test_caps(void) hal_caps.dwSize = sizeof(hal_caps); hel_caps.dwSize = sizeof(hel_caps); hr = IDirectDraw7_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);
IDirectDraw7_Release(ddraw);
if (hal_caps.ddsCaps.dwCaps) { hr = pDirectDrawCreateEx((GUID *)DDCREATE_HARDWAREONLY, (void **)&ddraw, &IID_IDirectDraw7, 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)); memset(&hel_caps, 0, sizeof(hel_caps)); hal_caps.dwSize = sizeof(hal_caps); hel_caps.dwSize = sizeof(hel_caps); hr = IDirectDraw7_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); - todo_wine ok(!hel_caps.ddsCaps.dwCaps, "Got unexpected caps %#x.\n", hel_caps.ddsCaps.dwCaps); + "Got unexpected caps %#lx.\n", hal_caps.ddsCaps.dwCaps); + todo_wine ok(!hel_caps.ddsCaps.dwCaps, "Got unexpected caps %#lx.\n", hel_caps.ddsCaps.dwCaps);
IDirectDraw7_Release(ddraw); }
hr = pDirectDrawCreateEx((GUID *)DDCREATE_EMULATIONONLY, (void **)&ddraw, &IID_IDirectDraw7, 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)); memset(&hel_caps, 0, sizeof(hel_caps)); hal_caps.dwSize = sizeof(hal_caps); hel_caps.dwSize = sizeof(hel_caps); hr = IDirectDraw7_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);
IDirectDraw7_Release(ddraw); } @@ -17822,7 +17791,7 @@ static void test_d32_support(void) ddraw = create_ddraw(); ok(!!ddraw, "Failed to create a ddraw object.\n"); hr = IDirectDraw7_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); @@ -17835,25 +17804,25 @@ static void test_d32_support(void) surface_desc.dwWidth = 64; surface_desc.dwHeight = 64; hr = IDirectDraw7_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 = IDirectDrawSurface7_GetSurfaceDesc(surface, &surface_desc); - ok(hr == DD_OK, "Got unexpected hr %#x.\n", hr); - ok((surface_desc.dwFlags & DDSD_PIXELFORMAT), "Got unexpected flags %#x.\n", surface_desc.dwFlags); + ok(hr == DD_OK, "Got unexpected hr %#lx.\n", hr); + ok((surface_desc.dwFlags & DDSD_PIXELFORMAT), "Got unexpected flags %#lx.\n", surface_desc.dwFlags); ok(U4(surface_desc).ddpfPixelFormat.dwFlags & DDPF_ZBUFFER, - "Got unexpected format flags %#x.\n", U4(surface_desc).ddpfPixelFormat.dwFlags); + "Got unexpected format flags %#lx.\n", U4(surface_desc).ddpfPixelFormat.dwFlags); ok(U1(U4(surface_desc).ddpfPixelFormat).dwZBufferBitDepth == 32, - "Got unexpected dwZBufferBitDepth %u.\n", U1(U4(surface_desc).ddpfPixelFormat).dwZBufferBitDepth); + "Got unexpected dwZBufferBitDepth %lu.\n", U1(U4(surface_desc).ddpfPixelFormat).dwZBufferBitDepth); ok(U3(U4(surface_desc).ddpfPixelFormat).dwZBitMask == 0xffffffff, - "Got unexpected Z mask 0x%08x.\n", U3(U4(surface_desc).ddpfPixelFormat).dwZBitMask); + "Got unexpected Z mask 0x%08lx.\n", U3(U4(surface_desc).ddpfPixelFormat).dwZBitMask); 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); IDirectDrawSurface7_Release(surface);
refcount = IDirectDraw7_Release(ddraw); - ok(!refcount, "%u references left.\n", refcount); + ok(!refcount, "%lu references left.\n", refcount); DestroyWindow(window); }
@@ -18055,11 +18024,11 @@ static void test_surface_format_conversion_alpha(void) ddraw = create_ddraw(); ok(!!ddraw, "Failed to create a ddraw object.\n"); hr = IDirectDraw7_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);
hr = IDirect3DDevice7_EnumTextureFormats(device, test_block_formats_creation_cb, &supported_fmts); - ok(hr == DD_OK, "Got unexpected hr %#x.\n", hr); + ok(hr == DD_OK, "Got unexpected hr %#lx.\n", hr);
is_wine = !strcmp(winetest_platform, "wine");
@@ -18097,17 +18066,17 @@ static void test_surface_format_conversion_alpha(void) U4(surface_desc).ddpfPixelFormat = src_format->fmt; surface_desc.ddsCaps.dwCaps = test_caps[j].src_caps; hr = IDirectDraw7_CreateSurface(ddraw, &surface_desc, &src_surf, NULL); - ok(hr == DD_OK, "Test (%u, %u), got unexpected hr %#x.\n", j, i, hr); + ok(hr == DD_OK, "Test (%u, %u), got unexpected hr %#lx.\n", j, i, hr);
U4(surface_desc).ddpfPixelFormat = dst_format->fmt; surface_desc.ddsCaps.dwCaps = test_caps[j].dst_caps; hr = IDirectDraw7_CreateSurface(ddraw, &surface_desc, &dst_surf, NULL); - ok(hr == DD_OK, "Test (%u, %u), got unexpected hr %#x.\n", j, i, hr); + ok(hr == DD_OK, "Test (%u, %u), got unexpected hr %#lx.\n", j, i, hr);
memset(&lock, 0, sizeof(lock)); lock.dwSize = sizeof(lock); hr = IDirectDrawSurface7_Lock(src_surf, NULL, &lock, 0, NULL); - ok(hr == DD_OK, "Got unexpected hr %#x.\n", hr); + ok(hr == DD_OK, "Got unexpected hr %#lx.\n", hr); pitch = U1(lock).lPitch; for (y = 0; y < src_format->y_blocks; ++y) { @@ -18116,7 +18085,7 @@ static void test_surface_format_conversion_alpha(void) src_format->block_size * src_format->x_blocks); } hr = IDirectDrawSurface7_Unlock(src_surf, NULL); - ok(hr == DD_OK, "Got unexpected hr %#x.\n", hr); + ok(hr == DD_OK, "Got unexpected hr %#lx.\n", hr);
hr = IDirectDrawSurface7_Blt(dst_surf, NULL, src_surf, NULL, DDBLT_WAIT, NULL); if (!is_wine && FAILED(hr)) @@ -18124,17 +18093,17 @@ static void test_surface_format_conversion_alpha(void) /* Some software blits are rejected on Windows. */ IDirectDrawSurface7_Release(dst_surf); IDirectDrawSurface7_Release(src_surf); - skip("Skipping test (%u, %u), cannot blit %s -> %s, hr %#x.\n", j, i, + skip("Skipping test (%u, %u), cannot blit %s -> %s, hr %#lx.\n", j, i, src_format->name, dst_format->name, hr); continue; } - ok(hr == DD_OK, "Test (%u, %s -> %s), got unexpected hr %#x.\n", j, + ok(hr == DD_OK, "Test (%u, %s -> %s), got unexpected hr %#lx.\n", j, src_format->name, dst_format->name, hr);
memset(&lock, 0, sizeof(lock)); lock.dwSize = sizeof(lock); hr = IDirectDrawSurface7_Lock(dst_surf, NULL, &lock, 0, NULL); - ok(hr == DD_OK, "Got unexpected hr %#x.\n", hr); + ok(hr == DD_OK, "Got unexpected hr %#lx.\n", hr); pitch = U1(lock).lPitch;
for (y = 0; y < dst_format->y_blocks; ++y) @@ -18162,7 +18131,7 @@ static void test_surface_format_conversion_alpha(void) break; } hr = IDirectDrawSurface7_Unlock(dst_surf, NULL); - ok(hr == DD_OK, "Got unexpected hr %#x.\n", hr); + ok(hr == DD_OK, "Got unexpected hr %#lx.\n", hr);
IDirectDrawSurface7_Release(dst_surf); IDirectDrawSurface7_Release(src_surf); @@ -18171,7 +18140,7 @@ static void test_surface_format_conversion_alpha(void)
IDirect3DDevice7_Release(device); refcount = IDirectDraw7_Release(ddraw); - ok(!refcount, "%u references left.\n", refcount); + ok(!refcount, "%lu references left.\n", refcount); DestroyWindow(window); }
@@ -18265,11 +18234,11 @@ static void test_compressed_surface_stretch(void) ddraw = create_ddraw(); ok(!!ddraw, "Failed to create a ddraw object.\n"); hr = IDirectDraw7_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);
hr = IDirect3DDevice7_EnumTextureFormats(device, test_block_formats_creation_cb, &supported_fmts); - ok(hr == DD_OK, "Got unexpected hr %#x.\n", hr); + ok(hr == DD_OK, "Got unexpected hr %#lx.\n", hr);
memset(&src_surface_desc, 0, sizeof(src_surface_desc)); src_surface_desc.dwSize = sizeof(src_surface_desc); @@ -18316,22 +18285,22 @@ static void test_compressed_surface_stretch(void) rb_surface_desc.dwHeight = max(src_surface_desc.dwHeight, dst_surface_desc.dwHeight);
hr = IDirectDraw7_CreateSurface(ddraw, &rb_surface_desc, &rb_surf, NULL); - ok(hr == DD_OK, "Test (%u, %u), got unexpected hr %#x.\n", i, j, hr); + ok(hr == DD_OK, "Test (%u, %u), got unexpected hr %#lx.\n", i, j, hr);
for (k = 0; k < ARRAY_SIZE(test_formats); ++k) { U4(src_surface_desc).ddpfPixelFormat = test_formats[k].fmt; hr = IDirectDraw7_CreateSurface(ddraw, &src_surface_desc, &src_surf, NULL); - ok(hr == DD_OK, "Test (%u, %u, %u), got unexpected hr %#x.\n", i, j, k, hr); + ok(hr == DD_OK, "Test (%u, %u, %u), got unexpected hr %#lx.\n", i, j, k, hr);
U5(fx).dwFillColor = 0x801f; hr = IDirectDrawSurface7_Blt(rb_surf, NULL, NULL, NULL, DDBLT_COLORFILL | DDBLT_WAIT, &fx); - ok(hr == DD_OK, "Test (%u, %u, %u), got unexpected hr %#x.\n", i, j, k, hr); + ok(hr == DD_OK, "Test (%u, %u, %u), got unexpected hr %#lx.\n", i, j, k, hr);
hr = IDirectDrawSurface7_Blt(src_surf, &src_rect, rb_surf, &src_rect, DDBLT_WAIT, NULL);
todo_wine_if(test_formats[k].fmt.dwFlags == DDPF_FOURCC && test_sizes[j].todo_src) - ok(hr == DD_OK, "Test (%u, %u, %u), got unexpected hr %#x.\n", i, j, k, hr); + ok(hr == DD_OK, "Test (%u, %u, %u), got unexpected hr %#lx.\n", i, j, k, hr); if (FAILED(hr)) { IDirectDrawSurface7_Release(src_surf); @@ -18349,7 +18318,7 @@ static void test_compressed_surface_stretch(void) U4(dst_surface_desc).ddpfPixelFormat = test_formats[l].fmt;
hr = IDirectDraw7_CreateSurface(ddraw, &dst_surface_desc, &dst_surf, NULL); - ok(hr == DD_OK, "Test (%u, %u, %u, %u), got unexpected hr %#x.\n", i, j, k, l, hr); + ok(hr == DD_OK, "Test (%u, %u, %u, %u), got unexpected hr %#lx.\n", i, j, k, l, hr);
memset(&lock, 0, sizeof(lock)); lock.dwSize = sizeof(lock); @@ -18362,15 +18331,15 @@ static void test_compressed_surface_stretch(void) if (test_formats[l].fmt.dwFourCC == MAKEFOURCC('D', 'X', 'T', '3')) { hr = IDirectDrawSurface7_Lock(dst_surf, NULL, &lock, 0, NULL); - ok(hr == DD_OK, "Got unexpected hr %#x.\n", hr); + ok(hr == DD_OK, "Got unexpected hr %#lx.\n", hr); memset(lock.lpSurface, 0, U1(lock).dwLinearSize); hr = IDirectDrawSurface7_Unlock(dst_surf, NULL); - ok(hr == DD_OK, "Got unexpected hr %#x.\n", hr); + ok(hr == DD_OK, "Got unexpected hr %#lx.\n", hr); }
hr = IDirectDrawSurface7_Blt(dst_surf, &dst_rect, src_surf, &src_rect, DDBLT_WAIT, NULL); todo_wine_if(test_formats[l].fmt.dwFlags == DDPF_FOURCC && test_sizes[j].todo_dst) - ok(hr == DD_OK, "Test (%u, %u, %u, %u), got unexpected hr %#x.\n", i, j, k, l, hr); + ok(hr == DD_OK, "Test (%u, %u, %u, %u), got unexpected hr %#lx.\n", i, j, k, l, hr); if (FAILED(hr)) { IDirectDrawSurface7_Release(dst_surf); @@ -18379,12 +18348,12 @@ static void test_compressed_surface_stretch(void)
U5(fx).dwFillColor = 0xffffffff; hr = IDirectDrawSurface7_Blt(rb_surf, NULL, NULL, NULL, DDBLT_COLORFILL | DDBLT_WAIT, &fx); - ok(hr == DD_OK, "Test (%u, %u, %u, %u), got unexpected hr %#x.\n", i, j, k, l, hr); + ok(hr == DD_OK, "Test (%u, %u, %u, %u), got unexpected hr %#lx.\n", i, j, k, l, hr);
hr = IDirectDrawSurface7_Blt(rb_surf, &dst_rect, dst_surf, &dst_rect, DDBLT_WAIT, NULL); - ok(hr == DD_OK, "Test (%u, %u, %u, %u), got unexpected hr %#x.\n", i, j, k, l, hr); + ok(hr == DD_OK, "Test (%u, %u, %u, %u), got unexpected hr %#lx.\n", i, j, k, l, hr); hr = IDirectDrawSurface7_Lock(rb_surf, NULL, &lock, 0, NULL); - ok(hr == DD_OK, "Got unexpected hr %#x.\n", hr); + ok(hr == DD_OK, "Got unexpected hr %#lx.\n", hr); pitch = U1(lock).lPitch;
passed = TRUE; @@ -18410,7 +18379,7 @@ static void test_compressed_surface_stretch(void)
IDirect3DDevice7_Release(device); refcount = IDirectDraw7_Release(ddraw); - ok(!refcount, "%u references left.\n", refcount); + ok(!refcount, "%lu references left.\n", refcount); DestroyWindow(window); }
@@ -18472,13 +18441,13 @@ static void test_cursor_clipping(void) memset(&surface_desc, 0, sizeof(surface_desc)); surface_desc.dwSize = sizeof(surface_desc); hr = IDirectDraw7_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 = IDirectDraw7_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); @@ -18486,87 +18455,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 = IDirectDraw7_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 = IDirectDraw7_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 = IDirectDraw7_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 = IDirectDraw7_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 = IDirectDraw7_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));
@@ -18593,10 +18562,10 @@ static BOOL CALLBACK test_window_position_cb(HMONITOR monitor, HDC hdc, RECT *mo flush_events();
hr = IDirectDraw7_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)); @@ -18607,9 +18576,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)); @@ -18617,7 +18586,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, @@ -18626,15 +18595,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)); @@ -18642,25 +18611,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 = IDirectDraw7_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));
@@ -18691,14 +18660,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 = IDirectDraw7_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); @@ -18725,41 +18694,39 @@ static void test_get_display_mode(void) ok(!!window, "Failed to create a window.\n");
hr = IDirectDraw7_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 = IDirectDraw7_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 = IDirectDraw7_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"); @@ -18768,17 +18735,17 @@ static void test_get_display_mode(void)
hr = IDirectDraw7_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 = IDirectDraw7_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: @@ -18809,8 +18776,8 @@ static void test_texture_wrong_caps(const GUID *device_guid) IDirect3DDevice7 *device; IDirectDraw7 *ddraw; DDSURFACEDESC2 ddsd; + unsigned int color; IDirect3D7 *d3d; - D3DCOLOR color; ULONG refcount; HWND window; HRESULT hr; @@ -18823,11 +18790,11 @@ static void test_texture_wrong_caps(const GUID *device_guid) return; } hr = IDirect3DDevice3_GetDirect3D(device, &d3d); - ok(hr == D3D_OK, "Got unexpected hr %#x.\n", hr); + ok(hr == D3D_OK, "Got unexpected hr %#lx.\n", hr); hr = IDirect3D3_QueryInterface(d3d, &IID_IDirectDraw4, (void **)&ddraw); - ok(hr == D3D_OK, "Got unexpected hr %#x.\n", hr); + ok(hr == D3D_OK, "Got unexpected hr %#lx.\n", hr); hr = IDirect3DDevice3_GetRenderTarget(device, &rt); - 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); @@ -18837,37 +18804,37 @@ static void test_texture_wrong_caps(const GUID *device_guid) ddsd.ddsCaps.dwCaps = DDSCAPS_OFFSCREENPLAIN; U4(ddsd).ddpfPixelFormat = fmt; hr = IDirectDraw7_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);
fill_surface(surface, 0xff00ff00);
hr = IDirect3DDevice7_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 = IDirect3DDevice7_SetTextureStageState(device, 0, D3DTSS_COLOROP, D3DTOP_SELECTARG1); - ok(hr == D3D_OK, "Got unexpected hr %#x.\n", hr); + ok(hr == D3D_OK, "Got unexpected hr %#lx.\n", hr); hr = IDirect3DDevice7_SetTextureStageState(device, 0, D3DTSS_ALPHAOP, D3DTOP_SELECTARG1); - ok(hr == D3D_OK, "Got unexpected hr %#x.\n", hr); + ok(hr == D3D_OK, "Got unexpected hr %#lx.\n", hr); hr = IDirect3DDevice7_SetTextureStageState(device, 0, D3DTSS_COLORARG1, D3DTA_TEXTURE); - ok(hr == D3D_OK, "Got unexpected hr %#x.\n", hr); + ok(hr == D3D_OK, "Got unexpected hr %#lx.\n", hr); hr = IDirect3DDevice7_SetTextureStageState(device, 0, D3DTSS_ALPHAARG1, D3DTA_TEXTURE); - ok(hr == D3D_OK, "Got unexpected hr %#x.\n", hr); + ok(hr == D3D_OK, "Got unexpected hr %#lx.\n", hr);
hr = IDirect3DDevice7_SetTexture(device, 0, surface); - ok(hr == D3D_OK, "Got unexpected hr %#x.\n", hr); + ok(hr == D3D_OK, "Got unexpected hr %#lx.\n", hr);
hr = IDirect3DDevice7_Clear(device, 0, NULL, D3DCLEAR_TARGET, 0x000000ff, 0.0f, 0); - ok(hr == DD_OK, "Got unexpected hr %#x.\n", hr); + ok(hr == DD_OK, "Got unexpected hr %#lx.\n", hr); if (is_software_device_type(device_guid)) fill_surface(rt, 0x000000ff);
hr = IDirect3DDevice7_BeginScene(device); - ok(hr == D3D_OK, "Got unexpected hr %#x.\n", hr); + ok(hr == D3D_OK, "Got unexpected hr %#lx.\n", hr); hr = IDirect3DDevice7_DrawPrimitive(device, D3DPT_TRIANGLESTRIP, D3DFVF_XYZ | D3DFVF_TEX1, quad, 4, 0); - ok(hr == D3D_OK, "Got unexpected hr %#x.\n", hr); + ok(hr == D3D_OK, "Got unexpected hr %#lx.\n", hr); hr = IDirect3DDevice7_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 == 0, "Got unexpected color 0x%08x.\n", color); @@ -18877,7 +18844,7 @@ static void test_texture_wrong_caps(const GUID *device_guid) IDirectDraw7_Release(ddraw); IDirect3D7_Release(d3d); refcount = IDirect3DDevice3_Release(device); - ok(!refcount, "Device has %u references left.\n", refcount); + ok(!refcount, "Device has %lu references left.\n", refcount); DestroyWindow(window); }
@@ -18889,9 +18856,8 @@ static void test_filling_convention(void) static const DWORD colour_left = 0x00ff0000; static const DWORD colour_top = 0x0000ff00; IDirectDrawSurface7 *rt, *backbuffer, *cur; + unsigned int colour, expected, i, j, x, y; IDirect3DDevice7 *device; - unsigned int i, j, x, y; - DWORD colour, expected; IDirectDraw7 *ddraw; DDSURFACEDESC2 desc; IDirect3D7 *d3d; @@ -19227,11 +19193,11 @@ static void test_filling_convention(void) }
hr = IDirect3DDevice7_GetDirect3D(device, &d3d); - ok(hr == DD_OK, "Got unexpected hr %#x.\n", hr); + ok(hr == DD_OK, "Got unexpected hr %#lx.\n", hr); hr = IDirect3D7_QueryInterface(d3d, &IID_IDirectDraw7, (void **)&ddraw); - ok(hr == DD_OK, "Got unexpected hr %#x.\n", hr); + ok(hr == DD_OK, "Got unexpected hr %#lx.\n", hr); hr = IDirect3DDevice7_GetRenderTarget(device, &backbuffer); - ok(hr == DD_OK, "Got unexpected hr %#x.\n", hr); + ok(hr == DD_OK, "Got unexpected hr %#lx.\n", hr);
memset(&desc, 0, sizeof(desc)); desc.dwSize = sizeof(desc); @@ -19246,12 +19212,12 @@ static void test_filling_convention(void) desc.ddpfPixelFormat.dwGBitMask = 0x0000ff00; desc.ddpfPixelFormat.dwBBitMask = 0x000000ff; hr = IDirectDraw7_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);
hr = IDirect3DDevice7_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 = IDirect3DDevice7_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) { @@ -19260,19 +19226,19 @@ static void test_filling_convention(void) cur = j ? rt : backbuffer;
hr = IDirect3DDevice7_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 = IDirect3DDevice7_Clear(device, 0, NULL, D3DCLEAR_TARGET, colour_clear, 0.0f, 0); - ok(hr == D3D_OK, "Got unexpected hr %#x.\n", hr); + ok(hr == D3D_OK, "Got unexpected hr %#lx.\n", hr); hr = IDirect3DDevice7_SetViewport(device, &vp); - ok(hr == D3D_OK, "Got unexpected hr %#x.\n", hr); + ok(hr == D3D_OK, "Got unexpected hr %#lx.\n", hr);
hr = IDirect3DDevice7_BeginScene(device); - ok(hr == D3D_OK, "Got unexpected hr %#x.\n", hr); + ok(hr == D3D_OK, "Got unexpected hr %#lx.\n", hr); hr = IDirect3DDevice7_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 = IDirect3DDevice7_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++) { @@ -19322,7 +19288,7 @@ static void test_filling_convention(void) IDirectDraw7_Release(ddraw); IDirect3D7_Release(d3d); refcount = IDirect3DDevice7_Release(device); - ok(!refcount, "Device has %u references left.\n", refcount); + ok(!refcount, "Device has %lu references left.\n", refcount); DestroyWindow(window); }
@@ -19367,7 +19333,7 @@ START_TEST(ddraw7) if (IDirectDraw7_QueryInterface(ddraw, &IID_IDirect3D7, (void **)&d3d) == DD_OK) { hr = IDirect3D7_EnumDevices(d3d, enum_devtype_cb, &hal_ok); - ok(hr == DD_OK, "Got unexpected hr %#x.\n", hr); + ok(hr == DD_OK, "Got unexpected hr %#lx.\n", hr); if (hal_ok) hw_device_guid = &IID_IDirect3DTnLHalDevice; IDirectDraw7_Release(d3d);