From f7aefadd1f70d49c958990c429bdd5e0e2aa8048 Mon Sep 17 00:00:00 2001 From: Zhiyi Zhang Date: Tue, 21 Jul 2020 14:49:25 +0800 Subject: [PATCH] user32: Trace ChangeDisplaySettingsExW() results. Signed-off-by: Zhiyi Zhang Signed-off-by: Alexandre Julliard --- dlls/user32/sysparams.c | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/dlls/user32/sysparams.c b/dlls/user32/sysparams.c index 6c0c3e76db7..61cd06f6911 100644 --- a/dlls/user32/sysparams.c +++ b/dlls/user32/sysparams.c @@ -3310,12 +3310,18 @@ LONG WINAPI ChangeDisplaySettingsExW( LPCWSTR devname, LPDEVMODEW devmode, HWND WCHAR primary_adapter[CCHDEVICENAME]; BOOL def_mode = TRUE; DEVMODEW dm; + LONG ret; TRACE("%s %p %p %#x %p\n", debugstr_w(devname), devmode, hwnd, flags, lparam); TRACE("flags=%s\n", _CDS_flags(flags)); if (!devname && !devmode) - return USER_Driver->pChangeDisplaySettingsEx(NULL, NULL, hwnd, flags, lparam); + { + ret = USER_Driver->pChangeDisplaySettingsEx(NULL, NULL, hwnd, flags, lparam); + if (ret != DISP_CHANGE_SUCCESSFUL) + ERR("Restoring all displays to their registry settings returned %d.\n", ret); + return ret; + } if (!devname && devmode) { @@ -3359,7 +3365,10 @@ LONG WINAPI ChangeDisplaySettingsExW( LPCWSTR devname, LPDEVMODEW devmode, HWND return DISP_CHANGE_BADMODE; } - return USER_Driver->pChangeDisplaySettingsEx(devname, devmode, hwnd, flags, lparam); + ret = USER_Driver->pChangeDisplaySettingsEx(devname, devmode, hwnd, flags, lparam); + if (ret != DISP_CHANGE_SUCCESSFUL) + ERR("Changing %s display settings returned %d.\n", wine_dbgstr_w(devname), ret); + return ret; }