New issue
Advanced search Search tips

Issue 715794 link

Starred by 2 users

Issue metadata

Status: Archived
Owner: ----
Closed: Aug 21
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: Windows
Pri: 3
Type: Bug



Sign in to add a comment

MonitorInfoFromHMONITOR might return arbitrary data when a display is added or removed

Project Member Reported by stanisc@chromium.org, Apr 26 2017

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;
}
 

Comment 1 by e...@chromium.org, May 1 2017

Cc: rbyers@chromium.org
 Issue 716489  has been merged into this issue.
Status: Archived (was: Untriaged)
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!
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