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 );
if (modes) memcpy( modes, adapter->modes, adapter->mode_count * size );
I think you can avoid the memory copying here as well.