ddraw/tests: Win64 printf format warning fixes.

This commit is contained in:
H. Verbeet 2006-10-10 19:23:33 +02:00 committed by Alexandre Julliard
parent cb4ad6e52c
commit 37cb9de851
5 changed files with 144 additions and 145 deletions

View File

@ -5,7 +5,6 @@ VPATH = @srcdir@
TESTDLL = ddraw.dll
IMPORTS = ddraw user32 gdi32 kernel32
EXTRALIBS = -ldxguid
EXTRADEFS = -DWINE_NO_LONG_AS_INT
CTESTS = \
d3d.c \

View File

@ -68,18 +68,18 @@ static BOOL CreateDirect3D(void)
rc = pDirectDrawCreateEx(NULL, (void**)&lpDD,
&IID_IDirectDraw7, NULL);
ok(rc==DD_OK || rc==DDERR_NODIRECTDRAWSUPPORT, "DirectDrawCreateEx returned: %lx\n", rc);
ok(rc==DD_OK || rc==DDERR_NODIRECTDRAWSUPPORT, "DirectDrawCreateEx returned: %x\n", rc);
if (!lpDD) {
trace("DirectDrawCreateEx() failed with an error %lx\n", rc);
trace("DirectDrawCreateEx() failed with an error %x\n", rc);
return FALSE;
}
rc = IDirectDraw_SetCooperativeLevel(lpDD, NULL, DDSCL_NORMAL);
ok(rc==DD_OK, "SetCooperativeLevel returned: %lx\n", rc);
ok(rc==DD_OK, "SetCooperativeLevel returned: %x\n", rc);
rc = IDirectDraw7_QueryInterface(lpDD, &IID_IDirect3D7, (void**) &lpD3D);
if (rc == E_NOINTERFACE) return FALSE;
ok(rc==DD_OK, "QueryInterface returned: %lx\n", rc);
ok(rc==DD_OK, "QueryInterface returned: %x\n", rc);
memset(&ddsd, 0, sizeof(ddsd));
ddsd.dwSize = sizeof(ddsd);
@ -88,13 +88,13 @@ static BOOL CreateDirect3D(void)
ddsd.dwWidth = 256;
ddsd.dwHeight = 256;
rc = IDirectDraw7_CreateSurface(lpDD, &ddsd, &lpDDS, NULL);
ok(rc==DD_OK, "CreateSurface returned: %lx\n", rc);
ok(rc==DD_OK, "CreateSurface returned: %x\n", rc);
rc = IDirect3D7_CreateDevice(lpD3D, &IID_IDirect3DTnLHalDevice, lpDDS,
&lpD3DDevice);
ok(rc==D3D_OK || rc==DDERR_NOPALETTEATTACHED || rc==E_OUTOFMEMORY, "CreateDevice returned: %lx\n", rc);
ok(rc==D3D_OK || rc==DDERR_NOPALETTEATTACHED || rc==E_OUTOFMEMORY, "CreateDevice returned: %x\n", rc);
if (!lpD3DDevice) {
trace("IDirect3D7::CreateDevice() failed with an error %lx\n", rc);
trace("IDirect3D7::CreateDevice() failed with an error %x\n", rc);
return FALSE;
}
@ -144,29 +144,29 @@ static void LightTest(void)
U2(light.dvDirection).y = 1.f;
rc = IDirect3DDevice7_SetLight(lpD3DDevice, 5, &light);
ok(rc==D3D_OK, "SetLight returned: %lx\n", rc);
ok(rc==D3D_OK, "SetLight returned: %x\n", rc);
rc = IDirect3DDevice7_SetLight(lpD3DDevice, 10, &light);
ok(rc==D3D_OK, "SetLight returned: %lx\n", rc);
ok(rc==D3D_OK, "SetLight returned: %x\n", rc);
rc = IDirect3DDevice7_SetLight(lpD3DDevice, 45, &light);
ok(rc==D3D_OK, "SetLight returned: %lx\n", rc);
ok(rc==D3D_OK, "SetLight returned: %x\n", rc);
/* Try to retrieve a light beyond the indices of the lights that have
been set. */
rc = IDirect3DDevice7_GetLight(lpD3DDevice, 50, &light);
ok(rc==DDERR_INVALIDPARAMS, "GetLight returned: %lx\n", rc);
ok(rc==DDERR_INVALIDPARAMS, "GetLight returned: %x\n", rc);
rc = IDirect3DDevice7_GetLight(lpD3DDevice, 2, &light);
ok(rc==DDERR_INVALIDPARAMS, "GetLight returned: %lx\n", rc);
ok(rc==DDERR_INVALIDPARAMS, "GetLight returned: %x\n", rc);
/* Try to retrieve one of the lights that have been set */
rc = IDirect3DDevice7_GetLight(lpD3DDevice, 10, &light);
ok(rc==D3D_OK, "GetLight returned: %lx\n", rc);
ok(rc==D3D_OK, "GetLight returned: %x\n", rc);
/* Enable a light that have been previously set. */
rc = IDirect3DDevice7_LightEnable(lpD3DDevice, 10, TRUE);
ok(rc==D3D_OK, "LightEnable returned: %lx\n", rc);
ok(rc==D3D_OK, "LightEnable returned: %x\n", rc);
/* Enable some lights that have not been previously set, and verify that
@ -179,45 +179,45 @@ static void LightTest(void)
U3(defaultlight.dvDirection).z = 1.f;
rc = IDirect3DDevice7_LightEnable(lpD3DDevice, 20, TRUE);
ok(rc==D3D_OK, "LightEnable returned: %lx\n", rc);
ok(rc==D3D_OK, "LightEnable returned: %x\n", rc);
memset(&light, 0, sizeof(D3DLIGHT7));
rc = IDirect3DDevice7_GetLight(lpD3DDevice, 20, &light);
ok(rc==D3D_OK, "GetLight returned: %lx\n", rc);
ok(rc==D3D_OK, "GetLight returned: %x\n", rc);
ok(!memcmp(&light, &defaultlight, sizeof(D3DLIGHT7)),
"light data doesn't match expected default values\n" );
rc = IDirect3DDevice7_LightEnable(lpD3DDevice, 50, TRUE);
ok(rc==D3D_OK, "LightEnable returned: %lx\n", rc);
ok(rc==D3D_OK, "LightEnable returned: %x\n", rc);
memset(&light, 0, sizeof(D3DLIGHT7));
rc = IDirect3DDevice7_GetLight(lpD3DDevice, 50, &light);
ok(rc==D3D_OK, "GetLight returned: %lx\n", rc);
ok(rc==D3D_OK, "GetLight returned: %x\n", rc);
ok(!memcmp(&light, &defaultlight, sizeof(D3DLIGHT7)),
"light data doesn't match expected default values\n" );
/* Disable one of the light that have been previously enabled. */
rc = IDirect3DDevice7_LightEnable(lpD3DDevice, 20, FALSE);
ok(rc==D3D_OK, "LightEnable returned: %lx\n", rc);
ok(rc==D3D_OK, "LightEnable returned: %x\n", rc);
/* Try to retrieve the enable status of some lights */
/* Light 20 is supposed to be disabled */
rc = IDirect3DDevice7_GetLightEnable(lpD3DDevice, 20, &bEnabled );
ok(rc==D3D_OK, "GetLightEnable returned: %lx\n", rc);
ok(rc==D3D_OK, "GetLightEnable returned: %x\n", rc);
ok(!bEnabled, "GetLightEnable says the light is enabled\n");
/* Light 10 is supposed to be enabled */
bEnabled = FALSE;
rc = IDirect3DDevice7_GetLightEnable(lpD3DDevice, 10, &bEnabled );
ok(rc==D3D_OK, "GetLightEnable returned: %lx\n", rc);
ok(rc==D3D_OK, "GetLightEnable returned: %x\n", rc);
ok(bEnabled, "GetLightEnable says the light is disabled\n");
/* Light 80 has not been set */
rc = IDirect3DDevice7_GetLightEnable(lpD3DDevice, 80, &bEnabled );
ok(rc==DDERR_INVALIDPARAMS, "GetLightEnable returned: %lx\n", rc);
ok(rc==DDERR_INVALIDPARAMS, "GetLightEnable returned: %x\n", rc);
/* Light 23 has not been set */
rc = IDirect3DDevice7_GetLightEnable(lpD3DDevice, 23, &bEnabled );
ok(rc==DDERR_INVALIDPARAMS, "GetLightEnable returned: %lx\n", rc);
ok(rc==DDERR_INVALIDPARAMS, "GetLightEnable returned: %x\n", rc);
}
static void ProcessVerticesTest(void)
@ -250,10 +250,10 @@ static void ProcessVerticesTest(void)
desc.dwFVF = D3DFVF_XYZ;
desc.dwNumVertices = 16;
rc = IDirect3D7_CreateVertexBuffer(lpD3D, &desc, &lpVBufSrc, 0);
ok(rc==D3D_OK || rc==E_OUTOFMEMORY, "CreateVertexBuffer returned: %lx\n", rc);
ok(rc==D3D_OK || rc==E_OUTOFMEMORY, "CreateVertexBuffer returned: %x\n", rc);
if (!lpVBufSrc)
{
trace("IDirect3D7::CreateVertexBuffer() failed with an error %lx\n", rc);
trace("IDirect3D7::CreateVertexBuffer() failed with an error %x\n", rc);
goto out;
}
@ -264,10 +264,10 @@ static void ProcessVerticesTest(void)
desc.dwNumVertices = 16;
/* Msdn says that the last parameter must be 0 - check that */
rc = IDirect3D7_CreateVertexBuffer(lpD3D, &desc, &lpVBufDest1, 4);
ok(rc==D3D_OK || rc==E_OUTOFMEMORY, "CreateVertexBuffer returned: %lx\n", rc);
ok(rc==D3D_OK || rc==E_OUTOFMEMORY, "CreateVertexBuffer returned: %x\n", rc);
if (!lpVBufDest1)
{
trace("IDirect3D7::CreateVertexBuffer() failed with an error %lx\n", rc);
trace("IDirect3D7::CreateVertexBuffer() failed with an error %x\n", rc);
goto out;
}
@ -278,15 +278,15 @@ static void ProcessVerticesTest(void)
desc.dwNumVertices = 16;
/* Msdn says that the last parameter must be 0 - check that */
rc = IDirect3D7_CreateVertexBuffer(lpD3D, &desc, &lpVBufDest2, 12345678);
ok(rc==D3D_OK || rc==E_OUTOFMEMORY, "CreateVertexBuffer returned: %lx\n", rc);
ok(rc==D3D_OK || rc==E_OUTOFMEMORY, "CreateVertexBuffer returned: %x\n", rc);
if (!lpVBufDest2)
{
trace("IDirect3D7::CreateVertexBuffer() failed with an error %lx\n", rc);
trace("IDirect3D7::CreateVertexBuffer() failed with an error %x\n", rc);
goto out;
}
rc = IDirect3DVertexBuffer7_Lock(lpVBufSrc, 0, (void **) &in, NULL);
ok(rc==D3D_OK , "IDirect3DVertexBuffer::Lock returned: %lx\n", rc);
ok(rc==D3D_OK , "IDirect3DVertexBuffer::Lock returned: %x\n", rc);
if(!in) goto out;
/* Check basic transformation */
@ -307,16 +307,16 @@ static void ProcessVerticesTest(void)
in[3].y = -0.5;
in[3].z = 0.25;
rc = IDirect3DVertexBuffer7_Unlock(lpVBufSrc);
ok(rc==D3D_OK , "IDirect3DVertexBuffer::Unlock returned: %lx\n", rc);
ok(rc==D3D_OK , "IDirect3DVertexBuffer::Unlock returned: %x\n", rc);
rc = IDirect3DVertexBuffer7_ProcessVertices(lpVBufDest1, D3DVOP_TRANSFORM, 0, 4, lpVBufSrc, 0, lpD3DDevice, 0);
ok(rc==D3D_OK , "IDirect3DVertexBuffer::ProcessVertices returned: %lx\n", rc);
ok(rc==D3D_OK , "IDirect3DVertexBuffer::ProcessVertices returned: %x\n", rc);
rc = IDirect3DVertexBuffer7_ProcessVertices(lpVBufDest2, D3DVOP_TRANSFORM, 0, 4, lpVBufSrc, 0, lpD3DDevice, 0);
ok(rc==D3D_OK , "IDirect3DVertexBuffer::ProcessVertices returned: %lx\n", rc);
ok(rc==D3D_OK , "IDirect3DVertexBuffer::ProcessVertices returned: %x\n", rc);
rc = IDirect3DVertexBuffer7_Lock(lpVBufDest1, 0, (void **) &out, NULL);
ok(rc==D3D_OK , "IDirect3DVertexBuffer::Lock returned: %lx\n", rc);
ok(rc==D3D_OK , "IDirect3DVertexBuffer::Lock returned: %x\n", rc);
if(!out) goto out;
/* Check the results */
@ -345,11 +345,11 @@ static void ProcessVerticesTest(void)
"Output 3 vertex is (%f , %f , %f , %f)\n", out[3].x, out[3].y, out[3].z, out[3].rhw);
rc = IDirect3DVertexBuffer7_Unlock(lpVBufDest1);
ok(rc==D3D_OK , "IDirect3DVertexBuffer::Unlock returned: %lx\n", rc);
ok(rc==D3D_OK , "IDirect3DVertexBuffer::Unlock returned: %x\n", rc);
out = NULL;
rc = IDirect3DVertexBuffer7_Lock(lpVBufDest2, 0, (void **) &out2, NULL);
ok(rc==D3D_OK , "IDirect3DVertexBuffer::Lock returned: %lx\n", rc);
ok(rc==D3D_OK , "IDirect3DVertexBuffer::Lock returned: %x\n", rc);
if(!out2) goto out;
/* Small thing without much practial meaning, but I stumbled upon it,
* so let's check for it: If the output vertex buffer has to RHW value,
@ -361,7 +361,7 @@ static void ProcessVerticesTest(void)
"Output 4 vertex is (%f , %f , %f)\n", out2[4].x, out2[4].y, out2[4].z);
rc = IDirect3DVertexBuffer7_Unlock(lpVBufDest2);
ok(rc==D3D_OK , "IDirect3DVertexBuffer::Unlock returned: %lx\n", rc);
ok(rc==D3D_OK , "IDirect3DVertexBuffer::Unlock returned: %x\n", rc);
out = NULL;
/* Try a more complicated viewport, same vertices */
@ -373,14 +373,14 @@ static void ProcessVerticesTest(void)
vp.dvMinZ = -2.0;
vp.dvMaxZ = 4.0;
rc = IDirect3DDevice7_SetViewport(lpD3DDevice, &vp);
ok(rc==D3D_OK, "IDirect3DDevice7_SetViewport failed with rc=%lx\n", rc);
ok(rc==D3D_OK, "IDirect3DDevice7_SetViewport failed with rc=%x\n", rc);
/* Process again */
rc = IDirect3DVertexBuffer7_ProcessVertices(lpVBufDest1, D3DVOP_TRANSFORM, 0, 4, lpVBufSrc, 0, lpD3DDevice, 0);
ok(rc==D3D_OK , "IDirect3DVertexBuffer::ProcessVertices returned: %lx\n", rc);
ok(rc==D3D_OK , "IDirect3DVertexBuffer::ProcessVertices returned: %x\n", rc);
rc = IDirect3DVertexBuffer7_Lock(lpVBufDest1, 0, (void **) &out, NULL);
ok(rc==D3D_OK , "IDirect3DVertexBuffer::Lock returned: %lx\n", rc);
ok(rc==D3D_OK , "IDirect3DVertexBuffer::Lock returned: %x\n", rc);
if(!out) goto out;
/* Check the results */
@ -409,7 +409,7 @@ static void ProcessVerticesTest(void)
"Output 3 vertex is (%f , %f , %f , %f)\n", out[3].x, out[3].y, out[3].z, out[3].rhw);
rc = IDirect3DVertexBuffer7_Unlock(lpVBufDest1);
ok(rc==D3D_OK , "IDirect3DVertexBuffer::Unlock returned: %lx\n", rc);
ok(rc==D3D_OK , "IDirect3DVertexBuffer::Unlock returned: %x\n", rc);
out = NULL;
/* Play with some matrices. */
@ -424,10 +424,10 @@ static void ProcessVerticesTest(void)
ok(rc==D3D_OK, "IDirect3DDevice7_SetTransform failed\n");
rc = IDirect3DVertexBuffer7_ProcessVertices(lpVBufDest1, D3DVOP_TRANSFORM, 0, 4, lpVBufSrc, 0, lpD3DDevice, 0);
ok(rc==D3D_OK , "IDirect3DVertexBuffer::ProcessVertices returned: %lx\n", rc);
ok(rc==D3D_OK , "IDirect3DVertexBuffer::ProcessVertices returned: %x\n", rc);
rc = IDirect3DVertexBuffer7_Lock(lpVBufDest1, 0, (void **) &out, NULL);
ok(rc==D3D_OK , "IDirect3DVertexBuffer::Lock returned: %lx\n", rc);
ok(rc==D3D_OK , "IDirect3DVertexBuffer::Lock returned: %x\n", rc);
if(!out) goto out;
/* Keep the viewport simpler, otherwise we get bad numbers to compare */
@ -466,7 +466,7 @@ static void ProcessVerticesTest(void)
"Output 3 vertex is (%f , %f , %f , %f)\n", out[3].x, out[3].y, out[3].z, out[3].rhw);
rc = IDirect3DVertexBuffer7_Unlock(lpVBufDest1);
ok(rc==D3D_OK , "IDirect3DVertexBuffer::Unlock returned: %lx\n", rc);
ok(rc==D3D_OK , "IDirect3DVertexBuffer::Unlock returned: %x\n", rc);
out = NULL;
out:

View File

@ -71,9 +71,9 @@ static BOOL createdirectdraw(void)
HRESULT rc;
rc = DirectDrawCreate(NULL, &lpDD, NULL);
ok(rc==DD_OK || rc==DDERR_NODIRECTDRAWSUPPORT, "DirectDrawCreateEx returned: %lx\n", rc);
ok(rc==DD_OK || rc==DDERR_NODIRECTDRAWSUPPORT, "DirectDrawCreateEx returned: %x\n", rc);
if (!lpDD) {
trace("DirectDrawCreateEx() failed with an error %lx\n", rc);
trace("DirectDrawCreateEx() failed with an error %x\n", rc);
return FALSE;
}
return TRUE;
@ -108,7 +108,7 @@ static void flushdisplaymodes(void)
static HRESULT WINAPI enummodescallback(LPDDSURFACEDESC lpddsd, LPVOID lpContext)
{
trace("Width = %li, Height = %li, Refresh Rate = %li\r\n",
trace("Width = %i, Height = %i, Refresh Rate = %i\r\n",
lpddsd->dwWidth, lpddsd->dwHeight,
U2(*lpddsd).dwRefreshRate);
adddisplaymode(lpddsd);
@ -128,7 +128,7 @@ static void enumdisplaymodes(void)
rc = IDirectDraw_EnumDisplayModes(lpDD,
DDEDM_STANDARDVGAMODES, &ddsd, 0, enummodescallback);
ok(rc==DD_OK || rc==E_INVALIDARG,"EnumDisplayModes returned: %lx\n",rc);
ok(rc==DD_OK || rc==E_INVALIDARG,"EnumDisplayModes returned: %x\n",rc);
}
static void setdisplaymode(int i)
@ -137,7 +137,7 @@ static void setdisplaymode(int i)
rc = IDirectDraw_SetCooperativeLevel(lpDD,
hwnd, DDSCL_ALLOWMODEX | DDSCL_EXCLUSIVE | DDSCL_FULLSCREEN);
ok(rc==DD_OK,"SetCooperativeLevel returned: %lx\n",rc);
ok(rc==DD_OK,"SetCooperativeLevel returned: %x\n",rc);
if (modes[i].dwFlags & DDSD_PIXELFORMAT)
{
if (modes[i].ddpfPixelFormat.dwFlags & DDPF_RGB)
@ -145,10 +145,10 @@ static void setdisplaymode(int i)
rc = IDirectDraw_SetDisplayMode(lpDD,
modes[i].dwWidth, modes[i].dwHeight,
U1(modes[i].ddpfPixelFormat).dwRGBBitCount);
ok(DD_OK==rc || DDERR_UNSUPPORTED==rc,"SetDisplayMode returned: %lx\n",rc);
ok(DD_OK==rc || DDERR_UNSUPPORTED==rc,"SetDisplayMode returned: %x\n",rc);
if (DD_OK==rc) {
rc = IDirectDraw_RestoreDisplayMode(lpDD);
ok(DD_OK==rc,"RestoreDisplayMode returned: %lx\n",rc);
ok(DD_OK==rc,"RestoreDisplayMode returned: %x\n",rc);
}
}
}
@ -167,10 +167,10 @@ static void createsurface(void)
DDSCAPS_COMPLEX;
ddsd.dwBackBufferCount = 1;
rc = IDirectDraw_CreateSurface(lpDD, &ddsd, &lpDDSPrimary, NULL );
ok(rc==DD_OK,"CreateSurface returned: %lx\n",rc);
ok(rc==DD_OK,"CreateSurface returned: %x\n",rc);
ddscaps.dwCaps = DDSCAPS_BACKBUFFER;
rc = IDirectDrawSurface_GetAttachedSurface(lpDDSPrimary, &ddscaps, &lpDDSBack);
ok(rc==DD_OK,"GetAttachedSurface returned: %lx\n",rc);
ok(rc==DD_OK,"GetAttachedSurface returned: %x\n",rc);
}
static void destroysurface(void)
@ -189,17 +189,17 @@ static void testsurface(void)
HRESULT rc;
rc = IDirectDrawSurface_GetDC(lpDDSBack, &hdc);
ok(rc==DD_OK, "IDirectDrawSurface_GetDC returned: %lx\n",rc);
ok(rc==DD_OK, "IDirectDrawSurface_GetDC returned: %x\n",rc);
SetBkColor(hdc, RGB(0, 0, 255));
SetTextColor(hdc, RGB(255, 255, 0));
TextOut(hdc, 0, 0, testMsg, lstrlen(testMsg));
IDirectDrawSurface_ReleaseDC(lpDDSBack, hdc);
ok(rc==DD_OK, "IDirectDrawSurface_ReleaseDC returned: %lx\n",rc);
ok(rc==DD_OK, "IDirectDrawSurface_ReleaseDC returned: %x\n",rc);
while (1)
{
rc = IDirectDrawSurface_Flip(lpDDSPrimary, NULL, DDFLIP_WAIT);
ok(rc==DD_OK || rc==DDERR_SURFACELOST, "IDirectDrawSurface_BltFast returned: %lx\n",rc);
ok(rc==DD_OK || rc==DDERR_SURFACELOST, "IDirectDrawSurface_BltFast returned: %x\n",rc);
if (rc == DD_OK)
{
@ -208,7 +208,7 @@ static void testsurface(void)
else if (rc == DDERR_SURFACELOST)
{
rc = IDirectDrawSurface_Restore(lpDDSPrimary);
ok(rc==DD_OK, "IDirectDrawSurface_Restore returned: %lx\n",rc);
ok(rc==DD_OK, "IDirectDrawSurface_Restore returned: %x\n",rc);
}
}
}
@ -243,72 +243,72 @@ static void testcooperativelevels_normal(void)
rc = IDirectDraw_SetCooperativeLevel(lpDD,
hwnd, DDSCL_NORMAL);
ok(rc==DD_OK,"SetCooperativeLevel(DDSCL_NORMAL) returned: %lx\n",rc);
ok(rc==DD_OK,"SetCooperativeLevel(DDSCL_NORMAL) returned: %x\n",rc);
/* Try creating a double buffered primary in normal mode */
rc = IDirectDraw_CreateSurface(lpDD, &surfacedesc, &surface, NULL);
ok(rc == DDERR_NOEXCLUSIVEMODE, "IDirectDraw_CreateSurface returned %08lx\n", rc);
ok(rc == DDERR_NOEXCLUSIVEMODE, "IDirectDraw_CreateSurface returned %08x\n", rc);
ok(surface == NULL, "Returned surface pointer is %p\n", surface);
if(surface) IDirectDrawSurface_Release(surface);
/* Set the focus window */
rc = IDirectDraw_SetCooperativeLevel(lpDD,
hwnd, DDSCL_SETFOCUSWINDOW);
ok(rc==DD_OK,"SetCooperativeLevel(DDSCL_SETFOCUSWINDOW) returned: %lx\n",rc);
ok(rc==DD_OK,"SetCooperativeLevel(DDSCL_SETFOCUSWINDOW) returned: %x\n",rc);
/* Set the focus window a second time*/
rc = IDirectDraw_SetCooperativeLevel(lpDD,
hwnd, DDSCL_SETFOCUSWINDOW);
ok(rc==DD_OK,"SetCooperativeLevel(DDSCL_SETFOCUSWINDOW) the second time returned: %lx\n",rc);
ok(rc==DD_OK,"SetCooperativeLevel(DDSCL_SETFOCUSWINDOW) the second time returned: %x\n",rc);
/* Test DDSCL_SETFOCUSWINDOW with the other flags. They should all fail, except of DDSCL_NOWINDOWCHANGES */
rc = IDirectDraw_SetCooperativeLevel(lpDD,
hwnd, DDSCL_NORMAL | DDSCL_SETFOCUSWINDOW);
ok(rc==DDERR_INVALIDPARAMS,"SetCooperativeLevel(DDSCL_NORMAL | DDSCL_SETFOCUSWINDOW) returned: %lx\n",rc);
ok(rc==DDERR_INVALIDPARAMS,"SetCooperativeLevel(DDSCL_NORMAL | DDSCL_SETFOCUSWINDOW) returned: %x\n",rc);
rc = IDirectDraw_SetCooperativeLevel(lpDD,
hwnd, DDSCL_EXCLUSIVE | DDSCL_FULLSCREEN | DDSCL_SETFOCUSWINDOW);
ok(rc==DDERR_INVALIDPARAMS,"SetCooperativeLevel(DDSCL_EXCLUSIVE | DDSCL_FULLSCREEN | DDSCL_SETFOCUSWINDOW) returned: %lx\n",rc);
ok(rc==DDERR_INVALIDPARAMS,"SetCooperativeLevel(DDSCL_EXCLUSIVE | DDSCL_FULLSCREEN | DDSCL_SETFOCUSWINDOW) returned: %x\n",rc);
/* This one succeeds */
rc = IDirectDraw_SetCooperativeLevel(lpDD,
hwnd, DDSCL_NOWINDOWCHANGES | DDSCL_SETFOCUSWINDOW);
ok(rc==DD_OK,"SetCooperativeLevel(DDSCL_NOWINDOWCHANGES | DDSCL_SETFOCUSWINDOW) returned: %lx\n",rc);
ok(rc==DD_OK,"SetCooperativeLevel(DDSCL_NOWINDOWCHANGES | DDSCL_SETFOCUSWINDOW) returned: %x\n",rc);
rc = IDirectDraw_SetCooperativeLevel(lpDD,
hwnd, DDSCL_MULTITHREADED | DDSCL_SETFOCUSWINDOW);
ok(rc==DDERR_INVALIDPARAMS,"SetCooperativeLevel(DDSCL_MULTITHREADED | DDSCL_SETFOCUSWINDOW) returned: %lx\n",rc);
ok(rc==DDERR_INVALIDPARAMS,"SetCooperativeLevel(DDSCL_MULTITHREADED | DDSCL_SETFOCUSWINDOW) returned: %x\n",rc);
rc = IDirectDraw_SetCooperativeLevel(lpDD,
hwnd, DDSCL_FPUSETUP | DDSCL_SETFOCUSWINDOW);
ok(rc==DDERR_INVALIDPARAMS,"SetCooperativeLevel(DDSCL_FPUSETUP | DDSCL_SETFOCUSWINDOW) returned: %lx\n",rc);
ok(rc==DDERR_INVALIDPARAMS,"SetCooperativeLevel(DDSCL_FPUSETUP | DDSCL_SETFOCUSWINDOW) returned: %x\n",rc);
rc = IDirectDraw_SetCooperativeLevel(lpDD,
hwnd, DDSCL_FPUPRESERVE | DDSCL_SETFOCUSWINDOW);
ok(rc==DDERR_INVALIDPARAMS,"SetCooperativeLevel(DDSCL_FPUPRESERVE | DDSCL_SETFOCUSWINDOW) returned: %lx\n",rc);
ok(rc==DDERR_INVALIDPARAMS,"SetCooperativeLevel(DDSCL_FPUPRESERVE | DDSCL_SETFOCUSWINDOW) returned: %x\n",rc);
rc = IDirectDraw_SetCooperativeLevel(lpDD,
hwnd, DDSCL_ALLOWREBOOT | DDSCL_SETFOCUSWINDOW);
ok(rc==DDERR_INVALIDPARAMS,"SetCooperativeLevel(DDSCL_ALLOWREBOOT | DDSCL_SETFOCUSWINDOW) returned: %lx\n",rc);
ok(rc==DDERR_INVALIDPARAMS,"SetCooperativeLevel(DDSCL_ALLOWREBOOT | DDSCL_SETFOCUSWINDOW) returned: %x\n",rc);
rc = IDirectDraw_SetCooperativeLevel(lpDD,
hwnd, DDSCL_ALLOWMODEX | DDSCL_SETFOCUSWINDOW);
ok(rc==DDERR_INVALIDPARAMS,"SetCooperativeLevel(DDSCL_ALLOWMODEX | DDSCL_SETFOCUSWINDOW) returned: %lx\n",rc);
ok(rc==DDERR_INVALIDPARAMS,"SetCooperativeLevel(DDSCL_ALLOWMODEX | DDSCL_SETFOCUSWINDOW) returned: %x\n",rc);
/* Set the device window without any other flags. Should give an error */
rc = IDirectDraw_SetCooperativeLevel(lpDD,
hwnd, DDSCL_SETDEVICEWINDOW);
ok(rc==DDERR_INVALIDPARAMS,"SetCooperativeLevel(DDSCL_SETDEVICEWINDOW) returned: %lx\n",rc);
ok(rc==DDERR_INVALIDPARAMS,"SetCooperativeLevel(DDSCL_SETDEVICEWINDOW) returned: %x\n",rc);
/* Set device window with DDSCL_NORMAL */
rc = IDirectDraw_SetCooperativeLevel(lpDD,
hwnd, DDSCL_NORMAL | DDSCL_SETDEVICEWINDOW);
ok(rc==DD_OK,"SetCooperativeLevel(DDSCL_NORMAL | DDSCL_SETDEVICEWINDOW) returned: %lx\n",rc);
ok(rc==DD_OK,"SetCooperativeLevel(DDSCL_NORMAL | DDSCL_SETDEVICEWINDOW) returned: %x\n",rc);
/* Also set the focus window. Should give an error */
rc = IDirectDraw_SetCooperativeLevel(lpDD,
hwnd, DDSCL_ALLOWMODEX | DDSCL_EXCLUSIVE | DDSCL_FULLSCREEN | DDSCL_SETDEVICEWINDOW | DDSCL_SETFOCUSWINDOW);
ok(rc==DDERR_INVALIDPARAMS,"SetCooperativeLevel(DDSCL_NORMAL | DDSCL_SETDEVICEWINDOW | DDSCL_SETFOCUSWINDOW) returned: %lx\n",rc);
ok(rc==DDERR_INVALIDPARAMS,"SetCooperativeLevel(DDSCL_NORMAL | DDSCL_SETDEVICEWINDOW | DDSCL_SETFOCUSWINDOW) returned: %x\n",rc);
/* All done */
}
@ -322,22 +322,22 @@ static void testcooperativelevels_exclusive(void)
/* Try to set exclusive mode only */
rc = IDirectDraw_SetCooperativeLevel(lpDD,
hwnd, DDSCL_EXCLUSIVE);
ok(rc==DDERR_INVALIDPARAMS,"SetCooperativeLevel(DDSCL_EXCLUSIVE) returned: %lx\n",rc);
ok(rc==DDERR_INVALIDPARAMS,"SetCooperativeLevel(DDSCL_EXCLUSIVE) returned: %x\n",rc);
/* Full screen mode only */
rc = IDirectDraw_SetCooperativeLevel(lpDD,
hwnd, DDSCL_FULLSCREEN);
ok(rc==DDERR_INVALIDPARAMS,"SetCooperativeLevel(DDSCL_FULLSCREEN) returned: %lx\n",rc);
ok(rc==DDERR_INVALIDPARAMS,"SetCooperativeLevel(DDSCL_FULLSCREEN) returned: %x\n",rc);
/* Full screen mode + exclusive mode */
rc = IDirectDraw_SetCooperativeLevel(lpDD,
hwnd, DDSCL_FULLSCREEN | DDSCL_EXCLUSIVE);
ok(rc==DD_OK,"SetCooperativeLevel(DDSCL_EXCLUSIVE | DDSCL_FULLSCREEN) returned: %lx\n",rc);
ok(rc==DD_OK,"SetCooperativeLevel(DDSCL_EXCLUSIVE | DDSCL_FULLSCREEN) returned: %x\n",rc);
/* Set the focus window. Should fail */
rc = IDirectDraw_SetCooperativeLevel(lpDD,
hwnd, DDSCL_SETFOCUSWINDOW);
ok(rc==DDERR_HWNDALREADYSET,"SetCooperativeLevel(DDSCL_SETFOCUSWINDOW) returned: %lx\n",rc);
ok(rc==DDERR_HWNDALREADYSET,"SetCooperativeLevel(DDSCL_SETFOCUSWINDOW) returned: %x\n",rc);
/* All done */

