[host] d12: handle IDXGIAdapter::EnumOutputs errors

Before, the code treated any errors other than DXGI_ERROR_NOT_FOUND as if
they were successes, which is incorrect.
This commit is contained in:
Quantum authored and Geoffrey McRae committed 2026-06-17 21:43:19 +10:00
1 parent 4bb2c58fb6
commit 1f3051e81a
1 file changed
+10 -4
+10 -4
View File
@@ -987,11 +987,17 @@ static bool d12_enumerateDevices(
DEBUG_INFO("Adapter matched, trying: %ls", adapterDesc.Description);
}
for(
int n = 0;
IDXGIAdapter1_EnumOutputs(*adapter, n, output) != DXGI_ERROR_NOT_FOUND;
++n, comRef_release(output))
for (int n = 0; ; ++n, comRef_release(output))
{
HRESULT hr = IDXGIAdapter1_EnumOutputs(*adapter, n, output);
if (FAILED(hr))
{
if (hr != DXGI_ERROR_NOT_FOUND)
DEBUG_WINERROR("Failed to IDXGIAdapter::EnumOutputs", hr);
break;
}
IDXGIOutput_GetDesc(*output, &outputDesc);
if (optOutput)