Rein Klazes : user32: Do not handle WM_ENDSESSION in DefWindowProc() with test.

Alexandre Julliard julliard at winehq.org
Wed Feb 18 10:15:28 CST 2009


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

Author: Rein Klazes <wijn at online.nl>
Date:   Wed Feb 18 07:49:15 2009 +0100

user32: Do not handle WM_ENDSESSION in DefWindowProc() with test.

---

 dlls/user32/defwnd.c    |    5 -----
 dlls/user32/tests/msg.c |   17 +++++++++++++++++
 2 files changed, 17 insertions(+), 5 deletions(-)

diff --git a/dlls/user32/defwnd.c b/dlls/user32/defwnd.c
index c4951df..38d8def 100644
--- a/dlls/user32/defwnd.c
+++ b/dlls/user32/defwnd.c
@@ -662,11 +662,6 @@ static LRESULT DEFWND_DefWinProc( HWND hwnd, UINT msg, WPARAM wParam, LPARAM lPa
     case WM_QUERYENDSESSION:
         return 1;
 
-    case WM_ENDSESSION:
-        if (wParam)
-            PostQuitMessage(0);
-        return 0;
-
     case WM_SETICON:
         {
             HICON ret;
diff --git a/dlls/user32/tests/msg.c b/dlls/user32/tests/msg.c
index 584cc4f..147f5b7 100644
--- a/dlls/user32/tests/msg.c
+++ b/dlls/user32/tests/msg.c
@@ -11351,6 +11351,22 @@ static void test_paintingloop(void)
     DestroyWindow(hwnd);
 }
 
+static void test_defwinproc(void)
+{
+    HWND hwnd;
+    MSG msg;
+    int gotwmquit = FALSE;
+    hwnd = CreateWindowExA(0, "static", "test_defwndproc", WS_POPUP, 0,0,0,0,0,0,0, NULL);
+    assert(hwnd);
+    DefWindowProcA( hwnd, WM_ENDSESSION, 1, 0);
+    while (PeekMessageA( &msg, 0, 0, 0, PM_REMOVE )) {
+        if( msg.message == WM_QUIT) gotwmquit = TRUE;
+        DispatchMessageA( &msg );
+    }
+    ok( gotwmquit == FALSE, "Unexpected WM_QUIT message!\n");
+    DestroyWindow( hwnd);
+}
+
 START_TEST(msg)
 {
     BOOL ret;
@@ -11432,6 +11448,7 @@ START_TEST(msg)
     test_dbcs_wm_char();
     test_menu_messages();
     test_paintingloop();
+    test_defwinproc();
     /* keep it the last test, under Windows it tends to break the tests
      * which rely on active/foreground windows being correct.
      */




More information about the wine-cvs mailing list