winemac.drv: Zero initialize DEVMODE before passing it to EnumDisplaySettings().

EnumDisplaySettings() on Wine does not write beyond the end of DEVMODE because it doesn't use
dmDriverExtra currently, but this implementation detail should not be relied on.

Signed-off-by: Zhiyi Zhang <zzhang@codeweavers.com>
Signed-off-by: Ken Thomases <ken@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
Zhiyi Zhang 2020-08-11 18:16:21 +08:00 committed by Alexandre Julliard
parent 440fab3870
commit 6185252bbc
1 changed files with 1 additions and 0 deletions

View File

@ -847,6 +847,7 @@ LONG CDECL macdrv_ChangeDisplaySettingsEx(LPCWSTR devname, LPDEVMODEW devmode,
if (!devname && !devmode)
{
memset(&default_mode, 0, sizeof(default_mode));
default_mode.dmSize = sizeof(default_mode);
if (!EnumDisplaySettingsExW(primary_adapter, ENUM_REGISTRY_SETTINGS, &default_mode, 0))
{