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 --- dlls/winex11.drv/settings.c | 3 +++ 1 file changed, 3 insertions(+)
diff --git a/dlls/winex11.drv/settings.c b/dlls/winex11.drv/settings.c index a64d1de6500..2d1fc7220de 100644 --- a/dlls/winex11.drv/settings.c +++ b/dlls/winex11.drv/settings.c @@ -501,6 +501,7 @@ static LONG get_display_settings(struct x11drv_display_setting **new_displays,
if (!dev_mode) { + memset(®istry_mode, 0, sizeof(registry_mode)); registry_mode.dmSize = sizeof(registry_mode); if (!EnumDisplaySettingsExW(display_device.DeviceName, ENUM_REGISTRY_SETTINGS, ®istry_mode, 0)) goto done; @@ -512,6 +513,7 @@ static LONG get_display_settings(struct x11drv_display_setting **new_displays, displays[display_idx].desired_mode = *dev_mode; if (!(dev_mode->dmFields & DM_POSITION)) { + memset(¤t_mode, 0, sizeof(current_mode)); current_mode.dmSize = sizeof(current_mode); if (!EnumDisplaySettingsExW(display_device.DeviceName, ENUM_CURRENT_SETTINGS, ¤t_mode, 0)) goto done; @@ -522,6 +524,7 @@ static LONG get_display_settings(struct x11drv_display_setting **new_displays, } else { + memset(¤t_mode, 0, sizeof(current_mode)); current_mode.dmSize = sizeof(current_mode); if (!EnumDisplaySettingsExW(display_device.DeviceName, ENUM_CURRENT_SETTINGS, ¤t_mode, 0)) goto done;
Hi,
While running your changed tests, I think I found new failures. Being a bot and all I'm not very good at pattern recognition, so I might be wrong, but could you please double-check?
Full results can be found at: https://testbot.winehq.org/JobDetails.pl?Key=76843
Your paranoid android.
=== debiant (32 bit Chinese:China report) ===
user32: monitor: Timeout
=== debiant (64 bit WoW report) ===
user32: clipboard.c:760: Test failed: 5: gle 5 clipboard.c:765: Test failed: 5.0: got 0000 instead of 0002 clipboard.c:805: Test failed: 5: gle 1418 clipboard.c:815: Test failed: 5: count 3 clipboard.c:818: Test failed: 5: gle 1418 clipboard.c:853: Test failed: 5.0: formats 00000000 have been rendered clipboard.c:858: Test failed: 5.0: formats 00000000 have been rendered clipboard.c:853: Test failed: 5.1: formats 00000000 have been rendered clipboard.c:858: Test failed: 5.1: formats 00000000 have been rendered clipboard.c:853: Test failed: 5.2: formats 00000000 have been rendered clipboard.c:858: Test failed: 5.2: formats 00000000 have been rendered