18 Jan
2024
18 Jan
'24
10:03 p.m.
Zhiyi Zhang (@zhiyi) commented about dlls/win32u/sysparams.c:
+ if (!lock_display_devices()) return STATUS_UNSUCCESSFUL; + + if ((count = list_count( &adapters )) > max_adapters) + { + WARN( "Too many adapters (%u), only up to %u can be enumerated.\n", + (unsigned int)count, (unsigned int)max_adapters ); + count = max_adapters; + } + + if (count > desc->NumAdapters) + { + status = STATUS_BUFFER_TOO_SMALL; + goto done; + } + + if (!(adapter_infos = calloc( count, sizeof(*adapter_infos) ))) D3DKMT_ENUMADAPTERS2 already has an array for this. I think you can avoid this memory allocation.
-- https://gitlab.winehq.org/wine/wine/-/merge_requests/4857#note_58131