From: Zebediah Figura zfigura@codeweavers.com
--- dlls/ddraw/tests/dsurface.c | 779 +++++++++++++++++------------------- 1 file changed, 377 insertions(+), 402 deletions(-)
diff --git a/dlls/ddraw/tests/dsurface.c b/dlls/ddraw/tests/dsurface.c index 2c722fa03c4..50ff802f87f 100644 --- a/dlls/ddraw/tests/dsurface.c +++ b/dlls/ddraw/tests/dsurface.c @@ -22,7 +22,6 @@ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA */
-#define WINE_NO_LONG_TYPES #define COBJMACROS
#include "wine/test.h" @@ -40,14 +39,14 @@ static BOOL CreateDirectDraw(void) HRESULT rc;
rc = DirectDrawCreate(NULL, &lpDD, NULL); - ok(rc==DD_OK || rc==DDERR_NODIRECTDRAWSUPPORT, "DirectDrawCreateEx returned: %x\n", rc); + ok(rc == DD_OK || rc == DDERR_NODIRECTDRAWSUPPORT, "Got hr %#lx.\n", rc); if (!lpDD) { - trace("DirectDrawCreateEx() failed with an error %x\n", rc); + trace("DirectDrawCreateEx() failed with an error %#lx\n", rc); return FALSE; }
rc = IDirectDraw_SetCooperativeLevel(lpDD, NULL, DDSCL_NORMAL); - ok(rc==DD_OK,"SetCooperativeLevel returned: %x\n",rc); + ok(rc == DD_OK, "Got hr %#lx.\n", rc);
return TRUE; } @@ -94,41 +93,41 @@ static void GetDDInterface_1(void) ret = IDirectDraw_CreateSurface(lpDD, &surface, &dsurface, NULL); if(ret != DD_OK) { - ok(FALSE, "IDirectDraw::CreateSurface failed with error %x\n", ret); + ok(FALSE, "Got hr %#lx.\n", ret); return; } ret = IDirectDrawSurface_QueryInterface(dsurface, &IID_IDirectDrawSurface2, (void **) &dsurface2); - ok(ret == DD_OK, "IDirectDrawSurface_QueryInterface returned %08x\n", ret); + ok(ret == DD_OK, "Got hr %#lx.\n", ret); ret = IDirectDraw_QueryInterface(lpDD, &IID_IDirectDraw2, (void **) &dd2); - ok(ret == DD_OK, "IDirectDraw_QueryInterface returned %08x\n", ret); + ok(ret == DD_OK, "Got hr %#lx.\n", ret); ret = IDirectDraw_QueryInterface(lpDD, &IID_IDirectDraw4, (void **) &dd4); - ok(ret == DD_OK, "IDirectDraw_QueryInterface returned %08x\n", ret); + ok(ret == DD_OK, "Got hr %#lx.\n", ret); ret = IDirectDraw_QueryInterface(lpDD, &IID_IDirectDraw7, (void **) &dd7); - ok(ret == DD_OK, "IDirectDraw_QueryInterface returned %08x\n", ret); + ok(ret == DD_OK, "Got hr %#lx.\n", ret);
ref1 = getref((IUnknown *) lpDD); - ok(ref1 == 1, "IDirectDraw refcount is %d\n", ref1); + ok(ref1 == 1, "IDirectDraw refcount is %ld\n", ref1); ref2 = getref((IUnknown *) dd2); - ok(ref2 == 1, "IDirectDraw2 refcount is %d\n", ref2); + ok(ref2 == 1, "IDirectDraw2 refcount is %ld\n", ref2); ref4 = getref((IUnknown *) dd4); - ok(ref4 == 1, "IDirectDraw4 refcount is %d\n", ref4); + ok(ref4 == 1, "IDirectDraw4 refcount is %ld\n", ref4); ref7 = getref((IUnknown *) dd7); - ok(ref7 == 1, "IDirectDraw7 refcount is %d\n", ref7); + ok(ref7 == 1, "IDirectDraw7 refcount is %ld\n", ref7);
ret = IDirectDrawSurface2_GetDDInterface(dsurface2, &dd); - ok(ret == DD_OK, "IDirectDrawSurface7_GetDDInterface returned %08x\n", ret); - ok(getref((IUnknown *) lpDD) == ref1 + 1, "IDirectDraw refcount was increased by %d\n", getref((IUnknown *) lpDD) - ref1); - ok(getref((IUnknown *) dd2) == ref2 + 0, "IDirectDraw2 refcount was increased by %d\n", getref((IUnknown *) dd2) - ref2); - ok(getref((IUnknown *) dd4) == ref4 + 0, "IDirectDraw4 refcount was increased by %d\n", getref((IUnknown *) dd4) - ref4); - ok(getref((IUnknown *) dd7) == ref7 + 0, "IDirectDraw7 refcount was increased by %d\n", getref((IUnknown *) dd7) - ref7); + ok(ret == DD_OK, "Got hr %#lx.\n", ret); + ok(getref((IUnknown *) lpDD) == ref1 + 1, "IDirectDraw refcount was increased by %ld\n", getref((IUnknown *) lpDD) - ref1); + ok(getref((IUnknown *) dd2) == ref2 + 0, "IDirectDraw2 refcount was increased by %ld\n", getref((IUnknown *) dd2) - ref2); + ok(getref((IUnknown *) dd4) == ref4 + 0, "IDirectDraw4 refcount was increased by %ld\n", getref((IUnknown *) dd4) - ref4); + ok(getref((IUnknown *) dd7) == ref7 + 0, "IDirectDraw7 refcount was increased by %ld\n", getref((IUnknown *) dd7) - ref7);
ok(dd == lpDD, "Returned interface pointer is not equal to the creation interface\n"); IUnknown_Release((IUnknown *) dd);
/* try a NULL pointer */ ret = IDirectDrawSurface2_GetDDInterface(dsurface2, NULL); - ok(ret == DDERR_INVALIDPARAMS, "IDirectDrawSurface7_GetDDInterface returned %08x\n", ret); + ok(ret == DDERR_INVALIDPARAMS, "Got hr %#lx.\n", ret);
IDirectDraw2_Release(dd2); IDirectDraw4_Release(dd4); @@ -150,11 +149,11 @@ static void GetDDInterface_2(void) void *dd;
ret = IDirectDraw_QueryInterface(lpDD, &IID_IDirectDraw2, (void **) &dd2); - ok(ret == DD_OK, "IDirectDraw_QueryInterface returned %08x\n", ret); + ok(ret == DD_OK, "Got hr %#lx.\n", ret); ret = IDirectDraw_QueryInterface(lpDD, &IID_IDirectDraw4, (void **) &dd4); - ok(ret == DD_OK, "IDirectDraw_QueryInterface returned %08x\n", ret); + ok(ret == DD_OK, "Got hr %#lx.\n", ret); ret = IDirectDraw_QueryInterface(lpDD, &IID_IDirectDraw7, (void **) &dd7); - ok(ret == DD_OK, "IDirectDraw_QueryInterface returned %08x\n", ret); + ok(ret == DD_OK, "Got hr %#lx.\n", ret);
/* Create a surface */ ZeroMemory(&surface, sizeof(surface)); @@ -165,31 +164,31 @@ static void GetDDInterface_2(void) ret = IDirectDraw2_CreateSurface(dd2, &surface, &dsurface, NULL); if(ret != DD_OK) { - ok(FALSE, "IDirectDraw::CreateSurface failed with error %x\n", ret); + ok(FALSE, "Got hr %#lx.\n", ret); IDirectDraw2_Release(dd2); IDirectDraw4_Release(dd4); IDirectDraw7_Release(dd7); return; } ret = IDirectDrawSurface_QueryInterface(dsurface, &IID_IDirectDrawSurface2, (void **) &dsurface2); - ok(ret == DD_OK, "IDirectDrawSurface_QueryInterface returned %08x\n", ret); + ok(ret == DD_OK, "Got hr %#lx.\n", ret);
ref1 = getref((IUnknown *) lpDD); - ok(ref1 == 1, "IDirectDraw refcount is %d\n", ref1); + ok(ref1 == 1, "IDirectDraw refcount is %ld\n", ref1); ref2 = getref((IUnknown *) dd2); - ok(ref2 == 1, "IDirectDraw2 refcount is %d\n", ref2); + ok(ref2 == 1, "IDirectDraw2 refcount is %ld\n", ref2); ref4 = getref((IUnknown *) dd4); - ok(ref4 == 1, "IDirectDraw4 refcount is %d\n", ref4); + ok(ref4 == 1, "IDirectDraw4 refcount is %ld\n", ref4); ref7 = getref((IUnknown *) dd7); - ok(ref7 == 1, "IDirectDraw7 refcount is %d\n", ref7); + ok(ref7 == 1, "IDirectDraw7 refcount is %ld\n", ref7);
ret = IDirectDrawSurface2_GetDDInterface(dsurface2, &dd); - ok(ret == DD_OK, "IDirectDrawSurface7_GetDDInterface returned %08x\n", ret); - ok(getref((IUnknown *) lpDD) == ref1 + 0, "IDirectDraw refcount was increased by %d\n", getref((IUnknown *) lpDD) - ref1); - ok(getref((IUnknown *) dd2) == ref2 + 1, "IDirectDraw2 refcount was increased by %d\n", getref((IUnknown *) dd2) - ref2); - ok(getref((IUnknown *) dd4) == ref4 + 0, "IDirectDraw4 refcount was increased by %d\n", getref((IUnknown *) dd4) - ref4); - ok(getref((IUnknown *) dd7) == ref7 + 0, "IDirectDraw7 refcount was increased by %d\n", getref((IUnknown *) dd7) - ref7); + ok(ret == DD_OK, "Got hr %#lx.\n", ret); + ok(getref((IUnknown *) lpDD) == ref1 + 0, "IDirectDraw refcount was increased by %ld\n", getref((IUnknown *) lpDD) - ref1); + ok(getref((IUnknown *) dd2) == ref2 + 1, "IDirectDraw2 refcount was increased by %ld\n", getref((IUnknown *) dd2) - ref2); + ok(getref((IUnknown *) dd4) == ref4 + 0, "IDirectDraw4 refcount was increased by %ld\n", getref((IUnknown *) dd4) - ref4); + ok(getref((IUnknown *) dd7) == ref7 + 0, "IDirectDraw7 refcount was increased by %ld\n", getref((IUnknown *) dd7) - ref7);
ok(dd == dd2, "Returned interface pointer is not equal to the creation interface\n"); IUnknown_Release((IUnknown *) dd); @@ -214,11 +213,11 @@ static void GetDDInterface_4(void) void *dd;
ret = IDirectDraw_QueryInterface(lpDD, &IID_IDirectDraw2, (void **) &dd2); - ok(ret == DD_OK, "IDirectDraw_QueryInterface returned %08x\n", ret); + ok(ret == DD_OK, "Got hr %#lx.\n", ret); ret = IDirectDraw_QueryInterface(lpDD, &IID_IDirectDraw4, (void **) &dd4); - ok(ret == DD_OK, "IDirectDraw_QueryInterface returned %08x\n", ret); + ok(ret == DD_OK, "Got hr %#lx.\n", ret); ret = IDirectDraw_QueryInterface(lpDD, &IID_IDirectDraw7, (void **) &dd7); - ok(ret == DD_OK, "IDirectDraw_QueryInterface returned %08x\n", ret); + ok(ret == DD_OK, "Got hr %#lx.\n", ret);
/* Create a surface */ ZeroMemory(&surface, sizeof(surface)); @@ -229,41 +228,41 @@ static void GetDDInterface_4(void) ret = IDirectDraw4_CreateSurface(dd4, &surface, &dsurface4, NULL); if(ret != DD_OK) { - ok(FALSE, "IDirectDraw::CreateSurface failed with error %x\n", ret); + ok(FALSE, "Got hr %#lx.\n", ret); IDirectDraw2_Release(dd2); IDirectDraw4_Release(dd4); IDirectDraw7_Release(dd7); return; } ret = IDirectDrawSurface4_QueryInterface(dsurface4, &IID_IDirectDrawSurface2, (void **) &dsurface2); - ok(ret == DD_OK, "IDirectDrawSurface_QueryInterface returned %08x\n", ret); + ok(ret == DD_OK, "Got hr %#lx.\n", ret);
ref1 = getref((IUnknown *) lpDD); - ok(ref1 == 1, "IDirectDraw refcount is %d\n", ref1); + ok(ref1 == 1, "IDirectDraw refcount is %ld\n", ref1); ref2 = getref((IUnknown *) dd2); - ok(ref2 == 1, "IDirectDraw2 refcount is %d\n", ref2); + ok(ref2 == 1, "IDirectDraw2 refcount is %ld\n", ref2); ref4 = getref((IUnknown *) dd4); - ok(ref4 == 2, "IDirectDraw4 refcount is %d\n", ref4); + ok(ref4 == 2, "IDirectDraw4 refcount is %ld\n", ref4); ref7 = getref((IUnknown *) dd7); - ok(ref7 == 1, "IDirectDraw7 refcount is %d\n", ref7); + ok(ref7 == 1, "IDirectDraw7 refcount is %ld\n", ref7);
ret = IDirectDrawSurface4_GetDDInterface(dsurface4, &dd); - ok(ret == DD_OK, "IDirectDrawSurface7_GetDDInterface returned %08x\n", ret); - ok(getref((IUnknown *) lpDD) == ref1 + 0, "IDirectDraw refcount was increased by %d\n", getref((IUnknown *) lpDD) - ref1); - ok(getref((IUnknown *) dd2) == ref2 + 0, "IDirectDraw2 refcount was increased by %d\n", getref((IUnknown *) dd2) - ref2); - ok(getref((IUnknown *) dd4) == ref4 + 1, "IDirectDraw4 refcount was increased by %d\n", getref((IUnknown *) dd4) - ref4); - ok(getref((IUnknown *) dd7) == ref7 + 0, "IDirectDraw7 refcount was increased by %d\n", getref((IUnknown *) dd7) - ref7); + ok(ret == DD_OK, "Got hr %#lx.\n", ret); + ok(getref((IUnknown *) lpDD) == ref1 + 0, "IDirectDraw refcount was increased by %ld\n", getref((IUnknown *) lpDD) - ref1); + ok(getref((IUnknown *) dd2) == ref2 + 0, "IDirectDraw2 refcount was increased by %ld\n", getref((IUnknown *) dd2) - ref2); + ok(getref((IUnknown *) dd4) == ref4 + 1, "IDirectDraw4 refcount was increased by %ld\n", getref((IUnknown *) dd4) - ref4); + ok(getref((IUnknown *) dd7) == ref7 + 0, "IDirectDraw7 refcount was increased by %ld\n", getref((IUnknown *) dd7) - ref7);
ok(dd == dd4, "Returned interface pointer is not equal to the creation interface\n"); IUnknown_Release((IUnknown *) dd);
/* Now test what happens if we QI the surface for some other version - It should still return the creation interface */ ret = IDirectDrawSurface2_GetDDInterface(dsurface2, &dd); - ok(ret == DD_OK, "IDirectDrawSurface7_GetDDInterface returned %08x\n", ret); - ok(getref((IUnknown *) lpDD) == ref1 + 0, "IDirectDraw refcount was increased by %d\n", getref((IUnknown *) lpDD) - ref1); - ok(getref((IUnknown *) dd2) == ref2 + 0, "IDirectDraw2 refcount was increased by %d\n", getref((IUnknown *) dd2) - ref2); - ok(getref((IUnknown *) dd4) == ref4 + 1, "IDirectDraw4 refcount was increased by %d\n", getref((IUnknown *) dd4) - ref4); - ok(getref((IUnknown *) dd7) == ref7 + 0, "IDirectDraw7 refcount was increased by %d\n", getref((IUnknown *) dd7) - ref7); + ok(ret == DD_OK, "Got hr %#lx.\n", ret); + ok(getref((IUnknown *) lpDD) == ref1 + 0, "IDirectDraw refcount was increased by %ld\n", getref((IUnknown *) lpDD) - ref1); + ok(getref((IUnknown *) dd2) == ref2 + 0, "IDirectDraw2 refcount was increased by %ld\n", getref((IUnknown *) dd2) - ref2); + ok(getref((IUnknown *) dd4) == ref4 + 1, "IDirectDraw4 refcount was increased by %ld\n", getref((IUnknown *) dd4) - ref4); + ok(getref((IUnknown *) dd7) == ref7 + 0, "IDirectDraw7 refcount was increased by %ld\n", getref((IUnknown *) dd7) - ref7);
ok(dd == dd4, "Returned interface pointer is not equal to the creation interface\n"); IUnknown_Release((IUnknown *) dd); @@ -288,11 +287,11 @@ static void GetDDInterface_7(void) void *dd;
ret = IDirectDraw_QueryInterface(lpDD, &IID_IDirectDraw2, (void **) &dd2); - ok(ret == DD_OK, "IDirectDraw_QueryInterface returned %08x\n", ret); + ok(ret == DD_OK, "Got hr %#lx.\n", ret); ret = IDirectDraw_QueryInterface(lpDD, &IID_IDirectDraw4, (void **) &dd4); - ok(ret == DD_OK, "IDirectDraw_QueryInterface returned %08x\n", ret); + ok(ret == DD_OK, "Got hr %#lx.\n", ret); ret = IDirectDraw_QueryInterface(lpDD, &IID_IDirectDraw7, (void **) &dd7); - ok(ret == DD_OK, "IDirectDraw_QueryInterface returned %08x\n", ret); + ok(ret == DD_OK, "Got hr %#lx.\n", ret);
/* Create a surface */ ZeroMemory(&surface, sizeof(surface)); @@ -303,41 +302,41 @@ static void GetDDInterface_7(void) ret = IDirectDraw7_CreateSurface(dd7, &surface, &dsurface7, NULL); if(ret != DD_OK) { - ok(FALSE, "IDirectDraw::CreateSurface failed with error %x\n", ret); + ok(FALSE, "Got hr %#lx.\n", ret); IDirectDraw2_Release(dd2); IDirectDraw4_Release(dd4); IDirectDraw7_Release(dd7); return; } ret = IDirectDrawSurface7_QueryInterface(dsurface7, &IID_IDirectDrawSurface4, (void **) &dsurface4); - ok(ret == DD_OK, "IDirectDrawSurface_QueryInterface returned %08x\n", ret); + ok(ret == DD_OK, "Got hr %#lx.\n", ret);
ref1 = getref((IUnknown *) lpDD); - ok(ref1 == 1, "IDirectDraw refcount is %d\n", ref1); + ok(ref1 == 1, "IDirectDraw refcount is %ld\n", ref1); ref2 = getref((IUnknown *) dd2); - ok(ref2 == 1, "IDirectDraw2 refcount is %d\n", ref2); + ok(ref2 == 1, "IDirectDraw2 refcount is %ld\n", ref2); ref4 = getref((IUnknown *) dd4); - ok(ref4 == 1, "IDirectDraw4 refcount is %d\n", ref4); + ok(ref4 == 1, "IDirectDraw4 refcount is %ld\n", ref4); ref7 = getref((IUnknown *) dd7); - ok(ref7 == 2, "IDirectDraw7 refcount is %d\n", ref7); + ok(ref7 == 2, "IDirectDraw7 refcount is %ld\n", ref7);
ret = IDirectDrawSurface7_GetDDInterface(dsurface7, &dd); - ok(ret == DD_OK, "IDirectDrawSurface7_GetDDInterface returned %08x\n", ret); - ok(getref((IUnknown *) lpDD) == ref1 + 0, "IDirectDraw refcount was increased by %d\n", getref((IUnknown *) lpDD) - ref1); - ok(getref((IUnknown *) dd2) == ref2 + 0, "IDirectDraw2 refcount was increased by %d\n", getref((IUnknown *) dd2) - ref2); - ok(getref((IUnknown *) dd4) == ref4 + 0, "IDirectDraw4 refcount was increased by %d\n", getref((IUnknown *) dd4) - ref4); - ok(getref((IUnknown *) dd7) == ref7 + 1, "IDirectDraw7 refcount was increased by %d\n", getref((IUnknown *) dd7) - ref7); + ok(ret == DD_OK, "Got hr %#lx.\n", ret); + ok(getref((IUnknown *) lpDD) == ref1 + 0, "IDirectDraw refcount was increased by %ld\n", getref((IUnknown *) lpDD) - ref1); + ok(getref((IUnknown *) dd2) == ref2 + 0, "IDirectDraw2 refcount was increased by %ld\n", getref((IUnknown *) dd2) - ref2); + ok(getref((IUnknown *) dd4) == ref4 + 0, "IDirectDraw4 refcount was increased by %ld\n", getref((IUnknown *) dd4) - ref4); + ok(getref((IUnknown *) dd7) == ref7 + 1, "IDirectDraw7 refcount was increased by %ld\n", getref((IUnknown *) dd7) - ref7);
ok(dd == dd7, "Returned interface pointer is not equal to the creation interface\n"); IUnknown_Release((IUnknown *) dd);
/* Now test what happens if we QI the surface for some other version - It should still return the creation interface */ ret = IDirectDrawSurface4_GetDDInterface(dsurface4, &dd); - ok(ret == DD_OK, "IDirectDrawSurface7_GetDDInterface returned %08x\n", ret); - ok(getref((IUnknown *) lpDD) == ref1 + 0, "IDirectDraw refcount was increased by %d\n", getref((IUnknown *) lpDD) - ref1); - ok(getref((IUnknown *) dd2) == ref2 + 0, "IDirectDraw2 refcount was increased by %d\n", getref((IUnknown *) dd2) - ref2); - ok(getref((IUnknown *) dd4) == ref4 + 0, "IDirectDraw4 refcount was increased by %d\n", getref((IUnknown *) dd4) - ref4); - ok(getref((IUnknown *) dd7) == ref7 + 1, "IDirectDraw7 refcount was increased by %d\n", getref((IUnknown *) dd7) - ref7); + ok(ret == DD_OK, "Got hr %#lx.\n", ret); + ok(getref((IUnknown *) lpDD) == ref1 + 0, "IDirectDraw refcount was increased by %ld\n", getref((IUnknown *) lpDD) - ref1); + ok(getref((IUnknown *) dd2) == ref2 + 0, "IDirectDraw2 refcount was increased by %ld\n", getref((IUnknown *) dd2) - ref2); + ok(getref((IUnknown *) dd4) == ref4 + 0, "IDirectDraw4 refcount was increased by %ld\n", getref((IUnknown *) dd4) - ref4); + ok(getref((IUnknown *) dd7) == ref7 + 1, "IDirectDraw7 refcount was increased by %ld\n", getref((IUnknown *) dd7) - ref7);
ok(dd == dd7, "Returned interface pointer is not equal to the creation interface\n"); IUnknown_Release((IUnknown *) dd); @@ -391,9 +390,9 @@ static HRESULT WINAPI CubeTestPaletteEnum(IDirectDrawSurface7 *surface, DDSURFAC
hr = IDirectDrawSurface7_SetPalette(surface, context); if (desc->dwWidth == 64) /* This is for first mimpmap */ - ok(hr == DDERR_NOTONMIPMAPSUBLEVEL, "SetPalette returned: %x\n",hr); + ok(hr == DDERR_NOTONMIPMAPSUBLEVEL, "Got hr %#lx.\n", hr); else - ok(hr == DD_OK, "SetPalette returned: %x\n",hr); + ok(hr == DD_OK, "Got hr %#lx.\n", hr);
IDirectDrawSurface7_Release(surface);
@@ -461,10 +460,10 @@ static HRESULT WINAPI CubeTestLvl1Enum(IDirectDrawSurface7 *surface, DDSURFACEDE &mipmaps, CubeTestLvl2Enum);
- ok(desc->dwWidth == expected[*num].width, "Surface width is %d expected %d\n", desc->dwWidth, expected[*num].width); - ok(desc->dwHeight == expected[*num].height, "Surface height is %d expected %d\n", desc->dwHeight, expected[*num].height); - ok(desc->ddsCaps.dwCaps == expected[*num].caps, "Surface caps are %08x expected %08x\n", desc->ddsCaps.dwCaps, expected[*num].caps); - ok(desc->ddsCaps.dwCaps2 == expected[*num].caps2, "Surface caps2 are %08x expected %08x\n", desc->ddsCaps.dwCaps2, expected[*num].caps2); + ok(desc->dwWidth == expected[*num].width, "Surface width is %ld expected %ld\n", desc->dwWidth, expected[*num].width); + ok(desc->dwHeight == expected[*num].height, "Surface height is %ld expected %ld\n", desc->dwHeight, expected[*num].height); + ok(desc->ddsCaps.dwCaps == expected[*num].caps, "Surface caps are %#lx expected %#lx\n", desc->ddsCaps.dwCaps, expected[*num].caps); + ok(desc->ddsCaps.dwCaps2 == expected[*num].caps2, "Surface caps2 are %#lx expected %#lx\n", desc->ddsCaps.dwCaps2, expected[*num].caps2); ok(mipmaps == expected[*num].mipmaps, "Surface has %d mipmaps, expected %d\n", mipmaps, expected[*num].mipmaps);
(*num)++; @@ -496,7 +495,7 @@ static void CubeMapTest(void) }
hr = IDirectDraw_QueryInterface(lpDD, &IID_IDirectDraw7, (void **) &dd7); - ok(hr == DD_OK, "IDirectDraw::QueryInterface returned %08x\n", hr); + ok(hr == DD_OK, "Got hr %#lx.\n", hr); if (FAILED(hr)) goto err;
memset(&ddsd, 0, sizeof(ddsd)); @@ -523,11 +522,11 @@ static void CubeMapTest(void) }
hr = IDirectDrawSurface7_GetSurfaceDesc(cubemap, &ddsd); - ok(hr == DD_OK, "IDirectDrawSurface7_GetSurfaceDesc returned %08x\n", hr); + ok(hr == DD_OK, "Got hr %#lx.\n", hr); ok(ddsd.ddsCaps.dwCaps == (DDSCAPS_MIPMAP | DDSCAPS_TEXTURE | DDSCAPS_SYSTEMMEMORY | DDSCAPS_COMPLEX), - "Root Caps are %08x\n", ddsd.ddsCaps.dwCaps); + "Root Caps are %#lx\n", ddsd.ddsCaps.dwCaps); ok(ddsd.ddsCaps.dwCaps2 == (DDSCAPS2_CUBEMAP_POSITIVEX | DDSCAPS2_CUBEMAP), - "Root Caps2 are %08x\n", ddsd.ddsCaps.dwCaps2); + "Root Caps2 are %#lx\n", ddsd.ddsCaps.dwCaps2);
IDirectDrawSurface7_EnumAttachedSurfaces(cubemap, &num, @@ -553,7 +552,7 @@ static void CubeMapTest(void) U4(U4(ddsd).ddpfPixelFormat).dwBBitMask = 0x001F;
hr = IDirectDraw7_CreateSurface(dd7, &ddsd, &cubemap, NULL); - ok(hr == DDERR_INVALIDPARAMS, "IDirectDraw7::CreateSurface asking for a cube map without faces returned %08x\n", hr); + ok(hr == DDERR_INVALIDPARAMS, "Got hr %#lx.\n", hr);
/* Cube map faces without a cube map? */ memset(&ddsd, 0, sizeof(ddsd)); @@ -573,7 +572,7 @@ static void CubeMapTest(void) U4(U4(ddsd).ddpfPixelFormat).dwBBitMask = 0x001F;
hr = IDirectDraw7_CreateSurface(dd7, &ddsd, &cubemap, NULL); - ok(hr == DDERR_INVALIDCAPS, "IDirectDraw7::CreateSurface returned %08x\n", hr); + ok(hr == DDERR_INVALIDCAPS, "Got hr %#lx.\n", hr);
memset(&ddsd, 0, sizeof(ddsd)); ddsd.dwSize = sizeof(ddsd); @@ -592,7 +591,7 @@ static void CubeMapTest(void) U4(U4(ddsd).ddpfPixelFormat).dwBBitMask = 0x001F;
hr = IDirectDraw7_CreateSurface(dd7, &ddsd, &cubemap, NULL); - ok(hr == DDERR_INVALIDCAPS, "IDirectDraw7::CreateSurface returned %08x\n", hr); + ok(hr == DDERR_INVALIDCAPS, "Got hr %#lx.\n", hr);
memset(&ddsd, 0, sizeof(ddsd)); ddsd.dwSize = sizeof(ddsd); @@ -614,7 +613,7 @@ static void CubeMapTest(void) }
hr = IDirectDraw7_CreatePalette(dd7, DDPCAPS_ALLOW256 | DDPCAPS_8BIT, Table, &palette, NULL); - ok(hr == DD_OK, "CreatePalette failed with %08x\n", hr); + ok(hr == DD_OK, "Got hr %#lx.\n", hr);
hr = IDirectDrawSurface7_EnumAttachedSurfaces(cubemap, palette, CubeTestPaletteEnum); ok(hr == DD_OK, "EnumAttachedSurfaces failed\n"); @@ -634,7 +633,7 @@ static void CubeMapTest(void) memset(&ddsd, 0, sizeof(ddsd)); ddsd.dwSize = sizeof(DDSURFACEDESC); hr = IDirectDraw_EnumSurfaces(lpDD, DDENUMSURFACES_DOESEXIST | DDENUMSURFACES_ALL, (DDSURFACEDESC *) &ddsd, (void *) &ctx, enumCB); - ok(hr == DD_OK, "IDirectDraw_EnumSurfaces returned %08x\n", hr); + ok(hr == DD_OK, "Got hr %#lx.\n", hr); ok(ctx.count == 0, "%d surfaces enumerated, expected 0\n", ctx.count);
err: @@ -651,7 +650,7 @@ static void CompressedTest(void) RECT r2 = { 32, 32, 64, 64 };
hr = IDirectDraw_QueryInterface(lpDD, &IID_IDirectDraw7, (void **) &dd7); - ok(hr == DD_OK, "IDirectDraw::QueryInterface returned %08x\n", hr); + ok(hr == DD_OK, "Got hr %#lx.\n", hr);
memset(&ddsd, 0, sizeof(ddsd)); ddsd.dwSize = sizeof(ddsd); @@ -664,7 +663,7 @@ static void CompressedTest(void) U4(ddsd).ddpfPixelFormat.dwFourCC = MAKEFOURCC('D','X','T','1');
hr = IDirectDraw7_CreateSurface(dd7, &ddsd, &surface, NULL); - ok(hr == DD_OK, "CreateSurface returned %08x\n", hr); + ok(hr == DD_OK, "Got hr %#lx.\n", hr); if (FAILED(hr)) { skip("failed to create surface\n"); @@ -675,21 +674,21 @@ static void CompressedTest(void) ddsd2.dwSize = sizeof(ddsd2); U4(ddsd2).ddpfPixelFormat.dwSize = sizeof(U4(ddsd2).ddpfPixelFormat); hr = IDirectDrawSurface7_GetSurfaceDesc(surface, &ddsd2); - ok(hr == DD_OK, "GetSurfaceDesc returned %08x\n", hr); + ok(hr == DD_OK, "Got hr %#lx.\n", hr);
ok(ddsd2.dwFlags == (DDSD_PIXELFORMAT | DDSD_WIDTH | DDSD_HEIGHT | DDSD_CAPS | DDSD_LINEARSIZE), - "Surface desc flags: %08x\n", ddsd2.dwFlags); - ok(U4(ddsd2).ddpfPixelFormat.dwFlags == DDPF_FOURCC, "Pixel format flags: %08x\n", U4(ddsd2).ddpfPixelFormat.dwFlags); - ok(U1(U4(ddsd2).ddpfPixelFormat).dwRGBBitCount == 0, "RGB bitcount: %08x\n", U1(U4(ddsd2).ddpfPixelFormat).dwRGBBitCount); + "Surface desc flags: %#lx\n", ddsd2.dwFlags); + ok(U4(ddsd2).ddpfPixelFormat.dwFlags == DDPF_FOURCC, "Pixel format flags: %#lx\n", U4(ddsd2).ddpfPixelFormat.dwFlags); + ok(U1(U4(ddsd2).ddpfPixelFormat).dwRGBBitCount == 0, "RGB bitcount: %#lx\n", U1(U4(ddsd2).ddpfPixelFormat).dwRGBBitCount); ok(ddsd2.ddsCaps.dwCaps == (DDSCAPS_TEXTURE | DDSCAPS_SYSTEMMEMORY), - "Surface caps flags: %08x\n", ddsd2.ddsCaps.dwCaps); - ok(U1(ddsd2).dwLinearSize == 8192, "Linear size is %d\n", U1(ddsd2).dwLinearSize); - ok(ddsd2.ddsCaps.dwCaps2 == 0, "Caps2: %08x\n", ddsd2.ddsCaps.dwCaps2); + "Surface caps flags: %#lx\n", ddsd2.ddsCaps.dwCaps); + ok(U1(ddsd2).dwLinearSize == 8192, "Linear size is %lu\n", U1(ddsd2).dwLinearSize); + ok(ddsd2.ddsCaps.dwCaps2 == 0, "Caps2: %#lx\n", ddsd2.ddsCaps.dwCaps2); IDirectDrawSurface7_Release(surface);
U4(ddsd).ddpfPixelFormat.dwFourCC = MAKEFOURCC('D','X','T','3'); hr = IDirectDraw7_CreateSurface(dd7, &ddsd, &surface, NULL); - ok(hr == DD_OK, "CreateSurface returned %08x\n", hr); + ok(hr == DD_OK, "Got hr %#lx.\n", hr); if (FAILED(hr)) { skip("failed to create surface\n"); @@ -700,20 +699,20 @@ static void CompressedTest(void) ddsd2.dwSize = sizeof(ddsd2); U4(ddsd2).ddpfPixelFormat.dwSize = sizeof(U4(ddsd2).ddpfPixelFormat); hr = IDirectDrawSurface7_GetSurfaceDesc(surface, &ddsd2); - ok(hr == DD_OK, "GetSurfaceDesc returned %08x\n", hr); + ok(hr == DD_OK, "Got hr %#lx.\n", hr);
ok(ddsd2.dwFlags == (DDSD_PIXELFORMAT | DDSD_WIDTH | DDSD_HEIGHT | DDSD_CAPS | DDSD_LINEARSIZE), - "Surface desc flags: %08x\n", ddsd2.dwFlags); - ok(U4(ddsd2).ddpfPixelFormat.dwFlags == DDPF_FOURCC, "Pixel format flags: %08x\n", U4(ddsd2).ddpfPixelFormat.dwFlags); - ok(U1(U4(ddsd2).ddpfPixelFormat).dwRGBBitCount == 0, "RGB bitcount: %08x\n", U1(U4(ddsd2).ddpfPixelFormat).dwRGBBitCount); + "Surface desc flags: %#lx\n", ddsd2.dwFlags); + ok(U4(ddsd2).ddpfPixelFormat.dwFlags == DDPF_FOURCC, "Pixel format flags: %#lx\n", U4(ddsd2).ddpfPixelFormat.dwFlags); + ok(U1(U4(ddsd2).ddpfPixelFormat).dwRGBBitCount == 0, "RGB bitcount: %#lx\n", U1(U4(ddsd2).ddpfPixelFormat).dwRGBBitCount); ok(ddsd2.ddsCaps.dwCaps == (DDSCAPS_TEXTURE | DDSCAPS_SYSTEMMEMORY), - "Surface caps flags: %08x\n", ddsd2.ddsCaps.dwCaps); - ok(U1(ddsd2).dwLinearSize == 16384, "Linear size is %d\n", U1(ddsd2).dwLinearSize); + "Surface caps flags: %#lx\n", ddsd2.ddsCaps.dwCaps); + ok(U1(ddsd2).dwLinearSize == 16384, "Linear size is %lu\n", U1(ddsd2).dwLinearSize); IDirectDrawSurface7_Release(surface);
U4(ddsd).ddpfPixelFormat.dwFourCC = MAKEFOURCC('D','X','T','5'); hr = IDirectDraw7_CreateSurface(dd7, &ddsd, &surface, NULL); - ok(hr == DD_OK, "CreateSurface returned %08x\n", hr); + ok(hr == DD_OK, "Got hr %#lx.\n", hr); if (FAILED(hr)) { skip("failed to create surface\n"); @@ -724,15 +723,15 @@ static void CompressedTest(void) ddsd2.dwSize = sizeof(ddsd2); U4(ddsd2).ddpfPixelFormat.dwSize = sizeof(U4(ddsd2).ddpfPixelFormat); hr = IDirectDrawSurface7_GetSurfaceDesc(surface, &ddsd2); - ok(hr == DD_OK, "GetSurfaceDesc returned %08x\n", hr); + ok(hr == DD_OK, "Got hr %#lx.\n", hr);
ok(ddsd2.dwFlags == (DDSD_PIXELFORMAT | DDSD_WIDTH | DDSD_HEIGHT | DDSD_CAPS | DDSD_LINEARSIZE), - "Surface desc flags: %08x\n", ddsd2.dwFlags); - ok(U4(ddsd2).ddpfPixelFormat.dwFlags == DDPF_FOURCC, "Pixel format flags: %08x\n", U4(ddsd2).ddpfPixelFormat.dwFlags); - ok(U1(U4(ddsd2).ddpfPixelFormat).dwRGBBitCount == 0, "RGB bitcount: %08x\n", U1(U4(ddsd2).ddpfPixelFormat).dwRGBBitCount); + "Surface desc flags: %#lx\n", ddsd2.dwFlags); + ok(U4(ddsd2).ddpfPixelFormat.dwFlags == DDPF_FOURCC, "Pixel format flags: %#lx\n", U4(ddsd2).ddpfPixelFormat.dwFlags); + ok(U1(U4(ddsd2).ddpfPixelFormat).dwRGBBitCount == 0, "RGB bitcount: %#lx\n", U1(U4(ddsd2).ddpfPixelFormat).dwRGBBitCount); ok(ddsd2.ddsCaps.dwCaps == (DDSCAPS_TEXTURE | DDSCAPS_SYSTEMMEMORY), - "Surface caps flags: %08x\n", ddsd2.ddsCaps.dwCaps); - ok(U1(ddsd2).dwLinearSize == 16384, "Linear size is %d\n", U1(ddsd2).dwLinearSize); + "Surface caps flags: %#lx\n", ddsd2.ddsCaps.dwCaps); + ok(U1(ddsd2).dwLinearSize == 16384, "Linear size is %lu\n", U1(ddsd2).dwLinearSize); ok(ddsd2.lpSurface == 0, "Surface memory is at %p, expected NULL\n", ddsd2.lpSurface);
memset(&ddsd2, 0, sizeof(ddsd2)); @@ -743,51 +742,51 @@ static void CompressedTest(void) * about this is that DDSD_LPSURFACE isn't set. */ hr = IDirectDrawSurface7_Lock(surface, NULL, &ddsd2, DDLOCK_READONLY, 0); - ok(hr == DD_OK, "Lock returned %08x\n", hr); + ok(hr == DD_OK, "Got hr %#lx.\n", hr);
ok(ddsd2.dwFlags == (DDSD_PIXELFORMAT | DDSD_WIDTH | DDSD_HEIGHT | DDSD_CAPS | DDSD_LINEARSIZE), - "Surface desc flags: %08x\n", ddsd2.dwFlags); - ok(U4(ddsd2).ddpfPixelFormat.dwFlags == DDPF_FOURCC, "Pixel format flags: %08x\n", U4(ddsd2).ddpfPixelFormat.dwFlags); - ok(U1(U4(ddsd2).ddpfPixelFormat).dwRGBBitCount == 0, "RGB bitcount: %08x\n", U1(U4(ddsd2).ddpfPixelFormat).dwRGBBitCount); + "Surface desc flags: %#lx\n", ddsd2.dwFlags); + ok(U4(ddsd2).ddpfPixelFormat.dwFlags == DDPF_FOURCC, "Pixel format flags: %#lx\n", U4(ddsd2).ddpfPixelFormat.dwFlags); + ok(U1(U4(ddsd2).ddpfPixelFormat).dwRGBBitCount == 0, "RGB bitcount: %#lx\n", U1(U4(ddsd2).ddpfPixelFormat).dwRGBBitCount); ok(ddsd2.ddsCaps.dwCaps == (DDSCAPS_TEXTURE | DDSCAPS_SYSTEMMEMORY), - "Surface caps flags: %08x\n", ddsd2.ddsCaps.dwCaps); - ok(U1(ddsd2).dwLinearSize == 16384, "Linear size is %d\n", U1(ddsd2).dwLinearSize); + "Surface caps flags: %#lx\n", ddsd2.ddsCaps.dwCaps); + ok(U1(ddsd2).dwLinearSize == 16384, "Linear size is %lu\n", U1(ddsd2).dwLinearSize); ok(ddsd2.lpSurface != 0, "Surface memory is at NULL\n");
hr = IDirectDrawSurface7_Unlock(surface, NULL); - ok(hr == DD_OK, "Unlock returned %08x\n", hr); + ok(hr == DD_OK, "Got hr %#lx.\n", hr);
/* Now what about a locking rect? */ hr = IDirectDrawSurface7_Lock(surface, &r, &ddsd2, DDLOCK_READONLY, 0); - ok(hr == DD_OK, "Lock returned %08x\n", hr); + ok(hr == DD_OK, "Got hr %#lx.\n", hr);
ok(ddsd2.dwFlags == (DDSD_PIXELFORMAT | DDSD_WIDTH | DDSD_HEIGHT | DDSD_CAPS | DDSD_LINEARSIZE), - "Surface desc flags: %08x\n", ddsd2.dwFlags); - ok(U4(ddsd2).ddpfPixelFormat.dwFlags == DDPF_FOURCC, "Pixel format flags: %08x\n", U4(ddsd2).ddpfPixelFormat.dwFlags); - ok(U1(U4(ddsd2).ddpfPixelFormat).dwRGBBitCount == 0, "RGB bitcount: %08x\n", U1(U4(ddsd2).ddpfPixelFormat).dwRGBBitCount); + "Surface desc flags: %#lx\n", ddsd2.dwFlags); + ok(U4(ddsd2).ddpfPixelFormat.dwFlags == DDPF_FOURCC, "Pixel format flags: %#lx\n", U4(ddsd2).ddpfPixelFormat.dwFlags); + ok(U1(U4(ddsd2).ddpfPixelFormat).dwRGBBitCount == 0, "RGB bitcount: %#lx\n", U1(U4(ddsd2).ddpfPixelFormat).dwRGBBitCount); ok(ddsd2.ddsCaps.dwCaps == (DDSCAPS_TEXTURE | DDSCAPS_SYSTEMMEMORY), - "Surface caps flags: %08x\n", ddsd2.ddsCaps.dwCaps); - ok(U1(ddsd2).dwLinearSize == 16384, "Linear size is %d\n", U1(ddsd2).dwLinearSize); + "Surface caps flags: %#lx\n", ddsd2.ddsCaps.dwCaps); + ok(U1(ddsd2).dwLinearSize == 16384, "Linear size is %lu\n", U1(ddsd2).dwLinearSize); ok(ddsd2.lpSurface != 0, "Surface memory is at NULL\n");
hr = IDirectDrawSurface7_Unlock(surface, &r); - ok(hr == DD_OK, "Unlock returned %08x\n", hr); + ok(hr == DD_OK, "Got hr %#lx.\n", hr);
/* Now what about a different locking offset? */ hr = IDirectDrawSurface7_Lock(surface, &r2, &ddsd2, DDLOCK_READONLY, 0); - ok(hr == DD_OK, "Lock returned %08x\n", hr); + ok(hr == DD_OK, "Got hr %#lx.\n", hr);
ok(ddsd2.dwFlags == (DDSD_PIXELFORMAT | DDSD_WIDTH | DDSD_HEIGHT | DDSD_CAPS | DDSD_LINEARSIZE), - "Surface desc flags: %08x\n", ddsd2.dwFlags); - ok(U4(ddsd2).ddpfPixelFormat.dwFlags == DDPF_FOURCC, "Pixel format flags: %08x\n", U4(ddsd2).ddpfPixelFormat.dwFlags); - ok(U1(U4(ddsd2).ddpfPixelFormat).dwRGBBitCount == 0, "RGB bitcount: %08x\n", U1(U4(ddsd2).ddpfPixelFormat).dwRGBBitCount); + "Surface desc flags: %#lx\n", ddsd2.dwFlags); + ok(U4(ddsd2).ddpfPixelFormat.dwFlags == DDPF_FOURCC, "Pixel format flags: %#lx\n", U4(ddsd2).ddpfPixelFormat.dwFlags); + ok(U1(U4(ddsd2).ddpfPixelFormat).dwRGBBitCount == 0, "RGB bitcount: %#lx\n", U1(U4(ddsd2).ddpfPixelFormat).dwRGBBitCount); ok(ddsd2.ddsCaps.dwCaps == (DDSCAPS_TEXTURE | DDSCAPS_SYSTEMMEMORY), - "Surface caps flags: %08x\n", ddsd2.ddsCaps.dwCaps); - ok(U1(ddsd2).dwLinearSize == 16384, "Linear size is %d\n", U1(ddsd2).dwLinearSize); + "Surface caps flags: %#lx\n", ddsd2.ddsCaps.dwCaps); + ok(U1(ddsd2).dwLinearSize == 16384, "Linear size is %lu\n", U1(ddsd2).dwLinearSize); ok(ddsd2.lpSurface != 0, "Surface memory is at NULL\n");
hr = IDirectDrawSurface7_Unlock(surface, &r2); - ok(hr == DD_OK, "Unlock returned %08x\n", hr); + ok(hr == DD_OK, "Got hr %#lx.\n", hr); IDirectDrawSurface7_Release(surface);
/* Try this with video memory. A kind of surprise. It still has the LINEARSIZE flag set, @@ -798,7 +797,7 @@ static void CompressedTest(void)
hr = IDirectDraw7_CreateSurface(dd7, &ddsd, &surface, NULL); ok(hr == DD_OK || hr == DDERR_NOTEXTUREHW || hr == DDERR_INVALIDPARAMS || - broken(hr == DDERR_NODIRECTDRAWHW), "CreateSurface returned %08x\n", hr); + broken(hr == DDERR_NODIRECTDRAWHW), "Got hr %#lx.\n", hr);
/* Not supported everywhere */ if(SUCCEEDED(hr)) @@ -807,53 +806,53 @@ static void CompressedTest(void) ddsd2.dwSize = sizeof(ddsd2); U4(ddsd2).ddpfPixelFormat.dwSize = sizeof(U4(ddsd2).ddpfPixelFormat); hr = IDirectDrawSurface7_GetSurfaceDesc(surface, &ddsd2); - ok(hr == DD_OK, "GetSurfaceDesc returned %08x\n", hr); + ok(hr == DD_OK, "Got hr %#lx.\n", hr);
ok(ddsd2.dwFlags == (DDSD_PIXELFORMAT | DDSD_WIDTH | DDSD_HEIGHT | DDSD_CAPS | DDSD_LINEARSIZE), - "Surface desc flags: %08x\n", ddsd2.dwFlags); - ok(U4(ddsd2).ddpfPixelFormat.dwFlags == DDPF_FOURCC, "Pixel format flags: %08x\n", U4(ddsd2).ddpfPixelFormat.dwFlags); - ok(U1(U4(ddsd2).ddpfPixelFormat).dwRGBBitCount == 0, "RGB bitcount: %08x\n", U1(U4(ddsd2).ddpfPixelFormat).dwRGBBitCount); + "Surface desc flags: %#lx\n", ddsd2.dwFlags); + ok(U4(ddsd2).ddpfPixelFormat.dwFlags == DDPF_FOURCC, "Pixel format flags: %#lx\n", U4(ddsd2).ddpfPixelFormat.dwFlags); + ok(U1(U4(ddsd2).ddpfPixelFormat).dwRGBBitCount == 0, "RGB bitcount: %#lx\n", U1(U4(ddsd2).ddpfPixelFormat).dwRGBBitCount); ok(ddsd2.ddsCaps.dwCaps == (DDSCAPS_TEXTURE | DDSCAPS_VIDEOMEMORY | DDSCAPS_LOCALVIDMEM), - "Surface caps flags: %08x\n", ddsd2.ddsCaps.dwCaps); + "Surface caps flags: %#lx\n", ddsd2.ddsCaps.dwCaps); /* ATI drivers report a broken linear size, thus no need to clone the exact behaviour. nvidia reports the correct size */ - ok(ddsd2.ddsCaps.dwCaps2 == 0, "Caps2: %08x\n", ddsd2.ddsCaps.dwCaps2); + ok(ddsd2.ddsCaps.dwCaps2 == 0, "Caps2: %#lx\n", ddsd2.ddsCaps.dwCaps2); IDirectDrawSurface7_Release(surface);
U4(ddsd).ddpfPixelFormat.dwFourCC = MAKEFOURCC('D','X','T','3'); hr = IDirectDraw7_CreateSurface(dd7, &ddsd, &surface, NULL); - ok(hr == DD_OK, "CreateSurface returned %08x\n", hr); + ok(hr == DD_OK, "Got hr %#lx.\n", hr);
memset(&ddsd2, 0, sizeof(ddsd2)); ddsd2.dwSize = sizeof(ddsd2); U4(ddsd2).ddpfPixelFormat.dwSize = sizeof(U4(ddsd2).ddpfPixelFormat); hr = IDirectDrawSurface7_GetSurfaceDesc(surface, &ddsd2); - ok(hr == DD_OK, "GetSurfaceDesc returned %08x\n", hr); + ok(hr == DD_OK, "Got hr %#lx.\n", hr);
ok(ddsd2.dwFlags == (DDSD_PIXELFORMAT | DDSD_WIDTH | DDSD_HEIGHT | DDSD_CAPS | DDSD_LINEARSIZE), - "Surface desc flags: %08x\n", ddsd2.dwFlags); - ok(U4(ddsd2).ddpfPixelFormat.dwFlags == DDPF_FOURCC, "Pixel format flags: %08x\n", U4(ddsd2).ddpfPixelFormat.dwFlags); - ok(U1(U4(ddsd2).ddpfPixelFormat).dwRGBBitCount == 0, "RGB bitcount: %08x\n", U1(U4(ddsd2).ddpfPixelFormat).dwRGBBitCount); + "Surface desc flags: %#lx\n", ddsd2.dwFlags); + ok(U4(ddsd2).ddpfPixelFormat.dwFlags == DDPF_FOURCC, "Pixel format flags: %#lx\n", U4(ddsd2).ddpfPixelFormat.dwFlags); + ok(U1(U4(ddsd2).ddpfPixelFormat).dwRGBBitCount == 0, "RGB bitcount: %#lx\n", U1(U4(ddsd2).ddpfPixelFormat).dwRGBBitCount); ok(ddsd2.ddsCaps.dwCaps == (DDSCAPS_TEXTURE | DDSCAPS_VIDEOMEMORY | DDSCAPS_LOCALVIDMEM), - "Surface caps flags: %08x\n", ddsd2.ddsCaps.dwCaps); + "Surface caps flags: %#lx\n", ddsd2.ddsCaps.dwCaps); /* ATI drivers report a broken linear size, thus no need to clone the exact behaviour. nvidia reports the correct size */ IDirectDrawSurface7_Release(surface);
U4(ddsd).ddpfPixelFormat.dwFourCC = MAKEFOURCC('D','X','T','5'); hr = IDirectDraw7_CreateSurface(dd7, &ddsd, &surface, NULL); - ok(hr == DD_OK, "CreateSurface returned %08x\n", hr); + ok(hr == DD_OK, "Got hr %#lx.\n", hr);
memset(&ddsd2, 0, sizeof(ddsd2)); ddsd2.dwSize = sizeof(ddsd2); U4(ddsd2).ddpfPixelFormat.dwSize = sizeof(U4(ddsd2).ddpfPixelFormat); hr = IDirectDrawSurface7_GetSurfaceDesc(surface, &ddsd2); - ok(hr == DD_OK, "GetSurfaceDesc returned %08x\n", hr); + ok(hr == DD_OK, "Got hr %#lx.\n", hr);
ok(ddsd2.dwFlags == (DDSD_PIXELFORMAT | DDSD_WIDTH | DDSD_HEIGHT | DDSD_CAPS | DDSD_LINEARSIZE), - "Surface desc flags: %08x\n", ddsd2.dwFlags); - ok(U4(ddsd2).ddpfPixelFormat.dwFlags == DDPF_FOURCC, "Pixel format flags: %08x\n", U4(ddsd2).ddpfPixelFormat.dwFlags); - ok(U1(U4(ddsd2).ddpfPixelFormat).dwRGBBitCount == 0, "RGB bitcount: %08x\n", U1(U4(ddsd2).ddpfPixelFormat).dwRGBBitCount); + "Surface desc flags: %#lx\n", ddsd2.dwFlags); + ok(U4(ddsd2).ddpfPixelFormat.dwFlags == DDPF_FOURCC, "Pixel format flags: %#lx\n", U4(ddsd2).ddpfPixelFormat.dwFlags); + ok(U1(U4(ddsd2).ddpfPixelFormat).dwRGBBitCount == 0, "RGB bitcount: %#lx\n", U1(U4(ddsd2).ddpfPixelFormat).dwRGBBitCount); ok(ddsd2.ddsCaps.dwCaps == (DDSCAPS_TEXTURE | DDSCAPS_VIDEOMEMORY | DDSCAPS_LOCALVIDMEM), - "Surface caps flags: %08x\n", ddsd2.ddsCaps.dwCaps); + "Surface caps flags: %#lx\n", ddsd2.ddsCaps.dwCaps); /* ATI drivers report a broken linear size, thus no need to clone the exact behaviour. nvidia reports the correct size */ ok(ddsd2.lpSurface == 0, "Surface memory is at %p, expected NULL\n", ddsd2.lpSurface);
@@ -865,51 +864,51 @@ static void CompressedTest(void) * about this is that DDSD_LPSURFACE isn't set. */ hr = IDirectDrawSurface7_Lock(surface, NULL, &ddsd2, DDLOCK_READONLY, 0); - ok(hr == DD_OK, "Lock returned %08x\n", hr); + ok(hr == DD_OK, "Got hr %#lx.\n", hr);
ok(ddsd2.dwFlags == (DDSD_PIXELFORMAT | DDSD_WIDTH | DDSD_HEIGHT | DDSD_CAPS | DDSD_LINEARSIZE), - "Surface desc flags: %08x\n", ddsd2.dwFlags); - ok(U4(ddsd2).ddpfPixelFormat.dwFlags == DDPF_FOURCC, "Pixel format flags: %08x\n", U4(ddsd2).ddpfPixelFormat.dwFlags); - ok(U1(U4(ddsd2).ddpfPixelFormat).dwRGBBitCount == 0, "RGB bitcount: %08x\n", U1(U4(ddsd2).ddpfPixelFormat).dwRGBBitCount); + "Surface desc flags: %#lx\n", ddsd2.dwFlags); + ok(U4(ddsd2).ddpfPixelFormat.dwFlags == DDPF_FOURCC, "Pixel format flags: %#lx\n", U4(ddsd2).ddpfPixelFormat.dwFlags); + ok(U1(U4(ddsd2).ddpfPixelFormat).dwRGBBitCount == 0, "RGB bitcount: %#lx\n", U1(U4(ddsd2).ddpfPixelFormat).dwRGBBitCount); ok(ddsd2.ddsCaps.dwCaps == (DDSCAPS_TEXTURE | DDSCAPS_VIDEOMEMORY | DDSCAPS_LOCALVIDMEM), - "Surface caps flags: %08x\n", ddsd2.ddsCaps.dwCaps); + "Surface caps flags: %#lx\n", ddsd2.ddsCaps.dwCaps); /* ATI drivers report a broken linear size, thus no need to clone the exact behaviour. nvidia reports the correct size */ ok(ddsd2.lpSurface != 0, "Surface memory is at NULL\n");
hr = IDirectDrawSurface7_Unlock(surface, NULL); - ok(hr == DD_OK, "Unlock returned %08x\n", hr); + ok(hr == DD_OK, "Got hr %#lx.\n", hr);
/* Now what about a locking rect? */ hr = IDirectDrawSurface7_Lock(surface, &r, &ddsd2, DDLOCK_READONLY, 0); - ok(hr == DD_OK, "Lock returned %08x\n", hr); + ok(hr == DD_OK, "Got hr %#lx.\n", hr);
ok(ddsd2.dwFlags == (DDSD_PIXELFORMAT | DDSD_WIDTH | DDSD_HEIGHT | DDSD_CAPS | DDSD_LINEARSIZE), - "Surface desc flags: %08x\n", ddsd2.dwFlags); - ok(U4(ddsd2).ddpfPixelFormat.dwFlags == DDPF_FOURCC, "Pixel format flags: %08x\n", U4(ddsd2).ddpfPixelFormat.dwFlags); - ok(U1(U4(ddsd2).ddpfPixelFormat).dwRGBBitCount == 0, "RGB bitcount: %08x\n", U1(U4(ddsd2).ddpfPixelFormat).dwRGBBitCount); + "Surface desc flags: %#lx\n", ddsd2.dwFlags); + ok(U4(ddsd2).ddpfPixelFormat.dwFlags == DDPF_FOURCC, "Pixel format flags: %#lx\n", U4(ddsd2).ddpfPixelFormat.dwFlags); + ok(U1(U4(ddsd2).ddpfPixelFormat).dwRGBBitCount == 0, "RGB bitcount: %#lx\n", U1(U4(ddsd2).ddpfPixelFormat).dwRGBBitCount); ok(ddsd2.ddsCaps.dwCaps == (DDSCAPS_TEXTURE | DDSCAPS_VIDEOMEMORY | DDSCAPS_LOCALVIDMEM), - "Surface caps flags: %08x\n", ddsd2.ddsCaps.dwCaps); + "Surface caps flags: %#lx\n", ddsd2.ddsCaps.dwCaps); /* ATI drivers report a broken linear size, thus no need to clone the exact behaviour. nvidia reports the correct size */ ok(ddsd2.lpSurface != 0, "Surface memory is at NULL\n");
hr = IDirectDrawSurface7_Unlock(surface, &r); - ok(hr == DD_OK, "Unlock returned %08x\n", hr); + ok(hr == DD_OK, "Got hr %#lx.\n", hr);
/* Now what about a different locking offset? */ hr = IDirectDrawSurface7_Lock(surface, &r2, &ddsd2, DDLOCK_READONLY, 0); - ok(hr == DD_OK, "Lock returned %08x\n", hr); + ok(hr == DD_OK, "Got hr %#lx.\n", hr);
ok(ddsd2.dwFlags == (DDSD_PIXELFORMAT | DDSD_WIDTH | DDSD_HEIGHT | DDSD_CAPS | DDSD_LINEARSIZE), - "Surface desc flags: %08x\n", ddsd2.dwFlags); - ok(U4(ddsd2).ddpfPixelFormat.dwFlags == DDPF_FOURCC, "Pixel format flags: %08x\n", U4(ddsd2).ddpfPixelFormat.dwFlags); - ok(U1(U4(ddsd2).ddpfPixelFormat).dwRGBBitCount == 0, "RGB bitcount: %08x\n", U1(U4(ddsd2).ddpfPixelFormat).dwRGBBitCount); + "Surface desc flags: %#lx\n", ddsd2.dwFlags); + ok(U4(ddsd2).ddpfPixelFormat.dwFlags == DDPF_FOURCC, "Pixel format flags: %#lx\n", U4(ddsd2).ddpfPixelFormat.dwFlags); + ok(U1(U4(ddsd2).ddpfPixelFormat).dwRGBBitCount == 0, "RGB bitcount: %#lx\n", U1(U4(ddsd2).ddpfPixelFormat).dwRGBBitCount); ok(ddsd2.ddsCaps.dwCaps == (DDSCAPS_TEXTURE | DDSCAPS_VIDEOMEMORY | DDSCAPS_LOCALVIDMEM), - "Surface caps flags: %08x\n", ddsd2.ddsCaps.dwCaps); + "Surface caps flags: %#lx\n", ddsd2.ddsCaps.dwCaps); /* ATI drivers report a broken linear size, thus no need to clone the exact behaviour. nvidia reports the correct size */ ok(ddsd2.lpSurface != 0, "Surface memory is at NULL\n");
hr = IDirectDrawSurface7_Unlock(surface, &r2); - ok(hr == DD_OK, "Unlock returned %08x\n", hr); + ok(hr == DD_OK, "Got hr %#lx.\n", hr);
IDirectDrawSurface7_Release(surface); } @@ -926,7 +925,7 @@ static void CompressedTest(void) U4(ddsd).ddpfPixelFormat.dwFourCC = MAKEFOURCC('D','X','T','1');
hr = IDirectDraw7_CreateSurface(dd7, &ddsd, &surface, NULL); - ok(hr == DD_OK || hr == DDERR_NOTEXTUREHW, "CreateSurface returned %08x\n", hr); + ok(hr == DD_OK || hr == DDERR_NOTEXTUREHW, "Got hr %#lx.\n", hr);
/* Not supported everywhere */ if(SUCCEEDED(hr)) @@ -935,54 +934,54 @@ static void CompressedTest(void) ddsd2.dwSize = sizeof(ddsd2); U4(ddsd2).ddpfPixelFormat.dwSize = sizeof(U4(ddsd2).ddpfPixelFormat); hr = IDirectDrawSurface7_GetSurfaceDesc(surface, &ddsd2); - ok(hr == DD_OK, "GetSurfaceDesc returned %08x\n", hr); + ok(hr == DD_OK, "Got hr %#lx.\n", hr);
ok(ddsd2.dwFlags == (DDSD_PIXELFORMAT | DDSD_WIDTH | DDSD_HEIGHT | DDSD_CAPS | DDSD_LINEARSIZE), - "Surface desc flags: %08x\n", ddsd2.dwFlags); - ok(U4(ddsd2).ddpfPixelFormat.dwFlags == DDPF_FOURCC, "Pixel format flags: %08x\n", U4(ddsd2).ddpfPixelFormat.dwFlags); - ok(U1(U4(ddsd2).ddpfPixelFormat).dwRGBBitCount == 0, "RGB bitcount: %08x\n", U1(U4(ddsd2).ddpfPixelFormat).dwRGBBitCount); + "Surface desc flags: %#lx\n", ddsd2.dwFlags); + ok(U4(ddsd2).ddpfPixelFormat.dwFlags == DDPF_FOURCC, "Pixel format flags: %#lx\n", U4(ddsd2).ddpfPixelFormat.dwFlags); + ok(U1(U4(ddsd2).ddpfPixelFormat).dwRGBBitCount == 0, "RGB bitcount: %#lx\n", U1(U4(ddsd2).ddpfPixelFormat).dwRGBBitCount); ok(ddsd2.ddsCaps.dwCaps == (DDSCAPS_TEXTURE | DDSCAPS_SYSTEMMEMORY), - "Surface caps flags: %08x\n", ddsd2.ddsCaps.dwCaps); - ok(U1(ddsd2).dwLinearSize == 8192, "Linear size is %d\n", U1(ddsd2).dwLinearSize); - ok(ddsd2.ddsCaps.dwCaps2 == DDSCAPS2_TEXTUREMANAGE, "Caps2: %08x\n", ddsd2.ddsCaps.dwCaps2); + "Surface caps flags: %#lx\n", ddsd2.ddsCaps.dwCaps); + ok(U1(ddsd2).dwLinearSize == 8192, "Linear size is %lu\n", U1(ddsd2).dwLinearSize); + ok(ddsd2.ddsCaps.dwCaps2 == DDSCAPS2_TEXTUREMANAGE, "Caps2: %#lx\n", ddsd2.ddsCaps.dwCaps2); IDirectDrawSurface7_Release(surface);
U4(ddsd).ddpfPixelFormat.dwFourCC = MAKEFOURCC('D','X','T','3'); hr = IDirectDraw7_CreateSurface(dd7, &ddsd, &surface, NULL); - ok(hr == DD_OK, "CreateSurface returned %08x\n", hr); + ok(hr == DD_OK, "Got hr %#lx.\n", hr);
memset(&ddsd2, 0, sizeof(ddsd2)); ddsd2.dwSize = sizeof(ddsd2); U4(ddsd2).ddpfPixelFormat.dwSize = sizeof(U4(ddsd2).ddpfPixelFormat); hr = IDirectDrawSurface7_GetSurfaceDesc(surface, &ddsd2); - ok(hr == DD_OK, "GetSurfaceDesc returned %08x\n", hr); + ok(hr == DD_OK, "Got hr %#lx.\n", hr);
ok(ddsd2.dwFlags == (DDSD_PIXELFORMAT | DDSD_WIDTH | DDSD_HEIGHT | DDSD_CAPS | DDSD_LINEARSIZE), - "Surface desc flags: %08x\n", ddsd2.dwFlags); - ok(U4(ddsd2).ddpfPixelFormat.dwFlags == DDPF_FOURCC, "Pixel format flags: %08x\n", U4(ddsd2).ddpfPixelFormat.dwFlags); - ok(U1(U4(ddsd2).ddpfPixelFormat).dwRGBBitCount == 0, "RGB bitcount: %08x\n", U1(U4(ddsd2).ddpfPixelFormat).dwRGBBitCount); + "Surface desc flags: %#lx\n", ddsd2.dwFlags); + ok(U4(ddsd2).ddpfPixelFormat.dwFlags == DDPF_FOURCC, "Pixel format flags: %#lx\n", U4(ddsd2).ddpfPixelFormat.dwFlags); + ok(U1(U4(ddsd2).ddpfPixelFormat).dwRGBBitCount == 0, "RGB bitcount: %#lx\n", U1(U4(ddsd2).ddpfPixelFormat).dwRGBBitCount); ok(ddsd2.ddsCaps.dwCaps == (DDSCAPS_TEXTURE | DDSCAPS_SYSTEMMEMORY), - "Surface caps flags: %08x\n", ddsd2.ddsCaps.dwCaps); - ok(U1(ddsd2).dwLinearSize == 16384, "Linear size is %d\n", U1(ddsd2).dwLinearSize); + "Surface caps flags: %#lx\n", ddsd2.ddsCaps.dwCaps); + ok(U1(ddsd2).dwLinearSize == 16384, "Linear size is %lu\n", U1(ddsd2).dwLinearSize); IDirectDrawSurface7_Release(surface);
U4(ddsd).ddpfPixelFormat.dwFourCC = MAKEFOURCC('D','X','T','5'); hr = IDirectDraw7_CreateSurface(dd7, &ddsd, &surface, NULL); - ok(hr == DD_OK, "CreateSurface returned %08x\n", hr); + ok(hr == DD_OK, "Got hr %#lx.\n", hr);
memset(&ddsd2, 0, sizeof(ddsd2)); ddsd2.dwSize = sizeof(ddsd2); U4(ddsd2).ddpfPixelFormat.dwSize = sizeof(U4(ddsd2).ddpfPixelFormat); hr = IDirectDrawSurface7_GetSurfaceDesc(surface, &ddsd2); - ok(hr == DD_OK, "GetSurfaceDesc returned %08x\n", hr); + ok(hr == DD_OK, "Got hr %#lx.\n", hr);
ok(ddsd2.dwFlags == (DDSD_PIXELFORMAT | DDSD_WIDTH | DDSD_HEIGHT | DDSD_CAPS | DDSD_LINEARSIZE), - "Surface desc flags: %08x\n", ddsd2.dwFlags); - ok(U4(ddsd2).ddpfPixelFormat.dwFlags == DDPF_FOURCC, "Pixel format flags: %08x\n", U4(ddsd2).ddpfPixelFormat.dwFlags); - ok(U1(U4(ddsd2).ddpfPixelFormat).dwRGBBitCount == 0, "RGB bitcount: %08x\n", U1(U4(ddsd2).ddpfPixelFormat).dwRGBBitCount); + "Surface desc flags: %#lx\n", ddsd2.dwFlags); + ok(U4(ddsd2).ddpfPixelFormat.dwFlags == DDPF_FOURCC, "Pixel format flags: %#lx\n", U4(ddsd2).ddpfPixelFormat.dwFlags); + ok(U1(U4(ddsd2).ddpfPixelFormat).dwRGBBitCount == 0, "RGB bitcount: %#lx\n", U1(U4(ddsd2).ddpfPixelFormat).dwRGBBitCount); ok(ddsd2.ddsCaps.dwCaps == (DDSCAPS_TEXTURE | DDSCAPS_SYSTEMMEMORY), - "Surface caps flags: %08x\n", ddsd2.ddsCaps.dwCaps); - ok(U1(ddsd2).dwLinearSize == 16384, "Linear size is %d\n", U1(ddsd2).dwLinearSize); + "Surface caps flags: %#lx\n", ddsd2.ddsCaps.dwCaps); + ok(U1(ddsd2).dwLinearSize == 16384, "Linear size is %lu\n", U1(ddsd2).dwLinearSize); ok(ddsd2.lpSurface == 0, "Surface memory is at %p, expected NULL\n", ddsd2.lpSurface);
memset(&ddsd2, 0, sizeof(ddsd2)); @@ -993,51 +992,51 @@ static void CompressedTest(void) * about this is that DDSD_LPSURFACE isn't set. */ hr = IDirectDrawSurface7_Lock(surface, NULL, &ddsd2, DDLOCK_READONLY, 0); - ok(hr == DD_OK, "Lock returned %08x\n", hr); + ok(hr == DD_OK, "Got hr %#lx.\n", hr);
ok(ddsd2.dwFlags == (DDSD_PIXELFORMAT | DDSD_WIDTH | DDSD_HEIGHT | DDSD_CAPS | DDSD_LINEARSIZE), - "Surface desc flags: %08x\n", ddsd2.dwFlags); - ok(U4(ddsd2).ddpfPixelFormat.dwFlags == DDPF_FOURCC, "Pixel format flags: %08x\n", U4(ddsd2).ddpfPixelFormat.dwFlags); - ok(U1(U4(ddsd2).ddpfPixelFormat).dwRGBBitCount == 0, "RGB bitcount: %08x\n", U1(U4(ddsd2).ddpfPixelFormat).dwRGBBitCount); + "Surface desc flags: %#lx\n", ddsd2.dwFlags); + ok(U4(ddsd2).ddpfPixelFormat.dwFlags == DDPF_FOURCC, "Pixel format flags: %#lx\n", U4(ddsd2).ddpfPixelFormat.dwFlags); + ok(U1(U4(ddsd2).ddpfPixelFormat).dwRGBBitCount == 0, "RGB bitcount: %#lx\n", U1(U4(ddsd2).ddpfPixelFormat).dwRGBBitCount); ok(ddsd2.ddsCaps.dwCaps == (DDSCAPS_TEXTURE | DDSCAPS_SYSTEMMEMORY), - "Surface caps flags: %08x\n", ddsd2.ddsCaps.dwCaps); - ok(U1(ddsd2).dwLinearSize == 16384, "Linear size is %d\n", U1(ddsd2).dwLinearSize); + "Surface caps flags: %#lx\n", ddsd2.ddsCaps.dwCaps); + ok(U1(ddsd2).dwLinearSize == 16384, "Linear size is %lu\n", U1(ddsd2).dwLinearSize); ok(ddsd2.lpSurface != 0, "Surface memory is at NULL\n");
hr = IDirectDrawSurface7_Unlock(surface, NULL); - ok(hr == DD_OK, "Unlock returned %08x\n", hr); + ok(hr == DD_OK, "Got hr %#lx.\n", hr);
/* Now what about a locking rect? */ hr = IDirectDrawSurface7_Lock(surface, &r, &ddsd2, DDLOCK_READONLY, 0); - ok(hr == DD_OK, "Lock returned %08x\n", hr); + ok(hr == DD_OK, "Got hr %#lx.\n", hr);
ok(ddsd2.dwFlags == (DDSD_PIXELFORMAT | DDSD_WIDTH | DDSD_HEIGHT | DDSD_CAPS | DDSD_LINEARSIZE), - "Surface desc flags: %08x\n", ddsd2.dwFlags); - ok(U4(ddsd2).ddpfPixelFormat.dwFlags == DDPF_FOURCC, "Pixel format flags: %08x\n", U4(ddsd2).ddpfPixelFormat.dwFlags); - ok(U1(U4(ddsd2).ddpfPixelFormat).dwRGBBitCount == 0, "RGB bitcount: %08x\n", U1(U4(ddsd2).ddpfPixelFormat).dwRGBBitCount); + "Surface desc flags: %#lx\n", ddsd2.dwFlags); + ok(U4(ddsd2).ddpfPixelFormat.dwFlags == DDPF_FOURCC, "Pixel format flags: %#lx\n", U4(ddsd2).ddpfPixelFormat.dwFlags); + ok(U1(U4(ddsd2).ddpfPixelFormat).dwRGBBitCount == 0, "RGB bitcount: %#lx\n", U1(U4(ddsd2).ddpfPixelFormat).dwRGBBitCount); ok(ddsd2.ddsCaps.dwCaps == (DDSCAPS_TEXTURE | DDSCAPS_SYSTEMMEMORY), - "Surface caps flags: %08x\n", ddsd2.ddsCaps.dwCaps); - ok(U1(ddsd2).dwLinearSize == 16384, ""Linear" size is %d\n", U1(ddsd2).dwLinearSize); + "Surface caps flags: %#lx\n", ddsd2.ddsCaps.dwCaps); + ok(U1(ddsd2).dwLinearSize == 16384, ""Linear" size is %lu\n", U1(ddsd2).dwLinearSize); ok(ddsd2.lpSurface != 0, "Surface memory is at NULL\n");
hr = IDirectDrawSurface7_Unlock(surface, &r); - ok(hr == DD_OK, "Unlock returned %08x\n", hr); + ok(hr == DD_OK, "Got hr %#lx.\n", hr);
/* Now what about a different locking offset? */ hr = IDirectDrawSurface7_Lock(surface, &r2, &ddsd2, DDLOCK_READONLY, 0); - ok(hr == DD_OK, "Lock returned %08x\n", hr); + ok(hr == DD_OK, "Got hr %#lx.\n", hr);
ok(ddsd2.dwFlags == (DDSD_PIXELFORMAT | DDSD_WIDTH | DDSD_HEIGHT | DDSD_CAPS | DDSD_LINEARSIZE), - "Surface desc flags: %08x\n", ddsd2.dwFlags); - ok(U4(ddsd2).ddpfPixelFormat.dwFlags == DDPF_FOURCC, "Pixel format flags: %08x\n", U4(ddsd2).ddpfPixelFormat.dwFlags); - ok(U1(U4(ddsd2).ddpfPixelFormat).dwRGBBitCount == 0, "RGB bitcount: %08x\n", U1(U4(ddsd2).ddpfPixelFormat).dwRGBBitCount); + "Surface desc flags: %#lx\n", ddsd2.dwFlags); + ok(U4(ddsd2).ddpfPixelFormat.dwFlags == DDPF_FOURCC, "Pixel format flags: %#lx\n", U4(ddsd2).ddpfPixelFormat.dwFlags); + ok(U1(U4(ddsd2).ddpfPixelFormat).dwRGBBitCount == 0, "RGB bitcount: %#lx\n", U1(U4(ddsd2).ddpfPixelFormat).dwRGBBitCount); ok(ddsd2.ddsCaps.dwCaps == (DDSCAPS_TEXTURE | DDSCAPS_SYSTEMMEMORY), - "Surface caps flags: %08x\n", ddsd2.ddsCaps.dwCaps); - ok(U1(ddsd2).dwLinearSize == 16384, ""Linear" size is %d\n", U1(ddsd2).dwLinearSize); + "Surface caps flags: %#lx\n", ddsd2.ddsCaps.dwCaps); + ok(U1(ddsd2).dwLinearSize == 16384, ""Linear" size is %lu\n", U1(ddsd2).dwLinearSize); ok(ddsd2.lpSurface != 0, "Surface memory is at NULL\n");
hr = IDirectDrawSurface7_Unlock(surface, &r2); - ok(hr == DD_OK, "Unlock returned %08x\n", hr); + ok(hr == DD_OK, "Got hr %#lx.\n", hr);
IDirectDrawSurface7_Release(surface); } @@ -1063,7 +1062,7 @@ static void SizeTest(void) desc.dwFlags = DDSD_CAPS; desc.ddsCaps.dwCaps |= DDSCAPS_OFFSCREENPLAIN; ret = IDirectDraw_CreateSurface(lpDD, &desc, &dsurface, NULL); - ok(ret == DDERR_INVALIDPARAMS, "Creating an offscreen plain surface without a size info returned %08x (dsurface=%p)\n", ret, dsurface); + ok(ret == DDERR_INVALIDPARAMS, "Got hr %#lx.\n", ret); if(dsurface) { trace("Surface at %p\n", dsurface); @@ -1078,7 +1077,7 @@ static void SizeTest(void) desc.ddsCaps.dwCaps |= DDSCAPS_OFFSCREENPLAIN; desc.dwWidth = 128; ret = IDirectDraw_CreateSurface(lpDD, &desc, &dsurface, NULL); - ok(ret == DDERR_INVALIDPARAMS, "Creating an offscreen plain surface without height info returned %08x\n", ret); + ok(ret == DDERR_INVALIDPARAMS, "Got hr %#lx.\n", ret); if(dsurface) { IDirectDrawSurface_Release(dsurface); @@ -1092,7 +1091,7 @@ static void SizeTest(void) desc.ddsCaps.dwCaps |= DDSCAPS_OFFSCREENPLAIN; desc.dwHeight = 128; ret = IDirectDraw_CreateSurface(lpDD, &desc, &dsurface, NULL); - ok(ret == DDERR_INVALIDPARAMS, "Creating an offscreen plain surface without width info returned %08x\n", ret); + ok(ret == DDERR_INVALIDPARAMS, "Got hr %#lx.\n", ret); if(dsurface) { IDirectDrawSurface_Release(dsurface); @@ -1107,7 +1106,7 @@ static void SizeTest(void) desc.dwWidth = 1; desc.dwHeight = 0; ret = IDirectDraw_CreateSurface(lpDD, &desc, &dsurface, NULL); - ok(ret == DDERR_INVALIDPARAMS, "Creating a 0 height surface returned %#x, expected DDERR_INVALIDPARAMS.\n", ret); + ok(ret == DDERR_INVALIDPARAMS, "Got hr %#lx.\n", ret); if (SUCCEEDED(ret)) IDirectDrawSurface_Release(dsurface); dsurface = NULL;
@@ -1119,7 +1118,7 @@ static void SizeTest(void) desc.dwWidth = 0; desc.dwHeight = 1; ret = IDirectDraw_CreateSurface(lpDD, &desc, &dsurface, NULL); - ok(ret == DDERR_INVALIDPARAMS, "Creating a 0 width surface returned %#x, expected DDERR_INVALIDPARAMS.\n", ret); + ok(ret == DDERR_INVALIDPARAMS, "Got hr %#lx.\n", ret); if (SUCCEEDED(ret)) IDirectDrawSurface_Release(dsurface); dsurface = NULL;
@@ -1131,7 +1130,7 @@ static void SizeTest(void) desc.dwHeight = 128; desc.dwWidth = 128; ret = IDirectDraw_CreateSurface(lpDD, &desc, &dsurface, NULL); - ok(ret == DD_OK, "Creating an offscreen plain surface with width and height info returned %08x\n", ret); + ok(ret == DD_OK, "Got hr %#lx.\n", ret); if(dsurface) { IDirectDrawSurface_Release(dsurface); @@ -1140,7 +1139,7 @@ static void SizeTest(void)
/* Test a primary surface size */ ret = IDirectDraw_SetCooperativeLevel(lpDD, window, DDSCL_NORMAL); - ok(ret == DD_OK, "SetCooperativeLevel failed with %08x\n", ret); + ok(ret == DD_OK, "Got hr %#lx.\n", ret);
ZeroMemory(&desc, sizeof(desc)); desc.dwSize = sizeof(desc); @@ -1149,11 +1148,11 @@ static void SizeTest(void) desc.dwHeight = 128; /* Keep them set to check what happens */ desc.dwWidth = 128; /* Keep them set to check what happens */ ret = IDirectDraw_CreateSurface(lpDD, &desc, &dsurface, NULL); - ok(ret == DD_OK, "Creating a primary surface without width and height info returned %08x\n", ret); + ok(ret == DD_OK, "Got hr %#lx.\n", ret); if(dsurface) { ret = IDirectDrawSurface_GetSurfaceDesc(dsurface, &desc); - ok(ret == DD_OK, "GetSurfaceDesc returned %x\n", ret); + ok(ret == DD_OK, "Got hr %#lx.\n", ret);
IDirectDrawSurface_Release(dsurface); dsurface = NULL; @@ -1164,7 +1163,7 @@ static void SizeTest(void) ok(desc.dwHeight == GetSystemMetrics(SM_CYSCREEN), "Surface height differs from screen height\n"); } ret = IDirectDraw_SetCooperativeLevel(lpDD, NULL, DDSCL_NORMAL); - ok(ret == DD_OK, "SetCooperativeLevel failed with %08x\n", ret); + ok(ret == DD_OK, "Got hr %#lx.\n", ret); }
static void BltParamTest(void) @@ -1186,47 +1185,47 @@ static void BltParamTest(void) desc.dwHeight = 128; desc.dwWidth = 128; hr = IDirectDraw_CreateSurface(lpDD, &desc, &surface1, NULL); - ok(hr == DD_OK, "Creating an offscreen plain surface failed with %08x\n", hr); + ok(hr == DD_OK, "Got hr %#lx.\n", hr);
desc.dwHeight = 64; desc.dwWidth = 64; hr = IDirectDraw_CreateSurface(lpDD, &desc, &surface2, NULL); - ok(hr == DD_OK, "Creating an offscreen plain surface failed with %08x\n", hr); + ok(hr == DD_OK, "Got hr %#lx.\n", hr);
if(0) { /* This crashes */ hr = IDirectDrawSurface_BltFast(surface1, 0, 0, NULL, NULL, 0); - ok(hr == DD_OK, "BltFast from NULL surface returned %08x\n", hr); + ok(hr == DD_OK, "Got hr %#lx.\n", hr); } hr = IDirectDrawSurface_BltFast(surface1, 0, 0, surface2, NULL, 0); - ok(hr == DD_OK, "BltFast from smaller to bigger surface returned %08x\n", hr); + ok(hr == DD_OK, "Got hr %#lx.\n", hr); hr = IDirectDrawSurface_BltFast(surface2, 0, 0, surface1, NULL, 0); - ok(hr == DDERR_INVALIDRECT, "BltFast from bigger to smaller surface returned %08x\n", hr); + ok(hr == DDERR_INVALIDRECT, "Got hr %#lx.\n", hr); hr = IDirectDrawSurface_BltFast(surface2, 0, 0, surface1, &valid, 0); - ok(hr == DD_OK, "BltFast from bigger to smaller surface using a valid rectangle returned %08x\n", hr); + ok(hr == DD_OK, "Got hr %#lx.\n", hr); hr = IDirectDrawSurface_BltFast(surface2, 60, 60, surface1, &valid, 0); - ok(hr == DDERR_INVALIDRECT, "BltFast with a rectangle resulting in an off-surface write returned %08x\n", hr); + ok(hr == DDERR_INVALIDRECT, "Got hr %#lx.\n", hr); hr = IDirectDrawSurface_BltFast(surface1, 90, 90, surface2, NULL, 0); - ok(hr == DDERR_INVALIDRECT, "BltFast with a rectangle resulting in an off-surface write returned %08x\n", hr); + ok(hr == DDERR_INVALIDRECT, "Got hr %#lx.\n", hr);
hr = IDirectDrawSurface_BltFast(surface1, -10, 0, surface2, NULL, 0); - ok(hr == DDERR_INVALIDRECT, "BltFast with an offset resulting in an off-surface write returned %08x\n", hr); + ok(hr == DDERR_INVALIDRECT, "Got hr %#lx.\n", hr); hr = IDirectDrawSurface_BltFast(surface1, 0, -10, surface2, NULL, 0); - ok(hr == DDERR_INVALIDRECT, "BltFast with an offset resulting in an off-surface write returned %08x\n", hr); + ok(hr == DDERR_INVALIDRECT, "Got hr %#lx.\n", hr); hr = IDirectDrawSurface_BltFast(surface2, 20, 20, surface1, &valid, 0); - ok(hr == DD_OK, "BltFast from bigger to smaller surface using a valid rectangle and offset returned %08x\n", hr); + ok(hr == DD_OK, "Got hr %#lx.\n", hr);
hr = IDirectDrawSurface_BltFast(surface2, 0, 0, surface1, &invalid1, 0); - ok(hr == DDERR_INVALIDRECT, "BltFast with invalid rectangle 1 returned %08x\n", hr); + ok(hr == DDERR_INVALIDRECT, "Got hr %#lx.\n", hr); hr = IDirectDrawSurface_BltFast(surface2, 0, 0, surface1, &invalid2, 0); - ok(hr == DDERR_INVALIDRECT, "BltFast with invalid rectangle 2 returned %08x\n", hr); + ok(hr == DDERR_INVALIDRECT, "Got hr %#lx.\n", hr); hr = IDirectDrawSurface_BltFast(surface2, 0, 0, surface1, &invalid3, 0); - ok(hr == DDERR_INVALIDRECT, "BltFast with invalid rectangle 3 returned %08x\n", hr); + ok(hr == DDERR_INVALIDRECT, "Got hr %#lx.\n", hr); hr = IDirectDrawSurface_BltFast(surface1, 0, 0, surface2, &invalid4, 0); - ok(hr == DDERR_INVALIDRECT, "BltFast with invalid rectangle 3 returned %08x\n", hr); + ok(hr == DDERR_INVALIDRECT, "Got hr %#lx.\n", hr); hr = IDirectDrawSurface_BltFast(surface1, 0, 0, surface1, NULL, 0); - ok(hr == DD_OK, "BltFast blitting a surface onto itself returned %08x\n", hr); + ok(hr == DD_OK, "Got hr %#lx.\n", hr);
/* Blt(non-fast) tests */ memset(&BltFx, 0, sizeof(BltFx)); @@ -1234,47 +1233,47 @@ static void BltParamTest(void) U5(BltFx).dwFillColor = 0xaabbccdd;
hr = IDirectDrawSurface_Blt(surface1, &valid, NULL, NULL, DDBLT_COLORFILL, &BltFx); - ok(hr == DD_OK, "IDirectDrawSurface_Blt with a valid rectangle for color fill returned %08x\n", hr); + ok(hr == DD_OK, "Got hr %#lx.\n", hr); hr = IDirectDrawSurface_Blt(surface1, &valid, NULL, &invalid3, DDBLT_COLORFILL, &BltFx); - ok(hr == DD_OK, "IDirectDrawSurface_Blt with an invalid, unused rectangle returned %08x\n", hr); + ok(hr == DD_OK, "Got hr %#lx.\n", hr); hr = IDirectDrawSurface_Blt(surface2, &invalid1, NULL, NULL, DDBLT_COLORFILL, &BltFx); - ok(hr == DDERR_INVALIDRECT, "IDirectDrawSurface_Blt with a with invalid rectangle 1 returned %08x\n", hr); + ok(hr == DDERR_INVALIDRECT, "Got hr %#lx.\n", hr); hr = IDirectDrawSurface_Blt(surface2, &invalid2, NULL, NULL, DDBLT_COLORFILL, &BltFx); - ok(hr == DDERR_INVALIDRECT, "IDirectDrawSurface_Blt with a with invalid rectangle 2 returned %08x\n", hr); + ok(hr == DDERR_INVALIDRECT, "Got hr %#lx.\n", hr); hr = IDirectDrawSurface_Blt(surface2, &invalid3, NULL, NULL, DDBLT_COLORFILL, &BltFx); - ok(hr == DDERR_INVALIDRECT, "IDirectDrawSurface_Blt with a with invalid rectangle 3 returned %08x\n", hr); + ok(hr == DDERR_INVALIDRECT, "Got hr %#lx.\n", hr); hr = IDirectDrawSurface_Blt(surface2, &invalid4, NULL, NULL, DDBLT_COLORFILL, &BltFx); - ok(hr == DDERR_INVALIDRECT, "IDirectDrawSurface_Blt with a with invalid rectangle 4 returned %08x\n", hr); + ok(hr == DDERR_INVALIDRECT, "Got hr %#lx.\n", hr);
/* Valid on surface 1 */ hr = IDirectDrawSurface_Blt(surface1, &invalid4, NULL, NULL, DDBLT_COLORFILL, &BltFx); - ok(hr == DD_OK, "IDirectDrawSurface_Blt with a subrectangle fill returned %08x\n", hr); + ok(hr == DD_OK, "Got hr %#lx.\n", hr);
/* Works - stretched blit */ hr = IDirectDrawSurface_Blt(surface1, NULL, surface2, NULL, 0, NULL); - ok(hr == DD_OK, "IDirectDrawSurface_Blt from a smaller to a bigger surface returned %08x\n", hr); + ok(hr == DD_OK, "Got hr %#lx.\n", hr); hr = IDirectDrawSurface_Blt(surface2, NULL, surface1, NULL, 0, NULL); - ok(hr == DD_OK, "IDirectDrawSurface_Blt from a bigger to a smaller surface %08x\n", hr); + ok(hr == DD_OK, "Got hr %#lx.\n", hr);
/* Invalid dest rects in sourced blits */ hr = IDirectDrawSurface_Blt(surface2, &invalid1, surface1, NULL, 0, NULL); - ok(hr == DDERR_INVALIDRECT, "IDirectDrawSurface_Blt with a with invalid rectangle 1 returned %08x\n", hr); + ok(hr == DDERR_INVALIDRECT, "Got hr %#lx.\n", hr); hr = IDirectDrawSurface_Blt(surface2, &invalid2, surface1, NULL, 0, NULL); - ok(hr == DDERR_INVALIDRECT, "IDirectDrawSurface_Blt with a with invalid rectangle 2 returned %08x\n", hr); + ok(hr == DDERR_INVALIDRECT, "Got hr %#lx.\n", hr); hr = IDirectDrawSurface_Blt(surface2, &invalid3, surface1, NULL, 0, NULL); - ok(hr == DDERR_INVALIDRECT, "IDirectDrawSurface_Blt with a with invalid rectangle 3 returned %08x\n", hr); + ok(hr == DDERR_INVALIDRECT, "Got hr %#lx.\n", hr); hr = IDirectDrawSurface_Blt(surface2, &invalid4, surface1, NULL, 0, NULL); - ok(hr == DDERR_INVALIDRECT, "IDirectDrawSurface_Blt with a with invalid rectangle 4 returned %08x\n", hr); + ok(hr == DDERR_INVALIDRECT, "Got hr %#lx.\n", hr);
/* Invalid src rects */ hr = IDirectDrawSurface_Blt(surface2, NULL, surface1, &invalid1, 0, NULL); - ok(hr == DDERR_INVALIDRECT, "IDirectDrawSurface_Blt with a with invalid rectangle 1 returned %08x\n", hr); + ok(hr == DDERR_INVALIDRECT, "Got hr %#lx.\n", hr); hr = IDirectDrawSurface_Blt(surface2, NULL, surface1, &invalid2, 0, NULL); - ok(hr == DDERR_INVALIDRECT, "IDirectDrawSurface_Blt with a with invalid rectangle 2 returned %08x\n", hr); + ok(hr == DDERR_INVALIDRECT, "Got hr %#lx.\n", hr); hr = IDirectDrawSurface_Blt(surface2, NULL, surface1, &invalid3, 0, NULL); - ok(hr == DDERR_INVALIDRECT, "IDirectDrawSurface_Blt with a with invalid rectangle 3 returned %08x\n", hr); + ok(hr == DDERR_INVALIDRECT, "Got hr %#lx.\n", hr); hr = IDirectDrawSurface_Blt(surface1, NULL, surface2, &invalid4, 0, NULL); - ok(hr == DDERR_INVALIDRECT, "IDirectDrawSurface_Blt with a with invalid rectangle 4 returned %08x\n", hr); + ok(hr == DDERR_INVALIDRECT, "Got hr %#lx.\n", hr);
IDirectDrawSurface_Release(surface1); IDirectDrawSurface_Release(surface2); @@ -1302,12 +1301,12 @@ static void PaletteTest(void)
/* Create a 8bit palette without DDPCAPS_ALLOW256 set */ hr = IDirectDraw_CreatePalette(lpDD, DDPCAPS_8BIT, Table, &palette, NULL); - ok(hr == DD_OK, "CreatePalette failed with %08x\n", hr); + ok(hr == DD_OK, "Got hr %#lx.\n", hr); if (FAILED(hr)) goto err; /* Read back the palette and verify the entries. Without DDPCAPS_ALLOW256 set / entry 0 and 255 should have been overwritten with black and white */ hr = IDirectDrawPalette_GetEntries(palette , 0, 0, 256, &palEntries[0]); - ok(hr == DD_OK, "GetEntries failed with %08x\n", hr); + ok(hr == DD_OK, "Got hr %#lx.\n", hr); if(hr == DD_OK) { ok((palEntries[0].peRed == 0) && (palEntries[0].peGreen == 0) && (palEntries[0].peBlue == 0), @@ -1327,9 +1326,9 @@ static void PaletteTest(void) /* CreatePalette without DDPCAPS_ALLOW256 ignores entry 0 and 255, / now check we are able to update the entries afterwards. */ hr = IDirectDrawPalette_SetEntries(palette , 0, 0, 256, &Table[0]); - ok(hr == DD_OK, "SetEntries failed with %08x\n", hr); + ok(hr == DD_OK, "Got hr %#lx.\n", hr); hr = IDirectDrawPalette_GetEntries(palette , 0, 0, 256, &palEntries[0]); - ok(hr == DD_OK, "GetEntries failed with %08x\n", hr); + ok(hr == DD_OK, "Got hr %#lx.\n", hr); if(hr == DD_OK) { ok((palEntries[0].peRed == 0) && (palEntries[0].peGreen == 0) && (palEntries[0].peBlue == 0), @@ -1343,11 +1342,11 @@ static void PaletteTest(void)
/* Create a 8bit palette with DDPCAPS_ALLOW256 set */ hr = IDirectDraw_CreatePalette(lpDD, DDPCAPS_ALLOW256 | DDPCAPS_8BIT, Table, &palette, NULL); - ok(hr == DD_OK, "CreatePalette failed with %08x\n", hr); + ok(hr == DD_OK, "Got hr %#lx.\n", hr); if (FAILED(hr)) goto err;
hr = IDirectDrawPalette_GetEntries(palette , 0, 0, 256, &palEntries[0]); - ok(hr == DD_OK, "GetEntries failed with %08x\n", hr); + ok(hr == DD_OK, "Got hr %#lx.\n", hr); if(hr == DD_OK) { /* All entries should contain red */ @@ -1370,7 +1369,7 @@ static void PaletteTest(void) U3(ddsd.ddpfPixelFormat).dwGBitMask = 0x00FF00; U4(ddsd.ddpfPixelFormat).dwBBitMask = 0x0000FF; hr = IDirectDraw_CreateSurface(lpDD, &ddsd, &lpSurf, NULL); - ok(hr==DD_OK, "CreateSurface returned: %x\n",hr); + ok(hr==DD_OK, "Got hr %#lx.\n", hr); if (FAILED(hr)) { skip("failed to create surface\n"); @@ -1378,13 +1377,13 @@ static void PaletteTest(void) }
hr = IDirectDrawSurface_SetPalette(lpSurf, palette); - ok(hr == DDERR_INVALIDPIXELFORMAT, "CreateSurface returned: %x\n",hr); + ok(hr == DDERR_INVALIDPIXELFORMAT, "Got hr %#lx.\n", hr);
IDirectDrawPalette_Release(palette); palette = NULL;
hr = IDirectDrawSurface_GetPalette(lpSurf, &palette); - ok(hr == DDERR_NOPALETTEATTACHED, "CreateSurface returned: %x\n",hr); + ok(hr == DDERR_NOPALETTEATTACHED, "Got hr %#lx.\n", hr);
err:
@@ -1392,7 +1391,7 @@ static void PaletteTest(void) if (palette) IDirectDrawPalette_Release(palette);
hr = IDirectDraw_CreatePalette(lpDD, DDPCAPS_ALLOW256 | DDPCAPS_8BIT, Table, &palette, NULL); - ok(hr == DD_OK, "CreatePalette failed with %08x\n", hr); + ok(hr == DD_OK, "Got hr %#lx.\n", hr);
ddsd.dwSize = sizeof(ddsd); ddsd.ddpfPixelFormat.dwSize = sizeof(ddsd.ddpfPixelFormat); @@ -1405,7 +1404,7 @@ static void PaletteTest(void) U1(ddsd.ddpfPixelFormat).dwRGBBitCount = 8;
hr = IDirectDraw_CreateSurface(lpDD, &ddsd, &lpSurf, NULL); - ok(hr==DD_OK, "CreateSurface returned: %x\n",hr); + ok(hr==DD_OK, "Got hr %#lx.\n", hr); if (FAILED(hr)) { skip("failed to create surface\n"); @@ -1414,16 +1413,16 @@ static void PaletteTest(void)
ddscaps.dwCaps = DDSCAPS_BACKBUFFER; hr = IDirectDrawSurface_GetAttachedSurface(lpSurf, &ddscaps, &backbuffer); - ok(hr == DD_OK, "GetAttachedSurface returned: %x\n",hr); + ok(hr == DD_OK, "Got hr %#lx.\n", hr);
hr = IDirectDrawSurface_SetPalette(backbuffer, palette); - ok(hr == DD_OK, "SetPalette returned: %x\n",hr); + ok(hr == DD_OK, "Got hr %#lx.\n", hr);
IDirectDrawPalette_Release(palette); palette = NULL;
hr = IDirectDrawSurface_GetPalette(backbuffer, &palette); - ok(hr == DD_OK, "CreateSurface returned: %x\n",hr); + ok(hr == DD_OK, "Got hr %#lx.\n", hr); IDirectDrawPalette_Release(palette);
IDirectDrawSurface_Release(backbuffer); @@ -1499,17 +1498,17 @@ static void SurfaceCapsTest(void) }
hr = IDirectDraw_CreateSurface(lpDD, &create, &surface1, NULL); - ok(hr == DD_OK, "IDirectDraw_CreateSurface failed with %08x\n", hr); + ok(hr == DD_OK, "Got hr %#lx.\n", hr);
if (SUCCEEDED(hr)) { memset(&desc, 0, sizeof(desc)); desc.dwSize = sizeof(DDSURFACEDESC); hr = IDirectDrawSurface_GetSurfaceDesc(surface1, &desc); - ok(hr == DD_OK, "IDirectDrawSurface_GetSurfaceDesc failed with %08x\n", hr); + ok(hr == DD_OK, "Got hr %#lx.\n", hr);
ok(desc.ddsCaps.dwCaps == expected_caps[i], - "GetSurfaceDesc test %d returned caps %x, expected %x\n", + "GetSurfaceDesc test %d returned caps %#lx, expected %#lx\n", i, desc.ddsCaps.dwCaps, expected_caps[i]);
IDirectDrawSurface_Release(surface1); @@ -1518,7 +1517,7 @@ static void SurfaceCapsTest(void)
/* Test for differences in ddraw 7 */ hr = IDirectDraw_QueryInterface(lpDD, &IID_IDirectDraw7, (void **) &dd7); - ok(hr == DD_OK, "IDirectDraw_QueryInterface returned %08x\n", hr); + ok(hr == DD_OK, "Got hr %#lx.\n", hr); if (FAILED(hr)) { skip("Failed to get IDirectDraw7 interface, skipping tests\n"); @@ -1549,17 +1548,17 @@ static void SurfaceCapsTest(void) }
hr = IDirectDraw7_CreateSurface(dd7, &create2, &surface7, NULL); - ok(hr==DD_OK,"CreateSurface returned: %x\n",hr); + ok(hr==DD_OK, "Got hr %#lx.\n", hr);
if (SUCCEEDED(hr)) { memset(&desc2, 0, sizeof(desc2)); desc2.dwSize = sizeof(DDSURFACEDESC2); hr = IDirectDrawSurface7_GetSurfaceDesc(surface7, &desc2); - ok(hr == DD_OK, "IDirectDrawSurface_GetSurfaceDesc failed with %08x\n", hr); + ok(hr == DD_OK, "Got hr %#lx.\n", hr);
ok(desc2.ddsCaps.dwCaps == expected_caps[i], - "GetSurfaceDesc test %d returned caps %x, expected %x\n", + "GetSurfaceDesc test %d returned caps %#lx, expected %#lx\n", i, desc2.ddsCaps.dwCaps, expected_caps[i]);
IDirectDrawSurface7_Release(surface7); @@ -1576,7 +1575,7 @@ static void SurfaceCapsTest(void) create.dwWidth = 64; create.dwHeight = 64; hr = IDirectDraw_CreateSurface(lpDD, &create, &surface1, NULL); - ok(hr == DDERR_INVALIDCAPS, "Creating a SYSMEM | VIDMEM surface returned 0x%08x, expected DDERR_INVALIDCAPS\n", hr); + ok(hr == DDERR_INVALIDCAPS, "Got hr %#lx.\n", hr); if(surface1) IDirectDrawSurface_Release(surface1); }
@@ -1634,41 +1633,38 @@ static void BackBufferCreateSurfaceTest(void) created_ddsd.dwSize = sizeof(DDSURFACEDESC);
hr = IDirectDraw_CreateSurface(lpDD, &ddsd, &surf, NULL); - ok(SUCCEEDED(hr), "IDirectDraw_CreateSurface failed: 0x%08x\n", hr); + ok(SUCCEEDED(hr), "Got hr %#lx.\n", hr); if (surf != NULL) { hr = IDirectDrawSurface_GetSurfaceDesc(surf, &created_ddsd); - ok(SUCCEEDED(hr), "IDirectDraw_GetSurfaceDesc failed: 0x%08x\n", hr); + ok(SUCCEEDED(hr), "Got hr %#lx.\n", hr); ok(created_ddsd.ddsCaps.dwCaps == expected_caps, - "GetSurfaceDesc returned caps %x, expected %x\n", created_ddsd.ddsCaps.dwCaps, + "GetSurfaceDesc returned caps %#lx, expected %#lx\n", created_ddsd.ddsCaps.dwCaps, expected_caps); IDirectDrawSurface_Release(surf); }
hr = IDirectDraw_QueryInterface(lpDD, &IID_IDirectDraw2, (void **) &dd2); - ok(SUCCEEDED(hr), "IDirectDraw_QueryInterface failed: 0x%08x\n", hr); + ok(SUCCEEDED(hr), "Got hr %#lx.\n", hr);
hr = IDirectDraw2_CreateSurface(dd2, &ddsd, &surf, NULL); - ok(hr == DDERR_INVALIDCAPS, "IDirectDraw2_CreateSurface didn't return %x08x, but %x08x\n", - DDERR_INVALIDCAPS, hr); + ok(hr == DDERR_INVALIDCAPS, "Got hr %#lx.\n", hr);
IDirectDraw2_Release(dd2);
hr = IDirectDraw_QueryInterface(lpDD, &IID_IDirectDraw4, (void **) &dd4); - ok(SUCCEEDED(hr), "IDirectDraw_QueryInterface failed: 0x%08x\n", hr); + ok(SUCCEEDED(hr), "Got hr %#lx.\n", hr);
hr = IDirectDraw4_CreateSurface(dd4, &ddsd2, &surf4, NULL); - ok(hr == DDERR_INVALIDCAPS, "IDirectDraw4_CreateSurface didn't return %x08x, but %x08x\n", - DDERR_INVALIDCAPS, hr); + ok(hr == DDERR_INVALIDCAPS, "Got hr %#lx.\n", hr);
IDirectDraw4_Release(dd4);
hr = IDirectDraw_QueryInterface(lpDD, &IID_IDirectDraw7, (void **) &dd7); - ok(SUCCEEDED(hr), "IDirectDraw_QueryInterface failed: 0x%08x\n", hr); + ok(SUCCEEDED(hr), "Got hr %#lx.\n", hr);
hr = IDirectDraw7_CreateSurface(dd7, &ddsd2, &surf7, NULL); - ok(hr == DDERR_INVALIDCAPS, "IDirectDraw7_CreateSurface didn't return %x08x, but %x08x\n", - DDERR_INVALIDCAPS, hr); + ok(hr == DDERR_INVALIDCAPS, "Got hr %#lx.\n", hr);
IDirectDraw7_Release(dd7); } @@ -1682,7 +1678,7 @@ static void BackBufferAttachmentFlipTest(void) 100, 100, 160, 160, NULL, NULL, NULL, NULL);
hr = IDirectDraw_SetCooperativeLevel(lpDD, window, DDSCL_EXCLUSIVE | DDSCL_FULLSCREEN); - ok(hr == DD_OK, "SetCooperativeLevel returned %08x\n", hr); + ok(hr == DD_OK, "Got hr %#lx.\n", hr);
/* Perform attachment tests on a back-buffer */ memset(&ddsd, 0, sizeof(ddsd)); @@ -1692,7 +1688,7 @@ static void BackBufferAttachmentFlipTest(void) ddsd.dwWidth = GetSystemMetrics(SM_CXSCREEN); ddsd.dwHeight = GetSystemMetrics(SM_CYSCREEN); hr = IDirectDraw_CreateSurface(lpDD, &ddsd, &surface2, NULL); - ok(SUCCEEDED(hr), "CreateSurface returned: %x\n",hr); + ok(SUCCEEDED(hr), "Got hr %#lx.\n", hr);
if (surface2 != NULL) { @@ -1702,7 +1698,7 @@ static void BackBufferAttachmentFlipTest(void) ddsd.dwFlags = DDSD_CAPS; ddsd.ddsCaps.dwCaps = DDSCAPS_PRIMARYSURFACE; hr = IDirectDraw_CreateSurface(lpDD, &ddsd, &surface1, NULL); - ok(hr==DD_OK,"CreateSurface returned: %x\n",hr); + ok(hr==DD_OK, "Got hr %#lx.\n", hr);
memset(&ddsd, 0, sizeof(ddsd)); ddsd.dwSize = sizeof(ddsd); @@ -1711,7 +1707,7 @@ static void BackBufferAttachmentFlipTest(void) ddsd.dwWidth = GetSystemMetrics(SM_CXSCREEN); ddsd.dwHeight = GetSystemMetrics(SM_CYSCREEN); hr = IDirectDraw_CreateSurface(lpDD, &ddsd, &surface3, NULL); - ok(hr==DD_OK,"CreateSurface returned: %x\n",hr); + ok(hr==DD_OK, "Got hr %#lx.\n", hr);
/* This one has a different size */ memset(&ddsd, 0, sizeof(ddsd)); @@ -1721,63 +1717,63 @@ static void BackBufferAttachmentFlipTest(void) ddsd.dwWidth = 128; ddsd.dwHeight = 128; hr = IDirectDraw_CreateSurface(lpDD, &ddsd, &surface4, NULL); - ok(hr==DD_OK,"CreateSurface returned: %x\n",hr); + ok(hr==DD_OK, "Got hr %#lx.\n", hr);
hr = IDirectDrawSurface_AddAttachedSurface(surface1, surface2); todo_wine ok(hr == DD_OK || broken(hr == DDERR_CANNOTATTACHSURFACE), - "Attaching a back buffer to a front buffer returned %08x\n", hr); + "Attaching a back buffer to a front buffer returned %#lx\n", hr); if(SUCCEEDED(hr)) { /* Try flipping the surfaces */ hr = IDirectDrawSurface_Flip(surface1, NULL, DDFLIP_WAIT); - todo_wine ok(hr == DD_OK, "IDirectDrawSurface_Flip returned 0x%08x\n", hr); + todo_wine ok(hr == DD_OK, "Got hr %#lx.\n", hr); hr = IDirectDrawSurface_Flip(surface2, NULL, DDFLIP_WAIT); - todo_wine ok(hr == DDERR_NOTFLIPPABLE, "IDirectDrawSurface_Flip returned 0x%08x\n", hr); + todo_wine ok(hr == DDERR_NOTFLIPPABLE, "Got hr %#lx.\n", hr);
/* Try the reverse without detaching first */ hr = IDirectDrawSurface_AddAttachedSurface(surface2, surface1); - ok(hr == DDERR_SURFACEALREADYATTACHED, "Attaching an attached surface to its attachee returned %08x\n", hr); + ok(hr == DDERR_SURFACEALREADYATTACHED, "Got hr %#lx.\n", hr); hr = IDirectDrawSurface_DeleteAttachedSurface(surface1, 0, surface2); - ok(hr == DD_OK, "DeleteAttachedSurface failed with %08x\n", hr); + ok(hr == DD_OK, "Got hr %#lx.\n", hr); } hr = IDirectDrawSurface_AddAttachedSurface(surface2, surface1); todo_wine ok(hr == DD_OK || broken(hr == DDERR_CANNOTATTACHSURFACE), - "Attaching a front buffer to a back buffer returned %08x\n", hr); + "Attaching a front buffer to a back buffer returned %#lx\n", hr); if(SUCCEEDED(hr)) { /* Try flipping the surfaces */ hr = IDirectDrawSurface_Flip(surface1, NULL, DDFLIP_WAIT); - todo_wine ok(hr == DD_OK, "IDirectDrawSurface_Flip returned 0x%08x\n", hr); + todo_wine ok(hr == DD_OK, "Got hr %#lx.\n", hr); hr = IDirectDrawSurface_Flip(surface2, NULL, DDFLIP_WAIT); - todo_wine ok(hr == DDERR_NOTFLIPPABLE, "IDirectDrawSurface_Flip returned 0x%08x\n", hr); + todo_wine ok(hr == DDERR_NOTFLIPPABLE, "Got hr %#lx.\n", hr);
/* Try to detach reversed */ hr = IDirectDrawSurface_DeleteAttachedSurface(surface1, 0, surface2); - ok(hr == DDERR_CANNOTDETACHSURFACE, "DeleteAttachedSurface returned %08x\n", hr); + ok(hr == DDERR_CANNOTDETACHSURFACE, "Got hr %#lx.\n", hr); /* Now the proper detach */ hr = IDirectDrawSurface_DeleteAttachedSurface(surface2, 0, surface1); - ok(hr == DD_OK, "DeleteAttachedSurface failed with %08x\n", hr); + ok(hr == DD_OK, "Got hr %#lx.\n", hr); } hr = IDirectDrawSurface_AddAttachedSurface(surface2, surface3); todo_wine ok(hr == DD_OK || broken(hr == DDERR_CANNOTATTACHSURFACE), - "Attaching a back buffer to another back buffer returned %08x\n", hr); + "Attaching a back buffer to another back buffer returned %#lx\n", hr); if(SUCCEEDED(hr)) { /* Try flipping the surfaces */ hr = IDirectDrawSurface_Flip(surface3, NULL, DDFLIP_WAIT); - todo_wine ok(hr == DD_OK, "IDirectDrawSurface_Flip returned 0x%08x\n", hr); + todo_wine ok(hr == DD_OK, "Got hr %#lx.\n", hr); hr = IDirectDrawSurface_Flip(surface2, NULL, DDFLIP_WAIT); - todo_wine ok(hr == DDERR_NOTFLIPPABLE, "IDirectDrawSurface_Flip returned 0x%08x\n", hr); + todo_wine ok(hr == DDERR_NOTFLIPPABLE, "Got hr %#lx.\n", hr); hr = IDirectDrawSurface_Flip(surface1, NULL, DDFLIP_WAIT); - ok(hr == DDERR_NOTFLIPPABLE, "IDirectDrawSurface_Flip returned 0x%08x\n", hr); + ok(hr == DDERR_NOTFLIPPABLE, "Got hr %#lx.\n", hr);
hr = IDirectDrawSurface_DeleteAttachedSurface(surface2, 0, surface3); - ok(hr == DD_OK, "DeleteAttachedSurface failed with %08x\n", hr); + ok(hr == DD_OK, "Got hr %#lx.\n", hr); } hr = IDirectDrawSurface_AddAttachedSurface(surface1, surface4); - ok(hr == DDERR_CANNOTATTACHSURFACE, "Attaching a back buffer to a front buffer of different size returned %08x\n", hr); + ok(hr == DDERR_CANNOTATTACHSURFACE, "Got hr %#lx.\n", hr); hr = IDirectDrawSurface_AddAttachedSurface(surface4, surface1); - ok(hr == DDERR_CANNOTATTACHSURFACE, "Attaching a front buffer to a back buffer of different size returned %08x\n", hr); + ok(hr == DDERR_CANNOTATTACHSURFACE, "Got hr %#lx.\n", hr);
IDirectDrawSurface_Release(surface4); IDirectDrawSurface_Release(surface3); @@ -1786,7 +1782,7 @@ static void BackBufferAttachmentFlipTest(void) }
hr =IDirectDraw_SetCooperativeLevel(lpDD, NULL, DDSCL_NORMAL); - ok(hr == DD_OK, "SetCooperativeLevel returned %08x\n", hr); + ok(hr == DD_OK, "Got hr %#lx.\n", hr);
DestroyWindow(window); } @@ -1844,97 +1840,77 @@ static void CreateSurfaceBadCapsSizeTest(void) ddsd2_bad4.dwSize = sizeof(DDSURFACEDESC);
hr = IDirectDraw_CreateSurface(lpDD, &ddsd_ok, &surf, NULL); - ok(SUCCEEDED(hr), "IDirectDraw_CreateSurface failed: 0x%08x\n", hr); + ok(SUCCEEDED(hr), "Got hr %#lx.\n", hr); IDirectDrawSurface_Release(surf);
hr = IDirectDraw_CreateSurface(lpDD, &ddsd_bad1, &surf, NULL); - ok(hr == DDERR_INVALIDPARAMS, "IDirectDraw_CreateSurface didn't return 0x%08x, but 0x%08x\n", - DDERR_INVALIDPARAMS, hr); + ok(hr == DDERR_INVALIDPARAMS, "Got hr %#lx.\n", hr); hr = IDirectDraw_CreateSurface(lpDD, &ddsd_bad2, &surf, NULL); - ok(hr == DDERR_INVALIDPARAMS, "IDirectDraw_CreateSurface didn't return 0x%08x, but 0x%08x\n", - DDERR_INVALIDPARAMS, hr); + ok(hr == DDERR_INVALIDPARAMS, "Got hr %#lx.\n", hr); hr = IDirectDraw_CreateSurface(lpDD, &ddsd_bad3, &surf, NULL); - ok(hr == DDERR_INVALIDPARAMS, "IDirectDraw_CreateSurface didn't return 0x%08x, but 0x%08x\n", - DDERR_INVALIDPARAMS, hr); + ok(hr == DDERR_INVALIDPARAMS, "Got hr %#lx.\n", hr); hr = IDirectDraw_CreateSurface(lpDD, &ddsd_bad4, &surf, NULL); - ok(hr == DDERR_INVALIDPARAMS, "IDirectDraw_CreateSurface didn't return 0x%08x, but 0x%08x\n", - DDERR_INVALIDPARAMS, hr); + ok(hr == DDERR_INVALIDPARAMS, "Got hr %#lx.\n", hr); hr = IDirectDraw_CreateSurface(lpDD, NULL, &surf, NULL); - ok(hr == DDERR_INVALIDPARAMS, "IDirectDraw_CreateSurface didn't return 0x%08x, but 0x%08x\n", - DDERR_INVALIDPARAMS, hr); + ok(hr == DDERR_INVALIDPARAMS, "Got hr %#lx.\n", hr);
hr = IDirectDraw_QueryInterface(lpDD, &IID_IDirectDraw2, (void **) &dd2); - ok(SUCCEEDED(hr), "IDirectDraw_QueryInterface failed: 0x%08x\n", hr); + ok(SUCCEEDED(hr), "Got hr %#lx.\n", hr);
hr = IDirectDraw2_CreateSurface(dd2, &ddsd_ok, &surf, NULL); - ok(SUCCEEDED(hr), "IDirectDraw2_CreateSurface failed: 0x%08x\n", hr); + ok(SUCCEEDED(hr), "Got hr %#lx.\n", hr); IDirectDrawSurface_Release(surf);
hr = IDirectDraw2_CreateSurface(dd2, &ddsd_bad1, &surf, NULL); - ok(hr == DDERR_INVALIDPARAMS, "IDirectDraw2_CreateSurface didn't return 0x%08x, but 0x%08x\n", - DDERR_INVALIDPARAMS, hr); + ok(hr == DDERR_INVALIDPARAMS, "Got hr %#lx.\n", hr); hr = IDirectDraw2_CreateSurface(dd2, &ddsd_bad2, &surf, NULL); - ok(hr == DDERR_INVALIDPARAMS, "IDirectDraw2_CreateSurface didn't return 0x%08x, but 0x%08x\n", - DDERR_INVALIDPARAMS, hr); + ok(hr == DDERR_INVALIDPARAMS, "Got hr %#lx.\n", hr); hr = IDirectDraw2_CreateSurface(dd2, &ddsd_bad3, &surf, NULL); - ok(hr == DDERR_INVALIDPARAMS, "IDirectDraw2_CreateSurface didn't return 0x%08x, but 0x%08x\n", - DDERR_INVALIDPARAMS, hr); + ok(hr == DDERR_INVALIDPARAMS, "Got hr %#lx.\n", hr); hr = IDirectDraw2_CreateSurface(dd2, &ddsd_bad4, &surf, NULL); - ok(hr == DDERR_INVALIDPARAMS, "IDirectDraw2_CreateSurface didn't return 0x%08x, but 0x%08x\n", - DDERR_INVALIDPARAMS, hr); + ok(hr == DDERR_INVALIDPARAMS, "Got hr %#lx.\n", hr); hr = IDirectDraw2_CreateSurface(dd2, NULL, &surf, NULL); - ok(hr == DDERR_INVALIDPARAMS, "IDirectDraw2_CreateSurface didn't return 0x%08x, but 0x%08x\n", - DDERR_INVALIDPARAMS, hr); + ok(hr == DDERR_INVALIDPARAMS, "Got hr %#lx.\n", hr);
IDirectDraw2_Release(dd2);
hr = IDirectDraw_QueryInterface(lpDD, &IID_IDirectDraw4, (void **) &dd4); - ok(SUCCEEDED(hr), "IDirectDraw_QueryInterface failed: 0x%08x\n", hr); + ok(SUCCEEDED(hr), "Got hr %#lx.\n", hr);
hr = IDirectDraw4_CreateSurface(dd4, &ddsd2_ok, &surf4, NULL); - ok(SUCCEEDED(hr), "IDirectDraw4_CreateSurface failed: 0x%08x\n", hr); + ok(SUCCEEDED(hr), "Got hr %#lx.\n", hr); IDirectDrawSurface4_Release(surf4);
hr = IDirectDraw4_CreateSurface(dd4, &ddsd2_bad1, &surf4, NULL); - ok(hr == DDERR_INVALIDPARAMS, "IDirectDraw4_CreateSurface didn't return 0x%08x, but 0x%08x\n", - DDERR_INVALIDPARAMS, hr); + ok(hr == DDERR_INVALIDPARAMS, "Got hr %#lx.\n", hr); hr = IDirectDraw4_CreateSurface(dd4, &ddsd2_bad2, &surf4, NULL); - ok(hr == DDERR_INVALIDPARAMS, "IDirectDraw4_CreateSurface didn't return 0x%08x, but 0x%08x\n", - DDERR_INVALIDPARAMS, hr); + ok(hr == DDERR_INVALIDPARAMS, "Got hr %#lx.\n", hr); hr = IDirectDraw4_CreateSurface(dd4, &ddsd2_bad3, &surf4, NULL); - ok(hr == DDERR_INVALIDPARAMS, "IDirectDraw4_CreateSurface didn't return 0x%08x, but 0x%08x\n", - DDERR_INVALIDPARAMS, hr); + ok(hr == DDERR_INVALIDPARAMS, "Got hr %#lx.\n", hr); hr = IDirectDraw4_CreateSurface(dd4, &ddsd2_bad4, &surf4, NULL); - ok(hr == DDERR_INVALIDPARAMS, "IDirectDraw4_CreateSurface didn't return 0x%08x, but 0x%08x\n", - DDERR_INVALIDPARAMS, hr); + ok(hr == DDERR_INVALIDPARAMS, "Got hr %#lx.\n", hr); hr = IDirectDraw4_CreateSurface(dd4, NULL, &surf4, NULL); - ok(hr == DDERR_INVALIDPARAMS, "IDirectDraw4_CreateSurface didn't return 0x%08x, but 0x%08x\n", - DDERR_INVALIDPARAMS, hr); + ok(hr == DDERR_INVALIDPARAMS, "Got hr %#lx.\n", hr);
IDirectDraw4_Release(dd4);
hr = IDirectDraw_QueryInterface(lpDD, &IID_IDirectDraw7, (void **) &dd7); - ok(SUCCEEDED(hr), "IDirectDraw_QueryInterface failed: 0x%08x\n", hr); + ok(SUCCEEDED(hr), "Got hr %#lx.\n", hr);
hr = IDirectDraw7_CreateSurface(dd7, &ddsd2_ok, &surf7, NULL); - ok(SUCCEEDED(hr), "IDirectDraw7_CreateSurface failed: 0x%08x\n", hr); + ok(SUCCEEDED(hr), "Got hr %#lx.\n", hr); IDirectDrawSurface7_Release(surf7);
hr = IDirectDraw7_CreateSurface(dd7, &ddsd2_bad1, &surf7, NULL); - ok(hr == DDERR_INVALIDPARAMS, "IDirectDraw7_CreateSurface didn't return 0x%08x, but 0x%08x\n", - DDERR_INVALIDPARAMS, hr); + ok(hr == DDERR_INVALIDPARAMS, "Got hr %#lx.\n", hr); hr = IDirectDraw7_CreateSurface(dd7, &ddsd2_bad2, &surf7, NULL); - ok(hr == DDERR_INVALIDPARAMS, "IDirectDraw7_CreateSurface didn't return 0x%08x, but 0x%08x\n", - DDERR_INVALIDPARAMS, hr); + ok(hr == DDERR_INVALIDPARAMS, "Got hr %#lx.\n", hr); hr = IDirectDraw7_CreateSurface(dd7, &ddsd2_bad3, &surf7, NULL); - ok(hr == DDERR_INVALIDPARAMS, "IDirectDraw7_CreateSurface didn't return 0x%08x, but 0x%08x\n", - DDERR_INVALIDPARAMS, hr); + ok(hr == DDERR_INVALIDPARAMS, "Got hr %#lx.\n", hr); hr = IDirectDraw7_CreateSurface(dd7, &ddsd2_bad4, &surf7, NULL); - ok(hr == DDERR_INVALIDPARAMS, "IDirectDraw7_CreateSurface didn't return 0x%08x, but 0x%08x\n", - DDERR_INVALIDPARAMS, hr); + ok(hr == DDERR_INVALIDPARAMS, "Got hr %#lx.\n", hr); hr = IDirectDraw7_CreateSurface(dd7, NULL, &surf7, NULL); - ok(hr == DDERR_INVALIDPARAMS, "IDirectDraw7_CreateSurface didn't return 0x%08x, but 0x%08x\n", - DDERR_INVALIDPARAMS, hr); + ok(hr == DDERR_INVALIDPARAMS, "Got hr %#lx.\n", hr);
IDirectDraw7_Release(dd7); } @@ -1957,7 +1933,7 @@ static void no_ddsd_caps_test(void) ddsd.dwHeight = 128; ddsd.ddsCaps.dwCaps = DDSCAPS_OFFSCREENPLAIN; hr = IDirectDraw_CreateSurface(lpDD, &ddsd, &surface, NULL); - ok(SUCCEEDED(hr), "IDirectDraw_CreateSurface failed, hr %#x.\n", hr); + ok(SUCCEEDED(hr), "Got hr %#lx.\n", hr); reset_ddsd(&ddsd); hr = IDirectDrawSurface_GetSurfaceDesc(surface, &ddsd); IDirectDrawSurface_Release(surface); @@ -1967,7 +1943,7 @@ static void no_ddsd_caps_test(void) reset_ddsd(&ddsd); ddsd.ddsCaps.dwCaps = DDSCAPS_PRIMARYSURFACE; hr = IDirectDraw_CreateSurface(lpDD, &ddsd, &surface, NULL); - ok(SUCCEEDED(hr), "IDirectDraw_CreateSurface failed, hr %#x.\n", hr); + ok(SUCCEEDED(hr), "Got hr %#lx.\n", hr); reset_ddsd(&ddsd); hr = IDirectDrawSurface_GetSurfaceDesc(surface, &ddsd); IDirectDrawSurface_Release(surface); @@ -1980,14 +1956,14 @@ static void no_ddsd_caps_test(void) ddsd.dwHeight = 128; ddsd.ddsCaps.dwCaps = DDSCAPS_VIDEOMEMORY | DDSCAPS_SYSTEMMEMORY; hr = IDirectDraw_CreateSurface(lpDD, &ddsd, &surface, NULL); - ok(hr == DDERR_INVALIDCAPS, "IDirectDraw_CreateSurface returned %#x, expected DDERR_INVALIDCAPS.\n", hr); + ok(hr == DDERR_INVALIDCAPS, "Got hr %#lx.\n", hr); }
static void dump_format(const DDPIXELFORMAT *fmt) { - trace("dwFlags %08x, FourCC %08x, dwZBufferBitDepth %u, stencil %u\n", fmt->dwFlags, fmt->dwFourCC, + trace("dwFlags %#lx, FourCC %#lx, dwZBufferBitDepth %lu, stencil %lu\n", fmt->dwFlags, fmt->dwFourCC, U1(*fmt).dwZBufferBitDepth, U2(*fmt).dwStencilBitDepth); - trace("dwZBitMask %08x, dwStencilBitMask %08x, dwRGBZBitMask %08x\n", U3(*fmt).dwZBitMask, + trace("dwZBitMask %#lx, dwStencilBitMask %#lx, dwRGBZBitMask %#lx\n", U3(*fmt).dwZBitMask, U4(*fmt).dwStencilBitMask, U5(*fmt).dwRGBZBitMask); }
@@ -2054,7 +2030,7 @@ static void zbufferbitdepth_test(void) memset(&caps, 0, sizeof(caps)); caps.dwSize = sizeof(caps); hr = IDirectDraw_GetCaps(lpDD, &caps, NULL); - ok(SUCCEEDED(hr), "IDirectDraw_GetCaps failed, hr %#x.\n", hr); + ok(SUCCEEDED(hr), "Got hr %#lx.\n", hr); if (!(caps.ddsCaps.dwCaps & DDSCAPS_ZBUFFER)) { skip("Z buffers not supported, skipping DDSD_ZBUFFERBITDEPTH test\n"); @@ -2073,18 +2049,17 @@ static void zbufferbitdepth_test(void) hr = IDirectDraw_CreateSurface(lpDD, &ddsd, &surface, NULL); if (test_data[i].supported == ZFMT_SUPPORTED_ALWAYS) { - ok(SUCCEEDED(hr), "IDirectDraw_CreateSurface failed, hr %#x.\n", hr); + ok(SUCCEEDED(hr), "Got hr %#lx.\n", hr); } else if (test_data[i].supported == ZFMT_SUPPORTED_NEVER) { - ok(hr == DDERR_INVALIDPIXELFORMAT, "IDirectDraw_CreateSurface returned %#x, expected %x.\n", - hr, DDERR_INVALIDPIXELFORMAT); + ok(hr == DDERR_INVALIDPIXELFORMAT, "Got hr %#lx.\n", hr); } if (!surface) continue;
reset_ddsd(&ddsd); hr = IDirectDrawSurface_GetSurfaceDesc(surface, &ddsd); - ok(SUCCEEDED(hr), "IDirectDrawSurface_GetSurfaceDesc failed, hr %#x.\n", hr); + ok(SUCCEEDED(hr), "Got hr %#lx.\n", hr); IDirectDrawSurface_Release(surface);
ok(ddsd.dwFlags & DDSD_ZBUFFERBITDEPTH, "DDSD_ZBUFFERBITDEPTH is not set\n"); @@ -2092,7 +2067,7 @@ static void zbufferbitdepth_test(void) /* Yet the ddpfPixelFormat member contains valid data */ if (memcmp(&ddsd.ddpfPixelFormat, &test_data[i].pf, ddsd.ddpfPixelFormat.dwSize)) { - ok(0, "Unexpected format for depth %u\n", test_data[i].depth); + ok(0, "Unexpected format for depth %lu\n", test_data[i].depth); dump_format(&ddsd.ddpfPixelFormat); } } @@ -2111,17 +2086,17 @@ static void zbufferbitdepth_test(void)
surface = NULL; hr = IDirectDraw_CreateSurface(lpDD, &ddsd, &surface, NULL); - ok(SUCCEEDED(hr), "IDirectDraw_CreateSurface failed, hr %#x.\n", hr); + ok(SUCCEEDED(hr), "Got hr %#lx.\n", hr); if (!surface) return; reset_ddsd(&ddsd); hr = IDirectDrawSurface_GetSurfaceDesc(surface, &ddsd); - ok(SUCCEEDED(hr), "IDirectDrawSurface_GetSurfaceDesc failed, hr %#x.\n", hr); + ok(SUCCEEDED(hr), "Got hr %#lx.\n", hr); IDirectDrawSurface_Release(surface); - ok(U1(ddsd.ddpfPixelFormat).dwZBufferBitDepth == 16, "Expected a 16bpp depth buffer, got %ubpp\n", + ok(U1(ddsd.ddpfPixelFormat).dwZBufferBitDepth == 16, "Expected a 16bpp depth buffer, got %lu bpp\n", U1(ddsd.ddpfPixelFormat).dwZBufferBitDepth); ok(ddsd.dwFlags & DDSD_ZBUFFERBITDEPTH, "DDSD_ZBUFFERBITDEPTH is not set\n"); ok(!(ddsd.dwFlags & DDSD_PIXELFORMAT), "DDSD_PIXELFORMAT is set\n"); - ok(U2(ddsd).dwZBufferBitDepth == 16, "Expected dwZBufferBitDepth=16, got %u\n", + ok(U2(ddsd).dwZBufferBitDepth == 16, "Expected dwZBufferBitDepth=16, got %lu\n", U2(ddsd).dwZBufferBitDepth);
/* DDSD_PIXELFORMAT vs invalid ZBUFFERBITDEPTH */ @@ -2137,7 +2112,7 @@ static void zbufferbitdepth_test(void) U3(ddsd.ddpfPixelFormat).dwZBitMask = 0x0000ffff; surface = NULL; hr = IDirectDraw_CreateSurface(lpDD, &ddsd, &surface, NULL); - ok(SUCCEEDED(hr), "IDirectDraw_CreateSurface failed, hr %#x.\n", hr); + ok(SUCCEEDED(hr), "Got hr %#lx.\n", hr); if (surface) IDirectDrawSurface_Release(surface);
/* Create a PIXELFORMAT-only surface, see if ZBUFFERBITDEPTH is set */ @@ -2152,16 +2127,16 @@ static void zbufferbitdepth_test(void) U3(ddsd.ddpfPixelFormat).dwZBitMask = 0x0000ffff; surface = NULL; hr = IDirectDraw_CreateSurface(lpDD, &ddsd, &surface, NULL); - ok(SUCCEEDED(hr), "IDirectDrawSurface_GetSurfaceDesc failed, hr %#x.\n", hr); + ok(SUCCEEDED(hr), "Got hr %#lx.\n", hr); reset_ddsd(&ddsd); hr = IDirectDrawSurface_GetSurfaceDesc(surface, &ddsd); - ok(SUCCEEDED(hr), "IDirectDrawSurface_GetSurfaceDesc failed, hr %#x.\n", hr); + ok(SUCCEEDED(hr), "Got hr %#lx.\n", hr); IDirectDrawSurface_Release(surface); - ok(U1(ddsd.ddpfPixelFormat).dwZBufferBitDepth == 16, "Expected a 16bpp depth buffer, got %ubpp\n", + ok(U1(ddsd.ddpfPixelFormat).dwZBufferBitDepth == 16, "Expected a 16bpp depth buffer, got %lu bpp\n", U1(ddsd.ddpfPixelFormat).dwZBufferBitDepth); ok(ddsd.dwFlags & DDSD_ZBUFFERBITDEPTH, "DDSD_ZBUFFERBITDEPTH is not set\n"); ok(!(ddsd.dwFlags & DDSD_PIXELFORMAT), "DDSD_PIXELFORMAT is set\n"); - ok(U2(ddsd).dwZBufferBitDepth == 16, "Expected dwZBufferBitDepth=16, got %u\n", + ok(U2(ddsd).dwZBufferBitDepth == 16, "Expected dwZBufferBitDepth=16, got %lu\n", U2(ddsd).dwZBufferBitDepth); }
@@ -2179,17 +2154,17 @@ static void test_ddsd(DDSURFACEDESC *ddsd, BOOL expect_pf, BOOL expect_zd, const skip("Z buffers not supported, skipping Z flag test\n"); return; } - ok(SUCCEEDED(hr), "IDirectDraw_CreateSurface failed, hr %#x.\n", hr); + ok(SUCCEEDED(hr), "Got hr %#lx.\n", hr); hr = IDirectDrawSurface_QueryInterface(surface, &IID_IDirectDrawSurface7, (void **) &surface7); - ok(SUCCEEDED(hr), "IDirectDrawSurface_QueryInterface failed, hr %#x.\n", hr); + ok(SUCCEEDED(hr), "Got hr %#lx.\n", hr);
reset_ddsd(&out); hr = IDirectDrawSurface_GetSurfaceDesc(surface, &out); - ok(SUCCEEDED(hr), "IDirectDrawSurface_GetSurfaceDesc failed, hr %#x.\n", hr); + ok(SUCCEEDED(hr), "Got hr %#lx.\n", hr); memset(&out2, 0, sizeof(out2)); out2.dwSize = sizeof(out2); hr = IDirectDrawSurface7_GetSurfaceDesc(surface7, &out2); - ok(SUCCEEDED(hr), "IDirectDrawSurface_GetSurfaceDesc failed, hr %#x.\n", hr); + ok(SUCCEEDED(hr), "Got hr %#lx.\n", hr);
if (expect_pf) { @@ -2206,20 +2181,20 @@ static void test_ddsd(DDSURFACEDESC *ddsd, BOOL expect_pf, BOOL expect_zd, const if (expect_zd) { ok(out.dwFlags & DDSD_ZBUFFERBITDEPTH, "%s surface: Expected DDSD_ZBUFFERBITDEPTH to be set\n", name); - ok(U2(out).dwZBufferBitDepth == z_bit_depth, "ZBufferBitDepth is %u, expected %u\n", + ok(U2(out).dwZBufferBitDepth == z_bit_depth, "ZBufferBitDepth is %lu, expected %lu\n", U2(out).dwZBufferBitDepth, z_bit_depth); ok(!(out2.dwFlags & DDSD_ZBUFFERBITDEPTH), "%s surface: Did not expect DDSD_ZBUFFERBITDEPTH to be set in DDSURFACEDESC2\n", name); /* dwMipMapCount and dwZBufferBitDepth share the same union */ - ok(U2(out2).dwMipMapCount == 0, "dwMipMapCount is %u, expected 0\n", U2(out2).dwMipMapCount); + ok(U2(out2).dwMipMapCount == 0, "dwMipMapCount is %lu, expected 0\n", U2(out2).dwMipMapCount); } else { ok(!(out.dwFlags & DDSD_ZBUFFERBITDEPTH), "%s surface: Expected DDSD_ZBUFFERBITDEPTH not to be set\n", name); - ok(U2(out).dwZBufferBitDepth == 0, "ZBufferBitDepth is %u, expected 0\n", U2(out).dwZBufferBitDepth); + ok(U2(out).dwZBufferBitDepth == 0, "ZBufferBitDepth is %lu, expected 0\n", U2(out).dwZBufferBitDepth); ok(!(out2.dwFlags & DDSD_ZBUFFERBITDEPTH), "%s surface: Did not expect DDSD_ZBUFFERBITDEPTH to be set in DDSURFACEDESC2\n", name); - ok(U2(out2).dwMipMapCount == 0, "dwMipMapCount is %u, expected 0\n", U2(out2).dwMipMapCount); + ok(U2(out2).dwMipMapCount == 0, "dwMipMapCount is %lu, expected 0\n", U2(out2).dwMipMapCount); }
reset_ddsd(&out); @@ -2227,7 +2202,7 @@ static void test_ddsd(DDSURFACEDESC *ddsd, BOOL expect_pf, BOOL expect_zd, const if (SUCCEEDED(hr)) { hr = IDirectDrawSurface_Unlock(surface, NULL); - ok(SUCCEEDED(hr), "IDirectDrawSurface_GetSurfaceDesc failed, hr %#x.\n", hr); + ok(SUCCEEDED(hr), "Got hr %#lx.\n", hr);
/* DDSD_ZBUFFERBITDEPTH is never set on Nvidia, but follows GetSurfaceDesc rules on AMD */ if (!expect_zd) @@ -2247,24 +2222,24 @@ static void test_ddsd(DDSURFACEDESC *ddsd, BOOL expect_pf, BOOL expect_zd, const "Lock %s surface: Expected DDSD_PIXELFORMAT not to be set\n", name); } if (out.dwFlags & DDSD_ZBUFFERBITDEPTH) - ok(U2(out).dwZBufferBitDepth == z_bit_depth, "ZBufferBitDepth is %u, expected %u\n", + ok(U2(out).dwZBufferBitDepth == z_bit_depth, "ZBufferBitDepth is %lu, expected %lu\n", U2(out).dwZBufferBitDepth, z_bit_depth); else - ok(U2(out).dwZBufferBitDepth == 0, "ZBufferBitDepth is %u, expected 0\n", U2(out).dwZBufferBitDepth); + ok(U2(out).dwZBufferBitDepth == 0, "ZBufferBitDepth is %lu, expected 0\n", U2(out).dwZBufferBitDepth); }
hr = IDirectDrawSurface7_Lock(surface7, NULL, &out2, 0, NULL); - ok(SUCCEEDED(hr), "IDirectDrawSurface7_Lock failed, hr %#x.\n", hr); + ok(SUCCEEDED(hr), "Got hr %#lx.\n", hr); if (SUCCEEDED(hr)) { hr = IDirectDrawSurface7_Unlock(surface7, NULL); - ok(SUCCEEDED(hr), "IDirectDrawSurface7_Unlock failed, hr %#x.\n", hr); + ok(SUCCEEDED(hr), "Got hr %#lx.\n", hr); /* DDSD_PIXELFORMAT is always set, DDSD_ZBUFFERBITDEPTH never */ ok(out2.dwFlags & DDSD_PIXELFORMAT, "Lock %s surface: Expected DDSD_PIXELFORMAT to be set in DDSURFACEDESC2\n", name); ok(!(out2.dwFlags & DDSD_ZBUFFERBITDEPTH), "Lock %s surface: Did not expect DDSD_ZBUFFERBITDEPTH to be set in DDSURFACEDESC2\n", name); - ok(U2(out2).dwMipMapCount == 0, "dwMipMapCount is %u, expected 0\n", U2(out2).dwMipMapCount); + ok(U2(out2).dwMipMapCount == 0, "dwMipMapCount is %lu, expected 0\n", U2(out2).dwMipMapCount); }
IDirectDrawSurface7_Release(surface7); @@ -2280,7 +2255,7 @@ static void pixelformat_flag_test(void) memset(&caps, 0, sizeof(caps)); caps.dwSize = sizeof(caps); hr = IDirectDraw_GetCaps(lpDD, &caps, NULL); - ok(SUCCEEDED(hr), "IDirectDraw_GetCaps failed, hr %#x.\n", hr); + ok(SUCCEEDED(hr), "Got hr %#lx.\n", hr); if (!(caps.ddsCaps.dwCaps & DDSCAPS_ZBUFFER)) { skip("Z buffers not supported, skipping DDSD_PIXELFORMAT test\n"); @@ -2381,7 +2356,7 @@ static void partial_block_lock_test(void) RECT rect;
hr = IDirectDraw_QueryInterface(lpDD, &IID_IDirectDraw7, (void **) &dd7); - ok(SUCCEEDED(hr), "QueryInterface failed, hr %#x.\n", hr); + ok(SUCCEEDED(hr), "Got hr %#lx.\n", hr);
for (i = 0; i < sizeof(formats) / sizeof(formats[0]); i++) { @@ -2406,7 +2381,7 @@ static void partial_block_lock_test(void) U4(ddsd).ddpfPixelFormat.dwFlags = DDPF_FOURCC; U4(ddsd).ddpfPixelFormat.dwFourCC = formats[i].fourcc; hr = IDirectDraw7_CreateSurface(dd7, &ddsd, &surface, NULL); - ok(SUCCEEDED(hr), "CreateSurface failed, hr %#x, format %s, pool %s\n", + ok(SUCCEEDED(hr), "CreateSurface failed, hr %#lx, format %s, pool %s\n", hr, formats[i].name, pools[j].name);
/* All Windows versions allow partial block locks with DDSCAPS_SYSTEMMEMORY and @@ -2426,7 +2401,7 @@ static void partial_block_lock_test(void) if (SUCCEEDED(hr)) { hr = IDirectDrawSurface7_Unlock(surface, NULL); - ok(SUCCEEDED(hr), "Unlock failed, hr %#x.\n", hr); + ok(SUCCEEDED(hr), "Got hr %#lx.\n", hr); }
SetRect(&rect, 0, 0, formats[i].block_width >> 1, formats[i].block_height); @@ -2438,7 +2413,7 @@ static void partial_block_lock_test(void) if (SUCCEEDED(hr)) { hr = IDirectDrawSurface7_Unlock(surface, NULL); - ok(SUCCEEDED(hr), "Unlock failed, hr %#x.\n", hr); + ok(SUCCEEDED(hr), "Got hr %#lx.\n", hr); } }
@@ -2453,7 +2428,7 @@ static void partial_block_lock_test(void) if (SUCCEEDED(hr)) { hr = IDirectDrawSurface7_Unlock(surface, NULL); - ok(SUCCEEDED(hr), "Unlock failed, hr %#x.\n", hr); + ok(SUCCEEDED(hr), "Got hr %#lx.\n", hr); }
SetRect(&rect, 0, 0, formats[i].block_width, formats[i].block_height >> 1); @@ -2465,18 +2440,18 @@ static void partial_block_lock_test(void) if (SUCCEEDED(hr)) { hr = IDirectDrawSurface7_Unlock(surface, NULL); - ok(SUCCEEDED(hr), "Unlock failed, hr %#x.\n", hr); + ok(SUCCEEDED(hr), "Got hr %#lx.\n", hr); } }
SetRect(&rect, 0, 0, formats[i].block_width, formats[i].block_height); hr = IDirectDrawSurface7_Lock(surface, &rect, &ddsd, 0, NULL); - ok(SUCCEEDED(hr), "Full block lock returned %08x, expected %08x, format %s, pool %s\n", - hr, DD_OK, formats[i].name, pools[j].name); + ok(SUCCEEDED(hr), "Full block lock returned %#lx, format %s, pool %s\n", + hr, formats[i].name, pools[j].name); if (SUCCEEDED(hr)) { hr = IDirectDrawSurface7_Unlock(surface, NULL); - ok(SUCCEEDED(hr), "Unlock failed, hr %#x.\n", hr); + ok(SUCCEEDED(hr), "Got hr %#lx.\n", hr); }
IDirectDrawSurface7_Release(surface); @@ -2516,7 +2491,7 @@ START_TEST(dsurface) ret = IDirectDraw_GetCaps(lpDD, &ddcaps, NULL); if (ret != DD_OK) { - skip("IDirectDraw_GetCaps failed with %08x\n", ret); + skip("IDirectDraw_GetCaps failed with %#lx\n", ret); return; }
From: Zebediah Figura zfigura@codeweavers.com
--- dlls/ddraw/tests/refcount.c | 127 ++++++++++++++++++------------------ 1 file changed, 63 insertions(+), 64 deletions(-)
diff --git a/dlls/ddraw/tests/refcount.c b/dlls/ddraw/tests/refcount.c index 346a55e9d23..4efb2818ee6 100644 --- a/dlls/ddraw/tests/refcount.c +++ b/dlls/ddraw/tests/refcount.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" @@ -57,7 +56,7 @@ static void test_ddraw_objects(void) DDSURFACEDESC2 ddsd;
hr = pDirectDrawCreateEx(NULL, (void **) &DDraw7, &IID_IDirectDraw7, NULL); - ok(hr == DD_OK || hr==DDERR_NODIRECTDRAWSUPPORT, "DirectDrawCreateEx returned: %x\n", hr); + ok(hr == DD_OK || hr == DDERR_NODIRECTDRAWSUPPORT, "Got hr %#lx.\n", hr); if(!DDraw7) { trace("Couldn't create DDraw interface, skipping tests\n"); @@ -65,25 +64,25 @@ static void test_ddraw_objects(void) }
hr = IDirectDraw7_QueryInterface(DDraw7, &IID_IDirectDraw4, (void **) &DDraw4); - ok(hr == DD_OK, "IDirectDraw7_QueryInterface returned %08x\n", hr); + ok(hr == DD_OK, "Got hr %#lx.\n", hr); hr = IDirectDraw7_QueryInterface(DDraw7, &IID_IDirectDraw2, (void **) &DDraw2); - ok(hr == DD_OK, "IDirectDraw7_QueryInterface returned %08x\n", hr); + ok(hr == DD_OK, "Got hr %#lx.\n", hr); hr = IDirectDraw7_QueryInterface(DDraw7, &IID_IDirectDraw, (void **) &DDraw1); - ok(hr == DD_OK, "IDirectDraw7_QueryInterface returned %08x\n", hr); + ok(hr == DD_OK, "Got hr %#lx.\n", hr);
ref = getRefcount( (IUnknown *) DDraw7); - ok(ref == 1, "Got refcount %d, expected 1\n", ref); + ok(ref == 1, "Got refcount %ld, expected 1\n", ref);
/* Fails without a cooplevel */ hr = IDirectDraw7_CreatePalette(DDraw7, DDPCAPS_ALLOW256 | DDPCAPS_8BIT, Table, &palette, NULL); - ok(hr == DDERR_NOCOOPERATIVELEVELSET, "CreatePalette returned %08x\n", hr); + ok(hr == DDERR_NOCOOPERATIVELEVELSET, "Got hr %#lx.\n", hr);
/* This check is before the cooplevel check */ hr = IDirectDraw7_CreatePalette(DDraw7, DDPCAPS_ALLOW256 | DDPCAPS_8BIT, Table, &palette, (void *) 0xdeadbeef); - ok(hr == CLASS_E_NOAGGREGATION, "CreatePalette returned %08x\n", hr); + ok(hr == CLASS_E_NOAGGREGATION, "Got hr %#lx.\n", hr);
hr = IDirectDraw7_SetCooperativeLevel(DDraw7, 0, DDSCL_NORMAL); - ok(hr == DD_OK, "SetCooperativeLevel failed with %08x\n", hr); + ok(hr == DD_OK, "Got hr %#lx.\n", hr);
memset(&ddsd, 0, sizeof(ddsd)); ddsd.dwSize = sizeof(ddsd); @@ -98,98 +97,98 @@ static void test_ddraw_objects(void) hr = IDirectDraw7_CreateSurface(DDraw7, &ddsd, &surface, NULL); if (!surface) { - win_skip("Could not create surface : %08x\n", hr); + win_skip("Could not create surface : %#lx\n", hr); IDirectDraw_Release(DDraw1); IDirectDraw2_Release(DDraw2); IDirectDraw4_Release(DDraw4); IDirectDraw7_Release(DDraw7); return; } - ok(hr == DD_OK, "CreateSurface failed with %08x\n", hr); + ok(hr == DD_OK, "Got hr %#lx.\n", hr);
/* DDraw refcount increased by 1 */ ref = getRefcount( (IUnknown *) DDraw7); - ok(ref == 2, "Got refcount %d, expected 2\n", ref); + ok(ref == 2, "Got refcount %ld, expected 2\n", ref);
/* Surface refcount starts with 1 */ ref = getRefcount( (IUnknown *) surface); - ok(ref == 1, "Got refcount %d, expected 1\n", ref); + ok(ref == 1, "Got refcount %ld, expected 1\n", ref);
hr = IDirectDraw7_CreatePalette(DDraw7, DDPCAPS_ALLOW256 | DDPCAPS_8BIT, Table, &palette, NULL); - ok(hr == DD_OK, "CreatePalette returned %08x\n", hr); + ok(hr == DD_OK, "Got hr %#lx.\n", hr);
/* DDraw refcount increased by 1 */ ref = getRefcount( (IUnknown *) DDraw7); - ok(ref == 3, "Got refcount %d, expected 3\n", ref); + ok(ref == 3, "Got refcount %ld, expected 3\n", ref);
/* Palette starts with 1 */ ref = getRefcount( (IUnknown *) palette); - ok(ref == 1, "Got refcount %d, expected 1\n", ref); + ok(ref == 1, "Got refcount %ld, expected 1\n", ref);
/* Test attaching a palette to a surface */ hr = IDirectDrawSurface7_SetPalette(surface, palette); - ok(hr == DD_OK, "IDirectDrawSurface_SetPalette failed with %08x\n", hr); + ok(hr == DD_OK, "Got hr %#lx.\n", hr);
/* Palette refcount increased, surface stays the same */ ref = getRefcount( (IUnknown *) palette); - ok(ref == 2, "Got refcount %d, expected 2\n", ref); + ok(ref == 2, "Got refcount %ld, expected 2\n", ref); ref = getRefcount( (IUnknown *) surface); - ok(ref == 1, "Got refcount %d, expected 1\n", ref); + ok(ref == 1, "Got refcount %ld, expected 1\n", ref);
IDirectDrawSurface7_Release(surface); /* Increased before - decrease now */ ref = getRefcount( (IUnknown *) DDraw7); - ok(ref == 2, "Got refcount %d, expected 2\n", ref); + ok(ref == 2, "Got refcount %ld, expected 2\n", ref);
/* Releasing the surface detaches the palette */ ref = getRefcount( (IUnknown *) palette); - ok(ref == 1, "Got refcount %d, expected 1\n", ref); + ok(ref == 1, "Got refcount %ld, expected 1\n", ref);
IDirectDrawPalette_Release(palette);
/* Increased before - decrease now */ ref = getRefcount( (IUnknown *) DDraw7); - ok(ref == 1, "Got refcount %d, expected 1\n", ref); + ok(ref == 1, "Got refcount %ld, expected 1\n", ref);
/* Not all interfaces are AddRefed when a palette is created */ hr = IDirectDraw4_CreatePalette(DDraw4, DDPCAPS_ALLOW256 | DDPCAPS_8BIT, Table, &palette, NULL); - ok(hr == DD_OK, "CreatePalette returned %08x\n", hr); + ok(hr == DD_OK, "Got hr %#lx.\n", hr); ref = getRefcount( (IUnknown *) DDraw4); - ok(ref == 2, "Got refcount %d, expected 2\n", ref); + ok(ref == 2, "Got refcount %ld, expected 2\n", ref); IDirectDrawPalette_Release(palette);
/* No addref here */ hr = IDirectDraw2_CreatePalette(DDraw2, DDPCAPS_ALLOW256 | DDPCAPS_8BIT, Table, &palette, NULL); - ok(hr == DD_OK, "CreatePalette returned %08x\n", hr); + ok(hr == DD_OK, "Got hr %#lx.\n", hr); ref = getRefcount( (IUnknown *) DDraw2); - ok(ref == 1, "Got refcount %d, expected 1\n", ref); + ok(ref == 1, "Got refcount %ld, expected 1\n", ref); IDirectDrawPalette_Release(palette);
/* No addref here */ hr = IDirectDraw_CreatePalette(DDraw1, DDPCAPS_ALLOW256 | DDPCAPS_8BIT, Table, &palette, NULL); - ok(hr == DD_OK, "CreatePalette returned %08x\n", hr); + ok(hr == DD_OK, "Got hr %#lx.\n", hr); ref = getRefcount( (IUnknown *) DDraw1); - ok(ref == 1, "Got refcount %d, expected 1\n", ref); + ok(ref == 1, "Got refcount %ld, expected 1\n", ref); IDirectDrawPalette_Release(palette);
/* Similar for surfaces */ hr = IDirectDraw4_CreateSurface(DDraw4, &ddsd, &surface4, NULL); - ok(hr == DD_OK, "CreateSurface returned %08x\n", hr); + ok(hr == DD_OK, "Got hr %#lx.\n", hr); ref = getRefcount( (IUnknown *) DDraw4); - ok(ref == 2, "Got refcount %d, expected 2\n", ref); + ok(ref == 2, "Got refcount %ld, expected 2\n", ref); IDirectDrawSurface4_Release(surface4);
ddsd.dwSize = sizeof(DDSURFACEDESC); hr = IDirectDraw2_CreateSurface(DDraw2, (DDSURFACEDESC *) &ddsd, &surface1, NULL); - ok(hr == DD_OK, "CreateSurface returned %08x\n", hr); + ok(hr == DD_OK, "Got hr %#lx.\n", hr); ref = getRefcount( (IUnknown *) DDraw2); - ok(ref == 1, "Got refcount %d, expected 1\n", ref); + ok(ref == 1, "Got refcount %ld, expected 1\n", ref); IDirectDrawSurface_Release(surface1);
hr = IDirectDraw_CreateSurface(DDraw1, (DDSURFACEDESC *) &ddsd, &surface1, NULL); - ok(hr == DD_OK, "CreateSurface returned %08x\n", hr); + ok(hr == DD_OK, "Got hr %#lx.\n", hr); ref = getRefcount( (IUnknown *) DDraw1); - ok(ref == 1, "Got refcount %d, expected 1\n", ref); + ok(ref == 1, "Got refcount %ld, expected 1\n", ref); IDirectDrawSurface_Release(surface1);
IDirectDraw7_Release(DDraw7); @@ -212,7 +211,7 @@ static void test_iface_refcnt(void) long ref;
hr = pDirectDrawCreateEx(NULL, (void **) &DDraw7, &IID_IDirectDraw7, NULL); - ok(hr == DD_OK || hr==DDERR_NODIRECTDRAWSUPPORT, "DirectDrawCreateEx returned: %x\n", hr); + ok(hr == DD_OK || hr == DDERR_NODIRECTDRAWSUPPORT, "Got hr %#lx.\n", hr); if(!DDraw7) { trace("Couldn't create DDraw interface, skipping tests\n"); @@ -223,11 +222,11 @@ static void test_iface_refcnt(void) ok(ref == 1, "Initial IDirectDraw7 reference count is %ld\n", ref);
hr = IDirectDraw7_QueryInterface(DDraw7, &IID_IDirectDraw4, (void **) &DDraw4); - ok(hr == DD_OK, "IDirectDraw7_QueryInterface returned %08x\n", hr); + ok(hr == DD_OK, "Got hr %#lx.\n", hr); hr = IDirectDraw7_QueryInterface(DDraw7, &IID_IDirectDraw2, (void **) &DDraw2); - ok(hr == DD_OK, "IDirectDraw7_QueryInterf&ace returned %08x\n", hr); + ok(hr == DD_OK, "Got hr %#lx.\n", hr); hr = IDirectDraw7_QueryInterface(DDraw7, &IID_IDirectDraw, (void **) &DDraw1); - ok(hr == DD_OK, "IDirectDraw7_QueryInterface returned %08x\n", hr); + ok(hr == DD_OK, "Got hr %#lx.\n", hr);
/* All interfaces now have refcount 1! */ ref = getRefcount( (IUnknown *) DDraw7); @@ -243,7 +242,7 @@ static void test_iface_refcnt(void)
hr = IDirectDraw7_QueryInterface(DDraw7, &IID_IDirect3D7, (void **) &D3D7); ok(hr == DD_OK || hr == E_NOINTERFACE, /* win64 */ - "IDirectDraw7_QueryInterface returned %08x\n", hr); + "IDirectDraw7_QueryInterface returned %#lx\n", hr); if (FAILED(hr)) { IDirectDraw7_Release(DDraw7); @@ -274,31 +273,31 @@ static void test_iface_refcnt(void)
/* Can't get older d3d interfaces. WHY????? */ hr = IDirectDraw7_QueryInterface(DDraw7, &IID_IDirect3D3, (void **) &D3D3); - todo_wine ok(hr == E_NOINTERFACE, "IDirectDraw7_QueryInterface returned %08x\n", hr); + todo_wine ok(hr == E_NOINTERFACE, "Got hr %#lx.\n", hr); if(hr == DD_OK && D3D3) IDirect3D3_Release(D3D3);
hr = IDirectDraw4_QueryInterface(DDraw4, &IID_IDirect3D3, (void **) &D3D3); - todo_wine ok(hr == E_NOINTERFACE, "IDirectDraw4_QueryInterface returned %08x\n", hr); + todo_wine ok(hr == E_NOINTERFACE, "Got hr %#lx.\n", hr); if(hr == DD_OK && D3D3) IDirect3D3_Release(D3D3);
hr = IDirectDraw7_QueryInterface(DDraw7, &IID_IDirect3D2, (void **) &D3D2); - todo_wine ok(hr == E_NOINTERFACE, "IDirectDraw7_QueryInterface returned %08x\n", hr); + todo_wine ok(hr == E_NOINTERFACE, "Got hr %#lx.\n", hr); if(hr == DD_OK && D3D2) IDirect3D2_Release(D3D2);
hr = IDirectDraw2_QueryInterface(DDraw2, &IID_IDirect3D2, (void **) &D3D2); - todo_wine ok(hr == E_NOINTERFACE, "IDirectDraw2_QueryInterface returned %08x\n", hr); + todo_wine ok(hr == E_NOINTERFACE, "Got hr %#lx.\n", hr); if(hr == DD_OK && D3D2) IDirect3D2_Release(D3D2);
hr = IDirectDraw7_QueryInterface(DDraw7, &IID_IDirect3D, (void **) &D3D1); - todo_wine ok(hr == E_NOINTERFACE, "IDirectDraw7_QueryInterface returned %08x\n", hr); + todo_wine ok(hr == E_NOINTERFACE, "Got hr %#lx.\n", hr); if(hr == DD_OK && D3D1) IDirect3D_Release(D3D1);
hr = IDirectDraw_QueryInterface(DDraw1, &IID_IDirect3D, (void **) &D3D1); - todo_wine ok(hr == E_NOINTERFACE, "IDirectDraw_QueryInterface returned %08x\n", hr); + todo_wine ok(hr == E_NOINTERFACE, "Got hr %#lx.\n", hr); if(hr == DD_OK && D3D1) IDirect3D_Release(D3D1);
hr = IDirect3D7_QueryInterface(D3D7, &IID_IDirect3D, (void **) &D3D1); - todo_wine ok(hr == E_NOINTERFACE, "IDirect3D7_QueryInterface returned %08x\n", hr); + todo_wine ok(hr == E_NOINTERFACE, "Got hr %#lx.\n", hr); if(hr == DD_OK && D3D1) IDirect3D_Release(D3D1);
/* Try an AddRef, it only affects the AddRefed interface */ @@ -317,10 +316,10 @@ static void test_iface_refcnt(void)
/* Make sure that they are one object, not different ones */ hr = IDirectDraw4_SetCooperativeLevel(DDraw4, GetDesktopWindow(), DDSCL_EXCLUSIVE | DDSCL_FULLSCREEN); - ok(hr == DD_OK, "IDirectDraw4::SetCooperativeLevel returned %08x\n", hr); + ok(hr == DD_OK, "Got hr %#lx.\n", hr); /* After an window has been set, DDSCL_SETFOCUSWINDOW should return DDERR_HWNDALREADYSET, see the mode test */ hr = IDirectDraw7_SetCooperativeLevel(DDraw7, NULL, DDSCL_SETFOCUSWINDOW); - ok(hr == DDERR_HWNDALREADYSET, "IDirectDraw7::SetCooperativeLevel returned %08x\n", hr); + ok(hr == DDERR_HWNDALREADYSET, "Got hr %#lx.\n", hr);
/* All done, release all interfaces */ IDirectDraw7_Release(DDraw7); @@ -343,17 +342,17 @@ static void test_d3d_ifaces(void) long ref;
hr = DirectDrawCreate(NULL, &DDraw1, NULL); - ok(hr == DD_OK || hr==DDERR_NODIRECTDRAWSUPPORT, "DirectDrawCreateEx returned: %x\n", hr); + ok(hr == DD_OK || hr == DDERR_NODIRECTDRAWSUPPORT, "Got hr %#lx.\n", hr); if(!DDraw1) { - trace("DirectDrawCreate failed with %08x\n", hr); + trace("DirectDrawCreate failed with %#lx\n", hr); return; }
hr = IDirectDraw_QueryInterface(DDraw1, &IID_IDirectDraw2, (void **) &DDraw2); - ok(hr == DD_OK, "IDirectDraw_QueryInterface returned %08x\n", hr); + ok(hr == DD_OK, "Got hr %#lx.\n", hr); hr = IDirectDraw_QueryInterface(DDraw1, &IID_IDirectDraw4, (void **) &DDraw4); - ok(hr == DD_OK, "IDirectDraw_QueryInterface returned %08x\n", hr); + ok(hr == DD_OK, "Got hr %#lx.\n", hr);
ref = getRefcount( (IUnknown *) DDraw4); ok(ref == 1, "IDirectDraw4 reference count is %ld\n", ref); @@ -374,7 +373,7 @@ static void test_d3d_ifaces(void) skip( "no IDirect3D support\n" ); return; } - ok(hr == DD_OK, "IDirectDraw_QueryInterface returned %08x\n", hr); + ok(hr == DD_OK, "Got hr %#lx.\n", hr); ref = getRefcount( (IUnknown *) DDraw4); ok(ref == 1, "IDirectDraw4 reference count is %ld\n", ref); ref = getRefcount( (IUnknown *) DDraw2); @@ -384,7 +383,7 @@ static void test_d3d_ifaces(void) IDirect3D_Release(D3D1);
hr = IDirectDraw2_QueryInterface(DDraw2, &IID_IDirect3D2, (void **) &D3D2); - ok(hr == DD_OK, "IDirectDraw2_QueryInterface returned %08x\n", hr); + ok(hr == DD_OK, "Got hr %#lx.\n", hr); ref = getRefcount( (IUnknown *) DDraw4); ok(ref == 1, "IDirectDraw4 reference count is %ld\n", ref); ref = getRefcount( (IUnknown *) DDraw2); @@ -394,7 +393,7 @@ static void test_d3d_ifaces(void) IDirect3D2_Release(D3D2);
hr = IDirectDraw4_QueryInterface(DDraw4, &IID_IDirect3D3, (void **) &D3D3); - ok(hr == DD_OK, "IDirectDraw4_QueryInterface returned %08x\n", hr); + ok(hr == DD_OK, "Got hr %#lx.\n", hr); ref = getRefcount( (IUnknown *) DDraw4); ok(ref == 1, "IDirectDraw4 reference count is %ld\n", ref); ref = getRefcount( (IUnknown *) DDraw2); @@ -424,35 +423,35 @@ static void test_d3d_ifaces(void) * Except IDirect3D7, it can only be returned by IDirectDraw7(which can't return older ifaces) */ hr = IDirectDraw2_QueryInterface(DDraw2, &IID_IDirect3D, (void **) &D3D1); - ok(hr == DD_OK, "IDirectDraw2_QueryInterface returned %08x\n", hr); + ok(hr == DD_OK, "Got hr %#lx.\n", hr); IDirect3D_Release(D3D1); hr = IDirectDraw4_QueryInterface(DDraw4, &IID_IDirect3D, (void **) &D3D1); - ok(hr == DD_OK, "IDirectDraw4_QueryInterface returned %08x\n", hr); + ok(hr == DD_OK, "Got hr %#lx.\n", hr); IDirect3D_Release(D3D1);
hr = IDirectDraw_QueryInterface(DDraw1, &IID_IDirect3D2, (void **) &D3D2); - ok(hr == DD_OK, "IDirectDraw_QueryInterface returned %08x\n", hr); + ok(hr == DD_OK, "Got hr %#lx.\n", hr); IDirect3D_Release(D3D2); hr = IDirectDraw4_QueryInterface(DDraw4, &IID_IDirect3D2, (void **) &D3D2); - ok(hr == DD_OK, "IDirectDraw4_QueryInterface returned %08x\n", hr); + ok(hr == DD_OK, "Got hr %#lx.\n", hr); IDirect3D_Release(D3D2);
hr = IDirectDraw_QueryInterface(DDraw1, &IID_IDirect3D3, (void **) &D3D3); - ok(hr == DD_OK, "IDirectDraw_QueryInterface returned %08x\n", hr); + ok(hr == DD_OK, "Got hr %#lx.\n", hr); IDirect3D_Release(D3D3); hr = IDirectDraw2_QueryInterface(DDraw2, &IID_IDirect3D3, (void **) &D3D3); - ok(hr == DD_OK, "IDirectDraw2_QueryInterface returned %08x\n", hr); + ok(hr == DD_OK, "Got hr %#lx.\n", hr); IDirect3D_Release(D3D3);
/* This does NOT work */ hr = IDirectDraw_QueryInterface(DDraw1, &IID_IDirect3D7, (void **) &D3D7); - todo_wine ok(hr == E_NOINTERFACE, "IDirectDraw_QueryInterface returned %08x\n", hr); + todo_wine ok(hr == E_NOINTERFACE, "Got hr %#lx.\n", hr); if(D3D7) IDirect3D_Release(D3D7); hr = IDirectDraw2_QueryInterface(DDraw2, &IID_IDirect3D7, (void **) &D3D7); - todo_wine ok(hr == E_NOINTERFACE, "IDirectDraw2_QueryInterface returned %08x\n", hr); + todo_wine ok(hr == E_NOINTERFACE, "Got hr %#lx.\n", hr); if(D3D7) IDirect3D_Release(D3D7); hr = IDirectDraw4_QueryInterface(DDraw4, &IID_IDirect3D7, (void **) &D3D7); - todo_wine ok(hr == E_NOINTERFACE, "IDirectDraw4_QueryInterface returned %08x\n", hr); + todo_wine ok(hr == E_NOINTERFACE, "Got hr %#lx.\n", hr); if(D3D7) IDirect3D_Release(D3D7);
/* Release the interfaces */
From: Zebediah Figura zfigura@codeweavers.com
--- dlls/ddraw/tests/visual.c | 400 +++++++++++++++++++------------------- 1 file changed, 199 insertions(+), 201 deletions(-)
diff --git a/dlls/ddraw/tests/visual.c b/dlls/ddraw/tests/visual.c index 9d81ade34b5..331f16ac57f 100644 --- a/dlls/ddraw/tests/visual.c +++ b/dlls/ddraw/tests/visual.c @@ -19,8 +19,6 @@
/* See comment in dlls/d3d9/tests/visual.c for general guidelines */
-#define WINE_NO_LONG_TYPES - #include "wine/test.h" #include "ddraw.h" #include "d3d.h" @@ -99,7 +97,7 @@ static BOOL createObjects(void) if(!pDirectDrawCreateEx) return FALSE;
hr = pDirectDrawCreateEx(NULL, (void **) &DirectDraw, &IID_IDirectDraw7, NULL); - ok(hr==DD_OK || hr==DDERR_NODIRECTDRAWSUPPORT, "DirectDrawCreateEx returned: %x\n", hr); + ok(hr == DD_OK || hr == DDERR_NODIRECTDRAWSUPPORT, "Got hr %#lx.\n", hr); if(!DirectDraw) goto err;
wc.lpfnWndProc = DefWindowProcA; @@ -109,7 +107,7 @@ static BOOL createObjects(void) 0, 0, 640, 480, 0, 0, 0, 0);
hr = IDirectDraw7_SetCooperativeLevel(DirectDraw, window, DDSCL_EXCLUSIVE | DDSCL_FULLSCREEN); - ok(hr == DD_OK, "IDirectDraw7_SetCooperativeLevel failed with %08x\n", hr); + ok(hr == DD_OK, "Got hr %#lx.\n", hr); if(FAILED(hr)) goto err; hr = IDirectDraw7_SetDisplayMode(DirectDraw, 640, 480, 32, 0, 0); if(FAILED(hr)) { @@ -117,7 +115,7 @@ static BOOL createObjects(void) hr = IDirectDraw7_SetDisplayMode(DirectDraw, 640, 480, 24, 0, 0);
} - ok(hr == DD_OK || hr == DDERR_UNSUPPORTED, "IDirectDraw7_SetDisplayMode failed with %08x\n", hr); + ok(hr == DD_OK || hr == DDERR_UNSUPPORTED, "Got hr %#lx.\n", hr); if(FAILED(hr)) { /* use trace, the caller calls skip() */ trace("SetDisplayMode failed\n"); @@ -126,7 +124,7 @@ static BOOL createObjects(void)
hr = IDirectDraw7_QueryInterface(DirectDraw, &IID_IDirect3D7, (void**) &Direct3D); if (hr == E_NOINTERFACE) goto err; - ok(hr==DD_OK, "QueryInterface returned: %08x\n", hr); + ok(hr == DD_OK, "Got hr %#lx.\n", hr);
/* DirectDraw Flipping behavior doesn't seem that well-defined. The reference rasterizer behaves differently * than hardware implementations. Request single buffering, that seems to work everywhere @@ -140,7 +138,7 @@ static BOOL createObjects(void) if(FAILED(hr)) goto err;
hr = IDirect3D7_EnumDevices(Direct3D, enum_devtype_cb, &hal_ok); - ok(SUCCEEDED(hr), "Failed to enumerate devices, hr %#x.\n", hr); + ok(SUCCEEDED(hr), "Got hr %#lx.\n", hr); if (hal_ok) devtype = &IID_IDirect3DTnLHalDevice;
memset(&zfmt, 0, sizeof(zfmt)); @@ -156,11 +154,11 @@ static BOOL createObjects(void) ddsd.dwWidth = 640; ddsd.dwHeight = 480; hr = IDirectDraw7_CreateSurface(DirectDraw, &ddsd, &depth_buffer, NULL); - ok(SUCCEEDED(hr), "CreateSurface failed, hr %#x.\n", hr); + ok(SUCCEEDED(hr), "Got hr %#lx.\n", hr); if (FAILED(hr)) goto err;
hr = IDirectDrawSurface_AddAttachedSurface(Surface, depth_buffer); - ok(SUCCEEDED(hr), "AddAttachedSurface failed, hr %#x.\n", hr); + ok(SUCCEEDED(hr), "Got hr %#lx.\n", hr); if (FAILED(hr)) goto err;
hr = IDirect3D7_CreateDevice(Direct3D, devtype, Surface, &Direct3DDevice); @@ -206,7 +204,7 @@ static DWORD getPixelColor(IDirect3DDevice7 *device, UINT x, UINT y) ddsd.dwHeight = 480; ddsd.ddsCaps.dwCaps = DDSCAPS_OFFSCREENPLAIN | DDSCAPS_SYSTEMMEMORY; hr = IDirectDraw7_CreateSurface(DirectDraw, &ddsd, &surf, NULL); - ok(hr == DD_OK, "IDirectDraw7_CreateSurface failed with %08x\n", hr); + ok(hr == DD_OK, "Got hr %#lx.\n", hr); if(!surf) { trace("cannot create helper surface\n"); @@ -218,7 +216,7 @@ static DWORD getPixelColor(IDirect3DDevice7 *device, UINT x, UINT y) U4(ddsd).ddpfPixelFormat.dwSize = sizeof(U4(ddsd).ddpfPixelFormat);
hr = IDirectDrawSurface_BltFast(surf, 0, 0, Surface, NULL, 0); - ok(hr == DD_OK, "IDirectDrawSurface7_BltFast returned %08x\n", hr); + ok(hr == DD_OK, "Got hr %#lx.\n", hr); if(FAILED(hr)) { trace("Cannot blit\n"); @@ -229,7 +227,7 @@ static DWORD getPixelColor(IDirect3DDevice7 *device, UINT x, UINT y) hr = IDirectDrawSurface7_Lock(surf, &rectToLock, &ddsd, DDLOCK_READONLY | DDLOCK_WAIT, NULL); if(FAILED(hr)) { - trace("Can't lock the offscreen surface, hr=%08x\n", hr); + trace("Can't lock the offscreen surface, hr %#lx\n", hr); ret = 0xdeadbeec; goto out; } @@ -241,7 +239,7 @@ static DWORD getPixelColor(IDirect3DDevice7 *device, UINT x, UINT y) hr = IDirectDrawSurface7_Unlock(surf, NULL); if(FAILED(hr)) { - trace("Can't unlock the offscreen surface, hr=%08x\n", hr); + trace("Can't unlock the offscreen surface, hr %#lx\n", hr); }
out: @@ -257,25 +255,25 @@ static void set_viewport_size(IDirect3DDevice7 *device) IDirectDrawSurface7 *target;
hr = IDirect3DDevice7_GetRenderTarget(device, &target); - ok(hr == D3D_OK, "IDirect3DDevice7_GetRenderTarget returned %08x\n", hr); + ok(hr == D3D_OK, "Got hr %#lx.\n", hr);
memset(&ddsd, 0, sizeof(ddsd)); ddsd.dwSize = sizeof(ddsd); hr = IDirectDrawSurface7_GetSurfaceDesc(target, &ddsd); - ok(hr == D3D_OK, "IDirectDrawSurface7_GetSurfaceDesc returned %08x\n", hr); + ok(hr == D3D_OK, "Got hr %#lx.\n", hr); IDirectDrawSurface7_Release(target);
vp.dwWidth = ddsd.dwWidth; vp.dwHeight = ddsd.dwHeight; hr = IDirect3DDevice7_SetViewport(device, &vp); - ok(hr == D3D_OK, "IDirect3DDevice7_SetViewport returned %08x\n", hr); + ok(hr == D3D_OK, "Got hr %#lx.\n", hr); return; }
static void fog_test(IDirect3DDevice7 *device) { HRESULT hr; - DWORD color; + unsigned int color; float start = 0.0, end = 1.0; D3DDEVICEDESC7 caps;
@@ -370,66 +368,66 @@ static void fog_test(IDirect3DDevice7 *device)
memset(&caps, 0, sizeof(caps)); hr = IDirect3DDevice7_GetCaps(device, &caps); - ok(hr == D3D_OK, "IDirect3DDevice7_GetCaps returned %08x\n", hr); + ok(hr == D3D_OK, "Got hr %#lx.\n", hr); hr = IDirect3DDevice7_Clear(device, 0, NULL, D3DCLEAR_TARGET, 0xffff00ff, 0.0, 0); - ok(hr == D3D_OK, "IDirect3DDevice7_Clear returned %08x\n", hr); + ok(hr == D3D_OK, "Got 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), "Got 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), "Got hr %#lx.\n", hr); hr = IDirect3DDevice7_SetRenderState(device, D3DRENDERSTATE_LIGHTING, FALSE); - ok(hr == D3D_OK, "Turning off lighting returned %08x\n", hr); + ok(hr == D3D_OK, "Got hr %#lx.\n", hr); hr = IDirect3DDevice7_SetRenderState(device, D3DRENDERSTATE_FOGENABLE, TRUE); - ok(hr == D3D_OK, "Turning on fog calculations returned %08x\n", hr); + ok(hr == D3D_OK, "Got hr %#lx.\n", hr); hr = IDirect3DDevice7_SetRenderState(device, D3DRENDERSTATE_FOGCOLOR, 0xFF00FF00 /* A nice green */); - ok(hr == D3D_OK, "Setting fog color returned %08x\n", hr); + ok(hr == D3D_OK, "Got hr %#lx.\n", hr);
/* First test: Both table fog and vertex fog off */ hr = IDirect3DDevice7_SetRenderState(device, D3DRENDERSTATE_FOGTABLEMODE, D3DFOG_NONE); - ok(hr == D3D_OK, "Turning off table fog returned %08x\n", hr); + ok(hr == D3D_OK, "Got hr %#lx.\n", hr); hr = IDirect3DDevice7_SetRenderState(device, D3DRENDERSTATE_FOGVERTEXMODE, D3DFOG_NONE); - ok(hr == D3D_OK, "Turning off vertex fog returned %08x\n", hr); + ok(hr == D3D_OK, "Got hr %#lx.\n", hr);
/* Start = 0, end = 1. Should be default, but set them */ hr = IDirect3DDevice7_SetRenderState(device, D3DRENDERSTATE_FOGSTART, *((DWORD *) &start)); - ok(hr == D3D_OK, "Setting fog start returned %08x\n", hr); + ok(hr == D3D_OK, "Got hr %#lx.\n", hr); hr = IDirect3DDevice7_SetRenderState(device, D3DRENDERSTATE_FOGEND, *((DWORD *) &end)); - ok(hr == D3D_OK, "Setting fog end returned %08x\n", hr); + ok(hr == D3D_OK, "Got hr %#lx.\n", hr);
if(IDirect3DDevice7_BeginScene(device) == D3D_OK) { /* Untransformed, vertex fog = NONE, table fog = NONE: Read the fog weighting from the specular color */ hr = IDirect3DDevice7_DrawIndexedPrimitive(device, D3DPT_TRIANGLELIST, D3DFVF_XYZ | D3DFVF_DIFFUSE | D3DFVF_SPECULAR, untransformed_1, 4, Indices, 6, 0); - ok(hr == D3D_OK, "DrawIndexedPrimitive returned %08x\n", hr); + ok(hr == D3D_OK, "Got hr %#lx.\n", hr);
/* That makes it use the Z value */ hr = IDirect3DDevice7_SetRenderState(device, D3DRENDERSTATE_FOGVERTEXMODE, D3DFOG_LINEAR); - ok(hr == D3D_OK, "Setting fog vertex mode to D3DFOG_LINEAR returned %08x\n", hr); + ok(hr == D3D_OK, "Got hr %#lx.\n", hr); /* Untransformed, vertex fog != none (or table fog != none): * Use the Z value as input into the equation */ hr = IDirect3DDevice7_DrawIndexedPrimitive(device, D3DPT_TRIANGLELIST, D3DFVF_XYZ | D3DFVF_DIFFUSE | D3DFVF_SPECULAR, untransformed_2, 4, Indices, 6, 0); - ok(hr == D3D_OK, "DrawIndexedPrimitive returned %08x\n", hr); + ok(hr == D3D_OK, "Got hr %#lx.\n", hr);
/* Transformed, vertex fog != NONE, pixel fog == NONE: Use specular color alpha component */ hr = IDirect3DDevice7_DrawIndexedPrimitive(device, D3DPT_TRIANGLELIST, D3DFVF_XYZRHW | D3DFVF_DIFFUSE | D3DFVF_SPECULAR, transformed_1, 4, Indices, 6, 0); - ok(hr == D3D_OK, "DrawIndexedPrimitive returned %08x\n", hr); + ok(hr == D3D_OK, "Got hr %#lx.\n", hr);
hr = IDirect3DDevice7_SetRenderState(device, D3DRENDERSTATE_FOGTABLEMODE, D3DFOG_LINEAR); - ok( hr == D3D_OK, "Setting fog table mode to D3DFOG_LINEAR returned %08x\n", hr); + ok( hr == D3D_OK, "Got hr %#lx.\n", hr); /* Transformed, table fog != none, vertex anything: Use Z value as input to the fog * equation */ hr = IDirect3DDevice7_DrawIndexedPrimitive(device, D3DPT_TRIANGLELIST, D3DFVF_XYZRHW | D3DFVF_DIFFUSE | D3DFVF_SPECULAR, transformed_2, 4, Indices, 6, 0); - ok(hr == D3D_OK, "DrawIndexedPrimitive returned %08x\n", hr); + ok(hr == D3D_OK, "Got hr %#lx.\n", hr);
hr = IDirect3DDevice7_EndScene(device); - ok(hr == D3D_OK, "EndScene returned %08x\n", hr); + ok(hr == D3D_OK, "Got hr %#lx.\n", hr); } else { @@ -461,28 +459,28 @@ static void fog_test(IDirect3DDevice7 *device) { /* A simple fog + non-identity world matrix test */ hr = IDirect3DDevice7_SetTransform(device, D3DTRANSFORMSTATE_WORLD, &world_mat1); - ok(hr == D3D_OK, "IDirect3DDevice7_SetTransform returned %#08x\n", hr); + ok(hr == D3D_OK, "Got hr %#lx.\n", hr);
hr = IDirect3DDevice7_SetRenderState(device, D3DRENDERSTATE_FOGTABLEMODE, D3DFOG_LINEAR); - ok(hr == D3D_OK, "Setting fog table mode to D3DFOG_LINEAR returned %#08x\n", hr); + ok(hr == D3D_OK, "Got hr %#lx.\n", hr); hr = IDirect3DDevice7_SetRenderState(device, D3DRENDERSTATE_FOGVERTEXMODE, D3DFOG_NONE); - ok(hr == D3D_OK, "Turning off vertex fog returned %#08x\n", hr); + ok(hr == D3D_OK, "Got hr %#lx.\n", hr);
hr = IDirect3DDevice7_Clear(device, 0, NULL, D3DCLEAR_TARGET, 0xffff00ff, 0.0, 0); - ok(hr == D3D_OK, "IDirect3DDevice7_Clear returned %#08x\n", hr); + ok(hr == D3D_OK, "Got hr %#lx.\n", hr);
if (IDirect3DDevice7_BeginScene(device) == D3D_OK) { hr = IDirect3DDevice7_DrawIndexedPrimitive(device, D3DPT_TRIANGLELIST, D3DFVF_XYZ | D3DFVF_DIFFUSE | D3DFVF_SPECULAR, far_quad1, 4, Indices, 6, 0); - ok(hr == D3D_OK, "DrawIndexedPrimitive returned %#08x\n", hr); + ok(hr == D3D_OK, "Got hr %#lx.\n", hr);
hr = IDirect3DDevice7_DrawIndexedPrimitive(device, D3DPT_TRIANGLELIST, D3DFVF_XYZ | D3DFVF_DIFFUSE | D3DFVF_SPECULAR, far_quad2, 4, Indices, 6, 0); - ok(hr == D3D_OK, "DrawIndexedPrimitive returned %#08x\n", hr); + ok(hr == D3D_OK, "Got hr %#lx.\n", hr);
hr = IDirect3DDevice7_EndScene(device); - ok(hr == D3D_OK, "EndScene returned %#08x\n", hr); + ok(hr == D3D_OK, "Got hr %#lx.\n", hr); } else { @@ -496,25 +494,25 @@ static void fog_test(IDirect3DDevice7 *device)
/* Test fog behavior with an orthogonal (but not identity) projection matrix */ hr = IDirect3DDevice7_SetTransform(device, D3DTRANSFORMSTATE_WORLD, &world_mat2); - ok(hr == D3D_OK, "SetTransform returned %#08x\n", hr); + ok(hr == D3D_OK, "Got hr %#lx.\n", hr); hr = IDirect3DDevice7_SetTransform(device, D3DTRANSFORMSTATE_PROJECTION, &proj_mat); - ok(hr == D3D_OK, "SetTransform returned %#08x\n", hr); + ok(hr == D3D_OK, "Got hr %#lx.\n", hr);
hr = IDirect3DDevice7_Clear(device, 0, NULL, D3DCLEAR_TARGET, 0xffff00ff, 0.0, 0); - ok(hr == D3D_OK, "Clear returned %#08x\n", hr); + ok(hr == D3D_OK, "Got hr %#lx.\n", hr);
if (IDirect3DDevice7_BeginScene(device) == D3D_OK) { hr = IDirect3DDevice7_DrawIndexedPrimitive(device, D3DPT_TRIANGLELIST, D3DFVF_XYZ | D3DFVF_DIFFUSE | D3DFVF_SPECULAR, untransformed_1, 4, Indices, 6, 0); - ok(hr == D3D_OK, "DrawIndexedPrimitiveUP returned %#08x\n", hr); + ok(hr == D3D_OK, "Got hr %#lx.\n", hr);
hr = IDirect3DDevice7_DrawIndexedPrimitive(device, D3DPT_TRIANGLELIST, D3DFVF_XYZ | D3DFVF_DIFFUSE | D3DFVF_SPECULAR, untransformed_2, 4, Indices, 6, 0); - ok(hr == D3D_OK, "DrawIndexedPrimitiveUP returned %#08x\n", hr); + ok(hr == D3D_OK, "Got hr %#lx.\n", hr);
hr = IDirect3DDevice7_EndScene(device); - ok(hr == D3D_OK, "EndScene returned %#08x\n", hr); + ok(hr == D3D_OK, "Got hr %#lx.\n", hr); } else { @@ -527,9 +525,9 @@ static void fog_test(IDirect3DDevice7 *device) ok(color_match(color, 0x0000ff00, 1), "Fogged out quad has color %08x\n", color);
hr = IDirect3DDevice7_SetTransform(device, D3DTRANSFORMSTATE_WORLD, &ident_mat); - ok(hr == D3D_OK, "SetTransform returned %#08x\n", hr); + ok(hr == D3D_OK, "Got hr %#lx.\n", hr); hr = IDirect3DDevice7_SetTransform(device, D3DTRANSFORMSTATE_PROJECTION, &ident_mat); - ok(hr == D3D_OK, "SetTransform returned %#08x\n", hr); + ok(hr == D3D_OK, "Got hr %#lx.\n", hr); } else { @@ -538,14 +536,14 @@ static void fog_test(IDirect3DDevice7 *device)
/* Turn off the fog master switch to avoid confusing other tests */ hr = IDirect3DDevice7_SetRenderState(device, D3DRENDERSTATE_FOGENABLE, FALSE); - ok(hr == D3D_OK, "Turning off fog calculations returned %08x\n", hr); + ok(hr == D3D_OK, "Got hr %#lx.\n", hr); }
static void offscreen_test(IDirect3DDevice7 *device) { HRESULT hr; IDirectDrawSurface7 *backbuffer = NULL, *offscreen = NULL; - DWORD color; + unsigned int color; DDSURFACEDESC2 ddsd;
static float quad[][5] = { @@ -556,7 +554,7 @@ static void offscreen_test(IDirect3DDevice7 *device) };
hr = IDirect3DDevice7_Clear(device, 0, NULL, D3DCLEAR_TARGET, 0xffff0000, 0.0, 0); - ok(hr == D3D_OK, "Clear failed, hr = %08x\n", hr); + ok(hr == D3D_OK, "Got hr %#lx.\n", hr);
memset(&ddsd, 0, sizeof(ddsd)); ddsd.dwSize = sizeof(ddsd); @@ -566,27 +564,27 @@ static void offscreen_test(IDirect3DDevice7 *device) ddsd.dwHeight = 128; ddsd.ddsCaps.dwCaps = DDSCAPS_TEXTURE | DDSCAPS_3DDEVICE; hr = IDirectDraw7_CreateSurface(DirectDraw, &ddsd, &offscreen, NULL); - ok(hr == D3D_OK, "Creating the offscreen render target failed, hr = %08x\n", hr); + ok(hr == D3D_OK, "Got hr %#lx.\n", hr); if(!offscreen) { goto out; }
hr = IDirect3DDevice7_GetRenderTarget(device, &backbuffer); - ok(hr == D3D_OK, "Can't get back buffer, hr = %08x\n", hr); + ok(hr == D3D_OK, "Got hr %#lx.\n", hr); if(!backbuffer) { goto out; }
hr = IDirect3DDevice7_SetTextureStageState(device, 0, D3DTSS_COLOROP, D3DTOP_SELECTARG1); - ok(hr == D3D_OK, "SetTextureStageState failed, hr = %08x\n", hr); + ok(hr == D3D_OK, "Got hr %#lx.\n", hr); hr = IDirect3DDevice7_SetTextureStageState(device, 0, D3DTSS_COLORARG1, D3DTA_TEXTURE); - ok(hr == D3D_OK, "SetTextureStageState failed, hr = %08x\n", hr); + ok(hr == D3D_OK, "Got hr %#lx.\n", hr); hr = IDirect3DDevice7_SetTextureStageState(device, 0, D3DTSS_MINFILTER, D3DFILTER_NEAREST); - ok(SUCCEEDED(hr), "SetTextureStageState D3DSAMP_MINFILTER failed (0x%08x)\n", hr); + ok(hr == D3D_OK, "Got hr %#lx.\n", hr); hr = IDirect3DDevice7_SetTextureStageState(device, 0, D3DTSS_MAGFILTER, D3DFILTER_NEAREST); - ok(SUCCEEDED(hr), "SetTextureStageState D3DSAMP_MAGFILTER failed (0x%08x)\n", hr); + ok(hr == D3D_OK, "Got hr %#lx.\n", hr); hr = IDirect3DDevice7_SetRenderState(device, D3DRENDERSTATE_LIGHTING, FALSE); - ok(hr == D3D_OK, "IDirect3DDevice7_SetRenderState returned hr = %08x\n", hr); + ok(hr == D3D_OK, "Got hr %#lx.\n", hr);
if (refdevice) { win_skip("Tests would crash on W2K with a refdevice\n"); @@ -595,25 +593,25 @@ static void offscreen_test(IDirect3DDevice7 *device)
if(IDirect3DDevice7_BeginScene(device) == D3D_OK) { hr = IDirect3DDevice7_SetRenderTarget(device, offscreen, 0); - ok(hr == D3D_OK, "SetRenderTarget failed, hr = %08x\n", hr); + ok(hr == D3D_OK, "Got hr %#lx.\n", hr); set_viewport_size(device); hr = IDirect3DDevice7_Clear(device, 0, NULL, D3DCLEAR_TARGET, 0xffff00ff, 0.0, 0); - ok(hr == D3D_OK, "Clear failed, hr = %08x\n", hr); + ok(hr == D3D_OK, "Got hr %#lx.\n", hr);
/* Draw without textures - Should result in a white quad */ hr = IDirect3DDevice7_DrawPrimitive(device, D3DPT_TRIANGLESTRIP, D3DFVF_XYZ | D3DFVF_TEX1, quad, 4, 0); - ok(hr == D3D_OK, "DrawPrimitive failed, hr = %08x\n", hr); + ok(hr == D3D_OK, "Got hr %#lx.\n", hr);
hr = IDirect3DDevice7_SetRenderTarget(device, backbuffer, 0); - ok(hr == D3D_OK, "SetRenderTarget failed, hr = %08x\n", hr); + ok(hr == D3D_OK, "Got hr %#lx.\n", hr); set_viewport_size(device);
hr = IDirect3DDevice7_SetTexture(device, 0, offscreen); - ok(hr == D3D_OK, "SetTexture failed, %08x\n", hr); + ok(hr == D3D_OK, "Got hr %#lx.\n", hr);
/* This time with the texture */ hr = IDirect3DDevice7_DrawPrimitive(device, D3DPT_TRIANGLESTRIP, D3DFVF_XYZ | D3DFVF_TEX1, quad, 4, 0); - ok(hr == D3D_OK, "DrawPrimitive failed, hr = %08x\n", hr); + ok(hr == D3D_OK, "Got hr %#lx.\n", hr);
IDirect3DDevice7_EndScene(device); } @@ -638,12 +636,12 @@ static void offscreen_test(IDirect3DDevice7 *device)
out: hr = IDirect3DDevice7_SetTexture(device, 0, NULL); - ok(SUCCEEDED(hr), "IDirect3DDevice7_SetTexture returned %#x.\n", hr); + ok(SUCCEEDED(hr), "Got hr %#lx.\n", hr);
/* restore things */ if(backbuffer) { hr = IDirect3DDevice7_SetRenderTarget(device, backbuffer, 0); - ok(SUCCEEDED(hr), "IDirect3DDevice7_SetRenderTarget returned %#x.\n", hr); + ok(SUCCEEDED(hr), "Got hr %#lx.\n", hr); IDirectDrawSurface7_Release(backbuffer); } if(offscreen) { @@ -655,7 +653,7 @@ static void test_blend(IDirect3DDevice7 *device) { HRESULT hr; IDirectDrawSurface7 *backbuffer = NULL, *offscreen = NULL; - DWORD color, red, green, blue; + unsigned int color, red, green, blue; DDSURFACEDESC2 ddsd;
struct @@ -686,7 +684,7 @@ static void test_blend(IDirect3DDevice7 *device)
/* Clear the render target with alpha = 0.5 */ hr = IDirect3DDevice7_Clear(device, 0, NULL, D3DCLEAR_TARGET, 0x80ff0000, 0.0, 0); - ok(hr == D3D_OK, "Clear failed, hr = %08x\n", hr); + ok(hr == D3D_OK, "Got hr %#lx.\n", hr);
memset(&ddsd, 0, sizeof(ddsd)); ddsd.dwSize = sizeof(ddsd); @@ -701,27 +699,27 @@ static void test_blend(IDirect3DDevice7 *device) U4(U4(ddsd).ddpfPixelFormat).dwBBitMask = 0x000000ff; U5(U4(ddsd).ddpfPixelFormat).dwRGBAlphaBitMask = 0xff000000; hr = IDirectDraw7_CreateSurface(DirectDraw, &ddsd, &offscreen, NULL); - ok(hr == D3D_OK, "Creating the offscreen render target failed, hr = %08x\n", hr); + ok(hr == D3D_OK, "Got hr %#lx.\n", hr); if(!offscreen) { goto out; } hr = IDirect3DDevice7_GetRenderTarget(device, &backbuffer); - ok(hr == D3D_OK, "Can't get back buffer, hr = %08x\n", hr); + ok(hr == D3D_OK, "Got hr %#lx.\n", hr); if(!backbuffer) { goto out; }
hr = IDirect3DDevice7_SetTextureStageState(device, 0, D3DTSS_COLOROP, D3DTOP_SELECTARG1); - ok(hr == D3D_OK, "SetTextureStageState failed, hr = %08x\n", hr); + ok(hr == D3D_OK, "Got hr %#lx.\n", hr); hr = IDirect3DDevice7_SetTextureStageState(device, 0, D3DTSS_COLORARG1, D3DTA_TEXTURE); - ok(hr == D3D_OK, "SetTextureStageState failed, hr = %08x\n", hr); + ok(hr == D3D_OK, "Got hr %#lx.\n", hr); hr = IDirect3DDevice7_SetTextureStageState(device, 0, D3DTSS_MINFILTER, D3DFILTER_NEAREST); - ok(SUCCEEDED(hr), "SetTextureStageState D3DSAMP_MINFILTER failed (0x%08x)\n", hr); + ok(SUCCEEDED(hr), "Got hr %#lx.\n", hr); hr = IDirect3DDevice7_SetTextureStageState(device, 0, D3DTSS_MAGFILTER, D3DFILTER_NEAREST); - ok(SUCCEEDED(hr), "SetTextureStageState D3DSAMP_MAGFILTER failed (0x%08x)\n", hr); + ok(SUCCEEDED(hr), "Got hr %#lx.\n", hr);
hr = IDirect3DDevice7_SetRenderState(device, D3DRENDERSTATE_ALPHABLENDENABLE, TRUE); - ok(hr == D3D_OK, "IDirect3DDevice7_SetRenderState failed, hr = %08x\n", hr); + ok(hr == D3D_OK, "Got hr %#lx.\n", hr);
if (refdevice) { win_skip("Tests would crash on W2K with a refdevice\n"); @@ -738,18 +736,18 @@ static void test_blend(IDirect3DDevice7 *device) * They give essentially ZERO and ONE blend factors */ hr = IDirect3DDevice7_SetRenderState(device, D3DRENDERSTATE_SRCBLEND, D3DBLEND_SRCALPHA); - ok(hr == D3D_OK, "IDirect3DDevice7_SetRenderState failed, hr = %08x\n", hr); + ok(hr == D3D_OK, "Got hr %#lx.\n", hr); hr = IDirect3DDevice7_SetRenderState(device, D3DRENDERSTATE_DESTBLEND, D3DBLEND_INVSRCALPHA); - ok(hr == D3D_OK, "IDirect3DDevice7_SetRenderState failed, hr = %08x\n", hr); + ok(hr == D3D_OK, "Got hr %#lx.\n", hr); hr = IDirect3DDevice7_DrawPrimitive(device, D3DPT_TRIANGLESTRIP, D3DFVF_XYZ | D3DFVF_DIFFUSE, quad1, 4, 0); - ok(hr == D3D_OK, "DrawPrimitive failed, hr = %08x\n", hr); + ok(hr == D3D_OK, "Got hr %#lx.\n", hr);
hr = IDirect3DDevice7_SetRenderState(device, D3DRENDERSTATE_SRCBLEND, D3DBLEND_DESTALPHA); - ok(hr == D3D_OK, "IDirect3DDevice7_SetRenderState failed, hr = %08x\n", hr); + ok(hr == D3D_OK, "Got hr %#lx.\n", hr); hr = IDirect3DDevice7_SetRenderState(device, D3DRENDERSTATE_DESTBLEND, D3DBLEND_INVDESTALPHA); - ok(hr == D3D_OK, "IDirect3DDevice7_SetRenderState failed, hr = %08x\n", hr); + ok(hr == D3D_OK, "Got hr %#lx.\n", hr); hr = IDirect3DDevice7_DrawPrimitive(device, D3DPT_TRIANGLESTRIP, D3DFVF_XYZ | D3DFVF_DIFFUSE, quad2, 4, 0); - ok(hr == D3D_OK, "DrawPrimitive failed, hr = %08x\n", hr); + ok(hr == D3D_OK, "Got hr %#lx.\n", hr);
/* Switch to the offscreen buffer, and redo the testing. SRCALPHA and DESTALPHA. The offscreen buffer * has an alpha channel on its own. Clear the offscreen buffer with alpha = 0.5 again, then draw the @@ -758,44 +756,44 @@ static void test_blend(IDirect3DDevice7 *device) * vertices */ hr = IDirect3DDevice7_SetRenderTarget(device, offscreen, 0); - ok(hr == D3D_OK, "IDirect3DDevice7_SetRenderTarget failed, hr = %08x\n", hr); + ok(hr == D3D_OK, "Got hr %#lx.\n", hr); set_viewport_size(device); hr = IDirect3DDevice7_Clear(device, 0, NULL, D3DCLEAR_TARGET, 0x80ff0000, 0.0, 0); - ok(hr == D3D_OK, "Clear failed, hr = %08x\n", hr); + ok(hr == D3D_OK, "Got hr %#lx.\n", hr);
hr = IDirect3DDevice7_SetRenderState(device, D3DRENDERSTATE_SRCBLEND, D3DBLEND_SRCALPHA); - ok(hr == D3D_OK, "IDirect3DDevice7_SetRenderState failed, hr = %08x\n", hr); + ok(hr == D3D_OK, "Got hr %#lx.\n", hr); hr = IDirect3DDevice7_SetRenderState(device, D3DRENDERSTATE_DESTBLEND, D3DBLEND_INVSRCALPHA); - ok(hr == D3D_OK, "IDirect3DDevice7_SetRenderState failed, hr = %08x\n", hr); + ok(hr == D3D_OK, "Got hr %#lx.\n", hr); hr = IDirect3DDevice7_DrawPrimitive(device, D3DPT_TRIANGLESTRIP, D3DFVF_XYZ | D3DFVF_DIFFUSE, quad1, 4, 0); - ok(hr == D3D_OK, "DrawPrimitive failed, hr = %08x\n", hr); + ok(hr == D3D_OK, "Got hr %#lx.\n", hr);
hr = IDirect3DDevice7_SetRenderState(device, D3DRENDERSTATE_SRCBLEND, D3DBLEND_DESTALPHA); - ok(hr == D3D_OK, "IDirect3DDevice7_SetRenderState failed, hr = %08x\n", hr); + ok(hr == D3D_OK, "Got hr %#lx.\n", hr); hr = IDirect3DDevice7_SetRenderState(device, D3DRENDERSTATE_DESTBLEND, D3DBLEND_INVDESTALPHA); - ok(hr == D3D_OK, "IDirect3DDevice7_SetRenderState failed, hr = %08x\n", hr); + ok(hr == D3D_OK, "Got hr %#lx.\n", hr); hr = IDirect3DDevice7_DrawPrimitive(device, D3DPT_TRIANGLESTRIP, D3DFVF_XYZ | D3DFVF_DIFFUSE, quad2, 4, 0); - ok(hr == D3D_OK, "DrawPrimitive failed, hr = %08x\n", hr); + ok(hr == D3D_OK, "Got hr %#lx.\n", hr);
hr = IDirect3DDevice7_SetRenderTarget(device, backbuffer, 0); - ok(hr == D3D_OK, "IDirect3DDevice7_SetRenderTarget failed, hr = %08x\n", hr); + ok(hr == D3D_OK, "Got hr %#lx.\n", hr); set_viewport_size(device);
/* Render the offscreen texture onto the frame buffer to be able to compare it regularly. * Disable alpha blending for the final composition */ hr = IDirect3DDevice7_SetRenderState(device, D3DRENDERSTATE_ALPHABLENDENABLE, FALSE); - ok(hr == D3D_OK, "IDirect3DDevice7_SetRenderState failed, hr = %08x\n", hr); + ok(hr == D3D_OK, "Got hr %#lx.\n", hr);
hr = IDirect3DDevice7_SetTexture(device, 0, offscreen); - ok(hr == D3D_OK, "IDirect3DDevice7_SetTexture failed, hr = %08x\n", hr); + ok(hr == D3D_OK, "Got hr %#lx.\n", hr); hr = IDirect3DDevice7_DrawPrimitive(device, D3DPT_TRIANGLESTRIP, D3DFVF_XYZ | D3DFVF_TEX1, composite_quad, 4, 0); - ok(hr == D3D_OK, "DrawPrimitive failed, hr = %08x\n", hr); + ok(hr == D3D_OK, "Got hr %#lx.\n", hr); hr = IDirect3DDevice7_SetTexture(device, 0, NULL); - ok(hr == D3D_OK, "IDirect3DDevice7_SetTexture failed, hr = %08x\n", hr); + ok(hr == D3D_OK, "Got hr %#lx.\n", hr);
hr = IDirect3DDevice7_EndScene(device); - ok(hr == D3D_OK, "IDirect3DDevice7_EndScene failed, hr = %08x\n", hr); + ok(hr == D3D_OK, "Got hr %#lx.\n", hr); }
color = getPixelColor(device, 160, 360); @@ -834,8 +832,8 @@ static void test_blend(IDirect3DDevice7 *device) static void rhw_zero_test(IDirect3DDevice7 *device) { /* Test if it will render a quad correctly when vertex rhw = 0 */ + unsigned int color; HRESULT hr; - DWORD color;
struct { float x, y, z; @@ -851,17 +849,17 @@ static void rhw_zero_test(IDirect3DDevice7 *device)
/* Clear to black */ hr = IDirect3DDevice7_Clear(device, 0, NULL, D3DCLEAR_TARGET, 0, 0.0, 0); - ok(hr == D3D_OK, "Clear failed, hr = %08x\n", hr); + ok(hr == D3D_OK, "Got hr %#lx.\n", hr);
hr = IDirect3DDevice7_BeginScene(device); - ok(hr == D3D_OK, "IDirect3DDevice7_BeginScene failed with %08x\n", hr); + ok(hr == D3D_OK, "Got hr %#lx.\n", hr);
if (SUCCEEDED(hr)) { hr = IDirect3DDevice7_DrawPrimitive(device, D3DPT_TRIANGLESTRIP, D3DFVF_XYZRHW | D3DFVF_DIFFUSE, quad1, 4, 0); - ok(hr == D3D_OK, "DrawPrimitive failed, hr = %08x\n", hr); + ok(hr == D3D_OK, "Got hr %#lx.\n", hr);
hr = IDirect3DDevice7_EndScene(device); - ok(hr == D3D_OK, "IDirect3DDevice7_EndScene failed, hr = %08x\n", hr); + ok(hr == D3D_OK, "Got hr %#lx.\n", hr); }
color = getPixelColor(device, 5, 5); @@ -892,7 +890,7 @@ static DWORD D3D3_getPixelColor(IDirectDraw4 *DirectDraw, IDirectDrawSurface4 *S ddsd.dwHeight = 480; ddsd.ddsCaps.dwCaps = DDSCAPS_OFFSCREENPLAIN | DDSCAPS_SYSTEMMEMORY; hr = IDirectDraw4_CreateSurface(DirectDraw, &ddsd, &surf, NULL); - ok(hr == DD_OK, "IDirectDraw4_CreateSurface failed with %08x\n", hr); + ok(hr == DD_OK, "Got hr %#lx.\n", hr); if(!surf) { trace("cannot create helper surface\n"); @@ -904,7 +902,7 @@ static DWORD D3D3_getPixelColor(IDirectDraw4 *DirectDraw, IDirectDrawSurface4 *S U4(ddsd).ddpfPixelFormat.dwSize = sizeof(U4(ddsd).ddpfPixelFormat);
hr = IDirectDrawSurface4_BltFast(surf, 0, 0, Surface, NULL, 0); - ok(hr == DD_OK, "IDirectDrawSurface_BltFast returned %08x\n", hr); + ok(hr == DD_OK, "Got hr %#lx.\n", hr); if(FAILED(hr)) { trace("Cannot blit\n"); @@ -915,7 +913,7 @@ static DWORD D3D3_getPixelColor(IDirectDraw4 *DirectDraw, IDirectDrawSurface4 *S hr = IDirectDrawSurface4_Lock(surf, &rectToLock, &ddsd, DDLOCK_READONLY | DDLOCK_WAIT, NULL); if(FAILED(hr)) { - trace("Can't lock the offscreen surface, hr=%08x\n", hr); + trace("Can't lock the offscreen surface, hr=%#lx\n", hr); ret = 0xdeadbeec; goto out; } @@ -927,7 +925,7 @@ static DWORD D3D3_getPixelColor(IDirectDraw4 *DirectDraw, IDirectDrawSurface4 *S hr = IDirectDrawSurface4_Unlock(surf, NULL); if(FAILED(hr)) { - trace("Can't unlock the offscreen surface, hr=%08x\n", hr); + trace("Can't unlock the offscreen surface, hr=%#lx\n", hr); }
out: @@ -945,10 +943,10 @@ static void D3D3_ViewportClearTest(void) IDirect3DViewport3 *Viewport3 = NULL; IDirect3DViewport3 *SmallViewport3 = NULL; IDirect3DDevice3 *Direct3DDevice3 = NULL; + unsigned int color, red, green, blue; WNDCLASSA wc = {0}; DDSURFACEDESC2 ddsd; D3DVIEWPORT2 vp_data; - DWORD color, red, green, blue; D3DRECT rect; D3DMATRIX mat = { @@ -980,11 +978,11 @@ static void D3D3_ViewportClearTest(void) WS_MAXIMIZE | WS_VISIBLE | WS_CAPTION, 0, 0, 640, 480, 0, 0, 0, 0);
hr = DirectDrawCreate( NULL, &DirectDraw1, NULL ); - ok(hr==DD_OK || hr==DDERR_NODIRECTDRAWSUPPORT, "DirectDrawCreate returned: %x\n", hr); + ok(hr == DD_OK || hr == DDERR_NODIRECTDRAWSUPPORT, "Got hr %#lx.\n", hr); if(FAILED(hr)) goto out;
hr = IDirectDraw_SetCooperativeLevel(DirectDraw1, window, DDSCL_EXCLUSIVE | DDSCL_FULLSCREEN); - ok(hr==DD_OK, "SetCooperativeLevel returned: %x\n", hr); + ok(hr == DD_OK, "Got hr %#lx.\n", hr); if(FAILED(hr)) goto out;
hr = IDirectDraw_SetDisplayMode(DirectDraw1, 640, 480, 32); @@ -992,11 +990,11 @@ static void D3D3_ViewportClearTest(void) /* 24 bit is fine too */ hr = IDirectDraw_SetDisplayMode(DirectDraw1, 640, 480, 24); } - ok(hr==DD_OK || hr == DDERR_UNSUPPORTED, "SetDisplayMode returned: %x\n", hr); + ok(hr == DD_OK || hr == DDERR_UNSUPPORTED, "Got hr %#lx.\n", hr); if (FAILED(hr)) goto out;
hr = IDirectDraw_QueryInterface(DirectDraw1, &IID_IDirectDraw4, (void**)&DirectDraw4); - ok(hr==DD_OK, "QueryInterface returned: %08x\n", hr); + ok(hr == DD_OK, "Got hr %#lx.\n", hr); if(FAILED(hr)) goto out;
memset(&ddsd, 0, sizeof(DDSURFACEDESC2)); @@ -1005,11 +1003,11 @@ static void D3D3_ViewportClearTest(void) ddsd.ddsCaps.dwCaps = DDSCAPS_PRIMARYSURFACE | DDSCAPS_3DDEVICE;
hr = IDirectDraw4_CreateSurface(DirectDraw4, &ddsd, &Primary, NULL); - ok(hr==DD_OK, "IDirectDraw4_CreateSurface returned: %08x\n", hr); + ok(hr == DD_OK, "Got hr %#lx.\n", hr); if(FAILED(hr)) goto out;
hr = IDirectDraw4_QueryInterface(DirectDraw4, &IID_IDirect3D3, (void**)&Direct3D3); - ok(hr==DD_OK, "IDirectDraw4_QueryInterface returned: %08x\n", hr); + ok(hr == DD_OK, "Got hr %#lx.\n", hr); if(FAILED(hr)) goto out;
hr = IDirect3D3_CreateDevice(Direct3D3, &IID_IDirect3DHALDevice, Primary, &Direct3DDevice3, NULL); @@ -1017,15 +1015,15 @@ static void D3D3_ViewportClearTest(void) trace("Creating a HAL device failed, trying Ref\n"); hr = IDirect3D3_CreateDevice(Direct3D3, &IID_IDirect3DRefDevice, Primary, &Direct3DDevice3, NULL); } - ok(hr==D3D_OK, "Creating 3D device returned: %x\n", hr); + ok(hr == D3D_OK, "Got hr %#lx.\n", hr); if(FAILED(hr)) goto out;
hr = IDirect3D3_CreateViewport(Direct3D3, &Viewport3, NULL); - ok(hr==DD_OK, "IDirect3D3_CreateViewport returned: %08x\n", hr); + ok(hr == DD_OK, "Got hr %#lx.\n", hr); if(FAILED(hr)) goto out;
hr = IDirect3DDevice3_AddViewport(Direct3DDevice3, Viewport3); - ok(hr==DD_OK, "IDirect3DDevice3_AddViewport returned: %08x\n", hr); + ok(hr == DD_OK, "Got hr %#lx.\n", hr);
memset(&vp_data, 0, sizeof(D3DVIEWPORT2)); vp_data.dwSize = sizeof(D3DVIEWPORT2); @@ -1037,14 +1035,14 @@ static void D3D3_ViewportClearTest(void) vp_data.dvClipHeight = 2.0f; vp_data.dvMaxZ = 1.0f; hr = IDirect3DViewport3_SetViewport2(Viewport3, &vp_data); - ok(hr==DD_OK, "IDirect3DViewport3_SetViewport2 returned: %08x\n", hr); + ok(hr == DD_OK, "Got hr %#lx.\n", hr);
hr = IDirect3D3_CreateViewport(Direct3D3, &SmallViewport3, NULL); - ok(hr==DD_OK, "IDirect3D3_CreateViewport returned: %08x\n", hr); + ok(hr == DD_OK, "Got hr %#lx.\n", hr); if(FAILED(hr)) goto out;
hr = IDirect3DDevice3_AddViewport(Direct3DDevice3, SmallViewport3); - ok(hr==DD_OK, "IDirect3DDevice3_AddViewport returned: %08x\n", hr); + ok(hr == DD_OK, "Got hr %#lx.\n", hr);
memset(&vp_data, 0, sizeof(D3DVIEWPORT2)); vp_data.dwSize = sizeof(D3DVIEWPORT2); @@ -1058,33 +1056,33 @@ static void D3D3_ViewportClearTest(void) vp_data.dvClipHeight = 2.0f; vp_data.dvMaxZ = 1.0f; hr = IDirect3DViewport3_SetViewport2(SmallViewport3, &vp_data); - ok(hr==DD_OK, "IDirect3DViewport3_SetViewport2 returned: %08x\n", hr); + ok(hr == DD_OK, "Got hr %#lx.\n", hr);
hr = IDirect3DDevice3_BeginScene(Direct3DDevice3); - ok(hr == D3D_OK, "IDirect3DDevice3_BeginScene failed with %08x\n", hr); + ok(hr == D3D_OK, "Got hr %#lx.\n", hr);
hr = IDirect3DDevice3_SetTransform(Direct3DDevice3, D3DTRANSFORMSTATE_WORLD, &mat); - ok(hr == D3D_OK, "IDirect3DDevice3_SetTransform returned %08x\n", hr); + ok(hr == D3D_OK, "Got hr %#lx.\n", hr); hr = IDirect3DDevice3_SetTransform(Direct3DDevice3, D3DTRANSFORMSTATE_VIEW, &mat); - ok(hr == D3D_OK, "IDirect3DDevice3_SetTransform returned %08x\n", hr); + ok(hr == D3D_OK, "Got hr %#lx.\n", hr); hr = IDirect3DDevice3_SetTransform(Direct3DDevice3, D3DTRANSFORMSTATE_PROJECTION, &mat); - ok(hr == D3D_OK, "IDirect3DDevice3_SetTransform returned %08x\n", hr); + ok(hr == D3D_OK, "Got hr %#lx.\n", hr); hr = IDirect3DDevice3_SetRenderState(Direct3DDevice3, D3DRENDERSTATE_CLIPPING, FALSE); - ok(hr == D3D_OK, "IDirect3DDevice3_SetRenderState returned %08x\n", hr); + ok(hr == D3D_OK, "Got hr %#lx.\n", hr); hr = IDirect3DDevice3_SetRenderState(Direct3DDevice3, D3DRENDERSTATE_ZENABLE, FALSE); - ok(hr == D3D_OK, "IDirect3DDevice3_SetRenderState returned %08x\n", hr); + ok(hr == D3D_OK, "Got hr %#lx.\n", hr); hr = IDirect3DDevice3_SetRenderState(Direct3DDevice3, D3DRENDERSTATE_FOGENABLE, FALSE); - ok(hr == D3D_OK, "IDirect3DDevice3_SetRenderState returned %08x\n", hr); + ok(hr == D3D_OK, "Got hr %#lx.\n", hr); hr = IDirect3DDevice3_SetRenderState(Direct3DDevice3, D3DRENDERSTATE_STENCILENABLE, FALSE); - ok(hr == D3D_OK, "IDirect3DDevice3_SetRenderState returned %08x\n", hr); + ok(hr == D3D_OK, "Got hr %#lx.\n", hr); hr = IDirect3DDevice3_SetRenderState(Direct3DDevice3, D3DRENDERSTATE_ALPHATESTENABLE, FALSE); - ok(hr == D3D_OK, "IDirect3DDevice3_SetRenderState returned %08x\n", hr); + ok(hr == D3D_OK, "Got hr %#lx.\n", hr); hr = IDirect3DDevice3_SetRenderState(Direct3DDevice3, D3DRENDERSTATE_ALPHABLENDENABLE, FALSE); - ok(hr == D3D_OK, "IDirect3DDevice3_SetRenderState returned %08x\n", hr); + ok(hr == D3D_OK, "Got hr %#lx.\n", hr); hr = IDirect3DDevice3_SetRenderState(Direct3DDevice3, D3DRENDERSTATE_CULLMODE, D3DCULL_NONE); - ok(hr == D3D_OK, "IDirect3DDevice3_SetRenderState failed with %08x\n", hr); + ok(hr == D3D_OK, "Got hr %#lx.\n", hr); hr = IDirect3DDevice3_SetRenderState(Direct3DDevice3, D3DRENDERSTATE_LIGHTING, FALSE); - ok(hr == D3D_OK, "IDirect3DDevice3_SetRenderState returned %08x\n", hr); + ok(hr == D3D_OK, "Got hr %#lx.\n", hr);
if (SUCCEEDED(hr)) { U1(rect).x1 = U2(rect).y1 = 0; @@ -1092,13 +1090,13 @@ static void D3D3_ViewportClearTest(void) U4(rect).y2 = 480;
hr = IDirect3DViewport3_Clear2(Viewport3, 1, &rect, D3DCLEAR_TARGET, 0x00ff00, 0.0f, 0); - ok(hr == D3D_OK, "IDirect3DViewport3_Clear2 failed, hr = %08x\n", hr); + ok(hr == D3D_OK, "Got hr %#lx.\n", hr);
hr = IDirect3DViewport3_Clear2(SmallViewport3, 1, &rect, D3DCLEAR_TARGET, 0xff0000, 0.0f, 0); - ok(hr == D3D_OK, "IDirect3DViewport3_Clear2 failed, hr = %08x\n", hr); + ok(hr == D3D_OK, "Got hr %#lx.\n", hr);
hr = IDirect3DDevice3_EndScene(Direct3DDevice3); - ok(hr == D3D_OK, "IDirect3DDevice3_EndScene failed, hr = %08x\n", hr); + ok(hr == D3D_OK, "Got hr %#lx.\n", hr); }
color = D3D3_getPixelColor(DirectDraw4, Primary, 5, 5); @@ -1115,21 +1113,21 @@ static void D3D3_ViewportClearTest(void)
/* Test that clearing viewport doesn't interfere with rendering to previously active viewport. */ hr = IDirect3DDevice3_BeginScene(Direct3DDevice3); - ok(hr == D3D_OK, "IDirect3DDevice3_BeginScene failed with %08x\n", hr); + ok(hr == D3D_OK, "Got hr %#lx.\n", hr);
if (SUCCEEDED(hr)) { hr = IDirect3DDevice3_SetCurrentViewport(Direct3DDevice3, SmallViewport3); - ok(hr == D3D_OK, "IDirect3DDevice3_SetCurrentViewport failed with %08x\n", hr); + ok(hr == D3D_OK, "Got hr %#lx.\n", hr);
hr = IDirect3DViewport3_Clear2(Viewport3, 1, &rect, D3DCLEAR_TARGET, 0x000000, 0.0f, 0); - ok(hr == D3D_OK, "IDirect3DViewport3_Clear2 failed, hr = %08x\n", hr); + ok(hr == D3D_OK, "Got hr %#lx.\n", hr);
hr = IDirect3DDevice3_DrawIndexedPrimitive(Direct3DDevice3, D3DPT_TRIANGLELIST, fvf, quad, 4 /* NumVerts */, Indices, 6 /* Indexcount */, 0 /* flags */); - ok(hr == D3D_OK, "IDirect3DDevice3_DrawIndexedPrimitive failed with %08x\n", hr); + ok(hr == D3D_OK, "Got hr %#lx.\n", hr);
hr = IDirect3DDevice3_EndScene(Direct3DDevice3); - ok(hr == D3D_OK, "IDirect3DDevice3_EndScene failed, hr = %08x\n", hr); + ok(hr == D3D_OK, "Got hr %#lx.\n", hr); }
color = D3D3_getPixelColor(DirectDraw4, Primary, 5, 5); @@ -1163,13 +1161,13 @@ static COLORREF getPixelColor_GDI(IDirectDrawSurface *Surface, UINT x, UINT y) HRESULT hr;
hr = IDirectDrawSurface_GetDC(Surface, &hdc); - ok(hr==DD_OK, "IDirectDrawSurface_GetDC returned: %x\n", hr); + ok(hr == DD_OK, "Got hr %#lx.\n", hr);
if (SUCCEEDED(hr)) { clr = GetPixel(hdc, x, y);
hr = IDirectDrawSurface_ReleaseDC(Surface, hdc); - ok(hr==DD_OK, "IDirectDrawSurface_ReleaseDC returned: %x\n", hr); + ok(hr == DD_OK, "Got hr %#lx.\n", hr); }
return clr; @@ -1182,7 +1180,7 @@ static void cubemap_test(IDirect3DDevice7 *device) IDirectDrawSurface7 *cubemap, *surface; D3DDEVICEDESC7 d3dcaps; HRESULT hr; - DWORD color; + unsigned int color; DDSURFACEDESC2 ddsd; DDBLTFX DDBltFx; DDSCAPS2 caps; @@ -1213,7 +1211,7 @@ static void cubemap_test(IDirect3DDevice7 *device)
memset(&d3dcaps, 0, sizeof(d3dcaps)); hr = IDirect3DDevice7_GetCaps(device, &d3dcaps); - ok(hr == D3D_OK, "IDirect3DDevice7_GetCaps returned %08x\n", hr); + ok(hr == D3D_OK, "Got hr %#lx.\n", hr); if(!(d3dcaps.dpcTriCaps.dwTextureCaps & D3DPTEXTURECAPS_CUBEMAP)) { skip("No cubemap support\n"); @@ -1221,12 +1219,12 @@ static void cubemap_test(IDirect3DDevice7 *device) }
hr = IDirect3DDevice7_Clear(device, 0, NULL, D3DCLEAR_TARGET, 0xff000000, 0.0, 0); - ok(hr == D3D_OK, "IDirect3DDevice7_Clear failed with %08x\n", hr); + ok(hr == D3D_OK, "Got hr %#lx.\n", hr);
hr = IDirect3DDevice7_GetDirect3D(device, &d3d); - ok(hr == D3D_OK, "IDirect3DDevice7_GetDirect3D returned %08x\n", hr); + ok(hr == D3D_OK, "Got hr %#lx.\n", hr); hr = IDirect3D7_QueryInterface(d3d, &IID_IDirectDraw7, (void **) &ddraw); - ok(hr == D3D_OK, "IDirect3D7_QueryInterface returned %08x\n", hr); + ok(hr == D3D_OK, "Got hr %#lx.\n", hr); IDirect3D7_Release(d3d);
@@ -1245,60 +1243,60 @@ static void cubemap_test(IDirect3DDevice7 *device) U4(U4(ddsd).ddpfPixelFormat).dwBBitMask = 0x000000FF;
hr = IDirectDraw7_CreateSurface(ddraw, &ddsd, &cubemap, NULL); - ok(hr == DD_OK, "IDirectDraw7_CreateSurface returned %08x\n", hr); + ok(hr == DD_OK, "Got hr %#lx.\n", hr); IDirectDraw7_Release(ddraw);
/* Positive X */ U5(DDBltFx).dwFillColor = 0x00ff0000; hr = IDirectDrawSurface7_Blt(cubemap, NULL, NULL, NULL, DDBLT_COLORFILL, &DDBltFx); - ok(hr == DD_OK, "IDirectDrawSurface7_Blt returned %08x\n", hr); + ok(hr == DD_OK, "Got hr %#lx.\n", hr);
memset(&caps, 0, sizeof(caps)); caps.dwCaps = DDSCAPS_TEXTURE; caps.dwCaps2 = DDSCAPS2_CUBEMAP | DDSCAPS2_CUBEMAP_NEGATIVEX; hr = IDirectDrawSurface_GetAttachedSurface(cubemap, &caps, &surface); - ok(hr == DD_OK, "IDirectDrawSurface7_Lock returned %08x\n", hr); + ok(hr == DD_OK, "Got hr %#lx.\n", hr); U5(DDBltFx).dwFillColor = 0x0000ffff; hr = IDirectDrawSurface7_Blt(surface, NULL, NULL, NULL, DDBLT_COLORFILL, &DDBltFx); - ok(hr == DD_OK, "IDirectDrawSurface7_Blt returned %08x\n", hr); + ok(hr == DD_OK, "Got hr %#lx.\n", hr);
caps.dwCaps2 = DDSCAPS2_CUBEMAP | DDSCAPS2_CUBEMAP_NEGATIVEZ; hr = IDirectDrawSurface_GetAttachedSurface(cubemap, &caps, &surface); - ok(hr == DD_OK, "IDirectDrawSurface7_Lock returned %08x\n", hr); + ok(hr == DD_OK, "Got hr %#lx.\n", hr); U5(DDBltFx).dwFillColor = 0x0000ff00; hr = IDirectDrawSurface7_Blt(surface, NULL, NULL, NULL, DDBLT_COLORFILL, &DDBltFx); - ok(hr == DD_OK, "IDirectDrawSurface7_Blt returned %08x\n", hr); + ok(hr == DD_OK, "Got hr %#lx.\n", hr);
caps.dwCaps2 = DDSCAPS2_CUBEMAP | DDSCAPS2_CUBEMAP_POSITIVEZ; hr = IDirectDrawSurface_GetAttachedSurface(cubemap, &caps, &surface); - ok(hr == DD_OK, "IDirectDrawSurface7_Lock returned %08x\n", hr); + ok(hr == DD_OK, "Got hr %#lx.\n", hr); U5(DDBltFx).dwFillColor = 0x000000ff; hr = IDirectDrawSurface7_Blt(surface, NULL, NULL, NULL, DDBLT_COLORFILL, &DDBltFx); - ok(hr == DD_OK, "IDirectDrawSurface7_Blt returned %08x\n", hr); + ok(hr == DD_OK, "Got hr %#lx.\n", hr);
caps.dwCaps2 = DDSCAPS2_CUBEMAP | DDSCAPS2_CUBEMAP_NEGATIVEY; hr = IDirectDrawSurface_GetAttachedSurface(cubemap, &caps, &surface); - ok(hr == DD_OK, "IDirectDrawSurface7_Lock returned %08x\n", hr); + ok(hr == DD_OK, "Got hr %#lx.\n", hr); U5(DDBltFx).dwFillColor = 0x00ffff00; hr = IDirectDrawSurface7_Blt(surface, NULL, NULL, NULL, DDBLT_COLORFILL, &DDBltFx); - ok(hr == DD_OK, "IDirectDrawSurface7_Blt returned %08x\n", hr); + ok(hr == DD_OK, "Got hr %#lx.\n", hr);
caps.dwCaps2 = DDSCAPS2_CUBEMAP | DDSCAPS2_CUBEMAP_POSITIVEY; hr = IDirectDrawSurface_GetAttachedSurface(cubemap, &caps, &surface); - ok(hr == DD_OK, "IDirectDrawSurface7_Lock returned %08x\n", hr); + ok(hr == DD_OK, "Got hr %#lx.\n", hr); U5(DDBltFx).dwFillColor = 0x00ff00ff; hr = IDirectDrawSurface7_Blt(surface, NULL, NULL, NULL, DDBLT_COLORFILL, &DDBltFx); - ok(hr == DD_OK, "IDirectDrawSurface7_Blt returned %08x\n", hr); + ok(hr == DD_OK, "Got hr %#lx.\n", hr);
hr = IDirect3DDevice7_SetTexture(device, 0, cubemap); - ok(hr == DD_OK, "IDirect3DDevice7_SetTexture returned %08x\n", hr); + ok(hr == DD_OK, "Got hr %#lx.\n", hr); hr = IDirect3DDevice7_SetTextureStageState(device, 0, D3DTSS_COLOROP, D3DTOP_SELECTARG1); - ok(hr == DD_OK, "IDirect3DDevice7_SetTextureStageState returned %08x\n", hr); + ok(hr == DD_OK, "Got hr %#lx.\n", hr); hr = IDirect3DDevice7_SetTextureStageState(device, 0, D3DTSS_COLORARG1, D3DTA_TEXTURE); - ok(hr == DD_OK, "IDirect3DDevice7_SetTextureStageState returned %08x\n", hr); + ok(hr == DD_OK, "Got hr %#lx.\n", hr);
hr = IDirect3DDevice7_BeginScene(device); - ok(hr == DD_OK, "IDirect3DDevice7_BeginScene returned %08x\n", hr); + ok(hr == DD_OK, "Got hr %#lx.\n", hr); if(SUCCEEDED(hr)) { hr = IDirect3DDevice7_DrawPrimitive(device, D3DPT_TRIANGLESTRIP, D3DFVF_XYZ | D3DFVF_TEXCOORDSIZE3(0) | D3DFVF_TEX1, quad + 0 * 6, 4, 0); @@ -1307,22 +1305,22 @@ static void cubemap_test(IDirect3DDevice7 *device) /* VMware */ win_skip("IDirect3DDevice7_DrawPrimitive is not completely implemented, colors won't be tested\n"); hr = IDirect3DDevice7_EndScene(device); - ok(hr == DD_OK, "IDirect3DDevice7_EndScene returned %08x\n", hr); + ok(hr == DD_OK, "Got hr %#lx.\n", hr); goto out; } - ok(hr == DD_OK, "IDirect3DDevice7_DrawPrimitive returned %08x\n", hr); + ok(hr == DD_OK, "Got hr %#lx.\n", hr); hr = IDirect3DDevice7_DrawPrimitive(device, D3DPT_TRIANGLESTRIP, D3DFVF_XYZ | D3DFVF_TEXCOORDSIZE3(0) | D3DFVF_TEX1, quad + 4 * 6, 4, 0); - ok(hr == DD_OK, "IDirect3DDevice7_DrawPrimitive returned %08x\n", hr); + ok(hr == DD_OK, "Got hr %#lx.\n", hr); hr = IDirect3DDevice7_DrawPrimitive(device, D3DPT_TRIANGLESTRIP, D3DFVF_XYZ | D3DFVF_TEXCOORDSIZE3(0) | D3DFVF_TEX1, quad + 8 * 6, 4, 0); - ok(hr == DD_OK, "IDirect3DDevice7_DrawPrimitive returned %08x\n", hr); + ok(hr == DD_OK, "Got hr %#lx.\n", hr); hr = IDirect3DDevice7_DrawPrimitive(device, D3DPT_TRIANGLESTRIP, D3DFVF_XYZ | D3DFVF_TEXCOORDSIZE3(0) | D3DFVF_TEX1, quad + 12* 6, 4, 0); - ok(hr == DD_OK, "IDirect3DDevice7_DrawPrimitive returned %08x\n", hr); + ok(hr == DD_OK, "Got hr %#lx.\n", hr);
hr = IDirect3DDevice7_EndScene(device); - ok(hr == DD_OK, "IDirect3DDevice7_EndScene returned %08x\n", hr); + ok(hr == DD_OK, "Got hr %#lx.\n", hr); } hr = IDirect3DDevice7_SetTextureStageState(device, 0, D3DTSS_COLOROP, D3DTOP_DISABLE); - ok(hr == DD_OK, "IDirect3DDevice7_SetTextureStageState returned %08x\n", hr); + ok(hr == DD_OK, "Got hr %#lx.\n", hr);
color = getPixelColor(device, 160, 360); /* lower left quad - positivex */ ok(color == 0x00ff0000, "DDSCAPS2_CUBEMAP_POSITIVEX has color 0x%08x, expected 0x00ff0000\n", color); @@ -1335,7 +1333,7 @@ static void cubemap_test(IDirect3DDevice7 *device)
out: hr = IDirect3DDevice7_SetTexture(device, 0, NULL); - ok(hr == DD_OK, "IDirect3DDevice7_SetTexture returned %08x\n", hr); + ok(hr == DD_OK, "Got hr %#lx.\n", hr); IDirectDrawSurface7_Release(cubemap); }
@@ -1404,8 +1402,8 @@ static void depth_clamp_test(IDirect3DDevice7 *device) {{ 1.0f, 0.25f, 10.0f}, 0xfff91414}, };
+ unsigned int color; D3DVIEWPORT7 vp; - D3DCOLOR color; HRESULT hr;
vp.dwX = 0; @@ -1416,50 +1414,50 @@ static void depth_clamp_test(IDirect3DDevice7 *device) vp.dvMaxZ = 7.5;
hr = IDirect3DDevice7_SetViewport(device, &vp); - ok(SUCCEEDED(hr), "SetViewport failed, hr %#x.\n", hr); + ok(SUCCEEDED(hr), "Got hr %#lx.\n", hr);
hr = IDirect3DDevice7_Clear(device, 0, NULL, D3DCLEAR_TARGET | D3DCLEAR_ZBUFFER, 0xff00ff00, 1.0, 0); - ok(SUCCEEDED(hr), "Clear failed, hr %#x.\n", hr); + ok(SUCCEEDED(hr), "Got hr %#lx.\n", hr);
hr = IDirect3DDevice7_SetRenderState(device, D3DRENDERSTATE_CLIPPING, FALSE); - ok(SUCCEEDED(hr), "SetRenderState failed, hr %#x.\n", hr); + ok(SUCCEEDED(hr), "Got hr %#lx.\n", hr); hr = IDirect3DDevice7_SetRenderState(device, D3DRENDERSTATE_LIGHTING, FALSE); - ok(SUCCEEDED(hr), "SetRenderState failed, hr %#x.\n", hr); + ok(SUCCEEDED(hr), "Got hr %#lx.\n", hr); hr = IDirect3DDevice7_SetRenderState(device, D3DRENDERSTATE_ZWRITEENABLE, TRUE); - ok(SUCCEEDED(hr), "SetRenderState failed, hr %#x.\n", hr); + ok(SUCCEEDED(hr), "Got hr %#lx.\n", hr); hr = IDirect3DDevice7_SetRenderState(device, D3DRENDERSTATE_ZFUNC, D3DCMP_LESSEQUAL); - ok(SUCCEEDED(hr), "SetRenderState failed, hr %#x.\n", hr); + ok(SUCCEEDED(hr), "Got hr %#lx.\n", hr);
hr = IDirect3DDevice7_BeginScene(device); - ok(SUCCEEDED(hr), "BeginScene failed, hr %#x.\n", hr); + ok(SUCCEEDED(hr), "Got hr %#lx.\n", hr);
hr = IDirect3DDevice7_DrawPrimitive(device, D3DPT_TRIANGLESTRIP, D3DFVF_XYZRHW | D3DFVF_DIFFUSE, quad1, 4, 0); - ok(SUCCEEDED(hr), "DrawPrimitive failed, hr %#x.\n", hr); + ok(SUCCEEDED(hr), "Got hr %#lx.\n", hr); hr = IDirect3DDevice7_DrawPrimitive(device, D3DPT_TRIANGLESTRIP, D3DFVF_XYZRHW | D3DFVF_DIFFUSE, quad2, 4, 0); - ok(SUCCEEDED(hr), "DrawPrimitive failed, hr %#x.\n", hr); + ok(SUCCEEDED(hr), "Got hr %#lx.\n", hr);
hr = IDirect3DDevice7_SetRenderState(device, D3DRENDERSTATE_CLIPPING, TRUE); - ok(SUCCEEDED(hr), "SetRenderState failed, hr %#x.\n", hr); + ok(SUCCEEDED(hr), "Got hr %#lx.\n", hr);
hr = IDirect3DDevice7_DrawPrimitive(device, D3DPT_TRIANGLESTRIP, D3DFVF_XYZRHW | D3DFVF_DIFFUSE, quad3, 4, 0); - ok(SUCCEEDED(hr), "DrawPrimitive failed, hr %#x.\n", hr); + ok(SUCCEEDED(hr), "Got hr %#lx.\n", hr); hr = IDirect3DDevice7_DrawPrimitive(device, D3DPT_TRIANGLESTRIP, D3DFVF_XYZRHW | D3DFVF_DIFFUSE, quad4, 4, 0); - ok(SUCCEEDED(hr), "DrawPrimitive failed, hr %#x.\n", hr); + ok(SUCCEEDED(hr), "Got hr %#lx.\n", hr);
hr = IDirect3DDevice7_SetRenderState(device, D3DRENDERSTATE_CLIPPING, FALSE); - ok(SUCCEEDED(hr), "SetRenderState failed, hr %#x.\n", hr); + ok(SUCCEEDED(hr), "Got hr %#lx.\n", hr);
hr = IDirect3DDevice7_DrawPrimitive(device, D3DPT_TRIANGLESTRIP, D3DFVF_XYZ | D3DFVF_DIFFUSE, quad5, 4, 0); - ok(SUCCEEDED(hr), "DrawPrimitive failed, hr %#x.\n", hr); + ok(SUCCEEDED(hr), "Got hr %#lx.\n", hr);
hr = IDirect3DDevice7_SetRenderState(device, D3DRENDERSTATE_CLIPPING, TRUE); - ok(SUCCEEDED(hr), "SetRenderState failed, hr %#x.\n", hr); + ok(SUCCEEDED(hr), "Got hr %#lx.\n", hr);
hr = IDirect3DDevice7_DrawPrimitive(device, D3DPT_TRIANGLESTRIP, D3DFVF_XYZ | D3DFVF_DIFFUSE, quad6, 4, 0); - ok(SUCCEEDED(hr), "DrawPrimitive failed, hr %#x.\n", hr); + ok(SUCCEEDED(hr), "Got hr %#lx.\n", hr);
hr = IDirect3DDevice7_EndScene(device); - ok(SUCCEEDED(hr), "EndScene failed, hr %#x.\n", hr); + ok(SUCCEEDED(hr), "Got hr %#lx.\n", hr);
color = getPixelColor(device, 75, 75); ok(color_match(color, 0x00ffffff, 1) || color_match(color, 0x0000ff00, 1), "color 0x%08x.\n", color); @@ -1475,7 +1473,7 @@ static void depth_clamp_test(IDirect3DDevice7 *device) vp.dvMinZ = 0.0; vp.dvMaxZ = 1.0; hr = IDirect3DDevice7_SetViewport(device, &vp); - ok(SUCCEEDED(hr), "SetViewport failed, hr %#x.\n", hr); + ok(SUCCEEDED(hr), "Got hr %#lx.\n", hr); }
static void DX1_BackBufferFlipTest(void) @@ -1499,11 +1497,11 @@ static void DX1_BackBufferFlipTest(void) WS_MAXIMIZE | WS_VISIBLE | WS_CAPTION, 0, 0, 640, 480, 0, 0, 0, 0);
hr = DirectDrawCreate( NULL, &DirectDraw1, NULL ); - ok(hr==DD_OK || hr==DDERR_NODIRECTDRAWSUPPORT, "DirectDrawCreate returned: %x\n", hr); + ok(hr == DD_OK || hr == DDERR_NODIRECTDRAWSUPPORT, "Got hr %#lx.\n", hr); if(FAILED(hr)) goto out;
hr = IDirectDraw_SetCooperativeLevel(DirectDraw1, window, DDSCL_EXCLUSIVE | DDSCL_FULLSCREEN); - ok(hr==DD_OK, "SetCooperativeLevel returned: %x\n", hr); + ok(hr == DD_OK, "Got hr %#lx.\n", hr); if(FAILED(hr)) goto out;
hr = IDirectDraw_SetDisplayMode(DirectDraw1, 640, 480, 32); @@ -1511,7 +1509,7 @@ static void DX1_BackBufferFlipTest(void) /* 24 bit is fine too */ hr = IDirectDraw_SetDisplayMode(DirectDraw1, 640, 480, 24); } - ok(hr==DD_OK || hr == DDERR_UNSUPPORTED, "SetDisplayMode returned: %x\n", hr); + ok(hr == DD_OK || hr == DDERR_UNSUPPORTED, "Got hr %#lx.\n", hr); if (FAILED(hr)) { goto out; } @@ -1522,7 +1520,7 @@ static void DX1_BackBufferFlipTest(void) ddsd.ddsCaps.dwCaps = DDSCAPS_PRIMARYSURFACE;
hr = IDirectDraw_CreateSurface(DirectDraw1, &ddsd, &Primary, NULL); - ok(hr==DD_OK, "IDirectDraw_CreateSurface returned: %08x\n", hr); + ok(hr == DD_OK, "Got hr %#lx.\n", hr);
memset(&ddsd, 0, sizeof(DDSURFACEDESC)); ddsd.dwSize = sizeof(DDSURFACEDESC); @@ -1538,12 +1536,11 @@ static void DX1_BackBufferFlipTest(void) U4(ddsd.ddpfPixelFormat).dwBBitMask = 0x000000ff;
hr = IDirectDraw_CreateSurface(DirectDraw1, &ddsd, &Backbuffer, NULL); - ok(hr==DD_OK, "IDirectDraw_CreateSurface returned: %08x\n", hr); + ok(hr == DD_OK, "Got hr %#lx.\n", hr); if(FAILED(hr)) goto out;
hr = IDirectDrawSurface_AddAttachedSurface(Primary, Backbuffer); - todo_wine ok(hr == DD_OK || broken(hr == DDERR_CANNOTATTACHSURFACE), - "Attaching a back buffer to a front buffer returned %08x\n", hr); + todo_wine ok(hr == DD_OK || broken(hr == DDERR_CANNOTATTACHSURFACE), "Got hr %#lx.\n", hr); if (FAILED(hr)) goto out;
attached = TRUE; @@ -1552,11 +1549,11 @@ static void DX1_BackBufferFlipTest(void) ddbltfx.dwSize = sizeof(ddbltfx); U5(ddbltfx).dwFillColor = red; hr = IDirectDrawSurface_Blt(Backbuffer, NULL, NULL, NULL, DDBLT_COLORFILL | DDBLT_WAIT, &ddbltfx); - ok(hr == DD_OK, "IDirectDrawSurface_Blt returned: %x\n", hr); + ok(hr == DD_OK, "Got hr %#lx.\n", hr);
U5(ddbltfx).dwFillColor = white; hr = IDirectDrawSurface_Blt(Primary, NULL, NULL, NULL, DDBLT_COLORFILL | DDBLT_WAIT, &ddbltfx); - ok(hr == DD_OK, "IDirectDrawSurface_Blt returned: %x\n", hr); + ok(hr == DD_OK, "Got hr %#lx.\n", hr);
/* Check it out */ color = getPixelColor_GDI(Primary, 5, 5); @@ -1570,7 +1567,7 @@ static void DX1_BackBufferFlipTest(void) GetRValue(color), GetGValue(color), GetBValue(color));
hr = IDirectDrawSurface_Flip(Primary, NULL, DDFLIP_WAIT); - todo_wine ok(hr == DD_OK, "IDirectDrawSurface_Flip returned 0x%08x\n", hr); + todo_wine ok(hr == DD_OK, "Got hr %#lx.\n", hr);
if (hr == DD_OK) { @@ -1601,8 +1598,9 @@ static void DX1_BackBufferFlipTest(void)
START_TEST(visual) { + unsigned int color; HRESULT hr; - DWORD color; + if(!createObjects()) { skip("Cannot initialize DirectDraw and Direct3D, skipping\n");