[PATCH v2 3/4] winex11.drv: Retrieve virtual and primary monitor rectangles from SetupAPI.
Alexandre Julliard
julliard at winehq.org
Thu Oct 31 13:33:03 CDT 2019
Zhiyi Zhang <zzhang at codeweavers.com> writes:
> +/* Update screen rect cache from SetupAPI if it's outdated, return FALSE on failure and TRUE on success */
> +static BOOL update_screen_cache(void)
> +{
> + RECT virtual_rect = {0}, primary_rect = {0}, monitor_rect;
> + SP_DEVINFO_DATA device_data = {sizeof(device_data)};
> + HDEVINFO devinfo = INVALID_HANDLE_VALUE;
> + FILETIME filetime;
> + HKEY video_key;
> + HANDLE mutex;
> + DWORD i = 0;
> + INT result;
> + DWORD type;
> + LSTATUS lr;
> + BOOL ret = FALSE;
> +
> + if (RegOpenKeyW(HKEY_LOCAL_MACHINE, video_keyW, &video_key))
> + return FALSE;
> + lr = RegQueryInfoKeyW(video_key, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, &filetime);
> + RegCloseKey(video_key);
> + if (lr)
> + return FALSE;
> +
> + EnterCriticalSection(&screen_section);
> + result = CompareFileTime(&filetime, &last_query_screen_time);
> + LeaveCriticalSection(&screen_section);
> + if (result < 1)
> + return TRUE;
That looks pretty inefficient as caching mechanism. Hopefully we can
handle that without adding multiple wineserver calls.
--
Alexandre Julliard
julliard at winehq.org
More information about the wine-devel
mailing list