From: Henri Verbeet Subject: [PATCH 2/2] wined3d: Disallow creating devices without adapters in wined3d_device_create(). Message-Id: <20180919220047.14739-2-hverbeet@codeweavers.com> Date: Thu, 20 Sep 2018 02:30:47 +0430 These days, we have an adapter even with WINED3D_NO3D. Signed-off-by: Henri Verbeet --- dlls/wined3d/directx.c | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/dlls/wined3d/directx.c b/dlls/wined3d/directx.c index d1d80b8b3a7..b6c6ecba410 100644 --- a/dlls/wined3d/directx.c +++ b/dlls/wined3d/directx.c @@ -2438,12 +2438,11 @@ HRESULT CDECL wined3d_device_create(struct wined3d *wined3d, UINT adapter_idx, e struct wined3d_device *object; HRESULT hr; - TRACE("wined3d %p, adapter_idx %u, device_type %#x, focus_window %p, flags %#x, surface_alignment %u, device_parent %p, device %p.\n", + TRACE("wined3d %p, adapter_idx %u, device_type %#x, focus_window %p, " + "flags %#x, surface_alignment %u, device_parent %p, device %p.\n", wined3d, adapter_idx, device_type, focus_window, flags, surface_alignment, device_parent, device); - /* Validate the adapter number. If no adapters are available(no GL), ignore the adapter - * number and create a device without a 3D adapter for 2D only operation. */ - if (wined3d->adapter_count && adapter_idx >= wined3d->adapter_count) + if (adapter_idx >= wined3d->adapter_count) return WINED3DERR_INVALIDCALL; if (!(object = heap_alloc_zero(sizeof(*object)))) -- 2.11.0