Commit 23ce18d5 authored by Zhiyi Zhang's avatar Zhiyi Zhang Committed by Alexandre Julliard

user32: Always wait for the desktop process to be ready in load_desktop_driver().

Having a __wine_display_device_guid property in the desktop window only guarantees that the window is created. Explorer.exe still has to finish setting up virtual desktop, display settings etc. load_desktop_driver() needs to make sure that the desktop initialization is done before allowing applications to call user32 driver functions. Otherwise, they might get incorrect data. This race condition became apparent after aadae4d1, which adds ~100ms to the initialization process. Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=49762Signed-off-by: 's avatarZhiyi Zhang <zzhang@codeweavers.com> Signed-off-by: 's avatarAlexandre Julliard <julliard@winehq.org>
parent c0ab7af1
......@@ -59,17 +59,14 @@ static BOOL load_desktop_driver( HWND hwnd, HMODULE *module )
DWORD size;
WCHAR path[MAX_PATH];
WCHAR key[ARRAY_SIZE(key_pathW) + ARRAY_SIZE(displayW) + 40];
UINT guid_atom = HandleToULong( GetPropW( hwnd, display_device_guid_propW ));
UINT guid_atom;
USER_CheckNotLock();
strcpy( driver_load_error, "The explorer process failed to start." ); /* default error */
SendMessageW( hwnd, WM_NULL, 0, 0 ); /* wait for the desktop process to be ready */
if (!guid_atom)
{
SendMessageW( hwnd, WM_NULL, 0, 0 ); /* wait for the desktop process to be ready */
guid_atom = HandleToULong( GetPropW( hwnd, display_device_guid_propW ));
}
guid_atom = HandleToULong( GetPropW( hwnd, display_device_guid_propW ));
memcpy( key, key_pathW, sizeof(key_pathW) );
if (!GlobalGetAtomNameW( guid_atom, key + strlenW(key), 40 )) return 0;
strcatW( key, displayW );
......
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