Fix dxva2 arg: pass PHYSICAL_MONITOR array directly (not byref) for GetPhysicalMonitorsFromHMONITOR/DestroyPhysicalMonitors

This commit is contained in:
Hermes Agent committed 2026-09-16 17:03:43 +02:00
1 parent d0f6fd8818
commit bca41eadc4
1 file changed
+2 -2
+2 -2
View File
@@ -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 = []