From d69340cd6bb6e0385f9461efb72af360d1d94947 Mon Sep 17 00:00:00 2001 From: Rein Klazes Date: Wed, 18 Feb 2009 07:49:15 +0100 Subject: [PATCH] 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 c4951df5dd0..38d8def4e04 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 584cc4fe928..147f5b7d9fb 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. */