// Copyright (C) 2021 TiltedPhoques SRL. // For licensing information see LICENSE at the root of this distribution. #include #include #include #include #include #include "SupportChecks.h" namespace oobe { namespace { template using ComPtr = Microsoft::WRL::ComPtr; // TODO: requires some logging. bool TestD3D11Support() { // FIXME(Force): Ignore amd for now if (GetModuleHandleW(L"atiuxp64.dll")) return true; ComPtr device; HRESULT hr = D3D11CreateDevice(nullptr, D3D_DRIVER_TYPE_HARDWARE, nullptr, 0, nullptr, 0, D3D11_SDK_VERSION, device.GetAddressOf(), nullptr, nullptr); if (FAILED(hr)) return false; ComPtr dxgiOrig; hr = device.As(&dxgiOrig); if (FAILED(hr)) { return true; } ComPtr dxgiCheck; hr = dxgiOrig.As(&dxgiCheck); return SUCCEEDED(hr); } } // namespace // D3D11 Test CompatabilityStatus ReportModCompatabilityStatus() { if (!IsWindows8Point1OrGreater()) return CompatabilityStatus::kOldOS; /* if (!TestD3D11Support()) return CompatabilityStatus::kDX11Unsupported; */ return CompatabilityStatus::kAllGood; } } // namespace oobe