diff --git a/dlls/dxgi/dxgi_main.c b/dlls/dxgi/dxgi_main.c index eaf7b06de0f..b72c04a16fa 100644 --- a/dlls/dxgi/dxgi_main.c +++ b/dlls/dxgi/dxgi_main.c @@ -97,6 +97,12 @@ HRESULT WINAPI CreateDXGIFactory(REFIID riid, void **factory) EnterCriticalSection(&dxgi_cs); object->wined3d = WineDirect3DCreate(10, (IUnknown *)object); + if(!object->wined3d) + { + hr = DXGI_ERROR_UNSUPPORTED; + LeaveCriticalSection(&dxgi_cs); + goto fail; + } object->adapter_count = IWineD3D_GetAdapterCount(object->wined3d); LeaveCriticalSection(&dxgi_cs); diff --git a/dlls/dxgi/tests/device.c b/dlls/dxgi/tests/device.c index 7f22bb4bcd5..7603c1405de 100644 --- a/dlls/dxgi/tests/device.c +++ b/dlls/dxgi/tests/device.c @@ -33,7 +33,6 @@ static IDXGIDevice *create_device(HMODULE d3d10core) HRESULT hr; hr = CreateDXGIFactory(&IID_IDXGIFactory, (void *)&factory); - ok(SUCCEEDED(hr), "CreateDXGIFactory failed, hr %#x\n", hr); if (FAILED(hr)) goto cleanup; hr = IDXGIFactory_EnumAdapters(factory, 0, &adapter);