From cb85adb3670e2db464e6017d3b915cd74edd4324 Mon Sep 17 00:00:00 2001 From: Vincent Povirk Date: Thu, 22 Jul 2010 16:49:35 -0500 Subject: [PATCH 2/2] wineboot: Don't abort shutdown if we have to terminate a process. We can sometimes get a FALSE result from WM_QUERYENDSESSION as a side-effect of terminating a process. We should continue the shutdown process in this case. --- programs/wineboot/shutdown.c | 5 ++++- 1 files changed, 4 insertions(+), 1 deletions(-) diff --git a/programs/wineboot/shutdown.c b/programs/wineboot/shutdown.c index cebe16b..ac3019c 100644 --- a/programs/wineboot/shutdown.c +++ b/programs/wineboot/shutdown.c @@ -113,6 +113,7 @@ struct endtask_dlg_data { struct window_info *win; BOOL cancelled; + BOOL terminated; }; static INT_PTR CALLBACK endtask_dlg_proc( HWND hwnd, UINT msg, WPARAM wparam, LPARAM lparam ) @@ -138,6 +139,7 @@ static INT_PTR CALLBACK endtask_dlg_proc( HWND hwnd, UINT msg, WPARAM wparam, LP WINE_TRACE( "terminating process %04x\n", data->win[0].pid ); TerminateProcess( handle, 0 ); CloseHandle( handle ); + data->terminated = TRUE; } return TRUE; case MAKEWPARAM(IDCANCEL, BN_CLICKED): @@ -175,6 +177,7 @@ static LRESULT send_messages_with_timeout_dialog( cb_data->window_count = count; dlg_data.win = win; + dlg_data.terminated = FALSE; dlg_data.cancelled = FALSE; for (i = 0; i < count; i++) @@ -211,7 +214,7 @@ static LRESULT send_messages_with_timeout_dialog( } if (!cb_data->window_count) { - result = cb_data->result; + result = dlg_data.terminated || cb_data->result; HeapFree( GetProcessHeap(), 0, cb_data ); if (!result) goto cleanup; -- 1.7.0.4