MonitorInfoFromHMONITOR might return arbitrary data when a display is added or removed |
||
Issue description
When monitor configuration is changing (i.e. a monitor is added or removed) it looks like the driver gets reset and if GetMonitorInfo is called at that time it would return FALSE and MONITORINFO struct would contain garbage.
This means that the code below might return a MONITORINFOEX struct containing an arbitrary data.
Please investigate if that might cause any unpredictable issues.
At a minimum this code should zero the struct.
MONITORINFOEX MonitorInfoFromHMONITOR(HMONITOR monitor) {
MONITORINFOEX monitor_info;
::ZeroMemory(&monitor_info, sizeof(monitor_info));
monitor_info.cbSize = sizeof(monitor_info);
::GetMonitorInfo(monitor, &monitor_info);
return monitor_info;
}
,
Aug 21
Archiving old bugs that haven't been actively assigned in over a year. If you feel this issue should still be addressed, feel free to reopen it or to file a new issue. Thanks!
,
Aug 21
Archiving old bugs that haven't been actively assigned in over a year. If you feel this issue should still be addressed, feel free to reopen it or to file a new issue. Thanks! |
||
►
Sign in to add a comment |
||
Comment 1 by e...@chromium.org
, May 1 2017