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/user32/sysparams.c | 4 ++++ 1 file changed, 4 insertions(+)
diff --git a/dlls/user32/sysparams.c b/dlls/user32/sysparams.c index 79f938a3c20..0c0f8fac5d1 100644 --- a/dlls/user32/sysparams.c +++ b/dlls/user32/sysparams.c @@ -3369,6 +3369,7 @@ LONG WINAPI ChangeDisplaySettingsExW( LPCWSTR devname, LPDEVMODEW devmode, HWND
if (def_mode) { + memset(&dm, 0, sizeof(dm)); dm.dmSize = sizeof(dm); if (!EnumDisplaySettingsExW(devname, ENUM_REGISTRY_SETTINGS, &dm, 0)) { @@ -3428,6 +3429,8 @@ BOOL WINAPI EnumDisplaySettingsExA(LPCSTR lpszDeviceName, DWORD iModeNum, if (lpszDeviceName) RtlCreateUnicodeStringFromAsciiz(&nameW, lpszDeviceName); else nameW.Buffer = NULL;
+ memset(&devmodeW, 0, sizeof(devmodeW)); + devmodeW.dmSize = sizeof(devmodeW); ret = EnumDisplaySettingsExW(nameW.Buffer,iModeNum,&devmodeW,dwFlags); if (ret) { @@ -4808,6 +4811,7 @@ LONG WINAPI QueryDisplayConfig(UINT32 flags, UINT32 *numpathelements, DISPLAYCON &type, (BYTE *)device_name, sizeof(device_name), NULL, 0)) goto done;
+ memset(&devmode, 0, sizeof(devmode)); devmode.dmSize = sizeof(devmode); if (!EnumDisplaySettingsW(device_name, ENUM_CURRENT_SETTINGS, &devmode)) 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=76842
Your paranoid android.
=== debiant (32 bit report) ===
user32: menu.c:2337: Test failed: test 25
=== debiant (32 bit Chinese:China report) ===
user32: monitor: Timeout
=== debiant (32 bit WoW report) ===
user32: menu.c:2337: Test failed: test 25
=== debiant (64 bit WoW report) ===
user32: monitor: Timeout