From 35d8c5633332d6175ea3925b7df3d7f7d9921083 Mon Sep 17 00:00:00 2001 From: Ken Thomases Date: Mon, 27 Jan 2014 13:32:02 -0600 Subject: [PATCH] d3d9: Make CheckDeviceType() fail for display formats other than D3DFMT_X8R8G8B8 and D3DFMT_R5G6B5 in full-screen. The adapter mode functions already enforce this, and tests show CheckDeviceType() should fail for full-screen mode with display formats for which there are no adapter modes. --- dlls/d3d9/directx.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/dlls/d3d9/directx.c b/dlls/d3d9/directx.c index 537e6affcaa..e73051d7943 100644 --- a/dlls/d3d9/directx.c +++ b/dlls/d3d9/directx.c @@ -232,6 +232,10 @@ static HRESULT WINAPI d3d9_CheckDeviceType(IDirect3D9Ex *iface, UINT adapter, D3 TRACE("iface %p, adapter %u, device_type %#x, display_format %#x, backbuffer_format %#x, windowed %#x.\n", iface, adapter, device_type, display_format, backbuffer_format, windowed); + /* Others than that not supported by d3d9, but reported by wined3d for ddraw. Filter them out. */ + if (!windowed && display_format != D3DFMT_X8R8G8B8 && display_format != D3DFMT_R5G6B5) + return WINED3DERR_NOTAVAILABLE; + wined3d_mutex_lock(); hr = wined3d_check_device_type(d3d9->wined3d, adapter, device_type, wined3dformat_from_d3dformat(display_format), wined3dformat_from_d3dformat(backbuffer_format), windowed);