Alexandre Julliard : explorer: Don't use ExitWindows on shutdown.
Alexandre Julliard
julliard at wine.codeweavers.com
Fri Apr 7 13:31:00 CDT 2006
Module: wine
Branch: refs/heads/master
Commit: 2eb46bb464f2c899ad81ee0b3890d40eaa611e9b
URL: http://source.winehq.org/git/?p=wine.git;a=commit;h=2eb46bb464f2c899ad81ee0b3890d40eaa611e9b
Author: Alexandre Julliard <julliard at winehq.org>
Date: Fri Apr 7 20:26:47 2006 +0200
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 deletions(-)
diff --git a/programs/explorer/desktop.c b/programs/explorer/desktop.c
index 557a817..f2a019c 100644
--- a/programs/explorer/desktop.c
+++ b/programs/explorer/desktop.c
@@ -39,6 +39,10 @@ static LRESULT WINAPI desktop_wnd_proc(
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 ca1be13..8254793 100644
--- a/server/window.c
+++ b/server/window.c
@@ -363,7 +363,7 @@ struct process *get_top_window_owner( st
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) */
More information about the wine-cvs
mailing list