[PATCH 5/9] win32u: Implement monitor registration.

Jacek Caban jacek at codeweavers.com
Thu Nov 25 08:38:24 CST 2021


On 11/25/21 9:08 AM, Zhiyi Zhang wrote:
>> +    if (!ctx->adapter_count)
>> +    {
>> +        static const struct gdi_adapter default_adapter =
>> +        {
>> +            .state_flags = DISPLAY_DEVICE_ACTIVE | DISPLAY_DEVICE_ATTACHED,
>
> DISPLAY_DEVICE_ACTIVE and DISPLAY_DEVICE_ATTACHED are for monitors. For a default GDI adapter, you probably
> want DISPLAY_DEVICE_ATTACHED_TO_DESKTOP | DISPLAY_DEVICE_PRIMARY_DEVICE | DISPLAY_DEVICE_VGA_COMPATIBLE.


I will change it.


> It's probably necessary. But without SetupAPI, I find the overall display device registration much harder to
> understand and error-prone, mostly from these NT registry calls. I wonder if the display device registration
> can be moved to somewhere that SetupAPI can be called.


The problem is that SetupAPI needs to be used by PE modules and we 
shouldn't directly call PE modules from Unix libraries. While it's not 
impossible to do such calls (or just use something like send message), 
we would still need a way to pass all those informations between Unix 
lib and PE side somehow, so an additional interface would be needed. 
Given all that, I wouldn't expect it to be pretty, so I think it's 
better to just do everything in Unix lib.


On the bright side, with those patches, we only need to implement it 
once instead of doing that in each driver.


Thanks,

Jacek




More information about the wine-devel mailing list