Skip to content

Commit

Permalink
Bug 1160295 - DisplayLink (dlumd10.dll, dlumd11.dll) Startup crash.
Browse files Browse the repository at this point in the history
  • Loading branch information
InternalError503 committed Aug 13, 2015
1 parent 2bef378 commit 54c12df
Showing 1 changed file with 12 additions and 3 deletions.
15 changes: 12 additions & 3 deletions gfx/thebes/gfxWindowsPlatform.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1709,7 +1709,7 @@ gfxWindowsPlatform::GetDXGIAdapter()
return mAdapter;
}

bool DoesD3D11DeviceWork(ID3D11Device *device)
bool CouldD3D11DeviceWork()
{
static bool checked = false;
static bool result = false;
Expand Down Expand Up @@ -1879,6 +1879,11 @@ gfxWindowsPlatform::InitD3D11Devices()
if (InSafeMode()) {
return;
}

if (!CouldD3D11DeviceWork()) {
return;
}


bool useWARP = false;
bool allowWARP = false;
Expand Down Expand Up @@ -1965,7 +1970,7 @@ gfxWindowsPlatform::InitD3D11Devices()
adapter = nullptr;
}

if (FAILED(hr) || !DoesD3D11DeviceWork(mD3D11Device)) {
if (FAILED(hr)) {
gfxCriticalError() << "D3D11 device creation failed" << hexa(hr);
if (gfxPrefs::LayersD3D11DisableWARP()) {
return;
Expand Down Expand Up @@ -2073,6 +2078,10 @@ gfxWindowsPlatform::InitD3D11Devices()
TemporaryRef<ID3D11Device>
gfxWindowsPlatform::CreateD3D11DecoderDevice()
{
if (!CouldD3D11DeviceWork()) {
return nullptr;
}

nsModuleHandle d3d11Module(LoadLibrarySystem32(L"d3d11.dll"));
decltype(D3D11CreateDevice)* d3d11CreateDevice = (decltype(D3D11CreateDevice)*)
GetProcAddress(d3d11Module, "D3D11CreateDevice");
Expand Down Expand Up @@ -2110,7 +2119,7 @@ gfxWindowsPlatform::CreateD3D11DecoderDevice()
return nullptr;
}

if (FAILED(hr) || !DoesD3D11DeviceWork(device)) {
if (FAILED(hr)) {
return nullptr;
}

Expand Down

0 comments on commit 54c12df

Please sign in to comment.