Zhiyi Zhang (@zhiyi) commented about dlls/win32u/sysparams.c:
NTSTATUS WINAPI NtGdiDdDDIEnumAdapters2( D3DKMT_ENUMADAPTERS2 *desc ) { D3DKMT_OPENADAPTERFROMLUID open_adapter_from_luid; - static const ULONG max_adapters = 34; + struct gpu *gpu, *current_gpus[34]; D3DKMT_CLOSEADAPTER close_adapter; NTSTATUS status = STATUS_SUCCESS; - ULONG idx = 0, count; - struct gpu *gpu; + UINT idx = 0, count = 0;
TRACE( "(%p)\n", desc );
if (!desc) return STATUS_INVALID_PARAMETER;
- if (!desc->pAdapters) Why do you need to move the !desc->pAdapters check? The patch would be cleaner if you don't move it. It will also save unnecessary lock_display_devices()/unlock_display_devices().
-- https://gitlab.winehq.org/wine/wine/-/merge_requests/5306#note_65957