View File

@ -31,14 +31,14 @@ static BOOL CreateDirectDraw(void)
HRESULT rc;
rc = DirectDrawCreate(NULL, &lpDD, NULL);
ok(rc==DD_OK || rc==DDERR_NODIRECTDRAWSUPPORT, "DirectDrawCreateEx returned: %lx\n", rc);
ok(rc==DD_OK || rc==DDERR_NODIRECTDRAWSUPPORT, "DirectDrawCreateEx returned: %x\n", rc);
if (!lpDD) {
trace("DirectDrawCreateEx() failed with an error %lx\n", rc);
trace("DirectDrawCreateEx() failed with an error %x\n", rc);
return FALSE;
}
rc = IDirectDraw_SetCooperativeLevel(lpDD, NULL, DDSCL_NORMAL);
ok(rc==DD_OK,"SetCooperativeLevel returned: %lx\n",rc);
ok(rc==DD_OK,"SetCooperativeLevel returned: %x\n",rc);
return TRUE;
}
@ -69,16 +69,16 @@ static void MipMapCreationTest(void)
ddsd.dwWidth = 128;
ddsd.dwHeight = 32;
rc = IDirectDraw_CreateSurface(lpDD, &ddsd, &lpDDSMipMapTest, NULL);
ok(rc==DD_OK,"CreateSurface returned: %lx\n",rc);
ok(rc==DD_OK,"CreateSurface returned: %x\n",rc);
/* Check the number of created mipmaps */
memset(&ddsd, 0, sizeof(DDSURFACEDESC));
ddsd.dwSize = sizeof(ddsd);
rc = IDirectDrawSurface_GetSurfaceDesc(lpDDSMipMapTest, &ddsd);
ok(rc==DD_OK,"GetSurfaceDesc returned: %lx\n",rc);
ok(rc==DD_OK,"GetSurfaceDesc returned: %x\n",rc);
ok(ddsd.dwFlags & DDSD_MIPMAPCOUNT,
"GetSurfaceDesc returned no mipmapcount.\n");
ok(U2(ddsd).dwMipMapCount == 3, "Incorrect mipmap count: %ld.\n",
ok(U2(ddsd).dwMipMapCount == 3, "Incorrect mipmap count: %d.\n",
U2(ddsd).dwMipMapCount);
/* Destroy the surface. */
@ -95,16 +95,16 @@ static void MipMapCreationTest(void)
ddsd.dwWidth = 128;
ddsd.dwHeight = 32;
rc = IDirectDraw_CreateSurface(lpDD, &ddsd, &lpDDSMipMapTest, NULL);
ok(rc==DD_OK,"CreateSurface returned: %lx\n",rc);
ok(rc==DD_OK,"CreateSurface returned: %x\n",rc);
/* Check the number of created mipmaps */
memset(&ddsd, 0, sizeof(DDSURFACEDESC));
ddsd.dwSize = sizeof(ddsd);
rc = IDirectDrawSurface_GetSurfaceDesc(lpDDSMipMapTest, &ddsd);
ok(rc==DD_OK,"GetSurfaceDesc returned: %lx\n",rc);
ok(rc==DD_OK,"GetSurfaceDesc returned: %x\n",rc);
ok(ddsd.dwFlags & DDSD_MIPMAPCOUNT,
"GetSurfaceDesc returned no mipmapcount.\n");
ok(U2(ddsd).dwMipMapCount == 1, "Incorrect mipmap count: %ld.\n",
ok(U2(ddsd).dwMipMapCount == 1, "Incorrect mipmap count: %d.\n",
U2(ddsd).dwMipMapCount);
@ -121,16 +121,16 @@ static void MipMapCreationTest(void)
ddsd.dwWidth = 128;
ddsd.dwHeight = 32;
rc = IDirectDraw_CreateSurface(lpDD, &ddsd, &lpDDSMipMapTest, NULL);
ok(rc==DD_OK,"CreateSurface returned: %lx\n",rc);
ok(rc==DD_OK,"CreateSurface returned: %x\n",rc);
/* Check the number of created mipmaps */
memset(&ddsd, 0, sizeof(DDSURFACEDESC));
ddsd.dwSize = sizeof(ddsd);
rc = IDirectDrawSurface_GetSurfaceDesc(lpDDSMipMapTest, &ddsd);
ok(rc==DD_OK,"GetSurfaceDesc returned: %lx\n",rc);
ok(rc==DD_OK,"GetSurfaceDesc returned: %x\n",rc);
ok(ddsd.dwFlags & DDSD_MIPMAPCOUNT,
"GetSurfaceDesc returned no mipmapcount.\n");
ok(U2(ddsd).dwMipMapCount == 6, "Incorrect mipmap count: %ld.\n",
ok(U2(ddsd).dwMipMapCount == 6, "Incorrect mipmap count: %d.\n",
U2(ddsd).dwMipMapCount);
@ -145,16 +145,16 @@ static void MipMapCreationTest(void)
ddsd.dwWidth = 32;
ddsd.dwHeight = 64;
rc = IDirectDraw_CreateSurface(lpDD, &ddsd, &lpDDSMipMapTest, NULL);
ok(rc==DD_OK,"CreateSurface returned: %lx\n",rc);
ok(rc==DD_OK,"CreateSurface returned: %x\n",rc);
/* Check the number of created mipmaps */
memset(&ddsd, 0, sizeof(DDSURFACEDESC));
ddsd.dwSize = sizeof(ddsd);
rc = IDirectDrawSurface_GetSurfaceDesc(lpDDSMipMapTest, &ddsd);
ok(rc==DD_OK,"GetSurfaceDesc returned: %lx\n",rc);
ok(rc==DD_OK,"GetSurfaceDesc returned: %x\n",rc);
ok(ddsd.dwFlags & DDSD_MIPMAPCOUNT,
"GetSurfaceDesc returned no mipmapcount.\n");
ok(U2(ddsd).dwMipMapCount == 6, "Incorrect mipmap count: %ld.\n",
ok(U2(ddsd).dwMipMapCount == 6, "Incorrect mipmap count: %d.\n",
U2(ddsd).dwMipMapCount);
/* Destroy the surface. */
@ -185,43 +185,43 @@ static void SrcColorKey32BlitTest(void)
U3(ddsd.ddpfPixelFormat).dwGBitMask = 0x00FF00;
U4(ddsd.ddpfPixelFormat).dwBBitMask = 0x0000FF;
rc = IDirectDraw_CreateSurface(lpDD, &ddsd, &lpDst, NULL);
ok(rc==DD_OK,"CreateSurface returned: %lx\n",rc);
ok(rc==DD_OK,"CreateSurface returned: %x\n",rc);
ddsd.dwFlags |= DDSD_CKSRCBLT;
ddsd.ddckCKSrcBlt.dwColorSpaceLowValue = 0xFF00FF;
ddsd.ddckCKSrcBlt.dwColorSpaceHighValue = 0xFF00FF;
rc = IDirectDraw_CreateSurface(lpDD, &ddsd, &lpSrc, NULL);
ok(rc==DD_OK,"CreateSurface returned: %lx\n",rc);
ok(rc==DD_OK,"CreateSurface returned: %x\n",rc);
rc = IDirectDrawSurface_Lock(lpDst, NULL, &ddsd2, DDLOCK_WAIT, NULL);
ok(rc==DD_OK,"Lock returned: %lx\n",rc);
ok(rc==DD_OK,"Lock returned: %x\n",rc);
lpData = (LPDWORD)ddsd2.lpSurface;
lpData[0] = 0xCCCCCCCC;
lpData[1] = 0xCCCCCCCC;
lpData[2] = 0xCCCCCCCC;
lpData[3] = 0xCCCCCCCC;
rc = IDirectDrawSurface_Unlock(lpDst, NULL);
ok(rc==DD_OK,"Unlock returned: %lx\n",rc);
ok(rc==DD_OK,"Unlock returned: %x\n",rc);
rc = IDirectDrawSurface_Lock(lpSrc, NULL, &ddsd2, DDLOCK_WAIT, NULL);
ok(rc==DD_OK,"Lock returned: %lx\n",rc);
ok(rc==DD_OK,"Lock returned: %x\n",rc);
lpData = (LPDWORD)ddsd2.lpSurface;
lpData[0] = 0x77010203;
lpData[1] = 0x00010203;
lpData[2] = 0x77FF00FF;
lpData[3] = 0x00FF00FF;
rc = IDirectDrawSurface_Unlock(lpSrc, NULL);
ok(rc==DD_OK,"Unlock returned: %lx\n",rc);
ok(rc==DD_OK,"Unlock returned: %x\n",rc);
IDirectDrawSurface_Blt(lpDst, NULL, lpSrc, NULL, DDBLT_KEYSRC, NULL);
rc = IDirectDrawSurface_Lock(lpDst, NULL, &ddsd2, DDLOCK_WAIT, NULL);
ok(rc==DD_OK,"Lock returned: %lx\n",rc);
ok(rc==DD_OK,"Lock returned: %x\n",rc);
lpData = (LPDWORD)ddsd2.lpSurface;
ok((lpData[0]==0x77010203)&&(lpData[1]==0x00010203)&&(lpData[2]==0xCCCCCCCC)&&(lpData[3]==0xCCCCCCCC),
"Destination data after blitting is not correct\n");
rc = IDirectDrawSurface_Unlock(lpDst, NULL);
ok(rc==DD_OK,"Unlock returned: %lx\n",rc);
ok(rc==DD_OK,"Unlock returned: %x\n",rc);
IDirectDrawSurface_Release(lpSrc);
IDirectDrawSurface_Release(lpDst);
@ -243,13 +243,13 @@ static void QueryInterface(void)
ret = IDirectDraw_CreateSurface(lpDD, &surface, &dsurface, NULL);
if(ret != DD_OK)
{
ok(FALSE, "IDirectDraw::CreateSurface failed with error %lx\n", ret);
ok(FALSE, "IDirectDraw::CreateSurface failed with error %x\n", ret);
return;
}
/* Call IUnknown::QueryInterface */
ret = IDirectDrawSurface_QueryInterface(dsurface, 0, &object);
ok(ret == DDERR_INVALIDPARAMS, "IDirectDrawSurface::QueryInterface returned %lx\n", ret);
ok(ret == DDERR_INVALIDPARAMS, "IDirectDrawSurface::QueryInterface returned %x\n", ret);
IDirectDrawSurface_Release(dsurface);
}

View File

@ -57,7 +57,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: %lx\n", hr);
ok(hr == DD_OK || hr==DDERR_NODIRECTDRAWSUPPORT, "DirectDrawCreateEx returned: %x\n", hr);
if(!DDraw7)
{
trace("Couldn't create DDraw interface, skipping tests\n");
@ -65,25 +65,25 @@ static void test_ddraw_objects(void)
}
hr = IDirectDraw7_QueryInterface(DDraw7, &IID_IDirectDraw4, (void **) &DDraw4);
ok(hr == DD_OK, "IDirectDraw7_QueryInterface returned %08lx\n", hr);
ok(hr == DD_OK, "IDirectDraw7_QueryInterface returned %08x\n", hr);
hr = IDirectDraw7_QueryInterface(DDraw7, &IID_IDirectDraw2, (void **) &DDraw2);
ok(hr == DD_OK, "IDirectDraw7_QueryInterface returned %08lx\n", hr);
ok(hr == DD_OK, "IDirectDraw7_QueryInterface returned %08x\n", hr);
hr = IDirectDraw7_QueryInterface(DDraw7, &IID_IDirectDraw, (void **) &DDraw1);
ok(hr == DD_OK, "IDirectDraw7_QueryInterface returned %08lx\n", hr);
ok(hr == DD_OK, "IDirectDraw7_QueryInterface returned %08x\n", hr);
ref = getRefcount( (IUnknown *) DDraw7);
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 %08lx\n", hr);
ok(hr == DDERR_NOCOOPERATIVELEVELSET, "CreatePalette returned %08x\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 %08lx\n", hr);
ok(hr == CLASS_E_NOAGGREGATION, "CreatePalette returned %08x\n", hr);
hr = IDirectDraw7_SetCooperativeLevel(DDraw7, 0, DDSCL_NORMAL);
ok(hr == DD_OK, "SetCooperativeLevel failed with %08lx\n", hr);
ok(hr == DD_OK, "SetCooperativeLevel failed with %08x\n", hr);
memset(&ddsd, 0, sizeof(ddsd));
ddsd.dwSize = sizeof(ddsd);
@ -96,7 +96,7 @@ static void test_ddraw_objects(void)
U1(U4(ddsd).ddpfPixelFormat).dwRGBBitCount = 8;
hr = IDirectDraw7_CreateSurface(DDraw7, &ddsd, &surface, NULL);
ok(hr == DD_OK, "CreateSurface failed with %08lx\n", hr);
ok(hr == DD_OK, "CreateSurface failed with %08x\n", hr);
/* DDraw refcount increased by 1 */
ref = getRefcount( (IUnknown *) DDraw7);
@ -107,7 +107,7 @@ static void test_ddraw_objects(void)
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 %08lx\n", hr);
ok(hr == DD_OK, "CreatePalette returned %08x\n", hr);
/* DDraw refcount increased by 1 */
ref = getRefcount( (IUnknown *) DDraw7);
@ -119,7 +119,7 @@ static void test_ddraw_objects(void)
/* Test attaching a palette to a surface */
hr = IDirectDrawSurface7_SetPalette(surface, palette);
ok(hr == DD_OK, "IDirectDrawSurface_SetPalette failed with %08lx\n", hr);
ok(hr == DD_OK, "IDirectDrawSurface_SetPalette failed with %08x\n", hr);
/* Palette refcount increased, surface stays the same */
ref = getRefcount( (IUnknown *) palette);
@ -144,21 +144,21 @@ static void test_ddraw_objects(void)
/* 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 %08lx\n", hr);
ok(hr == DD_OK, "CreatePalette returned %08x\n", hr);
ref = getRefcount( (IUnknown *) DDraw4);
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 %08lx\n", hr);
ok(hr == DD_OK, "CreatePalette returned %08x\n", hr);
ref = getRefcount( (IUnknown *) DDraw2);
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 %08lx\n", hr);
ok(hr == DD_OK, "CreatePalette returned %08x\n", hr);
ref = getRefcount( (IUnknown *) DDraw1);
ok(ref == 1, "Got refcount %ld, expected 1\n", ref);
IDirectDrawPalette_Release(palette);
@ -183,7 +183,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: %lx\n", hr);
ok(hr == DD_OK || hr==DDERR_NODIRECTDRAWSUPPORT, "DirectDrawCreateEx returned: %x\n", hr);
if(!DDraw7)
{
trace("Couldn't create DDraw interface, skipping tests\n");
@ -194,11 +194,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 %08lx\n", hr);
ok(hr == DD_OK, "IDirectDraw7_QueryInterface returned %08x\n", hr);
hr = IDirectDraw7_QueryInterface(DDraw7, &IID_IDirectDraw2, (void **) &DDraw2);
ok(hr == DD_OK, "IDirectDraw7_QueryInterf&ace returned %08lx\n", hr);
ok(hr == DD_OK, "IDirectDraw7_QueryInterf&ace returned %08x\n", hr);
hr = IDirectDraw7_QueryInterface(DDraw7, &IID_IDirectDraw, (void **) &DDraw1);
ok(hr == DD_OK, "IDirectDraw7_QueryInterface returned %08lx\n", hr);
ok(hr == DD_OK, "IDirectDraw7_QueryInterface returned %08x\n", hr);
/* All interfaces now have refcount 1! */
ref = getRefcount( (IUnknown *) DDraw7);
@ -213,7 +213,7 @@ static void test_iface_refcnt(void)
ok(ref == 1, "IDirectDraw reference count is %ld\n", ref);
hr = IDirectDraw7_QueryInterface(DDraw7, &IID_IDirect3D7, (void **) &D3D7);
ok(hr == DD_OK, "IDirectDraw7_QueryInterface returned %08lx\n", hr);
ok(hr == DD_OK, "IDirectDraw7_QueryInterface returned %08x\n", hr);
/* Apparently IDirectDrawX and IDirect3DX are linked together */
ref = getRefcount( (IUnknown *) D3D7);
@ -235,31 +235,31 @@ static void test_iface_refcnt(void)
/* Can't get older d3d interfaces. WHY????? */
hr = IDirectDraw7_QueryInterface(DDraw4, &IID_IDirect3D3, (void **) &D3D3);
todo_wine ok(hr == E_NOINTERFACE, "IDirectDraw7_QueryInterface returned %08lx\n", hr);
todo_wine ok(hr == E_NOINTERFACE, "IDirectDraw7_QueryInterface returned %08x\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 %08lx\n", hr);
todo_wine ok(hr == E_NOINTERFACE, "IDirectDraw4_QueryInterface returned %08x\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 %08lx\n", hr);
todo_wine ok(hr == E_NOINTERFACE, "IDirectDraw7_QueryInterface returned %08x\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 %08lx\n", hr);
todo_wine ok(hr == E_NOINTERFACE, "IDirectDraw2_QueryInterface returned %08x\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 %08lx\n", hr);
todo_wine ok(hr == E_NOINTERFACE, "IDirectDraw7_QueryInterface returned %08x\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 %08lx\n", hr);
todo_wine ok(hr == E_NOINTERFACE, "IDirectDraw_QueryInterface returned %08x\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 %08lx\n", hr);
todo_wine ok(hr == E_NOINTERFACE, "IDirect3D7_QueryInterface returned %08x\n", hr);
if(hr == DD_OK && D3D1) IDirect3D_Release(D3D1);
/* Try an AddRef, it only affects the AddRefed interface */
@ -278,10 +278,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 %08lx\n", hr);
ok(hr == DD_OK, "IDirectDraw4::SetCooperativeLevel returned %08x\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 %08lx\n", hr);
ok(hr == DDERR_HWNDALREADYSET, "IDirectDraw7::SetCooperativeLevel returned %08x\n", hr);
/* All done, release all interfaces */
IDirectDraw7_Release(DDraw7);
@ -304,17 +304,17 @@ static void test_d3d_ifaces(void)
long ref;
hr = DirectDrawCreate(NULL, &DDraw1, NULL);
ok(hr == DD_OK || hr==DDERR_NODIRECTDRAWSUPPORT, "DirectDrawCreateEx returned: %lx\n", hr);
ok(hr == DD_OK || hr==DDERR_NODIRECTDRAWSUPPORT, "DirectDrawCreateEx returned: %x\n", hr);
if(!DDraw1)
{
trace("DirectDrawCreate failed with %08lx\n", hr);
trace("DirectDrawCreate failed with %08x\n", hr);
return;
}
hr = IDirectDraw_QueryInterface(DDraw1, &IID_IDirectDraw2, (void **) &DDraw2);
ok(hr == DD_OK, "IDirectDraw_QueryInterface returned %08lx\n", hr);
ok(hr == DD_OK, "IDirectDraw_QueryInterface returned %08x\n", hr);
hr = IDirectDraw_QueryInterface(DDraw1, &IID_IDirectDraw4, (void **) &DDraw4);
ok(hr == DD_OK, "IDirectDraw_QueryInterface returned %08lx\n", hr);
ok(hr == DD_OK, "IDirectDraw_QueryInterface returned %08x\n", hr);
ref = getRefcount( (IUnknown *) DDraw4);
ok(ref == 1, "IDirectDraw4 reference count is %ld\n", ref);
@ -324,7 +324,7 @@ static void test_d3d_ifaces(void)
ok(ref == 1, "IDirectDraw reference count is %ld\n", ref);
hr = IDirectDraw_QueryInterface(DDraw1, &IID_IDirect3D, (void **) &D3D1);
ok(hr == DD_OK, "IDirectDraw_QueryInterface returned %08lx\n", hr);
ok(hr == DD_OK, "IDirectDraw_QueryInterface returned %08x\n", hr);
ref = getRefcount( (IUnknown *) DDraw4);
ok(ref == 1, "IDirectDraw4 reference count is %ld\n", ref);
ref = getRefcount( (IUnknown *) DDraw2);
@ -334,7 +334,7 @@ static void test_d3d_ifaces(void)
IDirect3D_Release(D3D1);
hr = IDirectDraw2_QueryInterface(DDraw2, &IID_IDirect3D2, (void **) &D3D2);
ok(hr == DD_OK, "IDirectDraw_QueryInterface returned %08lx\n", hr);
ok(hr == DD_OK, "IDirectDraw_QueryInterface returned %08x\n", hr);
ref = getRefcount( (IUnknown *) DDraw4);
ok(ref == 1, "IDirectDraw4 reference count is %ld\n", ref);
ref = getRefcount( (IUnknown *) DDraw2);
@ -344,7 +344,7 @@ static void test_d3d_ifaces(void)
IDirect3D2_Release(D3D2);
hr = IDirectDraw4_QueryInterface(DDraw4, &IID_IDirect3D3, (void **) &D3D3);
ok(hr == DD_OK, "IDirectDraw_QueryInterface returned %08lx\n", hr);
ok(hr == DD_OK, "IDirectDraw_QueryInterface returned %08x\n", hr);
ref = getRefcount( (IUnknown *) DDraw4);
ok(ref == 1, "IDirectDraw4 reference count is %ld\n", ref);
ref = getRefcount( (IUnknown *) DDraw2);
@ -374,35 +374,35 @@ static void test_d3d_ifaces(void)
* Except IDirect3D7, it can only be returned by IDirectDraw7(which can't return older ifaces)
*/
hr = IDirectDraw_QueryInterface(DDraw2, &IID_IDirect3D, (void **) &D3D1);
ok(hr == DD_OK, "IDirectDraw2_QueryInterface returned %08lx\n", hr);
ok(hr == DD_OK, "IDirectDraw2_QueryInterface returned %08x\n", hr);
IDirect3D_Release(D3D1);
hr = IDirectDraw4_QueryInterface(DDraw4, &IID_IDirect3D, (void **) &D3D1);
ok(hr == DD_OK, "IDirectDraw4_QueryInterface returned %08lx\n", hr);
ok(hr == DD_OK, "IDirectDraw4_QueryInterface returned %08x\n", hr);
IDirect3D_Release(D3D1);
hr = IDirectDraw_QueryInterface(DDraw1, &IID_IDirect3D2, (void **) &D3D2);
ok(hr == DD_OK, "IDirectDraw_QueryInterface returned %08lx\n", hr);
ok(hr == DD_OK, "IDirectDraw_QueryInterface returned %08x\n", hr);
IDirect3D_Release(D3D2);
hr = IDirectDraw4_QueryInterface(DDraw4, &IID_IDirect3D2, (void **) &D3D2);
ok(hr == DD_OK, "IDirectDraw4_QueryInterface returned %08lx\n", hr);
ok(hr == DD_OK, "IDirectDraw4_QueryInterface returned %08x\n", hr);
IDirect3D_Release(D3D2);
hr = IDirectDraw_QueryInterface(DDraw1, &IID_IDirect3D3, (void **) &D3D3);
ok(hr == DD_OK, "IDirectDraw_QueryInterface returned %08lx\n", hr);
ok(hr == DD_OK, "IDirectDraw_QueryInterface returned %08x\n", hr);
IDirect3D_Release(D3D3);
hr = IDirectDraw2_QueryInterface(DDraw2, &IID_IDirect3D3, (void **) &D3D3);
ok(hr == DD_OK, "IDirectDraw2_QueryInterface returned %08lx\n", hr);
ok(hr == DD_OK, "IDirectDraw2_QueryInterface returned %08x\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 %08lx\n", hr);
todo_wine ok(hr == E_NOINTERFACE, "IDirectDraw_QueryInterface returned %08x\n", hr);
if(D3D7) IDirect3D_Release(D3D7);
hr = IDirectDraw2_QueryInterface(DDraw2, &IID_IDirect3D7, (void **) &D3D7);
todo_wine ok(hr == E_NOINTERFACE, "IDirectDraw2_QueryInterface returned %08lx\n", hr);
todo_wine ok(hr == E_NOINTERFACE, "IDirectDraw2_QueryInterface returned %08x\n", hr);
if(D3D7) IDirect3D_Release(D3D7);
hr = IDirectDraw4_QueryInterface(DDraw4, &IID_IDirect3D7, (void **) &D3D7);
todo_wine ok(hr == E_NOINTERFACE, "IDirectDraw4_QueryInterface returned %08lx\n", hr);
todo_wine ok(hr == E_NOINTERFACE, "IDirectDraw4_QueryInterface returned %08x\n", hr);
if(D3D7) IDirect3D_Release(D3D7);
/* Release the interfaces */