From bca41eadc43bd2a0de6cd9e8f2145c31d2f54830 Mon Sep 17 00:00:00 2001 From: Hermes Agent Date: Wed, 16 Sep 2026 17:03:43 +0200 Subject: [PATCH] Fix dxva2 arg: pass PHYSICAL_MONITOR array directly (not byref) for GetPhysicalMonitorsFromHMONITOR/DestroyPhysicalMonitors --- black_screen_dim.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/black_screen_dim.py b/black_screen_dim.py index 5151e5b..66e16df 100644 --- a/black_screen_dim.py +++ b/black_screen_dim.py @@ -66,7 +66,7 @@ class BrightnessController: def _open_physical(self, hmon): dx = ctypes.windll.dxva2 arr = (BrightnessController.PHYSICAL_MONITOR * 1)() - if not dx.GetPhysicalMonitorsFromHMONITOR(int(hmon), 1, ctypes.byref(arr)): + if not dx.GetPhysicalMonitorsFromHMONITOR(int(hmon), 1, arr): return None return arr[0].hPhysicalMonitor @@ -89,7 +89,7 @@ class BrightnessController: dx = ctypes.windll.dxva2 arr = (BrightnessController.PHYSICAL_MONITOR * 1)() arr[0].hPhysicalMonitor = handle - dx.DestroyPhysicalMonitors(1, ctypes.byref(arr)) + dx.DestroyPhysicalMonitors(1, arr) def _build(self): self.targets = []