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

Rein Klazes wijn at online.nl
Wed Feb 18 00:49:15 CST 2009


	modified:   dlls/user32/defwnd.c
	modified:   dlls/user32/tests/msg.c
---
 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 4824f79..4c18431 100644
--- a/dlls/user32/tests/msg.c
+++ b/dlls/user32/tests/msg.c
@@ -11339,6 +11339,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;
@@ -11421,6 +11437,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.
      */
-- 
1.5.6.5


--------------040100030504030501080103--



More information about the wine-patches mailing list