From 2f28a96f6aacce4f7e0f1b7f7acb482740f02f47 Mon Sep 17 00:00:00 2001 From: rustdesk Date: Wed, 2 Sep 2026 16:14:22 +0800 Subject: [PATCH] scrap: keep enumerate_output6's both-or-neither promise when IDXGIOutput6 is missing Review nit: a matched output whose IDXGIOutput6 query fails returned the fresh factory next to a null output, which let the constructor pair a current factory with the capturer's fallback output. Return neither in that case so the next refresh enumerates again. Co-Authored-By: Claude Fable 5.1 Claude-Session: https://claude.ai/code/session_01RLb1dNdhFqUQExJPANjo1F --- libs/scrap/src/dxgi/hdr.rs | 3 +++ 1 file changed, 3 insertions(+) diff --git a/libs/scrap/src/dxgi/hdr.rs b/libs/scrap/src/dxgi/hdr.rs index 5aa9b44e8..52f5ab21e 100644 --- a/libs/scrap/src/dxgi/hdr.rs +++ b/libs/scrap/src/dxgi/hdr.rs @@ -444,6 +444,9 @@ unsafe fn enumerate_output6( let mut desc: DXGI_OUTPUT_DESC = mem::zeroed(); if (*output.0).GetDesc(&mut desc) == S_OK && wide_eq(&desc.DeviceName, device_name) { let output6 = query_output6(output.0 as *mut IUnknown); + if output6.is_null() { + return (ComPtr(ptr::null_mut()), ComPtr(ptr::null_mut())); + } return (factory, output6); } }