dxgi: Don't crash and just skip the tests if glX in not available.

This commit is contained in:
Huw Davies 2008-12-03 13:33:32 +00:00 committed by Alexandre Julliard
parent ba3054b60e
commit 2392214427
2 changed files with 6 additions and 1 deletions

View File

@ -97,6 +97,12 @@ HRESULT WINAPI CreateDXGIFactory(REFIID riid, void **factory)
EnterCriticalSection(&dxgi_cs); EnterCriticalSection(&dxgi_cs);
object->wined3d = WineDirect3DCreate(10, (IUnknown *)object); 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); object->adapter_count = IWineD3D_GetAdapterCount(object->wined3d);
LeaveCriticalSection(&dxgi_cs); LeaveCriticalSection(&dxgi_cs);

View File

@ -33,7 +33,6 @@ static IDXGIDevice *create_device(HMODULE d3d10core)
HRESULT hr; HRESULT hr;
hr = CreateDXGIFactory(&IID_IDXGIFactory, (void *)&factory); hr = CreateDXGIFactory(&IID_IDXGIFactory, (void *)&factory);
ok(SUCCEEDED(hr), "CreateDXGIFactory failed, hr %#x\n", hr);
if (FAILED(hr)) goto cleanup; if (FAILED(hr)) goto cleanup;
hr = IDXGIFactory_EnumAdapters(factory, 0, &adapter); hr = IDXGIFactory_EnumAdapters(factory, 0, &adapter);