Commit d7133c97 authored by Jacek Caban's avatar Jacek Caban Committed by Alexandre Julliard

user32: Invalidate cache in update_monitor_cache when modification time matches current time.

Also preserve last error. Signed-off-by: 's avatarJacek Caban <jacek@codeweavers.com> Signed-off-by: 's avatarHuw Davies <huw@codeweavers.com> Signed-off-by: 's avatarAlexandre Julliard <julliard@winehq.org>
parent f6abd9d1
......@@ -3804,14 +3804,14 @@ static BOOL update_monitor_cache(void)
BOOL ret = FALSE;
BOOL is_replica;
DWORD i = 0, j;
DWORD type;
DWORD type, error = GetLastError();
/* Update monitor cache from SetupAPI if it's outdated */
if (!video_key && RegOpenKeyW( HKEY_LOCAL_MACHINE, L"HARDWARE\\DEVICEMAP\\VIDEO", &video_key ))
return FALSE;
if (RegQueryInfoKeyW( video_key, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, &filetime ))
return FALSE;
if (CompareFileTime( &filetime, &last_query_monitors_time ) < 1)
if (CompareFileTime( &filetime, &last_query_monitors_time ) < 0)
return TRUE;
mutex = get_display_device_init_mutex();
......@@ -3879,6 +3879,7 @@ fail:
SetupDiDestroyDeviceInfoList( devinfo );
LeaveCriticalSection( &monitors_section );
release_display_device_init_mutex( mutex );
SetLastError( error );
return ret;
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment