Ken Thomases : wineboot: Ignore 0 result from WM_QUERYENDSESSION if target window was destroyed.

Alexandre Julliard julliard at winehq.org
Fri Jan 17 11:55:32 CST 2014


Module: wine
Branch: master
Commit: a05b53894a55b8de1ecfde3815dd10628b8b05f2
URL:    http://source.winehq.org/git/wine.git/?a=commit;h=a05b53894a55b8de1ecfde3815dd10628b8b05f2

Author: Ken Thomases <ken at codeweavers.com>
Date:   Thu Jan 16 21:11:10 2014 -0600

wineboot: Ignore 0 result from WM_QUERYENDSESSION if target window was destroyed.

---

 programs/wineboot/shutdown.c |    8 ++++++++
 1 file changed, 8 insertions(+)

diff --git a/programs/wineboot/shutdown.c b/programs/wineboot/shutdown.c
index a5f5f5a..52d37e7 100644
--- a/programs/wineboot/shutdown.c
+++ b/programs/wineboot/shutdown.c
@@ -100,6 +100,14 @@ static void CALLBACK end_session_message_callback( HWND hwnd, UINT msg, ULONG_PT
                 msg == WM_QUERYENDSESSION ? "WM_QUERYENDSESSION" : (msg == WM_ENDSESSION ? "WM_ENDSESSION" : "Unknown"),
                 hwnd, lresult );
 
+    /* If the window was destroyed while the message was in its queue, SendMessageCallback()
+       calls us with a default 0 result.  Ignore it. */
+    if (!lresult && !IsWindow( hwnd ))
+    {
+        WINE_TRACE( "window was destroyed; ignoring FALSE lresult\n" );
+        lresult = TRUE;
+    }
+
     /* we only care if a WM_QUERYENDSESSION response is FALSE */
     cb_data->result = cb_data->result && lresult;
 




More information about the wine-cvs mailing list