Modify ↓
Opened on Jun 18, 2013 at 2:13:52 AM
Closed on Sep 8, 2013 at 2:24:26 PM
Last modified on Sep 8, 2013 at 3:00:02 PM
#2347 closed Bug (Fixed)
_WinAPI_GetMonitorInfo() returns incorrect data.
| Reported by: | Valik | Owned by: | |
|---|---|---|---|
| Milestone: | Future Release | Component: | Standard UDFs |
| Version: | 3.3.9.4 | Severity: | None |
| Keywords: | Cc: |
Description
The following line of _WinAPI_GetMonitorInfo() is incorrect:
If Not _WinAPI_MoveMemory(DllStructGetPtr($Result[$i]), DllStructGetPtr($tMIEX, $i + 1), 16) Then
DllStructGetPtr() is 1-indexed, not 0, so the code as originally written returns garbage. Actually it causes rcMonitor to return cbSize and the first 3 elements of rcMonitor and it causes rcWork to return rcMonitor. None of which is correct.
The fix is simple enough:
If Not _WinAPI_MoveMemory(DllStructGetPtr($Result[$i]), DllStructGetPtr($tMIEX, $i + 2), 16) Then
Better yet rewrite that part of the code to be less "clever" and more sane. Remember folks, clean and working code is better than clever broken code.
Attachments (0)
Change History (4)
comment:1 by , on Jun 19, 2013 at 7:28:10 AM
| Resolution: | → Fixed |
|---|---|
| Status: | new → closed |
comment:2 by , on Sep 8, 2013 at 2:21:02 PM
| Resolution: | Fixed |
|---|---|
| Status: | closed → reopened |
comment:3 by , on Sep 8, 2013 at 2:24:26 PM
| Resolution: | → Fixed |
|---|---|
| Status: | reopened → closed |
Note:
See TracTickets
for help on using tickets.

Wrong editing rev 7759 really fix it