Zhiyi Zhang (@zhiyi) commented about dlls/win32u/sysparams.c:
return STATUS_INVALID_PARAMETER;
return STATUS_NOT_SUPPORTED;
if (!lock_display_devices()) return STATUS_UNSUCCESSFUL;
memset( &preferred_mode->width, 0, sizeof(*preferred_mode) - offsetof(DISPLAYCONFIG_TARGET_PREFERRED_MODE, width) );
LIST_FOR_EACH_ENTRY(monitor, &monitors, struct monitor, entry)
{
if (preferred_mode->header.id != monitor->output_id) continue;
if (memcmp( &preferred_mode->header.adapterId, &monitor->adapter->gpu_luid,
sizeof(monitor->adapter->gpu_luid) ))
continue;
preferred_mode->width = monitor->rc_monitor.right - monitor->rc_monitor.left;
preferred_mode->height = monitor->rc_monitor.bottom - monitor->rc_monitor.top;
I don't suppose this is what Windows does. But I guess that's why it's a semi-stub. You should be able to read the preferred timing mode from EDID. If that fails, you can fall back to the maximum resolution with the highest frequency. Also, it would be nice to have a test.