From 19dc591f1962da2f96415707f9e967232b00e0f3 Mon Sep 17 00:00:00 2001 From: oiupoyt Date: Fri, 4 Sep 2026 08:00:21 +0530 Subject: [PATCH] Fix Windows DXGI output descriptor API and enable Win32_Graphics_Gdi feature --- Cargo.lock | 2 +- Cargo.toml | 3 ++- src/capture/windows.rs | 3 +-- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 09e6662..2c1ccef 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -4506,7 +4506,7 @@ dependencies = [ "serde", "serde_json", "tokio", - "windows 0.62.2", + "windows 0.58.0", "xcb", ] diff --git a/Cargo.toml b/Cargo.toml index 9d0cc3c..0555cdd 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -31,12 +31,13 @@ xcb = { version = "1.7.1", features = ["shm", "xfixes"] } memmap2 = "0.9.11" [target.'cfg(target_os = "windows")'.dependencies] -windows = { version = "0.62.2", features = [ +windows = { version = "0.58.0", features = [ "Win32_Foundation", "Win32_Graphics_Direct3D", "Win32_Graphics_Direct3D11", "Win32_Graphics_Dxgi", "Win32_Graphics_Dxgi_Common", + "Win32_Graphics_Gdi", "Win32_System_Com", "Win32_UI_WindowsAndMessaging", "Win32_System_Threading", diff --git a/src/capture/windows.rs b/src/capture/windows.rs index 2067e7f..d3e95e5 100644 --- a/src/capture/windows.rs +++ b/src/capture/windows.rs @@ -56,8 +56,7 @@ impl WindowsCapture { let output = adapter.EnumOutputs(0)?; let output1: IDXGIOutput1 = output.cast()?; - let mut desc = DXGI_OUTPUT_DESC::default(); - output.GetDesc(&mut desc)?; + let desc = output.GetDesc()?; let width = (desc.DesktopCoordinates.right - desc.DesktopCoordinates.left) as u32; let height = (desc.DesktopCoordinates.bottom - desc.DesktopCoordinates.top) as u32;