Re: [PATCH v3 0/3] MR4857: gdi32,win32u: Implement D3DKMTEnumAdapters2.
19 Jan
2024
19 Jan
'24
4:03 a.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
701
Age (days ago)
701
Last active (days ago)
0 comments
1 participants
participants (1)
-
Zhiyi Zhang (@zhiyi)