From 2eb46bb464f2c899ad81ee0b3890d40eaa611e9b Mon Sep 17 00:00:00 2001 From: Alexandre Julliard Date: Fri, 7 Apr 2006 20:26:47 +0200 Subject: [PATCH] explorer: Don't use ExitWindows on shutdown. ExitWindows kills all current processes and that creates a race with newly started processes. Instead, simply exit and let the new process create a new explorer. --- programs/explorer/desktop.c | 4 ++++ server/window.c | 2 +- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/programs/explorer/desktop.c b/programs/explorer/desktop.c index 557a817e59c..f2a019cd0ff 100644 --- a/programs/explorer/desktop.c +++ b/programs/explorer/desktop.c @@ -39,6 +39,10 @@ static LRESULT WINAPI desktop_wnd_proc( HWND hwnd, UINT message, WPARAM wp, LPAR if ((wp & 0xfff0) == SC_CLOSE) ExitWindows( 0, 0 ); return 0; + case WM_CLOSE: + PostQuitMessage(0); + return 0; + case WM_SETCURSOR: return (LRESULT)SetCursor( LoadCursorA( 0, (LPSTR)IDC_ARROW ) ); diff --git a/server/window.c b/server/window.c index ca1be13f90d..825479325ec 100644 --- a/server/window.c +++ b/server/window.c @@ -363,7 +363,7 @@ struct process *get_top_window_owner( struct desktop *desktop ) void close_desktop_window( struct desktop *desktop ) { struct window *win = desktop->top_window; - if (win && win->thread) post_message( win->handle, WM_SYSCOMMAND, SC_CLOSE, 0 ); + if (win && win->thread) post_message( win->handle, WM_CLOSE, 0, 0 ); } /* create a new window structure (note: the window is not linked in the window tree) */ -- 2.11.4.GIT