ddraw: SetDisplayMode may fail.

This commit is contained in:
Stefan Dösinger 2007-07-24 20:44:05 +02:00 committed by Alexandre Julliard
parent 8de07265a6
commit df75a7e007
2 changed files with 7 additions and 3 deletions

View File

@ -614,7 +614,7 @@ IDirectDrawImpl_SetDisplayMode(IDirectDraw7 *iface,
LeaveCriticalSection(&ddraw_cs);
switch(hr)
{
case WINED3DERR_NOTAVAILABLE: return DDERR_INVALIDMODE;
case WINED3DERR_NOTAVAILABLE: return DDERR_UNSUPPORTED;
default: return hr;
};
}

View File

@ -61,8 +61,12 @@ static BOOL createObjects(void)
hr = IDirectDraw7_SetDisplayMode(DirectDraw, 640, 480, 24, 0, 0);
}
ok(hr == DD_OK, "IDirectDraw7_SetDisplayMode failed with %08x\n", hr);
if(FAILED(hr)) goto err;
ok(hr == DD_OK || hr == DDERR_UNSUPPORTED, "IDirectDraw7_SetDisplayMode failed with %08x\n", hr);
if(FAILED(hr)) {
/* use trace, the caller calls skip() */
trace("SetDisplayMode failed\n");
goto err;
}
hr = IDirectDraw7_QueryInterface(DirectDraw, &IID_IDirect3D7, (void**) &Direct3D);
if (hr == E_NOINTERFACE) goto err;