So that Wine doesn't have to send an extra WM_NULL message when wait_graphics_driver_ready() is later called in EnumDisplayDevicesW(). Also, it avoids a deadlock when wait_graphics_driver_ready() is used in later patches.
Signed-off-by: Zhiyi Zhang zzhang@codeweavers.com --- dlls/user32/driver.c | 2 +- dlls/user32/sysparams.c | 2 +- dlls/user32/user_private.h | 1 + 3 files changed, 3 insertions(+), 2 deletions(-)
diff --git a/dlls/user32/driver.c b/dlls/user32/driver.c index 1c3b62eff2b..87c8cd621b3 100644 --- a/dlls/user32/driver.c +++ b/dlls/user32/driver.c @@ -55,7 +55,7 @@ static BOOL load_desktop_driver( HWND hwnd, HMODULE *module ) 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 */ + wait_graphics_driver_ready();
guid_atom = HandleToULong( GetPropW( hwnd, L"__wine_display_device_guid" )); lstrcpyW( key, L"System\CurrentControlSet\Control\Video\{" ); diff --git a/dlls/user32/sysparams.c b/dlls/user32/sysparams.c index 55d6d7e53a7..0b4dbfc2d78 100644 --- a/dlls/user32/sysparams.c +++ b/dlls/user32/sysparams.c @@ -583,7 +583,7 @@ static void release_display_device_init_mutex( HANDLE mutex ) }
/* Wait until graphics driver is loaded by explorer */ -static void wait_graphics_driver_ready(void) +void wait_graphics_driver_ready(void) { static BOOL ready = FALSE;
diff --git a/dlls/user32/user_private.h b/dlls/user32/user_private.h index db082462f1b..974d18be482 100644 --- a/dlls/user32/user_private.h +++ b/dlls/user32/user_private.h @@ -258,6 +258,7 @@ extern void move_window_bits( HWND hwnd, struct window_surface *old_surface, extern void move_window_bits_parent( HWND hwnd, HWND parent, const RECT *window_rect, const RECT *valid_rects ) DECLSPEC_HIDDEN; extern void update_window_state( HWND hwnd ) DECLSPEC_HIDDEN; +extern void wait_graphics_driver_ready(void) DECLSPEC_HIDDEN; extern void *get_hook_proc( void *proc, const WCHAR *module, HMODULE *free_module ) DECLSPEC_HIDDEN; extern RECT get_virtual_screen_rect(void) DECLSPEC_HIDDEN; extern LRESULT call_current_hook( HHOOK hhook, INT code, WPARAM wparam, LPARAM lparam ) DECLSPEC_HIDDEN;