https://bugs.winehq.org/show_bug.cgi?id=52508
Bug ID: 52508 Summary: EnumDisplayDevices() fails in obscure ways on 32-bit arch when 64-bit Vulkan is present but 32-bit is missing Product: Wine Version: 7.1 Hardware: x86-64 OS: Linux Status: NEW Severity: normal Priority: P2 Component: user32 Assignee: wine-bugs@winehq.org Reporter: z.figura12@gmail.com CC: jacek@codeweavers.com, zzhang@codeweavers.com Distribution: ---
FWIW, this is easy to trigger by running 32-bit ddraw:ddraw1.
I'm fine with calling this case "user error", but the problem is, it's not that hard to be missing Vulkan drivers for one architecture, while debugging this took way too long. It'd be nice to at least have some way of printing a message.
The basic problem is that when Vulkan is present we retrieve the PCI IDs from it, but when it's absent we set them to zero. As a result we end up creating two different sets of registry entries, but only the 64-bit one gets populated via initialize_display_settings(). EnumDisplayDevices() tries to access it and finds the GPU entries empty.
This does lead me to ask: can we avoid querying GPUs in each process? Can we just let explorer.exe manage them and get our information from there?
CC'ing Jacek and Zhiyi as both having worked closely with this code.