Module: wine Branch: stable Commit: 20a1bc4f0c77d219b40a73a8a2ee68a15bf54d6d URL: http://source.winehq.org/git/wine.git/?a=commit;h=20a1bc4f0c77d219b40a73a8a2...
Author: Vincent Povirk vincent@codeweavers.com Date: Thu Jul 22 16:49:35 2010 -0500
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. (cherry picked from commit da8904d150694ba82b201ec72e2e94cba9dd4475)
---
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;