explorer: 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: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
Zhiyi Zhang 2020-08-11 18:16:33 +08:00 committed by Alexandre Julliard
parent 6185252bbc
commit c9d2b62926
1 changed files with 1 additions and 0 deletions

View File

@ -889,6 +889,7 @@ static void initialize_display_settings(void)
/* Store current display mode in the registry */ /* Store current display mode in the registry */
ddW.cb = sizeof(ddW); ddW.cb = sizeof(ddW);
memset(&dmW, 0, sizeof(dmW));
dmW.dmSize = sizeof(dmW); dmW.dmSize = sizeof(dmW);
while (EnumDisplayDevicesW( NULL, i++, &ddW, 0 )) while (EnumDisplayDevicesW( NULL, i++, &ddW, 0 ))
{ {