Zhiyi Zhang (@zhiyi) commented about dlls/win32u/sysparams.c:
if (!NtUserEnumDisplaySettings( devname, ENUM_CURRENT_SETTINGS, ¤t_mode, 0 )) current_mode.dmSize = 0; if (!(devmode = validate_display_settings( &default_mode, ¤t_mode, devmode ))) return DISP_CHANGE_BADMODE;
- ret = user_driver->pChangeDisplaySettingsEx( device_name, devmode, hwnd, flags, lparam );
- if (ret != DISP_CHANGE_SUCCESSFUL)
ERR( "Changing %s display settings returned %d.\n", debugstr_us(devname), ret );
- ret = user_driver->pChangeDisplaySettingsEx( device_name, devmode, hwnd, flags | CDS_TEST, lparam );
- if (!ret && (flags & CDS_UPDATEREGISTRY) && !write_registry_settings( adapter_path, devmode )) ret = DISP_CHANGE_NOTUPDATED;
- else if (flags & (CDS_TEST | CDS_NORESET)) ret = DISP_CHANGE_SUCCESSFUL;
- else ret = user_driver->pChangeDisplaySettingsEx( device_name, devmode, hwnd, flags, lparam );
I think you can remove CDS_UPDATEREGISTRY here. Otherwise, user_driver->pChangeDisplaySettingsEx() will try to find the full mode again.