Zhiyi Zhang (@zhiyi) commented about dlls/win32u/sysparams.c:
{ lstrcpyW( device_name, adapter->dev.device_name ); lstrcpyW( adapter_path, adapter->config_key );
size = sizeof(DEVMODEW) + adapter->modes[0].dmDriverExtra;
/* allocate an extra mode for easier iteration */
modes = calloc( adapter->mode_count + 1, size );
This memory copy could be avoided when index is ENUM_CURRENT_SETTINGS or ENUM_REGISTRY_SETTINGS.