Fix dxva2 arg: pass PHYSICAL_MONITOR array directly (not byref) for GetPhysicalMonitorsFromHMONITOR/DestroyPhysicalMonitors
This commit is contained in:
1 parent
d0f6fd8818
commit
bca41eadc4
1 file changed
+2
-2
+2
-2
@@ -66,7 +66,7 @@ class BrightnessController:
|
|||||||
def _open_physical(self, hmon):
|
def _open_physical(self, hmon):
|
||||||
dx = ctypes.windll.dxva2
|
dx = ctypes.windll.dxva2
|
||||||
arr = (BrightnessController.PHYSICAL_MONITOR * 1)()
|
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 None
|
||||||
return arr[0].hPhysicalMonitor
|
return arr[0].hPhysicalMonitor
|
||||||
|
|
||||||
@@ -89,7 +89,7 @@ class BrightnessController:
|
|||||||
dx = ctypes.windll.dxva2
|
dx = ctypes.windll.dxva2
|
||||||
arr = (BrightnessController.PHYSICAL_MONITOR * 1)()
|
arr = (BrightnessController.PHYSICAL_MONITOR * 1)()
|
||||||
arr[0].hPhysicalMonitor = handle
|
arr[0].hPhysicalMonitor = handle
|
||||||
dx.DestroyPhysicalMonitors(1, ctypes.byref(arr))
|
dx.DestroyPhysicalMonitors(1, arr)
|
||||||
|
|
||||||
def _build(self):
|
def _build(self):
|
||||||
self.targets = []
|
self.targets = []
|
||||||
|
|||||||
Reference in new issue
Block a user